@moonshot-ai/kimi-code 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +2501 -1111
- package/dist-web/assets/{CodeBlockNode-JigiL_d4.js → CodeBlockNode-DDlAJrwY.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-CZB03k-a.js → CodeBlockShell.vue_vue_type_style_index_0_lang-DsCFStZn.js} +1 -1
- package/dist-web/assets/{DesignSystemView-B-05E4V9.js → DesignSystemView-BbwRX2u4.js} +1 -1
- package/dist-web/assets/{Tooltip-Cw3lx-z8.js → Tooltip-BR3ab6GW.js} +1 -1
- package/dist-web/assets/{arc-D2vJFF6c.js → arc-BhuMeKav.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-Df1UeK5E.js → architectureDiagram-3BPJPVTR-BnVP5dyo.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-Dgdf-zAM.js → blockDiagram-GPEHLZMM-CSgMO2Ha.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-CVS7v_bq.js → c4Diagram-AAUBKEIU-BSAec2JJ.js} +1 -1
- package/dist-web/assets/channel-CVqhQnas.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-DhINJh7R.js → chunk-2J33WTMH-CWZ6e0xX.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-CR40QGad.js → chunk-4BX2VUAB-D85JgHDt.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DPUxa6z0.js → chunk-55IACEB6-CRAS3mDv.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-BWvX468K.js → chunk-727SXJPM-L0fqaAlt.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-DyFilYHM.js → chunk-AQP2D5EJ-C15Xm2e2.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-Bg8gv0kQ.js → chunk-FMBD7UC4-BDbWvCMt.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-CgyBSWHA.js → chunk-ND2GUHAM-DSzhcCso.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-DvzUq1dT.js → chunk-QZHKN3VN-FFne1CzC.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-D1VGOBF6.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-D1VGOBF6.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-LU19ShHC.js → cose-bilkent-S5V4N54A-CjO7E22T.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-DiilOzYU.js → dagre-BM42HDAG-BWYtcSBE.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-Dq4mZYTA.js → diagram-2AECGRRQ-DyMLsE8L.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-BMxBErB7.js → diagram-5GNKFQAL-Cd6Po60W.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-Dl1uwLTa.js → diagram-KO2AKTUF-CNupkUrU.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-BLV66BdW.js → diagram-LMA3HP47-DoAx9YOA.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BDaRMm08.js → diagram-OG6HWLK6-CqrQtLGQ.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-De2es75Z.js → erDiagram-TEJ5UH35-X-6af5GI.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-DclyVvkE.js → flowDiagram-I6XJVG4X-DfhjR7Ov.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-D0Q-Ia-a.js → ganttDiagram-6RSMTGT7-DFHQfE0q.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-4e9vXj8W.js → gitGraphDiagram-PVQCEYII-DOryPD-X.js} +1 -1
- package/dist-web/assets/{index-BBWUkRCO.js → index-C9lkMths.js} +1 -1
- package/dist-web/assets/{index-CR1e9nsD.js → index-DQ5XP4c3.js} +2 -2
- package/dist-web/assets/index-Dy7xs5tu.js +325 -0
- package/dist-web/assets/{index-I7R1SQsL.css → index-RxoP2ZJI.css} +1 -1
- package/dist-web/assets/{index10--9NgV5KO.js → index10-Dm7kE2rr.js} +1 -1
- package/dist-web/assets/{index11-vhJM9Zd7.js → index11-DdA3MM9V.js} +1 -1
- package/dist-web/assets/{index5-BwxQZskx.js → index5-BEFSXtVE.js} +1 -1
- package/dist-web/assets/{index6-CCep5k45.js → index6-DRC2c8Au.js} +1 -1
- package/dist-web/assets/{index7-BpvJXlrz.js → index7-BA7Qbpln.js} +1 -1
- package/dist-web/assets/{index8-DcnUd6X7.js → index8-BJFkvY9w.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-DHRABO78.js → infoDiagram-5YYISTIA-ZsB3ppsA.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-CQvQ04o4.js → ishikawaDiagram-YF4QCWOH-B2AYN5_w.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-BPUe0bJA.js → journeyDiagram-JHISSGLW-ZRZDTfWd.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-B4fkPD56.js → kanban-definition-UN3LZRKU-C8zrJ_g1.js} +1 -1
- package/dist-web/assets/{linear-BBpz4kpy.js → linear-yzOEoW_K.js} +1 -1
- package/dist-web/assets/{mermaid.core-WG0zjqjP.js → mermaid.core-DKDe9fI9.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-6QrrPC-x.js → mindmap-definition-RKZ34NQL-Ba6Dk5CQ.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-Cbk8F7HI.js → pieDiagram-4H26LBE5-D9E3TqGb.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-UCR6ity-.js → quadrantDiagram-W4KKPZXB-BQ_noR4u.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-P2r_Lr3t.js → requirementDiagram-4Y6WPE33-XC7rugwi.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-BZztGDG9.js → sankeyDiagram-5OEKKPKP-Df-1d5Vn.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-Cf4C7Z1l.js → sequenceDiagram-3UESZ5HK-D82eaP5y.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-3dcgw49E.js → stateDiagram-AJRCARHV-Bg5vqbfv.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-C5ugWVoF.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-D8Wuxi_e.js → timeline-definition-PNZ67QCA-aGpihFYz.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CJZRHa6X.js → vennDiagram-CIIHVFJN-1X5A7nOP.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-ChfQpT4C.js → vue.runtime.esm-bundler-CPECXINV.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-eT9HyLJX.js → wardley-L42UT6IY-8CQt8FsK.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DDQwL97M.js → wardleyDiagram-YWT4CUSO-Dcath5AA.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-BGPSWjRq.js → xychartDiagram-2RQKCTM6-ztyWzdXI.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +7 -7
- package/dist-web/assets/channel-CkGndlmZ.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DknrTxU7.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DknrTxU7.js +0 -1
- package/dist-web/assets/index-CMhewTFA.js +0 -325
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU--68MzT1N.js +0 -1
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-B-05E4V9.js","assets/DesignSystemView-B9X_Wri_.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-JigiL_d4.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CZB03k-a.js","assets/index8-DcnUd6X7.js","assets/index11-vhJM9Zd7.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 Vp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Yt={},Cc=[],yi=()=>{},a4=()=>!1,Bd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Kp=e=>e.startsWith("onUpdate:"),bn=Object.assign,oy=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},pE=Object.prototype.hasOwnProperty,an=(e,t)=>pE.call(e,t),wt=Array.isArray,Ac=e=>Jc(e)==="[object Map]",Ia=e=>Jc(e)==="[object Set]",Nb=e=>Jc(e)==="[object Date]",mE=e=>Jc(e)==="[object RegExp]",Lt=e=>typeof e=="function",Cn=e=>typeof e=="string",Js=e=>typeof e=="symbol",cn=e=>e!==null&&typeof e=="object",sy=e=>(cn(e)||Lt(e))&&Lt(e.then)&&Lt(e.catch),c4=Object.prototype.toString,Jc=e=>c4.call(e),gE=e=>Jc(e).slice(8,-1),Gp=e=>Jc(e)==="[object Object]",Yp=e=>Cn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ya=Vp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Zp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},vE=/-\w/g,To=Zp(e=>e.replace(vE,t=>t.slice(1).toUpperCase())),yE=/\B([A-Z])/g,Ns=Zp(e=>e.replace(yE,"-$1").toLowerCase()),Xp=Zp(e=>e.charAt(0).toUpperCase()+e.slice(1)),uh=Zp(e=>e?`on${Xp(e)}`:""),jo=(e,t)=>!Object.is(e,t),Mc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},u4=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Qp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$h=e=>{const t=Cn(e)?Number(e):NaN;return isNaN(t)?e:t};let Ib;const Jp=()=>Ib||(Ib=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),kE="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",bE=Vp(kE);function Vt(e){if(wt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=Cn(o)?SE(o):Vt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(Cn(e)||cn(e))return e}const xE=/;(?![^(]*\))/g,wE=/:([^]+)/,_E=/\/\*[^]*?\*\//g;function SE(e){const t={};return e.replace(_E,"").split(xE).forEach(n=>{if(n){const o=n.split(wE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(Cn(e))t=e;else if(wt(e))for(let n=0;n<e.length;n++){const o=We(e[n]);o&&(t+=o+" ")}else if(cn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function zxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Cn(t)&&(e.class=We(t)),n&&(e.style=Vt(n)),e}const CE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",AE=Vp(CE);function d4(e){return!!e||e===""}function ME(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Or(e[o],t[o]);return n}function Or(e,t){if(e===t)return!0;let n=Nb(e),o=Nb(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=Js(e),o=Js(t),n||o)return e===t;if(n=wt(e),o=wt(t),n||o)return n&&o?ME(e,t):!1;if(n=cn(e),o=cn(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||!Or(e[r],t[r]))return!1}}return String(e)===String(t)}function em(e,t){return e.findIndex(n=>Or(n,t))}const f4=e=>!!(e&&e.__v_isRef===!0),O=e=>Cn(e)?e:e==null?"":wt(e)||cn(e)&&(e.toString===c4||!Lt(e.toString))?f4(e)?O(e.value):JSON.stringify(e,h4,2):String(e),h4=(e,t)=>f4(t)?h4(e,t.value):Ac(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[j1(o,i)+" =>"]=s,n),{})}:Ia(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>j1(n))}:Js(t)?j1(t):cn(t)&&!wt(t)&&!Gp(t)?String(t):t,j1=(e,t="")=>{var n;return Js(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function EE(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 Eo;class p4{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&&Eo&&(Eo.active?(this.parent=Eo,this.index=(Eo.scopes||(Eo.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=Eo;try{return Eo=this,t()}finally{Eo=n}}}on(){++this._on===1&&(this.prevScope=Eo,Eo=this)}off(){if(this._on>0&&--this._on===0){if(Eo===this)Eo=this.prevScope;else{let t=Eo;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 TE(e){return new p4(e)}function iy(){return Eo}function ry(e,t=!1){Eo&&Eo.cleanups.push(e)}let Bn;const V1=new WeakSet;class Fh{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,Eo&&(Eo.active?Eo.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,V1.has(this)&&(V1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||g4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Lb(this),v4(this);const t=Bn,n=Fi;Bn=this,Fi=!0;try{return this.fn()}finally{y4(this),Bn=t,Fi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)cy(t);this.deps=this.depsTail=void 0,Lb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?V1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_g(this)&&this.run()}get dirty(){return _g(this)}}let m4=0,Vu,Ku;function g4(e,t=!1){if(e.flags|=8,t){e.next=Ku,Ku=e;return}e.next=Vu,Vu=e}function ly(){m4++}function ay(){if(--m4>0)return;if(Ku){let t=Ku;for(Ku=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Vu;){let t=Vu;for(Vu=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 v4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function y4(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),cy(o),NE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function _g(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(k4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function k4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===dd)||(e.globalVersion=dd,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_g(e))))return;e.flags|=2;const t=e.dep,n=Bn,o=Fi;Bn=e,Fi=!0;try{v4(e);const s=e.fn(e._value);(t.version===0||jo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Bn=n,Fi=o,y4(e),e.flags&=-3}}function cy(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)cy(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function NE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Uxe(e,t){e.effect instanceof Fh&&(e=e.effect.fn);const n=new Fh(e);t&&bn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function qxe(e){e.effect.stop()}let Fi=!0;const b4=[];function Rr(){b4.push(Fi),Fi=!1}function Br(){const e=b4.pop();Fi=e===void 0?!0:e}function Lb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Bn;Bn=void 0;try{t()}finally{Bn=n}}}let dd=0;class IE{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 tm{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(!Bn||!Fi||Bn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Bn)n=this.activeLink=new IE(Bn,this),Bn.deps?(n.prevDep=Bn.depsTail,Bn.depsTail.nextDep=n,Bn.depsTail=n):Bn.deps=Bn.depsTail=n,x4(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=Bn.depsTail,n.nextDep=void 0,Bn.depsTail.nextDep=n,Bn.depsTail=n,Bn.deps===n&&(Bn.deps=o)}return n}trigger(t){this.version++,dd++,this.notify(t)}notify(t){ly();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ay()}}}function x4(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)x4(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Oh=new WeakMap,ka=Symbol(""),Sg=Symbol(""),fd=Symbol("");function ts(e,t,n){if(Fi&&Bn){let o=Oh.get(e);o||Oh.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new tm),s.map=o,s.key=n),s.track()}}function Mr(e,t,n,o,s,i){const r=Oh.get(e);if(!r){dd++;return}const l=a=>{a&&a.trigger()};if(ly(),t==="clear")r.forEach(l);else{const a=wt(e),c=a&&Yp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===fd||!Js(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(fd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ka)),Ac(e)&&l(r.get(Sg)));break;case"delete":a||(l(r.get(ka)),Ac(e)&&l(r.get(Sg)));break;case"set":Ac(e)&&l(r.get(ka));break}}ay()}function LE(e,t){const n=Oh.get(e);return n&&n.get(t)}function Qa(e){const t=tn(e);return t===e?t:(ts(t,"iterate",fd),Ks(e)?t:t.map(Ri))}function nm(e){return ts(e=tn(e),"iterate",fd),e}function Xi(e,t){return Dr(e)?Uc(xl(e)?Ri(t):t):Ri(t)}const $E={__proto__:null,[Symbol.iterator](){return K1(this,Symbol.iterator,e=>Xi(this,e))},concat(...e){return Qa(this).concat(...e.map(t=>wt(t)?Qa(t):t))},entries(){return K1(this,"entries",e=>(e[1]=Xi(this,e[1]),e))},every(e,t){return pr(this,"every",e,t,void 0,arguments)},filter(e,t){return pr(this,"filter",e,t,n=>n.map(o=>Xi(this,o)),arguments)},find(e,t){return pr(this,"find",e,t,n=>Xi(this,n),arguments)},findIndex(e,t){return pr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return pr(this,"findLast",e,t,n=>Xi(this,n),arguments)},findLastIndex(e,t){return pr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return pr(this,"forEach",e,t,void 0,arguments)},includes(...e){return G1(this,"includes",e)},indexOf(...e){return G1(this,"indexOf",e)},join(e){return Qa(this).join(e)},lastIndexOf(...e){return G1(this,"lastIndexOf",e)},map(e,t){return pr(this,"map",e,t,void 0,arguments)},pop(){return Cu(this,"pop")},push(...e){return Cu(this,"push",e)},reduce(e,...t){return $b(this,"reduce",e,t)},reduceRight(e,...t){return $b(this,"reduceRight",e,t)},shift(){return Cu(this,"shift")},some(e,t){return pr(this,"some",e,t,void 0,arguments)},splice(...e){return Cu(this,"splice",e)},toReversed(){return Qa(this).toReversed()},toSorted(e){return Qa(this).toSorted(e)},toSpliced(...e){return Qa(this).toSpliced(...e)},unshift(...e){return Cu(this,"unshift",e)},values(){return K1(this,"values",e=>Xi(this,e))}};function K1(e,t,n){const o=nm(e),s=o[t]();return o!==e&&!Ks(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const FE=Array.prototype;function pr(e,t,n,o,s,i){const r=nm(e),l=r!==e&&!Ks(e),a=r[t];if(a!==FE[t]){const d=a.apply(e,i);return l?Ri(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Xi(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 $b(e,t,n,o){const s=nm(e),i=s!==e&&!Ks(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=Xi(e,c)),n.call(this,c,Xi(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?Xi(e,a):a}function G1(e,t,n){const o=tn(e);ts(o,"iterate",fd);const s=o[t](...n);return(s===-1||s===!1)&&im(n[0])?(n[0]=tn(n[0]),o[t](...n)):s}function Cu(e,t,n=[]){Rr(),ly();const o=tn(e)[t].apply(e,n);return ay(),Br(),o}const OE=Vp("__proto__,__v_isRef,__isVue"),w4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Js));function RE(e){Js(e)||(e=String(e));const t=tn(this);return ts(t,"has",e),t.hasOwnProperty(e)}class _4{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?T4:E4:i?M4:A4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=wt(t);if(!s){let a;if(r&&(a=$E[n]))return a;if(n==="hasOwnProperty")return RE}const l=Reflect.get(t,n,fo(t)?t:o);if((Js(n)?w4.has(n):OE(n))||(s||ts(t,"get",n),i))return l;if(fo(l)){const a=r&&Yp(n)?l:l.value;return s&&cn(a)?Rh(a):a}return cn(l)?s?Rh(l):Ro(l):l}}class S4 extends _4{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=wt(t)&&Yp(n);if(!this._isShallow){const c=Dr(i);if(!Ks(o)&&!Dr(o)&&(i=tn(i),o=tn(o)),!r&&fo(i)&&!fo(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:an(t,n),a=Reflect.set(t,n,o,fo(t)?t:s);return t===tn(s)&&(l?jo(o,i)&&Mr(t,"set",n,o):Mr(t,"add",n,o)),a}deleteProperty(t,n){const o=an(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Mr(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!Js(n)||!w4.has(n))&&ts(t,"has",n),o}ownKeys(t){return ts(t,"iterate",wt(t)?"length":ka),Reflect.ownKeys(t)}}class C4 extends _4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const BE=new S4,DE=new C4,PE=new S4(!0),HE=new C4(!0),Cg=e=>e,Sf=e=>Reflect.getPrototypeOf(e);function WE(e,t,n){return function(...o){const s=this.__v_raw,i=tn(s),r=Ac(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Cg:t?Uc:Ri;return!t&&ts(i,"iterate",a?Sg:ka),bn(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 Cf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function zE(e,t){const n={get(s){const i=this.__v_raw,r=tn(i),l=tn(s);e||(jo(s,l)&&ts(r,"get",s),ts(r,"get",l));const{has:a}=Sf(r),c=t?Cg:e?Uc:Ri;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&&ts(tn(s),"iterate",ka),s.size},has(s){const i=this.__v_raw,r=tn(i),l=tn(s);return e||(jo(s,l)&&ts(r,"has",s),ts(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=tn(l),c=t?Cg:e?Uc:Ri;return!e&&ts(a,"iterate",ka),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return bn(n,e?{add:Cf("add"),set:Cf("set"),delete:Cf("delete"),clear:Cf("clear")}:{add(s){const i=tn(this),r=Sf(i),l=tn(s),a=!t&&!Ks(s)&&!Dr(s)?l:s;return r.has.call(i,a)||jo(s,a)&&r.has.call(i,s)||jo(l,a)&&r.has.call(i,l)||(i.add(a),Mr(i,"add",a,a)),this},set(s,i){!t&&!Ks(i)&&!Dr(i)&&(i=tn(i));const r=tn(this),{has:l,get:a}=Sf(r);let c=l.call(r,s);c||(s=tn(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?jo(i,u)&&Mr(r,"set",s,i):Mr(r,"add",s,i),this},delete(s){const i=tn(this),{has:r,get:l}=Sf(i);let a=r.call(i,s);a||(s=tn(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Mr(i,"delete",s,void 0),c},clear(){const s=tn(this),i=s.size!==0,r=s.clear();return i&&Mr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=WE(s,e,t)}),n}function om(e,t){const n=zE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(an(n,s)&&s in o?n:o,s,i)}const UE={get:om(!1,!1)},qE={get:om(!1,!0)},jE={get:om(!0,!1)},VE={get:om(!0,!0)},A4=new WeakMap,M4=new WeakMap,E4=new WeakMap,T4=new WeakMap;function KE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ro(e){return Dr(e)?e:sm(e,!1,BE,UE,A4)}function GE(e){return sm(e,!1,PE,qE,M4)}function Rh(e){return sm(e,!0,DE,jE,E4)}function jxe(e){return sm(e,!0,HE,VE,T4)}function sm(e,t,n,o,s){if(!cn(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=KE(gE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function xl(e){return Dr(e)?xl(e.__v_raw):!!(e&&e.__v_isReactive)}function Dr(e){return!!(e&&e.__v_isReadonly)}function Ks(e){return!!(e&&e.__v_isShallow)}function im(e){return e?!!e.__v_raw:!1}function tn(e){const t=e&&e.__v_raw;return t?tn(t):e}function mt(e){return!an(e,"__v_skip")&&Object.isExtensible(e)&&u4(e,"__v_skip",!0),e}const Ri=e=>cn(e)?Ro(e):e,Uc=e=>cn(e)?Rh(e):e;function fo(e){return e?e.__v_isRef===!0:!1}function Z(e){return N4(e,!1)}function La(e){return N4(e,!0)}function N4(e,t){return fo(e)?e:new YE(e,t)}class YE{constructor(t,n){this.dep=new tm,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:tn(t),this._value=n?t:Ri(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Ks(t)||Dr(t);t=o?t:tn(t),jo(t,n)&&(this._rawValue=t,this._value=o?t:Ri(t),this.dep.trigger())}}function Vxe(e){e.dep&&e.dep.trigger()}function C(e){return fo(e)?e.value:e}function I4(e){return Lt(e)?e():C(e)}const ZE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return fo(s)&&!fo(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function L4(e){return xl(e)?e:new Proxy(e,ZE)}class XE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new tm,{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 QE(e){return new XE(e)}function Kxe(e){const t=wt(e)?new Array(e.length):{};for(const n in e)t[n]=$4(e,n);return t}class JE{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Js(n)?n:String(n),this._raw=tn(t);let s=!0,i=t;if(!wt(t)||Js(this._key)||!Yp(this._key))do s=!im(i)||Ks(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&fo(this._raw[this._key])){const n=this._object[this._key];if(fo(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return LE(this._raw,this._key)}}class eT{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 Gxe(e,t,n){return fo(e)?e:Lt(e)?new eT(e):cn(e)&&arguments.length>1?$4(e,t,n):Z(e)}function $4(e,t,n){return new JE(e,t,n)}class tT{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new tm(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=dd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Bn!==this)return g4(this,!0),!0}get value(){const t=this.dep.track();return k4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function nT(e,t,n=!1){let o,s;return Lt(e)?o=e:(o=e.get,s=e.set),new tT(o,s,n)}const Yxe={GET:"get",HAS:"has",ITERATE:"iterate"},Zxe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Af={},Bh=new WeakMap;let dl;function Xxe(){return dl}function oT(e,t=!1,n=dl){if(n){let o=Bh.get(n);o||Bh.set(n,o=[]),o.push(e)}}function sT(e,t,n=Yt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=k=>s?k:Ks(k)||s===!1||s===0?Er(k,1):Er(k);let u,d,f,h,p=!1,g=!1;if(fo(e)?(d=()=>e.value,p=Ks(e)):xl(e)?(d=()=>c(e),p=!0):wt(e)?(g=!0,p=e.some(k=>xl(k)||Ks(k)),d=()=>e.map(k=>{if(fo(k))return k.value;if(xl(k))return c(k);if(Lt(k))return a?a(k,2):k()})):Lt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Rr();try{f()}finally{Br()}}const k=dl;dl=u;try{return a?a(e,3,[h]):e(h)}finally{dl=k}}:d=yi,t&&s){const k=d,A=s===!0?1/0:s;d=()=>Er(k(),A)}const b=iy(),v=()=>{u.stop(),b&&b.active&&oy(b.effects,u)};if(i&&t){const k=t;t=(...A)=>{k(...A),v()}}let m=g?new Array(e.length).fill(Af):Af;const y=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const A=u.run();if(s||p||(g?A.some(($,L)=>jo($,m[L])):jo(A,m))){f&&f();const $=dl;dl=u;try{const L=[A,m===Af?void 0:g&&m[0]===Af?[]:m,h];m=A,a?a(t,3,L):t(...L)}finally{dl=$}}}else u.run()};return l&&l(y),u=new Fh(d),u.scheduler=r?()=>r(y,!1):y,h=k=>oT(k,!1,u),f=u.onStop=()=>{const k=Bh.get(u);if(k){if(a)a(k,4);else for(const A of k)A();Bh.delete(u)}},t?o?y(!0):m=u.run():r?r(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function Er(e,t=1/0,n){if(t<=0||!cn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,fo(e))Er(e.value,t,n);else if(wt(e))for(let o=0;o<e.length;o++)Er(e[o],t,n);else if(Ia(e)||Ac(e))e.forEach(o=>{Er(o,t,n)});else if(Gp(e)){for(const o in e)Er(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Er(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 F4=[];function iT(e){F4.push(e)}function rT(){F4.pop()}function Qxe(e,t){}const Jxe={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"},lT={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 Dd(e,t,n,o){try{return o?e(...o):e()}catch(s){eu(s,t,n)}}function xi(e,t,n,o){if(Lt(e)){const s=Dd(e,t,n,o);return s&&sy(s)&&s.catch(i=>{eu(i,t,n)}),s}if(wt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(xi(e[i],t,n,o));return s}}function eu(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Yt;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){Rr(),Dd(i,null,10,[e,a,c]),Br();return}}aT(e,n,s,o,r)}function aT(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const ps=[];let Gi=-1;const Ec=[];let fl=null,cc=0;const O4=Promise.resolve();let Dh=null;function gt(e){const t=Dh||O4;return e?t.then(this?e.bind(this):e):t}function cT(e){let t=Gi+1,n=ps.length;for(;t<n;){const o=t+n>>>1,s=ps[o],i=hd(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function uy(e){if(!(e.flags&1)){const t=hd(e),n=ps[ps.length-1];!n||!(e.flags&2)&&t>=hd(n)?ps.push(e):ps.splice(cT(t),0,e),e.flags|=1,R4()}}function R4(){Dh||(Dh=O4.then(B4))}function Ph(e){wt(e)?Ec.push(...e):fl&&e.id===-1?fl.splice(cc+1,0,e):e.flags&1||(Ec.push(e),e.flags|=1),R4()}function Fb(e,t,n=Gi+1){for(;n<ps.length;n++){const o=ps[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;ps.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Hh(e){if(Ec.length){const t=[...new Set(Ec)].sort((n,o)=>hd(n)-hd(o));if(Ec.length=0,fl){fl.push(...t);return}for(fl=t,cc=0;cc<fl.length;cc++){const n=fl[cc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}fl=null,cc=0}}const hd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function B4(e){try{for(Gi=0;Gi<ps.length;Gi++){const t=ps[Gi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Dd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Gi<ps.length;Gi++){const t=ps[Gi];t&&(t.flags&=-2)}Gi=-1,ps.length=0,Hh(),Dh=null,(ps.length||Ec.length)&&B4()}}let uc,Mf=[];function D4(e,t){var n,o;uc=e,uc?(uc.enabled=!0,Mf.forEach(({event:s,args:i})=>uc.emit(s,...i)),Mf=[]):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=>{D4(i,t)}),setTimeout(()=>{uc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Mf=[])},3e3)):Mf=[]}let Go=null,rm=null;function pd(e){const t=Go;return Go=e,rm=e&&e.type.__scopeId||null,t}function ewe(e){rm=e}function twe(){rm=null}const nwe=e=>Ee;function Ee(e,t=Go,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&jh(-1);const i=pd(t);let r;try{r=e(...s)}finally{pd(i),o._d&&jh(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Ln(e,t){if(Go===null)return e;const n=zd(Go),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Yt]=t[s];i&&(Lt(i)&&(i={mounted:i,updated:i}),i.deep&&Er(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Yi(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&&(Rr(),xi(a,n,8,[e.el,l,e,t]),Br())}}function Nn(e,t){if(Ko){let n=Ko.provides;const o=Ko.parent&&Ko.parent.provides;o===n&&(n=Ko.provides=Object.create(o)),n[e]=t}}function jt(e,t,n=!1){const o=Zo();if(o||ba){let s=ba?ba._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&&Lt(t)?t.call(o&&o.proxy):t}}function owe(){return!!(Zo()||ba)}const uT=Symbol.for("v-scx"),dT=()=>jt(uT);function fT(e,t){return Pd(e,null,t)}function swe(e,t){return Pd(e,null,{flush:"post"})}function hT(e,t){return Pd(e,null,{flush:"sync"})}function Je(e,t,n){return Pd(e,t,n)}function Pd(e,t,n=Yt){const{immediate:o,deep:s,flush:i,once:r}=n,l=bn({},n),a=t&&o||!t&&i!=="post";let c;if(Ca){if(i==="sync"){const h=dT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=yi,h.resume=yi,h.pause=yi,h}}const u=Ko;l.call=(h,p,g)=>xi(h,u,p,g);let d=!1;i==="post"?l.scheduler=h=>{go(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():uy(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=sT(e,t,l);return Ca&&(c?c.push(f):a&&f()),f}function pT(e,t,n){const o=this.proxy,s=Cn(e)?e.includes(".")?P4(o,e):()=>o[e]:e.bind(o,o);let i;Lt(t)?i=t:(i=t.handler,n=t);const r=tu(this),l=Pd(s,i.bind(o),n);return r(),l}function P4(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 al=new WeakMap,H4=Symbol("_vte"),W4=e=>e.__isTeleport,aa=e=>e&&(e.disabled||e.disabled===""),mT=e=>e&&(e.defer||e.defer===""),Ob=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Rb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ag=(e,t)=>{const n=e&&e.to;return Cn(n)?t?t(n):null:n},gT={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:b,parentNode:v}}=c,m=aa(t.props);let{dynamicChildren:y}=t;const k=(L,w,E)=>{L.shapeFlag&16&&u(L.children,w,E,s,i,r,l,a)},A=(L=t)=>{const w=aa(L.props),E=L.target=Ag(L.props,p),T=Mg(E,L,g,h);E&&(r!=="svg"&&Ob(E)?r="svg":r!=="mathml"&&Rb(E)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(E),w||(k(L,E,T),Ru(L,!1)))},$=L=>{const w=()=>{if(al.get(L)===w){if(al.delete(L),aa(L.props)){const E=v(L.el)||n;k(L,E,L.anchor),Ru(L,!0)}A(L)}};al.set(L,w),go(w,i)};if(e==null){const L=t.el=g(""),w=t.anchor=g("");if(h(L,n,o),h(w,n,o),mT(t.props)||i&&i.pendingBranch){$(t);return}m&&(k(t,n,w),Ru(t,!0)),A()}else{t.el=e.el;const L=t.anchor=e.anchor,w=al.get(e);if(w){w.flags|=8,al.delete(e),$(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,T=t.targetAnchor=e.targetAnchor,F=aa(e.props),S=F?n:E,I=F?L:T;if(r==="svg"||Ob(E)?r="svg":(r==="mathml"||Rb(E))&&(r="mathml"),y?(f(e.dynamicChildren,y,S,s,i,r,l),by(e,t,!0)):a||d(e,t,S,I,s,i,r,l,!1),m)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ef(t,n,L,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=Ag(t.props,p);P&&Ef(t,P,null,c,0)}else F&&Ef(t,E,T,c,1);Ru(t,m)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!aa(f),p=al.get(e);if(p&&(p.flags|=8,al.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let g=0;g<l.length;g++){const b=l[g];o(b,t,n,h,!!b.dynamicChildren)}},move:Ef,hydrate:vT};function Ef(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),!al.has(e)&&(!d||aa(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function vT(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,v){let m=v;for(;m;){if(m&&m.nodeType===8){if(m.data==="teleport start anchor")t.targetStart=m;else if(m.data==="teleport anchor"){t.targetAnchor=m,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}m=r(m)}}function h(b,v){v.anchor=d(r(b),v,l(b),n,o,s,i)}const p=t.target=Ag(t.props,a),g=aa(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(g?(h(e,t),f(p,b),t.targetAnchor||Mg(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||Mg(p,t,u,c),d(b&&r(b),t,p,n,o,s,i))),Ru(t,g)}else g&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const lm=gT;function Ru(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 Mg(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[H4]=r,e&&(o(i,e,s),o(r,e,s)),r}const fi=Symbol("_leaveCb"),Au=Symbol("_enterCb");function z4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return un(()=>{e.isMounted=!0}),ho(()=>{e.isUnmounting=!0}),e}const ri=[Function,Array],U4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ri,onEnter:ri,onAfterEnter:ri,onEnterCancelled:ri,onBeforeLeave:ri,onLeave:ri,onAfterLeave:ri,onLeaveCancelled:ri,onBeforeAppear:ri,onAppear:ri,onAfterAppear:ri,onAppearCancelled:ri},q4=e=>{const t=e.subTree;return t.component?q4(t.component):t},yT={name:"BaseTransition",props:U4,setup(e,{slots:t}){const n=Zo(),o=z4();return()=>{const s=t.default&&dy(t.default(),!0),i=s&&s.length?j4(s):n.subTree?re():void 0;if(!i)return;const r=tn(e),{mode:l}=r;if(o.isLeaving)return Y1(i);const a=Bb(i);if(!a)return Y1(i);let c=md(a,r,o,n,d=>c=d);a.type!==ko&&Ml(a,c);let u=n.subTree&&Bb(n.subTree);if(u&&u.type!==ko&&!Ii(u,a)&&q4(n).type!==ko){let d=md(u,r,o,n);if(Ml(u,d),l==="out-in"&&a.type!==ko)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Y1(i);l==="in-out"&&a.type!==ko?d.delayLeave=(f,h,p)=>{const g=V4(o,u);g[String(u.key)]=u,f[fi]=()=>{h(),f[fi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function j4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ko){t=n;break}}return t}const kT=yT;function V4(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 md(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:b,onAppear:v,onAfterAppear:m,onAppearCancelled:y}=t,k=String(e.key),A=V4(n,e),$=(E,T)=>{E&&xi(E,o,9,T)},L=(E,T)=>{const F=T[1];$(E,T),wt(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},w={mode:r,persisted:l,beforeEnter(E){let T=a;if(!n.isMounted)if(i)T=b||a;else return;E[fi]&&E[fi](!0);const F=A[k];F&&Ii(e,F)&&F.el[fi]&&F.el[fi](),$(T,[E])},enter(E){if(A[k]===e)return;let T=c,F=u,S=d;if(!n.isMounted)if(i)T=v||c,F=m||u,S=y||d;else return;let I=!1;E[Au]=D=>{I||(I=!0,D?$(S,[E]):$(F,[E]),w.delayedLeave&&w.delayedLeave(),E[Au]=void 0)};const P=E[Au].bind(null,!1);T?L(T,[E,P]):P()},leave(E,T){const F=String(e.key);if(E[Au]&&E[Au](!0),n.isUnmounting)return T();$(f,[E]);let S=!1;E[fi]=P=>{S||(S=!0,T(),P?$(g,[E]):$(p,[E]),E[fi]=void 0,A[F]===e&&delete A[F])};const I=E[fi].bind(null,!1);A[F]=e,h?L(h,[E,I]):I()},clone(E){const T=md(E,t,n,o,s);return s&&s(T),T}};return w}function Y1(e){if(Hd(e))return e=Pr(e),e.children=null,e}function Bb(e){if(!Hd(e))return W4(e.type)&&e.children?j4(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&&Lt(n.default))return n.default()}}function Ml(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ml(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 dy(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===Pe?(r.patchFlag&128&&s++,o=o.concat(dy(r.children,t,l))):(t||r.type!==ko)&&o.push(l!=null?Pr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Ze(e,t){return Lt(e)?bn({name:e.name},t,{setup:e}):e}function iwe(){const e=Zo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function fy(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rwe(e){const t=Zo(),n=La(null);if(t){const s=t.refs===Yt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Db(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Wh=new WeakMap;function Tc(e,t,n,o,s=!1){if(wt(e)){e.forEach((g,b)=>Tc(g,t&&(wt(t)?t[b]:t),n,o,s));return}if($r(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Tc(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?zd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Yt?l.refs={}:l.refs,d=l.setupState,f=tn(d),h=d===Yt?a4:g=>Db(u,g)?!1:an(f,g),p=(g,b)=>!(b&&Db(u,b));if(c!=null&&c!==a){if(Pb(t),Cn(c))u[c]=null,h(c)&&(d[c]=null);else if(fo(c)){const g=t;p(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(Lt(a))Dd(a,l,12,[r,u]);else{const g=Cn(a),b=fo(a);if(g||b){const v=()=>{if(e.f){const m=g?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)wt(m)&&oy(m,i);else if(wt(m))m.includes(i)||m.push(i);else if(g)u[a]=[i],h(a)&&(d[a]=u[a]);else{const y=[i];p(a,e.k)&&(a.value=y),e.k&&(u[e.k]=y)}}else g?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const m=()=>{v(),Wh.delete(e)};m.id=-1,Wh.set(e,m),go(m,n)}else Pb(e),v()}}}function Pb(e){const t=Wh.get(e);t&&(t.flags|=8,Wh.delete(e))}let Hb=!1;const Ja=()=>{Hb||(console.error("Hydration completed but contains mismatches."),Hb=!0)},bT=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",xT=e=>e.namespaceURI.includes("MathML"),Tf=e=>{if(e.nodeType===1){if(bT(e))return"svg";if(xT(e))return"mathml"}},vc=e=>e.nodeType===8;function wT(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(y,k)=>{if(!k.hasChildNodes()){n(null,y,k),Hh(),k._vnode=y;return}d(k.firstChild,y,null,null,null),Hh(),k._vnode=y},d=(y,k,A,$,L,w=!1)=>{w=w||!!k.dynamicChildren;const E=vc(y)&&y.data==="[",T=()=>g(y,k,A,$,L,E),{type:F,ref:S,shapeFlag:I,patchFlag:P}=k;let D=y.nodeType;k.el=y,P===-2&&(w=!1,k.dynamicChildren=null);let W=null;switch(F){case wl:D!==3?k.children===""?(a(k.el=s(""),r(y),y),W=y):W=T():(y.data!==k.children&&(Ja(),y.data=k.children),W=i(y));break;case ko:m(y)?(W=i(y),v(k.el=y.content.firstChild,y,A)):D!==8||E?W=T():W=i(y);break;case Ic:if(E&&(y=i(y),D=y.nodeType),D===1||D===3){W=y;const z=!k.children.length;for(let R=0;R<k.staticCount;R++)z&&(k.children+=W.nodeType===1?W.outerHTML:W.data),R===k.staticCount-1&&(k.anchor=W),W=i(W);return E?i(W):W}else T();break;case Pe:E?W=p(y,k,A,$,L,w):W=T();break;default:if(I&1)(D!==1||k.type.toLowerCase()!==y.tagName.toLowerCase())&&!m(y)?W=T():W=f(y,k,A,$,L,w);else if(I&6){k.slotScopeIds=L;const z=r(y);if(E?W=b(y):vc(y)&&y.data==="teleport start"?W=b(y,y.data,"teleport end"):W=i(y),t(k,z,null,A,$,Tf(z),w),$r(k)&&!k.type.__asyncResolved){let R;E?(R=ie(Pe),R.anchor=W?W.previousSibling:z.lastChild):R=y.nodeType===3?Xe(""):ie("div"),R.el=y,k.component.subTree=R}}else I&64?D!==8?W=T():W=k.type.hydrate(y,k,A,$,L,w,e,h):I&128&&(W=k.type.hydrate(y,k,A,$,Tf(r(y)),L,w,e,d))}return S!=null&&Tc(S,null,$,k),W},f=(y,k,A,$,L,w)=>{w=w||!!k.dynamicChildren;const{type:E,props:T,patchFlag:F,shapeFlag:S,dirs:I,transition:P}=k,D=E==="input"||E==="option";if(D||F!==-1){I&&Yi(k,null,A,"created");let W=!1;if(m(y)){W=f3(null,P)&&A&&A.vnode.props&&A.vnode.props.appear;const R=y.content.firstChild;if(W){const q=R.getAttribute("class");q&&(R.$cls=q),P.beforeEnter(R)}v(R,y,A),k.el=y=R}if(S&16&&!(T&&(T.innerHTML||T.textContent))){let R=h(y.firstChild,k,y,A,$,L,w);for(R&&!Nf(y,1)&&Ja();R;){const q=R;R=R.nextSibling,l(q)}}else if(S&8){let R=k.children;R[0]===`
|
|
15
|
-
`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(R=R.slice(1));const{textContent:q}=y;q!==R&&q!==R.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Nf(y,0)||Ja(),y.textContent=k.children)}if(T){if(D||!w||F&48){const R=y.tagName.includes("-");for(const q in T)(D&&(q.endsWith("value")||q==="indeterminate")||Bd(q)&&!ya(q)||q[0]==="."||R&&!ya(q))&&o(y,q,null,T[q],void 0,A)}else if(T.onClick)o(y,"onClick",null,T.onClick,void 0,A);else if(F&4&&xl(T.style))for(const R in T.style)T.style[R]}let z;(z=T&&T.onVnodeBeforeMount)&&Ms(z,A,k),I&&Yi(k,null,A,"beforeMount"),((z=T&&T.onVnodeMounted)||I||W)&&g3(()=>{z&&Ms(z,A,k),W&&P.enter(y),I&&Yi(k,null,A,"mounted")},$)}return y.nextSibling},h=(y,k,A,$,L,w,E)=>{E=E||!!k.dynamicChildren;const T=k.children,F=T.length;let S=!1;for(let I=0;I<F;I++){const P=E?T[I]:T[I]=Ts(T[I]),D=P.type===wl;y?(D&&!E&&I+1<F&&Ts(T[I+1]).type===wl&&(a(s(y.data.slice(P.children.length)),A,i(y)),y.data=P.children),y=d(y,P,$,L,w,E)):D&&!P.children?a(P.el=s(""),A):(S||(S=!0,Nf(A,1)||Ja()),n(null,P,A,null,$,L,Tf(A),w))}return y},p=(y,k,A,$,L,w)=>{const{slotScopeIds:E}=k;E&&(L=L?L.concat(E):E);const T=r(y),F=h(i(y),k,T,A,$,L,w);return F&&vc(F)&&F.data==="]"?i(k.anchor=F):(Ja(),a(k.anchor=c("]"),T,F),F)},g=(y,k,A,$,L,w)=>{if(Nf(y.parentElement,1)||Ja(),k.el=null,w){const F=b(y);for(;;){const S=i(y);if(S&&S!==F)l(S);else break}}const E=i(y),T=r(y);return l(y),n(null,k,T,E,A,$,Tf(T),L),A&&(A.vnode.el=k.el,um(A,k.el)),E},b=(y,k="[",A="]")=>{let $=0;for(;y;)if(y=i(y),y&&vc(y)&&(y.data===k&&$++,y.data===A)){if($===0)return i(y);$--}return y},v=(y,k,A)=>{const $=k.parentNode;$&&$.replaceChild(y,k);let L=A;for(;L;)L.vnode.el===k&&(L.vnode.el=L.subTree.el=y),L=L.parent},m=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const Wb="data-allow-mismatch",_T={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Nf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Wb);)e=e.parentElement;const n=e&&e.getAttribute(Wb);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(_T[t])}}const ST=Jp().requestIdleCallback||(e=>setTimeout(e,1)),CT=Jp().cancelIdleCallback||(e=>clearTimeout(e)),lwe=(e=1e4)=>t=>{const n=ST(t,{timeout:e});return()=>CT(n)};function AT(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 awe=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(AT(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},cwe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},uwe=(e=[])=>(t,n)=>{Cn(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 MT(e,t){if(vc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(vc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const $r=e=>!!e.type.__asyncLoader;function Li(e){Lt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((b,v)=>{a(g,()=>b(f()),()=>v(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ze({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,b){let v=!1;(g.bu||(g.bu=[])).push(()=>v=!0);const m=()=>{v||b()},y=i?()=>{const k=i(m,A=>MT(p,A));k&&(g.bum||(g.bum=[])).push(k)}:m;u?y():h().then(()=>!g.isUnmounted&&y())},get __asyncResolved(){return u},setup(){const p=Ko;if(fy(p),u)return()=>If(u,p);const g=y=>{c=null,eu(y,p,13,!o)};if(l&&p.suspense||Ca)return h().then(y=>()=>If(y,p)).catch(y=>(g(y),()=>o?ie(o,{error:y}):null));const b=Z(!1),v=Z(),m=Z(!!s);return s&&setTimeout(()=>{m.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!v.value){const y=new Error(`Async component timed out after ${r}ms.`);g(y),v.value=y}},r),h().then(()=>{b.value=!0,p.parent&&Hd(p.parent.vnode)&&p.parent.update()}).catch(y=>{g(y),v.value=y}),()=>{if(b.value&&u)return If(u,p);if(v.value&&o)return ie(o,{error:v.value});if(n&&!m.value)return If(n,p)}}})}function If(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=ie(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Hd=e=>e.type.__isKeepAlive,ET={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Zo(),o=n.ctx;if(!o.renderer)return()=>{const m=t.default&&t.default();return m&&m.length===1?m[0]:m};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=(m,y,k,A,$)=>{const L=m.component;c(m,y,k,0,l),a(L.vnode,m,y,k,L,l,A,m.slotScopeIds,$),go(()=>{L.isDeactivated=!1,L.a&&Mc(L.a);const w=m.props&&m.props.onVnodeMounted;w&&Ms(w,L.parent,m)},l)},o.deactivate=m=>{const y=m.component;Uh(y.m),Uh(y.a),c(m,f,null,1,l),go(()=>{y.da&&Mc(y.da);const k=m.props&&m.props.onVnodeUnmounted;k&&Ms(k,y.parent,m),y.isDeactivated=!0},l)};function h(m){Z1(m),u(m,n,l,!0)}function p(m){s.forEach((y,k)=>{const A=Rg($r(y)?y.type.__asyncResolved||{}:y.type);A&&!m(A)&&g(k)})}function g(m){const y=s.get(m);y&&(!r||!Ii(y,r))?h(y):r&&Z1(r),s.delete(m),i.delete(m)}Je(()=>[e.include,e.exclude],([m,y])=>{m&&p(k=>Bu(m,k)),y&&p(k=>!Bu(y,k))},{flush:"post",deep:!0});let b=null;const v=()=>{b!=null&&(qh(n.subTree.type)?go(()=>{s.set(b,Lf(n.subTree))},n.subTree.suspense):s.set(b,Lf(n.subTree)))};return un(v),hy(v),ho(()=>{s.forEach(m=>{const{subTree:y,suspense:k}=n,A=Lf(y);if(m.type===A.type&&m.key===A.key){Z1(A);const $=A.component.da;$&&go($,k);return}h(m)})}),()=>{if(b=null,!t.default)return r=null;const m=t.default(),y=m[0];if(m.length>1)return r=null,m;if(!El(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return r=null,y;let k=Lf(y);if(k.type===ko)return r=null,k;const A=k.type,$=Rg($r(k)?k.type.__asyncResolved||{}:A),{include:L,exclude:w,max:E}=e;if(L&&(!$||!Bu(L,$))||w&&$&&Bu(w,$))return k.shapeFlag&=-257,r=k,y;const T=k.key==null?A:k.key,F=s.get(T);return k.el&&(k=Pr(k),y.shapeFlag&128&&(y.ssContent=k)),b=T,F?(k.el=F.el,k.component=F.component,k.transition&&Ml(k,k.transition),k.shapeFlag|=512,i.delete(T),i.add(T)):(i.add(T),E&&i.size>parseInt(E,10)&&g(i.values().next().value)),k.shapeFlag|=256,r=k,qh(y.type)?y:k}}},dwe=ET;function Bu(e,t){return wt(e)?e.some(n=>Bu(n,t)):Cn(e)?e.split(",").includes(t):mE(e)?(e.lastIndex=0,e.test(t)):!1}function TT(e,t){K4(e,"a",t)}function NT(e,t){K4(e,"da",t)}function K4(e,t,n=Ko){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(am(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Hd(s.parent.vnode)&&IT(o,t,n,s),s=s.parent}}function IT(e,t,n,o){const s=am(t,e,o,!0);xn(()=>{oy(o[t],s)},n)}function Z1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Lf(e){return e.shapeFlag&128?e.ssContent:e}function am(e,t,n=Ko,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Rr();const l=tu(n),a=xi(t,n,e,r);return l(),Br(),a});return o?s.unshift(i):s.push(i),i}}const Wr=e=>(t,n=Ko)=>{(!Ca||e==="sp")&&am(e,(...o)=>t(...o),n)},LT=Wr("bm"),un=Wr("m"),G4=Wr("bu"),hy=Wr("u"),ho=Wr("bum"),xn=Wr("um"),$T=Wr("sp"),FT=Wr("rtg"),OT=Wr("rtc");function RT(e,t=Ko){am("ec",e,t)}const py="components",BT="directives";function DT(e,t){return my(py,e,!0,t)||e}const Y4=Symbol.for("v-ndc");function Vo(e){return Cn(e)?my(py,e,!1)||e:e||Y4}function fwe(e){return my(BT,e)}function my(e,t,n=!0,o=!1){const s=Go||Ko;if(s){const i=s.type;if(e===py){const l=Rg(i,!1);if(l&&(l===t||l===To(t)||l===Xp(To(t))))return i}const r=zb(s[e]||i[e],t)||zb(s.appContext[e],t);return!r&&o?i:r}}function zb(e,t){return e&&(e[t]||e[To(t)]||e[Xp(To(t))])}function ot(e,t,n,o){let s;const i=n&&n[o],r=wt(e);if(r||Cn(e)){const l=r&&xl(e);let a=!1,c=!1;l&&(a=!Ks(e),c=Dr(e),e=nm(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?Uc(Ri(e[u])):Ri(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(cn(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 Z4(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(wt(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 $n(e,t,n={},o,s){if(Go.ce||Go.parent&&$r(Go.parent)&&Go.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),ke(Pe,null,[ie("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&gy(i(n)),l=n.key||r&&r.key,a=ke(Pe,{key:(l&&!Js(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 gy(e){return e.some(t=>El(t)?!(t.type===ko||t.type===Pe&&!gy(t.children)):!0)?e:null}function hwe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:uh(o)]=e[o];return n}const Eg=e=>e?x3(e)?zd(e):Eg(e.parent):null,Gu=bn(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=>Eg(e.parent),$root:e=>Eg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>vy(e),$forceUpdate:e=>e.f||(e.f=()=>{uy(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>pT.bind(e)}),X1=(e,t)=>e!==Yt&&!e.__isScriptSetup&&an(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(X1(o,t))return r[t]=1,o[t];if(s!==Yt&&an(s,t))return r[t]=2,s[t];if(an(i,t))return r[t]=3,i[t];if(n!==Yt&&an(n,t))return r[t]=4,n[t];Ng&&(r[t]=0)}}const c=Gu[t];let u,d;if(c)return t==="$attrs"&&ts(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Yt&&an(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,an(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return X1(s,t)?(s[t]=n,!0):o!==Yt&&an(o,t)?(o[t]=n,!0):an(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!==Yt&&l[0]!=="$"&&an(e,l)||X1(t,l)||an(i,l)||an(o,l)||an(Gu,l)||an(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:an(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},PT=bn({},Tg,{get(e,t){if(t!==Symbol.unscopables)return Tg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!bE(t)}});function pwe(){return null}function mwe(){return null}function gwe(e){}function vwe(e){}function ywe(){return null}function kwe(){}function bwe(e,t){return null}function xwe(){return X4().slots}function Wd(){return X4().attrs}function X4(e){const t=Zo();return t.setupContext||(t.setupContext=S3(t))}function gd(e){return wt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function wwe(e,t){const n=gd(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?wt(s)||Lt(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 _we(e,t){return!e||!t?e||t:wt(e)&&wt(t)?e.concat(t):bn({},gd(e),gd(t))}function Swe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Cwe(e){const t=Zo(),n=Ca;let o=e();yd(),n&&Lc(!1);const s=()=>{tu(t),n&&Lc(!0)},i=()=>{Zo()!==t&&t.scope.off(),yd(),n&&Lc(!1)};return sy(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Ng=!0;function HT(e){const t=vy(e),n=e.proxy,o=e.ctx;Ng=!1,t.beforeCreate&&Ub(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:g,deactivated:b,beforeDestroy:v,beforeUnmount:m,destroyed:y,unmounted:k,render:A,renderTracked:$,renderTriggered:L,errorCaptured:w,serverPrefetch:E,expose:T,inheritAttrs:F,components:S,directives:I,filters:P}=t;if(c&&WT(c,o,null),r)for(const z in r){const R=r[z];Lt(R)&&(o[z]=R.bind(n))}if(s){const z=s.call(n,n);cn(z)&&(e.data=Ro(z))}if(Ng=!0,i)for(const z in i){const R=i[z],q=Lt(R)?R.bind(n,n):Lt(R.get)?R.get.bind(n,n):yi,K=!Lt(R)&&Lt(R.set)?R.set.bind(n):yi,X=B({get:q,set:K});Object.defineProperty(o,z,{enumerable:!0,configurable:!0,get:()=>X.value,set:ue=>X.value=ue})}if(l)for(const z in l)Q4(l[z],o,n,z);if(a){const z=Lt(a)?a.call(n):a;Reflect.ownKeys(z).forEach(R=>{Nn(R,z[R])})}u&&Ub(u,e,"c");function W(z,R){wt(R)?R.forEach(q=>z(q.bind(n))):R&&z(R.bind(n))}if(W(LT,d),W(un,f),W(G4,h),W(hy,p),W(TT,g),W(NT,b),W(RT,w),W(OT,$),W(FT,L),W(ho,m),W(xn,k),W($T,E),wt(T))if(T.length){const z=e.exposed||(e.exposed={});T.forEach(R=>{Object.defineProperty(z,R,{get:()=>n[R],set:q=>n[R]=q,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===yi&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),I&&(e.directives=I),E&&fy(e)}function WT(e,t,n=yi){wt(e)&&(e=Ig(e));for(const o in e){const s=e[o];let i;cn(s)?"default"in s?i=jt(s.from||o,s.default,!0):i=jt(s.from||o):i=jt(s),fo(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function Ub(e,t,n){xi(wt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function Q4(e,t,n,o){let s=o.includes(".")?P4(n,o):()=>n[o];if(Cn(e)){const i=t[e];Lt(i)&&Je(s,i)}else if(Lt(e))Je(s,e.bind(n));else if(cn(e))if(wt(e))e.forEach(i=>Q4(i,t,n,o));else{const i=Lt(e.handler)?e.handler.bind(n):t[e.handler];Lt(i)&&Je(s,i,e)}}function vy(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=>zh(a,c,r,!0)),zh(a,t,r)),cn(t)&&i.set(t,a),a}function zh(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&zh(e,i,n,!0),s&&s.forEach(r=>zh(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=zT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const zT={data:qb,props:jb,emits:jb,methods:Du,computed:Du,beforeCreate:cs,created:cs,beforeMount:cs,mounted:cs,beforeUpdate:cs,updated:cs,beforeDestroy:cs,beforeUnmount:cs,destroyed:cs,unmounted:cs,activated:cs,deactivated:cs,errorCaptured:cs,serverPrefetch:cs,components:Du,directives:Du,watch:qT,provide:qb,inject:UT};function qb(e,t){return t?e?function(){return bn(Lt(e)?e.call(this,this):e,Lt(t)?t.call(this,this):t)}:t:e}function UT(e,t){return Du(Ig(e),Ig(t))}function Ig(e){if(wt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function cs(e,t){return e?[...new Set([].concat(e,t))]:t}function Du(e,t){return e?bn(Object.create(null),e,t):t}function jb(e,t){return e?wt(e)&&wt(t)?[...new Set([...e,...t])]:bn(Object.create(null),gd(e),gd(t??{})):t}function qT(e,t){if(!e)return t;if(!t)return e;const n=bn(Object.create(null),e);for(const o in t)n[o]=cs(e[o],t[o]);return n}function J4(){return{app:null,config:{isNativeTag:a4,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 jT=0;function VT(e,t){return function(o,s=null){Lt(o)||(o=bn({},o)),s!=null&&!cn(s)&&(s=null);const i=J4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:jT++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:w9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Lt(u.install)?(r.add(u),u.install(c,...d)):Lt(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||ie(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,zd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(xi(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=ba;ba=c;try{return u()}finally{ba=d}}};return c}}let ba=null;function Awe(e,t,n=Yt){const o=Zo(),s=To(t),i=Ns(t),r=e3(e,s),l=QE((a,c)=>{let u,d=Yt,f;return hT(()=>{const h=e[s];jo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!jo(p,u)&&!(d!==Yt&&jo(h,d)))return;const g=o.vnode.props;g&&(t in g||s in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${s}`in g||`onUpdate:${i}`in g)||(u=h,c()),o.emit(`update:${t}`,p),jo(h,p)&&jo(h,d)&&!jo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Yt:l,done:!1}:{done:!0}}}},l}const e3=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${To(t)}Modifiers`]||e[`${Ns(t)}Modifiers`];function KT(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Yt;let s=n;const i=t.startsWith("update:"),r=i&&e3(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>Cn(u)?u.trim():u)),r.number&&(s=n.map(Qp)));let l,a=o[l=uh(t)]||o[l=uh(To(t))];!a&&i&&(a=o[l=uh(Ns(t))]),a&&xi(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,xi(c,e,6,s)}}const GT=new WeakMap;function t3(e,t,n=!1){const o=n?GT:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!Lt(e)){const a=c=>{const u=t3(c,t,!0);u&&(l=!0,bn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(cn(e)&&o.set(e,null),null):(wt(i)?i.forEach(a=>r[a]=null):bn(r,i),cn(e)&&o.set(e,r),r)}function cm(e,t){return!e||!Bd(t)?!1:(t=t.slice(2).replace(/Once$/,""),an(e,t[0].toLowerCase()+t.slice(1))||an(e,Ns(t))||an(e,t))}function dh(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:g}=e,b=pd(e);let v,m;try{if(n.shapeFlag&4){const k=s||o,A=k;v=Ts(c.call(A,k,u,d,h,f,p)),m=l}else{const k=t;v=Ts(k.length>1?k(d,{attrs:l,slots:r,emit:a}):k(d,null)),m=t.props?l:ZT(l)}}catch(k){Yu.length=0,eu(k,e,1),v=ie(ko)}let y=v;if(m&&g!==!1){const k=Object.keys(m),{shapeFlag:A}=y;k.length&&A&7&&(i&&k.some(Kp)&&(m=XT(m,i)),y=Pr(y,m,!1,!0))}return n.dirs&&(y=Pr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Ml(y,n.transition),v=y,pd(b),v}function YT(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(El(s)){if(s.type!==ko||s.children==="v-if"){if(n)return;n=s}}else return}return n}const ZT=e=>{let t;for(const n in e)(n==="class"||n==="style"||Bd(n))&&((t||(t={}))[n]=e[n]);return t},XT=(e,t)=>{const n={};for(const o in e)(!Kp(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function QT(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?Vb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(n3(r,o,f)&&!cm(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?Vb(o,r,c):!0:!!r;return!1}function Vb(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(n3(t,e,i)&&!cm(n,i))return!0}return!1}function n3(e,t,n){const o=e[n],s=t[n];return n==="style"&&cn(o)&&cn(s)?!Or(o,s):o!==s}function um({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 o3={},s3=()=>Object.create(o3),i3=e=>Object.getPrototypeOf(e)===o3;function JT(e,t,n,o=!1){const s={},i=s3();e.propsDefaults=Object.create(null),r3(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:GE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function e9(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=tn(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(cm(e.emitsOptions,f))continue;const h=t[f];if(a)if(an(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=To(f);s[p]=Lg(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{r3(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!an(t,d)&&((u=Ns(d))===d||!an(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Lg(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!an(t,d))&&(delete i[d],c=!0)}c&&Mr(e.attrs,"set","")}function r3(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(ya(a))continue;const c=t[a];let u;s&&an(s,u=To(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:cm(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=tn(n),c=l||Yt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Lg(s,a,d,c[d],e,!an(c,d))}}return r}function Lg(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=an(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Lt(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=tu(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===Ns(n))&&(o=!0))}return o}const t9=new WeakMap;function l3(e,t,n=!1){const o=n?t9:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!Lt(e)){const u=d=>{a=!0;const[f,h]=l3(d,t,!0);bn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return cn(e)&&o.set(e,Cc),Cc;if(wt(i))for(let u=0;u<i.length;u++){const d=To(i[u]);Kb(d)&&(r[d]=Yt)}else if(i)for(const u in i){const d=To(u);if(Kb(d)){const f=i[u],h=r[d]=wt(f)||Lt(f)?{type:f}:bn({},f),p=h.type;let g=!1,b=!0;if(wt(p))for(let v=0;v<p.length;++v){const m=p[v],y=Lt(m)&&m.name;if(y==="Boolean"){g=!0;break}else y==="String"&&(b=!1)}else g=Lt(p)&&p.name==="Boolean";h[0]=g,h[1]=b,(g||an(h,"default"))&&l.push(d)}}const c=[r,l];return cn(e)&&o.set(e,c),c}function Kb(e){return e[0]!=="$"&&!ya(e)}const yy=e=>e==="_"||e==="_ctx"||e==="$stable",ky=e=>wt(e)?e.map(Ts):[Ts(e)],n9=(e,t,n)=>{if(t._n)return t;const o=Ee((...s)=>ky(t(...s)),n);return o._c=!1,o},a3=(e,t,n)=>{const o=e._ctx;for(const s in e){if(yy(s))continue;const i=e[s];if(Lt(i))t[s]=n9(s,i,o);else if(i!=null){const r=ky(i);t[s]=()=>r}}},c3=(e,t)=>{const n=ky(t);e.slots.default=()=>n},u3=(e,t,n)=>{for(const o in t)(n||!yy(o))&&(e[o]=t[o])},o9=(e,t,n)=>{const o=e.slots=s3();if(e.vnode.shapeFlag&32){const s=t._;s?(u3(o,t,n),n&&u4(o,"_",s,!0)):a3(t,o)}else t&&c3(e,t)},s9=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Yt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:u3(s,t,n):(i=!t.$stable,a3(t,s)),r=t}else t&&(c3(e,t),r={default:1});if(i)for(const l in s)!yy(l)&&r[l]==null&&delete s[l]},go=g3;function i9(e){return d3(e)}function r9(e){return d3(e,wT)}function d3(e,t){const n=Jp();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=yi,insertStaticContent:p}=e,g=(j,J,ye,fe=null,ve=null,V=null,ee=void 0,pe=null,Ce=!!J.dynamicChildren)=>{if(j===J)return;j&&!Ii(j,J)&&(fe=Ae(j),ue(j,ve,V,!0),j=null),J.patchFlag===-2&&(Ce=!1,J.dynamicChildren=null);const{type:$e,ref:De,shapeFlag:ge}=J;switch($e){case wl:b(j,J,ye,fe);break;case ko:v(j,J,ye,fe);break;case Ic:j==null&&m(J,ye,fe,ee);break;case Pe:S(j,J,ye,fe,ve,V,ee,pe,Ce);break;default:ge&1?A(j,J,ye,fe,ve,V,ee,pe,Ce):ge&6?I(j,J,ye,fe,ve,V,ee,pe,Ce):(ge&64||ge&128)&&$e.process(j,J,ye,fe,ve,V,ee,pe,Ce,U)}De!=null&&ve?Tc(De,j&&j.ref,V,J||j,!J):De==null&&j&&j.ref!=null&&Tc(j.ref,null,V,j,!0)},b=(j,J,ye,fe)=>{if(j==null)o(J.el=l(J.children),ye,fe);else{const ve=J.el=j.el;J.children!==j.children&&c(ve,J.children)}},v=(j,J,ye,fe)=>{j==null?o(J.el=a(J.children||""),ye,fe):J.el=j.el},m=(j,J,ye,fe)=>{[j.el,j.anchor]=p(j.children,J,ye,fe,j.el,j.anchor)},y=({el:j,anchor:J},ye,fe)=>{let ve;for(;j&&j!==J;)ve=f(j),o(j,ye,fe),j=ve;o(J,ye,fe)},k=({el:j,anchor:J})=>{let ye;for(;j&&j!==J;)ye=f(j),s(j),j=ye;s(J)},A=(j,J,ye,fe,ve,V,ee,pe,Ce)=>{if(J.type==="svg"?ee="svg":J.type==="math"&&(ee="mathml"),j==null)$(J,ye,fe,ve,V,ee,pe,Ce);else{const $e=j.el&&j.el._isVueCE?j.el:null;try{$e&&$e._beginPatch(),E(j,J,ve,V,ee,pe,Ce)}finally{$e&&$e._endPatch()}}},$=(j,J,ye,fe,ve,V,ee,pe)=>{let Ce,$e;const{props:De,shapeFlag:ge,transition:Ne,dirs:et}=j;if(Ce=j.el=r(j.type,V,De&&De.is,De),ge&8?u(Ce,j.children):ge&16&&w(j.children,Ce,null,fe,ve,Q1(j,V),ee,pe),et&&Yi(j,null,fe,"created"),L(Ce,j,j.scopeId,ee,fe),De){for(const St in De)St!=="value"&&!ya(St)&&i(Ce,St,null,De[St],V,fe);"value"in De&&i(Ce,"value",null,De.value,V),($e=De.onVnodeBeforeMount)&&Ms($e,fe,j)}et&&Yi(j,null,fe,"beforeMount");const rt=f3(ve,Ne);rt&&Ne.beforeEnter(Ce),o(Ce,J,ye),(($e=De&&De.onVnodeMounted)||rt||et)&&go(()=>{try{$e&&Ms($e,fe,j),rt&&Ne.enter(Ce),et&&Yi(j,null,fe,"mounted")}finally{}},ve)},L=(j,J,ye,fe,ve)=>{if(ye&&h(j,ye),fe)for(let V=0;V<fe.length;V++)h(j,fe[V]);if(ve){let V=ve.subTree;if(J===V||qh(V.type)&&(V.ssContent===J||V.ssFallback===J)){const ee=ve.vnode;L(j,ee,ee.scopeId,ee.slotScopeIds,ve.parent)}}},w=(j,J,ye,fe,ve,V,ee,pe,Ce=0)=>{for(let $e=Ce;$e<j.length;$e++){const De=j[$e]=pe?Cr(j[$e]):Ts(j[$e]);g(null,De,J,ye,fe,ve,V,ee,pe)}},E=(j,J,ye,fe,ve,V,ee)=>{const pe=J.el=j.el;let{patchFlag:Ce,dynamicChildren:$e,dirs:De}=J;Ce|=j.patchFlag&16;const ge=j.props||Yt,Ne=J.props||Yt;let et;if(ye&&Jl(ye,!1),(et=Ne.onVnodeBeforeUpdate)&&Ms(et,ye,J,j),De&&Yi(J,j,ye,"beforeUpdate"),ye&&Jl(ye,!0),(ge.innerHTML&&Ne.innerHTML==null||ge.textContent&&Ne.textContent==null)&&u(pe,""),$e?T(j.dynamicChildren,$e,pe,ye,fe,Q1(J,ve),V):ee||R(j,J,pe,null,ye,fe,Q1(J,ve),V,!1),Ce>0){if(Ce&16)F(pe,ge,Ne,ye,ve);else if(Ce&2&&ge.class!==Ne.class&&i(pe,"class",null,Ne.class,ve),Ce&4&&i(pe,"style",ge.style,Ne.style,ve),Ce&8){const rt=J.dynamicProps;for(let St=0;St<rt.length;St++){const vt=rt[St],Nt=ge[vt],Wt=Ne[vt];(Wt!==Nt||vt==="value")&&i(pe,vt,Nt,Wt,ve,ye)}}Ce&1&&j.children!==J.children&&u(pe,J.children)}else!ee&&$e==null&&F(pe,ge,Ne,ye,ve);((et=Ne.onVnodeUpdated)||De)&&go(()=>{et&&Ms(et,ye,J,j),De&&Yi(J,j,ye,"updated")},fe)},T=(j,J,ye,fe,ve,V,ee)=>{for(let pe=0;pe<J.length;pe++){const Ce=j[pe],$e=J[pe],De=Ce.el&&(Ce.type===Pe||!Ii(Ce,$e)||Ce.shapeFlag&198)?d(Ce.el):ye;g(Ce,$e,De,null,fe,ve,V,ee,!0)}},F=(j,J,ye,fe,ve)=>{if(J!==ye){if(J!==Yt)for(const V in J)!ya(V)&&!(V in ye)&&i(j,V,J[V],null,ve,fe);for(const V in ye){if(ya(V))continue;const ee=ye[V],pe=J[V];ee!==pe&&V!=="value"&&i(j,V,pe,ee,ve,fe)}"value"in ye&&i(j,"value",J.value,ye.value,ve)}},S=(j,J,ye,fe,ve,V,ee,pe,Ce)=>{const $e=J.el=j?j.el:l(""),De=J.anchor=j?j.anchor:l("");let{patchFlag:ge,dynamicChildren:Ne,slotScopeIds:et}=J;et&&(pe=pe?pe.concat(et):et),j==null?(o($e,ye,fe),o(De,ye,fe),w(J.children||[],ye,De,ve,V,ee,pe,Ce)):ge>0&&ge&64&&Ne&&j.dynamicChildren&&j.dynamicChildren.length===Ne.length?(T(j.dynamicChildren,Ne,ye,ve,V,ee,pe),(J.key!=null||ve&&J===ve.subTree)&&by(j,J,!0)):R(j,J,ye,De,ve,V,ee,pe,Ce)},I=(j,J,ye,fe,ve,V,ee,pe,Ce)=>{J.slotScopeIds=pe,j==null?J.shapeFlag&512?ve.ctx.activate(J,ye,fe,ee,Ce):P(J,ye,fe,ve,V,ee,Ce):D(j,J,Ce)},P=(j,J,ye,fe,ve,V,ee)=>{const pe=j.component=b3(j,fe,ve);if(Hd(j)&&(pe.ctx.renderer=U),w3(pe,!1,ee),pe.asyncDep){if(ve&&ve.registerDep(pe,W,ee),!j.el){const Ce=pe.subTree=ie(ko);v(null,Ce,J,ye),j.placeholder=Ce.el}}else W(pe,j,J,ye,ve,V,ee)},D=(j,J,ye)=>{const fe=J.component=j.component;if(QT(j,J,ye))if(fe.asyncDep&&!fe.asyncResolved){z(fe,J,ye);return}else fe.next=J,fe.update();else J.el=j.el,fe.vnode=J},W=(j,J,ye,fe,ve,V,ee)=>{const pe=()=>{if(j.isMounted){let{next:ge,bu:Ne,u:et,parent:rt,vnode:St}=j;{const dn=h3(j);if(dn){ge&&(ge.el=St.el,z(j,ge,ee)),dn.asyncDep.then(()=>{go(()=>{j.isUnmounted||$e()},ve)});return}}let vt=ge,Nt;Jl(j,!1),ge?(ge.el=St.el,z(j,ge,ee)):ge=St,Ne&&Mc(Ne),(Nt=ge.props&&ge.props.onVnodeBeforeUpdate)&&Ms(Nt,rt,ge,St),Jl(j,!0);const Wt=dh(j),ht=j.subTree;j.subTree=Wt,g(ht,Wt,d(ht.el),Ae(ht),j,ve,V),ge.el=Wt.el,vt===null&&um(j,Wt.el),et&&go(et,ve),(Nt=ge.props&&ge.props.onVnodeUpdated)&&go(()=>Ms(Nt,rt,ge,St),ve)}else{let ge;const{el:Ne,props:et}=J,{bm:rt,m:St,parent:vt,root:Nt,type:Wt}=j,ht=$r(J);if(Jl(j,!1),rt&&Mc(rt),!ht&&(ge=et&&et.onVnodeBeforeMount)&&Ms(ge,vt,J),Jl(j,!0),Ne&&se){const dn=()=>{j.subTree=dh(j),se(Ne,j.subTree,j,ve,null)};ht&&Wt.__asyncHydrate?Wt.__asyncHydrate(Ne,j,dn):dn()}else{Nt.ce&&Nt.ce._hasShadowRoot()&&Nt.ce._injectChildStyle(Wt,j.parent?j.parent.type:void 0);const dn=j.subTree=dh(j);g(null,dn,ye,fe,j,ve,V),J.el=dn.el}if(St&&go(St,ve),!ht&&(ge=et&&et.onVnodeMounted)){const dn=J;go(()=>Ms(ge,vt,dn),ve)}(J.shapeFlag&256||vt&&$r(vt.vnode)&&vt.vnode.shapeFlag&256)&&j.a&&go(j.a,ve),j.isMounted=!0,J=ye=fe=null}};j.scope.on();const Ce=j.effect=new Fh(pe);j.scope.off();const $e=j.update=Ce.run.bind(Ce),De=j.job=Ce.runIfDirty.bind(Ce);De.i=j,De.id=j.uid,Ce.scheduler=()=>uy(De),Jl(j,!0),$e()},z=(j,J,ye)=>{J.component=j;const fe=j.vnode.props;j.vnode=J,j.next=null,e9(j,J.props,fe,ye),s9(j,J.children,ye),Rr(),Fb(j),Br()},R=(j,J,ye,fe,ve,V,ee,pe,Ce=!1)=>{const $e=j&&j.children,De=j?j.shapeFlag:0,ge=J.children,{patchFlag:Ne,shapeFlag:et}=J;if(Ne>0){if(Ne&128){K($e,ge,ye,fe,ve,V,ee,pe,Ce);return}else if(Ne&256){q($e,ge,ye,fe,ve,V,ee,pe,Ce);return}}et&8?(De&16&&de($e,ve,V),ge!==$e&&u(ye,ge)):De&16?et&16?K($e,ge,ye,fe,ve,V,ee,pe,Ce):de($e,ve,V,!0):(De&8&&u(ye,""),et&16&&w(ge,ye,fe,ve,V,ee,pe,Ce))},q=(j,J,ye,fe,ve,V,ee,pe,Ce)=>{j=j||Cc,J=J||Cc;const $e=j.length,De=J.length,ge=Math.min($e,De);let Ne;for(Ne=0;Ne<ge;Ne++){const et=J[Ne]=Ce?Cr(J[Ne]):Ts(J[Ne]);g(j[Ne],et,ye,null,ve,V,ee,pe,Ce)}$e>De?de(j,ve,V,!0,!1,ge):w(J,ye,fe,ve,V,ee,pe,Ce,ge)},K=(j,J,ye,fe,ve,V,ee,pe,Ce)=>{let $e=0;const De=J.length;let ge=j.length-1,Ne=De-1;for(;$e<=ge&&$e<=Ne;){const et=j[$e],rt=J[$e]=Ce?Cr(J[$e]):Ts(J[$e]);if(Ii(et,rt))g(et,rt,ye,null,ve,V,ee,pe,Ce);else break;$e++}for(;$e<=ge&&$e<=Ne;){const et=j[ge],rt=J[Ne]=Ce?Cr(J[Ne]):Ts(J[Ne]);if(Ii(et,rt))g(et,rt,ye,null,ve,V,ee,pe,Ce);else break;ge--,Ne--}if($e>ge){if($e<=Ne){const et=Ne+1,rt=et<De?J[et].el:fe;for(;$e<=Ne;)g(null,J[$e]=Ce?Cr(J[$e]):Ts(J[$e]),ye,rt,ve,V,ee,pe,Ce),$e++}}else if($e>Ne)for(;$e<=ge;)ue(j[$e],ve,V,!0),$e++;else{const et=$e,rt=$e,St=new Map;for($e=rt;$e<=Ne;$e++){const Dt=J[$e]=Ce?Cr(J[$e]):Ts(J[$e]);Dt.key!=null&&St.set(Dt.key,$e)}let vt,Nt=0;const Wt=Ne-rt+1;let ht=!1,dn=0;const fn=new Array(Wt);for($e=0;$e<Wt;$e++)fn[$e]=0;for($e=et;$e<=ge;$e++){const Dt=j[$e];if(Nt>=Wt){ue(Dt,ve,V,!0);continue}let Pn;if(Dt.key!=null)Pn=St.get(Dt.key);else for(vt=rt;vt<=Ne;vt++)if(fn[vt-rt]===0&&Ii(Dt,J[vt])){Pn=vt;break}Pn===void 0?ue(Dt,ve,V,!0):(fn[Pn-rt]=$e+1,Pn>=dn?dn=Pn:ht=!0,g(Dt,J[Pn],ye,null,ve,V,ee,pe,Ce),Nt++)}const ss=ht?l9(fn):Cc;for(vt=ss.length-1,$e=Wt-1;$e>=0;$e--){const Dt=rt+$e,Pn=J[Dt],ao=J[Dt+1],it=Dt+1<De?ao.el||p3(ao):fe;fn[$e]===0?g(null,Pn,ye,it,ve,V,ee,pe,Ce):ht&&(vt<0||$e!==ss[vt]?X(Pn,ye,it,2):vt--)}}},X=(j,J,ye,fe,ve=null)=>{const{el:V,type:ee,transition:pe,children:Ce,shapeFlag:$e}=j;if($e&6){X(j.component.subTree,J,ye,fe);return}if($e&128){j.suspense.move(J,ye,fe);return}if($e&64){ee.move(j,J,ye,U);return}if(ee===Pe){o(V,J,ye);for(let ge=0;ge<Ce.length;ge++)X(Ce[ge],J,ye,fe);o(j.anchor,J,ye);return}if(ee===Ic){y(j,J,ye);return}if(fe!==2&&$e&1&&pe)if(fe===0)pe.persisted&&!V[fi]?o(V,J,ye):(pe.beforeEnter(V),o(V,J,ye),go(()=>pe.enter(V),ve));else{const{leave:ge,delayLeave:Ne,afterLeave:et}=pe,rt=()=>{j.ctx.isUnmounted?s(V):o(V,J,ye)},St=()=>{const vt=V._isLeaving||!!V[fi];V._isLeaving&&V[fi](!0),pe.persisted&&!vt?rt():ge(V,()=>{rt(),et&&et()})};Ne?Ne(V,rt,St):St()}else o(V,J,ye)},ue=(j,J,ye,fe=!1,ve=!1)=>{const{type:V,props:ee,ref:pe,children:Ce,dynamicChildren:$e,shapeFlag:De,patchFlag:ge,dirs:Ne,cacheIndex:et,memo:rt}=j;if(ge===-2&&(ve=!1),pe!=null&&(Rr(),Tc(pe,null,ye,j,!0),Br()),et!=null&&(J.renderCache[et]=void 0),De&256){J.ctx.deactivate(j);return}const St=De&1&&Ne,vt=!$r(j);let Nt;if(vt&&(Nt=ee&&ee.onVnodeBeforeUnmount)&&Ms(Nt,J,j),De&6)ce(j.component,ye,fe);else{if(De&128){j.suspense.unmount(ye,fe);return}St&&Yi(j,null,J,"beforeUnmount"),De&64?j.type.remove(j,J,ye,U,fe):$e&&!$e.hasOnce&&(V!==Pe||ge>0&&ge&64)?de($e,J,ye,!1,!0):(V===Pe&&ge&384||!ve&&De&16)&&de(Ce,J,ye),fe&&me(j)}const Wt=rt!=null&&et==null;(vt&&(Nt=ee&&ee.onVnodeUnmounted)||St||Wt)&&go(()=>{Nt&&Ms(Nt,J,j),St&&Yi(j,null,J,"unmounted"),Wt&&(j.el=null)},ye)},me=j=>{const{type:J,el:ye,anchor:fe,transition:ve}=j;if(J===Pe){ne(ye,fe);return}if(J===Ic){k(j);return}const V=()=>{s(ye),ve&&!ve.persisted&&ve.afterLeave&&ve.afterLeave()};if(j.shapeFlag&1&&ve&&!ve.persisted){const{leave:ee,delayLeave:pe}=ve,Ce=()=>ee(ye,V);pe?pe(j.el,V,Ce):Ce()}else V()},ne=(j,J)=>{let ye;for(;j!==J;)ye=f(j),s(j),j=ye;s(J)},ce=(j,J,ye)=>{const{bum:fe,scope:ve,job:V,subTree:ee,um:pe,m:Ce,a:$e}=j;Uh(Ce),Uh($e),fe&&Mc(fe),ve.stop(),V&&(V.flags|=8,ue(ee,j,J,ye)),pe&&go(pe,J),go(()=>{j.isUnmounted=!0},J)},de=(j,J,ye,fe=!1,ve=!1,V=0)=>{for(let ee=V;ee<j.length;ee++)ue(j[ee],J,ye,fe,ve)},Ae=j=>{if(j.shapeFlag&6)return Ae(j.component.subTree);if(j.shapeFlag&128)return j.suspense.next();const J=f(j.anchor||j.el),ye=J&&J[H4];return ye?f(ye):J};let Le=!1;const le=(j,J,ye)=>{let fe;j==null?J._vnode&&(ue(J._vnode,null,null,!0),fe=J._vnode.component):g(J._vnode||null,j,J,null,null,null,ye),J._vnode=j,Le||(Le=!0,Fb(fe),Hh(),Le=!1)},U={p:g,um:ue,m:X,r:me,mt:P,mc:w,pc:R,pbc:T,n:Ae,o:e};let ae,se;return t&&([ae,se]=t(U)),{render:le,hydrate:ae,createApp:VT(le,ae)}}function Q1({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 Jl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function f3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function by(e,t,n=!1){const o=e.children,s=t.children;if(wt(o)&&wt(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]=Cr(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&by(r,l)),l.type===wl&&(l.patchFlag===-1&&(l=s[i]=Cr(l)),l.el=r.el),l.type===ko&&!l.el&&(l.el=r.el)}}function l9(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 h3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:h3(t)}function Uh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function p3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?p3(t.subTree):null}const qh=e=>e.__isSuspense;let $g=0;const a9={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)c9(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}u9(e,t,n,o,s,r,l,a,c)}},hydrate:d9,normalize:f9},Mwe=a9;function vd(e,t){const n=e.props&&e.props[t];Lt(n)&&n()}function c9(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=m3(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?(vd(e,"onPending"),vd(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Nc(f,e.ssFallback)):f.resolve(!1,!0)}function u9(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:g,isInFallback:b,isHydrating:v}=d;if(g)d.pendingBranch=f,Ii(g,f)?(a(g,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(v||(a(p,h,n,o,s,null,i,r,l),Nc(d,h)))):(d.pendingId=$g++,v?(d.isHydrating=!1,d.activeBranch=g):c(g,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),Nc(d,h))):p&&Ii(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Ii(p,f))a(p,f,n,o,s,d,i,r,l),Nc(d,f);else if(vd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=$g++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:m,pendingId:y}=d;m>0?setTimeout(()=>{d.pendingId===y&&d.fallback(h)},m):m===0&&d.fallback(h)}}function m3(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:b}}=c;let v;const m=h9(e);m&&t&&t.pendingBranch&&(v=t.pendingId,t.deps++);const y=e.props?$h(e.props.timeout):void 0,k=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:$g++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,L=!1){const{vnode:w,activeBranch:E,pendingBranch:T,pendingId:F,effects:S,parentComponent:I,container:P,isInFallback:D}=A;let W=!1;if(A.isHydrating)A.isHydrating=!1;else if(!$){W=E&&T.transition&&T.transition.mode==="out-in";let q=!1;W&&(E.transition.afterLeave=()=>{F===A.pendingId&&(f(T,P,i===k&&!q?p(E):i,0),Ph(S),D&&w.ssFallback&&(w.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(g(E.el)===P&&(i=p(E),q=!0),h(E,I,A,!0),!W&&D&&w.ssFallback&&go(()=>w.ssFallback.el=null,A)),W||f(T,P,i,0)}A.isFallbackMountPending=!1,Nc(A,T),A.pendingBranch=null,A.isInFallback=!1;let z=A.parent,R=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),R=!0;break}z=z.parent}!R&&!W&&Ph(S),A.effects=[],m&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,t.deps===0&&!L&&t.resolve()),vd(w,"onResolve")},fallback($){if(!A.pendingBranch)return;const{vnode:L,activeBranch:w,parentComponent:E,container:T,namespace:F}=A;vd(L,"onFallback");const S=p(w),I=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,$,T,S,E,null,F,l,a),Nc(A,$))},P=$.transition&&$.transition.mode==="out-in";P&&(A.isFallbackMountPending=!0,w.transition.afterLeave=I),A.isInFallback=!0,h(w,E,null,!0),P||I()},move($,L,w){A.activeBranch&&f(A.activeBranch,$,L,w),A.container=$},next(){return A.activeBranch&&p(A.activeBranch)},registerDep($,L,w){const E=!!A.pendingBranch;E&&A.deps++;const T=$.vnode.el;$.asyncDep.catch(F=>{eu(F,$,0)}).then(F=>{if($.isUnmounted||A.isUnmounted||A.pendingId!==$.suspenseId)return;yd(),$.asyncResolved=!0;const{vnode:S}=$;Fg($,F,!1),T&&(S.el=T);const I=!T&&$.subTree.el;L($,S,g(T||$.subTree.el),T?null:p($.subTree),A,r,w),I&&(S.placeholder=null,b(I)),um($,S.el),E&&--A.deps===0&&A.resolve()})},unmount($,L){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,$,L),A.pendingBranch&&h(A.pendingBranch,n,$,L)}};return A}function d9(e,t,n,o,s,i,r,l,a){const c=t.suspense=m3(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 f9(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Gb(o?n.default:n),e.ssFallback=o?Gb(n.fallback):ie(ko)}function Gb(e){let t;if(Lt(e)){const n=Sa&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=ns,v3())}return wt(e)&&(e=YT(e)),e=Ts(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function g3(e,t){t&&t.pendingBranch?wt(e)?t.effects.push(...e):t.effects.push(e):Ph(e)}function Nc(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,um(o,s))}function h9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),wl=Symbol.for("v-txt"),ko=Symbol.for("v-cmt"),Ic=Symbol.for("v-stc"),Yu=[];let ns=null;function x(e=!1){Yu.push(ns=e?null:[])}function v3(){Yu.pop(),ns=Yu[Yu.length-1]||null}let Sa=1;function jh(e,t=!1){Sa+=e,e<0&&ns&&t&&(ns.hasOnce=!0)}function y3(e){return e.dynamicChildren=Sa>0?ns||Cc:null,v3(),Sa>0&&ns&&ns.push(e),e}function N(e,t,n,o,s,i){return y3(_(e,t,n,o,s,i,!0))}function ke(e,t,n,o,s){return y3(ie(e,t,n,o,s,!0))}function El(e){return e?e.__v_isVNode===!0:!1}function Ii(e,t){return e.type===t.type&&e.key===t.key}function Ewe(e){}const k3=({key:e})=>e??null,fh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Cn(e)||fo(e)||Lt(e)?{i:Go,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&k3(t),ref:t&&fh(t),scopeId:rm,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:Go};return l?(wy(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Cn(n)?8:16),Sa>0&&!r&&ns&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&ns.push(a),a}const ie=p9;function p9(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===Y4)&&(e=ko),El(e)){const l=Pr(e,t,!0);return n&&wy(l,n),Sa>0&&!i&&ns&&(l.shapeFlag&6?ns[ns.indexOf(e)]=l:ns.push(l)),l.patchFlag=-2,l}if(b9(e)&&(e=e.__vccOpts),t){t=m9(t);let{class:l,style:a}=t;l&&!Cn(l)&&(t.class=We(l)),cn(a)&&(im(a)&&!wt(a)&&(a=bn({},a)),t.style=Vt(a))}const r=Cn(e)?1:qh(e)?128:W4(e)?64:cn(e)?4:Lt(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function m9(e){return e?im(e)||i3(e)?bn({},e):e:null}function Pr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?kn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&k3(c),ref:t&&t.ref?n&&i?wt(i)?i.concat(fh(t)):[i,fh(t)]:fh(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Pr(e.ssContent),ssFallback:e.ssFallback&&Pr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Ml(u,a.clone(u)),u}function Xe(e=" ",t=0){return ie(wl,null,e,t)}function xy(e,t){const n=ie(Ic,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(x(),ke(ko,null,e)):ie(ko,null,e)}function Ts(e){return e==null||typeof e=="boolean"?ie(ko):wt(e)?ie(Pe,null,e.slice()):El(e)?Cr(e):ie(wl,null,String(e))}function Cr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Pr(e)}function wy(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(wt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),wy(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!i3(t)?t._ctx=Go:s===3&&Go&&(Go.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Lt(t)?(t={default:t,_ctx:Go},n=32):(t=String(t),o&64?(n=16,t=[Xe(t)]):n=8);e.children=t,e.shapeFlag|=n}function kn(...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=We([t.class,o.class]));else if(s==="style")t.style=Vt([t.style,o.style]);else if(Bd(s)){const i=t[s],r=o[s];r&&i!==r&&!(wt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Kp(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Ms(e,t,n,o=null){xi(e,t,7,[n,o])}const g9=J4();let v9=0;function b3(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||g9,i={uid:v9++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new p4(!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:l3(o,s),emitsOptions:t3(o,s),emit:null,emitted:null,propsDefaults:Yt,inheritAttrs:o.inheritAttrs,ctx:Yt,data:Yt,props:Yt,attrs:Yt,slots:Yt,refs:Yt,setupState:Yt,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=KT.bind(null,i),e.ce&&e.ce(i),i}let Ko=null;const Zo=()=>Ko||Go;let Vh,Lc;{const e=Jp(),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)}};Vh=t("__VUE_INSTANCE_SETTERS__",n=>Ko=n),Lc=t("__VUE_SSR_SETTERS__",n=>Ca=n)}const tu=e=>{const t=Ko;return Vh(e),e.scope.on(),()=>{e.scope.off(),Vh(t)}},yd=()=>{Ko&&Ko.scope.off(),Vh(null)};function x3(e){return e.vnode.shapeFlag&4}let Ca=!1;function w3(e,t=!1,n=!1){t&&Lc(t);const{props:o,children:s}=e.vnode,i=x3(e);JT(e,o,i,t),o9(e,s,n||t);const r=i?y9(e,t):void 0;return t&&Lc(!1),r}function y9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Tg);const{setup:o}=n;if(o){Rr();const s=e.setupContext=o.length>1?S3(e):null,i=tu(e),r=Dd(o,e,0,[e.props,s]),l=sy(r);if(Br(),i(),(l||e.sp)&&!$r(e)&&fy(e),l){if(r.then(yd,yd),t)return r.then(a=>{Fg(e,a,t)}).catch(a=>{eu(a,e,0)});e.asyncDep=r}else Fg(e,r,t)}else _3(e,t)}function Fg(e,t,n){Lt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:cn(t)&&(e.setupState=L4(t)),_3(e,n)}let Kh,Og;function Twe(e){Kh=e,Og=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,PT))}}const Nwe=()=>!Kh;function _3(e,t,n){const o=e.type;if(!e.render){if(!t&&Kh&&!o.render){const s=o.template||vy(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=bn(bn({isCustomElement:i,delimiters:l},r),a);o.render=Kh(s,c)}}e.render=o.render||yi,Og&&Og(e)}{const s=tu(e);Rr();try{HT(e)}finally{Br(),s()}}}const k9={get(e,t){return ts(e,"get",""),e[t]}};function S3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,k9),slots:e.slots,emit:e.emit,expose:t}}function zd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(L4(mt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Gu)return Gu[n](e)},has(t,n){return n in t||n in Gu}})):e.proxy}function Rg(e,t=!0){return Lt(e)?e.displayName||e.name:e.name||t&&e.__name}function b9(e){return Lt(e)&&"__vccOpts"in e}const B=(e,t)=>nT(e,t,Ca);function gn(e,t,n){try{jh(-1);const o=arguments.length;return o===2?cn(t)&&!wt(t)?El(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&El(n)&&(n=[n]),ie(e,t,n))}finally{jh(1)}}function Iwe(){}function Lwe(e,t,n,o){const s=n[o];if(s&&x9(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function x9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(jo(n[o],t[o]))return!1;return Sa>0&&ns&&ns.push(e),!0}const w9="3.5.35",$we=yi,Fwe=lT,Owe=uc,Rwe=D4,_9={createComponentInstance:b3,setupComponent:w3,renderComponentRoot:dh,setCurrentRenderingInstance:pd,isVNode:El,normalizeVNode:Ts,getComponentPublicInstance:zd,ensureValidVNode:gy,pushWarningContext:iT,popWarningContext:rT},Bwe=_9,Dwe=null,Pwe=null,Hwe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Bg;const Yb=typeof window<"u"&&window.trustedTypes;if(Yb)try{Bg=Yb.createPolicy("vue",{createHTML:e=>e})}catch{}const C3=Bg?e=>Bg.createHTML(e):e=>e,S9="http://www.w3.org/2000/svg",C9="http://www.w3.org/1998/Math/MathML",br=typeof document<"u"?document:null,Zb=br&&br.createElement("template"),A9={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"?br.createElementNS(S9,e):t==="mathml"?br.createElementNS(C9,e):n?br.createElement(e,{is:n}):br.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>br.createTextNode(e),createComment:e=>br.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>br.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{Zb.innerHTML=C3(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Zb.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]}},Jr="transition",Mu="animation",qc=Symbol("_vtc"),A3={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},M3=bn({},U4,A3),M9=e=>(e.displayName="Transition",e.props=M3,e),Tl=M9((e,{slots:t})=>gn(kT,E3(e),t)),ea=(e,t=[])=>{wt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Xb=e=>e?wt(e)?e.some(t=>t.length>1):e.length>1:!1;function E3(e){const t={};for(const S in e)S in A3||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=E9(s),g=p&&p[0],b=p&&p[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:k,onLeaveCancelled:A,onBeforeAppear:$=v,onAppear:L=m,onAppearCancelled:w=y}=t,E=(S,I,P,D)=>{S._enterCancelled=D,cl(S,I?u:l),cl(S,I?c:r),P&&P()},T=(S,I)=>{S._isLeaving=!1,cl(S,d),cl(S,h),cl(S,f),I&&I()},F=S=>(I,P)=>{const D=S?L:m,W=()=>E(I,S,P);ea(D,[I,W]),Qb(()=>{cl(I,S?a:i),Ki(I,S?u:l),Xb(D)||Jb(I,o,g,W)})};return bn(t,{onBeforeEnter(S){ea(v,[S]),Ki(S,i),Ki(S,r)},onBeforeAppear(S){ea($,[S]),Ki(S,a),Ki(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,I){S._isLeaving=!0;const P=()=>T(S,I);Ki(S,d),S._enterCancelled?(Ki(S,f),Dg(S)):(Dg(S),Ki(S,f)),Qb(()=>{S._isLeaving&&(cl(S,d),Ki(S,h),Xb(k)||Jb(S,o,b,P))}),ea(k,[S,P])},onEnterCancelled(S){E(S,!1,void 0,!0),ea(y,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),ea(w,[S])},onLeaveCancelled(S){T(S),ea(A,[S])}})}function E9(e){if(e==null)return null;if(cn(e))return[J1(e.enter),J1(e.leave)];{const t=J1(e);return[t,t]}}function J1(e){return $h(e)}function Ki(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[qc]||(e[qc]=new Set)).add(t)}function cl(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[qc];n&&(n.delete(t),n.size||(e[qc]=void 0))}function Qb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let T9=0;function Jb(e,t,n,o){const s=e._endId=++T9,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=T3(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function T3(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${Jr}Delay`),i=o(`${Jr}Duration`),r=ex(s,i),l=o(`${Mu}Delay`),a=o(`${Mu}Duration`),c=ex(l,a);let u=null,d=0,f=0;t===Jr?r>0&&(u=Jr,d=r,f=i.length):t===Mu?c>0&&(u=Mu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Jr:Mu:null,f=u?u===Jr?i.length:a.length:0);const h=u===Jr&&/\b(?:transform|all)(?:,|$)/.test(o(`${Jr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function ex(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>tx(n)+tx(e[o])))}function tx(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Dg(e){return(e?e.ownerDocument:document).body.offsetHeight}function N9(e,t,n){const o=e[qc];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Gh=Symbol("_vod"),N3=Symbol("_vsh"),mi={name:"show",beforeMount(e,{value:t},{transition:n}){e[Gh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Eu(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),Eu(e,!0),o.enter(e)):o.leave(e,()=>{Eu(e,!1)}):Eu(e,t))},beforeUnmount(e,{value:t}){Eu(e,t)}};function Eu(e,t){e.style.display=t?e[Gh]:"none",e[N3]=!t}function I9(){mi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const I3=Symbol("");function Wwe(e){const t=Zo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Yh(i,s))},o=()=>{const s=e(t.proxy);t.ce?Yh(t.ce,s):Pg(t.subTree,s),n(s)};G4(()=>{Ph(o)}),un(()=>{Je(o,yi,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),xn(()=>s.disconnect())})}function Pg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Pg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Yh(e.el,t);else if(e.type===Pe)e.children.forEach(n=>Pg(n,t));else if(e.type===Ic){let{el:n,anchor:o}=e;for(;n&&(Yh(n,t),n!==o);)n=n.nextSibling}}function Yh(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=EE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[I3]=o}}const L9=/(?:^|;)\s*display\s*:/;function $9(e,t,n){const o=e.style,s=Cn(n);let i=!1;if(n&&!s){if(t)if(Cn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Pu(o,l,"")}else for(const r in t)n[r]==null&&Pu(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?O9(e,r,!Cn(t)&&t?t[r]:void 0,l)||Pu(o,r,l):Pu(o,r,"")}}else if(s){if(t!==n){const r=o[I3];r&&(n+=";"+r),o.cssText=n,i=L9.test(n)}}else t&&e.removeAttribute("style");Gh in e&&(e[Gh]=i?o.display:"",e[N3]&&(o.display="none"))}const nx=/\s*!important$/;function Pu(e,t,n){if(wt(n))n.forEach(o=>Pu(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=F9(e,t);nx.test(n)?e.setProperty(Ns(o),n.replace(nx,""),"important"):e[o]=n}}const ox=["Webkit","Moz","ms"],e0={};function F9(e,t){const n=e0[t];if(n)return n;let o=To(t);if(o!=="filter"&&o in e)return e0[t]=o;o=Xp(o);for(let s=0;s<ox.length;s++){const i=ox[s]+o;if(i in e)return e0[t]=i}return t}function O9(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Cn(o)&&n===o}const sx="http://www.w3.org/1999/xlink";function ix(e,t,n,o,s,i=AE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(sx,t.slice(6,t.length)):e.setAttributeNS(sx,t,n):n==null||i&&!d4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Js(n)?String(n):n)}function rx(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?C3(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=d4(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 Tr(e,t,n,o){e.addEventListener(t,n,o)}function R9(e,t,n,o){e.removeEventListener(t,n,o)}const lx=Symbol("_vei");function B9(e,t,n,o,s=null){const i=e[lx]||(e[lx]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=D9(t);if(o){const c=i[t]=W9(o,s);Tr(e,l,c,a)}else r&&(R9(e,l,r,a),i[t]=void 0)}}const ax=/(?:Once|Passive|Capture)$/;function D9(e){let t;if(ax.test(e)){t={};let o;for(;o=e.match(ax);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ns(e.slice(2)),t]}let t0=0;const P9=Promise.resolve(),H9=()=>t0||(P9.then(()=>t0=0),t0=Date.now());function W9(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(wt(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&&xi(c,t,5,l)}}else xi(s,t,5,[o])};return n.value=e,n.attached=H9(),n}const cx=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,z9=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?N9(e,o,r):t==="style"?$9(e,n,o):Bd(t)?Kp(t)||B9(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):U9(e,t,o,r))?(rx(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ix(e,t,o,r,i,t!=="value")):e._isVueCE&&(q9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Cn(o)))?rx(e,To(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),ix(e,t,o,r))};function U9(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&cx(t)&&Lt(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 cx(t)&&Cn(n)?!1:t in e}function q9(e,t){const n=e._def.props;if(!n)return!1;const o=To(t);return Array.isArray(n)?n.some(s=>To(s)===o):Object.keys(n).some(s=>To(s)===o)}const ux={};function j9(e,t,n){let o=Ze(e,t);Gp(o)&&(o=bn({},o,t));class s extends _y{constructor(r){super(o,r,n)}}return s.def=o,s}const zwe=((e,t)=>j9(e,t,aN)),V9=typeof HTMLElement<"u"?HTMLElement:class{};class _y extends V9{constructor(t,n={},o=Qh){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!==Qh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(bn({},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 _y){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!wt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=$h(this._props[a])),(l||(l=Object.create(null)))[To(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)an(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=wt(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(To))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):ux;const s=To(t);n&&this._numberProps&&this._numberProps[s]&&(o=$h(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===ux?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(Ns(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ns(t),n+""):n||this.removeAttribute(Ns(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),lN(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,bn(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,Gp(r[0])?bn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Ns(i)!==i&&s(Ns(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 K9(e){const t=Zo(),n=t&&t.ce;return n||null}function Uwe(){const e=K9();return e&&e.shadowRoot}function qwe(e="$style"){{const t=Zo();if(!t)return Yt;const n=t.type.__cssModules;if(!n)return Yt;const o=n[e];return o||Yt}}const L3=new WeakMap,$3=new WeakMap,Zh=Symbol("_moveCb"),dx=Symbol("_enterCb"),G9=e=>(delete e.props.mode,e),Y9=G9({name:"TransitionGroup",props:bn({},M3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Zo(),o=z4();let s,i;return hy(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!eN(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(X9),s.forEach(Q9);const l=s.filter(J9);Dg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ki(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Zh]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Zh]=null,cl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=tn(e),l=E3(r);let a=r.tag||Pe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Ml(u,md(u,l,o,n)),L3.set(u,F3(u.el)))}i=t.default?dy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Ml(u,md(u,l,o,n))}return ie(a,null,i)}}}),Z9=Y9;function X9(e){const t=e.el;t[Zh]&&t[Zh](),t[dx]&&t[dx]()}function Q9(e){$3.set(e,F3(e.el))}function J9(e){const t=L3.get(e),n=$3.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 F3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function eN(e,t,n){const o=e.cloneNode(),s=e[qc];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}=T3(o);return i.removeChild(o),r}const Nl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return wt(t)?n=>Mc(t,n):t};function tN(e){e.target.composing=!0}function fx(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ki=Symbol("_assign");function hx(e,t,n){return t&&(e=e.trim()),n&&(e=Qp(e)),e}const _s={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[ki]=Nl(s);const i=o||s.props&&s.props.type==="number";Tr(e,t?"change":"input",r=>{r.target.composing||e[ki](hx(e.value,n,i))}),(n||i)&&Tr(e,"change",()=>{e.value=hx(e.value,n,i)}),t||(Tr(e,"compositionstart",tN),Tr(e,"compositionend",fx),Tr(e,"change",fx))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[ki]=Nl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Qp(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)}},Xh={deep:!0,created(e,t,n){e[ki]=Nl(n),Tr(e,"change",()=>{const o=e._modelValue,s=jc(e),i=e.checked,r=e[ki];if(wt(o)){const l=em(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(Ia(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(R3(e,i))})},mounted:px,beforeUpdate(e,t,n){e[ki]=Nl(n),px(e,t,n)}};function px(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(wt(t))s=em(t,o.props.value)>-1;else if(Ia(t))s=t.has(o.props.value);else{if(t===n)return;s=Or(t,R3(e,!0))}e.checked!==s&&(e.checked=s)}const O3={created(e,{value:t},n){e.checked=Or(t,n.props.value),e[ki]=Nl(n),Tr(e,"change",()=>{e[ki](jc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[ki]=Nl(o),t!==n&&(e.checked=Or(t,o.props.value))}},Hg={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Ia(t);Tr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Qp(jc(r)):jc(r));e[ki](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[ki]=Nl(o)},mounted(e,{value:t}){mx(e,t)},beforeUpdate(e,t,n){e[ki]=Nl(n)},updated(e,{value:t}){e._assigning||mx(e,t)}};function mx(e,t){const n=e.multiple,o=wt(t);if(!(n&&!o&&!Ia(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=jc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=em(t,l)>-1}else r.selected=t.has(l);else if(Or(jc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function jc(e){return"_value"in e?e._value:e.value}function R3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const nN={created(e,t,n){$f(e,t,n,null,"created")},mounted(e,t,n){$f(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){$f(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){$f(e,t,n,o,"updated")}};function B3(e,t){switch(e){case"SELECT":return Hg;case"TEXTAREA":return _s;default:switch(t){case"checkbox":return Xh;case"radio":return O3;default:return _s}}}function $f(e,t,n,o,s){const r=B3(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function oN(){_s.getSSRProps=({value:e})=>({value:e}),O3.getSSRProps=({value:e},t)=>{if(t.props&&Or(t.props.value,e))return{checked:!0}},Xh.getSSRProps=({value:e},t)=>{if(wt(e)){if(t.props&&em(e,t.props.value)>-1)return{checked:!0}}else if(Ia(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},nN.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=B3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const sN=["ctrl","shift","alt","meta"],iN={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)=>sN.some(n=>e[`${n}Key`]&&!t.includes(n))},xt=(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=iN[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},rN={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ji=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Ns(s.key);if(t.some(r=>r===i||rN[r]===i))return e(s)}))},D3=bn({patchProp:z9},A9);let Zu,gx=!1;function P3(){return Zu||(Zu=i9(D3))}function H3(){return Zu=gx?Zu:r9(D3),gx=!0,Zu}const lN=((...e)=>{P3().render(...e)}),jwe=((...e)=>{H3().hydrate(...e)}),Qh=((...e)=>{const t=P3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=z3(o);if(!s)return;const i=t._component;!Lt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,W3(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),aN=((...e)=>{const t=H3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=z3(o);if(s)return n(s,!0,W3(s))},t});function W3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function z3(e){return Cn(e)?document.querySelector(e):e}let vx=!1;const Vwe=()=>{vx||(vx=!0,oN(),I9())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function cN(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Jh=typeof window<"u",Ol=(e,t=!1)=>t?Symbol.for(e):Symbol(e),uN=(e,t,n)=>dN({l:e,k:t,s:n}),dN=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),xo=e=>typeof e=="number"&&isFinite(e),U3=e=>Cy(e)==="[object Date]",Vc=e=>Cy(e)==="[object RegExp]",dm=e=>Xt(e)&&Object.keys(e).length===0,wo=Object.assign,fN=Object.create,Sn=(e=null)=>fN(e);let yx;const pa=()=>yx||(yx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Sn());function kx(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function hN(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const pN=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,mN=/^(?:href|src|action|formaction)$/i;function Sy(e){return pN.test(e)}function gN(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+=Sy(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function bx(e,t){if(mN.test(e)&&Sy(t))return"about:blank";const n=e.toLowerCase()==="style"?gN(t):t;return hN(n)}function vN(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${bx(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${bx(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)=>Sy(s)?`${o}about:blank`:n),e}const yN=Object.prototype.hasOwnProperty;function vi(e,t){return yN.call(e,t)}const io=Array.isArray,Kn=e=>typeof e=="function",kt=e=>typeof e=="string",on=e=>typeof e=="boolean",sn=e=>e!==null&&typeof e=="object",kN=e=>sn(e)&&Kn(e.then)&&Kn(e.catch),q3=Object.prototype.toString,Cy=e=>q3.call(e),Xt=e=>Cy(e)==="[object Object]",bN=e=>e==null?"":io(e)||Xt(e)&&e.toString===q3?JSON.stringify(e,null,2):String(e);function Ay(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Ff=e=>!sn(e)||io(e);function hh(e,t){if(Ff(e)||Ff(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__"&&(sn(o[i])&&!sn(s[i])&&(s[i]=Array.isArray(o[i])?[]:Sn()),Ff(s[i])||Ff(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 xN(e,t,n){return{line:e,column:t,offset:n}}function Wg(e,t,n){return{start:e,end:t}}const pn={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},wN=17;function fm(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 _N(e){throw e}const qi=" ",SN="\r",Jo=`
|
|
29
|
-
`,CN="\u2028",AN="\u2029";function MN(e){const t=e;let n=0,o=1,s=1,i=0;const r=L=>t[L]===SN&&t[L+1]===Jo,l=L=>t[L]===Jo,a=L=>t[L]===AN,c=L=>t[L]===CN,u=L=>r(L)||l(L)||a(L)||c(L),d=()=>n,f=()=>o,h=()=>s,p=()=>i,g=L=>r(L)||a(L)||c(L)?Jo:t[L],b=()=>g(n),v=()=>g(n+i);function m(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function y(){return r(n+i)&&i++,i++,t[n+i]}function k(){n=0,o=1,s=1,i=0}function A(L=0){i=L}function $(){const L=n+i;for(;L!==n;)m();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:b,currentPeek:v,next:m,peek:y,reset:k,resetPeek:A,skipToPeek:$}}const mr=void 0,EN=".",xx="'",TN="tokenizer";function NN(e,t={}){const n=t.location!==!1,o=MN(e),s=()=>o.index(),i=()=>xN(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(V,ee,pe,...Ce){const $e=c();if(ee.column+=pe,ee.offset+=pe,u){const De=n?Wg($e.startLoc,ee):null,ge=fm(V,De,{domain:TN,args:Ce});u(ge)}}function f(V,ee,pe){V.endLoc=i(),V.currentType=ee;const Ce={type:ee};return n&&(Ce.loc=Wg(V.startLoc,V.endLoc)),pe!=null&&(Ce.value=pe),Ce}const h=V=>f(V,13);function p(V,ee){return V.currentChar()===ee?(V.next(),ee):(d(pn.EXPECTED_TOKEN,i(),0,ee),"")}function g(V){let ee="";for(;V.currentPeek()===qi||V.currentPeek()===Jo;)ee+=V.currentPeek(),V.peek();return ee}function b(V){const ee=g(V);return V.skipToPeek(),ee}function v(V){if(V===mr)return!1;const ee=V.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee===95}function m(V){if(V===mr)return!1;const ee=V.charCodeAt(0);return ee>=48&&ee<=57}function y(V,ee){const{currentType:pe}=ee;if(pe!==2)return!1;g(V);const Ce=v(V.currentPeek());return V.resetPeek(),Ce}function k(V,ee){const{currentType:pe}=ee;if(pe!==2)return!1;g(V);const Ce=V.currentPeek()==="-"?V.peek():V.currentPeek(),$e=m(Ce);return V.resetPeek(),$e}function A(V,ee){const{currentType:pe}=ee;if(pe!==2)return!1;g(V);const Ce=V.currentPeek()===xx;return V.resetPeek(),Ce}function $(V,ee){const{currentType:pe}=ee;if(pe!==7)return!1;g(V);const Ce=V.currentPeek()===".";return V.resetPeek(),Ce}function L(V,ee){const{currentType:pe}=ee;if(pe!==8)return!1;g(V);const Ce=v(V.currentPeek());return V.resetPeek(),Ce}function w(V,ee){const{currentType:pe}=ee;if(!(pe===7||pe===11))return!1;g(V);const Ce=V.currentPeek()===":";return V.resetPeek(),Ce}function E(V,ee){const{currentType:pe}=ee;if(pe!==9)return!1;const Ce=()=>{const De=V.currentPeek();return De==="{"?v(V.peek()):De==="@"||De==="|"||De===":"||De==="."||De===qi||!De?!1:De===Jo?(V.peek(),Ce()):F(V,!1)},$e=Ce();return V.resetPeek(),$e}function T(V){g(V);const ee=V.currentPeek()==="|";return V.resetPeek(),ee}function F(V,ee=!0){const pe=($e=!1,De="")=>{const ge=V.currentPeek();return ge==="{"||ge==="@"||!ge?$e:ge==="|"?!(De===qi||De===Jo):ge===qi?(V.peek(),pe(!0,qi)):ge===Jo?(V.peek(),pe(!0,Jo)):!0},Ce=pe();return ee&&V.resetPeek(),Ce}function S(V,ee){const pe=V.currentChar();return pe===mr?mr:ee(pe)?(V.next(),pe):null}function I(V){const ee=V.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee>=48&&ee<=57||ee===95||ee===36}function P(V){return S(V,I)}function D(V){const ee=V.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee>=48&&ee<=57||ee===95||ee===36||ee===45}function W(V){return S(V,D)}function z(V){const ee=V.charCodeAt(0);return ee>=48&&ee<=57}function R(V){return S(V,z)}function q(V){const ee=V.charCodeAt(0);return ee>=48&&ee<=57||ee>=65&&ee<=70||ee>=97&&ee<=102}function K(V){return S(V,q)}function X(V){let ee="",pe="";for(;ee=R(V);)pe+=ee;return pe}function ue(V){let ee="";for(;;){const pe=V.currentChar();if(pe==="\\"){const Ce=V.peek();Ce==="{"||Ce==="}"||Ce==="@"||Ce==="|"||Ce==="\\"?(ee+=pe+Ce,V.next(),V.next()):(V.resetPeek(),ee+=pe,V.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===qi||pe===Jo)if(F(V))ee+=pe,V.next();else{if(T(V))break;ee+=pe,V.next()}else ee+=pe,V.next()}}return ee}function me(V){b(V);let ee="",pe="";for(;ee=W(V);)pe+=ee;const Ce=V.currentChar();if(Ce&&Ce!=="}"&&Ce!==mr&&Ce!==qi&&Ce!==Jo&&Ce!==" "){const $e=U(V);return d(pn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+$e),pe+$e}return V.currentChar()===mr&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function ne(V){b(V);let ee="";return V.currentChar()==="-"?(V.next(),ee+=`-${X(V)}`):ee+=X(V),V.currentChar()===mr&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),ee}function ce(V){return V!==xx&&V!==Jo}function de(V){b(V),p(V,"'");let ee="",pe="";for(;ee=S(V,ce);)ee==="\\"?pe+=Ae(V):pe+=ee;const Ce=V.currentChar();return Ce===Jo||Ce===mr?(d(pn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ce===Jo&&(V.next(),p(V,"'")),pe):(p(V,"'"),pe)}function Ae(V){const ee=V.currentChar();switch(ee){case"\\":case"'":return V.next(),`\\${ee}`;case"u":return Le(V,ee,4);case"U":return Le(V,ee,6);default:return d(pn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,ee),""}}function Le(V,ee,pe){p(V,ee);let Ce="";for(let $e=0;$e<pe;$e++){const De=K(V);if(!De){d(pn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${ee}${Ce}${V.currentChar()}`);break}Ce+=De}return`\\${ee}${Ce}`}function le(V){return V!=="{"&&V!=="}"&&V!==qi&&V!==Jo}function U(V){b(V);let ee="",pe="";for(;ee=S(V,le);)pe+=ee;return pe}function ae(V){let ee="",pe="";for(;ee=P(V);)pe+=ee;return pe}function se(V){const ee=pe=>{const Ce=V.currentChar();return Ce==="{"||Ce==="@"||Ce==="|"||Ce==="("||Ce===")"||!Ce||Ce===qi?pe:(pe+=Ce,V.next(),ee(pe))};return ee("")}function j(V){b(V);const ee=p(V,"|");return b(V),ee}function J(V,ee){let pe=null;switch(V.currentChar()){case"{":return ee.braceNest>=1&&d(pn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),V.next(),pe=f(ee,2,"{"),b(V),ee.braceNest++,pe;case"}":return ee.braceNest>0&&ee.currentType===2&&d(pn.EMPTY_PLACEHOLDER,i(),0),V.next(),pe=f(ee,3,"}"),ee.braceNest--,ee.braceNest>0&&b(V),ee.inLinked&&ee.braceNest===0&&(ee.inLinked=!1),pe;case"@":return ee.braceNest>0&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=ye(V,ee)||h(ee),ee.braceNest=0,pe;default:{let $e=!0,De=!0,ge=!0;if(T(V))return ee.braceNest>0&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(ee,1,j(V)),ee.braceNest=0,ee.inLinked=!1,pe;if(ee.braceNest>0&&(ee.currentType===4||ee.currentType===5||ee.currentType===6))return d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),ee.braceNest=0,fe(V,ee);if($e=y(V,ee))return pe=f(ee,4,me(V)),b(V),pe;if(De=k(V,ee))return pe=f(ee,5,ne(V)),b(V),pe;if(ge=A(V,ee))return pe=f(ee,6,de(V)),b(V),pe;if(!$e&&!De&&!ge)return pe=f(ee,12,U(V)),d(pn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),b(V),pe;break}}return pe}function ye(V,ee){const{currentType:pe}=ee;let Ce=null;const $e=V.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&($e===Jo||$e===qi)&&d(pn.INVALID_LINKED_FORMAT,i(),0),$e){case"@":return V.next(),Ce=f(ee,7,"@"),ee.inLinked=!0,Ce;case".":return b(V),V.next(),f(ee,8,".");case":":return b(V),V.next(),f(ee,9,":");default:return T(V)?(Ce=f(ee,1,j(V)),ee.braceNest=0,ee.inLinked=!1,Ce):$(V,ee)||w(V,ee)?(b(V),ye(V,ee)):L(V,ee)?(b(V),f(ee,11,ae(V))):E(V,ee)?(b(V),$e==="{"?J(V,ee)||Ce:f(ee,10,se(V))):(pe===7&&d(pn.INVALID_LINKED_FORMAT,i(),0),ee.braceNest=0,ee.inLinked=!1,fe(V,ee))}}function fe(V,ee){let pe={type:13};if(ee.braceNest>0)return J(V,ee)||h(ee);if(ee.inLinked)return ye(V,ee)||h(ee);switch(V.currentChar()){case"{":return J(V,ee)||h(ee);case"}":return d(pn.UNBALANCED_CLOSING_BRACE,i(),0),V.next(),f(ee,3,"}");case"@":return ye(V,ee)||h(ee);default:{if(T(V))return pe=f(ee,1,j(V)),ee.braceNest=0,ee.inLinked=!1,pe;if(F(V))return f(ee,0,ue(V));break}}return pe}function ve(){const{currentType:V,offset:ee,startLoc:pe,endLoc:Ce}=a;return a.lastType=V,a.lastOffset=ee,a.lastStartLoc=pe,a.lastEndLoc=Ce,a.offset=s(),a.startLoc=i(),o.currentChar()===mr?f(a,13):fe(o,a)}return{nextToken:ve,currentOffset:s,currentPosition:i,context:c}}const IN="parser",LN=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,$N=/\\([\\@{}|])/g;function FN(e,t){return t}function ON(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 RN(e={}){const t=e.location!==!1,{onError:n}=e;function o(v,m,y,k,...A){const $=v.currentPosition();if($.offset+=k,$.column+=k,n){const L=t?Wg(y,$):null,w=fm(m,L,{domain:IN,args:A});n(w)}}function s(v,m,y){const k={type:v};return t&&(k.start=m,k.end=m,k.loc={start:y,end:y}),k}function i(v,m,y,k){t&&(v.end=m,v.loc&&(v.loc.end=y))}function r(v,m){const y=v.context(),k=s(3,y.offset,y.startLoc);return k.value=m.replace($N,FN),i(k,v.currentOffset(),v.currentPosition()),k}function l(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(5,k,A);return $.index=parseInt(m,10),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function a(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(4,k,A);return $.key=m,v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function c(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(9,k,A);return $.value=m.replace(LN,ON),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function u(v){const m=v.nextToken(),y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(8,k,A);return m.type!==11?(o(v,pn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),$.value="",i($,k,A),{nextConsumeToken:m,node:$}):(m.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ji(m)),$.value=m.value||"",i($,v.currentOffset(),v.currentPosition()),{node:$})}function d(v,m){const y=v.context(),k=s(7,y.offset,y.startLoc);return k.value=m,i(k,v.currentOffset(),v.currentPosition()),k}function f(v){const m=v.context(),y=s(6,m.offset,m.startLoc);let k=v.nextToken();if(k.type===8){const A=u(v);y.modifier=A.node,k=A.nextConsumeToken||v.nextToken()}switch(k.type!==9&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),k=v.nextToken(),k.type===2&&(k=v.nextToken()),k.type){case 10:k.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=d(v,k.value||"");break;case 4:k.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=a(v,k.value||"");break;case 5:k.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=l(v,k.value||"");break;case 6:k.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=c(v,k.value||"");break;default:{o(v,pn.UNEXPECTED_EMPTY_LINKED_KEY,m.lastStartLoc,0);const A=v.context(),$=s(7,A.offset,A.startLoc);return $.value="",i($,A.offset,A.startLoc),y.key=$,i(y,A.offset,A.startLoc),{nextConsumeToken:k,node:y}}}return i(y,v.currentOffset(),v.currentPosition()),{node:y}}function h(v){const m=v.context(),y=m.currentType===1?v.currentOffset():m.offset,k=m.currentType===1?m.endLoc:m.startLoc,A=s(2,y,k);A.items=[];let $=null;do{const E=$||v.nextToken();switch($=null,E.type){case 0:E.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(r(v,E.value||""));break;case 5:E.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(l(v,E.value||""));break;case 4:E.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(a(v,E.value||""));break;case 6:E.value==null&&o(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(c(v,E.value||""));break;case 7:{const T=f(v);A.items.push(T.node),$=T.nextConsumeToken||null;break}}}while(m.currentType!==13&&m.currentType!==1);const L=m.currentType===1?m.lastOffset:v.currentOffset(),w=m.currentType===1?m.lastEndLoc:v.currentPosition();return i(A,L,w),A}function p(v,m,y,k){const A=v.context();let $=k.items.length===0;const L=s(1,m,y);L.cases=[],L.cases.push(k);do{const w=h(v);$||($=w.items.length===0),L.cases.push(w)}while(A.currentType!==13);return $&&o(v,pn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),i(L,v.currentOffset(),v.currentPosition()),L}function g(v){const m=v.context(),{offset:y,startLoc:k}=m,A=h(v);return m.currentType===13?A:p(v,y,k,A)}function b(v){const m=NN(v,wo({},e)),y=m.context(),k=s(0,y.offset,y.startLoc);return t&&k.loc&&(k.loc.source=v),k.body=g(m),e.onCacheKey&&(k.cacheKey=e.onCacheKey(v)),y.currentType!==13&&o(m,pn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),i(k,m.currentOffset(),m.currentPosition()),k}return{parse:b}}function ji(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 BN(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function wx(e,t){for(let n=0;n<e.length;n++)My(e[n],t)}function My(e,t){switch(e.type){case 1:wx(e.cases,t),t.helper("plural");break;case 2:wx(e.items,t);break;case 6:{My(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 DN(e,t={}){const n=BN(e);n.helper("normalize"),e.body&&My(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function PN(e){const t=e.body;return t.type===2?_x(t):t.cases.forEach(n=>_x(n)),e}function _x(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=Ay(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 dc(e){switch(e.t=e.type,e.type){case 0:{const t=e;dc(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++)dc(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++)dc(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;dc(t.key),t.k=t.key,delete t.key,t.modifier&&(dc(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 HN(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,b){r.code+=g}function c(g,b=!0){const v=b?o:"";a(s?v+" ".repeat(g):v)}function u(g=!0){const b=++r.indentLevel;g&&c(b)}function d(g=!0){const b=--r.indentLevel;g&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function WN(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Kc(e,t.key),t.modifier?(e.push(", "),Kc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function zN(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&&(Kc(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function UN(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&&(Kc(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function qN(e,t){t.body?Kc(e,t.body):e.push("null")}function Kc(e,t){const{helper:n}=e;switch(t.type){case 0:qN(e,t);break;case 1:UN(e,t);break;case 2:zN(e,t);break;case 6:WN(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 jN=(e,t={})=>{const n=kt(t.mode)?t.mode:"normal",o=kt(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=HN(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Ay(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Kc(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 VN(e,t={}){const n=wo({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=RN(n).parse(e);return o?(i&&PN(l),s&&dc(l),{ast:l,code:""}):(DN(l,n),jN(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function KN(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(pa().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(pa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function tr(e){return sn(e)&&Ey(e)===0&&(vi(e,"b")||vi(e,"body"))}const j3=["b","body"];function GN(e){return Rl(e,j3)}const V3=["c","cases"];function YN(e){return Rl(e,V3,[])}const K3=["s","static"];function ZN(e){return Rl(e,K3)}const G3=["i","items"];function XN(e){return Rl(e,G3,[])}const Y3=["t","type"];function Ey(e){return Rl(e,Y3)}const Z3=["v","value"];function Of(e,t){const n=Rl(e,Z3);if(n!=null)return n;throw kd(t)}const X3=["m","modifier"];function QN(e){return Rl(e,X3)}const Q3=["k","key"];function JN(e){const t=Rl(e,Q3);if(t)return t;throw kd(6)}function Rl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(vi(e,s)&&e[s]!=null)return e[s]}return n}const J3=[...j3,...V3,...K3,...G3,...Q3,...X3,...Z3,...Y3];function kd(e){return new Error(`unhandled node type: ${e}`)}function n0(e){return n=>e7(n,e)}function e7(e,t){const n=GN(t);if(n==null)throw kd(0);if(Ey(n)===1){const i=YN(n);return e.plural(i.reduce((r,l)=>[...r,Sx(e,l)],[]))}else return Sx(e,n)}function Sx(e,t){const n=ZN(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=XN(t).reduce((s,i)=>[...s,zg(e,i)],[]);return e.normalize(o)}}function zg(e,t){const n=Ey(t);switch(n){case 3:return Of(t,n);case 9:return Of(t,n);case 4:{const o=t;if(vi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(vi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw kd(n)}case 5:{const o=t;if(vi(o,"i")&&xo(o.i))return e.interpolate(e.list(o.i));if(vi(o,"index")&&xo(o.index))return e.interpolate(e.list(o.index));throw kd(n)}case 6:{const o=t,s=QN(o),i=JN(o);return e.linked(zg(e,i),s?zg(e,s):void 0,e.type)}case 7:return Of(t,n);case 8:return Of(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const t7=e=>e;let Rf=Sn();function n7(e,t={}){let n=!1;const o=t.onError||_N;return t.onError=s=>{n=!0,o(s)},{...VN(e,t),detectError:n}}function o7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&kt(e)){on(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||t7)(e),s=Rf[o];if(s)return s;const{ast:i,detectError:r}=n7(e,{...t,location:!1,jit:!0}),l=n0(i);return r?l:Rf[o]=l}else{const n=e.cacheKey;if(n){const o=Rf[n];return o||(Rf[n]=n0(e))}else return n0(e)}}let bd=null;function s7(e){bd=e}function i7(e,t,n){bd&&bd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const r7=l7("function:translate");function l7(e){return t=>bd&&bd.emit(e,t)}const Nr={INVALID_ARGUMENT:wN,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},a7=24;function Ir(e){return fm(e,null,void 0)}function Ty(e,t){return t.locale!=null?Cx(t.locale):Cx(e.locale)}let o0;function Cx(e){if(kt(e))return e;if(Kn(e)){if(e.resolvedOnce&&o0!=null)return o0;if(e.constructor.name==="Function"){const t=e();if(kN(t))throw Ir(Nr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return o0=t}else throw Ir(Nr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ir(Nr.NOT_SUPPORT_LOCALE_TYPE)}function c7(e,t,n){return[...new Set([n,...io(t)?t:sn(t)?Object.keys(t):kt(t)?[t]:[n]])]}function Ug(e,t,n){const o=kt(n)?n:xd,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;io(r);)r=Ax(i,r,t);const l=io(t)||!Xt(t)?t:t.default?t.default:null;r=kt(l)?[l]:l,io(r)&&Ax(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Ax(e,t,n){let o=!0;for(let s=0;s<t.length&&on(o);s++){const i=t[s];kt(i)&&(o=u7(e,t[s],n))}return o}function u7(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=d7(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function d7(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),(io(n)||Xt(n))&&n[s]&&(o=n[s])}return o}const Bl=[];Bl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Bl[1]={w:[1],".":[2],"[":[4],o:[7]};Bl[2]={w:[2],i:[3,0],0:[3,0]};Bl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Bl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Bl[5]={"'":[4,0],o:8,l:[5,0]};Bl[6]={'"':[4,0],o:8,l:[6,0]};const f7=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function h7(e){return f7.test(e)}function p7(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 m7(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 g7(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:h7(t)?p7(t):"*"+t}function v7(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=g7(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=m7(i),d=Bl[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 Mx=new Map;function y7(e,t){return sn(e)?e[t]:null}function k7(e,t){if(!sn(e))return null;let n=Mx.get(t);if(n||(n=v7(t),n&&Mx.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(J3.includes(r)&&tr(s)||!sn(s)||!vi(s,r))return null;const l=s[r];if(l===void 0||Kn(s))return null;s=l,i++}return s}const b7="11.4.5",hm=-1,xd="en-US",ep="",Ex=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function x7(){return{upper:(e,t)=>t==="text"&&kt(e)?e.toUpperCase():t==="vnode"&&sn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&kt(e)?e.toLowerCase():t==="vnode"&&sn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&kt(e)?Ex(e):t==="vnode"&&sn(e)&&"__v_isVNode"in e?Ex(e.children):e}}let eA;function w7(e){eA=e}let tA;function _7(e){tA=e}let nA;function S7(e){nA=e}let oA=null;const C7=e=>{oA=e},A7=()=>oA;let sA=null;const Tx=e=>{sA=e},M7=()=>sA;let Nx=0;function E7(e={}){const t=Kn(e.onWarn)?e.onWarn:cN,n=kt(e.version)?e.version:b7,o=kt(e.locale)||Kn(e.locale)?e.locale:xd,s=Kn(o)?xd:o,i=io(e.fallbackLocale)||Xt(e.fallbackLocale)||kt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Xt(e.messages)?e.messages:s0(s),l=Xt(e.datetimeFormats)?e.datetimeFormats:s0(s),a=Xt(e.numberFormats)?e.numberFormats:s0(s),c=wo(Sn(),e.modifiers,x7()),u=e.pluralRules||Sn(),d=Kn(e.missing)?e.missing:null,f=on(e.missingWarn)||Vc(e.missingWarn)?e.missingWarn:!0,h=on(e.fallbackWarn)||Vc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,b=Kn(e.postTranslation)?e.postTranslation:null,v=Xt(e.processor)?e.processor:null,m=on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,k=Kn(e.messageCompiler)?e.messageCompiler:eA,A=Kn(e.messageResolver)?e.messageResolver:tA||y7,$=Kn(e.localeFallbacker)?e.localeFallbacker:nA||c7,L=sn(e.fallbackContext)?e.fallbackContext:void 0,w=e,E=sn(w.__datetimeFormatters)?w.__datetimeFormatters:new Map,T=sn(w.__numberFormatters)?w.__numberFormatters:new Map,F=sn(w.__meta)?w.__meta:{};Nx++;const S={version:n,cid:Nx,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:g,postTranslation:b,processor:v,warnHtmlMessage:m,escapeParameter:y,messageCompiler:k,messageResolver:A,localeFallbacker:$,fallbackContext:L,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=E,S.__numberFormatters=T,__INTLIFY_PROD_DEVTOOLS__&&i7(S,n,F),S}const s0=e=>({[e]:Sn()});function Ny(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return kt(l)?l:t}else return t}function Tu(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function T7(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function N7(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(T7(e,t[o]))return!0;return!1}function Ix(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!kt(t[0])&&!U3(t[0])&&!xo(t[0]))return ep;const[a,c,u,d]=qg(...t),f=on(u.missingWarn)?u.missingWarn:e.missingWarn;on(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ty(e,u),g=r(e,s,p);if(!kt(a)||a===""){const $=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="datetime format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Xt(m));$++)Ny(e,a,v,f,y);if(!Xt(m)||!kt(v))return o?hm:a;let k=`${v}__${a}`;dm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.DateTimeFormat(v,wo({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const iA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function qg(...e){const[t,n,o,s]=e,i=Sn();let r=Sn(),l;if(kt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Ir(Nr.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 Ir(Nr.INVALID_ISO_DATE_ARGUMENT)}}else if(U3(t)){if(isNaN(t.getTime()))throw Ir(Nr.INVALID_DATE_ARGUMENT);l=t}else if(xo(t))l=t;else throw Ir(Nr.INVALID_ARGUMENT);return kt(n)?i.key=n:Xt(n)&&Object.keys(n).forEach(a=>{iA.includes(a)?r[a]=n[a]:i[a]=n[a]}),kt(o)?i.locale=o:Xt(o)&&(r=o),Xt(s)&&(r=s),[i.key||"",l,i,r]}function Lx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function $x(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!xo(t[0]))return ep;const[a,c,u,d]=jg(...t),f=on(u.missingWarn)?u.missingWarn:e.missingWarn;on(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ty(e,u),g=r(e,s,p);if(!kt(a)||a===""){const $=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="number format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Xt(m));$++)Ny(e,a,v,f,y);if(!Xt(m)||!kt(v))return o?hm:a;let k=`${v}__${a}`;dm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.NumberFormat(v,wo({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const rA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function jg(...e){const[t,n,o,s]=e,i=Sn();let r=Sn();if(!xo(t))throw Ir(Nr.INVALID_ARGUMENT);const l=t;return kt(n)?i.key=n:Xt(n)&&Object.keys(n).forEach(a=>{rA.includes(a)?r[a]=n[a]:i[a]=n[a]}),kt(o)?i.locale=o:Xt(o)&&(r=o),Xt(s)&&(r=s),[i.key||"",l,i,r]}function Fx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const I7=e=>e,L7=e=>"",$7="text",F7=e=>e.length===0?"":Ay(e),O7=bN;function i0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function R7(e){const t=xo(e.pluralIndex)?e.pluralIndex:-1;return xo(e.named?.count)?e.named.count:xo(e.named?.n)?e.named.n:t}function B7(e={}){const t=e.locale,n=R7(e),o=kt(t)&&Kn(e.pluralRules?.[t])?e.pluralRules[t]:i0,s=o===i0?void 0:i0,i=v=>v[o(n,v.length,s)],r=e.list||[],l=v=>r[v],a=e.named||Sn();xo(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=v=>a[v];function u(v,m){const y=Kn(e.messages)?e.messages(v,!!m):sn(e.messages)?e.messages[v]:!1;return y||(e.parent?e.parent.message(v):L7)}const d=v=>e.modifiers?e.modifiers[v]:I7,f=Kn(e.processor?.normalize)?e.processor.normalize:F7,h=Kn(e.processor?.interpolate)?e.processor.interpolate:O7,p=kt(e.processor?.type)?e.processor.type:$7,b={list:l,named:c,plural:i,linked:(v,...m)=>{const[y,k]=m;let A="text",$="";m.length===1?sn(y)?($=y.modifier||$,A=y.type||A):kt(y)&&($=y||$):m.length===2&&(kt(y)&&($=y||$),kt(k)&&(A=k||A));const L=u(v,!0)(b),w=L===""||L===void 0?v:L,E=A==="vnode"&&io(w)&&$?w[0]:w;return $?d($)(E,A):E},message:u,type:p,interpolate:h,normalize:f,values:wo(Sn(),r,a)};return b}const Ox=()=>"",hi=e=>Kn(e);function Rx(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Vg(...t),u=on(c.missingWarn)?c.missingWarn:e.missingWarn,d=on(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=on(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=kt(c.default)||on(c.default)?on(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||p!=null&&(kt(p)||Kn(p)),b=Ty(e,c);f&&D7(c);let[v,m,y]=h?[a,b,l[b]||Sn()]:lA(e,a,b,r,d,u),k=v,A=a;if(!h&&!(kt(k)||tr(k)||hi(k))&&g&&(k=p,A=k),!h&&(!(kt(k)||tr(k)||hi(k))||!kt(m)))return s?hm:a;let $=!1;const L=()=>{$=!0},w=hi(k)?k:aA(e,a,m,k,A,L);if($)return k;const E=W7(e,m,y,c),T=B7(E),F=P7(e,w,T);let S=o?o(F,a):F;if(f&&kt(S)&&(S=vN(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:kt(a)?a:hi(k)?k.key:"",locale:m||(hi(k)?k.locale:""),format:kt(k)?k:hi(k)?k.source:"",message:S};I.meta=wo({},e.__meta,A7()||{}),r7(I)}return S}function D7(e){io(e.list)?e.list=e.list.map(t=>kt(t)?kx(t):t):sn(e.named)&&Object.keys(e.named).forEach(t=>{kt(e.named[t])&&(e.named[t]=kx(e.named[t]))})}function lA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Sn(),f,h=null;const p="translate";for(let g=0;g<u.length&&(f=u[g],d=r[f]||Sn(),(h=a(d,t))===null&&(h=d[t]),!(kt(h)||tr(h)||hi(h)));g++)if(!N7(f,u)){const b=Ny(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function aA(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(hi(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,H7(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function P7(e,t,n){return t(n)}function Vg(...e){const[t,n,o]=e,s=Sn();if(!kt(t)&&!xo(t)&&!hi(t)&&!tr(t))throw Ir(Nr.INVALID_ARGUMENT);const i=xo(t)?String(t):(hi(t),t);return xo(n)?s.plural=n:kt(n)?s.default=n:Xt(n)&&!dm(n)?s.named=n:io(n)&&(s.list=n),xo(o)?s.plural=o:kt(o)?s.default=o:Xt(o)&&wo(s,o),[i,s]}function H7(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>uN(t,n,r)}}function W7(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let g=r(n,h);if(g==null&&(u||p)){const[b,,v]=lA(u||e,h,t,l,a,c);g=b??r(v,h)}if(kt(g)||tr(g)){let b=!1;const m=aA(e,h,t,g,h,()=>{b=!0});return b?Ox:m}else return hi(g)?g:Ox}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),xo(o.plural)&&(f.pluralIndex=o.plural),f}KN();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const z7="11.4.5";function U7(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(pa().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(pa().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(pa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(pa().__INTLIFY_PROD_DEVTOOLS__=!1)}const vs={UNEXPECTED_RETURN_TYPE:a7,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 Is(e,...t){return fm(e,null,void 0)}const Kg=Ol("__translateVNode"),Gg=Ol("__datetimeParts"),Yg=Ol("__numberParts"),cA=Ol("__setPluralRules"),uA=Ol("__injectWithOption"),yc=Ol("__dispose");function wd(e){if(!sn(e)||tr(e))return e;for(const t in e)if(vi(e,t))if(!t.includes("."))sn(e[t])&&wd(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]]=Sn()),!sn(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(tr(s)?J3.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!tr(s)){const r=s[n[o]];sn(r)&&wd(r)}}return e}function Iy(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Xt(n)?n:io(o)?Sn():{[e]:Sn()};if(io(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Sn(),hh(c,r[a])):hh(c,r)}else kt(l)&&hh(JSON.parse(l),r)}),s==null&&i)for(const l in r)vi(r,l)&&wd(r[l]);return r}function dA(e){return e.type}function fA(e,t,n){let o=sn(t.messages)?t.messages:Sn();"__i18nGlobal"in n&&(o=Iy(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(sn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(sn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Bx(e){return ie(wl,null,e,0)}function _d(){return Zo()}const Dx="__INTLIFY_META__",Px=()=>[],q7=()=>!1;let Hx=0;function Wx(e){return((t,n,o,s)=>e(n,o,_d()||void 0,s))}const j7=()=>{const e=_d();let t=null;return e&&(t=dA(e)[Dx])?{[Dx]:t}:null};function tp(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=Jh?Z:La;let r=on(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:kt(e.locale)?e.locale:xd),a=i(t&&r?t.fallbackLocale.value:kt(e.fallbackLocale)||io(e.fallbackLocale)||Xt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Iy(l.value,e)),u=i(Xt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Xt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:on(e.missingWarn)||Vc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:on(e.fallbackWarn)||Vc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:on(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,b=Kn(e.missing)?e.missing:null,v=Kn(e.missing)?Wx(e.missing):null,m=Kn(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter;const A=t?t.modifiers:Xt(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,L;L=(()=>{o&&Tx(null);const ge={version:z7,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:$,missing:v===null?void 0:v,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:m===null?void 0:m,warnHtmlMessage:y,escapeParameter:k,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ge.datetimeFormats=u.value,ge.numberFormats=d.value,ge.__datetimeFormatters=Xt(L)?L.__datetimeFormatters:void 0,ge.__numberFormatters=Xt(L)?L.__numberFormatters:void 0;const Ne=E7(ge);return o&&Tx(Ne),Ne})(),Tu(L,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const T=B({get:()=>l.value,set:ge=>{L.locale=ge,l.value=ge}}),F=B({get:()=>a.value,set:ge=>{L.fallbackLocale=ge,a.value=ge,Tu(L,l.value,ge)}}),S=B(()=>c.value),I=B(()=>u.value),P=B(()=>d.value);function D(){return Kn(m)?m:null}function W(ge){m=ge,L.postTranslation=ge}function z(){return b}function R(ge){ge!==null&&(v=Wx(ge)),b=ge,L.missing=v}const q=(ge,Ne,et,rt,St,vt)=>{E();let Nt;try{__INTLIFY_PROD_DEVTOOLS__,o||(L.fallbackContext=t?M7():void 0),Nt=ge(L)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(L.fallbackContext=void 0)}if(et!=="translate exists"&&xo(Nt)&&Nt===hm||et==="translate exists"&&!Nt){const[Wt,ht]=Ne();return t&&p?rt(t):St(Wt)}else{if(vt(Nt))return Nt;throw Is(vs.UNEXPECTED_RETURN_TYPE)}};function K(...ge){return q(Ne=>Reflect.apply(Rx,null,[Ne,...ge]),()=>Vg(...ge),"translate",Ne=>Reflect.apply(Ne.t,Ne,[...ge]),Ne=>Ne,Ne=>kt(Ne))}function X(...ge){const[Ne,et,rt]=ge;if(rt&&!sn(rt))throw Is(vs.INVALID_ARGUMENT);return K(Ne,et,wo({resolvedMessage:!0},rt||{}))}function ue(...ge){return q(Ne=>Reflect.apply(Ix,null,[Ne,...ge]),()=>qg(...ge),"datetime format",Ne=>Reflect.apply(Ne.d,Ne,[...ge]),()=>ep,Ne=>kt(Ne)||io(Ne))}function me(...ge){return q(Ne=>Reflect.apply($x,null,[Ne,...ge]),()=>jg(...ge),"number format",Ne=>Reflect.apply(Ne.n,Ne,[...ge]),()=>ep,Ne=>kt(Ne)||io(Ne))}function ne(ge){return ge.map(Ne=>kt(Ne)||xo(Ne)||on(Ne)?Bx(String(Ne)):Ne)}const de={normalize:ne,interpolate:ge=>ge,type:"vnode"};function Ae(...ge){return q(Ne=>{let et;const rt=Ne;try{rt.processor=de,et=Reflect.apply(Rx,null,[rt,...ge])}finally{rt.processor=null}return et},()=>Vg(...ge),"translate",Ne=>Ne[Kg](...ge),Ne=>[Bx(Ne)],Ne=>io(Ne))}function Le(...ge){return q(Ne=>Reflect.apply($x,null,[Ne,...ge]),()=>jg(...ge),"number format",Ne=>Ne[Yg](...ge),Px,Ne=>kt(Ne)||io(Ne))}function le(...ge){return q(Ne=>Reflect.apply(Ix,null,[Ne,...ge]),()=>qg(...ge),"datetime format",Ne=>Ne[Gg](...ge),Px,Ne=>kt(Ne)||io(Ne))}function U(ge){$=ge,L.pluralRules=$}function ae(ge,Ne){return q(()=>{if(!ge)return!1;const et=kt(Ne)?Ne:l.value,rt=kt(Ne)?[et]:Ug(L,a.value,et);for(let St=0;St<rt.length;St++){const vt=J(rt[St]);let Nt=L.messageResolver(vt,ge);if(Nt===null&&(Nt=vt[ge]),tr(Nt)||hi(Nt)||kt(Nt))return!0}return!1},()=>[ge],"translate exists",et=>Reflect.apply(et.te,et,[ge,Ne]),q7,et=>on(et))}function se(ge){let Ne=null;const et=Ug(L,a.value,l.value);for(let rt=0;rt<et.length;rt++){const St=c.value[et[rt]]||{},vt=L.messageResolver(St,ge);if(vt!=null){Ne=vt;break}}return Ne}function j(ge){const Ne=se(ge);return Ne??(t?t.tm(ge)||{}:{})}function J(ge){return c.value[ge]||{}}function ye(ge,Ne){if(s){const et={[ge]:Ne};for(const rt in et)vi(et,rt)&&wd(et[rt]);Ne=et[ge]}c.value[ge]=Ne,L.messages=c.value}function fe(ge,Ne){c.value[ge]=c.value[ge]||{};const et={[ge]:Ne};if(s)for(const rt in et)vi(et,rt)&&wd(et[rt]);Ne=et[ge],hh(Ne,c.value[ge]),L.messages=c.value}function ve(ge){return u.value[ge]||{}}function V(ge,Ne){u.value[ge]=Ne,L.datetimeFormats=u.value,Lx(L,ge,Ne)}function ee(ge,Ne){u.value[ge]=wo(u.value[ge]||{},Ne),L.datetimeFormats=u.value,Lx(L,ge,Ne)}function pe(ge){return d.value[ge]||{}}function Ce(ge,Ne){d.value[ge]=Ne,L.numberFormats=d.value,Fx(L,ge,Ne)}function $e(ge,Ne){d.value[ge]=wo(d.value[ge]||{},Ne),L.numberFormats=d.value,Fx(L,ge,Ne)}Hx++,t&&Jh&&(Je(t.locale,ge=>{r&&(l.value=ge,L.locale=ge,Tu(L,l.value,a.value))}),Je(t.fallbackLocale,ge=>{r&&(a.value=ge,L.fallbackLocale=ge,Tu(L,l.value,a.value))}));const De={id:Hx,locale:T,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(ge){r=ge,ge&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Tu(L,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return $||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(ge){f=ge,L.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ge){h=ge,L.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ge){p=ge},get fallbackFormat(){return g},set fallbackFormat(ge){g=ge,L.fallbackFormat=g},get warnHtmlMessage(){return y},set warnHtmlMessage(ge){y=ge,L.warnHtmlMessage=ge},get escapeParameter(){return k},set escapeParameter(ge){k=ge,L.escapeParameter=ge},t:K,getLocaleMessage:J,setLocaleMessage:ye,mergeLocaleMessage:fe,getPostTranslationHandler:D,setPostTranslationHandler:W,getMissingHandler:z,setMissingHandler:R,[cA]:U};return De.datetimeFormats=I,De.numberFormats=P,De.rt=X,De.te=ae,De.tm=j,De.d=ue,De.n=me,De.getDateTimeFormat=ve,De.setDateTimeFormat=V,De.mergeDateTimeFormat=ee,De.getNumberFormat=pe,De.setNumberFormat=Ce,De.mergeNumberFormat=$e,De[uA]=n,De[Kg]=Ae,De[Gg]=le,De[Yg]=Le,De}function V7(e){const t=kt(e.locale)?e.locale:xd,n=kt(e.fallbackLocale)||io(e.fallbackLocale)||Xt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Kn(e.missing)?e.missing:void 0,s=on(e.silentTranslationWarn)||Vc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=on(e.silentFallbackWarn)||Vc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=on(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Xt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Kn(e.postTranslation)?e.postTranslation:void 0,d=kt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=on(e.sync)?e.sync:!0;let p=e.messages;if(Xt(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((L,w)=>{const E=L[w]||(L[w]={});return wo(E,A[w]),L},p||{})}const{__i18n:g,__root:b,__injectWithOption:v}=e,m=e.datetimeFormats,y=e.numberFormats,k=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:k,datetimeFormats:m,numberFormats:y,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:b,__injectWithOption:v}}function Zg(e={}){const t=tp(V7(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 on(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=on(s)?!s:s},get silentFallbackWarn(){return on(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=on(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 K7(e,t,n){return{beforeCreate(){const o=_d();if(!o)throw Is(vs.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=zx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Zg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=zx(e,s);else{this.$i18n=Zg({__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&&fA(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=_d();if(!o)throw Is(vs.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 zx(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[cA](t.pluralizationRules||e.pluralizationRules);const n=Iy(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 Ly={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function G7({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Sn())}function hA(){return Pe}const Y7=Ze({name:"i18n-t",props:wo({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>xo(e)||!isNaN(e)}},Ly),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Et({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Sn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=kt(e.plural)?+e.plural:e.plural);const u=G7(t,a);return s[Kg](e.keypath,u,c)},r=wo(Sn(),o),l=kt(e.tag)||sn(e.tag)?e.tag:hA();return sn(l)?gn(l,r,{default:i}):gn(l,r,i())}}}),Ux=Y7;function Z7(e){return io(e)&&!kt(e[0])}function pA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Sn();e.locale&&(c.locale=e.locale),kt(e.format)?c.key=e.format:sn(e.format)&&(kt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?wo(Sn(),h,{[p]:e.format[p]}):h,Sn()));const d=o(e.value,c,u);let f=[c.key];return io(d)?f=d.map((h,p)=>{const g=s[h.type],b=g?g({[h.type]:h.value,index:p,parts:d}):[h.value];return Z7(b)&&(b[0].key=`${h.type}-${p}`),b}):kt(d)&&(f=[d]),f},l=wo(Sn(),i),a=kt(e.tag)||sn(e.tag)?e.tag:hA();return sn(a)?gn(a,l,{default:r}):gn(a,l,r())}}const X7=Ze({name:"i18n-n",props:wo({value:{type:Number,required:!0},format:{type:[String,Object]}},Ly),setup(e,t){const n=e.i18n||Et({useScope:e.scope,__useComponent:!0});return pA(e,t,rA,(...o)=>n[Yg](...o))}}),qx=X7;function Q7(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 J7(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Is(vs.UNEXPECTED_ERROR);const c=Q7(e,l.$),u=jx(a);return[Reflect.apply(c.t,c,[...Vx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Jh&&(r.__i18nWatcher=Je(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Jh&&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=jx(l);r.textContent=Reflect.apply(a.t,a,[...Vx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function jx(e){if(kt(e))return{path:e};if(Xt(e)){if(!("path"in e))throw Is(vs.REQUIRED_VALUE,"path");return e}else throw Is(vs.INVALID_VALUE)}function Vx(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return kt(n)&&(r.locale=n),xo(s)&&(r.plural=s),xo(i)&&(r.plural=i),[t,l,r]}function eI(e,t,...n){const o=Xt(n[0])?n[0]:{};(on(o.globalInstall)?o.globalInstall:!0)&&([Ux.name,"I18nT"].forEach(i=>e.component(i,Ux)),[qx.name,"I18nN"].forEach(i=>e.component(i,qx)),[Yx.name,"I18nD"].forEach(i=>e.component(i,Yx))),e.directive("t",J7(t))}const tI=Ol("global-vue-i18n");function nI(e={}){const t=__VUE_I18N_LEGACY_API__&&on(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=on(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=oI(e,t),r=Ol("");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),Xt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=uI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&eI(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(K7(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Et(e={}){const t=_d();if(t==null)throw Is(vs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Is(vs.NOT_INSTALLED);const n=sI(t),o=rI(n),s=dA(t),i=iI(e,s);if(i==="global")return fA(o,e,s),o;if(i==="parent"){let a=Kx(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Is(vs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=wo({},e),u=Kx(n,t);c.__root=u||o;const d=tp(c);return a.__composerExtend&&(d[yc]=a.__composerExtend(d)),iy()&&ry(()=>{const h=d[yc];h&&(h(),delete d[yc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=wo({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=tp(a),r.__composerExtend&&(l[yc]=r.__composerExtend(l)),aI(r,t,l),r.__setInstance(t,l)}return l}function oI(e,t){const n=TE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Zg(e)):n.run(()=>tp(e));if(o==null)throw Is(vs.UNEXPECTED_ERROR);return[n,o]}function sI(e){const t=jt(e.isCE?tI:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Is(e.isCE?vs.NOT_INSTALLED_WITH_PROVIDE:vs.UNEXPECTED_ERROR);return t}function iI(e,t){return dm(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function rI(e){return e.mode==="composition"?e.global:e.global.__composer}function Kx(e,t,n=!1){let o=null;const s=t.root;let i=lI(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[uA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function lI(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function aI(e,t,n){un(()=>{},t),xn(()=>{const o=n;e.__deleteInstance(t);const s=o[yc];s&&(s(),delete o[yc])},t)}const cI=["locale","fallbackLocale","availableLocales"],Gx=["t","rt","d","n","tm","te"];function uI(e,t){const n=Object.create(null);return cI.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Is(vs.UNEXPECTED_ERROR);const r=fo(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,Gx.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Is(vs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Gx.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const dI=Ze({name:"i18n-d",props:wo({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Ly),setup(e,t){const n=e.i18n||Et({useScope:e.scope,__useComponent:!0});return pA(e,t,iA,(...o)=>n[Gg](...o))}}),Yx=dI;U7();w7(o7);_7(k7);S7(Ug);if(__INTLIFY_PROD_DEVTOOLS__){const e=pa();e.__INTLIFY__=!0,s7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const fI="modulepreload",hI=function(e){return"/"+e},Zx={},ms=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=hI(c),c in Zx)return;Zx[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":fI,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},$t={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function Xx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function lo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function po(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Gc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function pm(e){const t=lo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Ud(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function $y(){const e=lo($t.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function Fy(e){const n={...$y()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];po($t.unread,JSON.stringify(n))}function pI(){const e=pm($t.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function r0(e){Ud($t.collapsedWorkspaces,Array.from(e))}function mI(){const e=pm($t.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function mA(e){Ud($t.workspaceOrder,Array.from(e))}function Bf(){const e=pm($t.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function Qx(e){Ud($t.workspaceNameOverrides,e)}function gI(){return lo($t.workspaceSort)}function gA(e){po($t.workspaceSort,e)}const Jx=$t.clientId,vI="kimi-code-web",yI="web";function kI(){return{serverHttpUrl:xI(),clientId:CI(),clientName:vI,clientVersion:AI(),clientUiMode:yI}}function bI(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function xI(e){const t=bI(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function wI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function _I(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return wI(e)}function kc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function SI(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 CI(){const e=lo(Jx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return po(Jx,t),t}function AI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function MI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function EI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Yo(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 TI(e)}function TI(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 NI(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 II(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 LI(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function $I(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const FI={"&":"&","<":"<",">":">",'"':""","'":"'"};function ew(e){return e.replace(/[&<>"']/g,t=>FI[t]??t)}function OI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function RI(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return tw(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return tw(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function tw(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function l0(e,t){const n=ew(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(OI(ew(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const fc=Z(0),BI=["type","disabled","aria-label"],DI=Ze({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(x(),N("button",{ref_key:"el",ref:n,class:We(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[$n(o.$slots,"default",{},void 0,!0)],10,BI))}}),ct=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Dn=ct(DI,[["__scopeId","data-v-c9e67023"]]),PI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function HI(e,t){return x(),N("svg",PI,[...t[0]||(t[0]=[_("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const WI=mt({name:"kimi-add-conversation",render:HI}),zI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function UI(e,t){return x(),N("svg",zI,[...t[0]||(t[0]=[_("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const qI=mt({name:"kimi-folder",render:UI}),jI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},VI=["clip-path"],KI=["id"];function GI(e,t){return x(),N("svg",jI,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,VI),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,KI)])])}const YI=mt({name:"kimi-folder-open",render:GI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),ZI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XI(e,t){return x(),N("svg",ZI,[...t[0]||(t[0]=[_("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),_("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),_("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const QI=mt({name:"kimi-more",render:XI}),JI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function eL(e,t){return x(),N("svg",JI,[...t[0]||(t[0]=[_("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const tL=mt({name:"kimi-search",render:eL}),nL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oL(e,t){return x(),N("svg",nL,[...t[0]||(t[0]=[_("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),_("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const sL=mt({name:"kimi-setting",render:oL}),iL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rL(e,t){return x(),N("svg",iL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const lL=mt({name:"tabler-layout-sidebar-left-collapse",render:rL}),aL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cL(e,t){return x(),N("svg",aL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const uL=mt({name:"tabler-layout-sidebar-left-expand",render:cL}),dL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fL(e,t){return x(),N("svg",dL,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const hL=mt({name:"tabler-paperclip",render:fL}),pL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mL(e,t){return x(),N("svg",pL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const gL=mt({name:"ri-add-line",render:mL}),vL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yL(e,t){return x(),N("svg",vL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const kL=mt({name:"ri-alert-line",render:yL}),bL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xL(e,t){return x(),N("svg",bL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const wL=mt({name:"ri-archive-line",render:xL}),_L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SL(e,t){return x(),N("svg",_L,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const CL=mt({name:"ri-arrow-down-line",render:SL}),AL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ML(e,t){return x(),N("svg",AL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const EL=mt({name:"ri-arrow-down-s-line",render:ML}),TL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NL(e,t){return x(),N("svg",TL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const IL=mt({name:"ri-arrow-go-back-line",render:NL}),LL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $L(e,t){return x(),N("svg",LL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const FL=mt({name:"ri-arrow-right-line",render:$L}),OL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RL(e,t){return x(),N("svg",OL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const BL=mt({name:"ri-arrow-right-s-line",render:RL}),DL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PL(e,t){return x(),N("svg",DL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const nw=mt({name:"ri-arrow-up-line",render:PL}),HL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WL(e,t){return x(),N("svg",HL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const zL=mt({name:"ri-arrow-up-s-line",render:WL}),UL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qL(e,t){return x(),N("svg",UL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const jL=mt({name:"ri-braces-line",render:qL}),VL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KL(e,t){return x(),N("svg",VL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const GL=mt({name:"ri-calendar-close-line",render:KL}),YL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZL(e,t){return x(),N("svg",YL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const XL=mt({name:"ri-calendar-schedule-line",render:ZL}),QL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JL(e,t){return x(),N("svg",QL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const e$=mt({name:"ri-calendar-todo-line",render:JL}),t$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function n$(e,t){return x(),N("svg",t$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const o$=mt({name:"ri-check-line",render:n$}),s$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function i$(e,t){return x(),N("svg",s$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const r$=mt({name:"ri-close-line",render:i$}),l$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function a$(e,t){return x(),N("svg",l$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const c$=mt({name:"ri-code-line",render:a$}),u$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function d$(e,t){return x(),N("svg",u$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const f$=mt({name:"ri-collapse-diagonal-line",render:d$}),h$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function p$(e,t){return x(),N("svg",h$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const m$=mt({name:"ri-download-line",render:p$}),g$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v$(e,t){return x(),N("svg",g$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const y$=mt({name:"ri-draggable",render:v$}),k$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b$(e,t){return x(),N("svg",k$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const x$=mt({name:"ri-equalizer-line",render:b$}),w$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _$(e,t){return x(),N("svg",w$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const S$=mt({name:"ri-expand-diagonal-line",render:_$}),C$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A$(e,t){return x(),N("svg",C$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const M$=mt({name:"ri-external-link-line",render:A$}),E$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T$(e,t){return x(),N("svg",E$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const N$=mt({name:"ri-file-add-line",render:T$}),I$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L$(e,t){return x(),N("svg",I$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const $$=mt({name:"ri-file-copy-line",render:L$}),F$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O$(e,t){return x(),N("svg",F$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const R$=mt({name:"ri-file-edit-line",render:O$}),B$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D$(e,t){return x(),N("svg",B$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const ow=mt({name:"ri-file-line",render:D$}),P$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H$(e,t){return x(),N("svg",P$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const W$=mt({name:"ri-file-text-line",render:H$}),z$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U$(e,t){return x(),N("svg",z$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const q$=mt({name:"ri-flashlight-line",render:U$}),j$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V$(e,t){return x(),N("svg",j$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const K$=mt({name:"ri-folder-add-line",render:V$}),G$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y$(e,t){return x(),N("svg",G$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const Z$=mt({name:"ri-folder-fill",render:Y$}),X$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q$(e,t){return x(),N("svg",X$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const J$=mt({name:"ri-git-fork-line",render:Q$}),eF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tF(e,t){return x(),N("svg",eF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const nF=mt({name:"ri-git-pull-request-line",render:tF}),oF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sF(e,t){return x(),N("svg",oF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const iF=mt({name:"ri-global-line",render:sF}),rF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lF(e,t){return x(),N("svg",rF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const sw=mt({name:"ri-image-line",render:lF}),aF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cF(e,t){return x(),N("svg",aF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const uF=mt({name:"ri-information-line",render:cF}),dF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fF(e,t){return x(),N("svg",dF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const hF=mt({name:"ri-links-line",render:fF}),pF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mF(e,t){return x(),N("svg",pF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const gF=mt({name:"ri-list-check",render:mF}),vF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yF(e,t){return x(),N("svg",vF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const kF=mt({name:"ri-list-unordered",render:yF}),bF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xF(e,t){return x(),N("svg",bF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const wF=mt({name:"ri-login-box-line",render:xF}),_F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SF(e,t){return x(),N("svg",_F,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const CF=mt({name:"ri-mail-line",render:SF}),AF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MF(e,t){return x(),N("svg",AF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const EF=mt({name:"ri-message-line",render:MF}),TF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NF(e,t){return x(),N("svg",TF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const IF=mt({name:"ri-pause-fill",render:NF}),LF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $F(e,t){return x(),N("svg",LF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const FF=mt({name:"ri-pencil-line",render:$F}),OF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RF(e,t){return x(),N("svg",OF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const BF=mt({name:"ri-play-fill",render:RF}),DF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PF(e,t){return x(),N("svg",DF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const HF=mt({name:"ri-question-line",render:PF}),WF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zF(e,t){return x(),N("svg",WF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const UF=mt({name:"ri-sort-desc",render:zF}),qF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jF(e,t){return x(),N("svg",qF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const VF=mt({name:"ri-sparkling-line",render:jF}),KF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GF(e,t){return x(),N("svg",KF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const YF=mt({name:"ri-star-fill",render:GF}),ZF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XF(e,t){return x(),N("svg",ZF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const QF=mt({name:"ri-star-line",render:XF}),JF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eO(e,t){return x(),N("svg",JF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const tO=mt({name:"ri-stop-fill",render:eO}),nO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oO(e,t){return x(),N("svg",nO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const sO=mt({name:"ri-subtract-line",render:oO}),iO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rO(e,t){return x(),N("svg",iO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const lO=mt({name:"ri-target-line",render:rO}),aO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cO(e,t){return x(),N("svg",aO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const uO=mt({name:"ri-terminal-box-line",render:cO}),dO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fO(e,t){return x(),N("svg",dO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const hO=mt({name:"ri-time-line",render:fO}),pO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mO(e,t){return x(),N("svg",pO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const gO=mt({name:"ri-tools-line",render:mO}),vO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yO(e,t){return x(),N("svg",vO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const kO=mt({name:"ri-user-line",render:yO}),bO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
-
<path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
|
|
40
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
|
|
41
|
-
</svg>
|
|
42
|
-
`,xO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
-
<path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
|
|
44
|
-
</svg>
|
|
45
|
-
`,wO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
-
<g clip-path="url(#clip0_4626_2033)">
|
|
47
|
-
<path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
|
|
48
|
-
</g>
|
|
49
|
-
<defs>
|
|
50
|
-
<clipPath id="clip0_4626_2033">
|
|
51
|
-
<rect width="24" height="24" fill="white"/>
|
|
52
|
-
</clipPath>
|
|
53
|
-
</defs>
|
|
54
|
-
</svg>
|
|
55
|
-
`,_O=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
-
<path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
|
|
57
|
-
<path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
|
|
58
|
-
<path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
|
|
59
|
-
</svg>
|
|
60
|
-
`,SO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
-
<path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
|
|
62
|
-
</svg>
|
|
63
|
-
`,CO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
64
|
-
<path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
|
|
65
|
-
<path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
|
|
66
|
-
</svg>
|
|
67
|
-
`,AO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',MO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',EO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',TO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',NO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',IO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',LO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',$O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',FO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',OO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',RO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',iw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',BO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',DO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',PO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',HO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',WO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',zO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',UO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',qO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',jO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',VO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',KO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',GO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',YO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',ZO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',XO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',QO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',JO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',rw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',eR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',tR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',nR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',oR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',sR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',iR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',rR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',lw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',lR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',aR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',cR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',uR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',dR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',fR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',hR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',pR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',mR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',gR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',vR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',yR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',kR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',bR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',xR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',wR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',_R='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',SR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',CR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',AR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',MR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',ER='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',vA={sm:14,md:16,lg:20};function yt(e,t){return{component:e,svg:t}}const yA={plus:yt(gL,TO),"chat-new":yt(WI,bO),"calendar-close":yt(GL,PO),"calendar-schedule":yt(XL,HO),"calendar-todo":yt(e$,WO),close:yt(r$,UO),check:yt(o$,zO),archive:yt(wL,IO),search:yt(tL,SO),copy:yt($$,QO),link:yt(hF,aR),"external-link":yt(M$,ZO),download:yt(m$,VO),undo:yt(IL,FO),send:yt(nw,iw),image:yt(sw,lw),settings:yt(sL,CO),sliders:yt(x$,GO),"log-in":yt(wF,dR),"chevron-down":yt(EL,$O),"chevron-right":yt(BL,RO),"chevron-up":yt(zL,BO),"arrow-up":yt(nw,iw),"arrow-down":yt(CL,LO),"arrow-right":yt(FL,OO),minus:yt(sO,_R),"panel-collapse":yt(lL,AO),"panel-expand":yt(uL,MO),expand:yt(S$,YO),collapse:yt(f$,jO),list:yt(kF,uR),sort:yt(UF,yR),grip:yt(y$,KO),folder:yt(YI,wO),"folder-closed":yt(qI,xO),"folder-plus":yt(K$,nR),"folder-solid":yt(Z$,oR),file:yt(ow,rw),"file-text":yt(W$,eR),"file-edit":yt(R$,JO),"file-plus":yt(N$,XO),"file-off":yt(ow,rw),attachment:yt(hL,EO),"image-off":yt(sw,lw),code:yt(c$,qO),terminal:yt(uO,CR),pencil:yt(FF,mR),tool:yt(gO,MR),glob:yt(jL,DO),globe:yt(iF,rR),"check-list":yt(gF,cR),bolt:yt(q$,tR),"git-fork":yt(J$,sR),"git-pull-request":yt(nF,iR),message:yt(EF,hR),mail:yt(CF,fR),user:yt(kO,ER),info:yt(uF,lR),"help-circle":yt(HF,vR),"alert-triangle":yt(kL,NO),clock:yt(hO,AR),sparkles:yt(VF,kR),target:yt(lO,SR),pause:yt(IF,pR),play:yt(BF,gR),stop:yt(tO,wR),star:yt(YF,bR),"star-outline":yt(QF,xR),"dots-horizontal":yt(QI,_O)};function TR(e){return yA[e]}function NR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function hc(e,t="md"){const n=yA[e];return n?NR(n.svg,vA[t]):""}const Kwe=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],Ve=Ze({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=B(()=>TR(t.name)),o=B(()=>vA[t.size]);return(s,i)=>n.value?(x(),ke(Vo(n.value.component),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):re("",!0)}}),IR={key:0,class:"ui-dialog__head"},LR={class:"ui-dialog__titles"},$R={key:0,class:"ui-dialog__title"},FR={key:1,class:"ui-dialog__desc"},OR={class:"ui-dialog__body"},RR={key:1,class:"ui-dialog__foot"},BR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',DR=Ze({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=Z(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(BR)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?s.value?.querySelector(d)??null:s.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),s.value?.focus();return}const g=document.activeElement;d.shiftKey&&g===h?(d.preventDefault(),p.focus()):!d.shiftKey&&g===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Je(()=>n.open,async d=>{if(d){fc.value+=1,i=document.activeElement,await gt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else fc.value=Math.max(0,fc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ho(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(fc.value=Math.max(0,fc.value-1))}),(d,f)=>(x(),ke(lm,{to:"body"},[e.open?(x(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[_("div",{ref_key:"panel",ref:s,class:We(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(x(),N("div",IR,[$n(d.$slots,"head",{},()=>[_("div",LR,[e.title?(x(),N("div",$R,O(e.title),1)):re("",!0),e.description?(x(),N("div",FR,O(e.description),1)):re("",!0)])],!0),ie(Dn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[ie(Ve,{name:"close",size:"md"})]),_:1})])):re("",!0),_("div",OR,[$n(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(x(),N("div",RR,[$n(d.$slots,"foot",{},void 0,!0)])):re("",!0)],2)],32)):re("",!0)]))}}),zr=ct(DR,[["__scopeId","data-v-3dce23a4"]]),PR={class:"sd-head"},HR=["placeholder","aria-label"],WR=["aria-selected","onClick","onMousemove"],zR={class:"sd-meta"},UR=["innerHTML"],qR={class:"sd-time"},jR=["innerHTML"],VR=["innerHTML"],KR={key:1,class:"sd-empty"},GR={class:"sd-hint"},YR=200,ZR=Ze({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=Z(!0),r=Z(""),l=Z(null),a=Z(null),c=B(()=>{const v=r.value.trim().toLowerCase(),m=[];for(const y of o.sessions){const k=y.title??"",A=y.lastPrompt??"",$=y.workspaceName??"",L=v.length>0&&k.toLowerCase().includes(v),w=v.length>0&&A.toLowerCase().includes(v),E=v.length>0&&$.toLowerCase().includes(v);if(!(v.length>0&&!L&&!w&&!E)&&(m.push({session:y,inTitle:L,inWorkspace:E,snippetText:A?RI(A,r.value):""}),m.length>=YR))break}return m}),u=Z(0);Je(r,()=>{u.value=0});function d(v){const m=c.value.length;return m===0?0:Math.max(0,Math.min(m-1,v))}async function f(){await gt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(v){u.value=d(u.value+v),f()}function p(v){s("select",v),s("close")}function g(){const v=c.value[u.value];v&&p(v.session.id)}function b(v){v.key==="ArrowDown"?(v.preventDefault(),h(1)):v.key==="ArrowUp"?(v.preventDefault(),h(-1)):v.key==="Enter"&&(v.preventDefault(),g())}return un(()=>{l.value?.focus()}),(v,m)=>(x(),ke(zr,{open:i.value,"onUpdate:open":m[1]||(m[1]=y=>i.value=y),size:"lg",height:"fixed",padded:!1,onClose:m[2]||(m[2]=y=>s("close"))},{head:Ee(()=>[_("div",PR,[ie(Ve,{class:"sd-search-icon",name:"search",size:"md"}),Ln(_("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>r.value=y),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,HR),[[_s,r.value]])])]),foot:Ee(()=>[_("span",GR,O(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[_("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(x(!0),N(Pe,{key:0},ot(c.value,(y,k)=>(x(),N("button",{key:y.session.id,class:We(["sd-row",{on:k===u.value,active:y.session.id===e.activeId}]),role:"option","aria-selected":k===u.value,onClick:A=>p(y.session.id),onMousemove:A=>u.value=k},[_("span",zR,[ie(Ve,{class:"sd-folder",name:"folder-closed",size:"sm"}),_("span",{class:"sd-ws",innerHTML:C(l0)(y.session.workspaceName??y.session.workspaceId??"",y.inWorkspace?r.value:"")},null,8,UR),_("span",qR,O(y.session.time),1)]),_("span",{class:"sd-title",innerHTML:C(l0)(y.session.title,y.inTitle?r.value:"")},null,8,jR),y.snippetText?(x(),N("span",{key:0,class:"sd-snippet",innerHTML:C(l0)(y.snippetText,r.value)},null,8,VR)):re("",!0)],42,WR))),128)):(x(),N("div",KR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),XR=ct(ZR,[["__scopeId","data-v-a678f802"]]),QR=["aria-label"],JR=Ze({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(x(),N("span",{class:We(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,QR))}}),Ds=ct(JR,[["__scopeId","data-v-e5c5b17d"]]),eB={key:0,class:"ui-badge__dot","aria-hidden":"true"},tB=Ze({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(x(),N("span",{class:We(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(x(),N("span",eB)):re("",!0),$n(t.$slots,"default",{},void 0,!0)],2))}}),Ls=ct(tB,[["__scopeId","data-v-5bc5cd6d"]]),nB=Ze({__name:"Menu",setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(x(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[$n(o.$slots,"default",{},void 0,!0)],512))}}),vl=ct(nB,[["__scopeId","data-v-60e6cd8d"]]),oB={key:0,class:"ui-menu-sep",role:"separator"},sB=["disabled"],iB=Ze({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(x(),N("div",oB)):(x(),N("button",{key:1,class:We(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[$n(t.$slots,"default",{},void 0,!0)],10,sB))}}),mn=ct(iB,[["__scopeId","data-v-f940771a"]]),el=6,tl=8,rB=150,lB=Ze({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Z(),o=Z(),s=Z(!1),i=Z(!1),r=Z({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const g=o.value;if(!a||!g)return;const b=a.getBoundingClientRect(),v=g.offsetWidth,m=g.offsetHeight,y=window.innerWidth,k=window.innerHeight;let A=t.placement;A==="top"&&b.top-el-m<tl?A="bottom":A==="bottom"&&b.bottom+el+m>k-tl?A="top":A==="left"&&b.left-el-v<tl?A="right":A==="right"&&b.right+el+v>y-tl&&(A="left");let $=0,L=0;A==="top"?($=b.top-el-m,L=b.left+b.width/2-v/2):A==="bottom"?($=b.bottom+el,L=b.left+b.width/2-v/2):A==="left"?($=b.top+b.height/2-m/2,L=b.left-el-v):($=b.top+b.height/2-m/2,L=b.right+el),L=Math.min(Math.max(L,tl),y-tl-v),$=Math.min(Math.max($,tl),k-tl-m),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round($)}px`,left:`${Math.round(L)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,gt(()=>{u(),i.value=!0})},rB))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(g){g!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=g,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return un(()=>{const g=n.value??null;p(g?.firstElementChild??g),g&&(c=new MutationObserver(()=>{const b=g.firstElementChild??null;b!==a&&(f(),p(b??g))}),c.observe(g,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ho(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(g,b)=>(x(),N(Pe,null,[_("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[$n(g.$slots,"default",{},void 0,!0)],512),(x(),ke(lm,{to:"body"},[Ln(_("div",{ref_key:"bubble",ref:o,class:We(["ui-tip__bubble",{positioned:i.value}]),style:Vt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[mi,s.value]])]))],64))}}),Zt=ct(lB,[["__scopeId","data-v-4c261eb6"]]),aB={class:"row"},cB={class:"lead","aria-hidden":"true"},uB={key:1,class:"unread-dot"},dB={class:"left"},fB=["onKeydown"],hB={class:"act"},pB={class:"ts"},mB={class:"menu-time"},gB=Ze({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:o}=Et(),s=e,i=n;function r(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const P=D=>String(D).padStart(2,"0");return`${I.getFullYear()}-${P(I.getMonth()+1)}-${P(I.getDate())} ${P(I.getHours())}:${P(I.getMinutes())}`}const l=B(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=Z(!1),c=Z(null),u=Z(null),d=Z({});function f(S){const I=S.target;u.value?.el?.contains(I)||c.value?.el?.contains(I)||g()}function h(){const S=c.value?.el;if(!S)return;const I=u.value?.el,P=S.getBoundingClientRect(),D=4,W=8,z=I?.offsetHeight??0,R=I?.offsetWidth??0;let q=P.bottom+D;q+z>window.innerHeight-W&&(q=Math.max(W,P.top-z-D));let K=P.right-R;K<W&&(K=W),d.value={top:`${Math.round(q)}px`,left:`${Math.round(K)}px`}}async function p(S){if(S.stopPropagation(),a.value){g();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",g),await gt(),h()}function g(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)}xn(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)});const b=Z(!1),v=Z(""),m=Z(null);async function y(){g(),b.value=!0,v.value=s.session.title,await gt();try{m.value?.focus(),m.value?.select()}catch{}}function k(){const S=v.value.trim();S&&i("rename",s.session.id,S),b.value=!1}function A(){b.value=!1}const $=Z(!1),L=Z(!1);async function w(){const S=await Yo(s.session.id);$.value=S,L.value=!S,setTimeout(()=>{$.value=!1,L.value=!1,g()},1500)}function E(){g(),i("fork",s.session.id)}function T(){g(),i("export",s.session.id)}function F(){g(),i("archive",s.session.id)}return t({closeMenu:g}),(S,I)=>(x(),N("div",{class:We(["se",{on:e.active}]),onClick:I[4]||(I[4]=P=>i("select",e.session.id))},[_("div",aB,[_("span",cB,[e.session.busy?(x(),ke(Ds,{key:0,size:"sm"})):e.unread?(x(),N("span",uB)):re("",!0)]),_("div",dB,[b.value?Ln((x(),N("input",{key:0,ref_key:"renameInputRef",ref:m,"onUpdate:modelValue":I[0]||(I[0]=P=>v.value=P),class:"rename-input",onClick:I[1]||(I[1]=xt(()=>{},["stop"])),onKeydown:[Ji(xt(k,["stop"]),["enter"]),Ji(xt(A,["stop"]),["esc"])],onBlur:k},null,40,fB)),[[_s,v.value]]):(x(),N("span",{key:1,class:"t",onDblclick:xt(y,["stop"])},O(e.session.title),33))]),ie(Zt,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!b.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(x(),ke(Ls,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Xe(O(C(o)("workspace.awaitingAnswer")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Zt,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!b.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(x(),ke(Ls,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Xe(O(C(o)("workspace.awaitingPermission")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Zt,{text:C(o)("workspace.abortedTitle")},{default:Ee(()=>[!b.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(x(),ke(Ls,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Xe(O(C(o)("workspace.aborted")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),_("span",hB,[_("span",pB,O(e.session.time),1),b.value?re("",!0):(x(),ke(Dn,{key:0,ref_key:"kebabRef",ref:c,class:We(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:I[2]||(I[2]=xt(P=>p(P),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(x(),ke(lm,{to:"body"},[a.value?(x(),ke(vl,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:Vt(d.value),onClick:I[3]||(I[3]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie(mn,{danger:L.value,onClick:w},{default:Ee(()=>[ie(Ve,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(L.value?C(o)("sidebar.copyFailed"):$.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(mn,{separator:""}),ie(mn,{onClick:y},{default:Ee(()=>[ie(Ve,{name:"pencil",size:"sm"}),Xe(" "+O(C(o)("sidebar.rename")),1)]),_:1}),ie(mn,{onClick:E},{default:Ee(()=>[ie(Ve,{name:"git-fork",size:"sm"}),Xe(" "+O(C(o)("sidebar.fork")),1)]),_:1}),ie(mn,{onClick:T},{default:Ee(()=>[ie(Ve,{name:"download",size:"sm"}),Xe(" "+O(C(o)("sidebar.export")),1)]),_:1}),ie(mn,{danger:"",onClick:F},{default:Ee(()=>[ie(Ve,{name:"archive",size:"sm"}),Xe(" "+O(C(o)("sidebar.archive")),1)]),_:1}),ie(mn,{separator:""}),_("div",mB,O(l.value),1)]),_:1},8,["style"])):re("",!0)]))],2))}}),vB=ct(gB,[["__scopeId","data-v-c1a3c877"]]),yB={class:"gh-top"},kB={class:"gh-name"},bB=["inert"],xB=["disabled"],wB={class:"show-more-label"},_B={class:"show-more-label"},SB={key:2,class:"group-empty"},CB=Ze({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=B({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=B(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=B(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(x(),N("div",{class:We(["group",{dragging:e.dragging}])},[_("div",{class:We(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=xt(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[_("div",yB,[e.isCollapsed(e.group.workspace.id)?(x(),ke(Ve,{key:0,class:"gh-folder",name:"folder-closed"})):(x(),ke(Ve,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(x(),ke(Zt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[_("span",kB,O(e.group.workspace.name),1)]),_:1},8,["text"])):Ln((x(),N("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=Ji(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=Ji(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=xt(()=>{},["stop"]))},null,544)),[[_s,i.value]]),e.renamingId!==e.group.workspace.id?(x(),N("div",{key:4,class:We(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ie(Dn,{class:We(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=xt(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ie(Dn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=xt(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"chat-new"})]),_:1},8,["label"])],2)):re("",!0)])],34),_("div",{class:We(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(x(!0),N(Pe,null,ot(r.value,p=>(x(),ke(vB,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=g=>s("selectSession",g)),onRename:h[11]||(h[11]=(g,b)=>s("renameSession",g,b)),onArchive:h[12]||(h[12]=g=>s("archiveSession",g)),onFork:h[13]||(h[13]=g=>s("forkSession",g)),onExport:h[14]||(h[14]=g=>s("exportSession",g))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=xt(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",wB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,xB)):re("",!0),l.value?(x(),N("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=xt(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",_B,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):re("",!0),e.group.sessions.length===0?(x(),N("div",SB,O(C(n)("sidebar.noSessions")),1)):re("",!0)],10,bB)],2))}}),AB=ct(CB,[["__scopeId","data-v-cdac739a"]]),MB="kimi_desktop",EB="platform",aw="kimi-desktop",cw="kimi-desktop-platform";function TB(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(MB)?(sessionStorage.setItem(aw,"1"),e=!0):e=e||sessionStorage.getItem(aw)==="1";const o=n.get(EB);o?(sessionStorage.setItem(cw,o),t=o):t=sessionStorage.getItem(cw)}catch{}return{isDesktop:e,platform:t}}const Xg=TB(),NB=Xg.isDesktop,$c=Xg.isDesktop&&Xg.platform==="darwin",IB={class:"ui-kbd"},LB=Ze({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(x(),N("span",IB,[(x(!0),N(Pe,null,ot(e.keys,o=>(x(),N("kbd",{key:o,class:"ui-kbd__key"},O(o),1))),128))]))}}),vr=ct(LB,[["__scopeId","data-v-32292ed8"]]),$B=["disabled","aria-pressed"],FB=Ze({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(x(),N("button",{key:0,class:We(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[$n(t.$slots,"default",{},void 0,!0)],10,$B)):(x(),N("span",{key:1,class:We(["ui-pill",{"is-active":e.active}])},[$n(t.$slots,"default",{},void 0,!0)],2))}}),ph=ct(FB,[["__scopeId","data-v-317ace1a"]]),OB={class:"ch"},RB={class:"ch-brand"},BB={class:"ch-backend-ep"},DB={class:"btn-wrap"},PB={class:"search-input"},HB={key:0,class:"empty"},WB={class:"side-section-label"},zB={class:"side-section-title"},UB={class:"side-section-actions"},qB=["onDragover","onDrop"],jB={class:"side-footer"},VB={class:"section-menu-check"},KB={class:"section-menu-check"},GB={class:"section-menu-check"},YB={class:"backend-menu-name"},ZB={class:"backend-menu-url"},XB=1e3,QB=Ze({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Et(),o=!1,s=Z(null),i=B(()=>""),r=["default","multi"];function l(ze){const Qe=s.value?.presets[ze]??"";return Qe?EI(Qe):""}function a(ze){const Qe=s.value;return Qe!==null&&Qe.current===Qe.presets[ze]}const c=e,u=t,d=Z(!1),f=g()?["⌘","K"]:["Ctrl","K"];function h(){u("loadAllSessions"),d.value=!0}function p(ze){(ze.metaKey||ze.ctrlKey)&&ze.key.toLowerCase()==="k"&&(ze.preventDefault(),h())}un(()=>window.addEventListener("keydown",p)),ho(()=>window.removeEventListener("keydown",p));function g(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const ze=navigator.userAgentData;return ze?.platform==="macOS"||ze?.platform==="iOS"}const b=Z(!1);function v(ze){b.value=ze.target.scrollTop>0}const m=Z(new Set(pI()));function y(ze){return m.value.has(ze)}function k(ze){const Qe=new Set(m.value);Qe.has(ze)?Qe.delete(ze):Qe.add(ze),m.value=Qe,r0(Qe)}function A(){const ze=new Set(c.groups.map(Qe=>Qe.workspace.id));m.value=ze,r0(ze)}function $(){const ze=new Set;m.value=ze,r0(ze)}const L=B(()=>c.groups.length>0&&c.groups.every(ze=>m.value.has(ze.workspace.id))),w=Z(new Set);function E(ze){return w.value.has(ze)}function T(ze){const Qe=new Set(w.value);Qe.has(ze)?Qe.delete(ze):Qe.add(ze),w.value=Qe}function F(ze){if(!w.value.has(ze)){const Qe=new Set(w.value);Qe.add(ze),w.value=Qe}u("loadMoreSessions",ze)}const S=Z(null),I=Z(null);function P(ze){S.value=ze}function D(){S.value=null,I.value=null}function W(ze){const Qe=ze.currentTarget.getBoundingClientRect();return ze.clientY<Qe.top+Qe.height/2?"before":"after"}function z(ze,Qe){S.value===null||S.value===Qe||(ze.preventDefault(),ze.dataTransfer&&(ze.dataTransfer.dropEffect="move"),I.value={id:Qe,position:W(ze)})}function R(ze){const Qe=S.value,bt=I.value?.id===ze?I.value.position:"before";if(I.value=null,S.value=null,!Qe||Qe===ze)return;const Pt=LI(c.groups.map(Hn=>Hn.workspace.id),Qe,ze,bt);u("reorderWorkspaces",Pt)}function q(ze,Qe){Qe.target.closest(".gh-more, .gh-add")||k(ze)}function K(ze){u("select",ze)}const X=Z(null),ue=Z(""),me=Z(null);function ne(){return me}function ce(ze,Qe){X.value=ze,ue.value=Qe,gt().then(()=>me.value?.focus())}function de(){const ze=X.value,Qe=ue.value.trim();ze&&Qe&&u("renameWorkspace",ze,Qe),X.value=null}function Ae(){X.value=null}function Le(ze){ue.value=ze}const le=Z(!1),U=Z(null),ae=Z({}),se=Z(null);function j(ze){se.value?.el&&!se.value.el.contains(ze.target)&&ye()}function J(ze,Qe){Qe.preventDefault(),Qe.stopPropagation(),U.value=ze,ae.value={top:`${Qe.clientY}px`,left:`${Qe.clientX}px`},le.value=!0,document.addEventListener("mousedown",j,!0)}function ye(){le.value=!1,document.removeEventListener("mousedown",j,!0),U.value=null}function fe(){U.value&&Yo(U.value.root),ye()}function ve(){U.value&&ce(U.value.id,U.value.name),ye()}function V(){const ze=U.value;ze&&(ye(),u("deleteWorkspace",ze.id))}const ee=Z(null),pe=Z(null),Ce=Z({}),$e=Z(null);function De(ze){const Qe=ze.target;Qe.closest(".gh-more")||Qe.closest(".ws-menu")||Ne()}async function ge(ze,Qe){if(ee.value===ze.id){Ne();return}const bt=Qe.currentTarget;pe.value=ze,ee.value=ze.id,document.addEventListener("mousedown",De),window.addEventListener("resize",Ne),await gt();const Pt=$e.value?.el,Hn=bt.getBoundingClientRect(),rn=4,Ut=8,En=Pt?.offsetHeight??0,jn=Pt?.offsetWidth??0;let Ct=Hn.bottom+rn;Ct+En>window.innerHeight-Ut&&(Ct=Math.max(Ut,Hn.top-En-rn));let Do=Hn.right-jn;Do<Ut&&(Do=Ut),Ce.value={top:`${Math.round(Ct)}px`,left:`${Math.round(Do)}px`}}function Ne(){ee.value=null,pe.value=null,document.removeEventListener("mousedown",De),window.removeEventListener("resize",Ne)}function et(ze){Yo(ze.root),Ne()}function rt(ze){ce(ze.id,ze.name),Ne()}function St(ze){Ne(),u("deleteWorkspace",ze.id)}const vt=Z(!1),Nt=Z({}),Wt=Z(null);function ht(ze){const Qe=ze.target;Qe.closest(".side-section-kebab")||Qe.closest(".section-menu")||fn()}async function dn(ze){if(vt.value){fn();return}const Qe=ze.currentTarget;vt.value=!0,document.addEventListener("mousedown",ht),window.addEventListener("resize",fn),await gt();const bt=Wt.value?.el,Pt=Qe.getBoundingClientRect(),Hn=4,rn=8,Ut=bt?.offsetHeight??0,En=bt?.offsetWidth??0;let jn=Pt.bottom+Hn;jn+Ut>window.innerHeight-rn&&(jn=Math.max(rn,Pt.top-Ut-Hn));let Ct=Pt.right-En;Ct<rn&&(Ct=rn),Nt.value={top:`${Math.round(jn)}px`,left:`${Math.round(Ct)}px`}}function fn(){vt.value=!1,document.removeEventListener("mousedown",ht),window.removeEventListener("resize",fn)}function ss(ze){u("setWorkspaceSortMode",ze),fn()}const Dt=Z(!1),Pn=Z({}),ao=Z(null);function it(ze){const Qe=ze.target;Qe.closest(".ch-backend")||Qe.closest(".backend-menu")||co()}async function Gn(ze){if(s.value===null)return;if(Dt.value){co();return}const Qe=ze.currentTarget;Dt.value=!0,document.addEventListener("mousedown",it),window.addEventListener("resize",co),await gt();const bt=ao.value?.el,Pt=Qe.getBoundingClientRect(),Hn=4,rn=8,Ut=bt?.offsetHeight??0;let En=Pt.bottom+Hn;En+Ut>window.innerHeight-rn&&(En=Math.max(rn,Pt.top-Ut-Hn)),Pn.value={top:`${Math.round(En)}px`,left:`${Math.round(Math.max(rn,Pt.left))}px`}}function co(){Dt.value=!1,document.removeEventListener("mousedown",it),window.removeEventListener("resize",co)}async function Yn(ze){if(a(ze)){co();return}if(await MI(ze)===null){console.warn("[kimi-web] dev backend switch failed:",ze),co();return}window.location.reload()}ho(()=>{document.removeEventListener("mousedown",j,!0),document.removeEventListener("mousedown",De),document.removeEventListener("mousedown",ht),document.removeEventListener("mousedown",it),window.removeEventListener("resize",Ne),window.removeEventListener("resize",fn),window.removeEventListener("resize",co)});const mo=Z(null);let is;function qn(){const ze=mo.value;ze&&(ze.classList.remove("blink-now"),ze.getBoundingClientRect(),ze.classList.add("blink-now"),clearTimeout(is),is=setTimeout(()=>ze.classList.remove("blink-now"),300))}const to=Li(()=>ms(()=>import("./DesignSystemView-B-05E4V9.js"),__vite__mapDeps([0,1]))),yn=Z(!1);let Zn,wn=!1;function An(ze){wn=!1,clearTimeout(Zn),ze.currentTarget.setPointerCapture?.(ze.pointerId),Zn=setTimeout(()=>{wn=!0,yn.value=!0},XB)}function Mn(ze){clearTimeout(Zn);const Qe=ze.currentTarget;Qe.hasPointerCapture?.(ze.pointerId)&&Qe.releasePointerCapture(ze.pointerId)}function Bo(){if(wn){wn=!1;return}qn()}return ho(()=>{clearTimeout(Zn)}),(ze,Qe)=>(x(),N("aside",{class:We(["side",{"macos-desktop":C($c),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Vt({width:e.collapsed?"0px":e.colWidth+"px"})},[_("div",{class:"col",style:Vt({width:e.colWidth+"px"})},[_("div",OB,[_("div",RB,[C($c)?re("",!0):(x(),N(Pe,{key:0},[(x(),N("svg",{ref_key:"logoRef",ref:mo,class:We(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Bo,onPointerdown:An,onPointerup:Mn,onPointercancel:Mn},[...Qe[22]||(Qe[22]=[xy('<defs data-v-1b04ce05><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-1b04ce05><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1b04ce05></rect><g class="ch-eyes" fill="#000" data-v-1b04ce05><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-1b04ce05></rect>',2)])],34)),Qe[23]||(Qe[23]=_("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(x(),ke(ph,{key:0,class:"ch-backend",clickable:s.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:i.value}),onClick:Gn},{default:Ee(()=>[_("span",{class:We(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),_("span",BB," · "+O(i.value),1),s.value!==null?(x(),ke(Ve,{key:0,name:"chevron-down",size:"sm"})):re("",!0)]),_:1},8,["clickable","title"])):re("",!0)],64))]),C($c)?re("",!0):(x(),ke(Dn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Qe[0]||(Qe[0]=xt(bt=>u("collapse"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"panel-collapse"})]),_:1},8,["label"]))]),_("div",DB,[_("button",{class:"btn-new-chat",type:"button",onClick:Qe[1]||(Qe[1]=xt(bt=>u("create"),["stop"]))},[ie(Ve,{name:"chat-new"}),_("span",null,O(C(n)("sidebar.newChat")),1)]),re("",!0)]),_("div",{class:We(["search-wrap",{"search-wrap--scrolled":b.value}])},[_("button",{class:"search",type:"button",onClick:h},[ie(Ve,{class:"search-icon",name:"search"}),_("span",PB,O(C(n)("sidebar.search")),1),ie(vr,{keys:C(f)},null,8,["keys"])])],2),_("div",{class:"sessions",onScroll:v},[e.groups.length===0?(x(),N("div",HB,O(C(n)("workspace.noWorkspace")),1)):(x(),N(Pe,{key:1},[_("div",WB,[_("span",zB,O(C(n)("sidebar.workspaces")),1),_("div",UB,[ie(Dn,{class:"side-section-toggle",size:"sm",label:L.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Qe[3]||(Qe[3]=xt(bt=>L.value?$():A(),["stop"]))},{default:Ee(()=>[L.value?(x(),ke(Ve,{key:0,name:"expand"})):(x(),ke(Ve,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Dn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":vt.value,onClick:Qe[4]||(Qe[4]=xt(bt=>dn(bt),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(x(!0),N(Pe,null,ot(e.groups,bt=>(x(),N("div",{key:bt.workspace.id,class:We(["ws-drop-target",{"drop-before":I.value?.id===bt.workspace.id&&I.value.position==="before","drop-after":I.value?.id===bt.workspace.id&&I.value.position==="after"}]),onDragover:Pt=>z(Pt,bt.workspace.id),onDrop:Pt=>R(bt.workspace.id)},[ie(AB,{group:bt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":X.value,"rename-value":ue.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ee.value,dragging:S.value===bt.workspace.id,"is-collapsed":y,"is-expanded":E,onGroupClick:q,onGroupContextmenu:J,onToggleWsMenu:ge,onCreateInWorkspace:Qe[5]||(Qe[5]=Pt=>u("createInWorkspace",Pt)),onSelectSession:K,onRenameSession:Qe[6]||(Qe[6]=(Pt,Hn)=>u("rename",Pt,Hn)),onArchiveSession:Qe[7]||(Qe[7]=Pt=>u("archive",Pt)),onForkSession:Qe[8]||(Qe[8]=Pt=>u("fork",Pt)),onExportSession:Qe[9]||(Qe[9]=Pt=>u("export",Pt)),onLoadMore:F,onToggleExpand:T,onConfirmRename:de,onCancelRename:Ae,onUpdateRenameValue:Le,onWsDragstart:P,onWsDragend:D},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,qB))),128))],64))],32),_("div",jB,[_("button",{class:"btn-settings",type:"button",onClick:Qe[10]||(Qe[10]=xt(bt=>u("openSettings"),["stop"]))},[ie(Ve,{name:"settings"}),_("span",null,O(C(n)("settings.title")),1)])])],4),le.value?(x(),ke(vl,{key:0,ref_key:"ghMenuRef",ref:se,class:"gh-menu",style:Vt(ae.value),onClick:Qe[11]||(Qe[11]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie(mn,{onClick:fe},{default:Ee(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(mn,{onClick:ve},{default:Ee(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1}),ie(mn,{danger:"",onClick:V},{default:Ee(()=>[Xe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),ee.value!==null&&pe.value?(x(),ke(vl,{key:1,ref_key:"wsMenuRef",ref:$e,class:"ws-menu",style:Vt(Ce.value),onClick:Qe[15]||(Qe[15]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie(mn,{onClick:Qe[12]||(Qe[12]=bt=>et(pe.value))},{default:Ee(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(mn,{separator:""}),ie(mn,{onClick:Qe[13]||(Qe[13]=bt=>rt(pe.value))},{default:Ee(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1}),ie(mn,{separator:""}),ie(mn,{danger:"",onClick:Qe[14]||(Qe[14]=bt=>St(pe.value))},{default:Ee(()=>[Xe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),vt.value?(x(),ke(vl,{key:2,ref_key:"sectionMenuRef",ref:Wt,class:"section-menu",style:Vt(Nt.value),onClick:Qe[18]||(Qe[18]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie(mn,{onClick:Qe[16]||(Qe[16]=bt=>ss("manual"))},{default:Ee(()=>[_("span",VB,[e.workspaceSortMode==="manual"?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):re("",!0)]),Xe(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),ie(mn,{onClick:Qe[17]||(Qe[17]=bt=>ss("recent"))},{default:Ee(()=>[_("span",KB,[e.workspaceSortMode==="recent"?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):re("",!0)]),Xe(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):re("",!0),Dt.value?(x(),ke(vl,{key:3,ref_key:"backendMenuRef",ref:ao,class:"backend-menu",style:Vt(Pn.value),onClick:Qe[19]||(Qe[19]=xt(()=>{},["stop"]))},{default:Ee(()=>[(x(),N(Pe,null,ot(r,bt=>ie(mn,{key:bt,onClick:Pt=>Yn(bt)},{default:Ee(()=>[_("span",GB,[a(bt)?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):re("",!0)]),_("span",YB,O(bt),1),_("span",ZB,O(l(bt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):re("",!0),d.value?(x(),ke(XR,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:K,onClose:Qe[20]||(Qe[20]=bt=>d.value=!1)},null,8,["sessions","active-id"])):re("",!0),(x(),ke(lm,{to:"body"},[yn.value?(x(),ke(C(to),{key:0,onClose:Qe[21]||(Qe[21]=bt=>yn.value=!1)})):re("",!0)]))],6))}}),JB=ct(QB,[["__scopeId","data-v-1b04ce05"]]);function eD(e){try{const t=lo(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function tD(e,t){try{po(e,String(t))}catch{}}function nD(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(v){return Number.isFinite(v)?Math.min(I4(s),Math.max(o,Math.round(v))):n}const l=Z(r(eD(t)??n)),a=Z(!1);function c(v){const m=r(v);l.value=m,tD(t,m)}let u=0,d=0,f=null,h=-1;function p(v){if(!a.value)return;const m=v.clientX-u;c(d+(i?-m:m))}function g(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",g),f.removeEventListener("pointercancel",g)}f=null,h=-1}}function b(v){v.preventDefault(),a.value=!0,u=v.clientX,d=r(l.value),f=v.currentTarget,h=v.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",g),f.addEventListener("pointercancel",g)}return ho(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const oD=["aria-label"],sD=Ze({__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}=Et(),{width:i,dragging:r,onPointerDown:l}=nD({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Je(i,a=>o("update:width",a)),Je(r,a=>o("update:dragging",a)),(a,c)=>(x(),N("div",{class:We(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[_("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,oD))}}),uw=ct(sD,[["__scopeId","data-v-48fd0a6d"]]),iD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},rD={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…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},lD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export 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",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},aD={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",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.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",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"},cD={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},uD={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",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"},dD={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},fD={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",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the kimi-code process and try again."},hD={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},pD={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} 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"},mD={justNow:"just now"},gD={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"},vD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},yD={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",collapse:"Collapse",expand:"Expand"},kD={panelTitle:"Thinking",close:"Close"},bD={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"},xD={},wD={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",enlargeImage:"Enlarge image",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"}},_D={searching:"Searching…",noMatch:"No matches"},SD={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},CD={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},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"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},AD={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},MD={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},ED={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},TD={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},ND={preview:"预览",confirm:"确认",cancel:"取消"},ID={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},LD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},$D={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},FD={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},OD={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},RD={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},BD={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 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 kimi-code 进程后重试"},DD={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},PD={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},HD={justNow:"刚刚"},WD={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},zD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},UD={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},qD={panelTitle:"思考过程",close:"关闭"},jD={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},VD={},KD={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:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},GD={searching:"搜索中…",noMatch:"无匹配"},YD={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},ZD={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},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 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},XD={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},QD={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},JD={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},eP={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},tP={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},nP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},oP={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},sP={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},iP={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",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},rP={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},lP={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"},aP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},cP={en:{common:iD,app:rD,sidebar:lD,workspace:aD,conversation:cD,status:uD,composer:dD,login:fD,providers:hD,model:pD,sessions:mD,approval:gD,question:vD,tasks:yD,thinking:kD,diff:bD,fileTree:xD,filePreview:wD,mention:_D,warnings:SD,commands:CD,tools:AD,layout:MD,mobile:ED,theme:TD,onboarding:tP,settings:oP,header:iP,sideChat:lP},zh:{common:ND,app:ID,sidebar:LD,workspace:$D,conversation:FD,status:OD,composer:RD,login:BD,providers:DD,model:PD,sessions:HD,approval:WD,question:zD,tasks:UD,thinking:qD,diff:jD,fileTree:VD,filePreview:KD,mention:GD,warnings:YD,commands:ZD,tools:XD,layout:QD,mobile:JD,theme:eP,onboarding:nP,settings:sP,header:rP,sideChat:aP}},kA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function uP(){const e=lo($t.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const _n=nI({legacy:!1,locale:uP(),fallbackLocale:"en",messages:cP});function bA(e){_n.global.locale.value=e,po($t.locale,e)}const es=_n.global.t,dP={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",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},fP={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",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function $a(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return fP[t]??t}function Fa(e){const t=dP[$a(e)];return t?es(t):e}const hP={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function mm(e){const t=$a(e);let n=hP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),hc(n,"sm")}const xA=80;function pP(e,t=xA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function mP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function gP(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 Gt(e){return typeof e=="string"&&e.length>0?e:void 0}function ul(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function vP(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 a0(e){return Gt(e.path)??Gt(e.file_path)??Gt(e.filePath)??Gt(e.filename)}const yP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function kP(e){const t=Gt(e);if(!t)return;const n=yP[t];return n?es(n):t}function bP(e){const t=ul(e.value),n=Gt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return es("tools.goal.turns",{value:t});case"tokens":return es("tools.goal.tokens",{value:t});case"milliseconds":return es("tools.goal.milliseconds",{value:t});case"seconds":return es("tools.goal.seconds",{value:t});case"minutes":return es("tools.goal.minutes",{value:t});case"hours":return es("tools.goal.hours",{value:t});default:return es("tools.goal.budget",{value:t,unit:n})}}const xP=64;function Sd(e,t,n=!1){const o=(s,i=xA)=>n?s.trim():pP(s,i);try{const s=gP(t);if(!n&&mP(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch($a(e)){case"read":{const r=a0(s);if(!r)return i();const l=ul(s.offset)??ul(s.line_start)??ul(s.start_line),a=ul(s.limit)??ul(s.length),c=ul(s.line_end)??ul(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=a0(s);return r?o(`${r} ${es("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=a0(s);return r?o(r):i()}case"bash":{const r=Gt(s.command)??Gt(s.cmd)??Gt(s.script);return r?o(r,xP):i()}case"grep":case"search":{const r=Gt(s.pattern)??Gt(s.query)??Gt(s.regex),l=Gt(s.path)??Gt(s.glob)??Gt(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=Gt(s.pattern)??Gt(s.glob)??Gt(s.query),l=Gt(s.path)??Gt(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):Gt(s.path)?o(Gt(s.path)):i()}case"ls":{const r=Gt(s.path)??Gt(s.dir)??Gt(s.directory)??Gt(s.cwd);return r?o(r):i()}case"web_fetch":{const r=Gt(s.url)??Gt(s.uri);return r?o(vP(r)):i()}case"todo":case"task":{const r=Gt(s.description)??Gt(s.title)??Gt(s.prompt)??Gt(s.name)??Gt(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(es("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Gt(s.objective),l=Gt(s.completionCriterion);return r&&l?o(es("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=bP(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=kP(s.status);return r?o(es("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function wP(e){try{switch($a(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return es("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 es("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?es("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const _P=Ze({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=B(()=>n(t.status));return(s,i)=>(x(),N("span",{class:We(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Cd=ct(_P,[["__scopeId","data-v-e36198e5"]]),SP=["innerHTML"],CP={class:"bh-text"},AP={class:"a"},MP={key:0,class:"p"},EP={class:"rt"},TP=["aria-label"],NP={key:0,class:"tm"},IP=["inert"],LP={class:"bb-pad"},$P=Ze({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,o=jt("pinScroll",()=>{}),s=Z(null);function i(){n("toggle");const r=s.value;r&>(()=>o(r))}return(r,l)=>(x(),N("div",{class:We(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[_("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(x(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,SP)):re("",!0),_("span",CP,[_("span",AP,O(e.name),1),ie(Zt,{text:e.arg},{default:Ee(()=>[e.arg?(x(),N("span",MP,O(e.arg),1)):re("",!0)]),_:1},8,["text"])]),_("span",EP,[_("span",{class:We(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):e.status==="error"?(x(),ke(Ve,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(x(),ke(Cd,{key:2,status:"suspended"})):(x(),ke(Cd,{key:3,status:"running"}))],10,TP),$n(r.$slots,"trailing"),e.time?(x(),N("span",NP,O(e.time),1)):re("",!0)]),e.expandable?(x(),ke(Ve,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):re("",!0)],512),_("div",{class:We(["bb",{open:e.open}]),inert:!e.open},[_("div",LP,[$n(r.$slots,"default")])],10,IP)],2))}}),gm=ct($P,[["__scopeId","data-v-fef8aad2"]]),FP={key:0,class:"at-type"},OP={key:1,class:"at-task"},RP={key:2,class:"bb-code"},BP=Ze({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t;function i(v){if(!v)return{};try{const m=JSON.parse(v);return{description:typeof m.description=="string"?m.description:void 0,subagentType:typeof m.subagent_type=="string"?m.subagent_type:void 0,prompt:typeof m.prompt=="string"?m.prompt:void 0}}catch{return{}}}const r=B(()=>i(o.tool.arg)),l=B(()=>!!o.tool.output&&o.tool.output.length>0),a=B(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Z(o.tool.defaultExpanded===!0&&a.value),u=B(()=>o.tool.status),d=B(()=>Fa(o.tool.name)),f=B(()=>mm(o.tool.name)),h=B(()=>r.value.description||r.value.subagentType||""),p=jt("resolveAgentTaskId"),g=B(()=>p?p(o.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Je(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(v,m)=>(x(),ke(gm,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:Ee(()=>[g.value?(x(),N("button",{key:0,type:"button",class:"at-open",onClick:m[0]||(m[0]=xt(y=>s("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):re("",!0)]),default:Ee(()=>[r.value.subagentType?(x(),N("div",FP,O(r.value.subagentType),1)):re("",!0),r.value.prompt?(x(),N("div",OP,O(r.value.prompt),1)):re("",!0),l.value?(x(),N("div",RP,[(x(!0),N(Pe,null,ot(e.tool.output??[],(y,k)=>(x(),N("div",{key:k},O(y),1))),128))])):re("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),DP=ct(BP,[["__scopeId","data-v-14ef8750"]]);function PP(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const o=[];for(const s of n){if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];o.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return o}catch{return[]}}const Df={recognized:!1,answers:{},note:""};function HP(e){const t=e?.[0];if(!t)return Df;let n;try{n=JSON.parse(t)}catch{return Df}if(!n||typeof n!="object"||Array.isArray(n))return Df;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Df;const s={};for(const[i,r]of Object.entries(o))typeof r=="string"?s[i]=r:r===!0&&(s[i]=!0);return{recognized:!0,answers:s,note:typeof n.note=="string"?n.note:""}}function WP(e,t,n){return e[t]??e[`q_${n}`]}const zP=/^opt_\d+_(\d+)$/;function UP(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const o=n.get(e);if(o!==void 0)return{selected:new Set([o]),otherText:"",indeterminate:!1};const s=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){s.add(a);continue}const c=zP.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const qP={key:0,class:"chip"},jP={key:0,class:"au-dismissed"},VP={key:1,class:"au-list"},KP={class:"au-q"},GP={key:0,class:"au-hdr"},YP={class:"au-qtext"},ZP={class:"au-opts"},XP={class:"au-glyph"},QP={class:"au-label"},JP={key:0,class:"au-desc"},eH={key:0,class:"au-opt sel"},tH={class:"au-glyph"},nH={class:"au-label"},oH={key:1,class:"au-opt sel"},sH={class:"au-label"},iH={key:2,class:"au-raw"},rH=80,lH=Ze({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Et();function o(L,w=rH){const E=L.trim();return E.length>w?E.slice(0,w-1)+"…":E}const s=B(()=>PP(t.tool.arg)),i=B(()=>HP(t.tool.output)),r=B(()=>i.value.recognized),l=B(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=B(()=>s.value.map((L,w)=>UP(WP(i.value.answers,L.question,w),L.options))),c=B(()=>Object.keys(i.value.answers).length);function u(L,w){return a.value[L]?.selected.has(w)??!1}function d(L){return a.value[L]?.otherText??""}function f(L){return a.value[L]?.indeterminate??!1}function h(L,w){return L?w?"■":"□":w?"●":"○"}const p=B(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const L=s.value[0]?.question??"",w=o(L);return s.value.length<=1?w:`${w} ${n("tools.ask.more",{count:s.value.length-1})}`}),g=B(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),b=B(()=>!!t.tool.output&&t.tool.output.length>0),v=B(()=>r.value&&(s.value.length>0||l.value)||b.value),m=Z(t.tool.defaultExpanded===!0&&v.value),y=B(()=>t.tool.status),k=B(()=>Fa(t.tool.name)),A=B(()=>mm(t.tool.name));function $(){v.value&&(m.value=!m.value)}return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(m.value=!0)}),(L,w)=>(x(),ke(gm,{status:y.value,icon:A.value,name:k.value,arg:m.value?"":p.value,time:e.tool.timing,open:m.value,expandable:v.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:$},{trailing:Ee(()=>[g.value?(x(),N("span",qP,O(g.value),1)):re("",!0)]),default:Ee(()=>[l.value?(x(),N("div",jP,O(i.value.note),1)):r.value?(x(),N("div",VP,[(x(!0),N(Pe,null,ot(s.value,(E,T)=>(x(),N("div",{key:T,class:"au-block"},[_("div",KP,[E.header?(x(),N("span",GP,O(E.header),1)):re("",!0),_("span",YP,O(E.question),1)]),_("div",ZP,[(x(!0),N(Pe,null,ot(E.options,(F,S)=>(x(),N("div",{key:S,class:We(["au-opt",{sel:u(T,S)}])},[_("span",XP,O(h(E.multiSelect,u(T,S))),1),_("span",QP,O(F.label),1),F.description?(x(),N("span",JP,O(F.description),1)):re("",!0)],2))),128)),d(T)?(x(),N("div",eH,[_("span",tH,O(h(E.multiSelect,!0)),1),_("span",nH,O(d(T)),1)])):re("",!0),f(T)?(x(),N("div",oH,[w[0]||(w[0]=_("span",{class:"au-glyph"},"●",-1)),_("span",sH,O(C(n)("tools.ask.answered")),1)])):re("",!0)])]))),128))])):(x(),N("div",iH,[(x(!0),N(Pe,null,ot(e.tool.output??[],(E,T)=>(x(),N("div",{key:T},O(E),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),aH=ct(lH,[["__scopeId","data-v-a9a0f259"]]),cH=1e6,dw=5e3;function fw(e){if(e==="")return[];const t=e.split(`
|
|
68
|
-
`);return t.at(-1)===""&&t.pop(),t}function uH(e,t){const n=fw(e),o=fw(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>dw||i>dw||(s+1)*(i+1)>cH)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function dH(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 wA(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 _A(e){const t=$a(e.name);if(t!=="edit"&&t!=="write")return null;const n=wA(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:uH(o,s)}return null}function fH(e){const t=wA(e);return t&&typeof t.path=="string"?t.path:void 0}function hH(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const pH={key:0,class:"bb-empty"},hw=50,mH=Ze({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=B(()=>t.lines??[]),o=B(()=>n.value.length>hw),s={"--tool-output-visible-lines":String(hw)};return(i,r)=>(x(),N("div",{class:We(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(x(),N("div",pH,O(e.emptyText),1)):re("",!0),(x(!0),N(Pe,null,ot(n.value,(l,a)=>(x(),N("div",{key:a},O(l),1))),128))],2))}}),SA=ct(mH,[["__scopeId","data-v-262bbea0"]]),gH={key:0,class:"chip"},vH={key:0,class:"bb-summary"},yH=Ze({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>n.tool.status),i=B(()=>Fa(n.tool.name)),r=B(()=>mm(n.tool.name)),l=B(()=>Sd(n.tool.name,n.tool.arg)),a=B(()=>Sd(n.tool.name,n.tool.arg,!0)),c=B(()=>_A(n.tool)),u=B(()=>{const g=c.value;if(g&&n.tool.status!=="error"){const{added:b,removed:v}=dH(g);if(b||v)return`+${b} −${v}`}return""}),d=B(()=>!!n.tool.output&&n.tool.output.length>0),f=Z(!1),h=B(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(g,b)=>(x(),ke(gm,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Ee(()=>[u.value?(x(),N("span",gH,O(u.value),1)):re("",!0)]),default:Ee(()=>[a.value?(x(),N("div",vH,O(a.value),1)):re("",!0),ie(SA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),kH=ct(yH,[["__scopeId","data-v-74e1da99"]]),bH={key:0,class:"chip"},xH={key:0,class:"bb-summary"},wH=Ze({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=B(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=B(()=>!!t.tool.output&&t.tool.output.length>0),s=B(()=>o.value||n.value),i=Z(t.tool.defaultExpanded===!0&&s.value),r=B(()=>t.tool.status),l=B(()=>Fa(t.tool.name)),a=B(()=>mm(t.tool.name)),c=B(()=>Sd(t.tool.name,t.tool.arg)),u=B(()=>Sd(t.tool.name,t.tool.arg,!0)),d=B(()=>wP({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(x(),ke(gm,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Ee(()=>[d.value?(x(),N("span",bH,O(d.value),1)):re("",!0)]),default:Ee(()=>[u.value?(x(),N("div",xH,O(u.value),1)):re("",!0),ie(SA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),_H=ct(wH,[["__scopeId","data-v-aa4edcb0"]]),SH={class:"media-title"},CH=["src","alt"],AH=["src"],MH=["src"],EH=Ze({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=B(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(x(),N("div",{key:0,class:We(["media-tool",{mob:e.mobile}])},[ie(Zt,{text:s.value.path||l.value},{default:Ee(()=>[_("div",SH,O(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(x(),ke(Zt,{key:0,text:s.value.path||l.value},{default:Ee(()=>[_("button",{type:"button",class:"media-image-button",onClick:a},[_("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,CH)])]),_:1},8,["text"])):s.value.kind==="video"?(x(),N("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,AH)):(x(),N("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,MH))],2)):re("",!0)}}),TH=ct(EH,[["__scopeId","data-v-bec13b73"]]),NH=/<summary>([\s\S]*?)<\/summary>/,IH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,c0=/<subagent\b([^>]*)>|<\/subagent>/g,LH="</subagent>",pw=/(completed|failed|aborted):\s*(\d+)/g,mw=/([a-z_]+)="([^"]*)"/g;function $H(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function FH(e){const t={};mw.lastIndex=0;let n;for(;(n=mw.exec(e))!==null;)t[n[1]]=$H(n[2]);return t}function OH(e){const t={completed:0,failed:0,aborted:0};pw.lastIndex=0;let n;for(;(n=pw.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function RH(e,t){const n=FH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function BH(e){const t=[],n=[];c0.lastIndex=0;let o;for(;(o=c0.exec(e))!==null;)if(o[0]===LH){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(RH(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:c0.lastIndex}):n.push(null);return t}function DH(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
|
|
69
|
-
`):e;if(!t.includes("<agent_swarm_result>"))return null;const n=NH.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=OH(n),r=IH.exec(t)?.[1]?.trim(),l=BH(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function gw(e){return e?e.split(`
|
|
70
|
-
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function PH(e){return e.suspendedReason||gw(e.text)||gw(e.outputLines?.join(`
|
|
71
|
-
`))||e.summary||""}function HH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
72
|
-
`):e.summary??""}function WH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function vw(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
73
|
-
`)[0]??"",phase:WH(e.outcome),body:e.body}}function zH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function UH(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:PH(s),phase:s.phase,body:HH(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>zH(i,s))).map((s,i)=>vw(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>vw(s,i))}const qH=["aria-expanded"],jH={class:"title"},VH={key:0,class:"meta"},KH={key:1,class:"sum-txt"},GH={class:"rt"},YH={class:"status"},ZH={key:0,class:"chip"},XH={key:1,class:"tm"},QH={class:"body"},JH={class:"overview"},eW={class:"overview-line"},tW={class:"big"},nW={key:0,class:"lbl"},oW={key:1,class:"lbl"},sW={key:2,class:"lbl"},iW={key:0,class:"seg","aria-hidden":"true"},rW={key:1,class:"legend"},lW=["aria-expanded","onClick"],aW={class:"mname"},cW={class:"mact"},uW={class:"mphase"},dW={key:1,class:"fallback-output"},fW={key:2,class:"waiting"},hW=Ze({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Et(),n=e;function o(T){if(!T)return{};try{const F=JSON.parse(T),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=jt("resolveSwarmMembers"),i=B(()=>o(n.tool.arg)),r=B(()=>Fa(n.tool.name)),l=B(()=>i.value.description??""),a=B(()=>s?.(n.tool.id)??[]),c=B(()=>DH(n.tool.output)),u=B(()=>n.tool.status),d=B(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=B(()=>UH(a.value,c.value)),h=B(()=>{const T={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)T[F.phase]++;return T}),p=B(()=>f.value.length||i.value.itemCount||0),g=B(()=>h.value.completed+h.value.failed),b=B(()=>h.value.working+h.value.suspended+h.value.queued),v=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],m=B(()=>v.map(({phase:T,cls:F})=>({phase:T,count:h.value[T],cls:F})).filter(T=>T.count>0)),y=Z(u.value==="running"||b.value>0);function k(){y.value=!y.value}const A=B(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
74
|
-
`).trim()),$=Z(new Set);function L(T){const F=new Set($.value);F.has(T)?F.delete(T):F.add(T),$.value=F}function w(T){return $.value.has(T)}function E(T){return t(`tools.swarm.phase${T[0].toUpperCase()}${T.slice(1)}`)}return(T,F)=>(x(),N("div",{class:We(["swarm-card",{open:y.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":y.value,onClick:k},[ie(Ve,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",jH,O(r.value),1),l.value?(x(),N("span",VH,"·")):re("",!0),l.value?(x(),N("span",KH,O(l.value),1)):re("",!0),_("span",GH,[_("span",YH,[d.value==="ok"?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):d.value==="error"?(x(),ke(Ve,{key:1,name:"close",size:"sm"})):(x(),ke(Cd,{key:2,status:"running"}))]),g.value>0||p.value>0?(x(),N("span",ZH,O(g.value)+" / "+O(p.value),1)):re("",!0),e.tool.timing?(x(),N("span",XH,O(e.tool.timing),1)):re("",!0)]),ie(Ve,{class:"car",name:y.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,qH),Ln(_("div",QH,[_("div",JH,[_("div",eW,[_("span",tW,O(C(t)("tools.swarm.progress",{done:g.value,total:p.value})),1),d.value==="running"&&p.value>0?(x(),N("span",nW,O(C(t)("tools.swarm.runningSub",{count:b.value})),1)):c.value?(x(),N("span",oW,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(x(),N("span",sW,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&m.value.length>0?(x(),N("div",iW,[(x(!0),N(Pe,null,ot(m.value,S=>(x(),N("span",{key:S.phase,class:We(S.cls),style:Vt({flex:S.count})},null,6))),128))])):re("",!0),m.value.length>1?(x(),N("div",rW,[(x(!0),N(Pe,null,ot(m.value,S=>(x(),N("span",{key:S.phase},[_("i",{class:We(["lg-dot",S.cls])},null,2),Xe(O(E(S.phase))+" "+O(S.count),1)]))),128))])):re("",!0)]),f.value.length>0?(x(!0),N(Pe,{key:0},ot(f.value,S=>(x(),N("div",{key:S.id,class:We(["member",[`phase-${S.phase}`,{open:w(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":w(S.id),onClick:I=>L(S.id)},[ie(Cd,{class:"row-dot",status:S.phase},null,8,["status"]),ie(Zt,{text:S.name},{default:Ee(()=>[_("span",aW,O(S.name),1)]),_:2},1032,["text"]),S.activity?(x(),ke(Zt,{key:0,text:S.activity},{default:Ee(()=>[_("span",cW,O(S.activity),1)]),_:2},1032,["text"])):re("",!0),_("span",uW,O(E(S.phase)),1),ie(Ve,{class:"mcar",name:w(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,lW),Ln(_("div",{class:"member-body"},O(S.body),513),[[mi,w(S.id)]])],2))),128)):A.value?(x(),N("div",dW,O(A.value),1)):(x(),N("div",fW,O(C(t)("tools.swarm.waiting")),1))],512),[[mi,y.value]])],2))}}),pW=ct(hW,[["__scopeId","data-v-4b58e128"]]);function mW(e){if(e.media&&e.status==="ok")return TH;const t=$a(e.name);return t==="edit"||t==="write"||t==="multi_edit"?kH:t==="task"?DP:t==="agentswarm"?pW:t==="askuserquestion"?aH:_H}const CA=Ze({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>mW(n.tool));return(i,r)=>(x(),ke(Vo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function or(e){if(e>=1024*1024)return`${yw(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):yw(t)}k`}return String(e)}function yw(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function gW(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 vm(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 vW(e){return!(e.tool.status==="ok"&&e.tool.media)}function yW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function kW(e){const t=vm(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(vW(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function bW(e){return vm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
75
|
-
|
|
76
|
-
`)}function xW(e){const t=[];for(const n of vm(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
77
|
-
> ${n.thinking.split(`
|
|
78
|
-
`).join(`
|
|
79
|
-
> `)}`);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(`
|
|
80
|
-
`);t.push(`\`\`\`
|
|
81
|
-
[${n.tool.name}]
|
|
82
|
-
${o}
|
|
83
|
-
\`\`\``)}return t.join(`
|
|
84
|
-
|
|
85
|
-
`)}function AA(e){return e.tool.id||`tool-${e.sourceIndex}`}function wW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?AA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const _W=["aria-expanded"],SW={class:"tg-title"},CW={class:"tg-meta"},AW=["inert"],MW={class:"tool-group-body-inner"},EW=Ze({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=Z(!0),i=B(()=>n.tools.length),r=B(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Et(),a=B(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=jt("pinScroll",()=>{}),d=Z(null);function f(){c();const h=d.value;h&>(()=>u(h))}return(h,p)=>(x(),N("div",{class:We(["tool-group",{open:s.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[ie(Cd,{status:r.value},null,8,["status"]),ie(Ve,{class:"tg-ic",name:"list",size:"sm"}),_("span",SW,O(C(l)("tools.group.title",i.value)),1),_("span",CW,"· "+O(a.value),1),ie(Ve,{class:"tg-car",name:"chevron-right",size:"sm"})],8,_W),_("div",{class:We(["tool-group-body",{open:s.value}]),inert:!s.value},[_("div",MW,[(x(!0),N(Pe,null,ot(e.tools,(g,b)=>(x(),ke(CA,{key:C(AA)(g),tool:g.tool,mobile:e.mobile,"stack-position":C(yW)(b,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=v=>o("openMedia",v)),onOpenFile:p[1]||(p[1]=v=>o("openFile",v)),onOpenToolDiff:p[2]||(p[2]=v=>o("openToolDiff",v)),onOpenAgent:p[3]||(p[3]=v=>o("openAgent",v))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,AW)],2))}}),TW=ct(EW,[["__scopeId","data-v-37eb334f"]]);var NW=Object.create,Oy=Object.defineProperty,IW=Object.getOwnPropertyDescriptor,MA=Object.getOwnPropertyNames,LW=Object.getPrototypeOf,$W=Object.prototype.hasOwnProperty,EA=(e,t)=>function(){return t||(0,e[MA(e)[0]])((t={exports:{}}).exports,t),t.exports},TA=e=>{let t={};for(var n in e)Oy(t,n,{get:e[n],enumerable:!0});return t},FW=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=MA(t),i=0,r=s.length,l;i<r;i++)l=s[i],!$W.call(e,l)&&l!==n&&Oy(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=IW(t,l))||o.enumerable});return e},NA=(e,t,n)=>(n=e!=null?NW(LW(e)):{},FW(Oy(n,"default",{value:e,enumerable:!0}),e));function OW(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 RW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function BW(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 DW(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
86
|
-
`:`<hr class="footnotes-sep">
|
|
87
|
-
`)+`<section class="footnotes">
|
|
88
|
-
<ol class="footnotes-list">
|
|
89
|
-
`}function PW(){return`</ol>
|
|
90
|
-
</section>
|
|
91
|
-
`}function HW(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 WW(){return`</li>
|
|
92
|
-
`}function zW(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 UW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=BW,e.renderer.rules.footnote_block_open=DW,e.renderer.rules.footnote_block_close=PW,e.renderer.rules.footnote_open=HW,e.renderer.rules.footnote_close=WW,e.renderer.rules.footnote_anchor=zW,e.renderer.rules.footnote_caption=RW,e.renderer.rules.footnote_anchor_name=OW;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:p},g.level=l.level++,l.tokens.push(g);const b=l.bMarks[a],v=l.tShift[a],m=l.sCount[a],y=l.parentType,k=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let $=A;for(;h<f;){const w=l.src.charCodeAt(h);if(n(w))w===9?$+=4-$%4:$++;else break;h++}l.tShift[a]=h-k,l.sCount[a]=$-A,l.bMarks[a]=k,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=y,l.blkIndent-=4,l.tShift[a]=v,l.sCount[a]=m,l.bMarks[a]=b;const L=new l.Token("footnote_reference_close","",-1);return L.level=--l.level,l.tokens.push(L),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,g=h.length;p<g;p++){const b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const y=new l.Token("paragraph_open","p",1);y.block=!0,a.push(y);const k=new l.Token("inline","",0);k.children=h[p].tokens,k.content=h[p].content,a.push(k);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let v;l.tokens[l.tokens.length-1].type==="paragraph_close"?v=l.tokens.pop():v=null;const m=h[p].count>0?h[p].count:1;for(let y=0;y<m;y++){const k=new l.Token("footnote_anchor","",0);k.meta={id:p,subId:y,label:h[p].label},l.tokens.push(k)}v&&l.tokens.push(v),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 qW(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 jW(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 VW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function KW(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(VW,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function GW(e){e.inline.ruler.after("emphasis","sub",KW)}const YW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function ZW(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(YW,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function XW(e){e.inline.ruler.after("emphasis","sup",ZW)}var QW=EA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),g.core.ruler.after("inline","github-task-lists",function(v){for(var m=v.tokens,y=0,k=2;k<m.length;k++)s(m,k)&&(i(m[k],y,b,v.Token),y+=1,n(m[k-2],"class",b.liClass),n(m[o(m,k-2)],"class",b.ulClass))})};function n(g,b,v){var m=g.attrIndex(b),y=[b,v];m<0?g.attrPush(y):g.attrs[m]=y}function o(g,b){for(var v=g[b].level-1,m=b-1;m>=0;m--)if(g[m].level===v)return m;return-1}function s(g,b){return d(g[b])&&f(g[b-1])&&h(g[b-2])&&p(g[b])}function i(g,b,v,m){var y=v.idPrefix+b;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(y,m)),g.children.push(a(m)),g.children.unshift(r(g,y,v,m)),v.divWrap&&(g.children.unshift(c(v,m)),g.children.push(u(m)))}function r(g,b,v,m){var y=new m("checkbox_input","input",0);return y.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&y.attrs.push(["checked","true"]),v.disabled===!0&&y.attrs.push(["disabled","true"]),y}function l(g,b){var v=new b("label_open","label",1);return v.attrs=[["for",g]],v}function a(g){return new g("label_close","label",-1)}function c(g,b){var v=new b("checkbox_open","div",0);return v.attrs=[["class",g.divClass]],v}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function p(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),JW=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))),ez=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),u0;const tz=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]]),nz=(u0=String.fromCodePoint)!==null&&u0!==void 0?u0: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 oz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=tz.get(e))!==null&&t!==void 0?t:e}var Oo;(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"})(Oo||(Oo={}));const sz=32;var yl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(yl||(yl={}));function Qg(e){return e>=Oo.ZERO&&e<=Oo.NINE}function iz(e){return e>=Oo.UPPER_A&&e<=Oo.UPPER_F||e>=Oo.LOWER_A&&e<=Oo.LOWER_F}function rz(e){return e>=Oo.UPPER_A&&e<=Oo.UPPER_Z||e>=Oo.LOWER_A&&e<=Oo.LOWER_Z||Qg(e)}function lz(e){return e===Oo.EQUALS||rz(e)}var Fo;(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"})(Fo||(Fo={}));var ml;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ml||(ml={}));var az=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Fo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ml.Strict}startEntity(e){this.decodeMode=e,this.state=Fo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Fo.EntityStart:return e.charCodeAt(t)===Oo.NUM?(this.state=Fo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Fo.NamedEntity,this.stateNamedEntity(e,t));case Fo.NumericStart:return this.stateNumericStart(e,t);case Fo.NumericDecimal:return this.stateNumericDecimal(e,t);case Fo.NumericHex:return this.stateNumericHex(e,t);case Fo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|sz)===Oo.LOWER_X?(this.state=Fo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Fo.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(Qg(o)||iz(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(Qg(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===Oo.SEMI)this.consumed+=1;else if(this.decodeMode===ml.Strict)return 0;return this.emitCodePoint(oz(this.result),this.consumed),this.errors&&(e!==Oo.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&yl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=cz(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===ml.Attribute&&(s===0||lz(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&yl.VALUE_LENGTH)>>14,s!==0){if(i===Oo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ml.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]&yl.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]&~yl.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Fo.NamedEntity:return this.result!==0&&(this.decodeMode!==ml.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Fo.NumericDecimal:return this.emitNumericEntity(0,2);case Fo.NumericHex:return this.emitNumericEntity(0,3);case Fo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Fo.EntityStart:return 0}}};function IA(e){let t="";const n=new az(e,o=>t+=nz(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 cz(e,t,n,o){const s=(t&yl.BRANCH_LENGTH)>>7,i=t&yl.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 uz=IA(JW);IA(ez);function Ry(e,t=ml.Legacy){return uz(e,t)}var dz=NA(QW());const kw={};function fz(e){let t=kw[e];if(t)return t;t=kw[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 ym(e,t){typeof t!="string"&&(t=ym.defaultChars);const n=fz(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})}ym.defaultChars=";/?:@&=+$,#";ym.componentChars="";var Jg=ym;const bw={};function hz(e){let t=bw[e];if(t)return t;t=bw[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 km(e,t,n){typeof t!="string"&&(n=t,t=km.defaultChars),typeof n>"u"&&(n=!0);const o=hz(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}km.defaultChars=";/?:@&=+$,-_.!~*'()#";km.componentChars="-_.!~*'()";var LA=km;function By(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 np(){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 pz=/^([a-z0-9.+-]+:)/i,mz=/:[0-9]*$/,gz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,vz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
93
|
-
`," "]),yz=["'"].concat(vz),xw=["%","/","?",";","#"].concat(yz),ww=["/","?","#"],kz=255,_w=/^[+a-z0-9A-Z_-]{0,63}$/,bz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Sw={javascript:!0,"javascript:":!0},Cw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function xz(e,t){if(e&&e instanceof np)return e;const n=new np;return n.parse(e,t),n}np.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=gz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=pz.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&&Sw[r])&&(i=i.substr(2),this.slashes=!0)),!Sw[r]&&(s||r&&!Cw[r])){let c=-1;for(let p=0;p<ww.length;p++)o=i.indexOf(ww[p]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<xw.length;p++)o=i.indexOf(xw[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let g=0,b=p.length;g<b;g++){const v=p[g];if(v&&!v.match(_w)){let m="";for(let y=0,k=v.length;y<k;y++)v.charCodeAt(y)>127?m+="x":m+=v[y];if(!m.match(_w)){const y=p.slice(0,g),k=p.slice(g+1),A=v.match(bz);A&&(y.push(A[1]),k.unshift(A[2])),k.length&&(i=k.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>kz&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Cw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};np.prototype.parseHost=function(e){let t=mz.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 Dy=xz,$A=TA({decode:()=>Jg,encode:()=>LA,format:()=>By,parse:()=>Dy}),FA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,OA=/[\0-\x1F\x7F-\x9F]/,wz=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,RA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,_z=/[\$\+<->\^`\|~\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]/,BA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Sz=TA({Any:()=>FA,Cc:()=>OA,Cf:()=>wz,P:()=>RA,S:()=>_z,Z:()=>BA}),Cz=Object.defineProperty,DA=e=>{let t={};for(var n in e)Cz(t,n,{get:e[n],enumerable:!0});return t},bo=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}`}},Az=DA({arrayReplaceAt:()=>$z,assign:()=>Iz,countLines:()=>so,escapeHtml:()=>zz,escapeRE:()=>qz,fromCodePoint:()=>Md,has:()=>Nz,isMdAsciiPunct:()=>ip,isPunctChar:()=>sp,isPunctCode:()=>ev,isSpace:()=>Lz,isString:()=>Ez,isValidEntityCode:()=>xm,isWhiteSpace:()=>Ad,lib:()=>jz,mdurl:()=>$A,normalizeReference:()=>bm,ucmicro:()=>op,unescapeAll:()=>Ed,unescapeMd:()=>Bz});const op=Sz;function Mz(e){return Object.prototype.toString.call(e)}function Ez(e){return Mz(e)==="[object String]"}const Tz=Object.prototype.hasOwnProperty;function Nz(e,t){return Tz.call(e,t)}function Iz(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 Lz(e){return e===9||e===32}function Ad(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 sp(e){return op.P.test(e)||op.S.test(e)}const Aw=new Map;function ev(e){if(ip(e))return!0;const t=Aw.get(e);if(t!==void 0)return t;const n=sp(String.fromCharCode(e));return Aw.set(e,n),n}function ip(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 bm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function $z(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function xm(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 Md(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 PA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Fz=new RegExp(`${PA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Oz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Rz(e,t){if(t.charCodeAt(0)===35&&Oz.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return xm(o)?Md(o):e}const n=Ry(e);return n!==e?n:e}function Bz(e){return e.includes("\\")?e.replace(PA,"$1"):e}function Ed(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Fz,(t,n,o)=>n||Rz(t,o))}const Dz=/[&<>"]/,Pz=/[&<>"]/g,Hz={"&":"&","<":"<",">":">",'"':"""};function Wz(e){return Hz[e]}function zz(e){return Dz.test(e)?e.replace(Pz,Wz):e}const Uz=/[.?*+^$[\]\\(){}|-]/g;function qz(e){return e.replace(Uz,"\\$&")}const jz={mdurl:$A,ucmicro:op};function so(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
94
|
-
`,n+1))!==-1;)t++;return t}const Vz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Kz=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Gz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Py=["references","footnotes","abbreviations","abbr","abbrs"],Hy=Symbol.for("markdown-it-ts.global-state"),Wy=Object.prototype.hasOwnProperty;function Mw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _l(e){if(Array.isArray(e))return e.map(t=>_l(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=_l(e[n]);return t}return e}function rp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function tv(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(!tv(e[n],t[n]))return!1;return!0}if($i(e)||$i(t)){if(!$i(e)||!$i(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(!Wy.call(t,s)||!tv(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function HA(e,t){if(Array.isArray(e))return e[Number(t)];if($i(e))return e[t]}function Yz(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=_l(t[n]);return e}if($i(e)&&$i(t)){for(const n of Object.keys(e))Wy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=_l(t[n]);return e}return _l(t)}function Zz(e,t,n){const o=n.ownedKeys??[],s=e[t];if($i(s)||Array.isArray(s)){const i=new Set(rp(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=_l(HA(n.value,r)):delete s[r];!n.existed&&rp(s).length===0&&delete e[t];return}n.existed?e[t]=_l(n.value):delete e[t]}function zy(e){const t=e[Hy];return Mw(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Mw(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function Xz(e,t){Object.defineProperty(e,Hy,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Es(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Vz.test(e)?"footnote-definition":Kz.test(e)?"abbreviation-definition":Gz.test(e)?"reference-definition":null}function qd(e){return zy(e)?.reason??null}function Fc(e,t,n){if(qd(e)&&Hr(e),!t)return n();Uy(e,t);try{const o=n();return qy(e),o}catch(o){throw Hr(e),o}}function Uy(e,t){try{Hr(e);const n={};for(const o of Py)n[o]=Wy.call(e,o)?{existed:!0,value:_l(e[o])}:{existed:!1};Xz(e,{reason:t,snapshot:n})}catch{}}function qy(e){const t=zy(e);if(t)for(const n of Py){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!$i(s)&&!Array.isArray(s))continue;const i=new Set(rp(o.existed?o.value:void 0));o.ownedKeys=rp(s).filter(r=>i.has(r)?!tv(s[r],HA(o.value,r)):!0)}}function Hr(e){const t=zy(e);if(t){for(const n of Py){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){Zz(e,n,o);continue}o.existed?e[n]=Yz(e[n],o.value):delete e[n]}delete e[Hy]}}const nv=Symbol.for("markdown-it-ts.diagnostics");function wm(e,t){if(e)try{const n=e[nv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[nv]=o,o}catch{return}}function xr(e){return wm(e,!1)}function Qz(e){if(e)try{const t=e[nv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function us(e){Qz(e)}function vo(e,t){const n=wm(e,!0);n&&(n.strategy=t)}function d0(e,t){const n=wm(e,!0);n&&(n.chunk=t)}function WA(e,t){const n=wm(e,!0);n&&(n.unbounded=t)}function Jz(e){const t={};e=e||{},t.src_Any=FA.source,t.src_Cc=OA.source,t.src_Z=BA.source,t.src_P=RA.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function ov(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function _m(e){return Object.prototype.toString.call(e)}function eU(e){return _m(e)==="[object String]"}function tU(e){return _m(e)==="[object Object]"}function nU(e){return _m(e)==="[object RegExp]"}function Ew(e){return _m(e)==="[object Function]"}function oU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const zA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function sU(e){return Object.keys(e||{}).reduce(function(t,n){return t||zA.hasOwnProperty(n)},!1)}const iU={"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}}},rU="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]",lU="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function aU(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Tw(){return function(e,t){t.normalize(e)}}function lp(e){const t=e.re=Jz(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(rU),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,tU(a)){nU(a.validate)?c.validate=aU(a.validate):Ew(a.validate)?c.validate=a.validate:i(l,a),Ew(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Tw();return}if(eU(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:Tw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(oU).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function UA(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ei(e,t){if(!(this instanceof ei))return new ei(e,t);t||sU(e)&&(t=e,e={}),this.__opts__=ov({},zA,t),this.__schemas__=ov({},iU,e),this.__compiled__={},this.__tlds__=lU,this.__tlds_replaced__=!1,this.re={},lp(this)}ei.prototype.add=function(t,n){return this.__schemas__[t]=n,lp(this),this};ei.prototype.set=function(t){return this.__opts__=ov(this.__opts__,t),this};ei.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)};ei.prototype.pretest=function(t){return this.re.pretest.test(t)};ei.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ei.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new UA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};ei.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new UA(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ei.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(),lp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,lp(this),this)};ei.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ei.prototype.onCompile=function(){};var qA=ei,cU=EA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,b=Math.floor,v=String.fromCharCode;function m(D){throw new RangeError(p[D])}function y(D,W){const z=[];let R=D.length;for(;R--;)z[R]=W(D[R]);return z}function k(D,W){const z=D.split("@");let R="";z.length>1&&(R=z[0]+"@",D=z[1]),D=D.replace(h,".");const q=y(D.split("."),W).join(".");return R+q}function A(D){const W=[];let z=0;const R=D.length;for(;z<R;){const q=D.charCodeAt(z++);if(q>=55296&&q<=56319&&z<R){const K=D.charCodeAt(z++);(K&64512)==56320?W.push(((q&1023)<<10)+(K&1023)+65536):(W.push(q),z--)}else W.push(q)}return W}const $=D=>String.fromCodePoint(...D),L=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},w=function(D,W){return D+22+75*(D<26)-((W!=0)<<5)},E=function(D,W,z){let R=0;for(D=z?b(D/700):D>>1,D+=b(D/W);D>g*26>>1;R+=36)D=b(D/g);return b(R+(g+1)*D/(D+38))},T=function(D){const W=[],z=D.length;let R=0,q=128,K=72,X=D.lastIndexOf("-");X<0&&(X=0);for(let ue=0;ue<X;++ue)D.charCodeAt(ue)>=128&&m("not-basic"),W.push(D.charCodeAt(ue));for(let ue=X>0?X+1:0;ue<z;){const me=R;for(let ce=1,de=36;;de+=36){ue>=z&&m("invalid-input");const Ae=L(D.charCodeAt(ue++));Ae>=36&&m("invalid-input"),Ae>b((2147483647-R)/ce)&&m("overflow"),R+=Ae*ce;const Le=de<=K?1:de>=K+26?26:de-K;if(Ae<Le)break;const le=36-Le;ce>b(2147483647/le)&&m("overflow"),ce*=le}const ne=W.length+1;K=E(R-me,ne,me==0),b(R/ne)>2147483647-q&&m("overflow"),q+=b(R/ne),R%=ne,W.splice(R++,0,q)}return String.fromCodePoint(...W)},F=function(D){const W=[];D=A(D);const z=D.length;let R=128,q=0,K=72;for(const me of D)me<128&&W.push(v(me));const X=W.length;let ue=X;for(X&&W.push("-");ue<z;){let me=2147483647;for(const ce of D)ce>=R&&ce<me&&(me=ce);const ne=ue+1;me-R>b((2147483647-q)/ne)&&m("overflow"),q+=(me-R)*ne,R=me;for(const ce of D)if(ce<R&&++q>2147483647&&m("overflow"),ce===R){let de=q;for(let Ae=36;;Ae+=36){const Le=Ae<=K?1:Ae>=K+26?26:Ae-K;if(de<Le)break;const le=de-Le,U=36-Le;W.push(v(w(Le+le%U,0))),de=b(le/U)}W.push(v(w(de,0))),K=E(q,ne,ue===X),q=0,++ue}++q,++R}return W.join("")},P={version:"2.3.1",ucs2:{decode:A,encode:$},decode:T,encode:F,toASCII:function(D){return k(D,function(W){return f.test(W)?"xn--"+F(W):W})},toUnicode:function(D){return k(D,function(W){return d.test(W)?T(W.slice(4).toLowerCase()):W})}};t.exports=P})}),jA=NA(cU());function jy(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=Ed(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=Ed(e.slice(t,s)),i.pos=s,i.ok=!0),i}var VA=jy;const mh=-2;function uU(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 mh}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return mh;if(r===91){s++,i++;continue}i++}return-1}function Vy(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=uU(l,t,a,n);if(f!==mh)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var ap=Vy;function Ky(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+=Ed(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+=Ed(e.slice(t,i)),r}var KA=Ky;function Sm(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 Gy(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function dU(e,t,n){const o=Sm(e,t),s=[t,n];o<0?Gy(e,s):e.attrs[o]=s}function fU(e,t){const n=Sm(e,t);return n>=0?e.attrs[n][1]:null}function hU(e,t,n){const o=Sm(e,t);o<0?Gy(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var pU=DA({attrGet:()=>fU,attrIndex:()=>Sm,attrJoin:()=>hU,attrPush:()=>Gy,attrSet:()=>dU,parseLinkDestination:()=>jy,parseLinkLabel:()=>Vy,parseLinkTitle:()=>Ky});function mU(e){return e.includes("\r")||e.includes("\0")}function GA(e){return typeof e=="string"?e:e.toString()}function gU(e){if(e.inlineMode){const t=new bo("inline","",0);t.content=GA(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const vU=/^([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])?)*)$/,yU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function kU(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(yU.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(vU.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 bU=kU;function xU(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(`
|
|
95
|
-
`)&&(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 wU=xU;function Nw(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function _U(e){const t=e.tokens_meta,n=e.tokens_meta.length;Nw(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Nw(t[o].delimiters)}var SU=_U;function CU(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 Iw(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 AU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Iw(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Iw(e,t[o].delimiters)}const Lw={tokenize:CU,postProcess:AU};function YA(e){return Ry(e)}function Yy(e){return e>=48&&e<=57}function MU(e){const t=e|32;return Yy(e)||t>=97&&t<=102}function ZA(e){const t=e|32;return t>=97&&t<=122}function EU(e){return ZA(e)||Yy(e)}function TU(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?MU(l):Yy(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function NU(e,t,n){let o=t+1;if(o>=n||!ZA(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&EU(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return YA(s)!==s?s:null}function IU(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=TU(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=xm(i)?Md(i):Md(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=NU(e.src,n,o);if(s){const i=YA(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var LU=IU;const XA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),sv=new Array(128),QA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);sv[e]=`\\${t}`,QA[e]=XA[e]?t:sv[e]}function $w(e,t,n){e.pending&&e.pushPending();const o=new bo("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 $U(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):($w(e,QA[i],sv[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 $w(e,i<256&&XA[i]?r:l,l),e.pos=n+1,!0}var FU=$U;function OU(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 RU=OU;const JA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,e6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",BU=new RegExp(`^(?:${JA}|${e6}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),DU=new RegExp(`^(?:${JA}|${e6})`);function t6(e){return e===32||e===9||e===10||e===12||e===13}function PU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||t6(t)}function HU(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(!t6(n))return!1}return!1}function WU(e){const t=e|32;return t>=97&&t<=122}function zU(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&&!WU(i))return!1;const r=s.slice(o).match(BU);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,PU(l)&&e.linkLevel++,HU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var UU=zU;function qU(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=ap(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=VA(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=KA(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=ap(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[bm(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const g=[];e.md.inline.parse(o,e.md,e.env,g);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=g,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var jU=qU;function VU(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=ap(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(s=VA(e.src,p,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?p=s.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(s=KA(e.src,p,e.posMax),p<d&&a!==p&&s.ok)for(l=s.str,p=s.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=ap(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[bm(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var KU=VU;function n6(e){const t=e|32;return t>=97&&t<=122}function GU(e){return e>=48&&e<=57}function YU(e){return n6(e)||GU(e)||e===43||e===45||e===46}function ZU(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&YU(e.charCodeAt(t));)t--;return t++,t>=e.length||!n6(e.charCodeAt(t))?null:e.slice(t)}function XU(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 QU(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=ZU(e.pending);if(!s)return!1;const i=XU(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 JU(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 eq=JU;function tq(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 Fw(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 nq(e){const t=e.delimiters;Fw(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Fw(e,n[o].delimiters)}const Ow={tokenize:tq,postProcess:nq};function Rw(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 oq(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||Rw(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!Rw(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var sq=oq;function Zy(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function iq(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 rq(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 o6(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:Zy(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Oc(e,t,n,o,s,i){const r=o6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=rq(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=Zy()}function lq(e){const t=o6(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=iq(s.samples)}return t.completedAt=Zy(),t}var Bw=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}},s6=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 bo("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 bo(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 bo(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=Ad(l),u=Ad(a),d=ev(l),f=ev(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};s6.prototype.Token=bo;const aq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function i6(e){return!aq.test(e)}var cq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Bw,this.ruler2=new Bw,this.ruler.push("text",sq),this.ruler.push("linkify",QU),this.ruler.push("newline",eq),this.ruler.push("escape",FU),this.ruler.push("backticks",wU),this.ruler.push("strikethrough",Ow.tokenize),this.ruler.push("emphasis",Lw.tokenize),this.ruler.push("link",KU),this.ruler.push("image",jU),this.ruler.push("autolink",bU),this.ruler.push("html_inline",UU),this.ruler.push("entity",LU),this.ruler2.push("balance_pairs",SU),this.ruler2.push("strikethrough",Ow.postProcess),this.ruler2.push("emphasis",Lw.postProcess),this.ruler2.push("fragments_join",RU),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(Oc(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(Oc(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()&&i6(e)){const a=new bo("text","",0);a.content=e,o.push(a);return}const s=new s6(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();Oc(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 uq(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&&i6(i.content)){const r=new bo("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const dq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,fq=/[0-9a-z]/i;function hq(e){return/^<a[>\s]/i.test(e)}function pq(e){return/^<\/a\s*>/i.test(e)}function mq(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(!dq.test(o)||!fq.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 gq(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"&&(hq(l.content)&&i>0&&i--,pq(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>mq(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],g=e.md.normalizeLink(p.url);if(!e.md.validateLink(g))continue;let b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const v=p.index;if(v>f){const A=new bo("text","",0);A.content=a.slice(f,v),A.level=d,u.push(A)}const m=new bo("link_open","a",1);m.attrs=[["href",g]],m.level=d++,m.markup="linkify",m.info="auto",u.push(m);const y=new bo("text","",0);y.content=b,y.level=d,u.push(y);const k=new bo("link_close","a",-1);k.level=--d,k.markup="linkify",k.info="auto",u.push(k),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new bo("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const vq=/\r\n?|\n/g,yq=/\0/g;function kq(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(vq,`
|
|
96
|
-
`)),o&&(s=s.replace(yq,"�")),e.src=s}const r6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,bq=/\((?:c|tm|r)\)/i,xq=/\((c|tm|r)\)/gi,wq={c:"©",r:"®",tm:"™"};function _q(e,t){return wq[t.toLowerCase()]}function Sq(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(xq,_q)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Cq(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&r6.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 Aq(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(""):"");bq.test(o)&&Sq(n.children||[]),r6.test(o)&&Cq(n.children||[])}}var Mq=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 Eq=/['"]/,Dw=/['"]/g,Pw="’";function Pf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Tq(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;){Dw.lastIndex=c;const d=Dw.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let g=32;if(d.index-1>=0)g=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const v=ip(g)||sp(String.fromCharCode(g)),m=ip(b)||sp(String.fromCharCode(b)),y=Ad(g),k=Ad(b);if(k?f=!1:m&&(y||v||(f=!1)),y?h=!1:v&&(k||m||(h=!1)),b===34&&d[0]==='"'&&g>=48&&g<=57&&(h=f=!1),f&&h&&(f=v,h=m),!f&&!h){p&&(r.content=Pf(r.content,d.index,Pw));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===p&&o[n].level===l){A=o[n];let $,L;p?($=s[2]||"‘",L=s[3]||"’"):($=s[0]||"“",L=s[1]||"”"),r.content=Pf(r.content,d.index,L),e[A.token].content=Pf(e[A.token].content,A.pos,$),c+=L.length-1,A.token===i&&(c+=$.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Pf(r.content,d.index,Pw))}}}function Nq(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("");!Eq.test(o)||!n.children||Tq(n.children,e)}}function Iq(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 Lq=/^(?:vbscript|javascript|file|data):/,$q=/^data:image\/(?:gif|png|jpeg|webp);/,l6=["http:","https:","mailto:"];function a6(e){const t=e.trim().toLowerCase();return Lq.test(t)?$q.test(t):!0}function c6(e){const t=Dy(e,!0);if(t.hostname&&(!t.protocol||l6.includes(t.protocol)))try{t.hostname=jA.default.toASCII(t.hostname)}catch{}return LA(By(t))}function u6(e){const t=Dy(e,!0);if(t.hostname&&(!t.protocol||l6.includes(t.protocol)))try{t.hostname=jA.default.toUnicode(t.hostname)}catch{}return Jg(By(t),`${Jg.defaultChars}%`)}function Fq(e){switch(e){case 9:case 32:return!0}return!1}function Oq(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],g=[],b=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.parentType;e.parentType="blockquote";let y=!1,k;for(k=t;k<n;k++){const E=a[k]<e.blkIndent;if(u=i[k]+l[k],d=r[k],u>=d)break;if(s.charCodeAt(u++)===62&&!E){let F=a[k]+1,S,I;s.charCodeAt(u)===32?(u++,F++,I=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[k]+F)%4===3?(u++,F++,I=!1):I=!0):S=!1;let P=F;for(h.push(i[k]),i[k]=u;u<d;){const D=s.charCodeAt(u);if(Fq(D))D===9?P+=4-(P+c[k]+(I?1:0))%4:P++;else break;u++}y=u>=d,p.push(c[k]),c[k]=a[k]+1+(S?1:0),g.push(a[k]),a[k]=P-F,b.push(l[k]),l[k]=u-i[k];continue}if(y)break;let T=!1;for(let F=0,S=v.length;F<S;F++)if(v[F](e,k,n,!0)){T=!0;break}if(T){e.lineMax=k,e.blkIndent!==0&&(h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]-=e.blkIndent);break}h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]=-1}const A=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const L=[t,0];$.map=L,e.md.block.tokenize(e,t,k);const w=e.push("blockquote_close","blockquote",-1);w.markup=">",e.lineMax=f,e.parentType=m,L[1]=e.line;for(let E=0;E<b.length;E++)i[E+t]=h[E],l[E+t]=b[E],a[E+t]=g[E],c[E+t]=p[E];return e.blkIndent=A,!0}function Rq(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)}
|
|
97
|
-
`,i.map=[t,e.line],!0}function Bq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const Hw=["","h1","h2","h3","h4","h5","h6"],Ww=["","#","##","###","####","#####","######"];function zw(e){switch(e){case 9:case 32:return!0}return!1}function Dq(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&&!zw(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&zw(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",Hw[d],1);h.markup=Ww[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const g=e.push("heading_close",Hw[d],-1);return g.markup=Ww[d],!0}function Pq(e){switch(e){case 9:case 32:return!0}return!1}function Hq(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&&!Pq(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 ec=[[/^<(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(`${DU.source}\\s*$`),/^$/,!1]];function Wq(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<ec.length&&!ec[l][0].test(r);l++);if(l===ec.length)return!1;if(o)return ec[l][2];let a=t+1;if(!ec[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),ec[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 Uw(e){switch(e){case 9:case 32:return!0}return!1}const Xu={Pipe:1,ParagraphTerminator:2};function zq(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 d6=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|=Xu.Pipe|Xu.ParagraphTerminator),!a)if(Uw(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,zq(f)&&(c|=Xu.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 bo(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new bo(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const g=this.src,b=this.bsCount,v=this.tShift;for(;f<h&&p<n;){const m=g.charCodeAt(f);if(m===9||m===32)m===9?p+=4-(p+b[u])%4:p++;else if(f-d<v[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,g;for(d+1<t||o?g=l[d]+1:g=l[d];p<g&&f<n;){const b=i.charCodeAt(p);if(Uw(b))b===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,g):s[u]=i.slice(p,g)}return s.join("")}};d6.prototype.Token=bo;function Uq(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function f6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function h6(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Xu.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:Uq(n,o,s)}const qw=["","h1","h2"];function qq(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=f6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const k=i[p]+r[p],A=l[p];if(k>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(k),h===45||h===61)){let L=k+1,w=L;for(;L<A&&s.charCodeAt(L)===h;)L++;for(w=L;L<A;){const E=s.charCodeAt(L);if(E!==9&&E!==32)break;L++}if(L>=A){f=h===61?1:2;break}if(w-k>1)continue}if(a[p]<0||u&&!h6(e,p,s,k,A))continue;let $=!1;for(let L=0,w=o.length;L<w;L++)if(o[L](e,p,n,!0)){$=!0;break}if($)break}if(!f)return!1;let g;if(p===t+1){const k=i[t]+r[t];let A=l[t];for(;A>k;){const $=s.charCodeAt(A-1);if($!==9&&$!==32)break;A--}g=s.slice(k,A)}else g=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",v=e.push("heading_open",qw[f],1);v.markup=b,v.map=[t,e.line];const m=e.push("inline","",0);m.content=g,m.map=[t,e.line-1],m.children=[];const y=e.push("heading_close",qw[f],-1);return y.markup=b,e.parentType=d,!0}function p6(e){switch(e){case 9:case 32:return!0}return!1}function jw(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&&!p6(i.charCodeAt(l))?-1:l}function Vw(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),!p6(c))?-1:a}function jq(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 Vq=["0","1","2","3","4","5","6","7","8","9"];function Kq(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 Gq(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,g=e.tShift,b=e.eMarks,v=e.sCount,m=e.bsCount,y=p[l]+g[l];if(y>=b[l])return!1;const k=h.charCodeAt(y);if(k>=48&&k<=57){if(f=Vw(e,l),f<0||(u=!0,r=y,d=jq(e,l,f),c&&d!==1))return!1}else if(k===42||k===45||k===43){if(f=jw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),$=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const L=[l,0];e.tokens[e.tokens.length-1].map=L,e.tokens[e.tokens.length-1].markup=$;let w=!1;const E=e.tokens.length-1,T=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=b[l];const S=v[l]+f-(p[l]+g[l]);let I=S;for(;i<s;){const ne=h.charCodeAt(i);if(ne===9)I+=4-(I+m[l])%4;else if(ne===32)I++;else break;i++}const P=i;let D;P>=s?D=1:D=I-S,D>4&&(D=1);const W=S+D,z=e.push("list_item_open","li",1);z.markup=$;const R=[l,0];z.map=R,u&&(z.info=f-r-1===1?Vq[h.charCodeAt(r)-48]:h.slice(r,f-1));const q=e.tight,K=e.tShift[l],X=e.sCount[l],ue=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[l]=P-p[l],e.sCount[l]=I,P>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||w)&&(a=!1),w=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ue,e.tShift[l]=K,e.sCount[l]=X,e.tight=q,e.push("list_item_close","li",-1).markup=$,l=e.line,R[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let me=!1;for(let ne=0,ce=T.length;ne<ce;ne++)if(T[ne](e,l,n,!0)){me=!0;break}if(me)break;if(u){if(f=Vw(e,l),f<0)break;r=p[l]+g[l]}else if(f=jw(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=$:e.push("bullet_list_close","ul",-1).markup=$,L[1]=l,e.line=l,e.parentType=F,a&&Kq(e,E),!0}function Kw(e){return e===9||e===32}function Yq(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=f6(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 y=r[f]+l[f],k=a[f];if(y<k){const A=i.charCodeAt(y);if(A===42||A===45||A===43){if(y+1>=k||Kw(i.charCodeAt(y+1)))break}else if(A>=48&&A<=57&&y+1<k){let $=y+1;for(;;){if($>=k){$=-1;break}const L=i.charCodeAt($++);if(L>=48&&L<=57){if($-y>=10){$=-1;break}continue}if((L===41||L===46)&&($>=k||Kw(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const b=r[f]+l[f],v=a[f];if(d&&!h6(e,f,i,b,v))continue;let m=!1;for(let y=0,k=o.length;y<k;y++)if(o[y](e,f,n,!0)){m=!0;break}if(m)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const g=e.push("inline","",0);return g.content=h,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function Hf(e){switch(e){case 9:case 32:return!0}return!1}function Zq(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(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let A=!1;if(e.sCount[y]-e.blkIndent>3&&(A=!0),e.sCount[y]<0&&(A=!0),!A){const w=e.parentType;e.parentType="reference";let E=!1;for(let T=0,F=l.length;T<F;T++)if(l[T](e,y,k,!0)){E=!0;break}if(e.parentType=w,E)return null}const $=e.bMarks[y]+e.tShift[y],L=e.eMarks[y];return e.src.slice($,L+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const y=c.charCodeAt(s);if(y===91)return!1;if(y===93){u=s;break}else if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(y===92&&(s++,s<i&&c.charCodeAt(s)===10)){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Hf(y))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,g=s;for(;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Hf(y))break}let b=e.md.helpers.parseLinkTitle(c,s,i);for(;b.can_continue;){const y=a(r);if(y===null)break;c+=y,s=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,s,i,b)}let v;for(s<i&&g!==s&&b.ok?(v=b.str,s=b.pos):(v="",s=h,r=p);s<i&&Hf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&v)for(v="",s=h,r=p;s<i&&Hf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const m=bm(c.slice(1,u));return m?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[m]>"u"&&(e.env.references[m]={title:v,href:f}),e.line=r),!0):!1}function f0(e){switch(e){case 9:case 32:return!0}return!1}const Xq=65536;function h0(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function Qq(e,t){if(e.lineFlags)return(e.lineFlags[t]&Xu.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 Gw(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 Jq(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&&!f0(l)||r===45&&f0(l)||!Qq(e,t))return!1;for(;i<e.eMarks[s];){const k=e.src.charCodeAt(i);if(k!==124&&k!==45&&k!==58&&!f0(k))return!1;i++}let a=h0(e,t+1),c=a.split("|");const u=[];for(let k=0;k<c.length;k++){const A=c[k].trim();if(!A){if(k===0||k===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=h0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Gw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),g=[t,0];p.map=g;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let k=0;k<c.length;k++){const A=e.push("th_open","th",1);u[k]&&(A.attrs=[["style",`text-align:${u[k]}`]]);const $=e.push("inline","",0);$.content=c[k].trim(),$.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let m,y=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let k=!1;for(let $=0,L=h.length;$<L;$++)if(h[$](e,s,n,!0)){k=!0;break}if(k||(a=h0(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=Gw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),y+=d-c.length,y>Xq))break;if(s===t+2){const $=e.push("tbody_open","tbody",1);$.map=m=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let $=0;$<d;$++){const L=e.push("td_open","td",1);u[$]&&(L.attrs=[["style",`text-align:${u[$]}`]]);const w=e.push("inline","",0);w.content=c[$]?c[$].trim():"",w.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return m&&(e.push("tbody_close","tbody",-1),m[1]=s),e.push("table_close","table",-1),g[1]=s,e.parentType=f,e.line=s,!0}var ej=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 Oc(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 Wf=[["table",Jq,["paragraph","reference"]],["code",Rq],["fence",Bq,["paragraph","reference","blockquote","list"]],["blockquote",Oq,["paragraph","reference","blockquote","list"]],["hr",Hq,["paragraph","reference","blockquote","list"]],["list",Gq,["paragraph","reference","blockquote"]],["reference",Zq],["html_block",Wq,["paragraph","reference","blockquote"]],["heading",Dq,["paragraph","reference","blockquote"]],["lheading",qq],["paragraph",Yq]];var tj=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new ej;for(let e=0;e<Wf.length;e++)this.ruler.push(Wf[e][0],Wf[e][1],{alt:(Wf[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++)if(p=o[g](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[g].fn(e,u,n,!1);const v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Oc(e.env,"block",f[g].name,v-b,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new d6(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}},m6=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}};m6.prototype.Token=bo;const Yw=[["normalize",kq],["block",gU],["inline",uq],["linkify",gq],["replacements",Aq],["smartquotes",Nq],["text_join",Iq]],nj={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},oj={parseLinkLabel:Vy,parseLinkDestination:jy,parseLinkTitle:Ky};function sj(){return{...nj}}function ij(){return{...oj}}var rj=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new tj,this.inline=new cq,this.ruler=new Mq;for(let e=0;e<Yw.length;e++){const[t,n]=Yw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:sj(),helpers:ij(),normalizeLink:c6,normalizeLinkText:u6,validateLink:a6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new qA),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new m6(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();Oc(e.env,"core",t[n].name,s-o,!0,!1)}lq(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&mU(e))return this.parse(GA(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const lj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function cp(e){return!lj.test(e)}function Hu(e,t){const n=e.indexOf(`
|
|
98
|
-
`,t);return n===-1?e.length:n}function gh(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 Zw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function p0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function aj(e){if(e.length>3)return cp(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 cj=["","h1","h2","h3","h4","h5","h6"],uj=["","#","##","###","####","#####","######"],Xw=0,m0=1,g0=2;function Vs(e,t,n,o){const s=new bo(e,t,n);return s.level=o,s.block=!0,s}function g6(e,t,n){const o=Vs("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new bo("text","",0);return s.content=e,o.children=[s],o}function dj(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(!cp(u))return!1;const d=cj[i],f=uj[i],h=Vs("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(g6(u,s,1));const p=Vs("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function fj(e,t,n){const o=Vs("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(g6(t,n,1)),e.push(Vs("paragraph_close","p",-1,0))}function hj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function v0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function pj(e,t){const n=Vs("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function mj(e,t,n){const o=Vs("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Vs("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Vs("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new bo("text","",0);r.content=t,i.children=[r],e.push(i);const l=Vs("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Vs("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function gj(e){const t=Vs("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function vj(e,t,n,o){if(!Zw(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=Hu(e,l);if(Zw(e,l,c)&&gh(e,l+3,c)){const u=Vs("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 yj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?Xw:g0,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Hu(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(!gh(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!dj(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=v0(e,h),l+=1+r-h;continue}if(c===45){if(!p0(e,r,a))return null;const h=l;let p=r,g=l,b=null,v=null;for(;p<e.length;){const k=Hu(e,p);if(!p0(e,p,k))break;const A=p+2,$=k===A+1?e[A]:e.slice(A,k);if(!aj($))return null;b===null&&(b=pj(t,h)),v=mj(t,$,g),p=k<e.length?k+1:k,g++}if(b===null||v===null)return null;let m=p,y=g;for(;m<e.length;){if(e.charCodeAt(m)===10){m++,y++;continue}const k=Hu(e,m);if(!gh(e,m,k)){if(p0(e,m,k))return null;break}m=k<e.length?k+1:k,y++}b.map[1]=y,v.map[1]=y,gj(t),r=m,l=y;continue}if(c===96){const h=vj(e,r,a,l);if(!h)return null;t.push(h.token),r=v0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=hj(e,r,a);let d;if(n===g0?d=cp(u):n===m0&&u===o?d=s:(d=cp(u),n===Xw?(i&&(n=u===o?m0:g0),o=u,s=d,i=!0):n===m0&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!gh(e,f,Hu(e,f)))return null;fj(t,u,l),r=v0(e,f),l+=1+r-f}return t}const kj=/[&<>"]/,Qw=/[&<>"]/g,bj=/&/g,xj=/[<>"]/g,wj={"&":"&","<":"<",">":">",'"':"""};function y0(e){return wj[e]||e}function In(e){if(e.length===0)return"";if(e.length<32)return kj.test(e)?e.replace(Qw,y0):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(bj,"&"):t?e.replace(Qw,y0):e.replace(xj,y0)}const _j=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Sj=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function v6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(_j,(t,n,o)=>{if(n)return n;if(Sj.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return xm(i)?Md(i):"�"}const s=Ry(t);return s!==t?s:t})}const Cj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Aj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Mj=/"/g;function bc(e,t){const n=e.indexOf(`
|
|
99
|
-
`,t);return n===-1?e.length:n}function up(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 zf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Ej(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!up(e,t,bc(e,t))}function Jw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Tj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Xy(e){return Aj.test(e)?Cj.test(e)?null:e.replace(Mj,"""):e}function Nj(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=Xy(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
100
|
-
`}function e_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Ij(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
101
|
-
`;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>
|
|
102
|
-
`}function Lj(e,t,n){const o=t+2;if(n===o+1)return Ij(e,o);const s=Xy(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
103
|
-
`}function $j(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 Fj(e,t,n,o){if(!Jw(e,t,n))return null;const s=$j(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=bc(e,l);if(Jw(e,l,a)&&up(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-${In(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${In(c)}</code></pre>
|
|
104
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function t_(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=bc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!up(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const g=Nj(e,t,u);if(g===null)return null;o?s.push(g):n+=g,t=zf(e,u<e.length?u+1:u);continue}if(d===45){let g=t;for(;g<e.length;){const y=bc(e,g);if(!e_(e,g,y))break;g=y<e.length?y+1:y}if(g===t)return null;const b=e.slice(t,g);let v;if(b===r)v=l;else{let y=t;for(v=`<ul>
|
|
105
|
-
`;y<g;){const k=bc(e,y),A=Lj(e,y,k);if(A===null)return null;v+=A,y=k<e.length?k+1:k}v+=`</ul>
|
|
106
|
-
`,r=b,l=v}let m=zf(e,g);for(;m<e.length;){if(e.charCodeAt(m)===10){m++;continue}const y=bc(e,m);if(!up(e,m,y)){if(e_(e,m,y))return null;break}m=y<e.length?y+1:y}o?s.push(v):n+=v,t=m;continue}if(d===96){const g=Fj(e,t,u,i);if(!g)return null;o?s.push(g.html):n+=g.html,t=zf(e,g.nextPos);continue}const f=Tj(e,t,u);let h;if(f===a)h=c;else{const g=Xy(f);if(g===null)return null;h=`<p>${g}</p>
|
|
107
|
-
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&Ej(e,p))return null;o?s.push(h):n+=h,t=zf(e,p)}return o?s.join(""):n}const Oj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function dp(e,t,n={},o){us(n);const s={...Oj,...o||{}},i=Es(t);if(s.fallbackOnGlobalState!==!1&&i)return d0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Fc(n,i,()=>e.core.parse(t,n,e).tokens);let r=vh(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=Pj(r,s.maxChunks)),yh(t,r))return d0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Fc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return d0(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),Fc(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&&Bj(f,l),Dj(a,f),l+=u.lineCount}return a})}function vh(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
108
|
-
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const g=Hj(e,f,h);if(t.fenceAware){let m=f;for(;m<h;){const k=e.charCodeAt(m);if(k===32||k===9)m++;else break}const y=e[m];if(y==="`"||y==="~"){let k=m;for(;k<h&&e[k]===y;)k++;const A=k-m;A>=3&&(u?u.marker===y&&A>=u.length&&(u=null):u={marker:y,length:A})}}const b=p-f;s+=b,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=b);const v=g;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(v)d(p);else{const m=Math.max(10,Math.floor(t.maxChunkLines*.5)),y=Math.max(t.maxChunkChars,8e3);(a>=m||c>=y)&&d(p)}f=p}return n&&d(e.length),o}function yh(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!Rj(e,t[s].end))return!0;return!1}function Rj(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 Bj(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 Dj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Pj(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 Hj(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 y6=4e6,k6=8e4,Wj=1e4,zj=200,Uj=1e4,qj=200;function b6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function jj(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 nl(e){return e.length===0?0:so(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Vj(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 Kj(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
|
|
109
|
-
`,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 Gj(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 Vj(e,n+1,e.length-1)?!Kj(e,t):!1}function Yj(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??Uj:e.options.fullChunkSizeChars??Wj),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??qj:e.options.fullChunkSizeLines??zj);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 jd=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=nl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=vh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(yh(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,nl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Gj(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,nl(this.pending)),null;const n=vh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,nl(this.pending)),null;const o=yh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:nl(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=vh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=yh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:nl(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:nl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+nl(this.pending);return Yj(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(qd(e)&&Hr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Es(t);n&&(Uy(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&&jj(r,a),this.options.retainTokens!==!1&&b6(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&&qy(t),n}catch(o){throw this.markedGlobalStateReason&&(Hr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){WA(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function Zj(e,t,n={},o={}){us(n);const s=new jd(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function Xj(e,t,n={},o={}){us(n);const s=new jd(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function Qj(e,t,n,o={},s={}){us(o);const i=new jd(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 Jj(e,t,n,o={},s={}){us(o);const i=new jd(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 x6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??y6,s=e.options.autoUnboundedThresholdLines??k6;return t>=o||n>=s}function w6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??y6))return"yes";const o=e.options.autoUnboundedThresholdLines??k6;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Qu(e,t,n={},o={}){us(n);const s=Es(t);if(qd(n)&&Hr(n),o.fallbackOnGlobalState!==!1&&s)return WA(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:so(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),Fc(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new jd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){b6(i,l)}});if(s&&Uy(n,s),r.feed(t),r.flushForce(n),s&&(qy(n),o.fallbackOnGlobalState===!1)){const l=xr(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Rc=(e,t,n)=>e<t?t:e>n?n:e;function _6(e){return e.experimental?{...e,...e.experimental}:e}const n_=[{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"}],o_=[{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 S6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function eV(e,t=Math.max(0,e/40|0),n={}){const o=_6(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<n_.length;l++){const a=n_[l];if(e<=a.max){if(a.strategy!=="adaptive")return S6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Rc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Rc(Math.ceil(t/i),150,700),maxChunks:Rc(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 s_(e,t=Math.max(0,e/40|0),n={}){const o=_6(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<o_.length;l++){const a=o_[l];if(e<=a.max){if(a.strategy!=="adaptive")return S6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Rc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Rc(Math.ceil(t/i),150,700),maxChunks:Rc(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 tV={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"]}}},nV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},oV={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 Cm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function kh(e,t){if(Cm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const i_=e=>Cm(e)?e:Promise.resolve(e);function Ju(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 In(e)}}function Il(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Ju(t[0])}="${In(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Ju(s[0])}="${In(s[1])}"`}return n}function C6(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 ed(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
|
|
110
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${In(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
|
|
111
|
-
`;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${Il(r)}>${t}</code></pre>
|
|
112
|
-
`}return`<pre><code${Il(e.attrs)}>${t}</code></pre>
|
|
113
|
-
`}function fp(e){return!e.attrs||e.attrs.length===0?`<code>${In(e.content)}</code>`:`<code${Il(e.attrs)}>${In(e.content)}</code>`}function iv(e){const t=In(e.content);return e.attrs?`<pre${Il(e.attrs)}><code>${t}</code></pre>
|
|
114
|
-
`:`<pre><code>${t}</code></pre>
|
|
115
|
-
`}function sV(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="${In(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${In(n[0][1])}">`}return null}function r_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Ju(t[0][0])}="${In(t[0][1])}">`:t.length===2?`<a ${Ju(t[0][0])}="${In(t[0][1])}" ${Ju(t[1][0])}="${In(t[1][1])}">`:`<a${Il(t)}>`}function iV(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 l_(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 hp(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+Il(n);return o===0&&t&&(i+=" /"),`${i}>`}const rV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Uf=Object.prototype.hasOwnProperty,Tn={code_inline(e,t){return fp(e[t])},code_block(e,t){return iv(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?v6(i.info).trim():"",{langName:l,langAttrs:a}=C6(r),c=n.highlight,u=In(i.content);if(!c)return ed(i,u,r,l,n);const d=c(i.content,l,a);return Cm(d)?d.then(f=>ed(i,f||u,r,l,n)):ed(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]],hp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
116
|
-
`:`<br>
|
|
117
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
118
|
-
`:`<br>
|
|
119
|
-
`:`
|
|
120
|
-
`},text(e,t){return In(e[t].content)},text_special(e,t){return In(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function a_(e,t,n){const o=e.info?v6(e.info).trim():"",{langName:s,langAttrs:i}=C6(o),r=t.highlight,l=In(e.content);if(!r)return ed(e,l,o,s,t);const a=r(e.content,s,i);if(Cm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return ed(e,a||l,o,s,t)}function qf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Tn.text)return l.content.length===0?"":In(l.content);break;case"text_special":if(s.text_special===Tn.text_special)return l.content.length===0?"":In(l.content);break;case"softbreak":if(s.softbreak===Tn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Tn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Tn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Tn.code_inline)return fp(l);break}const a=s[l.type];if(!a)return hp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:kh(c,l.type)}var lV=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Tn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",g=!1,b="";for(let v=0;v<e.length;v++){const m=e[v],y=m.type,k=v>0&&e[v-1].hidden?`
|
|
121
|
-
`:"";if(y==="list_item_open"&&(!m.attrs||m.attrs.length===0)&&v+3<e.length){const L=e[v+1],w=e[v+2],E=e[v+3];if(L.type==="paragraph_open"&&L.hidden&&w.type==="inline"&&E.type==="paragraph_close"&&E.hidden){b+=`${k}<li>${this.renderInlineTokens(w.children||[],o,s)}`,v+=3;continue}}if(v+2<e.length){const L=e[v+1],w=e[v+2];if(L.type==="inline"&&w.nesting===-1&&w.tag===m.tag&&!w.hidden){const E=sV(m,k);if(E!==null){b+=`${E+this.renderInlineTokens(L.children||[],o,s)}</${m.tag}>
|
|
122
|
-
`,v+=2;continue}}}if(y==="inline"){const L=m.children||[];if(L.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
|
|
123
|
-
`:`<br>
|
|
124
|
-
`,p=o.breaks?h:`
|
|
125
|
-
`,g=!0);const w=L[0];switch(w.type){case"text":if(l===Tn.text){b+=In(w.content);continue}break;case"text_special":if(a===Tn.text_special){b+=In(w.content);continue}break;case"softbreak":if(c===Tn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Tn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Tn.html_inline){b+=w.content;continue}break;case"code_inline":if(f===Tn.code_inline){b+=fp(w);continue}break}}b+=this.renderInlineTokens(L,o,s);continue}const A=i[y];if(!A){const L=m.attrs;if(!m.hidden){if(!L||L.length===0)switch(y){case"hr":b+=r?`<hr />
|
|
126
|
-
`:`<hr>
|
|
127
|
-
`;continue;case"heading_open":b+=`<${m.tag}>`;continue;case"heading_close":b+=`</${m.tag}>
|
|
128
|
-
`;continue;case"paragraph_open":b+=`${k}<p>`;continue;case"paragraph_close":b+=`</p>
|
|
129
|
-
`;continue;case"list_item_open":{const w=e[v+1];b+=k+(w&&(w.type==="inline"||w.hidden||w.nesting===-1&&w.tag==="li")?"<li>":`<li>
|
|
130
|
-
`);continue}case"list_item_close":b+=`</li>
|
|
131
|
-
`;continue;case"bullet_list_open":b+=`${k}<ul>
|
|
132
|
-
`;continue;case"bullet_list_close":b+=`</ul>
|
|
133
|
-
`;continue;case"blockquote_open":b+=k+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
134
|
-
`);continue;case"blockquote_close":b+=`</blockquote>
|
|
135
|
-
`;continue;case"ordered_list_open":b+=`${k}<ol>
|
|
136
|
-
`;continue;case"ordered_list_close":b+=`</ol>
|
|
137
|
-
`;continue;case"table_open":b+=`${k}<table>
|
|
138
|
-
`;continue;case"table_close":b+=`</table>
|
|
139
|
-
`;continue;case"thead_open":b+=`${k}<thead>
|
|
140
|
-
`;continue;case"thead_close":b+=`</thead>
|
|
141
|
-
`;continue;case"tbody_open":b+=`${k}<tbody>
|
|
142
|
-
`;continue;case"tbody_close":b+=`</tbody>
|
|
143
|
-
`;continue;case"tr_open":b+=`${k}<tr>
|
|
144
|
-
`;continue;case"tr_close":b+=`</tr>
|
|
145
|
-
`;continue;case"td_open":b+=`${k}<td>`;continue;case"td_close":b+=`</td>
|
|
146
|
-
`;continue;case"th_open":b+=`${k}<th>`;continue;case"th_close":b+=`</th>
|
|
147
|
-
`;continue}else if(L.length===1){const w=L[0];if(y==="ordered_list_open"&&w[0]==="start"){b+=`${k}<ol start="${In(w[1])}">
|
|
148
|
-
`;continue}if(y==="td_open"&&w[0]==="style"){b+=`${k}<td style="${In(w[1])}">`;continue}if(y==="th_open"&&w[0]==="style"){b+=`${k}<th style="${In(w[1])}">`;continue}}}b+=this.renderToken(e,v,o);continue}if(y==="code_block"&&A===Tn.code_block){b+=iv(m);continue}if(y==="fence"&&A===Tn.fence){b+=a_(m,o);continue}if(y==="html_block"&&A===Tn.html_block){b+=m.content;continue}const $=A(e,v,o,s,this);typeof $=="string"?b+=$:b+=kh($,m.type)}return b}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await i_(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 Il(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?`
|
|
149
|
-
`:"",u=a?`>
|
|
150
|
-
`:">";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+Il(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(Uf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Uf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Uf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Uf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...rV,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Tn.code_block)return iv(t);if(i==="html_block"&&s.html_block===Tn.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):hp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Tn.fence)return a_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:kh(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,g=o.strong_close,b=t.xhtmlOut===!0,v=b?`<br />
|
|
151
|
-
`:`<br>
|
|
152
|
-
`,m=t.breaks?v:`
|
|
153
|
-
`;if(e.length===1)return qf(e,t,n,this,o,v,m);let y="";for(let k=0;k<e.length;k++){const A=e[k];if(A.type==="link_open"&&!u&&!d&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="link_close"&&iV(w)){const E=`${r_(A)+qf([w],t,n,this,o,v,m)}</a>`;if(r===Tn.softbreak&&k+3<e.length&&e[k+3].type==="softbreak"){y+=E+m,k+=3;continue}y+=E,k+=2;continue}}if(A.type==="link_open"&&!u&&!d&&k+1<e.length&&e[k+1].type==="link_close"){y+=`${r_(A)}</a>`,k+=1;continue}if(A.type==="em_open"&&!f&&!h&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="em_close"&&l_(w)){y+=`<em>${qf([w],t,n,this,o,v,m)}</em>`,k+=2;continue}}if(A.type==="strong_open"&&!p&&!g&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="strong_close"&&l_(w)){y+=`<strong>${qf([w],t,n,this,o,v,m)}</strong>`,k+=2;continue}}switch(A.type){case"text":if(s===Tn.text){const w=A.content.length===0?"":In(A.content);if(a===Tn.html_inline&&k+1<e.length&&e[k+1].type==="html_inline"){for(y+=w+e[++k].content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}y+=w;continue}break;case"text_special":if(i===Tn.text_special){A.content.length!==0&&(y+=In(A.content));continue}break;case"softbreak":if(r===Tn.softbreak){y+=m;continue}break;case"hardbreak":if(l===Tn.hardbreak){y+=v;continue}break;case"html_inline":if(a===Tn.html_inline){for(y+=A.content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}break;case"code_inline":if(c===Tn.code_inline){y+=fp(A);continue}break}const $=o[A.type];if(!$){y+=A.block?this.renderToken(e,k,t):hp(A,b);continue}const L=$(e,k,t,n,this);typeof L=="string"?y+=L:y+=kh(L,A.type)}return y}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 i_(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+=`
|
|
154
|
-
`;break}}return o}},aV=lV;const cV=[],k0=4096;function uV(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
|
|
155
|
-
`,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 dV(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 fV(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(!A6(e[n],t[n]))return!1;return!0}function A6(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||!dV(e.attrs,t.attrs)||!fV(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function c_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var hV=class{core;cache=null;stats=c_();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=c_(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(us(o??s?.env),!s||o&&o!==s.env){const I=o??{},P=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,W=!!n.options?.streamChunkedFallback,z=!P&&D,R=W||z,q=n.options?.streamChunkAdaptive!==!1,K=n.options?.streamChunkTargetChunks??8,X=n.options?.streamChunkSizeChars,ue=n.options?.streamChunkSizeLines,me=n.options?.streamChunkMaxChunks,ne=!!n.__explicitStreamChunkConfig,ce=n.options?.autoTuneChunks!==!1,de=n.options?.streamChunkFenceAware??!0,Ae=n.options?.streamLargeCachePolicy??"retain",Le=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,le=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let U,ae=!1;if(Ae==="skip"&&(ae=e.length>=Le,!ae&&le!==void 0&&(U=so(e),ae=U>=le)),ae){const j=this.parseFullDocument(e,I,n,U,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",vo(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!xr(I)?.unbounded}),j.tokens}else if(R){const j=(pe,Ce,$e)=>pe<Ce?Ce:pe>$e?$e:pe;U===void 0&&(U=so(e));const J=ce&&!ne?s_(e.length,U,n.options):null,ye=J?.maxChunkChars??(q?j(Math.ceil(e.length/K),8e3,64e3):X??1e4),fe=J?.maxChunkLines??(q?j(Math.ceil(U/K),150,700):ue??200),ve=J?.maxChunks??(q?j(Math.ceil(e.length/64e3),K,32):me),V=e.length>0&&e.charCodeAt(e.length-1)===10,ee=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&J?.strategy!=="plain";if((W||ee)&&(e.length>=ye*2||U>=fe*2)&&V){const pe=dp(n,e,I,{maxChunkChars:ye,maxChunkLines:fe,fenceAware:J?.fenceAware??de,maxChunks:ve});return this.cache={src:e,tokens:pe,env:I,lineCount:U,lastSegment:void 0,globalStateReason:Es(e)},this.updateCacheLineCount(this.cache,U),this.recordChunkedParseResult(I,W?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const se=this.parseFullDocument(e,I,n,U);return U=se.lineCount,this.cache={src:e,tokens:se.tokens,env:I,lineCount:U,lastSegment:void 0,globalStateReason:Es(e)},this.updateCacheLineCount(this.cache,U),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",vo(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!xr(I)?.unbounded}),se.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",vo(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=Es(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Es(e),a=r||l;if(a){const I=o??s.env;Hr(I);const P=Es(e),D=this.parseFullDocument(e,I,n),W=D.tokens,z=D.lineCount;return this.cache={src:e,tokens:W,env:I,lineCount:z,lastSegment:void 0,globalStateReason:P},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",vo(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!xr(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,P=this.parseFullDocument(e,I,n),D=P.tokens,W=P.lineCount;return this.cache={src:e,tokens:D,env:I,lineCount:W,lastSegment:void 0,globalStateReason:Es(e)},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",vo(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!xr(I)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const I=s.lineCount??so(s.src);let P=3;u.length>5e3?P=8:u.length>1e3?P=6:u.length>200&&(P=4),P=Math.min(P,I);let D=null;const W=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,R=n.options?.streamContextParseMinLines??2;let q;const K=()=>(q===void 0&&(q=so(u)),q),X=this.canDirectlyParseAppend(s),ue=X&&this.shouldUseUnboundedAppend(e,s,u);let me=!1;if(!X)switch(W){case"lines":me=K()>=R;break;case"constructs":if(u.length>=z){me=!0;break}if(uV(u)){me=!0;break}me=K()>=R;break;case"chars":default:me=u.length>=z}if(P>0&&me){const de=this.getTailLines(s.src,P)+u;try{const Ae=this.core.parse(de,s.env,n).tokens,Le=Ae.findIndex(le=>le.map&&typeof le.map[1]=="number"&&le.map[1]>P);if(Le!==-1){const le=Ae.slice(Le),U=I-P;U!==0&&this.shiftTokenLines(le,U),D={tokens:le}}}catch{D=null}}else D=null;if(!D){const de=I;if(ue)D={tokens:Qu(n,u,s.env,{mode:"stream"})},de>0&&this.shiftTokenLines(D.tokens,de);else{const Ae=this.core.parse(u,s.env,n);de>0&&this.shiftTokenLines(Ae.tokens,de),D=Ae}}let ne=0;if(s.tokens.length>0&&D.tokens.length>0){const de=s.tokens[s.tokens.length-1],Ae=D.tokens[0];try{de.type==="inline"&&Ae.type==="inline"&&(Ae.children&&Ae.children.length>0&&(de.children||(de.children=[]),this.appendTokens(de.children,Ae.children)),de.content=(de.content||"")+(Ae.content||""),ne=1)}catch{ne=0}}const ce=s.tokens.length;if(D.tokens.length>ne){const de=s.tokens,Ae=D.tokens,Le=Math.min(de.length,Ae.length-ne);let le=0;for(let U=Le;U>0;U--){let ae=!0;for(let se=0;se<U;se++){const j=de[de.length-U+se],J=Ae[ne+se];if(!A6(j,J)){ae=!1;break}}if(ae){le=U;break}}le>0&&(ne+=le),Ae.length>ne&&this.appendTokens(s.tokens,Ae,ne)}if(s.src=e,s.globalStateReason=null,s.lineCount=I+(q??K()),s.tokens.length>ce){const de=this.getLastSegment(s.tokens,e,ce,s.tokens.length,e.length-u.length,I);de?s.lastSegment=de:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ue&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",vo(s.env,{area:"stream",path:ue?"stream-unbounded-append":"stream-append",reason:ue?"large-delta":"safe-append",unbounded:ue}),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",vo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,v=g||b,m=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,$=n.options?.streamChunkMaxChunks,L=!!n.__explicitStreamChunkConfig,w=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let T=u&&s.lineCount!==void 0?s.lineCount+so(u):void 0;if(v){T===void 0&&(T=so(e));const I=(K,X,ue)=>K<X?X:K>ue?ue:K,P=w&&!L?s_(e.length,T,n.options):null,D=P?.maxChunkChars??(m?I(Math.ceil(e.length/y),8e3,64e3):k??1e4),W=P?.maxChunkLines??(m?I(Math.ceil(T/y),150,700):A??200),z=P?.maxChunks??(m?I(Math.ceil(e.length/64e3),y,32):$),R=e.length>0&&e.charCodeAt(e.length-1)===10,q=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&P?.strategy!=="plain";if((g||q)&&(e.length>=D*2||T>=W*2)&&R){const K=dp(n,e,d,{maxChunkChars:D,maxChunkLines:W,fenceAware:P?.fenceAware??E,maxChunks:z});return this.cache={src:e,tokens:K,env:d,lineCount:T,lastSegment:void 0,globalStateReason:Es(e)},this.updateCacheLineCount(this.cache,T),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const F=this.parseFullDocument(e,d,n,T),S=F.tokens;return T=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:T,lastSegment:void 0,globalStateReason:Es(e)},this.updateCacheLineCount(this.cache,T),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",vo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!xr(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=xr(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",vo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!xr(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",vo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Es(e);qd(t)&&Hr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?w6(n,e.length,o):"no";if(r==="yes"){const a=Qu(n,e,t);return vo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?so(e):0)}}let l=o;if(r==="need-lines"&&(l=so(e),x6(n,e.length,l))){const a=Qu(n,e,t);return vo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?so(e):0),{tokens:Fc(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:so(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
156
|
-
`))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(`
|
|
157
|
-
`);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+so(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(`
|
|
158
|
-
`,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??cV}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??so(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(-k0))+t,o=Es(n);return e.globalStateCarry=n.length>k0?n.slice(n.length-k0):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(`
|
|
159
|
-
`,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(`
|
|
160
|
-
`,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??so(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+so(i);t.lineCount=g;const b=this.getDocLineCount(e,g);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const g=s.lineEnd-2;g!==0&&this.shiftTokenLines(p,g);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,v=t.lineCount??so(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const m=v+so(i);t.lineCount=m;const y=this.getDocLineCount(e,m);if(r.map&&(r.map[1]=y),h.tbodyOpenIndex>=0){const k=t.tokens[h.tbodyOpenIndex];k?.map&&(k.map[1]=y)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
161
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
162
|
-
`,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=so(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 u_={default:nV,zero:oV,commonmark:tV};function pV(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function mV(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 d_(e){return e.experimental?{...e,...e.experimental}:e}function ui(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 f_(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(ui(t,s)||ui(e,s))return!0}return!1}function h_(e,t,n){return ui(t,n)||ui(e,n)}function p_(e,t){const n=xr(e)?.chunk;if(n?.fallback){vo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}vo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function gV(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=u_[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=d_(n),typeof n.quotes=="string"){const w=n.quotes;w.length>=4?n.quotes=[w[0],w[1],w[2],w[3]]:n.quotes=["“","”","‘","’"]}let r=f_(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=f_(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=h_(i?.options,s,"fullChunkedFallback"),c=h_(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new rj;let p=null;const g=()=>(p||(p=new aV(n)),p);let b=null;const v=()=>(b||(b=new hV(h)),b);let m=null;const y=()=>(m||(m=new qA),m),k=w=>!u&&!!d&&!mV(w,d),A=(w,E)=>o==="default"&&!u&&p===null&&f!==null&&w.parse===f&&k(w)&&!w.stream.enabled&&E<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.xhtmlOut===!1&&w.options.breaks===!1&&w.options.langPrefix==="language-"&&w.options.linkify===!1&&w.options.typographer===!1&&w.options.highlight===null,$=(w,E)=>o==="default"&&!u&&k(w)&&!w.stream.enabled&&!w.options.fullChunkedFallback&&E<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.linkify===!1&&w.options.typographer===!1,L={core:h,block:h.block,inline:h.inline,get linkify(){const w=y();return Object.defineProperty(this,"linkify",{value:w,writable:!0,configurable:!0}),w},get renderer(){const w=g();return Object.defineProperty(this,"renderer",{value:w,writable:!0,configurable:!0}),w},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(w){const E=d_(w);return this.options={...this.options,...E},(ui(w,"fullChunkSizeChars")||ui(w,"fullChunkSizeLines")||ui(w,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ui(w,"streamChunkSizeChars")||ui(w,"streamChunkSizeLines")||ui(w,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ui(w,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ui(w,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,b&&(b.reset(),b.resetStats())),this},configure(w){const E=typeof w=="string"?u_[w]:w;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const T=E.components;T.core?.rules&&this.core.ruler.enableOnly(T.core.rules),T.block?.rules&&this.block.ruler.enableOnly(T.block.rules),T.inline?.rules&&this.inline.ruler.enableOnly(T.inline.rules),T.inline2?.rules&&this.inline.ruler2.enableOnly(T.inline2.rules)}return this},enable(w,E){const T=Array.isArray(w)?w:[w],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const P=I.enable(T,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!E){const I=T.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(w,E){const T=Array.isArray(w)?w:[w],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const P=I.disable(T,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!E){const I=T.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(w,...E){const T=typeof w=="function"?w:w&&typeof w.default=="function"?w.default:void 0;if(!T)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...E],S=w;return u=!0,T.apply(S,F),this},render(w,E){if(A(this,w.length)){E!==void 0&&us(E);const S=t_(w);if(S!==null)return E!==void 0&&vo(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const T=E??{},F=this.parse(w,T);return g().render(F,this.options,T)},async renderAsync(w,E){if(A(this,w.length)){E!==void 0&&us(E);const S=t_(w);if(S!==null)return E!==void 0&&vo(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const T=E??{},F=this.parse(w,T);return g().renderAsync(F,this.options,T)},renderIterable(w,E={}){const T=this.parseIterable(w,E);return g().render(T,this.options,E)},async renderAsyncIterable(w,E={}){const T=await this.parseAsyncIterable(w,E);return g().renderAsync(T,this.options,E)},renderInline(w,E={}){const T=this.parseInline(w,E);return g().render(T,this.options,E)},validateLink:a6,normalizeLink:c6,normalizeLinkText:u6,utils:Az,helpers:{...pU},parse(w,E){if(typeof w!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&us(E),$(this,w.length)){const I=yj(w);if(I!==null)return E!==void 0&&vo(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const T=E??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const I=w6(this,w.length);if(I==="yes"){const P=Qu(this,w,T);return vo(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),P}I==="need-lines"&&(F=so(w))}if(!this.stream.enabled){const I=w.length,P=this.options.autoTuneChunks!==!1,D=r,W=!a&&k(this),z=!!this.options.fullChunkedFallback,R=W&&I>=2e5;let q;(z||R||F!==void 0)&&(q=F??so(w));const K=(z||R)&&P&&!D?eV(I,q,this.options):null;if(z||R){const X=q??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||X>=(this.options.fullChunkThresholdLines??400):R){if(K&&K.strategy!=="plain"){const ue=dp(this,w,T,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return E&&p_(E,z?"explicit-full-chunk":"default-large-string"),ue}if(z){const ue=(ae,se,j)=>ae<se?se:ae>j?j:ae,me=this.options.fullChunkAdaptive!==!1,ne=this.options.fullChunkTargetChunks??8,ce=ue(Math.ceil(I/ne),8e3,64e3),de=ue(Math.ceil(X/ne),150,700),Ae=me?ce:this.options.fullChunkSizeChars??1e4,Le=me?de:this.options.fullChunkSizeLines??200,le=me?ue(Math.ceil(I/64e3),ne,32):this.options.fullChunkMaxChunks,U=dp(this,w,T,{maxChunkChars:Ae,maxChunkLines:Le,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:le});return E&&p_(E,"explicit-full-chunk"),U}}}if(F!==void 0&&k(this)&&x6(this,I,q??F)){const X=Qu(this,w,T);return vo(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),X}}const S=Es(w);return vo(E,{area:"parse",path:"plain",reason:"default-plain"}),Fc(T,S,()=>h.parse(w,T,this).tokens)},parseIterable(w,E={}){return us(E),Zj(this,w,E)},parseAsyncIterable(w,E={}){return us(E),Xj(this,w,E)},parseIterableToSink(w,E,T={}){return us(T),Qj(this,w,E,T)},parseAsyncIterableToSink(w,E,T={}){return us(T),Jj(this,w,E,T)},parseInline(w,E={}){if(typeof w!="string")throw new TypeError("Input data should be a String");us(E),qd(E)&&Hr(E);const T=h.createState(w,E,this);return T.inlineMode=!0,h.process(T),T.tokens}};if(L.stream={enabled:!!n.stream,parse(w,E){return L.stream.enabled?v().parse(w,E,L):L.parse(w,E??{})},reset(){v().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const w=i.components;w.core?.rules&&L.core.ruler.enableOnly(w.core.rules),w.block?.rules&&L.block.ruler.enableOnly(w.block.rules),w.inline?.rules&&L.inline.ruler.enableOnly(w.inline.rules),w.inline2?.rules&&L.inline.ruler2.enableOnly(w.inline2.rules)}return d=pV(L),f=L.parse,L}var vV=gV;const M6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],yV=["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"],E6=["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"],kV=["svg","g","path"],bV=["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"],xV=["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"],wV=["action","data","href","src","srcset","poster","xlink:href","formaction"],_V=["script"],SV=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Oa=new Set(M6),CV=new Set(E6),Td=new Set([...M6,...yV,...E6,...kV]),T6=new Set([...Td,...bV]),AV=new Set(xV),MV=new Set(wV),Vd=new Set(_V),N6=new Set(SV);function I6(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 EV={amp:"&",bsol:"\\",colon:":",newline:`
|
|
163
|
-
`,sol:"/",tab:" "};function L6(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 EV[String(s??"").toLowerCase()]??t})}const jf=new Set(["http","https","mailto","tel"]),TV=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),ta=new Set(["http","https"]);function $6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function NV(e,t,n){if(!td(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function td(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function IV(e,t){return t==="href"||t==="xlink:href"?td(e,t)?jf:ta:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?ta:(td(e,t),jf)}function xa(e,t={}){const n=I6(L6(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=$6(n);return i?i==="file"?!NV(n,o,s):td(o,s)?TV.has(i):!IV(o,s).has(i):!1}function LV(e){const t=L6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=$6(I6(t).toLowerCase());return n==="http"||n==="https"}function $V(e,t={}){const n=String(e??"").trim();return n?xa(n,t)?"":n:""}function m_(e){return $V(e,{tagName:"img",attrName:"src"})}function FV(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,g,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,g,b)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,g){let b,v=!1,m=f.bMarks[h]+f.tShift[h],y=f.eMarks[h];if(l!==f.src.charCodeAt(m))return!1;for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);const k=Math.floor((b-m)/a);if(k<i)return!1;b-=(b-m)%a;const A=f.src.slice(m,b),$=f.src.slice(b,y);if(!c($,A))return!1;if(g)return!0;let L=h;for(;L++,!(L>=p||(m=f.bMarks[L]+f.tShift[L],y=f.eMarks[L],m<y&&f.sCount[L]<f.blkIndent));)if(l===f.src.charCodeAt(m)&&!(f.sCount[L]-f.blkIndent>=4)){for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);if(!(Math.floor((b-m)/a)<k)&&(b-=(b-m)%a,b=f.skipSpaces(b),!(b<y))){v=!0;break}}const w=f.parentType,E=f.lineMax;f.parentType="container",f.lineMax=L;const T=f.push("container_"+t+"_open","div",1);T.markup=A,T.block=!0,T.info=$,T.map=[h,L],f.md.block.tokenize(f,h+1,L);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(m,b),F.block=!0,f.parentType=w,f.lineMax=E,f.line=L+(v?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 OV(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let b=0;b<a.length;b++){const v=a[b];if(v==="\\"){b++;continue}if(!u&&v==="'"){c=!c;continue}if(!c&&v==='"'){u=!u;continue}if(!c&&!u&&v===":"){d=b;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let g;if(!h)g="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{g=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=h}else/^-?\d+(?:\.\d+)?$/.test(h)?g=Number(h):h==="true"||h==="false"?g=h==="true":h==="null"?g=null:g=h;l[p]=g}return l}function RV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(FV,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
164
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),g=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,g?.startsWith("{")){let A=0,$=-1;for(let L=0;L<g.length;L++)if(g[L]==="{"?A++:g[L]==="}"&&A--,A===0){$=L+1;break}$>0&&(h=g.slice(0,$))}h||(f=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let v=n+1,m=!1;for(;v<=o;){const A=i.bMarks[v]+i.tShift[v],$=i.eMarks[v];if(i.src.slice(A,$).trim()===":::"){m=!0;break}v++}m||(v=o);const y=i.push("vmr_container_open","div",1);if(y.attrSet("class",`vmr-container vmr-container-${u}`),y.meta={...y.meta??{},unclosed:!m&&!b},f&&y.attrSet("data-args",f),h)try{const A=JSON.parse(h);for(const[$,L]of Object.entries(A)){const w=L!=null&&typeof L=="object";y.attrSet(`data-${$}`,w?JSON.stringify(L):String(L))}}catch{const A=OV(h);if(A)for(const[$,L]of Object.entries(A)){const w=L!=null&&typeof L=="object";y.attrSet(`data-${$}`,w?JSON.stringify(L):String(L))}else y.attrSet("data-attrs",h)}const k=[];for(let A=n+1;A<v;A++){const $=i.bMarks[A]+i.tShift[A],L=i.eMarks[A];k.push(i.src.slice($,L))}if(k.some(A=>A.trim().length>0)){let A=k.join(`
|
|
165
|
-
`);A.endsWith(`
|
|
166
|
-
`)||(A+=`
|
|
167
|
-
`),A.endsWith(`
|
|
168
|
-
|
|
169
|
-
`)||(A+=`
|
|
170
|
-
`);const $=i.tokens[i.tokens.length-1];$&&($.raw=A);const L=[];i.md.block.parse(A,i.md,i.env,L),i.tokens.push(...L)}return m&&i.push("vmr_container_close","div",-1),i.line=m?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function Am(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 BV=/^[a-z][a-z0-9_-]*$/;function g_(e){return BV.test(String(e??"").trim().toLowerCase())}function wi(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return g_(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)?"":g_(s)?s:""}function nu(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=wi(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function DV(...e){const t=new Set,n=[];for(const o of e)for(const s of nu(o))t.has(s)||(t.add(s),n.push(s));return n}function PV(e){const t=nu(e);return{key:t.join(","),tags:t}}function F6(e){return wi(e)}function HV(e,t){const n=String(e??""),o=wi(t);if(!o)return!1;const s=Gs(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 O6(e,t){const n=wi(t);return!!n&&!Td.has(n)&&!HV(e,n)}function WV(e,t){const n=String(e??""),o=wi(t);if(!o)return n;const s=Gs(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 R6=Oa,zV=Td,B6=new Set(CV);B6.delete("details");const UV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,qV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,rv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,jV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function pp(e){return(e.match(rv)?.[1]??"").toLowerCase()}function Qy(e){return/^\s*<\s*\//.test(e)}function Jy(e,t){return R6.has(t)||/\/\s*>\s*$/.test(e)}function VV(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=pp(i);if(r===t){if(Qy(i)){if(n===0)return o;n--;continue}Jy(i,r)||n++}}return-1}function KV(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=pp(s);if(i===t){if(Qy(s)){n>0&&n--;continue}Jy(s,i)||n++}}return n}function v_(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Gs(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 GV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Gs(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 mp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function YV(e){const t=e;return t.meta||(t.meta={}),t.meta}function b0(e,t,n){const o=YV(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function ZV(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Gs(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
|
|
171
|
-
`),s=!1)},a=h=>{r(h)},c=h=>{for(let g=0;g<o.length;g++)o[g].raw+=h,g<o.length-1&&(o[g].inner+=h);const p=o.pop();b0(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Gs(p)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!u(h),f=(h,p,g)=>{const b=g??(h.type==="html_inline"?pp(p):"");if(!(b&&t.has(b))){r(p);return}const v=Qy(p),m=!v&&Jy(p,b);if(v){if(!o.length||o[o.length-1].tag!==b){r(p);return}c(p);return}if(r(p),m){b0(h,p,"");return}o.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let g=0,b=!0;for(const v of h.children){const m=mp(v),y=v.type==="html_inline"?pp(m):"",k=y&&t.has(y);let A=m;if(b&&p&&m&&(o.length||k)){const $=p.indexOf(m,g);if($!==-1)a(p.slice(g,$)),A=p.slice($,$+m.length),g=$+m.length;else{if(o.length&&!k)continue;b=!1}}f(v,A,y)}b&&p&&g<p.length&&o.length&&a(p.slice(g)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=mp(h),g=h.type==="html_block"?u(p):null;if(g){c(`${s?`
|
|
172
|
-
`:""}${g}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)b0(h.token,h.raw,h.inner)}function XV(e){return/^\s*<\s*[!?]/.test(e)}function QV(e){const t=new Set(zV);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 y_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function JV(e,t){let n=null;for(const i of e.matchAll(UV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();y_(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(qV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();y_(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function eK(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function tK(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(eK(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(rv);if(!h){i("<",c),u=d+1;continue}const p=Jn(f);if(p===-1){i("<",c),u=d+1;continue}const g=f.slice(0,p+1),b=(h[1]??"").toLowerCase();t.has(b)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=JV(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+=mp(a),s=o.buffer;const c=Jn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=mp(a),u=(c.match(rv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Jn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const nK=["a","span","strong","em","b","i","u"];function oK(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=wi(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const y of g){const k=wi(String(y??""));k&&p.add(k)}const b=QV(Array.from(p)),v=new Set(nK);for(const y of p)v.add(y);return{autoCloseInlineTagSet:v,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:y=>p.has(y)||!b.has(y)||B6.has(y)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const g=p.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const b={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:g}=o(f);for(const b of h){const v=b;if(v.type!=="inline"||!Array.isArray(v.children))continue;const m=String(v.content??""),y=v.children.length?v.children:m.includes("<")?[{type:"text",content:m,raw:m}]:null;if(y)try{const k=tK(y,p);if(v.children=k.children,k.pendingBuffer){const A=m.lastIndexOf(k.pendingBuffer);if(A!==-1){const $=m.slice(0,A);v.content=$,typeof v.raw=="string"&&(v.raw=$)}}}catch(k){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",k)}}ZV(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:g,shouldMergeHtmlBlockTag:b}=o(f),v=[];for(let m=0;m<h.length;m++){const y=h[m];if(v.length>0){const[A,$]=v[v.length-1];if(m!==$){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const L=String(y.content??y.raw??"");if(L){const w=h[$],E=`${String(w.content||"")}
|
|
173
|
-
${L}`,T=Jn(E),F=T===-1?null:v_(E,A,T+1);if(F){const S=E.slice(0,F.end),I=E.slice(F.end);w.content=S,w.loading=!1,h.splice(m,1),v.pop();const P=d(w,I)?[]:c(I,u(h,m,"paragraph"));P.length&&h.splice(m,0,...P),m--;continue}w.content=E,w.loading!==!1&&(w.loading=!0)}h.splice(m,1),m--;continue}}const k=s(y);if(k){if(XV(k))continue;const A=(k.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(k);if(!A||!b(A))continue;if(i(y,k),!$)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(k)&&GV(k,A)>0&&v.push([A,m]);else if(v.length>0&&A&&v[v.length-1][0]===A){const[,L]=v[v.length-1],w=h[L];w.content=`${String(w.content||"")}
|
|
174
|
-
${k}`,w.loading=!1,v.pop(),h.splice(m,1),m--}continue}else if(v.length>0){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const A=y.content||"",$=new RegExp(`<\\s*\\/\\s*${v[v.length-1][0]}\\s*>`,"i").test(A);if(A){const[,L]=v[v.length-1],w=h[L];w.content=`${w.content||""}
|
|
175
|
-
${A}`,w.loading!==!1&&(w.loading=!$)}$&&v.pop(),h.splice(m,1),m--}else continue}if(g.size>0){const m=new Map,y=new Map,k=L=>{let w=m.get(L);return w||(w=new RegExp(`<\\s*${L}\\b`,"i"),m.set(L,w)),w},A=L=>{let w=y.get(L);return w||(w=new RegExp(`<\\s*\\/\\s*${L}\\s*>`,"i"),y.set(L,w)),w},$=[];for(let L=0;L<h.length;L++){const w=h[L],E=String(w.content??"");if($.length>0){const F=$[$.length-1],S=h[F.index],I=w.type==="html_block"?A(F.tag).exec(E):null;if(I){const W=I.index+I[0].length,z=E.slice(0,W),R=E.slice(W);S.content=`${String(S.content??"")}
|
|
176
|
-
${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),$.pop();const q=d(S,R)?[]:c(R,u(h,L,"paragraph"));q.length?h.splice(L,1,...q):(h.splice(L,1),L--);continue}if(w.type!=="inline")continue;const P=Array.isArray(w.children)?w.children:[],D=VV(P,F.tag);if(D!==-1){const W=P.slice(0,D+1),z=P.slice(D+1),R=W.map(q=>String(q?.content??q?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
177
|
-
${R}`,Array.isArray(S.children)&&S.children.push(...W),z.length){const q=z.map(K=>String(K.content??K.raw??"")).join("");if(q.trim()){const K=q.replace(/^\s+/,"");if(d(S,q))h.splice(L,1),L--;else if(K.startsWith("<"))h.splice(L,1,{type:"html_block",content:K});else{const X=c(q,u(h,L,"paragraph"));h.splice(L,1,...X)}}else h.splice(L,1),L--}else h.splice(L,1),L--;$.pop();continue}S.content=`${String(S.content??"")}
|
|
178
|
-
${E}`,Array.isArray(S.children)&&S.children.push(...P),h.splice(L,1),L--;continue}if(w.type!=="inline")continue;const T=Array.isArray(w.children)?w.children:[];for(const F of g)if((T.length?KV(T,F):k(F).test(E)&&!A(F).test(E)?1:0)>0){$.push({tag:F,index:L});break}}}{let m=0;for(let y=0;y<h.length;y++){const k=h[y];if(k.type==="paragraph_open"){m++;continue}k.type==="paragraph_close"&&(m>0?m--:(h.splice(y,1),y--))}}for(let m=0;m<h.length;m++){const y=h[m];if(y.type==="html_block"){const w=(y.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(w.startsWith("!")||w.startsWith("?")){y.loading=!1;continue}if(g.has(w)){const D=String(y.content??""),W=Jn(D),z=W===-1?null:v_(D,w,W+1);y.loading=z?!1:y.loading!==void 0?y.loading:!0;const R=z?.start??-1,q=z?z.end-z.start:0;if(R!==-1){const K=D.slice(0,R+q);let X="";W!==-1&&W<R&&(X=D.slice(W+1,R)),y.children=[{type:w,content:X,raw:K,attrs:[],tag:w,loading:!1}],y.content=K,y.raw=K;const ue=c(D.slice(R+q)||"","text");ue.length&&h.splice(m+1,0,...ue)}else y.children=[{type:w,content:"",raw:D,attrs:[],tag:w,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(w))continue;y.type="inline";const E=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let T;for(;(T=E.exec(y.content||""))!==null;)T[1],T[2]||T[3]||T[4];const F=String(y.content??""),S=new RegExp(`<\\/\\s*${w}\\s*>`,"i").exec(F),I=S?S.index:-1,P=S?S[0].length:0;if(I!==-1){const D=F.slice(0,I+P),W=(F.slice(I+P)||"").replace(/^\s+/,"");y.children=[{type:"html_block",content:D,tag:w,loading:!1}],y.content=D,y.raw=D,W&&h.splice(m+1,0,W.startsWith("<")?{type:"html_block",content:W}:{type:"text",content:W,raw:W})}else y.children=[{type:"html_block",content:y.content,tag:w,loading:!0}];continue}if(!y||y.type!=="inline")continue;if(y.children.length===2&&y.children[0].type==="html_inline"){const w=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=y.children[1],T=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&T===w)continue;p.has(w)?(y.children[0].loading=!0,y.children[0].tag=w,y.children.push({type:"html_inline",tag:w,loading:!0,content:`</${w}>`})):y.children=[{type:"html_block",loading:!0,tag:w,content:String(y.children[0]?.content??"")+String(y.children[1]?.content??"")}];continue}else if(y.children.length===3&&y.children[0].type==="html_inline"&&y.children[2].type==="html_inline"){const w=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(w))continue;y.children=[{type:"html_block",loading:!1,tag:w,content:y.children.map(E=>E.content).join("")}];continue}if(!y.content?.startsWith("<")||y.children?.length!==1)continue;const k=String(y.content),A=y,$=A.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(k)&&(A.children.length=0);continue}const L=String($.content??k).match(jV)?.[1]?.toLowerCase()??"";if(L){if(/\/\s*>\s*$/.test(k)||R6.has(L)){A.children=[{type:"html_inline",content:k}];continue}A.children.length=0}}})}function sK(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 iK(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&&!sK(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 D6=/\.([a-z0-9]{1,15})$/i,rK=/[_()[\]{}<>]/u,lK=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,aK=/[?#@]/u,cK=/[\\/]/u,uK=/^[\p{L}\p{N}./\\-]+$/u,dK=/^[A-Za-z0-9-]{1,63}$/u,fK=/^xn--[a-z0-9-]{2,59}$/i,hK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,pK=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,mK=/文件名\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,gK=/文件名\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,vK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,yK=new Set(["ai","md","py","rs","sh","zip"]),P6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),kK=new Set([...P6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),bK=new Set(["com","dev","io","page","site"]),xK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),wK=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 Nd(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function x0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Nd(n)?n:void 0}function k_(e,t){if(!Nd(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 b_(e){const t=Kd(e);return Nd(t)?t:void 0}function _K(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function x_(e,t){if(!Nd(t))return;const n=String(e??"").trim().split(/\s+/u).map(_K).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>gp(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>gp(s,{marketTicker:!0}))&&(o.marketTicker=!0),Nd(o)?o:void 0}function Dl(e,t=!1){let n;return{options(o){return t||o==null?k_(e,n):k_(e,x0(b_(o),x_(o,n)))},remember(o){const s=b_(o);n=t?x0(n,s):x0(s,x_(o,n))},reset(){n=void 0}}}function w_(e){return dK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function SK(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return w_(n)||fK.test(n)?t.every(w_):!1}function H6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function CK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function AK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function W6(e,t,n){const o=CK(t);return H6(e)&&AK(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function Kd(e){const t=String(e??"");return{explicitFilename:mK.test(t),filename:gK.test(t),marketTicker:vK.test(t)}}function MK(e){return SK(e.split(/[\\/]/)[0]??"")}function EK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function TK(e){if(rK.test(e)||!uK.test(e))return!0;if(cK.test(e))return!MK(e);const t=e.replace(D6,"");return H6(t)?!0:t.split(".").filter(Boolean).some(EK)}function NK(e,t,n){if(!(n?kK:P6).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?pK:hK).test(o)}function gp(e,t={}){if(!e||lK.test(e)||aK.test(e))return!1;const n=e.match(D6);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return NK(e,o,t.marketTicker===!0)?!0:wK.has(o)?!yK.has(o)||t.filename?!0:TK(e):!!(t.explicitFilename&&bK.has(o)||t.filename&&xK.has(o))}const __=["!"];function As(e){return{type:"text",content:e,raw:e}}function na(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 oa(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 ol(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 IK(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(As(t))}}function S_(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 LK(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function $K(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 FK(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 OK(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=RK(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function RK(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Kd(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=FK(e,o,i),l=LK(s);if(s.markup==="linkify"&&r&&!W6(r,l,t)&&gp(r,n)){e.splice(o,i-o+1,As(r));continue}const a=S_(l,__);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=S_(u.content,__);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let v=c+1;v<i;v++){const m=e[v];m?.type==="text"&&typeof m.content=="string"&&(p+=m.content)}u.content=h,u.raw=h;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const v=encodeURI(p);if(v&&l.endsWith(v))b=l.slice(0,l.length-v.length);else{const m=f?encodeURI(f):"",y=m?l.indexOf(m):-1;y!==-1&&(b=l.slice(0,y))}}b!==l&&$K(s,b),p&&e.splice(i+1,0,As(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(As(r));const c=i[1],u=l[1].length;na(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(ol(c,d,!e[o+4]?.content?.startsWith(")"))),oa(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(As(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(As(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),na(a,f),a.push(ol(c,h,!e[o+4]?.content?.startsWith(")"))),oa(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(As(p)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(ol(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(As(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(ol(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(As(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;na(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;p<e.length;p++){const g=d?d[1].length:e[o-3].markup.length,b=e[p];if(g===1&&b.type==="em_close")break;if(g===2&&b.type==="strong_close")break;if(g===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;oa(f,p)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(As(l)),na(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(ol(a,c,u)),oa(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(As(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(As(r)),na(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(ol(l,a,c)),oa(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(As(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(As(r)),na(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(ol(a,c,d)),oa(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=[];na(a,2),a.push(ol(r,l,!1)),oa(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;IK(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function BK(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=DK(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function DK(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 PK(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=HK(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function HK(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="__"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="_"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=WK(l),l}function WK(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=zK(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 zK(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 UK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=YK(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 C_(){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 A_(){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 M_(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 z6(e,t){if(!e.startsWith("|")||e.includes(`
|
|
179
|
-
`)||!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 w0(e){return z6(e)!==null}function U6(e){return/^:?-+:?$/.test(e.trim())}function qK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(U6)}function jK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function VK(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(U6)&&jK(n)}function KK(e){return e==="|"||e==="|:"}function GK(e){const t=z6(e);return t!==null&&t.every(n=>!n.includes(":"))}function YK(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(`
|
|
180
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
181
|
-
`),d=!t&&!r.includes(`
|
|
182
|
-
`)&&/\r?\n$/.test(n)&&w0(r);if(!t&&(r.includes(`
|
|
183
|
-
`)&&u.length===0&&w0(a)&&VK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>M_(p)),h=[...C_(),...f,...A_()];o.splice(s-1,3,...h)}else if(r.includes(`
|
|
184
|
-
`)&&u.length===0&&w0(a)&&qK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>M_(p)),h=[...C_(),...f,...A_()];o.splice(s-1,3,...h)}else r.includes(`
|
|
185
|
-
`)&&u.length===0&&GK(a)&&KK(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function ZK(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 XK=ZK;const QK=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],vp=QK.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),JK=/\\[a-z]+/i,q6="(?:\\\\|\\u0008)",eG=new RegExp(String.raw`${q6}(?:${vp})\s*\{[^}]+\}`,"i"),tG=new RegExp(String.raw`(?:${q6})?(?:${vp})\s*\{`,"i"),nG=/\\(?:text|frac|left|right|times)/,oG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,sG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,iG=/[A-Z]+\s*\([^)]+\)/i,rG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,lG=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,aG=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,cG={"\b":"\\b","\v":"\\v","\f":"\\f"};function uG(e){let t="";for(const n of e)t+=cG[n]??n;return t}function xc(e){if(!e)return!1;const t=uG(e),n=t.trim();if(aG.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=JK.test(t),s=eG.test(t),i=tG.test(t),r=nG.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=oG.test(t)&&!sG.test(t),c=iG.test(t),u=rG.test(n),d=lG.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const j6="__markstreamMathPluginApplied",lv=80,V6=2e4,E_=V6+4096;function K6(e){return!!e[j6]}function dG(e){e[j6]=!0}const G6=["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"],fG=["cdot","mathbf{","partial","mu_{"],Y6=G6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Z6="[ \r\b\f\v]",hG=new RegExp(`([^\\\\])(${fG.map(e=>e).join("|")})+`,"g"),pG=/span\{([^}]+)\}/,mG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,gG=/(^|[^\\])\\\r?\n/g,vG=/(^|[^\\])\\$/g,yG=new RegExp(`(${Z6})|(${Y6})\\b`,"g"),T_=new Map,N_=new Map;function kG(e){if(!e)return yG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=T_.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${Z6})|(${s})\\b`,"g");return T_.set(n,i),i}function bG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=N_.get(o);if(s)return s;const i=e?[vp,Y6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),vp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return N_.set(o,r),r}const I_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function L_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function $_(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 sl(e,t){const n=t?.commands??G6,o=t?.escapeExclamation??!0,s=t?.commands==null,i=kG(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&I_[u]!==void 0)return`\\${I_[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=bG(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(pG,"span\\{$1\\}").replace(mG,"\\operatorname{span}\\{$1\\}"),l=l.replace(gG,`$1\\\\
|
|
186
|
-
`),l=l.replace(vG,"$1\\\\"),l=l.replace(hG,"$1\\$2"),l}function F_(e){const t=e.trim();return!(!xc(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 X6(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 yp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function xG(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 Gd(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function av(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(Gd(e,o)){n=o+1;continue}return o}return-1}function _0(e,t){let n=t;for(;n<e.length;){const o=av(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 Wu(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(!Gd(e,s))return s;o=s+Math.max(1,t.length)}return-1}function O_(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=yp(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Gd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function ek(e,t,n){const o=Ld(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Ld(o.slice(0,s)).trim()||Gd(o,s))return-1;const i=X6(o);if(yp(i,s))return-1;const r=O_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>O_(o,n,0,s,i))return-1;return s}function Id(e){return e===" "||e===" "}function Ld(e){let t=e.length;for(;t>0&&Id(e[t-1]);)t--;return e.slice(0,t)}function R_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
187
|
-
`&&t++;return t}function B_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function wG(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(!Id(s))return!1}return n>=3}function _G(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 SG(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(_G)}function CG(e){let t=0;if(!B_(e[t]))return!1;for(;B_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Id(e[t+1])}function Q6(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&&Id(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Id(t[1])||CG(t)||wG(t)||SG(t))}function D_(e,t){return e?t?`${e}
|
|
188
|
-
${t}`:e:t}function cv(e){const t=String(e??"").trim();return t?xc(t):!1}function P_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function J6(e){if(e.length<=E_)return{source:e,lineOffset:0};let t=e.length-E_;const n=e.indexOf(`
|
|
189
|
-
`,t);return n===-1?{source:"",lineOffset:R_(e)}:(t=n+1,{source:e.slice(t),lineOffset:R_(e.slice(0,t))})}function eM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=J6(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-lv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Ld(o[r]);if(l&&!Q6(l)){for(const[a,c]of i)if(ek(l,a,c)!==-1)return!0}}return!1}function AG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=J6(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-lv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Ld(s[l]);for(const[c,u]of r){const d=ek(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>lv){h=!0;break}const g=s[p],b=Wu(g,u);if(b!==-1){const v=D_(f,g.slice(0,b));if(!cv(v)){h=!0;break}const m=g.slice(b+u.length),y=m.trim()?`suffix:${P_(m)}`:"nosuffix";return["closed",c,o+l,d,o+p,b,P_(v),y].join(":")}if(Q6(g)){h=!0;break}if(f=D_(f,g),f.length>V6){h=!0;break}}if(!h&&cv(f))return["pending",c,o+l,d].join(":")}}return null}function S0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function MG(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 C0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function EG(e,t){dG(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=(m,y)=>{let k=y;for(;k<m.length&&(m[k]===" "||m[k]===" ");)k++;if(k===y||!(m[k]===`
|
|
190
|
-
`||m[k]==="\r"&&m[k+1]===`
|
|
191
|
-
`))return y;const A=m.slice(y,k),$=a.push("text","",0);return $.content=A,k};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let m=a.pos+1;for(;a.src[m]==="$";)m++;const y=m-a.pos,k=a.src[m];if(y>=3&&(!k||/\s/.test(k))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,m),a.pos=m,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let g=p,b=p;const v=p;for(const[m,y]of f){const k=a.src,A=X6(k),$=xG(k,u);let L=!1;m==="$$"&&g!==v&&(g=v);let w=-1,E=-1,T=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,g=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,g=a.pos;return}if(!S)return;if(m==="$$"&&S.includes("$")){let D=0;for(;D<S.length;){const W=av(S,D);if(W===-1){const de=S.slice(D);if(de){const Ae=a.push("text","",0);Ae.content=de,a.pos=a.pos+de.length,g=a.pos}break}if(W>0&&S[W-1]==="$"||W+1<S.length&&S[W+1]==="$"){const de=S.slice(D,W+1);if(de){const Ae=a.push("text","",0);Ae.content=de,a.pos=a.pos+de.length,g=a.pos}D=W+1;continue}const z=S.slice(D,W);if(z){const de=a.push("text","",0);de.content=z,a.pos=a.pos+z.length,g=a.pos}const R=_0(S,W+1);if(R===-1){const de=S.slice(W),Ae=a.push("text","",0);Ae.content=de,a.pos=a.pos+de.length,g=a.pos;break}const q=S.slice(W+1,R),K=q.includes("`"),X=!q||!q.trim(),ue=S[R+1],me=S0(q,ue),ne=C0(q);if(!K&&!X&&!me&&!ne){const de=a.push("math_inline","math",0);de.content=sl(q,t),de.markup="$",de.raw=`$${q}$`,de.loading=!1,a.pos=a.pos+(R-W+1),g=a.pos,D=R+1;continue}const ce=a.push("text","",0);ce.content="$",a.pos=a.pos+1,g=a.pos,D=W+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),R=a.push("text","",0);R.content=z,a.pos=a.pos+z.length,g=a.pos}const D=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,z,R]=D,q=R.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=q?q[1]:R,X=q&&q[2]?q[2]:null,ue=a.push("image","img",0);ue.attrs=[["src",K],["alt",z]],X&&ue.attrs.push(["title",X]),ue.content=z,ue.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+D[0].length,g=a.pos;const me=S.slice(I+D[0].length);me&&F(me);return}const W=a.push("text","",0);W.content=S,a.pos=a.pos+S.length,g=a.pos;return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,g=a.pos};for(;!(g>=k.length);){const S=k.indexOf(m,g);if(S===-1)break;if(Gd(k,S)){g=S+Math.max(1,m.length);continue}const I=yp(A,S);if(I){g=I[1];continue}const P=yp($,S);if(P){g=P[1];continue}if(S===w&&g===E){if(T++,T>2){g=S+Math.max(1,m.length);continue}}else T=0,w=S,E=g;if(m==="("&&S>0){let me=S-1;for(;me>=0&&k[me]===" ";)me--;if(me>=0&&k[me]==="]"){g=S+m.length;continue}}if(m==="$"&&S>0&&k[S-1]==="$"){g=S+1;continue}if(m==="$"&&S<k.length-1&&k[S+1]==="$"){g=S+2;continue}const D=m==="$"?_0(k,S+m.length):XK(k,S+m.length,m,y);if(D===-1){const me=k.slice(S+m.length);if(me.includes(m)){g=k.indexOf(m,S+m.length);continue}if(D===-1){const ne=m==="$"&&MG(me);if(u&&!c&&!ne&&xc(me)&&!me.includes("`")){if(g=S+m.length,L=!0,!l){a.pending="";const ce=b?k.slice(b,g):k.slice(0,g),de=L_(ce)%2===1;if(b)F(k.slice(b,g));else{let Ae=k.slice(0,g);Ae.endsWith(m)&&(Ae=Ae.slice(0,Ae.length-m.length)),F(Ae)}if(de){const Ae=$_(ce)?.marker??"**",Le=a.push("strong_open","",0);Le.markup=Ae;const le=a.push("math_inline","math",0);le.content=sl(me,t),le.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",le.raw=`${m}${me}${y}`,le.loading=!0,Le.content=me,a.push("strong_close","",0)}else{const Ae=a.push("math_inline","math",0);Ae.content=sl(me,t),Ae.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Ae.raw=`${m}${me}${y}`,Ae.loading=!0}a.pos=k.length}g=k.length,b=g}break}}const W=k.slice(S+m.length,D),z=W.includes("`"),R=!W||!W.trim(),q=m==="$",K=k[D+y.length],X=q&&S0(W,K),ue=q&&C0(W);if(c?z||R||X||ue:z||R||X||ue||!q&&!xc(W)){g=D+y.length;const me=k.slice(a.pos,g);a.pending||(F(me),b=g);continue}if(L=!0,!l){const me=k.slice(a.pos-(a.pending??"").length,S);let ne=k.slice(0,g)?k.slice(b,S):me;const ce=L_(ne)%2===1;S!==a.pos&&ce&&(ne=a.pending+k.slice(a.pos,S));const de=ce?$_(ne):null,Ae=de?.marker??"**";if(a.pending!==ne)if(a.pending="",ce)if(de){const Le=ne.slice(de.index+Ae.length);F(ne.slice(0,de.index));const le=a.push("strong_open","",0);le.markup=Ae;const U=a.push("text","",0);U.content=Le,a.push("strong_close","",0)}else F(ne);else F(ne);if(ce){const Le=a.push("strong_open","",0);Le.markup=Ae;const le=a.push("math_inline","math",0);le.content=sl(W,t),le.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",le.raw=`${m}${W}${y}`,le.loading=!1;const U=k.slice(D+y.length).startsWith(Ae);return U&&a.push("strong_close","",0),a.pos=d(k,D+y.length),g=a.pos,b=g,U||a.push("strong_close","",0),!0}else{const Le=a.push("math_inline","math",0);Le.content=sl(W,t),Le.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Le.raw=`${m}${W}${y}`,Le.loading=!1}}return g=d(k,D+y.length),b=g,a.pos=g,!0}if(L){if(l)a.pos=g;else{if(m==="$$"&&g<k.length&&k.slice(g).includes("$")){let S=g;for(;!(S>=k.length);){const I=av(k,S);if(I===-1)break;if(I+1<k.length&&k[I+1]==="$"){S=I+2;continue}if(I>0&&k[I-1]==="$"){S=I+1;continue}const P=_0(k,I+1);if(P===-1)break;const D=k.slice(I+1,P),W=D.includes("`"),z=!D||!D.trim(),R=k[P+1],q=S0(D,R),K=C0(D);if(!W&&!z&&!q&&!K){const X=k.slice(g,I);X&&F(X);const ue=a.push("math_inline","math",0);ue.content=sl(D,t),ue.markup="$",ue.raw=`$${D}$`,ue.loading=!1,g=P+1,S=P+1}else F("$"),S=I+1}S<k.length&&F(k.slice(S))}else g<k.length&&F(k.slice(g));a.pos=k.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let g=u.src.slice(p,u.eMarks[l]).trim(),b=!1,v="",m="",y=!1,k="",A=!1;for(const[X,ue]of h)if(g.startsWith(X))if(X.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=X,m=ue;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=X,m=ue;break}continue}else{const me=u.tokens[u.tokens.length-1];if(me&&me.type==="list_item_open"&&me.mark==="-"&&g.slice(X.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const ne=g.indexOf("]");if(g.slice(ne).trim()!=="]")continue;const ce=g.slice(X.length,ne);if(X==="["?F_(ce):xc(ce)){b=!0,v=X,m=ue;break}continue}}else{b=!0,v=X,m=ue;break}else if((X==="$$"||X==="\\[")&&g.endsWith(X)&&l+1<a){const me=ek(g,X,ue);if(me===-1)continue;k=Ld(g.slice(0,me)),A=!0;const ne=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(ne,u.eMarks[l+1]).trim(),y=!0,b=!0,v=X,m=ue;break}if(!b)return!1;if(c&&!A)return!0;const $=g.indexOf(v),L=$+v.length,w=!f&&v==="["?g.indexOf("\\]",L):-1,E=w>=0?"\\]":m,T=w>=0?w:Wu(g,m,L);if(!y&&T>v.length){const X=g.slice($+v.length,T),ue=u.push("math_block","math",0);ue.content=sl(X),ue.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",ue.map=[l,l+1],ue.raw=`${v}${X}${E}`,ue.block=!0,ue.loading=!1,u.line=l+1;const me=g.slice(T+E.length);return me.trim()&&n(u,me,l),!0}let F=l,S="",I=!1,P="",D=l;const W=y?g:g===v?"":g.slice(v.length),z=!f&&v==="\\["?"]":"",R=Wu(W,m);if(R!==-1){const X=R;S=W.slice(0,X),P=W.slice(X+m.length),D=y?l+1:l,I=!0,F=D}else for(W&&!y&&(S=W),F=l+1;F<a;F++){const X=u.bMarks[F]+u.tShift[F],ue=u.eMarks[F],me=u.src.slice(X,ue),ne=me.trim();if(!f&&v==="["&&ne==="\\]"){m="\\]",I=!0;break}if(z&&me.trim()===z){m=z,I=!0;break}if(ne===m){I=!0;break}else if(!f&&v==="["&&me.includes("\\]")){I=!0;const ce=me.indexOf("\\]");m="\\]";const de=me.slice(0,ce);de&&(S+=(S?`
|
|
192
|
-
`:"")+de),P=me.slice(ce+m.length),D=F;break}else if(Wu(me,m)!==-1){I=!0;const ce=Wu(me,m),de=me.slice(0,ce);de&&(S+=(S?`
|
|
193
|
-
`:"")+de),P=me.slice(ce+m.length),D=F;break}S+=(S?`
|
|
194
|
-
`:"")+me}if((!d||f)&&!I)return!1;const q=/^\s*!\[/.test(S);if(!(A?!q&&cv(S):v==="$$"?!q:v==="["?F_(S):xc(S)))return!1;if(c)return!0;k&&n(u,k,l);const K=u.push("math_block","math",0);return K.content=sl(S),K.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",K.raw=`${v}${S}${S.startsWith(`
|
|
195
|
-
`)?`
|
|
196
|
-
`:""}${m}`,K.map=[l,F+1],K.block=!0,K.loading=!I,u.line=F+1,P.trim()&&n(u,P,D),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function TG(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 NG(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 vV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!xa(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&EG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&RV(i),e.enableFixIndentedCodeBlock!==!1&&iK(i),OK(i),PK(i),BK(i),UK(i),TG(i),oK(i,{customHtmlTags:e.customHtmlTags}),i}function wa(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=>wa(n))),t}function IG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function LG(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 $G(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Vf(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(...eo(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const H_=/\r?\n[ \t]*`+\s*$/,tM=["diff ","index ","--- ","+++ ","@@ "],FG=/\r?\n/;function OG(e){const t=String(e??"");return t?tM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function W_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function RG(e,t){const n=[],o=[],s=[],i=[],r=e.split(FG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!tM.some(g=>p.startsWith(g)))if(p.startsWith("-")){const g=p.slice(1);s.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(p.startsWith("+")){const g=p.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{W_(n,o,s,i);const g=a&&p.startsWith(" ")?p.slice(1):p;n.push(g),o.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&OG(p)||c(p)}(t||s.length>0||i.length>0)&&W_(n,o,s,i);const d=n.join(`
|
|
197
|
-
`),f=o.join(`
|
|
198
|
-
`);return{original:t&&l&&d?`${d}
|
|
199
|
-
`:d,updated:t&&l&&f?`${f}
|
|
200
|
-
`:f}}function tk(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(H_.test(a)&&(a=a.replace(H_,"")),r){const{original:c,updated:u}=RG(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 BG(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function DG(){return{type:"hardbreak",raw:`\\
|
|
201
|
-
`}}function PG(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(...eo(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let A0=null;const M0=new WeakMap;function z_(){return A0||(A0={customTagSet:null,allowedTagSet:Tm()}),A0}function nM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function oM(e){return/^<\s*\//.test(e)}function sM(e,t){return/\/\s*>\s*$/.test(t)||Oa.has(e)}function HG(e){if(!e||e.length===0)return z_();const t=M0.get(e);if(t)return t;const n=e.map(wi).filter(Boolean);if(!n.length){const s=z_();return M0.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Tm({customHtmlTags:e})};return M0.set(e,o),o}function iM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function WG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function kp(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 zG(e,t,n){const o=e.slice();return kp(o,"href")||o.push(["href",t]),n!=null&&!kp(o,"title")&&o.push(["title",n]),o}function uv(e){return e.map(iM).join("")}function bh(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:bh(o.children)});continue}t.push(o)}return t}function UG(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=nM(r),a=oM(r),c=sM(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function E0(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?UG(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:uv(o),innerTokens:s,nextIndex:i}}function qG(e,t,n,o,s,i,r){const l=String(e.content??""),a=nM(l),{customTagSet:c,allowedTagSet:u}=HG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!E0(t,n,a).closed){const A=iM(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=oM(l),f=sM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=E0(t,n,a),$=Am(l),L=A.innerTokens,w=String(kp($,"href")??""),E=kp($,"title"),T=E==null?null:String(E),F=zG($,w,T),S=bh(L.length?o(L,s,i,r):[]),I=L.length?uv(L):w||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:w,title:T,text:I,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=E0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:bh(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=bh(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let g=h.html||l,b=!h.closed,v=!1;if(!h.closed){const A=`</${a}>`;g.toLowerCase().includes(A.toLowerCase())||(g+=A),v=!0,b=!0}const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(l))!==null;){const A=k[1],$=k[2]||k[3]||k[4]||"";m.push([A,$])}if(c?.has(a)){const A=WG(e);return[{type:a,tag:a,attrs:m,content:A?A.inner:h.innerTokens.length?uv(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??g,loading:e.loading||b,autoClosed:v},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:m,content:g,children:p,raw:g,loading:b,autoClosed:v},h.nextIndex]}function rM(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>rM(t)).join(""):String(e.content??"")}function jG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>rM(t)).join("")}function U_(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=jG(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 VG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function KG(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(...eo(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function GG(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 bp(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 YG(e,t,n){const o=e.slice();return bp(o,"href")||o.push(["href",t]),n!=null&&!bp(o,"title")&&o.push(["title",n]),o}function Kf(e,t,n){const o=e[t],s=GG(o.attrs),i=String(bp(s,"href")??""),r=bp(s,"title"),l=r==null?null:String(r),a=YG(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(b=>b.type==="strong_open")){const b=String(h.content??""),v=String(h.raw??b),m=wa(h);m.content=b.slice(0,-2),m.raw=v.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=m}const p=eo(f,void 0,void 0,n),g=p.map(b=>{const v=b;return"content"in b?String(v.content??""):String(v.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:p,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function q_(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 ZG(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function j_(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(...eo(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const XG=/\\([\\()[\]`$|*_\-!])/g;function QG(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(XG,"$1")===t))return n}function Nu(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(...eo(l,QG(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function JG(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(...eo(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 eY(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(...eo(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 tY(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const nY=/[^~]*~{2,}[^~]+/,oY=/\*\*/,sY=/[[_*^~]/,iY=/\\([\\()[\]`$|*_\-!])/g,nk=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),rY=/\s/u,lY=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,aY=/\p{P}/u,cY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,uY=/:\/\//;function dY(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function lM(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&nk.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Ll(e){return!!e&&rY.test(e)}function $l(e){return!!e&&(lY.test(e)||aY.test(e))}function fY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Ll(o)?!1:!($l(o)&&n&&!Ll(n)&&!$l(n))}function hY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Ll(n)?!1:!($l(n)&&o&&!Ll(o)&&!$l(o))}function pY(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?lM(e,o):t.indexOf("*",o);if(i===-1)break;if(hY(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function mY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Ll(o)?!1:!($l(o)&&n&&!Ll(n)&&!$l(n))}function gY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Ll(n)?!1:!($l(n)&&o&&!Ll(o)&&!$l(o))}function vY(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(gY(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function yY(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&&nk.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function kY(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&nk.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function bY(e,t,n){const o=kY(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 xY=/[\p{L}\p{N}]/u,wY=/^[\p{L}\p{N}]+$/u;function dv(e){return e?xY.test(e):!1}function aM(e){return e?wY.test(e):!1}function nd(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:dv(o)&&dv(s)}}function _Y(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=nd(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!aM(e.slice(o.end,s.start)))return s.end}return-1}function SY(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function CY(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=nd(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function AY(e){return e?cY.test(e)||uY.test(e):!1}function MY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function eo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Kd(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function g(U,ae){const se=e.length===1?t:String(ae.content??""),j=[],J=_Y(U);if(J!==-1){A(U.slice(0,J),U.slice(0,J));const fe=U.slice(J);return fe&&(T({type:"text",content:fe,raw:fe}),u--),u++,!0}if(nY.test(U)){const fe=U.indexOf("~~");fe!==-1&&j.push({type:"strikethrough",index:fe})}if(oY.test(U)){const fe=U.indexOf("**");fe!==-1&&j.push({type:"strong",index:fe})}if(/[^*]*\*[^*]+/.test(U)){const fe=se?lM(se,0):U.indexOf("*");if(se&&fe===-1)return!1;fe!==-1&&j.push({type:"emphasis",index:fe})}j.sort((fe,ve)=>fe.index!==ve.index?fe.index-ve.index:fe.type===ve.type?0:fe.type==="strong"?-1:ve.type==="strong"?1:0);const ye=j[0];if(!ye)return!1;if(ye.type==="strikethrough"){const fe=ye.index,ve=fe>-1?U.slice(0,fe):"";if(ve&&A(ve,ve),fe===-1)return u++,!0;const V=U.indexOf("~~",fe+2),ee=V===-1?U.slice(fe+2):U.slice(fe+2,V),pe=V===-1?"":U.slice(V+2),{node:Ce}=j_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ee,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),k(Ce),pe&&(T({type:"text",content:pe,raw:pe}),u--),u++,!0}if(ye.type==="strong"){const fe=ye.index,ve=fe>-1?U.slice(0,fe):"";if(ve&&A(ve,ve),fe===-1)return u++,!0;if(t&&fe===0){let De=!1,ge=0;for(;ge<U.length&&U[ge]==="*";)ge++;if(t.startsWith("\\*")&&(De=!0),De){let Ne=0,et=0;for(;et<t.length&&Ne<ge;)if(t[et]==="\\"&&et+1<t.length&&t[et+1]==="*")Ne+=1,et+=2;else{if(t[et]==="*")break;et++}if(Ne>=2)return A(U,U),u++,!0}}if(t&&(U.match(/\*/g)||[]).length>dY(t))return A(U.slice(ve.length),U.slice(ve.length)),u++,!0;const V=nd(U,fe);if(V.len>=3){const De=CY(U,fe+V.len);if(De!==-1){const ge=U.slice(fe+V.len,De);if(SY(ge)){const{node:Ne}=Nu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);p(),k(Ne);const et=U.slice(De+3);return et&&(T({type:"text",content:et,raw:et}),u--),u++,!0}}}if(!mY(U,fe)){const De=U.slice(fe,fe+V.len);A(De,De);const ge=U.slice(fe+V.len);return ge&&(T({type:"text",content:ge,raw:ge}),u--),u++,!0}const ee=vY(U,fe+2);let pe="",Ce="";if(ee.index!==-1){pe=U.slice(fe+2,ee.index),Ce=U.slice(ee.index+2);const De=ee.index,ge=nd(U,De);if(V.intraword&&ge.intraword&&!aM(pe)||!pe&&V.len>=4&&V.intraword)return A(U.slice(ve.length),U.slice(ve.length)),u++,!0}else{if(d||ee.sawInvalidClose||V.intraword)return A(U.slice(ve.length),U.slice(ve.length)),u++,!0;pe=U.slice(fe+2),Ce=""}if(!pe&&/^\*+$/.test(Ce))return A(U,U),u++,!0;const{node:$e}=Nu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),k($e),Ce&&(T({type:"text",content:Ce,raw:Ce}),u--),u++,!0}if(ye.type==="emphasis"){let fe=ye.index;fe===-1&&(fe=0);const ve=U.slice(0,fe);if(ve&&A(ve,ve),!fY(U,fe)){A(U[fe],U[fe]);const De=U.slice(fe+1);return De&&(T({type:"text",content:De,raw:De}),u--),u++,!0}const V=nd(U,fe),ee=pY(se,U,fe+1),pe=ee.index,Ce=e[u+1];if(o?.final&&Ce?.type==="em_open"&&pe!==-1&&U.slice(fe+1,pe).trim()!==U.slice(fe+1,pe)||pe===-1&&(ee.sawInvalidClose||o?.final||V.intraword||!dv(U[fe+1])))return A(U.slice(fe),U.slice(fe)),u++,!0;const{node:$e}=Vf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe>-1?U.slice(fe+1,pe):U.slice(fe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),k($e),pe!==-1&&pe<U.length-1){const De=U.slice(pe+1);De&&(T({type:"text",content:De,raw:De}),u--)}return u++,!0}return!1}function b(U,ae){if(!U.includes("`"))return!1;const j=(Ce=>{for(let $e=0;$e<Ce.length;$e++){if(Ce[$e]!=="`")continue;let De=0;for(let ge=$e-1;ge>=0&&Ce[ge]==="\\";ge--)De++;if(De%2===0)return $e}return-1})(U);if(j===-1)return!1;let J=1;for(let Ce=j+1;Ce<U.length&&U[Ce]==="`";Ce++)J++;const ye="`".repeat(J),fe=j+J,ve=U.indexOf(ye,fe);if(ve===-1){if(J===1){const $e=U.slice(0,j),De=U.slice(j+1);return $e&&(g($e,ae)?u--:A($e,$e)),m({type:"inline_code",code:De,raw:String(De)}),u++,!0}let Ce=U;for(let $e=u+1;$e<e.length;$e++)Ce+=String((e[$e].content??"")+(e[$e].markup??""));return u=e.length-1,A(Ce,Ce),u++,!0}p();const V=U.slice(0,j),ee=U.slice(j+J,ve),pe=U.slice(ve+J);return V&&(g(V,ae)?u--:A(V,V)),m({type:"inline_code",code:ee,raw:String(ee??"")}),pe&&(T({type:"text",content:pe,raw:pe}),u--),u++,!0}function v(U){const ae=l?.__markdownIt;if(!ae||e.length<=1||!e.some(ye=>ye?.type==="math_inline")||!sY.test(U))return null;const se=ae.parseInline(U,{__markstreamFinal:!!o?.final});if(!Array.isArray(se)||se.length===0)return null;const j=(se.find(ye=>ye?.type==="inline")?.children??[]).filter(ye=>!(ye?.type==="text"&&String(ye.content??"")===""));if(!j.length||!j.some(ye=>ye?.type!=="text")||j.length===1&&j[0]?.type==="text"&&String(j[0].content??"")===U)return null;const J=eo(j,U,n,o);return J.length?J:null}function m(U){p(),a.push(U)}function y(U){p();const ae=wa(U);a.push(ae)}function k(U){m(U)}function A(U,ae){c?(c.content+=U,c.raw+=ae??U):(c={type:"text",content:String(U??""),raw:String(ae??U??"")},a.push(c))}function $(U,ae){if(!U)return;const se=eo([{...ae,type:"text",content:U,raw:U}],U,n,o);if(se.length===1&&se[0]?.type==="text"){const j=se[0];A(String(j.content??""),String(j.raw??j.content??""));return}for(const j of se)k(j)}function L(U,ae){return String(U.markup??"").startsWith(ae)}function w(U){return U.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 E(U,ae){let se=U;const j=String(ae.content??"");return se.endsWith("\\")&&!L(ae,"\\\\")&&!j.endsWith("\\\\")&&(se=se.slice(0,-1)),se.endsWith("(")&&!L(ae,"\\(")&&!j.endsWith("\\(")&&(se=se.slice(0,-1)),/\*+$/.test(se)&&!L(ae,"\\*")&&!j.endsWith("\\*")&&(se=se.replace(/\*+$/,"")),se}for(;u<e.length;){const U=e[u];T(U)}function T(U){switch(U.type){case"text":S(U);break;case"softbreak":c?(c.content+=`
|
|
202
|
-
`,c.raw+=`
|
|
203
|
-
`):(c={type:"text",content:`
|
|
204
|
-
`,raw:`
|
|
205
|
-
`},a.push(c)),u++;break;case"code_inline":k(VG(U)),u++;break;case"html_inline":{const[ae,se]=qG(U,e,u,eo,t,n,o);k(ae),u=se;break}case"link_open":I(U);break;case"image":me(U)||(p(),k(U_(U)),u++);break;case"strong_open":{p();const{node:ae,nextIndex:se}=Nu(e,u,U.content,o);k(ae),u=se;break}case"em_open":{p();const{node:ae,nextIndex:se}=Vf(e,u,o);k(ae),u=se;break}case"s_open":{p();const{node:ae,nextIndex:se}=j_(e,u,o);k(ae),u=se;break}case"mark_open":{p();const{node:ae,nextIndex:se}=PG(e,u,o);k(ae),u=se;break}case"ins_open":{p();const{node:ae,nextIndex:se}=KG(e,u,o);k(ae),u=se;break}case"sub_open":{p();const{node:ae,nextIndex:se}=JG(e,u,o);k(ae),u=se;break}case"sup_open":{p();const{node:ae,nextIndex:se}=eY(e,u,o);k(ae),u=se;break}case"sub":p(),k({type:"subscript",children:[{type:"text",content:String(U.content??""),raw:String(U.content??"")}],raw:`~${String(U.content??"")}~`}),u++;break;case"sup":p(),k({type:"superscript",children:[{type:"text",content:String(U.content??""),raw:String(U.content??"")}],raw:`^${String(U.content??"")}^`}),u++;break;case"emoji":{p();const ae=e[u-1];ae?.type==="text"&&/\|:-+/.test(String(ae.content??""))?A("",""):k($G(U)),u++;break}case"checkbox":p(),k(IG(U)),u++;break;case"checkbox_input":p(),k(LG(U)),u++;break;case"footnote_ref":p(),k(BG(U)),u++;break;case"footnote_anchor":{p();const ae=U.meta??{};m({type:"footnote_anchor",id:String(ae.label??U.content??""),raw:String(U.content??"")}),u++;break}case"hardbreak":p(),k(DG()),u++;break;case"fence":p(),k(tk(e[u])),u++;break;case"math_inline":p(),!U.content&&U.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(k(q_({...U,content:e[u+1].content})),u+=2):k(q_(U)),u++;break;case"reference":D(U);break;case"text_special":A(String(U.content??""),String(U.content??"")),u++;break;default:{const ae=U;if(U.type==="link"&&ae.href!=null&&o?.validateLink&&!o.validateLink(String(ae.href))){p();const se=String(ae.text??"");A(se,se),u++}else ne(U)||z(U)||q(U)||W(U)||y(U),u++;break}}}function F(U,ae,se,j){const J=tY({...ae,content:U});if(c){c.content+=E(J.content,ae),c.raw+=J.raw;return}const ye=se?.tag==="br"&&e[u-2]?.content==="[";j||(J.content=E(J.content,ae)),c=J,c.center=ye,a.push(c)}function S(U){const ae=String(U.content??""),se=e.length===1&&ae.includes("\\")&&typeof t=="string"?String(t):"";let j=se?yY(se):ae.replace(iY,"$1");if(U.content==="<"||j==="1"&&e[u-1]?.tag==="br"){u++;return}const J=j.indexOf("$");J!==-1&&J===j.lastIndexOf("$")&&j.endsWith("$")&&(j=j.slice(0,-1)),j.endsWith("undefined")&&!t?.endsWith("undefined")&&(j=j.slice(0,-9));let ye=a.length,fe="";for(let pe=a.length-1;pe>=0;pe--){const Ce=a[pe];if(Ce.type!=="text")break;ye=pe,fe=String(Ce.content??"")+fe}ye<a.length&&(j.startsWith(fe)?(c=null,a.length=ye):c=a[a.length-1]);const ve=e[u+1];if((j==="`"||j==="|"||j==="$")&&!L(U,`\\${j}`)||/^\*+$/.test(j)&&!L(U,"\\*")){u++;return}if(!ve&&/[^\]]\s*\(\s*$/.test(j)&&(j=j.replace(/\(\s*$/,"")),!j){u++;return}if(ue(j)||ce(j))return;if(!(j.includes("*")||j.includes("_")||j.includes("~")||j.includes("`")||j.includes("[")||j.includes("!")||j.includes("$")||j.includes("|")||j.includes("("))){F(j,U,e[u-1],ve),u++;return}if(le(j))return;const V=e[u-1];if(j==="["&&!ve?.markup?.includes("*")&&!L(U,"\\[")||j==="]"&&!V?.markup?.includes("*")&&!L(U,"\\]")){u++;return}if(b(ae,U)||Le(j)||(e[u+1]?.type!=="link_open"||w(j))&&Ae(j,U))return;const ee=v(ae);if(ee){p();for(const pe of ee)k(pe);u++;return}g(j,U)||(F(j,U,V,ve),u++)}function I(U){if(P(U))return;if(de()){const{node:ve,nextIndex:V}=Kf(e,u,o),ee=String(ve.text||ve.href||"");A(ee,ee),u=V;return}p();const{node:ae,nextIndex:se}=Kf(e,u,o);u=se;const j=ae.text||ae.href||"";if(U.markup==="linkify"&&!W6(j,ae.href,t)&&gp(j,l?.__linkifyDemotionContext)){A(j,j);return}const J=ae.children.length===1&&ae.children[0]?.type==="text";if(ae.loading&&t&&ae.text===ae.href&&J){const ve=MY(t,ae.href);ve&&(ae.text=ve,ae.children=[{type:"text",content:ve,raw:ve}],ae.raw=`[${ve}](${ae.href}${ae.title?` "${ae.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(ae.href)){A(ae.text,ae.text);return}const ye=U.attrs?.find(([ve])=>ve==="href")?.[1],fe=String(ye??"");if(t&&fe){const ve=t.indexOf("](");if(ve!==-1){const V=t.indexOf(")",ve+2);V===-1?ae.loading=!0:ae.loading&&t.slice(ve+2,V).includes(fe)&&(ae.loading=!1)}}W(ae)||m(ae)}function P(U){if(U.markup!=="linkify")return!1;const{node:ae,nextIndex:se}=Kf(e,u,o);return R(ae,se)?(u=se,!0):!1}function D(U){p(),k(ZG(U)),u++}function W(U){if(U.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const se=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!se)return!1;const j=U,J=String(j.href??""),ye=String(j.text??""),fe=String(se[2]??""),ve=J.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!J||!(ye===J||ye===ve||AY(ye)))return!1;const V=String(se[1]??"");return V?(ae.content=V,ae.raw=V):a.pop(),m({...U,text:fe,children:[{type:"text",content:fe,raw:fe}],raw:`[${fe}](${J}${j.title?` "${j.title}"`:""})`}),!0}function z(U){if(U.type!=="link")return!1;const ae=U,se=String(ae.href??"");return se?R({href:se,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},u+1):!1}function R(U,ae){const se=a[a.length-1];if(se?.type!=="image"||se.src||!se.loading||!String(se.raw??"").endsWith("]("))return!1;const j=e[ae],J=String(j?.content??"");if(j?.type!=="text"||!J.startsWith(")"))return!1;a.pop(),c=null;const ye=String(se.alt??"");m({type:"image",src:U.href,alt:ye,title:U.title,raw:``,loading:!!U.loading});const fe=J.slice(1),ve=wa(j);return ve.content=fe,ve.raw=fe,h()[ae]=ve,!0}function q(U){if(U.type!=="link")return!1;const ae=a[a.length-1],se=e[u-1];if(!ae||ae.type!=="text"||se?.type!=="text")return!1;const j=String(ae.content??""),J=String(se.content??"");if(!j.endsWith("!")||!J.endsWith("!")||L(se,"\\!"))return!1;const ye=j.slice(0,-1);ye?(ae.content=ye,ae.raw=ye,c=ae):(a.pop(),c=null);const fe=U,ve=String(fe.text??fe.children?.map(pe=>String(pe?.content??pe?.raw??"")).join("")??""),V=String(fe.href??""),ee=fe.title==null||fe.title===""?null:String(fe.title);return m({type:"image",src:V,alt:ve,title:ee,raw:``,loading:!!fe.loading}),!0}function K(U,ae="",se=null){const j=String(U.alt??U.raw??"");return{type:"link",href:ae,title:se,text:j,children:[U],raw:`[${j}](${ae}${se?` "${se}"`:""})`,loading:!0}}function X(U){const ae=U.startsWith(";return{type:"image",src:"",alt:j===-1?se.replace(/\]$/,""):se.slice(0,j),title:null,raw:ae,loading:!0}}function ue(U){const ae=U.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&bY(t,ae,"["))return!1;const se=U.slice(0,ae);return se&&A(se,se),m(K(X(U.slice(ae+1)))),u++,!0}function me(U){if(o?.final)return!1;const ae=e[u-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||L(ae,"\\["))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 m(K(U_(U))),u++,!0}function ne(U){if(U.type!=="link")return!1;const ae=U,se=String(ae.raw??""),j=String(ae.text??"");if(!se.startsWith("[![")&&!j.startsWith("!["))return!1;const J=ae.title==null||ae.title===""?null:String(ae.title);return m(K({type:"image",src:String(ae.href??""),alt:j.replace(/^!\[/,"").replace(/\]$/,""),title:J,raw:se.startsWith("[)return!1;const ae=e[u-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&L(ae,"\\["))return!1;const se=a[a.length-1];if(se?.type!=="image"&&se?.type!=="link")return!1;const j=se,J=se?.type==="link"&&Array.isArray(j.children)&&j.children.length===1&&j.children[0]?.type==="image"?a.pop():null,ye=J?J.children[0]:a.pop();if(!ye||ye.type!=="image")return!1;const fe=e[u+1];let ve=String(J?.href??""),V=J?.title==null?null:String(J.title),ee=!0;if(fe?.type==="link_open"){const{node:Ce,nextIndex:$e}=Kf(e,u+1,o);ve=Ce.href,V=Ce.title,ee=!0,u=$e}else{if(ve=U.slice(2),ve.includes('"')){const Ce=ve.split('"');ve=String(Ce[0]??"").trim(),V=Ce[1]==null?null:String(Ce[1]).trim()}u++}const pe=K(ye,ve,V);return pe.loading=ee,m(pe),!0}function de(){const U=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&U?.type==="text"&&String(U.content??"").endsWith("[")&&L(U,"\\[")}function Ae(U,ae){const se=U.indexOf("[");if(se===-1)return!1;let j=U.slice(0,se);const J=U.indexOf("](",se);if(J!==-1){const ye=e[u+2];let fe=U.slice(se+1,J);if(fe.includes("[")){const De=fe.indexOf("[");j+=U.slice(0,se+De+1);const ge=se+De+1;fe=U.slice(ge+1,J)}const ve=e[u+1];if(U.endsWith("](")&&ve?.type==="link_open"&&ye){const De=e[u+4];let ge=4,Ne=!0;if(De?.type==="text"){const rt=String(De.content??"");if(rt.startsWith(")")){Ne=!1;const St=rt.slice(1);if(St){const vt=wa(De);vt.content=St,vt.raw=St,h()[u+4]=vt}else ge++}else rt==="."&&ge++}$(j,ae);const et=String(ye.content??"");return o?.validateLink&&!o.validateLink(et)?A(fe,fe):m({type:"link",href:et,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:Ne}),u+=ge,!0}const V=U.indexOf(")",J),ee=V!==-1?U.slice(J+2,V):"",pe=V===-1;let Ce=j.match(/\*+$/);if(Ce&&(j=j.replace(/\*+$/,"")),$(j,ae),Ce||(Ce=fe.match(/^\*+/)),!d&&Ce){const De=Ce[0].length;fe=fe.replace(/^\*+/,"").replace(/\*+$/,"");const ge=[];if(De===1?ge.push({type:"em_open",tag:"em",nesting:1}):De===2?ge.push({type:"strong_open",tag:"strong",nesting:1}):De===3&&(ge.push({type:"strong_open",tag:"strong",nesting:1}),ge.push({type:"em_open",tag:"em",nesting:1})),ge.push({type:"link",href:ee,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:pe}),De===1){ge.push({type:"em_close",tag:"em",nesting:-1});const{node:Ne}=Vf(ge,0,o);k(Ne)}else if(De===2){ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Nu(ge,0,void 0,o);k(Ne)}else if(De===3){ge.push({type:"em_close",tag:"em",nesting:-1}),ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Nu(ge,0,void 0,o);k(Ne)}else{const{node:Ne}=Vf(ge,0,o);k(Ne)}}else o?.validateLink&&!o.validateLink(ee)?A(fe,fe):m({type:"link",href:ee,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:pe});const $e=V!==-1?U.slice(V+1):"";return $e&&(T({type:"text",content:$e,raw:$e}),u--),u++,!0}return!1}function Le(U){const ae=U.indexOf("![");if(ae===-1)return!1;const se=U.slice(0,ae);return se&&!c?c={type:"text",content:se,raw:se}:se&&c&&(c.content+=se),c&&(a.push(c),c=null),m(X(U.slice(ae))),u++,!0}function le(U){if(!(U?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=U.slice(1).match(/[^\s\]]/);if(ae===null)return u++,!0;if(ae&&/x/i.test(ae[0])){const se=ae[0]==="x"||ae[0]==="X";return m({type:"checkbox_input",checked:se,raw:se?"[x]":"[ ]"}),u++,!0}return!1}return a}function EY(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 TY(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 NY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function ou(e,t,n){const o=e[t],s=[],i=Dl(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=NY(c)?wa(c):c,d=e[a-1];u!==c&&(TY(u),EY(u));const f=String(u.content??"");l.push({type:"paragraph",children:eo(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=su(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]=ou(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=sk(e,a,i.options(),ok);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(`
|
|
206
|
-
`)},r+1]}function IY(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Dl(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:eo(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]=ou(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=su(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Mm(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}
|
|
207
|
-
${r.map(c=>c.raw).join(`
|
|
208
|
-
`)}
|
|
209
|
-
:::`},a+1]}const LY=new Set(["warning","info","note","tip","danger","caution"]);function $Y(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 LY.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function FY(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=$Y(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Dl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let g=f.length-1;g>=0;g--){const b=f[g];if(b.type==="text"&&/:+/.test(b.content)){h=g;break}}const p={type:"paragraph",children:eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=ou(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=su(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Mm(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}
|
|
210
|
-
${l.map(d=>d.raw).join(`
|
|
211
|
-
`)}
|
|
212
|
-
:::`},c+1]}const OY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function RY(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=OY.exec(String(o.info??""));return s?IY(e,t,s,n):null}const ok={parseContainer:(e,t,n)=>FY(e,t,n),matchAdmonition:RY};function su(e,t,n){const o=[],s=Dl(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:eo(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]=ou(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=su(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=sk(e,i,s.options(),ok);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(`
|
|
213
|
-
`)},i+1]}function BY(e){if(e.info?.startsWith("diff"))return tk(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 DY(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Dl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=eo(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:eo(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(`
|
|
214
|
-
`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
|
|
215
|
-
`)},s+1]}function PY(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Dl(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:eo(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(`
|
|
216
|
-
`)}`},l+1]}function HY(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:eo(a.children||[],c,void 0,n),raw:c}}function WY(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=Jn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=Jn(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function cM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=Jn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Oa.has(n),l=Am(s),a=(o===-1?-1:WY(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
217
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function zY(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 UY(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function uM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function dM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return uM(n)?n:void 0}function qY(e,t,n){const o=dM(Kd(t),n);if(!uM(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function jY(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),g=UY(e[c].attrs),b=a.length,v=!f&&!r,m=v?s?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:eo(h.children||[],p,void 0,qY(n,m,v?u:void 0)),raw:p,align:g}),v&&(u=dM(u,Kd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
218
|
-
`)},o+1]}function VY(){return{type:"thematic_break",raw:"---"}}let T0=null;const N0=new WeakMap;function V_(){return T0||(T0={allowedTagSet:Tm(),customTagSet:null}),T0}function KY(e){if(!e||e.length===0)return V_();const t=N0.get(e);if(t)return t;const n=e.map(wi).filter(Boolean);if(!n.length){const s=V_();return N0.set(e,s),s}const o={allowedTagSet:Tm({customHtmlTags:e}),customTagSet:new Set(n)};return N0.set(e,o),o}function GY(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const g=p.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(h.startsWith("data-")){const g=h.slice(5);try{r[g]=JSON.parse(p)}catch{r[g]=p}}}const l=[],a=Dl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:eo(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=ou(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=su(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Mm(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
219
|
-
`,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
|
|
220
|
-
`),f+=`
|
|
221
|
-
`),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 YY(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function ZY(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function XY(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Gs(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=Jn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=Jn(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function QY(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Jn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const g=e.indexOf(">",p);if(g===-1)return null;if(u--,u===0){const b=g+1;return{raw:e.slice(r,b),end:b}}d=g+1;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function fv(e){return Number.isFinite(e)&&e>0?e:0}function JY(e,t){const n=fv(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
|
|
222
|
-
`&&(o++,o===n))return s+1;return e.length}function Mm(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[HY(e,t,n),t+3];case"code_block":return[BY(o),t+1];case"fence":return[tk(o),t+1];case"math_block":return[zY(o),t+1];case"html_block":{const s=cM(o),i=s.tag?KY(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)?JY(l,Number(o.map?.[0]??0)):0,u=QY(l,r,Math.max(fv(a),fv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=Jn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),g=f===-1?null:XY(d,r,f+1),b=g?.start??-1;let v="";f!==-1&&(b!==-1&&f<b?v=d.slice(f+1,b):v=d.slice(f+1)),b===-1&&(v=ZY(v,r));const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(h))!==null;){const $=k[1];if(!$||$.toLowerCase()===r)continue;const L=k[2]||k[3]||k[4]||"";m.push([$,L])}const A=!n?.final&&!p&&g==null;return[{type:r,tag:r,content:YY(v),raw:String(u?.raw??s.raw??d),loading:A,attrs:m.length?m:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=jY(e,t,n);return[s,i]}case"dl_open":{const[s,i]=DY(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=PY(e,t,n);return[s,i]}case"hr":return[VY(),t+1]}return null}function sk(e,t,n,o){const s=Mm(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 GY(e,t,n)}return null}function eZ(){return{type:"hardbreak",raw:`\\
|
|
223
|
-
`}}function tZ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:eo(o.children||[],s,void 0,n),raw:s}}const K_=new WeakMap,Em=new WeakMap,nZ=["$$","\\["];function Yc(){return typeof performance<"u"?performance.now():Date.now()}function ik(e,t,n){e&&(e[t]=(e[t]??0)+n)}function fM(e){return e.__timing}function I0(e,t,n){return t&&ik(t,"parseMarkdownToStructureTotalMs",Yc()-n),e}function G_(e,t,n){if(!n)return nS(e,t);const o=Yc(),s=nS(e,t);return ik(n,"processTokensMs",Yc()-o),s}function oZ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=nu(t);return n.length?new Set(n):null}function sZ(e,t){const n=e;let o=K_.get(n);o||(o=new Map,K_.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 iZ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gf(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]=ca(s.value,n))}}function ca(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(ca(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(ca(l,t),ca(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(ca(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),Gf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Gf(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),Gf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!iZ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Gf(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=ca(i[r],t);return s}function hM(e,t=!0){if(!t)return wa(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=>hM(a,t)):t&&r&&typeof r=="object"&&(l=ca(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function Y_(e,t=!0){return e.map(n=>hM(n,t))}function pM(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 rZ(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 lZ(e){Em.delete(e)}function aZ(e,t,n){Em.set(e,{source:t,key:n,pendingCandidate:n===null&&eM(t)})}function cZ(e){return e.endsWith("$")||e.endsWith("\\")}function uZ(e){const t=Math.max(e.lastIndexOf(`
|
|
224
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return nZ.some(o=>n.endsWith(o))}function dZ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||uZ(e)&&/[\r\n]/.test(t)):!1}function fZ(e,t){if(!K6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Em.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&&!dZ(s.source,l)&&!cZ(t)){s.source=t;return}}const i=AG(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),aZ(e,t,i)}function hZ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function pZ(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 L0(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&&pZ(e,t)}function Z_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function mZ(e){for(let t=0;t+5<e.length;t++)if(Z_(e,t)&&Z_(e,t+3)&&L0(e[t],e[t+3])&&L0(e[t+1],e[t+4])&&L0(e[t+2],e[t+5]))return!0;return!1}function gZ(e,t,n){return K6(e)&&eM(t)&&mZ(n)}function vZ(e){const t=Em.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function X_(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!pM(e,o)||(fZ(e,t),vZ(e)))return e.parse(t,n);const s=e.stream.parse(t,sZ(e,n));if(gZ(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!hZ(o))return s;const i=fM(o);if(!i)return Y_(s,!0);const r=Yc(),l=Y_(s,!0);return ik(i,"tokenCloneMs",Yc()-r),l}function Tm(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Td;const n=new Set(Td);for(const o of nu(t))o&&n.add(o);return n}function yZ(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 Q_(e){return{type:"paragraph",children:e,raw:e.map(yZ).join("")}}function J_(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=oZ(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(Q_(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(Q_(c)),a}function kZ(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 od(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function bZ(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*${Gs(t)}\s*>\s*$`,"i").test(n)}function rk(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${Gs(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Jn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Oa.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Gs(o)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const g=Jn(e.slice(p));if(g===-1)return null;u--;const b=p+g+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;const b=e.slice(p,p+g+1);/\/\s*>$/.test(b)||u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function xZ(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]===`
|
|
225
|
-
`){n++;continue}return-1}return o===t.length?n:-1}function wZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
226
|
-
</${t}>`}function eS(e){return e.replace(/\r\n/g,`
|
|
227
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function _Z(e,t,n){return n?e.includes(n,t)?!0:eS(e.slice(Math.max(0,t))).includes(eS(n)):!1}function SZ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
228
|
-
`&&n++,n):e[n]===`
|
|
229
|
-
`?n+1:t}function tS(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 CZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function lk(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Gs(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function mM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const AZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),MZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function EZ(e){return/\n\s*\n/.test(e)||MZ.test(e)}function TZ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>AZ.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(!EZ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function NZ(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"||N6.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Jn(l);if(a===-1)return s;const c=lk(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=sd(u,t,mM(n,o));return TZ(u,d)?{...s,children:d}:s})}function sd(e,t,n){return e.trim()?vM(e,t,{...n,__disableStreamParse:!0}):[]}function IZ(e,t,n){const o=sd(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function LZ(e,t,n){const o=cM({content:e}),s=Jn(e),i=lk(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=IZ(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function $Z(e,t,n){const o=Jn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=rk(s,"summary",0);if(!i)return sd(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...sd(r,t,n),LZ(i.raw,t,n),...sd(l,t,n)]}function gM(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=od(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!tS(c)){r.push(c);continue}const f=String(c.raw??od(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,g=-1;for(let q=a+1;q<e.length;q++){const K=e[q];if(tS(K)){p++;continue}if(CZ(K)&&(p--,p===0)){g=q;break}}const b=rk(t,"details",h),v=g===-1&&b?.closed===!0,m=v?(()=>{const q=lk(f,"details");return q!==-1?f.slice(0,q):f})():f,[y]=gM(v?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,o,s,h+f.length),k=$Z(m,n,mM(o,s)),A=g===-1?"</details>":String(e[g].raw??od(e[g])??"</details>"),$=v||g!==-1&&b?.closed===!0,L=A.replace(/[\t\r\n ]+$/,""),w=$?(()=>{const q=(b?.raw??"").lastIndexOf(L);return q===-1?t.length:h+q})():t.length,E=Jn(f),T=v&&E!==-1?h+E+1:h+f.length,F=t.slice(T,w===-1?t.length:w),S=n.parse(F,{__markstreamFinal:s}),I=n.renderer.render(S,n.options,{__markstreamFinal:s}),P=w+L.length,D=$?Math.max(w+A.length,SZ(t,P)):t.length,W=$?t.slice(w,D):A,z=$?t.slice(h,D):t.slice(h),R=v&&E!==-1?f.slice(0,E+1):f;if(r.push({...c,tag:"details",attrs:Am(f.slice(0,E+1)),raw:z,content:`${R}${I}${W}`,children:[...k,...y],loading:!s&&!$}),l=$?D:t.length,g===-1&&!v)break;g!==-1&&(a=g)}return[r,l]}function FZ(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=od(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=rk(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),h=wZ(u.raw,c,u.closed),p=!t&&!u.closed,g=d!==h||f!==u.raw||!!r.loading!==p,b=Jn(u.raw),v=b===-1?"":u.raw.slice(0,b+1),m=v?Am(v):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=m.length?m:void 0,!g)continue;let y=xZ(u.raw,f);y===-1&&(y=0);const k=i+1;for(;k<o.length;){if(u.closed&&bZ(o[k],c)){o.splice(k,1);continue}const A=od(o[k]);if(!A)break;const $=u.raw.indexOf(A,y);if($===-1){if(_Z(n,u.end,A))break;o.splice(k,1);continue}y=$+A.length,o.splice(k,1)}}return o}function OZ(e){const t=l=>l===" "||l===" "||l===`
|
|
230
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=g=>{const b=g.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=g=>{const b=g.charCodeAt(0);return b>=48&&b<=57},d=g=>g==="!"||c(g),f=g=>c(g)||u(g)||g===":"||g==="-",h=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=m=>m===" "||m===" ",h=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;const k=m[y];if(k!=="`"&&k!=="~")return null;let A=y;for(;A<m.length&&m[A]===k;)A++;const $=A-y;return $<3?null:{markerChar:k,markerLen:$,rest:m.slice(A)}},p=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;let k=!1;for(;y<m.length&&m[y]===">";)for(k=!0,y++;y<m.length&&f(m[y]);)y++;return k?m.slice(y):null},g=m=>{const y=h(m);if(y)return y;const k=p(m);return k==null?null:h(k)};let b=0;const v=l.split(/\r?\n/);for(const m of v){const y=b,k=b+m.length;if(a<y)break;const A=g(m);if(A){const $=A.markerChar,L=A.markerLen;c?$===u&&L>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=$,d=L)}if(a<=k)break;b=k+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===`
|
|
231
|
-
`||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]===`
|
|
232
|
-
`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function RZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const g=p.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let g=0;for(let b=0;b<p.length;b++){const v=p[b];if(v===" "){if(g++,g>=4)return!0;continue}if(v===" ")return!0;break}return!1},r=p=>{let g=!1,b=!1;for(let v=0;v<p.length;v++){const m=p[v];if(m==="\\"){v++;continue}if(!b&&m==="'"){g=!g;continue}if(!g&&m==='"'){b=!b;continue}if(!g&&!b&&m===">")return v}return-1},l=p=>{let g=0;for(;g<p.length&&o(p[g]);)g++;const b=p[g];if(b!=="`"&&b!=="~")return null;let v=g;for(;v<p.length&&p[v]===b;)v++;const m=v-g;return m<3?null:{markerChar:b,markerLen:m,rest:p.slice(v)}},a=(p,g)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let v=!1,m=0;for(;m<p.length;){const y=p[m];if(y!=="<"){o(y)||(v=!0),m++;continue}const k=r(p.slice(m));if(k===-1){v=!0,m++;continue}const A=p.slice(m,m+k+1);let $=1;for(;$<A.length&&o(A[$]);)$++;if($>=A.length){v=!0,m++;continue}const L=A[$];if(L==="!"||L==="?"){v=!0,m+=k+1;continue}if(L==="/"){v=!0,m+=k+1;continue}const w=$;for(;$<A.length&&s(A[$]);)$++;if($===w){v=!0,m++;continue}const E=A.slice(w,$).toLowerCase(),T=A[$];if(T&&T!==" "&&T!==" "&&T!==">"&&T!=="/"){v=!0,m++;continue}const F=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),S=/\/\s*>$/.test(A),I=F.test(p.slice(m+k+1)),P=F.test(e.slice(g+m+k+1)),D=/[\r\n]/.test(e.slice(g+m+k+1));if(v&&n.has(E)&&!S&&!I&&(P||D))return m;v=!0,m+=k+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
233
|
-
`,h),g=p!==-1,b=g&&p>h&&e[p-1]==="\r",v=g?b?p-1:p:e.length,m=e.slice(h,v),y=g?b?`\r
|
|
234
|
-
`:`
|
|
235
|
-
`:"",k=l(m);let A=m;if(!c&&!k){const $=a(m,h);if($!==-1){const L=y||`
|
|
236
|
-
`;A=`${m.slice(0,$).replace(/[ \t]+$/,"")}${L}${L}${m.slice($).replace(/^[ \t]+/,"")}`}}f+=A,f+=y,k&&(c?k.markerChar===u&&k.markerLen>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=k.markerChar,d=k.markerLen)),h=g?p+1:e.length}return f}function BZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const g=d[p];if(g==="\\"){p++;continue}if(!h&&g==="'"){f=!f;continue}if(!f&&g==='"'){h=!h;continue}if(!f&&!h&&g===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let b=g+1;for(;b<d.length&&o(d[b]);)b++;if(b>=d.length||d[b]!=="/"){g=d.indexOf("<",g+1);continue}for(b++;b<d.length&&o(d[b]);)b++;if(b+p.length>d.length){g=d.indexOf("<",g+1);continue}let v=!0;for(let y=0;y<p.length;y++){const k=d[b+y];if((k>="A"&&k<="Z"?String.fromCharCode(k.charCodeAt(0)+32):k)!==p[y]){v=!1;break}}if(!v){g=d.indexOf("<",g+1);continue}let m=b+p.length;if(m<d.length&&s(d[m])){g=d.indexOf("<",g+1);continue}for(;m<d.length&&o(d[m]);)m++;if(m<d.length&&d[m]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const g=r(d.slice(f));if(g===-1)return d;const b=f+g;if(l(d,b+1,p))return d;const v=i(d.slice(b+1));return v?`${d.slice(0,b+1)}
|
|
237
|
-
${v}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
238
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
239
|
-
`:`
|
|
240
|
-
`,u=d+1}return c}function DZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,g=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;g=h}return p?{prefix:f.slice(0,g),content:f.slice(g)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let g=h;for(;g<f.length&&f[g]===p;)g++;const b=g-h;return b<3?null:{markerChar:p,markerLen:b,rest:f.slice(g)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
241
|
-
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",g=h?p?f-1:f:e.length,b=e.slice(d,g),v=h?p?`\r
|
|
242
|
-
`:`
|
|
243
|
-
`:"",m=s(b),y=m?.prefix??"",k=m?.content??b,A=i(k);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let $=k;if(!l&&$.includes("</"))for(const L of r)$=$.replace(L,(w,E,T,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return w;const S=F.slice(0,T).replace(/^[\t ]+/,"");if(S.length>0){const I=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!P||I!==P)return w}return`${E}
|
|
244
|
-
|
|
245
|
-
`});if(y){const L=y+$.split(`
|
|
246
|
-
`).join(`
|
|
247
|
-
${y}`);u+=L}else u+=$;u+=v,d=h?f+1:e.length}return u}function PZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let I=0;for(let P=0;P<S.length;P++){const D=S[P];if(D===" "){if(I++,I>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,P=!1,D=0;for(;I<S.length;){for(;I<S.length&&o(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(P=!0,I++;I<S.length&&o(S[I]);)I++;D=I}if(!P)return null;const W=S.slice(0,D);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:S.slice(D)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const P=S[I];if(P!==" "&&P!==" ")return!1}return!0},u=S=>{if(s(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length||I[P]==="/"||I[P]==="!"||I[P]==="?")return"";const D=P;for(;P<I.length&&i(I[P]);)P++;if(P===D)return"";const W=I.slice(D,P).toLowerCase();if(!n.has(W))return"";const z=I[P];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":W},d=S=>{if(s(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length)return null;const D=I[P]==="/";if(D)for(P++;P<I.length&&o(I[P]);)P++;const W=I[P];if(!W||W==="!"||W==="?")return null;const z=P;for(;P<I.length&&i(I[P]);)P++;if(P===z)return null;const R=I.slice(z,P).toLowerCase();if(!n.has(R))return null;const q=I[P];if(q&&q!==" "&&q!==" "&&q!==">"&&q!=="/")return null;if(D)return{type:"close",name:R};if(/\/\s*>\s*$/.test(I))return{type:"open",name:R,complete:!0};const K=I.indexOf(">",P);if(K!==-1){const X=I.slice(K+1);if(new RegExp(`<\\s*\\/\\s*${R}\\s*>`,"i").test(X))return{type:"open",name:R,complete:!0}}return{type:"open",name:R,complete:!1}},f=S=>{if(s(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const P=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const D=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const W=D[1].toLowerCase();return W===D[2].toLowerCase()?W:null};let h=!1,p="",g=0;const b=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;const P=S[I];if(P!=="`"&&P!=="~")return null;let D=I;for(;D<S.length&&S[D]===P;)D++;const W=D-I;return W<3?null:{markerChar:P,markerLen:W,rest:S.slice(D)}},v=S=>b(S),m=S=>{const I=r(S);return I?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},y=(S,I,P)=>{let D=S,W=0;for(;D<e.length;){const z=e.indexOf(`
|
|
248
|
-
`,D),R=z!==-1,q=R&&z>D&&e[z-1]==="\r",K=R?q?z-1:z:e.length,X=e.slice(D,K),ue=l(X),me=ue?.key??"";if(W>0&&I&&me!==I)break;const ne=ue?.content??X,ce=d(ne);if(ce?.name===P){if(ce.type==="open")ce.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(ne)||m(ne)))return!0;if(R)D=z+1;else break}return!1};let k="",A=0,$=!0,L=!1,w=!1,E=`
|
|
249
|
-
`;const T=[];let F="";for(;A<e.length;){const S=e.indexOf(`
|
|
250
|
-
`,A),I=S!==-1,P=I&&S>A&&e[S-1]==="\r",D=I?P?S-1:S:e.length,W=e.slice(A,D),z=I?P?`\r
|
|
251
|
-
`:`
|
|
252
|
-
`:"",R=l(W),q=R?.key??"",K=R?.content??W,X=v(K);X&&(h?X.markerChar===p&&X.markerLen>=g&&/^\s*$/.test(X.rest)&&(h=!1,p="",g=0):(h=!0,p=X.markerChar,g=X.markerLen));const ue=T.length>0;if(!h&&!ue){const ne=u(K),ce=!!ne&&!$&&L&&w&&y(A,q,ne);ne&&!$&&(!L||ce)&&(q&&F&&q===F?k+=`${q}${E}`:q||(k+=E))}if(k+=W,k+=z,z&&(E=z),!h){const ne=d(K);if(ne){if(ne.type==="open")ne.complete||T.push(ne.name);else for(let ce=T.length-1;ce>=0;ce--)if(T[ce]===ne.name){T.length=ce;break}}}const me=c(K);$=me,L=!me&&a(K),w=!me&&!!f(K),F=q,A=I?S+1:e.length}return k}function vM(e,t,n={}){const o=fM(n),s=o?Yc():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(rZ(t,n)&&(t.stream.reset(),lZ(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
|
|
253
|
-
`)?`
|
|
254
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
|
|
255
|
-
`)?`
|
|
256
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
|
|
257
|
-
`)?`
|
|
258
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
259
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
|
|
260
|
-
`)?`
|
|
261
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,v,m)=>`${v}${m.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
|
|
262
|
-
`)?`
|
|
263
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
264
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const b=nu(n.customHtmlTags);if(b.length&&(r=RZ(r,b),r=BZ(r,b),r=PZ(r,b),r=DZ(r,b),r.includes("</")))for(const v of b){const m=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(m,"$1$2$2")}}i||(r=OZ(r));const l=kZ(r);if(l){const b=n.preTransformTokens,v=n.postTransformTokens;if(pM(t,n)||typeof b=="function"||typeof v=="function"){const m=X_(t,r,{__markstreamFinal:i},n),y=typeof b=="function"&&b(m)||m;typeof v=="function"&&v(y)}return I0(l,o,s)}const a=X_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return I0([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=G_(d,p,o);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const v=b[0],m=v?.type;v&&typeof m=="string"?g=G_(b,void 0,o):g=b}}if(g=FZ(g,i,r),g=gM(g,r,t,n,i)[0],g=NZ(g,t,n,i),i){const b=new WeakSet,v=m=>{if(!m||typeof m!="object"||b.has(m))return;if(b.add(m),Array.isArray(m)){for(const k of m)v(k);return}const y=m;y.type==="html_block"&&y.loading===!0&&(y.loading=!1);for(const k of Object.values(y))v(k)};v(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),I0(g,o,s)}function nS(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Dl(t);let s=0;for(;s<e.length;){const i=sk(e,s,o.options(),ok);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=tZ(e,s,o.options(l)),c=J_(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]=ou(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=su(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(eZ()),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=eo(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=J_(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const HZ=new Set([...Vd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),WZ=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"]),oS=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function sS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zZ(e){return typeof e=="string"?e:e==null?"":String(e)}function yM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function gl(e){return zZ(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function kM(e){return gl(e).replace(/`/g,"`")}function Nm(e){return String(e??"").trim().toLowerCase()}function ak(e,t="safe"){const n=Nm(e);return n?t==="escape"?!0:t==="trusted"?Vd.has(n):!WZ.has(n):!1}function bM(e,t="safe"){const n=Nm(e);return n?t==="escape"?!0:t==="trusted"?Vd.has(n):HZ.has(n):!1}function iS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${kM(o)}"`).join("")}function UZ(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||xa(s,{tagName:t,attrName:"srcset"})})}function xM(e,t,n,o){return AV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?UZ(t,o):!!(MV.has(e)&&t&&xa(t,{tagName:o,attrName:e}))}function ua(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function wM(e,t,n,o=!1){if(t!=="safe"||Nm(n)!=="a")return e;const s=ua(e,"href");if(o&&(!s||!e[s])){const a=ua(e,"target"),c=ua(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=ua(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=ua(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 rS(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!yM(r)||xM(l,i,t,n)||(o[r]=i)}return wM(o,t,n,!!ua(e,"href"))}function _M(e,t){const n=e.toLowerCase();return T6.has(n)?!1:sS(t,n)||sS(t,e)}function ck(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!yM(r)||xM(l,i,t,n)||(o[r]=i)}return wM(o,t,n,!!ua(e,"href"))}function xp(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 hv(e,t="safe",n){const o=ck(xp(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function qZ(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 jZ(e){const t={};for(const[n,o]of Object.entries(e))t[n]=qZ(o,n);return t}function lS(e){return e.trim().length>0}function VZ(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);lS(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);lS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Oa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function KZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Oa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function GZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${gl(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${gl(o)}`:` ${gl(o)}="${kM(s)}"`).join("");return e.type==="self_closing"?`<${gl(t)}${n} />`:`<${gl(t)}${n}>`}function YZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;oS.lastIndex=0;let n;for(;(n=oS.exec(e))!==null;)if(_M(n[1],t))return!0;return!1}function Bc(e,t="safe"){if(!e)return"";if(t==="escape")return gl(e);const n=KZ(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(gl(r.content??""));continue}const l=Nm(r.tagName);if(!l)continue;if(bM(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&ak(l,t)){s.push(GZ(r));continue}if(r.type==="self_closing"){s.push(`<${l}${iS(rS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${iS(rS(r.attrs??{},t,l))}>`),Oa.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 ZZ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],aS="http://www.w3.org/2000/svg",XZ=new Set(["script","style","iframe","object","embed","link","meta"]),QZ=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"]),JZ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),eX=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),tX=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function nX(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function oX(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function sX(e){const t=e.nodeName.toLowerCase();return t==="use"?nX(e):t==="image"?oX(e):t==="text"||t==="tspan"?!!e.textContent?.trim():tX.has(t)}function iX(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 rX(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")?xa(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?xa(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":xa(i,{tagName:o,attrName:s})?"":i:""}function lX(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 SM(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 CM(e){const t=SM(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=lX(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function cS(e){const t=SM(e);return ZZ.some(n=>n.test(t))||CM(t)}function aX(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 Yf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function AM(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!XZ.has(o)){if(o==="br"){t.push(`
|
|
265
|
-
`);return}for(const s of Array.from(n.childNodes))AM(s,t)}}function cX(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];AM(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=Yf(t.getAttribute("width")),i=Yf(t.getAttribute("height")),r=Yf(t.getAttribute("x")),l=Yf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(aS,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(aS,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function uX(e){cX(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!QZ.has(o)){n.remove();continue}if(o==="style"&&cS(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&&cS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(JZ.has(r)&&i.value){const l=rX(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(eX.has(r)&&i.value&&CM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=iX(i.value);l!==i.value&&n.setAttribute(i.name,l)}}aX(n)}}function Gwe(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 uX(n),dX(n)?null:n}catch{return null}}function dX(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){sX(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 uS=[];function $0(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function fX(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function hX(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function dS(e=`editor-${Date.now()}`,t={}){const n=NG(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=h=>f[h]??o[h]??h}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...g]=h;typeof p=="function"&&n.use(p,...g)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(uS.length)for(const f of uS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(GW),n.use(XW),n.use(jW);const i=dz,r=i.default??i;n.use(r),n.use(qW),n.use(UW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,g=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const v of h.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const m=v.map[0],y=v.map[1],k=v.markup,A=k[0],$=k.length,L=b[Math.max(0,y-1)]??"";let w=0;for(;w<L.length&&(L[w]===" "||L[w]===" ");)w++;let E=0;for(;w+E<L.length&&L[w+E]===A;)E++;let T=w+E;for(;T<L.length&&(L[T]===" "||L[T]===" ");)T++;const F=g?!0:y>m+1&&E>=$&&T===L.length,S=v;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,g=p.pos;if(p.src[g]!=="~")return!1;const b=p.src[g-1],v=p.src[g+1];if(/\d/.test(b)&&/\d/.test(v)){if(!h){const m=p.push("text","",0);m.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],g=String(p.info??"").trim(),b=String(p.content??""),v=btoa(unescape(encodeURIComponent(b))),m=fX(g),y=$0(m),k=hX(`editor-${e}-${h}-${m}`),A=$0(s("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${y}" id="${k}">
|
|
266
|
-
<div class="code-header">
|
|
267
|
-
<span class="code-lang">${$0(m.toUpperCase())}</span>
|
|
268
|
-
<button class="copy-button" data-code="${v}">${A}</button>
|
|
269
|
-
</div>
|
|
270
|
-
<div class="code-editor"></div>
|
|
271
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const g=a.exec(p.src.slice(p.pos));if(!g)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=p.src.slice(p.pos+g[0].length);if(v.startsWith("](")||v.startsWith("(")||u(v))return!1;if(!h){const m=g[1],y=p.push("reference","span",0);y.content=m,y.markup=g[0],y.raw=g[0]}return p.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const g=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}function pX({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 MM({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}:pX({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const fS=new WeakMap;function mX(e){let t=fS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},fS.set(e,t)),t}function hS(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 uk(e){return!!(e.themes?.length||e.langs?.length)}function EM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function gX(e,t){return!t?.length||e.registeredAllLangs?!0:EM(e.registeredLangs,t)}function F0(e,t){return uk(t)&&EM(e.registeredThemes,t.themes)&&gX(e,t.langs)}function vX(e,t){if(!uk(t))return t;const n=hS(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:hS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const yX={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 kX(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function TM(e){const t=kX(e);return yX[t]??t}function NM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>TM(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function IM(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 bX(e){return IM(e)?.join("\0")??""}function LM(e,t){const n=IM(e),o=NM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function wp(e,t){return`${bX(e)}\0\0${NM(t)?.join("\0")??""}`}function Ywe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=LM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:wp(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Zwe(e,t={},n){if(!e)return"ready";const o=LM(t.themes,t.langs),s=wp(o.themes,o.langs),i=n&&n===s?n:s,r=mX(e);if(r.completed.has(i))return"ready";if(F0(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)||F0(r,o))return r.completed.add(i),"ready";const c=vX(r,o),u=wp(c.themes,c.langs);return r.completed.has(u)||F0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(uk(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 tc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function pS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var xX=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=mS();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=mS();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,g=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=CX(p/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const v=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),m=SX(this.source.slice(this.visible.length),v,this.segmenter);m.text&&(this.visible+=m.text,this.charBudget=Math.max(0,this.charBudget-m.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=tc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,tc(o,1e3,1)),this.normalizedTargetLatencyMs=tc(s,900,1),this.normalizedCatchUpLatencyMs=tc(i,350,1),this.normalizedCatchUpThreshold=pS(r,600),this.normalizedStartDelayMs=pS(a,80),this.maxCommitFps=Math.trunc(tc(l,30,1)),this.maxCharsPerCommit=Math.trunc(tc(c,80,1)),this.flushOnFinish=u,this.segmenter=_X(),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 wX(e={},t){const n=new xX(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 _X(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function SX(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 mS(){return typeof performance<"u"?performance.now():Date.now()}function CX(e,t,n){return Math.min(n,Math.max(t,e))}var AX=(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 pv=Symbol.for("markstream-vue:node-lifecycle"),gS='<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>',vS='<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>',MX={id:"material",core:{"":vS,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:vS,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:gS,csharp:gS,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:()=>ms(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},mv=new Map;let yS="material";const wc=new Map,kS=new Map;let gv=null;function EX(e){mv.set(e.id,e)}function TX(e){return AX(this,null,function*(){var t,n,o;if(wc.has(e.id))return(t=wc.get(e.id))!=null?t:null;let s=kS.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(wc.set(e.id,i),gv?.(),i)).catch(()=>(wc.set(e.id,null),null)),kS.set(e.id,s)),s})}const NX=La(0);gv=()=>{NX.value++},EX(MX);const IX={"":"",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 dk(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=IX[n])!=null?t:n}function Xwe(e){const t=dk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Qwe(e){return(function(o){const s=mv.get(yS);if(!s)return;const i=s.core[o];if(i)return i;const r=wc.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!wc.has(s.id)&&TX(s)})(dk(e))||((n=(t=mv.get(yS))==null?void 0:t.fallback)!=null?n:"");var t,n}const Jwe={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 $M=!1;function e_e(){return $M}function t_e(){$M=!0}var Im=(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 js=null,xh=!1,Lm=hk;function $m(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function fk(){try{const e=globalThis;return $m(e?.katex)}catch{return null}}function hk(){return Im(null,null,function*(){const e=fk();if(e)return e;const t=yield ms(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ms(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return $m(t)})}function LX(e){Lm=e,js=null,xh=!1}function $X(e){LX(hk)}function FM(){return typeof Lm=="function"}function n_e(){var e;const t=Lm;if(!t||t===hk)return null;if(js)return js;const n=fk();if(n)return js=n,js;try{const o=t();return o&&typeof o?.then!="function"?(js=(e=$m(o))!=null?e:o,js):null}catch{return null}}function pk(){return Im(this,null,function*(){var e;const t=fk();if(t)return js=t,js;if(js)return js;if(xh)return null;const n=Lm;if(!n)return xh=!0,null;try{const o=yield n();if(o)return js=(e=$m(o))!=null?e:o,js}catch{}return xh=!0,null})}function OM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let kl=null,hl=null;const pi=new Map,Lr=new Map;let _p=5;const ma=new Set;function $d(){if(pi.size<_p&&ma.size){const e=Array.from(ma);ma.clear();for(const t of e)try{t()}catch{}}}function FX(e){kl=e,hl=null,kl.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=pi.get(n);if(i)if(pi.delete(n),clearTimeout(i.timeoutId),$d(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Lr.set(a,o),Lr.size>200){const c=Lr.keys().next().value;Lr.delete(c)}}i.resolve(o)}},kl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of pi.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));pi.clear(),$d()}}function OX(){var e;kl&&((e=kl.terminate)==null||e.call(kl)),kl=null,hl=null}function RX(e,t=!0,n=2e3,o){return Im(this,null,function*(){performance.now();const s=OM(e);if(!FM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(hl)return Promise.reject(hl);const i=`${t?"d":"i"}:${s}`,r=Lr.get(i);if(r)return Promise.resolve(r);const l=kl||(hl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),hl.name="WorkerInitError",hl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(hl);if(pi.size>=_p){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=pi.size,a.max=_p,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{pi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),$d()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),pi.has(u)&&pi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),$d()},{once:!0});const f=a,h=c;pi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function o_e(e,t=!0,n){const o=`${t?"d":"i"}:${OM(e)}`;if(Lr.set(o,n),Lr.size>200){const s=Lr.keys().next().value;Lr.delete(s)}}const BX="WORKER_BUSY";function DX(e=2e3,t){return pi.size<_p?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),ma.delete(r),n())};if(ma.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,ma.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>$d()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),ma.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Iu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function s_e(e){return Im(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!FM()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(s=o.timeout)!=null?s:Iu.timeout,c=(i=o.waitTimeout)!=null?i:Iu.waitTimeout,u=(r=o.backoffMs)!=null?r:Iu.backoffMs,d=(l=o.maxRetries)!=null?l:Iu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Iu.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield RX(t,n,a,h)}catch(g){if(g?.code!==BX||p>=f)throw g;if(p++,yield DX(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function _c(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function PX(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 vv(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=PX(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 yv(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function RM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function kv(e,t=360,n=500){return RM(e,t,n)}function bv(e,t=360,n=500){return RM(e,t,n)}var HX=Object.defineProperty,WX=Object.defineProperties,zX=Object.getOwnPropertyDescriptors,bS=Object.getOwnPropertySymbols,UX=Object.prototype.hasOwnProperty,qX=Object.prototype.propertyIsEnumerable,xS=(e,t,n)=>t in e?HX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BM=(e,t)=>{for(var n in t||(t={}))UX.call(t,n)&&xS(e,n,t[n]);if(bS)for(var n of bS(t))qX.call(t,n)&&xS(e,n,t[n]);return e},mk=(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 gk=()=>ms(()=>import("./mermaid.core-WG0zjqjP.js").then(e=>e.bn),[]);let yr=null,vk=gk;function jX(e){vk=e,yr=null}function VX(e){jX(gk)}function KX(){return typeof vk=="function"}function wS(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=BM({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},WX(n,zX(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function _S(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=BM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function i_e(){return mk(this,null,function*(){if(yr)return yr;const e=(function(){try{const o=globalThis;return wS(o?.mermaid)}catch{return null}})();if(e)return yr=e,_S(yr),yr;const t=vk;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===gk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(yr=wS(n),_S(yr),yr):null})}let hs=null,pl=null;const qo=new Map;let SS=5,CS=!1;const GX="WORKER_BUSY",YX="MERMAID_DISABLED";function ZX(e){hs=e,pl=null;const t=e;hs.onmessage=n=>{if(hs!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=qo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},hs.onerror=n=>{var o,s;if(hs===t)if(qo.size!==0){try{CS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of qo.entries())r.reject(new Error(`Worker error: ${n.message}`));qo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},hs.onmessageerror=n=>{var o,s;if(hs===t)if(qo.size!==0){try{CS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of qo.entries())r.reject(new Error("Worker messageerror"));qo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function XX(){var e;if(hs)try{for(const[t,n]of qo.entries())n.reject(new Error("Worker cleared"));qo.clear(),(e=hs.terminate)==null||e.call(hs)}catch{}hs=null,pl=null}function DM(e,t,n=1400){if(!KX()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=YX,Promise.reject(s)}if(pl)return Promise.reject(pl);const o=hs||(pl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),pl.name="WorkerInitError",pl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(pl);if(qo.size>=SS){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=GX,s.inFlight=qo.size,s.max=SS,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),qo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};qo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return qo.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=qo.get(r);f&&f.reject(d)},n)})}function r_e(e,t,n=1400){return mk(this,null,function*(){try{return yield DM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function l_e(e,t,n=1400){return mk(this,null,function*(){try{return yield DM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function a_e(){if(hs)try{for(const[e,t]of qo.entries())t.reject(new Error("Worker terminated"));qo.clear(),hs.terminate()}finally{hs=null}}var QX=Object.defineProperty,JX=Object.defineProperties,eQ=Object.getOwnPropertyDescriptors,AS=Object.getOwnPropertySymbols,tQ=Object.prototype.hasOwnProperty,nQ=Object.prototype.propertyIsEnumerable,MS=(e,t,n)=>t in e?QX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))tQ.call(t,n)&&MS(e,n,t[n]);if(AS)for(var n of AS(t))nQ.call(t,n)&&MS(e,n,t[n]);return e},Bt=(e,t)=>JX(e,eQ(t)),Qn=(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 oQ="__global__",O0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",xv=(()=>{const e=globalThis;if(e[O0])return e[O0];const t={scopedCustomComponents:{},revision:La(0)};return e[O0]=t,t})(),ES=xv.revision,sQ=Symbol("markstreamCustomComponents"),iQ=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 Yd(e){return iQ.has(String(e).trim().toLowerCase())}function rQ(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function R0(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([wi(n),wi(rQ(n))]))!s||Yd(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function _o(e){const t=jt(sQ,null);return B(()=>{var n;return ES.value,(function(o,s={}){return ES.value,lt(lt(lt({},R0(xv.scopedCustomComponents[oQ]||{})),R0(s)),R0((function(i){return i&&xv.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const lQ=["aria-label"],aQ={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"},cQ={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"},vn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ys=vn(Ze({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),N("svg",cQ,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),N("svg",aQ,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,lQ))}),[["__scopeId","data-v-be21ab83"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const uQ={class:"emoji-node"},$s=vn(Ze({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),N("span",uQ,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);$s.install=e=>{e.component($s.__name,$s)};const dQ=["id"],fQ=["title"],Zs=vn(Ze({__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)=>(x(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,fQ)],8,dQ))}}),[["__scopeId","data-v-c1463a29"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const PM=(()=>{try{return!1}catch{}return!1})();function B0(e){PM&&console.warn(e)}function TS(e,t="safe",n){return ck(e,t,n)}function HM(e){return jZ(e)}function D0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function yk(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=hv((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),D0(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),D0(r.value)]):Object.entries(s).map(([r,l])=>[r,D0(l)]):null,t,n);var s;if(!o)return;const i=HM(xp(o));return Object.keys(i).length>0?i:void 0}function NS(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 Lu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function P0(e,t,n,o,s,i,r=!1){const l=(function(d,f){return _M(d,f)})(e,o);if(Vd.has(e.toLowerCase())||!l&&bM(e,i))return null;if(!l&&ak(e,i))return r?[NS(e,t,!0)]:[NS(e,t),...n,`</${e}>`];const a=ck(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=HM(a);return gn(d,Bt(lt({},f),{key:u}),n.length>0?n:void 0)}return gn(e,Bt(lt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function WM(e,t){return YZ(e,t)}function Sp(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=P0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Lu(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),g=P0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Lu(c[c.length-1].children,g):Lu(u,g),p.tagName.toLowerCase()!==f&&c.length>h&&B0(`Auto-closing unclosed tag: <${p.tagName}>`)}else B0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=P0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Lu(c[c.length-1].children,f):Lu(u,f),B0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(VZ(e),t,n)}catch(s){return o=s,PM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const hQ=["innerHTML"],Xs=vn(Ze({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),o=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=_o(()=>t.customId),i=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Bc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Sp(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!WM(l,s.value))return{mode:"html",content:Bc(l,o.value)};const a=Sp(l,s.value,o.value);return a===null?{mode:"html",content:Bc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),N("span",{key:0,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ie(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),N("span",{key:1,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(x(),N("span",{key:2,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,hQ))}}),[["__scopeId","data-v-d17f12b0"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const pQ={class:"inline-code"},mQ={key:0},os=vn(Ze({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Wd(),o=jt("markstreamFade",void 0),s=jt("markstreamTextStreamState",void 0),i=jt("markstreamStreamVersion",void 0),r=B(()=>{const m=n.fade;return m===""||m===!0||m==="true"||m!==!1&&m!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var m;return String((m=t.node.code)!=null?m:"")}),c=B(()=>!l.value),u=B(()=>{var m;const y=(m=n["index-key"])!=null?m:n.indexKey;return y==null||y===""?"":String(y)}),d=Z(t.node.code),f=Z("");let h=i?.value;const p=Z(0);function g(){return d.value+f.value}function b(){f.value&&(d.value=g(),f.value="")}Je([()=>t.node.code,u,l,()=>i?.value],([m,y,k,A])=>{const $=String(m??""),L=u.value,w=A!==h;h=A;const E=MM({nextContent:$,persistedContent:L?s?.get(L):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:w});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(p.value+=1),L&&s?.set(L,$)},{immediate:!0}),Je(l,m=>{var y;m||(y=g(),d.value=y,f.value="")});const v=B(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(m,y)=>(x(),N("code",pQ,[c.value?(x(),N(Pe,{key:0},[Xe(O(a.value),1)],64)):(x(),N(Pe,{key:1},[d.value?(x(),N("span",mQ,O(d.value),1)):re("",!0),f.value?(x(),N("span",{key:1,class:We(["inline-code-stream-delta",[v.value]]),onAnimationend:b},O(f.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);os.install=e=>{e.component(os.__name,os)};const wv=Z(!1),IS=Z(""),LS=Z("top"),id=Z(null),rd=Z(null),_v=Z(null),Sv=Z(null),$S=Z(null);let wh=null,_h=null,Cv=0;function zM(){wh&&(clearTimeout(wh),wh=null),_h&&(clearTimeout(_h),_h=null)}let Zf=!1,Xf=null,FS=!1;function gQ(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Cv;zM();const l=()=>Qn(null,null,function*(){var a,c;if(yield(function(){return Qn(this,null,function*(){if(!Zf&&!FS&&typeof document<"u"){Xf!=null||(Xf=Qn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ms(()=>import("./vue.runtime.esm-bundler-ChfQpT4C.js"),[]),ms(()=>import("./Tooltip-Cw3lx-z8.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:wv.value,"anchor-el":id.value,content:IS.value,placement:LS.value,id:rd.value,originX:_v.value,originY:Sv.value,isDark:(p=$S.value)!=null?p:void 0})}}).mount(h),Zf=!0}));try{yield Xf}catch(u){Zf=!1,Xf=null,FS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Zf&&r===Cv){rd.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,id.value=e,IS.value=t,LS.value=n,_v.value=(a=s?.x)!=null?a:null,Sv.value=(c=s?.y)!=null?c:null,$S.value=typeof i=="boolean"?i:null,wv.value=!0;try{e.setAttribute("aria-describedby",rd.value)}catch{}}});o?l():wh=setTimeout(l,80)}function vQ(e=!1){Cv+=1,zM();const t=()=>{if(id.value&&rd.value)try{id.value.removeAttribute("aria-describedby")}catch{}wv.value=!1,id.value=null,rd.value=null,_v.value=null,Sv.value=null};e?t():_h=setTimeout(t,120)}const Av={"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..."},Mv=e=>{var t;return(t=Av[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 OS(e){return{t(t){if(e.te&&Av[t]&&!e.te(t))return Mv(t);const n=e.t(t);return n===t&&Av[t]?Mv(t):n}}}function yQ(){const e=(function(){var t,n;try{const o=Zo(),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 OS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return OS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Mv}}function kQ(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 bQ=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],xQ={key:1,class:"image-placeholder"},wQ={key:1,class:"image-node__raw-text"},_Q={key:0,class:"image-shimmer-overlay"},SQ={key:1,class:"image-node__raw-text"},CQ={key:2,class:"image-error"},Sl=vn(Ze({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,s=Z(!1),i=Z(!1),r=Z(""),l=Z("primary"),a=Z(null),c=Wd(),u=jt(pv,null);let d="",f=null;const h=B(()=>m_(n.node.src)),p=B(()=>m_(n.fallbackSrc)),g=B(()=>r.value),b=B(()=>!n.lazy),v=B(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),m=B(()=>l.value==="failed"),y=B(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),k=B(()=>kQ(n,c));function A(P=k.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function $(P=k.value){P&>(()=>{A(P)})}function L(){f&&(clearTimeout(f),f=null)}function w(){const P=k.value;P&&d!==P&&(d&&u?.markSettled(d),L(),d=P,u?.markPending(P),typeof window<"u"&&(f=window.setTimeout(()=>{d===P&&($(P),E())},8e3)))}function E(){return Qn(this,null,function*(){const P=d;P&&(L(),d="",yield gt(),A(P),u?.markSettled(P))})}function T(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,s.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,o("error",r.value),$()}function F(){s.value=!0,i.value=!1,o("load",g.value),$()}function S(P){P.preventDefault(),s.value&&!i.value&&o("click",[P,g.value])}const{t:I}=yQ();return Je([h,p,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Je([v,s,i,g,()=>n.lazy],([P,D,W,z,R])=>P&&z&&!W?D?(E(),void $()):R?(w(),void $()):void(D||W||w()):(E(),void $()),{flush:"post",immediate:!0}),ho(()=>{(function(){const P=d;P&&(L(),d="",u?.markSettled(P))})()}),(P,D)=>{var W,z,R,q,K;return x(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[v.value?(x(),N("img",{key:0,src:g.value,alt:String((z=(W=n.node.alt)!=null?W:n.node.title)!=null?z:""),title:String((q=(R=n.node.title)!=null?R:n.node.alt)!=null?q:""),class:We(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(K=n.node.alt)!=null?K:C(I)("image.preview"),onError:T,onLoad:F,onClick:S},null,42,bQ)):re("",!0),e.node.loading&&!i.value?(x(),N("span",xQ,[n.usePlaceholder?$n(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),N("span",wQ,O(e.node.raw),1))])):re("",!0),ie(Tl,{name:"shimmer-fade"},{default:Ee(()=>[y.value&&!e.node.loading?(x(),N("span",_Q,[n.usePlaceholder?$n(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),N("span",SQ,O(e.node.raw),1))])):re("",!0)]),_:3}),m.value?(x(),N("span",CQ,[$n(P.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("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)),_("span",null,O(C(I)("image.loadError")),1)],!0)])):re("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Sl.install=e=>{e.component(Sl.__name,Sl)};const AQ={key:2},ir=Ze({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=_o(()=>t.customId),o=jt("markstreamHtmlPolicy",void 0),s=jt("markstreamNestedRendererProps",void 0),i=B(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=B(()=>{var p,g;const b=(p=s?.value)!=null?p:{};return Bt(lt({},b),{customId:(g=t.customId)!=null?g:b.customId,htmlPolicy:i.value})}),l=Li({loader:()=>Promise.resolve().then(()=>Ck),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!Yd(String(t.node.type)))),u=B(()=>c.value?yk(t.node,i.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=B(()=>{var p,g;return String((g=(p=t.node.content)!=null?p:t.node.raw)!=null?g:"")});return(p,g)=>a.value&&c.value?(x(),ke(Vo(a.value),kn({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:Ee(()=>[d.value?(x(),ke(C(l),kn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(x(),ke(C(l),kn({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"])):re("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),ke(Vo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),N("span",AQ,O(h.value),1)):re("",!0)}}),MQ=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],EQ={key:0,translate:"no",class:"markstream-pre__diff-code"},TQ={class:"markstream-pre__diff-number","aria-hidden":"true"},NQ={class:"markstream-pre__diff-content"},IQ={class:"markstream-pre__diff-content-inner"},LQ={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},$Q=["textContent"],qs=Ze({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=B(()=>{var S,I,P;const D=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((P=String(D).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=B(()=>`language-${n.value}`),s=B(()=>{var S,I,P,D,W;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(I=t.node)==null?void 0:I.code)!=null?P:""):(function(z,R){const q=String(z??"");return R?q:q.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((W=t.node)==null?void 0:W.loading)===!0)}),i=B(()=>s.value.split(/\r\n|\n|\r/)),r=B(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=B(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=B(()=>l.value&&t.diffInline===!0),c=B(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",P={}){const D=u(S);return{code:S,kind:D&&I!=="hunk"&&!P.preserveBlankKind?"context":I,empty:D}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function g(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const P=f(S),D=f(I),W=(function(ue,me){const ne=ue.length,ce=me.length;if((ne+1)*(ce+1)>15e5)return null;const de=ce+1,Ae=new Uint32Array((ne+1)*(ce+1));for(let ae=1;ae<=ne;ae++)for(let se=1;se<=ce;se++){const j=ae*de+se;if(ue[ae-1]===me[se-1])Ae[j]=Ae[(ae-1)*de+(se-1)]+1;else{const J=Ae[(ae-1)*de+se],ye=Ae[ae*de+(se-1)];Ae[j]=J>=ye?J:ye}}const Le=[];let le=ne,U=ce;for(;le>0&&U>0;)ue[le-1]===me[U-1]?(Le.push({originalIndex:le-1,modifiedIndex:U-1}),le--,U--):Ae[(le-1)*de+U]>=Ae[le*de+(U-1)]?le--:U--;return Le.reverse(),Le})(P,D);if(W){const ue=[];let me=0,ne=0;for(const ce of W){for(;me<ce.originalIndex;)ue.push(Bt(lt({},d(P[me],"removed",{preserveBlankKind:h(P,me)})),{key:`inline-removed-source-${me}`,number:""})),me++;for(;ne<ce.modifiedIndex;)ue.push(Bt(lt({},d(D[ne],"added",{preserveBlankKind:h(D,ne)})),{key:`inline-added-source-${ne}`,number:ne+1})),ne++;ue.push(Bt(lt({},d(D[ce.modifiedIndex])),{key:`inline-context-source-${ce.originalIndex}-${ce.modifiedIndex}`,number:ce.modifiedIndex+1})),me=ce.originalIndex+1,ne=ce.modifiedIndex+1}for(;me<P.length;)ue.push(Bt(lt({},d(P[me],"removed",{preserveBlankKind:h(P,me)})),{key:`inline-removed-source-${me}`,number:""})),me++;for(;ne<D.length;)ue.push(Bt(lt({},d(D[ne],"added",{preserveBlankKind:h(D,ne)})),{key:`inline-added-source-${ne}`,number:ne+1})),ne++;return ue}const z=[];let R=0,q=P.length-1,K=D.length-1;for(;R<=q&&R<=K&&P[R]===D[R];)z.push(Bt(lt({},d(D[R])),{key:`inline-prefix-${R}`,number:R+1})),R++;const X=[];for(;q>=R&&K>=R&&P[q]===D[K];)X.unshift(Bt(lt({},d(D[K])),{key:`inline-suffix-${K}`,number:K+1})),q--,K--;for(let ue=R;ue<=q;ue++)z.push(Bt(lt({},d(P[ue],"removed",{preserveBlankKind:h(P,ue)})),{key:`inline-removed-source-${ue}`,number:""}));for(let ue=R;ue<=K;ue++)z.push(Bt(lt({},d(D[ue],"added",{preserveBlankKind:h(D,ue)})),{key:`inline-added-source-${ue}`,number:ue+1}));return z.concat(X)}const v=B(()=>{var S,I,P,D;const W=(function(K){const X=K.some(me=>p(me)),ue=K.some(me=>g(me));return X&&ue||(function(){var me,ne,ce,de;if(n.value==="diff")return!0;const Ae=(de=(ce=String((ne=(me=t.node)==null?void 0:me.raw)!=null?ne:"").split(/\r?\n/,1)[0])==null?void 0:ce.trim())!=null?de:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ae)})()&&(X||ue)})(i.value),z=(function(){var K,X;return((K=t.node)==null?void 0:K.originalCode)!=null||((X=t.node)==null?void 0:X.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:W?(function(K){const X=[];let ue=1;for(const[me,ne]of K.entries())if(ne.startsWith("@@"))X.push(Bt(lt({},d(ne,"hunk")),{key:`inline-hunk-${me}`,number:""}));else if(p(ne))X.push(Bt(lt({},d(ne.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${me}`,number:""}));else if(g(ne))X.push(Bt(lt({},d(ne.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${me}`,number:ue++}));else{const ce=ne.startsWith(" ")?ne.slice(1):ne;X.push(Bt(lt({},d(ce)),{key:`inline-context-${me}`,number:ue})),ue++}return X})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!W&&z){const K=f((P=t.node)==null?void 0:P.originalCode),X=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((ue,me)=>{const ne=X[me]===ue?"context":"removed";return Bt(lt({},d(ue,ne,{preserveBlankKind:h(K,me)})),{key:`original-${me}`,number:me+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:X.map((ue,me)=>{const ne=K[me]===ue?"context":"added";return Bt(lt({},d(ue,ne,{preserveBlankKind:h(X,me)})),{key:`modified-${me}`,number:me+1})})}]}const R=[],q=[];for(const K of i.value)if(K.startsWith("@@"))R.push(d(K,"hunk")),q.push(d(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))R.push(d(K.slice(1),"removed",{preserveBlankKind:!0}));else if(K.startsWith("+")&&!K.startsWith("+++"))q.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const X=K.startsWith(" ")?K.slice(1):K;R.push(d(X)),q.push(d(X))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:R.map((K,X)=>Bt(lt({},K),{key:`original-${X}`,number:X+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:q.map((K,X)=>Bt(lt({},K),{key:`modified-${X}`,number:X+1}))}]}),m=B(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),y=Z(null),k=Z([]);let A=null,$=null;function L(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function w(S,I){var P;if(!S)return I;const D=S.querySelector(".markstream-pre__diff-content"),W=D?.getBoundingClientRect(),z=(P=W?.height)!=null?P:0;return Math.max(I,Math.ceil(z))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,I;A=null;const P=y.value;if(!P||!l.value)return void(k.value.length&&(k.value=[]));const D=(function(ue){const me=window.getComputedStyle(ue),ne=L(me.getPropertyValue("--markstream-pre-diff-line-height"));if(ne>0)return ne;const ce=L(me.lineHeight);return ce>0?ce:18})(P),W=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),R=Math.max(W.length,z.length),q=[];for(let ue=0;ue<R;ue++){const me=w((S=W[ue])!=null?S:null,D),ne=w((I=z[ue])!=null?I:null,D),ce=Math.max(D,me,ne);q.push({rowHeight:ce,originalHeight:me,modifiedHeight:ne})}var K,X;K=k.value,X=q,K.length===X.length&&K.every((ue,me)=>{const ne=X[me];return ne&&Math.abs(ue.rowHeight-ne.rowHeight)<=.5&&Math.abs(ue.originalHeight-ne.originalHeight)<=.5&&Math.abs(ue.modifiedHeight-ne.modifiedHeight)<=.5})||(k.value=q)})()}))}function T(S){$?.disconnect(),$=null,S&&l.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{E()}),$.observe(S))}function F(S,I){const P=k.value[S];if(!P)return;const D=I==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Je(y,S=>{T(S),gt(()=>E())},{flush:"post"}),Je([l,v],()=>{T(y.value),gt(()=>E())},{flush:"post",immediate:!0}),ho(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),$?.disconnect(),$=null}),(S,I)=>(x(),N("pre",{ref_key:"preRef",ref:y,style:Vt(c.value),class:We([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":m.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(x(),N("code",EQ,[(x(!0),N(Pe,null,ot(v.value,P=>(x(),N("span",{key:P.key,class:We(["markstream-pre__diff-pane",P.className])},[(x(!0),N(Pe,null,ot(P.lines,(D,W)=>(x(),N("span",{key:D.key,class:We(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Vt(F(W,P.key))},[I[0]||(I[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",TQ,O(D.number),1),_("span",NQ,[_("span",IQ,O(D.code),1)])],6))),128))],2))),128))])):(x(),N(Pe,{key:1},[t.showLineNumbers?(x(),N("span",LQ,[(x(!0),N(Pe,null,ot(r.value,P=>(x(),N("span",{key:P,class:"markstream-pre__line-number"},O(P),1))),128))])):re("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:O(s.value)},null,8,$Q)],64))],14,MQ))}});qs.install=e=>{e.component(qs.__name,qs)};const H0=La(!1);let RS=null;const FQ={key:0},ro=vn(Ze({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(RS||(RS=pk().then(v=>{H0.value=!!v}).catch(()=>{H0.value=!1})),Rh(H0)),o=Wd(),s=jt("markstreamFade",void 0),i=jt("markstreamTextStreamState",void 0),r=jt("markstreamStreamVersion",void 0),l=B(()=>{const v=o.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=B(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=B(()=>{var v;const m=(v=o["index-key"])!=null?v:o.indexKey;return m==null||m===""?"":String(m)}),u=Z(t.node.content),d=Z("");let f=r?.value;const h=Z(0);function p(){return u.value+d.value}function g(){d.value&&(u.value=p(),d.value="")}Je([()=>t.node.content,c,a,()=>r?.value],([v,m,y,k])=>{const A=String(v??""),$=c.value,L=k!==f;f=k;const w=MM({nextContent:A,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:L});u.value=w.settledContent,d.value=w.streamedDelta,w.appended&&(h.value+=1),$&&i?.set($,A)},{immediate:!0}),Je(a,v=>{var m;v||(m=p(),u.value=m,d.value="")});const b=B(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(v,m)=>(x(),N("span",{class:We([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(x(),N("span",FQ,O(u.value),1)):re("",!0),d.value?(x(),N("span",{key:1,class:We(["text-node-stream-delta",[b.value]]),onAnimationend:g},O(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);ro.install=e=>{e.component(ro.__name,ro)};const UM=Ze({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return gn(qs,Bt(lt({},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"}))}}}),W0=Li({loader:()=>Qn(null,null,function*(){try{return(yield ms(()=>import("./CodeBlockNode-JigiL_d4.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),qs}}),loadingComponent:UM,delay:0,suspensible:!1}),Bi=Li(()=>Qn(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 gn(ro,Bt(lt({},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 pk())return(yield ms(()=>import("./index6-CCep5k45.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 gn(ro,Bt(lt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),qM=Li(()=>Qn(null,null,function*(){try{if(yield pk())return(yield ms(()=>import("./index5-BwxQZskx.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 gn(ro,Bt(lt({},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:""}$$`}}))}})),ys=vn(Ze({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ys.install=e=>{e.component(ys.__name,ys)};const OQ={class:"superscript-node"},Fs=vn(Ze({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>lt({text:ro,inline_code:os,link:xs,html_inline:Xs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Qs,insert:Rs,subscript:Os,emoji:$s,math_inline:Bi,reference:ys},n.value));return(s,i)=>(x(),N("sup",OQ,[(x(!0),N(Pe,null,ot(e.node.children,(r,l)=>(x(),ke(C(ir),{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"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const RQ={class:"subscript-node"},Os=vn(Ze({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>lt({text:ro,inline_code:os,link:xs,html_inline:Xs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Qs,insert:Rs,superscript:Fs,emoji:$s,math_inline:Bi,reference:ys},n.value));return(s,i)=>(x(),N("sub",RQ,[(x(!0),N(Pe,null,ot(e.node.children,(r,l)=>(x(),ke(C(ir),{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"]]);Os.install=e=>{e.component(Os.__name,Os)};const BQ={class:"strong-node"},ks=vn(Ze({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>lt({text:ro,inline_code:os,link:xs,html_inline:Xs,emphasis:ws,strikethrough:bs,highlight:Qs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Bi,reference:ys},n.value));return(s,i)=>(x(),N("strong",BQ,[(x(!0),N(Pe,null,ot(e.node.children,(r,l)=>(x(),ke(C(ir),{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"]]);ks.install=e=>{e.component(ks.__name,ks)};const DQ={class:"strikethrough-node"},bs=vn(Ze({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>lt({text:ro,inline_code:os,link:xs,html_inline:Xs,strong:ks,emphasis:ws,highlight:Qs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Bi,reference:ys},n.value));return(s,i)=>(x(),N("del",DQ,[(x(!0),N(Pe,null,ot(e.node.children,(r,l)=>(x(),ke(C(ir),{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"]]);bs.install=e=>{e.component(bs.__name,bs)};const PQ=["href","title","aria-label","aria-hidden","target","rel"],HQ=["aria-hidden"],WQ={class:"link-text-wrapper relative inline-flex"},zQ={class:"leading-[normal] link-text"},xs=vn(Ze({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=jt("markstreamShowTooltips",void 0),o=B(()=>{const v=n?.value;return typeof v=="boolean"?v:t.showTooltip}),s=B(()=>{var v,m,y,k,A;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",L=(v=t.animationOpacity)!=null?v:.35,w=Math.max(.12,Math.min(.5*L,L)),E={"--underline-height":`${(m=t.underlineHeight)!=null?m:2}px`,"--underline-bottom":$,"--underline-opacity":String(L),"--underline-rest-opacity":String(w),"--underline-duration":`${(y=t.animationDuration)!=null?y:1.6}s`,"--underline-timing":(k=t.animationTiming)!=null?k:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=_o(()=>t.customId),r=B(()=>lt({text:ro,strong:ks,strikethrough:bs,emphasis:ws,image:Sl,html_inline:Xs,inline_code:os},i.value)),l=Wd(),a=B(()=>{var v,m;const y=(v=t.node)==null?void 0:v.attrs;if(!y||typeof y!="object")return{};const k={};if(Array.isArray(y))for(const A of y)Array.isArray(A)&&A[0]&&(k[String(A[0])]=String((m=A[1])!=null?m:""));else for(const[A,$]of Object.entries(y))A&&$!=null&&$!==!1&&(k[A]=$===!0?"":String($));return TS(k,"safe","a")}),c=B(()=>lt(lt({},l),a.value)),u=B(()=>{var v,m;return TS({href:String((m=(v=t.node)==null?void 0:v.href)!=null?m:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const v=c.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(LV(u.value)?"_blank":void 0)}),f=B(()=>{var v;return String((v=d.value)!=null?v:"").trim().toLowerCase()==="_blank"}),h=B(()=>{if(!u.value)return;const v=c.value.rel,m=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),y=new Set(Array.from(m).filter(k=>k.toLowerCase()!=="opener"));return f.value&&(y.add("noopener"),y.add("noreferrer")),y.size>0?Array.from(y).join(" "):void 0}),p=B(()=>{const v=lt({},c.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function g(){o.value&&vQ()}const b=B(()=>{var v,m;const y=(v=t.node)==null?void 0:v.title;return typeof y=="string"&&y.trim().length>0?y:String((m=u.value)!=null?m:"")});return(v,m)=>{var y,k;return e.node.loading?(x(),N("span",kn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[_("span",WQ,[_("span",zQ,[ie(C(ro),{class:"leading-[normal] link-text",node:{type:"text",content:String((y=e.node.text)!=null?y:""),raw:String((k=e.node.text)!=null?k:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),m[1]||(m[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,HQ)):(x(),N("a",kn({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:m[0]||(m[0]=A=>(function($){var L,w,E,T;if(!o.value)return;const F=$,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,I=((L=t.node)==null?void 0:L.title)||((w=u.value)!=null&&w.includes("xn--")&&((T=(E=t.node)==null?void 0:E.text)!=null&&T.includes("://"))?t.node.text:u.value)||"";gQ($.currentTarget,I,"top",!1,S)})(A)),onMouseleave:g}),[(x(!0),N(Pe,null,ot(e.node.children,(A,$)=>(x(),ke(C(ir),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,PQ))}}}),[["__scopeId","data-v-367e6ca4"]]);xs.install=e=>{e.component(xs.__name,xs)};const UQ={class:"insert-node"},Rs=vn(Ze({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>lt({text:ro,inline_code:os,link:xs,html_inline:Xs,strong:ks,emphasis:ws,strikethrough:bs,highlight:Qs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Bi,reference:ys},n.value));return(s,i)=>(x(),N("ins",UQ,[(x(!0),N(Pe,null,ot(e.node.children,(r,l)=>(x(),ke(C(ir),{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"]]);Rs.install=e=>{e.component(Rs.__name,Rs)};const qQ={class:"highlight-node"},Qs=vn(Ze({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>lt({text:ro,inline_code:os,link:xs,html_inline:Xs,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Bi,reference:ys},n.value));return(s,i)=>(x(),N("mark",qQ,[(x(!0),N(Pe,null,ot(e.node.children,(r,l)=>(x(),ke(C(ir),{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"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const jQ={class:"emphasis-node"},ws=vn(Ze({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>lt({text:ro,inline_code:os,link:xs,html_inline:Xs,strong:ks,strikethrough:bs,highlight:Qs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Bi,reference:ys},n.value));return(s,i)=>(x(),N("em",jQ,[(x(!0),N(Pe,null,ot(e.node.children,(r,l)=>(x(),ke(C(ir),{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"]]);ws.install=e=>{e.component(ws.__name,ws)};const VQ={class:"hard-break"},Cl=vn(Ze({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),N("br",VQ))}),[["__scopeId","data-v-50c58f70"]]);Cl.install=e=>{e.component(Cl.__name,Cl)};const Fd=Ze({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=mt({checkbox:Ys,checkbox_input:Ys,emoji:$s,emphasis:ws,hardbreak:Cl,highlight:Qs,inline_code:os,insert:Rs,link:xs,reference:ys,strikethrough:bs,strong:ks,subscript:Os,superscript:Fs,text:ro}),o=_o(()=>t.customId),s=B(()=>{const i=o.value;return Object.keys(i).length>0?lt(lt({},n),i):n});return(i,r)=>(x(!0),N(Pe,null,ot(e.nodes,(l,a)=>(x(),ke(C(ir),{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 Ev(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(Ev)}function Cp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Ev))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(Ev)?s:null}function Zc(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 KQ=["cite"],GQ={key:0,dir:"auto",class:"paragraph-node"},YQ=["custom-id"],Sh=vn(Ze({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=_o(()=>t.customId),o=B(()=>!!n.value.paragraph),s=B(()=>!!n.value.text),i=B(()=>Cp(t.node.children,!o.value)),r=B(()=>t.fade!==!1||s.value?null:Zc(i.value));return Nn("markstreamShowTooltips",B(()=>t.showTooltips)),Nn("markstreamFade",B(()=>t.fade)),(l,a)=>(x(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),N("p",GQ,[r.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,YQ)):(x(),ke(C(Fd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),ke(C(Bs),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,KQ))}}),[["__scopeId","data-v-abfecebc"]]);Sh.install=e=>{e.component(Sh.__name,Sh)};const ZQ={class:"definition-list"},XQ={class:"definition-term"},QQ={class:"definition-desc"},Ch=vn(Ze({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),N("dl",ZQ,[(x(!0),N(Pe,null,ot(t.node.items,(s,i)=>(x(),N(Pe,{key:i},[_("dt",XQ,[ie(C(Bs),{"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"])]),_("dd",QQ,[ie(C(Bs),{"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"]]);Ch.install=e=>{e.component(Ch.__name,Ch)};const JQ=["href","title"],ld=vn(Ze({__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)=>(x(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,JQ))}}),[["__scopeId","data-v-e1eb37b6"]]);ld.install=e=>{e.component(ld.__name,ld)};const eJ=["id"],tJ={class:"flex-1"},Ah=Ze({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",tJ,[ie(C(Bs),{"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,eJ))}});Ah.install=e=>{e.component(Ah.__name,Ah)};const nJ=["custom-id"],Tv=vn(Ze({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=_o(()=>t.customId),o=jt("markstreamFade",void 0),s=B(()=>o?.value!==!1||n.value.text?null:Zc(t.node.children)),i=B(()=>lt({text:ro,inline_code:os,link:xs,image:Sl,strong:ks,emphasis:ws,strikethrough:bs,highlight:Qs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,footnote_reference:Zs,hardbreak:Cl,math_inline:Bi,reference:ys},n.value));return(r,l)=>(x(),ke(Vo(`h${e.node.level}`),kn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[s.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(s.value),9,nJ)):(x(!0),N(Pe,{key:1},ot(e.node.children,(a,c)=>(x(),ke(C(ir),{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"]]),Ap=Tv;Ap.install=e=>{e.component(Tv.__name,Tv)};const oJ={key:0,dir:"auto",class:"paragraph-node"},sJ=["custom-id"],iJ={dir:"auto",class:"paragraph-node"},rJ=["custom-id"],Dc=vn(Ze({__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=B(()=>{var h;return(h=t.node)!=null?h:t.item}),o=_o(()=>t.customId),s=B(()=>!!o.value.paragraph),i=B(()=>!!o.value.text),r=B(()=>{var h;return Cp((h=n.value)==null?void 0:h.children,!s.value)}),l=B(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const g=p[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const b=p.slice(1);if(!b.every(m=>m?.type==="list"))return null;const v=Cp([g]);return v?{paragraphChildren:v,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=B(()=>a()?Zc(r.value):null),u=B(()=>{var h;return a()?Zc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Nn("markstreamShowTooltips",B(()=>t.showTooltips)),Nn("markstreamFade",B(()=>t.fade)),(h,p)=>{var g,b;return x(),N("li",kn({class:"list-item",dir:"auto"},f.value),[r.value?(x(),N("p",oJ,[c.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,sJ)):(x(),ke(C(Fd),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(x(),N(Pe,{key:1},[_("p",iJ,[u.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,rJ)):(x(),ke(C(Fd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),N(Pe,null,ot(l.value.nestedLists,(v,m)=>(x(),ke(C(Bs),{key:m,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${m}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=y=>h.$emit("copy",y))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),ke(C(Bs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(g=n.value)==null?void 0:g.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=v=>h.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Dc.install=e=>{e.component(Dc.__name,Dc)};const Pc=vn(Ze({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=_o(()=>e.customId),n=B(()=>t.value.list_item||Dc);return(o,s)=>(x(),ke(Vo(e.node.ordered?"ol":"ul"),{class:We(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(x(!0),N(Pe,null,ot(e.node.items,(i,r)=>{var l;return x(),ke(Vo(n.value),kn({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"]]);Pc.install=e=>{e.component(Pc.__name,Pc)};const jM=Symbol("ViewportPriority");function lJ(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(t):t,r=s?(n=window.requestIdleCallback)!=null?n:m=>window.setTimeout(()=>m({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:m=>window.clearTimeout(m):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function g(m){const y=u.get(m);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const m=d.values().next().value;m&&(d.delete(m),g(m),d.size&&b())},{timeout:1200}))}Je(i,m=>{if(!m){for(const y of Array.from(u.keys()))g(y);h()}},{flush:"sync"});const v=(m,y)=>{const k=Z(!1);let A,$=!1;const L=new Promise(T=>{A=()=>{$||($=!0,T())}}),w=()=>{try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()};if(!s||!i.value)return k.value=!0,A(),{isVisible:k,whenVisible:L,destroy:w};const E=(function(T,F){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,W){var z,R,q;return{root:(z=e?.(D??null))!=null?z:null,rootMargin:(R=W?.rootMargin)!=null?R:"300px",threshold:(q=W?.threshold)!=null?q:0}})(T,F);if(a&&(P=S,(I=c)&&I.root===P.root&&I.rootMargin===P.rootMargin&&I.threshold===P.threshold))return a;var I,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const W of D)(W.isIntersecting||W.intersectionRatio>0)&&g(W.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(m,y);return E?(u.set(m,{resolve:A,visible:k}),E.observe(m),d.add(m),b(),{isVisible:k,whenVisible:L,destroy:w}):(k.value=!0,A(),{isVisible:k,whenVisible:L,destroy:w})};return Nn(jM,v),v}function aJ(){var e,t;const n=jt(jM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=o.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=Z(!1);let p,g=!1;const b=new Promise(y=>{p=()=>{g||(g=!0,y())}}),v=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},m=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(y=>{for(const k of y)(k.isIntersecting||k.intersectionRatio>0)&&u(k.target)},{root:null,rootMargin:"300px",threshold:0}),s));return m?(o.set(f,{resolve:p,visible:h}),m.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:v}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:v})}}const cJ={key:2,class:"html-block-node__raw"},uJ=["innerHTML"],dJ={key:1,class:"html-block-node__placeholder"},ad=vn(Ze({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamNestedRendererProps",void 0),s=B(()=>{var $,L;return(L=($=t.htmlPolicy)!=null?$:n?.value)!=null?L:"safe"}),i=B(()=>{var $,L;const w=($=o?.value)!=null?$:{};return Bt(lt({},w),{customId:(L=t.customId)!=null?L:w.customId,htmlPolicy:s.value})}),r=Li({loader:()=>Promise.resolve().then(()=>Ck),suspensible:!1}),l=B(()=>{const $=hv(t.node.attrs,s.value);if(!$)return;const L=xp($);return Object.keys(L).length>0?L:void 0}),a=B(()=>{const $=String(t.node.tag||"").trim(),L=hv(t.node.attrs,s.value,$);if(!L)return;const w=xp(L);return Object.keys(w).length>0?w:void 0}),c=_o(()=>t.customId),u=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),f=Z(typeof window>"u"),h=Z(t.node.content),p=B(()=>Array.isArray(t.node.children)?t.node.children:[]),g=B(()=>String(t.node.tag||"div")),b=B(()=>{const $=g.value.trim().toLowerCase();return N6.has($)||ak($,s.value)}),v=B(()=>p.value.length>0&&!!t.node.tag&&!b.value),m=B(()=>{var $,L,w;if(v.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:($=h.value)!=null?$:""};const E=(L=h.value)!=null?L:t.node.content;if(!E)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Bc(E,s.value)};if(t.node.loading){const F=Sp(E,c.value,s.value);return F===null?{mode:"text",content:(w=t.node.raw)!=null?w:E}:{mode:"dynamic",nodes:F}}if(!WM(E,c.value))return{mode:"html",content:Bc(E,s.value)};const T=Sp(E,c.value,s.value);return T===null?{mode:"html",content:Bc(E,s.value)}:{mode:"dynamic",nodes:T}}),y=aJ(),k=Z(null),A=!!t.node.loading;return typeof window<"u"?(Je(d,$=>{var L,w;if((w=(L=k.value)==null?void 0:L.destroy)==null||w.call(L),k.value=null,!A)return f.value=!0,void(h.value=t.node.content);if(!$)return void(f.value=!1);const E=y($,{rootMargin:"400px"});k.value=E,f.value=E.isVisible.value,E.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Je(()=>t.node.content,$=>{A&&!f.value||(h.value=$)})):f.value=!0,ho(()=>{var $,L;(L=($=k.value)==null?void 0:$.destroy)==null||L.call($),k.value=null}),($,L)=>(x(),ke(Vo(v.value?g.value:"div"),kn({ref_key:"htmlRef",ref:d,class:"html-block-node"},v.value?a.value:void 0),{default:Ee(()=>[f.value?(x(),N(Pe,{key:0},[m.value.mode==="structured"?(x(),ke(C(r),kn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):m.value.mode==="dynamic"?(x(),ke(C(u),{key:1,nodes:m.value.nodes},null,8,["nodes"])):m.value.mode==="text"?(x(),N("pre",cJ,O(m.value.content),1)):(x(),N("div",kn({key:3},l.value,{innerHTML:m.value.content}),null,16,uJ))],64)):(x(),N("div",dJ,[$n($.$slots,"placeholder",{node:e.node},()=>[L[0]||(L[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),L[1]||(L[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),L[2]||(L[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);ad.install=e=>{e.component(ad.__name,ad)};const fJ={dir:"auto",class:"paragraph-node"},hJ=["custom-id"],_a=vn(Ze({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=_o(()=>t.customId),o=jt("markstreamHtmlPolicy",void 0),s=jt("markstreamFade",void 0),i=jt("markstreamParseOptions",void 0),r=jt("markstreamCustomMarkdownIt",void 0),l=jt("markstreamNestedRendererProps",void 0),a=B(()=>{var w;return(w=o?.value)!=null?w:"safe"}),c=B(()=>{var w;return(w=t.parseOptions)!=null?w:i?.value}),u=B(()=>{var w;return(w=t.customMarkdownIt)!=null?w:r?.value}),d=B(()=>{var w,E;return(E=t.customHtmlTags)!=null?E:(w=l?.value)==null?void 0:w.customHtmlTags}),f=B(()=>{var w,E;const T=(w=l?.value)!=null?w:{};return Bt(lt({},T),{customId:(E=t.customId)!=null?E:T.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Li({loader:()=>Promise.resolve().then(()=>Ck),suspensible:!1});function p(w){var E;return w.type==="text"&&String((E=w.content)!=null?E:"").trim()===""}const g=B(()=>t.node.children.filter(w=>!p(w))),b=B(()=>g.value.length>0&&g.value.every(w=>w.type==="image"||(function(E){var T;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!p(I)):[]})(E);return F.length===1&&((T=F[0])==null?void 0:T.type)==="image"})(w))),v=B(()=>new Set(nu(d.value))),m=B(()=>{if(!b.value||g.value.length<=1)return t.node.children;const w=[];for(let E=0;E<t.node.children.length;E++){const T=t.node.children[E];if(!p(T)){w.push(T);continue}const F=w.length>0,S=t.node.children.slice(E+1).some(I=>!p(I));F&&S&&w.push(Bt(lt({},T),{content:" ",raw:" "}))}return w}),y=B(()=>s?.value===!1&&!n.value.text),k=B(()=>y.value?Zc(m.value):null);function A(w,E){return{node:w,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=B(()=>lt({inline_code:os,image:Sl,link:xs,hardbreak:Cl,emphasis:ws,strong:ks,strikethrough:bs,highlight:Qs,insert:Rs,subscript:Os,superscript:Fs,html_inline:Xs,html_block:ad,emoji:$s,checkbox:Ys,math_inline:Bi,checkbox_input:Ys,reference:ys,footnote_anchor:ld,footnote_reference:Zs,text:ro},n.value)),L=B(()=>m.value.map((w,E)=>{var T;const F=(function(S){var I,P,D,W;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||F6(S.content);if(z&&!v.value.has(z)&&O6((P=S.content)!=null?P:S.raw,z)){const R=String((W=(D=S.content)!=null?D:S.raw)!=null?W:"");return{child:{type:"text",content:R,raw:R},component:ro,isCustomComponent:!1}}}return{child:S,component:$.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Yd(String(S.type)))}})(w);return Bt(lt({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?yk(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((T=F.child.content)!=null?T:""),originalChild:w})}));return(w,E)=>(x(),N("p",fJ,[k.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(k.value),9,hJ)):(x(!0),N(Pe,{key:1},ot(L.value,T=>{return x(),N(Pe,{key:T.key},[b.value&&p(T.originalChild)?(x(),N(Pe,{key:0},[Xe(O((F=T.originalChild,String((S=F.content)!=null?S:""))),1)],64)):T.isCustomComponent?(x(),ke(Vo(T.component),kn({key:1,ref_for:!0},T.customAttrs,{node:T.child,loading:T.child.loading,"index-key":T.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[T.hasSlotChildren?(x(),ke(C(h),kn({key:0,ref_for:!0},f.value,{nodes:T.child.children,"index-key":T.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):T.slotContent?(x(),ke(C(h),kn({key:1,ref_for:!0},f.value,{content:T.slotContent,final:!T.child.loading,"index-key":`${T.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),ke(Vo(T.component),kn({key:2,ref_for:!0},A(T.child,T.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);_a.install=e=>{e.component(_a.__name,_a)};const pJ={class:"table-node-wrapper"},mJ=["aria-busy"],gJ={key:0},vJ=["custom-id"],yJ=["aria-label","onPointerdown"],kJ=["custom-id"],bJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},cd=vn(Ze({__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=B(()=>{var v;return(v=t.node.loading)!=null&&v}),o=B(()=>{var v;return(v=t.node.rows)!=null?v:[]}),s=Z(null),i=Z([]);let r=null;const l=B(()=>t.node.header.cells.length),a=B(()=>i.value.some(v=>Number.isFinite(v)&&v>0)),c=B(()=>a.value?i.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);Nn("markstreamShowTooltips",B(()=>t.showTooltips)),Nn("markstreamFade",B(()=>t.fade));const u=_o(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),h=new WeakMap;function p(v){const m=t.fade===!1&&!d.value,y=!f.value,k=h.get(v);if(k?.children===v.children&&k.textFastPath===m&&k.paragraphFastPath===y)return k.info;const A=Cp(v.children,y,!0),$={simpleChildren:A,plainText:A&&m?Zc(A):null};return h.set(v,{children:v.children,textFastPath:m,paragraphFastPath:y,info:$}),$}function g(v){if(!r)return;v.preventDefault();const m=r.startWidth+r.nextStartWidth,y=Math.min(48,Math.floor(m/2)),k=Math.max(y,Math.min(m-y,Math.round(r.startWidth+v.clientX-r.startX))),A=[...r.widths];A[r.index]=k,A[r.index+1]=m-k,i.value=A}function b(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Je(l,()=>{b(),i.value=[]}),ho(b),(v,m)=>(x(),N("div",pJ,[_("table",{ref_key:"tableRef",ref:s,class:We(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),N("colgroup",gJ,[(x(!0),N(Pe,null,ot(e.node.header.cells,(y,k)=>(x(),N("col",{key:k,style:Vt(c.value[k])},null,4))),128))])):re("",!0),_("thead",null,[_("tr",null,[(x(!0),N(Pe,null,ot(e.node.header.cells,(y,k)=>(x(),N("th",{key:k,dir:"auto",class:We([y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"])},[p(y).plainText!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(y).plainText),9,vJ)):p(y).simpleChildren?(x(),ke(C(Fd),{key:1,nodes:p(y).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${k}`},null,8,["nodes","custom-id","index-key"])):(x(),ke(C(Bs),{key:2,nodes:y.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[0]||(m[0]=A=>v.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),k<e.node.header.cells.length-1?(x(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${k+1} and ${k+2}`,onPointerdown:A=>(function($,L){if(L.button!==0)return;const w=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),E=w[$],T=w[$+1];E&&T&&(L.preventDefault(),r={index:$,startX:L.clientX,startWidth:E,nextStartWidth:T,widths:w},i.value=w,window.addEventListener("pointermove",g),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(k,A)},null,40,yJ)):re("",!0)],2))),128))])]),_("tbody",null,[(x(!0),N(Pe,null,ot(o.value,(y,k)=>(x(),N("tr",{key:k},[(x(!0),N(Pe,null,ot(y.cells,(A,$)=>(x(),N("td",{key:$,class:We([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(A).plainText),9,kJ)):p(A).simpleChildren?(x(),ke(C(Fd),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${k}-${$}`},null,8,["nodes","custom-id","index-key"])):(x(),ke(C(Bs),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[1]||(m[1]=L=>v.$emit("copy",L))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,mJ),ie(Tl,{name:"table-node-fade"},{default:Ee(()=>[n.value?(x(),N("div",bJ,[$n(v.$slots,"loading",{isLoading:n.value},()=>[m[2]||(m[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),m[3]||(m[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):re("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);cd.install=e=>{e.component(cd.__name,cd)};const xJ={class:"hr-node"},Mh=vn({},[["render",function(e,t){return x(),N("hr",xJ)}],["__scopeId","data-v-39b2349c"]]);Mh.install=e=>{e.component(Mh.__name,Mh)};const wJ={class:"unknown-node"},Nv=Ze({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),N("div",wJ,O(e.node.raw),1))}),Eh=vn(Ze({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=B(()=>`vmr-container vmr-container-${t.node.name}`),o=_o(()=>t.customId),s=B(()=>lt({text:ro,paragraph:_a,heading:Ap,inline_code:os,link:xs,image:Sl,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,checkbox:Ys,checkbox_input:Ys,hardbreak:Cl,math_inline:Bi,reference:ys,list:Pc,math_block:qM,table:cd},o.value));return(i,r)=>(x(),N("div",kn({class:n.value},e.node.attrs),[(x(!0),N(Pe,null,ot(e.node.children,(l,a)=>{return x(),ke(Vo((c=l.type,s.value[c]||Nv)),{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"]]);Eh.install=e=>{e.component(Eh.__name,Eh)};const _J=["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"],BS=[[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 SJ(e){if(e<=255)return _J[e];let t=0,n=BS.length-1;for(;t<=n;){const o=t+n>>1,s=BS[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const CJ=/[ \t\n\r\f]+/g,AJ=/[\t\n\r\f]| {2,}|^ | $/;let z0=null;const MJ=new RegExp("\\p{Script=Arabic}","u"),Fm=new RegExp("\\p{M}","u"),VM=new RegExp("\\p{Nd}","u");function DS(e){return MJ.test(e)}function PS(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 Fr(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(PS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(PS(n))return!0}}return!1}const EJ=new Set([" "," ","","\uFEFF"]);function TJ(e){return Fr(e)}function Iv(e){return!(function(t){const n=Mp(t);return n!==null&&(kk.has(n)||Aa.has(n))})(e)&&!(function(t){const n=Mp(t);return n!==null&&EJ.has(n)})(e)}const kk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Om=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),bk=new Set(["'","’"]),Aa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),NJ=new Set([":",".","،","؛"]),IJ=new Set(["၏"]),LJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function $J(e){if(xk(e))return!0;let t=!1;for(const n of e)if(Aa.has(n))t=!0;else if(!t||!Fm.test(n))return!1;return t}function FJ(e){for(const t of e)if(!kk.has(t)&&!Aa.has(t))return!1;return e.length>0}function OJ(e){if(xk(e))return!0;for(const t of e)if(!Om.has(t)&&!bk.has(t)&&!Fm.test(t))return!1;return e.length>0}function xk(e){let t=!1;for(const n of e)if(n!=="\\"&&!Fm.test(n)){if(!(Om.has(n)||Aa.has(n)||bk.has(n)))return!1;t=!0}return t}function KM(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Mp(e){if(e.length===0)return null;const t=KM(e,e.length);return e.slice(t)}function RJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Fm.test(o))n--;else{if(!Om.has(o)&&!bk.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function BJ(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function HS(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 WS(e,t){return e&&t!==null&&NJ.has(t)}function DJ(e){const t=Mp(e);return t!==null&&IJ.has(t)}function PJ(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 Lv(e){let t=e.length;for(;t>0;){const n=KM(e,t),o=e.slice(n,t);if(LJ.has(o))return!0;if(!Aa.has(o))return!1;t=n}return!1}function HJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
272
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const WJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function di(e){return e.length===1?e[0]:e.join("")}function zJ(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),di(n)}function UJ(e,t,n,o){if(!WJ.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=HJ(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:di(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:di(r),isWordLike:a,kind:i,start:l}),s}function U0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const qJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function jJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||qJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function VJ(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const KJ=new Set([":","-","/","×",",",".","+","–","—"]),zS=/^[A-Za-z0-9_]+[,:;]*$/,US=/[,:;]+$/;function qS(e){for(const t of e)if(VM.test(t))return!0;return!1}function Th(e){if(e.length===0)return!1;for(const t of e)if(!VM.test(t)&&!KJ.has(t))return!1;return!0}function jS(e,t,n){var o,s,i;const r=(z0===null&&(z0=new Intl.Segmenter(void 0,{granularity:"word"})),z0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[],v=[],m=[],y=[];for(const w of r.segment(e))for(const E of UJ(w.segment,(o=w.isWordLike)!=null&&o,w.index,n)){let T=function(){h[R]!==null&&(c[R]=[HS(a,h,p,R)],h[R]=null),c[R].push(E.text),u[R]=u[R]||E.isWordLike,g[R]=g[R]||I,b[R]=b[R]||P,v[R]=W,m[R]=z,y[R]=WS(b[R],D)};const F=E.kind==="text",S=BJ(E.text,E.isWordLike,E.kind),I=Fr(E.text),P=DS(E.text),D=Mp(E.text),W=Lv(E.text),z=DJ(E.text),R=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[R]==="text"&&I&&g[R]&&v[R]||F&&l>0&&d[R]==="text"&&FJ(E.text)&&g[R]||F&&l>0&&d[R]==="text"&&m[R]?T():F&&l>0&&d[R]==="text"&&E.isWordLike&&P&&y[R]?(T(),u[R]=!0):S!==null&&l>0&&d[R]==="text"&&h[R]===S?p[R]=((s=p[R])!=null?s:1)+1:F&&!E.isWordLike&&l>0&&d[R]==="text"&&($J(E.text)||E.text==="-"&&u[R])?T():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,f[l]=E.start,h[l]=S,p[l]=S===null?0:1,g[l]=I,b[l]=P,v[l]=W,m[l]=z,y[l]=WS(P,D),l++)}for(let w=0;w<l;w++)h[w]===null?a[w]=di(c[w]):a[w]=HS(a,h,p,w);for(let w=1;w<l;w++)d[w]==="text"&&!u[w]&&xk(a[w])&&d[w-1]==="text"&&(a[w-1]+=a[w],u[w-1]=u[w-1]||u[w],a[w]="");const k=Array.from({length:l},()=>null);let A=-1;for(let w=l-1;w>=0;w--){const E=a[w];if(E.length!==0){if(d[w]==="text"&&!u[w]&&OJ(E)&&A>=0&&d[A]==="text"){const T=(i=k[A])!=null?i:[];T.push(E),k[A]=T,f[A]=f[w],a[w]="";continue}A=w}}for(let w=0;w<l;w++){const E=k[w];E!=null&&(a[w]=zJ(E,a[w]))}let $=0;for(let w=0;w<l;w++){const E=a[w];E.length!==0&&($!==w&&(a[$]=E,u[$]=u[w],d[$]=d[w],f[$]=f[w]),$++)}a.length=$,u.length=$,d.length=$,f.length=$;const L=(function(w){const E=w.texts.slice(),T=w.isWordLike.slice(),F=w.kinds.slice(),S=w.starts.slice();for(let I=0;I<E.length-1;I++){if(F[I]!=="text"||F[I+1]!=="text"||!Fr(E[I])||!Fr(E[I+1]))continue;const P=RJ(E[I]);P!==null&&(E[I]=P.head,E[I+1]=P.tail+E[I+1],S[I+1]=S[I]+P.head.length)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I],D=w.kinds[I],W=w.isWordLike[I];if(D==="text"&&W&&zS.test(P)){const z=[P];let R=US.test(P),q=I+1;for(;R&&q<w.len&&w.kinds[q]==="text"&&w.isWordLike[q]&&zS.test(w.texts[q]);){const K=w.texts[q];z.push(K),R=US.test(K),q++}E.push(di(z)),T.push(!0),F.push("text"),S.push(w.starts[I]),I=q-1;continue}E.push(P),T.push(W),F.push(D),S.push(w.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I];if(w.kinds[I]==="text"&&P.includes("-")){const D=P.split("-");let W=D.length>1;for(let z=0;z<D.length;z++){const R=D[z];if(!W)break;R.length!==0&&qS(R)&&Th(R)||(W=!1)}if(W){let z=0;for(let R=0;R<D.length;R++){const q=D[R],K=R<D.length-1?`${q}-`:q;E.push(K),T.push(!0),F.push("text"),S.push(w.starts[I]+z),z+=K.length}continue}}E.push(P),T.push(w.isWordLike[I]),F.push(w.kinds[I]),S.push(w.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I],D=w.kinds[I];if(D==="text"&&Th(P)&&qS(P)){const W=[P];let z=I+1;for(;z<w.len&&w.kinds[z]==="text"&&Th(w.texts[z]);)W.push(w.texts[z]),z++;E.push(di(W)),T.push(!0),F.push("text"),S.push(w.starts[I]),I=z-1;continue}E.push(P),T.push(w.isWordLike[I]),F.push(D),S.push(w.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I];if(E.push(P),T.push(w.isWordLike[I]),F.push(w.kinds[I]),S.push(w.starts[I]),!VJ(P))continue;const D=I+1;if(D>=w.len||U0(w.kinds[D]))continue;const W=[],z=w.starts[D];let R=D;for(;R<w.len&&!U0(w.kinds[R]);)W.push(w.texts[R]),R++;W.length>0&&(E.push(di(W)),T.push(!0),F.push("text"),S.push(z),I=R-1)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=w.texts.slice(),T=w.isWordLike.slice(),F=w.kinds.slice(),S=w.starts.slice();for(let P=0;P<w.len;P++){if(F[P]!=="text"||!jJ(w,P))continue;const D=[E[P]];let W=P+1;for(;W<w.len&&!U0(F[W]);){D.push(E[W]),T[P]=!0;const z=E[W].includes("?");if(F[W]="text",E[W]="",W++,z)break}E[P]=di(D)}let I=0;for(let P=0;P<E.length;P++){const D=E[P];D.length!==0&&(I!==P&&(E[I]=D,T[I]=T[P],F[I]=F[P],S[I]=S[P]),I++)}return E.length=I,T.length=I,F.length=I,S.length=I,{len:I,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];let I=0;for(;I<w.len;){const P=[w.texts[I]];let D=w.isWordLike[I],W=w.kinds[I],z=w.starts[I];if(W==="glue"){const R=[P[0]],q=z;for(I++;I<w.len&&w.kinds[I]==="glue";)R.push(w.texts[I]),I++;const K=di(R);if(!(I<w.len&&w.kinds[I]==="text")){E.push(K),T.push(!1),F.push("glue"),S.push(q);continue}P[0]=K,P.push(w.texts[I]),D=w.isWordLike[I],W="text",z=q,I++}else I++;if(W==="text")for(;I<w.len&&w.kinds[I]==="glue";){const R=[];for(;I<w.len&&w.kinds[I]==="glue";)R.push(w.texts[I]),I++;const q=di(R);I<w.len&&w.kinds[I]==="text"?(P.push(q,w.texts[I]),D=D||w.isWordLike[I],I++):P.push(q)}E.push(di(P)),T.push(D),F.push(W),S.push(z)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})({len:$,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let w=0;w<L.len-1;w++){const E=PJ(L.texts[w]);E!==null&&(L.kinds[w]!=="space"&&L.kinds[w]!=="preserved-space"||L.kinds[w+1]!=="text"||!DS(L.texts[w+1])||(L.texts[w]=E.space,L.isWordLike[w]=!1,L.kinds[w]=L.kinds[w]==="preserved-space"?"preserved-space":"space",L.texts[w+1]=E.marks+L.texts[w+1],L.starts[w+1]=L.starts[w]+E.space.length))}return L}function GJ(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 nc=null;const VS=new Map;let oc=null;const YJ=new RegExp("\\p{Emoji_Presentation}","u"),ZJ=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let q0=null;const KS=new Map;function $v(){if(nc!==null)return nc;if(typeof OffscreenCanvas<"u")return nc=new OffscreenCanvas(1,1).getContext("2d"),nc;if(typeof document<"u")return nc=document.createElement("canvas").getContext("2d"),nc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function il(e,t){let n=t.get(e);return n===void 0&&(n={width:$v().measureText(e).width,containsCJK:Fr(e)},t.set(e,n)),n}function Rm(){if(oc!==null)return oc;if(typeof navigator>"u")return oc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},oc;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 oc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},oc}function GM(){return q0===null&&(q0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),q0}function XJ(e){return YJ.test(e)||e.includes("️")}function sa(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=GM();for(const a of l.segment(i))XJ(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function QJ(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 JJ(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function GS(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+Rm().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(k=u,A=d,$=a){l++,a=0,c=!1,f=-1,h=0}function g(k,A){c=!0,u=k+1,d=0,a=A}function b(k,A,$){c=!0,u=k,d=A+1,a=$}function v(k,A){c?(a+=A,u=k+1,d=0):g(k,A)}function m(k,A){const $=i[k];for(let L=A;L<$.length;L++){const w=$[L];c?a+w>r?(p(),b(k,L,w)):(a+=w,u=k,d=L+1):b(k,L,w)}c&&u===k&&d===$.length&&(u=k+1,d=0)}let y=0;for(;y<o.length&&(c||(y=QJ(e,y),!(y>=o.length)));){const k=o[y],A=s[y],$=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+k>r){if($){v(y,k),p(y+1,0,a-k),y++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(k>t&&i[y]!==null){p(),m(y,0),y++;continue}p()}else v(y,k),$&&(f=y+1,h=a-k),y++;else k>t&&i[y]!==null?m(y,0):g(y,k),$&&(f=y+1,h=a-k),y++}return c&&p(),l}let j0=null;function eee(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Lv(d),l=Om.has(d)}function u(d,f){o.push(d),i=i||f;const h=Lv(d);r=d.length===1&&Aa.has(d)&&r||h,l=!1}for(const d of(j0===null&&(j0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),j0).segment(e)){const f=d.segment,h=Fr(f);o.length!==0?l||kk.has(f)||Aa.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function tee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Fr(e[0].text),i=Iv(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=Fr(a.text),u=Iv(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 nee(e,t,n,o){const s=Rm(),{cache:i,emojiCorrection:r}=(function(L,w){$v().font=L;const E=(function(S){let I=VS.get(S);return I||(I=new Map,VS.set(S,I)),I})(L),T=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})(L),F=w?(function(S,I){let P=KS.get(S);if(P!==void 0)return P;const D=$v();D.font=S;const W=D.measureText("😀").width;if(P=0,W>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const R=z.getBoundingClientRect().width;document.body.removeChild(z),W-R>.5&&(P=W-R)}return KS.set(S,P),P})(L,T):0;return{cache:E,fontSize:T,emojiCorrection:F}})(t,(l=e.normalized,ZJ.test(l)));var l;const a=sa("-",il("-",i),r),c=8*sa(" ",il(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const g=null,b=[],v=n?[]:null,m=Array.from({length:e.len});function y(L,w,E,T,F,S,I){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(w),d.push(E),f.push(T),h.push(F),b.push(I),v!==null&&v.push(L)}function k(L,w,E,T,F){const S=il(L,i),I=sa(L,S,r),P=w==="space"||w==="preserved-space"||w==="zero-width-break"?0:I,D=w==="space"||w==="zero-width-break"?0:I;if(F&&T&&L.length>1){let W="sum-graphemes";Th(L)?W="pair-context":s.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const z=(function(R,q,K,X,ue){if(q.breakableFitAdvances!==void 0)return q.breakableFitAdvances;const me=GM(),ne=[];for(const Le of me.segment(R))ne.push(Le.segment);if(ne.length<=1)return q.breakableFitAdvances=null,q.breakableFitAdvances;if(ue==="sum-graphemes"){const Le=[];for(const le of ne){const U=il(le,K);Le.push(sa(le,U,X))}return q.breakableFitAdvances=Le,q.breakableFitAdvances}if(ue==="pair-context"||ne.length>96){const Le=[];let le=null,U=0;for(const ae of ne){const se=sa(ae,il(ae,K),X);if(le===null)Le.push(se);else{const j=le+ae,J=il(j,K);Le.push(sa(j,J,X)-U)}le=ae,U=se}return q.breakableFitAdvances=Le,q.breakableFitAdvances}const ce=[];let de="",Ae=0;for(const Le of ne){de+=Le;const le=sa(de,il(de,K),X);ce.push(le-Ae),Ae=le}return q.breakableFitAdvances=ce,q.breakableFitAdvances})(L,S,i,r,W);return void y(L,I,P,D,w,E,z)}y(L,I,P,D,w,E,null)}for(let L=0;L<e.len;L++){m[L]=u.length;const w=e.texts[L],E=e.isWordLike[L],T=e.kinds[L],F=e.starts[L];if(T==="soft-hyphen"){y(w,0,a,a,T,F,null);continue}if(T==="hard-break"){y(w,0,0,0,T,F,null);continue}if(T==="tab"){y(w,0,0,0,T,F,null);continue}const S=il(w,i);if(T==="text"&&S.containsCJK){const I=eee(w,s),P=o==="keep-all"?tee(I):I;for(let D=0;D<P.length;D++){const W=P[D];k(W.text,"text",F+W.start,E,o==="keep-all"||!Fr(W.text))}continue}k(w,T,F,E,!0)}const A=(function(L,w,E){const T=[];for(let F=0;F<L.length;F++){const S=L[F],I=S.startSegmentIndex<w.length?w[S.startSegmentIndex]:E,P=S.endSegmentIndex<w.length?w[S.endSegmentIndex]:E,D=S.consumedEndSegmentIndex<w.length?w[S.consumedEndSegmentIndex]:E;T.push({startSegmentIndex:I,endSegmentIndex:P,consumedEndSegmentIndex:D})}return T})(e.chunks,m,u.length),$=g===null?null:(function(L,w){const E=(function(F){const S=F.length;if(S===0)return null;const I=new Array(S);let P=!1;for(let K=0;K<S;){const X=F.charCodeAt(K);let ue=X,me=1;if(X>=55296&&X<=56319&&K+1<S){const ce=F.charCodeAt(K+1);ce>=56320&&ce<=57343&&(ue=ce-56320+(X-55296<<10)+65536,me=2)}const ne=SJ(ue);ne!=="R"&&ne!=="AL"&&ne!=="AN"||(P=!0);for(let ce=0;ce<me;ce++)I[K+ce]=ne;K+=me}if(!P)return null;let D=0;for(let K=0;K<S;K++){const X=I[K];if(X==="L"){D=0;break}if(X==="R"||X==="AL"){D=1;break}}const W=new Int8Array(S);for(let K=0;K<S;K++)W[K]=D;const z=1&D?"R":"L",R=z;let q=R;for(let K=0;K<S;K++)I[K]==="NSM"?I[K]=q:q=I[K];q=R;for(let K=0;K<S;K++){const X=I[K];X==="EN"?I[K]=q==="AL"?"AN":"EN":X!=="R"&&X!=="L"&&X!=="AL"||(q=X)}for(let K=0;K<S;K++)I[K]==="AL"&&(I[K]="R");for(let K=1;K<S-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<S;K++){if(I[K]!=="EN")continue;let X;for(X=K-1;X>=0&&I[X]==="ET";X--)I[X]="EN";for(X=K+1;X<S&&I[X]==="ET";X++)I[X]="EN"}for(let K=0;K<S;K++){const X=I[K];X!=="WS"&&X!=="ES"&&X!=="ET"&&X!=="CS"||(I[K]="ON")}q=R;for(let K=0;K<S;K++){const X=I[K];X==="EN"?I[K]=q==="L"?"L":"EN":X!=="R"&&X!=="L"||(q=X)}for(let K=0;K<S;K++){if(I[K]!=="ON")continue;let X=K+1;for(;X<S&&I[X]==="ON";)X++;const ue=(K>0?I[K-1]:R)!=="L"?"R":"L";if(ue===((X<S?I[X]:R)!=="L"?"R":"L"))for(let me=K;me<X;me++)I[me]=ue;K=X-1}for(let K=0;K<S;K++)I[K]==="ON"&&(I[K]=z);for(let K=0;K<S;K++){const X=I[K];1&W[K]?X!=="L"&&X!=="AN"&&X!=="EN"||W[K]++:X==="R"?W[K]++:X!=="AN"&&X!=="EN"||(W[K]+=2)}return W})(L);if(E===null)return null;const T=new Int8Array(w.length);for(let F=0;F<w.length;F++)T[F]=E[w[F]];return T})(e.normalized,g);return v!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:v}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function oee(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return nee((function(c,u,d="normal",f="normal"){const h=(function(b){const v=b??"normal";return v==="pre-wrap"?{mode:v,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:v,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
|
|
273
|
-
`).replace(/[\r\f]/g,`
|
|
274
|
-
`):b.replace(/\r\n/g,`
|
|
275
|
-
`)})(c):(function(b){if(!AJ.test(b))return b;let v=b.replace(CJ," ");return v.charCodeAt(0)===32&&(v=v.slice(1)),v.length>0&&v.charCodeAt(v.length-1)===32&&(v=v.slice(0,-1)),v})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=f==="keep-all"?(function(b){if(b.len<=1)return b;const v=[],m=[],y=[],k=[];let A=null,$=!1,L=0,w=!1,E=!1;function T(){A!==null&&(v.push(di(A)),m.push($),y.push("text"),k.push(L),A=null)}for(let F=0;F<b.len;F++){const S=b.texts[F],I=b.kinds[F],P=b.isWordLike[F],D=b.starts[F];if(I==="text"){const W=TJ(S),z=Iv(S);if(A!==null&&w&&E){A.push(S),$=$||P,w=w||W,E=z;continue}T(),A=[S],$=P,L=D,w=W,E=z;continue}T(),v.push(S),m.push(P),y.push(I),k.push(D)}return T(),{len:v.length,texts:v,isWordLike:m,kinds:y,starts:k}})(jS(p,u,h)):jS(p,u,h);return lt({normalized:p,chunks:GJ(g,h)},g)})(o,Rm(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const V0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Mo=(()=>{const e=globalThis;if(e[V0])return e[V0];const t={configs:{},controllers:{},revision:La(0),preparedCache:new Map,blockEstimateCache:new Map};return e[V0]=t,t})();let $u=null;const YS=Mo.revision;function ZS(e){var t;return e&&(t=Mo.configs[e])!=null?t:null}function XS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function see(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function K0(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!see(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+=`
|
|
276
|
-
`)}return s.length>0?s:null}function G0(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if($u!=null)return $u;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return $u=!!((i=r.getContext)!=null&&i.call(r,"2d")),$u}catch{return $u=!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=Mo.blockEstimateCache.get(r);if(l)return Mo.blockEstimateCache.delete(r),Mo.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,g){const b=`${g}\0${p}\0${h}`,v=Mo.preparedCache.get(b);if(v)return Mo.preparedCache.delete(b),Mo.preparedCache.set(b,v),v.prepared;const m=oee(h,p,{whiteSpace:g});for(Mo.preparedCache.set(b,{prepared:m});Mo.preparedCache.size>240;){const y=Mo.preparedCache.keys().next().value;if(!y)break;Mo.preparedCache.delete(y)}return m})(e,n.font,a),u=(function(h,p,g){const b=(function(v,m){return v.simpleLineWalkFastPath?GS(v,m):(function(y,k){if(y.simpleLineWalkFastPath)return GS(y,k);const{widths:A,lineEndFitAdvances:$,lineEndPaintAdvances:L,kinds:w,breakableFitAdvances:E,discretionaryHyphenWidth:T,tabStopAdvance:F,chunks:S}=y;if(A.length===0||S.length===0)return 0;const I=Rm(),P=I.lineFitEpsilon,D=k+P;let W=0,z=0,R=!1,q=0,K=0,X=-1,ue=0,me=0,ne=null;function ce(){X=-1,ue=0,me=0,ne=null}function de(J=q,ye=K,fe=z){W++,z=0,R=!1,ce()}function Ae(J,ye){R=!0,q=J+1,K=0,z=ye}function Le(J,ye,fe){R=!0,q=J,K=ye+1,z=fe}function le(J,ye){R?(z+=ye,q=J+1,K=0):Ae(J,ye)}function U(J,ye,fe,ve){if(!ye)return;const V=J==="tab"?0:$[fe],ee=J==="tab"?ve:L[fe];X=fe+1,ue=z-ve+V,me=z-ve+ee,ne=J}function ae(J,ye){const fe=E[J];for(let ve=ye;ve<fe.length;ve++){const V=fe[ve];R?z+V>D?(de(),Le(J,ve,V)):(z+=V,q=J,K=ve+1):Le(J,ve,V)}R&&q===J&&K===fe.length&&(q=J+1,K=0)}function se(J){if(ne!=="soft-hyphen")return!1;const ye=E[J];if(ye==null)return!1;const{fitCount:fe,fittedWidth:ve}=(function(V,ee,pe,Ce,$e){let De=0,ge=ee;for(;De<V.length;){const Ne=ge+V[De];if((De+1<V.length?Ne+$e:Ne)>pe+Ce)break;ge=Ne,De++}return{fitCount:De,fittedWidth:ge}})(ye,z,k,P,T);return fe!==0&&(z=ve,q=J,K=fe,ce(),fe===ye.length?(q=J+1,K=0,!0):(de(J,fe,ve+T),ae(J,fe),!0))}function j(J){W++,ce()}for(let J=0;J<S.length;J++){const ye=S[J];if(ye.startSegmentIndex===ye.endSegmentIndex){j();continue}R=!1,z=0,ye.startSegmentIndex,q=ye.startSegmentIndex,K=0,ce();let fe=ye.startSegmentIndex;for(;fe<ye.endSegmentIndex;){const ve=w[fe],V=ve==="space"||ve==="preserved-space"||ve==="tab"||ve==="zero-width-break"||ve==="soft-hyphen",ee=ve==="tab"?JJ(z,F):A[fe];if(ve!=="soft-hyphen")if(R){if(z+ee>D){const pe=z+(ve==="tab"?0:$[fe]),Ce=z+(ve==="tab"?ee:L[fe]);if(ne==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&ue<=D){de(X,0,me);continue}if(ne==="soft-hyphen"&&se(fe)){fe++;continue}if(V&&pe<=D){le(fe,ee),de(fe+1,0,Ce),fe++;continue}if(X>=0&&ue<=D){if(q>X||q===X&&K>0){de();continue}const $e=X;de($e,0,me),fe=$e;continue}if(ee>k&&E[fe]!==null){de(),ae(fe,0),fe++;continue}de();continue}le(fe,ee),U(ve,V,fe,ee),fe++}else ee>k&&E[fe]!==null?ae(fe,0):Ae(fe,ee),U(ve,V,fe,ee),fe++;else R&&(q=fe+1,K=0,X=fe+1,ue=z+T,me=z+T,ne=ve),fe++}if(R){const ve=X===ye.consumedEndSegmentIndex?me:z;de(ye.consumedEndSegmentIndex,0,ve)}}return W})(v,m)})(h,p);return{lineCount:b,height:b*g}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Mo.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Mo.blockEstimateCache.size>4e3;){const h=Mo.blockEstimateCache.keys().next().value;if(!h)break;Mo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function YM(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=K0(e.children);return i&&n.paragraph?G0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=K0(e.children),l=n.headings[i];return r&&l?G0(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=K0((s=i[0])==null?void 0:s.children);return r?G0(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=YM(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function Qf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function iee(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(Qf(String((d=u.originalCode)!=null?d:"")),Qf(String((f=u.updatedCode)!=null?f:"")),Qf(String((h=u.code)!=null?h:""))):Qf((function(p,g){const b=String(p??"");return g?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const g=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*g)})(u,r),f=(function(h,p){var g,b;if(!p)return 0;const v=typeof((g=h?.padding)==null?void 0:g.top)=="number"?h.padding.top:10,m=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,v)+Math.max(0,m)})(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 ree(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Y0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=XS(o.lineHeight,1.5*XS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:ree(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const lee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function QS(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))lee.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const aee=!1;function c_e(){return aee}function JS(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const ZM=Symbol("MarkstreamMathBlockMinHeightCache");function u_e(){return jt(ZM,null)}const cee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],uee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],dee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),XM=["raw","content","code","originalCode","updatedCode"],eC=new WeakMap,tC=new WeakMap;let fee=1;function Ti(){return typeof performance<"u"?performance.now():Date.now()}function nC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function gi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=eC.get(t);return n||(n=fee++,eC.set(t,n)),String(n)}function oC(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:gi(t),customMarkdownIt:gi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:gi(e.validateLink),preTransformTokens:gi(e.preTransformTokens),postTransformTokens:gi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function sC(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
277
|
-
`,t-1)+1;return e.slice(n,t).trim()}function iC(e){const t=QM(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function QM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function JM(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function wk(e){const t=String(e??"");return`${t.length}:${JM(t)}`}function Fv(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?wk(r):`${r.length}:${JM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${gi(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:${gi(o)}`;const i=gi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Fv(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}:${Fv(r[c],t,n+1)}`).join(";")}`}return typeof e}function Ep(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function e5(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Ep(o)?Fl(o,t,n+1):e5(o,t,n+1)).join(",")}`:Ep(e)?Fl(e,t,n):Fv(e,t,n)}function hee(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!XM.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${wk(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${gi(s)}`:dee.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${e5(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${gi(s)}`:""}).filter(Boolean).join(";")}function pee(e){return XM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${wk(n)}`:""}).filter(Boolean).join(";")}function Fl(e,t=new WeakMap,n=0){const o=tC.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}:${gi(s)}`;const r=gi(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Fl(p,c,u+1)).join("|"):"";return[a.type,pee(d),hee(d,c,u),f.length,h].join(":")})(e,t,n);return tC.set(s,l),l}function t5(e,t){return Fl(e)===Fl(t)}function _k(e,t,n){const o=Ti(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ti()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function rC(e,t,n){return _k(t,n,()=>Fl(e))}function n5(e,t,n){return rC(e,n,"stabilizeSignatureMs")===rC(t,n,"stabilizeSignatureMs")}function Z0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function lC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function mee(e,t){return e.length===t.length&&e===t}function Sk(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!mee(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Ep(d)||!Ep(f))return null;const h=Sk(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function gee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Sk(e,t);return n??t5(e,t)}function vee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return _k(n,"stabilizeSignatureMs",()=>{o=Sk(e,t)}),o??n5(e,t,n)}function yee(e,t){const n={};for(const o of cee){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function kee(e,t){var n;const o=dS(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),r=Z(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ti();function g(){l&&(clearTimeout(l),l=void 0)}function b(){g();const E=t.renderContent.value;r.value!==E&&(r.value=E),p=Ti()}Je([t.renderContent,t.effectiveFinal,i],([E,T,F])=>{r.value!==E&&(!F||T||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const P=I.slice(S.length);return!!P&&(!!iC(sC(I))||!(!P.includes(`
|
|
278
|
-
|
|
279
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
|
|
280
|
-
`)&&!(function(D){const W=sC(D);if(iC(W))return!1;const z=QM(W);return z.length>=2&&z.some(R=>R.trim())})(I))})(r.value,E)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const P=I.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(Ti()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),ry(g);const v=B(()=>{var E,T,F,S;return DV(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(T=t.customComponentsMap)==null?void 0:T.value)!=null?F:{},Object.entries(S).map(([I,P])=>{const D=wi(I);return P==null||!D||Yd(D)||T6.has(D)||Vd.has(D)?"":D}).filter(Boolean)))}),m=B(()=>{const{key:E,tags:T}=PV(v.value);if(!E)return o;const F=s.get(E);if(F)return F;const S=dS(t.instanceMsgId,{customHtmlTags:T});return s.set(E,S),S}),y=B(()=>{const E=m.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),k=B(()=>{var E,T;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=v.value,P=S!=null,D=I.length>0;return P||D||F.streamParse==null?lt(lt(Bt(lt({},F),{streamParse:(T=F.streamParse)==null||T}),P?{final:S}:{}),D?{customHtmlTags:I}:{}):F}),A=B(()=>{var E;return new Set(((E=k.value.customHtmlTags)!=null?E:[]).map(T=>String(T).trim().toLowerCase()).filter(Boolean))}),$=B(()=>oC(k.value,y.value,e.customMarkdownIt,{includeFinal:!0})),L=B(()=>oC(k.value,y.value,e.customMarkdownIt,{includeFinal:!1}));Je([$,L],([E,T],[F,S])=>{F&&(E===F&&T===S||(b(),T!==S&&(a=[],d="")))},{flush:"sync"});const w=B(()=>{var E,T,F,S,I,P,D,W;if((E=e.nodes)!=null&&E.length)return a=[],d="",mt(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const R=t.debugPerformanceEnabled.value,q=R?Ti():0,K=y.value,X=$.value,ue=L.value;c&&X!==c&&(function(ye){var fe,ve;(ve=(fe=ye.stream)==null?void 0:fe.reset)==null||ve.call(fe)})(K),u&&ue!==u&&(a=[],d="");const me=a.length>0&&z.startsWith(d)&&ue===u,ne=R?nC(K):null,ce=R?{}:void 0,de=ce?Bt(lt({},k.value),{__timing:ce}):k.value,Ae=vM(z,K,de),Le=R?Ti():0,le=R?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let U,ae=R?Z0(Ae.length):void 0,se=0,j=0;if(me){const ye=R?Ti():0;if(le){const fe=(function(ve,V,ee){if(!V.length)return{nodes:ve,metrics:Z0(ve.length)};const pe=(function(De,ge,Ne){const et=Math.min(De.length,ge.length);for(let rt=0;rt<et;rt++)if(!vee(ge[rt],De[rt],Ne))return rt;return De.length===ge.length?-1:et})(ve,V,ee);if(pe<0)return{nodes:V,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:pe,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const Ce=ve.slice();let $e=pe;for(let De=0;De<pe;De++)Ce[De]=V[De];for(let De=pe;De<ve.length;De++){const ge=V[De],Ne=ve[De];ge&&n5(ge,Ne,ee)&&(Ce[De]=ge,$e+=1)}return{nodes:Ce,metrics:{reusedNodeCount:$e,dirtyStartIndex:pe,stablePrefixNodeCount:pe,dirtyTailNodeCount:lC(pe,ve,V)}}})(Ae,a,le);U=fe.nodes,ae=fe.metrics}else{const fe=(function(ve,V){if(!V.length)return{nodes:ve,metrics:Z0(ve.length)};const ee=(function($e,De){const ge=Math.min($e.length,De.length);for(let Ne=0;Ne<ge;Ne++)if(!gee(De[Ne],$e[Ne]))return Ne;return $e.length===De.length?-1:ge})(ve,V);if(ee<0)return{nodes:V,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:ee,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const pe=ve.slice();let Ce=ee;for(let $e=0;$e<ee;$e++)pe[$e]=V[$e];for(let $e=ee;$e<ve.length;$e++){const De=V[$e],ge=ve[$e];De&&t5(De,ge)&&(pe[$e]=De,Ce+=1)}return{nodes:pe,metrics:{reusedNodeCount:Ce,dirtyStartIndex:ee,stablePrefixNodeCount:ee,dirtyTailNodeCount:lC(ee,ve,V)}}})(Ae,a);U=fe.nodes,ae=fe.metrics}se=R?Ti()-ye:0,j=ae?.dirtyStartIndex==null||ae.dirtyStartIndex<0?U.length:ae.dirtyStartIndex}else U=Ae;le?(function(ye,fe,ve=0){for(let V=Math.max(0,ve);V<ye.length;V++)_k(fe,"primeSignatureMs",()=>Fl(ye[V]))})(U,le,j):(function(ye,fe=0){for(let ve=Math.max(0,fe);ve<ye.length;ve++)Fl(ye[ve])})(U,j);const J=R?Ti()-Le:0;if(f+=1,d=z,c=X,u=ue,a=U,R){const ye=nC(K),fe=typeof ye?.total=="number"&&ye.total>((T=ne?.total)!=null?T:0);t.logPerf(fe?"parse(stream)":"parse(sync)",lt(lt(lt({rendererId:t.instanceMsgId,ms:Math.round(Ti()-q),nodes:U.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:J,signatureMs:(F=le?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=le?.primeSignatureMs)!=null?I:0,signatureCallCount:(P=le?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(D=le?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(W=le?.primeSignatureCallCount)!=null?W:0,stabilizeMs:se},ae??{}),ce?Object.fromEntries(uee.map(ve=>{var V;return[ve,(V=ce[ve])!=null?V:0]})):{}),ye?{streamMode:ye.lastMode,streamDelta:yee(ye,ne),streamStats:ye}:{}))}return mt(U)});return{effectiveCustomHtmlTags:v,effectiveCustomHtmlTagsSet:A,mdBase:m,mdInstance:y,mergedParseOptions:k,parsedNodes:w}}function bee(e){const{isClient:t}=e,n=Z(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((g=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!g)return;var p,g;const b=n.value,v=b.has(f);if(h){if(v)return;const y=new Set(b);return y.add(f),void(n.value=y)}if(!v)return;const m=new Set(b);m.delete(f),n.value=m})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function xee(e={}){const t=Z(""),n=Z(""),o=Z(!1),s=wX(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=B(()=>Math.max(0,t.value.length-n.value.length)),a=B(()=>l.value===0),c=B(()=>o.value&&a.value);return iy()&&ry(()=>{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 aC=/auto|scroll|overlay/i;function wee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return aC.test(t)||aC.test(n)}function _ee(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 See=Ze({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return bv((o=_c(e.estimatedPreviewHeightPx))!=null?o:yv(String((n=e.node.code)!=null?n:"")))});return()=>gn("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?gn("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)"}},[gn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[gn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),gn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),gn("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},()=>gn("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,gn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[gn("div",{class:"absolute inset-0"},[gn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),Cee=Ze({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return kv((o=_c(e.estimatedPreviewHeightPx))!=null?o:vv(String((n=e.node.code)!=null?n:"")))});return()=>gn("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?gn("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)"}},[gn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[gn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),gn("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},()=>gn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[gn("span",{class:"action-icon block"})])))]):null,gn("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)"}},[gn("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"}})])])}}),Aee=["data-custom-id"],Mee={class:"m-0 p-0"},Eee=["data-probe"],Tee=["data-node-index","data-node-type"],o5=vn(Ze(Bt(lt({},{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=Zo(),r=jt("markstreamNestedRendererProps",void 0);function l(M){var H,G;const Y=o[M];return(function(oe){const _e=i?.vnode.props;return!!_e&&(Object.prototype.hasOwnProperty.call(_e,oe)||Object.prototype.hasOwnProperty.call(_e,String(oe).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?Y:(G=(H=r?.value)==null?void 0:H[M])!=null?G:Y}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=B(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=B(()=>{const M=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return M===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:M===!1||c.value==="docs"?"monaco":"pre"}),d=B(()=>a[c.value]),f=B(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),h=B(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),p=B(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),g=B(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),b=B(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),v=B(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),m=B(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),y=B(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),k=B(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=B(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),$=B(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),L=B(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),w={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return v.value},get renderBatchBudgetMs(){return m.value},get renderBatchIdleTimeoutMs(){return y.value},get deferNodesUntilVisible(){return k.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return $.value},get nodeVirtual(){return L.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function E(M){s("height-change",M)}function T(M){s("virtual-state-change",M)}function F(M){s("anchor-change",M)}const S=Z(),I=Z(null),P=Z(null),D=Z(null),W=Ro({1:null,2:null,3:null,4:null,5:null,6:null}),z=Z(!1),R=new Map,q=Z(0),K=Z(0),X=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ue(){var M,H;if(((M=o.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const G=(H=o.virtualScroll)==null?void 0:H.scrollRoot;return me(typeof G=="function"?G():G)}function me(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?me(M.value):typeof M=="object"&&"$el"in M?me(M.$el):null:null}const{isClient:ne,renderAsFragment:ce,debugPerformanceEnabled:de,resolvedShowTooltips:Ae,resolvedHtmlPolicy:Le,inheritedSmoothStreaming:le,ownsTypewriterCursor:U}=(function(M){const H=typeof window<"u",G=Wd(),Y=jt("markstreamHtmlPolicy",void 0),oe=jt("markstreamTypewriterCursor",void 0),_e=jt("markstreamSmoothStreaming",void 0),Me=B(()=>M.renderAsFragment===!0),Ie=B(()=>!!(M.debugPerformance&&H&&typeof console<"u")),qe=B(()=>{var je;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Be=(je=G.showTooltips)!=null?je:G["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Re=B(()=>{var je,Be;return(Be=(je=M.htmlPolicy)!=null?je:Y?.value)!=null?Be:"safe"}),Ge=B(()=>oe?.value!==!0);return{isClient:H,renderAsFragment:Me,debugPerformanceEnabled:Ie,resolvedShowTooltips:qe,resolvedHtmlPolicy:Re,inheritedSmoothStreaming:_e,inheritedTypewriterCursor:oe,ownsTypewriterCursor:Ge}})(w),{resolveViewportRoot:ae,resolveScrollContainer:se,isReverseFlexScrollRoot:j,getNormalizedScrollTop:J,getOffsetTopWithinRoot:ye}=(function(M,H){function G(){var Ie,qe;return(qe=(Ie=H.scrollRoot)==null?void 0:Ie.call(H))!=null?qe:null}function Y(Ie){if(typeof window>"u")return null;const qe=G();if(qe)return qe;const Re=Ie??M.value;if(!Re)return null;const Ge=Re.ownerDocument||document,je=Ge.scrollingElement||Ge.documentElement;let Be=Re;for(;Be&&Be!==Ge.body&&Be!==je;){if(wee(window.getComputedStyle(Be))&&_ee(Be))return Be;Be=Be.parentElement}return null}function oe(Ie){if(!H.isClient)return!1;try{const qe=window.getComputedStyle(Ie);return!!(qe.display||"").toLowerCase().includes("flex")&&(qe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function _e(Ie,qe,Re){var Ge,je;if(Re)return Me(qe);const Be=Ie.scrollTop;if(!oe(Ie))return Be;const Ke=Be<0?-Be:Be;return Math.max(0,((Ge=Ie.scrollHeight)!=null?Ge:0)-((je=Ie.clientHeight)!=null?je:0))-Ke}function Me(Ie){var qe,Re,Ge,je,Be;const Ke=Number((qe=Ie.scrollingElement)==null?void 0:qe.scrollTop),tt=Number((Ge=(Re=Ie.documentElement)==null?void 0:Re.scrollTop)!=null?Ge:0),nt=Number((Be=(je=Ie.body)==null?void 0:je.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Ke)?Ke:0,Number.isFinite(tt)?tt:0,Number.isFinite(nt)?nt:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(Ie){var qe,Re,Ge,je;const Be=G();if(Be)return Be;const Ke=Y((qe=Ie??M.value)!=null?qe:null);if(Ke)return Ke;const tt=(je=(Ge=Ie?.ownerDocument)!=null?Ge:(Re=M.value)==null?void 0:Re.ownerDocument)!=null?je:typeof document<"u"?document:null;return tt?.scrollingElement||tt?.documentElement||null},isReverseFlexScrollRoot:oe,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:function(Ie,qe){const Re=qe.ownerDocument||Ie.ownerDocument||document;if((function(Ke,tt){return Ke===tt.documentElement||Ke===tt.body||Ke===tt.scrollingElement})(qe,Re))return Ie.getBoundingClientRect().top+Me(Re);const Ge=qe.getBoundingClientRect(),je=Ie.getBoundingClientRect(),Be=_e(qe,Re,!1);return je.top-Ge.top+Be}}})(S,{isClient:ne,scrollRoot:ue});Nn("markstreamShowTooltips",Ae),Nn("markstreamHtmlPolicy",Le),Nn("markstreamTypewriter",B(()=>w.typewriter!==!1)),Nn("markstreamFade",B(()=>w.fade!==!1)),Nn("markstreamTypewriterCursor",B(()=>!0)),Nn("markstreamTextStreamState",R),Nn("markstreamStreamVersion",q),Nn("markstreamParseOptions",B(()=>w.parseOptions)),Nn("markstreamCustomMarkdownIt",B(()=>w.customMarkdownIt));const{smoothStreamingEnabled:fe,renderContent:ve,effectiveFinal:V}=(function(M,H){const G=xee(M.smoothStreamingOptions),Y=B(()=>{var Re,Ge,je;return M.smoothStreaming!==!1&&!((Re=M.nodes)!=null&&Re.length)&&(M.smoothStreaming===!0||!((Ge=H.inheritedSmoothStreaming)!=null&&Ge.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((je=M.maxLiveNodes)!=null?je:0)<=0)}),oe=Z(!H.isClient||M.smoothStreaming===!0);un(()=>{oe.value=!0});const _e=B(()=>oe.value&&Y.value),Me=B(()=>{var Re;return _e.value?G.visible.value:(Re=M.content)!=null?Re:""}),Ie=B(()=>{var Re,Ge;const je=(Re=M.parseOptions)!=null?Re:{};return(Ge=M.final)!=null?Ge:je.final}),qe=B(()=>{const Re=Ie.value;return _e.value&&Re!=null?!!Re&&G.caughtUp.value:Re});return Je([()=>M.content,()=>M.nodes,_e,Ie],([Re,Ge,je,Be])=>{if(Ge?.length)return void G.reset("");const Ke=Re??"";if(!je)return G.reset(Ke),void(Be&&G.finish({flush:!0}));const tt=G.source.value;Ke?Ke===tt||(Ke.startsWith(tt)?G.enqueue(Ke.slice(tt.length)):G.reset(Ke)):G.reset(""),Be&&G.finish()},{immediate:!0}),{smoothStream:G,smoothStreamingEligible:Y,smoothStreamingEnabled:_e,renderContent:Me,requestedFinal:Ie,effectiveFinal:qe}})(w,{isClient:ne,inheritedSmoothStreaming:le});Nn("markstreamSmoothStreaming",fe);const ee=Z(!1);let pe="",Ce=!1,$e=null;function De(){ne&&$e!=null&&(window.clearTimeout($e),$e=null)}function ge(){ee.value=!1,De()}function Ne(M,H){if(!de.value)return;const G=(function(){if(!de.value)return null;const Y=Nt(et),oe=Nt(rt),_e=Math.max(vt,oe);if(Y<=0&&_e<=0)return null;const Me={total:Y,maxPerFrame:_e,byLabel:(Ie=et,Object.fromEntries(Array.from(Ie.entries()).sort((qe,Re)=>Re[1]-qe[1]||qe[0].localeCompare(Re[0]))))};var Ie;return et.clear(),rt.clear(),vt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,G?Bt(lt({},H),{layoutReads:G}):H)}Je([ve,()=>o.nodes,V],([M,H,G])=>{const Y=M??"";return H?.length||G===!0?(ge(),pe=Y,void(Ce=!0)):Ce?(pe&&Y.length>pe.length&&Y.startsWith(pe)?(ee.value=!0,ne&&(De(),$e=window.setTimeout(()=>{var oe;$e=null,V.value===!0||(oe=o.nodes)!=null&&oe.length||(Va(),ee.value=!1,cr())},1200))):(Y.length<pe.length||!Y.startsWith(pe))&&ge(),void(pe=Y)):(pe=Y,void(Ce=!0))},{flush:"sync",immediate:!0});const et=new Map,rt=new Map;let St=!1,vt=0;function Nt(M){let H=0;for(const G of M.values())H+=G;return H}function Wt(){vt=Math.max(vt,Nt(rt)),rt.clear(),St=!1}function ht(M,H){return(function(G){var Y,oe;de.value&&(et.set(G,((Y=et.get(G))!=null?Y:0)+1),rt.set(G,((oe=rt.get(G))!=null?oe:0)+1),St||(St=!0,ne&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Wt):typeof queueMicrotask!="function"?setTimeout(Wt,0):queueMicrotask(Wt)))})(M),H()}const dn=w.customId?`renderer-${w.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,fn=(function(M){const H=new Map;return{scope:M,cache:H,clear:()=>H.clear()}})(dn),ss=B(()=>`${dn}:${q.value}`);Nn(ZM,fn);const Dt=_o(()=>w.customId),{effectiveCustomHtmlTagsSet:Pn,mergedParseOptions:ao,parsedNodes:it}=kee(w,{instanceMsgId:dn,renderContent:ve,effectiveFinal:V,smoothStreamingEnabled:fe,debugPerformanceEnabled:de,customComponentsMap:Dt,logPerf:Ne});Je(it,()=>{fn.clear(),q.value+=1},{immediate:!0});const Gn=B(()=>({customId:w.customId,customHtmlTags:ao.value.customHtmlTags,parseOptions:w.parseOptions,customMarkdownIt:w.customMarkdownIt,htmlPolicy:Le.value,viewportPriority:w.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:w.codeBlockStream,codeBlockDarkTheme:w.codeBlockDarkTheme,codeBlockLightTheme:w.codeBlockLightTheme,codeBlockMonacoOptions:w.codeBlockMonacoOptions,renderCodeBlocksAsPre:w.renderCodeBlocksAsPre,codeBlockMinWidth:w.codeBlockMinWidth,codeBlockMaxWidth:w.codeBlockMaxWidth,codeBlockProps:w.codeBlockProps,mermaidProps:w.mermaidProps,d2Props:w.d2Props,infographicProps:w.infographicProps,showTooltips:Ae.value,themes:w.themes,langs:w.langs,isDark:w.isDark,typewriter:w.typewriter,smoothStreamingOptions:w.smoothStreamingOptions,parseCoalesceMs:w.parseCoalesceMs,fade:w.fade}));Nn("markstreamNestedRendererProps",Gn);const co=B(()=>it.value),Yn=B(()=>it.value.length),mo=Z(null),is=Z(null),qn=Z(null),to=Z(null),yn=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Zn=!yn&&w.customId?ZS(w.customId):null,wn=B(()=>Zn?(YS.value,ZS(w.customId)):null),An=B(()=>{var M;return!!(ne&&!ce.value&&w.customId&&!yn&&((M=wn.value)!=null&&M.enabled))}),Mn=B(()=>{var M;return!!(!ce.value&&((M=o.virtualScroll)!=null&&M.enabled))}),Bo=Z(!1);un(()=>{Bo.value=!0});const ze=B(()=>!!(ne&&Mn.value));Nn("markstreamHostScrollManaged",ze);const Qe=B(()=>!!(Bo.value&&ze.value)),bt=B(()=>An.value||ze.value),Pt=B(()=>An.value||Qe.value),Hn=B(()=>{var M;return bt.value&&((M=wn.value)==null?void 0:M.textEstimation)!==!1}),rn=B(()=>{var M;return bt.value&&((M=wn.value)==null?void 0:M.codeBlockEstimation)!==!1});function Ut(){const M=K.value||ht("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const En=B(()=>{const M=Ut();return M>0?Math.max(1,Math.round(M)):640}),jn=B(()=>{var M;return Math.max(1,(M=w.maxLiveNodes)!=null?M:320)}),Ct=B(()=>{var M;return!ce.value&&w.nodeVirtual!==!1&&!(((M=w.maxLiveNodes)!=null?M:0)<=0)&&(w.nodeVirtual===!0?it.value.length>0:it.value.length>jn.value)}),Do=B(()=>Ct.value||An.value||ze.value),So=B(()=>w.viewportPriority!==!1&&!z.value),Xo=lJ(M=>{var H;return ae((H=M??S.value)!=null?H:null)},So),{requestFrame:Fn,cancelFrame:Wn,hasIdleCallback:ti,isTestEnv:Ps}=(function(M){const H=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,G=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=M.isClient&&typeof window.requestIdleCallback=="function",oe=(function(){var _e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(_e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:_e.value;return Me?.env})();return{requestFrame:H,cancelFrame:G,hasIdleCallback:Y,isTestEnv:oe?.NODE_ENV==="test"}})({isClient:ne}),{resolvedBatchSize:Po,resolvedInitialBatch:Ss,batchingEnabled:Pi,incrementalRenderingActive:_i,renderedCount:uo,previousRenderContext:ni,adaptiveBatchSize:Si,previousBatchConfig:rr}=(function(M,H){var G;const Y=B(()=>{var je;const Be=Math.trunc((je=M.renderBatchSize)!=null?je:80);return Number.isFinite(Be)?Math.max(0,Be):0}),oe=B(()=>{var je;const Be=Math.trunc((je=M.initialRenderBatchSize)!=null?je:Y.value);return Number.isFinite(Be)?Math.max(0,Be):Y.value}),_e=B(()=>!H.renderAsFragment.value&&M.batchRendering!==!1&&Y.value>0&&H.isClient&&!H.isTestEnv),Me=Z(0),Ie=Z({key:M.indexKey,total:0}),qe=Z(Math.max(1,Y.value||1)),Re=B(()=>{var je;return _e.value&&((je=M.maxLiveNodes)!=null?je:0)<=0}),Ge=Z({batchSize:Y.value,initial:oe.value,delay:(G=M.renderBatchDelay)!=null?G:16,enabled:Re.value});return{resolvedBatchSize:Y,resolvedInitialBatch:oe,batchingEnabled:_e,incrementalRenderingActive:Re,renderedCount:Me,previousRenderContext:Ie,adaptiveBatchSize:qe,previousBatchConfig:Ge}})(w,{isClient:ne,isTestEnv:Ps,renderAsFragment:ce}),no=new Map,rs=new Map,ls=new WeakMap;let No=null;const Ci=new WeakMap,zn=new Map,Io=Z(0),oi=B(()=>(Io.value,Array.from(no.entries()).sort((M,H)=>M[0]-H[0]))),Ue=Z(null),Oe=Z(null);let te=null,Te=0,he=null;const{activeRestoreAnchor:we,getRelativeScrollTopWithinContainer:He,setRelativeScrollTopWithinContainer:Ft,resolveAnchorOffset:Rt,clearRestoreReconcile:ln,scheduleRestoreReconcile:Un,captureRestoreAnchor:Q,restoreAnchor:be,getAnchorDrift:Se}=(function(M){const{isClient:H,containerRef:G,parsedNodeCount:Y,requestFrame:oe,cancelFrame:_e,resolveScrollContainer:Me,getNormalizedScrollTop:Ie,getOffsetTopWithinRoot:qe,isReverseFlexScrollRoot:Re,estimateIndexForOffset:Ge,estimateHeightRange:je,getFallbackNodeHeight:Be,clamp:Ke}=M,tt=Z(null);let nt=null,_t=[];function at(){const It=Me(),zt=G.value;if(!It||!zt)return null;const Ht=It.ownerDocument||zt.ownerDocument||document;if(It===Ht.documentElement||It===Ht.body||It===Ht.scrollingElement){const hn=zt.getBoundingClientRect();return Math.max(0,-hn.top)}return Math.max(0,Ie(It,Ht,!1)-qe(zt,It))}function ft(It){var zt;const Ht=Me(),hn=G.value;if(!Ht||!hn)return;const Us=Math.max(0,It),as=Ht.ownerDocument||hn.ownerDocument||document,Mi=as.defaultView||(typeof window<"u"?window:null);if(Ht===as.documentElement||Ht===as.body||Ht===as.scrollingElement){const Yr=Ie(Ht,as,!0)+hn.getBoundingClientRect().top;return void((zt=Mi?.scrollTo)==null||zt.call(Mi,0,Math.max(0,Yr+Us)))}JS(Ht,as,qe(hn,Ht)+Us,{isReverseFlexScrollRoot:Yr=>{var Zr;return(Zr=Re?.(Yr))!=null&&Zr},getNormalizedScrollTop:Ie})}function Mt(It){const zt=Y.value,Ht=Ke(It.nodeIndex,0,Math.max(0,zt-1));return je(0,Ht)+Math.max(0,It.offsetWithinNodePx)}function At(){if(nt!=null&&(_e?.(nt),nt=null),H)for(const It of _t)window.clearTimeout(It);_t=[]}function nn(It){const zt=Mt(It),Ht=at();Ht!=null&&Math.abs(Ht-zt)<=.5||ft(zt)}return{activeRestoreAnchor:tt,getRelativeScrollTopWithinContainer:at,setRelativeScrollTopWithinContainer:ft,resolveAnchorOffset:Mt,clearRestoreReconcile:At,applyRestoreAnchor:nn,scheduleRestoreReconcile:function(){tt.value&&H&&nt==null&&(nt=oe?oe(()=>{nt=null,tt.value&&nn(tt.value)}):null,nt==null&&tt.value&&nn(tt.value))},captureRestoreAnchor:function(){const It=at(),zt=Y.value;if(It==null||zt<=0)return null;const Ht=Ke(Ge(It+1),0,zt-1),hn=je(0,Ht),Us=Be(Ht);return{nodeIndex:Ht,offsetWithinNodePx:Ke(It-hn,0,Math.max(0,Us-1))}},restoreAnchor:function(It){const zt=Y.value;if(tt.value={nodeIndex:Ke(It.nodeIndex,0,Math.max(0,zt-1)),offsetWithinNodePx:Math.max(0,It.offsetWithinNodePx)},At(),nn(tt.value),H)for(const Ht of[0,120,280,480])_t.push(window.setTimeout(()=>{tt.value&&nn(tt.value)},Ht))},getAnchorDrift:function(It){const zt=at();return zt==null?null:zt-Mt(It)}}})({isClient:ne,containerRef:S,parsedNodeCount:Yn,requestFrame:Fn,cancelFrame:Wn,resolveScrollContainer:()=>Ue.value||se(),getNormalizedScrollTop:J,getOffsetTopWithinRoot:ye,isReverseFlexScrollRoot:j,estimateIndexForOffset:L1,estimateHeightRange:Gr,getFallbackNodeHeight:cf,clamp:zo}),{nodeHeights:Fe,heightStats:Ye,heightTreeSize:st,heightSumTree:Tt,heightKnownTree:Qt,averageNodeHeight:Kt,resetHeightMeasurements:Jt,pruneHeightMeasurements:Ho,rebuildHeightTrees:Lo,recordNodeHeight:pt,removeNodeHeights:qt,exportHeightCache:en,importHeightCache:Co,fenwickRangeSum:oo}=(function(M={}){const H=Ro({}),G=Ro({total:0,count:0}),Y=Z(0),oe=Z([]),_e=Z([]);function Me(){for(const Be of Object.keys(H))delete H[Number(Be)];G.total=0,G.count=0,Y.value=0,oe.value=[],_e.value=[]}function Ie(Be,Ke,tt){for(let nt=Ke+1;nt<Be.length;nt+=nt&-nt)Be[nt]+=tt}function qe(Be,Ke){let tt=0;for(let nt=Ke+1;nt>0;nt-=nt&-nt)tt+=Be[nt];return tt}function Re(Be){Y.value=Be;const Ke=new Array(Be+1).fill(0),tt=new Array(Be+1).fill(0);for(const[nt,_t]of Object.entries(H)){const at=Number(nt),ft=Number(_t);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0||(Ie(Ke,at,ft),Ie(tt,at,1))}oe.value=Ke,_e.value=tt}function Ge(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Ke=H[Be];if(!Number.isFinite(Ke)||Ke<=0)return!1;if(delete H[Be],G.total=Math.max(0,G.total-Ke),G.count=Math.max(0,G.count-1),Y.value>Be){const tt=oe.value,nt=_e.value;tt.length&&nt.length&&(Ie(tt,Be,-Ke),Ie(nt,Be,-1))}return!0}const je=B(()=>G.count>0?Math.max(12,G.total/G.count):32);return{nodeHeights:H,heightStats:G,heightTreeSize:Y,heightSumTree:oe,heightKnownTree:_e,averageNodeHeight:je,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Be){if(Be<=0)return void Me();let Ke=0,tt=0;for(const[nt,_t]of Object.entries(H)){const at=Number(nt),ft=Number(_t);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0?delete H[at]:(Ke+=ft,tt++)}G.total=Ke,G.count=tt},rebuildHeightTrees:Re,recordNodeHeight:function(Be,Ke,tt={}){(function(nt,_t,at={}){var ft;if(!Number.isFinite(_t)||_t<=0)return!1;const Mt=H[nt];if(Mt&&(at.allowShrink===!1&&_t<Mt||Math.abs(_t-Mt)<=1))return!1;if(H[nt]=_t,Mt?G.total+=_t-Mt:(G.total+=_t,G.count++),Y.value>nt){const At=oe.value,nn=_e.value;if(At.length&&nn.length)if(Mt){const It=_t-Mt;It!==0&&Ie(At,nt,It)}else Ie(At,nt,_t),Ie(nn,nt,1)}at.notify!==!1&&((ft=M.onHeightRecorded)==null||ft.call(M))})(Be,Ke,Bt(lt({},tt),{notify:!0}))},removeNodeHeight:function(Be,Ke={}){var tt;const nt=Ge(Be);return nt&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},removeNodeHeights:function(Be,Ke={}){var tt;let nt=0;for(const _t of Be)Ge(Number(_t))&&nt++;return nt>0&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},exportHeightCache:function(){return Object.entries(H).map(([Be,Ke])=>({index:Number(Be),height:Number(Ke)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Ke)=>Be.index-Ke.index)},importHeightCache:function(Be,Ke={}){var tt;if(!Array.isArray(Be))return;const nt=Y.value;let _t=!1;if(Ke.mode!=="merge"){const at=Object.keys(H);if(at.length>0){for(const ft of at)delete H[Number(ft)];_t=!0}}for(const at of Be){const ft=Number(at.index),Mt=Number(at.height);if(!Number.isInteger(ft)||ft<0||nt>0&&ft>=nt||!Number.isFinite(Mt)||Mt<=0)continue;const At=H[ft];At&&Math.abs(At-Mt)<=1||(H[ft]=Mt,_t=!0)}_t&&((function(){let at=0,ft=0;const Mt=Y.value;for(const[At,nn]of Object.entries(H)){const It=Number(At),zt=Number(nn);!Number.isFinite(It)||It<0||Mt>0&&It>=Mt||!Number.isFinite(zt)||zt<=0?delete H[It]:(at+=zt,ft++)}G.total=at,G.count=ft})(),nt>0&&Re(nt),(tt=M.onHeightRecorded)==null||tt.call(M))},fenwickRangeSum:function(Be,Ke,tt){if(tt<=Ke)return 0;const nt=qe(Be,tt-1);return Ke<=0?nt:nt-qe(Be,Ke-1)}}})({onHeightRecorded:()=>{ii(),ze.value&&xu(),we.value&&Un(),Oe.value&&Ua(),On("node-resize")}});function Ai(){Jt(),zn.clear()}function Wl(M){!Number.isInteger(M)||M<0||M>=it.value.length||zn.set(M,uu(M))}function tf(M,H,G={}){const Y=Fe[M];pt(M,H,G);const oe=Fe[M];oe&&oe>0?Wl(M):Y&&zn.delete(M)}function f2(M,H){const G=ht("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,oe;return(oe=(Y=no.get(M))==null?void 0:Y.offsetHeight)!=null?oe:0});return G>0?G:ht("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function h2(M,H={}){Co(M,H),_1()}const qr=B(()=>{var M;return!ce.value&&w.deferNodesUntilVisible!==!1&&!(((M=w.maxLiveNodes)!=null?M:0)<=0)&&!Ct.value&&!(it.value.length>900)&&So.value}),p2=B(()=>!!Xo&&(qr.value||Ct.value)),m2=B(()=>Ct.value||ze.value),{liveNodeBufferResolved:ru,focusIndex:si,liveRange:Wo,updateLiveRange:zl}=(function(M,H){const{parsedNodeCount:G,virtualizationEnabled:Y,maxLiveNodesResolved:oe,clamp:_e}=H,Me=B(()=>{var Re;return Math.max(0,(Re=M.liveNodeBuffer)!=null?Re:60)}),Ie=Z(0),qe=Ro({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Ie,liveRange:qe,updateLiveRange:function(){const Re=G.value;if(!Y.value||Re===0)return qe.start=0,void(qe.end=Re);const Ge=Math.min(oe.value,Re),je=Me.value,Be=_e(Ie.value-je,0,Math.max(0,Re-Ge));qe.start=Be,qe.end=Math.min(Re,Be+Ge)}}})(w,{parsedNodeCount:Yn,virtualizationEnabled:Ct,maxLiveNodesResolved:jn,clamp:zo}),Hi=new Map,Ul=new Map,jr=new Map,nf=[],lr=new Map,Vr=new Set,g2=Z(0);let Zm=!1;const v2=B(()=>(g2.value,Vr.size)),Hs=new Map,Wi=new Map,y2=Z(0),Xm=B(()=>{y2.value;let M=0;for(const H of Hs.values())M+=Math.max(0,H);return M});let Ws=null,Qm=!0,k2=[0],b2="";function ii(){Qm=!0}const of=B(()=>{if(!Ct.value)return it.value.length;const M=ru.value,H=Math.max(Wo.end+M,Ss.value),G=Math.min(it.value.length,H);return Math.max(uo.value,G)});function sf(){Zm||(Zm=!0,queueMicrotask(()=>{Zm=!1,g2.value+=1}))}function x2(M,H,G="node-resize"){if(!ne||typeof window>"u")return null;const Y=window.setTimeout(()=>{Vr.delete(Y)&&sf();try{H()}finally{On(G)}},Math.max(0,M));return Vr.add(Y),sf(),Y}function rf(M){ne&&M!=null&&(Vr.delete(M)&&sf(),window.clearTimeout(M))}function w2(){if(ne&&typeof window<"u")for(const M of Vr)window.clearTimeout(M);Vr.size&&(Vr.clear(),sf()),nf.length=0,jr.clear()}function I8(M){var H,G;return(G=(H=to.value)==null?void 0:H[M])!=null?G:null}const{cancelScheduledFocusSync:Jm,scheduleFocusSync:zi}=(function(M){const{isClient:H,containerRef:G,virtualizationEnabled:Y,requestFrame:oe,cancelFrame:_e,syncFocusToScroll:Me}=M;let Ie=null;function qe(){var Ge,je,Be;return(Be=(je=(Ge=G.value)==null?void 0:Ge.ownerDocument)==null?void 0:je.defaultView)!=null?Be:typeof window<"u"?window:null}function Re(){if(!Ie)return;const Ge=qe();Ie.viaTimeout?Ge?Ge.clearTimeout(Ie.id):clearTimeout(Ie.id):_e?.(Ie.id),Ie=null}return{cancelScheduledFocusSync:Re,scheduleFocusSync:function(Ge={}){if(!Y.value)return;if(!H)return void Me(!0);if(Ge.immediate)return Re(),void Me(!0);if(Ie)return;const je=()=>{Ie=null,Me()};if(oe)return void(Ie={id:oe(je),viaTimeout:!1});const Be=qe();Ie={id:Be?Be.setTimeout(je,16):setTimeout(je,16),viaTimeout:!0}}}})({isClient:ne,containerRef:S,virtualizationEnabled:Ct,requestFrame:Fn,cancelFrame:Wn,syncFocusToScroll:function(M=!1){var H;if(!Ct.value)return;const G=Ue.value||se();if(!G)return;const Y=G.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,oe=Y?.defaultView||(typeof window<"u"?window:null),_e=G===Y?.documentElement||G===Y?.body,Me=it.value.length;if(!_e&&Me>0&&j(G)){const tt=ht("syncFocusToScroll.clientHeight",()=>G.clientHeight||0),nt=ht("syncFocusToScroll.scrollTop",()=>G.scrollTop),_t=nt<0?-nt:nt,at=(function(Mt){var At,nn;const It=it.value;if(!It.length)return 0;if(Mt<=0)return Math.max(0,It.length-1);if(bt.value){const Ht=(At=s1()[It.length])!=null?At:0;return N2(Math.max(0,Ht-Mt))}if(st.value===It.length){const Ht=Gr(0,It.length);return L1(Math.max(0,Ht-Mt))}let zt=Mt;for(let Ht=It.length-1;Ht>=0;Ht--){const hn=(nn=Fe[Ht])!=null?nn:Kt.value;if(zt<=hn)return Ht;zt-=hn}return 0})(Math.max(0,_t)+.5*Math.max(0,tt)),ft=zo(at,0,Math.max(0,Me-1));return void((M||Math.abs(ft-si.value)>1)&&(si.value=ft,zl()))}const Ie=_e?null:ht("syncFocusToScroll.root.getBoundingClientRect",()=>G.getBoundingClientRect()),qe=_e?0:Ie.top,Re=_e?ht("syncFocusToScroll.viewport.clientHeight",()=>{var tt,nt;return(nt=(tt=oe?.innerHeight)!=null?tt:G.clientHeight)!=null?nt:0}):Ie.bottom,Ge=oi.value;let je=null,Be=null;for(const[tt,nt]of Ge){if(!nt)continue;const _t=ht("syncFocusToScroll.slot.getBoundingClientRect",()=>nt.getBoundingClientRect());_t.bottom<=qe||_t.top>=Re||(je==null&&(je=tt),Be=tt)}if(je==null||Be==null){const tt=S.value;if(!tt)return;const nt=_e?{top:0}:ht("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>G.getBoundingClientRect()),_t=ht("syncFocusToScroll.fallback.scrollTop",()=>J(G,Y,_e)),at=_e?(()=>{const At=ht("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>tt.getBoundingClientRect()),nn=(_e?0:nt.top)-At.top;return Math.max(0,nn)})():(()=>{const At=ye(tt,G);return Math.max(0,_t-At)})(),ft=_e?ht("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var At,nn,It,zt;return(zt=(It=(nn=oe?.innerHeight)!=null?nn:(At=Y?.documentElement)==null?void 0:At.clientHeight)!=null?It:G.clientHeight)!=null?zt:0}):ht("syncFocusToScroll.fallback.root.clientHeight",()=>G.clientHeight),Mt=L1(at+.5*Math.max(0,ft));return si.value=zo(Mt,0,Math.max(0,it.value.length-1)),void zl()}const Ke=Math.round((je+Be)/2);!M&&Math.abs(Ke-si.value)<=1||(si.value=zo(Ke,0,Math.max(0,it.value.length-1)),zl())}}),{visibleNodeIndices:e1,nodeVisibilityHandles:Ra,nodeVisibilityWatchStops:lf,nodeVisibilityFallbackTimers:_2,clearVisibilityFallback:af,markNodeVisible:Kr,cleanupNodeVisibility:L8,destroyNodeVisibilityState:t1}=bee({isClient:ne,shouldTrackVisibleNodeIndices:()=>qr.value,shouldCleanupNodeVisibility:()=>Ct.value,onNodeMarkedVisible:M=>{Ct.value?zi():si.value=zo(M,0,Math.max(0,it.value.length-1))},onNodeVisibilityCleaned:M=>{no.delete(M)&&Q2()}}),{cleanupScrollListener:S2,setupScrollListener:$8}=(function(M){const{isClient:H,virtualizationEnabled:G,listenerEnabled:Y,scrollRootElement:oe,resolveScrollContainer:_e,scheduleFocusSync:Me,onScroll:Ie}=M;let qe=null,Re=null;function Ge(){qe&&(qe(),qe=null),Re=null,oe.value=null}function je(Be){const Ke=M.getScrollTop?M.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Ke)?Math.abs(Ke):0)}return{cleanupScrollListener:Ge,setupScrollListener:function(){if(!H)return;if(!((Be=Y?.value)!=null?Be:G.value))return void Ge();var Be;const Ke=_e();if(!Ke)return void Ge();if(oe.value===Ke&&qe)return;Ge(),Re=je(Ke);const tt=()=>{if(Ie?.(),G.value){const nt=(function(_t){const at=je(_t),ft=Re;Re=at;const Mt=Math.max(480,.75*(_t.clientHeight||0));return ft==null?at>Mt?{immediate:!0}:void 0:Math.abs(at-ft)>Mt?{immediate:!0}:void 0})(Ke);nt?Me(nt):Me()}};Ke.addEventListener("scroll",tt,{passive:!0}),oe.value=Ke,qe=()=>{Ke.removeEventListener("scroll",tt)}}}})({isClient:ne,virtualizationEnabled:Ct,listenerEnabled:m2,scrollRootElement:Ue,resolveScrollContainer:se,scheduleFocusSync:zi,onScroll:function(){const M=Oe.value;if(!M)return;const H=cu();if(!H||(function(Y){if(mu()>=Te)return he=null,!1;const oe=he;if(oe==null)return!0;const _e=Math.abs(Y.scrollTop-oe)<=2;return _e||(he=null),_e})(H))return;const G=P2(H);G!=null?(G<-32||Math.abs(Math.max(0,G)-Math.max(0,M.distanceFromBottomPx))>32)&&za("restore"):za("restore")},getScrollTop:M=>{var H;const G=M.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement;return ht("scrollListener.getScrollTop",()=>J(M,G,Y))}});function zo(M,H,G){return Math.min(Math.max(M,H),G)}function n1(M){return M?.firstElementChild}function C2(M,H){var G;return M?(G=M.matches)!=null&&G.call(M,H)?M:M.querySelector(H):null}function A2(){if(!bt.value)return void(K.value=0);const M=ht("updateExperimentContainerWidth.clientWidth",()=>{var H,G;return(G=(H=S.value)==null?void 0:H.clientWidth)!=null?G:0});K.value=M>0?M:0}let lu=null;function o1(){lu?.disconnect(),lu=null}const M2=Li({loader:()=>Qn(null,null,function*(){return(yield ms(()=>import("./index8-DcnUd6X7.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:UM,delay:0,suspensible:!1});function E2(M){return M===M2}const T2=B(()=>u.value==="pre"?qs:u.value==="shiki"?M2:W0),ql=B(()=>{const M=it.value;if(!M.length||!bt.value)return M.map(()=>null);const H=K.value||ht("estimatedNodeHeights.clientWidth",()=>{var G;return((G=S.value)==null?void 0:G.clientWidth)||0});return!Number.isFinite(H)||H<=0?M.map(()=>null):M.map((G,Y)=>{const oe=Fe[Y],_e=typeof oe=="number"&&oe>0;if(Hn.value&&!_e){const Ie=YM(G,H,X.value);if(Ie)return Ie}if(rn.value&&G.type==="code_block"){const Ie=(function(qe){if(qe.type!=="code_block")return null;const Re=db(qe,gf(qe));return E2(Re)?"markdown":Re===qs?"pre":Re===T2.value||Re===W0?"monaco":null})(G);if(Ie==="monaco"||Ie==="markdown"||Ie==="pre")return iee(G,{rendererKind:Ie,monacoOptions:w.codeBlockMonacoOptions,showHeader:((Me=w.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function cf(M){var H;const G=Fe[M];if(Number.isFinite(G)&&G>0)return G;const Y=(H=ql.value[M])==null?void 0:H.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Kt.value,(function(oe){var _e,Me,Ie,qe,Re,Ge,je,Be,Ke,tt,nt,_t,at;const ft=it.value[oe];if(!ft||typeof ft!="object")return 32;const Mt=String((_e=ft.type)!=null?_e:""),At=Ut()||640;switch(Mt){case"heading":return 44;case"paragraph":return Ba(String((Ie=(Me=ft.raw)!=null?Me:ft.content)!=null?Ie:""),At,34);case"list":{const nn=Array.isArray(ft.items)?ft.items.length:1;return Math.max(48,30*nn+12)}case"list_item":return Ba(String((Re=(qe=ft.raw)!=null?qe:ft.content)!=null?Re:""),At,34);case"blockquote":return Ba(String((je=(Ge=ft.raw)!=null?Ge:ft.content)!=null?je:""),At,56);case"table":{const nn=Array.isArray(ft.rows)?ft.rows.length:Array.isArray(ft.children)?ft.children.length:3;return Math.max(120,38*nn+48)}case"code_block":return Ba(String((Ke=(Be=ft.code)!=null?Be:ft.raw)!=null?Ke:""),At,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Ba(String((nt=(tt=ft.raw)!=null?tt:ft.content)!=null?nt:""),At,96);case"thematic_break":return 24;default:return Ba(String((at=(_t=ft.raw)!=null?_t:ft.content)!=null?at:""),At,40)}})(M))}function Ba(M,H,G,Y=22){const oe=String(M??"");if(!oe)return G;const _e=Math.max(18,Math.floor(Math.max(320,H)/8)),Me=oe.split(/\r?\n/).length,Ie=Math.ceil(oe.length/_e),qe=Math.max(1,Me,Ie);return Math.max(G,Math.ceil(qe*Y+12))}function au(M){const H=Number(M);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function s1(){var M,H;const G=it.value.length,Y=au(K.value||ht("getFallbackHeightPrefix.clientWidth",()=>{var Ie;return((Ie=S.value)==null?void 0:Ie.clientWidth)||0})),oe=((M=o.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(o.virtualScroll.measurementKey),_e=[G,Ye.count,Math.round(Ye.total),Math.round(100*Kt.value),oe,Y,bt.value?1:0,YS.value,q.value].join(":");if(!Qm&&b2===_e)return k2;const Me=new Array(G+1);Me[0]=0;for(let Ie=0;Ie<G;Ie++)Me[Ie+1]=Me[Ie]+(bt.value?cf(Ie):(H=Fe[Ie])!=null?H:Kt.value);return k2=Me,b2=_e,Qm=!1,Me}function N2(M){var H,G;const Y=it.value.length;if(Y<=0||M<=0)return 0;const oe=s1();if(M>=((H=oe[Y])!=null?H:0))return Y-1;let _e=0,Me=Y-1,Ie=Y-1;for(;_e<=Me;){const qe=_e+Me>>1;((G=oe[qe+1])!=null?G:0)>=M?(Ie=qe,Me=qe-1):_e=qe+1}return Ie}function Gr(M,H){var G,Y;if(M>=H)return 0;if(bt.value)return(function(Me,Ie){var qe,Re;const Ge=it.value.length,je=zo(Math.trunc(Me),0,Ge),Be=zo(Math.trunc(Ie),je,Ge);if(je>=Be)return 0;const Ke=s1();return((qe=Ke[Be])!=null?qe:0)-((Re=Ke[je])!=null?Re:0)})(M,H);if(st.value!==it.value.length){let Me=0;for(let Ie=M;Ie<H;Ie++)Me+=(G=Fe[Ie])!=null?G:Kt.value;return Me}const oe=Tt.value,_e=Qt.value;if(!oe.length||!_e.length){let Me=0;for(let Ie=M;Ie<H;Ie++)Me+=(Y=Fe[Ie])!=null?Y:Kt.value;return Me}return oo(oe,M,H)+(H-M-oo(_e,M,H))*Kt.value}Je(()=>it.value.length,M=>{ii(),M<=0?Ai():(M<st.value&&Ho(M),M!==st.value&&Lo(M))},{immediate:!0});const F8=B(()=>{if(!Ct.value)return it.value.map((Y,oe)=>({node:Y,index:oe}));const M=it.value.length,H=zo(Wo.start,0,M),G=zo(Wo.end,H,M);return it.value.slice(H,G).map((Y,oe)=>({node:Y,index:H+oe}))}),i1=B(()=>Ct.value?Gr(0,Math.min(Wo.start,it.value.length)):0),r1=B(()=>{if(!Ct.value)return 0;const M=it.value.length;return Gr(Math.min(Wo.end,M),M)});function I2(){if(!bt.value)return 0;let M=0;const H=ql.value;for(let G=0;G<H.length;G++){if(!H[G])continue;const Y=Fe[G];Number.isFinite(Y)&&Y>0||M++}return M}function L2(){const M=it.value.length;return{totalNodes:M,measuredCount:Ye.count,estimatedCount:I2(),averageNodeHeight:Kt.value,topSpacerHeight:i1.value,bottomSpacerHeight:r1.value,estimatedTotalHeight:Gr(0,M),width:jl()}}function O8(){const M=it.value,H=L2();return Bt(lt({},H),{probe:{paragraphReady:!!X.value.paragraph,listItemReady:!!X.value.listItem,listWrapperOverhead:X.value.listWrapperOverhead,headingReadyLevels:Object.entries(X.value.headings).filter(([,G])=>!!G).map(([G])=>Number(G))},nodes:M.map((G,Y)=>{var oe,_e,Me,Ie,qe,Re,Ge,je,Be;return{index:Y,type:G.type,estimateKind:(_e=(oe=ql.value[Y])==null?void 0:oe.kind)!=null?_e:null,rendererKind:(Ie=(Me=ql.value[Y])==null?void 0:Me.rendererKind)!=null?Ie:null,estimatedHeight:(Re=(qe=ql.value[Y])==null?void 0:qe.height)!=null?Re:null,estimatedContentHeight:(je=(Ge=ql.value[Y])==null?void 0:Ge.contentHeight)!=null?je:null,measuredHeight:(Be=Fe[Y])!=null?Be:null}})})}function l1(){return o.indexKey!=null?String(o.indexKey):Mn.value?`virtual-${Vn()}`:"markdown-renderer"}function $2(M){const H=String(M),G=`${l1()}-`;if(!H.startsWith(G))return null;const Y=H.slice(G.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const oe=Number(Y[1]);return!Number.isInteger(oe)||oe<0||oe>=it.value.length?null:oe}function Vn(){var M,H,G;const Y=(M=o.virtualScroll)==null?void 0:M.sessionKey;return String(Y!=null&&Y!==""?Y:(G=(H=o.indexKey)!=null?H:w.customId)!=null?G:dn)}function Ao(){var M;const H=(M=o.virtualScroll)==null?void 0:M.threadKey;return H==null||H===""?void 0:String(H)}function a1(M){var H;return(M??"")===((H=Ao())!=null?H:"")}function R8(){var M;const H=(M=o.virtualScroll)==null?void 0:M.measurementKey;return H==null?"":String(H)}function B8(){var M,H;const G=u.value,Y=G==="monaco"?w.codeBlockMonacoOptions:void 0,oe=w.codeBlockProps,_e=G==="shiki";return[w.isDark?"dark":"light",G==="monaco"?"code-rich":G==="pre"?"code-pre":"code-shiki",w.codeBlockStream===!1?"code-static":"code-stream",$o(w.codeBlockMinWidth),$o(w.codeBlockMaxWidth),..._e?[wp((M=oe?.themes)!=null?M:w.themes,(H=oe?.langs)!=null?H:w.langs)]:[],$o(Y?.fontSize),$o(Y?.lineHeight),$o(Y?.fontFamily),$o(Y?.tabSize),$o(Y?.MAX_HEIGHT),$o(Y?.wordWrap),$o(Y?.wrappingIndent),$o(Y?.padding),$o(oe?.showHeader),$o(oe?.showCopyButton),$o(oe?.showExpandButton),$o(oe?.showPreviewButton),$o(oe?.showCollapseButton),$o(oe?.showFontSizeButtons)].join("\0")}function ar(){return[R8(),B8()].join("\0")}function jl(){return Ut()}const uf=B(()=>au(jl())),zs=B(()=>[ar(),uf.value].join("\0")),D8=B(()=>{var M;return Mn.value?["virtual",(M=Ao())!=null?M:"",Vn(),zs.value].join("\0"):o.indexKey});function Da(){y2.value+=1}function c1(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=it.value.length||M.sessionKey!==Vn()||M.threadKey!==Ao()||M.layoutEpochKey!==zs.value)}function F2(M){const H=String(M),G=Wi.get(H);return G?c1(G)?G.index:null:$2(H)}function O2(M="async-node"){(Hs.size||Wi.size)&&(Hs.clear(),Wi.clear(),Da(),On(M))}const Pa=jt(pv,null),u1={reportHeight(M,H){if(!ze.value)return;const G=F2(M);if(G==null)return;const Y=Hi.get(G);if(!Y)return;const oe=Number(H),_e=f2(G,Y);tf(G,Number.isFinite(oe)&&oe>0?Math.max(oe,_e||0):_e)},markPending(M){if(!ze.value)return;const H=$2(M);H!=null&&(function(G,Y){var oe;const _e=Wi.get(G);if(_e&&c1(_e))return Hs.set(G,Math.max(0,(oe=Hs.get(G))!=null?oe:0)+1),Da(),void On("async-node");Hs.set(G,1),Wi.set(G,(function(Me){return{index:Me,sessionKey:Vn(),threadKey:Ao(),layoutEpochKey:zs.value}})(Y)),Da(),On("async-node")})(String(M),H)},markSettled(M){if(!ze.value)return;const H=String(M),G=F2(M);(G!=null||(function(Y){return Hs.has(String(Y))})(H))&&(function(Y){var oe;const _e=(oe=Hs.get(Y))!=null?oe:0;return!(_e<=0||(_e<=1?(Hs.delete(Y),Wi.delete(Y)):Hs.set(Y,_e-1),Da(),_e===1&&On("async-node"),0))})(H)&&G!=null&&cr()}};function P8(){let M=0;for(const H of Hi.values())M+=ht("getVisibleDomHeight.offsetHeight",()=>{var G;return(G=H?.offsetHeight)!=null?G:0});return Math.ceil(Math.max(0,M))}Nn(pv,{reportHeight(M,H){u1.reportHeight(M,H),Pa?.reportHeight(M,H)},markPending(M){u1.markPending(M),Pa?.markPending(M)},markSettled(M){u1.markSettled(M),Pa?.markSettled(M)}});let d1,f1=null,Ha=null;function df(M){return M!==!1&&M!=null&&M!==""}function R2(){return Ct.value?(function(){if(!Ct.value)return!0;const M=it.value.length,H=zo(Wo.start,0,M),G=zo(Wo.end,H,M);if(H>=G)return!0;for(let Y=H;Y<G;Y++)if(!no.has(Y)||$1(Y)&&!Hi.has(Y))return!1;return!0})():uo.value>=of.value}function h1(){return V.value===!0&&!ee.value&&Xm.value===0&&Vr.size===0&&lr.size===0&&Ws==null&&R2()}function B2(){var M,H;if(((M=o.virtualScroll)==null?void 0:M.settleMode)!=="manual"||f1===Vn()&&d1===Ao())return!0;const G=(H=o.virtualScroll)==null?void 0:H.settledToken;return!!df(G)&&Ha===wu(G)}function p1(){return h1()&&B2()}function H8(M,H){return H.totalNodes<=0?M==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?M==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function Vl(M="manual",H){const G=L2(),Y=(function(oe){return oe||(V.value!==!0?it.value.length>0?"streaming":"estimating":!R2()||lr.size>0||Ws!=null?"measuring":p1()?"settled":"settling")})(H);return{sessionKey:Vn(),threadKey:Ao(),phase:Y,nodeCount:G.totalNodes,liveRange:{start:Wo.start,end:Wo.end},renderedCount:uo.value,measuredCount:G.measuredCount,estimatedCount:G.estimatedCount,averageNodeHeight:G.averageNodeHeight,topSpacerHeight:G.topSpacerHeight,bottomSpacerHeight:G.bottomSpacerHeight,visibleDomHeight:P8(),totalHeight:D2(),width:G.width,final:V.value===!0,stable:p1(),confidence:H8(Y,G),reason:M}}function cu(){const M=Ue.value||se(),H=S.value;if(!M||!H)return null;const G=M.ownerDocument||H.ownerDocument||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement,oe=ht("getScrollBox.scrollTop",()=>J(M,G,Y)),_e=ht("getScrollBox.scrollHeight",()=>{var Ie,qe,Re,Ge,je;return Y?Math.max((qe=(Ie=G.documentElement)==null?void 0:Ie.scrollHeight)!=null?qe:0,(Ge=(Re=G.body)==null?void 0:Re.scrollHeight)!=null?Ge:0,(je=M.scrollHeight)!=null?je:0):M.scrollHeight}),Me=ht("getScrollBox.clientHeight",()=>{var Ie;return Y?((Ie=G.documentElement)==null?void 0:Ie.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:G,isViewportRoot:Y,scrollTop:oe,scrollHeight:_e,clientHeight:Me}}function D2(){const M=it.value.length,H=Math.max(0,Gr(0,M)),G=ht("getRendererLogicalHeight.offsetHeight",()=>{var oe,_e;return(_e=(oe=S.value)==null?void 0:oe.offsetHeight)!=null?_e:0}),Y=Math.max(0,G>0?G:ht("getRendererLogicalHeight.scrollHeight",()=>{var oe,_e;return(_e=(oe=S.value)==null?void 0:oe.scrollHeight)!=null?_e:0}));return M<=0?Math.ceil(G):Ct.value?H>0?Math.max(1,Math.ceil(H),(function(){let oe=i1.value+r1.value;for(const _e of no.values())_e&&(oe+=Math.max(0,ht("getVirtualizedDomLogicalHeight.offsetHeight",()=>_e.offsetHeight||0)));return Math.ceil(Math.max(0,oe))})(),(function(oe,_e){return oe<=0||_e<=0?0:_e<=oe+Math.max(512,.05*oe)?Math.ceil(_e):0})(H,Y)):Math.max(1,Math.ceil(Y)):ze.value?H>0||Ye.count>0||I2()>0?(_i.value&&uo.value,Math.max(1,Math.ceil(Y),Math.ceil(H))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(H))}function P2(M){const H=S.value;if(!H)return null;const G=ht("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(oe){return oe.isViewportRoot?oe.clientHeight:ht("getViewportBottomInRoot.getBoundingClientRect",()=>oe.root.getBoundingClientRect().bottom)})(M)-G.bottom}function W8(M={}){const H=M.requireViewport!==!1,G=(function(_e=64){const Me=cu(),Ie=S.value;if(!Me||!Ie)return!1;const qe=(function(Ge){if(Ge.isViewportRoot)return{top:0,bottom:Ge.clientHeight};const je=ht("getVirtualViewportRect.getBoundingClientRect",()=>Ge.root.getBoundingClientRect());return{top:je.top,bottom:je.bottom}})(Me),Re=ht("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ie.getBoundingClientRect());return Re.bottom>=qe.top-_e&&Re.top<=qe.bottom+_e})();if(H&&!G)return null;const Y=(function(){const _e=cu(),Me=S.value;if(!_e||!Me||Math.max(0,_e.scrollHeight-_e.scrollTop-_e.clientHeight)>64)return null;const Ie=P2(_e);return Ie==null?null:Ie>=-8&&Ie<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ie)}:null})();if(Y)return{anchor:Y,captured:!0};const oe=Q();if(oe)return{anchor:{type:"node",nodeIndex:oe.nodeIndex,offsetWithinNodePx:oe.offsetWithinNodePx},captured:G};if(M.allowFallback===!0){const _e=(function(){const Me=it.value.length;return Me<=0?null:{type:"node",nodeIndex:zo(si.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return _e?{anchor:_e,captured:!1}:null}return null}function m1(M){let H=2166136261;for(let G=0;G<M.length;G++)H^=M.charCodeAt(G),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function z8(M,H){let G=M;for(let Y=0;Y<H.length;Y++)G^=H.charCodeAt(Y),G=Math.imul(G,16777619);return G^=31,G=Math.imul(G,16777619),G}const U8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function ff(M,H=new WeakSet,G=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(Y){const oe=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${m1(oe)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(H.has(M))return"cycle";if(G>=6)return"max-depth";H.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Re=[];for(let Ge=0;Ge<M.length;Ge++)Re.push(ff(M[Ge],H,G+1));return`a:${M.length}:${Re.join(",")}`}const _e=[],Me=[],Ie=Math.max(0,M.length-32);let qe=2166136261;for(let Re=0;Re<M.length;Re++){const Ge=ff(M[Re],H,G+1);qe=z8(qe,Ge),Re<32&&_e.push(Ge),Re>=Ie&&Me.push(Ge)}return[`a:${M.length}`,`h=${_e.join(",")}`,`t=${Me.join(",")}`,`all=${(qe>>>0).toString(36)}`].join(":")}const Y=M,oe=Object.keys(Y).filter(_e=>{const Me=Y[_e];return _e!=="parent"&&_e!=="el"&&_e!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||U8.has(_e))}).sort();return`o:${oe.length}:${oe.map(_e=>`${_e}=${ff(Y[_e],H,G+1)}`).join(";")}`}finally{H.delete(M)}}let H2=-1,g1="";function uu(M){const H=it.value[M];return H?m1(ff(H)):""}function v1(){const M=q.value;if(H2===M)return g1;let H=2166136261;for(let G=0;G<it.value.length;G++){const Y=uu(G);for(let oe=0;oe<Y.length;oe++)H^=Y.charCodeAt(oe),H=Math.imul(H,16777619)}return g1=(H>>>0).toString(36),H2=M,g1}function Wa(M,H={}){var G;const Y=H.includeHeightCache===!0,oe=(G=H.includeContentHash)!=null?G:Y,_e=Y?(function(Ie){const qe=(function(){var nt,_t;const at=Number((_t=(nt=o.virtualScroll)==null?void 0:nt.heightCacheLimit)!=null?_t:5e3);return!Number.isFinite(at)||at<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(at))})();if(!Number.isFinite(qe)||Ie.length<=qe)return Ie;const Re=new Map,Ge=nt=>{!nt||Re.size>=qe||Re.set(nt.index,nt)},je=it.value.length,Be=zo(Wo.start-2*ru.value,0,je),Ke=zo(Wo.end+2*ru.value,Be,je);for(const nt of Ie)nt.index>=Be&&nt.index<Ke&&Ge(nt);const tt=Math.max(1,Math.ceil(Ie.length/qe));for(let nt=0;nt<Ie.length&&Re.size<qe;nt+=tt)Ge(Ie[nt]);for(let nt=Ie.length-1;nt>=0&&Re.size<qe;nt-=tt)Ge(Ie[nt]);return Array.from(Re.values()).sort((nt,_t)=>nt.index-_t.index).slice(0,qe)})(en().map(Ie=>{var qe;const Re=it.value[Ie.index];return Re?Bt(lt({},Ie),{nodeType:String((qe=Re.type)!=null?qe:""),signature:uu(Ie.index)}):null}).filter(Ie=>!!Ie)):[],Me=W8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Me||_e.length||H.includeEmptyState===!0?Bt(lt({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:oe?v1():void 0,measurementKey:ar()||void 0,heightCache:_e.length?_e:void 0}):null}function y1(M){var H,G;const Y=cu();if(!Y)return;const oe=(function(Ie){const qe=S.value;if(!qe)return null;const Re=ye(qe,Ie.root),Ge=it.value.length,je=ht("getRendererBottomOffsetWithinRoot.offsetHeight",()=>qe.offsetHeight||0),Be=Math.max(0,je>0?je:Ge>0?ht("getRendererBottomOffsetWithinRoot.scrollHeight",()=>qe.scrollHeight||0):0),Ke=D2();return Re+Math.max(Be,Ke)})(Y);if(oe==null)return;const _e=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,oe-Y.clientHeight-_e);(function(Ie){Te=mu()+120,he=Ie})(Me),Y.isViewportRoot?(G=(H=Y.doc.defaultView)==null?void 0:H.scrollTo)==null||G.call(H,0,Me):JS(Y.root,Y.doc,Me,{isReverseFlexScrollRoot:j,getNormalizedScrollTop:J})}const k1=[];function W2(){if(ne)for(te!=null&&(Wn?.(te),te=null);k1.length;){const M=k1.pop();M!=null&&window.clearTimeout(M)}}function za(M){const H=!!Oe.value;Oe.value=null,Te=0,he=null,W2(),H&&M&&On(M)}function Ua(){if(!Oe.value||!ne||te!=null)return;const M=()=>{te=null;const H=Oe.value;H&&y1(H)};te=Fn?Fn(M):null,te==null&&M()}function z2(M,H={}){const G=it.value.length;return G<=0?[]:M.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=G)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(H.requireSignature&&!Y.signature)&&!(H.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(oe){var _e;const Me=it.value[oe.index];return!(!Me||oe.nodeType&&oe.nodeType!==String((_e=Me.type)!=null?_e:"")||oe.signature&&oe.signature!==uu(oe.index))})(Y))}function U2(M){const H=au(jl()),G=au(M);return H!==-1&&G!==-1&&H===G}function b1(M){var H;const G=Number(M?.width);if(Number.isFinite(G)&&G>0)return G;const Y=Number((H=M?.metrics)==null?void 0:H.width);return Number.isFinite(Y)&&Y>0?Y:null}function q2(M){var H;return M.sessionKey===Vn()&&!!a1(M.threadKey)&&((H=M.measurementKey)!=null?H:"")===ar()&&!!U2(b1(M))&&!!(function(G){const Y=G.heightCache;return!!Y?.length&&(j2(G)?Y.some(oe=>!!(oe.nodeType||oe.signature)):Y.some(oe=>!!oe.signature))})(M)}function j2(M){return!!(M.contentHash&&M.contentHash===v1())}function q8(M){return!j2(M)}let Kl=null,Gl=null,hf=null,du=null,fu=null;function x1(M){var H;const G=M.map(oe=>{var _e,Me;return[oe.index,Math.round(10*oe.height),(_e=oe.nodeType)!=null?_e:"",(Me=oe.signature)!=null?Me:""].join("")}).join(""),Y=au(jl());return[(H=Ao())!=null?H:"",Vn(),ar(),it.value.length,Y,M.length,m1(G)].join(":")}function V2(M=(H=>(H=o.virtualScroll)==null?void 0:H.heightCache)()){if(!ze.value||!M?.length||it.value.length<=0||!U2((H=o.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const G=z2(M,{requireSignature:!0});if(!G.length)return!1;const Y=x1(G);return Y===Kl?(Gl="standalone",!0):(h2(G,{mode:"merge"}),ii(),Kl=Y,Gl="standalone",vu(),On("restore"),!0)}function w1(M,H={}){var G,Y,oe;if(!ze.value||!M||M.sessionKey!==Vn()||!a1(M.threadKey)||it.value.length<=0)return!1;const _e=!!((G=M.heightCache)!=null&&G.length)&&!pf(),Me=!M.anchor||M.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:M.anchor,Ie=H.restoreAnchor===!0&&!!Me&&!pf()&&Number(b1(M))>0;let qe=!1;if((Y=M.heightCache)!=null&&Y.length&&q2(M)){const Ge=z2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:q8(M)});Ge.length&&(h2(Ge,{mode:"merge"}),ii(),Kl=x1(Ge),Gl="restore",vu(),qe=!0)}if(_e||Ie)return!1;if(!H.restoreAnchor||!Me)return qe&&On("restore"),!0;const Re=(function(Ge,je){var Be;const Ke=Ge.anchor,tt=Ke?Ke.type==="bottom"?`bottom:${Math.round(Ke.distanceFromBottomPx)}`:`node:${Ke.nodeIndex}:${Math.round(Ke.offsetWithinNodePx)}`:"none";return[(Be=Ao())!=null?Be:"",Vn(),ar(),uf.value,je,tt].join(":")})(M,(oe=H.restoreToken)!=null?oe:"imperative");return hf===Re?(qe&&On("restore"),!0):(hf=Re,(function(Ge){const je=()=>{if(Ge.type==="node")return za(),void be({nodeIndex:Ge.nodeIndex,offsetWithinNodePx:Ge.offsetWithinNodePx});if(ln(),we.value=null,Oe.value=Ge,W2(),y1(Ge),ne)for(const Be of[0,120,280,480])k1.push(window.setTimeout(()=>{const Ke=Oe.value;Ke&&y1(Ke)},Be))};(function(Be){if(!Ct.value)return!1;const Ke=it.value.length;return!(Ke<=0||(si.value=Be.type==="node"?zo(Be.nodeIndex,0,Ke-1):Ke-1,zl(),0))})(Ge)?gt(je):je()})(Me),On("restore"),!0)}function pf(){const M=jl();return Number.isFinite(M)&&M>0}function K2(M){var H;return M.sessionKey===Vn()&&!!a1(M.threadKey)&&(it.value.length<=0||!(!((H=M.heightCache)!=null&&H.length)||pf())||!(!(M.anchor&&Number(b1(M))>0)||pf()))}function _1(){zn.clear();for(const M of Object.keys(Fe)){const H=Number(M);Number.isInteger(H)&&H>=0&&H<it.value.length&&Wl(H)}}function hu(){Ws!=null&&(Wn?.(Ws),Ws=null),F1()}function G2(){return!ne||Ps?Promise.resolve():new Promise(M=>{let H=!1,G=null;const Y=()=>{H||(H=!0,G!=null&&window.clearTimeout(G),M())};if(Fn)return Fn(Y),void(G=window.setTimeout(Y,50));G=window.setTimeout(Y,0)})}function S1(M,H=Ao(),G=zs.value){return Vn()===M&&Ao()===H&&zs.value===G}function C1(){return Qn(this,arguments,function*(M={}){var H,G,Y,oe,_e;const Me=Vn(),Ie=Ao(),qe=zs.value,Re=(H=M.frames)!=null?H:2,Ge=(G=M.timeoutMs)!=null?G:120,je=(Y=M.reason)!=null?Y:"manual",Be=M.expectedSettledTokenKey,Ke=M.flushPendingTimers===!0,tt=Vl(je),nt=()=>Bt(lt({},tt),{phase:tt.final?"settling":tt.phase,stable:!1,confidence:tt.confidence==="final"?"mixed":tt.confidence,reason:je}),_t=()=>S1(Me,Ie,qe)&&(Be==null||gu()===Be);for(let At=0;At<Re;At++){if(yield gt(),!_t()||(yield G2(),!_t()))return nt();cr(),hu()}if(yield(function(At){return!ne||At<=0?Promise.resolve():new Promise(nn=>window.setTimeout(nn,At))})(Ge),!_t()||(Ke&&w2(),cr(),hu(),!_t()))return nt();const at=h1();at&&(f1=Me,d1=Ie,((oe=o.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&Be!=null&&df((_e=o.virtualScroll)==null?void 0:_e.settledToken)&&gu()===Be&&(Ha=wu(o.virtualScroll.settledToken)));const ft=_t()&&at&&B2(),Mt=Vl(je,ft?"final":void 0);return N1(Mt,!0),Mt})}let A1="content",Yl=null,Zl=null,M1=0,pu=null,qa=null,E1=null,T1=null;function mu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Y2(M){var H,G;const Y=pu;if(!Y)return!0;const oe=(G=(H=o.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?G:1;return Math.abs(M.totalHeight-Y.totalHeight)>oe||M.sessionKey!==Y.sessionKey||M.phase!==Y.phase||M.stable!==Y.stable||M.final!==Y.final||M.threadKey!==Y.threadKey||M.nodeCount!==Y.nodeCount||M.measuredCount!==Y.measuredCount||M.width!==Y.width}function $o(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function gu(M=(H=>(H=o.virtualScroll)==null?void 0:H.settledToken)()){return $o(M)}function Z2(M,H){var G,Y;return[M,H.sessionKey,(G=H.threadKey)!=null?G:"",ar(),v1(),$o((Y=o.virtualScroll)==null?void 0:Y.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function vu(){E1=null,T1=null,qa=null}function j8(M){const H=M.heightCache;return H?.length?x1(H):""}function yu(M){var H,G,Y;const oe=M.metrics,_e=M.anchor?(Me=M.anchor).type==="bottom"?`bottom:${Math.round(Me.distanceFromBottomPx)}`:`node:${Me.nodeIndex}:${Math.round(Me.offsetWithinNodePx)}`:"none";var Me;return[M.sessionKey,(H=M.threadKey)!=null?H:"",(G=M.measurementKey)!=null?G:ar(),(Y=M.contentHash)!=null?Y:"",j8(M),_e,M.anchorCaptured?1:0,oe.liveRange.start,oe.liveRange.end,oe.renderedCount,oe.nodeCount,Math.round(oe.totalHeight),Math.round(oe.width),oe.phase,oe.stable?1:0].join("\0")}function N1(M,H=!1){if(!ze.value||(function(Me=!1){return!Me&&Mn.value&&!Qe.value})(H))return;const G=H||Y2(M),Y=(function(Me,Ie=!1){return Ie||Me.stable||Me.phase==="final"?{state:Wa(Me,{includeHeightCache:!0})}:{state:Wa(Me)}})(M,H),oe=Y.state,_e=!!(oe&&(G||(function(Me,Ie=!1){return!!Ie||yu(Me)!==qa})(oe,H)));if(G&&(E(M),pu=M,M1=mu()),oe&&_e&&(T(oe),oe.anchor&&F(oe.anchor),qa=yu(oe)),M.stable){const Me=Z2("settled",M);if(Me!==E1){E1=Me;const Ie=Wa(M,{includeHeightCache:!0});Ie&&(T(Ie),qa=yu(Ie)),(function(qe){s("render-settled",qe)})(M)}}if(M.phase==="final"){const Me=Z2("final",M);if(Me!==T1){T1=Me;const Ie=Wa(M,{includeHeightCache:!0});Ie&&(T(Ie),qa=yu(Ie)),(function(qe){s("render-final",qe)})(M)}}}function I1(){Yl!=null&&(Wn?.(Yl),Yl=null),Zl!=null&&ne&&(window.clearTimeout(Zl),Zl=null)}function X2(){Yl=null,Zl=null,(function(M){if(lr.size>0||Ws!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(A1)&&(cr(),hu()),N1(Vl(A1))}function On(M){var H,G;if(!ze.value||(A1=M,Yl!=null||Zl!=null))return;const Y=Math.max(0,(G=(H=o.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?G:32),oe=Math.max(0,Y-(mu()-M1)),_e=()=>{Zl=null,Yl=Fn?Fn(X2):null,Yl==null&&X2()};ne&&oe>0?Zl=window.setTimeout(_e,oe):_e()}function L1(M){var H;if(M<=0)return 0;const G=it.value;if(bt.value)return N2(M);if(st.value===G.length&&Tt.value.length&&Qt.value.length){const oe=Kt.value,_e=Tt.value,Me=Qt.value,Ie=je=>je<=0?0:oo(_e,0,je)+(je-oo(Me,0,je))*oe;let qe=0,Re=G.length-1,Ge=G.length-1;for(;qe<=Re;){const je=qe+Re>>1;Ie(je+1)>=M?(Ge=je,Re=je-1):qe=je+1}return Ge}let Y=M;for(let oe=0;oe<G.length;oe++){const _e=(H=Fe[oe])!=null?H:Kt.value;if(Y<=_e)return oe;Y-=_e}return Math.max(0,G.length-1)}function Q2(){Io.value+=1}function $1(M){return!(_i.value&&M>=uo.value)&&(!qr.value||M<Ss.value||e1.value.has(M))}function ja(M){const H=lf.get(M);H&&(H(),lf.delete(M));const G=Ra.get(M);G&&(G.destroy(),Ra.delete(M)),af(M)}function J2(M,H){let G=!1;if(H){const _e=no.get(M);no.set(M,H),_e!==H&&(G=!0)}else no.delete(M)&&(G=!0);if(G&&Q2(),H||af(M),!p2.value||!Xo||!Ct.value&&qr.value&&!z.value&&Ra.size>=640&&(z.value||(z.value=!0,t1()),!p2.value||!Xo))return ja(M),void(H&&Kr(M,!0));if(M<Ss.value&&!Ct.value||e1.value.has(M))return ja(M),void Kr(M,!0);if(!H)return void ja(M);ja(M);const Y=Xo(H,{rootMargin:"400px"});if(!Y)return;Ra.set(M,Y),Kr(M,Y.isVisible.value),qr.value&&(function(_e){if(!ne||!qr.value)return;af(_e);const Me=_e%17*23,Ie=window.setTimeout(()=>{if(_2.delete(_e),!qr.value||e1.value.has(_e))return;const qe=no.get(_e);if(!qe)return;const Re=se(qe),Ge=qe.ownerDocument||document,je=Ge.defaultView||window,Be=!Re||Re===Ge.documentElement||Re===Ge.body,Ke=!Be&&Re?ht("nodeVisibilityFallback.root.getBoundingClientRect",()=>Re.getBoundingClientRect()):null,tt=Be?0:Ke.top,nt=Be?ht("nodeVisibilityFallback.clientHeight",()=>{var at,ft;return(ft=(at=je.innerHeight)!=null?at:Re?.clientHeight)!=null?ft:0}):Ke.bottom,_t=ht("nodeVisibilityFallback.node.getBoundingClientRect",()=>qe.getBoundingClientRect());_t.bottom>=tt-500&&_t.top<=nt+500&&Kr(_e,!0)},1800+Me);_2.set(_e,Ie)})(M);let oe=null;oe=Je(()=>Y.isVisible.value,_e=>{if(_e){af(M),Kr(M,!0),oe?.(),lf.delete(M),Ra.get(M)===Y&&Ra.delete(M);try{Y.destroy()}catch{}}},{immediate:!0}),lf.set(M,oe),Ct.value&&zi()}function F1(){Ws=null;for(const[M,H]of lr)lr.delete(M),Hi.get(M)===H.el&&Ul.get(M)===H.version&&tf(M,H.height,{allowShrink:H.allowShrink})}function Va(){Ws!=null&&(Wn?.(Ws),Ws=null),lr.clear()}function mf(M,H){(function(G,Y,oe){var _e;if(!Number.isFinite(oe)||oe<=0||Hi.get(G)!==Y)return;const Me=Ul.get(G);if(Me==null)return;const Ie=it.value[G],qe=ee.value&&V.value!==!0&&!((_e=o.nodes)!=null&&_e.length)&&G>=it.value.length-2,Re=!(Ie?.loading===!0||qe),Ge=lr.get(G),je=Ge?Ge.allowShrink&&Re:Re,Be=Ge&&!je?Math.max(Ge.height,oe):oe;lr.set(G,{height:Be,allowShrink:je,version:Me,el:Y}),Ws==null&&(Ws=Fn?Fn(F1):null,Ws==null&&F1())})(M,H,f2(M,H))}function cr(){for(const[M,H]of Hi)H&&mf(M,H)}function eb(){No?.disconnect(),No=null,rs.clear()}function O1(){for(;nf.length;)rf(nf.pop())}Je(Qe,M=>{M&&On("content")},{flush:"post"}),t({getVirtualMetrics:Vl,captureVirtualState:function(M={}){var H;return Wa(Vl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(H=M.includeEmptyState)==null||H})},restoreVirtualState:function(M,H={}){const G=H.restoreAnchor===!0,Y=H.restoreToken==null?"imperative":String(H.restoreToken);du=M,fu={restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!w1(M,{restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&K2(M)||(du=null,fu=null)},forceMeasure:function(M="manual"){return Qn(this,null,function*(){yield gt(),yield G2(),cr(),hu(),yield gt();const H=Vl(M);return N1(H,!0),H})},settle:C1,scrollToNode:function(M,H="start"){za(),ln();const G=it.value.length;if(G<=0)return;const Y=zo(M,0,G-1),oe=()=>{var _e;const Me=Rt({nodeIndex:Y,offsetWithinNodePx:0}),Ie=cf(Y),qe=cu(),Re=(_e=qe?.clientHeight)!=null?_e:0,Ge=He();let je=Me;if(H==="center")je=Me-Re/2+Ie/2;else if(H==="end")je=Me-Re+Ie;else if(H==="nearest"&&Ge!=null){if(Me>=Ge&&Me+Ie<=Ge+Re)return;je=Me<Ge?Me:Me-Re+Ie}Ft(Math.max(0,je)),zi({immediate:!0}),Ct.value&&(si.value=Y,zl())};if(Ct.value)return si.value=Y,zl(),void gt(oe);oe()}}),Je(()=>Do.value,M=>{if(!M){eb();for(const H of jr.values())for(const G of H)rf(G);jr.clear(),Ul.clear(),O1(),Va()}},{immediate:!0}),Je(V,M=>{M&&(function(){if(ne&&V.value&&Hi.size){O1();for(const H of[80,240,640]){const G=x2(H,()=>{for(const[Y,oe]of Hi)oe&&mf(Y,oe)},"final");G!=null&&nf.push(G)}}})(),On(M?"final":"content")}),Je([()=>it.value.length,()=>uo.value],()=>{Oe.value&&Ua(),On("content")},{flush:"post",immediate:!0}),Je([()=>Wo.start,()=>Wo.end],()=>{On("batch")},{flush:"post"});const{cleanupBatchScheduler:V8}=(function(M){const{props:H,isClient:G,isTestEnv:Y,parsedNodesIdentity:oe,parsedNodeCount:_e,desiredRenderedCount:Me,datasetKey:Ie,batchingEnabled:qe,incrementalRenderingActive:Re,resolvedBatchSize:Ge,resolvedInitialBatch:je,renderedCount:Be,adaptiveBatchSize:Ke,previousRenderContext:tt,previousBatchConfig:nt,requestFrame:_t,cancelFrame:at,hasIdleCallback:ft,cleanupNodeVisibility:Mt,onDatasetKeyChanged:At,onDatasetChanged:nn}=M;let It=null,zt=null,Ht=!1,hn=null,Us=null,as=0,Mi=!1,Yr=!1;const Zr=new Set,Ql=new Set;function yb(){if(G){It!=null&&(at?.(It),It=null),zt!=null&&(window.clearTimeout(zt),zt=null),Us!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Us),Us=null),as+=1;for(const Qo of Zr)at?.(Qo);Zr.clear();for(const Qo of Ql)window.clearTimeout(Qo);Ql.clear(),Ht=!1,hn=null,Mi=!1,Yr=!1}}function wf(){return typeof performance<"u"?performance.now():Date.now()}function kb(Qo){(function(ur){var Xr;if(!Re.value)return;const dr=Math.max(2,(Xr=H.renderBatchBudgetMs)!=null?Xr:6),fr=Math.max(1,Ge.value||1),Ei=Math.max(1,Math.floor(fr/4));ur>1.2*dr?Ke.value=Math.max(Ei,Math.floor(.7*Ke.value)):ur<.5*dr&&Ke.value<fr&&(Ke.value=Math.min(fr,Math.ceil(1.2*Ke.value)))})(Qo),Mi=!1;const Cs=Yr||Be.value<Me.value;Yr=!1,Cs&&wb()}function bb(Qo,Cs={}){var ur,Xr;if(!Re.value)return;const dr=Me.value;if(Be.value>=dr)return;const fr=Math.max(1,Qo),Ei=()=>{const Ya=wf();let Za=0;It=null,zt=null,Us=null,Ht=!1;const Xa=hn??fr;hn=null;const U1=wf();Be.value=Math.min(dr,Be.value+Xa),Mt(Be.value),Za=wf()-U1,(function(q1,_b){if(!G)return void kb(_b);Mi=!0;const Sb=++as;gt().then(()=>{var Cb;if(Sb!==as)return;const fE=wf(),hE=Math.max(_b,fE-q1),Ab=()=>{Sb===as&&kb(hE)};if(_t){let Eb=!1,hr=null;const Tb=()=>{Eb||(Eb=!0,Ab())},_f=_t(()=>{Zr.delete(_f),hr!=null&&(window.clearTimeout(hr),Ql.delete(hr),hr=null),Tb()});return Zr.add(_f),hr=window.setTimeout(()=>{hr!=null&&Ql.delete(hr),hr=null,at?.(_f),Zr.delete(_f),Tb()},Math.max(32,(Cb=H.renderBatchIdleTimeoutMs)!=null?Cb:120)),void Ql.add(hr)}const Mb=window.setTimeout(()=>{Ql.delete(Mb),Ab()},0);Ql.add(Mb)})})(Ya,Za)};if(!G||Cs.immediate)return void Ei();const Qr=Math.max(0,(ur=H.renderBatchDelay)!=null?ur:16);if(hn=hn!=null?Math.max(hn,fr):fr,!Ht){if(Ht=!0,!Y&&ft&&window.requestIdleCallback){const Ya=Math.max(0,(Xr=H.renderBatchIdleTimeoutMs)!=null?Xr:120);return void(Us=window.requestIdleCallback(()=>Ei(),{timeout:Ya}))}_t&&!Y?It=_t(()=>{Qr!==0?zt=window.setTimeout(()=>Ei(),Qr):Ei()}):zt=window.setTimeout(()=>Ei(),Qr)}}function xb(Qo,Cs={}){Mi?Yr=!0:Qo==null?wb():bb(Qo,Cs)}function wb(){Re.value&&bb(qe.value?Math.max(1,Math.round(Ke.value)):Math.max(1,Ge.value))}return Je([oe,_e,Ie,Re,Ge,je,()=>H.renderBatchDelay],()=>{var Qo;const Cs=_e.value,ur=tt.value,Xr=Ie.value,dr=!Object.is(Xr,ur.key),fr=Cs!==ur.total,Ei=dr||fr;tt.value={key:Xr,total:Cs};const Qr=nt.value,Ya=(Qo=H.renderBatchDelay)!=null?Qo:16,Za=Qr.batchSize!==Ge.value||Qr.initial!==je.value||Qr.delay!==Ya||Qr.enabled!==Re.value;nt.value={batchSize:Ge.value,initial:je.value,delay:Ya,enabled:Re.value},dr&&At(Cs),(Ei||Za||!Re.value)&&yb(),(Ei||Za)&&(Ke.value=Math.max(1,Ge.value||1)),Ei&&nn();const Xa=Me.value;if(!Cs)return Be.value=0,void Mt(0);if(!Re.value)return Be.value=Xa,void Mt(Be.value);const U1=dr||ur.total===0;Be.value=U1||Za?Math.min(Xa,je.value):Math.min(Be.value,Xa);const q1=Math.max(1,je.value||Ge.value||Cs);Be.value<Xa?xb(q1,{immediate:!G}):Mt(Be.value)},{immediate:!0}),Je(Me,(Qo,Cs)=>{Re.value&&(typeof Cs=="number"&&Qo<=Cs||Qo>Be.value&&xb())}),{cleanupBatchScheduler:yb}})({props:w,isClient:ne,isTestEnv:Ps,parsedNodesIdentity:co,parsedNodeCount:Yn,desiredRenderedCount:of,datasetKey:D8,batchingEnabled:Pi,incrementalRenderingActive:_i,resolvedBatchSize:Po,resolvedInitialBatch:Ss,renderedCount:uo,adaptiveBatchSize:Si,previousRenderContext:ni,previousBatchConfig:rr,requestFrame:Fn,cancelFrame:Wn,hasIdleCallback:ti,cleanupNodeVisibility:L8,onDatasetKeyChanged:M=>{Va(),Ai(),ii(),vu(),M>0&&Lo(M)},onDatasetChanged:()=>{Ct.value&&zi({immediate:!0})}});Je([m2,Ct,()=>S.value,()=>ue()],([M,H])=>{if(!M)return S2(),void Jm();$8(),H?zi({immediate:!0}):Jm()},{flush:"post",immediate:!0}),Je([()=>it.value.length,()=>Ct.value],M=>Qn(null,[M],function*([H,G]){G&&H&&ne&&(yield gt(),zi({immediate:!0}))}),{flush:"post"}),Je(bt,M=>{M&&(function(){var H;if(mo.value&&is.value&&qn.value&&((H=to.value)!=null&&H[1]))return;const G=mt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=mt({type:"list_item",children:[G],raw:"- Probe paragraph text"}),oe=mt({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});mo.value=G,is.value=Y,qn.value=oe;const _e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)_e[Me]=mt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});to.value=_e})()},{immediate:!0}),Je([()=>S.value,bt],()=>{if(!bt.value)return o1(),void(K.value=0);A2(),o1(),bt.value&&S.value&&typeof ResizeObserver<"u"&&(lu=new ResizeObserver(()=>{A2(),we.value&&Un(),Oe.value&&Ua(),On("resize")}),lu.observe(S.value))},{immediate:!0}),Je([bt,En,zs],()=>Qn(null,null,function*(){if(!bt.value)return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();yield gt(),(function(){if(!bt.value||typeof window>"u")return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=C2(n1(I.value),".paragraph-node");M.paragraph=Y0(I.value,H,"pre-wrap");const G=n1(P.value),Y=G?.querySelector(".paragraph-node");M.listItem=Y0(P.value,Y,"pre-wrap");const oe=ht("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Ie;return(Ie=(Me=D.value)==null?void 0:Me.offsetHeight)!=null?Ie:0}),_e=ht("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Ie;return(Ie=(Me=P.value)==null?void 0:Me.offsetHeight)!=null?Ie:0});M.listWrapperOverhead=Math.max(0,oe-_e);for(let Me=1;Me<=6;Me++){const Ie=C2(n1(W[Me]),`h${Me}`);M.headings[Me]=Y0(W[Me],Ie,"pre-wrap")}X.value=M,ii()})()}),{flush:"post",immediate:!0}),Je(()=>it.value.length,()=>{Ct.value&&zi({immediate:!0})}),Je([bt,K],()=>{ii(),Ct.value&&zi({immediate:!0}),we.value&&Un(),Oe.value&&Ua(),On("resize")},{immediate:!1}),Je(()=>qr.value,M=>{if(M)for(const[H,G]of no)J2(H,G);else{t1();for(const[H,G]of no)G&&Kr(H,!0)}},{immediate:!1}),Je([()=>w.viewportPriority,()=>it.value.length],([M,H])=>{M!==!1?z.value&&H<=200&&(z.value=!1):z.value=!1}),Je(()=>uo.value,()=>{Ct.value&&zi({immediate:!0})}),Je([si,jn,ru,()=>it.value.length,Ct],()=>{zl()},{immediate:!0});let ku=null,bu=!1,Ka=null;function xu(){ku=null,f1=null,d1=void 0,Ha=null,vu()}function R1(){Va(),Ai(),ii(),zn.clear();const M=it.value.length;M>0&&Lo(M),_1()}function B1(){I1(),w2(),pu=null,Kl=null,Gl=null,hf=null,du=null,fu=null,bu=!1,xu(),O2("restore"),ln(),za()}function wu(M){var H;return[(H=Ao())!=null?H:"",Vn(),ar(),uf.value,gu(M),it.value.length,Math.round(Gr(0,it.value.length)),Math.round(jl()),Ye.count,Math.round(Ye.total)].join(":")}function tb(){return Qn(this,null,function*(){var M,H,G,Y;const oe=(M=o.virtualScroll)==null?void 0:M.settledToken,_e=gu(oe),Me=Vn(),Ie=Ao(),qe=zs.value;if(ze.value&&((H=o.virtualScroll)==null?void 0:H.settleMode)==="manual"&&df(oe))if(h1()){if(wu(oe)!==Ha&&!bu){bu=!0;try{const Re=yield C1({reason:"manual",expectedSettledTokenKey:_e}),Ge=gu()===_e;S1(Me,Ie,qe)&&Re.sessionKey===Me&&Re.threadKey===Ie&&Ge&&Re.stable&&Re.phase==="final"&&(Ha=wu((G=o.virtualScroll)==null?void 0:G.settledToken))}finally{bu=!1,yield gt();const Re=(Y=o.virtualScroll)==null?void 0:Y.settledToken,Ge=df(Re)?wu(Re):"";S1(Me,Ie,qe)&&Ge&&Ha!==Ge&&tb()}}}else On("manual")})}Je(ze,(M,H)=>{if(M!==H){if(!M)return B1(),void I1();B1(),R1(),Ka=zs.value,On("content")}},{flush:"post"}),Je([ze,zs],([M,H])=>{M?Ka!=null?Ka!==H&&(Ka=H,(function(G="resize"){Va(),Ai(),ii(),zn.clear();const Y=it.value.length;Y>0&&Lo(Y),_1(),Kl=null,Gl=null,hf=null,pu=null,bu=!1,xu(),V2(),gt(()=>{cr(),we.value&&Un(),Oe.value&&Ua(),On(G)})})("resize")):Ka=H:Ka=null},{flush:"post",immediate:!0}),Je([ze,()=>Vn(),()=>Ao()],([M])=>{M&&(B1(),R1(),O2("content"),On("content"))}),Je([ze,()=>Vn(),()=>Ao(),zs,()=>it.value.length],([M])=>{M&&(function(H="async-node"){let G=!1;for(const[Y,oe]of Array.from(Wi.entries()))c1(oe)||(Wi.delete(Y),Hs.delete(Y),G=!0);G&&(Da(),On(H))})("async-node")},{flush:"post"}),Je([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>o.indexKey,()=>q.value],([M])=>{M&&(vu(),(function(H="content"){if(!ze.value)return;const G=[],Y=it.value.length;for(const oe of Array.from(zn.keys())){if(oe>=Y){G.push(oe);continue}const _e=uu(oe),Me=zn.get(oe);Me!=null&&Me!==_e&&G.push(oe),zn.set(oe,_e)}for(const oe of Array.from(zn.keys()))oe>=Y&&zn.delete(oe);G.length&&((function(oe,_e={}){const Me=Array.from(oe,Number);qt(Me,_e)>0&&(function(qe){for(const Re of qe)zn.delete(Re)})(Me)})(G,{notify:!1}),ii(),xu(),we.value&&Un(),Oe.value&&Ua(),On(H))})("content"))},{flush:"post",immediate:!0}),Je([ze,()=>it.value.length,()=>Vn(),()=>Ao()],([M,H,G,Y],[oe,_e,Me,Ie])=>{M&&oe&&G===Me&&Y===Ie&&H!==_e&&xu()},{flush:"post"}),Je([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],()=>{V2()},{flush:"post",immediate:!0}),Je([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],M=>Qn(null,[M],function*([H,G]){if(!H||!G)return;yield gt();const Y=(function(){var oe;const _e=(oe=o.virtualScroll)==null?void 0:oe.restoreAnchor;return _e==null||_e===!1?null:_e===!0?"true":String(_e)})();w1(G,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Je([ze,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var H;if(!M)return;const G=(H=o.virtualScroll)==null?void 0:H.restoreState;G&&Kl&&Gl==="restore"&&(q2(G)||(R1(),Kl=null,Gl=null,On("resize")))},{flush:"post"}),Je([ze,()=>it.value.length,()=>Vn(),K],M=>Qn(null,[M],function*([H]){var G;const Y=du,oe=fu;H&&Y&&(yield gt(),!w1(Y,{restoreAnchor:oe?.restoreAnchor===!0,restoreToken:(G=oe?.restoreToken)!=null?G:"imperative",allowUncapturedAnchor:oe?.allowUncapturedAnchor===!0})&&K2(Y)||(du=null,fu=null))}),{flush:"post",immediate:!0}),Je([ze,V,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>Vn(),()=>Ao(),zs,Xm,v2,()=>uo.value,of,()=>Ye.count,()=>Ye.total],([M,H,G])=>{if(!M||H!==!0||G==="manual"||!p1())return;const Y=(function(){var oe;const _e=it.value.length;return[(oe=Ao())!=null?oe:"",Vn(),ar(),uf.value,_e,Math.round(Gr(0,_e)),Math.round(jl()),Ye.count,Math.round(Ye.total)].join(":")})();ku!==Y&&(ku=Y,C1({reason:"final"}).then(oe=>{oe.stable||ku!==Y||(ku=null)}))},{flush:"post",immediate:!0}),Je([ze,V,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settledToken},()=>Vn(),()=>Ao(),zs,Xm,v2,()=>uo.value,of,()=>it.value.length,()=>Ye.count,()=>Ye.total],()=>{tb()},{flush:"post",immediate:!0}),Je([()=>it.value.length,Ct,jn,ru,()=>Wo.start,()=>Wo.end],([M,H,G,Y,oe,_e])=>{de.value&&Ne("virtualization",{nodes:M,virtualization:H,maxLiveNodes:G,buffer:Y,focusIndex:si.value,scroll:H?(()=>{const Me=Ue.value||se();return Me?{reverse:j(Me),scrollTop:Math.round(Me.scrollTop),scrollTopAbs:Math.round(Math.abs(Me.scrollTop)),scrollHeight:Math.round(Me.scrollHeight),clientHeight:Math.round(Me.clientHeight)}:null})():null,liveRange:{start:oe,end:_e},rendered:uo.value})}),Je([()=>w.customId],([M],H,G)=>{if(!M||yn)return;const Y=(function(oe,_e){return oe?(Mo.controllers[oe]=_e,()=>{Mo.controllers[oe]===_e&&delete Mo.controllers[oe]}):()=>{}})(M,{captureRestoreAnchor:Q,restoreAnchor:be,getAnchorDrift:Se,getReport:O8});G(()=>{Y()})},{immediate:!0}),ho(()=>{(function(){if(ze.value)try{cr(),hu();const M=Vl("manual");Y2(M)&&(E(M),pu=M,M1=mu());const H=Wa(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(T(H),H.anchor&&F(H.anchor),qa=yu(H))}catch{}})(),V8(),t1(),De(),eb();for(const M of jr.values())for(const H of M)rf(H);jr.clear(),Ul.clear(),zn.clear(),O1(),Va(),o1(),ln(),za(),I1(),S2(),Jm()});const K8=Li({loader:()=>Qn(null,null,function*(){try{return(yield ms(()=>import("./index11-vhJM9Zd7.js"),__vite__mapDeps([8,5]))).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',M),qs}}),loadingComponent:Cee,delay:0}),G8=Li({loader:()=>Qn(null,null,function*(){try{return(yield ms(()=>import("./index10--9NgV5KO.js"),[])).default}catch(M){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',M),qs}}),loadingComponent:See,delay:0}),Y8=Li(()=>Qn(null,null,function*(){try{return(yield ms(()=>import("./index7-BpvJXlrz.js"),[])).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',M),qs}})),nb={text:ro,paragraph:_a,heading:Ap,code_block:W0,list:Pc,list_item:Dc,blockquote:Sh,table:cd,definition_list:Ch,footnote:Ah,footnote_reference:Zs,footnote_anchor:ld,admonition:Nh,vmr_container:Eh,hardbreak:Cl,link:xs,image:Sl,thematic_break:Mh,math_inline:Bi,math_block:qM,strong:ks,emphasis:ws,strikethrough:bs,highlight:Qs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,inline_code:os,html_inline:Xs,reference:ys,html_block:ad},Z8=B(()=>l1()),ob=B(()=>QS(w.codeBlockProps)),X8=B(()=>QS(w.codeBlockProps,{omit:["langs"]})),sb=B(()=>lt(lt({stream:w.codeBlockStream,darkTheme:w.codeBlockDarkTheme,lightTheme:w.codeBlockLightTheme,monacoOptions:w.codeBlockMonacoOptions,themes:w.themes,langs:u.value==="shiki"?w.langs:void 0,minWidth:w.codeBlockMinWidth,maxWidth:w.codeBlockMaxWidth},typeof Ae.value=="boolean"?{showTooltips:Ae.value}:{}),X8.value)),ib=B(()=>lt(Bt(lt({},sb.value),{langs:w.langs}),ob.value));function rb(M){return typeof M=="boolean"?M:void 0}const Q8=B(()=>{const M=w.codeBlockProps||{},H={},G=rb(M.showLineNumbers);G!==void 0&&(H.showLineNumbers=G);const Y=rb(M.diffInline);Y!==void 0&&(H.diffInline=Y);const oe=(function(_e){const Me=Number(_e);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return oe!==void 0&&(H.reservedHeightPx=oe),H}),J8=B(()=>lt(lt({stream:w.codeBlockStream,darkTheme:w.codeBlockDarkTheme,lightTheme:w.codeBlockLightTheme,themes:w.themes,langs:w.langs,minWidth:w.codeBlockMinWidth,maxWidth:w.codeBlockMaxWidth},typeof Ae.value=="boolean"?{showTooltips:Ae.value}:{}),ob.value)),eE=B(()=>lt({},w.mermaidProps||{})),lb=B(()=>lt({},w.d2Props||{})),tE=B(()=>lt({},w.infographicProps||{})),_u=B(()=>({typewriter:w.typewriter,fade:w.fade,customHtmlTags:ao.value.customHtmlTags})),nE=B(()=>lt(lt({},_u.value),typeof Ae.value=="boolean"?{showTooltip:Ae.value}:{})),oE=B(()=>lt(lt({},_u.value),typeof Ae.value=="boolean"?{showTooltips:Ae.value}:{})),sE=B(()=>lt(lt({},_u.value),typeof Ae.value=="boolean"?{showTooltips:Ae.value}:{})),iE=B(()=>lt(lt({},_u.value),typeof Ae.value=="boolean"?{showTooltips:Ae.value}:{}));function rE(M){return Array.isArray(M.children)&&M.children.length>0}const D1=B(()=>F8.value.map(M=>{var H,G,Y,oe,_e,Me,Ie,qe;let Re=(function(at){var ft,Mt,At,nn,It,zt,Ht;if(at.type!=="code_block")return at;const hn=at,Us=[String((ft=hn.language)!=null?ft:""),String((Mt=hn.loading)!=null?Mt:""),String((At=hn.diff)!=null?At:""),String((nn=hn.code)!=null?nn:""),String((It=hn.originalCode)!=null?It:""),String((zt=hn.updatedCode)!=null?zt:""),String((Ht=hn.raw)!=null?Ht:"")].join("\0"),as=Ci.get(hn);if(as&&as.signature===Us)return as.node;const Mi=lt({},hn);return Ci.set(hn,{signature:Us,node:Mi}),Mi})(M.node);const Ge=gf(Re);let je=db(Re,Ge);if((Re.type==="html_block"||Re.type==="html_inline")&&je===nb[Re.type]){const at=Re,ft=String((H=at.tag)!=null?H:"").trim().toLowerCase()||F6(at.content);if(ft){const Mt=Dt.value[ft];if(Pn.value.has(ft)&&Mt)je=Mt,Re=Bt(lt({},at),{type:ft,tag:ft,content:WV(at.content,ft)});else if(O6((G=at.content)!=null?G:at.raw,ft)){const At=String((oe=(Y=at.content)!=null?Y:at.raw)!=null?oe:"");Re.type==="html_inline"?(je=ro,Re={type:"text",content:At,raw:At}):(je=_a,Re={type:"paragraph",children:[{type:"text",content:At,raw:At}],raw:At})}}}const Be=Re.type==="code_block"&&u.value==="pre"&&je===qs&&!P1(Dt.value,Ge);let Ke=lt({},(function(at,ft,Mt){const At=ft??gf(at);if(at.type==="code_block"){const nn=At?P1(Dt.value,At):void 0;if(Mt&&u.value==="pre"&&!nn&&Mt===qs)return Q8.value;if(Mt&&At&&Mt===nn)return At==="mermaid"?cb(at):At==="infographic"?ub(at):At==="d2"||At==="d2lang"?lb.value:ib.value;if(Mt&&Mt===Dt.value.code_block)return ib.value;if(E2(Mt))return J8.value}return At==="mermaid"?cb(at):At==="infographic"?ub(at):At==="d2"||At==="d2lang"?lb.value:at.type==="link"?nE.value:at.type==="list"?oE.value:at.type==="blockquote"?sE.value:at.type==="table"?iE.value:at.type==="code_block"?sb.value:_u.value})(Re,Ge,je));const tt=ql.value[M.index];Re.type==="code_block"&&tt?.kind==="code-block"&&(Ke=Bt(lt({},Ke),Be?{reservedHeightPx:(_e=tt.height)!=null?_e:tt.contentHeight}:{estimatedHeightPx:tt.height,estimatedContentHeightPx:tt.contentHeight})),Be||Re.type!=="code_block"||Ge!=="mermaid"||_c(Ke.estimatedPreviewHeightPx)!=null||(Ke=Bt(lt({},Ke),{estimatedPreviewHeightPx:kv(vv(String((Me=Re.code)!=null?Me:"")))})),Be||Re.type!=="code_block"||Ge!=="infographic"||_c(Ke.estimatedPreviewHeightPx)!=null||(Ke=Bt(lt({},Ke),{estimatedPreviewHeightPx:bv(yv(String((Ie=Re.code)!=null?Ie:"")))})),Re.type==="math_block"&&(Ke=Bt(lt({},Ke),{cacheScope:ss.value}));const nt=(function(at,ft){const Mt=String(at.type);return!Yd(Mt)&&Dt.value[Mt]===ft})(Re,je),_t=nt?yk(Re,Le.value):void 0;return Bt(lt({},M),{node:Re,component:je,bindings:Ke,customBindings:lt(lt({},_t??{}),Ke),rendersCustomNode:nt,hasSlotChildren:rE(Re),slotContent:String((qe=Re.content)!=null?qe:""),isCodeBlock:Re.type==="code_block",indexKey:`${Z8.value}-${M.index}`})}));function gf(M){var H;return M?.type==="code_block"?String((H=M.language)!=null?H:"").trim().toLowerCase():""}function P1(M,H){const G=H.trim().toLowerCase();if(G)for(const Y of[G,dk(G),TM(G)]){const oe=Y&&M[Y];if(oe)return oe}}function ab(M,H,G,Y){var oe,_e;const Me=lt({},M.value);return _c(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=Y(G(String((oe=H?.code)!=null?oe:"")),void 0,Me.maxHeight==="none"?null:(_e=_c(Me.maxHeight))!=null?_e:void 0)),Me}function cb(M){return ab(eE,M,vv,kv)}function ub(M){return ab(tE,M,yv,bv)}function db(M,H){if(!M)return Nv;const G=Dt.value,Y=G[String(M.type)];if(M.type==="code_block"){const oe=H??gf(M),_e=oe?P1(G,oe):void 0;return _e||(u.value==="pre"?G.code_block||qs:oe==="mermaid"?G.mermaid||K8:oe==="infographic"?G.infographic||G8:oe==="d2"||oe==="d2lang"?G.d2||Y8:Y||G.code_block||T2.value)}return Y||nb[String(M.type)]||Nv}function H1(M){s("click",M)}function lE(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&s("mouseover",M)}function aE(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&s("mouseout",M)}function fb(M){s("mouseover",M)}function hb(M){s("mouseout",M)}const Xl=Z(null),Ui=Z(!1);let Su,Ga=null,W1=0,vf=0,yf=0;const pb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],cE=new Set(pb),mb=[".typewriter-cursor",".height-estimation-probes",...pb.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function gb(M){if(!M||typeof M!="object")return!1;const H=M.type;return typeof H=="string"&&cE.has(H)}function kf(M){var H,G;if(!M||typeof M!="object")return 0;const Y=M,oe=(G=(H=Y.raw)!=null?H:Y.content)!=null?G:Y.code;if(typeof oe=="string")return oe.length;const _e=Y.children;if(Array.isArray(_e))return _e.reduce((Ie,qe)=>Ie+kf(qe),0);const Me=Y.items;return Array.isArray(Me)?Me.reduce((Ie,qe)=>Ie+kf(qe),0):0}function bf(){Su&&(clearTimeout(Su),Su=void 0)}function vb(){W1+=1,Ga!=null&&(Wn?.(Ga),Ga=null)}function xf(){vb(),Xl.value&&(Xl.value.style.visibility="hidden")}function uE(M){var H;if(M.nodeType!==Node.TEXT_NODE||!((H=M.textContent)!=null?H:"").trim())return!1;const G=M.parentElement;return!!G&&!G.closest(mb)}function dE(M){let H=M.lastChild;for(;H;){if(uE(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const G=H;if(!G.matches(mb)&&G.lastChild){H=G.lastChild;continue}}for(;H&&H!==M&&!H.previousSibling;)H=H.parentNode;if(!H||H===M)break;H=H.previousSibling}return null}function z1(){if(!ne||!Ui.value||Ga!=null)return;const M=W1,H=()=>{Ga=null,M===W1&&(function(){var G,Y;if(!(ne&&Ui.value&&S.value&&Xl.value))return;const oe=S.value,_e=Xl.value;_e.style.visibility="hidden";const Me=(function(){const je=D1.value;for(let Be=je.length-1;Be>=0;Be--){const Ke=je[Be];if(!Ke||gb(Ke.node)||!$1(Ke.index))continue;const tt=no.get(Ke.index);if(!tt)continue;const nt=dE(tt);if(nt)return nt}return null})();if(!Me)return;let Ie=0,qe=0,Re=20,Ge=!1;if(Me?.textContent){const je=Me.textContent.length,Be=document.createRange();Be.setStart(Me,Math.max(0,je-1)),Be.setEnd(Me,je);const Ke=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,tt=(Y=Ke?.[Ke.length-1])!=null?Y:(G=Me.parentElement)==null?void 0:G.getBoundingClientRect();if(tt){const nt=ht("typewriterCursor.root.getBoundingClientRect",()=>oe.getBoundingClientRect());Ie=tt.right-nt.left+oe.scrollLeft,qe=tt.top-nt.top+oe.scrollTop,Re=tt.height||Re,Ge=!0}Be.detach()}Ge&&(_e.style.transform=`translate(${Math.max(0,Ie)}px, ${Math.max(0,qe)}px)`,_e.style.height=`${Re}px`,_e.style.visibility="visible")})()};Fn?Ga=Fn(H):H()}return Je([ve,()=>o.content,()=>o.nodes,()=>w.typewriter,V],()=>Qn(null,null,function*(){var M,H;if(!ne||ce.value||!U.value)return;if(V.value)return Ui.value=!1,bf(),void xf();if((M=o.nodes)!=null&&M.length)return Ui.value=!1,bf(),xf(),vf=((H=o.content)!=null?H:"").length,void(yf=ve.value.length);const G=(function(){var Ie,qe;return(Ie=o.nodes)!=null&&Ie.length?o.nodes.reduce((Re,Ge)=>Re+kf(Ge),0):((qe=o.content)!=null?qe:"").length})(),Y=(function(){var Ie;return(Ie=o.nodes)!=null&&Ie.length?o.nodes.reduce((qe,Re)=>qe+kf(Re),0):ve.value.length})(),oe=!gb(it.value[it.value.length-1]),_e=G>vf,Me=Y>yf;if(w.typewriter===!1||!oe||!_e&&!Me)return w.typewriter!==!1&&oe||(Ui.value=!1,xf()),vf=G,void(yf=Y);vf=G,yf=Y,Ui.value=!0,Xl.value&&(Xl.value.style.visibility="hidden"),bf(),yield gt(),z1(),Su=setTimeout(()=>{Su=void 0,Ui.value=!1},3e3)}),{flush:"post",immediate:!0}),Je(Ui,M=>Qn(null,null,function*(){M?(yield gt(),z1()):xf()}),{flush:"post"}),Je([()=>uo.value,()=>Wo.start,()=>Wo.end],()=>Qn(null,null,function*(){ne&&!ce.value&&U.value&&Ui.value&&(yield gt(),z1())}),{flush:"post"}),ho(()=>{bf(),vb(),fn.clear()}),(M,H)=>{const G=DT("NodeRenderer",!0);return C(ce)?(x(!0),N(Pe,{key:0},ot(D1.value,Y=>(x(),N(Pe,{key:Y.index},[Y.rendersCustomNode?(x(),ke(Vo(Y.component),kn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onClick:H1,onMouseover:fb,onMouseout:hb,onCopy:H[0]||(H[0]=oe=>s("copy",oe)),onHandleArtifactClick:H[1]||(H[1]=oe=>s("handleArtifactClick",oe))}),{default:Ee(()=>[Y.hasSlotChildren?(x(),ke(G,kn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(x(),ke(G,kn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),ke(Vo(Y.component),kn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onClick:H1,onMouseover:fb,onMouseout:hb,onCopy:H[2]||(H[2]=oe=>s("copy",oe)),onHandleArtifactClick:H[3]||(H[3]=oe=>s("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),N("div",{key:1,ref_key:"containerRef",ref:S,class:We(["markstream-vue markdown-renderer",[{dark:w.isDark},{virtualized:Ct.value},{"virtual-scroll-coordinated":Qe.value}]]),"data-custom-id":w.customId,onClick:H1,onMouseover:lE,onMouseout:aE},[Pt.value||Ct.value?(x(),N(Pe,{key:0},[Pt.value?(x(),N("div",{key:0,class:"height-estimation-probes",style:Vt({width:`${En.value}px`}),"aria-hidden":"true"},[_("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[ie(C(_a),{node:mo.value,"index-key":"probe-paragraph"},null,8,["node"])],512),_("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[_("ul",Mee,[ie(C(Dc),{node:is.value,"index-key":"probe-list-item"},null,8,["node"])])],512),_("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[ie(C(Pc),{node:qn.value,"index-key":"probe-list"},null,8,["node"])],512),(x(),N(Pe,null,ot(6,Y=>_("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:oe=>(function(_e,Me){_e<1||_e>6||(W[_e]=Me)})(Y,oe),class:"node-content","data-probe":`heading-${Y}`},[ie(C(Ap),{node:I8(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,Eee)),64))],4)):re("",!0),Ct.value?(x(),N("div",{key:1,class:"node-spacer",style:Vt({height:`${i1.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(x(!0),N(Pe,null,ot(D1.value,Y=>(x(),N("div",{key:Y.index,ref_for:!0,ref:oe=>J2(Y.index,oe),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[$1(Y.index)?(x(),N("div",{key:0,ref_for:!0,ref:oe=>(function(_e,Me){var Ie;Me||(function(je){const Be=`${l1()}-${je}`;let Ke=!1;for(const tt of Array.from(Hs.keys())){const nt=Wi.get(tt);(nt?.index===je||tt===Be||tt.startsWith(`${Be}-`))&&(Hs.delete(tt),Wi.delete(tt),Ke=!0)}Ke&&(Da(),On("async-node"))})(_e),lr.delete(_e),(function(je){var Be;const Ke=((Be=Ul.get(je))!=null?Be:0)+1;Ul.set(je,Ke)})(_e);const qe=jr.get(_e);if(qe){for(const je of qe)rf(je);jr.delete(_e)}if((function(je){const Be=rs.get(je);Be&&(No?.unobserve(Be),ls.delete(Be),rs.delete(je))})(_e),!Me||!Do.value)return Hi.delete(_e),void Ul.delete(_e);Hi.set(_e,Me);const Re=()=>{mf(_e,Me)};queueMicrotask(Re);const Ge=(No||typeof ResizeObserver>"u"||(No=new ResizeObserver(je=>{if(je.length)for(const Be of je){const Ke=ls.get(Be.target),tt=rs.get(Ke??-1);Ke!=null&&tt&&mf(Ke,tt)}else cr()})),No);if(Ge&&(rs.set(_e,Me),ls.set(Me,_e),Ge.observe(Me)),typeof window<"u"){const je=((Ie=it.value[_e])==null?void 0:Ie.type)==="code_block"?[16,80,240,800]:V.value?[80]:[];if(je.length){const Be=je.map(Ke=>x2(Ke,Re,"node-resize")).filter(Ke=>Ke!=null);Be.length&&jr.set(_e,Be)}}})(Y.index,oe),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(x(),ke(Vo(Y.component),kn({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[8]||(H[8]=oe=>s("copy",oe)),onHandleArtifactClick:H[9]||(H[9]=oe=>s("handleArtifactClick",oe))}),{default:Ee(()=>[Y.hasSlotChildren?(x(),ke(G,kn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(x(),ke(G,kn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),ke(Vo(Y.component),kn({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[10]||(H[10]=oe=>s("copy",oe)),onHandleArtifactClick:H[11]||(H[11]=oe=>s("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),ke(Tl,{key:0,name:"fade",css:w.fade!==!1,appear:w.fade!==!1},{default:Ee(()=>[Y.rendersCustomNode?(x(),ke(Vo(Y.component),kn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[4]||(H[4]=oe=>s("copy",oe)),onHandleArtifactClick:H[5]||(H[5]=oe=>s("handleArtifactClick",oe))}),{default:Ee(()=>[Y.hasSlotChildren?(x(),ke(G,kn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(x(),ke(G,kn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),ke(Vo(Y.component),kn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[6]||(H[6]=oe=>s("copy",oe)),onHandleArtifactClick:H[7]||(H[7]=oe=>s("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),N("div",{key:1,class:"node-placeholder",style:Vt({height:`${cf(Y.index)}px`})},null,4))],8,Tee))),128)),Ui.value?(x(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:Xl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),Ct.value?(x(),N("div",{key:2,class:"node-spacer",style:Vt({height:`${r1.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,Aee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Bs=o5;Bs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Bs.__name,Bs.name].filter(n=>!!n));for(const n of t)e.component(n,o5)};const Ck=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),Nee={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"},Iee={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"},Lee={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"},$ee={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"},Fee={class:"admonition-title"},Oee=["aria-expanded","aria-controls"],Ree=["id"],Nh=vn(Ze({__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=B(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Z(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),N("div",{class:We(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(x(),N("svg",Nee,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(x(),N("svg",Iee,[...u[2]||(u[2]=[_("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),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(x(),N("svg",Lee,[...u[3]||(u[3]=[_("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),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(x(),N("svg",$ee,[...u[4]||(u[4]=[_("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),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):re("",!0),_("span",Fee,O(i.value),1),o.node.collapsible?(x(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),N("svg",{style:Vt({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]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Oee)):re("",!0)]),Ln(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(Bs),{"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,Ree),[[mi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Nh.install=e=>{e.component(Nh.__name,Nh)};const s5=()=>ms(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Jf=null,Bee=s5;function d_e(){return Qn(this,null,function*(){if(Jf)return Jf;const e=Bee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===s5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(Jf=(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),Jf):null})}function f_e(){return!1}function h_e(){return Qn(this,null,function*(){return null})}const eh=Z(!1);let cC=!1;function X0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Dee(){return!cC&&typeof window<"u"&&typeof document<"u"&&(cC=!0,eh.value=X0(),new MutationObserver(()=>{eh.value=X0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{eh.value=X0()})),eh}const i5=["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"],Pee=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Ov=[...i5].sort((e,t)=>t.length-e.length).join("|"),Q0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Ov}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Ov})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),r5=/[),.;!?,。;!?)]+$/;function Hee(e){const t=e.toLowerCase();return i5.some(n=>t.endsWith(`.${n}`))}function Wee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Ov}))["']`,"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 zee(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(r5,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Pee.has(i),a=Hee(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 Uee(e,t={}){const n=[];Q0.lastIndex=0;let o;for(;(o=Q0.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(r5,""),u=a.length-c.length;a=c;const d=zee(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(Q0.lastIndex-=u)}return n}const qee=12e4,jee=6e4,Vee=32,Kee=3e4,uC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Gee(e){let t=0,n=0,o=0;uC.lastIndex=0;let s;for(;(s=uC.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=qee||n>=jee||t>=Vee||o>=Kee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Yee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Zee(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Xee={key:1,class:"diff-wrap"},Qee={class:"diff-bar"},Jee=["aria-label","onClick"],ete={class:"diff-pre"},tte={key:0,class:"diff-sign"},nte={class:"diff-text"},ote="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",dC="github-light",fC="github-dark",ste=Ze({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){$X(),VX(),OX(),XX(),FX(new Yee),ZX(new Zee);function t(D){return D.inline.ruler.disable("math"),D}const{t:n}=Et(),o=jt("resolveImage"),s=Z(null),i=e,r=B(()=>!i.streaming),l=B(()=>Wee(i.text??"")),a=B(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Gee(i.text??"")),c=Dee(),u=B(()=>!i.streaming),d=Ro(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(D){return!/^(https?:|data:|blob:)/i.test(D)}function b(D){if(!o)return;const W=[];for(const z of[h,p]){z.lastIndex=0;let R;for(;(R=z.exec(D))!==null;)W.push(R[2]??"")}for(const z of W)!z||!g(z)||d.has(z)||f.has(z)||(f.add(z),o(z).then(R=>{d.set(z,R!==z?R:"")}).catch(()=>{d.set(z,"")}).finally(()=>{f.delete(z)}))}function v(D){if(!o)return D;const W=z=>{if(!g(z))return null;const R=d.get(z);return R===void 0?ote:R===""?null:R};return D.replace(h,(z,R,q,K)=>{const X=W(q);return X===null?z:`${R}${X}${K}`}).replace(p,(z,R,q,K)=>{const X=W(q);return X===null?z:`${R}${X}${K}`})}Je(()=>i.text,D=>b(D??""),{immediate:!0});function m(){if(!s.value||!i.openFile||i.streaming)return;const D=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),W=[];let z=D.nextNode();for(;z;){const R=z,q=R.parentElement;q&&!q.closest("a, pre, .md-file-link, svg")&&R.data.trim().length>0&&W.push(R),z=D.nextNode()}for(const R of W){const q=Uee(R.data,{aliases:l.value});if(q.length===0||!R.parentNode)continue;const K=document.createDocumentFragment();let X=0;for(const ue of q){ue.start>X&&K.append(document.createTextNode(R.data.slice(X,ue.start)));const me=document.createElement("button");me.type="button",me.className="md-file-link",me.textContent=ue.text,me.title=ue.line?`${ue.path}:${ue.line}`:ue.path,me.addEventListener("click",ne=>{ne.preventDefault(),ne.stopPropagation(),i.openFile?.({path:ue.path,line:ue.line})}),K.append(me),X=ue.end}X<R.data.length&&K.append(document.createTextNode(R.data.slice(X))),R.parentNode.replaceChild(K,R)}}function y(D){return!(!D||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(D))}function k(D){let W=D.length;for(const z of["#","?"]){const R=D.indexOf(z);R!==-1&&R<W&&(W=R)}return D.slice(0,W)}function A(){if(!s.value||!i.openFile||i.streaming)return;const D=s.value.querySelectorAll("a[href]");for(const W of D){if(W.dataset.mdLinkHandled==="true"||W.closest("svg"))continue;const z=W.getAttribute("href")??"";y(z)&&(W.dataset.mdLinkHandled="true",W.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation(),i.openFile?.({path:k(z)})}))}}function $(){gt().then(()=>{m(),A()})}Je(()=>i.text,$),Je(()=>i.streaming,$);let L=null;un(()=>{$(),s.value&&(L=new MutationObserver($),L.observe(s.value,{childList:!0,subtree:!0}))}),xn(()=>{L?.disconnect()});const w={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1};function E(D){const W=typeof navigator<"u"?navigator.clipboard:void 0;W&&typeof W.writeText=="function"||Yo(D)}const T=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,F=B(()=>{const D=v(i.text??""),W=[];let z=0;T.lastIndex=0;let R;for(;(R=T.exec(D))!==null;){const K=R[1]??"",X=D.slice(z,R.index)+(K||"");X.trim()&&W.push({kind:"md",text:X}),W.push({kind:"diff",code:R[2]??""}),z=T.lastIndex}const q=D.slice(z);return(q.trim()||W.length===0)&&W.push({kind:"md",text:q}),W});function S(D){return D.split(`
|
|
281
|
-
`).map(W=>W.startsWith("@@")?{type:"hunk",sign:"",text:W}:/^\+(?!\+\+)/.test(W)?{type:"add",sign:"+",text:W.slice(1)}:/^-(?!--)/.test(W)?{type:"del",sign:"-",text:W.slice(1)}:W.startsWith(" ")?{type:"ctx",sign:"",text:W.slice(1)}:{type:"ctx",sign:"",text:W})}const I=Z(null);function P(D,W){Yo(D).then(z=>{z&&(I.value=W,setTimeout(()=>{I.value=null},1400))})}return(D,W)=>(x(),N("div",{ref_key:"mdRef",ref:s,class:"md"},[(x(!0),N(Pe,null,ot(F.value,(z,R)=>(x(),N(Pe,{key:R},[z.kind==="md"?(x(),ke(C(Bs),{key:0,content:z.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":dC,"code-block-dark-theme":fC,themes:[dC,fC],"code-block-props":w,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:E},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(x(),N("div",Xee,[_("div",Qee,[W[0]||(W[0]=_("span",{class:"diff-lang"},"diff",-1)),ie(Zt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:q=>P(z.code,R)},[ie(Ve,{name:I.value===R?"check":"copy",size:"sm"},null,8,["name"])],8,Jee)]),_:2},1032,["text"])]),_("pre",ete,[_("code",null,[(x(!0),N(Pe,null,ot(S(z.code),(q,K)=>(x(),N("span",{key:K,class:We(["diff-line",`diff-${q.type}`])},[q.type!=="hunk"?(x(),N("span",tte,O(q.sign),1)):re("",!0),_("span",nte,O(q.text),1)],2))),128))])])]))],64))),128))],512))}}),Bm=ct(ste,[["__scopeId","data-v-fbd17874"]]),ite={class:"tc-anim"},rte={class:"prev-anim"},lte={class:"prev"},ate=Ze({__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=B(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=B(()=>n.foldable&&s.value.length>1),r=B(()=>n.streaming||!i.value),l=B(()=>s.value.at(-1)??""),a=Z(null);return un(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Je(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),N("div",{class:We(["think",{mob:e.mobile}])},[i.value?(x(),N("div",{key:0,class:We(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[_("div",ite,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),_("div",rte,[_("span",lte,O(l.value),1)])],2)):(x(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),cte=ct(ate,[["__scopeId","data-v-fdc551ea"]]),ute={class:"activity-notice",role:"status"},dte={"aria-hidden":"true"},fte={class:"an-label"},hte=Ze({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(x(),N("div",ute,[_("span",dte,[ie(Ds,{size:"sm"})]),_("span",fte,O(e.label),1)]))}}),pte=ct(hte,[["__scopeId","data-v-0d497074"]]);function mte(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const gte=Ze({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Et(),o=Z(!1),s=B(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=B(()=>o.value?s.value:mte(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(x(),N("button",{type:"button",class:"msg-time",onClick:xt(r,["stop"])},O(i.value),1))}}),l5=ct(gte,[["__scopeId","data-v-9672fbd5"]]);function vte(e){return e.length===1?`0${e}`:e}function yte(e,t){return`${String(Number(e))}:${vte(t)}`}const hC=e=>/^\d+$/.test(e);function kte(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(hC(o)&&hC(s)&&c){const f=yte(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const bte=["data-turn-id"],xte={class:"cn-bubble"},wte={class:"cn-title"},_te={key:0,class:"cn-prompt"},Ste={class:"cn-meta"},Cte={key:0,class:"cn-meta-item"},Ate={key:1,class:"cn-meta-item"},Mte=["aria-label"],Ete=["title"],Tte=Ze({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Et(),o=B(()=>t.cron),s=B(()=>o.value?.missedCount!==void 0),i=B(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=B(()=>{const u=o.value?.cron;return u?kte(u,n):""}),l=B(()=>s.value?"error":"ok"),a=B(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=B(()=>t.text??"");return(u,d)=>(x(),N("div",{class:We(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",xte,[_("span",wte,O(i.value),1),c.value?(x(),N("span",_te,O(c.value),1)):re("",!0)]),_("div",Ste,[ie(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(x(),N("span",Cte,O(r.value),1)):re("",!0),a.value?(x(),N("span",Ate,O(a.value),1)):re("",!0),_("span",{class:We(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):(x(),ke(Ve,{key:1,name:"close",size:"sm"}))],10,Mte),o.value?.jobId?(x(),N("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},O(o.value.jobId),9,Ete)):re("",!0),e.createdAt?(x(),ke(l5,{key:3,time:e.createdAt},null,8,["time"])):re("",!0)])],10,bte))}}),Nte=ct(Tte,[["__scopeId","data-v-a62a6587"]]),Ite=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],a5=500,Tp=256*1024,pC=200,J0=16384,eg=500,tg=50,ng=50,Lte=6,$te=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Fte=/^[A-Za-z0-9+/=_-]{200,}$/;let og=null;function Di(){if(og!==null)return og;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=lo($t.debug)==="1"),og=e,e}const Al=[],Sc=[];let zu=0;const da=[];let Uu=0,Ote=1;const Np=new TextEncoder,Rte=new Set(Ite),Ak=Z(0),qu=La(!1);function Bte(){return Al}function Dte(){Al.length=0,Sc.length=0,zu=0,da.length=0,Uu=0,Ak.value++}function Ur(e){if(!qu.value){try{const t={id:Ote++,ts:Date.now(),source:e.source,kind:String(Hc(e.kind)),label:String(Hc(e.label)),sessionId:e.sessionId===void 0?void 0:String(Hc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Pl(e.detail)},n=JSON.stringify(t),o=Np.encode(n).byteLength;if(o>Tp)return;for(Al.push(t),Sc.push(n),zu+=o+(Sc.length>1?1:0);Al.length>a5||zu>Tp;){const s=Sc.shift();Al.shift(),s!==void 0&&(zu-=Np.encode(s).byteLength,Sc.length>0&&(zu-=1))}}catch{return}Ak.value++}}function ia(e){if(typeof e=="string")return e.length<=pC?e:e.slice(0,pC)}function li(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Pte(e,t){if(Rte.has(e))try{const n={ts:Date.now(),event:e,sessionId:ia(t?.sessionId),status:ia(t?.status),operation:ia(t?.operation),seq:li(t?.seq),durationMs:li(t?.durationMs),messageCount:li(t?.messageCount),contentCount:li(t?.contentCount),mediaCount:li(t?.mediaCount),sessionCount:li(t?.sessionCount),workspaceCount:li(t?.workspaceCount),promptId:ia(t?.promptId),zipBytes:li(t?.zipBytes),errorName:ia(t?.errorName),errorCode:li(t?.errorCode),requestId:ia(t?.requestId),phase:ia(t?.phase),httpStatus:li(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:li(t?.line),col:li(t?.col)},o=JSON.stringify(n),s=Np.encode(o).byteLength;if(s>Tp)return;for(da.push(o),Uu+=s+(da.length>1?1:0);da.length>a5||Uu>Tp;){const i=da.shift();i!==void 0&&(Uu-=Np.encode(i).byteLength,da.length>0&&(Uu-=1))}}catch{return}}function Hc(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return Fte.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>eg?`${i.slice(0,eg)}… [+${i.length-eg} chars]`:i}if(n!=="object")return String(e);if(t>=Lte)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,tg).map(r=>Hc(r,t+1));return e.length>tg&&i.push(`[+${e.length-tg} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,ng))o[i]=$te.test(i)?"[redacted]":Hc(r,t+1);return s.length>ng&&(o._truncatedKeys=s.length-ng),o}function Pl(e){if(e===void 0)return;const t=Hc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>J0)return{_truncated:`detail JSON was ${n.length} chars; first ${J0} kept`,preview:n.slice(0,J0)}}catch{return"[unserializable detail]"}return t}function th(e){Di()&&Ur({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Pl(e.body)}})}function sc(e){if(!Di())return;const t=e.code!==0;Ur({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:Pl(e.data)}})}function rl(e){Di()&&Ur({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 ic(e,t){Di()&&Ur({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Pl(t)})}function Hte(e){if(!Di())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;Ur({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Pl(e)})}function Wte(e){if(!Di())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);Ur({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Pl(t.payload)})}const zte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Ute(e,t,n){Di()&&Ur({source:"client",kind:`client:${e}`,label:`${zte[e]} ${t}`,detail:Pl(n)})}function Ar(e,t){Di()&&Ur({source:"client",kind:"client:event",label:`· ${e}`,detail:Pl(t)})}function yo(e,t){Pte(e,t),Ur({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let sg=!1,nh=null;function qte(){if(sg)return()=>nh?.();sg=!0;const e=[];try{if(typeof window<"u"){const n=s=>{yo("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;yo("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Di())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{Ute(n,i.map(jte).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(nh===t){for(const n of e.toReversed())n();nh=null,sg=!1}};return nh=t,t}function jte(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 c5(e=Al){if(typeof document>"u")return;const t=new Blob([Vte(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Vte(e=Al){return e===Al?Sc.join(`
|
|
282
|
-
`):e.map(t=>JSON.stringify(t)).join(`
|
|
283
|
-
`)}function Kte(){return da.join(`
|
|
284
|
-
`)}function u5(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 Rv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ni(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:u5(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 ud(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 mC(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 Mk(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:mC(e.source)};case"video":return{type:"video",source:mC(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 Bv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Mk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Gte(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 Yte(e){return{content:e.content.map(Gte),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 Zte(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function d5(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 Xte(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Qte(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Xte),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function f5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Qte),createdAt:e.created_at}}function Jte(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 ene(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=Jte(o);return{answers:t,method:e.method,note:e.note}}function Ih(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function gC(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 ll(e,t){const n=e[t];return typeof n=="string"?n:void 0}function rc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ai(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function h5(e){if(!e||typeof e!="object")return null;const t=e,n=ll(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:ll(t,"goalId")??ll(t,"goal_id")??"goal",objective:ll(t,"objective")??"",completionCriterion:ll(t,"completionCriterion")??ll(t,"completion_criterion"),status:n,turnsUsed:rc(t,"turnsUsed")??rc(t,"turns_used")??0,tokensUsed:rc(t,"tokensUsed")??rc(t,"tokens_used")??0,wallClockMs:rc(t,"wallClockMs")??rc(t,"wall_clock_ms")??0,terminalReason:ll(t,"terminalReason")??ll(t,"terminal_reason"),budget:{tokenBudget:ai(s,"tokenBudget")??ai(s,"token_budget"),remainingTokens:ai(s,"remainingTokens")??ai(s,"remaining_tokens"),turnBudget:ai(s,"turnBudget")??ai(s,"turn_budget"),remainingTurns:ai(s,"remainingTurns")??ai(s,"remaining_turns"),wallClockBudgetMs:ai(s,"wallClockBudgetMs")??ai(s,"wall_clock_budget_ms"),remainingWallClockMs:ai(s,"remainingWallClockMs")??ai(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function tne(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ni(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:ud(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:ud(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:u5(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=h5(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:Bv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Mk),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:d5(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:f5(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:Ih(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:Dv(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 nne(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function vC(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 Dv(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function one(e){return e.session_id}function sne(e){return e.seq}const ine="main",rne=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","prompt.aborted","error"]);function wr(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 lne(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 yC(){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,retryReuseMsgId:void 0}}function ds(e,t){const n=e[t];return typeof n=="string"?n:void 0}function la(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ci(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ane(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=ds(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=ds(t,"goalId")??ds(t,"goal_id")??"goal",r=ds(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ds(t,"completionCriterion")??ds(t,"completion_criterion"),status:s,turnsUsed:la(t,"turnsUsed")??la(t,"turns_used")??0,tokensUsed:la(t,"tokensUsed")??la(t,"tokens_used")??0,wallClockMs:la(t,"wallClockMs")??la(t,"wall_clock_ms")??0,terminalReason:ds(t,"terminalReason")??ds(t,"terminal_reason"),budget:{tokenBudget:ci(o,"tokenBudget")??ci(o,"token_budget"),remainingTokens:ci(o,"remainingTokens")??ci(o,"remaining_tokens"),turnBudget:ci(o,"turnBudget")??ci(o,"turn_budget"),remainingTurns:ci(o,"remainingTurns")??ci(o,"remaining_turns"),wallClockBudgetMs:ci(o,"wallClockBudgetMs")??ci(o,"wall_clock_budget_ms"),remainingWallClockMs:ci(o,"remainingWallClockMs")??ci(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function fa(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 cne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ds(t,"name")??ds(t,"toolName")??"tool",o=Fa(une(n)),s=dne(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=ds(n,"text");if(s)return ig(s);const i=ds(n,"message");if(i)return ig(i)}const o=ds(t,"message");if(o)return ig(o)}return null}function une(e){return e.replace(/_\d+$/,"")}const kC=2e3;function ig(e){return e.length>kC?`${e.slice(0,kC)}…`:e}function dne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Sd(e,n)}function fne(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=ds(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=fa(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=cne(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=fa(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 Fu(e){return{...e,content:e.content.map(t=>({...t}))}}function bC(e,t,n){const o={id:wr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function hne(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 pne(e){return Array.isArray(e)?e.map(t=>Mk(t)):[]}function xC(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 mne(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 gne(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 wC(e,t){e.messages.find(n=>n.id===t)}function vne(e,t,n,o,s,i){const r={id:wr("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 Ou(e,t){return e.messages.find(n=>n.id===t)}function _C(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 yne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=yC(),e.set(u,d)),d}function o(u){e.set(u,yC())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??wr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=bC(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const b=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:b}),f.toolStartTimes.set(g.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:Fu(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),g=d,b=[],v=g?.agentId;if(typeof v=="string"&&v!==ine){const m=t.has(v);if(m&&(u==="thinking.delta"||u==="assistant.delta")){const y=g?.delta??"";return y?[{type:"agentDelta",sessionId:f,agentId:v,delta:{[u==="thinking.delta"?"thinking":"text"]:y}}]:[]}if(m&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:v,reason:g?.reason}];if(rne.has(u))return fne(p,f,v,u,g??{},t)}switch(u){case"session.meta.updated":{const m=g?.patch?.title??g?.title,y=g?.patch?.lastPrompt,k={};typeof m=="string"&&m.length>0&&(k.title=m),typeof y=="string"&&(k.lastPrompt=y),(k.title!==void 0||k.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...k});break}case"prompt.submitted":{const m=g?.promptId,y=g?.userMessageId;if(!m||!y)break;const k=pne(g?.content);if(k.length===0)break;p.currentPromptId=m;const A=hne(p,f,m,y,k,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:Fu(A)});break}case"turn.started":{const m=g?.turnId,y=p.currentPromptId??wr("pr_");p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y),p.turnTextLen=0,p.turnThinkLen=0,b.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;if(y||(y=wr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,Ou(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const k=bC(p,f,y);p.currentAssistantMsgId=k.id,b.push({type:"messageCreated",message:Fu(k)});break}case"thinking.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const k=a(p.turnThinkLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=xC(p,m,"thinking",y);if(A<0)break;p.turnThinkLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{thinking:y}});break}case"assistant.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const k=a(p.turnTextLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=xC(p,m,"text",y);if(A<0)break;p.turnTextLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{text:y}});break}case"tool.use":case"tool.call.started":{const m=p.currentAssistantMsgId,y=g?.turnId,k=p.turnPromptId.get(y)??p.currentPromptId;if(!m||!k)break;const A=g?.toolCallId,$=g?.name??g?.toolName??"",L=g?.args??g?.input??{};mne(p,m,A,$,L);const w=Ou(p,m);w&&w.content.length-1,p.toolStartTimes.set(A,Date.now()),w&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:w.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const m=g?.toolCallId,y=gne(g??{});m&&y&&b.push({type:"toolOutput",sessionId:f,toolCallId:m,outputChunk:y.outputChunk,stream:y.stream});break}case"tool.result":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;y||(y=wr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y));const k=g?.toolCallId,A=g?.output,$=g?.isError??!1;p.toolStartTimes.get(k)??Date.now(),p.toolStartTimes.delete(k);const L=vne(p,f,k,A,$,y);b.push({type:"messageCreated",message:Fu(L)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const m=p.currentAssistantMsgId,y=lne(g?.usage);if(p.totalInput+=y.input,p.totalOutput+=y.output,p.totalCacheRead+=y.cacheRead,p.totalCacheCreate+=y.cacheCreate,m){wC(p,m);const k=Ou(p,m);k&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:k.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(p.model=g.model),g?.contextTokens!==void 0&&(p.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(p.contextLimit=g.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:_C(p),model:p.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0});break}case"turn.ended":{const m=p.currentAssistantMsgId,y=g?.reason??"completed",k=la(g??{},"durationMs");if(b.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:g?.reason}),m){wC(p,m);const $=Ou(p,m);$&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:$.content.map(L=>({...L})),status:y==="failed"||y==="blocked"?"error":"completed",durationMs:k})}p.turnCount++;const A=_C(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptCompleted",sessionId:f,promptId:m,reason:g?.reason??"completed"});break}case"prompt.aborted":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptAborted",sessionId:f,promptId:m});break}case"turn.step.retrying":{const m=p.currentAssistantMsgId;if(m!==void 0){const y=Ou(p,m);y!==void 0&&(y.content=y.content.filter(k=>k.type!=="text"&&k.type!=="thinking"&&k.type!=="toolUse"),b.push({type:"messageUpdated",sessionId:f,messageId:m,content:y.content.map(k=>({...k})),status:"pending"}),p.retryReuseMsgId=m)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const y={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:wr("task_"),sessionId:f,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0,runInBackground:g?.runInBackground===!0};p.subagentMeta.set(y.id,y),b.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.started":{const m=fa(p,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.suspended":{const m=fa(p,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.completed":{const m=typeof g?.resultSummary=="string"?g.resultSummary:void 0,y=fa(p,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:m});break}case"subagent.failed":{const m=typeof g?.error=="string"?g.error:void 0,y=fa(p,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:m});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message,name:g?.name,details:g?.details,retryable:g?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"task.started":{const m=g?.info??{},y=typeof m.startedAt=="number"?new Date(m.startedAt).toISOString():void 0,k=typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):wr("task_"),A=typeof m.description=="string"?m.description:typeof m.command=="string"?m.command:_n.global.t("tasks.defaultDescription");if(m.kind==="agent"){const L=typeof m.agentId=="string"&&m.agentId.length>0?m.agentId:void 0;if(L!==void 0){const w=fa(p,f,L,{description:A,backgroundTaskId:k,runInBackground:!0});w&&b.push({type:"taskCreated",sessionId:f,task:w})}else b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,subagentPhase:"queued",runInBackground:!0}});break}const $=typeof m.command=="string"?m.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"bash",description:A,command:$,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"task.terminated":{const m=g?.info??{},y=m.status==="failed"||typeof m.exitCode=="number"&&m.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):"",status:y?"failed":"completed"});break}case"compaction.completed":{const m=g?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof m.tokensBefore=="number"?m.tokensBefore:void 0,tokensAfter:typeof m.tokensAfter=="number"?m.tokensAfter:void 0,summary:typeof m.summary=="string"?m.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const m=ane(g?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:m?.status==="complete"?null:m});break}case"cron.fired":{const m=g?.origin,y=ds(g??{},"prompt");if(m&&typeof m=="object"&&m.kind==="cron_job"&&y){const k={id:wr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:y}],createdAt:new Date().toISOString(),metadata:{origin:m}};p.messages.push(k),b.push({type:"messageCreated",message:Fu(k)})}break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const kne=new Set(["server_hello","ack","ping","resync_required","error","pong"]),SC=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","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),bne=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"]),xne=new Set(["assistant.delta","thinking.delta"]);function wne(e,t){if(kne.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return xne.has(o)?_ne(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?bne.has(o)?{route:"protocol"}:SC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:SC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function _ne(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 ju extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class kr extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function nr(e){return e instanceof ju||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Ek(e){return e instanceof kr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Uo="kimi-web.server-credential",Sne="token",Cne=10080*60*1e3;let er;const Pv=new Set;function Ane(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Sne);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 Hv(e){return{version:1,credential:e,expiresAt:Date.now()+Cne}}function Mne(e){return JSON.stringify(e)}function Tk(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Wv(e){globalThis.localStorage?.setItem(Uo,Mne(e))}function Ene(){try{const e=globalThis.localStorage?.getItem(Uo);if(e){const n=Tk(e);if(n===void 0){const o=Hv(e);let s=!1;try{Wv(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(Uo)===e&&globalThis.localStorage?.removeItem(Uo),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Uo)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Uo),globalThis.localStorage?.getItem(Uo)===e&&globalThis.localStorage?.removeItem(Uo);return}const t=globalThis.sessionStorage?.getItem(Uo);if(t){const n=Hv(t);let o=!1;try{Wv(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Uo),o=!0}catch{}return o?n:void 0}return}catch{return}}function Tne(){const e=Ane();return e?(m5(e),!0):(er=Ene(),er!==void 0)}function p5(){if(er!==void 0){if(er.expiresAt<=Date.now()){Nne(er);return}return er.credential}}function Nne(e){er=void 0;try{globalThis.sessionStorage?.removeItem(Uo);const t=globalThis.localStorage?.getItem(Uo),n=t==null?void 0:Tk(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Uo)}catch{}}function m5(e){const t=Hv(e);er=t;try{Wv(t)}catch{}try{globalThis.sessionStorage?.removeItem(Uo)}catch{}}function Ine(){const e=er;er=void 0;try{const t=globalThis.localStorage?.getItem(Uo),o=(t==null?void 0:Tk(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(Uo),globalThis.sessionStorage?.removeItem(Uo)}catch{}}function Lne(e){return Pv.add(e),()=>{Pv.delete(e)}}function $ne(){Ine();for(const e of Pv)try{e()}catch{}}const pc=3e4,oh=5*6e4,g5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",CC=500,v5=40101;function sh(e=pc){try{return AbortSignal.timeout(e)}catch{return}}function Fne(e,t){let n="",o=e;for(let s=0;s<t;s++)n=g5[o%32]+n,o=Math.floor(o/32);return n}function One(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=>g5[n%32]).join("")}function ih(){return`${Fne(Date.now(),10)}${One(16)}`}function Rne(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 rg(e){try{const t=await e.text();return t?t.length>CC?`${t.slice(0,CC)}...`:t:void 0}catch{return}}class Bne{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=kc(this.origin,t),o=ih(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();th({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:sh()})}catch(a){throw rl({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new kr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:pc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return sc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),sc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new ju({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=kc(this.origin,t),r=ih(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();th({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:sh(oh)})}catch(h){throw rl({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new kr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:oh,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const b=h?.code??c.status,v=h?.msg??c.statusText;throw sc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:b,msg:v,envelopeRequestId:h?.request_id}),new ju({code:b,msg:v,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),g=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw rl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:g}),new kr({message:`Invalid ZIP response from ${s} ${t}`,cause:g,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:oh,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await rg(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw rl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new kr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:oh,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return sc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=kc(this.origin,t),s=ih(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();th({method:"POST",path:t,url:o,requestId:s,body:Rne(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:sh()})}catch(u){throw rl({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new kr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:pc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw rl({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new kr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:pc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await rg(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(sc({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 ju({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=kc(this.origin,n);if(s){const h=new URLSearchParams;for(const[g,b]of Object.entries(s))b!==void 0&&h.set(g,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=ih(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();th({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:sh()})}catch(h){throw rl({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new kr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:pc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw rl({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new kr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:pc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await rg(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(sc({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 ju({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=p5();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===v5)&&$ne()}}const Dne="kimi-code.bearer.",Pne=3e4;class Hne{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;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),ic("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=p5(),n=t!==void 0?[`${Dne}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{ic("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));Wte(i),this.handleFrame(i)}catch(i){ic("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{ic("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{ic("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,ic("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=rh(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(rh(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(rh(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)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Pne),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),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=rh(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=wne(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)),Hte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function rh(e,t){return`${e}\0${t}`}function Wne(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function AC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function lg(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 MC(e){return e==="auto_compact"||e==="manual_compact"}class zne{http;config;constructor(t){this.config=t,this.http=new Bne(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:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Ni),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 Ni(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ni(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 Ni(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return h5(n)}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 restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ni(n)}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(Bv),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();yo("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Ni(o.session),messages:o.messages.items.map(Bv),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(d5),pendingQuestions:o.pending_questions.map(f5),subagents:(o.subagents??[]).map(Ih)};return yo("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw yo("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...AC(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(`
|
|
285
|
-
`).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:Wne(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();yo("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Yte(n));return yo("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw yo("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...AC(s)}),s}}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 Ni(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 Ni(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ni)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Zte(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)}`,ene(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(Ih)}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 Ih(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(lg)}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 lg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return lg(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 listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${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(gC)])):void 0;return{items:s.items.map(gC),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 kc(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(ud)}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 ud(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return ud(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir,isGitRepo:o.is_git_repo,branch:o.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(nne)}async listProviders(){return(await this.http.get("/providers")).items.map(vC)}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 vC(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 ag(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return ag(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return ag(t)}async getConfig(){const t=await this.http.get("/config");return Dv(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return Dv(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 t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,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 kc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=SI(this.config.serverHttpUrl,this.config.clientId),o=yne(),s=new Hne(n,this.config.clientId,{onWireEvent:i=>{const r=one(i),l=sne(i),a=tne(i);a.type==="historyCompacted"&&!MC(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){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!MC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},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)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function ag(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 EC;function dt(){return EC??=new zne(kI()),EC}const Une=["src","controls","muted"],qne=["src","alt"],y5=Ze({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=Z(t.fileId?"":t.url),o=Z(null),s=Z(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await dt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Je(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),un(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),ho(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(x(),N("video",{key:0,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Une)):(x(),N("img",{key:1,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,qne))}}),jne=["title","data-kind"],Vne=["aria-label"],Kne={class:"att-tile"},Gne={class:"att-name"},Yne={key:1,class:"att-err"},Zne=["aria-label"],Xne=Ze({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et(),i=B(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=B(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=B(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=B(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(x(),N("span",{class:We(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[_("span",Kne,[e.kind==="image"&&e.url?(x(),ke(y5,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(x(),ke(Ve,{key:1,name:"play",size:"sm"})):e.kind==="image"?(x(),ke(Ve,{key:2,name:"image",size:"sm"})):(x(),ke(Ve,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",Gne,O(l.value),1),e.uploading?(x(),ke(Ds,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(x(),N("span",Yne,[ie(Ve,{name:"info",size:"sm"})])):re("",!0)],8,Vne),e.removable?(x(),ke(Zt,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ee(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[ie(Ve,{name:"close",size:"sm"})],8,Zne)]),_:1},8,["text"])):re("",!0)],10,jne))}}),k5=ct(Xne,[["__scopeId","data-v-12ec975b"]]),Qne=["aria-label"],Jne=120,eoe=60,toe=Ze({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*Jne}ms`,"--moon-frame-fast-delay":`${o*eoe}ms`}}return(o,s)=>(x(),N("span",{class:We(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(x(),N(Pe,null,ot(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:Vt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Qne))}}),b5=ct(toe,[["__scopeId","data-v-a6b7ec07"]]),Qi=Z(null),Wc=Z(!1);function Nk(e){const t=Qi.value;!t||Wc.value||(Qi.value=null,t.resolve(e))}async function noe(){const e=Qi.value;if(!(!e||Wc.value)){if(!e.action){Nk(!0);return}Wc.value=!0;try{await e.action(),Qi.value===e&&(Qi.value=null),e.resolve(!0)}catch(t){Qi.value===e&&(Qi.value=null),e.reject(t)}finally{Wc.value=!1}}}function ooe(e){return Wc.value?Promise.resolve(!1):(Qi.value&&Nk(!1),new Promise((t,n)=>{Qi.value={...e,resolve:t,reject:n}}))}function Zd(){return{current:Qi,busy:Wc,confirm:ooe,settle:Nk,runAction:noe}}const soe=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,ioe=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,roe=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,TC="text/plain;charset=utf-8";function loe(e,t){const n=(t??"").toLowerCase();if(soe.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:TC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:ioe.test(o)?TC:roe.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function x5(e,t,n){const o=loe(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await dt().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const aoe={class:"chat"},coe={key:0,class:"chat-loading"},uoe={class:"chat-loading-text"},doe={key:1,class:"chat-empty"},foe={key:1,class:"top-sentinel-text"},hoe={key:0,class:"u-turn"},poe=["data-turn-id"],moe={key:0,class:"u-atts"},goe={key:1,class:"skill-act"},voe={class:"skill-act-head"},yoe={key:0,class:"skill-act-args"},koe={key:2,class:"skill-act"},boe={class:"skill-act-head"},xoe={key:0,class:"skill-act-args"},woe={key:3,class:"u-text"},_oe={key:0,class:"u-meta"},Soe=["aria-label","onClick"],Coe=["aria-label","onClick"],Aoe=["data-turn-id"],Moe=["onClick"],Eoe={class:"cd-view"},Toe={key:1,class:"cd-label"},Noe=["data-turn-id"],Ioe={key:1,class:"msg"},Loe={key:0,class:"a-msg-ft"},$oe={key:0,class:"a-duration"},Foe=["aria-label","onClick"],Ooe={key:4,class:"sending-placeholder"},Roe={key:5,class:"q-stack"},Boe={class:"q-head"},Doe={class:"q-title"},Poe={class:"q-hint"},Hoe=["onDragover","onDrop"],Woe={class:"u-bub q-bub"},zoe=["title","onDragstart"],Uoe=["title","onClick"],qoe={key:0,class:"u-text q-text"},joe={key:1,class:"q-text q-text-placeholder"},Voe={key:0,class:"q-imgs"},Koe={key:0,class:"q-file"},Goe={key:1,class:"q-tag q-tag-next"},Yoe={key:2,class:"q-tag q-tag-idx"},Zoe=["aria-label","onClick"],Xoe={key:0,class:"open-unsupported",role:"status"},Qoe=2500,Joe=Ze({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=Et(),{confirm:s}=Zd();xn(()=>{K!==null&&(clearTimeout(K),K=null),I!==null&&(clearTimeout(I),I=null),E!==null&&(clearTimeout(E),E=null),ce!==null&&(clearTimeout(ce),ce=null)});const i=e,r=Z(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Le=>{Le[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}un(a),xn(()=>{l?.disconnect(),l=null}),Je(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{gt().then(a)});const c=B(()=>{if(!i.turnActive||i.turns.length===0)return null;const Le=i.turns.at(-1);return Le.role==="assistant"?Le.id:null}),u=B(()=>i.working),d=n,f=Z(null),h=Z(null);function p(Le){return(Le.attachments?.length??0)>0}function g(Le){d("editQueued",Le)}function b(Le,le){if(f.value=Le,!le.dataTransfer)return;le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",String(Le));const U=le.currentTarget?.closest(".q-turn");U&&le.dataTransfer.setDragImage(U,24,24)}function v(Le,le){if(f.value===null)return;le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move");const U=le.currentTarget.getBoundingClientRect(),ae=le.clientY<U.top+U.height/2?"before":"after";h.value={index:Le,position:ae}}function m(Le,le){le.preventDefault();const U=f.value,ae=h.value?.position??"before";if(f.value=null,h.value=null,U===null)return;let se=ae==="before"?Le:Le+1;U<se&&(se-=1),U!==se&&d("reorderQueue",{from:U,to:se})}function y(){f.value=null,h.value=null}const k=B(()=>{for(let Le=i.turns.length-1;Le>=0;Le--)if(i.turns[Le].role==="user")return i.turns[Le].id;return null});function A(Le){return Le.role==="user"&&Le.id===k.value&&!i.working&&!Le.skillActivation&&!Le.pluginCommand}function $(Le){const le=Le.compaction,U=le?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof le?.tokensBefore=="number"&&typeof le?.tokensAfter=="number"?U+o("conversation.compactedTokens",{before:or(le.tokensBefore),after:or(le.tokensAfter)}):U}const L=Z(null),w=Z(null);let E=null;async function T(Le){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(Le)}function F(Le){w.value===null&&(w.value=Le.id,d("editMessage",{text:Le.text,attachments:Le.attachments}),E=setTimeout(()=>{E=null,w.value=null},Qoe))}Je(()=>i.turns,Le=>{w.value!==null&&(Le.some(le=>le.id===w.value)||(w.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const S=Z(!1);let I=null;function P(){if(i.turns.length===0)return;const Le=[];for(const U of i.turns){if(U.role==="compaction"||U.role==="cron")continue;const ae=U.role==="user"?"User":"Assistant",se=xW(U);se.trim()&&Le.push(`**${ae}**
|
|
286
|
-
|
|
287
|
-
${se}`)}const le=Le.join(`
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
`);Yo(le).then(U=>{U&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}function D(Le){const le=[];for(let U=Le;U>=0;U--){const ae=i.turns[U];if(!ae||ae.role!=="assistant")break;le.unshift(ae)}return le}function W(Le){return D(Le).map(le=>bW(le)).filter(Boolean).join(`
|
|
292
|
-
|
|
293
|
-
`)}function z(){for(let Le=i.turns.length-1;Le>=0;Le-=1)if(i.turns[Le]?.role==="assistant")return W(Le);return""}function R(){const Le=z();Le.trim()&&Yo(Le).then(le=>{le&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:P,copyFinalSummary:R});function q(Le){const le=i.turns[Le];if(!le||le.role!=="assistant")return!1;const U=i.turns[Le+1];return!U||U.role!=="assistant"}let K=null;function X(Le){const le=i.turns[Le];if(!le)return;const U=W(Le);U.trim()&&Yo(U).then(ae=>{ae&&(L.value=le.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,L.value=null},1400))}).catch(()=>{})}function ue(Le){const le=Le.text;le.trim()&&Yo(le).then(U=>{U&&(L.value=Le.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,L.value=null},1400))}).catch(()=>{})}function me(Le){return{kind:Le.kind==="video"?"video":"image",url:Le.url,path:Le.name,fileId:Le.fileId}}const ne=Z(null);let ce=null;function de(Le){if(Le.kind==="image"||Le.kind==="video"){d("openMedia",me(Le));return}Le.fileId!==void 0&&x5(Le.fileId,Le.name,Le.mediaType).then(le=>{le==="unsupported"&&(ne.value=Le.name??Le.fileId??"",ce!==null&&clearTimeout(ce),ce=setTimeout(()=>{ce=null,ne.value=null},2400))})}function Ae(Le,le){return Le.id!==c.value?!1:le.sourceIndex===vm(Le).length-1}return(Le,le)=>(x(),N(Pe,null,[_("div",aoe,[e.sessionLoading?(x(),N("div",coe,[ie(Ds,{size:"sm"}),_("span",uoe,O(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),N("div",doe)):re("",!0),e.hasMoreMessages||e.loadingMore?(x(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:We(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),N("span",foe,[ie(Ds,{size:"sm"}),Xe(" "+O(C(o)("conversation.loadingOlder")),1)])):(x(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:le[0]||(le[0]=U=>d("loadOlderMessages"))},O(C(o)("conversation.loadOlder")),1))],2)):re("",!0),(x(!0),N(Pe,null,ot(e.turns,(U,ae)=>(x(),N(Pe,{key:U.id},[U.role==="user"?(x(),N("div",hoe,[_("div",{class:We(["u-bub turn-anchor",{undoing:w.value===U.id}]),"data-turn-id":U.id},[U.attachments&&U.attachments.length>0?(x(),N("div",moe,[(x(!0),N(Pe,null,ot(U.attachments,(se,j)=>(x(),ke(k5,{key:j,kind:se.kind,name:se.name,url:se.url,"file-id":se.fileId,"media-type":se.mediaType,size:se.size,onActivate:J=>de(se)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):re("",!0),U.skillActivation?(x(),N("div",goe,[_("div",voe,[le[9]||(le[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,O(C(o)("conversation.activatedSkill",{name:U.skillActivation.name})),1)]),U.skillActivation.args?(x(),N("div",yoe,O(U.skillActivation.args),1)):re("",!0)])):U.pluginCommand?(x(),N("div",koe,[_("div",boe,[le[10]||(le[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+O(U.pluginCommand.pluginId)+":"+O(U.pluginCommand.commandName),1)]),U.pluginCommand.args?(x(),N("div",xoe,O(U.pluginCommand.args),1)):re("",!0)])):(x(),N("div",woe,O(U.text),1))],10,poe),U.createdAt||A(U)?(x(),N("div",_oe,[A(U)?(x(),N("div",{key:0,class:We(["u-edit-wrap",{undoing:w.value===U.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:se=>T(U)},[ie(Ve,{name:"undo",size:"sm"})],8,Soe)],2)):re("",!0),U.text.trim().length>0?(x(),N("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:xt(se=>ue(U),["stop"])},[L.value!==U.id?(x(),ke(Ve,{key:0,name:"copy",size:"sm"})):(x(),ke(Ve,{key:1,name:"check",size:"sm"}))],8,Coe)):re("",!0),U.createdAt?(x(),ke(l5,{key:2,time:U.createdAt},null,8,["time"])):re("",!0)])):re("",!0)])):U.role==="compaction"?(x(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":U.id,role:"separator"},[le[11]||(le[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),U.text?(x(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:se=>d("openCompaction",{turnId:U.id})},[_("span",null,O($(U)),1),_("span",Eoe,O(C(o)("conversation.viewSummary")),1)],8,Moe)):(x(),N("span",Toe,O($(U)),1)),le[12]||(le[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Aoe)):U.role==="cron"?(x(),ke(Nte,{key:2,text:U.text,cron:U.cron,"turn-id":U.id,"created-at":U.createdAt},null,8,["text","cron","turn-id","created-at"])):(x(),N("div",{key:3,class:"a-msg turn-anchor","data-turn-id":U.id},[(x(!0),N(Pe,null,ot(C(kW)(U),(se,j)=>(x(),N(Pe,{key:C(wW)(se,j)},[se.kind==="thinking"?(x(),ke(cte,{key:0,text:se.thinking,mobile:"",streaming:Ae(U,se),onOpen:J=>d("openThinking",{turnId:U.id,blockIndex:se.sourceIndex})},null,8,["text","streaming","onOpen"])):se.kind==="text"&&se.text?(x(),N("div",Ioe,[ie(Bm,{text:se.text,streaming:Ae(U,se),"open-file":J=>d("openFile",J)},null,8,["text","streaming","open-file"])])):se.kind==="tool-stack"?(x(),ke(TW,{key:2,tools:se.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[1]||(le[1]=J=>d("openMedia",J)),onOpenFile:le[2]||(le[2]=J=>d("openFile",J)),onOpenToolDiff:le[3]||(le[3]=J=>d("openToolDiff",J)),onOpenAgent:le[4]||(le[4]=J=>d("openAgent",J))},null,8,["tools","tool-diff-panel"])):se.kind==="tool"?(x(),ke(CA,{key:3,tool:se.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[5]||(le[5]=J=>d("openMedia",J)),onOpenFile:le[6]||(le[6]=J=>d("openFile",J)),onOpenToolDiff:le[7]||(le[7]=J=>d("openToolDiff",J)),onOpenAgent:le[8]||(le[8]=J=>d("openAgent",J))},null,8,["tool","tool-diff-panel"])):re("",!0)],64))),128)),U.id!==c.value&&q(ae)&&(W(ae).trim().length>0||U.durationMs!==void 0)?(x(),N("div",Loe,[ie(Zt,{text:`${U.durationMs} ms`},{default:Ee(()=>[U.durationMs!==void 0?(x(),N("span",$oe,O(C(gW)(U.durationMs)),1)):re("",!0)]),_:2},1032,["text"]),W(ae).trim().length>0?(x(),N("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:se=>X(ae)},[L.value!==U.id?(x(),ke(Ve,{key:0,name:"copy",size:"sm"})):(x(),ke(Ve,{key:1,name:"check",size:"sm"}))],8,Foe)):re("",!0)])):re("",!0)],8,Noe))],64))),128)),e.compaction?(x(),ke(pte,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(x(),N("div",Ooe,[ie(b5,{fast:e.fastMoon},null,8,["fast"])])):re("",!0),e.queued.length>0?(x(),N("div",Roe,[_("div",Boe,[_("span",Doe,[ie(Ve,{name:"mail",size:"sm"}),Xe(" "+O(C(o)("composer.queueLabel"))+" · ",1),_("b",null,O(e.queued.length),1)]),_("span",Poe,O(C(o)("composer.queueAutoDrain")),1)]),(x(!0),N(Pe,null,ot(e.queued,(U,ae)=>(x(),N("div",{key:ae,class:We(["u-turn q-turn",{"q-dragging":f.value===ae,"drop-before":h.value?.index===ae&&h.value.position==="before","drop-after":h.value?.index===ae&&h.value.position==="after"}]),onDragover:se=>v(ae,se),onDrop:se=>m(ae,se)},[_("div",Woe,[_("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:se=>b(ae,se),onDragend:y},[ie(Ve,{name:"grip",size:"sm"})],40,zoe),_("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:se=>g(ae)},[U.text?(x(),N("span",qoe,O(U.text),1)):(x(),N("span",joe,[ie(Ve,{name:"file",size:"sm"}),Xe(" "+O(C(o)("composer.queuedAttachments",{n:U.attachments?.length??0})),1)]))],8,Uoe),p(U)?(x(),N("div",Voe,[(x(!0),N(Pe,null,ot(U.attachments,(se,j)=>(x(),N(Pe,{key:j},[se.kind==="file"?(x(),N("span",Koe,[ie(Ve,{name:"file",size:"sm"}),Xe(" "+O(se.name??se.fileId),1)])):(x(),ke(y5,{key:1,url:se.url,kind:se.kind,"file-id":se.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):re("",!0),ae===0?(x(),N("span",Goe,O(C(o)("composer.queueNext")),1)):(x(),N("span",Yoe,"#"+O(ae+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:xt(se=>d("unqueue",ae),["stop"])},[ie(Ve,{name:"close",size:"sm"})],8,Zoe)])],42,Hoe))),128))])):re("",!0)]),ne.value!==null?(x(),N("div",Xoe,O(C(o)("composer.attachmentOpenUnsupported",{name:ne.value})),1)):re("",!0)],64))}}),w5=ct(Joe,[["__scopeId","data-v-7c31d582"]]),ese={class:"ch-id"},tse={key:0,class:"ch-ws"},nse={key:1,class:"ch-sep"},ose=["onKeydown"],sse={class:"ch-ses"},ise={key:0,class:"ch-pill ch-sync-pill"},rse={key:0,class:"ch-ahead"},lse={key:1,class:"ch-behind"},ase={key:1,class:"ch-pill ch-diff-pill"},cse={key:0,class:"ch-add"},use={key:1,class:"ch-del"},dse=Ze({__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","exportSession"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=B(()=>o.ahead??0),r=B(()=>o.behind??0),l=B(()=>o.gitDiffStats?.totalAdditions??0),a=B(()=>o.gitDiffStats?.totalDeletions??0),c=B(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(q){return q.trim().toLowerCase().replaceAll("_","-")}function f(q){const K=d(q);return u[K]?`pr-${K}`:"pr-unknown"}function h(q){return n(u[d(q)]??"header.prStatusUnknown")}const p=Z(!1),g=Z(null),b=Z(null),v=Z({});function m(q){const K=q.target;b.value?.el?.contains(K)||g.value?.el?.contains(K)||A()}function y(){A()}async function k(q){if(q.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",y),await gt();const K=g.value?.el,X=b.value?.el;if(!K||!X)return;const ue=K.getBoundingClientRect(),me=4,ne=8,ce=X.offsetWidth,de=X.offsetHeight;let Ae=ue.bottom+me;Ae+de>window.innerHeight-ne&&(Ae=Math.max(ne,ue.top-de-me));let Le=ue.left;Le+ce>window.innerWidth-ne&&(Le=Math.max(ne,ue.right-ce)),v.value={top:`${Math.round(Ae)}px`,left:`${Math.round(Le)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)}xn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)});function $(){s("copyAll"),A()}function L(){s("copyFinalSummary"),A()}const w=Z(!1);function E(){o.sessionId&&Yo(o.sessionId).then(q=>{q&&(w.value=!0,setTimeout(()=>{w.value=!1},1200))})}const T=Z(!1),F=Z(""),S=Z(null);async function I(){if(A(),!!o.sessionId){T.value=!0,F.value=o.sessionTitle??"",await gt();try{S.value?.focus(),S.value?.select()}catch{}}}function P(){const q=F.value.trim();q&&o.sessionId&&q!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,q),T.value=!1}function D(){T.value=!1}function W(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function z(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function R(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(q,K)=>(x(),N("header",{class:We(["chat-header",{"macos-desktop":C($c)}])},[_("div",ese,[e.workspaceName?(x(),N("span",tse,O(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(x(),N("span",nse,"/")):re("",!0),T.value?Ln((x(),N("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":K[0]||(K[0]=X=>F.value=X),class:"ch-rename",type:"text",onKeydown:[Ji(xt(P,["stop"]),["enter"]),Ji(xt(D,["stop"]),["esc"])],onBlur:P,onClick:K[1]||(K[1]=xt(()=>{},["stop"]))},null,40,ose)),[[_s,F.value]]):e.sessionTitle?(x(),ke(Zt,{key:3,text:e.sessionTitle},{default:Ee(()=>[_("span",sse,O(e.sessionTitle),1)]),_:1},8,["text"])):re("",!0)]),ie(Dn,{ref_key:"kebabRef",ref:g,class:We(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:K[2]||(K[2]=xt(X=>k(X),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(x(),ke(vl,{key:0,ref_key:"menuRef",ref:b,class:"ch-menu",style:Vt(v.value),onClick:K[3]||(K[3]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie(mn,{onClick:$},{default:Ee(()=>[ie(Ve,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ie(mn,{onClick:L},{default:Ee(()=>[ie(Ve,{name:"file-text",size:"sm"}),Xe(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(x(),N(Pe,{key:0},[ie(mn,{separator:""}),ie(mn,{onClick:E},{default:Ee(()=>[ie(Ve,{name:w.value?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(w.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ie(mn,{onClick:I},{default:Ee(()=>[ie(Ve,{name:"pencil",size:"sm"}),Xe(" "+O(C(n)("header.renameSession")),1)]),_:1}),ie(mn,{onClick:W},{default:Ee(()=>[ie(Ve,{name:"git-fork",size:"sm"}),Xe(" "+O(C(n)("header.forkSession")),1)]),_:1}),ie(mn,{onClick:z},{default:Ee(()=>[ie(Ve,{name:"download",size:"sm"}),Xe(" "+O(C(n)("header.exportSession")),1)]),_:1}),ie(mn,{danger:"",onClick:R},{default:Ee(()=>[ie(Ve,{name:"archive",size:"sm"}),Xe(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):re("",!0)]),_:1},8,["style"])):re("",!0),K[6]||(K[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),N("button",{key:1,type:"button",class:"ch-git",onClick:K[4]||(K[4]=X=>s("openChanges"))},[_("span",{class:We(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(x(),N("span",ise,[i.value>0?(x(),N("span",rse,"↑"+O(i.value),1)):re("",!0),r.value>0?(x(),N("span",lse,"↓"+O(r.value),1)):re("",!0)])):re("",!0),c.value?(x(),N("span",ase,[l.value>0?(x(),N("span",cse,"+"+O(l.value),1)):re("",!0),a.value>0?(x(),N("span",use,"-"+O(a.value),1)):re("",!0)])):re("",!0)])):re("",!0),e.pr?(x(),N("button",{key:2,type:"button",class:We(["ch-pill ch-pr",f(e.pr.state)]),onClick:K[5]||(K[5]=X=>e.pr&&s("openPr",e.pr.url))},[ie(Ve,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+O(e.pr.number)+" · "+O(h(e.pr.state)),1)],2)):re("",!0)],2))}}),fse=ct(dse,[["__scopeId","data-v-fa4451d4"]]),hse=["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"],NC=[[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 pse(e){if(e<=255)return hse[e];let t=0,n=NC.length-1;for(;t<=n;){const o=t+n>>1,s=NC[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function mse(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=pse(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!o)return null;let s=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){s=0;break}if(u==="R"||u==="AL"){s=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=s;const r=s&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let g=c;g<u;g++)n[g]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function gse(e,t){const n=mse(e);if(n===null)return null;const o=new Int8Array(t.length);for(let s=0;s<t.length;s++)o[s]=n[t[s]];return o}const vse=/[ \t\n\r\f]+/g,yse=/[\t\n\r\f]| {2,}|^ | $/;function kse(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function bse(e){if(!yse.test(e))return e;let t=e.replace(vse," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function xse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
294
|
-
`).replace(/[\r\f]/g,`
|
|
295
|
-
`):e}let cg=null,wse;function _se(){return cg===null&&(cg=new Intl.Segmenter(wse,{granularity:"word"})),cg}const Sse=/\p{Script=Arabic}/u,Hl=/\p{M}/u,Ik=/\p{Nd}/u;function IC(e){return Sse.test(e)}function LC(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>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function sr(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){const s=(n-55296<<10)+(o-56320)+65536;if(LC(s))return!0;t++;continue}}if(LC(n))return!0}}return!1}function Cse(e){const t=Xd(e);return t!==null&&(Lk.has(t)||Ma.has(t))}const Ase=new Set([" "," ","","\uFEFF"]),Mse=new Set(["-","‐","–","—"]);function Ese(e){const t=Xd(e);return t!==null&&Ase.has(t)}function Tse(e){const t=Xd(e);return t!==null&&Mse.has(t)}function _5(e,t){return Ese(e)?!1:t?!(Cse(e)||Tse(e)):!0}const Lk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Dm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),$k=new Set(["'","’"]),Ma=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Nse=new Set([":",".","،","؛"]),Ise=new Set(["၏"]),Lse=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function $se(e){if(Fk(e))return!0;let t=!1;for(const n of e){if(Ma.has(n)||Hm(n)){t=!0;continue}if(!(t&&Hl.test(n)))return!1}return t}function Fse(e){for(const t of e)if(!Lk.has(t)&&!Ma.has(t))return!1;return e.length>0}function Ose(e){if(Fk(e))return!0;for(const t of e)if(!Dm.has(t)&&!$k.has(t)&&!Hl.test(t)&&!Hm(t))return!1;return e.length>0}function Fk(e){let t=!1;for(const n of e)if(!(n==="\\"||Hl.test(n))){if(Dm.has(n)||Ma.has(n)||$k.has(n)){t=!0;continue}return!1}return t}function Pm(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 Xd(e){if(e.length===0)return null;const t=Pm(e,e.length);return e.slice(t)}function Rse(e){for(const t of e)if(!Hl.test(t))return t;return null}function Bse(e){for(let t=e.length;t>0;){const n=Pm(e,t),o=e.slice(n,t);if(!Hl.test(o))return o;t=n}return null}const Dse=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Pse(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Hm(e){const t=e.codePointAt(0);return t!==void 0&&Pse(t,Dse)}function Hse(e){const t=Bse(e);return t!==null&&Hm(t)}function Wse(e){const t=Rse(e);return t!==null&&Ik.test(t)}function zse(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Hl.test(o)){n--;continue}if(Dm.has(o)||$k.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Use(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function $C(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 FC(e,t){return e&&t!==null&&Nse.has(t)}function qse(e){const t=Xd(e);return t!==null&&Ise.has(t)}function jse(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function zv(e){let t=e.length;for(;t>0;){const n=Pm(e,t),o=e.slice(n,t);if(Lse.has(o))return!0;if(!Ma.has(o))return!1;t=n}return!1}function Vse(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
296
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const Kse=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Oi(e){return e.length===1?e[0]:e.join("")}function Gse(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Oi(n)}function Yse(e,t,n,o){if(!Kse.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=Vse(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:Oi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:Oi(r),isWordLike:a,kind:i,start:l}),s}function Uv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Zse=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Xse(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:Zse.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Qse(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Jse(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let r=0;r<e.len;r++){if(o[r]!=="text"||!Xse(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!Uv(o[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(o[a]="text",t[a]="",a++,c)break}t[r]=Oi(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],o[i]=o[r],s[i]=s[r]),i++)}return t.length=i,n.length=i,o.length=i,s.length=i,{len:i,texts:t,isWordLike:n,kinds:o,starts:s}}function eie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i]),!Qse(r))continue;const l=i+1;if(l>=e.len||Uv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!Uv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Oi(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const tie=new Set([":","-","/","×",",",".","+","–","—"]),nie=/[\p{P}\p{S}\p{Co}]/u,oie=/\p{Emoji_Presentation}/u,sie=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function iie(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function S5(e){const t=e.charCodeAt(0);return t<128?iie(t):!sie.has(e)&&!oie.test(e)&&nie.test(e)}function OC(e){let t=!1;for(const n of e)if(!Hl.test(n)){if(!S5(n))return!1;t=!0}return t}function rie(e){for(let t=e.length;t>0;){const n=Pm(e,t),o=e.slice(n,t);if(Hl.test(o)){t=n;continue}return S5(o)||Hm(o)}return!1}function lie(e,t,n,o){const s=!t&&OC(e),i=!o&&OC(n),r=Hse(e),l=(t||r)&&rie(e);return!s&&!i&&!l||sr(e)||sr(n)?!1:(t||s||r)&&(o||i)}function C5(e){for(const t of e)if(Ik.test(t))return!0;return!1}function Ip(e){if(e.length===0)return!1;for(const t of e)if(!(Ik.test(t)||tie.has(t)))return!1;return!0}function aie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Ip(r)&&C5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Ip(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Oi(a)),n.push(!0),o.push("text"),s.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),o.push(l),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function cie(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&lie(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(Oi(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function uie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!C5(u)||!Ip(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),o.push("text"),s.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function die(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=Oi(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),o.push("glue"),s.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=Oi(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(Oi(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function fie(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let i=0;i<t.length-1;i++){if(o[i]!=="text"||o[i+1]!=="text"||!sr(t[i])||!sr(t[i+1]))continue;const r=zse(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],s[i+1]=s[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function hie(e,t,n){const o=_se();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[];for(const $ of o.segment(e))for(const L of Yse($.segment,$.isWordLike??!1,$.index,n)){let W=function(){u[D]!==null&&(r[D]=[$C(i,u,d,D)],u[D]=null),r[D].push(L.text),l[D]=l[D]||L.isWordLike,f[D]=f[D]||T,h[D]=h[D]||F,p[D]=I,g[D]=P,b[D]=FC(h[D],S)};const w=L.kind==="text",E=Use(L.text,L.isWordLike,L.kind),T=sr(L.text),F=IC(L.text),S=Xd(L.text),I=zv(L.text),P=qse(L.text),D=s-1;t.carryCJKAfterClosingQuote&&w&&s>0&&a[D]==="text"&&T&&f[D]&&p[D]||w&&s>0&&a[D]==="text"&&Fse(L.text)&&f[D]||w&&s>0&&a[D]==="text"&&g[D]?W():w&&s>0&&a[D]==="text"&&L.isWordLike&&F&&b[D]?(W(),l[D]=!0):E!==null&&s>0&&a[D]==="text"&&u[D]===E?d[D]=(d[D]??1)+1:w&&!L.isWordLike&&s>0&&a[D]==="text"&&!f[D]&&($se(L.text)||L.text==="-"&&l[D])?W():(i[s]=L.text,r[s]=[L.text],l[s]=L.isWordLike,a[s]=L.kind,c[s]=L.start,u[s]=E,d[s]=E===null?0:1,f[s]=T,h[s]=F,p[s]=I,g[s]=P,b[s]=FC(F,S),s++)}for(let $=0;$<s;$++){if(u[$]!==null){i[$]=$C(i,u,d,$);continue}i[$]=Oi(r[$])}for(let $=1;$<s;$++)a[$]==="text"&&!l[$]&&Fk(i[$])&&a[$-1]==="text"&&!f[$-1]&&(i[$-1]+=i[$],l[$-1]=l[$-1]||l[$],i[$]="");const v=Array.from({length:s},()=>null);let m=-1;for(let $=s-1;$>=0;$--){const L=i[$];if(L.length!==0){if(a[$]==="text"&&!l[$]&&m>=0&&a[m]==="text"&&(Ose(L)||L==="-"&&Wse(i[m]))){const w=v[m]??[];w.push(L),v[m]=w,c[m]=c[$],i[$]="";continue}m=$}}for(let $=0;$<s;$++){const L=v[$];L!=null&&(i[$]=Gse(L,i[$]))}let y=0;for(let $=0;$<s;$++){const L=i[$];L.length!==0&&(y!==$&&(i[y]=L,l[y]=l[$],a[y]=a[$],c[y]=c[$]),y++)}i.length=y,l.length=y,a.length=y,c.length=y;const k=die({len:y,texts:i,isWordLike:l,kinds:a,starts:c}),A=fie(cie(uie(aie(eie(Jse(k))))));for(let $=0;$<A.len-1;$++){const L=jse(A.texts[$]);L!==null&&(A.kinds[$]!=="space"&&A.kinds[$]!=="preserved-space"||A.kinds[$+1]!=="text"||!IC(A.texts[$+1])||(A.texts[$]=L.space,A.isWordLike[$]=!1,A.kinds[$]=A.kinds[$]==="preserved-space"?"preserved-space":"space",A.texts[$+1]=L.marks+A.texts[$+1],A.starts[$+1]=A.starts[$]+L.space.length))}return A}function pie(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}function mie(e,t,n){if(t.len<=1)return t;const o=[],s=[],i=[],r=[];let l=-1,a=!1;function c(f){o.push(t.texts[f]),s.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let v=f;v<h;v++)p=p||t.isWordLike[v];const g=t.starts[f],b=h<t.len?t.starts[h]:e.length;o.push(e.slice(g,b)),s.push(p),i.push("text"),r.push(g)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!_5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||sr(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function gie(e,t,n="normal",o="normal"){const s=kse(n),i=s.mode==="pre-wrap"?xse(e):bse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=hie(i,t,s),l=o==="keep-all"?mie(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:pie(l,s),...l}}let lc=null;const RC=new Map;let ac=null;const vie=96,yie=/\p{Emoji_Presentation}/u,kie=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let ug=null;const BC=new Map;function Ok(){if(lc!==null)return lc;if(typeof OffscreenCanvas<"u")return lc=new OffscreenCanvas(1,1).getContext("2d"),lc;if(typeof document<"u")return lc=document.createElement("canvas").getContext("2d"),lc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function bie(e){let t=RC.get(e);return t||(t=new Map,RC.set(e,t)),t}function bl(e,t){let n=t.get(e);return n===void 0&&(n={width:Ok().measureText(e).width,containsCJK:sr(e)},t.set(e,n)),n}function Wm(){if(ac!==null)return ac;if(typeof navigator>"u")return ac={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ac;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return ac={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},ac}function xie(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function A5(){return ug===null&&(ug=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ug}function wie(e){return yie.test(e)||e.includes("️")}function _ie(e){return kie.test(e)}function Sie(e,t){let n=BC.get(e);if(n!==void 0)return n;const o=Ok();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return BC.set(e,n),n}function Cie(e){let t=0;const n=A5();for(const o of n.segment(e))wie(o.segment)&&t++;return t}function Aie(e,t){return t.emojiCount===void 0&&(t.emojiCount=Cie(e)),t.emojiCount}function ga(e,t,n){return n===0?t.width:t.width-Aie(e,t)*n}function Mie(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=A5(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=bl(d,n);u.push(ga(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>vie){const u=[];let d=null,f=0;for(const h of r){const p=bl(h,n),g=ga(h,p,o);if(d===null)u.push(g);else{const b=d+h,v=bl(b,n);u.push(ga(b,v,o)-f)}d=h,f=g}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=bl(a,n),f=ga(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Eie(e,t){const n=Ok();n.font=e;const o=bie(e),s=xie(e),i=t?Sie(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function Tie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function M5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function E5(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!Tie(o))break;t++}return t}function Nie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Iie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Rk(e,t){return t===0?0:e+t}function Lie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function $ie(e,t,n,o,s){const i=t==="tab"?s+Lie(e,n):e.lineEndFitAdvances[n];return Rk(o,i)}function DC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return Rk(o,s)}function PC(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return Rk(o,i)}function Fie(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Oie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Lp(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Rie(e,t,n,o,s){if(e.letterSpacing===0)return 0;if(s>0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Bie(e,t,n,o,s,i){return t+Rie(e,n,o,s,i)}function Die(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=Wm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,g=0,b=0,v=-1,m=0;function y(){v=-1,m=0}function k(T=g,F=b,S=d){u++,n?.(S,h,p,T,F),d=0,f=!1,y()}function A(T,F){f=!0,h=T,p=0,g=T+1,b=0,d=F}function $(T,F,S){f=!0,h=T,p=F,g=T,b=F+1,d=S}function L(T,F){if(!f){A(T,F);return}d+=F,g=T+1,b=0}function w(T,F){const S=i[T],I=r[T]??null;let P=I===null?-1:Lp(I,0,F+1),D=-1,W=0,z=F;for(;z<S.length;){const R=S[z];if(!f)$(T,z,R);else if(d+R>c){if(I!==null&&D>F){k(T,D,W),z=D,P=Lp(I,P,z+1),D=-1,W=0;continue}k(),$(T,z,R)}else d+=R,g=T,b=z+1;const q=z+1;I!==null&&I[P]===q&&(D=q,W=d,P++),z++}f&&g===T&&b===S.length&&(g=T+1,b=0)}let E=0;for(;E<o.length&&!(!f&&(E=E5(e,E),E>=o.length));){const T=o[E],F=s[E],S=M5(F);if(!f){T>c&&i[E]!==null?w(E,0):A(E,T),S&&(v=E+1,m=d-T),E++;continue}if(d+T>c){if(S){L(E,T),k(E+1,0,d-T),E++;continue}if(v>=0){if(g>v||g===v&&b>0){k();continue}k(v,0,m);continue}if(T>c&&i[E]!==null){k(),w(E,0),E++;continue}k();continue}L(E,T),S&&(v=E+1,m=d-T),E++}return f&&k(),u}function Pie(e,t,n){if(e.simpleLineWalkFastPath)return Die(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=Wm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,g=0,b=0,v=0,m=0,y=-1,k=0,A=0,$=null;function L(){y=-1,k=0,A=0,$=null}function w(){return $==="soft-hyphen"&&y===v&&m===0?A:h}function E(W=v,z=m,R){f++,n!==void 0&&n(Bie(e,R??w(),g,b,W,z),g,b,W,z),h=0,p=!1,L()}function T(W,z){p=!0,g=W,b=0,v=W+1,m=0,h=z}function F(W,z,R){p=!0,g=W,b=z,v=W,m=z+1,h=R}function S(W,z){if(!p){T(W,z);return}h+=z,v=W+1,m=0}function I(W,z,R,q,K,X){if(!z)return;const ue=DC(e,W,R,K),me=PC(e,W,R,K,q);y=R+1,k=h-X+ue,A=h-X+me,$=W}function P(W,z){const R=i[W],q=r[W]??null;let K=q===null?-1:Lp(q,0,z+1),X=-1,ue=0,me=z;for(;me<R.length;){const ne=R[me];if(!p)F(W,me,ne);else{const de=Fie(e,!0,ne),Ae=h+de;if(Oie(e,Ae)>d){if(q!==null&&X>z){E(W,X,ue),me=X,K=Lp(q,K,me+1),X=-1,ue=0;continue}E(),F(W,me,ne)}else h=Ae,v=W,m=me+1}const ce=me+1;q!==null&&q[K]===ce&&(X=ce,ue=h,K++),me++}p&&v===W&&m===R.length&&(v=W+1,m=0)}function D(W){f++,n?.(0,W.startSegmentIndex,0,W.consumedEndSegmentIndex,0),L()}for(let W=0;W<a.length;W++){const z=a[W];if(z.startSegmentIndex===z.endSegmentIndex){D(z);continue}p=!1,h=0,g=z.startSegmentIndex,b=0,v=z.startSegmentIndex,m=0,L();let R=z.startSegmentIndex;for(;R<z.endSegmentIndex&&!(!p&&(R=E5(e,R,z.endSegmentIndex),R>=z.endSegmentIndex));){const q=s[R],K=M5(q),X=Iie(e,p,R),ue=q==="tab"?Nie(h+X,e.tabStopAdvance):o[R],me=X+ue,ne=$ie(e,q,R,X,ue);if(q==="soft-hyphen"){p&&(v=R+1,m=0,y=R+1,k=h+l,A=h+l,$=q),R++;continue}if(!p){ne>d&&i[R]!==null?P(R,0):T(R,ue),I(q,K,R,ue,X,me),R++;continue}if(h+ne>d){const de=h+DC(e,q,R,X),Ae=h+PC(e,q,R,X,ue);if($==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&k<=d){E(y,0,A);continue}if(K&&de<=d){S(R,me),E(R+1,0,Ae),R++;continue}if(y>=0&&k<=d){if(v>y||v===y&&m>0){E();continue}const Le=y;E(Le,0,A),R=Le;continue}if(ne>d&&i[R]!==null){E(),P(R,0),R++;continue}E();continue}S(R,me),I(q,K,R,ue,X,me),R++}if(p){const q=y===z.consumedEndSegmentIndex?A:h;E(z.consumedEndSegmentIndex,0,q)}}return f}let dg=null;function Bk(){return dg===null&&(dg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),dg}function Hie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function Wie(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=zv(d),l=Dm.has(d)}function u(d,f){o.push(d),i=i||f;const h=zv(d);d.length===1&&Ma.has(d)?r=r||h:r=h,l=!1}for(const d of Bk().segment(e)){const f=d.segment,h=sr(f);if(o.length===0){c(f,d.index,h);continue}if(l||Lk.has(f)||Ma.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function zie(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})}function l(a){if(!(s<0)){if(i)s+1===a?o.push(t[s]):r(s,a);else for(let c=s;c<a;c++)o.push(t[c]);s=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];s>=0&&!_5(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||sr(c.text)}return l(t.length),o}function HC(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=Bk();for(const s of o.segment(e))n++;return n}function Uie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function qie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of Bk().segment(e))n++,Uie(o.segment)&&t.push(n);return t.length===0?null:t}function jie(e,t,n){return t>1?e+(t-1)*n:e}function Vie(e,t,n,o,s){const i=Wm(),{cache:r,emojiCorrection:l}=Eie(t,_ie(e.normalized)),a=ga("-",bl("-",r),l)+(s===0?0:s*2),u=ga(" ",bl(" ",r),l)*8,d=s!==0;if(e.len===0)return Hie();const f=[],h=[],p=[],g=[];let b=e.chunks.length<=1&&!d;const v=n?[]:null,m=[],y=[],k=[],A=n?[]:null,$=Array.from({length:e.len});function L(F,S,I,P,D,W,z,R,q){D!=="text"&&D!=="space"&&D!=="zero-width-break"&&(b=!1),f.push(S),h.push(I),p.push(P),g.push(D),v?.push(W),m.push(z),y.push(R),d&&k.push(q),A!==null&&A.push(F)}function w(F,S,I,P,D){const W=bl(F,r),z=d?HC(F,S):0,R=jie(ga(F,W,l),z,s),q=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:R,K=q===0?0:q+(z>0?s:0),X=S==="space"||S==="zero-width-break"?0:R;if(D&&P&&F.length>1){let ue="sum-graphemes";s!==0?ue="segment-prefixes":Ip(F)?ue="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ue="segment-prefixes");const me=Mie(F,W,r,l,ue),ne=me===null||o==="keep-all"?null:qie(F);L(F,R,K,X,S,I,me,ne,z);return}L(F,R,K,X,S,I,null,null,z)}for(let F=0;F<e.len;F++){$[F]=f.length;const S=e.texts[F],I=e.isWordLike[F],P=e.kinds[F],D=e.starts[F];if(P==="soft-hyphen"){L(S,0,a,a,P,D,null,null,0);continue}if(P==="hard-break"){L(S,0,0,0,P,D,null,null,0);continue}if(P==="tab"){L(S,0,0,0,P,D,null,null,d?HC(S,P):0);continue}const W=bl(S,r);if(P==="text"&&W.containsCJK){const z=Wie(S,i),R=o==="keep-all"?zie(S,z,i.breakKeepAllAfterPunctuation):z;for(let q=0;q<R.length;q++){const K=R[q];w(K.text,"text",D+K.start,I,o==="keep-all"||!sr(K.text))}continue}w(S,P,D,I,!0)}const E=Kie(e.chunks,$,f.length),T=v===null?null:gse(e.normalized,v);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:T,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:T,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E}}function Kie(e,t,n){const o=[];for(let s=0;s<e.length;s++){const i=e[s],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;o.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return o}function Gie(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=gie(e,Wm(),o?.whiteSpace,s);return Vie(r,t,n,s,i)}function Yie(e,t,n){return Gie(e,t,!0,n)}function Zie(e){let t=0;return Pie(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const Xie={key:0,class:"slash-menu",role:"listbox"},Qie=["aria-selected","onMouseenter","onMousedown"],Jie={class:"slash-name"},ere={class:"slash-desc"},tre=Ze({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=Z([]);return Je(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),N("div",Xie,[(x(!0),N(Pe,null,ot(e.items,(a,c)=>(x(),N("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:We(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:xt(u=>s("select",a),["prevent"])},[_("span",Jie,O(a.name),1),_("span",ere,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Qie))),128))])):re("",!0)}}),nre=ct(tre,[["__scopeId","data-v-f60b70d9"]]),ore={class:"mention-menu",role:"listbox"},sre={key:0,class:"mention-state dim"},ire={key:1,class:"mention-state dim"},rre=["aria-selected","onMouseenter","onMousedown"],lre=["innerHTML"],are={class:"mention-name"},cre={class:"mention-path"},ure=Ze({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et(),i=hc("folder","sm"),r=hc("code","sm"),l=hc("file-text","sm"),a=hc("image","sm"),c=hc("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const g=p.path;if(g.endsWith("/"))return i;const b=p.name||g.split("/").pop()||g,v=b.lastIndexOf("."),m=v>0?b.slice(v+1).toLowerCase():"";return m?u.has(m)?r:d.has(m)?l:f.has(m)?a:c:c}return(p,g)=>(x(),N("div",ore,[n.loading?(x(),N("div",sre,O(C(s)("mention.searching")),1)):n.items.length===0?(x(),N("div",ire,O(C(s)("mention.noMatch")),1)):(x(!0),N(Pe,{key:2},ot(n.items,(b,v)=>(x(),N("div",{key:b.path,class:We(["mention-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:m=>o("hover",v),onMousedown:xt(m=>o("select",b),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,lre),_("span",are,O(b.name),1),_("span",cre,O(b.path),1)],42,rre))),128))]))}}),dre=ct(ure,[["__scopeId","data-v-f4d6b958"]]),T5=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.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:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function fre(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)}}const $p="skill:";function hre(e){return e.startsWith($p)?e.slice($p.length):e}function N5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${$p}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...T5,...t]}function pre(e,t=T5){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 zm(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 I5(e){return e?.supportEfforts??[]}function mre(e){return e[Math.floor(e.length/2)]}function Um(e){if(zm(e)==="unsupported")return"off";const t=I5(e);return t.length>0?e?.defaultEffort??mre(t):"on"}function Dk(e){const t=I5(e),n=zm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function qv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function gre(e){return e!=="off"}function Pk(e,t){return t==="off"?"off":t==="on"?Um(e):t}function Fp(e,t){return t??Um(e)}function vre(e){return e==="off"?{enabled:!1}:e==="on"?{enabled:!0}:{enabled:!0,effort:e}}function yre(e,t,n){return!n||e===void 0?t:Um(e)}const Op=100;function kre(e){const t=pm($t.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Op?n.slice(-Op):n,s={[e]:o};return Ud($t.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function bre(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=Z(kre(s())),r=B(()=>i.value[s()??""]??[]);let l=-1,a="";function c(v){const m=s();if(l=-1,!m)return;const y=v.trim();if(!y)return;const k=i.value[m]??[];if(k.at(-1)===y)return;const A=[...k,y],$=A.length>Op?A.slice(-Op):A;i.value={...i.value,[m]:$},Ud($t.inputHistory,i.value)}function u(){const v=n.value;return v?(v.selectionStart??0)===0:!1}function d(v){t.value=v,gt(()=>{const m=n.value;if(!m)return;o();const y=v.length;m.setSelectionRange(y,y)})}function f(){const v=r.value;if(v.length!==0){if(l===-1)a=t.value,l=v.length-1;else if(l>0)l-=1;else return;d(v[l])}}function h(){if(l===-1)return;const v=r.value;l<v.length-1?(l+=1,d(v[l])):(l=-1,d(a))}function p(){l=-1}function g(){return l!==-1}function b(){return r.value.length>0}return Je(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:g,hasHistory:b}}function xre(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Z(!1),c=Z([]),u=Z(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=pre(h,N5(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,gt(()=>{const p=n.value;if(!p)return;const g=t.value.length;p.setSelectionRange(g,g),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function wre(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=Z(!1),r=Z([]),l=Z(0),a=Z(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let g=p-1;for(;g>=0&&!/\s/.test(h[g]);)g--;g++;const b=h.slice(g,p);return b.startsWith("@")?{token:b.slice(1),start:g,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const g=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const g=t.value;t.value=g.slice(0,p.start)+h.path+g.slice(p.end),i.value=!1,gt(()=>{const b=n.value;if(!b)return;const v=p.start+h.path.length;b.setSelectionRange(v,v),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function _re(e){const{sessionId:t}=e;function n(c){return lo(Xx(c))??""}function o(c,u){const d=Xx(c);u?po(d,u):Gc(d)}const s=Z(n(t())),i=Z(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Je(s,c=>{gt(r),o(t(),c)}),Je(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),gt(r))});function l(c){s.value=c,gt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function Sre(e){const{uploadImage:t,sessionId:n}=e,o=Z({}),s=B(()=>o.value[n()??""]??[]),i=Z(null),r=Z(null),l=Z(!1);let a=0;function c(){return`att_${++a}`}function u(z,R){o.value={...o.value,[z]:R}}function d(z){if(z.previewUrl!==void 0)try{URL.revokeObjectURL(z.previewUrl)}catch{}}function f(z){return z.startsWith("image/")?"image":z.startsWith("video/")?"video":"file"}async function h(z){const R=t();if(!R)return;const q=n()??"";if(z.length!==0)for(const K of z){const X=f(K.type),ue=c(),me=X==="file"?void 0:URL.createObjectURL(K),ne={localId:ue,name:K.name,kind:X,previewUrl:me,mediaType:K.type||"application/octet-stream",size:K.size,uploading:!0};u(q,[...o.value[q]??[],ne]),R(K,K.name).then(ce=>{const de=o.value[q]??[];u(q,de.map(Ae=>Ae.localId===ue?{...Ae,uploading:!1,fileId:ce?.fileId,mediaType:ce?.mediaType??Ae.mediaType,error:ce===null}:Ae))}).catch(()=>{const ce=o.value[q]??[];u(q,ce.map(de=>de.localId===ue?{...de,uploading:!1,error:!0}:de))})}}function p(z){const R=n()??"",q=o.value[R]??[],K=q.find(X=>X.localId===z);i.value?.localId===z&&(i.value=null),K&&d(K),u(R,q.filter(X=>X.localId!==z))}function g(z){i.value=z}function b(){i.value=null}function v(){r.value?.click()}function m(z){const R=z.target,q=Array.from(R.files??[]);h(q),R.value=""}function y(z){if(!t())return;const R=z.clipboardData;if(!R)return;const q=[],K=new Set,X=(ue,me)=>{const ne=`${ue.size}:${ue.type}:${me}`;if(K.has(ne))return;K.add(ne);const ce=ue.type.split("/")[1]??"png",de=me.includes(".")?me:`paste-${Date.now()}.${ce}`;q.push(ue instanceof File?ue:new File([ue],de,{type:ue.type}))};for(const ue of Array.from(R.items))if(ue.kind==="file"){const me=ue.getAsFile();me&&X(me,me.name||`paste-${Date.now()}.${ue.type.split("/")[1]??"png"}`)}for(const ue of Array.from(R.files))X(ue,ue.name);q.length!==0&&(z.preventDefault(),h(q))}let k=0;function A(z){!t()||!Array.from(z.dataTransfer?.items??[]).some(q=>q.kind==="file")||(z.preventDefault(),z.stopPropagation(),l.value=!0)}function $(){l.value=!1}function L(z){if(k=0,l.value=!1,!t())return;z.preventDefault(),z.stopPropagation();const R=Array.from(z.dataTransfer?.files??[]);h(R)}function w(z){return Array.from(z.dataTransfer?.items??[]).some(R=>R.kind==="file")}function E(z){!t()||!w(z)||(z.preventDefault(),k+=1,l.value=!0)}function T(z){!t()||!w(z)||z.preventDefault()}function F(z){!t()||!w(z)||(k=Math.max(0,k-1),k===0&&(l.value=!1))}function S(z){if(k=0,l.value=!1,!t())return;z.preventDefault();const R=Array.from(z.dataTransfer?.files??[]);h(R)}function I(){const z=n()??"";for(const R of o.value[z]??[])d(R);u(z,[])}function P(z,R,q){const K=o.value[z]??[];K.some(X=>X.localId===R)&&u(z,K.map(X=>X.localId===R?{...X,...q}:X))}function D(z){return fetch(z).then(R=>{if(!R.ok)throw new Error(`fetch failed: ${R.status}`);return R.blob()})}function W(z){const R=n()??"";for(const q of o.value[R]??[])d(q);u(R,[]);for(const q of z){const K=c(),X=/^data:/i.test(q.url),ue=/^blob:/i.test(q.url),me=q.name??q.kind;if(q.fileId){const ne={localId:K,name:me,kind:q.kind,previewUrl:q.kind==="file"?void 0:q.url,uploading:!1,fileId:q.fileId};u(R,[...o.value[R]??[],ne]),q.kind!=="file"&&!X&&!ue&&dt().getFileBlob(q.fileId).then(ce=>{const de=URL.createObjectURL(ce);if(!(o.value[R]??[]).some(Le=>Le.localId===K)){URL.revokeObjectURL(de);return}P(R,K,{previewUrl:de})}).catch(()=>{})}else{if(!q.url)continue;const ne=t();if(!ne)continue;const ce={localId:K,name:me,kind:q.kind,previewUrl:q.url,uploading:!0};u(R,[...o.value[R]??[],ce]),D(q.url).then(de=>{const Ae=me.includes(".")?me:`${me}.${de.type.split("/")[1]??"bin"}`;return ne(de,Ae)}).then(de=>{if(de===null){const Ae=o.value[R]??[];u(R,Ae.filter(Le=>Le.localId!==K));return}P(R,K,{uploading:!1,fileId:de.fileId})}).catch(()=>{const de=o.value[R]??[];u(R,de.filter(Ae=>Ae.localId!==K))})}}}return Je(n,()=>{i.value=null}),un(()=>{document.addEventListener("paste",y),document.addEventListener("dragenter",E),document.addEventListener("dragover",T),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),xn(()=>{document.removeEventListener("paste",y),document.removeEventListener("dragenter",E),document.removeEventListener("dragover",T),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const z of Object.values(o.value))for(const R of z)d(R);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:g,closeAttachmentPreview:b,openFilePicker:v,handleFileInputChange:m,handleDragOver:A,handleDragLeave:$,handleDrop:L,clearAfterSubmit:I,loadAttachments:W}}const Cre=["type","disabled"],Are={class:"ui-button__content"},Mre=Ze({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(x(),N("button",{class:We(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(x(),ke(Ds,{key:0,size:"sm",class:"ui-button__spinner"})):re("",!0),_("span",Are,[$n(t.$slots,"default",{},void 0,!0)])],10,Cre))}}),Ot=ct(Mre,[["__scopeId","data-v-e58393a8"]]),Ere={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Tre=["stroke-dasharray","stroke-dashoffset"],fg=7,Nre=Ze({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*fg;return(o,s)=>(x(),N("svg",Ere,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:fg,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:fg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Tre)]))}}),Ire=ct(Nre,[["__scopeId","data-v-a364f1f1"]]),Lre={key:0,class:"att-strip"},$re={class:"att-lightbox-card"},Fre=["src"],Ore=["src","alt"],Rre={class:"att-lightbox-name"},Bre={class:"composer-card"},Dre={class:"cin-wrap"},Pre={class:"input-row"},Hre=["placeholder","disabled"],Wre=["aria-label"],zre={class:"toolbar-left"},Ure=["onKeydown"],qre=["onClick"],jre={class:"pd-check"},Vre={class:"pd-info"},Kre={class:"pd-desc"},Gre={class:"mode-label"},Yre={key:0,class:"mode-tag"},Zre={key:1,class:"mode-tag"},Xre={key:2,class:"mode-tag"},Qre={class:"mode-row-icon"},Jre={class:"mode-row-info"},ele={class:"mode-row-name"},tle={class:"mode-row-desc"},nle={class:"mode-row-icon"},ole={class:"mode-row-info"},sle={class:"mode-row-name"},ile={class:"mode-row-desc"},rle={class:"mode-row-icon"},lle={class:"mode-row-info"},ale={class:"mode-row-name"},cle={class:"mode-row-desc"},ule={key:0,class:"mode-row-actions"},dle={class:"toolbar-right"},fle=["aria-label"],hle=["onKeydown"],ple={key:0,class:"think-suffix"},mle=["aria-label"],gle=["aria-label","disabled"],vle={key:0,class:"md-section"},yle=["onClick"],kle={class:"md-check"},ble={class:"md-name"},xle={class:"md-provider"},wle={key:1,class:"md-divider"},_le={key:2,class:"md-section"},Sle=["onClick"],Cle={class:"md-check"},Ale={class:"md-name"},Mle={key:3,class:"md-divider"},Ele={class:"md-name"},Tle={key:0,class:"md-note"},Nle=["aria-label"],Ile=["disabled","onClick"],Lle={class:"md-name"},$le={class:"drop-card"},WC=36,Fle=Ze({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{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},goal:{},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=B(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Et(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=_re({sessionId:()=>o.sessionId}),h=Z(!1);function p(){h.value=!h.value,gt(()=>{u(),m(),c.value?.focus()})}function g(){h.value&&(h.value=!1,gt(u))}function b(Ue){if(typeof getComputedStyle>"u")return WC;const Oe=Number.parseFloat(getComputedStyle(Ue).minHeight);return Number.isFinite(Oe)&&Oe>0?Oe:WC}const v=Z(!1);function m(){const Ue=c.value;v.value=!!Ue&&Ue.scrollHeight>b(Ue)}Je(a,()=>{gt(m)}),Je(()=>o.sessionId,()=>{h.value=!1});const y=bre({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:k,items:A,active:$,update:L,select:w}=xre({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ue=>i("command",Ue),historyPush:Ue=>y.push(Ue),clearDraft:f}),{open:E,items:T,active:F,loading:S,update:I,select:P}=wre({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function D(){y.resetBrowsing(),L(),I()}const{attachments:W,previewAttachment:z,fileInputRef:R,isDragOver:q,removeAttachment:K,openAttachmentPreview:X,closeAttachmentPreview:ue,openFilePicker:me,handleFileInputChange:ne,handleDragOver:ce,handleDragLeave:de,handleDrop:Ae,clearAfterSubmit:Le,loadAttachments:le}=Sre({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});un(()=>{a.value&>(()=>{u(),m()})}),xn(()=>{document.removeEventListener("mousedown",Ut),V()});function U(){c.value?.focus({preventScroll:!0})}function ae(Ue){le(Ue)}t({loadForEdit:d,loadAttachmentsForEdit:ae,focus:U});function se(Ue){return{fileId:Ue.fileId,kind:Ue.kind,name:Ue.name,mediaType:Ue.mediaType,size:Ue.size}}function j(Ue){if(Ue.kind==="file"){Ue.fileId!==void 0&&x5(Ue.fileId,Ue.name,Ue.mediaType);return}X(Ue)}function J(){const Ue=a.value.trim();if(W.value.some(Te=>Te.uploading))return;const Oe=W.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ue&&Oe.length===0)return;if(y.push(Ue),Ue){const Te=fre(Ue),he=Te?N5(o.skills).some(we=>we.name===Te.cmd||we.name===`/${$p}${Te.cmd.slice(1)}`):!1;if(Te&&he){a.value="",f(),k.value=!1,g(),i("command",Te.arg?`${Te.cmd} ${Te.arg}`:Te.cmd);return}}const te={text:Ue,attachments:Oe.map(Te=>se(Te))};z.value=null,Le(),a.value="",f(),k.value=!1,E.value=!1,g(),i("submit",te)}function ye(){if(!o.running||W.value.some(Te=>Te.uploading))return;const Ue=a.value.trim(),Oe=W.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ue&&Oe.length===0&&o.queued.length===0)return;const te={text:Ue,attachments:Oe.map(Te=>se(Te))};Le(),y.push(Ue),a.value="",f(),k.value=!1,E.value=!1,g(),i("steer",te)}let fe=!1,ve=null;function V(){ve!==null&&(clearTimeout(ve),ve=null)}function ee(){V(),fe=!0}function pe(){V(),ve=setTimeout(()=>{ve=null,fe=!1},0)}function Ce(Ue){return fe||Ue.isComposing||Ue.keyCode===229}function $e(Ue){if(!Ce(Ue)){if(Ue.key==="Escape"){if(Ne.value){Ue.preventDefault(),vt();return}if(et.value){Ue.preventDefault(),Wt();return}}if(k.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),$.value=($.value+1)%A.value.length;return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),$.value=($.value-1+A.value.length)%A.value.length;return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Oe=A.value[$.value];Oe&&w(Oe);return}if(Ue.key==="Escape"){Ue.preventDefault(),k.value=!1;return}}if(E.value&&!S.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),F.value=(F.value+1)%Math.max(1,T.value.length);return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),F.value=(F.value-1+Math.max(1,T.value.length))%Math.max(1,T.value.length);return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Oe=T.value[F.value];Oe&&P(Oe);return}if(Ue.key==="Escape"){Ue.preventDefault(),E.value=!1;return}}if(Ue.key==="s"&&(Ue.ctrlKey||Ue.metaKey)&&!Ue.shiftKey&&!Ue.altKey){o.running&&(Ue.preventDefault(),ye());return}if(!h.value&&!k.value&&!E.value&&!Ue.shiftKey&&!Ue.altKey&&!Ue.metaKey&&!Ue.ctrlKey){const Oe=y.isBrowsing();if(Ue.key==="ArrowUp"&&y.hasHistory()&&(Oe||y.caretAtTextStart())){Ue.preventDefault(),y.recallOlder();return}if(Ue.key==="ArrowDown"&&Oe){Ue.preventDefault(),y.recallNewer();return}}if(Ue.key==="Enter"&&!Ue.shiftKey){if(h.value&&!(Ue.metaKey||Ue.ctrlKey))return;Ue.preventDefault(),J()}}}const De=B(()=>r("composer.send")),ge=B(()=>!!o.uploadImage),Ne=Z(!1),et=Z(!1),rt=Z(null);function St(){Ne.value=!Ne.value,Ne.value?(et.value=!1,rn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function vt(){Ne.value=!1,et.value||document.removeEventListener("click",ht,!0)}function Nt(){et.value=!et.value,et.value?(Ne.value=!1,rn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function Wt(){et.value=!1,Ne.value||document.removeEventListener("click",ht,!0)}function ht(Ue){rt.value&&!rt.value.contains(Ue.target)&&(vt(),Wt())}xn(()=>{document.removeEventListener("click",ht,!0)});const dn=B(()=>{const Ue=o.status?.ctxMax??0;return Ue<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Ue*100)))}),fn=B(()=>{const Ue=or(o.status?.ctxUsed??0),Oe=or(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ue,max:Oe,pct:dn.value})}),ss=B(()=>dn.value>=80),Dt=B(()=>o.models?.find(Ue=>Ue.id===o.status?.modelId)),Pn=B(()=>zm(Dt.value)),ao=B(()=>Dk(Dt.value)),it=B(()=>Fp(Dt.value,o.thinking)),Gn=B(()=>ao.value.includes(it.value)?it.value:""),co=B(()=>gre(it.value)),Yn=B(()=>Pn.value==="unsupported"||ao.value.length<=1),mo=B(()=>{if(!co.value)return"";const Ue=(Dt.value?.supportEfforts?.length??0)>0,Oe=it.value;return Ue&&Oe!=="on"?r("composer.thinkingSuffixEffort",{level:Oe}):r("composer.thinkingSuffix")});function is(Ue){Yn.value||i("setThinking",Pk(Dt.value,Ue))}function qn(Ue){return Ue==="on"?r("status.thinkingOn"):Ue==="off"?r("status.thinkingOff"):qv(Ue)}const to=B(()=>o.planMode===!0),yn=B(()=>o.swarmMode===!0),Zn=B(()=>o.goal?.status??o.activationBadges?.goal?.status??null),wn=B(()=>Zn.value!==null&&Zn.value!=="complete"),An=B(()=>wn.value||o.goalMode===!0),Mn=B(()=>Zn.value==="active"),Bo=B(()=>Zn.value==="paused"||Zn.value==="blocked"),ze=Z(!1),Qe=Z(null),bt=Z(null),Pt=Z({}),Hn=B(()=>to.value||yn.value||An.value);function rn(){ze.value=!1,document.removeEventListener("mousedown",Ut)}function Ut(Ue){const Oe=Ue.target;Qe.value?.contains(Oe)||bt.value?.contains(Oe)||rn()}function En(){if(ze.value){rn();return}vt(),Wt();const Ue=Qe.value?.getBoundingClientRect();Ue&&(Pt.value={left:`${Math.round(Ue.left)}px`,bottom:`${Math.round(window.innerHeight-Ue.top+8)}px`}),ze.value=!0,setTimeout(()=>document.addEventListener("mousedown",Ut),0)}const jn=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Ct=["status.planDesc","status.swarmDesc","status.goalDesc"],Do=Z(null),So=Z(""),Xo=Z("");function Fn(Ue){const Oe={};return Ue&&(Oe["--composer-menu-desc-width"]=Ue),Oe}const Wn=B(()=>Fn(So.value)),ti=B(()=>Fn(Xo.value)),Ps=B(()=>({...Pt.value,...ti.value}));let Po=null;function Ss(Ue){const Oe=Number.parseFloat(Ue);return Number.isFinite(Oe)?Oe:0}function Pi(Ue){return`${Ue.fontStyle||"normal"} ${Ue.fontWeight||"400"} ${Ue.fontSize} ${Ue.fontFamily}`}function _i(Ue){return Ue.letterSpacing==="normal"?0:Ss(Ue.letterSpacing)}function uo(Ue,Oe){if(!Ue)return 0;const te=Yie(Ue,Pi(Oe),{letterSpacing:_i(Oe)});return Zie(te)}function ni(){const Ue=Do.value?.querySelector(".pd-desc");if(!Ue)return;const Oe=getComputedStyle(Ue),te=Math.max(0,...jn.map(he=>uo(r(he.descKey),Oe))),Te=Math.max(0,...Ct.map(he=>uo(r(he),Oe)));So.value=te>0?`${Math.ceil(te)}px`:"",Xo.value=Te>0?`${Math.ceil(Te)}px`:""}function Si(){typeof window>"u"||(Po!==null&&window.cancelAnimationFrame(Po),gt(()=>{Po=window.requestAnimationFrame(()=>{Po=null,ni()})}))}Je(l,Si,{immediate:!0}),un(()=>{Si(),document.fonts?.ready.then(Si)}),xn(()=>{Po!==null&&(window.cancelAnimationFrame(Po),Po=null)});function rr(Ue){i("setPermission",Ue),Wt()}const no=B(()=>jn.find(Ue=>Ue.mode===o.status?.permission)),rs=B(()=>no.value?r(no.value.labelKey):""),ls=B(()=>Dt.value?.provider??""),No=B(()=>!ls.value||!o.models?.length?[]:o.models.filter(Ue=>Ue.provider===ls.value)),Ci=B(()=>new Set(o.starredIds??[]));function zn(Ue){return Ci.value.has(Ue)}const Io=B(()=>o.models?.length?o.models.filter(Ue=>zn(Ue.id)&&Ue.provider!==ls.value):[]);function oi(Ue){i("selectModel",Ue),vt()}return(Ue,Oe)=>(x(),N("div",{class:We(["composer",{"drag-over":C(q),expanded:h.value}]),onDragover:Oe[18]||(Oe[18]=(...te)=>C(ce)&&C(ce)(...te)),onDragleave:Oe[19]||(Oe[19]=(...te)=>C(de)&&C(de)(...te)),onDrop:Oe[20]||(Oe[20]=(...te)=>C(Ae)&&C(Ae)(...te))},[C(W).length>0?(x(),N("div",Lre,[(x(!0),N(Pe,null,ot(C(W),te=>(x(),ke(k5,{key:te.localId,kind:te.kind,name:te.name,url:te.previewUrl,"file-id":te.fileId,"media-type":te.mediaType,size:te.size,uploading:te.uploading,error:te.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:te.name}),onActivate:Te=>j(te),onRemove:Te=>C(K)(te.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):re("",!0),C(z)?(x(),N("div",{key:1,class:"att-lightbox",onClick:Oe[1]||(Oe[1]=xt((...te)=>C(ue)&&C(ue)(...te),["self"]))},[_("div",$re,[ie(Zt,{text:C(r)("model.close")},{default:Ee(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:Oe[0]||(Oe[0]=(...te)=>C(ue)&&C(ue)(...te))},"✕")]),_:1},8,["text"]),C(z).kind==="video"?(x(),N("video",{key:0,class:"att-lightbox-media",src:C(z).previewUrl,controls:"",playsinline:""},null,8,Fre)):(x(),N("img",{key:1,class:"att-lightbox-media",src:C(z).previewUrl,alt:C(z).name},null,8,Ore)),_("div",Rre,O(C(z).name),1)])])):re("",!0),_("div",Bre,[_("div",Dre,[C(k)?(x(),ke(nre,{key:0,items:C(A),"active-index":C($),onSelect:C(w),onHover:Oe[2]||(Oe[2]=te=>$.value=te)},null,8,["items","active-index","onSelect"])):re("",!0),C(E)?(x(),ke(dre,{key:1,items:C(T),"active-index":C(F),loading:C(S),onSelect:C(P),onHover:Oe[3]||(Oe[3]=te=>F.value=te)},null,8,["items","active-index","loading","onSelect"])):re("",!0),_("div",Pre,[Ln(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Oe[4]||(Oe[4]=te=>fo(a)?a.value=te:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:$e,onCompositionstart:ee,onCompositionend:pe,onInput:D},null,40,Hre),[[_s,C(a)]]),h.value||v.value?(x(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(x(),ke(Ve,{key:0,name:"collapse",size:"sm"})):(x(),ke(Ve,{key:1,name:"expand",size:"sm"}))],8,Wre)):re("",!0)])]),ge.value?(x(),N("input",{key:0,ref_key:"fileInputRef",ref:R,type:"file",multiple:"",class:"file-input-hidden",onChange:Oe[5]||(Oe[5]=(...te)=>C(ne)&&C(ne)(...te))},null,544)):re("",!0),_("div",{ref_key:"toolbarRef",ref:rt,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Do,class:"menu-measure","aria-hidden":"true"},[...Oe[21]||(Oe[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",zre,[ge.value?(x(),ke(Dn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(me)},{default:Ee(()=>[ie(Ve,{name:"attachment"})]),_:1},8,["label","onClick"])):re("",!0),e.status?(x(),N("span",{key:1,class:We(["perm-pill",["perm-"+e.status.permission,{open:et.value}]]),role:"button",tabindex:"0",onClick:xt(Nt,["stop"]),onKeydown:[Ji(Nt,["enter"]),Ji(xt(Nt,["prevent"]),["space"])]},O(rs.value),43,Ure)):re("",!0),et.value&&e.status?(x(),N("div",{key:2,class:"perm-dropdown",style:Vt(Wn.value),role:"menu",onClick:Oe[6]||(Oe[6]=xt(()=>{},["stop"]))},[(x(),N(Pe,null,ot(jn,te=>_("button",{key:te.mode,class:We(["pd-row",{"is-current":te.mode===e.status.permission}]),role:"menuitem",onClick:Te=>rr(te.mode)},[_("span",jre,[te.mode===e.status.permission?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):re("",!0)]),_("span",Vre,[_("span",{class:"pd-name",style:Vt({color:te.color})},O(C(r)(te.labelKey)),5),_("span",Kre,O(C(r)(te.descKey)),1)])],10,qre)),64))],4)):re("",!0),e.status?(x(),N("div",{key:3,ref_key:"modesRef",ref:Qe,class:"modes"},[_("button",{type:"button",class:We(["mode-pill",{on:Hn.value,open:ze.value}]),onClick:xt(En,["stop"])},[_("span",Gre,O(C(r)("status.modesLabel")),1),to.value?(x(),N("span",Yre,O(C(r)("status.planLabel")),1)):re("",!0),yn.value?(x(),N("span",Zre,O(C(r)("status.swarmLabel")),1)):re("",!0),An.value?(x(),N("span",Xre,O(C(r)("status.goalLabel")),1)):re("",!0)],2),ze.value?(x(),N("div",{key:0,ref_key:"modesMenuRef",ref:bt,class:"modes-menu",style:Vt(Ps.value),role:"menu"},[_("button",{type:"button",class:We(["mode-row",{on:to.value}]),role:"menuitem",onClick:Oe[7]||(Oe[7]=te=>i("togglePlan"))},[_("span",Qre,[ie(Ve,{name:"file-edit",size:"sm"})]),_("span",Jre,[_("span",ele,O(C(r)("status.planLabel")),1),_("span",tle,O(C(r)("status.planDesc")),1)]),_("span",{class:We(["mode-switch",{on:to.value}])},[...Oe[22]||(Oe[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:We(["mode-row",{on:yn.value}]),role:"menuitem",onClick:Oe[8]||(Oe[8]=te=>i("toggleSwarm"))},[_("span",nle,[ie(Ve,{name:"sparkles",size:"sm"})]),_("span",ole,[_("span",sle,O(C(r)("status.swarmLabel")),1),_("span",ile,O(C(r)("status.swarmDesc")),1)]),_("span",{class:We(["mode-switch",{on:yn.value}])},[...Oe[23]||(Oe[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:We(["mode-row mode-row-goal",{on:wn.value||o.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:Oe[9]||(Oe[9]=te=>wn.value?i("focusGoal"):i("toggleGoal"))},[_("span",rle,[ie(Ve,{name:"target",size:"sm"})]),_("span",lle,[_("span",ale,O(C(r)("status.goalLabel")),1),_("span",cle,O(C(r)("status.goalDesc")),1)]),wn.value?re("",!0):(x(),N("span",{key:0,class:We(["mode-switch",{on:o.goalMode}])},[...Oe[24]||(Oe[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),wn.value?(x(),N("div",ule,[Mn.value?(x(),ke(Ot,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:Oe[10]||(Oe[10]=te=>i("controlGoal","pause"))},{default:Ee(()=>[ie(Ve,{name:"pause",size:"sm"}),_("span",null,O(C(r)("status.goalPause")),1)]),_:1})):re("",!0),Bo.value?(x(),ke(Ot,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:Oe[11]||(Oe[11]=te=>i("controlGoal","resume"))},{default:Ee(()=>[ie(Ve,{name:"play",size:"sm"}),_("span",null,O(C(r)("status.goalResume")),1)]),_:1})):re("",!0),ie(Ot,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:Oe[12]||(Oe[12]=te=>i("controlGoal","cancel"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"}),_("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):re("",!0)],2)],4)):re("",!0)],512)):re("",!0)]),_("div",dle,[ss.value?(x(),N("button",{key:0,class:"compact-chip",onClick:Oe[13]||(Oe[13]=xt(te=>i("compact"),["stop"]))},"/compact")):re("",!0),ie(Zt,{text:fn.value},{default:Ee(()=>[e.status&&!e.hideContext?(x(),N("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":fn.value},[ie(Ire,{pct:dn.value},null,8,["pct"])],8,fle)):re("",!0)]),_:1},8,["text"]),e.status?(x(),N("span",{key:1,class:We(["model-pill",{open:Ne.value}]),role:"button",tabindex:"0",onClick:xt(St,["stop"]),onKeydown:[Ji(St,["enter"]),Ji(xt(St,["prevent"]),["space"])]},[_("b",null,O(e.status.model),1),mo.value?(x(),N("span",ple,O(mo.value),1)):re("",!0),ie(Ve,{class:"cv",name:"chevron-down",size:"sm"})],42,hle)):re("",!0),e.running?(x(),ke(Zt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:Oe[14]||(Oe[14]=te=>i("interrupt"))},[ie(Ve,{name:"stop",size:"sm"})],8,mle)]),_:1},8,["text"])):re("",!0),_("button",{class:We(["send",{"is-starting":e.starting}]),"aria-label":De.value,disabled:e.starting,onClick:Oe[15]||(Oe[15]=te=>J())},[e.starting?(x(),ke(Ds,{key:0,size:"sm"})):(x(),ke(Ve,{key:1,name:"send",size:"sm"}))],10,gle)]),Ne.value&&e.status?(x(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:Oe[17]||(Oe[17]=xt(()=>{},["stop"]))},[Io.value.length>0?(x(),N("div",vle,O(C(r)("status.starredModels")),1)):re("",!0),(x(!0),N(Pe,null,ot(Io.value,te=>(x(),N("button",{key:te.id,class:We(["md-row",{"is-current":te.id===e.status.modelId}]),role:"menuitem",onClick:Te=>oi(te.id)},[_("span",kle,[te.id===e.status.modelId?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):re("",!0)]),_("span",ble,O(te.displayName??te.model),1),_("span",xle,O(te.provider),1),ie(Ve,{class:"md-star",name:"star",size:"sm"})],10,yle))),128)),Io.value.length>0?(x(),N("div",wle)):re("",!0),No.value.length>0?(x(),N("div",_le,O(ls.value),1)):re("",!0),(x(!0),N(Pe,null,ot(No.value,te=>(x(),N("button",{key:te.id,class:We(["md-row",{"is-current":te.id===e.status.modelId}]),role:"menuitem",onClick:Te=>oi(te.id)},[_("span",Cle,[te.id===e.status.modelId?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):re("",!0)]),_("span",Ale,O(te.displayName??te.model),1),zn(te.id)?(x(),ke(Ve,{key:0,class:"md-star",name:"star",size:"sm"})):re("",!0)],10,Sle))),128)),No.value.length>0?(x(),N("div",Mle)):re("",!0),_("div",{class:We(["md-thinking",{"is-readonly":Yn.value}])},[_("span",Ele,O(C(r)("status.thinkingLabel")),1),Pn.value==="unsupported"?(x(),N("span",Tle,O(C(r)("status.modeNotSupported")),1)):(x(),N("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(x(!0),N(Pe,null,ot(ao.value,te=>(x(),N("button",{key:te,type:"button",class:We(["effort-seg",{"is-active":te===Gn.value}]),disabled:Yn.value,onClick:Te=>is(te)},O(qn(te)),11,Ile))),128))],8,Nle))],2),Oe[25]||(Oe[25]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:Oe[16]||(Oe[16]=te=>{vt(),i("pickModel")})},[_("span",Lle,O(C(r)("status.moreModels")),1)])])):re("",!0)],512)]),_("div",{class:We(["drop-overlay",{show:C(q)}]),"aria-hidden":"true"},[_("div",$le,[ie(Ve,{name:"file-plus",size:"lg"}),_("span",null,O(C(r)("composer.dropToAttach")),1)])],2)],34))}}),L5=ct(Fle,[["__scopeId","data-v-862f27d1"]]),Ole={key:0,class:"ui-card__head"},Rle={class:"ui-card__body"},Ble={key:1,class:"ui-card__foot"},Dle=Ze({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(x(),N("div",Ole,[$n(t.$slots,"head",{},void 0,!0)])):re("",!0),_("div",Rle,[$n(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(x(),N("div",Ble,[$n(t.$slots,"foot",{},void 0,!0)])):re("",!0)],2))}}),Hk=ct(Dle,[["__scopeId","data-v-9c9f9a9a"]]),Ple={class:"goal-kicker"},Hle={key:0,class:"goal-progress","aria-hidden":"true"},Wle={class:"goal-full"},zle={key:0,class:"goal-criterion"},Ule=["inert","aria-hidden"],qle={class:"goal-meta"},jle={key:0},Vle={class:"goal-actions"},Kle=Ze({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et(),{confirm:i}=Zd(),r=Z(!1);Je(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=B(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(x(),ke(Hk,{class:We(["goal-strip",{expanded:r.value}])},{head:Ee(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[ie(Ve,{class:"goal-icon",name:"target",size:"md"}),_("span",Ple,O(C(s)("status.goalLabel")),1),_("span",{class:We(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),ie(Ls,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Xe(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(x(),N("span",Hle,[_("span",{class:"goal-progress-fill",style:Vt({width:`${l.value}%`})},null,4)])):re("",!0),ie(Ve,{class:We(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ee(()=>[_("div",Wle,O(e.goal.objective),1),e.goal.completionCriterion?(x(),N("div",zle,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,O(e.goal.completionCriterion),1)])):re("",!0)]),foot:Ee(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",qle,[_("span",null,O(e.goal.turnsUsed)+" turns",1),_("span",null,O(C(or)(e.goal.tokensUsed))+" tokens",1),_("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),N("span",jle,O(l.value)+"% token budget",1)):re("",!0)]),_("div",Vle,[e.goal.status==="active"?(x(),ke(Ot,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=xt(h=>o("controlGoal","pause"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"pause",size:"md"}),_("span",null,O(C(s)("status.goalPause")),1)]),_:1})):re("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(x(),ke(Ot,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=xt(h=>o("controlGoal","resume"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"play",size:"md"}),_("span",null,O(C(s)("status.goalResume")),1)]),_:1})):re("",!0),ie(Ot,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:xt(u,["stop"])},{default:Ee(()=>[ie(Ve,{name:"close",size:"md"}),_("span",null,O(C(s)("status.goalCancel")),1)]),_:1})])],8,Ule)]),_:1},8,["class"]))}}),Gle=ct(Kle,[["__scopeId","data-v-44bef30f"]]),Yle={class:"qh"},Zle={class:"qtitle"},Xle={key:0,class:"qstep"},Qle={key:1,class:"qmin-peek"},Jle={class:"qbody"},eae=["aria-label"],tae=["aria-selected","aria-label","onClick"],nae={class:"qstep-num"},oae={key:1,class:"qheader-chip"},sae={class:"qtext"},iae={class:"qopts"},rae=["onClick"],lae={class:"qopt-key"},aae={class:"qopt-glyph"},cae={key:0,class:"chk"},uae={key:1,class:"rad"},dae={class:"qopt-text"},fae={class:"qopt-label"},hae={key:0,class:"qopt-desc"},pae={class:"qopt-glyph"},mae={key:0,class:"chk"},gae={key:1,class:"rad"},vae={class:"qopt-label"},yae=["placeholder"],kae={class:"qfoot"},bae=Ze({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Et(),s=t,i=Z(0),r=Z(!1),l=B(()=>n.question.questions[i.value]),a=B(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(W){W>=0&&W<a.value&&(i.value=W)}function f(W){const z=p.value[W];return z?z.kind==="multi"?z.optionIds.length>0:z.kind==="multiWithOther"?z.optionIds.length>0||z.otherText.trim().length>0:z.kind==="other"?z.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=Z({});function g(W){return W.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${W.label} ${W.description??""}`.toLowerCase())}function b(){const W={...p.value};let z=!1;for(const R of n.question.questions){if(W[R.id])continue;const q=R.options.filter(g);q.length!==0&&(W[R.id]=R.multiSelect?{kind:"multi",optionIds:q.map(K=>K.id)}:{kind:"single",optionId:q[0].id},z=!0)}z&&(p.value=W)}Je(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},y.value={}}),Je(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function v(W,z){const R=p.value[W];if(R&&R.kind==="single"&&R.optionId===z){const q={...p.value};delete q[W],p.value=q}else p.value={...p.value,[W]:{kind:"single",optionId:z}}}function m(W,z){const R=p.value[W],q=R&&(R.kind==="multi"||R.kind==="multiWithOther")?R.kind==="multi"?[...R.optionIds]:[...R.optionIds]:[],K=q.indexOf(z);K>=0?q.splice(K,1):q.push(z);const X=p.value[W],ue=X&&X.kind==="multiWithOther"?X.otherText:"";ue?p.value={...p.value,[W]:{kind:"multiWithOther",optionIds:q,otherText:ue}}:p.value={...p.value,[W]:{kind:"multi",optionIds:q}}}const y=Z({}),k=Z(null);function A(W){const z=n.question.questions.find(q=>q.id===W),R=y.value[W]??"";if(z.multiSelect){const q=p.value[W],K=q&&(q.kind==="multi"||q.kind==="multiWithOther")?q.kind==="multi"?[...q.optionIds]:[...q.optionIds]:[];p.value={...p.value,[W]:{kind:"multiWithOther",optionIds:K,otherText:R}}}else p.value={...p.value,[W]:{kind:"other",text:R}}}function $(W){A(W),gt(()=>k.value?.focus())}function L(W,z){const R=p.value[W];return R?R.kind==="single"?R.optionId===z:R.kind==="multi"||R.kind==="multiWithOther"?R.optionIds.includes(z):!1:!1}function w(W){const z=p.value[W];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function E(){return n.question.questions.every(W=>f(W.id))}const T=B(()=>n.busyKind==="answer"),F=B(()=>n.busyKind==="dismiss"),S=B(()=>!!n.busyKind);function I(){if(S.value||!E())return;const W={answers:p.value,method:"click"};s("answer",n.question.questionId,W)}function P(){S.value||s("dismiss",n.question.questionId)}function D(W){const z=(document.activeElement?.tagName??"").toLowerCase(),R=z==="input"||z==="textarea";if(S.value)return;if(W.key==="Enter"){if(W.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():E()&&I();return}if(R)return;if(W.key==="Escape"){W.preventDefault(),P();return}if(r.value)return;const q=parseInt(W.key,10);if(!isNaN(q)&&q>=1&&q<=9){W.preventDefault();const K=l.value,X=q-1,ue=K.options[X];ue&&(K.multiSelect?m(K.id,ue.id):v(K.id,ue.id))}}return un(()=>document.addEventListener("keydown",D)),xn(()=>document.removeEventListener("keydown",D)),(W,z)=>(x(),ke(Hk,{class:We(["qcard",{minimized:r.value}])},Z4({head:Ee(()=>[_("div",Yle,[z[5]||(z[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",Zle,O(C(o)("question.title")),1),a.value>1&&!r.value?(x(),N("span",Xle,O(C(o)("question.step",{current:i.value+1,total:a.value})),1)):re("",!0),r.value?(x(),N("span",Qle,O(l.value.question),1)):re("",!0),ie(Dn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:z[0]||(z[0]=R=>r.value=!r.value)},{default:Ee(()=>[r.value?(x(),ke(Ve,{key:0,name:"chevron-up",size:"md"})):(x(),ke(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[_("div",Jle,[a.value>1?(x(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(x(!0),N(Pe,null,ot(n.question.questions,(R,q)=>(x(),N("button",{key:R.id,type:"button",class:We(["qstep-dot",{active:q===i.value,answered:f(R.id)}]),"aria-selected":q===i.value,"aria-label":C(o)("question.step",{current:q+1,total:a.value}),onClick:K=>d(q)},[_("span",nae,O(q+1),1)],10,tae))),128))],8,eae)):re("",!0),l.value.header?(x(),N("div",oae,[ie(Ls,{variant:"neutral",size:"sm"},{default:Ee(()=>[Xe(O(l.value.header),1)]),_:1})])):re("",!0),_("div",sae,O(l.value.question),1),l.value.body?(x(),ke(Bm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),_("div",iae,[(x(!0),N(Pe,null,ot(l.value.options,(R,q)=>(x(),N("label",{key:R.id,class:We(["qopt",{selected:L(l.value.id,R.id)}]),onClick:xt(K=>l.value.multiSelect?m(l.value.id,R.id):v(l.value.id,R.id),["prevent"])},[_("span",lae,O(q+1),1),_("span",aae,[l.value.multiSelect?(x(),N("span",cae,O(L(l.value.id,R.id)?"■":"□"),1)):(x(),N("span",uae,O(L(l.value.id,R.id)?"●":"○"),1))]),_("span",dae,[_("span",fae,O(R.label),1),R.description?(x(),N("span",hae,O(R.description),1)):re("",!0)])],10,rae))),128)),l.value.allowOther?(x(),N("label",{key:0,class:We(["qopt",{selected:w(l.value.id)}]),onClick:z[4]||(z[4]=xt(R=>$(l.value.id),["prevent"]))},[z[6]||(z[6]=_("span",{class:"qopt-key"},null,-1)),_("span",pae,[l.value.multiSelect?(x(),N("span",mae,O(w(l.value.id)?"■":"□"),1)):(x(),N("span",gae,O(w(l.value.id)?"●":"○"),1))]),_("span",vae,O(l.value.otherLabel??C(o)("question.otherDefault")),1),Ln(_("input",{ref_key:"otherInputEl",ref:k,"onUpdate:modelValue":z[1]||(z[1]=R=>y.value[l.value.id]=R),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:z[2]||(z[2]=R=>A(l.value.id)),onFocus:z[3]||(z[3]=R=>A(l.value.id))},null,40,yae),[[_s,y.value[l.value.id]]])],2)):re("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[_("div",kae,[i.value<a.value-1?(x(),ke(Ot,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ee(()=>[Xe(O(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(x(),ke(Ot,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:T.value,onClick:I},{default:Ee(()=>[Xe(O(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(x(),ke(Ot,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Xe(O(C(o)("question.back")),1)]),_:1},8,["disabled"])):re("",!0),ie(Ot,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:P},{default:Ee(()=>[Xe(O(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),xae=ct(bae,[["__scopeId","data-v-14c58ac1"]]),wae={class:"ah"},_ae={class:"akind"},Sae={class:"apath"},Cae={class:"ah-path"},Aae={key:1,class:"diff"},Mae={class:"dg"},Eae={class:"dc"},Tae={key:2,class:"body-shell"},Nae={class:"shell-cmd"},Iae={key:0,class:"shell-cwd"},Lae={key:1,class:"shell-danger"},$ae={key:3,class:"body-file"},Fae={class:"file-bar"},Oae={class:"file-lang"},Rae={class:"file-content"},Bae={class:"file-ln"},Dae={class:"file-text"},Pae={key:4,class:"body-chip"},Hae={class:"chip-label"},Wae={class:"chip-value"},zae={key:0,class:"chip-detail"},Uae={key:5,class:"body-chip"},qae={key:0,class:"chip-label"},jae={class:"chip-value"},Vae={key:6,class:"body-chip"},Kae={class:"chip-label"},Gae={class:"chip-value"},Yae={key:0,class:"chip-detail"},Zae={key:7,class:"body-chip"},Xae={class:"chip-label"},Qae={class:"chip-value"},Jae={key:0,class:"chip-detail"},ece={key:8,class:"body-todo"},tce={class:"todo-glyph"},nce={key:9,class:"body-plan"},oce={key:10,class:"body-generic"},sce={class:"gen-text"},ice={key:11,class:"feedback-wrap"},rce=["placeholder"],lce={class:"feedback-hint"},ace={key:0,class:"plan-actions"},cce={key:1,class:"abtn"},uce=Ze({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et(),i=B(()=>{const T=n.block;return T.kind!=="plan_review"?null:{plan:T.plan,path:T.path,options:T.options??[]}}),r=Z(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const T=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${T}`)}const c=Z(!1),u=Z(""),d=Z(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const T=u.value.trim();i.value?v("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:T||void 0}):v("feedback",{decision:"rejected",feedback:T||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function g(T){T.key==="Enter"&&!T.shiftKey?(T.preventDefault(),h()):T.key==="Escape"&&(T.preventDefault(),p())}const b=Z(null);Je(()=>n.busy,T=>{T||(b.value=null)});function v(T,F){n.busy||(b.value=T,o("decide",F))}function m(){v("approve",{decision:"approved"})}function y(){v("approveSession",{decision:"approved",scope:"session"})}function k(){v("reject",{decision:"rejected"})}function A(){v("approvePlan",{decision:"approved"})}function $(T){v(`option:${T}`,{decision:"approved",selectedLabel:T})}function L(){n.busy||f()}function w(){v("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(T){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){T.key==="1"?(T.preventDefault(),A()):T.key==="2"?(T.preventDefault(),L()):T.key==="3"&&(T.preventDefault(),w());return}T.key==="1"&&S.options[0]?(T.preventDefault(),$(S.options[0].label)):T.key==="2"&&S.options[1]?(T.preventDefault(),$(S.options[1].label)):T.key==="3"&&S.options[2]&&(T.preventDefault(),$(S.options[2].label));return}T.key==="1"?(T.preventDefault(),m()):T.key==="2"?(T.preventDefault(),y()):T.key==="3"?(T.preventDefault(),k()):T.key==="4"&&(T.preventDefault(),f())}return un(()=>document.addEventListener("keydown",E)),xn(()=>document.removeEventListener("keydown",E)),(T,F)=>(x(),ke(Hk,{class:We(["appr",{minimized:r.value}])},Z4({head:Ee(()=>[_("div",wae,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",_ae,O(a()),1),_("span",Sae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),N(Pe,{key:0},[Xe(O(e.block.path),1)],64)):e.block.kind==="shell"?(x(),N(Pe,{key:1},[Xe(O(e.block.command),1)],64)):e.block.kind==="url"?(x(),N(Pe,{key:2},[Xe(O(e.block.url),1)],64)):e.block.kind==="search"?(x(),N(Pe,{key:3},[Xe(O(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),N(Pe,{key:4},[Xe(O(e.block.name),1)],64)):e.block.kind==="generic"?(x(),N(Pe,{key:5},[Xe(O(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!r.value?(x(),ke(Ls,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Xe(O(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):re("",!0),r.value?re("",!0):(x(),ke(Ls,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Xe(O(C(s)("approval.required")),1)]),_:1})),ie(Dn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ee(()=>[r.value?(x(),ke(Ve,{key:0,name:"chevron-up",size:"md"})):(x(),ke(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(x(),ke(Zt,{key:0,text:e.block.path},{default:Ee(()=>[_("div",Cae,O(e.block.path),1)]),_:1},8,["text"])):re("",!0),e.block.kind==="diff"?(x(),N("div",Aae,[(x(!0),N(Pe,null,ot(e.block.diff,(S,I)=>(x(),N("div",{key:I,class:We(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",Mae,O(S.gutter),1),_("span",Eae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(x(),N("div",Tae,[_("div",Nae,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),Xe(" "+O(e.block.command),1)]),e.block.cwd?(x(),N("div",Iae,"cwd: "+O(e.block.cwd),1)):re("",!0),e.block.danger?(x(),N("div",Lae,O(C(s)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(x(),N("div",$ae,[_("div",Fae,[_("span",Oae,O(e.block.language??""),1)]),_("div",Rae,[(x(!0),N(Pe,null,ot(e.block.content.split(`
|
|
297
|
-
`),(S,I)=>(x(),N("div",{key:I,class:"file-line"},[_("span",Bae,O(I+1),1),_("span",Dae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(x(),N("div",Pae,[_("span",Hae,O(e.block.op),1),_("span",Wae,O(e.block.path),1),e.block.detail?(x(),N("span",zae,O(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(x(),N("div",Uae,[e.block.method?(x(),N("span",qae,O(e.block.method),1)):re("",!0),_("span",jae,O(e.block.url),1)])):e.block.kind==="search"?(x(),N("div",Vae,[_("span",Kae,O(C(s)("approval.searchQueryLabel")),1),_("span",Gae,O(e.block.query),1),e.block.scope?(x(),N("span",Yae,O(C(s)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(x(),N("div",Zae,[_("span",Xae,O(e.block.kind2),1),_("span",Qae,O(e.block.name),1),e.block.description?(x(),N("span",Jae,O(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(x(),N("div",ece,[(x(!0),N(Pe,null,ot(e.block.items,(S,I)=>(x(),N("div",{key:I,class:"todo-item"},[_("span",tce,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:We(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),N("div",nce,[ie(Bm,{text:e.block.plan},null,8,["text"])])):(x(),N("div",oce,[_("span",sce,O(e.block.summary),1)])),c.value?(x(),N("div",ice,[Ln(_("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,rce),[[_s,u.value]]),_("div",lce,O(C(s)("approval.feedbackHint")),1)])):re("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(x(),N("div",ace,[i.value.options.length>0?(x(!0),N(Pe,{key:0},ot(i.value.options,(S,I)=>(x(),ke(Zt,{key:I,text:S.description},{default:Ee(()=>[ie(Ot,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:P=>$(S.label)},{default:Ee(()=>[Xe(O(S.label),1),ie(vr,{class:"k",keys:[String(I+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(x(),ke(Ot,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ee(()=>[Xe(O(C(s)("approval.approvePlan")),1),ie(vr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:L},{default:Ee(()=>[Xe(O(C(s)("approval.revise")),1),i.value.options.length===0?(x(),ke(vr,{key:0,class:"k",keys:["2"]})):re("",!0)]),_:1},8,["disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:w},{default:Ee(()=>[Xe(O(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),ke(vr,{key:0,class:"k",keys:["3"]})):re("",!0)]),_:1},8,["loading","disabled"])])):(x(),N("div",cce,[ie(Ot,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:m},{default:Ee(()=>[Xe(O(C(s)("approval.approve")),1),ie(vr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:y},{default:Ee(()=>[Xe(O(C(s)("approval.approveSession")),1),ie(vr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:k},{default:Ee(()=>[Xe(O(C(s)("approval.reject")),1),ie(vr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Xe(O(C(s)("approval.feedback")),1),ie(vr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),dce=ct(uce,[["__scopeId","data-v-458a9d7d"]]),fce=Ze({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(x(),N("span",{class:We(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),$5=ct(fce,[["__scopeId","data-v-f595d935"]]),hce={class:"taskspane"},pce={class:"tp-head"},mce={class:"tp-title"},gce={class:"tp-count"},vce={class:"tp-list"},yce={key:0,class:"tp-empty"},kce=["role","onClick"],bce={class:"tp-name"},xce={class:"tp-time"},wce=["onClick"],_ce={key:0,class:"tp-detail"},Sce={key:0,class:"tp-codebox"},Cce=["onClick"],Ace={class:"tp-pre"},Mce={class:"tp-cmd"},Ece={key:1,class:"tp-codebox"},Tce=["onClick"],Nce={class:"tp-pre"},Ice=Ze({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Et(),s=Ro(new Set),i=Ro(new Set),r=Ro(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,g,b){await Yo(p)&&(b.add(g),setTimeout(()=>b.delete(g),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const g=p.output?.join(`
|
|
298
|
-
`)??"";g&&await d(g,p.id,r)}return(p,g)=>(x(),N("div",hce,[_("div",pce,[_("span",mce,O(C(o)("tasks.tag")),1),_("span",gce,O(e.tasks.length),1)]),_("div",vce,[e.tasks.length===0?(x(),N("div",yce,O(C(o)("tasks.emptyTasks")),1)):(x(!0),N(Pe,{key:1},ot(e.tasks,b=>(x(),N("div",{key:b.id,class:We(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[_("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:v=>a(b)},[ie($5,{status:u(b.state)},null,8,["status"]),_("span",bce,O(b.name),1),ie(Ls,{variant:"neutral",size:"sm"},{default:Ee(()=>[Xe(O(b.kind),1)]),_:2},1024),_("span",xce,O(b.timing),1),b.state==="run"?(x(),N("button",{key:0,class:"tp-stop",onClick:xt(v=>n("cancel",b.id),["stop"])},O(C(o)("tasks.stop")),9,wce)):re("",!0),b.kind==="subagent"?(x(),ke(Ve,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(x(),ke(Ve,{key:2,class:We(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):re("",!0)],8,kce),s.has(b.id)&&l(b)?(x(),N("div",_ce,[b.meta?(x(),N("div",Sce,[_("button",{class:We(["tp-copy",{copied:i.has(b.id)}]),onClick:xt(v=>f(b),["stop"])},O(i.has(b.id)?"已复制":"复制"),11,Cce),_("pre",Ace,[_("code",null,[_("span",Mce,O(b.meta),1)])])])):re("",!0),b.output&&b.output.length>0?(x(),N("div",Ece,[_("button",{class:We(["tp-copy",{copied:r.has(b.id)}]),onClick:xt(v=>h(b),["stop"])},O(r.has(b.id)?"已复制":"复制"),11,Tce),_("pre",Nce,[_("code",null,[g[0]||(g[0]=Xe(`
|
|
299
|
-
`,-1)),(x(!0),N(Pe,null,ot(b.output,(v,m)=>(x(),N("span",{key:m,class:"tp-line"},O(v),1))),128)),g[1]||(g[1]=Xe(`
|
|
300
|
-
`,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),zC=ct(Ice,[["__scopeId","data-v-28fd5fc0"]]),Lce={class:"todo-card"},$ce={key:0,class:"tc-empty"},Fce={class:"tc-name"},Oce=Ze({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Et();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(x(),N("div",Lce,[t.todos.length===0?(x(),N("div",$ce,[i[0]||(i[0]=_("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,O(C(n)("tasks.emptyTodo")),1)])):re("",!0),(x(!0),N(Pe,null,ot(t.todos,(r,l)=>(x(),N("div",{key:l,class:We(["tc-row",`s-${r.status}`])},[ie($5,{status:o(r.status)},null,8,["status"]),_("span",Fce,O(r.title),1)],2))),128))]))}}),Rce=ct(Oce,[["__scopeId","data-v-01c65735"]]),Bce={class:"dock-work-head"},Dce={key:0,class:"dock-work-tab static"},Pce={key:1,class:"dock-work-tab static"},Hce={key:2,class:"dock-work-tab static"},Wce={class:"dock-work-body"},zce={class:"dw-count"},Uce={class:"dw-count"},qce={class:"dw-count"},jce=Ze({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Et(),r=Z(null),l=Z(null),a=Z(null),c=Z(null);function u(b){return r.value?(r.value.loadForEdit(b),!0):!1}function d(b){r.value?.loadAttachmentsForEdit(b)}function f(){r.value?.focus()}function h(b){if(!o.dockPanel)return;const v=b.target;v&&(l.value?.contains(v)||a.value?.contains(v)||s("close-dock-panel"))}Je(()=>o.dockPanel,b=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),b&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function g(){const b=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${b}px`)}return un(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(g),p.observe(c.value),g())}),xn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(b,v)=>(x(),N("div",{ref_key:"dockRef",ref:c,class:We(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:v[28]||(v[28]=xt(()=>{},["stop"]))},[ie(Tl,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(x(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:v[3]||(v[3]=xt(()=>{},["stop"]))},[_("div",Bce,[e.dockPanel==="bash"?(x(),N("span",Dce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),N("span",Pce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),N("span",Hce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):re("",!0)]),_("div",Wce,[e.dockPanel==="bash"?(x(),ke(zC,{key:0,tasks:e.bashTasks,onCancel:v[0]||(v[0]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),ke(zC,{key:1,tasks:e.subagentTasks,onCancel:v[1]||(v[1]=m=>s("cancelTask",m)),onOpen:v[2]||(v[2]=m=>s("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),ke(Rce,{key:2,todos:e.todos??[]},null,8,["todos"])):re("",!0)])],512)):re("",!0)]),_:1}),e.goal?(x(),ke(Gle,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:v[4]||(v[4]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(x(),N("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),ke(ph,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:v[5]||(v[5]=m=>s("toggle-dock-panel","bash"))},{default:Ee(()=>[ie(Ve,{name:"clock",size:"md"}),_("span",null,O(C(i)("tasks.dockBash")),1),_("span",zce,[v[29]||(v[29]=Xe("(",-1)),_("b",null,O(e.bashTasks.length),1),v[30]||(v[30]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),e.subagentTasks.length>0?(x(),ke(ph,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:v[6]||(v[6]=m=>s("toggle-dock-panel","subagent"))},{default:Ee(()=>[ie(Ve,{name:"sparkles",size:"md"}),_("span",null,O(C(i)("tasks.dockSubagent")),1),_("span",Uce,[v[31]||(v[31]=Xe("(",-1)),_("b",null,O(e.subagentTasks.length),1),v[32]||(v[32]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),(e.todos?.length??0)>0?(x(),ke(ph,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:v[7]||(v[7]=m=>s("toggle-dock-panel","todos"))},{default:Ee(()=>[ie(Ve,{name:"check-list",size:"md"}),_("span",null,O(C(i)("tasks.dockTodos")),1),_("span",qce,[v[33]||(v[33]=Xe("(",-1)),_("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),v[34]||(v[34]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0)],512)):re("",!0),e.pendingQuestion?(x(),ke(xae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:v[8]||(v[8]=(m,y)=>s("answer",m,y)),onDismiss:v[9]||(v[9]=m=>s("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(x(),ke(dce,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:v[10]||(v[10]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(x(),ke(L5,{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,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:v[11]||(v[11]=m=>s("submit",m)),onSteer:v[12]||(v[12]=m=>s("steer",m)),onCommand:v[13]||(v[13]=m=>s("command",m)),onInterrupt:v[14]||(v[14]=m=>s("interrupt")),onSetPermission:v[15]||(v[15]=m=>s("setPermission",m)),onSetThinking:v[16]||(v[16]=m=>s("setThinking",m)),onTogglePlan:v[17]||(v[17]=m=>s("togglePlan")),onToggleSwarm:v[18]||(v[18]=m=>s("toggleSwarm")),onToggleGoal:v[19]||(v[19]=m=>s("toggleGoal")),onOpenBtw:v[20]||(v[20]=m=>s("openBtw")),onCreateGoal:v[21]||(v[21]=m=>s("createGoal",m)),onControlGoal:v[22]||(v[22]=m=>s("controlGoal",m)),onFocusGoal:v[23]||(v[23]=m=>s("focusGoal")),onFocusSwarm:v[24]||(v[24]=m=>s("focusSwarm")),onCompact:v[25]||(v[25]=m=>s("compact")),onPickModel:v[26]||(v[26]=m=>s("pickModel")),onSelectModel:v[27]||(v[27]=m=>s("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Vce=ct(jce,[["__scopeId","data-v-9e5ec0f2"]]),Kce=["aria-label","aria-hidden"],Gce={class:"toc-scroll"},Yce=["onClick"],Zce={class:"toc-label"},Xce=240,Qce=Ze({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et(),i=Z(null),r=Z(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=Xce}const c=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Je(c,u=>{l?.disconnect(),l=null,u&>(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ho(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(x(),N("nav",{key:0,ref_key:"navRef",ref:i,class:We(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",Gce,[(x(!0),N(Pe,null,ot(e.items,f=>(x(),N("button",{key:f.id,type:"button",class:We(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",Zce,O(f.title),1)],10,Yce))),128))])],10,Kce)):re("",!0)}}),Jce=ct(Qce,[["__scopeId","data-v-3f1c1f66"]]),eue=5;function tue(e,t,n,o=eue){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 nue={class:"chat-layout"},oue={class:"empty-hint"},sue={key:0,class:"empty-hint-text"},iue={key:1,class:"ws-pick"},rue={class:"ws-pick-name"},lue={key:1,class:"ws-pick-menu"},aue=["onClick"],cue={class:"ws-pick-item-name"},uue={class:"ws-pick-item-path"},due=["aria-label"],fue={key:0,class:"abort-toast",role:"status","aria-live":"polite"},hue={class:"abort-toast-text"},hg=80,UC=1e3,pue=420,mue=3e3,gue=Ze({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=Et(),s=e,i=n,r=Z(!1),l=Z(!1),a=B(()=>s.workspaces?.find(we=>we.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=B(()=>(s.workspaces?.length??0)>0),u=B(()=>tue(s.workspaces??[],s.activeWorkspaceId,l.value)),d=B(()=>(s.workspaces?.length??0)-u.value.length);Je(r,he=>{he||(l.value=!1)});function f(he){r.value=!1,he!==s.activeWorkspaceId&&i("selectWorkspace",he)}Gc($t.contentAlign);const h=Z(null),p=Z(null),g=Z(null),b=Z(!1),v=Z(0);let m=null;function y(he,we){const He=g.value??p.value;return!He||He.loadForEdit(he)===!1?!1:(He.loadAttachmentsForEdit(we??[]),!0)}function k(){b.value=!0,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,b.value=!1},2e3)}function A(){v.value++}const $=B(()=>s.tasks.filter(he=>he.kind!=="subagent")),L=B(()=>s.tasks.filter(he=>he.kind==="subagent"&&he.runInBackground)),w=B(()=>$.value.filter(he=>he.state==="run").length),E=B(()=>L.value.filter(he=>he.state==="run").length);function T(he){const we=s.tasks,He=we.find(Rt=>Rt.id===he)??we.find(Rt=>Rt.parentToolCallId===he);if(He)return He.id;const Ft=we.filter(Rt=>Rt.kind==="subagent"&&!Rt.parentToolCallId);if(Ft.length===1)return Ft[0].id}Nn("resolveAgentTaskId",T),Nn("pinScroll",to);const F=B(()=>(s.todos??[]).filter(he=>he.status==="done").length),S=B(()=>$.value.length>0||L.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),I=Z(null),P=B(()=>s.gitInfo?s.changes?.length??0:0);function D(he){I.value=I.value===he?null:he}function W(){I.value=null}Je(S,he=>{he||W()});function z(he){if(he.role==="compaction")return o("conversation.compactedPlain");if(he.role==="user"){if(he.skillActivation)return`/${he.skillActivation.name}`;if(he.pluginCommand)return`/${he.pluginCommand.pluginId}:${he.pluginCommand.commandName}`;const He=he.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const we=(he.text||he.thinking||"").trim().replaceAll(/\s+/g," ");return we.length>0?we:(he.tools?.length??0)>0?`${he.tools.length} tools`:"kimi"}const R=B(()=>s.turns.filter(he=>he.role==="user").map((he,we)=>({id:he.id,role:he.role,no:we+1,title:z(he)}))),q=Z(null);function K(){const he=le.value;if(!he)return;const we=he.querySelectorAll(".turn-anchor[data-turn-id]");if(we.length===0)return;const He=R.value;if(He.length===0)return;const Ft=new Set(He.map(Q=>Q.id));if(pe()<=hg){q.value=He[He.length-1].id;return}const Rt=he.getBoundingClientRect(),ln=Rt.height/2;let Un=null;we.forEach(Q=>{const be=Q.dataset.turnId;if(!be||!Ft.has(be))return;Q.getBoundingClientRect().top-Rt.top<=ln&&(Un=be)}),q.value=Un??He[0].id}const X=Z(!1);let ue=0;function me(){ue||(ue=it(()=>{ue=0,ne()}))}function ne(){const he=le.value,we=!s.mobile&&s.conversationToc&&he?he.closest(".con")?.querySelector(".conversation-toc"):null,He=we?.querySelector(".toc-bar");let Ft=!1;if(he&&we&&He){const Rt=He.getBoundingClientRect(),ln=we.getBoundingClientRect(),Un=Rt.left+Rt.width/2;Ft=Array.from(he.querySelectorAll(".table-node-wrapper")).some(Q=>{const be=Q.getBoundingClientRect();return be.left<=Un&&Un<=be.right&&be.top<ln.bottom&&be.bottom>ln.top})}X.value!==Ft&&(X.value=Ft)}const ce=B(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),de=B(()=>{const he=ce.value;if(he)return s.pendingQuestionActions?.[he.questionId]}),Ae=B(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Le=B(()=>{const he=Ae.value;return he?!!s.pendingApprovalActions?.[he.approvalId]:!1}),le=Z(null),U=Z(null),ae=Z(0),se=Z(0),j=B(()=>({"--panes-scrollbar-width":`${ae.value}px`}));function J(he){return he instanceof HTMLElement?he:he&&"$el"in he&&he.$el instanceof HTMLElement?he.$el:null}function ye(){const he=le.value;ae.value=he?Math.max(0,he.offsetWidth-he.clientWidth):0,se.value=U.value?.offsetHeight??0}function fe(he){const we=J(he);le.value=we,we&&ls()}function ve(he){const we=J(he);U.value=we??null,he&&"loadForEdit"in he&&typeof he.loadForEdit=="function"&&"focus"in he&&typeof he.focus=="function"?g.value={loadForEdit:he.loadForEdit.bind(he),loadAttachmentsForEdit:"loadAttachmentsForEdit"in he&&typeof he.loadAttachmentsForEdit=="function"?he.loadAttachmentsForEdit.bind(he):()=>{},focus:he.focus.bind(he)}:g.value=null,rs()}const V=Z(!0),ee=Z(!1);function pe(){const he=le.value;return he?he.scrollHeight-he.scrollTop-he.clientHeight:0}let Ce=0,$e=0,De=0,ge=0,Ne=0,et=0;function rt(){return Date.now()<$e}function St(){me();const he=le.value;if(!he)return;const we=he.scrollTop;if(qn()){Ce=we;return}if(performance.now()-De<100){Ce=we;return}const He=pe();if(rt()){V.value=!0,ee.value=!1,Ce=we;return}we<Ce-1&&He>1?(V.value=!1,ee.value=!0):He<=hg&&we>Ce+1&&(V.value=!0,ee.value=!1),Ce=we,K()}function vt(he=!1){const we=le.value;V.value=!0,ee.value=!1,we&&(!he&&performance.now()<ge||(he&&typeof we.scrollTo=="function"?(De=performance.now(),ge=performance.now()+pue,we.scrollTo({top:we.scrollHeight,behavior:"smooth"})):we.scrollTop=we.scrollHeight,Ce=we.scrollTop))}function Nt(he,we){return(we.closest("[inert]")?.closest(".tool-group")??we).getBoundingClientRect().top-he.getBoundingClientRect().top+he.scrollTop}function Wt(he,we){const He=Array.from(he.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(ln=>({node:ln,top:Nt(he,ln)})),Ft=He.findIndex(ln=>ln.top>=we),Rt=Ft<0?Math.max(0,He.length-1):Ft;return He.slice(Rt,Rt+2).flatMap(ln=>{const Un=ln.node.dataset.scrollAnchorId,Q=Un??ln.node.dataset.turnId;return Q?[{kind:Un?"tool":"turn",id:Q,top:ln.top}]:[]})}const ht=new Map;function dn(he,we){for(const He of we.anchors){const Ft=He.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Rt=he.querySelector(`[${Ft}="${Dt(He.id)}"]`);if(Rt)return Nt(he,Rt)-He.top}return he.scrollHeight-we.oldHeight}function fn(he,we,He=he.scrollTop){return he.scrollTop=He+dn(he,we),Ce=he.scrollTop,he.scrollTop}async function ss(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Fn.value||!s.hasMoreMessages)return;const he=s.sessionId,we=le.value,He=we?.scrollTop??0,Ft={anchors:we?Wt(we,He):[],oldHeight:we?.scrollHeight??0};Wn(he,!0),Ps();try{if(await gt(),await s.loadOlderMessages(he),await gt(),s.sessionId!==he){ht.set(he,Ft);return}const Rt=le.value;if(!Rt)return;fn(Rt,Ft),ht.delete(he)}finally{Wn(he,!1)}}function Dt(he){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(he):he.replaceAll(/["\\]/g,"\\$&")}function Pn(he){const we=le.value;if(!we)return;const He=we.querySelector(`.turn-anchor[data-turn-id="${Dt(he)}"]`);He&&(Po(),V.value=!1,ee.value=pe()>hg,He.scrollIntoView({behavior:"smooth",block:"center"}))}function ao(){const he=le.value;if(!he)return"none";const we=he.firstElementChild,He=we instanceof HTMLElement?we.offsetHeight:0,Ft=U.value?.offsetHeight??0;return`${he.scrollHeight}:${he.clientHeight}:${He}:${Ft}`}function it(he){return typeof requestAnimationFrame=="function"?requestAnimationFrame(he):setTimeout(he,16)}function Gn(he){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(he):clearTimeout(he)}let co=0,Yn=0,mo=null,is=0;function qn(){return performance.now()<co}function to(he,we=260){const He=le.value;if(!He||(mo=he,is=he.getBoundingClientRect().top,co=performance.now()+we,Yn))return;const Ft=()=>{if(Yn=0,performance.now()>=co||!mo){mo=null;return}const Rt=mo.getBoundingClientRect().top-is;Rt&&(He.scrollTop+=Rt),Yn=it(Ft)};Yn=it(Ft)}function yn(he=36){if(!V.value&&!rt())return;const we=++et;let He="",Ft=0,Rt=0;Ne&&(Gn(Ne),Ne=0);const ln=()=>{if(Ne=0,we!==et||!V.value&&!rt())return;vt(!1);const Un=ao();Ft=Un===He?Ft+1:0,He=Un,Rt++,Ft<3&&Rt<he&&(Ne=it(ln))};Ne=it(ln)}function Zn(he,we){return he!==void 0&&he.length>0&&we.length>=he.length&&he.firstId!==we.firstId&&he.lastId===we.lastId&&he.lastTextLen===we.lastTextLen&&he.lastThinkingLen===we.lastThinkingLen&&he.lastToolsLen===we.lastToolsLen&&he.approvalIds===we.approvalIds}const wn=B(()=>{const he=(s.approvals??[]).map(ln=>ln.approvalId).join(","),we=s.turns,He=we.at(-1),Ft=He?.thinking?.length??0,Rt=He?.tools?.reduce((ln,Un)=>ln+Un.name.length+(Un.arg?.length??0)+(Un.output?.join("").length??0),0)??0;return{length:we.length,firstId:we[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:Ft,lastToolsLen:Rt,approvalIds:he}});Je(wn,async(he,we)=>{if(Fn.value&&Zn(we,he)){K();return}await gt(),V.value||rt()?vt(he.length<we.length):ee.value=!0,K()}),Je(U,()=>{rs()}),Je(()=>s.mobile,async()=>{await gt(),ye()});const An=new Map;Je(()=>s.fileReloadKey,async(he,we)=>{const He=le.value;we&&He&&An.set(String(we),{top:He.scrollTop,following:V.value}),Po(),await gt();const Ft=le.value,Rt=he?An.get(String(he)):void 0;if(Rt&&Ft){const ln=ht.get(String(he)),Un=ln?fn(Ft,ln,Rt.top):Rt.top;ln&&ht.delete(String(he)),V.value=Rt.following,Ft.scrollTop=Un,Ce=Ft.scrollTop,ee.value=!Rt.following&&pe()>1,Rt.following&&yn()}else V.value=!0,Ce=0,vt(!1),yn();K()}),Je(()=>s.sessionLoading,async(he,we)=>{he||!we||(V.value=!0,await gt(),yn(),K())}),Je(()=>s.turnActive,async(he,we)=>{he||!we||!V.value&&!rt()||(await gt(),yn(48),K())});function Mn(){V.value=!0,ee.value=!1,$e=Date.now()+UC,gt(()=>{vt(!0),yn(16)})}function Bo(he){Mn(),i("submit",he)}function ze(he){V.value=!0,ee.value=!1,$e=Date.now()+UC,i("editMessage",he)}function Qe(he){const we=s.queued?.[he],He=we?.text??"";y(He,we?.attachments)&&i("editQueued",he)}function bt(he){i("reorderQueue",he)}function Pt(he,we){Mn(),i("answer",he,we)}function Hn(he,we){!he||!we||i("approval",he,we)}let rn=null,Ut=null,En=null,jn=null,Ct=0,Do=0,So=0;const Xo=Z(new Set),Fn=B(()=>!!s.sessionId&&Xo.value.has(s.sessionId));function Wn(he,we){const He=new Set(Xo.value);we?He.add(he):He.delete(he),Xo.value=He}function ti(){Fn.value||So||(So=it(()=>{So=0,!Fn.value&&(qn()||(V.value||rt())&&vt(!1))}))}function Ps(){et++,Ne&&(Gn(Ne),Ne=0),So&&(Gn(So),So=0)}function Po(){const he=le.value;if($e=0,Ps(),co=0,mo=null,he){const we=he.scrollTop;typeof he.scrollTo=="function"?he.scrollTo({top:we,behavior:"auto"}):he.scrollTop=we}ge=0,De=Number.NEGATIVE_INFINITY,he&&(Ce=he.scrollTop)}function Ss(){const he=le.value;!he||he.scrollHeight-he.clientHeight<=1&&!s.hasMoreMessages||(V.value=!1,Po(),he.scrollHeight-he.clientHeight>1&&(ee.value=!0))}function Pi(he){const we=le.value;if(!we)return!1;for(const He of he.composedPath()){if(He===we)return!1;if(He instanceof HTMLElement&&He.scrollHeight>He.clientHeight+1&&He.scrollTop>1)return!0}return!1}function _i(he){he.defaultPrevented||he.ctrlKey||he.shiftKey||he.deltaY>=0||Pi(he)||Ss()}function uo(he){const we=le.value;if(!we||he.defaultPrevented||he.button!==0||he.pointerType==="touch")return;const He=we.getBoundingClientRect(),Ft=we.offsetWidth-we.clientWidth,Rt=Ft>0?Ft:12;he.target===we&&he.clientX>=He.right-Rt&&Ss()}let ni=null;function Si(he){ni=he.touches.length===1?he.touches[0].clientY:null}function rr(he){const we=he.touches.length===1?he.touches[0].clientY:null;we!==null&&ni!==null&&we>ni+2&&!Pi(he)&&Ss(),ni=we}function no(){if(!Ut)return;const he=le.value?.firstElementChild??null;he!==En&&(En&&Ut.unobserve(En),En=he,he&&Ut.observe(he))}function rs(){if(!Ut)return;const he=U.value;he!==jn&&(jn&&Ut.unobserve(jn),jn=he,he&&Ut.observe(he))}function ls(){const he=le.value;ye(),rn&&(rn.disconnect(),he&&rn.observe(he,{childList:!0,subtree:!0,characterData:!0})),Ut&&(Ut.disconnect(),En=null,jn=null,he&&Ut.observe(he),no(),rs()),Ct=he?.scrollHeight??0,Do=he?.clientHeight??0,me()}function No(){no(),ti(),me()}function Ci(){typeof document>"u"||document.visibilityState==="visible"&&V.value&&yn()}const zn=Z(!1);let Io=null;function oi(){zn.value=!0,Io!==null&&clearTimeout(Io),Io=setTimeout(()=>{zn.value=!1},mue)}function Ue(){oi(),i("interrupt")}function Oe(he){he.key==="Escape"&&(s.running||s.working)&&(he.preventDefault(),Ue())}function te(){V.value&&ti()}un(()=>{gt(()=>{typeof MutationObserver=="function"&&(rn=new MutationObserver(No)),typeof ResizeObserver=="function"&&(Ut=new ResizeObserver(()=>{me(),ye();const he=le.value;if(!he)return;const{scrollHeight:we,clientHeight:He}=he,Ft=we>Ct+1,Rt=He<Do-1;Ct=we,Do=He,!qn()&&(Ft||Rt)&&ti()})),ls(),yn(48),K(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ci),document.addEventListener("keydown",Oe)),window.visualViewport?.addEventListener("resize",te)})}),xn(()=>{rn&&rn.disconnect(),Ut&&Ut.disconnect(),So&&Gn(So),Ne&&Gn(Ne),Yn&&Gn(Yn),ue&&Gn(ue),Io!==null&&clearTimeout(Io),m!==null&&(clearTimeout(m),m=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ci),document.removeEventListener("keydown",Oe)),window.visualViewport?.removeEventListener("resize",te)});function Te(){(g.value??p.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:Te}),(he,we)=>(x(),N("section",{class:We(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),ke(fse,{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":P.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:we[0]||(we[0]=He=>i("openChanges")),onCopyAll:we[1]||(we[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:we[2]||(we[2]=He=>h.value?.copyFinalSummary()),onOpenPr:we[3]||(we[3]=He=>e.pr&&i("openPr",e.pr.url)),onRenameSession:we[4]||(we[4]=(He,Ft)=>i("renameSession",He,Ft)),onForkSession:we[5]||(we[5]=He=>i("forkSession",He)),onArchiveSession:we[6]||(we[6]=He=>i("archiveSession",He)),onExportSession:we[7]||(we[7]=He=>i("exportSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),e.conversationToc?(x(),ke(Jce,{key:1,items:R.value,"active-turn-id":q.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:X.value,onSelect:Pn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):re("",!0),_("div",nue,[_("div",{ref:fe,class:We(["panes chat-scroll",{"is-following":V.value,"history-prepending":Fn.value}]),onScrollPassive:St,onWheelPassive:_i,onPointerdownPassive:uo,onTouchstartPassive:Si,onTouchmovePassive:rr},[_("div",{class:We(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),N(Pe,{key:0},[we[55]||(we[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",oue,[_("span",{class:We(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(x(),ke(Ds,{key:0,size:"sm"})):re("",!0),_("span",null,O(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?re("",!0):(x(),N("span",sue,O(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(x(),N("div",iue,[ie(Zt,{text:C(o)("conversation.switchWorkspace")},{default:Ee(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:we[8]||(we[8]=xt(He=>r.value=!r.value,["stop"]))},[ie(Ve,{name:"folder",size:"sm"}),_("span",rue,O(a.value),1),ie(Ve,{class:We(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(x(),N("div",{key:0,class:"ws-pick-backdrop",onClick:we[9]||(we[9]=He=>r.value=!1)})):re("",!0),r.value?(x(),N("div",lue,[(x(!0),N(Pe,null,ot(u.value,He=>(x(),N("button",{key:He.id,type:"button",class:We(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:xt(Ft=>f(He.id),["stop"])},[_("span",cue,O(He.name),1),_("span",uue,O(He.shortPath),1)],10,aue))),128)),d.value>0?(x(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:we[10]||(we[10]=xt(He=>l.value=!l.value,["stop"]))},[_("span",null,O(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):re("",!0),we[54]||(we[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:we[11]||(we[11]=xt(He=>{r.value=!1,i("addWorkspace")},["stop"]))},[ie(Ve,{name:"plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)])])):re("",!0)])):e.starting?re("",!0):(x(),N("button",{key:2,type:"button",class:"empty-add-workspace",onClick:we[12]||(we[12]=He=>i("addWorkspace"))},[ie(Ve,{name:"folder-plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)]))]),ie(L5,{ref_key:"emptyComposerRef",ref:p,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,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Bo,onSteer:we[13]||(we[13]=He=>i("steer",He)),onCommand:we[14]||(we[14]=He=>i("command",He)),onInterrupt:Ue,onUnqueue:we[15]||(we[15]=He=>i("unqueue",He)),onEditQueued:we[16]||(we[16]=He=>i("editQueued",He)),onSetPermission:we[17]||(we[17]=He=>i("setPermission",He)),onSetThinking:we[18]||(we[18]=He=>i("setThinking",He)),onTogglePlan:we[19]||(we[19]=He=>i("togglePlan")),onToggleSwarm:we[20]||(we[20]=He=>i("toggleSwarm")),onToggleGoal:we[21]||(we[21]=He=>i("toggleGoal")),onOpenBtw:we[22]||(we[22]=He=>i("command","/btw")),onCreateGoal:we[23]||(we[23]=He=>i("createGoal",He)),onControlGoal:we[24]||(we[24]=He=>i("controlGoal",He)),onFocusGoal:A,onCompact:we[25]||(we[25]=He=>i("compact")),onPickModel:we[26]||(we[26]=He=>i("pickModel")),onSelectModel:we[27]||(we[27]=He=>i("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),we[56]||(we[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(x(),ke(w5,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"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":V.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:we[28]||(we[28]=He=>i("openFile",He)),onOpenMedia:we[29]||(we[29]=He=>i("openMedia",He)),onCopyConversationCopied:k,onOpenThinking:we[30]||(we[30]=He=>i("openThinking",He)),onOpenCompaction:we[31]||(we[31]=He=>i("openCompaction",He)),onOpenAgent:we[32]||(we[32]=He=>i("openAgent",He)),onOpenToolDiff:we[33]||(we[33]=He=>i("openToolDiff",He)),onEditMessage:ze,onLoadOlderMessages:ss,onUnqueue:we[34]||(we[34]=He=>i("unqueue",He)),onEditQueued:Qe,onReorderQueue:bt},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?re("",!0):(x(),ke(Vce,{key:0,ref:ve,style:Vt(j.value),"session-id":e.sessionId,running:e.running,starting:e.starting,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":v.value,"dock-panel":I.value,"bash-tasks":$.value,"subagent-tasks":L.value,"bash-running":w.value,"subagent-running":E.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ce.value,"question-busy-kind":de.value,"pending-approval":Ae.value,"approval-busy":Le.value,mobile:e.mobile,onToggleDockPanel:we[35]||(we[35]=He=>D(He)),onCloseDockPanel:we[36]||(we[36]=He=>W()),onOpenAgent:we[37]||(we[37]=He=>i("openAgent",He)),onAnswer:Pt,onDismiss:we[38]||(we[38]=He=>i("dismiss",He)),onApproval:Hn,onCancelTask:we[39]||(we[39]=He=>i("cancelTask",He)),onControlGoal:we[40]||(we[40]=He=>i("controlGoal",He)),onSubmit:Bo,onSteer:we[41]||(we[41]=He=>i("steer",He)),onCommand:we[42]||(we[42]=He=>i("command",He)),onInterrupt:Ue,onSetPermission:we[43]||(we[43]=He=>i("setPermission",He)),onSetThinking:we[44]||(we[44]=He=>i("setThinking",He)),onTogglePlan:we[45]||(we[45]=He=>i("togglePlan")),onToggleSwarm:we[46]||(we[46]=He=>i("toggleSwarm")),onToggleGoal:we[47]||(we[47]=He=>i("toggleGoal")),onOpenBtw:we[48]||(we[48]=He=>i("command","/btw")),onCreateGoal:we[49]||(we[49]=He=>i("createGoal",He)),onFocusGoal:A,onCompact:we[50]||(we[50]=He=>i("compact")),onPickModel:we[51]||(we[51]=He=>i("pickModel")),onSelectModel:we[52]||(we[52]=He=>i("selectModel",He))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ie(Tl,{name:"pill"},{default:Ee(()=>[ee.value?(x(),N("button",{key:0,class:"newmsg-pill",style:Vt({bottom:`${se.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:we[53]||(we[53]=He=>vt(!0))},[ie(Ve,{class:"pill-chevron",name:"chevron-down",size:"md"}),Xe(" "+O(C(o)("conversation.newMessages")),1)],12,due)):re("",!0)]),_:1}),ie(Tl,{name:"abort-toast"},{default:Ee(()=>[zn.value?(x(),N("div",fue,[_("span",hue,O(C(o)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),vue=ct(gue,[["__scopeId","data-v-0bbe2565"]]),yue=["aria-selected","onClick"],kue=Ze({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),N("div",{class:We(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(x(!0),N(Pe,null,ot(e.options,i=>(x(),N("button",{key:i.value,class:We(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},O(i.label),11,yue))),128))],2))}}),gs=ct(kue,[["__scopeId","data-v-d1aaccd7"]]),bue={class:"ui-panel-header__title"},xue={key:0,class:"ui-panel-header__sub"},wue=Ze({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-panel-header",{wrap:e.wrap}])},[_("span",bue,O(e.title),1),ie(Zt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(x(),N("span",xue,O(e.subtitle),1)):re("",!0)]),_:1},8,["text"]),$n(t.$slots,"default",{},void 0,!0),e.closable?(x(),ke(Dn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])):re("",!0)],2))}}),Ea=ct(wue,[["__scopeId","data-v-c47879ad"]]),_ue={key:0,class:"fp-empty fp-error"},Sue={key:1,class:"fp-empty"},Cue={key:2,class:"fp-loading"},Aue={class:"fp-path"},Mue={class:"fp-meta"},Eue={key:0,class:"fp-lines"},Tue={class:"fp-size"},Nue={key:3,class:"fp-search"},Iue=["placeholder"],Lue={key:0,class:"fp-search-count"},$ue=["href","aria-label"],Fue={key:1,class:"fp-code"},Oue={class:"fp-line-table"},Rue=["data-line"],Bue={class:"fp-gutter"},Due=["innerHTML"],Pue={key:1,class:"fp-body fp-code"},Hue={class:"fp-line-table"},Wue=["data-line"],zue={class:"fp-gutter"},Uue=["innerHTML"],que={key:2,class:"fp-body"},jue=["srcdoc","title"],Vue={key:1,class:"fp-code"},Kue={class:"fp-line-table"},Gue=["data-line"],Yue={class:"fp-gutter"},Zue=["innerHTML"],Xue={key:3,class:"fp-body fp-pdf-wrap"},Que=["src","title"],Jue={key:1,class:"fp-binary-card"},ede={class:"fp-binary-label"},tde={key:4,class:"fp-body fp-table-wrap"},nde={class:"fp-table"},ode=["data-line"],sde={key:5,class:"fp-body fp-image-wrap"},ide=["src","alt"],rde={key:1,class:"fp-binary-card"},lde={class:"fp-binary-icon"},ade={class:"fp-binary-label"},cde={key:6,class:"fp-body fp-code"},ude={class:"fp-line-table"},dde=["data-line"],fde={class:"fp-gutter"},hde=["innerHTML"],pde={key:7,class:"fp-body fp-binary-wrap"},mde={class:"fp-binary-card"},gde={class:"fp-binary-icon"},vde={class:"fp-binary-label"},yde=Ze({__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}=Et();function o(le,U){const ae=U?U.split("/").filter(Boolean):[];for(const se of le.split("/"))se===""||se==="."||(se===".."?ae.pop():ae.push(se));return ae.join("/")}const s=jt("resolveImage",async le=>le),i=B(()=>{const le=c.file?.path??"",U=le.lastIndexOf("/");return U>0?le.slice(0,U):""});function r(le){if(/^(https?:|data:|blob:)/i.test(le)||le.startsWith("/"))return le;const U=i.value;return U?o(le,U):le}async function l(le){const U=r(le);return s?s(U):U}Nn("resolveImage",l);function a(le){let U=le.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(U)||U.startsWith("/"))return le;for(const se of["#","?"]){const j=U.indexOf(se);j!==-1&&(U=U.slice(0,j))}const ae=i.value;return{...le,path:o(U,ae)}}const c=e,u=t;function d(le){c.openFile?.(a(le))}const f=Z(null),h=B(()=>{const le=c.file;if(!le)return"binary";const U=le.mime??"",ae=le.languageId??"",se=le.path.toLowerCase();return U==="text/markdown"||ae==="markdown"||ae==="md"||se.endsWith(".mdx")?"markdown":U==="application/json"||ae==="json"?"json":U==="text/html"||ae==="html"||se.endsWith(".html")||se.endsWith(".htm")?"html":U==="application/pdf"||se.endsWith(".pdf")?"pdf":U==="text/csv"||ae==="csv"||se.endsWith(".csv")?"csv":U.startsWith("image/")?"image":le.isBinary?"binary":U.startsWith("text/")||ae!==""?"text":"binary"});function p(le){const U=atob(le),ae=Uint8Array.from(U,se=>se.charCodeAt(0));return new TextDecoder().decode(ae)}const g=B(()=>{const le=c.file;if(!le)return"";if(le.encoding==="base64")try{return p(le.content)}catch{return le.content}return le.content}),b=B(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),v=B(()=>c.file?(h.value==="json"?b.value:g.value).split(`
|
|
301
|
-
`):[]),m=B(()=>c.file?h.value==="json"?b.value:g.value:""),y=Z(""),k=Z(0),A=B(()=>{const le=y.value.trim().toLowerCase();if(!le)return[];const U=[];return v.value.forEach((ae,se)=>{ae.toLowerCase().includes(le)&&U.push(se+1)}),U});Je(y,()=>{k.value=0});function $(le,U=!1){le&>(()=>{const ae=f.value?.querySelector(".fp-body"),se=ae?.querySelector(`[data-line="${le}"]`);if(!ae||!se)return;U&&(ae.scrollTop=0);const j=ae.getBoundingClientRect(),J=se.getBoundingClientRect(),ye=J.top-j.top+ae.scrollTop;ae.scrollTop=ye-ae.clientHeight/2+J.height/2})}Je(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function L(le){const U=A.value;U.length!==0&&(k.value=(k.value+le+U.length)%U.length,$(U[k.value]))}function w(le){const U=A.value;return{target:c.line===le,hit:U.includes(le),active:U[k.value]===le}}function E(le){return le<1024?`${le} B`:le<1024*1024?`${(le/1024).toFixed(1)} KB`:`${(le/(1024*1024)).toFixed(1)} MB`}const T=Z(!1),F=Z(!1);function S(){c.file&&Yo(m.value).then(le=>{le&&(T.value=!0,setTimeout(()=>{T.value=!1},1400))})}function I(){c.file&&Yo(c.file.path).then(le=>{le&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const P=Z("preview"),D=Z("preview"),W=Z("fit");function z(le){P.value=le}function R(le){D.value=le}function q(le){W.value=le}Je(h,le=>{P.value=le==="html"?"preview":"source",D.value="preview",W.value="fit"});const K=B(()=>{const le=c.file;return!le||h.value!=="image"?null:le.sourceUrl?le.sourceUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:le.mime==="image/svg+xml"?`data:${le.mime};charset=utf-8,${encodeURIComponent(le.content)}`:null}),X=B(()=>{const le=c.file;return!le||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:null}),ue=B(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,g.value].join(""):"");function me(le){const U=[];let ae="",se=!1;for(let j=0;j<le.length;j++){const J=le[j];J==='"'&&le[j+1]==='"'?(ae+='"',j++):J==='"'?se=!se:J===","&&!se?(U.push(ae),ae=""):ae+=J}return U.push(ae),U}const ne=B(()=>v.value.slice(0,200).map(me));function ce(le){return le.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function de(){const le=c.file;if(!le)return"";const U=le.languageId?.toLowerCase();return U||(le.path.split(".").pop()?.toLowerCase()??"")}function Ae(le){const U=de();let ae=ce(le);return h.value==="json"||U==="json"||U==="jsonc"?(ae=ae.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),ae=ae.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),ae=ae.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ae=ae.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ae):h.value==="html"||U==="html"||U==="xml"||U==="svg"?(ae=ae.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ae=ae.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ae):(ae=ae.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>'),ae=ae.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ae)}function Le(le,U=55){return!le||le.length<=U?le:"…"+le.slice(le.length-U+1)}return(le,U)=>(x(),N("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),N("div",_ue,[_("span",null,O(e.error),1),e.closable?(x(),ke(Ot,{key:0,variant:"secondary",size:"sm",onClick:U[0]||(U[0]=ae=>u("close"))},{default:Ee(()=>[Xe(O(C(n)("filePreview.close")),1)]),_:1})):re("",!0)])):!e.file&&!e.loading?(x(),N("div",Sue,O(C(n)("filePreview.empty")),1)):e.loading?(x(),N("div",Cue,[U[7]||(U[7]=_("span",{class:"spinner"},null,-1)),_("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(x(),N(Pe,{key:3},[ie(Ea,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:U[6]||(U[6]=ae=>u("close"))},{default:Ee(()=>[ie(Zt,{text:e.file.path},{default:Ee(()=>[_("span",Aue,O(Le(e.file.path)),1)]),_:1},8,["text"]),_("span",Mue,[e.file.lineCount?(x(),N("span",Eue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),_("span",Tue,O(E(e.file.size)),1)]),h.value==="html"?(x(),ke(gs,{key:0,"model-value":P.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):re("",!0),h.value==="markdown"?(x(),ke(gs,{key:1,"model-value":D.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":R},null,8,["model-value","options"])):re("",!0),h.value==="image"?(x(),ke(gs,{key:2,"model-value":W.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":q},null,8,["model-value","options"])):re("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),N("div",Nue,[Ln(_("input",{"onUpdate:modelValue":U[1]||(U[1]=ae=>y.value=ae),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Iue),[[_s,y.value]]),y.value.trim()?(x(),N("span",Lue,O(A.value.length),1)):re("",!0),ie(Dn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:U[2]||(U[2]=ae=>L(-1))},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Dn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:U[3]||(U[3]=ae=>L(1))},{default:Ee(()=>[ie(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):re("",!0),ie(Dn,{size:"sm",class:We({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:I},{default:Ee(()=>[F.value?(x(),ke(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),ke(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(x(),ke(Dn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:U[4]||(U[4]=ae=>u("openExternal"))},{default:Ee(()=>[ie(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):re("",!0),e.externalActions?(x(),ke(Dn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:U[5]||(U[5]=ae=>u("reveal"))},{default:Ee(()=>[ie(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):re("",!0),e.downloadUrl?(x(),N("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ie(Ve,{name:"download",size:"md"})],8,$ue)):re("",!0),!e.file.isBinary&&h.value!=="image"?(x(),ke(Dn,{key:7,size:"sm",class:We({copied:T.value}),label:T.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[T.value?(x(),ke(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),ke(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):re("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(x(),N("div",{key:0,class:We(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(x(),ke(Bm,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),N("div",Fue,[_("div",Oue,[(x(!0),N(Pe,null,ot(v.value,(ae,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",Bue,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Ae(ae)},null,8,Due)],10,Rue))),128))])]))],2)):h.value==="json"?(x(),N("div",Pue,[_("div",Hue,[(x(!0),N(Pe,null,ot(v.value,(ae,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",zue,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Ae(ae)},null,8,Uue)],10,Wue))),128))])])):h.value==="html"?(x(),N("div",que,[P.value==="preview"?(x(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ue.value,title:e.file.path},null,8,jue)):(x(),N("div",Vue,[_("div",Kue,[(x(!0),N(Pe,null,ot(v.value,(ae,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",Yue,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Ae(ae)},null,8,Zue)],10,Gue))),128))])]))])):h.value==="pdf"?(x(),N("div",Xue,[X.value?(x(),N("iframe",{key:0,class:"fp-pdf-frame",src:X.value,title:e.file.path},null,8,Que)):(x(),N("div",Jue,[_("span",ede,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),N("div",tde,[_("table",nde,[_("tbody",null,[(x(!0),N(Pe,null,ot(ne.value,(ae,se)=>(x(),N("tr",{key:se,class:We(w(se+1)),"data-line":se+1},[_("th",null,O(se+1),1),(x(!0),N(Pe,null,ot(ae,(j,J)=>(x(),N("td",{key:J},O(j),1))),128))],10,ode))),128))])])])):h.value==="image"?(x(),N("div",sde,[K.value?(x(),N("img",{key:0,src:K.value,alt:e.file.path,class:We(["fp-image",{actual:W.value==="actual"}])},null,10,ide)):(x(),N("div",rde,[_("span",lde,[ie(Ve,{name:"image-off",size:"lg"})]),_("span",ade,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):h.value==="text"?(x(),N("div",cde,[_("div",ude,[(x(!0),N(Pe,null,ot(v.value,(ae,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",fde,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Ae(ae)},null,8,hde)],10,dde))),128))])])):(x(),N("div",pde,[_("div",mde,[_("span",gde,[ie(Ve,{name:"file-off",size:"lg"})]),_("span",vde,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),kde=ct(yde,[["__scopeId","data-v-62bfaf2d"]]),bde={class:"tp"},xde=Ze({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et(),i=Z(null);return Je(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),N("div",bde,[ie(Ea,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),qC=ct(xde,[["__scopeId","data-v-cf9c560b"]]),wde={class:"ap"},_de={key:0,class:"ap-type"},Sde={key:1,class:"ap-reason"},Cde={key:2,class:"ap-field"},Ade={class:"ap-field-body"},Mde={key:3,class:"ap-field"},Ede={class:"ap-field-body ap-live"},Tde={key:4,class:"ap-field"},Nde={class:"ap-field-body ap-progress"},Ide={key:0,class:"ap-call"},Lde={key:1,class:"ap-output"},$de=["onClick"],Fde={key:5,class:"ap-field"},Ode={class:"ap-field-body"},Rde=8,jC=5,VC=2,Bde=Ze({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et(),i=B(()=>(n.member.outputLines??[]).map(g=>g.trimEnd()).filter(g=>g.length>0)),r=B(()=>(n.member.text??"").trimEnd());function l(g){const b=[];let v=null,m=0;for(const y of g)y.startsWith("Calling ")?(v={key:`g${m++}`,call:y,output:[]},b.push(v)):v?v.output.push(y):(v={key:`g${m++}`,call:"",output:[y]},b.push(v));return b}const a=B(()=>l(i.value)),c=Z(new Set);function u(g){return c.value.has(g)}function d(g){const b=new Set(c.value);b.has(g)?b.delete(g):b.add(g),c.value=b}function f(g){return g.output.length-jC-VC}function h(g){switch(g){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=Z(null);return Je(()=>i.value.length+r.value.length,()=>{const g=p.value;!g||!(g.scrollHeight-g.scrollTop-g.clientHeight<24)||gt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(g,b)=>(x(),N("div",wde,[ie(Ea,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:b[0]||(b[0]=v=>o("close"))},{default:Ee(()=>[ie(Ls,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Xe(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),N("div",_de,O(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(x(),N("div",Sde,O(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(x(),N("div",Cde,[b[1]||(b[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",Ade,O(e.member.prompt),1)])):re("",!0),r.value?(x(),N("div",Mde,[b[2]||(b[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",Ede,O(r.value),1)])):re("",!0),a.value.length>0?(x(),N("div",Tde,[b[4]||(b[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",Nde,[(x(!0),N(Pe,null,ot(a.value,v=>(x(),N("div",{key:v.key,class:"ap-group"},[v.call?(x(),N("div",Ide,[b[3]||(b[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Xe(" "+O(v.call),1)])):re("",!0),v.output.length>0?(x(),N("div",Lde,[v.output.length<=Rde||u(v.key)?(x(!0),N(Pe,{key:0},ot(v.output,(m,y)=>(x(),N("div",{key:y,class:"ap-out-line"},O(m),1))),128)):(x(),N(Pe,{key:1},[(x(!0),N(Pe,null,ot(v.output.slice(0,jC),(m,y)=>(x(),N("div",{key:y,class:"ap-out-line"},O(m),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:m=>d(v.key)}," … ("+O(f(v))+" more) ",9,$de),(x(!0),N(Pe,null,ot(v.output.slice(-VC),(m,y)=>(x(),N("div",{key:"t"+y,class:"ap-out-line"},O(m),1))),128))],64))])):re("",!0)]))),128))])])):re("",!0),e.member.summary?(x(),N("div",Fde,[b[5]||(b[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",Ode,O(e.member.summary),1)])):re("",!0)],512)]))}}),Dde=ct(Bde,[["__scopeId","data-v-715bd93e"]]),Pde={class:"diff-lines"},Hde={key:0,class:"hunk-text"},Wde={class:"dl-gutter old"},zde={class:"dl-gutter new"},Ude={class:"dl-sign"},qde={class:"dl-text"},jde=Ze({__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)=>(x(),N("div",Pde,[(x(!0),N(Pe,null,ot(e.lines,(r,l)=>(x(),N("div",{key:l,class:We(["dl",o(r)])},[r.type==="hunk"?(x(),N("span",Hde,O(r.text),1)):(x(),N(Pe,{key:1},[_("span",Wde,O(t(r)),1),_("span",zde,O(n(r)),1),_("span",Ude,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",qde,O(r.text),1)],64))],2))),128))]))}}),F5=ct(jde,[["__scopeId","data-v-2f6bc1cc"]]),Vde={class:"tdp"},Kde={class:"tdp-body"},Gde={key:1,class:"tdp-output"},Yde={key:2,class:"tdp-empty"},Zde=Ze({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Et();return(s,i)=>(x(),N("div",Vde,[ie(Ea,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",Kde,[e.target.lines&&e.target.lines.length>0?(x(),ke(F5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),N("div",Gde,[(x(!0),N(Pe,null,ot(e.target.output,(r,l)=>(x(),N("div",{key:l},O(r),1))),128))])):(x(),N("div",Yde,O(C(o)("diff.noDiff")),1))])]))}}),Xde=ct(Zde,[["__scopeId","data-v-76f2fbca"]]),Qde={class:"sc"},Jde={key:0,class:"sc-empty"},efe={key:2,class:"sc-loading","aria-hidden":"true"},tfe={class:"sc-composer"},nfe=["placeholder"],ofe=["disabled"],sfe=Ze({__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}=Et(),i=B(()=>n.turns.find(m=>m.role==="user")?.text?.trim()??""),r=B(()=>n.title?.trim()||s("sideChat.title")),l=B(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=Z(""),c=Z(null),u=Z(null);function d(){const v=a.value.trim();v&&(o("send",v),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const v=u.value;v&&(v.scrollTop=v.scrollHeight)}const h=B(()=>{const v=n.turns;if(v.length===0)return"0";const m=v.at(-1),y=m.thinking?.length??0,k=m.tools?.reduce((A,$)=>A+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${v.length}:${m.text.length}:${y}:${k}`});Je(h,async()=>{!n.running&&!n.sending||(await gt(),f())});const p=B(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),d())}function b(){const v=c.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}return(v,m)=>(x(),N("div",Qde,[ie(Ea,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:m[0]||(m[0]=y=>o("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),N("div",Jde,O(C(s)("sideChat.empty")),1)):(x(),ke(w5,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(x(),N("div",efe,[ie(b5)])):re("",!0)],512),_("div",tfe,[Ln(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":m[1]||(m[1]=y=>a.value=y),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:b,onKeydown:g},null,40,nfe),[[_s,a.value]]),ie(Zt,{text:C(s)("sideChat.send")},{default:Ee(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(Ve,{name:"arrow-right",size:"sm"})],8,ofe)]),_:1},8,["text"])])]))}}),ife=ct(sfe,[["__scopeId","data-v-f973798f"]]),rfe={class:"changes-pane"},lfe={class:"dv-path"},afe={class:"diff-head"},cfe={class:"back-label"},ufe={key:0,class:"empty-state"},dfe={key:1,class:"dv-lines-wrap"},ffe={key:2,class:"empty-state"},hfe={class:"dv-change-count"},pfe={class:"ch-head"},mfe={class:"br-label"},gfe={class:"br-name"},vfe={key:0,class:"sync-info"},yfe={key:0,class:"ahead"},kfe={key:0,class:"behind"},bfe={key:1,class:"empty-head"},xfe={key:0,class:"ch-list"},wfe=["onClick"],_fe={class:"fpath"},Sfe={key:1,class:"ch-list ch-tree"},Cfe={class:"tree-list"},Afe=["onClick"],Mfe={class:"tree-name"},Efe=["onClick"],Tfe={class:"tree-name"},Nfe={key:2,class:"empty-state"},Ife={key:3,class:"empty-state"},Lfe=Ze({__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}=Et(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=B(()=>o.gitInfo!==null),u=B(()=>o.changes.length>0),d=B(()=>(o.selectedDiffPath??null)!==null),f=B(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=B(()=>o.fileDiff??[]),p=B(()=>o.fileDiffLoading===!0);function g(F){s("open",F)}function b(){s("back")}function v(){s("close")}const m=Z("list");function y(F){m.value=F}function k(F){const S={children:[]},I=[...F].sort((P,D)=>P.path.localeCompare(D.path));for(const P of I){const D=P.path.split("/");let W=S;for(let z=0;z<D.length;z++){const R=D[z],q=z===D.length-1,K=D.slice(0,z+1).join("/");let X=W.children.find(ue=>ue.name===R&&ue.kind===(q?"file":"folder"));X||(X={name:R,path:K,kind:q?"file":"folder",status:q?P.status:void 0,children:[]},W.children.push(X)),W=X}}return S.children}const A=B(()=>k(o.changes)),$=Z(new Set);function L(F){return!$.value.has(F)}const w=B(()=>{const F=[];function S(I,P){for(const D of I)F.push({node:D,depth:P}),D.kind==="folder"&&L(D.path)&&S(D.children,P+1)}return S(A.value,0),F});function E(F){const S=new Set($.value);S.has(F.path)?S.delete(F.path):S.add(F.path),$.value=S}function T(F){return`${16+F*16}px`}return(F,S)=>(x(),N("div",rfe,[f.value?(x(),N(Pe,{key:0},[ie(Ea,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[ie(Zt,{text:e.selectedDiffPath??""},{default:Ee(()=>[_("span",lfe,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",afe,[e.hideBack?re("",!0):(x(),ke(Ot,{key:0,variant:"ghost",size:"sm",onClick:b},{default:Ee(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",cfe,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(x(),N("div",ufe,O(C(n)("diff.loading")),1)):h.value.length>0?(x(),N("div",dfe,[ie(F5,{lines:h.value},null,8,["lines"])])):(x(),N("div",ffe,O(C(n)("diff.noDiff")),1))],64)):(x(),N(Pe,{key:1},[ie(Ea,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[_("span",hfe,O(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(gs,{"model-value":m.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":y},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",pfe,[c.value?(x(),N(Pe,{key:0},[_("span",mfe,O(C(n)("diff.branch")),1),_("span",gfe,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),N("span",vfe,[ie(Zt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(x(),N("span",yfe,"↑"+O(e.gitInfo.ahead),1)):re("",!0)]),_:1},8,["text"]),ie(Zt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(x(),N("span",kfe,"↓"+O(e.gitInfo.behind),1)):re("",!0)]),_:1},8,["text"])])):re("",!0)],64)):(x(),N("span",bfe,O(C(n)("diff.empty")),1))]),u.value&&m.value==="list"?(x(),N("div",xfe,[(x(!0),N(Pe,null,ot(e.changes,I=>(x(),ke(Zt,{key:I.path,text:I.path},{default:Ee(()=>[_("button",{type:"button",class:"ch-row",onClick:P=>g(I.path)},[_("span",{class:We(["badge",i(I.status)])},O(l(I.status)),3),_("span",_fe,O(a(I.path)),1)],8,wfe)]),_:2},1032,["text"]))),128))])):u.value&&m.value==="tree"?(x(),N("div",Sfe,[_("ul",Cfe,[(x(!0),N(Pe,null,ot(w.value,({node:I,depth:P})=>(x(),N("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(x(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:Vt({paddingLeft:T(P)}),onClick:D=>E(I)},[ie(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",Mfe,O(I.name),1)],12,Afe)):(x(),ke(Zt,{key:1,text:I.path},{default:Ee(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Vt({paddingLeft:T(P)}),onClick:D=>g(I.path)},[_("span",{class:We(["badge",i(I.status)])},O(l(I.status)),3),_("span",Tfe,O(I.name),1)],12,Efe)]),_:2},1032,["text"]))]))),128))])])):c.value?(x(),N("div",Nfe,O(C(n)("diff.clean")),1)):(x(),N("div",Ife,O(C(n)("diff.empty")),1))],64))]))}}),$fe=ct(Lfe,[["__scopeId","data-v-7778610a"]]);function Wk(e,t){let n=null;un(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),ho(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Ffe=["type","value","placeholder","disabled","readonly"],Ofe=Ze({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=Z();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(x(),N("input",{ref_key:"el",ref:s,class:We(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,Ffe))}}),zc=ct(Ofe,[["__scopeId","data-v-340f0da2"]]),Rfe={class:"search-wrap"},Bfe={key:0,class:"tab-strip"},Dfe={key:1,class:"state-row"},Pfe={key:2,class:"state-row unavail"},Hfe={key:3,class:"model-list"},Wfe=["aria-selected","onClick","onMouseenter"],zfe={class:"check"},Ufe={class:"model-main"},qfe={class:"model-name"},jfe={class:"model-id"},Vfe={key:0,class:"caps"},Kfe={class:"model-provider"},Gfe={class:"model-ctx"},Yfe={key:0,class:"empty"},Zfe={class:"footer-hint"},Xfe=Ze({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=B(()=>new Set(o.starredIds??[]));function r(y){return i.value.has(y)}const l=Z(""),a=Z(null),c=Z(null),u=Z("all");Wk(c,a);const d=B(()=>{const y=new Set,k=[{id:"all",label:n("model.allTab")}];for(const A of o.models)y.has(A.provider)||(y.add(A.provider),k.push({id:A.provider,label:A.provider}));return k}),f=B(()=>{const y=l.value.toLowerCase().trim(),k=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const $=(A.displayName??A.model).toLowerCase().includes(y),L=A.provider.toLowerCase().includes(y),w=A.id.toLowerCase().includes(y);return!y||$||L||w});return u.value!=="all"?k:k.sort((A,$)=>{const L=r(A.id)?1:0;return(r($.id)?1:0)-L})}),h=B(()=>f.value),p=Z(0);Je([l,u],()=>{p.value=0}),Je(d,y=>{y.some(k=>k.id===u.value)||(u.value="all")}),Je(h,y=>{p.value=Math.min(p.value,Math.max(y.length-1,0))});function g(y){if(y.key==="Escape"){s("close");return}if(y.key==="ArrowDown")y.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(y.key==="ArrowUp")y.preventDefault(),p.value=Math.max(p.value-1,0);else if(y.key==="Enter"){const k=h.value[p.value];k&&s("select",k.id)}}un(()=>{document.addEventListener("keydown",g)}),xn(()=>{document.removeEventListener("keydown",g)});function b(y){s("select",y)}function v(y){return h.value.indexOf(y)}function m(y){u.value=y}return(y,k)=>(x(),ke(zr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:k[1]||(k[1]=A=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",Rfe,[ie(zc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(x(),N("div",Bfe,[(x(!0),N(Pe,null,ot(d.value,A=>(x(),ke(Ot,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:$=>m(A.id)},{default:Ee(()=>[Xe(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):re("",!0),e.loading?(x(),N("div",Dfe,[ie(Ds,{size:"sm"}),_("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(x(),N("div",Pfe,[ie(Ve,{name:"alert-triangle",size:"lg"}),_("span",null,O(C(n)("model.unavailable")),1)])):(x(),N("div",Hfe,[(x(!0),N(Pe,null,ot(h.value,A=>(x(),N("div",{key:A.id,class:We(["model-row",{"is-current":A.id===e.current,"is-selected":v(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:$=>b(A.id),onMouseenter:$=>p.value=v(A)},[_("span",zfe,[A.id===e.current?(x(),ke(Ve,{key:0,name:"check",size:"sm"})):re("",!0)]),_("span",Ufe,[_("span",qfe,O(A.displayName??A.model),1),_("span",jfe,O(A.id),1),A.capabilities&&A.capabilities.length>0?(x(),N("span",Vfe,[(x(!0),N(Pe,null,ot(A.capabilities,$=>(x(),ke(Ls,{key:$,variant:"info",size:"sm"},{default:Ee(()=>[Xe(O($),1)]),_:2},1024))),128))])):re("",!0)]),_("span",Kfe,O(A.provider),1),_("span",Gfe,O(C(n)("model.contextSuffix",{size:C(or)(A.maxContextSize)})),1),ie(Dn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:xt($=>s("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(x(),ke(Ve,{key:0,name:"star",size:"md"})):(x(),ke(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Wfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),N("div",Yfe,O(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):re("",!0)])),_("div",Zfe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Qfe=ct(Xfe,[["__scopeId","data-v-56cefe51"]]),Jfe={key:0,class:"ui-field__label"},ehe={key:1,class:"ui-field__error"},the={key:2,class:"ui-field__hint"},nhe=Ze({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-field",{"has-error":!!e.error}])},[e.label?(x(),N("label",Jfe,O(e.label),1)):re("",!0),$n(t.$slots,"default",{},void 0,!0),e.error?(x(),N("span",ehe,O(e.error),1)):e.hint?(x(),N("span",the,O(e.hint),1)):re("",!0)],2))}}),lh=ct(nhe,[["__scopeId","data-v-49bce958"]]),ohe=["value","disabled"],she=Ze({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(x(),N("select",{class:We(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[$n(s.$slots,"default",{},void 0,!0)],42,ohe))}}),jv=ct(she,[["__scopeId","data-v-92a040fd"]]),ihe={class:"prov-list"},rhe={key:0,class:"state-row"},lhe={key:1,class:"state-row unavail"},ahe={key:2,class:"empty"},che={class:"prov-info"},uhe={class:"prov-type"},dhe={key:0,class:"prov-url"},fhe={class:"prov-meta"},hhe={key:0},phe={class:"prov-actions"},mhe={key:0,class:"add-section"},ghe={key:0,class:"add-btns"},vhe={key:1,class:"add-form"},yhe=["value"],khe={key:0,class:"add-error"},bhe={class:"form-btns"},xhe={class:"footer-hint"},whe=Ze({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Et(),o=Z(null);Wk(o);const s=t;function i(b){s("delete",b)}const r=Z(!1),l=Ro({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=Z(""),c=["moonshot","anthropic","openai","custom"];function u(){l.type="moonshot",l.apiKey="",l.baseUrl="",l.defaultModel="",a.value="",r.value=!0}function d(){r.value=!1}function f(){if(!l.apiKey.trim()){a.value=n("providers.apiKeyRequired");return}a.value="",s("add",{type:l.type,apiKey:l.apiKey.trim()||void 0,baseUrl:l.baseUrl.trim()||void 0,defaultModel:l.defaultModel.trim()||void 0}),r.value=!1}function h(b){if(b.key==="Escape"){if(r.value){d();return}s("close")}}un(()=>document.addEventListener("keydown",h)),xn(()=>document.removeEventListener("keydown",h));function p(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function g(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(x(),ke(zr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:v[6]||(v[6]=m=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",ihe,[e.loading?(x(),N("div",rhe,[ie(Ds,{size:"sm"}),_("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(x(),N("div",lhe,[ie(Ve,{name:"alert-triangle",size:"md"}),_("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),N("div",ahe,O(C(n)("providers.empty")),1)):(x(!0),N(Pe,{key:3},ot(e.providers,m=>(x(),N("div",{key:m.id,class:"prov-row"},[ie(Zt,{text:g(m.status)},{default:Ee(()=>[_("span",{class:We(["status-dot",{"status-dot--empty":m.status!=="connected"&&m.status!=="error"}]),style:Vt(m.status==="connected"||m.status==="error"?{background:p(m.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",che,[_("span",uhe,O(m.type),1),m.baseUrl?(x(),N("span",dhe,O(m.baseUrl),1)):re("",!0),_("span",fhe,[ie(Ls,{variant:m.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Xe(O(m.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),m.models&&m.models.length>0?(x(),N("span",hhe," · "+O(C(n)("providers.modelCount",{count:m.models.length})),1)):re("",!0)])]),_("div",phe,[ie(Zt,{text:C(n)("providers.refreshTitle",{type:m.type})},{default:Ee(()=>[ie(Ot,{variant:"secondary",size:"sm",onClick:y=>s("refresh",m.id)},{default:Ee(()=>[Xe(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(Zt,{text:C(n)("providers.deleteTitle",{type:m.type})},{default:Ee(()=>[ie(Ot,{variant:"danger-soft",size:"sm",onClick:y=>i(m.id)},{default:Ee(()=>[Xe(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?re("",!0):(x(),N("div",mhe,[r.value?(x(),N("div",vhe,[ie(lh,{label:C(n)("providers.fieldType")},{default:Ee(()=>[ie(jv,{modelValue:l.type,"onUpdate:modelValue":v[2]||(v[2]=m=>l.type=m)},{default:Ee(()=>[(x(),N(Pe,null,ot(c,m=>_("option",{key:m,value:m},O(m),9,yhe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(lh,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[ie(zc,{modelValue:l.apiKey,"onUpdate:modelValue":v[3]||(v[3]=m=>l.apiKey=m),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ie(lh,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[ie(zc,{modelValue:l.baseUrl,"onUpdate:modelValue":v[4]||(v[4]=m=>l.baseUrl=m),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(lh,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[ie(zc,{modelValue:l.defaultModel,"onUpdate:modelValue":v[5]||(v[5]=m=>l.defaultModel=m),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(x(),N("div",khe,O(a.value),1)):re("",!0),_("div",bhe,[ie(Ot,{variant:"primary",size:"sm",onClick:f},{default:Ee(()=>[Xe(O(C(n)("providers.add")),1)]),_:1}),ie(Ot,{variant:"secondary",size:"sm",onClick:d},{default:Ee(()=>[Xe(O(C(n)("common.cancel")),1)]),_:1})])])):(x(),N("div",ghe,[ie(Ot,{variant:"secondary",size:"sm",onClick:v[0]||(v[0]=m=>s("openLogin","moonshot"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Xe(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),ie(Ot,{variant:"secondary",size:"sm",onClick:v[1]||(v[1]=m=>s("openLogin","anthropic"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Xe(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Ot,{variant:"primary",size:"sm",onClick:u},{default:Ee(()=>[ie(Ve,{name:"plus",size:"sm"}),Xe(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),_("div",xhe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),_he=ct(whe,[["__scopeId","data-v-cf73278e"]]),She={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Che={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Ahe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},pg=Ze({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(x(),N("svg",She,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(x(),N("svg",Che,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(x(),N("svg",Ahe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Mhe={key:0,class:"center-body"},Ehe={class:"center-text"},The={key:1,class:"nb"},Nhe={class:"nb-lead"},Ihe=["href"],Lhe={class:"nb-or"},$he={class:"nb-fallback"},Fhe={class:"nb-fb-text"},Ohe=["href"],Rhe={class:"nb-code-row"},Bhe={class:"nb-code"},Dhe={class:"nb-status"},Phe={class:"nb-status-text"},Hhe={class:"nb-countdown"},Whe={key:2,class:"center-body"},zhe={class:"center-text success-text"},Uhe={class:"center-hint"},qhe={class:"center-body"},jhe={class:"center-text err-text"},Vhe={class:"center-hint"},Khe={class:"actions"},Ghe={class:"center-body"},Yhe={class:"center-text warn-text"},Zhe={class:"center-hint"},Xhe={class:"actions"},Qhe=3,Jhe=Ze({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Et(),o=Z(!0),s=t,i=e,r=Z("starting"),l=Z(!1),a=Z(null),c=Z(0),u=Z(!1);let d=null,f=null,h=0;un(async()=>{await p()}),xn(()=>{v()});async function p(){v(),a.value=null,l.value=!1,h=0,r.value="starting";const $=await i.onStartOAuthLogin();if(!$){r.value="error";return}if($.status==="authenticated"){v(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:$.flowId,verificationUri:$.verificationUri,verificationUriComplete:$.verificationUriComplete,userCode:$.userCode,expiresIn:$.expiresIn,interval:$.interval},c.value=$.expiresIn,r.value="device-code",g(),b($.interval)}function g(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function b($){d&&clearTimeout(d),d=setTimeout(async()=>{const L=await i.onPollOAuthLogin();if(L===null){if(h+=1,h>=Qhe){v(),l.value=!0,r.value="error";return}b($);return}h=0,L.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):L.status==="expired"||L.status==="cancelled"?(v(),r.value="expired"):b($)},$*1e3)}function v(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function m(){await p()}async function y(){!a.value||!await Yo(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function k(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A($){const L=Math.floor($/60),w=$%60;return`${L}:${String(w).padStart(2,"0")}`}return($,L)=>(x(),ke(zr,{open:o.value,"onUpdate:open":L[0]||(L[0]=w=>o.value=w),title:C(n)("login.title"),"close-on-overlay":!1,onClose:k},{default:Ee(()=>[r.value==="starting"?(x(),N("div",Mhe,[ie(Ds,{size:"md"}),_("span",Ehe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(x(),N("div",The,[_("div",Nhe,O(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Xe(O(C(n)("login.authorizeInBrowser"))+" ",1),ie(Ve,{name:"external-link",size:"sm"})],8,Ihe),_("div",Lhe,O(C(n)("login.orDivider")),1),_("div",$he,[_("div",Fhe,[Xe(O(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(a.value.verificationUri),9,Ohe),Xe(O(C(n)("login.fallbackSuffix")),1)]),_("div",Rhe,[_("span",Bhe,O(a.value.userCode),1),ie(Ot,{class:We(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:y},{default:Ee(()=>[u.value?(x(),N(Pe,{key:0},[ie(Ve,{name:"check",size:"sm"}),Xe(" "+O(C(n)("login.copied")),1)],64)):(x(),N(Pe,{key:1},[ie(Ve,{name:"copy",size:"sm"}),Xe(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",Dhe,[ie(Ds,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",Phe,O(C(n)("login.waitingAutoClose")),1),_("span",Hhe,O(A(c.value)),1)])])):r.value==="success"?(x(),N("div",Whe,[ie(pg,{kind:"success"}),_("span",zhe,O(C(n)("login.success")),1),_("span",Uhe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),N(Pe,{key:3},[_("div",qhe,[ie(pg,{kind:"expired"}),_("span",jhe,O(C(n)("login.expiredTitle")),1),_("span",Vhe,O(C(n)("login.expiredHint")),1)]),_("div",Khe,[ie(Ot,{variant:"primary",onClick:m},{default:Ee(()=>[Xe(O(C(n)("login.retry")),1)]),_:1}),ie(Ot,{variant:"secondary",onClick:k},{default:Ee(()=>[Xe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(x(),N(Pe,{key:4},[_("div",Ghe,[ie(pg,{kind:"error"}),_("span",Yhe,O(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",Zhe,O(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",Xhe,[ie(Ot,{variant:"primary",onClick:m},{default:Ee(()=>[Xe(O(C(n)("login.retry")),1)]),_:1}),ie(Ot,{variant:"secondary",onClick:k},{default:Ee(()=>[Xe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):re("",!0)]),_:1},8,["open","title"]))}}),epe=ct(Jhe,[["__scopeId","data-v-8308a28f"]]);function tpe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function npe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function ope(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,activeRoot:s,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(o),a=new Map;for(const h of t)l.has(h.root)||a.has(h.root)||a.set(h.root,{...h});for(const h of n){const p=h.cwd;p&&(l.has(p)||a.has(p)||a.set(p,{id:h.workspaceId??p,root:p,name:tpe(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=npe(t,h);c.set(p,(c.get(p)??0)+1)}const u=[...new Set(t.filter(h=>!l.has(h.root)).map(h=>h.root))],d=[...a.keys()].filter(h=>!u.includes(h));d.sort((h,p)=>h.localeCompare(p));const f=[];for(const h of[...u,...d]){const p=a.get(h),g=c.get(p.id)??c.get(p.root)??0,b=r[p.id]===!1?g:Math.max(p.sessionCount,g);let v=p.branch;!v&&i&&s===p.root&&(v=i),f.push({...p,sessionCount:b,branch:v})}return f}function spe(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function KC(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function ipe(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function rpe(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 lpe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function ape(e){return lpe.has(e.type)}const cpe=50,upe=100,Vv=32*1024,dpe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,cpe)},cancelTask(e){clearTimeout(e)}};function fpe(e,t,n={}){const o=n.scheduler??dpe,s=Math.max(1,Math.floor(n.maxItemsPerSlice??upe)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const g=()=>{if(u||l!==null||a!==null||d()===0)return;const v=++c,m=()=>{v===c&&p()};l=o.requestFrame(m),a=o.requestTask(m)};p=()=>{f();let v=0;for(;!u&&v<s&&r<i.length;){const m=i[r++];e(m),v+=1}h(),g()};const b=(v=>{if(!u){if(t(v)){const m=i.length>r?i.at(-1):void 0,y=m===void 0?void 0:n.coalesce?.(m,v);y===void 0?i.push(v):i[i.length-1]=y,g();return}if(d()===0){e(v);return}i.push(v),p()}});return b.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},b.discard=v=>{if(u||d()===0)return;let m=r;for(let y=r;y<i.length;y+=1){const k=i[y];v(k)||(i[m++]=k)}i.length=m,h(),d()===0?f():g()},b.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},b}function Kv(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function hpe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=Kv(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=Vv)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+Vv,o.value.length);r<o.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function ppe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=Kv(e.appEvent),i=Kv(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>Vv)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const O5=["blue","mono"],R5=["light","dark","system"],B5=14,mpe=12,gpe=20;function vpe(){const e=lo($t.accent);return e&&O5.includes(e)?e:"blue"}function ype(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function kpe(){const e=lo($t.colorScheme);return e&&R5.includes(e)?e:"system"}function bpe(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 zk(e){return Number.isFinite(e)?Math.min(gpe,Math.max(mpe,Math.round(e))):B5}function xpe(){const e=lo($t.uiFontSize);return e===null?B5:zk(Number(e))}function wpe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${zk(e)}px`)}const Uk=Z(kpe()),qk=Z(vpe()),jk=Z(xpe());Je(Uk,bpe,{immediate:!0});Je(qk,ype,{immediate:!0});Je(jk,wpe,{immediate:!0});function _pe(e){R5.includes(e)&&(Uk.value=e,po($t.colorScheme,e))}function Spe(e){O5.includes(e)&&(qk.value=e,po($t.accent,e))}function Cpe(e){const t=zk(e);jk.value=t,po($t.uiFontSize,String(t))}const Ape=600,Mpe=250,qm=250,Epe=1e3,Tpe=160,Rp=Z(!1);let ha=[],va=null,Bp=-qm;function Npe(){ha=[],Bp=-qm,Rp.value=!1,va!==null&&(clearTimeout(va),va=null)}function Ipe(){Rp.value=!0,va!==null&&clearTimeout(va),va=setTimeout(()=>{va=null,ha=[],Bp=-qm,Rp.value=!1},Epe)}function Lpe(e){if(e<=0)return;const t=Date.now();ha.push({time:t,chars:e});const n=t-Ape;if(ha=ha.filter(l=>l.time>=n),t-Bp<qm)return;Bp=t;const o=ha[0]?.time??t,s=Math.max(t-o,Mpe);ha.reduce((l,a)=>l+a.chars,0)/s*1e3>=Tpe&&Ipe()}function D5(){return{colorScheme:Uk,accent:qk,uiFontSize:jk,fastMoon:Rp,setColorScheme:_pe,setAccent:Spe,setUiFontSize:Cpe,resetFastMoon:Npe,recordMoonDelta:Lpe}}function $pe(e,t,n){return e==="idle"&&!t&&!n}function Vk(e,t){const n=lo(e);return n===null?t:n==="1"}const Kk=Z(Vk($t.notifyOnComplete,!0)),Gk=Z(Vk($t.notifyOnQuestion,!1)),Yk=Z(Vk($t.notifyOnApproval,!1)),Zk=Z(typeof Notification<"u"?Notification.permission:"denied"),Fpe="/favicon.ico";async function Xk(e,t,n){if(!n){e.value=!1,po(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}Zk.value=o,o==="granted"&&(e.value=!0,po(t,"1"))}function Ope(e){return Xk(Kk,$t.notifyOnComplete,e)}function Rpe(e){return Xk(Gk,$t.notifyOnQuestion,e)}function Bpe(e){return Xk(Yk,$t.notifyOnApproval,e)}function Qk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Dpe(e){return{title:_n.global.t("settings.notifyTitle"),body:Qk(e,_n.global.t("settings.notifyFallback"))}}function Ppe(e,t){return{title:_n.global.t("settings.notifyQuestionTitle"),body:Qk(t,e,_n.global.t("settings.notifyQuestionFallback"))}}function Hpe(e,t){return{title:_n.global.t("settings.notifyApprovalTitle"),body:Qk(t,e,_n.global.t("settings.notifyApprovalFallback"))}}function Jk(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{Zk.value=i,i==="granted"&&GC(t,n,o)});return}GC(t,n,o)}}function GC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Fpe});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Wpe(e,t){Jk(Kk.value,t,Dpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function zpe(e){Jk(Gk.value,e,Ppe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function Upe(e){Jk(Yk.value,e,Hpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function qpe(){return{notifyOnComplete:Kk,notifyOnQuestion:Gk,notifyOnApproval:Yk,notifyPermission:Zk,setNotifyOnComplete:Ope,setNotifyOnQuestion:Rpe,setNotifyOnApproval:Bpe,maybeNotifyCompletion:Wpe,maybeNotifyQuestion:zpe,maybeNotifyApproval:Upe}}function jpe(){return lo($t.soundOnComplete)==="1"}const iu=Z(jpe());function Vpe(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let mg=null;function P5(){const e=Vpe();if(!e)return null;if(mg===null)try{mg=new e}catch{return null}return mg}function H5(){if(!iu.value)return;const e=P5();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 YC=!1;function Kpe(){if(YC||typeof window>"u")return;YC=!0;const e=()=>{H5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Kpe();function Gpe(e){iu.value=e,po($t.soundOnComplete,e?"1":"0"),e&&H5()}function ZC(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 e2(){const e=P5();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{ZC(e,880,0,.16,.18),ZC(e,1320,.1,.22,.16),Ar("sound: chime scheduled",{state:e.state})}catch(t){Ar("sound: failed to play",{error:String(t)})}}function Ype(){iu.value&&e2()}function Zpe(){iu.value&&e2()}function Xpe(){iu.value&&e2()}function Qpe(){return{soundOnComplete:iu,setSoundOnComplete:Gpe,maybePlayCompletionSound:Ype,maybePlayQuestionSound:Zpe,maybePlayApprovalSound:Xpe}}const Jpe=1e3,eme=4096,XC=32*1024;function tme(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await dt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:KC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],g=dt(),b=new Map;if(await Promise.all(p.map(async m=>{if((m.status==="completed"||m.status==="failed"||m.status==="cancelled")&&!s.has(m.id)&&!((m.outputLines?.length??0)>0))try{const k=await g.getTask(f,m.id,{withOutput:!0,outputBytes:XC});k.outputPreview!==void 0&&b.set(m.id,{preview:k.outputPreview,bytes:k.outputBytes}),s.add(m.id)}catch{}})),b.size===0)return;const v=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:v.map(m=>{const y=b.get(m.id)??(m.backgroundTaskId!==void 0?b.get(m.backgroundTaskId):void 0);return y?{...m,outputPreview:y.preview,outputBytes:y.bytes}:m})}}async function l(f){if(e.activeSessionId!==f)return;const h=dt();let p;try{p=await h.listTasks(f)}catch{return}const g=new Map;await Promise.all(p.map(async y=>{const k=y.status==="running",A=y.status==="completed"||y.status==="failed"||y.status==="cancelled";if(!(!k&&!A)&&!(A&&(s.has(y.id)||(y.outputLines?.length??0)>0)))try{const $=await h.getTask(f,y.id,{withOutput:!0,outputBytes:k?eme:XC});$.outputPreview!==void 0&&g.set(y.id,{preview:$.outputPreview,bytes:$.outputBytes}),A&&s.add(y.id)}catch{}}));const b=e.tasksBySession[f]??[],v=new Map(b.map(y=>[y.id,y])),m=p.map(y=>{const k=v.get(y.id),A=g.get(y.id);return{...y,outputLines:k?.outputLines,text:k?.text,outputPreview:A?.preview??k?.outputPreview,outputBytes:A?.bytes??k?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:KC(m,b)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Jpe))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=Z(0);let d=null;return Je(()=>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}),Je(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,g)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(m=>m.status==="running")||c()},1500):c(),g(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:i}}function nme(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 ome(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
|
|
302
|
-
`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&nme(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 Gv="/sessions/";function QC(e){const{pathname:t}=e;if(!t.startsWith(Gv))return;const n=t.slice(Gv.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function sme(e){return e===void 0||e.length===0?"/":`${Gv}${encodeURIComponent(e)}`}const ime=50,Yv=5,rme=40402,lme=40410,ame=40902,cme=2e3;function gg(e){return nr(e)&&e.code===ame}const ume=40904;function dme(e){return nr(e)&&e.code===ume}const ra=Ro({}),ah=Ro({}),vg=Ro({}),Vi=Ro(new Set),jm=new Map,Ta=new Map,Dp=new Map;let fme=0;function hme(e){return{generation:jm.get(e)??0,pending:(Ta.get(e)?.size??0)>0}}function Zv(e){const t=++fme;jm.set(e,t);const n=Ta.get(e)??new Set;return n.add(t),Ta.set(e,n),t}function Xv(e,t){const n=Ta.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Ta.delete(e);const o=Dp.get(e);Dp.delete(e),o?.()}function pme(e){jm.delete(e),Ta.delete(e),Dp.delete(e)}function mme(e,t){return!t.pending&&t.generation===(jm.get(e)??0)}function gme(e,t){if((Ta.get(e)?.size??0)===0){t();return}Dp.set(e,t)}function vme(e,t){const{t:n}=_n.global,{confirm:o}=Zd(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:g,updateSessionMessages:b,nextOptimisticMsgId:v,getEventConn:m,syncSessionFromSnapshot:y,reopenSession:k,hasLoadedMessages:A,refreshSessionStatus:$,refreshSessionGoal:L,persistSessionProfile:w,mergedWorkspaces:E,workspacesView:T,status:F,workspaceIdForSession:S,savePermissionToStorage:I,savePlanModeToStorage:P,saveSwarmModeToStorage:D,saveGoalModeToStorage:W,draftModes:z,saveUnread:R,saveActiveWorkspaceToStorage:q,saveHiddenWorkspacesToStorage:K,goalErrorMessage:X,resetFastMoon:ue,initialized:me,connectIssue:ne,selectedDiffPath:ce,fileDiffLines:de,fileDiffLoading:Ae}=t;let Le=!1;async function le(Q){if(e.messagesLoadingMoreBySession[Q])return;const be=e.messagesBySession[Q];if(!be||be.length===0)return;const Se=be[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!1};try{const Fe=await dt().listMessages(Q,{beforeId:Se,pageSize:ime}),Ye=[...Fe.items].reverse();b(Q,st=>[...Ye,...st]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[Q]:Fe.hasMore}}catch(Fe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!0},l("loadOlderMessages",Fe,{sessionId:Q})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!1}}}function U(Q){s.loadTasksForSession(Q),j(Q),$(Q),L(Q),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,Q)||r.loadSkillsForSession(Q)}async function ae(Q){const be=e.activeSessionId;if(be){ce.value=Q,de.value=[],Ae.value=!0;try{const Fe=await dt().getFileDiff(be,Q);if(ce.value!==Q)return;de.value=ome(Fe.diff)}catch(Se){ce.value===Q&&(de.value=[]),console.warn("[loadFileDiff] diff unavailable for",Q,Se)}finally{ce.value===Q&&(Ae.value=!1)}}}function se(){ce.value=null,de.value=[],Ae.value=!1}async function j(Q){try{const Se=await dt().getGitStatus(Q);e.gitStatusBySession={...e.gitStatusBySession,[Q]:Se}}catch{}}async function J(){try{const be=await dt().getAuth();return e.authReady=be.ready,e.defaultModel=be.defaultModel,e.managedProviderStatus=be.managedProvider?.status??null,ne.value=null,"proceed"}catch(Q){return nr(Q)&&(Q.code===401||Q.code===v5)?(ne.value=null,"server-auth-required"):(ne.value=(Q instanceof Error?Q.message:String(Q)).slice(0,140),"retry")}}async function ye(){let Q=!0;for(;;){const be=await J();if(be!=="retry")return be;Q&&(ne.value=null,Q=!1),await new Promise(Se=>{setTimeout(Se,cme)})}}async function fe(){try{const Q=dt();e.config=await Q.getConfig()}catch{}}async function ve(Q){try{const Se=await dt().setConfig(Q);return e.config=Se,e.defaultModel=Se.defaultModel??null,!0}catch(be){return l("setConfig",be),!1}}const V=100,ee=30,pe=720*60*1e3;async function Ce(){const Q=dt(),be=[];let Se,Fe;for(;;){let Ye;try{Ye=await Q.listSessions({pageSize:V,beforeId:Se,excludeEmpty:!0})}catch(st){if(be.length===0)throw st;Fe=st;break}if(be.push(...Ye.items),!Ye.hasMore||Ye.items.length===0)break;Se=Ye.items[Ye.items.length-1].id}return{sessions:be,error:Fe}}function $e(Q){const be=new Map(e.sessions.map(Se=>[Se.id,Se.usage]));u(Q.map(Se=>{const Fe=be.get(Se.id);return Fe!==void 0&&Rv(Se.usage)&&!Rv(Fe)?{...Se,usage:Fe}:Se}))}function De(Q){const be=[...Q],Se=new Set(be.map(Fe=>Fe.id));for(const Fe of e.sessions)Se.has(Fe.id)||(be.push(Fe),Se.add(Fe.id));return be.sort((Fe,Ye)=>new Date(Ye.updatedAt).getTime()-new Date(Fe.updatedAt).getTime()),be}async function ge(Q){const be=dt(),Se=[],Fe=Date.now(),Ye=Jt=>Fe-new Date(Jt.updatedAt).getTime();let st,Tt=!1,Qt=!0,Kt;for(;;){let Jt;try{Jt=await be.listSessions({workspaceId:Q,pageSize:Yv,beforeId:st,excludeEmpty:!0})}catch(pt){if(Qt)throw pt;Kt=pt,Tt=!0;break}if(Tt=Jt.hasMore,Jt.items.length===0)break;const Ho=Jt.items[Jt.items.length-1],Lo=Ye(Ho)>=pe;if(!Qt&&Lo){const pt=Jt.items.findIndex(en=>Ye(en)>=pe),qt=pt>=0?pt+1:Jt.items.length;Se.push(...Jt.items.slice(0,qt)),Tt=Jt.hasMore||qt<Jt.items.length;break}if(Se.push(...Jt.items),Qt=!1,!Jt.hasMore||Lo)break;st=Ho.id}return{workspaceId:Q,page:{items:Se,hasMore:Tt},error:Kt}}async function Ne(){const Q=e.workspaces;if(Q.length===0){const pt=await Ce(),qt=pt.error===void 0?pt.sessions:De(pt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=pt.error===void 0,pt.error!==void 0&&l("load",pt.error),qt}const be=await Promise.allSettled(Q.map(pt=>ge(pt.id))),Se=[],Fe=new Set,Ye=new Map,st=new Set;let Tt;for(let pt=0;pt<be.length;pt++){const qt=be[pt];if(qt.status==="fulfilled"){Ye.set(qt.value.workspaceId,qt.value.page),qt.value.error!==void 0&&(st.size===0&&(Tt=qt.value.error),st.add(qt.value.workspaceId));for(const en of qt.value.page.items)Fe.has(en.id)||(Se.push(en),Fe.add(en.id));continue}st.size===0&&(Tt=qt.reason),st.add(Q[pt].id)}if(Ye.size===0){l("load",Tt);return}const Qt=new Set(Q.filter(pt=>st.has(pt.id)).map(pt=>pt.root)),Kt=new Set(Q.map(pt=>pt.id));for(const pt of e.sessions)!(pt.workspaceId!==void 0&&Kt.has(pt.workspaceId)?st.has(pt.workspaceId):Qt.has(pt.cwd)||st.has(S(pt)))||Fe.has(pt.id)||(Se.push(pt),Fe.add(pt.id));const Jt={},Ho={},Lo={};for(const{id:pt}of Q){const qt=Ye.get(pt);if(qt===void 0){const en=e.sessionsHasMoreByWorkspace[pt],Co=e.sessionsCursorByWorkspace[pt],oo=e.sessionsInitialCountByWorkspace[pt];en!==void 0&&(Jt[pt]=en),Co!==void 0&&(Ho[pt]=Co),oo!==void 0&&(Lo[pt]=oo);continue}Jt[pt]=qt.hasMore,Ho[pt]=qt.items.length>0?qt.items[qt.items.length-1].id:void 0,Lo[pt]=Math.max(qt.items.length,Yv)}return e.sessionsHasMoreByWorkspace=Jt,e.sessionsCursorByWorkspace=Ho,e.sessionsInitialCountByWorkspace=Lo,e.sessionsFullyLoaded=!1,Se.sort((pt,qt)=>new Date(qt.updatedAt).getTime()-new Date(pt.updatedAt).getTime()),st.size>0&&l("load",Tt),Se}async function et(Q){if(e.sessionsLoadingMoreByWorkspace[Q]||e.sessionsHasMoreByWorkspace[Q]===!1)return;const be=e.sessionsCursorByWorkspace[Q];if(be!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!0};try{const Se=await dt().listSessions({workspaceId:Q,pageSize:ee,beforeId:be,excludeEmpty:!0}),Fe=new Set(e.sessions.map(st=>st.id)),Ye=Se.items.filter(st=>!Fe.has(st.id));Ye.length>0&&u([...e.sessions,...Ye]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Q]:Se.items.length>0?Se.items[Se.items.length-1].id:be},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Q]:Se.hasMore}}catch(Se){l("loadMoreSessions",Se)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!1}}}}async function rt(){if(e.sessionsFullyLoaded)return;const Q=await Ce().catch(Fe=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Fe),null));if(Q===null)return;const be=Q.error===void 0?Q.sessions:De(Q.sessions);if($e(be),e.sessionsFullyLoaded=Q.error===void 0,Q.error!==void 0)return;const Se={};for(const Fe of e.workspaces)Se[Fe.id]=!1;e.sessionsHasMoreByWorkspace=Se}async function St(){const Q=await dt().getMeta().catch(()=>null);Q!==null&&(e.serverVersion=Q.serverVersion,e.availableOpenInApps=Q.openInApps,e.dangerousBypassAuth=Q.dangerousBypassAuth,e.backend=Q.backend)}async function vt(){const Q=Date.now();let be="accepted";yo("app:load:start"),e.loading=!0;const Se=!me.value;let Fe=!0;try{if(Se&&await ye()==="server-auth-required"){Fe=!1,be="auth-required";return}const Ye=dt();await Promise.all([Ye.getHealth().catch(()=>null),St(),r.loadModels()]),Se||await J(),await fe(),await Nt();const st=await Ne(),Tt=st??e.sessions;st!==void 0&&$e(st);const Qt=Tt[0],Kt=e.activeWorkspaceId;!(Kt!==null&&E.value.some(Lo=>Lo.id===Kt))&&Qt&&ht(S(Qt)),wn();const Ho=typeof window<"u"?QC(window.location):void 0;!e.activeSessionId&&Ho!==void 0&&(e.sessions.some(pt=>pt.id===Ho)||await to(Ho))&&await An(Ho,{urlMode:"replace"}),!e.activeSessionId&&Tt.length>0&&await An(Tt[0].id,{urlMode:"replace"})}catch(Ye){be="failed",l("load",Ye)}finally{e.loading=!1,Fe&&(me.value=!0),yo("app:load:complete",{status:be,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-Q})}}async function Nt(){try{const Q=dt(),[be,Se]=await Promise.all([Q.listWorkspaces().catch(()=>[]),Q.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Wt(be),e.fsHome=Se.home||null,e.recentRoots=Se.recentRoots}catch{}}function Wt(Q){const be=Bf();return Object.keys(be).length===0?Q:Q.map(Se=>{const Fe=be[Se.root];return Fe!==void 0?{...Se,name:Fe}:Se})}function ht(Q){e.activeWorkspaceId=Q,q(Q)}function dn(Q){ht(Q);const be=e.sessions.filter(Se=>S(Se)===Q);if(be.length>0){const Se=be[0];Se&&Se.id!==e.activeSessionId&&An(Se.id)}else g(void 0),qn(void 0,"push")}function fn(Q){const be=Bf()[Q.root],Se=be!==void 0?{...Q,name:be}:Q;e.hiddenWorkspaceRoots.includes(Se.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(st=>st!==Se.root),K(e.hiddenWorkspaceRoots));const Fe=e.workspaces.findIndex(st=>st.id===Se.id||st.root===Se.root);if(Fe===-1){e.workspaces=[Se,...e.workspaces];return}const Ye=[...e.workspaces];Ye[Fe]=Se,e.workspaces=Ye}function ss(Q){if(Q.type==="workspaceCreated"||Q.type==="workspaceUpdated"){fn(Q.workspace);return}const be=e.workspaces.find(Fe=>Fe.id===Q.workspaceId)?.root??Q.root;if(be&&!e.hiddenWorkspaceRoots.includes(be)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,be],K(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Fe=>Fe.id!==Q.workspaceId&&Fe.root!==be),e.activeWorkspaceId===Q.workspaceId||e.activeWorkspaceId===be){const Fe=T.value[0]?.id??null;if(e.activeWorkspaceId=Fe,Fe)q(Fe);else try{Gc($t.activeWorkspace)}catch{}g(void 0),e.sessionLoading=!1,se(),qn(void 0,"replace")}}function Dt(){g(void 0),qn(void 0,"push")}function Pn(Q){ht(Q),Dt(),se()}async function ao(Q){const be=E.value.find(Jt=>Jt.id===Q);if(!be)return null;const Se=dt();let Fe,Ye=be.root;try{const Jt=await Se.addWorkspace({root:be.root});Fe=Jt.id,Ye=Jt.root,fn(Jt)}catch{}const st=r.draftModel.value??void 0,Tt=await Se.createSession({workspaceId:Fe,cwd:Ye,model:st});r.draftModel.value=null;const Qt=st!==void 0&&(!Tt.model||Tt.model.length===0)?{...Tt,model:st}:Tt;f(Qt),ht(Tt.workspaceId??Fe??Q),await An(Tt.id);const Kt=Tt.id;return z.planMode&&(e.planModeBySession={...e.planModeBySession,[Kt]:!0},P()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Kt]:!0},D()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Kt]:!0},W()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,Kt}async function it(Q,be,Se){if(!Vi.has(Q)){Vi.add(Q);try{const Fe=await ao(Q);if(!Fe)return;await Mn(Fe,be,Se)}catch(Fe){l("startSessionAndSendPrompt",Fe)}finally{Vi.delete(Q)}}}async function Gn(Q,be,Se){if(!Vi.has(Q)){Vi.add(Q);try{const Fe=await ao(Q);if(!Fe)return;const Ye=e.planModeBySession[Fe]??!1,st=e.swarmModeBySession[Fe]??!1,Tt=e.sessions.find(Kt=>Kt.id===Fe),Qt=(Tt?.model&&Tt.model.length>0?Tt.model:e.defaultModel)??void 0;await w({model:Qt,planMode:Ye,swarmMode:st,permissionMode:e.permission,thinking:e.thinking},Fe),await r.activateSkill(be,Se,Fe)}catch(Fe){l("startSessionAndActivateSkill",Fe)}finally{Vi.delete(Q)}}}async function co(Q,be){if(!Vi.has(Q)){Vi.add(Q);try{const Se=await ao(Q);if(!Se)return;await i.openSideChatOn(Se,be)}catch(Se){l("startSessionAndOpenSideChat",Se)}finally{Vi.delete(Q)}}}async function Yn(Q){const be=Q.trim();if(!be)return!1;const Se=dt();try{const Fe=await Se.addWorkspace({root:be});return fn(Fe),Pn(Fe.id),!0}catch(Fe){return console.warn("[kimi-web] addWorkspaceByPath failed for",be,Fe),!1}}async function mo(Q){try{return await dt().browseFs(Q)}catch{return{path:"",parent:null,entries:[]}}}async function is(){try{return await dt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function qn(Q,be){if(be==="none"||typeof window>"u"||!window.history)return;const Se=sme(Q);if(window.location.pathname!==Se)try{be==="push"?window.history.pushState(null,"",Se):window.history.replaceState(null,"",Se)}catch{}}async function to(Q){try{const be=await dt().getSession(Q);return e.sessions.some(Se=>Se.id===be.id)||h(be),!0}catch{return!1}}function yn(){const Q=QC(window.location);if(Q===void 0){g(void 0);return}if(Q!==e.activeSessionId){if(e.sessions.some(be=>be.id===Q)){An(Q,{urlMode:"none"});return}(async()=>{if(await to(Q)){await An(Q,{urlMode:"none"});return}const be=e.sessions[0];be?await An(be.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))})()}}let Zn=!1;function wn(){Zn||typeof window>"u"||(Zn=!0,window.addEventListener("popstate",yn))}async function An(Q,be){const Se=A(Q),Fe=!Se&&c.has(Q);c.delete(Q);try{qn(Q,be?.urlMode??"push"),e.sessionLoading=!Se&&!Fe,g(Q),ue(),e.unreadBySession[Q]&&(e.unreadBySession={...e.unreadBySession,[Q]:!1},R({[Q]:!1})),se();const Ye=e.sessions.find(st=>st.id===Q);if(Ye){const st=S(Ye);e.activeWorkspaceId!==st&&ht(st)}if(Se){if(await k(Q)==="not-found")return}else if(await y(Q)==="not-found")return;U(Q)}catch(Ye){l("selectSession",Ye,{sessionId:Q})}finally{e.activeSessionId===Q&&(e.sessionLoading=!1)}}async function Mn(Q,be,Se){const Fe=Zv(Q);e.inFlightBySession={...e.inFlightBySession,[Q]:!0};const Ye=v();try{const st=dt(),Tt=[];be&&Tt.push({type:"text",text:be});for(const en of Se??[])en.kind==="video"?Tt.push({type:"video",source:{kind:"file",fileId:en.fileId}}):en.kind==="file"?Tt.push({type:"file",fileId:en.fileId,name:en.name??"",mediaType:en.mediaType||"application/octet-stream",size:en.size??0}):Tt.push({type:"image",source:{kind:"file",fileId:en.fileId}});if(Tt.length===0)return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},!1;const Qt={id:Ye,sessionId:Q,role:"user",content:Tt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Q,en=>[...en,Qt]);const Kt=e.sessions.find(en=>en.id===Q),Jt=(Kt?.model&&Kt.model.length>0?Kt.model:e.defaultModel)??void 0,Ho=e.planModeBySession[Q]??!1,Lo=e.swarmModeBySession[Q]??!1,pt=e.goalModeBySession[Q]??!1;if(pt&&be)try{await st.updateSession(Q,{goalObjective:be.trim()})}catch(en){return l("createGoal",en,{sessionId:Q}),e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,Co=>Co.some(oo=>oo.id===Ye)?Co.filter(oo=>oo.id!==Ye):Co),!1}const qt=await st.submitPrompt(Q,{content:Tt,model:Jt,thinking:e.thinking,permissionMode:e.permission,planMode:Ho,swarmMode:Lo});return pt&&(e.goalModeBySession={...e.goalModeBySession,[Q]:!1},W()),e.promptIdBySession={...e.promptIdBySession,[Q]:qt.promptId},b(Q,en=>{const Co=en.findIndex(Ai=>Ai.id===Ye);if(Co===-1)return en;const oo=[...en];return oo[Co]={...oo[Co],promptId:oo[Co].promptId??qt.promptId},oo}),m()?.bindNextPromptId(Q,qt.promptId),!0}catch(st){return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,Tt=>Tt.some(Qt=>Qt.id===Ye)?Tt.filter(Qt=>Qt.id!==Ye):Tt),l("sendPrompt",st,{sessionId:Q}),!1}finally{Xv(Q,Fe)}}async function Bo(Q,be){const Se=e.activeSessionId;if(Se){if(a.value!=="idle"||e.inFlightBySession[Se]){bt(Q,be);return}await Mn(Se,Q,be)}}async function ze(Q,be){const Se=e.activeSessionId;if(!Se)return;const Fe=e.queuedBySession[Se]??[],Ye=[],st=[];for(const pt of Fe){const qt=pt.text.trim();qt&&Ye.push(qt),pt.attachments?.length&&st.push(...pt.attachments)}const Tt=Q.trim();if(Tt&&Ye.push(Tt),be?.length&&st.push(...be),Ye.length===0&&st.length===0)return;Fe.length>0&&(e.queuedBySession={...e.queuedBySession,[Se]:[]});const Qt=Ye.join(`
|
|
303
|
-
|
|
304
|
-
`);if(a.value==="idle"&&!e.inFlightBySession[Se]){await Mn(Se,Qt,st);return}const Kt=[];Qt&&Kt.push({type:"text",text:Qt});for(const pt of st)pt.kind==="video"?Kt.push({type:"video",source:{kind:"file",fileId:pt.fileId}}):pt.kind==="file"?Kt.push({type:"file",fileId:pt.fileId,name:pt.name??"",mediaType:pt.mediaType||"application/octet-stream",size:pt.size??0}):Kt.push({type:"image",source:{kind:"file",fileId:pt.fileId}});const Jt=v(),Ho={id:Jt,sessionId:Se,role:"user",content:Kt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Se,pt=>[...pt,Ho]);const Lo=Zv(Se);try{const pt=dt(),qt=e.sessions.find(oo=>oo.id===Se),en=(qt?.model&&qt.model.length>0?qt.model:e.defaultModel)??void 0,Co=await pt.submitPrompt(Se,{content:Kt,model:en,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Se]??!1,swarmMode:e.swarmModeBySession[Se]??!1});if(b(Se,oo=>{const Ai=oo.findIndex(tf=>tf.id===Jt);if(Ai===-1)return oo;const Wl=[...oo];return Wl[Ai]={...Wl[Ai],promptId:Wl[Ai].promptId??Co.promptId},Wl}),Co.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Se]:Co.promptId},m()?.bindNextPromptId(Se,Co.promptId);return}try{await pt.steerPrompts(Se,[Co.promptId])}catch{}}catch(pt){b(Se,qt=>qt.filter(en=>en.id!==Jt)),l("steer",pt,{sessionId:Se})}finally{Xv(Se,Lo)}}async function Qe(Q,be){try{const Fe=await dt().uploadFile({file:Q,name:be});return{fileId:Fe.id,name:Fe.name,mediaType:Fe.mediaType}}catch(Se){return l("uploadImage",Se),null}}function bt(Q,be){const Se=e.activeSessionId;if(!Se)return;const Fe=e.queuedBySession[Se]??[];e.queuedBySession={...e.queuedBySession,[Se]:[...Fe,{text:Q,attachments:be}]}}function Pt(Q){const be=e.inFlightBySession[Q]===!0;if(e.inFlightBySession={...e.inFlightBySession,[Q]:!1},e.promptIdBySession[Q]!==void 0){const Fe={...e.promptIdBySession};delete Fe[Q],e.promptIdBySession=Fe}Q===e.activeSessionId&&ue();const Se=e.queuedBySession[Q]??[];if(Se.length>0){const[Fe,...Ye]=Se;e.queuedBySession={...e.queuedBySession,[Q]:Ye},Fe!==void 0&&Mn(Q,Fe.text,Fe.attachments).then(st=>{if(!st){const Tt=e.queuedBySession[Q]??[];e.queuedBySession={...e.queuedBySession,[Q]:[Fe,...Tt]}}})}return be}function Hn(Q,be){be.inFlightTurn!==null&&be.busy||Pt(Q)}async function rn(){const Q=e.activeSessionId;if(!Q)return;const be=e.sessions.find(Ye=>Ye.id===Q);let Se=e.promptIdBySession[Q];if(Se===void 0){const Ye=be?.currentPromptId;Ye!==void 0&&Ye.length>0&&!Ye.startsWith("pr_")&&(Se=Ye)}const Fe=dt();if(Se!==void 0)try{if((await Fe.abortPrompt(Q,Se)).aborted)return;const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}catch(Ye){if(nr(Ye)&&Ye.code===rme){const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}else{l("abortCurrentPrompt",Ye,{sessionId:Q});return}}try{await Fe.abortSession(Q)}catch(Ye){l("abortCurrentPrompt",Ye,{sessionId:Q})}}function Ut(Q,be){const Se=e.approvalsBySession[Q]??[];e.approvalsBySession={...e.approvalsBySession,[Q]:Se.filter(Fe=>Fe.approvalId!==be)}}function En(Q,be){const Se=e.questionsBySession[Q]??[];e.questionsBySession={...e.questionsBySession,[Q]:Se.filter(Fe=>Fe.questionId!==be)}}async function jn(Q,be){const Se=e.activeSessionId;if(Se&&!ah[Q]){ah[Q]=!0;try{const Fe=dt(),Ye={decision:be.decision,scope:be.scope,feedback:be.feedback,selectedLabel:be.selectedLabel};await Fe.respondApproval(Se,Q,Ye),Ut(Se,Q)}catch(Fe){gg(Fe)?Ut(Se,Q):l("respondApproval",Fe,{sessionId:Se})}finally{delete ah[Q]}}}async function Ct(Q,be){const Se=e.activeSessionId;if(Se&&!ra[Q]){ra[Q]="answer";try{await dt().respondQuestion(Se,Q,be),En(Se,Q)}catch(Fe){gg(Fe)?En(Se,Q):l("respondQuestion",Fe,{sessionId:Se})}finally{delete ra[Q]}}}async function Do(Q){const be=e.activeSessionId;if(be&&!ra[Q]){ra[Q]="dismiss";try{await dt().dismissQuestion(be,Q),En(be,Q)}catch(Se){gg(Se)?En(be,Q):l("dismissQuestion",Se,{sessionId:be})}finally{delete ra[Q]}}}async function So(Q){const be=e.activeSessionId;if(be&&!vg[Q]){vg[Q]=!0;try{const Se=dt(),Fe=(e.tasksBySession[be]??[]).find(st=>st.id===Q)?.backgroundTaskId;await Se.cancelTask(be,Fe??Q);const Ye=e.tasksBySession[be]??[];e.tasksBySession={...e.tasksBySession,[be]:Ye.map(st=>st.id===Q?{...st,status:"cancelled"}:st)}}catch(Se){dme(Se)||l("cancelTask",Se,{sessionId:be})}finally{delete vg[Q]}}}function Xo(Q){const be=e.activeSessionId;be?(e.planModeBySession={...e.planModeBySession,[be]:Q},P(),w({planMode:Q})):z.planMode=Q}function Fn(){const Q=e.activeSessionId,be=Q?e.planModeBySession[Q]??!1:z.planMode;Xo(!be)}function Wn(Q){const be=e.activeSessionId;be?(e.swarmModeBySession={...e.swarmModeBySession,[be]:Q},D(),w({swarmMode:Q})):z.swarmMode=Q}async function ti(){const Q=e.activeSessionId,Se=!(Q?e.swarmModeBySession[Q]??!1:z.swarmMode);Se&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Wn(Se)}function Ps(Q){const be=e.activeSessionId;be?(e.goalModeBySession={...e.goalModeBySession,[be]:Q},W()):z.goalMode=Q}function Po(){const Q=e.activeSessionId,be=Q?e.goalModeBySession[Q]??!1:z.goalMode;Ps(!be)}async function Ss(Q){const be=Q.trim();if(!be||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:be}),variant:"primary"}))return;let Se=e.activeSessionId;if(!Se){const Fe=e.activeWorkspaceId,Ye=Fe&&T.value.some(st=>st.id===Fe)?Fe:T.value[0]?.id??null;if(!Ye)return;try{Se=await ao(Ye)??void 0}catch(st){l("createGoal",st);return}if(!Se)return}try{await dt().updateSession(Se,{goalObjective:be})}catch(Fe){l("createGoal",Fe,{sessionId:Se,message:X(Fe)});return}e.goalModeBySession[Se]&&(e.goalModeBySession={...e.goalModeBySession,[Se]:!1},W()),e.activeSessionId===Se?await Bo(be):await Mn(Se,be)}function Pi(Q){const be=e.activeSessionId;be&&Promise.resolve(dt().updateSession(be,{goalControl:Q})).catch(Se=>{l("controlGoal",Se,{sessionId:be,message:X(Se)})})}function _i(Q){e.permission=Q,I(Q),w({permissionMode:Q})}function uo(Q){const be=[...e.warnings];be.splice(Q,1),e.warnings=be}async function ni(Q,be){try{await dt().updateSession(Q,{title:be}),d(Q,Fe=>({...Fe,title:be}))}catch(Se){l("renameSession",Se,{sessionId:Q})}}async function Si(Q,be){const Se=e.workspaces.find(Ye=>Ye.id===Q)?.root,Fe=()=>{e.workspaces=e.workspaces.map(Ye=>Ye.id===Q?{...Ye,name:be}:Ye)};try{if(await dt().updateWorkspace(Q,{name:be}),Se!==void 0){const Ye=Bf();Se in Ye&&(delete Ye[Se],Qx(Ye))}Fe()}catch(Ye){if(Se!==void 0&&nr(Ye)&&Ye.code===lme){Qx({...Bf(),[Se]:be}),Fe();return}l("renameWorkspace",Ye)}}async function rr(Q){const be=e.workspaces.find(st=>st.id===Q)?.root??E.value.find(st=>st.id===Q)?.root??Q,Se=e.activeSessionId?e.sessions.find(st=>st.id===e.activeSessionId):void 0,Fe=e.activeWorkspaceId===Q||e.activeWorkspaceId===be,Ye=!!(Se&&(Se.cwd===be||Se.workspaceId===Q||S(Se)===Q));be&&!e.hiddenWorkspaceRoots.includes(be)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,be],K(e.hiddenWorkspaceRoots));try{await dt().deleteWorkspace(Q)}catch(st){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",Q,st)}if(e.workspaces=e.workspaces.filter(st=>st.id!==Q&&st.root!==be),Fe||Ye){const st=T.value[0]?.id??null;if(e.activeWorkspaceId=st,st)q(st);else try{Gc($t.activeWorkspace)}catch{}}(Fe||Ye)&&(g(void 0),e.sessionLoading=!1,se(),qn(void 0,"replace"))}async function no(Q){try{await dt().archiveSession(Q),p(Q),i.clearSideChatForSession(Q);const{[Q]:Se,...Fe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Fe,e.activeSessionId===Q){const Ye=e.sessions[0];Ye?await An(Ye.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))}}catch(be){l("archiveSession",be,{sessionId:Q})}}async function rs(Q){if(Le)return;const be=Q??e.activeSessionId;if(!be){const Fe=n("commands.export.noSession");yo("export:failed",{status:"no-session"}),l("exportSession",new Error(Fe),{message:Fe});return}Le=!0;const Se=Date.now();yo("export:start",{sessionId:be});try{const Fe=Kte(),{blob:Ye,fileName:st}=await dt().exportSession(be,Fe);if(typeof document>"u")throw new Error("Document is unavailable");const Tt=URL.createObjectURL(Ye);let Qt;try{Qt=document.createElement("a"),Qt.href=Tt,Qt.download=st,document.body.append(Qt),Qt.click()}finally{Qt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Tt)}catch{}},0)}yo("export:accepted",{sessionId:be,status:"accepted",zipBytes:Ye.size,durationMs:Date.now()-Se})}catch(Fe){const Ye=typeof Fe=="object"&&Fe!==null?Fe:void 0;yo("export:failed",{sessionId:be,status:"failed",durationMs:Date.now()-Se,errorName:typeof Ye?.name=="string"?Ye.name:typeof Fe,errorCode:typeof Ye?.code=="number"?Ye.code:void 0,requestId:typeof Ye?.requestId=="string"?Ye.requestId:void 0,phase:typeof Ye?.phase=="string"?Ye.phase:void 0,httpStatus:typeof Ye?.status=="number"?Ye.status:void 0}),l("exportSession",Fe,{sessionId:be})}finally{Le=!1}}async function ls(Q){try{const be=await dt().restoreSession(Q);return f(be),!0}catch(be){return l("restoreSession",be,{sessionId:Q}),!1}}function No(Q){return dt().listSessions({archivedOnly:!0,beforeId:Q?.beforeId,pageSize:Q?.pageSize??50})}async function Ci(){try{await dt().logout(),await J(),await vt()}catch(Q){l("logout",Q)}}function zn(Q){const be=e.activeSessionId;be&&dt().compactSession(be,Q).catch(Se=>{l("compact",Se,{sessionId:be})})}async function Io(Q){const be=Q??e.activeSessionId;if(be)try{const Se=await dt().forkSession(be);f(Se),await An(Se.id)}catch(Se){l("fork",Se,{sessionId:be})}}async function oi(Q=1){const be=e.activeSessionId;if(!be)return null;const Se=(()=>{const Fe=e.messagesBySession[be]??[];for(let Ye=Fe.length-1;Ye>=0;Ye--){const st=Fe[Ye];if(st.role==="user"&&!(st.metadata?.origin&&st.metadata.origin.kind!=="user"))return st.content.filter(Tt=>Tt.type==="text").map(Tt=>Tt.text).join(`
|
|
305
|
-
`)}return null})();try{return await dt().undoSession(be,Q),await y(be),Se}catch(Fe){return l("undo",Fe,{sessionId:be}),null}}function Ue(Q){const be=e.activeSessionId;if(!be)return;const Se=e.queuedBySession[be]??[];if(Q<0||Q>=Se.length)return;const Fe=[...Se];Fe.splice(Q,1),e.queuedBySession={...e.queuedBySession,[be]:Fe}}function Oe(Q,be){const Se=e.activeSessionId;if(!Se)return;const Fe=e.queuedBySession[Se]??[];if(Q===be||Q<0||Q>=Fe.length||be<0||be>=Fe.length)return;const Ye=[...Fe],[st]=Ye.splice(Q,1);st!==void 0&&(Ye.splice(be,0,st),e.queuedBySession={...e.queuedBySession,[Se]:Ye})}async function te(Q){const be=e.activeSessionId;if(!be)return[];try{return(await dt().listDirectory(be,{path:Q,includeGitStatus:!0})).items}catch{return[]}}async function Te(Q){const be=e.activeSessionId;if(!be)return null;try{const Fe=await dt().readFile(be,{path:Q});return{path:Fe.path,content:Fe.content,encoding:Fe.encoding,mime:Fe.mime,languageId:Fe.languageId,isBinary:Fe.isBinary,size:Fe.size,lineCount:Fe.lineCount}}catch(Se){return console.warn("[kimi-web] readFileContent failed for",Q,Se),null}}const he=10485760;function we(Q){const be=e.activeSessionId;return be?dt().getFileDownloadUrl(be,Q):null}async function He(Q,be){const Se=e.activeSessionId;if(!Se)return!1;try{return await dt().openFile(Se,{path:Q,line:be}),!0}catch(Fe){return l("openFile",Fe,{sessionId:Se}),!1}}async function Ft(Q){const be=e.activeSessionId;if(!be)return;const Se=F.value.cwd||".";try{await dt().openInApp(be,Q,Se)}catch(Fe){l("openInApp",Fe,{sessionId:be})}}async function Rt(Q){const be=e.activeSessionId;if(!be)return!1;try{return await dt().revealFile(be,{path:Q}),!0}catch(Se){return l("revealFile",Se,{sessionId:be}),!1}}async function ln(Q){if(/^(https?:|data:|blob:)/i.test(Q))return Q;const be=e.activeSessionId;if(!be)return Q;let Se=Q;if(Se.startsWith("/")){const Fe=e.sessions.find(Ye=>Ye.id===be)?.cwd;if(Fe&&(Se===Fe||Se.startsWith(Fe.endsWith("/")?Fe:`${Fe}/`))){if(Se=Se.slice(Fe.length).replace(/^\//,""),!Se)return Q}else return Q}try{const Ye=await dt().readFile(be,{path:Se,length:he});return!Ye.isBinary||Ye.encoding!=="base64"||Ye.truncated?Q:`data:${Ye.mime};base64,${Ye.content}`}catch{return Q}}async function Un(Q){const be=e.activeSessionId;if(!be)return[];try{return(await dt().searchFiles(be,{query:Q,limit:20})).items.map(Ye=>({path:Ye.path,name:Ye.name}))}catch{return[]}}return{loadFileDiff:ae,clearFileDiff:se,loadGitStatus:j,checkAuth:J,loadConfig:fe,updateConfig:ve,listAllSessionsGlobal:Ce,load:vt,refreshServerMeta:St,loadWorkspaces:Nt,loadMoreSessions:et,loadAllSessions:rt,selectWorkspace:ht,openWorkspace:dn,upsertWorkspacePreserveOrder:fn,applyWorkspaceEvent:ss,clearActiveSession:Dt,openWorkspaceDraft:Pn,startSessionAndSendPrompt:it,startSessionAndActivateSkill:Gn,startSessionAndOpenSideChat:co,addWorkspaceByPath:Yn,browseFs:mo,getFsHome:is,writeSessionUrl:qn,fetchSessionIntoList:to,onSessionRoutePopState:yn,bindSessionRoute:wn,selectSession:An,submitPromptInternal:Mn,finishPromptLocal:Pt,localTurnStartState:hme,isLocalTurnSnapshotCurrent:mme,afterLocalTurnStartsSettle:gme,handleSessionSnapshot:Hn,sendPrompt:Bo,steerPrompt:ze,uploadImage:Qe,enqueue:bt,unqueue:Ue,reorderQueue:Oe,abortCurrentPrompt:rn,respondApproval:jn,respondQuestion:Ct,dismissQuestion:Do,pendingQuestionActions:ra,pendingApprovalActions:ah,cancelTask:So,setPlanMode:Xo,togglePlanMode:Fn,setSwarmMode:Wn,toggleSwarmMode:ti,setGoalMode:Ps,toggleGoalMode:Po,createGoal:Ss,controlGoal:Pi,setPermission:_i,dismissWarning:uo,renameSession:ni,renameWorkspace:Si,deleteWorkspace:rr,archiveSession:no,exportSession:rs,restoreSession:ls,loadArchivedSessions:No,logout:Ci,compact:zn,forkSession:Io,undo:oi,listDir:te,readFileContent:Te,getFileDownloadUrl:we,openWorkspaceFile:He,openInApp:Ft,revealWorkspaceFile:Rt,resolveImageUrl:ln,searchFiles:Un,loadOlderMessages:le,refreshSessionSidecars:U,isStartingFirstPrompt:()=>Vi.size>0}}const W5=$t.starredModels;function yme(){try{const e=lo(W5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function kme(e){try{po(W5,JSON.stringify(e))}catch{}}function bme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,saveThinkingToStorage:r,updateSession:l,updateSessionMessages:a}=t,c=Z([]),u=Z(yme()),d=Z({}),f=Z({}),h=Z([]),p=Z(null);function g(R){if(!(R==null||R.length===0))return c.value.find(q=>q.id===R)??c.value.find(q=>q.model===R)}function b(){const R=e.activeSessionId?e.sessions.find(K=>K.id===e.activeSessionId):void 0,q=R===void 0?p.value??e.defaultModel:R.model||e.defaultModel;return g(q)?.id??q??void 0}function v(R){return e.thinking=R,R!==void 0&&r(R),R}function m(R){dt().setConfig({thinking:vre(R)}).catch(q=>n("setConfig",q))}async function y(R){try{const K=await dt().listSkills(R);d.value={...d.value,[R]:K}}catch{}}async function k(R){try{const K=await dt().listSkillsForWorkspace(R);f.value={...f.value,[R]:K}}catch{}}async function A(){try{const R=dt();if(c.value=await R.listModels(),e.thinking===void 0){const q=g(b());q!==void 0&&(e.thinking=Um(q))}}catch(R){n("loadModels",R)}}async function $(){try{const R=dt();h.value=await R.listProviders()}catch(R){n("loadProviders",R)}}async function L(R){const q=e.activeSessionId,K=g(R),X=e.thinking,ue=q?e.sessions.find(ce=>ce.id===q)?.model:void 0,me=b()!==(K?.id??R),ne=yre(K,X,me);if(!q)return p.value=R,v(ne),ne!==X&&ne!==void 0&&m(ne),!0;l(q,ce=>({...ce,model:R})),ne!==X&&v(ne);try{await dt().updateSession(q,{model:R,thinking:ne!==X?ne:void 0})}catch(ce){return l(q,de=>({...de,model:ue??de.model})),ne!==X&&v(X),n("setModel",ce,{sessionId:q}),!1}return ne!==X&&ne!==void 0&&m(ne),await o(q),!0}function w(R){const q=new Set(u.value);q.has(R)?q.delete(R):q.add(R),u.value=Array.from(q),kme(u.value)}async function E(R,q,K){const X=K??e.activeSessionId;if(!X)return;const ue=i.value==="idle"&&!e.inFlightBySession[X],me=`msg_skill_opt_${Date.now().toString(36)}`,ne=ue?Zv(X):void 0;if(ue){e.inFlightBySession={...e.inFlightBySession,[X]:!0};const ce={id:me,sessionId:X,role:"user",content:[{type:"text",text:`/${R}${q?` ${q}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:R,skillArgs:q}}};a(X,de=>[...de,ce])}try{await dt().activateSkill(X,R,q)}catch(ce){ue&&(e.inFlightBySession={...e.inFlightBySession,[X]:!1},a(X,de=>de.filter(Ae=>Ae.id!==me))),n("activateSkill",ce,{sessionId:X})}finally{ne!==void 0&&Xv(X,ne)}}async function T(R){try{await dt().addProvider(R),await Promise.all([$(),A()])}catch(q){n("addProvider",q)}}async function F(R){try{await dt().deleteProvider(R),await Promise.all([$(),A()])}catch(q){n("deleteProvider",q)}}async function S(R){try{const q=await dt().refreshProvider(R);for(const K of q.failed)n("refreshProvider",new Error(K.reason),{message:K.provider});await Promise.all([$(),A()])}catch(q){n("refreshProvider",q)}}async function I(){try{const R=await dt().refreshAllProviders();for(const q of R.failed)n("refreshAllProviders",new Error(q.reason),{message:q.provider});await Promise.all([$(),A()])}catch(R){n("refreshAllProviders",R)}}async function P(){try{return await dt().startOAuthLogin()}catch{return null}}async function D(){try{return await dt().pollOAuthLogin()}catch(R){return console.warn("[kimi-web] pollOAuthLogin failed",R),null}}async function W(){try{await dt().cancelOAuthLogin()}catch{}}function z(R){const q=v(R);s({thinking:q}),q!==void 0&&m(q)}return{models:c,starredModelIds:u,providers:h,draftModel:p,skillsBySession:d,skillsByWorkspace:f,loadSkillsForSession:y,loadSkillsForWorkspace:k,loadModels:A,loadProviders:$,setModel:L,toggleStarModel:w,activateSkill:E,addProvider:T,deleteProvider:F,refreshProvider:S,refreshAllProviders:I,startOAuthLogin:P,pollOAuthLogin:D,cancelOAuthLogin:W,setThinking:z}}const z5="kimiWeb.compaction",xme=/^read[_-]?media(?:file)?$/i,wme=/^data:([^;]+);base64,(.*)$/s,_me=/^<(image|video|audio)\s+path="([^"]+)">$/,Sme=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Cme=/Mime type:\s*([^.\s]+)/i,Ame=/Size:\s*(\d+)\s*bytes/i,Mme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Eme="<system>Image compressed to fit model limits:",Tme=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Nme(e){return e.includes(Eme)?e.replace(Tme,""):e}function Ime(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Lme(e){const t=Sme.exec(e.trim());return t?{kind:t[1],path:Ime(t[2])}:null}const U5=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,$me=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Fme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return U5.test(o)?o:void 0}const Ome=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Rme(e){const t=Ome.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=$me.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&U5.test(o)?o:void 0}}function Bme(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 Dme(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 Pme(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 Hme(e,t){if(!xme.test(e))return;const n=Dme(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=_me.exec(h);p&&(s=p[1],o=p[2]);const g=Cme.exec(h);g?.[1]&&(i=g[1]);const b=Ame.exec(h);b?.[1]&&(r=Number(b[1]));const v=Mme.exec(h);v?.[1]&&v[2]&&(l=`${v[1]}x${v[2]}`);continue}const f=Pme(d);f&&(a=f)}if(a===null)return;const c=wme.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Bme(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Wme(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
306
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
307
|
-
`));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
|
|
308
|
-
`)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
|
|
309
|
-
`)):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 zme(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Ume(e,t){const n=e.split(`
|
|
310
|
-
`),o=t.split(`
|
|
311
|
-
`),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 qme(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:Ume(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 jme(e){const t=`<prompt>
|
|
312
|
-
`,n=`
|
|
313
|
-
</prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):Vme(e)}function Vme(e){const t=e.split(`
|
|
314
|
-
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
315
|
-
`):e}function Kme(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Gme(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
316
|
-
`);return jme(t)}function Yme(e,t){const n=e.metadata?.origin??{},o=Gme(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Zme(e,t,n){const{text:o,cron:s}=Yme(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function Xme(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function Qme(e){return e.metadata?.origin?.kind==="compaction_summary"}function Jme(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function e1e(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 t1e(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function n1e(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function q5(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let g=0;g<p.tools.length;g++){const b=p.tools[g];if(b.status!=="running")continue;const v={...b,status:"ok"};p.tools[g]=v;const m=p.blocks.find(y=>y.kind==="tool"&&y.tool.id===v.id);m&&m.kind==="tool"&&(m.tool=v)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
|
|
317
|
-
`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
|
|
318
|
-
`):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const g of p)if(g.type==="text"){if(g.text){h.textParts.push(g.text);const b=h.blocks.at(-1);b&&b.kind==="text"?b.text+=`
|
|
319
|
-
`+g.text:h.blocks.push({kind:"text",text:g.text})}}else if(g.type==="thinking"){if(g.thinking){h.thinkingParts.push(g.thinking);const b=h.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
|
|
320
|
-
`+g.thinking:h.blocks.push({kind:"thinking",thinking:g.thinking})}}else if(g.type==="toolUse"){const b=l.get(g.toolCallId),v={id:g.toolCallId,name:g.toolName,arg:typeof g.input=="string"?g.input:JSON.stringify(g.input),status:"running",output:g.outputLines,planPath:g.toolName==="ExitPlanMode"?s[g.toolCallId]?.path:void 0};h.tools.push(v),h.blocks.push({kind:"tool",tool:v}),b&&(h.approval=qme(b),h.approvalId=b.approvalId)}else if(g.type==="toolResult"){const b=h.tools.findIndex(v=>v.id===g.toolCallId);if(b!==-1){const v=h.tools[b],m={...v,status:g.isError?"error":"ok",output:Wme(g.output),media:g.isError?void 0:Hme(v.name,g.output)};m.name==="ExitPlanMode"&&!m.planPath&&(m.planPath=e1e(m.output)),h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}}function d(h,p){for(const g of p){if(g.type!=="toolUse"||!g.outputLines?.length)continue;const b=h.tools.findIndex(k=>k.id===g.toolCallId);if(b===-1)continue;const v=h.tools[b];if(v.output!==void 0)continue;const m={...v,output:g.outputLines};h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,g=h.source;if(g.kind==="url")return{url:g.url,kind:p};if(g.kind==="base64")return{url:`data:${g.mediaType};base64,${g.data}`,kind:p};if(g.kind==="file"&&n)return{url:n(g.fileId),kind:p,fileId:g.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(Qme(h)){c();const m=h.metadata?.[z5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(y=>y.type==="text").map(y=>y.text).join(`
|
|
321
|
-
`),compaction:{trigger:m?.trigger,tokensBefore:m?.tokensBefore,tokensAfter:m?.tokensAfter}});continue}if(h.role==="user"){const m=Kme(h);if(c(),m!==void 0){i.push(Zme(h,r++,m));continue}if(!Xme(h))continue;const y=h.metadata?.origin,k=y?.kind==="skill_activation"&&y?.trigger==="user-slash",A=y?.kind==="plugin_command"&&y?.trigger==="user-slash",$=[],L=[];for(const w of h.content){if(w.type==="text")if(k)$.push(y.skillArgs??"");else if(A)$.push(y.commandArgs??"");else{const T=Lme(w.text);if(T&&(T.kind==="video"||T.kind==="image")&&n){const I=Fme(T.path);if(I){L.push({url:n(I),kind:T.kind,fileId:I});continue}}const F=Rme(w.text);if(F){L.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=Nme(w.text);if(S!==w.text&&S.trim().length===0)continue;$.push(S)}const E=f(w);if(E){L.push({url:E.url,kind:E.kind,name:w.type==="file"?w.name:void 0,fileId:E.fileId});continue}w.type==="file"&&n&&L.push({kind:"file",url:n(w.fileId),fileId:w.fileId,name:w.name,mediaType:w.mediaType||void 0,size:w.size})}i.push({id:h.id,role:"user",no:r++,text:$.join(`
|
|
322
|
-
`),attachments:L.length>0?L:void 0,skillActivation:k?{name:y.skillName,args:y.skillArgs}:void 0,pluginCommand:A?{pluginId:y.pluginId,commandName:y.commandName,args:y.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;Jme(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const b=a;if(b===null)continue;const v=t1e(h.content);if(b.promptId!==void 0&&b.foldedSigs.some(m=>n1e(m,v))){d(b,h.content);continue}b.foldedSigs.push(v),u(b,h.content)}return c(!0),i}function o1e(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i}=t,r=Z({}),l=B(()=>{const E=e.activeSessionId;if(!E)return null;const T=r.value[E];return T?{parentId:E,agentId:T.agentId}:null}),a=B(()=>l.value?.parentId??null),c=B(()=>l.value!==null),u=B(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=B(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(T=>T.id===E.agentId&&T.status==="running"):!1}),f=B(()=>{const E=l.value;if(!E)return[];const T=e.sideChatMessagesByAgent[E.agentId]??[];return q5(T,[],F=>dt().getFileUrl(F),d.value)});function h(E,T){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:T(e.sideChatMessagesByAgent[E]??[])}}function p(E,T){h(E,F=>[...F,T])}function g(E){h(E,T=>{const F=[...T].reverse().findIndex(I=>I.role==="user");if(F===-1)return T;const S=T.length-1-F;return T.filter((I,P)=>P!==S)})}function b(E,T){h(E,F=>{const S=[...F];for(let I=S.length-1;I>=0;I-=1){const P=S[I];if(P.role==="user")return S[I]={...P,promptId:P.promptId??T},S}return F})}function v(E,T,F){F&&h(E,S=>{const I=S.at(-1);if(I?.role==="assistant"){const P=I.content[0],D=P?.type==="text"?P.text:"";return[...S.slice(0,-1),{...I,content:[{type:"text",text:`${D}${F}`}]}]}return[...S,{id:o(),sessionId:T,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function m(E,T,F){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!F)return;const I=(e.sideChatMessagesByAgent[E]??[]).at(-1);(I?.role==="assistant"&&I.content[0]?.type==="text"?I.content[0].text:"").trim().length>0||v(E,T,F)}async function y(E){const T=e.activeSessionId;T&&await k(T,E)}async function k(E,T){if(!r.value[E]){let F;try{({agentId:F}=await dt().startBtw(E))}catch(S){n("openSideChat",S,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[F]:e.sideChatMessagesByAgent[F]??[]},r.value={...r.value,[E]:{agentId:F}},s(),i()?.markSideChannelAgent(F)}T&&T.trim()&&await A(E,T.trim())}async function A(E,T){const F=r.value[E],S=T.trim();if(!F||!S)return;const I=E,P=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!0};const D={id:o(),sessionId:I,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(P,D);try{const W=e.sessions.find(q=>q.id===I),z=(W?.model&&W.model.length>0?W.model:e.defaultModel)??void 0,R=await dt().submitPrompt(I,{content:[{type:"text",text:S}],agentId:P,model:z,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[I]??!1,swarmMode:e.swarmModeBySession[I]??!1});b(P,R.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],R.userMessageId]}}catch(W){n("sendSideChatPrompt",W,{sessionId:I}),g(P),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!1}}}function $(){const E=e.activeSessionId;if(!E)return;const{[E]:T,...F}=r.value;r.value=F}async function L(E){const T=l.value;T&&await A(T.parentId,E)}function w(E){if(!r.value[E])return;const{[E]:T,...F}=r.value;r.value=F}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:v,finishSideChatAgent:m,openSideChat:y,openSideChatOn:k,closeSideChat:$,sendSideChatPrompt:L,clearSideChatForSession:w}}const s1e="kimiWeb.optimisticUserMessage",JC="Sub Agent";function i1e(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function r1e(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function l1e(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 yg(e){return e.role==="user"&&e.metadata?.[s1e]===!0}function a1e(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function c1e(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const u1e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function e4(e){let t="",n=0;for(const o of e.content)o.type==="text"?u1e.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function d1e(e,t){const n=e4(e),o=e4(t);return n.text===o.text&&n.media===o.media}function f1e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(yg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(yg(s)&&c1e(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(yg(s)&&d1e(s,t))return o}return-1}function h1e(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}const p1e={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function m1e(e){const t=_n.global.t,n=[],o=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?p1e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function g1e(e,t,n){const o=r1e(e);switch(l1e(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],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];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"},[z5]: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"&&!a1e(t.message)){const a=f1e(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]=h1e(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],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===JC&&a.description!==JC?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,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"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,m1e(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${_n.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function v1e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function y1e(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"||$a(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:v1e(a.status)}]:[]})}}return[]}const k1e=["queued","working","suspended","completed","failed"];function j5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function b1e(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function x1e(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:j5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,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=b1e();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 w1e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of k1e)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function _1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:j5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const _r=D5(),Zi=qpe(),Od=Qpe(),V5=$t.permission,K5=$t.activeWorkspace,G5=$t.thinking,Y5=$t.planMode,Z5=$t.swarmMode,X5=$t.goalMode,t4=40401,Q5=$t.onboarded,S1e=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Gc($t.codeFont);Gc($t.theme);function C1e(){try{const e=lo(V5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function A1e(e){try{po(V5,e)}catch{}}function M1e(){try{const e=lo(G5);if(e&&S1e.test(e))return e}catch{}}function E1e(e){try{po(G5,e)}catch{}}function kg(e){const t=lo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function t2(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);po(e,JSON.stringify(n))}catch{}}function J5(){t2(Y5,xe.planModeBySession)}function e8(){t2(Z5,xe.swarmModeBySession)}function t8(){t2(X5,xe.goalModeBySession)}function T1e(){try{return lo(K5)}catch{return null}}const n8=$t.hiddenWorkspaces;function N1e(){try{const e=lo(n8);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function I1e(e){try{po(n8,JSON.stringify(e))}catch{}}function L1e(e){try{po(K5,e)}catch{}}function $1e(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 xe=Ro({...i1e(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:C1e(),thinking:M1e(),planModeBySession:kg(Y5),swarmModeBySession:kg(Z5),goalModeBySession:kg(X5),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:$y(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:T1e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:N1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Vm=Ro({planMode:!1,swarmMode:!1,goalMode:!1});function o8(e){xe.sessions=e}function Km(e,t){xe.sessions=xe.sessions.map(n=>n.id===e?t(n):n)}function F1e(e){xe.sessions=[e,...xe.sessions.filter(t=>t.id!==e.id)]}function O1e(e){xe.sessions=[...xe.sessions,e]}function R1e(e){xe.sessions=xe.sessions.filter(t=>t.id!==e)}function s8(){const e=xe.activeSessionId;e&&xe.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(xe.unreadBySession={...xe.unreadBySession,[e]:!1},Fy({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(xe.unreadBySession=$y(),s8())});function Qv(){if(bi===null||!bi.health().stale)return;yo("ws:stale-reconnect",{sessionId:xe.activeSessionId,status:"stale"}),Ar("ws: stale socket on focus, reconnecting",{activeSessionId:xe.activeSessionId}),bi.reconnect();const e=xe.activeSessionId;e&&Wp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(s8(),Qv())});typeof window<"u"&&(window.addEventListener("focus",Qv),window.addEventListener("online",Qv));function n2(e){xe.activeSessionId=e}function B1e(e){xe.messagesBySession=e}function D1e(e,t){xe.messagesBySession={...xe.messagesBySession,[e]:t}}function i8(e,t){xe.messagesBySession={...xe.messagesBySession,[e]:t(xe.messagesBySession[e]??[])}}function P1e(e){const{[e]:t,...n}=xe.messagesBySession;xe.messagesBySession=n}function r8(e){bi?.unsubscribe(e),c0e(e),Pp.discard(({meta:t})=>t.sessionId===e),R1e(e),P1e(e),delete xe.approvalsBySession[e],delete xe.questionsBySession[e],delete xe.tasksBySession[e],delete xe.goalBySession[e],delete xe.gitStatusBySession[e],delete xe.lastSeqBySession[e],delete xe.compactionBySession[e],delete xe.messagesLoadingMoreBySession[e],delete xe.messagesHasMoreBySession[e],delete xe.messagesLoadMoreErrorBySession[e],delete Jv[e],Hp.delete(e),Lh.delete(e),y8.delete(e),pme(e),delete xe.queuedBySession[e],delete xe.promptIdBySession[e],delete xe.inFlightBySession[e],delete xe.turnActiveBySession[e],delete xe.planModeBySession[e],delete xe.swarmModeBySession[e],delete xe.goalModeBySession[e],J5(),e8(),t8()}const l8=Z(null),a8=Z([]),c8=Z(!1),u8=Z(!1),d8=Z(null);async function Qd(e){let t;try{t=await dt().getSessionStatus(e)}catch{return}Km(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),xe.swarmModeBySession={...xe.swarmModeBySession,[e]:t.swarmMode},xe.planModeBySession={...xe.planModeBySession,[e]:t.planMode}}async function H1e(e){const t=xe.goalVersionBySession[e]??0;let n;try{n=await dt().getSessionGoal(e)}catch{return}if((xe.goalVersionBySession[e]??0)!==t)return;const o={...xe.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,xe.goalBySession=o}function f8(e,t){const n=t??xe.activeSessionId;return n?Promise.resolve(dt().updateSession(n,e)).then(()=>Qd(n)).catch(o=>{Jd("persistSessionProfile",o,{sessionId:n})}):Promise.resolve()}const h8=$t.conversationToc;function W1e(){try{const e=lo(h8);return e===null?!0:e==="true"}catch{return!0}}function z1e(e){try{po(h8,e?"true":"false")}catch{}}const p8=Z(W1e());function U1e(e){p8.value=e,z1e(e)}function q1e(e){try{return lo(e)??""}catch{return""}}const m8=Z(q1e(Q5)==="1");function j1e(e){m8.value=e;try{po(Q5,e?"1":"0")}catch{}}let bi=null,n4=0;function g8(){return n4+=1,`msg_opt_${Date.now().toString(36)}_${n4}`}function V1e(e,t,n){const o={sessions:xe.sessions,activeSessionId:xe.activeSessionId,messagesBySession:xe.messagesBySession,approvalsBySession:xe.approvalsBySession,planReviewByToolCallId:xe.planReviewByToolCallId,questionsBySession:xe.questionsBySession,tasksBySession:xe.tasksBySession,goalBySession:xe.goalBySession,goalVersionBySession:xe.goalVersionBySession,lastSeqBySession:xe.lastSeqBySession,turnActiveBySession:xe.turnActiveBySession,compactionBySession:xe.compactionBySession,config:xe.config,warnings:xe.warnings},s=g1e(o,e,{sessionId:t,seq:n});o8(s.sessions),n2(s.activeSessionId),B1e(s.messagesBySession),xe.approvalsBySession=s.approvalsBySession,xe.planReviewByToolCallId=s.planReviewByToolCallId,xe.questionsBySession=s.questionsBySession,xe.tasksBySession=s.tasksBySession,xe.goalBySession=s.goalBySession,xe.goalVersionBySession=s.goalVersionBySession,xe.lastSeqBySession=s.lastSeqBySession,xe.turnActiveBySession=s.turnActiveBySession,xe.compactionBySession=s.compactionBySession,xe.config=s.config??null,xe.warnings=s.warnings,e.type==="configChanged"&&(xe.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Rn.loadModels(),Rn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(xe.swarmModeBySession={...xe.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(xe.planModeBySession={...xe.planModeBySession,[e.sessionId]:e.planMode}))}function K1e(e,t){const n=xe.lastSeqBySession[t.sessionId]??0,o=xe.turnActiveBySession[t.sessionId]??!1;V1e(e,t.sessionId,t.seq);const s=fs.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&fs.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?fs.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?fs.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&fs.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;xe.promptIdBySession[i]!==e.message.promptId&&(xe.promptIdBySession={...xe.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===xe.activeSessionId&&_r.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;mge(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle")}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&pge(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&xe.promptIdBySession[e.sessionId]===e.promptId&&ut.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&gge(e.sessionId,e.question),e.type==="approvalRequested"&&vge(e.sessionId,e.approval)}const Pp=fpe(({appEvent:e,meta:t})=>K1e(e,t),({appEvent:e})=>ape(e),{coalesce:ppe});function v8(){if(bi!==null||typeof WebSocket>"u")return;yo("ws:connection",{status:"connecting"}),xe.connection="connecting",bi=dt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ut.applyWorkspaceEvent(t);return}for(const o of hpe({appEvent:t,meta:n}))Pp(o)},onResync(t,n,o){yo("ws:resync",{sessionId:t,status:"required",seq:n}),Pp.flush(),Hp.add(t),Wp.request(t)},onError(t,n,o){yo("ws:error",{status:"failed",errorCode:t,fatal:o}),o2({severity:"error",title:_n.global.t("warnings.wsTitle"),message:n,details:[Xn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){yo("ws:connection",{status:t?"connected":"disconnected"}),xe.connected=t,xe.connection=t?"connected":"disconnected",t&&(t0e(),ut.refreshServerMeta())}})}const Jv={},Hp=new Set,Lh=new Set,y8=new Set;function G1e(e){return nr(e)&&e.code===t4?!0:typeof e=="object"&&e!==null&&e.code===t4}function Xn(e,t){if(!(t==null||t===""))return{label:_n.global.t(`warnings.details.${e}`),value:k8(t)}}function k8(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Y1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Z1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function X1e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Q1e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function o4(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function J1e(e,t,n){const o=Ek(t),s=nr(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Xn("operation",e),Xn("sessionId",n??xe.activeSessionId),Xn("connection",xe.connection),Xn("timestamp",Q1e(i??Date.now()))];return o?l.push(Xn("duration",o4(r)),Xn("request",`${t.method} ${t.path}`),Xn("endpoint",t.url),Xn("requestId",t.requestId),Xn("phase",t.phase),Xn("timeout",`${t.timeoutMs}ms`),Xn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Xn("contentType",t.contentType),Xn("responsePreview",t.bodyPreview),Xn("cause",t.cause)):s?l.push(Xn("duration",o4(r)),Xn("code",t.code),Xn("requestId",t.requestId),Xn("message",t.message),Xn("details",t.details)):l.push(Xn("errorName",Y1e(t)),Xn("message",Z1e(t)??k8(t)),Xn("stack",X1e(t))),l.filter(a=>a!==void 0)}function e0e(e,t,n={}){const o=Ek(t),s=nr(t),i=n.title??(o?_n.global.t("warnings.daemonNetworkTitle"):s?_n.global.t("warnings.daemonApiTitle"):_n.global.t("warnings.operationFailedTitle")),r=n.message??(o?_n.global.t("warnings.daemonNetworkMessage"):s?t.message:_n.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:J1e(e,t,n.sessionId)}}function o2(e){xe.warnings=[...xe.warnings,e]}function t0e(){const e=_n.global.t("warnings.wsTitle"),t=xe.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==xe.warnings.length&&(xe.warnings=t)}function Jd(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=nr(t),s=Ek(t);yo("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),o2(e0e(e,t,n))}const n0e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function o0e(e){if(!nr(e))return;const t=n0e[e.code];return t?_n.global.t(t):void 0}async function s0e(e){if(r8(e),xe.activeSessionId!==e)return;const t=xe.sessions[0];t?await ut.selectSession(t.id,{urlMode:"replace"}):(n2(void 0),xe.sessionLoading=!1,ut.writeSessionUrl(void 0,"replace"))}const s4=new Set;async function i0e(e){if(!s4.has(e)){s4.add(e);try{const t=await dt().getSessionWarnings(e),n=_n.global.t("warnings.noteLabel");for(const o of t)o2(`${n}: ${o.message}`)}catch{}}}async function s2(e){const t=ut.localTurnStartState(e);try{const o=await dt().getSessionSnapshot(e);if(!xe.sessions.some(a=>a.id===e))return"ok";Pp.flush();const s=xe.lastSeqBySession[e]??0,i=Jv[e];if(!(Hp.has(e)||zp.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Lh.delete(e)||(Lh.add(e),Wp.request(e)),"ok";if(!ut.isLocalTurnSnapshotCurrent(e,t))return ut.afterLocalTurnStartsSettle(e,()=>{Wp.request(e)}),"ok";const l=Rv(o.session.usage);Km(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),D1e(e,spe(xe.messagesBySession[e]??[],o.messages)),xe.tasksBySession={...xe.tasksBySession,[e]:ipe(o.subagents,xe.tasksBySession[e]??[])},xe.messagesHasMoreBySession={...xe.messagesHasMoreBySession,[e]:o.hasMoreMessages},xe.approvalsBySession={...xe.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(xe.planReviewByToolCallId={...xe.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}xe.questionsBySession={...xe.questionsBySession,[e]:o.pendingQuestions},xe.lastSeqBySession={...xe.lastSeqBySession,[e]:o.asOfSeq},Jv[e]=o.epoch,Hp.delete(e),Lh.delete(e),ut.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...xe.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],xe.turnActiveBySession=a}return v8(),bi&&(bi.seedSnapshot(e,o),bi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),a0e(e)),zp.delete(e),l&&Qd(e),i0e(e),"ok"}catch(n){return G1e(n)?(await s0e(e),"not-found"):(Jd("getSessionSnapshot",n,{title:_n.global.t("warnings.sessionSnapshotTitle"),message:_n.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Wp=rpe(s2);function r0e(e){return Object.prototype.hasOwnProperty.call(xe.messagesBySession,e)}const l0e=4,Sr=[],zp=new Set;function a0e(e){const t=Sr.indexOf(e);for(t!==-1&&Sr.splice(t,1),Sr.unshift(e);Sr.length>l0e;){let n=-1;for(let s=Sr.length-1;s>=0;s--)if(Sr[s]!==xe.activeSessionId){n=s;break}if(n===-1)break;const[o]=Sr.splice(n,1);if(o===void 0)break;bi?.unsubscribe(o),zp.add(o)}}function c0e(e){const t=Sr.indexOf(e);t!==-1&&Sr.splice(t,1),zp.delete(e)}async function u0e(e){return s2(e)}function i2(e,t){return(xe.inFlightBySession[e]??!1)||(xe.turnActiveBySession[e]??!1)||(t??xe.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function r2(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return _n.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const d0e=3e4,Rd=Z(0);let bg=null;function f0e(){bg===null&&(bg=setInterval(()=>{Rd.value=(Rd.value+1)%Number.MAX_SAFE_INTEGER},d0e),bg.unref?.())}function h0e(e,t){const n=e.split(`
|
|
323
|
-
`),o=t.split(`
|
|
324
|
-
`),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 p0e(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:h0e(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 m0e(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 g0e(e){const t=xe.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 v0e(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=_n.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=_n.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??g0e(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const y0e=B(()=>{const e=xe.sessions.find(n=>n.id===xe.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:xe.workspaceName,branch:t}}),k0e=B(()=>(Rd.value,xe.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:r2(e.updatedAt),busy:i2(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),b0e=B(()=>xe.activeSessionId??""),x0e=B(()=>{const e=xe.activeSessionId;if(e)return Rn.skillsBySession.value[e]??[];const t=Ym.value;return t?Rn.skillsByWorkspace.value[t]??[]:[]}),l2=B(()=>{const e=xe.activeSessionId;return e?xe.inFlightBySession[e]??!1:!1}),w0e=B(()=>ut.isStartingFirstPrompt()),fs=o1e(xe,{pushOperationFailure:Jd,nextOptimisticMsgId:g8,connectEventsIfNeeded:v8,getEventConn:()=>bi}),ef=B(()=>{const e=xe.activeSessionId;if(!e)return[];const t=fs.sideChatTargetBySession.value[e]?.agentId;return(xe.tasksBySession[e]??[]).filter(n=>n.id!==t)}),b8=tme(xe,ef),_0e=B(()=>{const e=xe.activeSessionId;if(!e)return[];const t=new Set(xe.sideChatUserMessageIdsBySession[e]??[]),n=(xe.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=xe.approvalsBySession[e]??[];return q5(n,o,s=>dt().getFileUrl(s),Gm.value,xe.planReviewByToolCallId)}),Gm=B(()=>{const e=xe.activeSessionId;return e?(xe.turnActiveBySession[e]??!1)||(xe.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),S0e=B(()=>l2.value||Gm.value),C0e=B(()=>(b8.taskClock.value,ef.value.map(v0e))),x8=B(()=>x1e(ef.value)),A0e=B(()=>_1e(ef.value)),mc=B(()=>{const e=xe.activeSessionId;return e?xe.goalBySession[e]??null:null}),M0e=B(()=>{const e=xe.activeSessionId;return e?y1e(xe.messagesBySession[e]??[]):[]}),E0e=B(()=>{const e=xe.activeSessionId;return e?xe.compactionBySession[e]??null:null}),T0e=B(()=>xe.connection),N0e=B(()=>xe.loading),I0e=B(()=>xe.sessionLoading),L0e=B(()=>{const e=xe.activeSessionId;return e?xe.messagesLoadingMoreBySession[e]??!1:!1}),$0e=B(()=>{const e=xe.activeSessionId;return e?xe.messagesHasMoreBySession[e]??!1:!1}),F0e=B(()=>{const e=xe.activeSessionId;return e?xe.messagesLoadMoreErrorBySession[e]??!1:!1}),O0e=B(()=>xe.serverVersion),R0e=B(()=>xe.backend),B0e=B(()=>xe.dangerousBypassAuth);function D0e(){xe.dangerousBypassAuth=!1}const P0e=B(()=>xe.permission),H0e=B(()=>xe.thinking),w8=B(()=>{const e=xe.activeSessionId;return e?xe.planModeBySession[e]??!1:Vm.planMode}),W0e=B(()=>{const e=xe.activeSessionId;return e?xe.swarmModeBySession[e]??!1:Vm.swarmMode}),z0e=B(()=>{const e=xe.activeSessionId;return e?xe.goalModeBySession[e]??!1:Vm.goalMode}),U0e=B(()=>{const e=w1e(x8.value);return{plan:w8.value,goal:mc.value&&mc.value.status!=="complete"?{status:mc.value.status,turnsUsed:mc.value.turnsUsed,elapsedMs:mc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),q0e=B(()=>{const e=xe.activeSessionId;if(!e)return[];const t=dt();return(xe.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),j0e=B(()=>xe.warnings),V0e=B(()=>{const e=xe.activeSessionId;return e?(xe.questionsBySession[e]??[]).map(m0e):[]}),K0e=B(()=>{const e=xe.activeSessionId;return e?(xe.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:p0e(t),agentName:t.agentName})):[]}),a2=B(()=>{const e=xe.activeSessionId;return e?(xe.approvalsBySession[e]??[]).length>0?"awaiting-approval":(xe.questionsBySession[e]??[]).length>0?"awaiting-question":l2.value||Gm.value?"running":"idle":"idle"}),Rn=bme(xe,{pushOperationFailure:Jd,refreshSessionStatus:Qd,persistSessionProfile:f8,activity:a2,saveThinkingToStorage:E1e,updateSession:Km,updateSessionMessages:i8}),Up=B(()=>{const e=xe.activeSessionId;if(!e)return null;const t=xe.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),G0e=B(()=>{const e=xe.activeSessionId;return e?xe.gitStatusBySession[e]?.pullRequest??null:null}),Y0e=B(()=>{const e=xe.activeSessionId;if(!e)return[];const t=xe.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Z0e=B(()=>{const e=xe.activeSessionId;if(!e)return null;const t=xe.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),_8=B(()=>{const e=xe.sessions.find(r=>r.id===xe.activeSessionId),t=Up.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Rn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??xe.defaultModel)??"—",s=Rn.models.value.find(r=>r.id===o)??Rn.models.value.find(r=>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:xe.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Up.value!==null}}),X0e=B(()=>a8.value),Q0e=B(()=>xe.sessions.find(t=>t.id===xe.activeSessionId)?.usage.totalCostUsd??0),J0e=B(()=>xe.authReady),ege=B(()=>xe.defaultModel),tge=B(()=>xe.managedProviderStatus),nge=B(()=>xe.config),oge=B(()=>{const e=xe.activeSessionId;if(!e)return{};const t=xe.gitStatusBySession[e];return t?{...t.entries}:{}});function Xc(e){return xe.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const c2=B(()=>ope({workspaces:xe.workspaces,sessions:xe.sessions,hiddenWorkspaceRoots:xe.hiddenWorkspaceRoots,activeRoot:xe.sessions.find(e=>e.id===xe.activeSessionId)?.cwd,activeBranch:Up.value?.branch??null,sessionsHasMoreByWorkspace:xe.sessionsHasMoreByWorkspace})),qp=Z(mI()),Qc=Z(gI()==="manual"?"manual":"recent");Je(()=>[c2.value.map(e=>e.id).join("\0"),xe.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=NI(n,qp.value);o!==null&&(qp.value=o,mA(o))});const Na=B(()=>{const e=c2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:$1e(t.root,xe.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Qc.value==="recent"){const t=new Map;for(const n of xe.sessions){if(n.parentSessionId)continue;const o=Xc(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return $I(e,t)}return II(e,qp.value)}),Ym=B(()=>{const e=xe.activeWorkspaceId,t=Na.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Je(Ym,e=>{e&&(Object.prototype.hasOwnProperty.call(Rn.skillsByWorkspace.value,e)||Rn.loadSkillsForWorkspace(e))},{immediate:!0});const sge=B(()=>{const e=Ym.value;return e?Na.value.find(t=>t.id===e)??null:null}),ige=B(()=>{Rd.value;const e=new Set(Na.value.map(n=>n.id)),t=new Map(Na.value.map(n=>[n.id,n.name]));return xe.sessions.filter(n=>!n.parentSessionId&&e.has(Xc(n))).map(n=>{const o=Xc(n);return{id:n.id,title:n.title,time:r2(n.updatedAt),busy:i2(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),rge=B(()=>{Rd.value;const e=new Map;for(const t of xe.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Xc(t),o={id:t.id,title:t.title,time:r2(t.updatedAt),busy:i2(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Na.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:xe.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:xe.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:xe.sessionsInitialCountByWorkspace[t.id]??Yv}))});function lge(e){qp.value=e,mA(e),Qc.value!=="manual"&&(Qc.value="manual",gA("manual"))}function age(e){Qc.value!==e&&(Qc.value=e,gA(e))}const S8=B(()=>{const e={};for(const[t,n]of Object.entries(xe.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(xe.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),cge=B(()=>{const e={};for(const[t,n]of Object.entries(xe.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(xe.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),uge=B(()=>{const e={};for(const[t,n]of Object.entries(xe.unreadBySession))n&&(e[t]=!0);return e}),dge=B(()=>{const e={},t=S8.value;for(const n of xe.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=Xc(n);e[s]=(e[s]??0)+o}return e}),fge=B(()=>xe.recentRoots),hge=B(()=>xe.availableOpenInApps),ut=vme(xe,{taskPoller:b8,sideChat:fs,modelProvider:Rn,pushOperationFailure:Jd,activity:a2,sessionsKnownEmpty:y8,setSessions:o8,updateSession:Km,upsertSessionFront:F1e,appendSession:O1e,forgetSession:r8,setActiveSessionId:n2,updateSessionMessages:i8,nextOptimisticMsgId:g8,getEventConn:()=>bi,syncSessionFromSnapshot:s2,reopenSession:u0e,hasLoadedMessages:r0e,refreshSessionStatus:Qd,refreshSessionGoal:H1e,persistSessionProfile:f8,mergedWorkspaces:c2,workspacesView:Na,status:_8,workspaceIdForSession:Xc,savePermissionToStorage:A1e,savePlanModeToStorage:J5,saveSwarmModeToStorage:e8,saveGoalModeToStorage:t8,draftModes:Vm,saveUnread:Fy,saveActiveWorkspaceToStorage:L1e,saveHiddenWorkspacesToStorage:I1e,goalErrorMessage:o0e,resetFastMoon:_r.resetFastMoon,initialized:u8,connectIssue:d8,selectedDiffPath:l8,fileDiffLines:a8,fileDiffLoading:c8});function u2(e){return e===xe.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function pge(e){if(xe.turnActiveBySession[e]){const t={...xe.turnActiveBySession};delete t[e],xe.turnActiveBySession=t}xe.inFlightBySession[e]&&(xe.inFlightBySession={...xe.inFlightBySession,[e]:!1})}function mge(e,t){const n=xe.promptIdBySession[e];ut.finishPromptLocal(e),e===xe.activeSessionId?(ut.loadGitStatus(e),Qd(e)):t==="idle"&&(xe.unreadBySession={...xe.unreadBySession,[e]:!0},Fy({[e]:!0}));const o=(xe.approvalsBySession[e]??[]).length>0,s=(xe.questionsBySession[e]??[]).length>0;$pe(t,o,s)&&Zi.maybeNotifyCompletion(e,{isUserWatching:u2(e),sessionTitle:xe.sessions.find(i=>i.id===e)?.title??"",promptId:n,onClick:()=>{ut.selectSession(e)}}),t==="idle"&&Od.maybePlayCompletionSound()}function gge(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Zi.maybeNotifyQuestion({isUserWatching:u2(e),sessionTitle:xe.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ut.selectSession(e)}}),Od.maybePlayQuestionSound()}function vge(e,t){Zi.maybeNotifyApproval({isUserWatching:u2(e),sessionTitle:xe.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ut.selectSession(e)}}),Od.maybePlayApprovalSound()}function d2(){return f0e(),{workspace:y0e,sessions:k0e,activeSessionId:b0e,workspacesView:Na,workspaceSortMode:Qc,visibleWorkspace:sge,activeWorkspaceId:Ym,sessionsForView:ige,workspaceGroups:rge,attentionBySession:S8,pendingBySession:cge,attentionByWorkspace:dge,unreadBySession:uge,recentRoots:fge,turns:_0e,tasks:C0e,activeAppTasks:ef,todos:M0e,goal:mc,swarms:x8,swarmMembersByToolCallId:A0e,activationBadges:U0e,compaction:E0e,status:_8,sessionCost:Q0e,fileDiff:X0e,selectedDiffPath:l8,fileDiffLoading:c8,changes:Y0e,gitInfo:Up,gitDiffStats:Z0e,activePullRequest:G0e,changesByPath:oge,pendingApprovals:K0e,availableOpenInApps:hge,connection:T0e,loading:N0e,sessionLoading:I0e,loadingMoreMessages:L0e,hasMoreMessages:$0e,loadMoreMessagesError:F0e,serverVersion:O0e,backend:R0e,dangerousBypassAuth:B0e,clearDangerousBypassAuth:D0e,initialized:u8,connectIssue:d8,permission:P0e,thinking:H0e,planMode:w8,swarmMode:W0e,goalMode:z0e,queued:q0e,warnings:j0e,questions:V0e,activity:a2,turnActive:Gm,inFlight:l2,working:S0e,isStartingFirstPrompt:w0e,fastMoon:_r.fastMoon,models:Rn.models,starredModelIds:Rn.starredModelIds,providers:Rn.providers,uiFontSize:_r.uiFontSize,setUiFontSize:_r.setUiFontSize,conversationToc:p8,setConversationToc:U1e,colorScheme:_r.colorScheme,setColorScheme:_r.setColorScheme,accent:_r.accent,setAccent:_r.setAccent,notifyOnComplete:Zi.notifyOnComplete,notifyOnQuestion:Zi.notifyOnQuestion,notifyOnApproval:Zi.notifyOnApproval,notifyPermission:Zi.notifyPermission,setNotifyOnComplete:Zi.setNotifyOnComplete,setNotifyOnQuestion:Zi.setNotifyOnQuestion,setNotifyOnApproval:Zi.setNotifyOnApproval,soundOnComplete:Od.soundOnComplete,setSoundOnComplete:Od.setSoundOnComplete,onboarded:m8,setOnboarded:j1e,load:ut.load,selectSession:ut.selectSession,clearActiveSession:ut.clearActiveSession,loadOlderMessages:ut.loadOlderMessages,loadWorkspaces:ut.loadWorkspaces,loadMoreSessions:ut.loadMoreSessions,loadAllSessions:ut.loadAllSessions,selectWorkspace:ut.selectWorkspace,openWorkspace:ut.openWorkspace,openWorkspaceDraft:ut.openWorkspaceDraft,startSessionAndSendPrompt:ut.startSessionAndSendPrompt,startSessionAndActivateSkill:ut.startSessionAndActivateSkill,startSessionAndOpenSideChat:ut.startSessionAndOpenSideChat,addWorkspaceByPath:ut.addWorkspaceByPath,browseFs:ut.browseFs,getFsHome:ut.getFsHome,sendPrompt:ut.sendPrompt,steerPrompt:ut.steerPrompt,sideChatVisible:fs.sideChatVisible,sideChatSessionId:fs.sideChatSessionId,sideChatTurns:fs.sideChatTurns,sideChatRunning:fs.sideChatRunning,sideChatSending:fs.sideChatSending,openSideChat:fs.openSideChat,closeSideChat:fs.closeSideChat,sendSideChatPrompt:fs.sendSideChatPrompt,uploadImage:ut.uploadImage,abortCurrentPrompt:ut.abortCurrentPrompt,respondApproval:ut.respondApproval,respondQuestion:ut.respondQuestion,dismissQuestion:ut.dismissQuestion,pendingQuestionActions:ut.pendingQuestionActions,pendingApprovalActions:ut.pendingApprovalActions,cancelTask:ut.cancelTask,setPermission:ut.setPermission,setThinking:Rn.setThinking,setPlanMode:ut.setPlanMode,togglePlanMode:ut.togglePlanMode,setSwarmMode:ut.setSwarmMode,toggleSwarmMode:ut.toggleSwarmMode,setGoalMode:ut.setGoalMode,toggleGoalMode:ut.toggleGoalMode,createGoal:ut.createGoal,controlGoal:ut.controlGoal,enqueue:ut.enqueue,dismissWarning:ut.dismissWarning,renameSession:ut.renameSession,renameWorkspace:ut.renameWorkspace,deleteWorkspace:ut.deleteWorkspace,reorderWorkspaces:lge,setWorkspaceSortMode:age,archiveSession:ut.archiveSession,exportSession:ut.exportSession,restoreSession:ut.restoreSession,loadArchivedSessions:ut.loadArchivedSessions,compact:ut.compact,forkSession:ut.forkSession,undo:ut.undo,unqueue:ut.unqueue,reorderQueue:ut.reorderQueue,searchFiles:ut.searchFiles,loadGitStatus:ut.loadGitStatus,loadFileDiff:ut.loadFileDiff,clearFileDiff:ut.clearFileDiff,listDir:ut.listDir,readFileContent:ut.readFileContent,getFileDownloadUrl:ut.getFileDownloadUrl,openWorkspaceFile:ut.openWorkspaceFile,openInApp:ut.openInApp,revealWorkspaceFile:ut.revealWorkspaceFile,resolveImageUrl:ut.resolveImageUrl,loadModels:Rn.loadModels,loadProviders:Rn.loadProviders,skills:x0e,activateSkill:Rn.activateSkill,setModel:Rn.setModel,toggleStarModel:Rn.toggleStarModel,addProvider:Rn.addProvider,deleteProvider:Rn.deleteProvider,refreshProvider:Rn.refreshProvider,refreshAllProviders:Rn.refreshAllProviders,authReady:J0e,defaultModel:ege,managedProviderStatus:tge,config:nge,updateConfig:ut.updateConfig,checkAuth:ut.checkAuth,startOAuthLogin:Rn.startOAuthLogin,pollOAuthLogin:Rn.pollOAuthLogin,cancelOAuthLogin:Rn.cancelOAuthLogin,logout:ut.logout}}const C8=Ze({__name:"LanguageSwitcher",setup(e){const{locale:t}=Et(),n=kA.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&bA(s)}return(s,i)=>(x(),ke(gs,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),yge=["aria-checked","aria-label","disabled"],kge=Ze({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),N("button",{class:We(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,yge))}}),gr=ct(kge,[["__scopeId","data-v-dbe22dc4"]]),bge=["aria-label"],xge=["aria-selected","onClick"],wge={class:"body"},_ge={class:"panel"},Sge={class:"sec"},Cge={class:"sec-title"},Age={class:"row"},Mge={class:"rlabel"},Ege={class:"row"},Tge={class:"rlabel"},Nge={class:"row"},Ige={class:"rlabel"},Lge={class:"num-field"},$ge=["value","aria-label"],Fge={class:"row"},Oge={class:"rlabel"},Rge={class:"row"},Bge={class:"rlabel"},Dge={class:"hint"},Pge={class:"sec"},Hge={class:"sec-title"},Wge={class:"row"},zge={class:"rlabel"},Uge={key:0,class:"hint"},qge={class:"row"},jge={class:"rlabel"},Vge={key:0,class:"hint"},Kge={class:"row"},Gge={class:"rlabel"},Yge={key:0,class:"hint"},Zge={class:"row"},Xge={class:"rlabel"},Qge={class:"panel"},Jge={class:"sec"},eve={class:"sec-title"},tve={class:"row"},nve={class:"rlabel"},ove={key:0,class:"rvalue"},sve={class:"actions"},ive={class:"panel"},rve={class:"sec"},lve={class:"sec-head"},ave={class:"sec-title"},cve={key:0,class:"saving"},uve={class:"row"},dve={class:"rlabel"},fve={class:"hint"},hve={key:0,class:"select-wrap"},pve={key:0,value:"",disabled:""},mve=["label"],gve=["value"],vve={key:1,class:"rvalue mono"},yve={class:"row"},kve={class:"rlabel"},bve={class:"hint"},xve={class:"row"},wve={class:"rlabel"},_ve={class:"hint"},Sve={class:"row"},Cve={class:"rlabel"},Ave={class:"hint"},Mve={class:"row"},Eve={class:"rlabel"},Tve={class:"hint"},Nve={key:1,class:"empty-config"},Ive={class:"panel"},Lve={class:"sec"},$ve={class:"sec-title"},Fve={class:"row"},Ove={class:"rlabel"},Rve={class:"rvalue mono"},Bve={class:"row"},Dve={class:"rlabel"},Pve={class:"rvalue mono"},Hve={class:"row"},Wve={class:"rlabel"},zve={class:"rvalue mono"},Uve={key:0,class:"row"},qve={class:"rlabel"},jve={class:"hint"},Vve={class:"hint"},Kve={class:"row"},Gve={class:"rlabel"},Yve={key:0,class:"hint"},Zve={class:"panel"},Xve={class:"panel-head"},Qve={class:"panel-title"},Jve={class:"panel-desc"},eye={class:"archive-toolbar"},tye={class:"archive-search"},nye=["placeholder"],oye={value:"all"},sye=["value"],iye={key:0,class:"archive-empty"},rye={key:0,class:"archive-list"},lye={class:"archive-workspace"},aye={class:"path"},cye={class:"count"},uye={class:"setting-card"},dye={class:"archive-meta"},fye={class:"archive-name"},hye={class:"archive-time"},pye={key:1,class:"archive-empty"},mye=100,gye=Ze({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=Z("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=_I(),a=B(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=Z(null);Wk(d);function f(ne){ne.key==="Escape"&&s("close")}un(()=>document.addEventListener("keydown",f)),xn(()=>document.removeEventListener("keydown",f));function h(){c5()}const p=B(()=>{const ne=new Map;for(const ce of o.models??[])ne.set(ce.id,{id:ce.id,label:ce.displayName??ce.model??ce.id,provider:ce.provider});for(const[ce,de]of Object.entries(o.config?.models??{})){if(ne.has(ce))continue;const Ae=v(de);ne.set(ce,{id:ce,label:m(ce,de,Ae),provider:Ae??ce})}return Array.from(ne.values())}),g=B(()=>{const ne=new Map;for(const ce of p.value){const de=ne.get(ce.provider)??[];de.push(ce),ne.set(ce.provider,de)}for(const ce of ne.values())ce.sort((de,Ae)=>de.label.localeCompare(Ae.label));return Array.from(ne.entries()).toSorted(([ce],[de])=>ce.localeCompare(de)).map(([ce,de])=>({provider:ce,options:de}))}),b=B(()=>{const ne=o.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function v(ne){if(!ne||typeof ne!="object")return;const ce=ne;return typeof ce.provider=="string"?ce.provider:void 0}function m(ne,ce,de){if(!ce||typeof ce!="object")return ne;const Ae=ce,Le=typeof Ae.model=="string"?Ae.model:void 0,le=de??v(ce);return Le&&le?`${ne} (${le}/${Le})`:Le?`${ne} (${Le})`:ne}function y(ne){return ne===!0}function k(ne){!ne||ne===o.config?.defaultModel||s("updateConfig",{defaultModel:ne})}function A(ne){ne!==b.value&&s("updateConfig",{defaultPermissionMode:ne})}function $(ne){const ce=o.config?.[ne];s("updateConfig",{[ne]:!y(ce)})}function L(){const ne=o.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function w(){s("updateConfig",{thinking:{enabled:!L()}})}function E(){const ne=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!ne})}function T(ne){i.value=ne}const F=d2(),S=Z([]),I=Z(!1),P=Z(!1),D=Z(""),W=Z("all"),z=Z("archived-desc");async function R(){if(!(I.value||P.value)){I.value=!0;try{const ne=[];let ce;for(;;){const de=await F.loadArchivedSessions({beforeId:ce,pageSize:mye});if(ne.push(...de.items),!de.hasMore||de.items.length===0)break;const Ae=de.items.at(-1)?.id;if(Ae===void 0)break;ce=Ae}S.value=ne,P.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{I.value=!1}}}Je(i,ne=>{ne==="archived"&&!P.value&&R()});const q=B(()=>{const ne=new Set;for(const ce of S.value)ne.add(ce.cwd);return Array.from(ne).sort((ce,de)=>ce.localeCompare(de))}),K=B(()=>{const ne=D.value.trim().toLowerCase();let ce=S.value.filter(de=>de.archived===!0);return W.value!=="all"&&(ce=ce.filter(de=>de.cwd===W.value)),ne&&(ce=ce.filter(de=>de.title.toLowerCase().includes(ne))),ce=ce.slice(),z.value==="archived-desc"?ce.sort((de,Ae)=>Ae.updatedAt.localeCompare(de.updatedAt)):z.value==="created-desc"?ce.sort((de,Ae)=>Ae.createdAt.localeCompare(de.createdAt)):ce.sort((de,Ae)=>de.title.localeCompare(Ae.title,"zh")),ce}),X=B(()=>{const ne=new Map;for(const ce of K.value){const de=ne.get(ce.cwd)??[];de.push(ce),ne.set(ce.cwd,de)}return Array.from(ne.entries()).map(([ce,de])=>({cwd:ce,items:de}))});async function ue(ne){await F.restoreSession(ne)&&(S.value=S.value.filter(de=>de.id!==ne))}function me(ne){const ce=new Date(ne);if(Number.isNaN(ce.getTime()))return ne;const de=Ae=>String(Ae).padStart(2,"0");return`${ce.getFullYear()}-${de(ce.getMonth()+1)}-${de(ce.getDate())} ${de(ce.getHours())}:${de(ce.getMinutes())}`}return(ne,ce)=>(x(),ke(zr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:ce[19]||(ce[19]=de=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:d,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),N(Pe,null,ot(r,de=>_("button",{key:de.id,type:"button",class:We(["tab",{on:i.value===de.id}]),role:"tab","aria-selected":i.value===de.id,onClick:Ae=>T(de.id)},O(C(n)(de.labelKey)),11,xge)),64))],8,bge),_("div",wge,[Ln(_("section",_ge,[_("section",Sge,[_("h3",Cge,O(C(n)("settings.appearance")),1),_("div",Age,[_("span",Mge,O(C(n)("theme.colorSchemeLabel")),1),ie(gs,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":ce[0]||(ce[0]=de=>s("setColorScheme",de))},null,8,["model-value","options"])]),_("div",Ege,[_("span",Tge,O(C(n)("theme.accentLabel")),1),ie(gs,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":ce[1]||(ce[1]=de=>s("setAccent",de))},null,8,["model-value","options"])]),_("div",Nge,[_("span",Ige,O(C(n)("settings.uiFontSize")),1),_("label",Lge,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ce[2]||(ce[2]=de=>s("setUiFontSize",Number(de.target.value)))},null,40,$ge),ce[20]||(ce[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",Fge,[_("span",Oge,O(C(n)("sidebar.language")),1),ie(C8)]),_("div",Rge,[_("span",Bge,[Xe(O(C(n)("settings.conversationToc"))+" ",1),_("span",Dge,O(C(n)("settings.conversationTocHint")),1)]),ie(gr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":ce[3]||(ce[3]=de=>s("setConversationToc",de))},null,8,["model-value","label"])])]),_("section",Pge,[_("h3",Hge,O(C(n)("settings.notifications")),1),_("div",Wge,[_("span",zge,[Xe(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),N("span",Uge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(gr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":ce[4]||(ce[4]=de=>s("setNotify",de))},null,8,["model-value","disabled","label"])]),_("div",qge,[_("span",jge,[Xe(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(x(),N("span",Vge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(gr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":ce[5]||(ce[5]=de=>s("setNotifyQuestion",de))},null,8,["model-value","disabled","label"])]),_("div",Kge,[_("span",Gge,[Xe(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(x(),N("span",Yge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(gr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":ce[6]||(ce[6]=de=>s("setNotifyApproval",de))},null,8,["model-value","disabled","label"])]),_("div",Zge,[_("span",Xge,O(C(n)("settings.soundOnComplete")),1),ie(gr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":ce[7]||(ce[7]=de=>s("setSound",de))},null,8,["model-value","label"])])])],512),[[mi,i.value==="general"]]),Ln(_("section",Qge,[_("section",Jge,[_("h3",eve,O(C(n)("settings.account")),1),_("div",tve,[_("span",nve,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(Zt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(x(),N("span",ove,O(e.accountModel),1)):re("",!0)]),_:1},8,["text"])]),_("div",sve,[ie(Ot,{variant:"secondary",size:"sm",onClick:ce[8]||(ce[8]=de=>{s("openOnboarding"),s("close")})},{default:Ee(()=>[Xe(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(x(),ke(Ot,{key:0,variant:"danger-soft",size:"sm",onClick:ce[9]||(ce[9]=de=>s("logout"))},{default:Ee(()=>[Xe(O(C(n)("sidebar.signOut")),1)]),_:1})):(x(),ke(Ot,{key:1,variant:"primary",size:"sm",onClick:ce[10]||(ce[10]=de=>s("login"))},{default:Ee(()=>[Xe(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[mi,i.value==="account"]]),Ln(_("section",ive,[_("section",rve,[_("div",lve,[_("h3",ave,O(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),N("span",cve,O(C(n)("settings.saving")),1)):re("",!0)]),e.config?(x(),N(Pe,{key:0},[_("div",uve,[_("span",dve,[Xe(O(C(n)("settings.defaultModel"))+" ",1),_("span",fve,O(C(n)("settings.defaultModelHint")),1)]),g.value.length>0?(x(),N("div",hve,[ie(jv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Ee(()=>[e.config.defaultModel?re("",!0):(x(),N("option",pve,O(C(n)("settings.noDefaultModel")),1)),(x(!0),N(Pe,null,ot(g.value,de=>(x(),N("optgroup",{key:de.provider,label:de.provider},[(x(!0),N(Pe,null,ot(de.options,Ae=>(x(),N("option",{key:Ae.id,value:Ae.id},O(Ae.label),9,gve))),128))],8,mve))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(x(),N("span",vve,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",yve,[_("span",kve,[Xe(O(C(n)("settings.defaultPermission"))+" ",1),_("span",bve,O(C(n)("settings.defaultPermissionHint")),1)]),ie(gs,{"model-value":b.value,options:c.map(de=>({value:de,label:C(n)(u[de])})),"onUpdate:modelValue":ce[11]||(ce[11]=de=>A(de))},null,8,["model-value","options"])]),_("div",xve,[_("span",wve,[Xe(O(C(n)("settings.defaultThinking"))+" ",1),_("span",_ve,O(C(n)("settings.defaultThinkingHint")),1)]),ie(gr,{"model-value":L(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":ce[12]||(ce[12]=de=>w())},null,8,["model-value","disabled","label"])]),_("div",Sve,[_("span",Cve,[Xe(O(C(n)("settings.defaultPlanMode"))+" ",1),_("span",Ave,O(C(n)("settings.defaultPlanModeHint")),1)]),ie(gr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":ce[13]||(ce[13]=de=>$("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",Mve,[_("span",Eve,[Xe(O(C(n)("settings.mergeSkills"))+" ",1),_("span",Tve,O(C(n)("settings.mergeSkillsHint")),1)]),ie(gr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":ce[14]||(ce[14]=de=>$("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(x(),N("div",Nve,O(C(n)("settings.configUnavailable")),1))])],512),[[mi,i.value==="agent"]]),Ln(_("section",Ive,[_("section",Lve,[_("h3",$ve,O(C(n)("settings.advanced")),1),_("div",Fve,[_("span",Ove,O(C(n)("sidebar.daemon")),1),_("span",Rve,O(C(l)),1)]),_("div",Bve,[_("span",Dve,O(C(n)("settings.backend")),1),_("span",Pve,O(a.value),1)]),_("div",Hve,[_("span",Wve,O(C(n)("settings.serverVersion")),1),_("span",zve,O(e.serverVersion||"-"),1)]),e.config?(x(),N("div",Uve,[_("span",qve,[Xe(O(C(n)("settings.telemetry"))+" ",1),_("span",jve,O(C(n)("settings.telemetryHint")),1),_("span",Vve,O(C(n)("settings.telemetryRestartHint")),1)]),ie(gr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":ce[15]||(ce[15]=de=>E())},null,8,["model-value","disabled","label"])])):re("",!0),_("div",Kve,[_("span",Gve,[Xe(O(C(n)("settings.exportLog"))+" ",1),C(Di)()?re("",!0):(x(),N("span",Yve,O(C(n)("settings.logHint")),1))]),ie(Ot,{variant:"secondary",size:"sm",onClick:h},{default:Ee(()=>[Xe(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[mi,i.value==="advanced"]]),Ln(_("section",Zve,[_("div",Xve,[ce[21]||(ce[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",Qve,O(C(n)("settings.archivedTitle")),1),_("p",Jve,O(C(n)("settings.archivedDesc")),1)]),_("div",eye,[_("label",tye,[ce[22]||(ce[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),Ln(_("input",{"onUpdate:modelValue":ce[16]||(ce[16]=de=>D.value=de),placeholder:C(n)("settings.archivedSearch")},null,8,nye),[[_s,D.value]])]),ie(jv,{"model-value":W.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":ce[17]||(ce[17]=de=>W.value=de)},{default:Ee(()=>[_("option",oye,O(C(n)("settings.archivedAllWorkspaces")),1),(x(!0),N(Pe,null,ot(q.value,de=>(x(),N("option",{key:de,value:de},O(de),9,sye))),128))]),_:1},8,["model-value","aria-label"]),ie(gs,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ce[18]||(ce[18]=de=>z.value=de)},null,8,["model-value","options"])]),I.value?(x(),N("div",iye,O(C(n)("settings.archivedLoadingAll")),1)):(x(),N(Pe,{key:1},[X.value.length>0?(x(),N("div",rye,[(x(!0),N(Pe,null,ot(X.value,de=>(x(),N("section",{key:de.cwd,class:"archive-card"},[_("div",lye,[ce[23]||(ce[23]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",aye,O(de.cwd),1),_("span",cye,O(C(n)("settings.archivedSessionsCount",{count:de.items.length})),1)]),_("div",uye,[(x(!0),N(Pe,null,ot(de.items,Ae=>(x(),N("div",{key:Ae.id,class:"archive-row"},[_("div",dye,[_("div",fye,O(Ae.title),1),_("div",hye,O(C(n)("settings.archivedAt",{time:me(Ae.updatedAt)})),1)]),ie(Ot,{variant:"secondary",size:"sm",onClick:Le=>ue(Ae.id)},{default:Ee(()=>[Xe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(x(),N("div",pye,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[mi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),vye=ct(gye,[["__scopeId","data-v-2377814f"]]),yye=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,A8=/^[A-Za-z]:[\\/]/,kye=/^\/\/(?!\/)/;function xg(e){return yye.test(e.trim())}function bye(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function xye(e){return kye.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function wye(e){return A8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function _ye(e){return A8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function ey(e,t){let n=xye(bye(e.trim(),t));const o=wye(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=_ye(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Sye(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Cye(e,t,n){if(n===null)return null;const{target:o}=ey(e,t);return o===n?n:null}const Aye={class:"aw"},Mye={key:0,class:"crumbbar"},Eye={class:"crumbs"},Tye={key:0,class:"crumb-sep"},Nye=["onClick"],Iye=["placeholder"],Lye={key:2,class:"folder-list"},$ye={key:0,class:"fl-loading"},Fye={key:0,class:"fl-loading"},Oye={key:0,class:"fl-note"},Rye=["onClick"],Bye={class:"folder-name"},Dye={key:0,class:"git-branch"},Pye={key:1,class:"fl-empty fl-error"},Hye={key:2,class:"fl-empty fl-error"},Wye=["onClick"],zye={class:"folder-name search-rel"},Uye={key:0,class:"git-branch"},qye={key:0,class:"fl-empty"},jye={key:1,class:"fl-loading"},Vye=["onClick"],Kye={class:"folder-name"},Gye={key:0,class:"git-branch"},Yye={key:0,class:"fl-empty"},Zye={key:3,class:"degraded-hint"},Xye={key:4,class:"add-error",role:"alert"},Qye={class:"actions"},Jye={class:"footer-hint"},eke=600,tke=6,i4=150,nke=Ze({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=Z(!0),r=Z(!1),l=Z(!1),a=Z(""),c=Z(null),u=Z([]),d=Z(""),f=Z(!1),h=Z([]),p=B(()=>d.value.trim().length>0);let g=0,b=null;const v=B(()=>xg(d.value)),m=Z("idle"),y=Z(""),k=Z("/"),A=Z([]),$=Z(""),L=Z(null),w=Z(null),E=B(()=>m.value!=="valid"?null:Cye(d.value,$.value,w.value));let T=0,F=null;function S(ce,de){const Ae=ce.toLowerCase(),Le=de.toLowerCase();let le=0;for(let U=0;U<Le.length&&le<Ae.length;U++)Le[U]===Ae[le]&&le++;return le===Ae.length}async function I(ce){const de=a.value,Ae=ce.trim();if(!de||Ae===""){h.value=[],f.value=!1;return}const Le=++g;f.value=!0;const le=[],U=[{path:de,depth:0}];let ae=0;for(;U.length>0&&ae<eke&&le.length<i4;){if(Le!==g)return;const se=U.shift();ae++;let j;try{j=await o.browseFs(se.path)}catch{continue}if(Le!==g)return;for(const J of j.entries){if(!J.isDir)continue;const ye=J.path.startsWith(de)?J.path.slice(de.length).replace(/^\/+/,""):J.path;if(S(Ae,ye||J.name)&&(le.push({path:J.path,name:J.name,rel:ye||J.name,isGitRepo:J.isGitRepo,branch:J.branch}),le.length>=i4))break;se.depth+1<tke&&U.push({path:J.path,depth:se.depth+1})}Le===g&&(h.value=[...le])}Le===g&&(f.value=!1)}Je(d,ce=>{b&&clearTimeout(b),F&&clearTimeout(F),T++,m.value="idle",A.value=[],w.value=null;const de=ce.trim();if(de===""){g++,h.value=[],f.value=!1;return}if(xg(de)){if(g++,h.value=[],f.value=!1,l.value)return;m.value="checking",F=setTimeout(()=>void P(de),150);return}b=setTimeout(()=>void I(ce),220)});async function P(ce){const de=++T;m.value="checking",w.value=null;const Ae=ey(ce,$.value),{target:Le}=Ae;try{const U=await o.browseFs(Le);if(de!==T)return;if(U.path){m.value="valid",A.value=[],w.value=Le,a.value=U.path,c.value=U.parent,u.value=U.entries,l.value=!1;return}}catch{}if(de!==T)return;const le=Ae.base.toLowerCase();y.value=Ae.parent,k.value=Ae.separator;try{const U=await o.browseFs(Ae.parent);if(de!==T)return;if(U.path){A.value=U.entries.filter(ae=>ae.isDir&&ae.name.toLowerCase().startsWith(le)),m.value="not-found";return}}catch{}de===T&&(A.value=[],m.value="bad-parent")}function D(ce){d.value=Sye(y.value,ce,k.value),L.value?.focus()}const W=B(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),z=B(()=>l.value?n("workspace.degradedHint"):v.value&&m.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function R(ce){if(ce.key==="Escape"){d.value?d.value="":s("close");return}if(ce.key!=="Enter")return;const de=d.value.trim();if(xg(de)){if(ce.preventDefault(),l.value){const{target:Ae}=ey(de,$.value);Ae&&s("add",Ae);return}m.value==="valid"?ne():m.value==="not-found"&&A.value[0]&&D(A.value[0].name)}}const q=B(()=>{const ce=a.value;if(!ce)return[];const de=ce.split("/").filter(Boolean),Ae=[{label:"/",path:"/"}];let Le="";for(const le of de)Le+=`/${le}`,Ae.push({label:le,path:Le});return Ae}),K=B(()=>!(a.value.length===0||v.value&&E.value===null));async function X(ce){r.value=!0;try{const de=await o.browseFs(ce);if(!de.path){l.value=!0;return}a.value=de.path,c.value=de.parent,u.value=de.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function ue(ce){ce.isDir&&X(ce.path)}function me(){c.value&&X(c.value)}function ne(){K.value&&s("add",E.value??a.value)}return un(async()=>{r.value=!0;try{const ce=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(ce.home&&($.value=ce.home),o.defaultPath&&(await X(o.defaultPath),!l.value))return;$.value?await X($.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),xn(()=>{b&&clearTimeout(b),F&&clearTimeout(F)}),(ce,de)=>(x(),ke(zr,{open:i.value,"onUpdate:open":de[2]||(de[2]=Ae=>i.value=Ae),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:de[3]||(de[3]=Ae=>s("close"))},{default:Ee(()=>[_("div",Aye,[l.value?re("",!0):(x(),N("div",Mye,[ie(Dn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:me},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",Eye,[(x(!0),N(Pe,null,ot(q.value,(Ae,Le)=>(x(),N(Pe,{key:Ae.path},[Le>1?(x(),N("span",Tye,"/")):re("",!0),_("button",{class:We(["crumb",{last:Le===q.value.length-1}]),onClick:le=>X(Ae.path)},O(Ae.label),11,Nye)],64))),128))])])),!r.value||l.value?(x(),N("div",{key:1,class:We(["filterbar",{"has-error":m.value==="not-found"||m.value==="bad-parent"}])},[ie(Ve,{class:"filter-icon",name:"search",size:"md"}),Ln(_("input",{ref_key:"filterEl",ref:L,"onUpdate:modelValue":de[0]||(de[0]=Ae=>d.value=Ae),class:"filter-input",type:"text",placeholder:W.value,autocomplete:"off",spellcheck:"false",onKeydown:xt(R,["stop"])},null,40,Iye),[[_s,d.value]]),f.value||m.value==="checking"?(x(),ke(Ds,{key:0,size:"sm"})):re("",!0)],2)):re("",!0),l.value?(x(),N("div",Zye,O(C(n)("workspace.degradedHint")),1)):(x(),N("div",Lye,[r.value?(x(),N("div",$ye,O(C(n)("workspace.browsing")),1)):v.value&&m.value!=="valid"?(x(),N(Pe,{key:1},[m.value==="checking"?(x(),N("div",Fye,O(C(n)("workspace.checkingPath")),1)):m.value==="not-found"?(x(),N(Pe,{key:1},[A.value.length>0?(x(),N("div",Oye,O(C(n)("workspace.pathPickHint")),1)):re("",!0),(x(!0),N(Pe,null,ot(A.value,Ae=>(x(),N("button",{key:Ae.path,class:"folder-row",onClick:Le=>D(Ae.name)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Bye,O(Ae.name),1),Ae.isGitRepo?(x(),ke(Ls,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Xe(O(C(n)("workspace.gitTag")),1),Ae.branch?(x(),N("span",Dye,O(Ae.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,Rye))),128)),A.value.length===0?(x(),N("div",Pye,O(C(n)("workspace.noPathMatch",{parent:y.value})),1)):re("",!0)],64)):m.value==="bad-parent"?(x(),N("div",Hye,O(C(n)("workspace.badParent",{parent:y.value})),1)):re("",!0)],64)):p.value&&!v.value?(x(),N(Pe,{key:2},[(x(!0),N(Pe,null,ot(h.value,Ae=>(x(),N("button",{key:Ae.path,class:"folder-row",onClick:Le=>X(Ae.path)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",zye,O(Ae.rel),1),Ae.isGitRepo?(x(),ke(Ls,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Xe(O(C(n)("workspace.gitTag")),1),Ae.branch?(x(),N("span",Uye,O(Ae.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,Wye))),128)),!f.value&&h.value.length===0?(x(),N("div",qye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(x(),N("div",jye,O(C(n)("workspace.searching")),1)):re("",!0)],64)):(x(),N(Pe,{key:3},[(x(!0),N(Pe,null,ot(u.value,Ae=>(x(),N("button",{key:Ae.path,class:"folder-row",onClick:Le=>ue(Ae)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Kye,O(Ae.name),1),Ae.isGitRepo?(x(),ke(Ls,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Xe(O(C(n)("workspace.gitTag")),1),Ae.branch?(x(),N("span",Gye,O(Ae.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,Vye))),128)),u.value.length===0?(x(),N("div",Yye,O(C(n)("workspace.noSubfolders")),1)):re("",!0)],64))])),e.error?(x(),N("div",Xye,O(e.error),1)):re("",!0),_("div",Qye,[ie(Zt,{text:a.value},{default:Ee(()=>[l.value?re("",!0):(x(),ke(Ot,{key:0,variant:"primary",disabled:!K.value,onClick:ne},{default:Ee(()=>[Xe(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Ot,{variant:"secondary",onClick:de[1]||(de[1]=Ae=>s("close"))},{default:Ee(()=>[Xe(O(C(n)("workspace.cancel")),1)]),_:1})]),_("div",Jye,O(z.value),1)])]),_:1},8,["open","title"]))}}),oke=ct(nke,[["__scopeId","data-v-b24b02ce"]]),ske={key:0,class:"confirm-dialog__message"},ike=Ze({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),ho(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(x(),ke(zr,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:i},{foot:Ee(()=>[ie(Ot,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ee(()=>[Xe(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Ot,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ee(()=>[Xe(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(x(),N("p",ske,O(e.message),1)):re("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),rke=ct(ike,[["__scopeId","data-v-2e719024"]]),lke=Ze({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=Zd();function i(){s()}return(r,l)=>(x(),ke(rke,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),ake={class:"rows"},cke={class:"row"},uke={class:"row"},dke={class:"row"},fke={class:"row"},hke={class:"row"},pke={class:"row"},mke={class:"ctx-text"},gke={key:0,class:"bar"},vke={class:"row"},yke=Ze({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t,i=Z(!0),r=B(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=B(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:or(o.status.ctxUsed),max:or(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=B(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=B(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=B(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=B(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,g)=>(x(),ke(zr,{open:i.value,"onUpdate:open":g[0]||(g[0]=b=>i.value=b),title:C(n)("status.statusPanelTitle"),onClose:g[1]||(g[1]=b=>s("close"))},{default:Ee(()=>[_("dl",ake,[_("div",cke,[_("dt",null,O(C(n)("status.statusModel")),1),_("dd",null,O(e.status.model),1)]),_("div",uke,[_("dt",null,O(C(n)("status.statusThinking")),1),_("dd",null,O(e.thinking),1)]),_("div",dke,[_("dt",null,O(C(n)("status.statusPermission")),1),_("dd",{style:Vt({color:c.value})},O(a(e.status.permission)),5)]),_("div",fke,[_("dt",null,O(C(n)("status.statusPlanMode")),1),_("dd",{class:We({"plan-on":e.planMode})},O(u.value),3)]),_("div",hke,[_("dt",null,O(C(n)("status.statusSwarmMode")),1),_("dd",{class:We({"swarm-on":e.swarmMode})},O(d.value),3)]),_("div",pke,[_("dt",null,O(C(n)("status.statusContext")),1),_("dd",null,[_("span",mke,O(l.value),1),e.status.ctxMax>0?(x(),N("span",gke,[_("i",{style:Vt({width:r.value+"%"})},null,4)])):re("",!0)])]),_("div",vke,[_("dt",null,O(C(n)("status.statusCost")),1),_("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),kke=ct(yke,[["__scopeId","data-v-39844d89"]]),bke={class:"ui-toast__icon","aria-hidden":"true"},xke={class:"ui-toast__body"},wke={class:"ui-toast__title"},_ke={key:0,class:"ui-toast__msg"},Ske=Ze({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-toast",`ui-toast--${e.variant}`])},[_("span",bke,[$n(t.$slots,"icon",{},()=>[e.variant==="success"?(x(),ke(Ve,{key:0,name:"check"})):e.variant==="danger"?(x(),ke(Ve,{key:1,name:"close"})):e.variant==="warning"?(x(),ke(Ve,{key:2,name:"alert-triangle"})):(x(),ke(Ve,{key:3,name:"info"}))],!0)]),_("div",xke,[_("div",wke,O(e.title),1),e.message?(x(),N("div",_ke,O(e.message),1)):re("",!0),$n(t.$slots,"default",{},void 0,!0)]),ie(Dn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Cke=ct(Ske,[["__scopeId","data-v-adc6f346"]]),Ake={key:0,class:"actions"},Mke=["onClick"],Eke=["onClick"],Tke={key:1,class:"details"},Nke=Ze({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Et();function i(w){return typeof w=="object"&&w!==null}function r(w){return i(w)?w.title:w}function l(w){return i(w)?w.message??"":""}function a(w){return i(w)?w.details:void 0}function c(w){return i(w)?w.severity==="error":w.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(w)}function u(w){return i(w)?`notice:${w.severity}:${w.title}:${w.message??""}:${JSON.stringify(w.details??[])}`:`text:${w}`}function d(w){if(!i(w))return w;const E=[w.title];w.message&&E.push(w.message);const T=w.details??[];if(T.length>0){E.push("",`${s("warnings.diagnostics")}:`);for(const F of T)E.push(`${F.label}: ${F.value}`)}return E.join(`
|
|
325
|
-
`)}let f=1;const h=Z([]),p=new Map,g=new Map;function b(w){const E=c(w)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function v(w,E){const T=p.get(w)??{handle:null,deadline:0,remaining:0};T.handle=setTimeout(()=>L(w),E),T.deadline=Date.now()+E,p.set(w,T)}function m(w){const E=p.get(w);E&&E.handle!==null&&clearTimeout(E.handle),p.delete(w)}function y(w){const E=p.get(w);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function k(w){if(h.value.find(F=>F.id===w)?.detailsOpen)return;const T=p.get(w);!T||T.handle!==null||v(w,T.remaining)}function A(w){w.detailsOpen=!w.detailsOpen,w.detailsOpen?y(w.id):k(w.id)}async function $(w){if(!await Yo(d(w.warning)))return;w.copied=!0;const T=g.get(w.id);T&&clearTimeout(T),g.set(w.id,setTimeout(()=>{w.copied=!1,g.delete(w.id)},1400))}function L(w){m(w);const E=g.get(w);E&&clearTimeout(E),g.delete(w);const T=h.value.findIndex(F=>F.id===w);T!==-1&&(h.value=h.value.filter(F=>F.id!==w),o("dismiss",T))}return Je(()=>n.warnings,w=>{const E=[...h.value];h.value=w.map(T=>{const F=u(T),S=E.findIndex(D=>D.key===F),I=S===-1?void 0:E.splice(S,1)[0];if(I)return I.warning=T,I;const P={id:f++,key:F,warning:T,detailsOpen:!1,copied:!1};return v(P.id,b(T)),P});for(const T of E){m(T.id);const F=g.get(T.id);F&&clearTimeout(F),g.delete(T.id)}},{immediate:!0,flush:"post"}),xn(()=>{p.forEach(w=>{w.handle!==null&&clearTimeout(w.handle)}),p.clear(),g.forEach(w=>clearTimeout(w)),g.clear()}),(w,E)=>(x(),ke(Z9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(x(!0),N(Pe,null,ot(h.value,T=>(x(),ke(Cke,{key:T.id,variant:c(T.warning)?"danger":"warning",title:r(T.warning),message:l(T.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>L(T.id),onPointerenter:F=>y(T.id),onPointerleave:F=>k(T.id)},{default:Ee(()=>[a(T.warning)?.length?(x(),N("div",Ake,[_("button",{class:"link",type:"button",onClick:F=>A(T)},O(T.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Mke),_("button",{class:"link",type:"button",onClick:F=>$(T)},O(T.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,Eke)])):re("",!0),T.detailsOpen&&a(T.warning)?.length?(x(),N("dl",Tke,[(x(!0),N(Pe,null,ot(a(T.warning),F=>(x(),N("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,O(F.label),1),_("dd",null,O(F.value),1)]))),128))])):re("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Ike=ct(Nke,[["__scopeId","data-v-6cc72bd4"]]),Lke={class:"topbar"},$ke={class:"wsq"},Fke=["aria-label"],Oke={class:"tb-path"},Rke={class:"ws"},Bke={class:"se"},Dke={class:"tb-sub"},Pke=Ze({__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}=Et(),o=e,s=t,i=B(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=B(()=>o.workspace?.name??n("workspace.noWorkspace")),l=B(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),N("div",Lke,[_("span",$ke,O(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",Oke,[_("span",Rke,O(r.value),1),e.sessionTitle?(x(),N(Pe,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",Bke,O(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",Dke,[_("span",{class:We(["rd",{on:e.running}])},null,2),_("span",null,O(l.value),1),e.branch?(x(),N(Pe,{key:0},[Xe(" · "+O(e.branch),1)],64)):re("",!0),e.sessionCount>0?(x(),N(Pe,{key:1},[Xe(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,Fke),ie(Dn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ee(()=>[ie(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Hke=ct(Pke,[["__scopeId","data-v-6b4b901f"]]),Wke={key:0,class:"sheet-root"},zke=["aria-label"],Uke=["aria-label"],qke={key:0,class:"sheet-head"},jke={class:"sheet-title"},Vke={class:"sheet-body"},Kke=Ze({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Je(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),xn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),ke(Tl,{name:"sheet"},{default:Ee(()=>[e.modelValue?(x(),N("div",Wke,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Uke),e.title?(x(),N("div",qke,[_("span",jke,O(e.title),1)])):re("",!0),_("div",Vke,[$n(l.$slots,"default",{},void 0,!0)])],8,zke)])):re("",!0)]),_:3}))}}),M8=ct(Kke,[["__scopeId","data-v-745ee5a2"]]),Gke={class:"mlist"},Yke={key:0,class:"mempty"},Zke=["onClick"],Xke={class:"mgh-main"},Qke={class:"mgh-name"},Jke={class:"mgh-path"},e2e={key:2,class:"att"},t2e={key:0,class:"mempty small"},n2e=["onClick"],o2e={class:"m"},s2e={class:"s"},i2e={key:0,class:"att"},r2e=["disabled","onClick"],l2e=["onClick"],a2e=Ze({__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}=Et(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=Z(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,y.value=null,L.value=null}const h=Z(new Set);function p(F){return h.value.has(F)}function g(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function b(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(I=>I.id===o.activeId)){const I=F.sessions.find(P=>P.id===o.activeId);if(I)return[...S,I]}return S}function v(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function m(F){return o.attentionByWorkspace[F]??0}const y=Z(null);function k(F){y.value=y.value===F?null:F,L.value=null}function A(F){y.value=null;const I=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();I&&s("rename",F.id,I)}function $(F){y.value=null,s("archive",F)}const L=Z(null);function w(F){L.value=L.value===F?null:F,y.value=null}function E(F){Yo(F.root),L.value=null}function T(F){L.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(x(),ke(M8,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=I=>s("update:modelValue",I))},{default:Ee(()=>[_("button",{type:"button",class:"newrow",onClick:a},[ie(Ve,{name:"message",size:"sm"}),Xe(" "+O(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[ie(Ve,{name:"folder",size:"sm"}),Xe(" "+O(C(n)("sidebar.newWorkspace")),1)]),_("div",Gke,[e.groups.length===0?(x(),N("div",Yke,O(C(n)("workspace.noWorkspace")),1)):re("",!0),(x(!0),N(Pe,null,ot(e.groups,I=>(x(),N("div",{key:I.workspace.id,class:"mgroup"},[_("div",{class:We(["mgh",{on:I.workspace.id===e.activeWorkspaceId}]),onClick:P=>f(I.workspace.id)},[d(I.workspace.id)?(x(),ke(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(x(),ke(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",Xke,[_("span",Qke,O(I.workspace.name),1),ie(Zt,{text:I.workspace.root},{default:Ee(()=>[_("span",Jke,O(I.workspace.branch||I.workspace.shortPath),1)]),_:2},1032,["text"])]),d(I.workspace.id)&&m(I.workspace.id)>0?(x(),N("span",e2e,O(m(I.workspace.id)),1)):re("",!0),ie(Dn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:xt(P=>w(I.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Dn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:xt(P=>l(I.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),L.value===I.workspace.id?(x(),ke(vl,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie(mn,{size:"lg",onClick:P=>E(I.workspace)},{default:Ee(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(mn,{size:"lg",danger:"",onClick:P=>T(I.workspace)},{default:Ee(()=>[Xe(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Zke),Ln(_("div",null,[I.sessions.length===0?(x(),N("div",t2e,O(C(n)("sidebar.noSessions")),1)):re("",!0),(x(!0),N(Pe,null,ot(b(I),P=>(x(),N("div",{key:P.id,class:We(["srow",{cur:P.id===e.activeId}]),onClick:D=>r(P.id)},[_("div",o2e,[_("div",{class:We(["t",{run:P.busy,aborted:!P.busy&&(e.attentionBySession[P.id]??0)===0&&(P.lastTurnReason==="cancelled"||P.lastTurnReason==="failed")}])},O(P.title),3),_("div",s2e,O(P.time),1)]),(e.attentionBySession[P.id]??0)>0?(x(),N("span",i2e,O(e.attentionBySession[P.id]),1)):re("",!0),ie(Dn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:xt(D=>k(P.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===P.id?(x(),ke(vl,{key:1,class:"kmenu",onClick:S[1]||(S[1]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie(mn,{size:"lg",onClick:D=>A(P)},{default:Ee(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(mn,{size:"lg",danger:"",onClick:D=>$(P.id)},{default:Ee(()=>[Xe(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,n2e))),128)),I.hasMore||I.loadingMore?(x(),N("button",{key:1,type:"button",class:"mshow-more",disabled:I.loadingMore,onClick:xt(P=>v(I.workspace.id),["stop"])},O(I.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,I.workspace.sessionCount-I.sessions.length)})),9,r2e)):re("",!0),I.sessions.length>I.initialCount?(x(),N("button",{key:2,type:"button",class:"mshow-more",onClick:xt(P=>g(I.workspace.id),["stop"])},O(p(I.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:I.sessions.length-I.initialCount})),9,l2e)):re("",!0)],512),[[mi,!d(I.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),c2e=ct(a2e,[["__scopeId","data-v-d10be77a"]]),u2e={class:"group-title"},d2e={class:"srow-main"},f2e={class:"srow-label"},h2e={class:"srow-sub"},p2e={class:"srow read-only"},m2e={class:"srow-main"},g2e={class:"srow-label"},v2e={key:0,class:"srow-sub"},y2e={class:"srow-main"},k2e={class:"srow-label"},b2e={class:"srow-sub"},x2e=["aria-checked"],w2e={class:"srow-main"},_2e={class:"srow-label"},S2e={class:"srow-sub"},C2e=["aria-checked"],A2e={class:"srow-main"},M2e={class:"srow-label"},E2e={class:"srow read-only"},T2e={class:"srow-main"},N2e={class:"srow-label"},I2e={class:"srow-sub"},L2e=["aria-label"],$2e={class:"group-title"},F2e={class:"srow-main"},O2e={class:"srow-label"},R2e={class:"srow-sub"},B2e={class:"srow read-only pref"},D2e={class:"srow-main"},P2e={class:"srow-label"},H2e={class:"srow read-only pref"},W2e={class:"srow-main"},z2e={class:"srow-label"},U2e={class:"srow read-only pref"},q2e={class:"srow-main"},j2e={class:"srow-label"},V2e={class:"num-field"},K2e=["value","aria-label"],G2e={class:"srow-main"},Y2e={class:"srow-label"},Z2e={class:"srow-sub"},X2e=["aria-checked"],Q2e={class:"srow-main"},J2e={class:"srow-label"},ebe={class:"srow-main"},tbe={class:"srow-label"},nbe={key:2,class:"srow read-only"},obe={class:"srow-main"},sbe={class:"srow-label"},ibe={class:"srow-val dim"},rbe={class:"arch-subhead"},lbe={class:"arch-count"},abe={class:"arch-tools"},cbe={key:0,class:"arch-empty"},ube={class:"arch-meta"},dbe={class:"arch-name"},fbe={class:"arch-time"},hbe={key:2,class:"arch-empty"},pbe=100,mbe=Ze({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Et(),o=e,s=t;function i(X){s("setColorScheme",X)}const r=["manual","auto","yolo"],l=B(()=>o.models?.find(X=>X.id===o.status?.modelId)),a=B(()=>zm(l.value)),c=B(()=>Dk(l.value)),u=B(()=>Fp(l.value,o.thinking)),d=B(()=>c.value.includes(u.value)?u.value:""),f=B(()=>c.value.map(X=>({value:X,label:qv(X)}))),h=B(()=>o.planMode===!0),p=B(()=>o.swarmMode===!0),g=B(()=>{const X=o.status.permission;return X==="yolo"?"var(--color-danger)":X==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=B(()=>{const X=o.status.permission,ue=n(X==="yolo"?"mobile.permYoloSub":X==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${X} · ${ue}`}),v=B(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),m=B(()=>o.status.ctxMax>0?`${or(o.status.ctxUsed)}/${or(o.status.ctxMax)}`:n("status.statusNone"));function y(X){s("setThinking",Pk(l.value,X))}function k(){const X=r.indexOf(o.status.permission),ue=r[(X+1)%r.length];s("setPermission",ue)}function A(){s("pickModel"),s("update:modelValue",!1)}function $(){s("login"),s("update:modelValue",!1)}function L(){s("logout"),s("update:modelValue",!1)}const w=d2(),E=Z("main"),T=Z([]),F=Z(!1),S=Z(!1),I=Z(""),P=Z("archived-desc");async function D(){if(!F.value){F.value=!0,S.value=!1;try{const X=[];let ue;for(;;){const me=await w.loadArchivedSessions({beforeId:ue,pageSize:pbe});if(X.push(...me.items),!me.hasMore||me.items.length===0)break;const ne=me.items.at(-1)?.id;if(ne===void 0)break;ue=ne}T.value=X,S.value=!0}catch(X){console.warn("loadAllArchived failed",X)}finally{F.value=!1}}}function W(){E.value="archived",I.value="",D()}function z(){E.value="main"}const R=B(()=>{const X=I.value.trim().toLowerCase();let ue=T.value.filter(me=>me.archived===!0);return X&&(ue=ue.filter(me=>me.title.toLowerCase().includes(X))),ue=ue.slice(),P.value==="archived-desc"?ue.sort((me,ne)=>ne.updatedAt.localeCompare(me.updatedAt)):P.value==="created-desc"?ue.sort((me,ne)=>ne.createdAt.localeCompare(me.createdAt)):ue.sort((me,ne)=>me.title.localeCompare(ne.title,"zh")),ue});async function q(X){await w.restoreSession(X)&&(T.value=T.value.filter(me=>me.id!==X))}function K(X){const ue=new Date(X);if(Number.isNaN(ue.getTime()))return X;const me=ne=>String(ne).padStart(2,"0");return`${ue.getFullYear()}-${me(ue.getMonth()+1)}-${me(ue.getDate())} ${me(ue.getHours())}:${me(ue.getMinutes())}`}return Je(()=>o.modelValue,X=>{X||(E.value="main")}),(X,ue)=>(x(),ke(M8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":ue[6]||(ue[6]=me=>s("update:modelValue",me))},{default:Ee(()=>[E.value==="main"?(x(),N(Pe,{key:0},[_("div",u2e,O(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:A},[_("span",d2e,[_("span",f2e,O(C(n)("status.statusModel")),1),_("span",h2e,O(e.status.model),1)]),ue[7]||(ue[7]=_("span",{class:"chev"},"›",-1))]),_("div",p2e,[_("span",m2e,[_("span",g2e,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(x(),N("span",v2e,O(C(n)("status.modeNotSupported")),1)):re("",!0)]),c.value.length>1?(x(),ke(gs,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(x(),N("span",{key:1,class:We(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(qv)(u.value)),3))]),_("button",{type:"button",class:"srow",onClick:ue[0]||(ue[0]=me=>s("togglePlan"))},[_("span",y2e,[_("span",k2e,O(C(n)("status.statusPlanMode")),1),_("span",b2e,O(C(n)("mobile.planModeSub")),1)]),_("span",{class:We(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,x2e)]),_("button",{type:"button",class:"srow",onClick:ue[1]||(ue[1]=me=>s("toggleSwarm"))},[_("span",w2e,[_("span",_2e,O(C(n)("status.statusSwarmMode")),1),_("span",S2e,O(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:We(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,C2e)]),_("button",{type:"button",class:"srow",onClick:k},[_("span",A2e,[_("span",M2e,O(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Vt({color:g.value})},O(b.value),5)]),ue[8]||(ue[8]=_("span",{class:"chev"},"›",-1))]),_("div",E2e,[_("span",T2e,[_("span",N2e,O(C(n)("status.statusContext")),1),_("span",I2e,O(m.value),1)]),_("span",{class:"ctx-meter","aria-label":m.value},[_("i",{style:Vt({width:v.value+"%"})},null,4)],8,L2e)]),_("div",$2e,O(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:W},[_("span",F2e,[_("span",O2e,O(C(n)("mobile.archivedSessions")),1),_("span",R2e,O(C(n)("mobile.archivedSessionsSub")),1)]),ue[9]||(ue[9]=_("span",{class:"chev"},"›",-1))]),_("div",B2e,[_("span",D2e,[_("span",P2e,O(C(n)("theme.colorSchemeLabel")),1)]),ie(gs,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",H2e,[_("span",W2e,[_("span",z2e,O(C(n)("sidebar.language")),1)]),ie(C8)]),_("div",U2e,[_("span",q2e,[_("span",j2e,O(C(n)("settings.uiFontSize")),1)]),_("label",V2e,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ue[2]||(ue[2]=me=>s("setUiFontSize",Number(me.target.value)))},null,40,K2e),ue[10]||(ue[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:ue[3]||(ue[3]=me=>s("setConversationToc",!e.conversationToc))},[_("span",G2e,[_("span",Y2e,O(C(n)("settings.conversationToc")),1),_("span",Z2e,O(C(n)("settings.conversationTocHint")),1)]),_("span",{class:We(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,X2e)]),e.authReady?(x(),N("button",{key:0,type:"button",class:"srow acct out",onClick:L},[_("span",Q2e,[_("span",J2e,O(C(n)("sidebar.signOut")),1)])])):(x(),N("button",{key:1,type:"button",class:"srow acct in",onClick:$},[_("span",ebe,[_("span",tbe,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),N("div",nbe,[_("span",obe,[_("span",sbe,O(C(n)("settings.serverVersion")),1)]),_("span",ibe,O(e.serverVersion),1)])):re("",!0)],64)):(x(),N(Pe,{key:1},[_("div",rbe,[_("button",{type:"button",class:"arch-back",onClick:z},[ue[11]||(ue[11]=_("span",{class:"chev back"},"‹",-1)),Xe(" "+O(C(n)("mobile.archivedBack")),1)]),_("span",lbe,O(C(n)("mobile.sessionCount",{n:R.value.length})),1)]),_("div",abe,[ie(zc,{class:"arch-search-input","model-value":I.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":ue[4]||(ue[4]=me=>I.value=me)},null,8,["model-value","placeholder"]),ie(gs,{size:"sm","model-value":P.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ue[5]||(ue[5]=me=>P.value=me)},null,8,["model-value","options"])]),F.value?(x(),N("div",cbe,O(C(n)("settings.archivedLoadingAll")),1)):R.value.length>0?(x(!0),N(Pe,{key:1},ot(R.value,me=>(x(),N("div",{key:me.id,class:"arch-row"},[_("div",ube,[_("div",dbe,O(me.title),1),_("div",fbe,O(C(n)("settings.archivedAt",{time:K(me.updatedAt)})),1)]),ie(Ot,{variant:"secondary",size:"sm",onClick:ne=>q(me.id)},{default:Ee(()=>[Xe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(x(),N("div",hbe,O(T.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),gbe=ct(mbe,[["__scopeId","data-v-6f7f6267"]]),vbe={class:"ob-brand"},ybe={class:"ob-brand-text"},kbe={class:"ob-title"},bbe={class:"ob-sub"},xbe={class:"ob-sec"},wbe={class:"ob-label"},_be={class:"ob-sec"},Sbe={class:"ob-label"},Cbe={class:"ob-sec"},Abe={class:"ob-label"},Mbe=Ze({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Et(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=D5();function c(d){s.value!==d&&bA(d)}function u(){n("complete")}return(d,f)=>(x(),ke(zr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ee(()=>[_("div",vbe,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[_("defs",null,[_("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),_("div",ybe,[_("div",kbe,O(C(o)("onboarding.title")),1),_("div",bbe,O(C(o)("onboarding.subtitle")),1)])])]),default:Ee(()=>[_("section",xbe,[_("div",wbe,O(C(o)("onboarding.languageLabel")),1),ie(gs,{"model-value":C(s),options:C(kA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",_be,[_("div",Sbe,O(C(o)("theme.colorSchemeLabel")),1),ie(gs,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),_("section",Cbe,[_("div",Abe,O(C(o)("theme.accentLabel")),1),ie(gs,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),ie(Ot,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Xe(O(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),Ebe=ct(Mbe,[["__scopeId","data-v-fbdd3eab"]]),Tbe=["aria-label"],Nbe={class:"gload-box"},Ibe={class:"gload-text"},Lbe={key:0,class:"gload-issue"},$be={class:"gload-issue-detail"},Fbe=Ze({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Et();return(n,o)=>(x(),N("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",Nbe,[o[0]||(o[0]=xy('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></path></svg>',1)),ie(Ds,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",Ibe,O(C(t)("app.connecting")),1),e.issue?(x(),N("div",Lbe,[_("div",null,O(C(t)("app.connectRetrying")),1),_("div",$be,O(e.issue),1)])):re("",!0)])],8,Tbe))}}),Obe=ct(Fbe,[["__scopeId","data-v-0b6dec6a"]]),Rbe={class:"kap-root"},Bbe={class:"kap-head"},Dbe={class:"kap-count"},Pbe={class:"kap-head-actions"},Hbe={class:"kap-filters"},Wbe=["value"],zbe={class:"kap-check"},Ube={class:"kap-check"},qbe={class:"kap-view-toggle",role:"group"},jbe={key:0,class:"kap-empty"},Vbe=["onClick"],Kbe={class:"kap-ts"},Gbe={class:"kap-label"},Ybe={key:0,class:"kap-detail"},Zbe={class:"kap-detail-actions"},Xbe=["onClick"],Qbe={key:1,class:"kap-agg"},Jbe={class:"mono"},exe={class:"mono"},txe={class:"num"},nxe={class:"num"},oxe={key:0},sxe={class:"mono"},ixe={class:"num"},rxe={class:"num"},lxe={key:0},axe=Ze({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=Z("all"),s=Z(""),i=Z(""),r=Z(!1),l=Z("timeline"),a=B(()=>(Ak.value,[...Bte()])),c=B(()=>{const E=new Set;for(const T of a.value)T.sessionId&&E.add(T.sessionId);return[...E].sort()});function u(E){return E.kind==="rest:error"||E.code!==void 0&&E.code!==0||E.eventType==="error"||E.eventType==="parse-error"}const d=B(()=>{const E=s.value.trim().toLowerCase();return a.value.filter(T=>!(o.value!=="all"&&T.source!==o.value||i.value&&T.sessionId!==i.value||r.value&&!u(T)||E&&!`${T.label} ${T.kind} ${T.eventType??""} ${T.sessionId??""} ${T.requestId??""}`.toLowerCase().includes(E)))}),f=B(()=>{const E=new Map;for(const T of d.value){if(T.kind!=="ws:in"&&T.kind!=="ws:out")continue;const F=T.kind==="ws:in"?"←":"→",S=`${F} ${T.eventType??"?"} @ ${T.sessionId??"-"}`,I=E.get(S)??{key:S,sessionId:T.sessionId??"-",eventType:T.eventType??"?",dir:F,count:0};I.count++,T.seq!==void 0&&(I.lastSeq=T.seq),E.set(S,I)}return[...E.values()].sort((T,F)=>F.count-T.count)}),h=B(()=>{const E=new Map;for(const T of d.value){if(T.source!=="rest"||T.kind==="rest:request")continue;const F=`${T.method??"?"} ${T.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(T)&&S.errors++,T.durationMs!==void 0&&(S.totalMs+=T.durationMs,S.timed++),E.set(F,S)}return[...E.entries()].map(([T,F])=>({key:T,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((T,F)=>F.count-T.count)}),p=Z(null),g=Z(!0),b=Z(null),v=Z(null);Je(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await gt();const E=b.value;E&&(E.scrollTop=E.scrollHeight)});function m(E){p.value=p.value===E?null:E}function y(E){const T=new Date(E),F=(S,I=2)=>String(S).padStart(I,"0");return`${F(T.getHours())}:${F(T.getMinutes())}:${F(T.getSeconds())}.${F(T.getMilliseconds(),3)}`}function k(E){return JSON.stringify(E,null,2)}async function A(E){await Yo(k(E))&&(v.value=E.id,setTimeout(()=>{v.value===E.id&&(v.value=null)},1500))}function $(){c5(d.value)}function L(E){return u(E)||E.source==="client"?"b-err":E.source==="rest"?"b-rest":E.kind==="ws:lifecycle"?"b-life":E.kind==="ws:out"?"b-out":"b-in"}function w(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,T)=>(x(),N("section",Rbe,[_("header",Bbe,[T[11]||(T[11]=_("strong",null,"KAP debug",-1)),_("span",Dbe,O(d.value.length)+"/"+O(a.value.length),1),_("div",Pbe,[_("button",{type:"button",class:We({on:C(qu)}),onClick:T[0]||(T[0]=F=>qu.value=!C(qu))},O(C(qu)?"resume":"pause"),3),_("button",{type:"button",onClick:T[1]||(T[1]=F=>C(Dte)())},"clear"),_("button",{type:"button",onClick:T[2]||(T[2]=F=>$())},"export jsonl"),ie(Zt,{text:"Close window"},{default:Ee(()=>[_("button",{type:"button",onClick:T[3]||(T[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",Hbe,[Ln(_("select",{"onUpdate:modelValue":T[4]||(T[4]=F=>o.value=F),"aria-label":"Source filter"},[...T[12]||(T[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[Hg,o.value]]),Ln(_("select",{"onUpdate:modelValue":T[5]||(T[5]=F=>i.value=F),"aria-label":"Session filter"},[T[13]||(T[13]=_("option",{value:""},"all sessions",-1)),(x(!0),N(Pe,null,ot(c.value,F=>(x(),N("option",{key:F,value:F},O(F),9,Wbe))),128))],512),[[Hg,i.value]]),Ln(_("input",{"onUpdate:modelValue":T[6]||(T[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[_s,s.value]]),_("label",zbe,[Ln(_("input",{"onUpdate:modelValue":T[7]||(T[7]=F=>r.value=F),type:"checkbox"},null,512),[[Xh,r.value]]),T[14]||(T[14]=Xe(" errors",-1))]),_("label",Ube,[Ln(_("input",{"onUpdate:modelValue":T[8]||(T[8]=F=>g.value=F),type:"checkbox"},null,512),[[Xh,g.value]]),T[15]||(T[15]=Xe(" follow",-1))]),_("div",qbe,[_("button",{type:"button",class:We({on:l.value==="timeline"}),onClick:T[9]||(T[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:We({on:l.value==="aggregate"}),onClick:T[10]||(T[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),N("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(x(),N("div",jbe," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(x(!0),N(Pe,null,ot(d.value,F=>(x(),N("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:We(["kap-row",{expanded:p.value===F.id}]),onClick:S=>m(F.id)},[_("span",Kbe,O(y(F.ts)),1),_("span",{class:We(["kap-badge",L(F)])},O(w(F)),3),_("span",Gbe,O(F.label),1)],10,Vbe),p.value===F.id?(x(),N("div",Ybe,[_("div",Zbe,[_("button",{type:"button",onClick:S=>A(F)},O(v.value===F.id?"copied ✓":"copy json"),9,Xbe)]),_("pre",null,O(k(F)),1)])):re("",!0)]))),128))],512)):(x(),N("div",Qbe,[T[20]||(T[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[T[17]||(T[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(x(!0),N(Pe,null,ot(f.value,F=>(x(),N("tr",{key:F.key},[_("td",null,O(F.dir),1),_("td",Jbe,O(F.eventType),1),_("td",exe,O(F.sessionId),1),_("td",txe,O(F.count),1),_("td",nxe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),N("tr",oxe,[...T[16]||(T[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),T[21]||(T[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[T[19]||(T[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(x(!0),N(Pe,null,ot(h.value,F=>(x(),N("tr",{key:F.key},[_("td",sxe,O(F.key),1),_("td",ixe,O(F.count),1),_("td",{class:We(["num",{err:F.errors>0}])},O(F.errors),3),_("td",rxe,O(F.avgMs),1)]))),128)),h.value.length===0?(x(),N("tr",lxe,[...T[18]||(T[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),cxe=ct(axe,[["__scopeId","data-v-3cda6fe3"]]),uxe=Ze({__name:"DebugPanel",setup(e){const t=Z(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=Qh(cxe,{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 un(()=>{c()}),ho(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),ke(Zt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),dxe=ct(uxe,[["__scopeId","data-v-21346738"]]);function fxe({client:e,authLogoRef:t}){const n=B(()=>e.authReady.value),o=B(()=>e.initialized.value&&!n.value),s="/login",i=Z(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Je(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 xn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function hxe({running:e,showAuthGate:t}){const{t:n}=Et(),o=["◐","◓","◑","◒"],s=Z(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}Je(e,c=>{c?r():l()},{immediate:!0});const a=B(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});fT(()=>{typeof document<"u"&&(document.title=a.value)}),xn(()=>{l()})}const E8=Z(typeof window>"u"?0:window.innerWidth);let ch=0,jp=!1;function ty(){E8.value=window.innerWidth}function pxe(){jp||typeof window>"u"||(window.addEventListener("resize",ty),jp=!0,ty())}function mxe(){!jp||typeof window>"u"||(window.removeEventListener("resize",ty),jp=!1)}function T8(e,t,n){return Math.max(t,e-n)}function ny(e,t,n){return Math.min(n,Math.max(t,e))}function N8(){return un(()=>{ch+=1,pxe()}),ho(()=>{ch=Math.max(0,ch-1),ch===0&&mxe()}),{viewportWidth:E8}}const gxe="kimi-web.file-preview-width",gc=320;function vxe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=N8(),i=B(()=>Math.max(0,s.value-t.value)),r=B(()=>T8(i.value,gc,gc));function l(se){return ny(Math.round(se),gc,r.value)}function a(){return l(i.value/2)}const c=B(()=>a()),u=Z(c.value),d=B(()=>ny(u.value,gc,r.value)),f=Z(null),h=B(()=>{const se=f.value;if(!se)return null;const J=e.turns.value.find(ye=>ye.id===se.turnId)?.blocks?.[se.blockIndex];return J?.kind==="thinking"?J.thinking:null}),p=B(()=>h.value!==null);function g(se){const j=f.value;if(j&&j.turnId===se.turnId&&j.blockIndex===se.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=se}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const v=Z(null),m=B(()=>{const se=v.value;if(!se)return null;const j=e.turns.value.find(J=>J.id===se.turnId);return j?.role==="compaction"&&j.text?j.text:null}),y=B(()=>m.value!==null);function k(se){if(v.value?.turnId===se.turnId){v.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",v.value=se}function A(){v.value=null,n.value==="compaction"&&(n.value=null)}const $=Z(null);function L(se){const j=e.activeAppTasks.value,J=j.find(fe=>fe.id===se)??j.find(fe=>fe.parentToolCallId===se);if(J)return J.id;const ye=j.filter(fe=>fe.kind==="subagent"&&!fe.parentToolCallId);if(ye.length===1)return ye[0].id}const w=B(()=>{const se=$.value;if(!se)return null;const j=e.activeAppTasks.value.find(J=>J.id===se.subagentId);return j?zme(j):null}),E=B(()=>w.value!==null);function T(se){const j=L(se);if(j){if($.value?.subagentId===j){$.value=null,n.value==="agent"&&(n.value=null);return}$.value={subagentId:j},n.value="agent"}}function F(){$.value=null,n.value==="agent"&&(n.value=null)}const S=Z(null),I=B(()=>{const se=S.value;if(!se)return null;const j=hH(e.turns.value,se);return j?{id:se,title:Fa(j.name),path:fH(j.arg),lines:j.status==="error"?null:_A(j),output:j.output}:null}),P=B(()=>I.value!==null);function D(se){if(n.value==="toolDiff"&&S.value===se){W();return}n.value="toolDiff",S.value=se}function W(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=Z("list"),R=Z(null);function q(){if(n.value==="diff"){K();return}n.value="diff",z.value="list",R.value=null,e.loadGitStatus(e.activeSessionId.value)}function K(){n.value==="diff"&&(n.value=null),z.value="list",R.value=null,e.clearFileDiff()}async function X(se){z.value="detail",R.value=se,await e.loadFileDiff(se)}async function ue(se){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,se):await e.openSideChat(se),n.value="btw"}function me(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ne(){n.value==="btw"&&(n.value=null)}const ce=B(()=>e.sideChatVisible.value),de=B(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||y.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||P.value)&&(n.value!=="btw"||ce.value)),Ae=Z(!1),Le=Z({});function le(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return v.value?{kind:"compaction",...v.value}:null;case"agent":return $.value?{kind:"agent",...$.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function U(se){if(se)switch(se.kind){case"thinking":f.value={turnId:se.turnId,blockIndex:se.blockIndex},n.value="thinking";break;case"compaction":v.value={turnId:se.turnId},n.value="compaction";break;case"agent":$.value={subagentId:se.subagentId},n.value="agent";break;case"toolDiff":S.value=se.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ae(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&y.value?(A(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&P.value?(W(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(K(),!0):n.value==="btw"?(me(),!0):!1}return Je(e.activeSessionId,(se,j)=>{if(j){const J=le();J?Le.value[j]=J:delete Le.value[j]}o(),b(),A(),F(),W(),K(),ne(),se&&U(Le.value[se])}),{PREVIEW_WIDTH_KEY:gxe,PREVIEW_MIN:gc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:g,closeThinkingPanel:b,compactionPanelText:m,compactionPanelVisible:y,openCompactionPanel:k,closeCompactionPanel:A,agentPanelMember:w,agentPanelVisible:E,openAgentPanel:T,closeAgentPanel:F,toolDiffTarget:I,toolDiffVisible:P,openToolDiff:D,closeToolDiff:W,detailDiffMode:z,detailDiffPath:R,openDiffDetail:q,closeDiffDetail:K,selectDiffFile:X,btwVisible:ce,openSideChatTab:ue,closeSideChat:me,hideSideChatPanel:ne,sidePanelVisible:de,panelDragging:Ae,closeOpenSidePanel:ae}}const yxe=$t.sidebarWidth,r4=$t.sidebarCollapsed,l4=270,wg=170,kxe=480,bxe=320;function xxe(e={}){const{viewportWidth:t}=N8(),n=Z(l4),o=Z(!1),s=Z(!1),i=B(()=>{const u=bxe+(I4(e.previewOpen)?gc:0);return Math.min(kxe,T8(t.value,wg,u))}),r=B(()=>ny(n.value,wg,i.value));function l(){try{o.value=lo(r4)==="true"}catch{o.value=!1}}function a(){try{po(r4,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:yxe,SIDEBAR_DEFAULT:l4,SIDEBAR_MIN:wg,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function wxe({client:e,detailTarget:t}){const{t:n}=Et(),o=Z(null),s=Z(null),i=Z(!1),r=Z(null),l=Z(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=B(()=>{const L=l.value;return L?e.getFileDownloadUrl(L):null}),f=B(()=>o.value!==null);function h(L){return L.length>1?L.replace(/\/+$/,""):L}function p(L){const w=[];for(const E of L.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){w.pop();continue}w.push(E)}return w.join("/")}function g(L){const w=L.trim();if(!w)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(w))return{error:n("filePreview.errors.unsupportedPath")};if(w.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=h(e.status.value.cwd);if(w.startsWith("/")){if(!E||w!==E&&!w.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=w===E?"":w.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(w.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const T=p(w);return T?{path:T}:{error:n("filePreview.errors.emptyPath")}}async function b(L){const w=o.value;if(t.value==="file"&&w&&w.path===L.path&&w.line===L.line){k();return}const E=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=L,l.value=null;const T=g(L.path);if("error"in T){i.value=!1,r.value=T.error;return}l.value=T.path;try{const F=await e.readFileContent(T.path);if(E!==a)return;F?s.value={...F,path:F.path||T.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if(E!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function v(L){return/^data:([^;,]+)/i.exec(L)?.[1]}function m(L){if(L.kind!=="image")return;const w=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const E={path:L.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:L.mimeType??v(L.url)??"image/*",isBinary:!0,size:L.bytes??0};L.fileId?(i.value=!0,s.value=E,dt().getFileBlob(L.fileId).then(T=>{if(w===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(T),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{w===a&&(s.value&&(s.value={...s.value,sourceUrl:L.url}),i.value=!1)})):(i.value=!1,s.value={...E,sourceUrl:L.url})}function y(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function k(){y(),t.value==="file"&&(t.value=null)}Je(t,(L,w)=>{w==="file"&&L!=="file"&&y()});function A(){const L=s.value?.path??o.value?.path;L&&e.openWorkspaceFile(L,o.value?.line)}function $(){const L=s.value?.path??o.value?.path;L&&e.revealWorkspaceFile(L)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:b,openMediaPreview:m,closeFilePreview:k,openPreviewInEditor:A,revealPreviewFile:$}}const _xe=640,Sxe=`(max-width: ${_xe}px)`;function Cxe(){const e=Z(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Sxe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),xn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),xn(()=>t.removeListener(n))),e}const Axe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Mxe={class:"server-auth-card"},Exe={class:"server-auth-body"},Txe={class:"server-auth-foot"},Nxe=Ze({__name:"ServerAuthDialog",setup(e){const t=Z(""),n=Z(null),o=Z(!1);un(()=>{gt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,m5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(x(),N("div",Axe,[_("div",Mxe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[Xe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"KIMI_CODE_PASSWORD"),Xe("). ")])],-1)),_("div",Exe,[ie(zc,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),_("div",Txe,[ie(Ot,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ee(()=>[Xe(O(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Ixe=ct(Nxe,[["__scopeId","data-v-6f624612"]]),Lxe=["aria-label"],$xe=Ze({__name:"InternalBuildBanner",setup(e){const{t}=Et(),n=NB;return(o,s)=>C(n)?(x(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=_("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,O(C(t)("app.internalBuildBanner")),1)],8,Lxe)):re("",!0)}}),Fxe=ct($xe,[["__scopeId","data-v-166b3735"]]),Oxe={class:"app-shell"},Rxe={key:1,class:"auth-page"},Bxe={class:"auth-page-inner"},Dxe={class:"auth-page-copy"},Pxe=["aria-label","aria-hidden"],Hxe=Ze({__name:"App",setup(e){Tne();const t=Z(!1);let n=null;const o=d2(),s=B(()=>!o.dangerousBypassAuth.value&&t.value);Nn("resolveImage",o.resolveImageUrl),Nn("resolveSwarmMembers",Oe=>o.swarmMembersByToolCallId.value.get(Oe)??[]);const{t:i}=Et(),{confirm:r}=Zd(),l=Di(),a=Cxe(),c=Z(!1),u=Z(!1),d=B(()=>{const Oe=o.activeSessionId.value;return o.sessions.value.find(te=>te.id===Oe)?.title??""}),f=B(()=>o.visibleWorkspace.value?.sessionCount??0),h=B(()=>o.activity.value!=="idle"),p=Z(null),{showAuthGate:g,blinkAuthLogo:b}=fxe({client:o,authLogoRef:p});hxe({running:h,showAuthGate:g});function v(Oe){const te=o.models.value.find(He=>He.id===o.status.value.modelId),Te=Dk(te),he=Te.indexOf(Fp(te,Oe)),we=Te[(he+1)%Te.length]??Te[0]??"off";return Pk(te,we)}const m=B(()=>{const Oe=o.models.value.find(te=>te.id===o.status.value.modelId);return Fp(Oe,o.thinking.value)}),y=Z(!o.onboarded.value);function k(){o.setOnboarded(!0),y.value=!1}function A(){y.value=!0}let $=0;function L(){const Oe=window.visualViewport,te=document.documentElement.style;te.setProperty("--app-height",`${Oe?.height??window.innerHeight}px`),te.setProperty("--app-top",`${Oe?.offsetTop??0}px`)}function w(){$||($=requestAnimationFrame(()=>{$=0,L()}))}un(()=>{n=Lne(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),se(),L(),window.visualViewport?.addEventListener("resize",w),window.visualViewport?.addEventListener("scroll",w),window.addEventListener("resize",w),document.addEventListener("keydown",E,!0)}),xn(()=>{document.removeEventListener("keydown",E,!0),window.visualViewport?.removeEventListener("resize",w),window.visualViewport?.removeEventListener("scroll",w),window.removeEventListener("resize",w),$&&(cancelAnimationFrame($),$=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function E(Oe){Oe.key==="Escape"&&(Qe.value||is()&&(Oe.stopPropagation(),Oe.preventDefault()))}const T=Z(null),F=Z(!1);Je(o.activeSessionId,()=>{F.value=!0,gt(()=>{F.value=!1})});const{previewTarget:S,previewFile:I,previewLoading:P,previewError:D,previewDownloadUrl:W,previewExternalActions:z,openFilePreview:R,openMediaPreview:q,closeFilePreview:K,openPreviewInEditor:X,revealPreviewFile:ue}=wxe({client:o,detailTarget:T}),me=B(()=>T.value!==null),{SIDEBAR_WIDTH_KEY:ne,SIDEBAR_DEFAULT:ce,SIDEBAR_MIN:de,sidebarMax:Ae,sessionColWidth:Le,sidebarCollapsed:le,sidebarDragging:U,sideWidth:ae,loadSidebarCollapsed:se,toggleSidebarCollapse:j}=xxe({previewOpen:me}),{PREVIEW_WIDTH_KEY:J,PREVIEW_MIN:ye,previewDefaultWidth:fe,previewMax:ve,previewWidth:V,previewPanelWidth:ee,thinkingPanelText:pe,thinkingVisible:Ce,openThinkingPanel:$e,closeThinkingPanel:De,compactionPanelText:ge,compactionPanelVisible:Ne,openCompactionPanel:et,closeCompactionPanel:rt,agentPanelMember:St,openAgentPanel:vt,closeAgentPanel:Nt,toolDiffTarget:Wt,openToolDiff:ht,closeToolDiff:dn,detailDiffMode:fn,detailDiffPath:ss,openDiffDetail:Dt,closeDiffDetail:Pn,selectDiffFile:ao,btwVisible:it,openSideChatTab:Gn,closeSideChat:co,sidePanelVisible:Yn,panelDragging:mo,closeOpenSidePanel:is}=vxe({client:o,sideWidth:ae,detailTarget:T,closeFilePreview:K}),qn=Z(null),to=Z(!1),yn=Z(!1),Zn=Z(!1),wn=Z(!1),An=Z(!1),Mn=Z(!1),Bo=Z(null),ze=Z(null),Qe=B(()=>fc.value>0||to.value||yn.value||Zn.value||wn.value||An.value||Mn.value||y.value||c.value||u.value),bt=Z(!1),Pt=Z(!1),Hn=Z(!1),rn=Z(!1),Ut=Z(!1);async function En(){bt.value=!0,Pt.value=!1,to.value=!0;try{await o.refreshAllProviders()}catch{Pt.value=!0}finally{bt.value=!1}}async function jn(){Hn.value=!0,rn.value=!1,yn.value=!0;try{await o.loadProviders()}catch{rn.value=!0}finally{Hn.value=!1}}function Ct(){Zn.value=!0}async function Do(Oe){to.value=!1,await So(Oe)}async function So(Oe){await o.setModel(Oe)&&Oe!==o.defaultModel.value&&o.updateConfig({defaultModel:Oe})}async function Xo(Oe){await o.addProvider(Oe)}async function Fn(Oe){await o.refreshProvider(Oe)}async function Wn(Oe){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Oe)})}async function ti(Oe){const te=o.workspacesView.value.find(Te=>Te.id===Oe)?.name??Oe;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:te}),variant:"danger",action:()=>o.deleteWorkspace(Oe)})}async function Ps(Oe){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Oe)})}async function Po(Oe){Ut.value=!0;try{await o.updateConfig(Oe)&&await o.checkAuth()}finally{Ut.value=!1}}async function Ss(){return o.startOAuthLogin()}async function Pi(){return o.pollOAuthLogin()}async function _i(){return o.cancelOAuthLogin()}async function uo(){Zn.value=!1,await o.checkAuth(),await o.load()}async function ni(Oe){await o.undo(1),await gt(),qn.value?.loadComposerForEdit(Oe.text,Oe.attachments)}function Si(Oe){if(Oe==="/compact"||Oe.startsWith("/compact ")){o.compact(Oe.slice(8).trim()||void 0);return}if(Oe==="/swarm"||Oe.startsWith("/swarm ")){const te=Oe.slice(6).trim();te==="on"?o.setSwarmMode(!0):te==="off"?o.setSwarmMode(!1):te?(o.setSwarmMode(!0),o.sendPrompt(te)):o.toggleSwarmMode();return}if(Oe==="/goal"||Oe.startsWith("/goal ")){const te=Oe.slice(5).trim();te==="pause"||te==="resume"||te==="cancel"?o.controlGoal(te):te?o.createGoal(te):o.toggleGoalMode();return}if(Oe==="/btw"||Oe.startsWith("/btw ")){const te=Oe.slice(4).trim();!te&&o.sideChatVisible.value?co():Gn(te||void 0);return}switch(Oe){case"/new":case"/clear":Io();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(v(o.thinking.value));break;case"/status":An.value=!0;break;case"/login":Ct();break;default:{const te=Oe.indexOf(" "),Te=hre((te===-1?Oe:Oe.slice(0,te)).slice(1)),he=te===-1?void 0:Oe.slice(te+1).trim()||void 0;if(!Te)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Te,he):o.activateSkill(Te,he);break}}}function rr(Oe){o.unqueue(Oe)}function no(Oe){o.unqueue(Oe)}function rs(Oe){o.reorderQueue(Oe.from,Oe.to)}async function ls(Oe){const te=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&te){await o.startSessionAndSendPrompt(te,Oe.text,Oe.attachments);return}if(!o.activeSessionId.value&&!te){Bo.value=Oe,wn.value=!0;return}o.sendPrompt(Oe.text,Oe.attachments)}async function No(Oe){if(ze.value=null,!await o.addWorkspaceByPath(Oe)){ze.value=i("workspace.addFailed");return}wn.value=!1;const Te=Bo.value;Bo.value=null;const he=o.activeWorkspaceId.value;Te&&he&&await o.startSessionAndSendPrompt(he,Te.text,Te.attachments)}function Ci(){Bo.value=null,ze.value=null,wn.value=!1}function zn(){gt(()=>{qn.value?.focusComposer()})}function Io(){const Oe=o.activeWorkspaceId.value;Oe?o.openWorkspaceDraft(Oe):o.clearActiveSession(),zn()}function oi(Oe){o.openWorkspaceDraft(Oe),zn()}function Ue(Oe){Oe&&window.open(Oe,"_blank","noopener")}return(Oe,te)=>(x(),N("div",Oxe,[s.value?(x(),ke(Ixe,{key:0})):re("",!0),C(g)?(x(),N("section",Rxe,[_("div",Bxe,[(x(),N("svg",{ref_key:"authLogoRef",ref:p,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:te[0]||(te[0]=xt(()=>{},["prevent"])),onClick:te[1]||(te[1]=(...Te)=>C(b)&&C(b)(...Te))},[...te[98]||(te[98]=[xy('<defs data-v-8cd3196b><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-8cd3196b><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-8cd3196b></rect><g class="ch-eyes" fill="#000" data-v-8cd3196b><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-8cd3196b></rect>',2)])],544)),_("div",Dxe,[_("h1",null,O(C(i)("app.authPageTitle")),1),_("p",null,O(C(i)("app.authPageMessage")),1)]),ie(Ot,{class:"auth-page-btn",variant:"primary",onClick:Ct},{default:Ee(()=>[ie(Ve,{name:"log-in",size:"md"}),_("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(x(),N("div",{key:2,class:We(["app",{mobile:C(a),"sidebar-collapsed":C(le)&&!C(a),"macos-desktop":C($c)}]),style:Vt({"--preview-w":C(ee)+"px"})},[C(a)?(x(),ke(Hke,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:te[19]||(te[19]=Te=>c.value=!0),onOpenSettings:te[20]||(te[20]=Te=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),N(Pe,{key:0},[ie(JB,{collapsed:C(le),dragging:C(U),"col-width":C(ae),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,backend:C(o).backend.value,onSelect:te[2]||(te[2]=Te=>C(o).selectSession(Te)),onCreate:Io,onCreateInWorkspace:te[3]||(te[3]=Te=>oi(Te)),onSelectWorkspace:te[4]||(te[4]=Te=>C(o).openWorkspace(Te)),onAddWorkspace:te[5]||(te[5]=Te=>wn.value=!0),onRename:te[6]||(te[6]=(Te,he)=>C(o).renameSession(Te,he)),onArchive:te[7]||(te[7]=Te=>Wn(Te)),onFork:te[8]||(te[8]=Te=>C(o).forkSession(Te)),onExport:te[9]||(te[9]=Te=>C(o).exportSession(Te)),onRenameWorkspace:te[10]||(te[10]=(Te,he)=>C(o).renameWorkspace(Te,he)),onDeleteWorkspace:te[11]||(te[11]=Te=>ti(Te)),onReorderWorkspaces:te[12]||(te[12]=Te=>C(o).reorderWorkspaces(Te)),onSetWorkspaceSortMode:te[13]||(te[13]=Te=>C(o).setWorkspaceSortMode(Te)),onLoadMoreSessions:te[14]||(te[14]=Te=>void C(o).loadMoreSessions(Te)),onLoadAllSessions:te[15]||(te[15]=Te=>void C(o).loadAllSessions()),onOpenSettings:te[16]||(te[16]=Te=>Mn.value=!0),onCollapse:C(j)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),Ln(ie(uw,{class:"side-handle","storage-key":C(ne),"default-width":C(ce),min:C(de),max:C(Ae),"onUpdate:width":te[17]||(te[17]=Te=>Le.value=Te),"onUpdate:dragging":te[18]||(te[18]=Te=>U.value=Te)},null,8,["storage-key","default-width","min","max"]),[[mi,!C(le)]])],64)),ie(vue,{ref_key:"conversationPaneRef",ref:qn,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:te[21]||(te[21]=Te=>C(Dt)()),onSelectWorkspace:te[22]||(te[22]=Te=>oi(Te)),onAddWorkspace:te[23]||(te[23]=Te=>wn.value=!0),onOpenPr:Ue,onSubmit:te[24]||(te[24]=Te=>ls(Te)),onSteer:te[25]||(te[25]=Te=>C(o).steerPrompt(Te.text,Te.attachments)),onApproval:te[26]||(te[26]=(Te,he)=>C(o).respondApproval(Te,he)),onCancelTask:te[27]||(te[27]=Te=>C(o).cancelTask(Te)),onAnswer:te[28]||(te[28]=(Te,he)=>C(o).respondQuestion(Te,he)),onDismiss:te[29]||(te[29]=Te=>C(o).dismissQuestion(Te)),onCommand:Si,onInterrupt:te[30]||(te[30]=Te=>C(o).abortCurrentPrompt()),onUnqueue:rr,onEditQueued:no,onReorderQueue:rs,onSetPermission:te[31]||(te[31]=Te=>C(o).setPermission(Te)),onSetThinking:te[32]||(te[32]=Te=>C(o).setThinking(Te)),onTogglePlan:te[33]||(te[33]=Te=>C(o).togglePlanMode()),onToggleSwarm:te[34]||(te[34]=Te=>C(o).toggleSwarmMode()),onToggleGoal:te[35]||(te[35]=Te=>C(o).toggleGoalMode()),onCreateGoal:te[36]||(te[36]=Te=>C(o).createGoal(Te)),onControlGoal:te[37]||(te[37]=Te=>C(o).controlGoal(Te)),onRefreshGitStatus:te[38]||(te[38]=Te=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:te[39]||(te[39]=(Te,he)=>C(o).renameSession(Te,he)),onForkSession:te[40]||(te[40]=Te=>C(o).forkSession(Te)),onArchiveSession:te[41]||(te[41]=Te=>Wn(Te)),onExportSession:te[42]||(te[42]=Te=>C(o).exportSession(Te)),onCompact:te[43]||(te[43]=Te=>C(o).compact()),onPickModel:te[44]||(te[44]=Te=>En()),onSelectModel:te[45]||(te[45]=Te=>So(Te)),onOpenFile:te[46]||(te[46]=Te=>C(R)(Te)),onOpenMedia:te[47]||(te[47]=Te=>C(q)(Te)),onOpenThinking:te[48]||(te[48]=Te=>C($e)(Te)),onOpenCompaction:te[49]||(te[49]=Te=>C(et)(Te)),onOpenAgent:te[50]||(te[50]=Te=>C(vt)(Te)),onOpenToolDiff:te[51]||(te[51]=Te=>C(ht)(Te)),onEditMessage:ni},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(a)&&(C($c)||C(le))?(x(),ke(Dn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(le)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(j)},{default:Ee(()=>[ie(Ve,{name:C(le)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):re("",!0),C(Yn)&&!C(a)?(x(),ke(uw,{key:3,class:"preview-handle","storage-key":C(J),"default-width":C(fe),min:C(ye),max:C(ve),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":te[52]||(te[52]=Te=>V.value=Te),"onUpdate:dragging":te[53]||(te[53]=Te=>mo.value=Te)},null,8,["storage-key","default-width","min","max","aria-label"])):re("",!0),!C(a)||C(Yn)?(x(),N("aside",{key:4,class:We(["global-preview",{open:C(Yn),mobile:C(a),"no-anim":C(mo)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Yn)},[T.value==="thinking"&&C(Ce)?(x(),ke(qC,{key:0,text:C(pe)??"",onClose:C(De)},null,8,["text","onClose"])):T.value==="compaction"&&C(Ne)?(x(),ke(qC,{key:1,text:C(ge)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(rt)},null,8,["text","subtitle","onClose"])):T.value==="agent"&&C(St)?(x(),ke(Dde,{key:2,member:C(St),onClose:C(Nt)},null,8,["member","onClose"])):T.value==="btw"&&C(it)?(x(),ke(ife,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:te[54]||(te[54]=Te=>C(o).sendSideChatPrompt(Te)),onClose:C(co)},null,8,["turns","running","sending","onClose"])):T.value==="diff"?(x(),ke($fe,{key:4,mode:C(fn),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(ao),onBack:te[55]||(te[55]=Te=>{fn.value="list",ss.value=null,C(o).clearFileDiff()}),onClose:C(Pn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):T.value==="toolDiff"&&C(Wt)?(x(),ke(Xde,{key:5,target:C(Wt),onClose:C(dn)},null,8,["target","onClose"])):T.value==="file"?(x(),ke(kde,{key:6,file:C(I),loading:C(P),error:C(D),line:C(S)?.line,"download-url":C(W),closable:"","external-actions":C(z),"open-file":C(R),onClose:C(K),onOpenExternal:C(X),onReveal:C(ue)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):re("",!0)],10,Pxe)):re("",!0),ie(Fxe,{class:"internal-build-fab"}),to.value?(x(),ke(Qfe,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:bt.value,unavailable:Pt.value,onSelect:te[56]||(te[56]=Te=>Do(Te)),onToggleStar:te[57]||(te[57]=Te=>C(o).toggleStarModel(Te)),onClose:te[58]||(te[58]=Te=>to.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),Mn.value?(x(),ke(vye,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":Ut.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:te[59]||(te[59]=Te=>C(o).setColorScheme(Te)),onSetAccent:te[60]||(te[60]=Te=>C(o).setAccent(Te)),onSetUiFontSize:te[61]||(te[61]=Te=>C(o).setUiFontSize(Te)),onSetNotify:te[62]||(te[62]=Te=>C(o).setNotifyOnComplete(Te)),onSetNotifyQuestion:te[63]||(te[63]=Te=>C(o).setNotifyOnQuestion(Te)),onSetNotifyApproval:te[64]||(te[64]=Te=>C(o).setNotifyOnApproval(Te)),onSetSound:te[65]||(te[65]=Te=>C(o).setSoundOnComplete(Te)),onSetConversationToc:te[66]||(te[66]=Te=>C(o).setConversationToc(Te)),onUpdateConfig:te[67]||(te[67]=Te=>Po(Te)),onLogin:te[68]||(te[68]=()=>{Mn.value=!1,Ct()}),onLogout:C(o).logout,onOpenOnboarding:te[69]||(te[69]=()=>{Mn.value=!1,A()}),onOpenProviders:te[70]||(te[70]=()=>{Mn.value=!1,jn()}),onClose:te[71]||(te[71]=Te=>Mn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):re("",!0),yn.value?(x(),ke(_he,{key:7,providers:C(o).providers.value,loading:Hn.value,unavailable:rn.value,onAdd:te[72]||(te[72]=Te=>Xo(Te)),onRefresh:te[73]||(te[73]=Te=>Fn(Te)),onDelete:te[74]||(te[74]=Te=>Ps(Te)),onOpenLogin:te[75]||(te[75]=()=>{yn.value=!1,Ct()}),onClose:te[76]||(te[76]=Te=>yn.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),An.value?(x(),ke(kke,{key:8,status:C(o).status.value,thinking:m.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:te[77]||(te[77]=Te=>An.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),wn.value?(x(),ke(oke,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:ze.value,onAdd:te[78]||(te[78]=Te=>No(Te)),onClose:Ci},null,8,["browse-fs","get-fs-home","default-path","error"])):re("",!0),ie(Tl,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?re("",!0):(x(),ke(Obe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&y.value&&!C(g)?(x(),ke(Ebe,{key:10,onComplete:k,onSkip:k})):re("",!0),ie(Ike,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(x(),ke(dxe,{key:11})):re("",!0),ie(lke),C(a)?(x(),ke(c2e,{key:12,modelValue:c.value,"onUpdate:modelValue":te[79]||(te[79]=Te=>c.value=Te),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:te[80]||(te[80]=Te=>C(o).selectSession(Te)),onCreate:Io,onCreateInWorkspace:te[81]||(te[81]=Te=>oi(Te)),onAddWorkspace:te[82]||(te[82]=Te=>wn.value=!0),onRename:te[83]||(te[83]=(Te,he)=>C(o).renameSession(Te,he)),onArchive:te[84]||(te[84]=Te=>Wn(Te)),onDeleteWorkspace:te[85]||(te[85]=Te=>ti(Te)),onLoadMore:te[86]||(te[86]=Te=>void C(o).loadMoreSessions(Te))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),C(a)?(x(),ke(gbe,{key:13,modelValue:u.value,"onUpdate:modelValue":te[87]||(te[87]=Te=>u.value=Te),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:te[88]||(te[88]=Te=>En()),onSetThinking:te[89]||(te[89]=Te=>C(o).setThinking(Te)),onTogglePlan:te[90]||(te[90]=Te=>C(o).togglePlanMode()),onToggleSwarm:te[91]||(te[91]=Te=>C(o).toggleSwarmMode()),onSetPermission:te[92]||(te[92]=Te=>C(o).setPermission(Te)),onSetColorScheme:te[93]||(te[93]=Te=>C(o).setColorScheme(Te)),onSetUiFontSize:te[94]||(te[94]=Te=>C(o).setUiFontSize(Te)),onSetConversationToc:te[95]||(te[95]=Te=>C(o).setConversationToc(Te)),onLogin:te[96]||(te[96]=()=>{u.value=!1,Ct()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):re("",!0)],6)),Zn.value?(x(),ke(epe,{key:3,"on-start-o-auth-login":Ss,"on-poll-o-auth-login":Pi,"on-cancel-o-auth-login":_i,onSuccess:uo,onClose:te[97]||(te[97]=Te=>Zn.value=!1)})):re("",!0)]))}}),Wxe=ct(Hxe,[["__scopeId","data-v-8cd3196b"]]);qte();Qh(Wxe).use(_n).mount("#app");export{TE as $,Z4 as A,kT as B,ko as C,Hwe as D,p4 as E,Pe as F,xy as G,Xe as H,ie as I,QE as J,dwe as K,Li as L,Ze as M,j9 as N,mwe as O,gwe as P,kwe as Q,Fh as R,Ic as S,lm as T,vwe as U,_y as V,pwe as W,zwe as X,ywe as Y,Owe as Z,Uxe as _,U4 as a,Vo as a$,Zo as a0,iy as a1,Xxe as a2,dy as a3,m9 as a4,gn as a5,eu as a6,owe as a7,jwe as a8,lwe as a9,G4 as aA,NT as aB,RT as aC,un as aD,OT as aE,FT as aF,ry as aG,$T as aH,xn as aI,hy as aJ,oT as aK,x as aL,z9 as aM,twe as aN,Nn as aO,L4 as aP,ewe as aQ,Ph as aR,Ro as aS,Rh as aT,Z as aU,Twe as aV,lN as aW,ot as aX,$n as aY,DT as aZ,fwe as a_,uwe as aa,cwe as ab,awe as ac,Iwe as ad,Vwe as ae,jt as af,x9 as ag,im as ah,xl as ai,Dr as aj,fo as ak,Nwe as al,Ks as am,El as an,mt as ao,wwe as ap,_we as aq,kn as ar,gt as as,A9 as at,We as au,zxe as av,Vt as aw,TT as ax,LT as ay,ho as az,Jxe as b,kQ as b$,Dwe as b0,md as b1,jh as b2,Rwe as b3,Ml as b4,GE as b5,jxe as b6,La as b7,uT as b8,Bwe as b9,_s as bA,mi as bB,w9 as bC,$we as bD,Je as bE,fT as bF,swe as bG,hT as bH,Cwe as bI,Ee as bJ,bwe as bK,Ln as bL,Ji as bM,Lwe as bN,xt as bO,nwe as bP,vn as bQ,ms as bR,n_e as bS,aJ as bT,OM as bU,s_e as bV,BX as bW,pk as bX,o_e as bY,pv as bZ,u_e as b_,qxe as ba,O as bb,uh as bc,hwe as bd,tn as be,Gxe as bf,Kxe as bg,I4 as bh,Ewe as bi,Vxe as bj,C as bk,Wd as bl,qwe as bm,Wwe as bn,K9 as bo,iwe as bp,Awe as bq,dT as br,Uwe as bs,xwe as bt,rwe as bu,z4 as bv,Xh as bw,nN as bx,O3 as by,Hg as bz,Fwe as c,yQ as c0,dk as c1,vQ as c2,Jwe as c3,NX as c4,Qwe as c5,wp as c6,Ywe as c7,gQ as c8,TM as c9,c_e as ca,Zwe as cb,f_e as cc,bv as cd,_c as ce,yv as cf,h_e as cg,d_e as ch,t_e as ci,qs as cj,Xwe as ck,e_e as cl,PX as cm,a_e as cn,kv as co,vv as cp,l_e as cq,Gwe as cr,r_e as cs,i_e as ct,Ve as cu,Kwe as cv,ct as cw,Mwe as d,wl as e,Yxe as f,Tl as g,Z9 as h,Zxe as i,Qxe as j,xi as k,Dd as l,To as m,Xp as n,Pr as o,Pwe as p,B as q,Qh as r,ke as s,re as t,N as u,_ as v,r9 as w,Swe as x,i9 as y,aN as z};
|