@moonshot-ai/kimi-code 0.23.4 → 0.23.5
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 +518 -107
- package/dist-web/assets/{CodeBlockNode-DI6gCVXa.js → CodeBlockNode-KR0ZBibg.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-BeZI5g5_.js → CodeBlockShell.vue_vue_type_style_index_0_lang-Bl31Ov6p.js} +1 -1
- package/dist-web/assets/{DesignSystemView-DQSXggUP.js → DesignSystemView-DU67euCs.js} +1 -1
- package/dist-web/assets/{Tooltip-B3YtzPNZ.js → Tooltip-CXVZw3LD.js} +1 -1
- package/dist-web/assets/{arc-bQMfCHSI.js → arc-D-rA9VJS.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-sZkP4A5D.js → architectureDiagram-3BPJPVTR-DCwhZ0-3.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-Cnf-tp-z.js → blockDiagram-GPEHLZMM-7zi2-mzu.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-D1Ej05NX.js → c4Diagram-AAUBKEIU-BUhBYlbI.js} +1 -1
- package/dist-web/assets/channel-B7bRl8z3.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-BhnDBJIi.js → chunk-2J33WTMH-DXfD8jVe.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-CiOLp8_3.js → chunk-4BX2VUAB-RnAXB6Jd.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-aUOZP4x-.js → chunk-55IACEB6-CzyvmHuE.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-CHY14gq8.js → chunk-727SXJPM-BwBvbidm.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-BKQr3gru.js → chunk-AQP2D5EJ-DHeLjRn1.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-BNnO5ZRK.js → chunk-FMBD7UC4-Bm646OfX.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-CzE2E83w.js → chunk-ND2GUHAM-D3VSc8VX.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-BVjSv3p6.js → chunk-QZHKN3VN-BvZn7Sbo.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-CxRebqWF.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CxRebqWF.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-DaSWvU-5.js → cose-bilkent-S5V4N54A-DdsbNmIL.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-VuVwg9z6.js → dagre-BM42HDAG--3VOObN-.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-BI5_WXHg.js → diagram-2AECGRRQ-DeWvFgbz.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-3M89yso9.js → diagram-5GNKFQAL-DthtQYgS.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-C9Qx0fJd.js → diagram-KO2AKTUF-Bt4BtRLc.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-yJ-bCZyw.js → diagram-LMA3HP47-7N499o4j.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-CZnqkQin.js → diagram-OG6HWLK6-Br3CxOQX.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-BQucaPqh.js → erDiagram-TEJ5UH35-BrhRvGW3.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-CNpuVBgN.js → flowDiagram-I6XJVG4X-D-u112mz.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-KIhg0NCT.js → ganttDiagram-6RSMTGT7-DpXOgY93.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-C4YXqCii.js → gitGraphDiagram-PVQCEYII-BzV-RpYW.js} +1 -1
- package/dist-web/assets/{index-CBO7u0oz.js → index-6oRZtoED.js} +26 -26
- package/dist-web/assets/{index-CL0UgQBD.js → index-DEjpFBq9.js} +2 -2
- package/dist-web/assets/{index-v28kS3Hg.js → index-DrI3jjno.js} +1 -1
- package/dist-web/assets/{index10-RB_ZIgWs.js → index10-UVo4gjYR.js} +1 -1
- package/dist-web/assets/{index11-DyrslmWY.js → index11-m1oYWviR.js} +1 -1
- package/dist-web/assets/{index5-Bn5298gF.js → index5-B45mMYRO.js} +1 -1
- package/dist-web/assets/{index6-Di9uDNmo.js → index6-DvvrfRua.js} +1 -1
- package/dist-web/assets/{index7-CL9Ie_DH.js → index7-BUH5Peml.js} +1 -1
- package/dist-web/assets/{index8-CHlcChT0.js → index8-1BPQUZEF.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-DTw-WQIn.js → infoDiagram-5YYISTIA-Cu7fADeQ.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BUmTsigt.js → ishikawaDiagram-YF4QCWOH-CVvnTORb.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-B8yfgocJ.js → journeyDiagram-JHISSGLW-C-69S6wV.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BUcF33Xd.js → kanban-definition-UN3LZRKU-pwEooP5T.js} +1 -1
- package/dist-web/assets/{linear-DY3q771w.js → linear-BQ3ylJG8.js} +1 -1
- package/dist-web/assets/{mermaid.core-D1ZdIpxL.js → mermaid.core-DcE0EhAy.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-ltEULHzt.js → mindmap-definition-RKZ34NQL-DKQ2AZ3h.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-iCUA44fk.js → pieDiagram-4H26LBE5-CHb1kYTj.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-Zrit1Fzo.js → quadrantDiagram-W4KKPZXB-DzFGGLJt.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-n610iR9M.js → requirementDiagram-4Y6WPE33-Bk-5_Exk.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-RQEY2tBl.js → sankeyDiagram-5OEKKPKP-CSxfPrmb.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-QrJ3Ysl6.js → sequenceDiagram-3UESZ5HK-DHFbmk49.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-D0mG4Tjg.js → stateDiagram-AJRCARHV-DR8SEStc.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Cp9aas86.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DacB6B1v.js → timeline-definition-PNZ67QCA-O5r5mf9f.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CXO9WlfO.js → vennDiagram-CIIHVFJN-BRtD6E2o.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-Dj6KWBND.js → vue.runtime.esm-bundler-ClW1ucng.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-BbMWJCmQ.js → wardley-L42UT6IY-BqzYPkrr.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-BIcvmjmV.js → wardleyDiagram-YWT4CUSO-BXjVelBc.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-CX9xzSCM.js → xychartDiagram-2RQKCTM6-Cc97QEmc.js} +1 -1
- package/dist-web/index.html +1 -1
- package/package.json +6 -6
- package/dist-web/assets/channel-UBfbidLp.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-B6r9FPXR.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B6r9FPXR.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CctN1EOf.js +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-DU67euCs.js","assets/DesignSystemView-B0VQ8shl.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-KR0ZBibg.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-Bl31Ov6p.js","assets/index8-1BPQUZEF.js","assets/index11-m1oYWviR.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
3
|
* @vue/shared v3.5.35
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
5
|
* @license MIT
|
|
6
|
-
**/function dp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Gt={},rc=[],li=()=>{},AC=()=>!1,gd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fp=e=>e.startsWith("onUpdate:"),mn=Object.assign,xv=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},N8=Object.prototype.hasOwnProperty,on=(e,t)=>N8.call(e,t),_t=Array.isArray,lc=e=>Ic(e)==="[object Map]",da=e=>Ic(e)==="[object Set]",Y2=e=>Ic(e)==="[object Date]",I8=e=>Ic(e)==="[object RegExp]",It=e=>typeof e=="function",bn=e=>typeof e=="string",zo=e=>typeof e=="symbol",rn=e=>e!==null&&typeof e=="object",_v=e=>(rn(e)||It(e))&&It(e.then)&&It(e.catch),MC=Object.prototype.toString,Ic=e=>MC.call(e),$8=e=>Ic(e).slice(8,-1),hp=e=>Ic(e)==="[object Object]",pp=e=>bn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zl=dp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},L8=/-\w/g,vs=mp(e=>e.replace(L8,t=>t.slice(1).toUpperCase())),F8=/\B([A-Z])/g,go=mp(e=>e.replace(F8,"-$1").toLowerCase()),gp=mp(e=>e.charAt(0).toUpperCase()+e.slice(1)),Df=mp(e=>e?`on${gp(e)}`:""),Is=(e,t)=>!Object.is(e,t),ac=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},EC=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},vp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ih=e=>{const t=bn(e)?Number(e):NaN;return isNaN(t)?e:t};let Z2;const yp=()=>Z2||(Z2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),O8="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",R8=dp(O8);function qt(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bn(s)?H8(s):qt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(bn(e)||rn(e))return e}const B8=/;(?![^(]*\))/g,D8=/:([^]+)/,P8=/\/\*[^]*?\*\//g;function H8(e){const t={};return e.replace(P8,"").split(B8).forEach(n=>{if(n){const s=n.split(D8);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function De(e){let t="";if(bn(e))t=e;else if(_t(e))for(let n=0;n<e.length;n++){const s=De(e[n]);s&&(t+=s+" ")}else if(rn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function
|
|
6
|
+
**/function dp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Gt={},rc=[],li=()=>{},AC=()=>!1,gd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fp=e=>e.startsWith("onUpdate:"),mn=Object.assign,xv=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},N8=Object.prototype.hasOwnProperty,on=(e,t)=>N8.call(e,t),_t=Array.isArray,lc=e=>Ic(e)==="[object Map]",da=e=>Ic(e)==="[object Set]",Y2=e=>Ic(e)==="[object Date]",I8=e=>Ic(e)==="[object RegExp]",It=e=>typeof e=="function",bn=e=>typeof e=="string",zo=e=>typeof e=="symbol",rn=e=>e!==null&&typeof e=="object",_v=e=>(rn(e)||It(e))&&It(e.then)&&It(e.catch),MC=Object.prototype.toString,Ic=e=>MC.call(e),$8=e=>Ic(e).slice(8,-1),hp=e=>Ic(e)==="[object Object]",pp=e=>bn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zl=dp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},L8=/-\w/g,vs=mp(e=>e.replace(L8,t=>t.slice(1).toUpperCase())),F8=/\B([A-Z])/g,go=mp(e=>e.replace(F8,"-$1").toLowerCase()),gp=mp(e=>e.charAt(0).toUpperCase()+e.slice(1)),Df=mp(e=>e?`on${gp(e)}`:""),Is=(e,t)=>!Object.is(e,t),ac=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},EC=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},vp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ih=e=>{const t=bn(e)?Number(e):NaN;return isNaN(t)?e:t};let Z2;const yp=()=>Z2||(Z2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),O8="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",R8=dp(O8);function qt(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bn(s)?H8(s):qt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(bn(e)||rn(e))return e}const B8=/;(?![^(]*\))/g,D8=/:([^]+)/,P8=/\/\*[^]*?\*\//g;function H8(e){const t={};return e.replace(P8,"").split(B8).forEach(n=>{if(n){const s=n.split(D8);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function De(e){let t="";if(bn(e))t=e;else if(_t(e))for(let n=0;n<e.length;n++){const s=De(e[n]);s&&(t+=s+" ")}else if(rn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function z2e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!bn(t)&&(e.class=De(t)),n&&(e.style=qt(n)),e}const W8="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",z8=dp(W8);function TC(e){return!!e||e===""}function U8(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=vr(e[s],t[s]);return n}function vr(e,t){if(e===t)return!0;let n=Y2(e),s=Y2(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=zo(e),s=zo(t),n||s)return e===t;if(n=_t(e),s=_t(t),n||s)return n&&s?U8(e,t):!1;if(n=rn(e),s=rn(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!vr(e[r],t[r]))return!1}}return String(e)===String(t)}function kp(e,t){return e.findIndex(n=>vr(n,t))}const NC=e=>!!(e&&e.__v_isRef===!0),B=e=>bn(e)?e:e==null?"":_t(e)||rn(e)&&(e.toString===MC||!It(e.toString))?NC(e)?B(e.value):JSON.stringify(e,IC,2):String(e),IC=(e,t)=>NC(t)?IC(e,t.value):lc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[f1(s,i)+" =>"]=o,n),{})}:da(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>f1(n))}:zo(t)?f1(t):rn(t)&&!_t(t)&&!hp(t)?String(t):t,f1=(e,t="")=>{var n;return zo(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function j8(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
|
|
7
7
|
* @vue/reactivity v3.5.35
|
|
8
8
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
9
|
* @license MIT
|
|
10
|
-
**/let gs;class $C{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&&gs&&(gs.active?(this.parent=gs,this.index=(gs.scopes||(gs.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=gs;try{return gs=this,t()}finally{gs=n}}}on(){++this._on===1&&(this.prevScope=gs,gs=this)}off(){if(this._on>0&&--this._on===0){if(gs===this)gs=this.prevScope;else{let t=gs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function q8(e){return new $C(e)}function wv(){return gs}function Sv(e,t=!1){gs&&gs.cleanups.push(e)}let Fn;const h1=new WeakSet;class rh{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,gs&&(gs.active?gs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,h1.has(this)&&(h1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||FC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Q2(this),OC(this);const t=Fn,n=_i;Fn=this,_i=!0;try{return this.fn()}finally{RC(this),Fn=t,_i=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Mv(t);this.deps=this.depsTail=void 0,Q2(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?h1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){K0(this)&&this.run()}get dirty(){return K0(this)}}let LC=0,_u,wu;function FC(e,t=!1){if(e.flags|=8,t){e.next=wu,wu=e;return}e.next=_u,_u=e}function Cv(){LC++}function Av(){if(--LC>0)return;if(wu){let t=wu;for(wu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;_u;){let t=_u;for(_u=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function OC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function RC(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Mv(s),V8(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function K0(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(BC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function BC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===zu)||(e.globalVersion=zu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!K0(e))))return;e.flags|=2;const t=e.dep,n=Fn,s=_i;Fn=e,_i=!0;try{OC(e);const o=e.fn(e._value);(t.version===0||Is(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Fn=n,_i=s,RC(e),e.flags&=-3}}function Mv(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Mv(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function V8(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function H2e(e,t){e.effect instanceof rh&&(e=e.effect.fn);const n=new rh(e);t&&mn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function W2e(e){e.effect.stop()}let _i=!0;const DC=[];function yr(){DC.push(_i),_i=!1}function kr(){const e=DC.pop();_i=e===void 0?!0:e}function Q2(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Fn;Fn=void 0;try{t()}finally{Fn=n}}}let zu=0;class K8{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 bp{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Fn||!_i||Fn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Fn)n=this.activeLink=new K8(Fn,this),Fn.deps?(n.prevDep=Fn.depsTail,Fn.depsTail.nextDep=n,Fn.depsTail=n):Fn.deps=Fn.depsTail=n,PC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Fn.depsTail,n.nextDep=void 0,Fn.depsTail.nextDep=n,Fn.depsTail=n,Fn.deps===n&&(Fn.deps=s)}return n}trigger(t){this.version++,zu++,this.notify(t)}notify(t){Cv();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Av()}}}function PC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)PC(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const lh=new WeakMap,Ql=Symbol(""),G0=Symbol(""),Uu=Symbol("");function zs(e,t,n){if(_i&&Fn){let s=lh.get(e);s||lh.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new bp),o.map=s,o.key=n),o.track()}}function cr(e,t,n,s,o,i){const r=lh.get(e);if(!r){zu++;return}const l=a=>{a&&a.trigger()};if(Cv(),t==="clear")r.forEach(l);else{const a=_t(e),c=a&&pp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===Uu||!zo(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Uu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Ql)),lc(e)&&l(r.get(G0)));break;case"delete":a||(l(r.get(Ql)),lc(e)&&l(r.get(G0)));break;case"set":lc(e)&&l(r.get(Ql));break}}Av()}function G8(e,t){const n=lh.get(e);return n&&n.get(t)}function Fa(e){const t=Xt(e);return t===e?t:(zs(t,"iterate",Uu),Oo(e)?t:t.map(Si))}function xp(e){return zs(e=Xt(e),"iterate",Uu),e}function Hi(e,t){return br(e)?xc(nl(e)?Si(t):t):Si(t)}const Y8={__proto__:null,[Symbol.iterator](){return p1(this,Symbol.iterator,e=>Hi(this,e))},concat(...e){return Fa(this).concat(...e.map(t=>_t(t)?Fa(t):t))},entries(){return p1(this,"entries",e=>(e[1]=Hi(this,e[1]),e))},every(e,t){return Xi(this,"every",e,t,void 0,arguments)},filter(e,t){return Xi(this,"filter",e,t,n=>n.map(s=>Hi(this,s)),arguments)},find(e,t){return Xi(this,"find",e,t,n=>Hi(this,n),arguments)},findIndex(e,t){return Xi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Xi(this,"findLast",e,t,n=>Hi(this,n),arguments)},findLastIndex(e,t){return Xi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Xi(this,"forEach",e,t,void 0,arguments)},includes(...e){return m1(this,"includes",e)},indexOf(...e){return m1(this,"indexOf",e)},join(e){return Fa(this).join(e)},lastIndexOf(...e){return m1(this,"lastIndexOf",e)},map(e,t){return Xi(this,"map",e,t,void 0,arguments)},pop(){return su(this,"pop")},push(...e){return su(this,"push",e)},reduce(e,...t){return X2(this,"reduce",e,t)},reduceRight(e,...t){return X2(this,"reduceRight",e,t)},shift(){return su(this,"shift")},some(e,t){return Xi(this,"some",e,t,void 0,arguments)},splice(...e){return su(this,"splice",e)},toReversed(){return Fa(this).toReversed()},toSorted(e){return Fa(this).toSorted(e)},toSpliced(...e){return Fa(this).toSpliced(...e)},unshift(...e){return su(this,"unshift",e)},values(){return p1(this,"values",e=>Hi(this,e))}};function p1(e,t,n){const s=xp(e),o=s[t]();return s!==e&&!Oo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const Z8=Array.prototype;function Xi(e,t,n,s,o,i){const r=xp(e),l=r!==e&&!Oo(e),a=r[t];if(a!==Z8[t]){const d=a.apply(e,i);return l?Si(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Hi(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function X2(e,t,n,s){const o=xp(e),i=o!==e&&!Oo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Hi(e,c)),n.call(this,c,Hi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Hi(e,a):a}function m1(e,t,n){const s=Xt(e);zs(s,"iterate",Uu);const o=s[t](...n);return(o===-1||o===!1)&&Sp(n[0])?(n[0]=Xt(n[0]),s[t](...n)):o}function su(e,t,n=[]){yr(),Cv();const s=Xt(e)[t].apply(e,n);return Av(),kr(),s}const Q8=dp("__proto__,__v_isRef,__isVue"),HC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zo));function X8(e){zo(e)||(e=String(e));const t=Xt(this);return zs(t,"has",e),t.hasOwnProperty(e)}class WC{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?KC:VC:i?qC:jC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=_t(t);if(!o){let a;if(r&&(a=Y8[n]))return a;if(n==="hasOwnProperty")return X8}const l=Reflect.get(t,n,Jn(t)?t:s);if((zo(n)?HC.has(n):Q8(n))||(o||zs(t,"get",n),i))return l;if(Jn(l)){const a=r&&pp(n)?l:l.value;return o&&rn(a)?ah(a):a}return rn(l)?o?ah(l):Ss(l):l}}class zC extends WC{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=_t(t)&&pp(n);if(!this._isShallow){const c=br(i);if(!Oo(s)&&!br(s)&&(i=Xt(i),s=Xt(s)),!r&&Jn(i)&&!Jn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:on(t,n),a=Reflect.set(t,n,s,Jn(t)?t:o);return t===Xt(o)&&(l?Is(s,i)&&cr(t,"set",n,s):cr(t,"add",n,s)),a}deleteProperty(t,n){const s=on(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&cr(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!zo(n)||!HC.has(n))&&zs(t,"has",n),s}ownKeys(t){return zs(t,"iterate",_t(t)?"length":Ql),Reflect.ownKeys(t)}}class UC extends WC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const J8=new zC,eE=new UC,tE=new zC(!0),nE=new UC(!0),Y0=e=>e,nf=e=>Reflect.getPrototypeOf(e);function sE(e,t,n){return function(...s){const o=this.__v_raw,i=Xt(o),r=lc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Y0:t?xc:Si;return!t&&zs(i,"iterate",a?G0:Ql),mn(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 sf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function oE(e,t){const n={get(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);e||(Is(o,l)&&zs(r,"get",o),zs(r,"get",l));const{has:a}=nf(r),c=t?Y0:e?xc:Si;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&zs(Xt(o),"iterate",Ql),o.size},has(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);return e||(Is(o,l)&&zs(r,"has",o),zs(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Xt(l),c=t?Y0:e?xc:Si;return!e&&zs(a,"iterate",Ql),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return mn(n,e?{add:sf("add"),set:sf("set"),delete:sf("delete"),clear:sf("clear")}:{add(o){const i=Xt(this),r=nf(i),l=Xt(o),a=!t&&!Oo(o)&&!br(o)?l:o;return r.has.call(i,a)||Is(o,a)&&r.has.call(i,o)||Is(l,a)&&r.has.call(i,l)||(i.add(a),cr(i,"add",a,a)),this},set(o,i){!t&&!Oo(i)&&!br(i)&&(i=Xt(i));const r=Xt(this),{has:l,get:a}=nf(r);let c=l.call(r,o);c||(o=Xt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Is(i,u)&&cr(r,"set",o,i):cr(r,"add",o,i),this},delete(o){const i=Xt(this),{has:r,get:l}=nf(i);let a=r.call(i,o);a||(o=Xt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&cr(i,"delete",o,void 0),c},clear(){const o=Xt(this),i=o.size!==0,r=o.clear();return i&&cr(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=sE(o,e,t)}),n}function _p(e,t){const n=oE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(on(n,o)&&o in s?n:s,o,i)}const iE={get:_p(!1,!1)},rE={get:_p(!1,!0)},lE={get:_p(!0,!1)},aE={get:_p(!0,!0)},jC=new WeakMap,qC=new WeakMap,VC=new WeakMap,KC=new WeakMap;function cE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ss(e){return br(e)?e:wp(e,!1,J8,iE,jC)}function uE(e){return wp(e,!1,tE,rE,qC)}function ah(e){return wp(e,!0,eE,lE,VC)}function z2e(e){return wp(e,!0,nE,aE,KC)}function wp(e,t,n,s,o){if(!rn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=cE($8(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function nl(e){return br(e)?nl(e.__v_raw):!!(e&&e.__v_isReactive)}function br(e){return!!(e&&e.__v_isReadonly)}function Oo(e){return!!(e&&e.__v_isShallow)}function Sp(e){return e?!!e.__v_raw:!1}function Xt(e){const t=e&&e.__v_raw;return t?Xt(t):e}function mt(e){return!on(e,"__v_skip")&&Object.isExtensible(e)&&EC(e,"__v_skip",!0),e}const Si=e=>rn(e)?Ss(e):e,xc=e=>rn(e)?ah(e):e;function Jn(e){return e?e.__v_isRef===!0:!1}function Q(e){return GC(e,!1)}function fa(e){return GC(e,!0)}function GC(e,t){return Jn(e)?e:new dE(e,t)}class dE{constructor(t,n){this.dep=new bp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Xt(t),this._value=n?t:Si(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Oo(t)||br(t);t=s?t:Xt(t),Is(t,n)&&(this._rawValue=t,this._value=s?t:Si(t),this.dep.trigger())}}function U2e(e){e.dep&&e.dep.trigger()}function C(e){return Jn(e)?e.value:e}function YC(e){return It(e)?e():C(e)}const fE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Jn(o)&&!Jn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function ZC(e){return nl(e)?e:new Proxy(e,fE)}class hE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new bp,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function pE(e){return new hE(e)}function j2e(e){const t=_t(e)?new Array(e.length):{};for(const n in e)t[n]=QC(e,n);return t}class mE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=zo(n)?n:String(n),this._raw=Xt(t);let o=!0,i=t;if(!_t(t)||zo(this._key)||!pp(this._key))do o=!Sp(i)||Oo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Jn(this._raw[this._key])){const n=this._object[this._key];if(Jn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return G8(this._raw,this._key)}}class gE{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 q2e(e,t,n){return Jn(e)?e:It(e)?new gE(e):rn(e)&&arguments.length>1?QC(e,t,n):Q(e)}function QC(e,t,n){return new mE(e,t,n)}class vE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new bp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Fn!==this)return FC(this,!0),!0}get value(){const t=this.dep.track();return BC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function yE(e,t,n=!1){let s,o;return It(e)?s=e:(s=e.get,o=e.set),new vE(s,o,n)}const V2e={GET:"get",HAS:"has",ITERATE:"iterate"},K2e={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},of={},ch=new WeakMap;let Vr;function G2e(){return Vr}function kE(e,t=!1,n=Vr){if(n){let s=ch.get(n);s||ch.set(n,s=[]),s.push(e)}}function bE(e,t,n=Gt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Oo(y)||o===!1||o===0?ur(y,1):ur(y);let u,d,f,p,h=!1,m=!1;if(Jn(e)?(d=()=>e.value,h=Oo(e)):nl(e)?(d=()=>c(e),h=!0):_t(e)?(m=!0,h=e.some(y=>nl(y)||Oo(y)),d=()=>e.map(y=>{if(Jn(y))return y.value;if(nl(y))return c(y);if(It(y))return a?a(y,2):y()})):It(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){yr();try{f()}finally{kr()}}const y=Vr;Vr=u;try{return a?a(e,3,[p]):e(p)}finally{Vr=y}}:d=li,t&&o){const y=d,A=o===!0?1/0:o;d=()=>ur(y(),A)}const _=wv(),k=()=>{u.stop(),_&&_.active&&xv(_.effects,u)};if(i&&t){const y=t;t=(...A)=>{y(...A),k()}}let g=m?new Array(e.length).fill(of):of;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const A=u.run();if(o||h||(m?A.some((L,$)=>Is(L,g[$])):Is(A,g))){f&&f();const L=Vr;Vr=u;try{const $=[A,g===of?void 0:m&&g[0]===of?[]:g,p];g=A,a?a(t,3,$):t(...$)}finally{Vr=L}}}else u.run()};return l&&l(v),u=new rh(d),u.scheduler=r?()=>r(v,!1):v,p=y=>kE(y,!1,u),f=u.onStop=()=>{const y=ch.get(u);if(y){if(a)a(y,4);else for(const A of y)A();ch.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function ur(e,t=1/0,n){if(t<=0||!rn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Jn(e))ur(e.value,t,n);else if(_t(e))for(let s=0;s<e.length;s++)ur(e[s],t,n);else if(da(e)||lc(e))e.forEach(s=>{ur(s,t,n)});else if(hp(e)){for(const s in e)ur(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&ur(e[s],t,n)}return e}/**
|
|
10
|
+
**/let gs;class $C{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&&gs&&(gs.active?(this.parent=gs,this.index=(gs.scopes||(gs.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=gs;try{return gs=this,t()}finally{gs=n}}}on(){++this._on===1&&(this.prevScope=gs,gs=this)}off(){if(this._on>0&&--this._on===0){if(gs===this)gs=this.prevScope;else{let t=gs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function q8(e){return new $C(e)}function wv(){return gs}function Sv(e,t=!1){gs&&gs.cleanups.push(e)}let Fn;const h1=new WeakSet;class rh{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,gs&&(gs.active?gs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,h1.has(this)&&(h1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||FC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Q2(this),OC(this);const t=Fn,n=_i;Fn=this,_i=!0;try{return this.fn()}finally{RC(this),Fn=t,_i=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Mv(t);this.deps=this.depsTail=void 0,Q2(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?h1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){K0(this)&&this.run()}get dirty(){return K0(this)}}let LC=0,_u,wu;function FC(e,t=!1){if(e.flags|=8,t){e.next=wu,wu=e;return}e.next=_u,_u=e}function Cv(){LC++}function Av(){if(--LC>0)return;if(wu){let t=wu;for(wu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;_u;){let t=_u;for(_u=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function OC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function RC(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Mv(s),V8(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function K0(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(BC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function BC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===zu)||(e.globalVersion=zu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!K0(e))))return;e.flags|=2;const t=e.dep,n=Fn,s=_i;Fn=e,_i=!0;try{OC(e);const o=e.fn(e._value);(t.version===0||Is(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Fn=n,_i=s,RC(e),e.flags&=-3}}function Mv(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Mv(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function V8(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function U2e(e,t){e.effect instanceof rh&&(e=e.effect.fn);const n=new rh(e);t&&mn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function j2e(e){e.effect.stop()}let _i=!0;const DC=[];function yr(){DC.push(_i),_i=!1}function kr(){const e=DC.pop();_i=e===void 0?!0:e}function Q2(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Fn;Fn=void 0;try{t()}finally{Fn=n}}}let zu=0;class K8{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 bp{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Fn||!_i||Fn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Fn)n=this.activeLink=new K8(Fn,this),Fn.deps?(n.prevDep=Fn.depsTail,Fn.depsTail.nextDep=n,Fn.depsTail=n):Fn.deps=Fn.depsTail=n,PC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Fn.depsTail,n.nextDep=void 0,Fn.depsTail.nextDep=n,Fn.depsTail=n,Fn.deps===n&&(Fn.deps=s)}return n}trigger(t){this.version++,zu++,this.notify(t)}notify(t){Cv();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Av()}}}function PC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)PC(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const lh=new WeakMap,Ql=Symbol(""),G0=Symbol(""),Uu=Symbol("");function zs(e,t,n){if(_i&&Fn){let s=lh.get(e);s||lh.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new bp),o.map=s,o.key=n),o.track()}}function cr(e,t,n,s,o,i){const r=lh.get(e);if(!r){zu++;return}const l=a=>{a&&a.trigger()};if(Cv(),t==="clear")r.forEach(l);else{const a=_t(e),c=a&&pp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===Uu||!zo(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Uu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Ql)),lc(e)&&l(r.get(G0)));break;case"delete":a||(l(r.get(Ql)),lc(e)&&l(r.get(G0)));break;case"set":lc(e)&&l(r.get(Ql));break}}Av()}function G8(e,t){const n=lh.get(e);return n&&n.get(t)}function Fa(e){const t=Xt(e);return t===e?t:(zs(t,"iterate",Uu),Oo(e)?t:t.map(Si))}function xp(e){return zs(e=Xt(e),"iterate",Uu),e}function Hi(e,t){return br(e)?xc(nl(e)?Si(t):t):Si(t)}const Y8={__proto__:null,[Symbol.iterator](){return p1(this,Symbol.iterator,e=>Hi(this,e))},concat(...e){return Fa(this).concat(...e.map(t=>_t(t)?Fa(t):t))},entries(){return p1(this,"entries",e=>(e[1]=Hi(this,e[1]),e))},every(e,t){return Xi(this,"every",e,t,void 0,arguments)},filter(e,t){return Xi(this,"filter",e,t,n=>n.map(s=>Hi(this,s)),arguments)},find(e,t){return Xi(this,"find",e,t,n=>Hi(this,n),arguments)},findIndex(e,t){return Xi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Xi(this,"findLast",e,t,n=>Hi(this,n),arguments)},findLastIndex(e,t){return Xi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Xi(this,"forEach",e,t,void 0,arguments)},includes(...e){return m1(this,"includes",e)},indexOf(...e){return m1(this,"indexOf",e)},join(e){return Fa(this).join(e)},lastIndexOf(...e){return m1(this,"lastIndexOf",e)},map(e,t){return Xi(this,"map",e,t,void 0,arguments)},pop(){return su(this,"pop")},push(...e){return su(this,"push",e)},reduce(e,...t){return X2(this,"reduce",e,t)},reduceRight(e,...t){return X2(this,"reduceRight",e,t)},shift(){return su(this,"shift")},some(e,t){return Xi(this,"some",e,t,void 0,arguments)},splice(...e){return su(this,"splice",e)},toReversed(){return Fa(this).toReversed()},toSorted(e){return Fa(this).toSorted(e)},toSpliced(...e){return Fa(this).toSpliced(...e)},unshift(...e){return su(this,"unshift",e)},values(){return p1(this,"values",e=>Hi(this,e))}};function p1(e,t,n){const s=xp(e),o=s[t]();return s!==e&&!Oo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const Z8=Array.prototype;function Xi(e,t,n,s,o,i){const r=xp(e),l=r!==e&&!Oo(e),a=r[t];if(a!==Z8[t]){const d=a.apply(e,i);return l?Si(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Hi(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function X2(e,t,n,s){const o=xp(e),i=o!==e&&!Oo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Hi(e,c)),n.call(this,c,Hi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Hi(e,a):a}function m1(e,t,n){const s=Xt(e);zs(s,"iterate",Uu);const o=s[t](...n);return(o===-1||o===!1)&&Sp(n[0])?(n[0]=Xt(n[0]),s[t](...n)):o}function su(e,t,n=[]){yr(),Cv();const s=Xt(e)[t].apply(e,n);return Av(),kr(),s}const Q8=dp("__proto__,__v_isRef,__isVue"),HC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zo));function X8(e){zo(e)||(e=String(e));const t=Xt(this);return zs(t,"has",e),t.hasOwnProperty(e)}class WC{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?KC:VC:i?qC:jC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=_t(t);if(!o){let a;if(r&&(a=Y8[n]))return a;if(n==="hasOwnProperty")return X8}const l=Reflect.get(t,n,Jn(t)?t:s);if((zo(n)?HC.has(n):Q8(n))||(o||zs(t,"get",n),i))return l;if(Jn(l)){const a=r&&pp(n)?l:l.value;return o&&rn(a)?ah(a):a}return rn(l)?o?ah(l):Ss(l):l}}class zC extends WC{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=_t(t)&&pp(n);if(!this._isShallow){const c=br(i);if(!Oo(s)&&!br(s)&&(i=Xt(i),s=Xt(s)),!r&&Jn(i)&&!Jn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:on(t,n),a=Reflect.set(t,n,s,Jn(t)?t:o);return t===Xt(o)&&(l?Is(s,i)&&cr(t,"set",n,s):cr(t,"add",n,s)),a}deleteProperty(t,n){const s=on(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&cr(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!zo(n)||!HC.has(n))&&zs(t,"has",n),s}ownKeys(t){return zs(t,"iterate",_t(t)?"length":Ql),Reflect.ownKeys(t)}}class UC extends WC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const J8=new zC,eE=new UC,tE=new zC(!0),nE=new UC(!0),Y0=e=>e,nf=e=>Reflect.getPrototypeOf(e);function sE(e,t,n){return function(...s){const o=this.__v_raw,i=Xt(o),r=lc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Y0:t?xc:Si;return!t&&zs(i,"iterate",a?G0:Ql),mn(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 sf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function oE(e,t){const n={get(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);e||(Is(o,l)&&zs(r,"get",o),zs(r,"get",l));const{has:a}=nf(r),c=t?Y0:e?xc:Si;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&zs(Xt(o),"iterate",Ql),o.size},has(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);return e||(Is(o,l)&&zs(r,"has",o),zs(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Xt(l),c=t?Y0:e?xc:Si;return!e&&zs(a,"iterate",Ql),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return mn(n,e?{add:sf("add"),set:sf("set"),delete:sf("delete"),clear:sf("clear")}:{add(o){const i=Xt(this),r=nf(i),l=Xt(o),a=!t&&!Oo(o)&&!br(o)?l:o;return r.has.call(i,a)||Is(o,a)&&r.has.call(i,o)||Is(l,a)&&r.has.call(i,l)||(i.add(a),cr(i,"add",a,a)),this},set(o,i){!t&&!Oo(i)&&!br(i)&&(i=Xt(i));const r=Xt(this),{has:l,get:a}=nf(r);let c=l.call(r,o);c||(o=Xt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Is(i,u)&&cr(r,"set",o,i):cr(r,"add",o,i),this},delete(o){const i=Xt(this),{has:r,get:l}=nf(i);let a=r.call(i,o);a||(o=Xt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&cr(i,"delete",o,void 0),c},clear(){const o=Xt(this),i=o.size!==0,r=o.clear();return i&&cr(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=sE(o,e,t)}),n}function _p(e,t){const n=oE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(on(n,o)&&o in s?n:s,o,i)}const iE={get:_p(!1,!1)},rE={get:_p(!1,!0)},lE={get:_p(!0,!1)},aE={get:_p(!0,!0)},jC=new WeakMap,qC=new WeakMap,VC=new WeakMap,KC=new WeakMap;function cE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ss(e){return br(e)?e:wp(e,!1,J8,iE,jC)}function uE(e){return wp(e,!1,tE,rE,qC)}function ah(e){return wp(e,!0,eE,lE,VC)}function q2e(e){return wp(e,!0,nE,aE,KC)}function wp(e,t,n,s,o){if(!rn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=cE($8(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function nl(e){return br(e)?nl(e.__v_raw):!!(e&&e.__v_isReactive)}function br(e){return!!(e&&e.__v_isReadonly)}function Oo(e){return!!(e&&e.__v_isShallow)}function Sp(e){return e?!!e.__v_raw:!1}function Xt(e){const t=e&&e.__v_raw;return t?Xt(t):e}function mt(e){return!on(e,"__v_skip")&&Object.isExtensible(e)&&EC(e,"__v_skip",!0),e}const Si=e=>rn(e)?Ss(e):e,xc=e=>rn(e)?ah(e):e;function Jn(e){return e?e.__v_isRef===!0:!1}function Q(e){return GC(e,!1)}function fa(e){return GC(e,!0)}function GC(e,t){return Jn(e)?e:new dE(e,t)}class dE{constructor(t,n){this.dep=new bp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Xt(t),this._value=n?t:Si(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Oo(t)||br(t);t=s?t:Xt(t),Is(t,n)&&(this._rawValue=t,this._value=s?t:Si(t),this.dep.trigger())}}function V2e(e){e.dep&&e.dep.trigger()}function C(e){return Jn(e)?e.value:e}function YC(e){return It(e)?e():C(e)}const fE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Jn(o)&&!Jn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function ZC(e){return nl(e)?e:new Proxy(e,fE)}class hE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new bp,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function pE(e){return new hE(e)}function K2e(e){const t=_t(e)?new Array(e.length):{};for(const n in e)t[n]=QC(e,n);return t}class mE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=zo(n)?n:String(n),this._raw=Xt(t);let o=!0,i=t;if(!_t(t)||zo(this._key)||!pp(this._key))do o=!Sp(i)||Oo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Jn(this._raw[this._key])){const n=this._object[this._key];if(Jn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return G8(this._raw,this._key)}}class gE{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 G2e(e,t,n){return Jn(e)?e:It(e)?new gE(e):rn(e)&&arguments.length>1?QC(e,t,n):Q(e)}function QC(e,t,n){return new mE(e,t,n)}class vE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new bp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Fn!==this)return FC(this,!0),!0}get value(){const t=this.dep.track();return BC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function yE(e,t,n=!1){let s,o;return It(e)?s=e:(s=e.get,o=e.set),new vE(s,o,n)}const Y2e={GET:"get",HAS:"has",ITERATE:"iterate"},Z2e={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},of={},ch=new WeakMap;let Vr;function Q2e(){return Vr}function kE(e,t=!1,n=Vr){if(n){let s=ch.get(n);s||ch.set(n,s=[]),s.push(e)}}function bE(e,t,n=Gt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Oo(y)||o===!1||o===0?ur(y,1):ur(y);let u,d,f,p,h=!1,m=!1;if(Jn(e)?(d=()=>e.value,h=Oo(e)):nl(e)?(d=()=>c(e),h=!0):_t(e)?(m=!0,h=e.some(y=>nl(y)||Oo(y)),d=()=>e.map(y=>{if(Jn(y))return y.value;if(nl(y))return c(y);if(It(y))return a?a(y,2):y()})):It(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){yr();try{f()}finally{kr()}}const y=Vr;Vr=u;try{return a?a(e,3,[p]):e(p)}finally{Vr=y}}:d=li,t&&o){const y=d,A=o===!0?1/0:o;d=()=>ur(y(),A)}const _=wv(),k=()=>{u.stop(),_&&_.active&&xv(_.effects,u)};if(i&&t){const y=t;t=(...A)=>{y(...A),k()}}let g=m?new Array(e.length).fill(of):of;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const A=u.run();if(o||h||(m?A.some((L,$)=>Is(L,g[$])):Is(A,g))){f&&f();const L=Vr;Vr=u;try{const $=[A,g===of?void 0:m&&g[0]===of?[]:g,p];g=A,a?a(t,3,$):t(...$)}finally{Vr=L}}}else u.run()};return l&&l(v),u=new rh(d),u.scheduler=r?()=>r(v,!1):v,p=y=>kE(y,!1,u),f=u.onStop=()=>{const y=ch.get(u);if(y){if(a)a(y,4);else for(const A of y)A();ch.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function ur(e,t=1/0,n){if(t<=0||!rn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Jn(e))ur(e.value,t,n);else if(_t(e))for(let s=0;s<e.length;s++)ur(e[s],t,n);else if(da(e)||lc(e))e.forEach(s=>{ur(s,t,n)});else if(hp(e)){for(const s in e)ur(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&ur(e[s],t,n)}return e}/**
|
|
11
11
|
* @vue/runtime-core v3.5.35
|
|
12
12
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
13
|
* @license MIT
|
|
14
|
-
**/const XC=[];function xE(e){XC.push(e)}function _E(){XC.pop()}function Y2e(e,t){}const Z2e={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"},wE={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 vd(e,t,n,s){try{return s?e(...s):e()}catch(o){$c(o,t,n)}}function ui(e,t,n,s){if(It(e)){const o=vd(e,t,n,s);return o&&_v(o)&&o.catch(i=>{$c(i,t,n)}),o}if(_t(e)){const o=[];for(let i=0;i<e.length;i++)o.push(ui(e[i],t,n,s));return o}}function $c(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Gt;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){yr(),vd(i,null,10,[e,a,c]),kr();return}}SE(e,n,o,s,r)}function SE(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Js=[];let Ri=-1;const cc=[];let Kr=null,ja=0;const JC=Promise.resolve();let uh=null;function pt(e){const t=uh||JC;return e?t.then(this?e.bind(this):e):t}function CE(e){let t=Ri+1,n=Js.length;for(;t<n;){const s=t+n>>>1,o=Js[s],i=ju(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function Ev(e){if(!(e.flags&1)){const t=ju(e),n=Js[Js.length-1];!n||!(e.flags&2)&&t>=ju(n)?Js.push(e):Js.splice(CE(t),0,e),e.flags|=1,e4()}}function e4(){uh||(uh=JC.then(t4))}function dh(e){_t(e)?cc.push(...e):Kr&&e.id===-1?Kr.splice(ja+1,0,e):e.flags&1||(cc.push(e),e.flags|=1),e4()}function J2(e,t,n=Ri+1){for(;n<Js.length;n++){const s=Js[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Js.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function fh(e){if(cc.length){const t=[...new Set(cc)].sort((n,s)=>ju(n)-ju(s));if(cc.length=0,Kr){Kr.push(...t);return}for(Kr=t,ja=0;ja<Kr.length;ja++){const n=Kr[ja];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Kr=null,ja=0}}const ju=e=>e.id==null?e.flags&2?-1:1/0:e.id;function t4(e){try{for(Ri=0;Ri<Js.length;Ri++){const t=Js[Ri];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),vd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ri<Js.length;Ri++){const t=Js[Ri];t&&(t.flags&=-2)}Ri=-1,Js.length=0,fh(),uh=null,(Js.length||cc.length)&&t4()}}let qa,rf=[];function n4(e,t){var n,s;qa=e,qa?(qa.enabled=!0,rf.forEach(({event:o,args:i})=>qa.emit(o,...i)),rf=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{n4(i,t)}),setTimeout(()=>{qa||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,rf=[])},3e3)):rf=[]}let Fs=null,Cp=null;function qu(e){const t=Fs;return Fs=e,Cp=e&&e.type.__scopeId||null,t}function Q2e(e){Cp=e}function X2e(){Cp=null}const J2e=e=>Ee;function Ee(e,t=Fs,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&vh(-1);const i=qu(t);let r;try{r=e(...o)}finally{qu(i),s._d&&vh(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Tn(e,t){if(Fs===null)return e;const n=xd(Fs),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Gt]=t[o];i&&(It(i)&&(i={mounted:i,updated:i}),i.deep&&ur(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Bi(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(yr(),ui(a,n,8,[e.el,l,e,t]),kr())}}function An(e,t){if(Ls){let n=Ls.provides;const s=Ls.parent&&Ls.parent.provides;s===n&&(n=Ls.provides=Object.create(s)),n[e]=t}}function Ut(e,t,n=!1){const s=Os();if(s||Xl){let o=Xl?Xl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&It(t)?t.call(s&&s.proxy):t}}function ebe(){return!!(Os()||Xl)}const AE=Symbol.for("v-scx"),ME=()=>Ut(AE);function EE(e,t){return yd(e,null,t)}function tbe(e,t){return yd(e,null,{flush:"post"})}function TE(e,t){return yd(e,null,{flush:"sync"})}function Ke(e,t,n){return yd(e,t,n)}function yd(e,t,n=Gt){const{immediate:s,deep:o,flush:i,once:r}=n,l=mn({},n),a=t&&s||!t&&i!=="post";let c;if(ia){if(i==="sync"){const p=ME();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=li,p.resume=li,p.pause=li,p}}const u=Ls;l.call=(p,h,m)=>ui(p,u,h,m);let d=!1;i==="post"?l.scheduler=p=>{os(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():Ev(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=bE(e,t,l);return ia&&(c?c.push(f):a&&f()),f}function NE(e,t,n){const s=this.proxy,o=bn(e)?e.includes(".")?s4(s,e):()=>s[e]:e.bind(s,s);let i;It(t)?i=t:(i=t.handler,n=t);const r=Lc(this),l=yd(o,i.bind(s),n);return r(),l}function s4(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Ur=new WeakMap,o4=Symbol("_vte"),i4=e=>e.__isTeleport,zl=e=>e&&(e.disabled||e.disabled===""),IE=e=>e&&(e.defer||e.defer===""),eb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,tb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Z0=(e,t)=>{const n=e&&e.to;return bn(n)?t?t(n):null:n},$E={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:_,parentNode:k}}=c,g=zl(t.props);let{dynamicChildren:v}=t;const y=($,x,E)=>{$.shapeFlag&16&&u($.children,x,E,o,i,r,l,a)},A=($=t)=>{const x=zl($.props),E=$.target=Z0($.props,h),N=Q0(E,$,m,p);E&&(r!=="svg"&&eb(E)?r="svg":r!=="mathml"&&tb(E)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(E),x||(y($,E,N),pu($,!1)))},L=$=>{const x=()=>{if(Ur.get($)===x){if(Ur.delete($),zl($.props)){const E=k($.el)||n;y($,E,$.anchor),pu($,!0)}A($)}};Ur.set($,x),os(x,i)};if(e==null){const $=t.el=m(""),x=t.anchor=m("");if(p($,n,s),p(x,n,s),IE(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,x),pu(t,!0)),A()}else{t.el=e.el;const $=t.anchor=e.anchor,x=Ur.get(e);if(x){x.flags|=8,Ur.delete(e),L(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=zl(e.props),S=F?n:E,T=F?$:N;if(r==="svg"||eb(E)?r="svg":(r==="mathml"||tb(E))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),Pv(e,t,!0)):a||d(e,t,S,T,o,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):lf(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Z0(t.props,h);R&&lf(t,R,null,c,0)}else F&&lf(t,E,N,c,1);pu(t,g)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,p=i||!zl(f),h=Ur.get(e);if(h&&(h.flags|=8,Ur.delete(e)),d&&(o(c),o(u)),i&&o(a),!h&&r&16)for(let m=0;m<l.length;m++){const _=l[m];s(_,t,n,p,!!_.dynamicChildren)}},move:lf,hydrate:LE};function lf(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!Ur.has(e)&&(!d||zl(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function LE(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function p(_,k){k.anchor=d(r(_),k,l(_),n,s,o,i)}const h=t.target=Z0(t.props,a),m=zl(t.props);if(h){const _=h._lpa||h.firstChild;t.shapeFlag&16&&(m?(p(e,t),f(h,_),t.targetAnchor||Q0(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,_),t.targetAnchor||Q0(h,t,u,c),d(_&&r(_),t,h,n,s,o,i))),pu(t,m)}else m&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Ap=$E;function pu(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Q0(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[o4]=r,e&&(s(i,e,o),s(r,e,o)),r}const ti=Symbol("_leaveCb"),ou=Symbol("_enterCb");function r4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ln(()=>{e.isMounted=!0}),es(()=>{e.isUnmounting=!0}),e}const Zo=[Function,Array],l4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Zo,onEnter:Zo,onAfterEnter:Zo,onEnterCancelled:Zo,onBeforeLeave:Zo,onLeave:Zo,onAfterLeave:Zo,onLeaveCancelled:Zo,onBeforeAppear:Zo,onAppear:Zo,onAfterAppear:Zo,onAppearCancelled:Zo},a4=e=>{const t=e.subTree;return t.component?a4(t.component):t},FE={name:"BaseTransition",props:l4,setup(e,{slots:t}){const n=Os(),s=r4();return()=>{const o=t.default&&Tv(t.default(),!0),i=o&&o.length?c4(o):n.subTree?le():void 0;if(!i)return;const r=Xt(e),{mode:l}=r;if(s.isLeaving)return g1(i);const a=nb(i);if(!a)return g1(i);let c=Vu(a,r,s,n,d=>c=d);a.type!==rs&&ll(a,c);let u=n.subTree&&nb(n.subTree);if(u&&u.type!==rs&&!yi(u,a)&&a4(n).type!==rs){let d=Vu(u,r,s,n);if(ll(u,d),l==="out-in"&&a.type!==rs)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},g1(i);l==="in-out"&&a.type!==rs?d.delayLeave=(f,p,h)=>{const m=u4(s,u);m[String(u.key)]=u,f[ti]=()=>{p(),f[ti]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function c4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==rs){t=n;break}}return t}const OE=FE;function u4(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Vu(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:_,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),A=u4(n,e),L=(E,N)=>{E&&ui(E,s,9,N)},$=(E,N)=>{const F=N[1];L(E,N),_t(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(E){let N=a;if(!n.isMounted)if(i)N=_||a;else return;E[ti]&&E[ti](!0);const F=A[y];F&&yi(e,F)&&F.el[ti]&&F.el[ti](),L(N,[E])},enter(E){if(A[y]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=k||c,F=g||u,S=v||d;else return;let T=!1;E[ou]=O=>{T||(T=!0,O?L(S,[E]):L(F,[E]),x.delayedLeave&&x.delayedLeave(),E[ou]=void 0)};const R=E[ou].bind(null,!1);N?$(N,[E,R]):R()},leave(E,N){const F=String(e.key);if(E[ou]&&E[ou](!0),n.isUnmounting)return N();L(f,[E]);let S=!1;E[ti]=R=>{S||(S=!0,N(),R?L(m,[E]):L(h,[E]),E[ti]=void 0,A[F]===e&&delete A[F])};const T=E[ti].bind(null,!1);A[F]=e,p?$(p,[E,T]):T()},clone(E){const N=Vu(E,t,n,s,o);return o&&o(N),N}};return x}function g1(e){if(kd(e))return e=xr(e),e.children=null,e}function nb(e){if(!kd(e))return i4(e.type)&&e.children?c4(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&&It(n.default))return n.default()}}function ll(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ll(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 Tv(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Be?(r.patchFlag&128&&o++,s=s.concat(Tv(r.children,t,l))):(t||r.type!==rs)&&s.push(l!=null?xr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function qe(e,t){return It(e)?mn({name:e.name},t,{setup:e}):e}function nbe(){const e=Os();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Nv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function sbe(e){const t=Os(),n=fa(null);if(t){const o=t.refs===Gt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function sb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const hh=new WeakMap;function uc(e,t,n,s,o=!1){if(_t(e)){e.forEach((m,_)=>uc(m,t&&(_t(t)?t[_]:t),n,s,o));return}if(mr(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&uc(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?xd(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Gt?l.refs={}:l.refs,d=l.setupState,f=Xt(d),p=d===Gt?AC:m=>sb(u,m)?!1:on(f,m),h=(m,_)=>!(_&&sb(u,_));if(c!=null&&c!==a){if(ob(t),bn(c))u[c]=null,p(c)&&(d[c]=null);else if(Jn(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(It(a))vd(a,l,12,[r,u]);else{const m=bn(a),_=Jn(a);if(m||_){const k=()=>{if(e.f){const g=m?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(o)_t(g)&&xv(g,i);else if(_t(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],p(a)&&(d[a]=u[a]);else{const v=[i];h(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,p(a)&&(d[a]=r)):_&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),hh.delete(e)};g.id=-1,hh.set(e,g),os(g,n)}else ob(e),k()}}}function ob(e){const t=hh.get(e);t&&(t.flags|=8,hh.delete(e))}let ib=!1;const Oa=()=>{ib||(console.error("Hydration completed but contains mismatches."),ib=!0)},RE=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",BE=e=>e.namespaceURI.includes("MathML"),af=e=>{if(e.nodeType===1){if(RE(e))return"svg";if(BE(e))return"mathml"}},Ja=e=>e.nodeType===8;function DE(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),fh(),y._vnode=v;return}d(y.firstChild,v,null,null,null),fh(),y._vnode=v},d=(v,y,A,L,$,x=!1)=>{x=x||!!y.dynamicChildren;const E=Ja(v)&&v.data==="[",N=()=>m(v,y,A,L,$,E),{type:F,ref:S,shapeFlag:T,patchFlag:R}=y;let O=v.nodeType;y.el=v,R===-2&&(x=!1,y.dynamicChildren=null);let D=null;switch(F){case sl:O!==3?y.children===""?(a(y.el=o(""),r(v),v),D=v):D=N():(v.data!==y.children&&(Oa(),v.data=y.children),D=i(v));break;case rs:g(v)?(D=i(v),k(y.el=v.content.firstChild,v,A)):O!==8||E?D=N():D=i(v);break;case fc:if(E&&(v=i(v),O=v.nodeType),O===1||O===3){D=v;const W=!y.children.length;for(let z=0;z<y.staticCount;z++)W&&(y.children+=D.nodeType===1?D.outerHTML:D.data),z===y.staticCount-1&&(y.anchor=D),D=i(D);return E?i(D):D}else N();break;case Be:E?D=h(v,y,A,L,$,x):D=N();break;default:if(T&1)(O!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?D=N():D=f(v,y,A,L,$,x);else if(T&6){y.slotScopeIds=$;const W=r(v);if(E?D=_(v):Ja(v)&&v.data==="teleport start"?D=_(v,v.data,"teleport end"):D=i(v),t(y,W,null,A,L,af(W),x),mr(y)&&!y.type.__asyncResolved){let z;E?(z=ie(Be),z.anchor=D?D.previousSibling:W.lastChild):z=v.nodeType===3?Ge(""):ie("div"),z.el=v,y.component.subTree=z}}else T&64?O!==8?D=N():D=y.type.hydrate(v,y,A,L,$,x,e,p):T&128&&(D=y.type.hydrate(v,y,A,L,af(r(v)),$,x,e,d))}return S!=null&&uc(S,null,L,y),D},f=(v,y,A,L,$,x)=>{x=x||!!y.dynamicChildren;const{type:E,props:N,patchFlag:F,shapeFlag:S,dirs:T,transition:R}=y,O=E==="input"||E==="option";if(O||F!==-1){T&&Bi(y,null,A,"created");let D=!1;if(g(v)){D=T4(null,R)&&A&&A.vnode.props&&A.vnode.props.appear;const z=v.content.firstChild;if(D){const V=z.getAttribute("class");V&&(z.$cls=V),R.beforeEnter(z)}k(z,v,A),y.el=v=z}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let z=p(v.firstChild,y,v,A,L,$,x);for(z&&!cf(v,1)&&Oa();z;){const V=z;z=z.nextSibling,l(V)}}else if(S&8){let z=y.children;z[0]===`
|
|
14
|
+
**/const XC=[];function xE(e){XC.push(e)}function _E(){XC.pop()}function X2e(e,t){}const J2e={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"},wE={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 vd(e,t,n,s){try{return s?e(...s):e()}catch(o){$c(o,t,n)}}function ui(e,t,n,s){if(It(e)){const o=vd(e,t,n,s);return o&&_v(o)&&o.catch(i=>{$c(i,t,n)}),o}if(_t(e)){const o=[];for(let i=0;i<e.length;i++)o.push(ui(e[i],t,n,s));return o}}function $c(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Gt;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){yr(),vd(i,null,10,[e,a,c]),kr();return}}SE(e,n,o,s,r)}function SE(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Js=[];let Ri=-1;const cc=[];let Kr=null,ja=0;const JC=Promise.resolve();let uh=null;function pt(e){const t=uh||JC;return e?t.then(this?e.bind(this):e):t}function CE(e){let t=Ri+1,n=Js.length;for(;t<n;){const s=t+n>>>1,o=Js[s],i=ju(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function Ev(e){if(!(e.flags&1)){const t=ju(e),n=Js[Js.length-1];!n||!(e.flags&2)&&t>=ju(n)?Js.push(e):Js.splice(CE(t),0,e),e.flags|=1,e4()}}function e4(){uh||(uh=JC.then(t4))}function dh(e){_t(e)?cc.push(...e):Kr&&e.id===-1?Kr.splice(ja+1,0,e):e.flags&1||(cc.push(e),e.flags|=1),e4()}function J2(e,t,n=Ri+1){for(;n<Js.length;n++){const s=Js[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Js.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function fh(e){if(cc.length){const t=[...new Set(cc)].sort((n,s)=>ju(n)-ju(s));if(cc.length=0,Kr){Kr.push(...t);return}for(Kr=t,ja=0;ja<Kr.length;ja++){const n=Kr[ja];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Kr=null,ja=0}}const ju=e=>e.id==null?e.flags&2?-1:1/0:e.id;function t4(e){try{for(Ri=0;Ri<Js.length;Ri++){const t=Js[Ri];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),vd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ri<Js.length;Ri++){const t=Js[Ri];t&&(t.flags&=-2)}Ri=-1,Js.length=0,fh(),uh=null,(Js.length||cc.length)&&t4()}}let qa,rf=[];function n4(e,t){var n,s;qa=e,qa?(qa.enabled=!0,rf.forEach(({event:o,args:i})=>qa.emit(o,...i)),rf=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{n4(i,t)}),setTimeout(()=>{qa||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,rf=[])},3e3)):rf=[]}let Fs=null,Cp=null;function qu(e){const t=Fs;return Fs=e,Cp=e&&e.type.__scopeId||null,t}function ebe(e){Cp=e}function tbe(){Cp=null}const nbe=e=>Ee;function Ee(e,t=Fs,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&vh(-1);const i=qu(t);let r;try{r=e(...o)}finally{qu(i),s._d&&vh(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Tn(e,t){if(Fs===null)return e;const n=xd(Fs),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Gt]=t[o];i&&(It(i)&&(i={mounted:i,updated:i}),i.deep&&ur(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Bi(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(yr(),ui(a,n,8,[e.el,l,e,t]),kr())}}function An(e,t){if(Ls){let n=Ls.provides;const s=Ls.parent&&Ls.parent.provides;s===n&&(n=Ls.provides=Object.create(s)),n[e]=t}}function Ut(e,t,n=!1){const s=Os();if(s||Xl){let o=Xl?Xl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&It(t)?t.call(s&&s.proxy):t}}function sbe(){return!!(Os()||Xl)}const AE=Symbol.for("v-scx"),ME=()=>Ut(AE);function EE(e,t){return yd(e,null,t)}function obe(e,t){return yd(e,null,{flush:"post"})}function TE(e,t){return yd(e,null,{flush:"sync"})}function Ke(e,t,n){return yd(e,t,n)}function yd(e,t,n=Gt){const{immediate:s,deep:o,flush:i,once:r}=n,l=mn({},n),a=t&&s||!t&&i!=="post";let c;if(ia){if(i==="sync"){const p=ME();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=li,p.resume=li,p.pause=li,p}}const u=Ls;l.call=(p,h,m)=>ui(p,u,h,m);let d=!1;i==="post"?l.scheduler=p=>{os(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():Ev(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=bE(e,t,l);return ia&&(c?c.push(f):a&&f()),f}function NE(e,t,n){const s=this.proxy,o=bn(e)?e.includes(".")?s4(s,e):()=>s[e]:e.bind(s,s);let i;It(t)?i=t:(i=t.handler,n=t);const r=Lc(this),l=yd(o,i.bind(s),n);return r(),l}function s4(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Ur=new WeakMap,o4=Symbol("_vte"),i4=e=>e.__isTeleport,zl=e=>e&&(e.disabled||e.disabled===""),IE=e=>e&&(e.defer||e.defer===""),eb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,tb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Z0=(e,t)=>{const n=e&&e.to;return bn(n)?t?t(n):null:n},$E={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:_,parentNode:k}}=c,g=zl(t.props);let{dynamicChildren:v}=t;const y=($,x,E)=>{$.shapeFlag&16&&u($.children,x,E,o,i,r,l,a)},A=($=t)=>{const x=zl($.props),E=$.target=Z0($.props,h),N=Q0(E,$,m,p);E&&(r!=="svg"&&eb(E)?r="svg":r!=="mathml"&&tb(E)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(E),x||(y($,E,N),pu($,!1)))},L=$=>{const x=()=>{if(Ur.get($)===x){if(Ur.delete($),zl($.props)){const E=k($.el)||n;y($,E,$.anchor),pu($,!0)}A($)}};Ur.set($,x),os(x,i)};if(e==null){const $=t.el=m(""),x=t.anchor=m("");if(p($,n,s),p(x,n,s),IE(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,x),pu(t,!0)),A()}else{t.el=e.el;const $=t.anchor=e.anchor,x=Ur.get(e);if(x){x.flags|=8,Ur.delete(e),L(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=zl(e.props),S=F?n:E,T=F?$:N;if(r==="svg"||eb(E)?r="svg":(r==="mathml"||tb(E))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),Pv(e,t,!0)):a||d(e,t,S,T,o,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):lf(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Z0(t.props,h);R&&lf(t,R,null,c,0)}else F&&lf(t,E,N,c,1);pu(t,g)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,p=i||!zl(f),h=Ur.get(e);if(h&&(h.flags|=8,Ur.delete(e)),d&&(o(c),o(u)),i&&o(a),!h&&r&16)for(let m=0;m<l.length;m++){const _=l[m];s(_,t,n,p,!!_.dynamicChildren)}},move:lf,hydrate:LE};function lf(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!Ur.has(e)&&(!d||zl(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function LE(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function p(_,k){k.anchor=d(r(_),k,l(_),n,s,o,i)}const h=t.target=Z0(t.props,a),m=zl(t.props);if(h){const _=h._lpa||h.firstChild;t.shapeFlag&16&&(m?(p(e,t),f(h,_),t.targetAnchor||Q0(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,_),t.targetAnchor||Q0(h,t,u,c),d(_&&r(_),t,h,n,s,o,i))),pu(t,m)}else m&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Ap=$E;function pu(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Q0(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[o4]=r,e&&(s(i,e,o),s(r,e,o)),r}const ti=Symbol("_leaveCb"),ou=Symbol("_enterCb");function r4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ln(()=>{e.isMounted=!0}),es(()=>{e.isUnmounting=!0}),e}const Zo=[Function,Array],l4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Zo,onEnter:Zo,onAfterEnter:Zo,onEnterCancelled:Zo,onBeforeLeave:Zo,onLeave:Zo,onAfterLeave:Zo,onLeaveCancelled:Zo,onBeforeAppear:Zo,onAppear:Zo,onAfterAppear:Zo,onAppearCancelled:Zo},a4=e=>{const t=e.subTree;return t.component?a4(t.component):t},FE={name:"BaseTransition",props:l4,setup(e,{slots:t}){const n=Os(),s=r4();return()=>{const o=t.default&&Tv(t.default(),!0),i=o&&o.length?c4(o):n.subTree?le():void 0;if(!i)return;const r=Xt(e),{mode:l}=r;if(s.isLeaving)return g1(i);const a=nb(i);if(!a)return g1(i);let c=Vu(a,r,s,n,d=>c=d);a.type!==rs&&ll(a,c);let u=n.subTree&&nb(n.subTree);if(u&&u.type!==rs&&!yi(u,a)&&a4(n).type!==rs){let d=Vu(u,r,s,n);if(ll(u,d),l==="out-in"&&a.type!==rs)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},g1(i);l==="in-out"&&a.type!==rs?d.delayLeave=(f,p,h)=>{const m=u4(s,u);m[String(u.key)]=u,f[ti]=()=>{p(),f[ti]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function c4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==rs){t=n;break}}return t}const OE=FE;function u4(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Vu(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:_,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),A=u4(n,e),L=(E,N)=>{E&&ui(E,s,9,N)},$=(E,N)=>{const F=N[1];L(E,N),_t(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(E){let N=a;if(!n.isMounted)if(i)N=_||a;else return;E[ti]&&E[ti](!0);const F=A[y];F&&yi(e,F)&&F.el[ti]&&F.el[ti](),L(N,[E])},enter(E){if(A[y]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=k||c,F=g||u,S=v||d;else return;let T=!1;E[ou]=O=>{T||(T=!0,O?L(S,[E]):L(F,[E]),x.delayedLeave&&x.delayedLeave(),E[ou]=void 0)};const R=E[ou].bind(null,!1);N?$(N,[E,R]):R()},leave(E,N){const F=String(e.key);if(E[ou]&&E[ou](!0),n.isUnmounting)return N();L(f,[E]);let S=!1;E[ti]=R=>{S||(S=!0,N(),R?L(m,[E]):L(h,[E]),E[ti]=void 0,A[F]===e&&delete A[F])};const T=E[ti].bind(null,!1);A[F]=e,p?$(p,[E,T]):T()},clone(E){const N=Vu(E,t,n,s,o);return o&&o(N),N}};return x}function g1(e){if(kd(e))return e=xr(e),e.children=null,e}function nb(e){if(!kd(e))return i4(e.type)&&e.children?c4(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&&It(n.default))return n.default()}}function ll(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ll(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 Tv(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Be?(r.patchFlag&128&&o++,s=s.concat(Tv(r.children,t,l))):(t||r.type!==rs)&&s.push(l!=null?xr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function qe(e,t){return It(e)?mn({name:e.name},t,{setup:e}):e}function ibe(){const e=Os();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Nv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rbe(e){const t=Os(),n=fa(null);if(t){const o=t.refs===Gt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function sb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const hh=new WeakMap;function uc(e,t,n,s,o=!1){if(_t(e)){e.forEach((m,_)=>uc(m,t&&(_t(t)?t[_]:t),n,s,o));return}if(mr(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&uc(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?xd(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Gt?l.refs={}:l.refs,d=l.setupState,f=Xt(d),p=d===Gt?AC:m=>sb(u,m)?!1:on(f,m),h=(m,_)=>!(_&&sb(u,_));if(c!=null&&c!==a){if(ob(t),bn(c))u[c]=null,p(c)&&(d[c]=null);else if(Jn(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(It(a))vd(a,l,12,[r,u]);else{const m=bn(a),_=Jn(a);if(m||_){const k=()=>{if(e.f){const g=m?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(o)_t(g)&&xv(g,i);else if(_t(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],p(a)&&(d[a]=u[a]);else{const v=[i];h(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,p(a)&&(d[a]=r)):_&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),hh.delete(e)};g.id=-1,hh.set(e,g),os(g,n)}else ob(e),k()}}}function ob(e){const t=hh.get(e);t&&(t.flags|=8,hh.delete(e))}let ib=!1;const Oa=()=>{ib||(console.error("Hydration completed but contains mismatches."),ib=!0)},RE=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",BE=e=>e.namespaceURI.includes("MathML"),af=e=>{if(e.nodeType===1){if(RE(e))return"svg";if(BE(e))return"mathml"}},Ja=e=>e.nodeType===8;function DE(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),fh(),y._vnode=v;return}d(y.firstChild,v,null,null,null),fh(),y._vnode=v},d=(v,y,A,L,$,x=!1)=>{x=x||!!y.dynamicChildren;const E=Ja(v)&&v.data==="[",N=()=>m(v,y,A,L,$,E),{type:F,ref:S,shapeFlag:T,patchFlag:R}=y;let O=v.nodeType;y.el=v,R===-2&&(x=!1,y.dynamicChildren=null);let D=null;switch(F){case sl:O!==3?y.children===""?(a(y.el=o(""),r(v),v),D=v):D=N():(v.data!==y.children&&(Oa(),v.data=y.children),D=i(v));break;case rs:g(v)?(D=i(v),k(y.el=v.content.firstChild,v,A)):O!==8||E?D=N():D=i(v);break;case fc:if(E&&(v=i(v),O=v.nodeType),O===1||O===3){D=v;const W=!y.children.length;for(let z=0;z<y.staticCount;z++)W&&(y.children+=D.nodeType===1?D.outerHTML:D.data),z===y.staticCount-1&&(y.anchor=D),D=i(D);return E?i(D):D}else N();break;case Be:E?D=h(v,y,A,L,$,x):D=N();break;default:if(T&1)(O!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?D=N():D=f(v,y,A,L,$,x);else if(T&6){y.slotScopeIds=$;const W=r(v);if(E?D=_(v):Ja(v)&&v.data==="teleport start"?D=_(v,v.data,"teleport end"):D=i(v),t(y,W,null,A,L,af(W),x),mr(y)&&!y.type.__asyncResolved){let z;E?(z=ie(Be),z.anchor=D?D.previousSibling:W.lastChild):z=v.nodeType===3?Ge(""):ie("div"),z.el=v,y.component.subTree=z}}else T&64?O!==8?D=N():D=y.type.hydrate(v,y,A,L,$,x,e,p):T&128&&(D=y.type.hydrate(v,y,A,L,af(r(v)),$,x,e,d))}return S!=null&&uc(S,null,L,y),D},f=(v,y,A,L,$,x)=>{x=x||!!y.dynamicChildren;const{type:E,props:N,patchFlag:F,shapeFlag:S,dirs:T,transition:R}=y,O=E==="input"||E==="option";if(O||F!==-1){T&&Bi(y,null,A,"created");let D=!1;if(g(v)){D=T4(null,R)&&A&&A.vnode.props&&A.vnode.props.appear;const z=v.content.firstChild;if(D){const V=z.getAttribute("class");V&&(z.$cls=V),R.beforeEnter(z)}k(z,v,A),y.el=v=z}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let z=p(v.firstChild,y,v,A,L,$,x);for(z&&!cf(v,1)&&Oa();z;){const V=z;z=z.nextSibling,l(V)}}else if(S&8){let z=y.children;z[0]===`
|
|
15
15
|
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(z=z.slice(1));const{textContent:V}=v;V!==z&&V!==z.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(cf(v,0)||Oa(),v.textContent=y.children)}if(N){if(O||!x||F&48){const z=v.tagName.includes("-");for(const V in N)(O&&(V.endsWith("value")||V==="indeterminate")||gd(V)&&!Zl(V)||V[0]==="."||z&&!Zl(V))&&s(v,V,null,N[V],void 0,A)}else if(N.onClick)s(v,"onClick",null,N.onClick,void 0,A);else if(F&4&&nl(N.style))for(const z in N.style)N.style[z]}let W;(W=N&&N.onVnodeBeforeMount)&&ho(W,A,y),T&&Bi(y,null,A,"beforeMount"),((W=N&&N.onVnodeMounted)||T||D)&&L4(()=>{W&&ho(W,A,y),D&&R.enter(v),T&&Bi(y,null,A,"mounted")},L)}return v.nextSibling},p=(v,y,A,L,$,x,E)=>{E=E||!!y.dynamicChildren;const N=y.children,F=N.length;let S=!1;for(let T=0;T<F;T++){const R=E?N[T]:N[T]=mo(N[T]),O=R.type===sl;v?(O&&!E&&T+1<F&&mo(N[T+1]).type===sl&&(a(o(v.data.slice(R.children.length)),A,i(v)),v.data=R.children),v=d(v,R,L,$,x,E)):O&&!R.children?a(R.el=o(""),A):(S||(S=!0,cf(A,1)||Oa()),n(null,R,A,null,L,$,af(A),x))}return v},h=(v,y,A,L,$,x)=>{const{slotScopeIds:E}=y;E&&($=$?$.concat(E):E);const N=r(v),F=p(i(v),y,N,A,L,$,x);return F&&Ja(F)&&F.data==="]"?i(y.anchor=F):(Oa(),a(y.anchor=c("]"),N,F),F)},m=(v,y,A,L,$,x)=>{if(cf(v.parentElement,1)||Oa(),y.el=null,x){const F=_(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const E=i(v),N=r(v);return l(v),n(null,y,N,E,A,L,af(N),$),A&&(A.vnode.el=y.el,Tp(A,y.el)),E},_=(v,y="[",A="]")=>{let L=0;for(;v;)if(v=i(v),v&&Ja(v)&&(v.data===y&&L++,v.data===A)){if(L===0)return i(v);L--}return v},k=(v,y,A)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=A;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const rb="data-allow-mismatch",PE={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function cf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(rb);)e=e.parentElement;const n=e&&e.getAttribute(rb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(PE[t])}}const HE=yp().requestIdleCallback||(e=>setTimeout(e,1)),WE=yp().cancelIdleCallback||(e=>clearTimeout(e)),obe=(e=1e4)=>t=>{const n=HE(t,{timeout:e});return()=>WE(n)};function zE(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const ibe=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(zE(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},rbe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},lbe=(e=[])=>(t,n)=>{bn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function UE(e,t){if(Ja(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Ja(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const mr=e=>!!e.type.__asyncLoader;function ki(e){It(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,p()),p=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,k)=>{a(m,()=>_(f()),()=>k(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return qe({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,_){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||_()},v=i?()=>{const y=i(g,A=>UE(h,A));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():p().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const h=Ls;if(Nv(h),u)return()=>uf(u,h);const m=v=>{c=null,$c(v,h,13,!s)};if(l&&h.suspense||ia)return p().then(v=>()=>uf(v,h)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const _=Q(!1),k=Q(),g=Q(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!_.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),p().then(()=>{_.value=!0,h.parent&&kd(h.parent.vnode)&&h.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(_.value&&u)return uf(u,h);if(k.value&&s)return ie(s,{error:k.value});if(n&&!g.value)return uf(n,h)}}})}function uf(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ie(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const kd=e=>e.type.__isKeepAlive,jE={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Os(),s=n.ctx;if(!s.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(g,v,y,A,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,A,g.slotScopeIds,L),os(()=>{$.isDeactivated=!1,$.a&&ac($.a);const x=g.props&&g.props.onVnodeMounted;x&&ho(x,$.parent,g)},l)},s.deactivate=g=>{const v=g.component;mh(v.m),mh(v.a),c(g,f,null,1,l),os(()=>{v.da&&ac(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&ho(y,v.parent,g),v.isDeactivated=!0},l)};function p(g){v1(g),u(g,n,l,!0)}function h(g){o.forEach((v,y)=>{const A=rg(mr(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!yi(v,r))?p(v):r&&v1(r),o.delete(g),i.delete(g)}Ke(()=>[e.include,e.exclude],([g,v])=>{g&&h(y=>mu(g,y)),v&&h(y=>!mu(v,y))},{flush:"post",deep:!0});let _=null;const k=()=>{_!=null&&(gh(n.subTree.type)?os(()=>{o.set(_,df(n.subTree))},n.subTree.suspense):o.set(_,df(n.subTree)))};return ln(k),Iv(k),es(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,A=df(v);if(g.type===A.type&&g.key===A.key){v1(A);const L=A.component.da;L&&os(L,y);return}p(g)})}),()=>{if(_=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!al(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=df(v);if(y.type===rs)return r=null,y;const A=y.type,L=rg(mr(y)?y.type.__asyncResolved||{}:A),{include:$,exclude:x,max:E}=e;if($&&(!L||!mu($,L))||x&&L&&mu(x,L))return y.shapeFlag&=-257,r=y,v;const N=y.key==null?A:y.key,F=o.get(N);return y.el&&(y=xr(y),v.shapeFlag&128&&(v.ssContent=y)),_=N,F?(y.el=F.el,y.component=F.component,y.transition&&ll(y,y.transition),y.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,gh(v.type)?v:y}}},abe=jE;function mu(e,t){return _t(e)?e.some(n=>mu(n,t)):bn(e)?e.split(",").includes(t):I8(e)?(e.lastIndex=0,e.test(t)):!1}function qE(e,t){d4(e,"a",t)}function VE(e,t){d4(e,"da",t)}function d4(e,t,n=Ls){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Mp(t,s,n),n){let o=n.parent;for(;o&&o.parent;)kd(o.parent.vnode)&&KE(s,t,n,o),o=o.parent}}function KE(e,t,n,s){const o=Mp(t,e,s,!0);fn(()=>{xv(s[t],o)},n)}function v1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function df(e){return e.shapeFlag&128?e.ssContent:e}function Mp(e,t,n=Ls,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{yr();const l=Lc(n),a=ui(t,n,e,r);return l(),kr(),a});return s?o.unshift(i):o.push(i),i}}const wr=e=>(t,n=Ls)=>{(!ia||e==="sp")&&Mp(e,(...s)=>t(...s),n)},GE=wr("bm"),ln=wr("m"),f4=wr("bu"),Iv=wr("u"),es=wr("bum"),fn=wr("um"),YE=wr("sp"),ZE=wr("rtg"),QE=wr("rtc");function XE(e,t=Ls){Mp("ec",e,t)}const $v="components",JE="directives";function eT(e,t){return Lv($v,e,!0,t)||e}const h4=Symbol.for("v-ndc");function $s(e){return bn(e)?Lv($v,e,!1)||e:e||h4}function cbe(e){return Lv(JE,e)}function Lv(e,t,n=!0,s=!1){const o=Fs||Ls;if(o){const i=o.type;if(e===$v){const l=rg(i,!1);if(l&&(l===t||l===vs(t)||l===gp(vs(t))))return i}const r=lb(o[e]||i[e],t)||lb(o.appContext[e],t);return!r&&s?i:r}}function lb(e,t){return e&&(e[t]||e[vs(t)]||e[gp(vs(t))])}function nt(e,t,n,s){let o;const i=n&&n[s],r=_t(e);if(r||bn(e)){const l=r&&nl(e);let a=!1,c=!1;l&&(a=!Oo(e),c=br(e),e=xp(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?xc(Si(e[u])):Si(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(rn(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function Fv(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(_t(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function In(e,t,n={},s,o){if(Fs.ce||Fs.parent&&mr(Fs.parent)&&Fs.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),ye(Be,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),b();const r=i&&Ov(i(n)),l=n.key||r&&r.key,a=ye(Be,{key:(l&&!zo(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function Ov(e){return e.some(t=>al(t)?!(t.type===rs||t.type===Be&&!Ov(t.children)):!0)?e:null}function ube(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:Df(s)]=e[s];return n}const X0=e=>e?D4(e)?xd(e):X0(e.parent):null,Su=mn(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=>X0(e.parent),$root:e=>X0(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Rv(e),$forceUpdate:e=>e.f||(e.f=()=>{Ev(e.update)}),$nextTick:e=>e.n||(e.n=pt.bind(e.proxy)),$watch:e=>NE.bind(e)}),y1=(e,t)=>e!==Gt&&!e.__isScriptSetup&&on(e,t),J0={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(y1(s,t))return r[t]=1,s[t];if(o!==Gt&&on(o,t))return r[t]=2,o[t];if(on(i,t))return r[t]=3,i[t];if(n!==Gt&&on(n,t))return r[t]=4,n[t];eg&&(r[t]=0)}}const c=Su[t];let u,d;if(c)return t==="$attrs"&&zs(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Gt&&on(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,on(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return y1(o,t)?(o[t]=n,!0):s!==Gt&&on(s,t)?(s[t]=n,!0):on(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Gt&&l[0]!=="$"&&on(e,l)||y1(t,l)||on(i,l)||on(s,l)||on(Su,l)||on(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:on(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},tT=mn({},J0,{get(e,t){if(t!==Symbol.unscopables)return J0.get(e,t,e)},has(e,t){return t[0]!=="_"&&!R8(t)}});function dbe(){return null}function fbe(){return null}function hbe(e){}function pbe(e){}function mbe(){return null}function gbe(){}function vbe(e,t){return null}function ybe(){return p4().slots}function bd(){return p4().attrs}function p4(e){const t=Os();return t.setupContext||(t.setupContext=W4(t))}function Ku(e){return _t(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function kbe(e,t){const n=Ku(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?_t(o)||It(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function bbe(e,t){return!e||!t?e||t:_t(e)&&_t(t)?e.concat(t):mn({},Ku(e),Ku(t))}function xbe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function _be(e){const t=Os(),n=ia;let s=e();Yu(),n&&hc(!1);const o=()=>{Lc(t),n&&hc(!0)},i=()=>{Os()!==t&&t.scope.off(),Yu(),n&&hc(!1)};return _v(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let eg=!0;function nT(e){const t=Rv(e),n=e.proxy,s=e.ctx;eg=!1,t.beforeCreate&&ab(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:_,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:A,renderTracked:L,renderTriggered:$,errorCaptured:x,serverPrefetch:E,expose:N,inheritAttrs:F,components:S,directives:T,filters:R}=t;if(c&&sT(c,s,null),r)for(const W in r){const z=r[W];It(z)&&(s[W]=z.bind(n))}if(o){const W=o.call(n,n);rn(W)&&(e.data=Ss(W))}if(eg=!0,i)for(const W in i){const z=i[W],V=It(z)?z.bind(n,n):It(z.get)?z.get.bind(n,n):li,U=!It(z)&&It(z.set)?z.set.bind(n):li,re=P({get:V,set:U});Object.defineProperty(s,W,{enumerable:!0,configurable:!0,get:()=>re.value,set:ae=>re.value=ae})}if(l)for(const W in l)m4(l[W],s,n,W);if(a){const W=It(a)?a.call(n):a;Reflect.ownKeys(W).forEach(z=>{An(z,W[z])})}u&&ab(u,e,"c");function D(W,z){_t(z)?z.forEach(V=>W(V.bind(n))):z&&W(z.bind(n))}if(D(GE,d),D(ln,f),D(f4,p),D(Iv,h),D(qE,m),D(VE,_),D(XE,x),D(QE,L),D(ZE,$),D(es,g),D(fn,y),D(YE,E),_t(N))if(N.length){const W=e.exposed||(e.exposed={});N.forEach(z=>{Object.defineProperty(W,z,{get:()=>n[z],set:V=>n[z]=V,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===li&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),T&&(e.directives=T),E&&Nv(e)}function sT(e,t,n=li){_t(e)&&(e=tg(e));for(const s in e){const o=e[s];let i;rn(o)?"default"in o?i=Ut(o.from||s,o.default,!0):i=Ut(o.from||s):i=Ut(o),Jn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function ab(e,t,n){ui(_t(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function m4(e,t,n,s){let o=s.includes(".")?s4(n,s):()=>n[s];if(bn(e)){const i=t[e];It(i)&&Ke(o,i)}else if(It(e))Ke(o,e.bind(n));else if(rn(e))if(_t(e))e.forEach(i=>m4(i,t,n,s));else{const i=It(e.handler)?e.handler.bind(n):t[e.handler];It(i)&&Ke(o,i,e)}}function Rv(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>ph(a,c,r,!0)),ph(a,t,r)),rn(t)&&i.set(t,a),a}function ph(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&ph(e,i,n,!0),o&&o.forEach(r=>ph(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=oT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const oT={data:cb,props:ub,emits:ub,methods:gu,computed:gu,beforeCreate:Ys,created:Ys,beforeMount:Ys,mounted:Ys,beforeUpdate:Ys,updated:Ys,beforeDestroy:Ys,beforeUnmount:Ys,destroyed:Ys,unmounted:Ys,activated:Ys,deactivated:Ys,errorCaptured:Ys,serverPrefetch:Ys,components:gu,directives:gu,watch:rT,provide:cb,inject:iT};function cb(e,t){return t?e?function(){return mn(It(e)?e.call(this,this):e,It(t)?t.call(this,this):t)}:t:e}function iT(e,t){return gu(tg(e),tg(t))}function tg(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ys(e,t){return e?[...new Set([].concat(e,t))]:t}function gu(e,t){return e?mn(Object.create(null),e,t):t}function ub(e,t){return e?_t(e)&&_t(t)?[...new Set([...e,...t])]:mn(Object.create(null),Ku(e),Ku(t??{})):t}function rT(e,t){if(!e)return t;if(!t)return e;const n=mn(Object.create(null),e);for(const s in t)n[s]=Ys(e[s],t[s]);return n}function g4(){return{app:null,config:{isNativeTag:AC,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 lT=0;function aT(e,t){return function(s,o=null){It(s)||(s=mn({},s)),o!=null&&!rn(o)&&(o=null);const i=g4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:lT++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:DT,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&It(u.install)?(r.add(u),u.install(c,...d)):It(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 p=c._ceVNode||ie(s,o);return p.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(p,u):e(p,u,f),a=!0,c._container=u,u.__vue_app__=c,xd(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(ui(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=Xl;Xl=c;try{return u()}finally{Xl=d}}};return c}}let Xl=null;function wbe(e,t,n=Gt){const s=Os(),o=vs(t),i=go(t),r=v4(e,o),l=pE((a,c)=>{let u,d=Gt,f;return TE(()=>{const p=e[o];Is(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Is(h,u)&&!(d!==Gt&&Is(p,d)))return;const m=s.vnode.props;m&&(t in m||o in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${i}`in m)||(u=p,c()),s.emit(`update:${t}`,h),Is(p,h)&&Is(p,d)&&!Is(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Gt:l,done:!1}:{done:!0}}}},l}const v4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${vs(t)}Modifiers`]||e[`${go(t)}Modifiers`];function cT(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Gt;let o=n;const i=t.startsWith("update:"),r=i&&v4(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>bn(u)?u.trim():u)),r.number&&(o=n.map(vp)));let l,a=s[l=Df(t)]||s[l=Df(vs(t))];!a&&i&&(a=s[l=Df(go(t))]),a&&ui(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ui(c,e,6,o)}}const uT=new WeakMap;function y4(e,t,n=!1){const s=n?uT:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!It(e)){const a=c=>{const u=y4(c,t,!0);u&&(l=!0,mn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(rn(e)&&s.set(e,null),null):(_t(i)?i.forEach(a=>r[a]=null):mn(r,i),rn(e)&&s.set(e,r),r)}function Ep(e,t){return!e||!gd(t)?!1:(t=t.slice(2).replace(/Once$/,""),on(e,t[0].toLowerCase()+t.slice(1))||on(e,go(t))||on(e,t))}function Pf(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:p,ctx:h,inheritAttrs:m}=e,_=qu(e);let k,g;try{if(n.shapeFlag&4){const y=o||s,A=y;k=mo(c.call(A,y,u,d,p,f,h)),g=l}else{const y=t;k=mo(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:fT(l)}}catch(y){Cu.length=0,$c(y,e,1),k=ie(rs)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:A}=v;y.length&&A&7&&(i&&y.some(fp)&&(g=hT(g,i)),v=xr(v,g,!1,!0))}return n.dirs&&(v=xr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&ll(v,n.transition),k=v,qu(_),k}function dT(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(al(o)){if(o.type!==rs||o.children==="v-if"){if(n)return;n=o}}else return}return n}const fT=e=>{let t;for(const n in e)(n==="class"||n==="style"||gd(n))&&((t||(t={}))[n]=e[n]);return t},hT=(e,t)=>{const n={};for(const s in e)(!fp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function pT(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?db(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(k4(r,s,f)&&!Ep(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?db(s,r,c):!0:!!r;return!1}function db(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(k4(t,e,i)&&!Ep(n,i))return!0}return!1}function k4(e,t,n){const s=e[n],o=t[n];return n==="style"&&rn(s)&&rn(o)?!vr(s,o):s!==o}function Tp({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const b4={},x4=()=>Object.create(b4),_4=e=>Object.getPrototypeOf(e)===b4;function mT(e,t,n,s=!1){const o={},i=x4();e.propsDefaults=Object.create(null),w4(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:uE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function gT(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Xt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(Ep(e.emitsOptions,f))continue;const p=t[f];if(a)if(on(i,f))p!==i[f]&&(i[f]=p,c=!0);else{const h=vs(f);o[h]=ng(a,l,h,p,e,!1)}else p!==i[f]&&(i[f]=p,c=!0)}}}else{w4(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!on(t,d)&&((u=go(d))===d||!on(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=ng(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!on(t,d))&&(delete i[d],c=!0)}c&&cr(e.attrs,"set","")}function w4(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Zl(a))continue;const c=t[a];let u;o&&on(o,u=vs(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:Ep(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Xt(n),c=l||Gt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=ng(o,a,d,c[d],e,!on(c,d))}}return r}function ng(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=on(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&It(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Lc(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===go(n))&&(s=!0))}return s}const vT=new WeakMap;function S4(e,t,n=!1){const s=n?vT:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!It(e)){const u=d=>{a=!0;const[f,p]=S4(d,t,!0);mn(r,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return rn(e)&&s.set(e,rc),rc;if(_t(i))for(let u=0;u<i.length;u++){const d=vs(i[u]);fb(d)&&(r[d]=Gt)}else if(i)for(const u in i){const d=vs(u);if(fb(d)){const f=i[u],p=r[d]=_t(f)||It(f)?{type:f}:mn({},f),h=p.type;let m=!1,_=!0;if(_t(h))for(let k=0;k<h.length;++k){const g=h[k],v=It(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(_=!1)}else m=It(h)&&h.name==="Boolean";p[0]=m,p[1]=_,(m||on(p,"default"))&&l.push(d)}}const c=[r,l];return rn(e)&&s.set(e,c),c}function fb(e){return e[0]!=="$"&&!Zl(e)}const Bv=e=>e==="_"||e==="_ctx"||e==="$stable",Dv=e=>_t(e)?e.map(mo):[mo(e)],yT=(e,t,n)=>{if(t._n)return t;const s=Ee((...o)=>Dv(t(...o)),n);return s._c=!1,s},C4=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Bv(o))continue;const i=e[o];if(It(i))t[o]=yT(o,i,s);else if(i!=null){const r=Dv(i);t[o]=()=>r}}},A4=(e,t)=>{const n=Dv(t);e.slots.default=()=>n},M4=(e,t,n)=>{for(const s in t)(n||!Bv(s))&&(e[s]=t[s])},kT=(e,t,n)=>{const s=e.slots=x4();if(e.vnode.shapeFlag&32){const o=t._;o?(M4(s,t,n),n&&EC(s,"_",o,!0)):C4(t,s)}else t&&A4(e,t)},bT=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Gt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:M4(o,t,n):(i=!t.$stable,C4(t,o)),r=t}else t&&(A4(e,t),r={default:1});if(i)for(const l in o)!Bv(l)&&r[l]==null&&delete o[l]},os=L4;function xT(e){return E4(e)}function _T(e){return E4(e,DE)}function E4(e,t){const n=yp();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=li,insertStaticContent:h}=e,m=(j,se,ge,ue=null,pe=null,q=null,J=void 0,he=null,Te=!!se.dynamicChildren)=>{if(j===se)return;j&&!yi(j,se)&&(ue=Se(j),ae(j,pe,q,!0),j=null),se.patchFlag===-2&&(Te=!1,se.dynamicChildren=null);const{type:Ie,ref:Oe,shapeFlag:de}=se;switch(Ie){case sl:_(j,se,ge,ue);break;case rs:k(j,se,ge,ue);break;case fc:j==null&&g(se,ge,ue,J);break;case Be:S(j,se,ge,ue,pe,q,J,he,Te);break;default:de&1?A(j,se,ge,ue,pe,q,J,he,Te):de&6?T(j,se,ge,ue,pe,q,J,he,Te):(de&64||de&128)&&Ie.process(j,se,ge,ue,pe,q,J,he,Te,Y)}Oe!=null&&pe?uc(Oe,j&&j.ref,q,se||j,!se):Oe==null&&j&&j.ref!=null&&uc(j.ref,null,q,j,!0)},_=(j,se,ge,ue)=>{if(j==null)s(se.el=l(se.children),ge,ue);else{const pe=se.el=j.el;se.children!==j.children&&c(pe,se.children)}},k=(j,se,ge,ue)=>{j==null?s(se.el=a(se.children||""),ge,ue):se.el=j.el},g=(j,se,ge,ue)=>{[j.el,j.anchor]=h(j.children,se,ge,ue,j.el,j.anchor)},v=({el:j,anchor:se},ge,ue)=>{let pe;for(;j&&j!==se;)pe=f(j),s(j,ge,ue),j=pe;s(se,ge,ue)},y=({el:j,anchor:se})=>{let ge;for(;j&&j!==se;)ge=f(j),o(j),j=ge;o(se)},A=(j,se,ge,ue,pe,q,J,he,Te)=>{if(se.type==="svg"?J="svg":se.type==="math"&&(J="mathml"),j==null)L(se,ge,ue,pe,q,J,he,Te);else{const Ie=j.el&&j.el._isVueCE?j.el:null;try{Ie&&Ie._beginPatch(),E(j,se,pe,q,J,he,Te)}finally{Ie&&Ie._endPatch()}}},L=(j,se,ge,ue,pe,q,J,he)=>{let Te,Ie;const{props:Oe,shapeFlag:de,transition:$e,dirs:Qe}=j;if(Te=j.el=r(j.type,q,Oe&&Oe.is,Oe),de&8?u(Te,j.children):de&16&&x(j.children,Te,null,ue,pe,k1(j,q),J,he),Qe&&Bi(j,null,ue,"created"),$(Te,j,j.scopeId,J,ue),Oe){for(const vt in Oe)vt!=="value"&&!Zl(vt)&&i(Te,vt,null,Oe[vt],q,ue);"value"in Oe&&i(Te,"value",null,Oe.value,q),(Ie=Oe.onVnodeBeforeMount)&&ho(Ie,ue,j)}Qe&&Bi(j,null,ue,"beforeMount");const tt=T4(pe,$e);tt&&$e.beforeEnter(Te),s(Te,se,ge),((Ie=Oe&&Oe.onVnodeMounted)||tt||Qe)&&os(()=>{try{Ie&&ho(Ie,ue,j),tt&&$e.enter(Te),Qe&&Bi(j,null,ue,"mounted")}finally{}},pe)},$=(j,se,ge,ue,pe)=>{if(ge&&p(j,ge),ue)for(let q=0;q<ue.length;q++)p(j,ue[q]);if(pe){let q=pe.subTree;if(se===q||gh(q.type)&&(q.ssContent===se||q.ssFallback===se)){const J=pe.vnode;$(j,J,J.scopeId,J.slotScopeIds,pe.parent)}}},x=(j,se,ge,ue,pe,q,J,he,Te=0)=>{for(let Ie=Te;Ie<j.length;Ie++){const Oe=j[Ie]=he?lr(j[Ie]):mo(j[Ie]);m(null,Oe,se,ge,ue,pe,q,J,he)}},E=(j,se,ge,ue,pe,q,J)=>{const he=se.el=j.el;let{patchFlag:Te,dynamicChildren:Ie,dirs:Oe}=se;Te|=j.patchFlag&16;const de=j.props||Gt,$e=se.props||Gt;let Qe;if(ge&&Fl(ge,!1),(Qe=$e.onVnodeBeforeUpdate)&&ho(Qe,ge,se,j),Oe&&Bi(se,j,ge,"beforeUpdate"),ge&&Fl(ge,!0),(de.innerHTML&&$e.innerHTML==null||de.textContent&&$e.textContent==null)&&u(he,""),Ie?N(j.dynamicChildren,Ie,he,ge,ue,k1(se,pe),q):J||z(j,se,he,null,ge,ue,k1(se,pe),q,!1),Te>0){if(Te&16)F(he,de,$e,ge,pe);else if(Te&2&&de.class!==$e.class&&i(he,"class",null,$e.class,pe),Te&4&&i(he,"style",de.style,$e.style,pe),Te&8){const tt=se.dynamicProps;for(let vt=0;vt<tt.length;vt++){const wt=tt[vt],xt=de[wt],Rt=$e[wt];(Rt!==xt||wt==="value")&&i(he,wt,xt,Rt,pe,ge)}}Te&1&&j.children!==se.children&&u(he,se.children)}else!J&&Ie==null&&F(he,de,$e,ge,pe);((Qe=$e.onVnodeUpdated)||Oe)&&os(()=>{Qe&&ho(Qe,ge,se,j),Oe&&Bi(se,j,ge,"updated")},ue)},N=(j,se,ge,ue,pe,q,J)=>{for(let he=0;he<se.length;he++){const Te=j[he],Ie=se[he],Oe=Te.el&&(Te.type===Be||!yi(Te,Ie)||Te.shapeFlag&198)?d(Te.el):ge;m(Te,Ie,Oe,null,ue,pe,q,J,!0)}},F=(j,se,ge,ue,pe)=>{if(se!==ge){if(se!==Gt)for(const q in se)!Zl(q)&&!(q in ge)&&i(j,q,se[q],null,pe,ue);for(const q in ge){if(Zl(q))continue;const J=ge[q],he=se[q];J!==he&&q!=="value"&&i(j,q,he,J,pe,ue)}"value"in ge&&i(j,"value",se.value,ge.value,pe)}},S=(j,se,ge,ue,pe,q,J,he,Te)=>{const Ie=se.el=j?j.el:l(""),Oe=se.anchor=j?j.anchor:l("");let{patchFlag:de,dynamicChildren:$e,slotScopeIds:Qe}=se;Qe&&(he=he?he.concat(Qe):Qe),j==null?(s(Ie,ge,ue),s(Oe,ge,ue),x(se.children||[],ge,Oe,pe,q,J,he,Te)):de>0&&de&64&&$e&&j.dynamicChildren&&j.dynamicChildren.length===$e.length?(N(j.dynamicChildren,$e,ge,pe,q,J,he),(se.key!=null||pe&&se===pe.subTree)&&Pv(j,se,!0)):z(j,se,ge,Oe,pe,q,J,he,Te)},T=(j,se,ge,ue,pe,q,J,he,Te)=>{se.slotScopeIds=he,j==null?se.shapeFlag&512?pe.ctx.activate(se,ge,ue,J,Te):R(se,ge,ue,pe,q,J,Te):O(j,se,Te)},R=(j,se,ge,ue,pe,q,J)=>{const he=j.component=B4(j,ue,pe);if(kd(j)&&(he.ctx.renderer=Y),P4(he,!1,J),he.asyncDep){if(pe&&pe.registerDep(he,D,J),!j.el){const Te=he.subTree=ie(rs);k(null,Te,se,ge),j.placeholder=Te.el}}else D(he,j,se,ge,pe,q,J)},O=(j,se,ge)=>{const ue=se.component=j.component;if(pT(j,se,ge))if(ue.asyncDep&&!ue.asyncResolved){W(ue,se,ge);return}else ue.next=se,ue.update();else se.el=j.el,ue.vnode=se},D=(j,se,ge,ue,pe,q,J)=>{const he=()=>{if(j.isMounted){let{next:de,bu:$e,u:Qe,parent:tt,vnode:vt}=j;{const nn=N4(j);if(nn){de&&(de.el=vt.el,W(j,de,J)),nn.asyncDep.then(()=>{os(()=>{j.isUnmounted||Ie()},pe)});return}}let wt=de,xt;Fl(j,!1),de?(de.el=vt.el,W(j,de,J)):de=vt,$e&&ac($e),(xt=de.props&&de.props.onVnodeBeforeUpdate)&&ho(xt,tt,de,vt),Fl(j,!0);const Rt=Pf(j),yt=j.subTree;j.subTree=Rt,m(yt,Rt,d(yt.el),Se(yt),j,pe,q),de.el=Rt.el,wt===null&&Tp(j,Rt.el),Qe&&os(Qe,pe),(xt=de.props&&de.props.onVnodeUpdated)&&os(()=>ho(xt,tt,de,vt),pe)}else{let de;const{el:$e,props:Qe}=se,{bm:tt,m:vt,parent:wt,root:xt,type:Rt}=j,yt=mr(se);if(Fl(j,!1),tt&&ac(tt),!yt&&(de=Qe&&Qe.onVnodeBeforeMount)&&ho(de,wt,se),Fl(j,!0),$e&&fe){const nn=()=>{j.subTree=Pf(j),fe($e,j.subTree,j,pe,null)};yt&&Rt.__asyncHydrate?Rt.__asyncHydrate($e,j,nn):nn()}else{xt.ce&&xt.ce._hasShadowRoot()&&xt.ce._injectChildStyle(Rt,j.parent?j.parent.type:void 0);const nn=j.subTree=Pf(j);m(null,nn,ge,ue,j,pe,q),se.el=nn.el}if(vt&&os(vt,pe),!yt&&(de=Qe&&Qe.onVnodeMounted)){const nn=se;os(()=>ho(de,wt,nn),pe)}(se.shapeFlag&256||wt&&mr(wt.vnode)&&wt.vnode.shapeFlag&256)&&j.a&&os(j.a,pe),j.isMounted=!0,se=ge=ue=null}};j.scope.on();const Te=j.effect=new rh(he);j.scope.off();const Ie=j.update=Te.run.bind(Te),Oe=j.job=Te.runIfDirty.bind(Te);Oe.i=j,Oe.id=j.uid,Te.scheduler=()=>Ev(Oe),Fl(j,!0),Ie()},W=(j,se,ge)=>{se.component=j;const ue=j.vnode.props;j.vnode=se,j.next=null,gT(j,se.props,ue,ge),bT(j,se.children,ge),yr(),J2(j),kr()},z=(j,se,ge,ue,pe,q,J,he,Te=!1)=>{const Ie=j&&j.children,Oe=j?j.shapeFlag:0,de=se.children,{patchFlag:$e,shapeFlag:Qe}=se;if($e>0){if($e&128){U(Ie,de,ge,ue,pe,q,J,he,Te);return}else if($e&256){V(Ie,de,ge,ue,pe,q,J,he,Te);return}}Qe&8?(Oe&16&&ke(Ie,pe,q),de!==Ie&&u(ge,de)):Oe&16?Qe&16?U(Ie,de,ge,ue,pe,q,J,he,Te):ke(Ie,pe,q,!0):(Oe&8&&u(ge,""),Qe&16&&x(de,ge,ue,pe,q,J,he,Te))},V=(j,se,ge,ue,pe,q,J,he,Te)=>{j=j||rc,se=se||rc;const Ie=j.length,Oe=se.length,de=Math.min(Ie,Oe);let $e;for($e=0;$e<de;$e++){const Qe=se[$e]=Te?lr(se[$e]):mo(se[$e]);m(j[$e],Qe,ge,null,pe,q,J,he,Te)}Ie>Oe?ke(j,pe,q,!0,!1,de):x(se,ge,ue,pe,q,J,he,Te,de)},U=(j,se,ge,ue,pe,q,J,he,Te)=>{let Ie=0;const Oe=se.length;let de=j.length-1,$e=Oe-1;for(;Ie<=de&&Ie<=$e;){const Qe=j[Ie],tt=se[Ie]=Te?lr(se[Ie]):mo(se[Ie]);if(yi(Qe,tt))m(Qe,tt,ge,null,pe,q,J,he,Te);else break;Ie++}for(;Ie<=de&&Ie<=$e;){const Qe=j[de],tt=se[$e]=Te?lr(se[$e]):mo(se[$e]);if(yi(Qe,tt))m(Qe,tt,ge,null,pe,q,J,he,Te);else break;de--,$e--}if(Ie>de){if(Ie<=$e){const Qe=$e+1,tt=Qe<Oe?se[Qe].el:ue;for(;Ie<=$e;)m(null,se[Ie]=Te?lr(se[Ie]):mo(se[Ie]),ge,tt,pe,q,J,he,Te),Ie++}}else if(Ie>$e)for(;Ie<=de;)ae(j[Ie],pe,q,!0),Ie++;else{const Qe=Ie,tt=Ie,vt=new Map;for(Ie=tt;Ie<=$e;Ie++){const Wt=se[Ie]=Te?lr(se[Ie]):mo(se[Ie]);Wt.key!=null&&vt.set(Wt.key,Ie)}let wt,xt=0;const Rt=$e-tt+1;let yt=!1,nn=0;const xn=new Array(Rt);for(Ie=0;Ie<Rt;Ie++)xn[Ie]=0;for(Ie=Qe;Ie<=de;Ie++){const Wt=j[Ie];if(xt>=Rt){ae(Wt,pe,q,!0);continue}let _n;if(Wt.key!=null)_n=vt.get(Wt.key);else for(wt=tt;wt<=$e;wt++)if(xn[wt-tt]===0&&yi(Wt,se[wt])){_n=wt;break}_n===void 0?ae(Wt,pe,q,!0):(xn[_n-tt]=Ie+1,_n>=nn?nn=_n:yt=!0,m(Wt,se[_n],ge,null,pe,q,J,he,Te),xt++)}const ns=yt?wT(xn):rc;for(wt=ns.length-1,Ie=Rt-1;Ie>=0;Ie--){const Wt=tt+Ie,_n=se[Wt],gn=se[Wt+1],ot=Wt+1<Oe?gn.el||I4(gn):ue;xn[Ie]===0?m(null,_n,ge,ot,pe,q,J,he,Te):yt&&(wt<0||Ie!==ns[wt]?re(_n,ge,ot,2):wt--)}}},re=(j,se,ge,ue,pe=null)=>{const{el:q,type:J,transition:he,children:Te,shapeFlag:Ie}=j;if(Ie&6){re(j.component.subTree,se,ge,ue);return}if(Ie&128){j.suspense.move(se,ge,ue);return}if(Ie&64){J.move(j,se,ge,Y);return}if(J===Be){s(q,se,ge);for(let de=0;de<Te.length;de++)re(Te[de],se,ge,ue);s(j.anchor,se,ge);return}if(J===fc){v(j,se,ge);return}if(ue!==2&&Ie&1&&he)if(ue===0)he.persisted&&!q[ti]?s(q,se,ge):(he.beforeEnter(q),s(q,se,ge),os(()=>he.enter(q),pe));else{const{leave:de,delayLeave:$e,afterLeave:Qe}=he,tt=()=>{j.ctx.isUnmounted?o(q):s(q,se,ge)},vt=()=>{const wt=q._isLeaving||!!q[ti];q._isLeaving&&q[ti](!0),he.persisted&&!wt?tt():de(q,()=>{tt(),Qe&&Qe()})};$e?$e(q,tt,vt):vt()}else s(q,se,ge)},ae=(j,se,ge,ue=!1,pe=!1)=>{const{type:q,props:J,ref:he,children:Te,dynamicChildren:Ie,shapeFlag:Oe,patchFlag:de,dirs:$e,cacheIndex:Qe,memo:tt}=j;if(de===-2&&(pe=!1),he!=null&&(yr(),uc(he,null,ge,j,!0),kr()),Qe!=null&&(se.renderCache[Qe]=void 0),Oe&256){se.ctx.deactivate(j);return}const vt=Oe&1&&$e,wt=!mr(j);let xt;if(wt&&(xt=J&&J.onVnodeBeforeUnmount)&&ho(xt,se,j),Oe&6)ne(j.component,ge,ue);else{if(Oe&128){j.suspense.unmount(ge,ue);return}vt&&Bi(j,null,se,"beforeUnmount"),Oe&64?j.type.remove(j,se,ge,Y,ue):Ie&&!Ie.hasOnce&&(q!==Be||de>0&&de&64)?ke(Ie,se,ge,!1,!0):(q===Be&&de&384||!pe&&Oe&16)&&ke(Te,se,ge),ue&&te(j)}const Rt=tt!=null&&Qe==null;(wt&&(xt=J&&J.onVnodeUnmounted)||vt||Rt)&&os(()=>{xt&&ho(xt,se,j),vt&&Bi(j,null,se,"unmounted"),Rt&&(j.el=null)},ge)},te=j=>{const{type:se,el:ge,anchor:ue,transition:pe}=j;if(se===Be){Z(ge,ue);return}if(se===fc){y(j);return}const q=()=>{o(ge),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(j.shapeFlag&1&&pe&&!pe.persisted){const{leave:J,delayLeave:he}=pe,Te=()=>J(ge,q);he?he(j.el,q,Te):Te()}else q()},Z=(j,se)=>{let ge;for(;j!==se;)ge=f(j),o(j),j=ge;o(se)},ne=(j,se,ge)=>{const{bum:ue,scope:pe,job:q,subTree:J,um:he,m:Te,a:Ie}=j;mh(Te),mh(Ie),ue&&ac(ue),pe.stop(),q&&(q.flags|=8,ae(J,j,se,ge)),he&&os(he,se),os(()=>{j.isUnmounted=!0},se)},ke=(j,se,ge,ue=!1,pe=!1,q=0)=>{for(let J=q;J<j.length;J++)ae(j[J],se,ge,ue,pe)},Se=j=>{if(j.shapeFlag&6)return Se(j.component.subTree);if(j.shapeFlag&128)return j.suspense.next();const se=f(j.anchor||j.el),ge=se&&se[o4];return ge?f(ge):se};let Ye=!1;const ve=(j,se,ge)=>{let ue;j==null?se._vnode&&(ae(se._vnode,null,null,!0),ue=se._vnode.component):m(se._vnode||null,j,se,null,null,null,ge),se._vnode=j,Ye||(Ye=!0,J2(ue),fh(),Ye=!1)},Y={p:m,um:ae,m:re,r:te,mt:R,mc:x,pc:z,pbc:N,n:Se,o:e};let ce,fe;return t&&([ce,fe]=t(Y)),{render:ve,hydrate:ce,createApp:aT(ve,ce)}}function k1({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 Fl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function T4(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Pv(e,t,n=!1){const s=e.children,o=t.children;if(_t(s)&&_t(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=lr(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Pv(r,l)),l.type===sl&&(l.patchFlag===-1&&(l=o[i]=lr(l)),l.el=r.el),l.type===rs&&!l.el&&(l.el=r.el)}}function wT(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function N4(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:N4(t)}function mh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function I4(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?I4(t.subTree):null}const gh=e=>e.__isSuspense;let sg=0;const ST={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)CT(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}AT(e,t,n,s,o,r,l,a,c)}},hydrate:MT,normalize:ET},Sbe=ST;function Gu(e,t){const n=e.props&&e.props[t];It(n)&&n()}function CT(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=$4(e,o,s,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,s,f,i,r),f.deps>0?(Gu(e,"onPending"),Gu(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),dc(f,e.ssFallback)):f.resolve(!1,!0)}function AT(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,p=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:_,isHydrating:k}=d;if(m)d.pendingBranch=f,yi(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():_&&(k||(a(h,p,n,s,o,null,i,r,l),dc(d,p)))):(d.pendingId=sg++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(h,p,n,s,o,null,i,r,l),dc(d,p))):h&&yi(h,f)?(a(h,f,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(h&&yi(h,f))a(h,f,n,s,o,d,i,r,l),dc(d,f);else if(Gu(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=sg++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(p)},g):g===0&&d.fallback(p)}}function $4(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:_}}=c;let k;const g=TT(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?ih(e.props.timeout):void 0,y=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:sg++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:x,activeBranch:E,pendingBranch:N,pendingId:F,effects:S,parentComponent:T,container:R,isInFallback:O}=A;let D=!1;if(A.isHydrating)A.isHydrating=!1;else if(!L){D=E&&N.transition&&N.transition.mode==="out-in";let V=!1;D&&(E.transition.afterLeave=()=>{F===A.pendingId&&(f(N,R,i===y&&!V?h(E):i,0),dh(S),O&&x.ssFallback&&(x.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(m(E.el)===R&&(i=h(E),V=!0),p(E,T,A,!0),!D&&O&&x.ssFallback&&os(()=>x.ssFallback.el=null,A)),D||f(N,R,i,0)}A.isFallbackMountPending=!1,dc(A,N),A.pendingBranch=null,A.isInFallback=!1;let W=A.parent,z=!1;for(;W;){if(W.pendingBranch){W.effects.push(...S),z=!0;break}W=W.parent}!z&&!D&&dh(S),A.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),Gu(x,"onResolve")},fallback(L){if(!A.pendingBranch)return;const{vnode:$,activeBranch:x,parentComponent:E,container:N,namespace:F}=A;Gu($,"onFallback");const S=h(x),T=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,L,N,S,E,null,F,l,a),dc(A,L))},R=L.transition&&L.transition.mode==="out-in";R&&(A.isFallbackMountPending=!0,x.transition.afterLeave=T),A.isInFallback=!0,p(x,E,null,!0),R||T()},move(L,$,x){A.activeBranch&&f(A.activeBranch,L,$,x),A.container=L},next(){return A.activeBranch&&h(A.activeBranch)},registerDep(L,$,x){const E=!!A.pendingBranch;E&&A.deps++;const N=L.vnode.el;L.asyncDep.catch(F=>{$c(F,L,0)}).then(F=>{if(L.isUnmounted||A.isUnmounted||A.pendingId!==L.suspenseId)return;Yu(),L.asyncResolved=!0;const{vnode:S}=L;og(L,F,!1),N&&(S.el=N);const T=!N&&L.subTree.el;$(L,S,m(N||L.subTree.el),N?null:h(L.subTree),A,r,x),T&&(S.placeholder=null,_(T)),Tp(L,S.el),E&&--A.deps===0&&A.resolve()})},unmount(L,$){A.isUnmounted=!0,A.activeBranch&&p(A.activeBranch,n,L,$),A.pendingBranch&&p(A.pendingBranch,n,L,$)}};return A}function MT(e,t,n,s,o,i,r,l,a){const c=t.suspense=$4(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function ET(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=hb(s?n.default:n),e.ssFallback=s?hb(n.fallback):ie(rs)}function hb(e){let t;if(It(e)){const n=oa&&e._c;n&&(e._d=!1,b()),e=e(),n&&(e._d=!0,t=Us,F4())}return _t(e)&&(e=dT(e)),e=mo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function L4(e,t){t&&t.pendingBranch?_t(e)?t.effects.push(...e):t.effects.push(e):dh(e)}function dc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,Tp(s,o))}function TT(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Be=Symbol.for("v-fgt"),sl=Symbol.for("v-txt"),rs=Symbol.for("v-cmt"),fc=Symbol.for("v-stc"),Cu=[];let Us=null;function b(e=!1){Cu.push(Us=e?null:[])}function F4(){Cu.pop(),Us=Cu[Cu.length-1]||null}let oa=1;function vh(e,t=!1){oa+=e,e<0&&Us&&t&&(Us.hasOnce=!0)}function O4(e){return e.dynamicChildren=oa>0?Us||rc:null,F4(),oa>0&&Us&&Us.push(e),e}function I(e,t,n,s,o,i){return O4(w(e,t,n,s,o,i,!0))}function ye(e,t,n,s,o){return O4(ie(e,t,n,s,o,!0))}function al(e){return e?e.__v_isVNode===!0:!1}function yi(e,t){return e.type===t.type&&e.key===t.key}function Cbe(e){}const R4=({key:e})=>e??null,Hf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bn(e)||Jn(e)||It(e)?{i:Fs,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,s=0,o=null,i=e===Be?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&R4(t),ref:t&&Hf(t),scopeId:Cp,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Fs};return l?(Wv(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=bn(n)?8:16),oa>0&&!r&&Us&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Us.push(a),a}const ie=NT;function NT(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===h4)&&(e=rs),al(e)){const l=xr(e,t,!0);return n&&Wv(l,n),oa>0&&!i&&Us&&(l.shapeFlag&6?Us[Us.indexOf(e)]=l:Us.push(l)),l.patchFlag=-2,l}if(RT(e)&&(e=e.__vccOpts),t){t=IT(t);let{class:l,style:a}=t;l&&!bn(l)&&(t.class=De(l)),rn(a)&&(Sp(a)&&!_t(a)&&(a=mn({},a)),t.style=qt(a))}const r=bn(e)?1:gh(e)?128:i4(e)?64:rn(e)?4:It(e)?2:0;return w(e,t,n,s,o,r,i,!0)}function IT(e){return e?Sp(e)||_4(e)?mn({},e):e:null}function xr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?pn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&R4(c),ref:t&&t.ref?n&&i?_t(i)?i.concat(Hf(t)):[i,Hf(t)]:Hf(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!==Be?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&&xr(e.ssContent),ssFallback:e.ssFallback&&xr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&ll(u,a.clone(u)),u}function Ge(e=" ",t=0){return ie(sl,null,e,t)}function Hv(e,t){const n=ie(fc,null,e);return n.staticCount=t,n}function le(e="",t=!1){return t?(b(),ye(rs,null,e)):ie(rs,null,e)}function mo(e){return e==null||typeof e=="boolean"?ie(rs):_t(e)?ie(Be,null,e.slice()):al(e)?lr(e):ie(sl,null,String(e))}function lr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:xr(e)}function Wv(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_t(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Wv(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!_4(t)?t._ctx=Fs:o===3&&Fs&&(Fs.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else It(t)?(t={default:t,_ctx:Fs},n=32):(t=String(t),s&64?(n=16,t=[Ge(t)]):n=8);e.children=t,e.shapeFlag|=n}function pn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=De([t.class,s.class]));else if(o==="style")t.style=qt([t.style,s.style]);else if(gd(o)){const i=t[o],r=s[o];r&&i!==r&&!(_t(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!fp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function ho(e,t,n,s=null){ui(e,t,7,[n,s])}const $T=g4();let LT=0;function B4(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||$T,i={uid:LT++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $C(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:S4(s,o),emitsOptions:y4(s,o),emit:null,emitted:null,propsDefaults:Gt,inheritAttrs:s.inheritAttrs,ctx:Gt,data:Gt,props:Gt,attrs:Gt,slots:Gt,refs:Gt,setupState:Gt,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=cT.bind(null,i),e.ce&&e.ce(i),i}let Ls=null;const Os=()=>Ls||Fs;let yh,hc;{const e=yp(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};yh=t("__VUE_INSTANCE_SETTERS__",n=>Ls=n),hc=t("__VUE_SSR_SETTERS__",n=>ia=n)}const Lc=e=>{const t=Ls;return yh(e),e.scope.on(),()=>{e.scope.off(),yh(t)}},Yu=()=>{Ls&&Ls.scope.off(),yh(null)};function D4(e){return e.vnode.shapeFlag&4}let ia=!1;function P4(e,t=!1,n=!1){t&&hc(t);const{props:s,children:o}=e.vnode,i=D4(e);mT(e,s,i,t),kT(e,o,n||t);const r=i?FT(e,t):void 0;return t&&hc(!1),r}function FT(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,J0);const{setup:s}=n;if(s){yr();const o=e.setupContext=s.length>1?W4(e):null,i=Lc(e),r=vd(s,e,0,[e.props,o]),l=_v(r);if(kr(),i(),(l||e.sp)&&!mr(e)&&Nv(e),l){if(r.then(Yu,Yu),t)return r.then(a=>{og(e,a,t)}).catch(a=>{$c(a,e,0)});e.asyncDep=r}else og(e,r,t)}else H4(e,t)}function og(e,t,n){It(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:rn(t)&&(e.setupState=ZC(t)),H4(e,n)}let kh,ig;function Abe(e){kh=e,ig=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,tT))}}const Mbe=()=>!kh;function H4(e,t,n){const s=e.type;if(!e.render){if(!t&&kh&&!s.render){const o=s.template||Rv(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=mn(mn({isCustomElement:i,delimiters:l},r),a);s.render=kh(o,c)}}e.render=s.render||li,ig&&ig(e)}{const o=Lc(e);yr();try{nT(e)}finally{kr(),o()}}}const OT={get(e,t){return zs(e,"get",""),e[t]}};function W4(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,OT),slots:e.slots,emit:e.emit,expose:t}}function xd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ZC(mt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Su)return Su[n](e)},has(t,n){return n in t||n in Su}})):e.proxy}function rg(e,t=!0){return It(e)?e.displayName||e.name:e.name||t&&e.__name}function RT(e){return It(e)&&"__vccOpts"in e}const P=(e,t)=>yE(e,t,ia);function dn(e,t,n){try{vh(-1);const s=arguments.length;return s===2?rn(t)&&!_t(t)?al(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&al(n)&&(n=[n]),ie(e,t,n))}finally{vh(1)}}function Ebe(){}function Tbe(e,t,n,s){const o=n[s];if(o&&BT(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function BT(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Is(n[s],t[s]))return!1;return oa>0&&Us&&Us.push(e),!0}const DT="3.5.35",Nbe=li,Ibe=wE,$be=qa,Lbe=n4,PT={createComponentInstance:B4,setupComponent:P4,renderComponentRoot:Pf,setCurrentRenderingInstance:qu,isVNode:al,normalizeVNode:mo,getComponentPublicInstance:xd,ensureValidVNode:Ov,pushWarningContext:xE,popWarningContext:_E},Fbe=PT,Obe=null,Rbe=null,Bbe=null;/**
|
|
16
|
+
`)&&(cf(v,0)||Oa(),v.textContent=y.children)}if(N){if(O||!x||F&48){const z=v.tagName.includes("-");for(const V in N)(O&&(V.endsWith("value")||V==="indeterminate")||gd(V)&&!Zl(V)||V[0]==="."||z&&!Zl(V))&&s(v,V,null,N[V],void 0,A)}else if(N.onClick)s(v,"onClick",null,N.onClick,void 0,A);else if(F&4&&nl(N.style))for(const z in N.style)N.style[z]}let W;(W=N&&N.onVnodeBeforeMount)&&ho(W,A,y),T&&Bi(y,null,A,"beforeMount"),((W=N&&N.onVnodeMounted)||T||D)&&L4(()=>{W&&ho(W,A,y),D&&R.enter(v),T&&Bi(y,null,A,"mounted")},L)}return v.nextSibling},p=(v,y,A,L,$,x,E)=>{E=E||!!y.dynamicChildren;const N=y.children,F=N.length;let S=!1;for(let T=0;T<F;T++){const R=E?N[T]:N[T]=mo(N[T]),O=R.type===sl;v?(O&&!E&&T+1<F&&mo(N[T+1]).type===sl&&(a(o(v.data.slice(R.children.length)),A,i(v)),v.data=R.children),v=d(v,R,L,$,x,E)):O&&!R.children?a(R.el=o(""),A):(S||(S=!0,cf(A,1)||Oa()),n(null,R,A,null,L,$,af(A),x))}return v},h=(v,y,A,L,$,x)=>{const{slotScopeIds:E}=y;E&&($=$?$.concat(E):E);const N=r(v),F=p(i(v),y,N,A,L,$,x);return F&&Ja(F)&&F.data==="]"?i(y.anchor=F):(Oa(),a(y.anchor=c("]"),N,F),F)},m=(v,y,A,L,$,x)=>{if(cf(v.parentElement,1)||Oa(),y.el=null,x){const F=_(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const E=i(v),N=r(v);return l(v),n(null,y,N,E,A,L,af(N),$),A&&(A.vnode.el=y.el,Tp(A,y.el)),E},_=(v,y="[",A="]")=>{let L=0;for(;v;)if(v=i(v),v&&Ja(v)&&(v.data===y&&L++,v.data===A)){if(L===0)return i(v);L--}return v},k=(v,y,A)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=A;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const rb="data-allow-mismatch",PE={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function cf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(rb);)e=e.parentElement;const n=e&&e.getAttribute(rb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(PE[t])}}const HE=yp().requestIdleCallback||(e=>setTimeout(e,1)),WE=yp().cancelIdleCallback||(e=>clearTimeout(e)),lbe=(e=1e4)=>t=>{const n=HE(t,{timeout:e});return()=>WE(n)};function zE(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const abe=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(zE(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},cbe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},ube=(e=[])=>(t,n)=>{bn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function UE(e,t){if(Ja(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Ja(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const mr=e=>!!e.type.__asyncLoader;function ki(e){It(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,p()),p=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,k)=>{a(m,()=>_(f()),()=>k(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return qe({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,_){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||_()},v=i?()=>{const y=i(g,A=>UE(h,A));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():p().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const h=Ls;if(Nv(h),u)return()=>uf(u,h);const m=v=>{c=null,$c(v,h,13,!s)};if(l&&h.suspense||ia)return p().then(v=>()=>uf(v,h)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const _=Q(!1),k=Q(),g=Q(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!_.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),p().then(()=>{_.value=!0,h.parent&&kd(h.parent.vnode)&&h.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(_.value&&u)return uf(u,h);if(k.value&&s)return ie(s,{error:k.value});if(n&&!g.value)return uf(n,h)}}})}function uf(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ie(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const kd=e=>e.type.__isKeepAlive,jE={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Os(),s=n.ctx;if(!s.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(g,v,y,A,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,A,g.slotScopeIds,L),os(()=>{$.isDeactivated=!1,$.a&&ac($.a);const x=g.props&&g.props.onVnodeMounted;x&&ho(x,$.parent,g)},l)},s.deactivate=g=>{const v=g.component;mh(v.m),mh(v.a),c(g,f,null,1,l),os(()=>{v.da&&ac(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&ho(y,v.parent,g),v.isDeactivated=!0},l)};function p(g){v1(g),u(g,n,l,!0)}function h(g){o.forEach((v,y)=>{const A=rg(mr(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!yi(v,r))?p(v):r&&v1(r),o.delete(g),i.delete(g)}Ke(()=>[e.include,e.exclude],([g,v])=>{g&&h(y=>mu(g,y)),v&&h(y=>!mu(v,y))},{flush:"post",deep:!0});let _=null;const k=()=>{_!=null&&(gh(n.subTree.type)?os(()=>{o.set(_,df(n.subTree))},n.subTree.suspense):o.set(_,df(n.subTree)))};return ln(k),Iv(k),es(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,A=df(v);if(g.type===A.type&&g.key===A.key){v1(A);const L=A.component.da;L&&os(L,y);return}p(g)})}),()=>{if(_=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!al(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=df(v);if(y.type===rs)return r=null,y;const A=y.type,L=rg(mr(y)?y.type.__asyncResolved||{}:A),{include:$,exclude:x,max:E}=e;if($&&(!L||!mu($,L))||x&&L&&mu(x,L))return y.shapeFlag&=-257,r=y,v;const N=y.key==null?A:y.key,F=o.get(N);return y.el&&(y=xr(y),v.shapeFlag&128&&(v.ssContent=y)),_=N,F?(y.el=F.el,y.component=F.component,y.transition&&ll(y,y.transition),y.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,gh(v.type)?v:y}}},dbe=jE;function mu(e,t){return _t(e)?e.some(n=>mu(n,t)):bn(e)?e.split(",").includes(t):I8(e)?(e.lastIndex=0,e.test(t)):!1}function qE(e,t){d4(e,"a",t)}function VE(e,t){d4(e,"da",t)}function d4(e,t,n=Ls){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Mp(t,s,n),n){let o=n.parent;for(;o&&o.parent;)kd(o.parent.vnode)&&KE(s,t,n,o),o=o.parent}}function KE(e,t,n,s){const o=Mp(t,e,s,!0);fn(()=>{xv(s[t],o)},n)}function v1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function df(e){return e.shapeFlag&128?e.ssContent:e}function Mp(e,t,n=Ls,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{yr();const l=Lc(n),a=ui(t,n,e,r);return l(),kr(),a});return s?o.unshift(i):o.push(i),i}}const wr=e=>(t,n=Ls)=>{(!ia||e==="sp")&&Mp(e,(...s)=>t(...s),n)},GE=wr("bm"),ln=wr("m"),f4=wr("bu"),Iv=wr("u"),es=wr("bum"),fn=wr("um"),YE=wr("sp"),ZE=wr("rtg"),QE=wr("rtc");function XE(e,t=Ls){Mp("ec",e,t)}const $v="components",JE="directives";function eT(e,t){return Lv($v,e,!0,t)||e}const h4=Symbol.for("v-ndc");function $s(e){return bn(e)?Lv($v,e,!1)||e:e||h4}function fbe(e){return Lv(JE,e)}function Lv(e,t,n=!0,s=!1){const o=Fs||Ls;if(o){const i=o.type;if(e===$v){const l=rg(i,!1);if(l&&(l===t||l===vs(t)||l===gp(vs(t))))return i}const r=lb(o[e]||i[e],t)||lb(o.appContext[e],t);return!r&&s?i:r}}function lb(e,t){return e&&(e[t]||e[vs(t)]||e[gp(vs(t))])}function nt(e,t,n,s){let o;const i=n&&n[s],r=_t(e);if(r||bn(e)){const l=r&&nl(e);let a=!1,c=!1;l&&(a=!Oo(e),c=br(e),e=xp(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?xc(Si(e[u])):Si(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(rn(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function Fv(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(_t(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function In(e,t,n={},s,o){if(Fs.ce||Fs.parent&&mr(Fs.parent)&&Fs.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),ye(Be,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),b();const r=i&&Ov(i(n)),l=n.key||r&&r.key,a=ye(Be,{key:(l&&!zo(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function Ov(e){return e.some(t=>al(t)?!(t.type===rs||t.type===Be&&!Ov(t.children)):!0)?e:null}function hbe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:Df(s)]=e[s];return n}const X0=e=>e?D4(e)?xd(e):X0(e.parent):null,Su=mn(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=>X0(e.parent),$root:e=>X0(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Rv(e),$forceUpdate:e=>e.f||(e.f=()=>{Ev(e.update)}),$nextTick:e=>e.n||(e.n=pt.bind(e.proxy)),$watch:e=>NE.bind(e)}),y1=(e,t)=>e!==Gt&&!e.__isScriptSetup&&on(e,t),J0={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(y1(s,t))return r[t]=1,s[t];if(o!==Gt&&on(o,t))return r[t]=2,o[t];if(on(i,t))return r[t]=3,i[t];if(n!==Gt&&on(n,t))return r[t]=4,n[t];eg&&(r[t]=0)}}const c=Su[t];let u,d;if(c)return t==="$attrs"&&zs(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Gt&&on(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,on(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return y1(o,t)?(o[t]=n,!0):s!==Gt&&on(s,t)?(s[t]=n,!0):on(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Gt&&l[0]!=="$"&&on(e,l)||y1(t,l)||on(i,l)||on(s,l)||on(Su,l)||on(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:on(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},tT=mn({},J0,{get(e,t){if(t!==Symbol.unscopables)return J0.get(e,t,e)},has(e,t){return t[0]!=="_"&&!R8(t)}});function pbe(){return null}function mbe(){return null}function gbe(e){}function vbe(e){}function ybe(){return null}function kbe(){}function bbe(e,t){return null}function xbe(){return p4().slots}function bd(){return p4().attrs}function p4(e){const t=Os();return t.setupContext||(t.setupContext=W4(t))}function Ku(e){return _t(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function _be(e,t){const n=Ku(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?_t(o)||It(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function wbe(e,t){return!e||!t?e||t:_t(e)&&_t(t)?e.concat(t):mn({},Ku(e),Ku(t))}function Sbe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Cbe(e){const t=Os(),n=ia;let s=e();Yu(),n&&hc(!1);const o=()=>{Lc(t),n&&hc(!0)},i=()=>{Os()!==t&&t.scope.off(),Yu(),n&&hc(!1)};return _v(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let eg=!0;function nT(e){const t=Rv(e),n=e.proxy,s=e.ctx;eg=!1,t.beforeCreate&&ab(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:_,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:A,renderTracked:L,renderTriggered:$,errorCaptured:x,serverPrefetch:E,expose:N,inheritAttrs:F,components:S,directives:T,filters:R}=t;if(c&&sT(c,s,null),r)for(const W in r){const z=r[W];It(z)&&(s[W]=z.bind(n))}if(o){const W=o.call(n,n);rn(W)&&(e.data=Ss(W))}if(eg=!0,i)for(const W in i){const z=i[W],V=It(z)?z.bind(n,n):It(z.get)?z.get.bind(n,n):li,U=!It(z)&&It(z.set)?z.set.bind(n):li,re=P({get:V,set:U});Object.defineProperty(s,W,{enumerable:!0,configurable:!0,get:()=>re.value,set:ae=>re.value=ae})}if(l)for(const W in l)m4(l[W],s,n,W);if(a){const W=It(a)?a.call(n):a;Reflect.ownKeys(W).forEach(z=>{An(z,W[z])})}u&&ab(u,e,"c");function D(W,z){_t(z)?z.forEach(V=>W(V.bind(n))):z&&W(z.bind(n))}if(D(GE,d),D(ln,f),D(f4,p),D(Iv,h),D(qE,m),D(VE,_),D(XE,x),D(QE,L),D(ZE,$),D(es,g),D(fn,y),D(YE,E),_t(N))if(N.length){const W=e.exposed||(e.exposed={});N.forEach(z=>{Object.defineProperty(W,z,{get:()=>n[z],set:V=>n[z]=V,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===li&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),T&&(e.directives=T),E&&Nv(e)}function sT(e,t,n=li){_t(e)&&(e=tg(e));for(const s in e){const o=e[s];let i;rn(o)?"default"in o?i=Ut(o.from||s,o.default,!0):i=Ut(o.from||s):i=Ut(o),Jn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function ab(e,t,n){ui(_t(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function m4(e,t,n,s){let o=s.includes(".")?s4(n,s):()=>n[s];if(bn(e)){const i=t[e];It(i)&&Ke(o,i)}else if(It(e))Ke(o,e.bind(n));else if(rn(e))if(_t(e))e.forEach(i=>m4(i,t,n,s));else{const i=It(e.handler)?e.handler.bind(n):t[e.handler];It(i)&&Ke(o,i,e)}}function Rv(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>ph(a,c,r,!0)),ph(a,t,r)),rn(t)&&i.set(t,a),a}function ph(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&ph(e,i,n,!0),o&&o.forEach(r=>ph(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=oT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const oT={data:cb,props:ub,emits:ub,methods:gu,computed:gu,beforeCreate:Ys,created:Ys,beforeMount:Ys,mounted:Ys,beforeUpdate:Ys,updated:Ys,beforeDestroy:Ys,beforeUnmount:Ys,destroyed:Ys,unmounted:Ys,activated:Ys,deactivated:Ys,errorCaptured:Ys,serverPrefetch:Ys,components:gu,directives:gu,watch:rT,provide:cb,inject:iT};function cb(e,t){return t?e?function(){return mn(It(e)?e.call(this,this):e,It(t)?t.call(this,this):t)}:t:e}function iT(e,t){return gu(tg(e),tg(t))}function tg(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ys(e,t){return e?[...new Set([].concat(e,t))]:t}function gu(e,t){return e?mn(Object.create(null),e,t):t}function ub(e,t){return e?_t(e)&&_t(t)?[...new Set([...e,...t])]:mn(Object.create(null),Ku(e),Ku(t??{})):t}function rT(e,t){if(!e)return t;if(!t)return e;const n=mn(Object.create(null),e);for(const s in t)n[s]=Ys(e[s],t[s]);return n}function g4(){return{app:null,config:{isNativeTag:AC,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 lT=0;function aT(e,t){return function(s,o=null){It(s)||(s=mn({},s)),o!=null&&!rn(o)&&(o=null);const i=g4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:lT++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:DT,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&It(u.install)?(r.add(u),u.install(c,...d)):It(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 p=c._ceVNode||ie(s,o);return p.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(p,u):e(p,u,f),a=!0,c._container=u,u.__vue_app__=c,xd(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(ui(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=Xl;Xl=c;try{return u()}finally{Xl=d}}};return c}}let Xl=null;function Abe(e,t,n=Gt){const s=Os(),o=vs(t),i=go(t),r=v4(e,o),l=pE((a,c)=>{let u,d=Gt,f;return TE(()=>{const p=e[o];Is(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Is(h,u)&&!(d!==Gt&&Is(p,d)))return;const m=s.vnode.props;m&&(t in m||o in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${i}`in m)||(u=p,c()),s.emit(`update:${t}`,h),Is(p,h)&&Is(p,d)&&!Is(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Gt:l,done:!1}:{done:!0}}}},l}const v4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${vs(t)}Modifiers`]||e[`${go(t)}Modifiers`];function cT(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Gt;let o=n;const i=t.startsWith("update:"),r=i&&v4(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>bn(u)?u.trim():u)),r.number&&(o=n.map(vp)));let l,a=s[l=Df(t)]||s[l=Df(vs(t))];!a&&i&&(a=s[l=Df(go(t))]),a&&ui(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ui(c,e,6,o)}}const uT=new WeakMap;function y4(e,t,n=!1){const s=n?uT:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!It(e)){const a=c=>{const u=y4(c,t,!0);u&&(l=!0,mn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(rn(e)&&s.set(e,null),null):(_t(i)?i.forEach(a=>r[a]=null):mn(r,i),rn(e)&&s.set(e,r),r)}function Ep(e,t){return!e||!gd(t)?!1:(t=t.slice(2).replace(/Once$/,""),on(e,t[0].toLowerCase()+t.slice(1))||on(e,go(t))||on(e,t))}function Pf(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:p,ctx:h,inheritAttrs:m}=e,_=qu(e);let k,g;try{if(n.shapeFlag&4){const y=o||s,A=y;k=mo(c.call(A,y,u,d,p,f,h)),g=l}else{const y=t;k=mo(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:fT(l)}}catch(y){Cu.length=0,$c(y,e,1),k=ie(rs)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:A}=v;y.length&&A&7&&(i&&y.some(fp)&&(g=hT(g,i)),v=xr(v,g,!1,!0))}return n.dirs&&(v=xr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&ll(v,n.transition),k=v,qu(_),k}function dT(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(al(o)){if(o.type!==rs||o.children==="v-if"){if(n)return;n=o}}else return}return n}const fT=e=>{let t;for(const n in e)(n==="class"||n==="style"||gd(n))&&((t||(t={}))[n]=e[n]);return t},hT=(e,t)=>{const n={};for(const s in e)(!fp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function pT(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?db(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(k4(r,s,f)&&!Ep(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?db(s,r,c):!0:!!r;return!1}function db(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(k4(t,e,i)&&!Ep(n,i))return!0}return!1}function k4(e,t,n){const s=e[n],o=t[n];return n==="style"&&rn(s)&&rn(o)?!vr(s,o):s!==o}function Tp({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const b4={},x4=()=>Object.create(b4),_4=e=>Object.getPrototypeOf(e)===b4;function mT(e,t,n,s=!1){const o={},i=x4();e.propsDefaults=Object.create(null),w4(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:uE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function gT(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Xt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(Ep(e.emitsOptions,f))continue;const p=t[f];if(a)if(on(i,f))p!==i[f]&&(i[f]=p,c=!0);else{const h=vs(f);o[h]=ng(a,l,h,p,e,!1)}else p!==i[f]&&(i[f]=p,c=!0)}}}else{w4(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!on(t,d)&&((u=go(d))===d||!on(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=ng(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!on(t,d))&&(delete i[d],c=!0)}c&&cr(e.attrs,"set","")}function w4(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Zl(a))continue;const c=t[a];let u;o&&on(o,u=vs(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:Ep(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Xt(n),c=l||Gt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=ng(o,a,d,c[d],e,!on(c,d))}}return r}function ng(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=on(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&It(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Lc(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===go(n))&&(s=!0))}return s}const vT=new WeakMap;function S4(e,t,n=!1){const s=n?vT:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!It(e)){const u=d=>{a=!0;const[f,p]=S4(d,t,!0);mn(r,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return rn(e)&&s.set(e,rc),rc;if(_t(i))for(let u=0;u<i.length;u++){const d=vs(i[u]);fb(d)&&(r[d]=Gt)}else if(i)for(const u in i){const d=vs(u);if(fb(d)){const f=i[u],p=r[d]=_t(f)||It(f)?{type:f}:mn({},f),h=p.type;let m=!1,_=!0;if(_t(h))for(let k=0;k<h.length;++k){const g=h[k],v=It(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(_=!1)}else m=It(h)&&h.name==="Boolean";p[0]=m,p[1]=_,(m||on(p,"default"))&&l.push(d)}}const c=[r,l];return rn(e)&&s.set(e,c),c}function fb(e){return e[0]!=="$"&&!Zl(e)}const Bv=e=>e==="_"||e==="_ctx"||e==="$stable",Dv=e=>_t(e)?e.map(mo):[mo(e)],yT=(e,t,n)=>{if(t._n)return t;const s=Ee((...o)=>Dv(t(...o)),n);return s._c=!1,s},C4=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Bv(o))continue;const i=e[o];if(It(i))t[o]=yT(o,i,s);else if(i!=null){const r=Dv(i);t[o]=()=>r}}},A4=(e,t)=>{const n=Dv(t);e.slots.default=()=>n},M4=(e,t,n)=>{for(const s in t)(n||!Bv(s))&&(e[s]=t[s])},kT=(e,t,n)=>{const s=e.slots=x4();if(e.vnode.shapeFlag&32){const o=t._;o?(M4(s,t,n),n&&EC(s,"_",o,!0)):C4(t,s)}else t&&A4(e,t)},bT=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Gt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:M4(o,t,n):(i=!t.$stable,C4(t,o)),r=t}else t&&(A4(e,t),r={default:1});if(i)for(const l in o)!Bv(l)&&r[l]==null&&delete o[l]},os=L4;function xT(e){return E4(e)}function _T(e){return E4(e,DE)}function E4(e,t){const n=yp();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=li,insertStaticContent:h}=e,m=(j,se,ge,ue=null,pe=null,q=null,J=void 0,he=null,Te=!!se.dynamicChildren)=>{if(j===se)return;j&&!yi(j,se)&&(ue=Se(j),ae(j,pe,q,!0),j=null),se.patchFlag===-2&&(Te=!1,se.dynamicChildren=null);const{type:Ie,ref:Oe,shapeFlag:de}=se;switch(Ie){case sl:_(j,se,ge,ue);break;case rs:k(j,se,ge,ue);break;case fc:j==null&&g(se,ge,ue,J);break;case Be:S(j,se,ge,ue,pe,q,J,he,Te);break;default:de&1?A(j,se,ge,ue,pe,q,J,he,Te):de&6?T(j,se,ge,ue,pe,q,J,he,Te):(de&64||de&128)&&Ie.process(j,se,ge,ue,pe,q,J,he,Te,Y)}Oe!=null&&pe?uc(Oe,j&&j.ref,q,se||j,!se):Oe==null&&j&&j.ref!=null&&uc(j.ref,null,q,j,!0)},_=(j,se,ge,ue)=>{if(j==null)s(se.el=l(se.children),ge,ue);else{const pe=se.el=j.el;se.children!==j.children&&c(pe,se.children)}},k=(j,se,ge,ue)=>{j==null?s(se.el=a(se.children||""),ge,ue):se.el=j.el},g=(j,se,ge,ue)=>{[j.el,j.anchor]=h(j.children,se,ge,ue,j.el,j.anchor)},v=({el:j,anchor:se},ge,ue)=>{let pe;for(;j&&j!==se;)pe=f(j),s(j,ge,ue),j=pe;s(se,ge,ue)},y=({el:j,anchor:se})=>{let ge;for(;j&&j!==se;)ge=f(j),o(j),j=ge;o(se)},A=(j,se,ge,ue,pe,q,J,he,Te)=>{if(se.type==="svg"?J="svg":se.type==="math"&&(J="mathml"),j==null)L(se,ge,ue,pe,q,J,he,Te);else{const Ie=j.el&&j.el._isVueCE?j.el:null;try{Ie&&Ie._beginPatch(),E(j,se,pe,q,J,he,Te)}finally{Ie&&Ie._endPatch()}}},L=(j,se,ge,ue,pe,q,J,he)=>{let Te,Ie;const{props:Oe,shapeFlag:de,transition:$e,dirs:Qe}=j;if(Te=j.el=r(j.type,q,Oe&&Oe.is,Oe),de&8?u(Te,j.children):de&16&&x(j.children,Te,null,ue,pe,k1(j,q),J,he),Qe&&Bi(j,null,ue,"created"),$(Te,j,j.scopeId,J,ue),Oe){for(const vt in Oe)vt!=="value"&&!Zl(vt)&&i(Te,vt,null,Oe[vt],q,ue);"value"in Oe&&i(Te,"value",null,Oe.value,q),(Ie=Oe.onVnodeBeforeMount)&&ho(Ie,ue,j)}Qe&&Bi(j,null,ue,"beforeMount");const tt=T4(pe,$e);tt&&$e.beforeEnter(Te),s(Te,se,ge),((Ie=Oe&&Oe.onVnodeMounted)||tt||Qe)&&os(()=>{try{Ie&&ho(Ie,ue,j),tt&&$e.enter(Te),Qe&&Bi(j,null,ue,"mounted")}finally{}},pe)},$=(j,se,ge,ue,pe)=>{if(ge&&p(j,ge),ue)for(let q=0;q<ue.length;q++)p(j,ue[q]);if(pe){let q=pe.subTree;if(se===q||gh(q.type)&&(q.ssContent===se||q.ssFallback===se)){const J=pe.vnode;$(j,J,J.scopeId,J.slotScopeIds,pe.parent)}}},x=(j,se,ge,ue,pe,q,J,he,Te=0)=>{for(let Ie=Te;Ie<j.length;Ie++){const Oe=j[Ie]=he?lr(j[Ie]):mo(j[Ie]);m(null,Oe,se,ge,ue,pe,q,J,he)}},E=(j,se,ge,ue,pe,q,J)=>{const he=se.el=j.el;let{patchFlag:Te,dynamicChildren:Ie,dirs:Oe}=se;Te|=j.patchFlag&16;const de=j.props||Gt,$e=se.props||Gt;let Qe;if(ge&&Fl(ge,!1),(Qe=$e.onVnodeBeforeUpdate)&&ho(Qe,ge,se,j),Oe&&Bi(se,j,ge,"beforeUpdate"),ge&&Fl(ge,!0),(de.innerHTML&&$e.innerHTML==null||de.textContent&&$e.textContent==null)&&u(he,""),Ie?N(j.dynamicChildren,Ie,he,ge,ue,k1(se,pe),q):J||z(j,se,he,null,ge,ue,k1(se,pe),q,!1),Te>0){if(Te&16)F(he,de,$e,ge,pe);else if(Te&2&&de.class!==$e.class&&i(he,"class",null,$e.class,pe),Te&4&&i(he,"style",de.style,$e.style,pe),Te&8){const tt=se.dynamicProps;for(let vt=0;vt<tt.length;vt++){const wt=tt[vt],xt=de[wt],Rt=$e[wt];(Rt!==xt||wt==="value")&&i(he,wt,xt,Rt,pe,ge)}}Te&1&&j.children!==se.children&&u(he,se.children)}else!J&&Ie==null&&F(he,de,$e,ge,pe);((Qe=$e.onVnodeUpdated)||Oe)&&os(()=>{Qe&&ho(Qe,ge,se,j),Oe&&Bi(se,j,ge,"updated")},ue)},N=(j,se,ge,ue,pe,q,J)=>{for(let he=0;he<se.length;he++){const Te=j[he],Ie=se[he],Oe=Te.el&&(Te.type===Be||!yi(Te,Ie)||Te.shapeFlag&198)?d(Te.el):ge;m(Te,Ie,Oe,null,ue,pe,q,J,!0)}},F=(j,se,ge,ue,pe)=>{if(se!==ge){if(se!==Gt)for(const q in se)!Zl(q)&&!(q in ge)&&i(j,q,se[q],null,pe,ue);for(const q in ge){if(Zl(q))continue;const J=ge[q],he=se[q];J!==he&&q!=="value"&&i(j,q,he,J,pe,ue)}"value"in ge&&i(j,"value",se.value,ge.value,pe)}},S=(j,se,ge,ue,pe,q,J,he,Te)=>{const Ie=se.el=j?j.el:l(""),Oe=se.anchor=j?j.anchor:l("");let{patchFlag:de,dynamicChildren:$e,slotScopeIds:Qe}=se;Qe&&(he=he?he.concat(Qe):Qe),j==null?(s(Ie,ge,ue),s(Oe,ge,ue),x(se.children||[],ge,Oe,pe,q,J,he,Te)):de>0&&de&64&&$e&&j.dynamicChildren&&j.dynamicChildren.length===$e.length?(N(j.dynamicChildren,$e,ge,pe,q,J,he),(se.key!=null||pe&&se===pe.subTree)&&Pv(j,se,!0)):z(j,se,ge,Oe,pe,q,J,he,Te)},T=(j,se,ge,ue,pe,q,J,he,Te)=>{se.slotScopeIds=he,j==null?se.shapeFlag&512?pe.ctx.activate(se,ge,ue,J,Te):R(se,ge,ue,pe,q,J,Te):O(j,se,Te)},R=(j,se,ge,ue,pe,q,J)=>{const he=j.component=B4(j,ue,pe);if(kd(j)&&(he.ctx.renderer=Y),P4(he,!1,J),he.asyncDep){if(pe&&pe.registerDep(he,D,J),!j.el){const Te=he.subTree=ie(rs);k(null,Te,se,ge),j.placeholder=Te.el}}else D(he,j,se,ge,pe,q,J)},O=(j,se,ge)=>{const ue=se.component=j.component;if(pT(j,se,ge))if(ue.asyncDep&&!ue.asyncResolved){W(ue,se,ge);return}else ue.next=se,ue.update();else se.el=j.el,ue.vnode=se},D=(j,se,ge,ue,pe,q,J)=>{const he=()=>{if(j.isMounted){let{next:de,bu:$e,u:Qe,parent:tt,vnode:vt}=j;{const nn=N4(j);if(nn){de&&(de.el=vt.el,W(j,de,J)),nn.asyncDep.then(()=>{os(()=>{j.isUnmounted||Ie()},pe)});return}}let wt=de,xt;Fl(j,!1),de?(de.el=vt.el,W(j,de,J)):de=vt,$e&&ac($e),(xt=de.props&&de.props.onVnodeBeforeUpdate)&&ho(xt,tt,de,vt),Fl(j,!0);const Rt=Pf(j),yt=j.subTree;j.subTree=Rt,m(yt,Rt,d(yt.el),Se(yt),j,pe,q),de.el=Rt.el,wt===null&&Tp(j,Rt.el),Qe&&os(Qe,pe),(xt=de.props&&de.props.onVnodeUpdated)&&os(()=>ho(xt,tt,de,vt),pe)}else{let de;const{el:$e,props:Qe}=se,{bm:tt,m:vt,parent:wt,root:xt,type:Rt}=j,yt=mr(se);if(Fl(j,!1),tt&&ac(tt),!yt&&(de=Qe&&Qe.onVnodeBeforeMount)&&ho(de,wt,se),Fl(j,!0),$e&&fe){const nn=()=>{j.subTree=Pf(j),fe($e,j.subTree,j,pe,null)};yt&&Rt.__asyncHydrate?Rt.__asyncHydrate($e,j,nn):nn()}else{xt.ce&&xt.ce._hasShadowRoot()&&xt.ce._injectChildStyle(Rt,j.parent?j.parent.type:void 0);const nn=j.subTree=Pf(j);m(null,nn,ge,ue,j,pe,q),se.el=nn.el}if(vt&&os(vt,pe),!yt&&(de=Qe&&Qe.onVnodeMounted)){const nn=se;os(()=>ho(de,wt,nn),pe)}(se.shapeFlag&256||wt&&mr(wt.vnode)&&wt.vnode.shapeFlag&256)&&j.a&&os(j.a,pe),j.isMounted=!0,se=ge=ue=null}};j.scope.on();const Te=j.effect=new rh(he);j.scope.off();const Ie=j.update=Te.run.bind(Te),Oe=j.job=Te.runIfDirty.bind(Te);Oe.i=j,Oe.id=j.uid,Te.scheduler=()=>Ev(Oe),Fl(j,!0),Ie()},W=(j,se,ge)=>{se.component=j;const ue=j.vnode.props;j.vnode=se,j.next=null,gT(j,se.props,ue,ge),bT(j,se.children,ge),yr(),J2(j),kr()},z=(j,se,ge,ue,pe,q,J,he,Te=!1)=>{const Ie=j&&j.children,Oe=j?j.shapeFlag:0,de=se.children,{patchFlag:$e,shapeFlag:Qe}=se;if($e>0){if($e&128){U(Ie,de,ge,ue,pe,q,J,he,Te);return}else if($e&256){V(Ie,de,ge,ue,pe,q,J,he,Te);return}}Qe&8?(Oe&16&&ke(Ie,pe,q),de!==Ie&&u(ge,de)):Oe&16?Qe&16?U(Ie,de,ge,ue,pe,q,J,he,Te):ke(Ie,pe,q,!0):(Oe&8&&u(ge,""),Qe&16&&x(de,ge,ue,pe,q,J,he,Te))},V=(j,se,ge,ue,pe,q,J,he,Te)=>{j=j||rc,se=se||rc;const Ie=j.length,Oe=se.length,de=Math.min(Ie,Oe);let $e;for($e=0;$e<de;$e++){const Qe=se[$e]=Te?lr(se[$e]):mo(se[$e]);m(j[$e],Qe,ge,null,pe,q,J,he,Te)}Ie>Oe?ke(j,pe,q,!0,!1,de):x(se,ge,ue,pe,q,J,he,Te,de)},U=(j,se,ge,ue,pe,q,J,he,Te)=>{let Ie=0;const Oe=se.length;let de=j.length-1,$e=Oe-1;for(;Ie<=de&&Ie<=$e;){const Qe=j[Ie],tt=se[Ie]=Te?lr(se[Ie]):mo(se[Ie]);if(yi(Qe,tt))m(Qe,tt,ge,null,pe,q,J,he,Te);else break;Ie++}for(;Ie<=de&&Ie<=$e;){const Qe=j[de],tt=se[$e]=Te?lr(se[$e]):mo(se[$e]);if(yi(Qe,tt))m(Qe,tt,ge,null,pe,q,J,he,Te);else break;de--,$e--}if(Ie>de){if(Ie<=$e){const Qe=$e+1,tt=Qe<Oe?se[Qe].el:ue;for(;Ie<=$e;)m(null,se[Ie]=Te?lr(se[Ie]):mo(se[Ie]),ge,tt,pe,q,J,he,Te),Ie++}}else if(Ie>$e)for(;Ie<=de;)ae(j[Ie],pe,q,!0),Ie++;else{const Qe=Ie,tt=Ie,vt=new Map;for(Ie=tt;Ie<=$e;Ie++){const Wt=se[Ie]=Te?lr(se[Ie]):mo(se[Ie]);Wt.key!=null&&vt.set(Wt.key,Ie)}let wt,xt=0;const Rt=$e-tt+1;let yt=!1,nn=0;const xn=new Array(Rt);for(Ie=0;Ie<Rt;Ie++)xn[Ie]=0;for(Ie=Qe;Ie<=de;Ie++){const Wt=j[Ie];if(xt>=Rt){ae(Wt,pe,q,!0);continue}let _n;if(Wt.key!=null)_n=vt.get(Wt.key);else for(wt=tt;wt<=$e;wt++)if(xn[wt-tt]===0&&yi(Wt,se[wt])){_n=wt;break}_n===void 0?ae(Wt,pe,q,!0):(xn[_n-tt]=Ie+1,_n>=nn?nn=_n:yt=!0,m(Wt,se[_n],ge,null,pe,q,J,he,Te),xt++)}const ns=yt?wT(xn):rc;for(wt=ns.length-1,Ie=Rt-1;Ie>=0;Ie--){const Wt=tt+Ie,_n=se[Wt],gn=se[Wt+1],ot=Wt+1<Oe?gn.el||I4(gn):ue;xn[Ie]===0?m(null,_n,ge,ot,pe,q,J,he,Te):yt&&(wt<0||Ie!==ns[wt]?re(_n,ge,ot,2):wt--)}}},re=(j,se,ge,ue,pe=null)=>{const{el:q,type:J,transition:he,children:Te,shapeFlag:Ie}=j;if(Ie&6){re(j.component.subTree,se,ge,ue);return}if(Ie&128){j.suspense.move(se,ge,ue);return}if(Ie&64){J.move(j,se,ge,Y);return}if(J===Be){s(q,se,ge);for(let de=0;de<Te.length;de++)re(Te[de],se,ge,ue);s(j.anchor,se,ge);return}if(J===fc){v(j,se,ge);return}if(ue!==2&&Ie&1&&he)if(ue===0)he.persisted&&!q[ti]?s(q,se,ge):(he.beforeEnter(q),s(q,se,ge),os(()=>he.enter(q),pe));else{const{leave:de,delayLeave:$e,afterLeave:Qe}=he,tt=()=>{j.ctx.isUnmounted?o(q):s(q,se,ge)},vt=()=>{const wt=q._isLeaving||!!q[ti];q._isLeaving&&q[ti](!0),he.persisted&&!wt?tt():de(q,()=>{tt(),Qe&&Qe()})};$e?$e(q,tt,vt):vt()}else s(q,se,ge)},ae=(j,se,ge,ue=!1,pe=!1)=>{const{type:q,props:J,ref:he,children:Te,dynamicChildren:Ie,shapeFlag:Oe,patchFlag:de,dirs:$e,cacheIndex:Qe,memo:tt}=j;if(de===-2&&(pe=!1),he!=null&&(yr(),uc(he,null,ge,j,!0),kr()),Qe!=null&&(se.renderCache[Qe]=void 0),Oe&256){se.ctx.deactivate(j);return}const vt=Oe&1&&$e,wt=!mr(j);let xt;if(wt&&(xt=J&&J.onVnodeBeforeUnmount)&&ho(xt,se,j),Oe&6)ne(j.component,ge,ue);else{if(Oe&128){j.suspense.unmount(ge,ue);return}vt&&Bi(j,null,se,"beforeUnmount"),Oe&64?j.type.remove(j,se,ge,Y,ue):Ie&&!Ie.hasOnce&&(q!==Be||de>0&&de&64)?ke(Ie,se,ge,!1,!0):(q===Be&&de&384||!pe&&Oe&16)&&ke(Te,se,ge),ue&&te(j)}const Rt=tt!=null&&Qe==null;(wt&&(xt=J&&J.onVnodeUnmounted)||vt||Rt)&&os(()=>{xt&&ho(xt,se,j),vt&&Bi(j,null,se,"unmounted"),Rt&&(j.el=null)},ge)},te=j=>{const{type:se,el:ge,anchor:ue,transition:pe}=j;if(se===Be){Z(ge,ue);return}if(se===fc){y(j);return}const q=()=>{o(ge),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(j.shapeFlag&1&&pe&&!pe.persisted){const{leave:J,delayLeave:he}=pe,Te=()=>J(ge,q);he?he(j.el,q,Te):Te()}else q()},Z=(j,se)=>{let ge;for(;j!==se;)ge=f(j),o(j),j=ge;o(se)},ne=(j,se,ge)=>{const{bum:ue,scope:pe,job:q,subTree:J,um:he,m:Te,a:Ie}=j;mh(Te),mh(Ie),ue&&ac(ue),pe.stop(),q&&(q.flags|=8,ae(J,j,se,ge)),he&&os(he,se),os(()=>{j.isUnmounted=!0},se)},ke=(j,se,ge,ue=!1,pe=!1,q=0)=>{for(let J=q;J<j.length;J++)ae(j[J],se,ge,ue,pe)},Se=j=>{if(j.shapeFlag&6)return Se(j.component.subTree);if(j.shapeFlag&128)return j.suspense.next();const se=f(j.anchor||j.el),ge=se&&se[o4];return ge?f(ge):se};let Ye=!1;const ve=(j,se,ge)=>{let ue;j==null?se._vnode&&(ae(se._vnode,null,null,!0),ue=se._vnode.component):m(se._vnode||null,j,se,null,null,null,ge),se._vnode=j,Ye||(Ye=!0,J2(ue),fh(),Ye=!1)},Y={p:m,um:ae,m:re,r:te,mt:R,mc:x,pc:z,pbc:N,n:Se,o:e};let ce,fe;return t&&([ce,fe]=t(Y)),{render:ve,hydrate:ce,createApp:aT(ve,ce)}}function k1({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 Fl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function T4(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Pv(e,t,n=!1){const s=e.children,o=t.children;if(_t(s)&&_t(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=lr(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Pv(r,l)),l.type===sl&&(l.patchFlag===-1&&(l=o[i]=lr(l)),l.el=r.el),l.type===rs&&!l.el&&(l.el=r.el)}}function wT(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function N4(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:N4(t)}function mh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function I4(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?I4(t.subTree):null}const gh=e=>e.__isSuspense;let sg=0;const ST={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)CT(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}AT(e,t,n,s,o,r,l,a,c)}},hydrate:MT,normalize:ET},Mbe=ST;function Gu(e,t){const n=e.props&&e.props[t];It(n)&&n()}function CT(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=$4(e,o,s,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,s,f,i,r),f.deps>0?(Gu(e,"onPending"),Gu(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),dc(f,e.ssFallback)):f.resolve(!1,!0)}function AT(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,p=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:_,isHydrating:k}=d;if(m)d.pendingBranch=f,yi(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():_&&(k||(a(h,p,n,s,o,null,i,r,l),dc(d,p)))):(d.pendingId=sg++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(h,p,n,s,o,null,i,r,l),dc(d,p))):h&&yi(h,f)?(a(h,f,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(h&&yi(h,f))a(h,f,n,s,o,d,i,r,l),dc(d,f);else if(Gu(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=sg++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(p)},g):g===0&&d.fallback(p)}}function $4(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:_}}=c;let k;const g=TT(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?ih(e.props.timeout):void 0,y=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:sg++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:x,activeBranch:E,pendingBranch:N,pendingId:F,effects:S,parentComponent:T,container:R,isInFallback:O}=A;let D=!1;if(A.isHydrating)A.isHydrating=!1;else if(!L){D=E&&N.transition&&N.transition.mode==="out-in";let V=!1;D&&(E.transition.afterLeave=()=>{F===A.pendingId&&(f(N,R,i===y&&!V?h(E):i,0),dh(S),O&&x.ssFallback&&(x.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(m(E.el)===R&&(i=h(E),V=!0),p(E,T,A,!0),!D&&O&&x.ssFallback&&os(()=>x.ssFallback.el=null,A)),D||f(N,R,i,0)}A.isFallbackMountPending=!1,dc(A,N),A.pendingBranch=null,A.isInFallback=!1;let W=A.parent,z=!1;for(;W;){if(W.pendingBranch){W.effects.push(...S),z=!0;break}W=W.parent}!z&&!D&&dh(S),A.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),Gu(x,"onResolve")},fallback(L){if(!A.pendingBranch)return;const{vnode:$,activeBranch:x,parentComponent:E,container:N,namespace:F}=A;Gu($,"onFallback");const S=h(x),T=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,L,N,S,E,null,F,l,a),dc(A,L))},R=L.transition&&L.transition.mode==="out-in";R&&(A.isFallbackMountPending=!0,x.transition.afterLeave=T),A.isInFallback=!0,p(x,E,null,!0),R||T()},move(L,$,x){A.activeBranch&&f(A.activeBranch,L,$,x),A.container=L},next(){return A.activeBranch&&h(A.activeBranch)},registerDep(L,$,x){const E=!!A.pendingBranch;E&&A.deps++;const N=L.vnode.el;L.asyncDep.catch(F=>{$c(F,L,0)}).then(F=>{if(L.isUnmounted||A.isUnmounted||A.pendingId!==L.suspenseId)return;Yu(),L.asyncResolved=!0;const{vnode:S}=L;og(L,F,!1),N&&(S.el=N);const T=!N&&L.subTree.el;$(L,S,m(N||L.subTree.el),N?null:h(L.subTree),A,r,x),T&&(S.placeholder=null,_(T)),Tp(L,S.el),E&&--A.deps===0&&A.resolve()})},unmount(L,$){A.isUnmounted=!0,A.activeBranch&&p(A.activeBranch,n,L,$),A.pendingBranch&&p(A.pendingBranch,n,L,$)}};return A}function MT(e,t,n,s,o,i,r,l,a){const c=t.suspense=$4(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function ET(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=hb(s?n.default:n),e.ssFallback=s?hb(n.fallback):ie(rs)}function hb(e){let t;if(It(e)){const n=oa&&e._c;n&&(e._d=!1,b()),e=e(),n&&(e._d=!0,t=Us,F4())}return _t(e)&&(e=dT(e)),e=mo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function L4(e,t){t&&t.pendingBranch?_t(e)?t.effects.push(...e):t.effects.push(e):dh(e)}function dc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,Tp(s,o))}function TT(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Be=Symbol.for("v-fgt"),sl=Symbol.for("v-txt"),rs=Symbol.for("v-cmt"),fc=Symbol.for("v-stc"),Cu=[];let Us=null;function b(e=!1){Cu.push(Us=e?null:[])}function F4(){Cu.pop(),Us=Cu[Cu.length-1]||null}let oa=1;function vh(e,t=!1){oa+=e,e<0&&Us&&t&&(Us.hasOnce=!0)}function O4(e){return e.dynamicChildren=oa>0?Us||rc:null,F4(),oa>0&&Us&&Us.push(e),e}function I(e,t,n,s,o,i){return O4(w(e,t,n,s,o,i,!0))}function ye(e,t,n,s,o){return O4(ie(e,t,n,s,o,!0))}function al(e){return e?e.__v_isVNode===!0:!1}function yi(e,t){return e.type===t.type&&e.key===t.key}function Ebe(e){}const R4=({key:e})=>e??null,Hf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bn(e)||Jn(e)||It(e)?{i:Fs,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,s=0,o=null,i=e===Be?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&R4(t),ref:t&&Hf(t),scopeId:Cp,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Fs};return l?(Wv(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=bn(n)?8:16),oa>0&&!r&&Us&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Us.push(a),a}const ie=NT;function NT(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===h4)&&(e=rs),al(e)){const l=xr(e,t,!0);return n&&Wv(l,n),oa>0&&!i&&Us&&(l.shapeFlag&6?Us[Us.indexOf(e)]=l:Us.push(l)),l.patchFlag=-2,l}if(RT(e)&&(e=e.__vccOpts),t){t=IT(t);let{class:l,style:a}=t;l&&!bn(l)&&(t.class=De(l)),rn(a)&&(Sp(a)&&!_t(a)&&(a=mn({},a)),t.style=qt(a))}const r=bn(e)?1:gh(e)?128:i4(e)?64:rn(e)?4:It(e)?2:0;return w(e,t,n,s,o,r,i,!0)}function IT(e){return e?Sp(e)||_4(e)?mn({},e):e:null}function xr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?pn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&R4(c),ref:t&&t.ref?n&&i?_t(i)?i.concat(Hf(t)):[i,Hf(t)]:Hf(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!==Be?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&&xr(e.ssContent),ssFallback:e.ssFallback&&xr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&ll(u,a.clone(u)),u}function Ge(e=" ",t=0){return ie(sl,null,e,t)}function Hv(e,t){const n=ie(fc,null,e);return n.staticCount=t,n}function le(e="",t=!1){return t?(b(),ye(rs,null,e)):ie(rs,null,e)}function mo(e){return e==null||typeof e=="boolean"?ie(rs):_t(e)?ie(Be,null,e.slice()):al(e)?lr(e):ie(sl,null,String(e))}function lr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:xr(e)}function Wv(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_t(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Wv(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!_4(t)?t._ctx=Fs:o===3&&Fs&&(Fs.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else It(t)?(t={default:t,_ctx:Fs},n=32):(t=String(t),s&64?(n=16,t=[Ge(t)]):n=8);e.children=t,e.shapeFlag|=n}function pn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=De([t.class,s.class]));else if(o==="style")t.style=qt([t.style,s.style]);else if(gd(o)){const i=t[o],r=s[o];r&&i!==r&&!(_t(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!fp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function ho(e,t,n,s=null){ui(e,t,7,[n,s])}const $T=g4();let LT=0;function B4(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||$T,i={uid:LT++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $C(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:S4(s,o),emitsOptions:y4(s,o),emit:null,emitted:null,propsDefaults:Gt,inheritAttrs:s.inheritAttrs,ctx:Gt,data:Gt,props:Gt,attrs:Gt,slots:Gt,refs:Gt,setupState:Gt,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=cT.bind(null,i),e.ce&&e.ce(i),i}let Ls=null;const Os=()=>Ls||Fs;let yh,hc;{const e=yp(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};yh=t("__VUE_INSTANCE_SETTERS__",n=>Ls=n),hc=t("__VUE_SSR_SETTERS__",n=>ia=n)}const Lc=e=>{const t=Ls;return yh(e),e.scope.on(),()=>{e.scope.off(),yh(t)}},Yu=()=>{Ls&&Ls.scope.off(),yh(null)};function D4(e){return e.vnode.shapeFlag&4}let ia=!1;function P4(e,t=!1,n=!1){t&&hc(t);const{props:s,children:o}=e.vnode,i=D4(e);mT(e,s,i,t),kT(e,o,n||t);const r=i?FT(e,t):void 0;return t&&hc(!1),r}function FT(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,J0);const{setup:s}=n;if(s){yr();const o=e.setupContext=s.length>1?W4(e):null,i=Lc(e),r=vd(s,e,0,[e.props,o]),l=_v(r);if(kr(),i(),(l||e.sp)&&!mr(e)&&Nv(e),l){if(r.then(Yu,Yu),t)return r.then(a=>{og(e,a,t)}).catch(a=>{$c(a,e,0)});e.asyncDep=r}else og(e,r,t)}else H4(e,t)}function og(e,t,n){It(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:rn(t)&&(e.setupState=ZC(t)),H4(e,n)}let kh,ig;function Tbe(e){kh=e,ig=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,tT))}}const Nbe=()=>!kh;function H4(e,t,n){const s=e.type;if(!e.render){if(!t&&kh&&!s.render){const o=s.template||Rv(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=mn(mn({isCustomElement:i,delimiters:l},r),a);s.render=kh(o,c)}}e.render=s.render||li,ig&&ig(e)}{const o=Lc(e);yr();try{nT(e)}finally{kr(),o()}}}const OT={get(e,t){return zs(e,"get",""),e[t]}};function W4(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,OT),slots:e.slots,emit:e.emit,expose:t}}function xd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ZC(mt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Su)return Su[n](e)},has(t,n){return n in t||n in Su}})):e.proxy}function rg(e,t=!0){return It(e)?e.displayName||e.name:e.name||t&&e.__name}function RT(e){return It(e)&&"__vccOpts"in e}const P=(e,t)=>yE(e,t,ia);function dn(e,t,n){try{vh(-1);const s=arguments.length;return s===2?rn(t)&&!_t(t)?al(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&al(n)&&(n=[n]),ie(e,t,n))}finally{vh(1)}}function Ibe(){}function $be(e,t,n,s){const o=n[s];if(o&&BT(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function BT(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Is(n[s],t[s]))return!1;return oa>0&&Us&&Us.push(e),!0}const DT="3.5.35",Lbe=li,Fbe=wE,Obe=qa,Rbe=n4,PT={createComponentInstance:B4,setupComponent:P4,renderComponentRoot:Pf,setCurrentRenderingInstance:qu,isVNode:al,normalizeVNode:mo,getComponentPublicInstance:xd,ensureValidVNode:Ov,pushWarningContext:xE,popWarningContext:_E},Bbe=PT,Dbe=null,Pbe=null,Hbe=null;/**
|
|
17
17
|
* @vue/runtime-dom v3.5.35
|
|
18
18
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
19
|
* @license MIT
|
|
20
|
-
**/let lg;const pb=typeof window<"u"&&window.trustedTypes;if(pb)try{lg=pb.createPolicy("vue",{createHTML:e=>e})}catch{}const z4=lg?e=>lg.createHTML(e):e=>e,HT="http://www.w3.org/2000/svg",WT="http://www.w3.org/1998/Math/MathML",sr=typeof document<"u"?document:null,mb=sr&&sr.createElement("template"),zT={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?sr.createElementNS(HT,e):t==="mathml"?sr.createElementNS(WT,e):n?sr.createElement(e,{is:n}):sr.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>sr.createTextNode(e),createComment:e=>sr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>sr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{mb.innerHTML=z4(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=mb.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Or="transition",iu="animation",_c=Symbol("_vtc"),U4={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},j4=mn({},l4,U4),UT=e=>(e.displayName="Transition",e.props=j4,e),cl=UT((e,{slots:t})=>dn(OE,q4(e),t)),Ol=(e,t=[])=>{_t(e)?e.forEach(n=>n(...t)):e&&e(...t)},gb=e=>e?_t(e)?e.some(t=>t.length>1):e.length>1:!1;function q4(e){const t={};for(const S in e)S in U4||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=jT(o),m=h&&h[0],_=h&&h[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:A,onBeforeAppear:L=k,onAppear:$=g,onAppearCancelled:x=v}=t,E=(S,T,R,O)=>{S._enterCancelled=O,jr(S,T?u:l),jr(S,T?c:r),R&&R()},N=(S,T)=>{S._isLeaving=!1,jr(S,d),jr(S,p),jr(S,f),T&&T()},F=S=>(T,R)=>{const O=S?$:g,D=()=>E(T,S,R);Ol(O,[T,D]),vb(()=>{jr(T,S?a:i),Oi(T,S?u:l),gb(O)||yb(T,s,m,D)})};return mn(t,{onBeforeEnter(S){Ol(k,[S]),Oi(S,i),Oi(S,r)},onBeforeAppear(S){Ol(L,[S]),Oi(S,a),Oi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,T){S._isLeaving=!0;const R=()=>N(S,T);Oi(S,d),S._enterCancelled?(Oi(S,f),ag(S)):(ag(S),Oi(S,f)),vb(()=>{S._isLeaving&&(jr(S,d),Oi(S,p),gb(y)||yb(S,s,_,R))}),Ol(y,[S,R])},onEnterCancelled(S){E(S,!1,void 0,!0),Ol(v,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),Ol(x,[S])},onLeaveCancelled(S){N(S),Ol(A,[S])}})}function jT(e){if(e==null)return null;if(rn(e))return[b1(e.enter),b1(e.leave)];{const t=b1(e);return[t,t]}}function b1(e){return ih(e)}function Oi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[_c]||(e[_c]=new Set)).add(t)}function jr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[_c];n&&(n.delete(t),n.size||(e[_c]=void 0))}function vb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let qT=0;function yb(e,t,n,s){const o=e._endId=++qT,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=V4(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function V4(e,t){const n=window.getComputedStyle(e),s=h=>(n[h]||"").split(", "),o=s(`${Or}Delay`),i=s(`${Or}Duration`),r=kb(o,i),l=s(`${iu}Delay`),a=s(`${iu}Duration`),c=kb(l,a);let u=null,d=0,f=0;t===Or?r>0&&(u=Or,d=r,f=i.length):t===iu?c>0&&(u=iu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Or:iu:null,f=u?u===Or?i.length:a.length:0);const p=u===Or&&/\b(?:transform|all)(?:,|$)/.test(s(`${Or}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function kb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>bb(n)+bb(e[s])))}function bb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ag(e){return(e?e.ownerDocument:document).body.offsetHeight}function VT(e,t,n){const s=e[_c];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const bh=Symbol("_vod"),K4=Symbol("_vsh"),oi={name:"show",beforeMount(e,{value:t},{transition:n}){e[bh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ru(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),ru(e,!0),s.enter(e)):s.leave(e,()=>{ru(e,!1)}):ru(e,t))},beforeUnmount(e,{value:t}){ru(e,t)}};function ru(e,t){e.style.display=t?e[bh]:"none",e[K4]=!t}function KT(){oi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const G4=Symbol("");function Dbe(e){const t=Os();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>xh(i,o))},s=()=>{const o=e(t.proxy);t.ce?xh(t.ce,o):cg(t.subTree,o),n(o)};f4(()=>{dh(s)}),ln(()=>{Ke(s,li,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),fn(()=>o.disconnect())})}function cg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{cg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)xh(e.el,t);else if(e.type===Be)e.children.forEach(n=>cg(n,t));else if(e.type===fc){let{el:n,anchor:s}=e;for(;n&&(xh(n,t),n!==s);)n=n.nextSibling}}function xh(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=j8(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[G4]=s}}const GT=/(?:^|;)\s*display\s*:/;function YT(e,t,n){const s=e.style,o=bn(n);let i=!1;if(n&&!o){if(t)if(bn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&vu(s,l,"")}else for(const r in t)n[r]==null&&vu(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?QT(e,r,!bn(t)&&t?t[r]:void 0,l)||vu(s,r,l):vu(s,r,"")}}else if(o){if(t!==n){const r=s[G4];r&&(n+=";"+r),s.cssText=n,i=GT.test(n)}}else t&&e.removeAttribute("style");bh in e&&(e[bh]=i?s.display:"",e[K4]&&(s.display="none"))}const xb=/\s*!important$/;function vu(e,t,n){if(_t(n))n.forEach(s=>vu(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=ZT(e,t);xb.test(n)?e.setProperty(go(s),n.replace(xb,""),"important"):e[s]=n}}const _b=["Webkit","Moz","ms"],x1={};function ZT(e,t){const n=x1[t];if(n)return n;let s=vs(t);if(s!=="filter"&&s in e)return x1[t]=s;s=gp(s);for(let o=0;o<_b.length;o++){const i=_b[o]+s;if(i in e)return x1[t]=i}return t}function QT(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bn(s)&&n===s}const wb="http://www.w3.org/1999/xlink";function Sb(e,t,n,s,o,i=z8(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(wb,t.slice(6,t.length)):e.setAttributeNS(wb,t,n):n==null||i&&!TC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":zo(n)?String(n):n)}function Cb(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?z4(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=TC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function dr(e,t,n,s){e.addEventListener(t,n,s)}function XT(e,t,n,s){e.removeEventListener(t,n,s)}const Ab=Symbol("_vei");function JT(e,t,n,s,o=null){const i=e[Ab]||(e[Ab]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=e9(t);if(s){const c=i[t]=s9(s,o);dr(e,l,c,a)}else r&&(XT(e,l,r,a),i[t]=void 0)}}const Mb=/(?:Once|Passive|Capture)$/;function e9(e){let t;if(Mb.test(e)){t={};let s;for(;s=e.match(Mb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):go(e.slice(2)),t]}let _1=0;const t9=Promise.resolve(),n9=()=>_1||(t9.then(()=>_1=0),_1=Date.now());function s9(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(_t(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&ui(c,t,5,l)}}else ui(o,t,5,[s])};return n.value=e,n.attached=n9(),n}const Eb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,o9=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?VT(e,s,r):t==="style"?YT(e,n,s):gd(t)?fp(t)||JT(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):i9(e,t,s,r))?(Cb(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Sb(e,t,s,r,i,t!=="value")):e._isVueCE&&(r9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bn(s)))?Cb(e,vs(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Sb(e,t,s,r))};function i9(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Eb(t)&&It(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Eb(t)&&bn(n)?!1:t in e}function r9(e,t){const n=e._def.props;if(!n)return!1;const s=vs(t);return Array.isArray(n)?n.some(o=>vs(o)===s):Object.keys(n).some(o=>vs(o)===s)}const Tb={};function l9(e,t,n){let s=qe(e,t);hp(s)&&(s=mn({},s,t));class o extends zv{constructor(r){super(s,r,n)}}return o.def=s,o}const Pbe=((e,t)=>l9(e,t,S9)),a9=typeof HTMLElement<"u"?HTMLElement:class{};class zv extends a9{constructor(t,n={},s=Sh){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==Sh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(mn({},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 zv){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,pt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!_t(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=ih(this._props[a])),(l||(l=Object.create(null)))[vs(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)on(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=_t(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(vs))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):Tb;const o=vs(t);n&&this._numberProps&&this._numberProps[o]&&(s=ih(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Tb?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(go(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(go(t),n+""):n||this.removeAttribute(go(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),w9(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,mn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,hp(r[0])?mn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),go(i)!==i&&o(go(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function c9(e){const t=Os(),n=t&&t.ce;return n||null}function Hbe(){const e=c9();return e&&e.shadowRoot}function Wbe(e="$style"){{const t=Os();if(!t)return Gt;const n=t.type.__cssModules;if(!n)return Gt;const s=n[e];return s||Gt}}const Y4=new WeakMap,Z4=new WeakMap,_h=Symbol("_moveCb"),Nb=Symbol("_enterCb"),u9=e=>(delete e.props.mode,e),d9=u9({name:"TransitionGroup",props:mn({},j4,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Os(),s=r4();let o,i;return Iv(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!g9(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(h9),o.forEach(p9);const l=o.filter(m9);ag(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Oi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[_h]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[_h]=null,jr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Xt(e),l=q4(r);let a=r.tag||Be;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),ll(u,Vu(u,l,s,n)),Y4.set(u,Q4(u.el)))}i=t.default?Tv(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&ll(u,Vu(u,l,s,n))}return ie(a,null,i)}}}),f9=d9;function h9(e){const t=e.el;t[_h]&&t[_h](),t[Nb]&&t[Nb]()}function p9(e){Z4.set(e,Q4(e.el))}function m9(e){const t=Y4.get(e),n=Z4.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function Q4(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function g9(e,t,n){const s=e.cloneNode(),o=e[_c];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=V4(s);return i.removeChild(s),r}const ul=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _t(t)?n=>ac(t,n):t};function v9(e){e.target.composing=!0}function Ib(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ai=Symbol("_assign");function $b(e,t,n){return t&&(e=e.trim()),n&&(e=vp(e)),e}const ao={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[ai]=ul(o);const i=s||o.props&&o.props.type==="number";dr(e,t?"change":"input",r=>{r.target.composing||e[ai]($b(e.value,n,i))}),(n||i)&&dr(e,"change",()=>{e.value=$b(e.value,n,i)}),t||(dr(e,"compositionstart",v9),dr(e,"compositionend",Ib),dr(e,"change",Ib))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[ai]=ul(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?vp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},wh={deep:!0,created(e,t,n){e[ai]=ul(n),dr(e,"change",()=>{const s=e._modelValue,o=wc(e),i=e.checked,r=e[ai];if(_t(s)){const l=kp(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(da(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(J4(e,i))})},mounted:Lb,beforeUpdate(e,t,n){e[ai]=ul(n),Lb(e,t,n)}};function Lb(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(_t(t))o=kp(t,s.props.value)>-1;else if(da(t))o=t.has(s.props.value);else{if(t===n)return;o=vr(t,J4(e,!0))}e.checked!==o&&(e.checked=o)}const X4={created(e,{value:t},n){e.checked=vr(t,n.props.value),e[ai]=ul(n),dr(e,"change",()=>{e[ai](wc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[ai]=ul(s),t!==n&&(e.checked=vr(t,s.props.value))}},ug={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=da(t);dr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?vp(wc(r)):wc(r));e[ai](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,pt(()=>{e._assigning=!1})}),e[ai]=ul(s)},mounted(e,{value:t}){Fb(e,t)},beforeUpdate(e,t,n){e[ai]=ul(n)},updated(e,{value:t}){e._assigning||Fb(e,t)}};function Fb(e,t){const n=e.multiple,s=_t(t);if(!(n&&!s&&!da(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=wc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=kp(t,l)>-1}else r.selected=t.has(l);else if(vr(wc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function wc(e){return"_value"in e?e._value:e.value}function J4(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const y9={created(e,t,n){ff(e,t,n,null,"created")},mounted(e,t,n){ff(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){ff(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){ff(e,t,n,s,"updated")}};function e3(e,t){switch(e){case"SELECT":return ug;case"TEXTAREA":return ao;default:switch(t){case"checkbox":return wh;case"radio":return X4;default:return ao}}}function ff(e,t,n,s,o){const r=e3(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function k9(){ao.getSSRProps=({value:e})=>({value:e}),X4.getSSRProps=({value:e},t)=>{if(t.props&&vr(t.props.value,e))return{checked:!0}},wh.getSSRProps=({value:e},t)=>{if(_t(e)){if(t.props&&kp(e,t.props.value)>-1)return{checked:!0}}else if(da(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},y9.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=e3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const b9=["ctrl","shift","alt","meta"],x9={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)=>b9.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=x9[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},_9={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},bi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=go(o.key);if(t.some(r=>r===i||_9[r]===i))return e(o)}))},t3=mn({patchProp:o9},zT);let Au,Ob=!1;function n3(){return Au||(Au=xT(t3))}function s3(){return Au=Ob?Au:_T(t3),Ob=!0,Au}const w9=((...e)=>{n3().render(...e)}),zbe=((...e)=>{s3().hydrate(...e)}),Sh=((...e)=>{const t=n3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=i3(s);if(!o)return;const i=t._component;!It(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,o3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),S9=((...e)=>{const t=s3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=i3(s);if(o)return n(o,!0,o3(o))},t});function o3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function i3(e){return bn(e)?document.querySelector(e):e}let Rb=!1;const Ube=()=>{Rb||(Rb=!0,k9(),KT())};/*!
|
|
20
|
+
**/let lg;const pb=typeof window<"u"&&window.trustedTypes;if(pb)try{lg=pb.createPolicy("vue",{createHTML:e=>e})}catch{}const z4=lg?e=>lg.createHTML(e):e=>e,HT="http://www.w3.org/2000/svg",WT="http://www.w3.org/1998/Math/MathML",sr=typeof document<"u"?document:null,mb=sr&&sr.createElement("template"),zT={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?sr.createElementNS(HT,e):t==="mathml"?sr.createElementNS(WT,e):n?sr.createElement(e,{is:n}):sr.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>sr.createTextNode(e),createComment:e=>sr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>sr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{mb.innerHTML=z4(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=mb.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Or="transition",iu="animation",_c=Symbol("_vtc"),U4={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},j4=mn({},l4,U4),UT=e=>(e.displayName="Transition",e.props=j4,e),cl=UT((e,{slots:t})=>dn(OE,q4(e),t)),Ol=(e,t=[])=>{_t(e)?e.forEach(n=>n(...t)):e&&e(...t)},gb=e=>e?_t(e)?e.some(t=>t.length>1):e.length>1:!1;function q4(e){const t={};for(const S in e)S in U4||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=jT(o),m=h&&h[0],_=h&&h[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:A,onBeforeAppear:L=k,onAppear:$=g,onAppearCancelled:x=v}=t,E=(S,T,R,O)=>{S._enterCancelled=O,jr(S,T?u:l),jr(S,T?c:r),R&&R()},N=(S,T)=>{S._isLeaving=!1,jr(S,d),jr(S,p),jr(S,f),T&&T()},F=S=>(T,R)=>{const O=S?$:g,D=()=>E(T,S,R);Ol(O,[T,D]),vb(()=>{jr(T,S?a:i),Oi(T,S?u:l),gb(O)||yb(T,s,m,D)})};return mn(t,{onBeforeEnter(S){Ol(k,[S]),Oi(S,i),Oi(S,r)},onBeforeAppear(S){Ol(L,[S]),Oi(S,a),Oi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,T){S._isLeaving=!0;const R=()=>N(S,T);Oi(S,d),S._enterCancelled?(Oi(S,f),ag(S)):(ag(S),Oi(S,f)),vb(()=>{S._isLeaving&&(jr(S,d),Oi(S,p),gb(y)||yb(S,s,_,R))}),Ol(y,[S,R])},onEnterCancelled(S){E(S,!1,void 0,!0),Ol(v,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),Ol(x,[S])},onLeaveCancelled(S){N(S),Ol(A,[S])}})}function jT(e){if(e==null)return null;if(rn(e))return[b1(e.enter),b1(e.leave)];{const t=b1(e);return[t,t]}}function b1(e){return ih(e)}function Oi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[_c]||(e[_c]=new Set)).add(t)}function jr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[_c];n&&(n.delete(t),n.size||(e[_c]=void 0))}function vb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let qT=0;function yb(e,t,n,s){const o=e._endId=++qT,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=V4(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function V4(e,t){const n=window.getComputedStyle(e),s=h=>(n[h]||"").split(", "),o=s(`${Or}Delay`),i=s(`${Or}Duration`),r=kb(o,i),l=s(`${iu}Delay`),a=s(`${iu}Duration`),c=kb(l,a);let u=null,d=0,f=0;t===Or?r>0&&(u=Or,d=r,f=i.length):t===iu?c>0&&(u=iu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Or:iu:null,f=u?u===Or?i.length:a.length:0);const p=u===Or&&/\b(?:transform|all)(?:,|$)/.test(s(`${Or}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function kb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>bb(n)+bb(e[s])))}function bb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ag(e){return(e?e.ownerDocument:document).body.offsetHeight}function VT(e,t,n){const s=e[_c];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const bh=Symbol("_vod"),K4=Symbol("_vsh"),oi={name:"show",beforeMount(e,{value:t},{transition:n}){e[bh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ru(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),ru(e,!0),s.enter(e)):s.leave(e,()=>{ru(e,!1)}):ru(e,t))},beforeUnmount(e,{value:t}){ru(e,t)}};function ru(e,t){e.style.display=t?e[bh]:"none",e[K4]=!t}function KT(){oi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const G4=Symbol("");function Wbe(e){const t=Os();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>xh(i,o))},s=()=>{const o=e(t.proxy);t.ce?xh(t.ce,o):cg(t.subTree,o),n(o)};f4(()=>{dh(s)}),ln(()=>{Ke(s,li,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),fn(()=>o.disconnect())})}function cg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{cg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)xh(e.el,t);else if(e.type===Be)e.children.forEach(n=>cg(n,t));else if(e.type===fc){let{el:n,anchor:s}=e;for(;n&&(xh(n,t),n!==s);)n=n.nextSibling}}function xh(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=j8(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[G4]=s}}const GT=/(?:^|;)\s*display\s*:/;function YT(e,t,n){const s=e.style,o=bn(n);let i=!1;if(n&&!o){if(t)if(bn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&vu(s,l,"")}else for(const r in t)n[r]==null&&vu(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?QT(e,r,!bn(t)&&t?t[r]:void 0,l)||vu(s,r,l):vu(s,r,"")}}else if(o){if(t!==n){const r=s[G4];r&&(n+=";"+r),s.cssText=n,i=GT.test(n)}}else t&&e.removeAttribute("style");bh in e&&(e[bh]=i?s.display:"",e[K4]&&(s.display="none"))}const xb=/\s*!important$/;function vu(e,t,n){if(_t(n))n.forEach(s=>vu(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=ZT(e,t);xb.test(n)?e.setProperty(go(s),n.replace(xb,""),"important"):e[s]=n}}const _b=["Webkit","Moz","ms"],x1={};function ZT(e,t){const n=x1[t];if(n)return n;let s=vs(t);if(s!=="filter"&&s in e)return x1[t]=s;s=gp(s);for(let o=0;o<_b.length;o++){const i=_b[o]+s;if(i in e)return x1[t]=i}return t}function QT(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bn(s)&&n===s}const wb="http://www.w3.org/1999/xlink";function Sb(e,t,n,s,o,i=z8(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(wb,t.slice(6,t.length)):e.setAttributeNS(wb,t,n):n==null||i&&!TC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":zo(n)?String(n):n)}function Cb(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?z4(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=TC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function dr(e,t,n,s){e.addEventListener(t,n,s)}function XT(e,t,n,s){e.removeEventListener(t,n,s)}const Ab=Symbol("_vei");function JT(e,t,n,s,o=null){const i=e[Ab]||(e[Ab]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=e9(t);if(s){const c=i[t]=s9(s,o);dr(e,l,c,a)}else r&&(XT(e,l,r,a),i[t]=void 0)}}const Mb=/(?:Once|Passive|Capture)$/;function e9(e){let t;if(Mb.test(e)){t={};let s;for(;s=e.match(Mb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):go(e.slice(2)),t]}let _1=0;const t9=Promise.resolve(),n9=()=>_1||(t9.then(()=>_1=0),_1=Date.now());function s9(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(_t(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&ui(c,t,5,l)}}else ui(o,t,5,[s])};return n.value=e,n.attached=n9(),n}const Eb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,o9=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?VT(e,s,r):t==="style"?YT(e,n,s):gd(t)?fp(t)||JT(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):i9(e,t,s,r))?(Cb(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Sb(e,t,s,r,i,t!=="value")):e._isVueCE&&(r9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bn(s)))?Cb(e,vs(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Sb(e,t,s,r))};function i9(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Eb(t)&&It(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Eb(t)&&bn(n)?!1:t in e}function r9(e,t){const n=e._def.props;if(!n)return!1;const s=vs(t);return Array.isArray(n)?n.some(o=>vs(o)===s):Object.keys(n).some(o=>vs(o)===s)}const Tb={};function l9(e,t,n){let s=qe(e,t);hp(s)&&(s=mn({},s,t));class o extends zv{constructor(r){super(s,r,n)}}return o.def=s,o}const zbe=((e,t)=>l9(e,t,S9)),a9=typeof HTMLElement<"u"?HTMLElement:class{};class zv extends a9{constructor(t,n={},s=Sh){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==Sh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(mn({},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 zv){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,pt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!_t(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=ih(this._props[a])),(l||(l=Object.create(null)))[vs(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)on(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=_t(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(vs))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):Tb;const o=vs(t);n&&this._numberProps&&this._numberProps[o]&&(s=ih(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Tb?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(go(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(go(t),n+""):n||this.removeAttribute(go(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),w9(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,mn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,hp(r[0])?mn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),go(i)!==i&&o(go(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function c9(e){const t=Os(),n=t&&t.ce;return n||null}function Ube(){const e=c9();return e&&e.shadowRoot}function jbe(e="$style"){{const t=Os();if(!t)return Gt;const n=t.type.__cssModules;if(!n)return Gt;const s=n[e];return s||Gt}}const Y4=new WeakMap,Z4=new WeakMap,_h=Symbol("_moveCb"),Nb=Symbol("_enterCb"),u9=e=>(delete e.props.mode,e),d9=u9({name:"TransitionGroup",props:mn({},j4,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Os(),s=r4();let o,i;return Iv(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!g9(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(h9),o.forEach(p9);const l=o.filter(m9);ag(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Oi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[_h]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[_h]=null,jr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Xt(e),l=q4(r);let a=r.tag||Be;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),ll(u,Vu(u,l,s,n)),Y4.set(u,Q4(u.el)))}i=t.default?Tv(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&ll(u,Vu(u,l,s,n))}return ie(a,null,i)}}}),f9=d9;function h9(e){const t=e.el;t[_h]&&t[_h](),t[Nb]&&t[Nb]()}function p9(e){Z4.set(e,Q4(e.el))}function m9(e){const t=Y4.get(e),n=Z4.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function Q4(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function g9(e,t,n){const s=e.cloneNode(),o=e[_c];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=V4(s);return i.removeChild(s),r}const ul=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _t(t)?n=>ac(t,n):t};function v9(e){e.target.composing=!0}function Ib(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ai=Symbol("_assign");function $b(e,t,n){return t&&(e=e.trim()),n&&(e=vp(e)),e}const ao={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[ai]=ul(o);const i=s||o.props&&o.props.type==="number";dr(e,t?"change":"input",r=>{r.target.composing||e[ai]($b(e.value,n,i))}),(n||i)&&dr(e,"change",()=>{e.value=$b(e.value,n,i)}),t||(dr(e,"compositionstart",v9),dr(e,"compositionend",Ib),dr(e,"change",Ib))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[ai]=ul(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?vp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},wh={deep:!0,created(e,t,n){e[ai]=ul(n),dr(e,"change",()=>{const s=e._modelValue,o=wc(e),i=e.checked,r=e[ai];if(_t(s)){const l=kp(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(da(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(J4(e,i))})},mounted:Lb,beforeUpdate(e,t,n){e[ai]=ul(n),Lb(e,t,n)}};function Lb(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(_t(t))o=kp(t,s.props.value)>-1;else if(da(t))o=t.has(s.props.value);else{if(t===n)return;o=vr(t,J4(e,!0))}e.checked!==o&&(e.checked=o)}const X4={created(e,{value:t},n){e.checked=vr(t,n.props.value),e[ai]=ul(n),dr(e,"change",()=>{e[ai](wc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[ai]=ul(s),t!==n&&(e.checked=vr(t,s.props.value))}},ug={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=da(t);dr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?vp(wc(r)):wc(r));e[ai](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,pt(()=>{e._assigning=!1})}),e[ai]=ul(s)},mounted(e,{value:t}){Fb(e,t)},beforeUpdate(e,t,n){e[ai]=ul(n)},updated(e,{value:t}){e._assigning||Fb(e,t)}};function Fb(e,t){const n=e.multiple,s=_t(t);if(!(n&&!s&&!da(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=wc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=kp(t,l)>-1}else r.selected=t.has(l);else if(vr(wc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function wc(e){return"_value"in e?e._value:e.value}function J4(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const y9={created(e,t,n){ff(e,t,n,null,"created")},mounted(e,t,n){ff(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){ff(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){ff(e,t,n,s,"updated")}};function e3(e,t){switch(e){case"SELECT":return ug;case"TEXTAREA":return ao;default:switch(t){case"checkbox":return wh;case"radio":return X4;default:return ao}}}function ff(e,t,n,s,o){const r=e3(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function k9(){ao.getSSRProps=({value:e})=>({value:e}),X4.getSSRProps=({value:e},t)=>{if(t.props&&vr(t.props.value,e))return{checked:!0}},wh.getSSRProps=({value:e},t)=>{if(_t(e)){if(t.props&&kp(e,t.props.value)>-1)return{checked:!0}}else if(da(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},y9.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=e3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const b9=["ctrl","shift","alt","meta"],x9={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)=>b9.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=x9[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},_9={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},bi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=go(o.key);if(t.some(r=>r===i||_9[r]===i))return e(o)}))},t3=mn({patchProp:o9},zT);let Au,Ob=!1;function n3(){return Au||(Au=xT(t3))}function s3(){return Au=Ob?Au:_T(t3),Ob=!0,Au}const w9=((...e)=>{n3().render(...e)}),qbe=((...e)=>{s3().hydrate(...e)}),Sh=((...e)=>{const t=n3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=i3(s);if(!o)return;const i=t._component;!It(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,o3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),S9=((...e)=>{const t=s3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=i3(s);if(o)return n(o,!0,o3(o))},t});function o3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function i3(e){return bn(e)?document.querySelector(e):e}let Rb=!1;const Vbe=()=>{Rb||(Rb=!0,k9(),KT())};/*!
|
|
21
21
|
* shared v11.4.5
|
|
22
22
|
* (c) 2026 kazuya kawaguchi
|
|
23
23
|
* Released under the MIT License.
|
|
@@ -64,7 +64,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemVie
|
|
|
64
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
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
66
|
</svg>
|
|
67
|
-
`,EF='<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>',TF='<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>',NF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',IF='<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>',$F='<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>',LF='<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>',FF='<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>',OF='<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>',RF='<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>',Sx='<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>',BF='<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>',DF='<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>',PF='<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>',HF='<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>',WF='<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>',zF='<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>',UF='<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>',jF='<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>',qF='<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>',VF='<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>',KF='<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>',GF='<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>',YF='<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>',ZF='<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>',QF='<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>',XF='<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>',Cx='<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>',JF='<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>',eO='<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>',tO='<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>',nO='<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>',sO='<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>',oO='<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>',Ax='<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>',iO='<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>',rO='<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>',lO='<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>',aO='<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>',cO='<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>',uO='<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>',dO='<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>',fO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',hO='<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>',pO='<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>',mO='<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>',gO='<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>',vO='<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>',yO='<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>',kO='<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>',bO='<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>',xO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',_O='<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>',wO='<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>',SO='<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>',CO='<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>',AO='<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>',F3={sm:14,md:16,lg:20};function kt(e,t){return{component:e,svg:t}}const O3={plus:kt(MI,NF),"chat-new":kt(tI,_F),"calendar-close":kt(JI,DF),"calendar-schedule":kt(n$,PF),"calendar-todo":kt(i$,HF),close:kt(d$,zF),check:kt(a$,WF),search:kt(mI,AF),copy:kt(D$,QF),link:kt(mL,rO),"external-link":kt($$,YF),download:kt(b$,qF),undo:kt(PI,FF),send:kt(xx,Sx),image:kt(wx,Ax),settings:kt(yI,MF),sliders:kt(A$,KF),"log-in":kt(SL,cO),"chevron-down":kt(RI,LF),"chevron-right":kt(qI,RF),"arrow-up":kt(xx,Sx),"arrow-down":kt(LI,$F),"arrow-right":kt(zI,OF),minus:kt(rF,xO),"panel-collapse":kt(xI,EF),"panel-expand":kt(SI,TF),expand:kt(T$,GF),collapse:kt(v$,jF),list:kt(xL,aO),sort:kt(qL,gO),grip:kt(w$,VF),folder:kt(cI,SF),"folder-closed":kt(oI,wF),"folder-plus":kt(X$,tO),"folder-solid":kt(tL,nO),file:kt(_x,Cx),"file-text":kt(V$,JF),"file-edit":kt(W$,XF),"file-plus":kt(O$,ZF),"file-off":kt(_x,Cx),"image-off":kt(wx,Ax),code:kt(p$,UF),terminal:kt(fF,wO),pencil:kt(RL,hO),tool:kt(yF,CO),glob:kt(ZI,BF),globe:kt(lL,oO),"check-list":kt(yL,lO),bolt:kt(Y$,eO),"git-pull-request":kt(oL,sO),message:kt(NL,dO),mail:kt(ML,uO),user:kt(xF,AO),info:kt(fL,iO),"help-circle":kt(zL,mO),"alert-triangle":kt(NI,IF),clock:kt(mF,SO),sparkles:kt(GL,vO),target:kt(cF,_O),pause:kt(LL,fO),play:kt(PL,pO),stop:kt(sF,bO),star:kt(QL,yO),"star-outline":kt(eF,kO),"dots-horizontal":kt(fI,CF)};function MO(e){return O3[e]}function EO(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Ga(e,t="md"){const n=O3[e];return n?EO(n.svg,F3[t]):""}const jbe=[["Actions",["plus","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","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-pull-request","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=qe({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=P(()=>MO(t.name)),s=P(()=>F3[t.size]);return(o,i)=>n.value?(b(),ye($s(n.value.component),{key:0,class:"kw-icon",width:s.value,height:s.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):le("",!0)}}),TO={key:0,class:"ui-dialog__head"},NO={class:"ui-dialog__titles"},IO={key:0,class:"ui-dialog__title"},$O={key:1,class:"ui-dialog__desc"},LO={class:"ui-dialog__body"},FO={key:1,class:"ui-dialog__foot"},OO='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',RO=qe({__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,s=t,o=Q(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(OO)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?o.value?.querySelector(d)??null:o.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(),p=f[0],h=f[f.length-1];if(!p||!h){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===p?(d.preventDefault(),h.focus()):!d.shiftKey&&m===h&&(d.preventDefault(),p.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Ke(()=>n.open,async d=>{if(d){Ka.value+=1,i=document.activeElement,await pt();const f=a(),p=l();(f??p[0]??o.value)?.focus()}else Ka.value=Math.max(0,Ka.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),es(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Ka.value=Math.max(0,Ka.value-1))}),(d,f)=>(b(),ye(Ap,{to:"body"},[e.open?(b(),I("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[w("div",{ref_key:"panel",ref:o,class:De(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(b(),I("div",TO,[In(d.$slots,"head",{},()=>[w("div",NO,[e.title?(b(),I("div",IO,B(e.title),1)):le("",!0),e.description?(b(),I("div",$O,B(e.description),1)):le("",!0)])],!0),ie(Nn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[ie(Ve,{name:"close",size:"md"})]),_:1})])):le("",!0),w("div",LO,[In(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(b(),I("div",FO,[In(d.$slots,"foot",{},void 0,!0)])):le("",!0)],2)],32)):le("",!0)]))}}),Sr=ut(RO,[["__scopeId","data-v-3dce23a4"]]),BO={class:"sd-head"},DO=["placeholder","aria-label"],PO=["aria-selected","onClick","onMousemove"],HO={class:"sd-meta"},WO=["innerHTML"],zO={class:"sd-time"},UO=["innerHTML"],jO=["innerHTML"],qO={key:1,class:"sd-empty"},VO={class:"sd-hint"},KO=200,GO=qe({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=Q(""),l=Q(null),a=Q(null),c=P(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",A=v.lastPrompt??"",L=v.workspaceName??"",$=k.length>0&&y.toLowerCase().includes(k),x=k.length>0&&A.toLowerCase().includes(k),E=k.length>0&&L.toLowerCase().includes(k);if(!(k.length>0&&!$&&!x&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?ZN(A,r.value):""}),g.length>=KO))break}return g}),u=Q(0);Ke(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await pt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function p(k){u.value=d(u.value+k),f()}function h(k){o("select",k),o("close")}function m(){const k=c.value[u.value];k&&h(k.session.id)}function _(k){k.key==="ArrowDown"?(k.preventDefault(),p(1)):k.key==="ArrowUp"?(k.preventDefault(),p(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return ln(()=>{l.value?.focus()}),(k,g)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>o("close"))},{head:Ee(()=>[w("div",BO,[ie(Ve,{class:"sd-search-icon",name:"search",size:"md"}),Tn(w("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:_},null,40,DO),[[ao,r.value]])])]),foot:Ee(()=>[w("span",VO,B(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(b(!0),I(Be,{key:0},nt(c.value,(v,y)=>(b(),I("button",{key:v.session.id,class:De(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:A=>h(v.session.id),onMousemove:A=>u.value=y},[w("span",HO,[ie(Ve,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(E1)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,WO),w("span",zO,B(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(E1)(v.session.title,v.inTitle?r.value:"")},null,8,UO),v.snippetText?(b(),I("span",{key:0,class:"sd-snippet",innerHTML:C(E1)(v.snippetText,r.value)},null,8,jO)):le("",!0)],42,PO))),128)):(b(),I("div",qO,B(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),YO=ut(GO,[["__scopeId","data-v-a678f802"]]),ZO=["aria-label"],QO=qe({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(b(),I("span",{class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[w("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[w("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),w("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,ZO))}}),wo=ut(QO,[["__scopeId","data-v-e5c5b17d"]]),XO={key:0,class:"ui-badge__dot","aria-hidden":"true"},JO=qe({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(b(),I("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(b(),I("span",XO)):le("",!0),In(t.$slots,"default",{},void 0,!0)],2))}}),Ro=ut(JO,[["__scopeId","data-v-5bc5cd6d"]]),td=Q(null);function R3(e){const t=td.value;t&&(td.value=null,t.resolve(e))}function eR(e){return td.value&&R3(!1),new Promise(t=>{td.value={...e,resolve:t}})}function kl(){return{current:td,confirm:eR,settle:R3}}const tR=qe({__name:"Menu",setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),I("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[In(s.$slots,"default",{},void 0,!0)],512))}}),Jl=ut(tR,[["__scopeId","data-v-60e6cd8d"]]),nR={key:0,class:"ui-menu-sep",role:"separator"},sR=["disabled"],oR=qe({__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?(b(),I("div",nR)):(b(),I("button",{key:1,class:De(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[In(t.$slots,"default",{},void 0,!0)],10,sR))}}),Mn=ut(oR,[["__scopeId","data-v-f940771a"]]),Rr=6,Br=8,iR=150,rR=qe({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Q(),s=Q(),o=Q(!1),i=Q(!1),r=Q({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const _=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&_.top-Rr-g<Br?A="bottom":A==="bottom"&&_.bottom+Rr+g>y-Br?A="top":A==="left"&&_.left-Rr-k<Br?A="right":A==="right"&&_.right+Rr+k>v-Br&&(A="left");let L=0,$=0;A==="top"?(L=_.top-Rr-g,$=_.left+_.width/2-k/2):A==="bottom"?(L=_.bottom+Rr,$=_.left+_.width/2-k/2):A==="left"?(L=_.top+_.height/2-g/2,$=_.left-Rr-k):(L=_.top+_.height/2-g/2,$=_.right+Rr),$=Math.min(Math.max($,Br),v-Br-k),L=Math.min(Math.max(L,Br),y-Br-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,pt(()=>{u(),i.value=!0})},iR))}function f(){window.clearTimeout(l),o.value=!1,i.value=!1}function p(){o.value&&f()}function h(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return ln(()=>{const m=n.value??null;h(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const _=m.firstElementChild??null;_!==a&&(f(),h(_??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p)}),es(()=>{window.clearTimeout(l),c?.disconnect(),h(null),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}),(m,_)=>(b(),I(Be,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[In(m.$slots,"default",{},void 0,!0)],512),(b(),ye(Ap,{to:"body"},[Tn(w("div",{ref_key:"bubble",ref:s,class:De(["ui-tip__bubble",{positioned:i.value}]),style:qt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},B(e.text),7),[[oi,o.value]])]))],64))}}),jt=ut(rR,[["__scopeId","data-v-4c261eb6"]]),lR={class:"row"},aR={class:"lead","aria-hidden":"true"},cR={key:1,class:"unread-dot"},uR={class:"left"},dR=["onKeydown"],fR={class:"act"},hR={class:"ts"},pR={class:"menu-time"},mR=qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=Et(),{confirm:o}=kl(),i=e,r=n;function l(S){const T=new Date(S);if(Number.isNaN(T.getTime()))return S;const R=O=>String(O).padStart(2,"0");return`${T.getFullYear()}-${R(T.getMonth()+1)}-${R(T.getDate())} ${R(T.getHours())}:${R(T.getMinutes())}`}const a=P(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Q(!1),u=Q(null),d=Q(null),f=Q({});function p(S){const T=S.target;d.value?.el?.contains(T)||u.value?.el?.contains(T)||_()}function h(){const S=u.value?.el;if(!S)return;const T=d.value?.el,R=S.getBoundingClientRect(),O=4,D=8,W=T?.offsetHeight??0,z=T?.offsetWidth??0;let V=R.bottom+O;V+W>window.innerHeight-D&&(V=Math.max(D,R.top-W-O));let U=R.right-z;U<D&&(U=D),f.value={top:`${Math.round(V)}px`,left:`${Math.round(U)}px`}}async function m(S){if(S.stopPropagation(),c.value){_();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",p),0),window.addEventListener("resize",_),await pt(),h()}function _(){c.value=!1,document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)}fn(()=>{document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)});const k=Q(!1),g=Q(""),v=Q(null);async function y(){_(),k.value=!0,g.value=i.session.title,await pt();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const S=g.value.trim();S&&r("rename",i.session.id,S),k.value=!1}function L(){k.value=!1}const $=Q(!1),x=Q(!1);async function E(){const S=await js(i.session.id);$.value=S,x.value=!S,setTimeout(()=>{$.value=!1,x.value=!1,_()},1500)}function N(){_(),r("fork",i.session.id)}async function F(){_(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:_}),(S,T)=>(b(),I("div",{class:De(["se",{on:e.active}]),onClick:T[4]||(T[4]=R=>r("select",e.session.id))},[w("div",lR,[w("span",aR,[e.session.busy?(b(),ye(wo,{key:0,size:"sm"})):e.unread?(b(),I("span",cR)):le("",!0)]),w("div",uR,[k.value?Tn((b(),I("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":T[0]||(T[0]=R=>g.value=R),class:"rename-input",onClick:T[1]||(T[1]=bt(()=>{},["stop"])),onKeydown:[bi(bt(A,["stop"]),["enter"]),bi(bt(L,["stop"]),["esc"])],onBlur:A},null,40,dR)),[[ao,g.value]]):(b(),I("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},B(e.session.title),33))]),ie(jt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.awaitingAnswer")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(b(),ye(Ro,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.awaitingPermission")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.abortedTitle")},{default:Ee(()=>[!k.value&&e.session.status==="aborted"?(b(),ye(Ro,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.aborted")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),w("span",fR,[w("span",hR,B(e.session.time),1),k.value?le("",!0):(b(),ye(Nn,{key:0,ref_key:"kebabRef",ref:u,class:De(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:T[2]||(T[2]=bt(R=>m(R),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(b(),ye(Ap,{to:"body"},[c.value?(b(),ye(Jl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:qt(f.value),onClick:T[3]||(T[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{danger:x.value,onClick:E},{default:Ee(()=>[Ge(B(x.value?C(s)("sidebar.copyFailed"):$.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(Mn,{separator:""}),ie(Mn,{onClick:y},{default:Ee(()=>[Ge(B(C(s)("sidebar.rename")),1)]),_:1}),ie(Mn,{onClick:N},{default:Ee(()=>[Ge(B(C(s)("sidebar.fork")),1)]),_:1}),ie(Mn,{danger:"",onClick:F},{default:Ee(()=>[Ge(B(C(s)("sidebar.archive")),1)]),_:1}),ie(Mn,{separator:""}),w("div",pR,B(a.value),1)]),_:1},8,["style"])):le("",!0)]))],2))}}),gR=ut(mR,[["__scopeId","data-v-e3ea544d"]]),vR={class:"gh-top"},yR={class:"gh-name"},kR=["inert"],bR=["disabled"],xR={class:"show-more-label"},_R={class:"show-more-label"},wR={key:2,class:"group-empty"},SR=qe({__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","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=P(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const f=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!f.some(p=>p.id===s.activeId)){const p=s.group.sessions.find(h=>h.id===s.activeId);if(p)return[...f,p]}return f}),l=P(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(f){s.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(f,p)=>(b(),I("div",{class:De(["group",{dragging:e.dragging}])},[w("div",{class:De(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:p[7]||(p[7]=bt(h=>o("groupClick",e.group.workspace.id,h),["stop"])),onContextmenu:p[8]||(p[8]=h=>o("groupContextmenu",e.group.workspace,h)),onDragstart:d,onDragend:p[9]||(p[9]=h=>o("wsDragend"))},[w("div",vR,[e.isCollapsed(e.group.workspace.id)?(b(),ye(Ve,{key:0,class:"gh-folder",name:"folder-closed"})):(b(),ye(Ve,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(b(),ye(jt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[w("span",yR,B(e.group.workspace.name),1)]),_:1},8,["text"])):Tn((b(),I("input",{key:3,ref:u,"onUpdate:modelValue":p[0]||(p[0]=h=>i.value=h),class:"gh-rename",type:"text",onKeydown:[p[1]||(p[1]=bi(h=>o("confirmRename"),["enter"])),p[2]||(p[2]=bi(h=>o("cancelRename"),["esc"]))],onBlur:p[3]||(p[3]=h=>o("cancelRename")),onClick:p[4]||(p[4]=bt(()=>{},["stop"]))},null,544)),[[ao,i.value]]),e.renamingId!==e.group.workspace.id?(b(),I("div",{key:4,class:De(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ie(Nn,{class:De(["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:p[5]||(p[5]=bt(h=>o("toggleWsMenu",e.group.workspace,h),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ie(Nn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:p[6]||(p[6]=bt(h=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"chat-new"})]),_:1},8,["label"])],2)):le("",!0)])],34),w("div",{class:De(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(b(!0),I(Be,null,nt(r.value,h=>(b(),ye(gR,{key:h.id,session:h,active:h.id===e.activeId,"approval-count":e.pendingBySession[h.id]?.approvals??0,"question-count":e.pendingBySession[h.id]?.questions??0,unread:e.unreadBySession[h.id]??!1,onSelect:p[10]||(p[10]=m=>o("selectSession",m)),onRename:p[11]||(p[11]=(m,_)=>o("renameSession",m,_)),onArchive:p[12]||(p[12]=m=>o("archiveSession",m)),onFork:p[13]||(p[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(b(),I("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:p[14]||(p[14]=bt(h=>o("loadMore",e.group.workspace.id),["stop"]))},[p[16]||(p[16]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",xR,B(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,bR)):le("",!0),l.value?(b(),I("button",{key:1,class:"show-more",onClick:p[15]||(p[15]=bt(h=>o("toggleExpand",e.group.workspace.id),["stop"]))},[p[17]||(p[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",_R,B(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):le("",!0),e.group.sessions.length===0?(b(),I("div",wR,B(C(n)("sidebar.noSessions")),1)):le("",!0)],10,kR)],2))}}),CR=ut(SR,[["__scopeId","data-v-cbca6d9c"]]),AR="kimi_desktop",MR="platform",Mx="kimi-desktop",Ex="kimi-desktop-platform";function ER(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(AR)?(sessionStorage.setItem(Mx,"1"),e=!0):e=e||sessionStorage.getItem(Mx)==="1";const s=n.get(MR);s?(sessionStorage.setItem(Ex,s),t=s):t=sessionStorage.getItem(Ex)}catch{}return{isDesktop:e,platform:t}}const xg=ER(),TR=xg.isDesktop,pc=xg.isDesktop&&xg.platform==="darwin",NR={class:"ui-kbd"},IR=qe({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(b(),I("span",NR,[(b(!0),I(Be,null,nt(e.keys,s=>(b(),I("kbd",{key:s,class:"ui-kbd__key"},B(s),1))),128))]))}}),tr=ut(IR,[["__scopeId","data-v-32292ed8"]]),$R={class:"ch"},LR={class:"ch-brand"},FR={class:"ch-name"},OR={key:0,class:"ch-endpoint"},RR={class:"btn-wrap"},BR={class:"search-input"},DR={key:0,class:"empty"},PR={class:"side-section-label"},HR={class:"side-section-title"},WR={class:"side-section-actions"},zR=["onDragover","onDrop"],UR={class:"side-footer"},jR={class:"section-menu-check"},qR={class:"section-menu-check"},VR=1e3,KR=qe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},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","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=!1,i="",r=e,l=t,a=Q(!1),c=f()?["⌘","K"]:["Ctrl","K"];function u(){l("loadAllSessions"),a.value=!0}function d(Xe){(Xe.metaKey||Xe.ctrlKey)&&Xe.key.toLowerCase()==="k"&&(Xe.preventDefault(),u())}ln(()=>window.addEventListener("keydown",d)),es(()=>window.removeEventListener("keydown",d));function f(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Xe=navigator.userAgentData;return Xe?.platform==="macOS"||Xe?.platform==="iOS"}const p=Q(!1);function h(Xe){p.value=Xe.target.scrollTop>0}const m=Q(new Set(NN()));function _(Xe){return m.value.has(Xe)}function k(Xe){const Ze=new Set(m.value);Ze.has(Xe)?Ze.delete(Xe):Ze.add(Xe),m.value=Ze,M1(Ze)}function g(){const Xe=new Set(r.groups.map(Ze=>Ze.workspace.id));m.value=Xe,M1(Xe)}function v(){const Xe=new Set;m.value=Xe,M1(Xe)}const y=P(()=>r.groups.length>0&&r.groups.every(Xe=>m.value.has(Xe.workspace.id))),A=Q(new Set);function L(Xe){return A.value.has(Xe)}function $(Xe){const Ze=new Set(A.value);Ze.has(Xe)?Ze.delete(Xe):Ze.add(Xe),A.value=Ze}function x(Xe){if(!A.value.has(Xe)){const Ze=new Set(A.value);Ze.add(Xe),A.value=Ze}l("loadMoreSessions",Xe)}const E=Q(null),N=Q(null);function F(Xe){E.value=Xe}function S(){E.value=null,N.value=null}function T(Xe){const Ze=Xe.currentTarget.getBoundingClientRect();return Xe.clientY<Ze.top+Ze.height/2?"before":"after"}function R(Xe,Ze){E.value===null||E.value===Ze||(Xe.preventDefault(),Xe.dataTransfer&&(Xe.dataTransfer.dropEffect="move"),N.value={id:Ze,position:T(Xe)})}function O(Xe){const Ze=E.value,Mt=N.value?.id===Xe?N.value.position:"before";if(N.value=null,E.value=null,!Ze||Ze===Xe)return;const Dt=VN(r.groups.map(zt=>zt.workspace.id),Ze,Xe,Mt);l("reorderWorkspaces",Dt)}function D(Xe,Ze){Ze.target.closest(".gh-more, .gh-add")||k(Xe)}function W(Xe){l("select",Xe)}const z=Q(null),V=Q(""),U=Q(null);function re(){return U}function ae(Xe,Ze){z.value=Xe,V.value=Ze,pt().then(()=>U.value?.focus())}function te(){const Xe=z.value,Ze=V.value.trim();Xe&&Ze&&l("renameWorkspace",Xe,Ze),z.value=null}function Z(){z.value=null}function ne(Xe){V.value=Xe}const ke=Q(!1),Se=Q(null),Ye=Q({}),ve=Q(null);function Y(Xe){ve.value?.el&&!ve.value.el.contains(Xe.target)&&fe()}function ce(Xe,Ze){Ze.preventDefault(),Ze.stopPropagation(),Se.value=Xe,Ye.value={top:`${Ze.clientY}px`,left:`${Ze.clientX}px`},ke.value=!0,document.addEventListener("mousedown",Y,!0)}function fe(){ke.value=!1,document.removeEventListener("mousedown",Y,!0),Se.value=null}function j(){Se.value&&js(Se.value.root),fe()}function se(){Se.value&&ae(Se.value.id,Se.value.name),fe()}async function ge(){const Xe=Se.value;Xe&&(fe(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id))}const ue=Q(null),pe=Q(null),q=Q({}),J=Q(null);function he(Xe){const Ze=Xe.target;Ze.closest(".gh-more")||Ze.closest(".ws-menu")||Ie()}async function Te(Xe,Ze){if(ue.value===Xe.id){Ie();return}const Mt=Ze.currentTarget;pe.value=Xe,ue.value=Xe.id,document.addEventListener("mousedown",he),window.addEventListener("resize",Ie),await pt();const Dt=J.value?.el,zt=Mt.getBoundingClientRect(),wn=4,Rn=8,hs=Dt?.offsetHeight??0,ss=Dt?.offsetWidth??0;let sn=zt.bottom+wn;sn+hs>window.innerHeight-Rn&&(sn=Math.max(Rn,zt.top-hs-wn));let Lt=zt.right-ss;Lt<Rn&&(Lt=Rn),q.value={top:`${Math.round(sn)}px`,left:`${Math.round(Lt)}px`}}function Ie(){ue.value=null,pe.value=null,document.removeEventListener("mousedown",he),window.removeEventListener("resize",Ie)}function Oe(Xe){js(Xe.root),Ie()}function de(Xe){ae(Xe.id,Xe.name),Ie()}async function $e(Xe){Ie(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id)}const Qe=Q(!1),tt=Q({}),vt=Q(null);function wt(Xe){const Ze=Xe.target;Ze.closest(".side-section-kebab")||Ze.closest(".section-menu")||Rt()}async function xt(Xe){if(Qe.value){Rt();return}const Ze=Xe.currentTarget;Qe.value=!0,document.addEventListener("mousedown",wt),window.addEventListener("resize",Rt),await pt();const Mt=vt.value?.el,Dt=Ze.getBoundingClientRect(),zt=4,wn=8,Rn=Mt?.offsetHeight??0,hs=Mt?.offsetWidth??0;let ss=Dt.bottom+zt;ss+Rn>window.innerHeight-wn&&(ss=Math.max(wn,Dt.top-Rn-zt));let sn=Dt.right-hs;sn<wn&&(sn=wn),tt.value={top:`${Math.round(ss)}px`,left:`${Math.round(sn)}px`}}function Rt(){Qe.value=!1,document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Rt)}function yt(Xe){l("setWorkspaceSortMode",Xe),Rt()}es(()=>{document.removeEventListener("mousedown",Y,!0),document.removeEventListener("mousedown",he),document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Ie),window.removeEventListener("resize",Rt)});const nn=Q(null);let xn;function ns(){const Xe=nn.value;Xe&&(Xe.classList.remove("blink-now"),Xe.getBoundingClientRect(),Xe.classList.add("blink-now"),clearTimeout(xn),xn=setTimeout(()=>Xe.classList.remove("blink-now"),300))}const Wt=ki(()=>eo(()=>import("./DesignSystemView-DQSXggUP.js"),__vite__mapDeps([0,1]))),_n=Q(!1);let gn,ot=!1;function ds(Xe){ot=!1,clearTimeout(gn),Xe.currentTarget.setPointerCapture?.(Xe.pointerId),gn=setTimeout(()=>{ot=!0,_n.value=!0},VR)}function ys(Xe){clearTimeout(gn);const Ze=Xe.currentTarget;Ze.hasPointerCapture?.(Xe.pointerId)&&Ze.releasePointerCapture(Xe.pointerId)}function fs(){if(ot){ot=!1;return}ns()}return es(()=>{clearTimeout(gn)}),(Xe,Ze)=>(b(),I("aside",{class:De(["side",{"macos-desktop":C(pc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:qt({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:qt({width:e.colWidth+"px"})},[w("div",$R,[w("div",LR,[C(pc)?le("",!0):(b(),I(Be,{key:0},[(b(),I("svg",{ref_key:"logoRef",ref:nn,class:De(["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:fs,onPointerdown:ds,onPointerup:ys,onPointercancel:ys},[...Ze[20]||(Ze[20]=[Hv('<defs data-v-c1a5226d><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-c1a5226d><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-c1a5226d></rect><g class="ch-eyes" fill="#000" data-v-c1a5226d><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-c1a5226d></rect>',2)])],34)),w("span",FR,[Ze[21]||(Ze[21]=Ge("Kimi Code",-1)),C(o)?(b(),I("span",OR," · "+B(C(i)),1)):le("",!0)])],64))]),C(pc)?le("",!0):(b(),ye(Nn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Ze[0]||(Ze[0]=bt(Mt=>l("collapse"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",RR,[w("button",{class:"btn-new-chat",type:"button",onClick:Ze[1]||(Ze[1]=bt(Mt=>l("create"),["stop"]))},[ie(Ve,{name:"chat-new"}),w("span",null,B(C(n)("sidebar.newChat")),1)]),le("",!0)]),w("div",{class:De(["search-wrap",{"search-wrap--scrolled":p.value}])},[w("button",{class:"search",type:"button",onClick:u},[ie(Ve,{class:"search-icon",name:"search"}),w("span",BR,B(C(n)("sidebar.search")),1),ie(tr,{keys:C(c)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:h},[e.groups.length===0?(b(),I("div",DR,B(C(n)("workspace.noWorkspace")),1)):(b(),I(Be,{key:1},[w("div",PR,[w("span",HR,B(C(n)("sidebar.workspaces")),1),w("div",WR,[ie(Nn,{class:"side-section-toggle",size:"sm",label:y.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Ze[3]||(Ze[3]=bt(Mt=>y.value?v():g(),["stop"]))},{default:Ee(()=>[y.value?(b(),ye(Ve,{key:0,name:"expand"})):(b(),ye(Ve,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Nn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Qe.value,onClick:Ze[4]||(Ze[4]=bt(Mt=>xt(Mt),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(b(!0),I(Be,null,nt(e.groups,Mt=>(b(),I("div",{key:Mt.workspace.id,class:De(["ws-drop-target",{"drop-before":N.value?.id===Mt.workspace.id&&N.value.position==="before","drop-after":N.value?.id===Mt.workspace.id&&N.value.position==="after"}]),onDragover:Dt=>R(Dt,Mt.workspace.id),onDrop:Dt=>O(Mt.workspace.id)},[ie(CR,{group:Mt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":z.value,"rename-value":V.value,"rename-input-ref":re(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ue.value,dragging:E.value===Mt.workspace.id,"is-collapsed":_,"is-expanded":L,onGroupClick:D,onGroupContextmenu:ce,onToggleWsMenu:Te,onCreateInWorkspace:Ze[5]||(Ze[5]=Dt=>l("createInWorkspace",Dt)),onSelectSession:W,onRenameSession:Ze[6]||(Ze[6]=(Dt,zt)=>l("rename",Dt,zt)),onArchiveSession:Ze[7]||(Ze[7]=Dt=>l("archive",Dt)),onForkSession:Ze[8]||(Ze[8]=Dt=>l("fork",Dt)),onLoadMore:x,onToggleExpand:$,onConfirmRename:te,onCancelRename:Z,onUpdateRenameValue:ne,onWsDragstart:F,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,zR))),128))],64))],32),w("div",UR,[w("button",{class:"btn-settings",type:"button",onClick:Ze[9]||(Ze[9]=bt(Mt=>l("openSettings"),["stop"]))},[ie(Ve,{name:"settings"}),w("span",null,B(C(n)("settings.title")),1)])])],4),ke.value?(b(),ye(Jl,{key:0,ref_key:"ghMenuRef",ref:ve,class:"gh-menu",style:qt(Ye.value),onClick:Ze[10]||(Ze[10]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:j},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1}),ie(Mn,{onClick:se},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1}),ie(Mn,{danger:"",onClick:ge},{default:Ee(()=>[Ge(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),ue.value!==null&&pe.value?(b(),ye(Jl,{key:1,ref_key:"wsMenuRef",ref:J,class:"ws-menu",style:qt(q.value),onClick:Ze[14]||(Ze[14]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:Ze[11]||(Ze[11]=Mt=>Oe(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1}),ie(Mn,{separator:""}),ie(Mn,{onClick:Ze[12]||(Ze[12]=Mt=>de(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1}),ie(Mn,{separator:""}),ie(Mn,{danger:"",onClick:Ze[13]||(Ze[13]=Mt=>$e(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),Qe.value?(b(),ye(Jl,{key:2,ref_key:"sectionMenuRef",ref:vt,class:"section-menu",style:qt(tt.value),onClick:Ze[17]||(Ze[17]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:Ze[15]||(Ze[15]=Mt=>yt("manual"))},{default:Ee(()=>[w("span",jR,[e.workspaceSortMode==="manual"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),Ge(" "+B(C(n)("sidebar.sortManual")),1)]),_:1}),ie(Mn,{onClick:Ze[16]||(Ze[16]=Mt=>yt("recent"))},{default:Ee(()=>[w("span",qR,[e.workspaceSortMode==="recent"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),Ge(" "+B(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):le("",!0),a.value?(b(),ye(YO,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:W,onClose:Ze[18]||(Ze[18]=Mt=>a.value=!1)},null,8,["sessions","active-id"])):le("",!0),(b(),ye(Ap,{to:"body"},[_n.value?(b(),ye(C(Wt),{key:0,onClose:Ze[19]||(Ze[19]=Mt=>_n.value=!1)})):le("",!0)]))],6))}}),GR=ut(KR,[["__scopeId","data-v-c1a5226d"]]);function YR(e){try{const t=Qn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function ZR(e,t){try{ts(e,String(t))}catch{}}function QR(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(YC(o),Math.max(s,Math.round(k))):n}const l=Q(r(YR(t)??n)),a=Q(!1);function c(k){const g=r(k);l.value=g,ZR(t,g)}let u=0,d=0,f=null,p=-1;function h(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(p)}catch{}f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,p=-1}}function _(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,p=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(p)}catch{}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return es(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const XR=["aria-label"],JR=qe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),{width:i,dragging:r,onPointerDown:l}=QR({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ke(i,a=>s("update:width",a)),Ke(r,a=>s("update:dragging",a)),(a,c)=>(b(),I("div",{class:De(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[w("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,XR))}}),Tx=ut(JR,[["__scopeId","data-v-ad762f1c"]]),eB=["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"],Nx=[[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 tB(e){if(e<=255)return eB[e];let t=0,n=Nx.length-1;for(;t<=n;){const s=t+n>>1,o=Nx[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function nB(e){const t=e.length;if(t===0)return null;const n=new Array(t);let s=!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 h=e.charCodeAt(c+1);h>=56320&&h<=57343&&(d=(u-55296<<10)+(h-56320)+65536,f=2)}const p=tB(d);(p==="R"||p==="AL"||p==="AN")&&(s=!0);for(let h=0;h<f;h++)n[c+h]=p;c+=f}if(!s)return null;let o=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){o=0;break}if(u==="R"||u==="AL"){o=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;const r=o&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,p=d!=="L"?"R":"L";if(p===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=p;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 sB(e,t){const n=nB(e);if(n===null)return null;const s=new Int8Array(t.length);for(let o=0;o<t.length;o++)s[o]=n[t[o]];return s}const oB=/[ \t\n\r\f]+/g,iB=/[\t\n\r\f]| {2,}|^ | $/;function rB(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function lB(e){if(!iB.test(e))return e;let t=e.replace(oB," ");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 aB(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
67
|
+
`,EF='<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>',TF='<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>',NF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',IF='<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>',$F='<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>',LF='<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>',FF='<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>',OF='<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>',RF='<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>',Sx='<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>',BF='<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>',DF='<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>',PF='<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>',HF='<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>',WF='<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>',zF='<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>',UF='<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>',jF='<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>',qF='<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>',VF='<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>',KF='<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>',GF='<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>',YF='<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>',ZF='<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>',QF='<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>',XF='<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>',Cx='<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>',JF='<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>',eO='<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>',tO='<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>',nO='<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>',sO='<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>',oO='<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>',Ax='<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>',iO='<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>',rO='<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>',lO='<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>',aO='<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>',cO='<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>',uO='<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>',dO='<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>',fO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',hO='<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>',pO='<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>',mO='<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>',gO='<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>',vO='<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>',yO='<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>',kO='<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>',bO='<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>',xO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',_O='<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>',wO='<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>',SO='<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>',CO='<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>',AO='<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>',F3={sm:14,md:16,lg:20};function kt(e,t){return{component:e,svg:t}}const O3={plus:kt(MI,NF),"chat-new":kt(tI,_F),"calendar-close":kt(JI,DF),"calendar-schedule":kt(n$,PF),"calendar-todo":kt(i$,HF),close:kt(d$,zF),check:kt(a$,WF),search:kt(mI,AF),copy:kt(D$,QF),link:kt(mL,rO),"external-link":kt($$,YF),download:kt(b$,qF),undo:kt(PI,FF),send:kt(xx,Sx),image:kt(wx,Ax),settings:kt(yI,MF),sliders:kt(A$,KF),"log-in":kt(SL,cO),"chevron-down":kt(RI,LF),"chevron-right":kt(qI,RF),"arrow-up":kt(xx,Sx),"arrow-down":kt(LI,$F),"arrow-right":kt(zI,OF),minus:kt(rF,xO),"panel-collapse":kt(xI,EF),"panel-expand":kt(SI,TF),expand:kt(T$,GF),collapse:kt(v$,jF),list:kt(xL,aO),sort:kt(qL,gO),grip:kt(w$,VF),folder:kt(cI,SF),"folder-closed":kt(oI,wF),"folder-plus":kt(X$,tO),"folder-solid":kt(tL,nO),file:kt(_x,Cx),"file-text":kt(V$,JF),"file-edit":kt(W$,XF),"file-plus":kt(O$,ZF),"file-off":kt(_x,Cx),"image-off":kt(wx,Ax),code:kt(p$,UF),terminal:kt(fF,wO),pencil:kt(RL,hO),tool:kt(yF,CO),glob:kt(ZI,BF),globe:kt(lL,oO),"check-list":kt(yL,lO),bolt:kt(Y$,eO),"git-pull-request":kt(oL,sO),message:kt(NL,dO),mail:kt(ML,uO),user:kt(xF,AO),info:kt(fL,iO),"help-circle":kt(zL,mO),"alert-triangle":kt(NI,IF),clock:kt(mF,SO),sparkles:kt(GL,vO),target:kt(cF,_O),pause:kt(LL,fO),play:kt(PL,pO),stop:kt(sF,bO),star:kt(QL,yO),"star-outline":kt(eF,kO),"dots-horizontal":kt(fI,CF)};function MO(e){return O3[e]}function EO(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Ga(e,t="md"){const n=O3[e];return n?EO(n.svg,F3[t]):""}const Kbe=[["Actions",["plus","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","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-pull-request","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=qe({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=P(()=>MO(t.name)),s=P(()=>F3[t.size]);return(o,i)=>n.value?(b(),ye($s(n.value.component),{key:0,class:"kw-icon",width:s.value,height:s.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):le("",!0)}}),TO={key:0,class:"ui-dialog__head"},NO={class:"ui-dialog__titles"},IO={key:0,class:"ui-dialog__title"},$O={key:1,class:"ui-dialog__desc"},LO={class:"ui-dialog__body"},FO={key:1,class:"ui-dialog__foot"},OO='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',RO=qe({__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,s=t,o=Q(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(OO)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?o.value?.querySelector(d)??null:o.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(),p=f[0],h=f[f.length-1];if(!p||!h){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===p?(d.preventDefault(),h.focus()):!d.shiftKey&&m===h&&(d.preventDefault(),p.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Ke(()=>n.open,async d=>{if(d){Ka.value+=1,i=document.activeElement,await pt();const f=a(),p=l();(f??p[0]??o.value)?.focus()}else Ka.value=Math.max(0,Ka.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),es(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Ka.value=Math.max(0,Ka.value-1))}),(d,f)=>(b(),ye(Ap,{to:"body"},[e.open?(b(),I("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[w("div",{ref_key:"panel",ref:o,class:De(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(b(),I("div",TO,[In(d.$slots,"head",{},()=>[w("div",NO,[e.title?(b(),I("div",IO,B(e.title),1)):le("",!0),e.description?(b(),I("div",$O,B(e.description),1)):le("",!0)])],!0),ie(Nn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[ie(Ve,{name:"close",size:"md"})]),_:1})])):le("",!0),w("div",LO,[In(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(b(),I("div",FO,[In(d.$slots,"foot",{},void 0,!0)])):le("",!0)],2)],32)):le("",!0)]))}}),Sr=ut(RO,[["__scopeId","data-v-3dce23a4"]]),BO={class:"sd-head"},DO=["placeholder","aria-label"],PO=["aria-selected","onClick","onMousemove"],HO={class:"sd-meta"},WO=["innerHTML"],zO={class:"sd-time"},UO=["innerHTML"],jO=["innerHTML"],qO={key:1,class:"sd-empty"},VO={class:"sd-hint"},KO=200,GO=qe({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=Q(""),l=Q(null),a=Q(null),c=P(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",A=v.lastPrompt??"",L=v.workspaceName??"",$=k.length>0&&y.toLowerCase().includes(k),x=k.length>0&&A.toLowerCase().includes(k),E=k.length>0&&L.toLowerCase().includes(k);if(!(k.length>0&&!$&&!x&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?ZN(A,r.value):""}),g.length>=KO))break}return g}),u=Q(0);Ke(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await pt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function p(k){u.value=d(u.value+k),f()}function h(k){o("select",k),o("close")}function m(){const k=c.value[u.value];k&&h(k.session.id)}function _(k){k.key==="ArrowDown"?(k.preventDefault(),p(1)):k.key==="ArrowUp"?(k.preventDefault(),p(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return ln(()=>{l.value?.focus()}),(k,g)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>o("close"))},{head:Ee(()=>[w("div",BO,[ie(Ve,{class:"sd-search-icon",name:"search",size:"md"}),Tn(w("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:_},null,40,DO),[[ao,r.value]])])]),foot:Ee(()=>[w("span",VO,B(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(b(!0),I(Be,{key:0},nt(c.value,(v,y)=>(b(),I("button",{key:v.session.id,class:De(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:A=>h(v.session.id),onMousemove:A=>u.value=y},[w("span",HO,[ie(Ve,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(E1)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,WO),w("span",zO,B(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(E1)(v.session.title,v.inTitle?r.value:"")},null,8,UO),v.snippetText?(b(),I("span",{key:0,class:"sd-snippet",innerHTML:C(E1)(v.snippetText,r.value)},null,8,jO)):le("",!0)],42,PO))),128)):(b(),I("div",qO,B(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),YO=ut(GO,[["__scopeId","data-v-a678f802"]]),ZO=["aria-label"],QO=qe({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(b(),I("span",{class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[w("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[w("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),w("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,ZO))}}),wo=ut(QO,[["__scopeId","data-v-e5c5b17d"]]),XO={key:0,class:"ui-badge__dot","aria-hidden":"true"},JO=qe({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(b(),I("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(b(),I("span",XO)):le("",!0),In(t.$slots,"default",{},void 0,!0)],2))}}),Ro=ut(JO,[["__scopeId","data-v-5bc5cd6d"]]),td=Q(null);function R3(e){const t=td.value;t&&(td.value=null,t.resolve(e))}function eR(e){return td.value&&R3(!1),new Promise(t=>{td.value={...e,resolve:t}})}function kl(){return{current:td,confirm:eR,settle:R3}}const tR=qe({__name:"Menu",setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),I("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[In(s.$slots,"default",{},void 0,!0)],512))}}),Jl=ut(tR,[["__scopeId","data-v-60e6cd8d"]]),nR={key:0,class:"ui-menu-sep",role:"separator"},sR=["disabled"],oR=qe({__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?(b(),I("div",nR)):(b(),I("button",{key:1,class:De(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[In(t.$slots,"default",{},void 0,!0)],10,sR))}}),Mn=ut(oR,[["__scopeId","data-v-f940771a"]]),Rr=6,Br=8,iR=150,rR=qe({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Q(),s=Q(),o=Q(!1),i=Q(!1),r=Q({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const _=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&_.top-Rr-g<Br?A="bottom":A==="bottom"&&_.bottom+Rr+g>y-Br?A="top":A==="left"&&_.left-Rr-k<Br?A="right":A==="right"&&_.right+Rr+k>v-Br&&(A="left");let L=0,$=0;A==="top"?(L=_.top-Rr-g,$=_.left+_.width/2-k/2):A==="bottom"?(L=_.bottom+Rr,$=_.left+_.width/2-k/2):A==="left"?(L=_.top+_.height/2-g/2,$=_.left-Rr-k):(L=_.top+_.height/2-g/2,$=_.right+Rr),$=Math.min(Math.max($,Br),v-Br-k),L=Math.min(Math.max(L,Br),y-Br-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,pt(()=>{u(),i.value=!0})},iR))}function f(){window.clearTimeout(l),o.value=!1,i.value=!1}function p(){o.value&&f()}function h(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return ln(()=>{const m=n.value??null;h(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const _=m.firstElementChild??null;_!==a&&(f(),h(_??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p)}),es(()=>{window.clearTimeout(l),c?.disconnect(),h(null),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}),(m,_)=>(b(),I(Be,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[In(m.$slots,"default",{},void 0,!0)],512),(b(),ye(Ap,{to:"body"},[Tn(w("div",{ref_key:"bubble",ref:s,class:De(["ui-tip__bubble",{positioned:i.value}]),style:qt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},B(e.text),7),[[oi,o.value]])]))],64))}}),jt=ut(rR,[["__scopeId","data-v-4c261eb6"]]),lR={class:"row"},aR={class:"lead","aria-hidden":"true"},cR={key:1,class:"unread-dot"},uR={class:"left"},dR=["onKeydown"],fR={class:"act"},hR={class:"ts"},pR={class:"menu-time"},mR=qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=Et(),{confirm:o}=kl(),i=e,r=n;function l(S){const T=new Date(S);if(Number.isNaN(T.getTime()))return S;const R=O=>String(O).padStart(2,"0");return`${T.getFullYear()}-${R(T.getMonth()+1)}-${R(T.getDate())} ${R(T.getHours())}:${R(T.getMinutes())}`}const a=P(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Q(!1),u=Q(null),d=Q(null),f=Q({});function p(S){const T=S.target;d.value?.el?.contains(T)||u.value?.el?.contains(T)||_()}function h(){const S=u.value?.el;if(!S)return;const T=d.value?.el,R=S.getBoundingClientRect(),O=4,D=8,W=T?.offsetHeight??0,z=T?.offsetWidth??0;let V=R.bottom+O;V+W>window.innerHeight-D&&(V=Math.max(D,R.top-W-O));let U=R.right-z;U<D&&(U=D),f.value={top:`${Math.round(V)}px`,left:`${Math.round(U)}px`}}async function m(S){if(S.stopPropagation(),c.value){_();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",p),0),window.addEventListener("resize",_),await pt(),h()}function _(){c.value=!1,document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)}fn(()=>{document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)});const k=Q(!1),g=Q(""),v=Q(null);async function y(){_(),k.value=!0,g.value=i.session.title,await pt();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const S=g.value.trim();S&&r("rename",i.session.id,S),k.value=!1}function L(){k.value=!1}const $=Q(!1),x=Q(!1);async function E(){const S=await js(i.session.id);$.value=S,x.value=!S,setTimeout(()=>{$.value=!1,x.value=!1,_()},1500)}function N(){_(),r("fork",i.session.id)}async function F(){_(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:_}),(S,T)=>(b(),I("div",{class:De(["se",{on:e.active}]),onClick:T[4]||(T[4]=R=>r("select",e.session.id))},[w("div",lR,[w("span",aR,[e.session.busy?(b(),ye(wo,{key:0,size:"sm"})):e.unread?(b(),I("span",cR)):le("",!0)]),w("div",uR,[k.value?Tn((b(),I("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":T[0]||(T[0]=R=>g.value=R),class:"rename-input",onClick:T[1]||(T[1]=bt(()=>{},["stop"])),onKeydown:[bi(bt(A,["stop"]),["enter"]),bi(bt(L,["stop"]),["esc"])],onBlur:A},null,40,dR)),[[ao,g.value]]):(b(),I("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},B(e.session.title),33))]),ie(jt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.awaitingAnswer")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(b(),ye(Ro,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.awaitingPermission")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.abortedTitle")},{default:Ee(()=>[!k.value&&e.session.status==="aborted"?(b(),ye(Ro,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.aborted")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),w("span",fR,[w("span",hR,B(e.session.time),1),k.value?le("",!0):(b(),ye(Nn,{key:0,ref_key:"kebabRef",ref:u,class:De(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:T[2]||(T[2]=bt(R=>m(R),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(b(),ye(Ap,{to:"body"},[c.value?(b(),ye(Jl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:qt(f.value),onClick:T[3]||(T[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{danger:x.value,onClick:E},{default:Ee(()=>[Ge(B(x.value?C(s)("sidebar.copyFailed"):$.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(Mn,{separator:""}),ie(Mn,{onClick:y},{default:Ee(()=>[Ge(B(C(s)("sidebar.rename")),1)]),_:1}),ie(Mn,{onClick:N},{default:Ee(()=>[Ge(B(C(s)("sidebar.fork")),1)]),_:1}),ie(Mn,{danger:"",onClick:F},{default:Ee(()=>[Ge(B(C(s)("sidebar.archive")),1)]),_:1}),ie(Mn,{separator:""}),w("div",pR,B(a.value),1)]),_:1},8,["style"])):le("",!0)]))],2))}}),gR=ut(mR,[["__scopeId","data-v-e3ea544d"]]),vR={class:"gh-top"},yR={class:"gh-name"},kR=["inert"],bR=["disabled"],xR={class:"show-more-label"},_R={class:"show-more-label"},wR={key:2,class:"group-empty"},SR=qe({__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","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=P(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const f=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!f.some(p=>p.id===s.activeId)){const p=s.group.sessions.find(h=>h.id===s.activeId);if(p)return[...f,p]}return f}),l=P(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(f){s.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(f,p)=>(b(),I("div",{class:De(["group",{dragging:e.dragging}])},[w("div",{class:De(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:p[7]||(p[7]=bt(h=>o("groupClick",e.group.workspace.id,h),["stop"])),onContextmenu:p[8]||(p[8]=h=>o("groupContextmenu",e.group.workspace,h)),onDragstart:d,onDragend:p[9]||(p[9]=h=>o("wsDragend"))},[w("div",vR,[e.isCollapsed(e.group.workspace.id)?(b(),ye(Ve,{key:0,class:"gh-folder",name:"folder-closed"})):(b(),ye(Ve,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(b(),ye(jt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[w("span",yR,B(e.group.workspace.name),1)]),_:1},8,["text"])):Tn((b(),I("input",{key:3,ref:u,"onUpdate:modelValue":p[0]||(p[0]=h=>i.value=h),class:"gh-rename",type:"text",onKeydown:[p[1]||(p[1]=bi(h=>o("confirmRename"),["enter"])),p[2]||(p[2]=bi(h=>o("cancelRename"),["esc"]))],onBlur:p[3]||(p[3]=h=>o("cancelRename")),onClick:p[4]||(p[4]=bt(()=>{},["stop"]))},null,544)),[[ao,i.value]]),e.renamingId!==e.group.workspace.id?(b(),I("div",{key:4,class:De(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ie(Nn,{class:De(["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:p[5]||(p[5]=bt(h=>o("toggleWsMenu",e.group.workspace,h),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ie(Nn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:p[6]||(p[6]=bt(h=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"chat-new"})]),_:1},8,["label"])],2)):le("",!0)])],34),w("div",{class:De(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(b(!0),I(Be,null,nt(r.value,h=>(b(),ye(gR,{key:h.id,session:h,active:h.id===e.activeId,"approval-count":e.pendingBySession[h.id]?.approvals??0,"question-count":e.pendingBySession[h.id]?.questions??0,unread:e.unreadBySession[h.id]??!1,onSelect:p[10]||(p[10]=m=>o("selectSession",m)),onRename:p[11]||(p[11]=(m,_)=>o("renameSession",m,_)),onArchive:p[12]||(p[12]=m=>o("archiveSession",m)),onFork:p[13]||(p[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(b(),I("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:p[14]||(p[14]=bt(h=>o("loadMore",e.group.workspace.id),["stop"]))},[p[16]||(p[16]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",xR,B(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,bR)):le("",!0),l.value?(b(),I("button",{key:1,class:"show-more",onClick:p[15]||(p[15]=bt(h=>o("toggleExpand",e.group.workspace.id),["stop"]))},[p[17]||(p[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",_R,B(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):le("",!0),e.group.sessions.length===0?(b(),I("div",wR,B(C(n)("sidebar.noSessions")),1)):le("",!0)],10,kR)],2))}}),CR=ut(SR,[["__scopeId","data-v-cbca6d9c"]]),AR="kimi_desktop",MR="platform",Mx="kimi-desktop",Ex="kimi-desktop-platform";function ER(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(AR)?(sessionStorage.setItem(Mx,"1"),e=!0):e=e||sessionStorage.getItem(Mx)==="1";const s=n.get(MR);s?(sessionStorage.setItem(Ex,s),t=s):t=sessionStorage.getItem(Ex)}catch{}return{isDesktop:e,platform:t}}const xg=ER(),TR=xg.isDesktop,pc=xg.isDesktop&&xg.platform==="darwin",NR={class:"ui-kbd"},IR=qe({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(b(),I("span",NR,[(b(!0),I(Be,null,nt(e.keys,s=>(b(),I("kbd",{key:s,class:"ui-kbd__key"},B(s),1))),128))]))}}),tr=ut(IR,[["__scopeId","data-v-32292ed8"]]),$R={class:"ch"},LR={class:"ch-brand"},FR={class:"ch-name"},OR={key:0,class:"ch-endpoint"},RR={class:"btn-wrap"},BR={class:"search-input"},DR={key:0,class:"empty"},PR={class:"side-section-label"},HR={class:"side-section-title"},WR={class:"side-section-actions"},zR=["onDragover","onDrop"],UR={class:"side-footer"},jR={class:"section-menu-check"},qR={class:"section-menu-check"},VR=1e3,KR=qe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},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","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=!1,i="",r=e,l=t,a=Q(!1),c=f()?["⌘","K"]:["Ctrl","K"];function u(){l("loadAllSessions"),a.value=!0}function d(Xe){(Xe.metaKey||Xe.ctrlKey)&&Xe.key.toLowerCase()==="k"&&(Xe.preventDefault(),u())}ln(()=>window.addEventListener("keydown",d)),es(()=>window.removeEventListener("keydown",d));function f(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Xe=navigator.userAgentData;return Xe?.platform==="macOS"||Xe?.platform==="iOS"}const p=Q(!1);function h(Xe){p.value=Xe.target.scrollTop>0}const m=Q(new Set(NN()));function _(Xe){return m.value.has(Xe)}function k(Xe){const Ze=new Set(m.value);Ze.has(Xe)?Ze.delete(Xe):Ze.add(Xe),m.value=Ze,M1(Ze)}function g(){const Xe=new Set(r.groups.map(Ze=>Ze.workspace.id));m.value=Xe,M1(Xe)}function v(){const Xe=new Set;m.value=Xe,M1(Xe)}const y=P(()=>r.groups.length>0&&r.groups.every(Xe=>m.value.has(Xe.workspace.id))),A=Q(new Set);function L(Xe){return A.value.has(Xe)}function $(Xe){const Ze=new Set(A.value);Ze.has(Xe)?Ze.delete(Xe):Ze.add(Xe),A.value=Ze}function x(Xe){if(!A.value.has(Xe)){const Ze=new Set(A.value);Ze.add(Xe),A.value=Ze}l("loadMoreSessions",Xe)}const E=Q(null),N=Q(null);function F(Xe){E.value=Xe}function S(){E.value=null,N.value=null}function T(Xe){const Ze=Xe.currentTarget.getBoundingClientRect();return Xe.clientY<Ze.top+Ze.height/2?"before":"after"}function R(Xe,Ze){E.value===null||E.value===Ze||(Xe.preventDefault(),Xe.dataTransfer&&(Xe.dataTransfer.dropEffect="move"),N.value={id:Ze,position:T(Xe)})}function O(Xe){const Ze=E.value,Mt=N.value?.id===Xe?N.value.position:"before";if(N.value=null,E.value=null,!Ze||Ze===Xe)return;const Dt=VN(r.groups.map(zt=>zt.workspace.id),Ze,Xe,Mt);l("reorderWorkspaces",Dt)}function D(Xe,Ze){Ze.target.closest(".gh-more, .gh-add")||k(Xe)}function W(Xe){l("select",Xe)}const z=Q(null),V=Q(""),U=Q(null);function re(){return U}function ae(Xe,Ze){z.value=Xe,V.value=Ze,pt().then(()=>U.value?.focus())}function te(){const Xe=z.value,Ze=V.value.trim();Xe&&Ze&&l("renameWorkspace",Xe,Ze),z.value=null}function Z(){z.value=null}function ne(Xe){V.value=Xe}const ke=Q(!1),Se=Q(null),Ye=Q({}),ve=Q(null);function Y(Xe){ve.value?.el&&!ve.value.el.contains(Xe.target)&&fe()}function ce(Xe,Ze){Ze.preventDefault(),Ze.stopPropagation(),Se.value=Xe,Ye.value={top:`${Ze.clientY}px`,left:`${Ze.clientX}px`},ke.value=!0,document.addEventListener("mousedown",Y,!0)}function fe(){ke.value=!1,document.removeEventListener("mousedown",Y,!0),Se.value=null}function j(){Se.value&&js(Se.value.root),fe()}function se(){Se.value&&ae(Se.value.id,Se.value.name),fe()}async function ge(){const Xe=Se.value;Xe&&(fe(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id))}const ue=Q(null),pe=Q(null),q=Q({}),J=Q(null);function he(Xe){const Ze=Xe.target;Ze.closest(".gh-more")||Ze.closest(".ws-menu")||Ie()}async function Te(Xe,Ze){if(ue.value===Xe.id){Ie();return}const Mt=Ze.currentTarget;pe.value=Xe,ue.value=Xe.id,document.addEventListener("mousedown",he),window.addEventListener("resize",Ie),await pt();const Dt=J.value?.el,zt=Mt.getBoundingClientRect(),wn=4,Rn=8,hs=Dt?.offsetHeight??0,ss=Dt?.offsetWidth??0;let sn=zt.bottom+wn;sn+hs>window.innerHeight-Rn&&(sn=Math.max(Rn,zt.top-hs-wn));let Lt=zt.right-ss;Lt<Rn&&(Lt=Rn),q.value={top:`${Math.round(sn)}px`,left:`${Math.round(Lt)}px`}}function Ie(){ue.value=null,pe.value=null,document.removeEventListener("mousedown",he),window.removeEventListener("resize",Ie)}function Oe(Xe){js(Xe.root),Ie()}function de(Xe){ae(Xe.id,Xe.name),Ie()}async function $e(Xe){Ie(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id)}const Qe=Q(!1),tt=Q({}),vt=Q(null);function wt(Xe){const Ze=Xe.target;Ze.closest(".side-section-kebab")||Ze.closest(".section-menu")||Rt()}async function xt(Xe){if(Qe.value){Rt();return}const Ze=Xe.currentTarget;Qe.value=!0,document.addEventListener("mousedown",wt),window.addEventListener("resize",Rt),await pt();const Mt=vt.value?.el,Dt=Ze.getBoundingClientRect(),zt=4,wn=8,Rn=Mt?.offsetHeight??0,hs=Mt?.offsetWidth??0;let ss=Dt.bottom+zt;ss+Rn>window.innerHeight-wn&&(ss=Math.max(wn,Dt.top-Rn-zt));let sn=Dt.right-hs;sn<wn&&(sn=wn),tt.value={top:`${Math.round(ss)}px`,left:`${Math.round(sn)}px`}}function Rt(){Qe.value=!1,document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Rt)}function yt(Xe){l("setWorkspaceSortMode",Xe),Rt()}es(()=>{document.removeEventListener("mousedown",Y,!0),document.removeEventListener("mousedown",he),document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Ie),window.removeEventListener("resize",Rt)});const nn=Q(null);let xn;function ns(){const Xe=nn.value;Xe&&(Xe.classList.remove("blink-now"),Xe.getBoundingClientRect(),Xe.classList.add("blink-now"),clearTimeout(xn),xn=setTimeout(()=>Xe.classList.remove("blink-now"),300))}const Wt=ki(()=>eo(()=>import("./DesignSystemView-DU67euCs.js"),__vite__mapDeps([0,1]))),_n=Q(!1);let gn,ot=!1;function ds(Xe){ot=!1,clearTimeout(gn),Xe.currentTarget.setPointerCapture?.(Xe.pointerId),gn=setTimeout(()=>{ot=!0,_n.value=!0},VR)}function ys(Xe){clearTimeout(gn);const Ze=Xe.currentTarget;Ze.hasPointerCapture?.(Xe.pointerId)&&Ze.releasePointerCapture(Xe.pointerId)}function fs(){if(ot){ot=!1;return}ns()}return es(()=>{clearTimeout(gn)}),(Xe,Ze)=>(b(),I("aside",{class:De(["side",{"macos-desktop":C(pc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:qt({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:qt({width:e.colWidth+"px"})},[w("div",$R,[w("div",LR,[C(pc)?le("",!0):(b(),I(Be,{key:0},[(b(),I("svg",{ref_key:"logoRef",ref:nn,class:De(["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:fs,onPointerdown:ds,onPointerup:ys,onPointercancel:ys},[...Ze[20]||(Ze[20]=[Hv('<defs data-v-c1a5226d><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-c1a5226d><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-c1a5226d></rect><g class="ch-eyes" fill="#000" data-v-c1a5226d><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-c1a5226d></rect>',2)])],34)),w("span",FR,[Ze[21]||(Ze[21]=Ge("Kimi Code",-1)),C(o)?(b(),I("span",OR," · "+B(C(i)),1)):le("",!0)])],64))]),C(pc)?le("",!0):(b(),ye(Nn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Ze[0]||(Ze[0]=bt(Mt=>l("collapse"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",RR,[w("button",{class:"btn-new-chat",type:"button",onClick:Ze[1]||(Ze[1]=bt(Mt=>l("create"),["stop"]))},[ie(Ve,{name:"chat-new"}),w("span",null,B(C(n)("sidebar.newChat")),1)]),le("",!0)]),w("div",{class:De(["search-wrap",{"search-wrap--scrolled":p.value}])},[w("button",{class:"search",type:"button",onClick:u},[ie(Ve,{class:"search-icon",name:"search"}),w("span",BR,B(C(n)("sidebar.search")),1),ie(tr,{keys:C(c)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:h},[e.groups.length===0?(b(),I("div",DR,B(C(n)("workspace.noWorkspace")),1)):(b(),I(Be,{key:1},[w("div",PR,[w("span",HR,B(C(n)("sidebar.workspaces")),1),w("div",WR,[ie(Nn,{class:"side-section-toggle",size:"sm",label:y.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Ze[3]||(Ze[3]=bt(Mt=>y.value?v():g(),["stop"]))},{default:Ee(()=>[y.value?(b(),ye(Ve,{key:0,name:"expand"})):(b(),ye(Ve,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Nn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Qe.value,onClick:Ze[4]||(Ze[4]=bt(Mt=>xt(Mt),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(b(!0),I(Be,null,nt(e.groups,Mt=>(b(),I("div",{key:Mt.workspace.id,class:De(["ws-drop-target",{"drop-before":N.value?.id===Mt.workspace.id&&N.value.position==="before","drop-after":N.value?.id===Mt.workspace.id&&N.value.position==="after"}]),onDragover:Dt=>R(Dt,Mt.workspace.id),onDrop:Dt=>O(Mt.workspace.id)},[ie(CR,{group:Mt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":z.value,"rename-value":V.value,"rename-input-ref":re(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ue.value,dragging:E.value===Mt.workspace.id,"is-collapsed":_,"is-expanded":L,onGroupClick:D,onGroupContextmenu:ce,onToggleWsMenu:Te,onCreateInWorkspace:Ze[5]||(Ze[5]=Dt=>l("createInWorkspace",Dt)),onSelectSession:W,onRenameSession:Ze[6]||(Ze[6]=(Dt,zt)=>l("rename",Dt,zt)),onArchiveSession:Ze[7]||(Ze[7]=Dt=>l("archive",Dt)),onForkSession:Ze[8]||(Ze[8]=Dt=>l("fork",Dt)),onLoadMore:x,onToggleExpand:$,onConfirmRename:te,onCancelRename:Z,onUpdateRenameValue:ne,onWsDragstart:F,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,zR))),128))],64))],32),w("div",UR,[w("button",{class:"btn-settings",type:"button",onClick:Ze[9]||(Ze[9]=bt(Mt=>l("openSettings"),["stop"]))},[ie(Ve,{name:"settings"}),w("span",null,B(C(n)("settings.title")),1)])])],4),ke.value?(b(),ye(Jl,{key:0,ref_key:"ghMenuRef",ref:ve,class:"gh-menu",style:qt(Ye.value),onClick:Ze[10]||(Ze[10]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:j},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1}),ie(Mn,{onClick:se},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1}),ie(Mn,{danger:"",onClick:ge},{default:Ee(()=>[Ge(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),ue.value!==null&&pe.value?(b(),ye(Jl,{key:1,ref_key:"wsMenuRef",ref:J,class:"ws-menu",style:qt(q.value),onClick:Ze[14]||(Ze[14]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:Ze[11]||(Ze[11]=Mt=>Oe(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1}),ie(Mn,{separator:""}),ie(Mn,{onClick:Ze[12]||(Ze[12]=Mt=>de(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1}),ie(Mn,{separator:""}),ie(Mn,{danger:"",onClick:Ze[13]||(Ze[13]=Mt=>$e(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),Qe.value?(b(),ye(Jl,{key:2,ref_key:"sectionMenuRef",ref:vt,class:"section-menu",style:qt(tt.value),onClick:Ze[17]||(Ze[17]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:Ze[15]||(Ze[15]=Mt=>yt("manual"))},{default:Ee(()=>[w("span",jR,[e.workspaceSortMode==="manual"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),Ge(" "+B(C(n)("sidebar.sortManual")),1)]),_:1}),ie(Mn,{onClick:Ze[16]||(Ze[16]=Mt=>yt("recent"))},{default:Ee(()=>[w("span",qR,[e.workspaceSortMode==="recent"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),Ge(" "+B(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):le("",!0),a.value?(b(),ye(YO,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:W,onClose:Ze[18]||(Ze[18]=Mt=>a.value=!1)},null,8,["sessions","active-id"])):le("",!0),(b(),ye(Ap,{to:"body"},[_n.value?(b(),ye(C(Wt),{key:0,onClose:Ze[19]||(Ze[19]=Mt=>_n.value=!1)})):le("",!0)]))],6))}}),GR=ut(KR,[["__scopeId","data-v-c1a5226d"]]);function YR(e){try{const t=Qn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function ZR(e,t){try{ts(e,String(t))}catch{}}function QR(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(YC(o),Math.max(s,Math.round(k))):n}const l=Q(r(YR(t)??n)),a=Q(!1);function c(k){const g=r(k);l.value=g,ZR(t,g)}let u=0,d=0,f=null,p=-1;function h(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(p)}catch{}f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,p=-1}}function _(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,p=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(p)}catch{}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return es(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const XR=["aria-label"],JR=qe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),{width:i,dragging:r,onPointerDown:l}=QR({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ke(i,a=>s("update:width",a)),Ke(r,a=>s("update:dragging",a)),(a,c)=>(b(),I("div",{class:De(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[w("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,XR))}}),Tx=ut(JR,[["__scopeId","data-v-ad762f1c"]]),eB=["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"],Nx=[[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 tB(e){if(e<=255)return eB[e];let t=0,n=Nx.length-1;for(;t<=n;){const s=t+n>>1,o=Nx[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function nB(e){const t=e.length;if(t===0)return null;const n=new Array(t);let s=!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 h=e.charCodeAt(c+1);h>=56320&&h<=57343&&(d=(u-55296<<10)+(h-56320)+65536,f=2)}const p=tB(d);(p==="R"||p==="AL"||p==="AN")&&(s=!0);for(let h=0;h<f;h++)n[c+h]=p;c+=f}if(!s)return null;let o=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){o=0;break}if(u==="R"||u==="AL"){o=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;const r=o&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,p=d!=="L"?"R":"L";if(p===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=p;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 sB(e,t){const n=nB(e);if(n===null)return null;const s=new Int8Array(t.length);for(let o=0;o<t.length;o++)s[o]=n[t[o]];return s}const oB=/[ \t\n\r\f]+/g,iB=/[\t\n\r\f]| {2,}|^ | $/;function rB(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function lB(e){if(!iB.test(e))return e;let t=e.replace(oB," ");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 aB(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
68
68
|
`).replace(/[\r\f]/g,`
|
|
69
69
|
`):e}let T1=null,cB;function uB(){return T1===null&&(T1=new Intl.Segmenter(cB,{granularity:"word"})),T1}const dB=/\p{Script=Arabic}/u,bl=/\p{M}/u,ey=/\p{Nd}/u;function Ix(e){return dB.test(e)}function $x(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 zi(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){const o=(n-55296<<10)+(s-56320)+65536;if($x(o))return!0;t++;continue}}if($x(n))return!0}}return!1}function fB(e){const t=wd(e);return t!==null&&(ty.has(t)||ra.has(t))}const hB=new Set([" "," ","","\uFEFF"]),pB=new Set(["-","‐","–","—"]);function mB(e){const t=wd(e);return t!==null&&hB.has(t)}function gB(e){const t=wd(e);return t!==null&&pB.has(t)}function B3(e,t){return mB(e)?!1:t?!(fB(e)||gB(e)):!0}const ty=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Fp=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),ny=new Set(["'","’"]),ra=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),vB=new Set([":",".","،","؛"]),yB=new Set(["၏"]),kB=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function bB(e){if(sy(e))return!0;let t=!1;for(const n of e){if(ra.has(n)||Rp(n)){t=!0;continue}if(!(t&&bl.test(n)))return!1}return t}function xB(e){for(const t of e)if(!ty.has(t)&&!ra.has(t))return!1;return e.length>0}function _B(e){if(sy(e))return!0;for(const t of e)if(!Fp.has(t)&&!ny.has(t)&&!bl.test(t)&&!Rp(t))return!1;return e.length>0}function sy(e){let t=!1;for(const n of e)if(!(n==="\\"||bl.test(n))){if(Fp.has(n)||ra.has(n)||ny.has(n)){t=!0;continue}return!1}return t}function Op(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function wd(e){if(e.length===0)return null;const t=Op(e,e.length);return e.slice(t)}function wB(e){for(const t of e)if(!bl.test(t))return t;return null}function SB(e){for(let t=e.length;t>0;){const n=Op(e,t),s=e.slice(n,t);if(!bl.test(s))return s;t=n}return null}const CB=[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 AB(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Rp(e){const t=e.codePointAt(0);return t!==void 0&&AB(t,CB)}function MB(e){const t=SB(e);return t!==null&&Rp(t)}function EB(e){const t=wB(e);return t!==null&&ey.test(t)}function TB(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(bl.test(s)){n--;continue}if(Fp.has(s)||ny.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function NB(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function Lx(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function Fx(e,t){return e&&t!==null&&vB.has(t)}function IB(e){const t=wd(e);return t!==null&&yB.has(t)}function $B(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 _g(e){let t=e.length;for(;t>0;){const n=Op(e,t),s=e.slice(n,t);if(kB.has(s))return!0;if(!ra.has(s))return!1;t=n}return!1}function LB(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
70
70
|
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const FB=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function wi(e){return e.length===1?e[0]:e.join("")}function OB(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),wi(n)}function RB(e,t,n,s){if(!FB.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=LB(u,s),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&o.push({text:wi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&o.push({text:wi(r),isWordLike:a,kind:i,start:l}),o}function wg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const BB=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function DB(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:BB.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function PB(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function HB(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let r=0;r<e.len;r++){if(s[r]!=="text"||!DB(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!wg(s[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(s[a]="text",t[a]="",a++,c)break}t[r]=wi(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],s[i]=s[r],o[i]=o[r]),i++)}return t.length=i,n.length=i,s.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:s,starts:o}}function WB(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i]),!PB(r))continue;const l=i+1;if(l>=e.len||wg(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!wg(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(wi(a)),n.push(!0),s.push("text"),o.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}const zB=new Set([":","-","/","×",",",".","+","–","—"]),UB=/[\p{P}\p{S}\p{Co}]/u,jB=/\p{Emoji_Presentation}/u,qB=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function VB(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function D3(e){const t=e.charCodeAt(0);return t<128?VB(t):!qB.has(e)&&!jB.test(e)&&UB.test(e)}function Ox(e){let t=!1;for(const n of e)if(!bl.test(n)){if(!D3(n))return!1;t=!0}return t}function KB(e){for(let t=e.length;t>0;){const n=Op(e,t),s=e.slice(n,t);if(bl.test(s)){t=n;continue}return D3(s)||Rp(s)}return!1}function GB(e,t,n,s){const o=!t&&Ox(e),i=!s&&Ox(n),r=MB(e),l=(t||r)&&KB(e);return!o&&!i&&!l||zi(e)||zi(n)?!1:(t||o||r)&&(s||i)}function P3(e){for(const t of e)if(ey.test(t))return!0;return!1}function Eh(e){if(e.length===0)return!1;for(const t of e)if(!(ey.test(t)||zB.has(t)))return!1;return!0}function YB(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Eh(r)&&P3(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Eh(e.texts[c]);)a.push(e.texts[c]),c++;t.push(wi(a)),n.push(!0),s.push("text"),o.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),s.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function ZB(e){const t=[],n=[],s=[],o=[];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"&&GB(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(wi(c)),n.push(d),s.push("text"),o.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),s.push(l),o.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function QB(e){const t=[],n=[],s=[],o=[];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||!P3(u)||!Eh(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),s.push("text"),o.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function XB(e){const t=[],n=[],s=[],o=[];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=wi(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),s.push("glue"),o.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=wi(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(wi(r)),n.push(l),s.push(a),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function JB(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(s[i]!=="text"||s[i+1]!=="text"||!zi(t[i])||!zi(t[i+1]))continue;const r=TB(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],o[i+1]=o[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function eD(e,t,n){const s=uB();let o=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],p=[],h=[],m=[],_=[];for(const L of s.segment(e))for(const $ of RB(L.segment,L.isWordLike??!1,L.index,n)){let D=function(){u[O]!==null&&(r[O]=[Lx(i,u,d,O)],u[O]=null),r[O].push($.text),l[O]=l[O]||$.isWordLike,f[O]=f[O]||N,p[O]=p[O]||F,h[O]=T,m[O]=R,_[O]=Fx(p[O],S)};const x=$.kind==="text",E=NB($.text,$.isWordLike,$.kind),N=zi($.text),F=Ix($.text),S=wd($.text),T=_g($.text),R=IB($.text),O=o-1;t.carryCJKAfterClosingQuote&&x&&o>0&&a[O]==="text"&&N&&f[O]&&h[O]||x&&o>0&&a[O]==="text"&&xB($.text)&&f[O]||x&&o>0&&a[O]==="text"&&m[O]?D():x&&o>0&&a[O]==="text"&&$.isWordLike&&F&&_[O]?(D(),l[O]=!0):E!==null&&o>0&&a[O]==="text"&&u[O]===E?d[O]=(d[O]??1)+1:x&&!$.isWordLike&&o>0&&a[O]==="text"&&!f[O]&&(bB($.text)||$.text==="-"&&l[O])?D():(i[o]=$.text,r[o]=[$.text],l[o]=$.isWordLike,a[o]=$.kind,c[o]=$.start,u[o]=E,d[o]=E===null?0:1,f[o]=N,p[o]=F,h[o]=T,m[o]=R,_[o]=Fx(F,S),o++)}for(let L=0;L<o;L++){if(u[L]!==null){i[L]=Lx(i,u,d,L);continue}i[L]=wi(r[L])}for(let L=1;L<o;L++)a[L]==="text"&&!l[L]&&sy(i[L])&&a[L-1]==="text"&&!f[L-1]&&(i[L-1]+=i[L],l[L-1]=l[L-1]||l[L],i[L]="");const k=Array.from({length:o},()=>null);let g=-1;for(let L=o-1;L>=0;L--){const $=i[L];if($.length!==0){if(a[L]==="text"&&!l[L]&&g>=0&&a[g]==="text"&&(_B($)||$==="-"&&EB(i[g]))){const x=k[g]??[];x.push($),k[g]=x,c[g]=c[L],i[L]="";continue}g=L}}for(let L=0;L<o;L++){const $=k[L];$!=null&&(i[L]=OB($,i[L]))}let v=0;for(let L=0;L<o;L++){const $=i[L];$.length!==0&&(v!==L&&(i[v]=$,l[v]=l[L],a[v]=a[L],c[v]=c[L]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const y=XB({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),A=JB(ZB(QB(YB(WB(HB(y))))));for(let L=0;L<A.len-1;L++){const $=$B(A.texts[L]);$!==null&&(A.kinds[L]!=="space"&&A.kinds[L]!=="preserved-space"||A.kinds[L+1]!=="text"||!Ix(A.texts[L+1])||(A.texts[L]=$.space,A.isWordLike[L]=!1,A.kinds[L]=A.kinds[L]==="preserved-space"?"preserved-space":"space",A.texts[L+1]=$.marks+A.texts[L+1],A.starts[L+1]=A.starts[L]+$.space.length))}return A}function tD(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function nD(e,t,n){if(t.len<=1)return t;const s=[],o=[],i=[],r=[];let l=-1,a=!1;function c(f){s.push(t.texts[f]),o.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,p){let h=!1;for(let k=f;k<p;k++)h=h||t.isWordLike[k];const m=t.starts[f],_=p<t.len?t.starts[p]:e.length;s.push(e.slice(m,_)),o.push(h),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let p=l;p<f;p++)c(p);l=-1,a=!1}}for(let f=0;f<t.len;f++){const p=t.texts[f],h=t.kinds[f];if(h==="text"){l>=0&&!B3(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||zi(p);continue}d(f),s.push(p),o.push(t.isWordLike[f]),i.push(h),r.push(t.starts[f])}return d(t.len),{len:s.length,texts:s,isWordLike:o,kinds:i,starts:r}}function sD(e,t,n="normal",s="normal"){const o=rB(n),i=o.mode==="pre-wrap"?aB(e):lB(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=eD(i,t,o),l=s==="keep-all"?nD(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:tD(l,o),...l}}let Ra=null;const Rx=new Map;let Ba=null;const oD=96,iD=/\p{Emoji_Presentation}/u,rD=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let N1=null;const Bx=new Map;function oy(){if(Ra!==null)return Ra;if(typeof OffscreenCanvas<"u")return Ra=new OffscreenCanvas(1,1).getContext("2d"),Ra;if(typeof document<"u")return Ra=document.createElement("canvas").getContext("2d"),Ra;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function lD(e){let t=Rx.get(e);return t||(t=new Map,Rx.set(e,t)),t}function Xr(e,t){let n=t.get(e);return n===void 0&&(n={width:oy().measureText(e).width,containsCJK:zi(e)},t.set(e,n)),n}function Bp(){if(Ba!==null)return Ba;if(typeof navigator>"u")return Ba={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ba;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/"),s=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Ba={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Ba}function aD(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function H3(){return N1===null&&(N1=new Intl.Segmenter(void 0,{granularity:"grapheme"})),N1}function cD(e){return iD.test(e)||e.includes("️")}function uD(e){return rD.test(e)}function dD(e,t){let n=Bx.get(e);if(n!==void 0)return n;const s=oy();s.font=e;const o=s.measureText("😀").width;if(n=0,o>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),o-r>.5&&(n=o-r)}return Bx.set(e,n),n}function fD(e){let t=0;const n=H3();for(const s of n.segment(e))cD(s.segment)&&t++;return t}function hD(e,t){return t.emojiCount===void 0&&(t.emojiCount=fD(e)),t.emojiCount}function Kl(e,t,n){return n===0?t.width:t.width-hD(e,t)*n}function pD(e,t,n,s,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const i=H3(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const u=[];for(const d of r){const f=Xr(d,n);u.push(Kl(d,f,s))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(o==="pair-context"||r.length>oD){const u=[];let d=null,f=0;for(const p of r){const h=Xr(p,n),m=Kl(p,h,s);if(d===null)u.push(m);else{const _=d+p,k=Xr(_,n);u.push(Kl(_,k,s)-f)}d=p,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=Xr(a,n),f=Kl(a,d,s);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function mD(e,t){const n=oy();n.font=e;const s=lD(e),o=aD(e),i=t?dD(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function gD(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function W3(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function z3(e,t,n=e.widths.length){for(;t<n;){const s=e.kinds[t];if(!gD(s))break;t++}return t}function vD(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function yD(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function iy(e,t){return t===0?0:e+t}function kD(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function bD(e,t,n,s,o){const i=t==="tab"?o+kD(e,n):e.lineEndFitAdvances[n];return iy(s,i)}function Dx(e,t,n,s){const o=t==="tab"?0:e.lineEndFitAdvances[n];return iy(s,o)}function Px(e,t,n,s,o){const i=t==="tab"?o:e.lineEndPaintAdvances[n];return iy(s,i)}function xD(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function _D(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Th(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function wD(e,t,n,s,o){if(e.letterSpacing===0)return 0;if(o>0)return e.spacingGraphemeCounts[s]>0?e.letterSpacing:0;for(let i=s-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===s-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function SD(e,t,n,s,o,i){return t+wD(e,n,s,o,i)}function CD(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(s.length===0)return 0;const a=Bp().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,p=0,h=0,m=0,_=0,k=-1,g=0;function v(){k=-1,g=0}function y(N=m,F=_,S=d){u++,n?.(S,p,h,N,F),d=0,f=!1,v()}function A(N,F){f=!0,p=N,h=0,m=N+1,_=0,d=F}function L(N,F,S){f=!0,p=N,h=F,m=N,_=F+1,d=S}function $(N,F){if(!f){A(N,F);return}d+=F,m=N+1,_=0}function x(N,F){const S=i[N],T=r[N]??null;let R=T===null?-1:Th(T,0,F+1),O=-1,D=0,W=F;for(;W<S.length;){const z=S[W];if(!f)L(N,W,z);else if(d+z>c){if(T!==null&&O>F){y(N,O,D),W=O,R=Th(T,R,W+1),O=-1,D=0;continue}y(),L(N,W,z)}else d+=z,m=N,_=W+1;const V=W+1;T!==null&&T[R]===V&&(O=V,D=d,R++),W++}f&&m===N&&_===S.length&&(m=N+1,_=0)}let E=0;for(;E<s.length&&!(!f&&(E=z3(e,E),E>=s.length));){const N=s[E],F=o[E],S=W3(F);if(!f){N>c&&i[E]!==null?x(E,0):A(E,N),S&&(k=E+1,g=d-N),E++;continue}if(d+N>c){if(S){$(E,N),y(E+1,0,d-N),E++;continue}if(k>=0){if(m>k||m===k&&_>0){y();continue}y(k,0,g);continue}if(N>c&&i[E]!==null){y(),x(E,0),E++;continue}y();continue}$(E,N),S&&(k=E+1,g=d-N),E++}return f&&y(),u}function AD(e,t,n){if(e.simpleLineWalkFastPath)return CD(e,t,n);const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(s.length===0||a.length===0)return 0;const c=Bp(),u=c.lineFitEpsilon,d=t+u;let f=0,p=0,h=!1,m=0,_=0,k=0,g=0,v=-1,y=0,A=0,L=null;function $(){v=-1,y=0,A=0,L=null}function x(){return L==="soft-hyphen"&&v===k&&g===0?A:p}function E(D=k,W=g,z){f++,n!==void 0&&n(SD(e,z??x(),m,_,D,W),m,_,D,W),p=0,h=!1,$()}function N(D,W){h=!0,m=D,_=0,k=D+1,g=0,p=W}function F(D,W,z){h=!0,m=D,_=W,k=D,g=W+1,p=z}function S(D,W){if(!h){N(D,W);return}p+=W,k=D+1,g=0}function T(D,W,z,V,U,re){if(!W)return;const ae=Dx(e,D,z,U),te=Px(e,D,z,U,V);v=z+1,y=p-re+ae,A=p-re+te,L=D}function R(D,W){const z=i[D],V=r[D]??null;let U=V===null?-1:Th(V,0,W+1),re=-1,ae=0,te=W;for(;te<z.length;){const Z=z[te];if(!h)F(D,te,Z);else{const ke=xD(e,!0,Z),Se=p+ke;if(_D(e,Se)>d){if(V!==null&&re>W){E(D,re,ae),te=re,U=Th(V,U,te+1),re=-1,ae=0;continue}E(),F(D,te,Z)}else p=Se,k=D,g=te+1}const ne=te+1;V!==null&&V[U]===ne&&(re=ne,ae=p,U++),te++}h&&k===D&&g===z.length&&(k=D+1,g=0)}function O(D){f++,n?.(0,D.startSegmentIndex,0,D.consumedEndSegmentIndex,0),$()}for(let D=0;D<a.length;D++){const W=a[D];if(W.startSegmentIndex===W.endSegmentIndex){O(W);continue}h=!1,p=0,m=W.startSegmentIndex,_=0,k=W.startSegmentIndex,g=0,$();let z=W.startSegmentIndex;for(;z<W.endSegmentIndex&&!(!h&&(z=z3(e,z,W.endSegmentIndex),z>=W.endSegmentIndex));){const V=o[z],U=W3(V),re=yD(e,h,z),ae=V==="tab"?vD(p+re,e.tabStopAdvance):s[z],te=re+ae,Z=bD(e,V,z,re,ae);if(V==="soft-hyphen"){h&&(k=z+1,g=0,v=z+1,y=p+l,A=p+l,L=V),z++;continue}if(!h){Z>d&&i[z]!==null?R(z,0):N(z,ae),T(V,U,z,ae,re,te),z++;continue}if(p+Z>d){const ke=p+Dx(e,V,z,re),Se=p+Px(e,V,z,re,ae);if(L==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&y<=d){E(v,0,A);continue}if(U&&ke<=d){S(z,te),E(z+1,0,Se),z++;continue}if(v>=0&&y<=d){if(k>v||k===v&&g>0){E();continue}const Ye=v;E(Ye,0,A),z=Ye;continue}if(Z>d&&i[z]!==null){E(),R(z,0),z++;continue}E();continue}S(z,te),T(V,U,z,ae,re,te),z++}if(h){const V=v===W.consumedEndSegmentIndex?A:p;E(W.consumedEndSegmentIndex,0,V)}}return f}let I1=null;function ry(){return I1===null&&(I1=new Intl.Segmenter(void 0,{granularity:"grapheme"})),I1}function MD(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function ED(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,p){s=[d],o=f,i=p,r=_g(d),l=Fp.has(d)}function u(d,f){s.push(d),i=i||f;const p=_g(d);d.length===1&&ra.has(d)?r=r||p:r=p,l=!1}for(const d of ry().segment(e)){const f=d.segment,p=zi(f);if(s.length===0){c(f,d.index,p);continue}if(l||ty.has(f)||ra.has(f)||t.carryCJKAfterClosingQuote&&p&&r){u(f,p);continue}if(!i&&!p){u(f,p);continue}a(),c(f,d.index,p)}return a(),n}function TD(e,t,n){if(t.length<=1)return t;const s=[];let o=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;s.push({text:e.slice(u,d),start:u})}function l(a){if(!(o<0)){if(i)o+1===a?s.push(t[o]):r(o,a);else for(let c=o;c<a;c++)s.push(t[c]);o=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];o>=0&&!B3(t[a-1].text,n)&&l(a),o<0&&(o=a),i=i||zi(c.text)}return l(t.length),s}function Hx(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const s=ry();for(const o of s.segment(e))n++;return n}function ND(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function ID(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const s of ry().segment(e))n++,ND(s.segment)&&t.push(n);return t.length===0?null:t}function $D(e,t,n){return t>1?e+(t-1)*n:e}function LD(e,t,n,s,o){const i=Bp(),{cache:r,emojiCorrection:l}=mD(t,uD(e.normalized)),a=Kl("-",Xr("-",r),l)+(o===0?0:o*2),u=Kl(" ",Xr(" ",r),l)*8,d=o!==0;if(e.len===0)return MD();const f=[],p=[],h=[],m=[];let _=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],y=[],A=n?[]:null,L=Array.from({length:e.len});function $(F,S,T,R,O,D,W,z,V){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(_=!1),f.push(S),p.push(T),h.push(R),m.push(O),k?.push(D),g.push(W),v.push(z),d&&y.push(V),A!==null&&A.push(F)}function x(F,S,T,R,O){const D=Xr(F,r),W=d?Hx(F,S):0,z=$D(Kl(F,D,l),W,o),V=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:z,U=V===0?0:V+(W>0?o:0),re=S==="space"||S==="zero-width-break"?0:z;if(O&&R&&F.length>1){let ae="sum-graphemes";o!==0?ae="segment-prefixes":Eh(F)?ae="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ae="segment-prefixes");const te=pD(F,D,r,l,ae),Z=te===null||s==="keep-all"?null:ID(F);$(F,z,U,re,S,T,te,Z,W);return}$(F,z,U,re,S,T,null,null,W)}for(let F=0;F<e.len;F++){L[F]=f.length;const S=e.texts[F],T=e.isWordLike[F],R=e.kinds[F],O=e.starts[F];if(R==="soft-hyphen"){$(S,0,a,a,R,O,null,null,0);continue}if(R==="hard-break"){$(S,0,0,0,R,O,null,null,0);continue}if(R==="tab"){$(S,0,0,0,R,O,null,null,d?Hx(S,R):0);continue}const D=Xr(S,r);if(R==="text"&&D.containsCJK){const W=ED(S,i),z=s==="keep-all"?TD(S,W,i.breakKeepAllAfterPunctuation):W;for(let V=0;V<z.length;V++){const U=z[V];x(U.text,"text",O+U.start,T,s==="keep-all"||!zi(U.text))}continue}x(S,R,O,T,!0)}const E=FD(e.chunks,L,f.length),N=k===null?null:sB(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:_,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E,segments:A}:{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:_,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E}}function FD(e,t,n){const s=[];for(let o=0;o<e.length;o++){const i=e[o],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;s.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return s}function OD(e,t,n,s){const o=s?.wordBreak??"normal",i=s?.letterSpacing??0,r=sD(e,Bp(),s?.whiteSpace,o);return LD(r,t,n,o,i)}function U3(e,t,n){return OD(e,t,!0,n)}function j3(e){let t=0;return AD(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const RD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},BD={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",internalBuildBanner:"Internal testing only"},DD={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",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load {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"},PD={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},HD={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"}},WD={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",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"},zD={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)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},UD={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"},jD={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"},qD={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},VD={justNow:"just now"},KD={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"},GD={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"},ZD={panelTitle:"Thinking",close:"Close"},QD={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={},JD={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"}},eP={searching:"Searching…",noMatch:"No matches"},tP={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},nP={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},sP={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)"}},oP={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},iP={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"},rP={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},lP={preview:"预览",confirm:"确认",cancel:"取消"},aP={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},cP={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:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},uP={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},dP={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:"收起"}},fP={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:"取消",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:"进行中"},hP={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · 思考: {level}"},pP={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 后重试"},mP={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 关闭"},gP={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},vP={justNow:"刚刚"},yP={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:"拒绝并退出"},kP={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},bP={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:"展开"},xP={panelTitle:"思考过程",close:"关闭"},_P={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},wP={},SP={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:"无法读取这个文件"}},CP={searching:"搜索中…",noMatch:"无匹配"},AP={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},MP={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},EP={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} 个)"}},TP={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},NP={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},IP={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},$P={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"},LP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},FP={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",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…"},OP={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:"服务端版本",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:"正在加载全部归档会话…"},RP={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"},BP={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:"归档"},DP={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"},PP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},HP={en:{common:RD,app:BD,sidebar:DD,workspace:PD,conversation:HD,status:WD,composer:zD,login:UD,providers:jD,model:qD,sessions:VD,approval:KD,question:GD,tasks:YD,thinking:ZD,diff:QD,fileTree:XD,filePreview:JD,mention:eP,warnings:tP,commands:nP,tools:sP,layout:oP,mobile:iP,theme:rP,onboarding:$P,settings:FP,header:RP,sideChat:DP},zh:{common:lP,app:aP,sidebar:cP,workspace:uP,conversation:dP,status:fP,composer:hP,login:pP,providers:mP,model:gP,sessions:vP,approval:yP,question:kP,tasks:bP,thinking:xP,diff:_P,fileTree:wP,filePreview:SP,mention:CP,warnings:AP,commands:MP,tools:EP,layout:TP,mobile:NP,theme:IP,onboarding:LP,settings:OP,header:BP,sideChat:PP}},q3=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function WP(){const e=Qn($t.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const yn=yN({legacy:!1,locale:WP(),fallbackLocale:"en",messages:HP});function V3(e){yn.global.locale.value=e,ts($t.locale,e)}const Ws=yn.global.t,zP={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"},UP={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 ha(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return UP[t]??t}function pa(e){const t=zP[ha(e)];return t?Ws(t):e}const jP={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 Dp(e){const t=ha(e);let n=jP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Ga(n,"sm")}const K3=80;function qP(e,t=K3){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function VP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function KP(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 Kt(e){return typeof e=="string"&&e.length>0?e:void 0}function qr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function GP(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 $1(e){return Kt(e.path)??Kt(e.file_path)??Kt(e.filePath)??Kt(e.filename)}const YP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function ZP(e){const t=Kt(e);if(!t)return;const n=YP[t];return n?Ws(n):t}function QP(e){const t=qr(e.value),n=Kt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return Ws("tools.goal.turns",{value:t});case"tokens":return Ws("tools.goal.tokens",{value:t});case"milliseconds":return Ws("tools.goal.milliseconds",{value:t});case"seconds":return Ws("tools.goal.seconds",{value:t});case"minutes":return Ws("tools.goal.minutes",{value:t});case"hours":return Ws("tools.goal.hours",{value:t});default:return Ws("tools.goal.budget",{value:t,unit:n})}}const XP=64;function nd(e,t,n=!1){const s=(o,i=K3)=>n?o.trim():qP(o,i);try{const o=KP(t);if(!n&&VP(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(ha(e)){case"read":{const r=$1(o);if(!r)return i();const l=qr(o.offset)??qr(o.line_start)??qr(o.start_line),a=qr(o.limit)??qr(o.length),c=qr(o.line_end)??qr(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=$1(o);return r?s(`${r} ${Ws("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=$1(o);return r?s(r):i()}case"bash":{const r=Kt(o.command)??Kt(o.cmd)??Kt(o.script);return r?s(r,XP):i()}case"grep":case"search":{const r=Kt(o.pattern)??Kt(o.query)??Kt(o.regex),l=Kt(o.path)??Kt(o.glob)??Kt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Kt(o.pattern)??Kt(o.glob)??Kt(o.query),l=Kt(o.path)??Kt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Kt(o.path)?s(Kt(o.path)):i()}case"ls":{const r=Kt(o.path)??Kt(o.dir)??Kt(o.directory)??Kt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Kt(o.url)??Kt(o.uri);return r?s(GP(r)):i()}case"todo":case"task":{const r=Kt(o.description)??Kt(o.title)??Kt(o.prompt)??Kt(o.name)??Kt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(Ws("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Kt(o.objective),l=Kt(o.completionCriterion);return r&&l?s(Ws("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?s(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=QP(o);return r?s(r):i()}case"updategoal":{if(n)return i();const r=ZP(o.status);return r?s(Ws("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function JP(e){try{switch(ha(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Ws("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return Ws("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Ws("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const eH=qe({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){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 s=P(()=>n(t.status));return(o,i)=>(b(),I("span",{class:De(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),sd=ut(eH,[["__scopeId","data-v-e36198e5"]]),tH=["innerHTML"],nH={class:"bh-text"},sH={class:"a"},oH={key:0,class:"p"},iH={class:"rt"},rH=["aria-label"],lH={key:0,class:"tm"},aH=["inert"],cH={class:"bb-pad"},uH=qe({__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,s=Ut("pinScroll",()=>{}),o=Q(null);function i(){n("toggle");const r=o.value;r&&pt(()=>s(r))}return(r,l)=>(b(),I("div",{class:De(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[w("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(b(),I("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,tH)):le("",!0),w("span",nH,[w("span",sH,B(e.name),1),ie(jt,{text:e.arg},{default:Ee(()=>[e.arg?(b(),I("span",oH,B(e.arg),1)):le("",!0)]),_:1},8,["text"])]),w("span",iH,[w("span",{class:De(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):e.status==="error"?(b(),ye(Ve,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(b(),ye(sd,{key:2,status:"suspended"})):(b(),ye(sd,{key:3,status:"running"}))],10,rH),In(r.$slots,"trailing"),e.time?(b(),I("span",lH,B(e.time),1)):le("",!0)]),e.expandable?(b(),ye(Ve,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):le("",!0)],512),w("div",{class:De(["bb",{open:e.open}]),inert:!e.open},[w("div",cH,[In(r.$slots,"default")])],10,aH)],2))}}),Pp=ut(uH,[["__scopeId","data-v-fef8aad2"]]),dH={key:0,class:"at-type"},fH={key:1,class:"at-task"},hH={key:2,class:"bb-code"},pH=qe({__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(),s=e,o=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=P(()=>i(s.tool.arg)),l=P(()=>!!s.tool.output&&s.tool.output.length>0),a=P(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Q(s.tool.defaultExpanded===!0&&a.value),u=P(()=>s.tool.status),d=P(()=>pa(s.tool.name)),f=P(()=>Dp(s.tool.name)),p=P(()=>r.value.description||r.value.subagentType||""),h=Ut("resolveAgentTaskId"),m=P(()=>h?h(s.tool.id)!==void 0:!0);function _(){a.value&&(c.value=!c.value)}return Ke(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(b(),ye(Pp,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":p.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:_},{trailing:Ee(()=>[m.value?(b(),I("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=bt(v=>o("openAgent",e.tool.id),["stop"]))},B(C(n)("tasks.openDetail")),1)):le("",!0)]),default:Ee(()=>[r.value.subagentType?(b(),I("div",dH,B(r.value.subagentType),1)):le("",!0),r.value.prompt?(b(),I("div",fH,B(r.value.prompt),1)):le("",!0),l.value?(b(),I("div",hH,[(b(!0),I(Be,null,nt(e.tool.output??[],(v,y)=>(b(),I("div",{key:y},B(v),1))),128))])):le("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),mH=ut(pH,[["__scopeId","data-v-14ef8750"]]);function gH(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const s=[];for(const o of n){if(!o||typeof o!="object")continue;const i=o,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:""}}):[];s.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return s}catch{return[]}}const vf={recognized:!1,answers:{},note:""};function vH(e){const t=e?.[0];if(!t)return vf;let n;try{n=JSON.parse(t)}catch{return vf}if(!n||typeof n!="object"||Array.isArray(n))return vf;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return vf;const o={};for(const[i,r]of Object.entries(s))typeof r=="string"?o[i]=r:r===!0&&(o[i]=!0);return{recognized:!0,answers:o,note:typeof n.note=="string"?n.note:""}}function yH(e,t,n){return e[t]??e[`q_${n}`]}const kH=/^opt_\d+_(\d+)$/;function bH(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 s=n.get(e);if(s!==void 0)return{selected:new Set([s]),otherText:"",indeterminate:!1};const o=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){o.add(a);continue}const c=kH.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const xH={key:0,class:"chip"},_H={key:0,class:"au-dismissed"},wH={key:1,class:"au-list"},SH={class:"au-q"},CH={key:0,class:"au-hdr"},AH={class:"au-qtext"},MH={class:"au-opts"},EH={class:"au-glyph"},TH={class:"au-label"},NH={key:0,class:"au-desc"},IH={key:0,class:"au-opt sel"},$H={class:"au-glyph"},LH={class:"au-label"},FH={key:1,class:"au-opt sel"},OH={class:"au-label"},RH={key:2,class:"au-raw"},BH=80,DH=qe({__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 s($,x=BH){const E=$.trim();return E.length>x?E.slice(0,x-1)+"…":E}const o=P(()=>gH(t.tool.arg)),i=P(()=>vH(t.tool.output)),r=P(()=>i.value.recognized),l=P(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=P(()=>o.value.map(($,x)=>bH(yH(i.value.answers,$.question,x),$.options))),c=P(()=>Object.keys(i.value.answers).length);function u($,x){return a.value[$]?.selected.has(x)??!1}function d($){return a.value[$]?.otherText??""}function f($){return a.value[$]?.indeterminate??!1}function p($,x){return $?x?"■":"□":x?"●":"○"}const h=P(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const $=o.value[0]?.question??"",x=s($);return o.value.length<=1?x:`${x} ${n("tools.ask.more",{count:o.value.length-1})}`}),m=P(()=>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}):""),_=P(()=>!!t.tool.output&&t.tool.output.length>0),k=P(()=>r.value&&(o.value.length>0||l.value)||_.value),g=Q(t.tool.defaultExpanded===!0&&k.value),v=P(()=>t.tool.status),y=P(()=>pa(t.tool.name)),A=P(()=>Dp(t.tool.name));function L(){k.value&&(g.value=!g.value)}return Ke(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),($,x)=>(b(),ye(Pp,{status:v.value,icon:A.value,name:y.value,arg:g.value?"":h.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:L},{trailing:Ee(()=>[m.value?(b(),I("span",xH,B(m.value),1)):le("",!0)]),default:Ee(()=>[l.value?(b(),I("div",_H,B(i.value.note),1)):r.value?(b(),I("div",wH,[(b(!0),I(Be,null,nt(o.value,(E,N)=>(b(),I("div",{key:N,class:"au-block"},[w("div",SH,[E.header?(b(),I("span",CH,B(E.header),1)):le("",!0),w("span",AH,B(E.question),1)]),w("div",MH,[(b(!0),I(Be,null,nt(E.options,(F,S)=>(b(),I("div",{key:S,class:De(["au-opt",{sel:u(N,S)}])},[w("span",EH,B(p(E.multiSelect,u(N,S))),1),w("span",TH,B(F.label),1),F.description?(b(),I("span",NH,B(F.description),1)):le("",!0)],2))),128)),d(N)?(b(),I("div",IH,[w("span",$H,B(p(E.multiSelect,!0)),1),w("span",LH,B(d(N)),1)])):le("",!0),f(N)?(b(),I("div",FH,[x[0]||(x[0]=w("span",{class:"au-glyph"},"●",-1)),w("span",OH,B(C(n)("tools.ask.answered")),1)])):le("",!0)])]))),128))])):(b(),I("div",RH,[(b(!0),I(Be,null,nt(e.tool.output??[],(E,N)=>(b(),I("div",{key:N},B(E),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),PH=ut(DH,[["__scopeId","data-v-a9a0f259"]]),HH=1e6,Wx=5e3;function zx(e){if(e==="")return[];const t=e.split(`
|
|
@@ -265,23 +265,23 @@ ${v}`);u+=$}else u+=L;u+=k,d=p?f+1:e.length}return u}function gQ(e,t){if(!e||!t.
|
|
|
265
265
|
`)?`
|
|
266
266
|
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
267
267
|
`))),n.customHtmlTags?.length&&r.includes("<")){const _=Fc(n.customHtmlTags);if(_.length&&(r=hQ(r,_),r=pQ(r,_),r=gQ(r,_),r=mQ(r,_),r.includes("</")))for(const k of _){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${k}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=fQ(r));const l=ZZ(r);if(l){const _=n.preTransformTokens,k=n.postTransformTokens;if(H6(t,n)||typeof _=="function"||typeof k=="function"){const g=Mw(t,r,{__markstreamFinal:i},n),v=typeof _=="function"&&_(g)||g;typeof k=="function"&&k(v)}return t0(l,s,o)}const a=Mw(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return t0([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,p=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),h={...n,validateLink:p,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=Sw(d,h,s);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const k=_[0],g=k?.type;k&&typeof g=="string"?m=Sw(_,void 0,s):m=_}}if(m=dQ(m,i,r),m=z6(m,r,t,n,i)[0],m=lQ(m,t,n,i),i){const _=new WeakSet,k=g=>{if(!g||typeof g!="object"||_.has(g))return;if(_.add(g),Array.isArray(g)){for(const y of g)k(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))k(y)};k(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),t0(m,s,o)}function $w(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=xl(t);let o=0;for(;o<e.length;){const i=Ny(e,o,s.options(),Ty);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=$Z(e,o,s.options(l)),c=Tw(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=Oc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=Rc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(IZ()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=jn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=Tw(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const vQ=new Set([...Ad,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),yQ=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"]),Lw=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function Fw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kQ(e){return typeof e=="string"?e:e==null?"":String(e)}function j6(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Qr(e){return kQ(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function q6(e){return Qr(e).replace(/`/g,"`")}function Jp(e){return String(e??"").trim().toLowerCase()}function Fy(e,t="safe"){const n=Jp(e);return n?t==="escape"?!0:t==="trusted"?Ad.has(n):!yQ.has(n):!1}function V6(e,t="safe"){const n=Jp(e);return n?t==="escape"?!0:t==="trusted"?Ad.has(n):vQ.has(n):!1}function Ow(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${q6(s)}"`).join("")}function bQ(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||ea(o,{tagName:t,attrName:"srcset"})})}function K6(e,t,n,s){return sK.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?bQ(t,s):!!(oK.has(e)&&t&&ea(t,{tagName:s,attrName:e}))}function jl(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function G6(e,t,n,s=!1){if(t!=="safe"||Jp(n)!=="a")return e;const o=jl(e,"href");if(s&&(!o||!e[o])){const a=jl(e,"target"),c=jl(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=jl(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=jl(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 Rw(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!j6(r)||K6(l,i,t,n)||(s[r]=i)}return G6(s,t,n,!!jl(e,"href"))}function Y6(e,t){const n=e.toLowerCase();return t6.has(n)?!1:Fw(t,n)||Fw(t,e)}function Oy(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!j6(r)||K6(l,i,t,n)||(s[r]=i)}return G6(s,t,n,!!jl(e,"href"))}function Yh(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function Pg(e,t="safe",n){const s=Oy(Yh(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function xQ(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function _Q(e){const t={};for(const[n,s]of Object.entries(e))t[n]=xQ(s,n);return t}function Bw(e){return e.trim().length>0}function wQ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);Bw(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);Bw(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||ma.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function SQ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const f=e.indexOf("]]>",s);if(f!==-1){t.push({type:"text",content:e.slice(s,f+3)}),n=f+3;continue}break}if(e.startsWith("!",s+1)){const f=e.indexOf(">",s);if(f!==-1){n=f+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||ma.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function CQ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Qr(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${Qr(s)}`:` ${Qr(s)}="${q6(o)}"`).join("");return e.type==="self_closing"?`<${Qr(t)}${n} />`:`<${Qr(t)}${n}>`}function AQ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;Lw.lastIndex=0;let n;for(;(n=Lw.exec(e))!==null;)if(Y6(n[1],t))return!0;return!1}function yc(e,t="safe"){if(!e)return"";if(t==="escape")return Qr(e);const n=SQ(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(Qr(r.content??""));continue}const l=Jp(r.tagName);if(!l)continue;if(V6(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"&&Fy(l,t)){o.push(CQ(r));continue}if(r.type==="self_closing"){o.push(`<${l}${Ow(Rw(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${Ow(Rw(r.attrs??{},t,l))}>`),ma.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const MQ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],Dw="http://www.w3.org/2000/svg",EQ=new Set(["script","style","iframe","object","embed","link","meta"]),TQ=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"]),NQ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),IQ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),$Q=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function LQ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function FQ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function OQ(e){const t=e.nodeName.toLowerCase();return t==="use"?LQ(e):t==="image"?FQ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():$Q.has(t)}function RQ(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 BQ(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?ea(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ea(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ea(i,{tagName:s,attrName:o})?"":i:""}function DQ(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function Z6(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function Q6(e){const t=Z6(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=DQ(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function Pw(e){const t=Z6(e);return MQ.some(n=>n.test(t))||Q6(t)}function PQ(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 Ef(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function X6(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!EQ.has(s)){if(s==="br"){t.push(`
|
|
268
|
-
`);return}for(const o of Array.from(n.childNodes))X6(o,t)}}function HQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];X6(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Ef(t.getAttribute("width")),i=Ef(t.getAttribute("height")),r=Ef(t.getAttribute("x")),l=Ef(t.getAttribute("y")),a=e.ownerDocument.createElementNS(Dw,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,f]of s.entries()){const p=e.ownerDocument.createElementNS(Dw,"tspan");p.setAttribute("x",String(r+o/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=f,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function WQ(e){HQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!TQ.has(s)){n.remove();continue}if(s==="style"&&Pw(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&Pw(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(NQ.has(r)&&i.value){const l=BQ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(IQ.has(r)&&i.value&&Q6(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=RQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}PQ(n)}}function
|
|
268
|
+
`);return}for(const o of Array.from(n.childNodes))X6(o,t)}}function HQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];X6(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Ef(t.getAttribute("width")),i=Ef(t.getAttribute("height")),r=Ef(t.getAttribute("x")),l=Ef(t.getAttribute("y")),a=e.ownerDocument.createElementNS(Dw,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,f]of s.entries()){const p=e.ownerDocument.createElementNS(Dw,"tspan");p.setAttribute("x",String(r+o/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=f,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function WQ(e){HQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!TQ.has(s)){n.remove();continue}if(s==="style"&&Pw(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&Pw(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(NQ.has(r)&&i.value){const l=BQ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(IQ.has(r)&&i.value&&Q6(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=RQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}PQ(n)}}function Gbe(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 WQ(n),zQ(n)?null:n}catch{return null}}function zQ(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){OQ(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const Hw=[];function s0(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function UQ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function jQ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function Ww(e=`editor-${Date.now()}`,t={}){const n=lY(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;o=p=>f[p]??s[p]??p}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const p=f;if(Array.isArray(p)){const[h,...m]=p;typeof h=="function"&&n.use(h,...m)}else typeof p=="function"&&n.use(p)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(p){console.error("[getMarkdown] apply function threw an error",p)}if(Hw.length)for(const f of Hw)if(Array.isArray(f)){const[p,...h]=f;typeof p=="function"&&n.use(p,...h)}else typeof f=="function"&&n.use(f);n.use(Cz),n.use(Ez),n.use(_z);const i=zz,r=i.default??i;n.use(r),n.use(xz),n.use(bz),n.core.ruler.after("block","mark_fence_closed",f=>{const p=f,h=p.src,m=!!p.env?.__markstreamFinal,_=h.split(/\r?\n/);for(const k of p.tokens){if(k.type!=="fence"||!k.map||!k.markup)continue;const g=k.map[0],v=k.map[1],y=k.markup,A=y[0],L=y.length,$=_[Math.max(0,v-1)]??"";let x=0;for(;x<$.length&&($[x]===" "||$[x]===" ");)x++;let E=0;for(;x+E<$.length&&$[x+E]===A;)E++;let N=x+E;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;const F=m?!0:v>g+1&&E>=L&&N===$.length,S=k;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,p)=>{const h=f,m=h.pos;if(h.src[m]!=="~")return!1;const _=h.src[m-1],k=h.src[m+1];if(/\d/.test(_)&&/\d/.test(k)){if(!p){const g=h.push("text","",0);g.content="~"}return h.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,p)=>{const h=f[p],m=String(h.info??"").trim(),_=String(h.content??""),k=btoa(unescape(encodeURIComponent(_))),g=UQ(m),v=s0(g),y=jQ(`editor-${e}-${p}-${g}`),A=s0(o("common.copy"));return`<div class="code-block" data-code="${k}" data-lang="${v}" id="${y}">
|
|
269
269
|
<div class="code-header">
|
|
270
270
|
<span class="code-lang">${s0(g.toUpperCase())}</span>
|
|
271
271
|
<button class="copy-button" data-code="${k}">${A}</button>
|
|
272
272
|
</div>
|
|
273
273
|
<div class="code-editor"></div>
|
|
274
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const p=c.exec(f);if(!p)return f!=="["&&!/^\[\d+$/.test(f);const h=String(p[1]??"");return f.slice(p[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},d=(f,p)=>{const h=f;if(h.src[h.pos]!=="[")return!1;const m=a.exec(h.src.slice(h.pos));if(!m)return!1;const _=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const k=h.src.slice(h.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))return!1;if(!p){const g=m[1],v=h.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return h.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,p)=>{const m=String(f[p].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function qQ({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 J6({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:qQ({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const zw=new WeakMap;function VQ(e){let t=zw.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},zw.set(e,t)),t}function Uw(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function Ry(e){return!!(e.themes?.length||e.langs?.length)}function e5(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function KQ(e,t){return!t?.length||e.registeredAllLangs?!0:e5(e.registeredLangs,t)}function o0(e,t){return Ry(t)&&e5(e.registeredThemes,t.themes)&&KQ(e,t.langs)}function GQ(e,t){if(!Ry(t))return t;const n=Uw(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:Uw(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const YQ={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 ZQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function t5(e){const t=ZQ(e);return YQ[t]??t}function n5(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>t5(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function s5(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function QQ(e){return s5(e)?.join("\0")??""}function o5(e,t){const n=s5(e),s=n5(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Zh(e,t){return`${QQ(e)}\0\0${n5(t)?.join("\0")??""}`}function Vbe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=o5(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Zh(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Kbe(e,t={},n){if(!e)return"ready";const s=o5(t.themes,t.langs),o=Zh(s.themes,s.langs),i=n&&n===o?n:o,r=VQ(e);if(r.completed.has(i))return"ready";if(o0(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||o0(r,s))return r.completed.add(i),"ready";const c=GQ(r,s),u=Zh(c.themes,c.langs);return r.completed.has(u)||o0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(Ry(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 Pa(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function jw(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var XQ=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,p=this.pendingChars<=0;if(this.source+=d,p){const h=qw();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=qw();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),p=Math.min(100,Math.max(0,d-this.lastTick));if(p<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const h=this.pendingChars,m=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=nX(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=tX(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Pa(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Pa(s,1e3,1)),this.normalizedTargetLatencyMs=Pa(o,900,1),this.normalizedCatchUpLatencyMs=Pa(i,350,1),this.normalizedCatchUpThreshold=jw(r,600),this.normalizedStartDelayMs=jw(a,80),this.maxCommitFps=Math.trunc(Pa(l,30,1)),this.maxCharsPerCommit=Math.trunc(Pa(c,80,1)),this.flushOnFinish=u,this.segmenter=eX(),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 JQ(e={},t){const n=new XQ(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 eX(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function tX(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function qw(){return typeof performance<"u"?performance.now():Date.now()}function nX(e,t,n){return Math.min(n,Math.max(t,e))}var sX=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Hg=Symbol.for("markstream-vue:node-lifecycle"),Vw='<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>',Kw='<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>',oX={id:"material",core:{"":Kw,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:Kw,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:Vw,csharp:Vw,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:()=>eo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Wg=new Map;let Gw="material";const sc=new Map,Yw=new Map;let zg=null;function iX(e){Wg.set(e.id,e)}function rX(e){return sX(this,null,function*(){var t,n,s;if(sc.has(e.id))return(t=sc.get(e.id))!=null?t:null;let o=Yw.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(sc.set(e.id,i),zg?.(),i)).catch(()=>(sc.set(e.id,null),null)),Yw.set(e.id,o)),o})}const lX=fa(0);zg=()=>{lX.value++},iX(oX);const aX={"":"",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 By(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=aX[n])!=null?t:n}function Gbe(e){const t=By(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Ybe(e){return(function(s){const o=Wg.get(Gw);if(!o)return;const i=o.core[s];if(i)return i;const r=sc.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!sc.has(o.id)&&rX(o)})(By(e))||((n=(t=Wg.get(Gw))==null?void 0:t.fallback)!=null?n:"");var t,n}const Zbe={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 i5=!1;function Qbe(){return i5}function Xbe(){i5=!0}var em=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Lo=null,Gf=!1,tm=Py;function nm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Dy(){try{const e=globalThis;return nm(e?.katex)}catch{return null}}function Py(){return em(null,null,function*(){const e=Dy();if(e)return e;const t=yield eo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield eo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return nm(t)})}function cX(e){tm=e,Lo=null,Gf=!1}function uX(e){cX(Py)}function r5(){return typeof tm=="function"}function Jbe(){var e;const t=tm;if(!t||t===Py)return null;if(Lo)return Lo;const n=Dy();if(n)return Lo=n,Lo;try{const s=t();return s&&typeof s?.then!="function"?(Lo=(e=nm(s))!=null?e:s,Lo):null}catch{return null}}function Hy(){return em(this,null,function*(){var e;const t=Dy();if(t)return Lo=t,Lo;if(Lo)return Lo;if(Gf)return null;const n=tm;if(!n)return Gf=!0,null;try{const s=yield n();if(s)return Lo=(e=nm(s))!=null?e:s,Lo}catch{}return Gf=!0,null})}function l5(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let el=null,Gr=null;const si=new Map,pr=new Map;let Qh=5;const Gl=new Set;function dd(){if(si.size<Qh&&Gl.size){const e=Array.from(Gl);Gl.clear();for(const t of e)try{t()}catch{}}}function dX(e){el=e,Gr=null,el.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=si.get(n);if(i)if(si.delete(n),clearTimeout(i.timeoutId),dd(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(pr.set(a,s),pr.size>200){const c=pr.keys().next().value;pr.delete(c)}}i.resolve(s)}},el.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of si.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));si.clear(),dd()}}function fX(){var e;el&&((e=el.terminate)==null||e.call(el)),el=null,Gr=null}function hX(e,t=!0,n=2e3,s){return em(this,null,function*(){performance.now();const o=l5(e);if(!r5()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Gr)return Promise.reject(Gr);const i=`${t?"d":"i"}:${o}`,r=pr.get(i);if(r)return Promise.resolve(r);const l=el||(Gr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Gr.name="WorkerInitError",Gr.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Gr);if(si.size>=Qh){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=si.size,a.max=Qh,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const h=new Error("Aborted");return h.name="AbortError",void c(h)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{si.delete(u);const h=new Error("Worker render timed out");h.name="WorkerTimeout",h.code="WORKER_TIMEOUT",c(h),dd()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),si.has(u)&&si.delete(u);const h=new Error("Aborted");h.name="AbortError",c(h),dd()},{once:!0});const f=a,p=c;si.set(u,{resolve:h=>{f(h)},reject:h=>{p(h)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function exe(e,t=!0,n){const s=`${t?"d":"i"}:${l5(e)}`;if(pr.set(s,n),pr.size>200){const o=pr.keys().next().value;pr.delete(o)}}const pX="WORKER_BUSY";function mX(e=2e3,t){return si.size<Qh?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Gl.delete(r),n())};if(Gl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Gl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>dd()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Gl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const cu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function txe(e){return em(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!r5()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:cu.timeout,c=(i=s.waitTimeout)!=null?i:cu.waitTimeout,u=(r=s.backoffMs)!=null?r:cu.backoffMs,d=(l=s.maxRetries)!=null?l:cu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):cu.maxRetries,p=s.signal;let h=0;for(;;){if(p?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield hX(t,n,a,p)}catch(m){if(m?.code!==pX||h>=f)throw m;if(h++,yield mX(c,p).catch(()=>{}),p?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*h)))}}})}function oc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function gX(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Ug(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=gX(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function jg(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 a5(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function qg(e,t=360,n=500){return a5(e,t,n)}function Vg(e,t=360,n=500){return a5(e,t,n)}var vX=Object.defineProperty,yX=Object.defineProperties,kX=Object.getOwnPropertyDescriptors,Zw=Object.getOwnPropertySymbols,bX=Object.prototype.hasOwnProperty,xX=Object.prototype.propertyIsEnumerable,Qw=(e,t,n)=>t in e?vX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c5=(e,t)=>{for(var n in t||(t={}))bX.call(t,n)&&Qw(e,n,t[n]);if(Zw)for(var n of Zw(t))xX.call(t,n)&&Qw(e,n,t[n]);return e},Wy=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const zy=()=>eo(()=>import("./mermaid.core-D1ZdIpxL.js").then(e=>e.bn),[]);let nr=null,Uy=zy;function _X(e){Uy=e,nr=null}function wX(e){_X(zy)}function SX(){return typeof Uy=="function"}function Xw(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 o=t.mermaidAPI;return n=c5({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},yX(n,kX(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function Jw(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=c5({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function nxe(){return Wy(this,null,function*(){if(nr)return nr;const e=(function(){try{const s=globalThis;return Xw(s?.mermaid)}catch{return null}})();if(e)return nr=e,Jw(nr),nr;const t=Uy;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===zy?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(nr=Xw(n),Jw(nr),nr):null})}let Xs=null,Yr=null;const Ns=new Map;let eS=5,tS=!1;const CX="WORKER_BUSY",AX="MERMAID_DISABLED";function MX(e){Xs=e,Yr=null;const t=e;Xs.onmessage=n=>{if(Xs!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Ns.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Xs.onerror=n=>{var s,o;if(Xs===t)if(Ns.size!==0){try{tS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Ns.entries())r.reject(new Error(`Worker error: ${n.message}`));Ns.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Xs.onmessageerror=n=>{var s,o;if(Xs===t)if(Ns.size!==0){try{tS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Ns.entries())r.reject(new Error("Worker messageerror"));Ns.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function EX(){var e;if(Xs)try{for(const[t,n]of Ns.entries())n.reject(new Error("Worker cleared"));Ns.clear(),(e=Xs.terminate)==null||e.call(Xs)}catch{}Xs=null,Yr=null}function u5(e,t,n=1400){if(!SX()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=AX,Promise.reject(o)}if(Yr)return Promise.reject(Yr);const s=Xs||(Yr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Yr.name="WorkerInitError",Yr.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Yr);if(Ns.size>=eS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=CX,o.inFlight=Ns.size,o.max=eS,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Ns.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Ns.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Ns.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=Ns.get(r);f&&f.reject(d)},n)})}function sxe(e,t,n=1400){return Wy(this,null,function*(){try{return yield u5("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function oxe(e,t,n=1400){return Wy(this,null,function*(){try{return yield u5("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function ixe(){if(Xs)try{for(const[e,t]of Ns.entries())t.reject(new Error("Worker terminated"));Ns.clear(),Xs.terminate()}finally{Xs=null}}var TX=Object.defineProperty,NX=Object.defineProperties,IX=Object.getOwnPropertyDescriptors,nS=Object.getOwnPropertySymbols,$X=Object.prototype.hasOwnProperty,LX=Object.prototype.propertyIsEnumerable,sS=(e,t,n)=>t in e?TX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))$X.call(t,n)&&sS(e,n,t[n]);if(nS)for(var n of nS(t))LX.call(t,n)&&sS(e,n,t[n]);return e},Bt=(e,t)=>NX(e,IX(t)),zn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const FX="__global__",i0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Kg=(()=>{const e=globalThis;if(e[i0])return e[i0];const t={scopedCustomComponents:{},revision:fa(0)};return e[i0]=t,t})(),oS=Kg.revision,OX=Symbol("markstreamCustomComponents"),RX=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 Td(e){return RX.has(String(e).trim().toLowerCase())}function BX(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,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([di(n),di(BX(n))]))!o||Td(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function us(e){const t=Ut(OX,null);return P(()=>{var n;return oS.value,(function(s,o={}){return oS.value,it(it(it({},r0(Kg.scopedCustomComponents[FX]||{})),r0(o)),r0((function(i){return i&&Kg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const DX=["aria-label"],PX={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"},HX={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"},hn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Do=hn(qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),I("svg",HX,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),I("svg",PX,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,DX))}),[["__scopeId","data-v-be21ab83"]]);Do.install=e=>{e.component(Do.__name,Do)};const WX={class:"emoji-node"},yo=hn(qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("span",WX,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);yo.install=e=>{e.component(yo.__name,yo)};const zX=["id"],UX=["title"],Po=hn(qe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(b(),I("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,UX)],8,zX))}}),[["__scopeId","data-v-c1463a29"]]);Po.install=e=>{e.component(Po.__name,Po)};const d5=(()=>{try{return!1}catch{}return!1})();function l0(e){d5&&console.warn(e)}function iS(e,t="safe",n){return Oy(e,t,n)}function f5(e){return _Q(e)}function a0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function jy(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Pg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),a0(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),a0(r.value)]):Object.entries(o).map(([r,l])=>[r,a0(l)]):null,t,n);var o;if(!s)return;const i=f5(Yh(s));return Object.keys(i).length>0?i:void 0}function rS(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function uu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function c0(e,t,n,s,o,i,r=!1){const l=(function(d,f){return Y6(d,f)})(e,s);if(Ad.has(e.toLowerCase())||!l&&V6(e,i))return null;if(!l&&Fy(e,i))return r?[rS(e,t,!0)]:[rS(e,t),...n,`</${e}>`];const a=Oy(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=f5(a);return dn(d,Bt(it({},f),{key:u}),n.length>0?n:void 0)}return dn(e,Bt(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function h5(e,t){return AQ(e,t)}function Xh(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=c0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);uu(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 p=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){p=h;break}if(p!==-1)for(;c.length>p;){const h=c.pop(),m=c0(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?uu(c[c.length-1].children,m):uu(u,m),h.tagName.toLowerCase()!==f&&c.length>p&&l0(`Auto-closing unclosed tag: <${h.tagName}>`)}else l0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=c0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?uu(c[c.length-1].children,f):uu(u,f),l0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(wQ(e),t,n)}catch(o){return s=o,d5&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const jX=["innerHTML"],Ho=hn(qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=P(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=us(()=>t.customId),i=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=P(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:yc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Xh(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!h5(l,o.value))return{mode:"html",content:yc(l,s.value)};const a=Xh(l,o.value,s.value);return a===null?{mode:"html",content:yc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),I("span",{key:0,class:De(["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"?(b(),I("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(b(),I("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,jX))}}),[["__scopeId","data-v-d17f12b0"]]);Ho.install=e=>{e.component(Ho.__name,Ho)};const qX={class:"inline-code"},VX={key:0},qs=hn(qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=bd(),s=Ut("markstreamFade",void 0),o=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=P(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=P(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=P(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=P(()=>!l.value),u=P(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Q(t.node.code),f=Q("");let p=i?.value;const h=Q(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}Ke([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const L=String(g??""),$=u.value,x=A!==p;p=A;const E=J6({nextContent:L,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(h.value+=1),$&&o?.set($,L)},{immediate:!0}),Ke(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=P(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(b(),I("code",qX,[c.value?(b(),I(Be,{key:0},[Ge(B(a.value),1)],64)):(b(),I(Be,{key:1},[d.value?(b(),I("span",VX,B(d.value),1)):le("",!0),f.value?(b(),I("span",{key:1,class:De(["inline-code-stream-delta",[k.value]]),onAnimationend:_},B(f.value),35)):le("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);qs.install=e=>{e.component(qs.__name,qs)};const Gg=Q(!1),lS=Q(""),aS=Q("top"),Ru=Q(null),Bu=Q(null),Yg=Q(null),Zg=Q(null),cS=Q(null);let Yf=null,Zf=null,Qg=0;function p5(){Yf&&(clearTimeout(Yf),Yf=null),Zf&&(clearTimeout(Zf),Zf=null)}let Tf=!1,Nf=null,uS=!1;function KX(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Qg;p5();const l=()=>zn(null,null,function*(){var a,c;if(yield(function(){return zn(this,null,function*(){if(!Tf&&!uS&&typeof document<"u"){Nf!=null||(Nf=zn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([eo(()=>import("./vue.runtime.esm-bundler-Dj6KWBND.js"),[]),eo(()=>import("./Tooltip-B3YtzPNZ.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:Gg.value,"anchor-el":Ru.value,content:lS.value,placement:aS.value,id:Bu.value,originX:Yg.value,originY:Zg.value,isDark:(h=cS.value)!=null?h:void 0})}}).mount(p),Tf=!0}));try{yield Nf}catch(u){Tf=!1,Nf=null,uS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Tf&&r===Qg){Bu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ru.value=e,lS.value=t,aS.value=n,Yg.value=(a=o?.x)!=null?a:null,Zg.value=(c=o?.y)!=null?c:null,cS.value=typeof i=="boolean"?i:null,Gg.value=!0;try{e.setAttribute("aria-describedby",Bu.value)}catch{}}});s?l():Yf=setTimeout(l,80)}function GX(e=!1){Qg+=1,p5();const t=()=>{if(Ru.value&&Bu.value)try{Ru.value.removeAttribute("aria-describedby")}catch{}Gg.value=!1,Ru.value=null,Bu.value=null,Yg.value=null,Zg.value=null};e?t():Zf=setTimeout(t,120)}const Xg={"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..."},Jg=e=>{var t;return(t=Xg[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function dS(e){return{t(t){if(e.te&&Xg[t]&&!e.te(t))return Jg(t);const n=e.t(t);return n===t&&Xg[t]?Jg(t):n}}}function YX(){const e=(function(){var t,n;try{const s=Os(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return dS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return dS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Jg}}function ZX(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const QX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],XX={key:1,class:"image-placeholder"},JX={key:1,class:"image-node__raw-text"},eJ={key:0,class:"image-shimmer-overlay"},tJ={key:1,class:"image-node__raw-text"},nJ={key:2,class:"image-error"},il=hn(qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=Q(!1),i=Q(!1),r=Q(""),l=Q("primary"),a=Q(null),c=bd(),u=Ut(Hg,null);let d="",f=null;const p=P(()=>q_(n.node.src)),h=P(()=>q_(n.fallbackSrc)),m=P(()=>r.value),_=P(()=>!n.lazy),k=P(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=P(()=>l.value==="failed"),v=P(()=>!_.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=P(()=>ZX(n,c));function A(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=y.value){R&&pt(()=>{A(R)})}function $(){f&&(clearTimeout(f),f=null)}function x(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),$(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(L(R),E())},8e3)))}function E(){return zn(this,null,function*(){const R=d;R&&($(),d="",yield pt(),A(R),u?.markSettled(R))})}function N(){if(l.value==="primary"&&h.value&&h.value!==r.value)return l.value="fallback",r.value=h.value,o.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,s("error",r.value),L()}function F(){o.value=!0,i.value=!1,s("load",m.value),L()}function S(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,m.value])}const{t:T}=YX();return Ke([p,h,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||p.value?(r.value=p.value,void(l.value="primary")):h.value?(r.value=h.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ke([k,o,i,m,()=>n.lazy],([R,O,D,W,z])=>R&&W&&!D?O?(E(),void L()):z?(x(),void L()):void(O||D||x()):(E(),void L()),{flush:"post",immediate:!0}),es(()=>{(function(){const R=d;R&&($(),d="",u?.markSettled(R))})()}),(R,O)=>{var D,W,z,V,U;return b(),I("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(b(),I("img",{key:0,src:m.value,alt:String((W=(D=n.node.alt)!=null?D:n.node.title)!=null?W:""),title:String((V=(z=n.node.title)!=null?z:n.node.alt)!=null?V:""),class:De(["image-node__img",{"is-loading":!_.value&&!o.value,"is-loaded":_.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(U=n.node.alt)!=null?U:C(T)("image.preview"),onError:N,onLoad:F,onClick:S},null,42,QX)):le("",!0),e.node.loading&&!i.value?(b(),I("span",XX,[n.usePlaceholder?In(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[0]||(O[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),I("span",JX,B(e.node.raw),1))])):le("",!0),ie(cl,{name:"shimmer-fade"},{default:Ee(()=>[v.value&&!e.node.loading?(b(),I("span",eJ,[n.usePlaceholder?In(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[1]||(O[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),I("span",tJ,B(e.node.raw),1))])):le("",!0)]),_:3}),g.value?(b(),I("span",nJ,[In(R.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[2]||(O[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("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)),w("span",null,B(C(T)("image.loadError")),1)],!0)])):le("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);il.install=e=>{e.component(il.__name,il)};const sJ={key:2},Ui=qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),i=P(()=>{var h;return(h=s?.value)!=null?h:"safe"}),r=P(()=>{var h,m;const _=(h=o?.value)!=null?h:{};return Bt(it({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1}),a=P(()=>t.components[String(t.node.type)]),c=P(()=>!!(a.value&&n.value[t.node.type]&&!Td(String(t.node.type)))),u=P(()=>c.value?jy(t.node,i.value):void 0),d=P(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=P(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=P(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(b(),ye($s(a.value),pn({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?(b(),ye(C(l),pn({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?(b(),ye(C(l),pn({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"])):le("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),ye($s(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),I("span",sJ,B(p.value),1)):le("",!0)}}),oJ=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],iJ={key:0,translate:"no",class:"markstream-pre__diff-code"},rJ={class:"markstream-pre__diff-number","aria-hidden":"true"},lJ={class:"markstream-pre__diff-content"},aJ={class:"markstream-pre__diff-content-inner"},cJ={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},uJ=["textContent"],$o=qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=P(()=>{var S,T,R;const O=String((T=(S=t.node)==null?void 0:S.language)!=null?T:"");return String((R=String(O).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=P(()=>`language-${n.value}`),o=P(()=>{var S,T,R,O,D;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(T=t.node)==null?void 0:T.code)!=null?R:""):(function(W,z){const V=String(W??"");return z?V:V.replace(/\r\n$|\n$|\r$/,"")})((O=t.node)==null?void 0:O.code,((D=t.node)==null?void 0:D.loading)===!0)}),i=P(()=>o.value.split(/\r\n|\n|\r/)),r=P(()=>Array.from({length:Math.max(1,i.value.length)},(S,T)=>T+1)),l=P(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=P(()=>l.value&&t.diffInline===!0),c=P(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const T=`${Math.ceil(S)}px`;return{height:T,minHeight:T,maxHeight:T,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,T="context",R={}){const O=u(S);return{code:S,kind:O&&T!=="hunk"&&!R.preserveBlankKind?"context":T,empty:O}}function f(S){const T=String(S??"");return T?T.split(/\r\n|\n|\r/):[]}function p(S,T){return!u(S[T])||T<S.length-1}function h(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function _(S,T){const R=f(S),O=f(T),D=(function(ae,te){const Z=ae.length,ne=te.length;if((Z+1)*(ne+1)>15e5)return null;const ke=ne+1,Se=new Uint32Array((Z+1)*(ne+1));for(let ce=1;ce<=Z;ce++)for(let fe=1;fe<=ne;fe++){const j=ce*ke+fe;if(ae[ce-1]===te[fe-1])Se[j]=Se[(ce-1)*ke+(fe-1)]+1;else{const se=Se[(ce-1)*ke+fe],ge=Se[ce*ke+(fe-1)];Se[j]=se>=ge?se:ge}}const Ye=[];let ve=Z,Y=ne;for(;ve>0&&Y>0;)ae[ve-1]===te[Y-1]?(Ye.push({originalIndex:ve-1,modifiedIndex:Y-1}),ve--,Y--):Se[(ve-1)*ke+Y]>=Se[ve*ke+(Y-1)]?ve--:Y--;return Ye.reverse(),Ye})(R,O);if(D){const ae=[];let te=0,Z=0;for(const ne of D){for(;te<ne.originalIndex;)ae.push(Bt(it({},d(R[te],"removed",{preserveBlankKind:p(R,te)})),{key:`inline-removed-source-${te}`,number:""})),te++;for(;Z<ne.modifiedIndex;)ae.push(Bt(it({},d(O[Z],"added",{preserveBlankKind:p(O,Z)})),{key:`inline-added-source-${Z}`,number:Z+1})),Z++;ae.push(Bt(it({},d(O[ne.modifiedIndex])),{key:`inline-context-source-${ne.originalIndex}-${ne.modifiedIndex}`,number:ne.modifiedIndex+1})),te=ne.originalIndex+1,Z=ne.modifiedIndex+1}for(;te<R.length;)ae.push(Bt(it({},d(R[te],"removed",{preserveBlankKind:p(R,te)})),{key:`inline-removed-source-${te}`,number:""})),te++;for(;Z<O.length;)ae.push(Bt(it({},d(O[Z],"added",{preserveBlankKind:p(O,Z)})),{key:`inline-added-source-${Z}`,number:Z+1})),Z++;return ae}const W=[];let z=0,V=R.length-1,U=O.length-1;for(;z<=V&&z<=U&&R[z]===O[z];)W.push(Bt(it({},d(O[z])),{key:`inline-prefix-${z}`,number:z+1})),z++;const re=[];for(;V>=z&&U>=z&&R[V]===O[U];)re.unshift(Bt(it({},d(O[U])),{key:`inline-suffix-${U}`,number:U+1})),V--,U--;for(let ae=z;ae<=V;ae++)W.push(Bt(it({},d(R[ae],"removed",{preserveBlankKind:p(R,ae)})),{key:`inline-removed-source-${ae}`,number:""}));for(let ae=z;ae<=U;ae++)W.push(Bt(it({},d(O[ae],"added",{preserveBlankKind:p(O,ae)})),{key:`inline-added-source-${ae}`,number:ae+1}));return W.concat(re)}const k=P(()=>{var S,T,R,O;const D=(function(U){const re=U.some(te=>h(te)),ae=U.some(te=>m(te));return re&&ae||(function(){var te,Z,ne,ke;if(n.value==="diff")return!0;const Se=(ke=(ne=String((Z=(te=t.node)==null?void 0:te.raw)!=null?Z:"").split(/\r?\n/,1)[0])==null?void 0:ne.trim())!=null?ke:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Se)})()&&(re||ae)})(i.value),W=(function(){var U,re;return((U=t.node)==null?void 0:U.originalCode)!=null||((re=t.node)==null?void 0:re.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:D?(function(U){const re=[];let ae=1;for(const[te,Z]of U.entries())if(Z.startsWith("@@"))re.push(Bt(it({},d(Z,"hunk")),{key:`inline-hunk-${te}`,number:""}));else if(h(Z))re.push(Bt(it({},d(Z.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${te}`,number:""}));else if(m(Z))re.push(Bt(it({},d(Z.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${te}`,number:ae++}));else{const ne=Z.startsWith(" ")?Z.slice(1):Z;re.push(Bt(it({},d(ne)),{key:`inline-context-${te}`,number:ae})),ae++}return re})(i.value):_((S=t.node)==null?void 0:S.originalCode,(T=t.node)==null?void 0:T.updatedCode)}];if(!D&&W){const U=f((R=t.node)==null?void 0:R.originalCode),re=f((O=t.node)==null?void 0:O.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((ae,te)=>{const Z=re[te]===ae?"context":"removed";return Bt(it({},d(ae,Z,{preserveBlankKind:p(U,te)})),{key:`original-${te}`,number:te+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:re.map((ae,te)=>{const Z=U[te]===ae?"context":"added";return Bt(it({},d(ae,Z,{preserveBlankKind:p(re,te)})),{key:`modified-${te}`,number:te+1})})}]}const z=[],V=[];for(const U of i.value)if(U.startsWith("@@"))z.push(d(U,"hunk")),V.push(d(U,"hunk"));else if(U.startsWith("-")&&!U.startsWith("---"))z.push(d(U.slice(1),"removed",{preserveBlankKind:!0}));else if(U.startsWith("+")&&!U.startsWith("+++"))V.push(d(U.slice(1),"added",{preserveBlankKind:!0}));else{const re=U.startsWith(" ")?U.slice(1):U;z.push(d(re)),V.push(d(re))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:z.map((U,re)=>Bt(it({},U),{key:`original-${re}`,number:re+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:V.map((U,re)=>Bt(it({},U),{key:`modified-${re}`,number:re+1}))}]}),g=P(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Q(null),y=Q([]);let A=null,L=null;function $(S){const T=Number.parseFloat(String(S??""));return Number.isFinite(T)&&T>0?T:0}function x(S,T){var R;if(!S)return T;const O=S.querySelector(".markstream-pre__diff-content"),D=O?.getBoundingClientRect(),W=(R=D?.height)!=null?R:0;return Math.max(T,Math.ceil(W))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,T;A=null;const R=v.value;if(!R||!l.value)return void(y.value.length&&(y.value=[]));const O=(function(ae){const te=window.getComputedStyle(ae),Z=$(te.getPropertyValue("--markstream-pre-diff-line-height"));if(Z>0)return Z;const ne=$(te.lineHeight);return ne>0?ne:18})(R),D=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),W=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),z=Math.max(D.length,W.length),V=[];for(let ae=0;ae<z;ae++){const te=x((S=D[ae])!=null?S:null,O),Z=x((T=W[ae])!=null?T:null,O),ne=Math.max(O,te,Z);V.push({rowHeight:ne,originalHeight:te,modifiedHeight:Z})}var U,re;U=y.value,re=V,U.length===re.length&&U.every((ae,te)=>{const Z=re[te];return Z&&Math.abs(ae.rowHeight-Z.rowHeight)<=.5&&Math.abs(ae.originalHeight-Z.originalHeight)<=.5&&Math.abs(ae.modifiedHeight-Z.modifiedHeight)<=.5})||(y.value=V)})()}))}function N(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{E()}),L.observe(S))}function F(S,T){const R=y.value[S];if(!R)return;const O=T==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(O)}px`}}return Ke(v,S=>{N(S),pt(()=>E())},{flush:"post"}),Ke([l,k],()=>{N(v.value),pt(()=>E())},{flush:"post",immediate:!0}),es(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),L?.disconnect(),L=null}),(S,T)=>(b(),I("pre",{ref_key:"preRef",ref:v,style:qt(c.value),class:De([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(b(),I("code",iJ,[(b(!0),I(Be,null,nt(k.value,R=>(b(),I("span",{key:R.key,class:De(["markstream-pre__diff-pane",R.className])},[(b(!0),I(Be,null,nt(R.lines,(O,D)=>(b(),I("span",{key:O.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${O.kind}`,{"markstream-pre__diff-line--empty":O.empty}]]),style:qt(F(D,R.key))},[T[0]||(T[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",rJ,B(O.number),1),w("span",lJ,[w("span",aJ,B(O.code),1)])],6))),128))],2))),128))])):(b(),I(Be,{key:1},[t.showLineNumbers?(b(),I("span",cJ,[(b(!0),I(Be,null,nt(r.value,R=>(b(),I("span",{key:R,class:"markstream-pre__line-number"},B(R),1))),128))])):le("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:B(o.value)},null,8,uJ)],64))],14,oJ))}});$o.install=e=>{e.component($o.__name,$o)};const u0=fa(!1);let fS=null;const dJ={key:0},Zn=hn(qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(fS||(fS=Hy().then(k=>{u0.value=!!k}).catch(()=>{u0.value=!1})),ah(u0)),s=bd(),o=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=P(()=>{const k=s.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),a=P(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=P(()=>{var k;const g=(k=s["index-key"])!=null?k:s.indexKey;return g==null||g===""?"":String(g)}),u=Q(t.node.content),d=Q("");let f=r?.value;const p=Q(0);function h(){return u.value+d.value}function m(){d.value&&(u.value=h(),d.value="")}Ke([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const A=String(k??""),L=c.value,$=y!==f;f=y;const x=J6({nextContent:A,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(p.value+=1),L&&i?.set(L,A)},{immediate:!0}),Ke(a,k=>{var g;k||(g=h(),u.value=g,d.value="")});const _=P(()=>p.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(b(),I("span",{class:De([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(b(),I("span",dJ,B(u.value),1)):le("",!0),d.value?(b(),I("span",{key:1,class:De(["text-node-stream-delta",[_.value]]),onAnimationend:m},B(d.value),35)):le("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const m5=qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return dn($o,Bt(it({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),d0=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./CodeBlockNode-DI6gCVXa.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),$o}}),loadingComponent:m5,delay:0,suspensible:!1}),Ci=ki(()=>zn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return dn(Zn,Bt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Hy())return(yield eo(()=>import("./index6-Di9uDNmo.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return dn(Zn,Bt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),g5=ki(()=>zn(null,null,function*(){try{if(yield Hy())return(yield eo(()=>import("./index5-Bn5298gF.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return dn(Zn,Bt(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),so=hn(qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),I("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);so.install=e=>{e.component(so.__name,so)};const fJ={class:"superscript-node"},ko=hn(qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,footnote_reference:Po,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,emoji:yo,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("sup",fJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);ko.install=e=>{e.component(ko.__name,ko)};const hJ={class:"subscript-node"},bo=hn(qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,footnote_reference:Po,strikethrough:io,highlight:Wo,insert:xo,superscript:ko,emoji:yo,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("sub",hJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);bo.install=e=>{e.component(bo.__name,bo)};const pJ={class:"strong-node"},oo=hn(qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("strong",pJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);oo.install=e=>{e.component(oo.__name,oo)};const mJ={class:"strikethrough-node"},io=hn(qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("del",mJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);io.install=e=>{e.component(io.__name,io)};const gJ=["href","title","aria-label","aria-hidden","target","rel"],vJ=["aria-hidden"],yJ={class:"link-text-wrapper relative inline-flex"},kJ={class:"leading-[normal] link-text"},ro=hn(qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Ut("markstreamShowTooltips",void 0),s=P(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=P(()=>{var k,g,v,y,A;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(k=t.animationOpacity)!=null?k:.35,x=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--underline-rest-opacity":String(x),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=us(()=>t.customId),r=P(()=>it({text:Zn,strong:oo,strikethrough:io,emphasis:lo,image:il,html_inline:Ho,inline_code:qs},i.value)),l=bd(),a=P(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,L]of Object.entries(v))A&&L!=null&&L!==!1&&(y[A]=L===!0?"":String(L));return iS(y,"safe","a")}),c=P(()=>it(it({},l),a.value)),u=P(()=>{var k,g;return iS({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=P(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(cK(u.value)?"_blank":void 0)}),f=P(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),p=P(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),h=P(()=>{const k=it({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&GX()}const _=P(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,y;return e.node.loading?(b(),I("span",pn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[w("span",yJ,[w("span",kJ,[ie(C(Zn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,vJ)):(b(),I("a",pn({key:0,class:"link-node",href:u.value,title:s.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:o.value,onMouseenter:g[0]||(g[0]=A=>(function(L){var $,x,E,N;if(!s.value)return;const F=L,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,T=(($=t.node)==null?void 0:$.title)||((x=u.value)!=null&&x.includes("xn--")&&((N=(E=t.node)==null?void 0:E.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";KX(L.currentTarget,T,"top",!1,S)})(A)),onMouseleave:m}),[(b(!0),I(Be,null,nt(e.node.children,(A,L)=>(b(),ye(C(Ui),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,gJ))}}}),[["__scopeId","data-v-367e6ca4"]]);ro.install=e=>{e.component(ro.__name,ro)};const bJ={class:"insert-node"},xo=hn(qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("ins",bJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);xo.install=e=>{e.component(xo.__name,xo)};const xJ={class:"highlight-node"},Wo=hn(qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,strikethrough:io,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("mark",xJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Wo.install=e=>{e.component(Wo.__name,Wo)};const _J={class:"emphasis-node"},lo=hn(qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("em",_J,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);lo.install=e=>{e.component(lo.__name,lo)};const wJ={class:"hard-break"},rl=hn(qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("br",wJ))}),[["__scopeId","data-v-50c58f70"]]);rl.install=e=>{e.component(rl.__name,rl)};const fd=qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=mt({checkbox:Do,checkbox_input:Do,emoji:yo,emphasis:lo,hardbreak:rl,highlight:Wo,inline_code:qs,insert:xo,link:ro,reference:so,strikethrough:io,strong:oo,subscript:bo,superscript:ko,text:Zn}),s=us(()=>t.customId),o=P(()=>{const i=s.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(b(!0),I(Be,null,nt(e.nodes,(l,a)=>(b(),ye(C(Ui),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function 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 Jh(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 s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(ev)?o:null}function Ec(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const SJ=["cite"],CJ={key:0,dir:"auto",class:"paragraph-node"},AJ=["custom-id"],Qf=hn(qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=us(()=>t.customId),s=P(()=>!!n.value.paragraph),o=P(()=>!!n.value.text),i=P(()=>Jh(t.node.children,!s.value)),r=P(()=>t.fade!==!1||o.value?null:Ec(i.value));return An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade)),(l,a)=>(b(),I("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(b(),I("p",CJ,[r.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,AJ)):(b(),ye(C(fd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),ye(C(_o),{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,SJ))}}),[["__scopeId","data-v-abfecebc"]]);Qf.install=e=>{e.component(Qf.__name,Qf)};const MJ={class:"definition-list"},EJ={class:"definition-term"},TJ={class:"definition-desc"},Xf=hn(qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),I("dl",MJ,[(b(!0),I(Be,null,nt(t.node.items,(o,i)=>(b(),I(Be,{key:i},[w("dt",EJ,[ie(C(_o),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),w("dd",TJ,[ie(C(_o),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Xf.install=e=>{e.component(Xf.__name,Xf)};const NJ=["href","title"],Du=hn(qe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(b(),I("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,NJ))}}),[["__scopeId","data-v-e1eb37b6"]]);Du.install=e=>{e.component(Du.__name,Du)};const IJ=["id"],$J={class:"flex-1"},Jf=qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),I("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",$J,[ie(C(_o),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,IJ))}});Jf.install=e=>{e.component(Jf.__name,Jf)};const LJ=["custom-id"],tv=hn(qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamFade",void 0),o=P(()=>s?.value!==!1||n.value.text?null:Ec(t.node.children)),i=P(()=>it({text:Zn,inline_code:qs,link:ro,image:il,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,checkbox:Do,checkbox_input:Do,footnote_reference:Po,hardbreak:rl,math_inline:Ci,reference:so},n.value));return(r,l)=>(b(),ye($s(`h${e.node.level}`),pn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[o.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,LJ)):(b(!0),I(Be,{key:1},nt(e.node.children,(a,c)=>(b(),ye(C(Ui),{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"]]),ep=tv;ep.install=e=>{e.component(tv.__name,tv)};const FJ={key:0,dir:"auto",class:"paragraph-node"},OJ=["custom-id"],RJ={dir:"auto",class:"paragraph-node"},BJ=["custom-id"],kc=hn(qe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=P(()=>{var p;return(p=t.node)!=null?p:t.item}),s=us(()=>t.customId),o=P(()=>!!s.value.paragraph),i=P(()=>!!s.value.text),r=P(()=>{var p;return Jh((p=n.value)==null?void 0:p.children,!o.value)}),l=P(()=>{var p;if(o.value)return null;const h=(p=n.value)==null?void 0:p.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=h.slice(1);if(!_.every(g=>g?.type==="list"))return null;const k=Jh([m]);return k?{paragraphChildren:k,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=P(()=>a()?Ec(r.value):null),u=P(()=>{var p;return a()?Ec((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=P(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade)),(p,h)=>{var m,_;return b(),I("li",pn({class:"list-item",dir:"auto"},f.value),[r.value?(b(),I("p",FJ,[c.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,OJ)):(b(),ye(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?(b(),I(Be,{key:1},[w("p",RJ,[u.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,BJ)):(b(),ye(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"]))]),(b(!0),I(Be,null,nt(l.value.nestedLists,(k,g)=>(b(),ye(C(_o),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:h[0]||(h[0]=v=>p.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(b(),ye(C(_o),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=k=>p.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);kc.install=e=>{e.component(kc.__name,kc)};const bc=hn(qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=us(()=>e.customId),n=P(()=>t.value.list_item||kc);return(s,o)=>(b(),ye($s(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(b(!0),I(Be,null,nt(e.node.items,(i,r)=>{var l;return b(),ye($s(n.value),pn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);bc.install=e=>{e.component(bc.__name,bc)};const v5=Symbol("ViewportPriority");function DJ(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function p(){if(f!=null){try{l?.(f)}catch{}f=null}}function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||p()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&_())},{timeout:1200}))}Ke(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);p()}},{flush:"sync"});const k=(g,v)=>{const y=Q(!1);let A,L=!1;const $=new Promise(N=>{A=()=>{L||(L=!0,N())}}),x=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()};if(!o||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x};const E=(function(N,F){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(O,D){var W,z,V;return{root:(W=e?.(O??null))!=null?W:null,rootMargin:(z=D?.rootMargin)!=null?z:"300px",threshold:(V=D?.threshold)!=null?V:0}})(N,F);if(a&&(R=S,(T=c)&&T.root===R.root&&T.rootMargin===R.rootMargin&&T.threshold===R.threshold))return a;var T,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(O=>{for(const D of O)(D.isIntersecting||D.intersectionRatio>0)&&m(D.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const O of u.keys())a.observe(O);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),_(),{isVisible:y,whenVisible:$,destroy:x}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x})};return An(v5,k),k}function PJ(){var e,t;const n=Ut(v5,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const p=s.get(f);if(p){if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.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 p=Q(!1);let h,m=!1;const _=new Promise(v=>{h=()=>{m||(m=!0,v())}}),k=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(f,{resolve:h,visible:p}),g.observe(f),i.add(f),d(),{isVisible:p,whenVisible:_,destroy:k}):(p.value=!0,h(),{isVisible:p,whenVisible:_,destroy:k})}}const HJ={key:2,class:"html-block-node__raw"},WJ=["innerHTML"],zJ={key:1,class:"html-block-node__placeholder"},Pu=hn(qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),o=P(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=P(()=>{var L,$;const x=(L=s?.value)!=null?L:{};return Bt(it({},x),{customId:($=t.customId)!=null?$:x.customId,htmlPolicy:o.value})}),r=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1}),l=P(()=>{const L=Pg(t.node.attrs,o.value);if(!L)return;const $=Yh(L);return Object.keys($).length>0?$:void 0}),a=P(()=>{const L=String(t.node.tag||"").trim(),$=Pg(t.node.attrs,o.value,L);if(!$)return;const x=Yh($);return Object.keys(x).length>0?x:void 0}),c=us(()=>t.customId),u=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Q(null),f=Q(typeof window>"u"),p=Q(t.node.content),h=P(()=>Array.isArray(t.node.children)?t.node.children:[]),m=P(()=>String(t.node.tag||"div")),_=P(()=>{const L=m.value.trim().toLowerCase();return n6.has(L)||Fy(L,o.value)}),k=P(()=>h.value.length>0&&!!t.node.tag&&!_.value),g=P(()=>{var L,$,x;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=p.value)!=null?L:""};const E=($=p.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:yc(E,o.value)};if(t.node.loading){const F=Xh(E,c.value,o.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:E}:{mode:"dynamic",nodes:F}}if(!h5(E,c.value))return{mode:"html",content:yc(E,o.value)};const N=Xh(E,c.value,o.value);return N===null?{mode:"html",content:yc(E,o.value)}:{mode:"dynamic",nodes:N}}),v=PJ(),y=Q(null),A=!!t.node.loading;return typeof window<"u"?(Ke(d,L=>{var $,x;if((x=($=y.value)==null?void 0:$.destroy)==null||x.call($),y.value=null,!A)return f.value=!0,void(p.value=t.node.content);if(!L)return void(f.value=!1);const E=v(L,{rootMargin:"400px"});y.value=E,f.value=E.isVisible.value,E.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ke(()=>t.node.content,L=>{A&&!f.value||(p.value=L)})):f.value=!0,es(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(b(),ye($s(k.value?m.value:"div"),pn({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:Ee(()=>[f.value?(b(),I(Be,{key:0},[g.value.mode==="structured"?(b(),ye(C(r),pn({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(b(),ye(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(b(),I("pre",HJ,B(g.value.content),1)):(b(),I("div",pn({key:3},l.value,{innerHTML:g.value.content}),null,16,WJ))],64)):(b(),I("div",zJ,[In(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Pu.install=e=>{e.component(Pu.__name,Pu)};const UJ={dir:"auto",class:"paragraph-node"},jJ=["custom-id"],na=hn(qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=P(()=>{var x;return(x=s?.value)!=null?x:"safe"}),c=P(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=P(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=P(()=>{var x,E;return(E=t.customHtmlTags)!=null?E:(x=l?.value)==null?void 0:x.customHtmlTags}),f=P(()=>{var x,E;const N=(x=l?.value)!=null?x:{};return Bt(it({},N),{customId:(E=t.customId)!=null?E:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1});function h(x){var E;return x.type==="text"&&String((E=x.content)!=null?E:"").trim()===""}const m=P(()=>t.node.children.filter(x=>!h(x))),_=P(()=>m.value.length>0&&m.value.every(x=>x.type==="image"||(function(E){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(T=>!h(T)):[]})(E);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(x))),k=P(()=>new Set(Fc(d.value))),g=P(()=>{if(!_.value||m.value.length<=1)return t.node.children;const x=[];for(let E=0;E<t.node.children.length;E++){const N=t.node.children[E];if(!h(N)){x.push(N);continue}const F=x.length>0,S=t.node.children.slice(E+1).some(T=>!h(T));F&&S&&x.push(Bt(it({},N),{content:" ",raw:" "}))}return x}),v=P(()=>o?.value===!1&&!n.value.text),y=P(()=>v.value?Ec(g.value):null);function A(x,E){return{node:x,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=P(()=>it({inline_code:qs,image:il,link:ro,hardbreak:rl,emphasis:lo,strong:oo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,html_inline:Ho,html_block:Pu,emoji:yo,checkbox:Do,math_inline:Ci,checkbox_input:Do,reference:so,footnote_anchor:Du,footnote_reference:Po,text:Zn},n.value)),$=P(()=>g.value.map((x,E)=>{var N;const F=(function(S){var T,R,O,D;if(S.type==="html_block"||S.type==="html_inline"){const W=String((T=S.tag)!=null?T:"").trim().toLowerCase()||r6(S.content);if(W&&!k.value.has(W)&&l6((R=S.content)!=null?R:S.raw,W)){const z=String((D=(O=S.content)!=null?O:S.raw)!=null?D:"");return{child:{type:"text",content:z,raw:z},component:Zn,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Td(String(S.type)))}})(x);return Bt(it({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?jy(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:x})}));return(x,E)=>(b(),I("p",UJ,[y.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(y.value),9,jJ)):(b(!0),I(Be,{key:1},nt($.value,N=>{return b(),I(Be,{key:N.key},[_.value&&h(N.originalChild)?(b(),I(Be,{key:0},[Ge(B((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(b(),ye($s(N.component),pn({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[N.hasSlotChildren?(b(),ye(C(p),pn({key:0,ref_for:!0},f.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(b(),ye(C(p),pn({key:1,ref_for:!0},f.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),ye($s(N.component),pn({key:2,ref_for:!0},A(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);na.install=e=>{e.component(na.__name,na)};const qJ={class:"table-node-wrapper"},VJ=["aria-busy"],KJ={key:0},GJ=["custom-id"],YJ=["aria-label","onPointerdown"],ZJ=["custom-id"],QJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Hu=hn(qe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=P(()=>{var k;return(k=t.node.loading)!=null&&k}),s=P(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=Q(null),i=Q([]);let r=null;const l=P(()=>t.node.header.cells.length),a=P(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=P(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade));const u=us(()=>t.customId),d=P(()=>!!u.value.text),f=P(()=>!!u.value.paragraph),p=new WeakMap;function h(k){const g=t.fade===!1&&!d.value,v=!f.value,y=p.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=Jh(k.children,v,!0),L={simpleChildren:A,plainText:A&&g?Ec(A):null};return p.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return Ke(l,()=>{_(),i.value=[]}),es(_),(k,g)=>(b(),I("div",qJ,[w("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),I("colgroup",KJ,[(b(!0),I(Be,null,nt(e.node.header.cells,(v,y)=>(b(),I("col",{key:y,style:qt(c.value[y])},null,4))),128))])):le("",!0),w("thead",null,[w("tr",null,[(b(!0),I(Be,null,nt(e.node.header.cells,(v,y)=>(b(),I("th",{key:y,dir:"auto",class:De([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[h(v).plainText!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(h(v).plainText),9,GJ)):h(v).simpleChildren?(b(),ye(C(fd),{key:1,nodes:h(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(b(),ye(C(_o),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>k.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(b(),I("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(L,$){if($.button!==0)return;const x=(function(){var F;const S=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],T=>Math.round(T.getBoundingClientRect().width))})(),E=x[L],N=x[L+1];E&&N&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:E,nextStartWidth:N,widths:x},i.value=x,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,A)},null,40,YJ)):le("",!0)],2))),128))])]),w("tbody",null,[(b(!0),I(Be,null,nt(s.value,(v,y)=>(b(),I("tr",{key:y},[(b(!0),I(Be,null,nt(v.cells,(A,L)=>(b(),I("td",{key:L,class:De([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(A).plainText!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(h(A).plainText),9,ZJ)):h(A).simpleChildren?(b(),ye(C(fd),{key:1,nodes:h(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),ye(C(_o),{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:g[1]||(g[1]=$=>k.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,VJ),ie(cl,{name:"table-node-fade"},{default:Ee(()=>[n.value?(b(),I("div",QJ,[In(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):le("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Hu.install=e=>{e.component(Hu.__name,Hu)};const XJ={class:"hr-node"},eh=hn({},[["render",function(e,t){return b(),I("hr",XJ)}],["__scopeId","data-v-39b2349c"]]);eh.install=e=>{e.component(eh.__name,eh)};const JJ={class:"unknown-node"},nv=qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),I("div",JJ,B(e.node.raw),1))}),th=hn(qe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=P(()=>`vmr-container vmr-container-${t.node.name}`),s=us(()=>t.customId),o=P(()=>it({text:Zn,paragraph:na,heading:ep,inline_code:qs,link:ro,image:il,strong:oo,emphasis:lo,strikethrough:io,insert:xo,subscript:bo,superscript:ko,checkbox:Do,checkbox_input:Do,hardbreak:rl,math_inline:Ci,reference:so,list:bc,math_block:g5,table:Hu},s.value));return(i,r)=>(b(),I("div",pn({class:n.value},e.node.attrs),[(b(!0),I(Be,null,nt(e.node.children,(l,a)=>{return b(),ye($s((c=l.type,o.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"]]);th.install=e=>{e.component(th.__name,th)};const eee=["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"],hS=[[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 tee(e){if(e<=255)return eee[e];let t=0,n=hS.length-1;for(;t<=n;){const s=t+n>>1,o=hS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const nee=/[ \t\n\r\f]+/g,see=/[\t\n\r\f]| {2,}|^ | $/;let f0=null;const oee=new RegExp("\\p{Script=Arabic}","u"),sm=new RegExp("\\p{M}","u"),y5=new RegExp("\\p{Nd}","u");function pS(e){return oee.test(e)}function mS(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 gr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(mS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(mS(n))return!0}}return!1}const iee=new Set([" "," ","","\uFEFF"]);function ree(e){return gr(e)}function sv(e){return!(function(t){const n=tp(t);return n!==null&&(qy.has(n)||la.has(n))})(e)&&!(function(t){const n=tp(t);return n!==null&&iee.has(n)})(e)}const qy=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),om=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Vy=new Set(["'","’"]),la=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),lee=new Set([":",".","،","؛"]),aee=new Set(["၏"]),cee=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function uee(e){if(Ky(e))return!0;let t=!1;for(const n of e)if(la.has(n))t=!0;else if(!t||!sm.test(n))return!1;return t}function dee(e){for(const t of e)if(!qy.has(t)&&!la.has(t))return!1;return e.length>0}function fee(e){if(Ky(e))return!0;for(const t of e)if(!om.has(t)&&!Vy.has(t)&&!sm.test(t))return!1;return e.length>0}function Ky(e){let t=!1;for(const n of e)if(n!=="\\"&&!sm.test(n)){if(!(om.has(n)||la.has(n)||Vy.has(n)))return!1;t=!0}return t}function k5(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function tp(e){if(e.length===0)return null;const t=k5(e,e.length);return e.slice(t)}function hee(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(sm.test(s))n--;else{if(!om.has(s)&&!Vy.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function pee(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function gS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function vS(e,t){return e&&t!==null&&lee.has(t)}function mee(e){const t=tp(e);return t!==null&&aee.has(t)}function gee(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 ov(e){let t=e.length;for(;t>0;){const n=k5(e,t),s=e.slice(n,t);if(cee.has(s))return!0;if(!la.has(s))return!1;t=n}return!1}function vee(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
274
|
+
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const p=c.exec(f);if(!p)return f!=="["&&!/^\[\d+$/.test(f);const h=String(p[1]??"");return f.slice(p[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},d=(f,p)=>{const h=f;if(h.src[h.pos]!=="[")return!1;const m=a.exec(h.src.slice(h.pos));if(!m)return!1;const _=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const k=h.src.slice(h.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))return!1;if(!p){const g=m[1],v=h.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return h.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,p)=>{const m=String(f[p].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function qQ({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 J6({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:qQ({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const zw=new WeakMap;function VQ(e){let t=zw.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},zw.set(e,t)),t}function Uw(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function Ry(e){return!!(e.themes?.length||e.langs?.length)}function e5(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function KQ(e,t){return!t?.length||e.registeredAllLangs?!0:e5(e.registeredLangs,t)}function o0(e,t){return Ry(t)&&e5(e.registeredThemes,t.themes)&&KQ(e,t.langs)}function GQ(e,t){if(!Ry(t))return t;const n=Uw(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:Uw(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const YQ={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 ZQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function t5(e){const t=ZQ(e);return YQ[t]??t}function n5(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>t5(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function s5(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function QQ(e){return s5(e)?.join("\0")??""}function o5(e,t){const n=s5(e),s=n5(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Zh(e,t){return`${QQ(e)}\0\0${n5(t)?.join("\0")??""}`}function Ybe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=o5(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Zh(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Zbe(e,t={},n){if(!e)return"ready";const s=o5(t.themes,t.langs),o=Zh(s.themes,s.langs),i=n&&n===o?n:o,r=VQ(e);if(r.completed.has(i))return"ready";if(o0(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||o0(r,s))return r.completed.add(i),"ready";const c=GQ(r,s),u=Zh(c.themes,c.langs);return r.completed.has(u)||o0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(Ry(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 Pa(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function jw(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var XQ=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,p=this.pendingChars<=0;if(this.source+=d,p){const h=qw();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=qw();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),p=Math.min(100,Math.max(0,d-this.lastTick));if(p<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const h=this.pendingChars,m=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=nX(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=tX(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Pa(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Pa(s,1e3,1)),this.normalizedTargetLatencyMs=Pa(o,900,1),this.normalizedCatchUpLatencyMs=Pa(i,350,1),this.normalizedCatchUpThreshold=jw(r,600),this.normalizedStartDelayMs=jw(a,80),this.maxCommitFps=Math.trunc(Pa(l,30,1)),this.maxCharsPerCommit=Math.trunc(Pa(c,80,1)),this.flushOnFinish=u,this.segmenter=eX(),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 JQ(e={},t){const n=new XQ(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 eX(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function tX(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function qw(){return typeof performance<"u"?performance.now():Date.now()}function nX(e,t,n){return Math.min(n,Math.max(t,e))}var sX=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Hg=Symbol.for("markstream-vue:node-lifecycle"),Vw='<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>',Kw='<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>',oX={id:"material",core:{"":Kw,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:Kw,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:Vw,csharp:Vw,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:()=>eo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Wg=new Map;let Gw="material";const sc=new Map,Yw=new Map;let zg=null;function iX(e){Wg.set(e.id,e)}function rX(e){return sX(this,null,function*(){var t,n,s;if(sc.has(e.id))return(t=sc.get(e.id))!=null?t:null;let o=Yw.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(sc.set(e.id,i),zg?.(),i)).catch(()=>(sc.set(e.id,null),null)),Yw.set(e.id,o)),o})}const lX=fa(0);zg=()=>{lX.value++},iX(oX);const aX={"":"",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 By(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=aX[n])!=null?t:n}function Qbe(e){const t=By(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Xbe(e){return(function(s){const o=Wg.get(Gw);if(!o)return;const i=o.core[s];if(i)return i;const r=sc.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!sc.has(o.id)&&rX(o)})(By(e))||((n=(t=Wg.get(Gw))==null?void 0:t.fallback)!=null?n:"");var t,n}const Jbe={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 i5=!1;function exe(){return i5}function txe(){i5=!0}var em=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Lo=null,Gf=!1,tm=Py;function nm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Dy(){try{const e=globalThis;return nm(e?.katex)}catch{return null}}function Py(){return em(null,null,function*(){const e=Dy();if(e)return e;const t=yield eo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield eo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return nm(t)})}function cX(e){tm=e,Lo=null,Gf=!1}function uX(e){cX(Py)}function r5(){return typeof tm=="function"}function nxe(){var e;const t=tm;if(!t||t===Py)return null;if(Lo)return Lo;const n=Dy();if(n)return Lo=n,Lo;try{const s=t();return s&&typeof s?.then!="function"?(Lo=(e=nm(s))!=null?e:s,Lo):null}catch{return null}}function Hy(){return em(this,null,function*(){var e;const t=Dy();if(t)return Lo=t,Lo;if(Lo)return Lo;if(Gf)return null;const n=tm;if(!n)return Gf=!0,null;try{const s=yield n();if(s)return Lo=(e=nm(s))!=null?e:s,Lo}catch{}return Gf=!0,null})}function l5(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let el=null,Gr=null;const si=new Map,pr=new Map;let Qh=5;const Gl=new Set;function dd(){if(si.size<Qh&&Gl.size){const e=Array.from(Gl);Gl.clear();for(const t of e)try{t()}catch{}}}function dX(e){el=e,Gr=null,el.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=si.get(n);if(i)if(si.delete(n),clearTimeout(i.timeoutId),dd(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(pr.set(a,s),pr.size>200){const c=pr.keys().next().value;pr.delete(c)}}i.resolve(s)}},el.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of si.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));si.clear(),dd()}}function fX(){var e;el&&((e=el.terminate)==null||e.call(el)),el=null,Gr=null}function hX(e,t=!0,n=2e3,s){return em(this,null,function*(){performance.now();const o=l5(e);if(!r5()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Gr)return Promise.reject(Gr);const i=`${t?"d":"i"}:${o}`,r=pr.get(i);if(r)return Promise.resolve(r);const l=el||(Gr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Gr.name="WorkerInitError",Gr.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Gr);if(si.size>=Qh){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=si.size,a.max=Qh,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const h=new Error("Aborted");return h.name="AbortError",void c(h)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{si.delete(u);const h=new Error("Worker render timed out");h.name="WorkerTimeout",h.code="WORKER_TIMEOUT",c(h),dd()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),si.has(u)&&si.delete(u);const h=new Error("Aborted");h.name="AbortError",c(h),dd()},{once:!0});const f=a,p=c;si.set(u,{resolve:h=>{f(h)},reject:h=>{p(h)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function sxe(e,t=!0,n){const s=`${t?"d":"i"}:${l5(e)}`;if(pr.set(s,n),pr.size>200){const o=pr.keys().next().value;pr.delete(o)}}const pX="WORKER_BUSY";function mX(e=2e3,t){return si.size<Qh?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Gl.delete(r),n())};if(Gl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Gl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>dd()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Gl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const cu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function oxe(e){return em(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!r5()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:cu.timeout,c=(i=s.waitTimeout)!=null?i:cu.waitTimeout,u=(r=s.backoffMs)!=null?r:cu.backoffMs,d=(l=s.maxRetries)!=null?l:cu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):cu.maxRetries,p=s.signal;let h=0;for(;;){if(p?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield hX(t,n,a,p)}catch(m){if(m?.code!==pX||h>=f)throw m;if(h++,yield mX(c,p).catch(()=>{}),p?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*h)))}}})}function oc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function gX(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Ug(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=gX(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function jg(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 a5(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function qg(e,t=360,n=500){return a5(e,t,n)}function Vg(e,t=360,n=500){return a5(e,t,n)}var vX=Object.defineProperty,yX=Object.defineProperties,kX=Object.getOwnPropertyDescriptors,Zw=Object.getOwnPropertySymbols,bX=Object.prototype.hasOwnProperty,xX=Object.prototype.propertyIsEnumerable,Qw=(e,t,n)=>t in e?vX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c5=(e,t)=>{for(var n in t||(t={}))bX.call(t,n)&&Qw(e,n,t[n]);if(Zw)for(var n of Zw(t))xX.call(t,n)&&Qw(e,n,t[n]);return e},Wy=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const zy=()=>eo(()=>import("./mermaid.core-DcE0EhAy.js").then(e=>e.bn),[]);let nr=null,Uy=zy;function _X(e){Uy=e,nr=null}function wX(e){_X(zy)}function SX(){return typeof Uy=="function"}function Xw(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 o=t.mermaidAPI;return n=c5({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},yX(n,kX(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function Jw(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=c5({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function ixe(){return Wy(this,null,function*(){if(nr)return nr;const e=(function(){try{const s=globalThis;return Xw(s?.mermaid)}catch{return null}})();if(e)return nr=e,Jw(nr),nr;const t=Uy;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===zy?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(nr=Xw(n),Jw(nr),nr):null})}let Xs=null,Yr=null;const Ns=new Map;let eS=5,tS=!1;const CX="WORKER_BUSY",AX="MERMAID_DISABLED";function MX(e){Xs=e,Yr=null;const t=e;Xs.onmessage=n=>{if(Xs!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Ns.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Xs.onerror=n=>{var s,o;if(Xs===t)if(Ns.size!==0){try{tS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Ns.entries())r.reject(new Error(`Worker error: ${n.message}`));Ns.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Xs.onmessageerror=n=>{var s,o;if(Xs===t)if(Ns.size!==0){try{tS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Ns.entries())r.reject(new Error("Worker messageerror"));Ns.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function EX(){var e;if(Xs)try{for(const[t,n]of Ns.entries())n.reject(new Error("Worker cleared"));Ns.clear(),(e=Xs.terminate)==null||e.call(Xs)}catch{}Xs=null,Yr=null}function u5(e,t,n=1400){if(!SX()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=AX,Promise.reject(o)}if(Yr)return Promise.reject(Yr);const s=Xs||(Yr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Yr.name="WorkerInitError",Yr.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Yr);if(Ns.size>=eS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=CX,o.inFlight=Ns.size,o.max=eS,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Ns.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Ns.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Ns.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=Ns.get(r);f&&f.reject(d)},n)})}function rxe(e,t,n=1400){return Wy(this,null,function*(){try{return yield u5("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function lxe(e,t,n=1400){return Wy(this,null,function*(){try{return yield u5("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function axe(){if(Xs)try{for(const[e,t]of Ns.entries())t.reject(new Error("Worker terminated"));Ns.clear(),Xs.terminate()}finally{Xs=null}}var TX=Object.defineProperty,NX=Object.defineProperties,IX=Object.getOwnPropertyDescriptors,nS=Object.getOwnPropertySymbols,$X=Object.prototype.hasOwnProperty,LX=Object.prototype.propertyIsEnumerable,sS=(e,t,n)=>t in e?TX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))$X.call(t,n)&&sS(e,n,t[n]);if(nS)for(var n of nS(t))LX.call(t,n)&&sS(e,n,t[n]);return e},Bt=(e,t)=>NX(e,IX(t)),zn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const FX="__global__",i0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Kg=(()=>{const e=globalThis;if(e[i0])return e[i0];const t={scopedCustomComponents:{},revision:fa(0)};return e[i0]=t,t})(),oS=Kg.revision,OX=Symbol("markstreamCustomComponents"),RX=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 Td(e){return RX.has(String(e).trim().toLowerCase())}function BX(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,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([di(n),di(BX(n))]))!o||Td(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function us(e){const t=Ut(OX,null);return P(()=>{var n;return oS.value,(function(s,o={}){return oS.value,it(it(it({},r0(Kg.scopedCustomComponents[FX]||{})),r0(o)),r0((function(i){return i&&Kg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const DX=["aria-label"],PX={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"},HX={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"},hn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Do=hn(qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),I("svg",HX,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),I("svg",PX,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,DX))}),[["__scopeId","data-v-be21ab83"]]);Do.install=e=>{e.component(Do.__name,Do)};const WX={class:"emoji-node"},yo=hn(qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("span",WX,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);yo.install=e=>{e.component(yo.__name,yo)};const zX=["id"],UX=["title"],Po=hn(qe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(b(),I("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,UX)],8,zX))}}),[["__scopeId","data-v-c1463a29"]]);Po.install=e=>{e.component(Po.__name,Po)};const d5=(()=>{try{return!1}catch{}return!1})();function l0(e){d5&&console.warn(e)}function iS(e,t="safe",n){return Oy(e,t,n)}function f5(e){return _Q(e)}function a0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function jy(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Pg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),a0(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),a0(r.value)]):Object.entries(o).map(([r,l])=>[r,a0(l)]):null,t,n);var o;if(!s)return;const i=f5(Yh(s));return Object.keys(i).length>0?i:void 0}function rS(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function uu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function c0(e,t,n,s,o,i,r=!1){const l=(function(d,f){return Y6(d,f)})(e,s);if(Ad.has(e.toLowerCase())||!l&&V6(e,i))return null;if(!l&&Fy(e,i))return r?[rS(e,t,!0)]:[rS(e,t),...n,`</${e}>`];const a=Oy(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=f5(a);return dn(d,Bt(it({},f),{key:u}),n.length>0?n:void 0)}return dn(e,Bt(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function h5(e,t){return AQ(e,t)}function Xh(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=c0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);uu(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 p=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){p=h;break}if(p!==-1)for(;c.length>p;){const h=c.pop(),m=c0(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?uu(c[c.length-1].children,m):uu(u,m),h.tagName.toLowerCase()!==f&&c.length>p&&l0(`Auto-closing unclosed tag: <${h.tagName}>`)}else l0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=c0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?uu(c[c.length-1].children,f):uu(u,f),l0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(wQ(e),t,n)}catch(o){return s=o,d5&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const jX=["innerHTML"],Ho=hn(qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=P(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=us(()=>t.customId),i=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=P(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:yc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Xh(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!h5(l,o.value))return{mode:"html",content:yc(l,s.value)};const a=Xh(l,o.value,s.value);return a===null?{mode:"html",content:yc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),I("span",{key:0,class:De(["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"?(b(),I("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(b(),I("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,jX))}}),[["__scopeId","data-v-d17f12b0"]]);Ho.install=e=>{e.component(Ho.__name,Ho)};const qX={class:"inline-code"},VX={key:0},qs=hn(qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=bd(),s=Ut("markstreamFade",void 0),o=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=P(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=P(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=P(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=P(()=>!l.value),u=P(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Q(t.node.code),f=Q("");let p=i?.value;const h=Q(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}Ke([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const L=String(g??""),$=u.value,x=A!==p;p=A;const E=J6({nextContent:L,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(h.value+=1),$&&o?.set($,L)},{immediate:!0}),Ke(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=P(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(b(),I("code",qX,[c.value?(b(),I(Be,{key:0},[Ge(B(a.value),1)],64)):(b(),I(Be,{key:1},[d.value?(b(),I("span",VX,B(d.value),1)):le("",!0),f.value?(b(),I("span",{key:1,class:De(["inline-code-stream-delta",[k.value]]),onAnimationend:_},B(f.value),35)):le("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);qs.install=e=>{e.component(qs.__name,qs)};const Gg=Q(!1),lS=Q(""),aS=Q("top"),Ru=Q(null),Bu=Q(null),Yg=Q(null),Zg=Q(null),cS=Q(null);let Yf=null,Zf=null,Qg=0;function p5(){Yf&&(clearTimeout(Yf),Yf=null),Zf&&(clearTimeout(Zf),Zf=null)}let Tf=!1,Nf=null,uS=!1;function KX(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Qg;p5();const l=()=>zn(null,null,function*(){var a,c;if(yield(function(){return zn(this,null,function*(){if(!Tf&&!uS&&typeof document<"u"){Nf!=null||(Nf=zn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([eo(()=>import("./vue.runtime.esm-bundler-ClW1ucng.js"),[]),eo(()=>import("./Tooltip-CXVZw3LD.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:Gg.value,"anchor-el":Ru.value,content:lS.value,placement:aS.value,id:Bu.value,originX:Yg.value,originY:Zg.value,isDark:(h=cS.value)!=null?h:void 0})}}).mount(p),Tf=!0}));try{yield Nf}catch(u){Tf=!1,Nf=null,uS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Tf&&r===Qg){Bu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ru.value=e,lS.value=t,aS.value=n,Yg.value=(a=o?.x)!=null?a:null,Zg.value=(c=o?.y)!=null?c:null,cS.value=typeof i=="boolean"?i:null,Gg.value=!0;try{e.setAttribute("aria-describedby",Bu.value)}catch{}}});s?l():Yf=setTimeout(l,80)}function GX(e=!1){Qg+=1,p5();const t=()=>{if(Ru.value&&Bu.value)try{Ru.value.removeAttribute("aria-describedby")}catch{}Gg.value=!1,Ru.value=null,Bu.value=null,Yg.value=null,Zg.value=null};e?t():Zf=setTimeout(t,120)}const Xg={"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..."},Jg=e=>{var t;return(t=Xg[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function dS(e){return{t(t){if(e.te&&Xg[t]&&!e.te(t))return Jg(t);const n=e.t(t);return n===t&&Xg[t]?Jg(t):n}}}function YX(){const e=(function(){var t,n;try{const s=Os(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return dS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return dS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Jg}}function ZX(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const QX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],XX={key:1,class:"image-placeholder"},JX={key:1,class:"image-node__raw-text"},eJ={key:0,class:"image-shimmer-overlay"},tJ={key:1,class:"image-node__raw-text"},nJ={key:2,class:"image-error"},il=hn(qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=Q(!1),i=Q(!1),r=Q(""),l=Q("primary"),a=Q(null),c=bd(),u=Ut(Hg,null);let d="",f=null;const p=P(()=>q_(n.node.src)),h=P(()=>q_(n.fallbackSrc)),m=P(()=>r.value),_=P(()=>!n.lazy),k=P(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=P(()=>l.value==="failed"),v=P(()=>!_.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=P(()=>ZX(n,c));function A(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=y.value){R&&pt(()=>{A(R)})}function $(){f&&(clearTimeout(f),f=null)}function x(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),$(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(L(R),E())},8e3)))}function E(){return zn(this,null,function*(){const R=d;R&&($(),d="",yield pt(),A(R),u?.markSettled(R))})}function N(){if(l.value==="primary"&&h.value&&h.value!==r.value)return l.value="fallback",r.value=h.value,o.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,s("error",r.value),L()}function F(){o.value=!0,i.value=!1,s("load",m.value),L()}function S(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,m.value])}const{t:T}=YX();return Ke([p,h,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||p.value?(r.value=p.value,void(l.value="primary")):h.value?(r.value=h.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ke([k,o,i,m,()=>n.lazy],([R,O,D,W,z])=>R&&W&&!D?O?(E(),void L()):z?(x(),void L()):void(O||D||x()):(E(),void L()),{flush:"post",immediate:!0}),es(()=>{(function(){const R=d;R&&($(),d="",u?.markSettled(R))})()}),(R,O)=>{var D,W,z,V,U;return b(),I("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(b(),I("img",{key:0,src:m.value,alt:String((W=(D=n.node.alt)!=null?D:n.node.title)!=null?W:""),title:String((V=(z=n.node.title)!=null?z:n.node.alt)!=null?V:""),class:De(["image-node__img",{"is-loading":!_.value&&!o.value,"is-loaded":_.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(U=n.node.alt)!=null?U:C(T)("image.preview"),onError:N,onLoad:F,onClick:S},null,42,QX)):le("",!0),e.node.loading&&!i.value?(b(),I("span",XX,[n.usePlaceholder?In(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[0]||(O[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),I("span",JX,B(e.node.raw),1))])):le("",!0),ie(cl,{name:"shimmer-fade"},{default:Ee(()=>[v.value&&!e.node.loading?(b(),I("span",eJ,[n.usePlaceholder?In(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[1]||(O[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),I("span",tJ,B(e.node.raw),1))])):le("",!0)]),_:3}),g.value?(b(),I("span",nJ,[In(R.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[2]||(O[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("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)),w("span",null,B(C(T)("image.loadError")),1)],!0)])):le("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);il.install=e=>{e.component(il.__name,il)};const sJ={key:2},Ui=qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),i=P(()=>{var h;return(h=s?.value)!=null?h:"safe"}),r=P(()=>{var h,m;const _=(h=o?.value)!=null?h:{};return Bt(it({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1}),a=P(()=>t.components[String(t.node.type)]),c=P(()=>!!(a.value&&n.value[t.node.type]&&!Td(String(t.node.type)))),u=P(()=>c.value?jy(t.node,i.value):void 0),d=P(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=P(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=P(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(b(),ye($s(a.value),pn({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?(b(),ye(C(l),pn({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?(b(),ye(C(l),pn({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"])):le("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),ye($s(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),I("span",sJ,B(p.value),1)):le("",!0)}}),oJ=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],iJ={key:0,translate:"no",class:"markstream-pre__diff-code"},rJ={class:"markstream-pre__diff-number","aria-hidden":"true"},lJ={class:"markstream-pre__diff-content"},aJ={class:"markstream-pre__diff-content-inner"},cJ={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},uJ=["textContent"],$o=qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=P(()=>{var S,T,R;const O=String((T=(S=t.node)==null?void 0:S.language)!=null?T:"");return String((R=String(O).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=P(()=>`language-${n.value}`),o=P(()=>{var S,T,R,O,D;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(T=t.node)==null?void 0:T.code)!=null?R:""):(function(W,z){const V=String(W??"");return z?V:V.replace(/\r\n$|\n$|\r$/,"")})((O=t.node)==null?void 0:O.code,((D=t.node)==null?void 0:D.loading)===!0)}),i=P(()=>o.value.split(/\r\n|\n|\r/)),r=P(()=>Array.from({length:Math.max(1,i.value.length)},(S,T)=>T+1)),l=P(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=P(()=>l.value&&t.diffInline===!0),c=P(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const T=`${Math.ceil(S)}px`;return{height:T,minHeight:T,maxHeight:T,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,T="context",R={}){const O=u(S);return{code:S,kind:O&&T!=="hunk"&&!R.preserveBlankKind?"context":T,empty:O}}function f(S){const T=String(S??"");return T?T.split(/\r\n|\n|\r/):[]}function p(S,T){return!u(S[T])||T<S.length-1}function h(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function _(S,T){const R=f(S),O=f(T),D=(function(ae,te){const Z=ae.length,ne=te.length;if((Z+1)*(ne+1)>15e5)return null;const ke=ne+1,Se=new Uint32Array((Z+1)*(ne+1));for(let ce=1;ce<=Z;ce++)for(let fe=1;fe<=ne;fe++){const j=ce*ke+fe;if(ae[ce-1]===te[fe-1])Se[j]=Se[(ce-1)*ke+(fe-1)]+1;else{const se=Se[(ce-1)*ke+fe],ge=Se[ce*ke+(fe-1)];Se[j]=se>=ge?se:ge}}const Ye=[];let ve=Z,Y=ne;for(;ve>0&&Y>0;)ae[ve-1]===te[Y-1]?(Ye.push({originalIndex:ve-1,modifiedIndex:Y-1}),ve--,Y--):Se[(ve-1)*ke+Y]>=Se[ve*ke+(Y-1)]?ve--:Y--;return Ye.reverse(),Ye})(R,O);if(D){const ae=[];let te=0,Z=0;for(const ne of D){for(;te<ne.originalIndex;)ae.push(Bt(it({},d(R[te],"removed",{preserveBlankKind:p(R,te)})),{key:`inline-removed-source-${te}`,number:""})),te++;for(;Z<ne.modifiedIndex;)ae.push(Bt(it({},d(O[Z],"added",{preserveBlankKind:p(O,Z)})),{key:`inline-added-source-${Z}`,number:Z+1})),Z++;ae.push(Bt(it({},d(O[ne.modifiedIndex])),{key:`inline-context-source-${ne.originalIndex}-${ne.modifiedIndex}`,number:ne.modifiedIndex+1})),te=ne.originalIndex+1,Z=ne.modifiedIndex+1}for(;te<R.length;)ae.push(Bt(it({},d(R[te],"removed",{preserveBlankKind:p(R,te)})),{key:`inline-removed-source-${te}`,number:""})),te++;for(;Z<O.length;)ae.push(Bt(it({},d(O[Z],"added",{preserveBlankKind:p(O,Z)})),{key:`inline-added-source-${Z}`,number:Z+1})),Z++;return ae}const W=[];let z=0,V=R.length-1,U=O.length-1;for(;z<=V&&z<=U&&R[z]===O[z];)W.push(Bt(it({},d(O[z])),{key:`inline-prefix-${z}`,number:z+1})),z++;const re=[];for(;V>=z&&U>=z&&R[V]===O[U];)re.unshift(Bt(it({},d(O[U])),{key:`inline-suffix-${U}`,number:U+1})),V--,U--;for(let ae=z;ae<=V;ae++)W.push(Bt(it({},d(R[ae],"removed",{preserveBlankKind:p(R,ae)})),{key:`inline-removed-source-${ae}`,number:""}));for(let ae=z;ae<=U;ae++)W.push(Bt(it({},d(O[ae],"added",{preserveBlankKind:p(O,ae)})),{key:`inline-added-source-${ae}`,number:ae+1}));return W.concat(re)}const k=P(()=>{var S,T,R,O;const D=(function(U){const re=U.some(te=>h(te)),ae=U.some(te=>m(te));return re&&ae||(function(){var te,Z,ne,ke;if(n.value==="diff")return!0;const Se=(ke=(ne=String((Z=(te=t.node)==null?void 0:te.raw)!=null?Z:"").split(/\r?\n/,1)[0])==null?void 0:ne.trim())!=null?ke:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Se)})()&&(re||ae)})(i.value),W=(function(){var U,re;return((U=t.node)==null?void 0:U.originalCode)!=null||((re=t.node)==null?void 0:re.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:D?(function(U){const re=[];let ae=1;for(const[te,Z]of U.entries())if(Z.startsWith("@@"))re.push(Bt(it({},d(Z,"hunk")),{key:`inline-hunk-${te}`,number:""}));else if(h(Z))re.push(Bt(it({},d(Z.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${te}`,number:""}));else if(m(Z))re.push(Bt(it({},d(Z.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${te}`,number:ae++}));else{const ne=Z.startsWith(" ")?Z.slice(1):Z;re.push(Bt(it({},d(ne)),{key:`inline-context-${te}`,number:ae})),ae++}return re})(i.value):_((S=t.node)==null?void 0:S.originalCode,(T=t.node)==null?void 0:T.updatedCode)}];if(!D&&W){const U=f((R=t.node)==null?void 0:R.originalCode),re=f((O=t.node)==null?void 0:O.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((ae,te)=>{const Z=re[te]===ae?"context":"removed";return Bt(it({},d(ae,Z,{preserveBlankKind:p(U,te)})),{key:`original-${te}`,number:te+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:re.map((ae,te)=>{const Z=U[te]===ae?"context":"added";return Bt(it({},d(ae,Z,{preserveBlankKind:p(re,te)})),{key:`modified-${te}`,number:te+1})})}]}const z=[],V=[];for(const U of i.value)if(U.startsWith("@@"))z.push(d(U,"hunk")),V.push(d(U,"hunk"));else if(U.startsWith("-")&&!U.startsWith("---"))z.push(d(U.slice(1),"removed",{preserveBlankKind:!0}));else if(U.startsWith("+")&&!U.startsWith("+++"))V.push(d(U.slice(1),"added",{preserveBlankKind:!0}));else{const re=U.startsWith(" ")?U.slice(1):U;z.push(d(re)),V.push(d(re))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:z.map((U,re)=>Bt(it({},U),{key:`original-${re}`,number:re+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:V.map((U,re)=>Bt(it({},U),{key:`modified-${re}`,number:re+1}))}]}),g=P(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Q(null),y=Q([]);let A=null,L=null;function $(S){const T=Number.parseFloat(String(S??""));return Number.isFinite(T)&&T>0?T:0}function x(S,T){var R;if(!S)return T;const O=S.querySelector(".markstream-pre__diff-content"),D=O?.getBoundingClientRect(),W=(R=D?.height)!=null?R:0;return Math.max(T,Math.ceil(W))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,T;A=null;const R=v.value;if(!R||!l.value)return void(y.value.length&&(y.value=[]));const O=(function(ae){const te=window.getComputedStyle(ae),Z=$(te.getPropertyValue("--markstream-pre-diff-line-height"));if(Z>0)return Z;const ne=$(te.lineHeight);return ne>0?ne:18})(R),D=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),W=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),z=Math.max(D.length,W.length),V=[];for(let ae=0;ae<z;ae++){const te=x((S=D[ae])!=null?S:null,O),Z=x((T=W[ae])!=null?T:null,O),ne=Math.max(O,te,Z);V.push({rowHeight:ne,originalHeight:te,modifiedHeight:Z})}var U,re;U=y.value,re=V,U.length===re.length&&U.every((ae,te)=>{const Z=re[te];return Z&&Math.abs(ae.rowHeight-Z.rowHeight)<=.5&&Math.abs(ae.originalHeight-Z.originalHeight)<=.5&&Math.abs(ae.modifiedHeight-Z.modifiedHeight)<=.5})||(y.value=V)})()}))}function N(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{E()}),L.observe(S))}function F(S,T){const R=y.value[S];if(!R)return;const O=T==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(O)}px`}}return Ke(v,S=>{N(S),pt(()=>E())},{flush:"post"}),Ke([l,k],()=>{N(v.value),pt(()=>E())},{flush:"post",immediate:!0}),es(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),L?.disconnect(),L=null}),(S,T)=>(b(),I("pre",{ref_key:"preRef",ref:v,style:qt(c.value),class:De([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(b(),I("code",iJ,[(b(!0),I(Be,null,nt(k.value,R=>(b(),I("span",{key:R.key,class:De(["markstream-pre__diff-pane",R.className])},[(b(!0),I(Be,null,nt(R.lines,(O,D)=>(b(),I("span",{key:O.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${O.kind}`,{"markstream-pre__diff-line--empty":O.empty}]]),style:qt(F(D,R.key))},[T[0]||(T[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",rJ,B(O.number),1),w("span",lJ,[w("span",aJ,B(O.code),1)])],6))),128))],2))),128))])):(b(),I(Be,{key:1},[t.showLineNumbers?(b(),I("span",cJ,[(b(!0),I(Be,null,nt(r.value,R=>(b(),I("span",{key:R,class:"markstream-pre__line-number"},B(R),1))),128))])):le("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:B(o.value)},null,8,uJ)],64))],14,oJ))}});$o.install=e=>{e.component($o.__name,$o)};const u0=fa(!1);let fS=null;const dJ={key:0},Zn=hn(qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(fS||(fS=Hy().then(k=>{u0.value=!!k}).catch(()=>{u0.value=!1})),ah(u0)),s=bd(),o=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=P(()=>{const k=s.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),a=P(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=P(()=>{var k;const g=(k=s["index-key"])!=null?k:s.indexKey;return g==null||g===""?"":String(g)}),u=Q(t.node.content),d=Q("");let f=r?.value;const p=Q(0);function h(){return u.value+d.value}function m(){d.value&&(u.value=h(),d.value="")}Ke([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const A=String(k??""),L=c.value,$=y!==f;f=y;const x=J6({nextContent:A,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(p.value+=1),L&&i?.set(L,A)},{immediate:!0}),Ke(a,k=>{var g;k||(g=h(),u.value=g,d.value="")});const _=P(()=>p.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(b(),I("span",{class:De([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(b(),I("span",dJ,B(u.value),1)):le("",!0),d.value?(b(),I("span",{key:1,class:De(["text-node-stream-delta",[_.value]]),onAnimationend:m},B(d.value),35)):le("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const m5=qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return dn($o,Bt(it({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),d0=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./CodeBlockNode-KR0ZBibg.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),$o}}),loadingComponent:m5,delay:0,suspensible:!1}),Ci=ki(()=>zn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return dn(Zn,Bt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Hy())return(yield eo(()=>import("./index6-DvvrfRua.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return dn(Zn,Bt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),g5=ki(()=>zn(null,null,function*(){try{if(yield Hy())return(yield eo(()=>import("./index5-B45mMYRO.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return dn(Zn,Bt(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),so=hn(qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),I("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);so.install=e=>{e.component(so.__name,so)};const fJ={class:"superscript-node"},ko=hn(qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,footnote_reference:Po,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,emoji:yo,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("sup",fJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);ko.install=e=>{e.component(ko.__name,ko)};const hJ={class:"subscript-node"},bo=hn(qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,footnote_reference:Po,strikethrough:io,highlight:Wo,insert:xo,superscript:ko,emoji:yo,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("sub",hJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);bo.install=e=>{e.component(bo.__name,bo)};const pJ={class:"strong-node"},oo=hn(qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("strong",pJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);oo.install=e=>{e.component(oo.__name,oo)};const mJ={class:"strikethrough-node"},io=hn(qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("del",mJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);io.install=e=>{e.component(io.__name,io)};const gJ=["href","title","aria-label","aria-hidden","target","rel"],vJ=["aria-hidden"],yJ={class:"link-text-wrapper relative inline-flex"},kJ={class:"leading-[normal] link-text"},ro=hn(qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Ut("markstreamShowTooltips",void 0),s=P(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=P(()=>{var k,g,v,y,A;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(k=t.animationOpacity)!=null?k:.35,x=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--underline-rest-opacity":String(x),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=us(()=>t.customId),r=P(()=>it({text:Zn,strong:oo,strikethrough:io,emphasis:lo,image:il,html_inline:Ho,inline_code:qs},i.value)),l=bd(),a=P(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,L]of Object.entries(v))A&&L!=null&&L!==!1&&(y[A]=L===!0?"":String(L));return iS(y,"safe","a")}),c=P(()=>it(it({},l),a.value)),u=P(()=>{var k,g;return iS({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=P(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(cK(u.value)?"_blank":void 0)}),f=P(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),p=P(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),h=P(()=>{const k=it({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&GX()}const _=P(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,y;return e.node.loading?(b(),I("span",pn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[w("span",yJ,[w("span",kJ,[ie(C(Zn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,vJ)):(b(),I("a",pn({key:0,class:"link-node",href:u.value,title:s.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:o.value,onMouseenter:g[0]||(g[0]=A=>(function(L){var $,x,E,N;if(!s.value)return;const F=L,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,T=(($=t.node)==null?void 0:$.title)||((x=u.value)!=null&&x.includes("xn--")&&((N=(E=t.node)==null?void 0:E.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";KX(L.currentTarget,T,"top",!1,S)})(A)),onMouseleave:m}),[(b(!0),I(Be,null,nt(e.node.children,(A,L)=>(b(),ye(C(Ui),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,gJ))}}}),[["__scopeId","data-v-367e6ca4"]]);ro.install=e=>{e.component(ro.__name,ro)};const bJ={class:"insert-node"},xo=hn(qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("ins",bJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);xo.install=e=>{e.component(xo.__name,xo)};const xJ={class:"highlight-node"},Wo=hn(qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,strikethrough:io,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("mark",xJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Wo.install=e=>{e.component(Wo.__name,Wo)};const _J={class:"emphasis-node"},lo=hn(qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("em",_J,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);lo.install=e=>{e.component(lo.__name,lo)};const wJ={class:"hard-break"},rl=hn(qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("br",wJ))}),[["__scopeId","data-v-50c58f70"]]);rl.install=e=>{e.component(rl.__name,rl)};const fd=qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=mt({checkbox:Do,checkbox_input:Do,emoji:yo,emphasis:lo,hardbreak:rl,highlight:Wo,inline_code:qs,insert:xo,link:ro,reference:so,strikethrough:io,strong:oo,subscript:bo,superscript:ko,text:Zn}),s=us(()=>t.customId),o=P(()=>{const i=s.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(b(!0),I(Be,null,nt(e.nodes,(l,a)=>(b(),ye(C(Ui),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function 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 Jh(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 s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(ev)?o:null}function Ec(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const SJ=["cite"],CJ={key:0,dir:"auto",class:"paragraph-node"},AJ=["custom-id"],Qf=hn(qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=us(()=>t.customId),s=P(()=>!!n.value.paragraph),o=P(()=>!!n.value.text),i=P(()=>Jh(t.node.children,!s.value)),r=P(()=>t.fade!==!1||o.value?null:Ec(i.value));return An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade)),(l,a)=>(b(),I("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(b(),I("p",CJ,[r.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,AJ)):(b(),ye(C(fd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),ye(C(_o),{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,SJ))}}),[["__scopeId","data-v-abfecebc"]]);Qf.install=e=>{e.component(Qf.__name,Qf)};const MJ={class:"definition-list"},EJ={class:"definition-term"},TJ={class:"definition-desc"},Xf=hn(qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),I("dl",MJ,[(b(!0),I(Be,null,nt(t.node.items,(o,i)=>(b(),I(Be,{key:i},[w("dt",EJ,[ie(C(_o),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),w("dd",TJ,[ie(C(_o),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Xf.install=e=>{e.component(Xf.__name,Xf)};const NJ=["href","title"],Du=hn(qe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(b(),I("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,NJ))}}),[["__scopeId","data-v-e1eb37b6"]]);Du.install=e=>{e.component(Du.__name,Du)};const IJ=["id"],$J={class:"flex-1"},Jf=qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),I("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",$J,[ie(C(_o),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,IJ))}});Jf.install=e=>{e.component(Jf.__name,Jf)};const LJ=["custom-id"],tv=hn(qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamFade",void 0),o=P(()=>s?.value!==!1||n.value.text?null:Ec(t.node.children)),i=P(()=>it({text:Zn,inline_code:qs,link:ro,image:il,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,checkbox:Do,checkbox_input:Do,footnote_reference:Po,hardbreak:rl,math_inline:Ci,reference:so},n.value));return(r,l)=>(b(),ye($s(`h${e.node.level}`),pn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[o.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,LJ)):(b(!0),I(Be,{key:1},nt(e.node.children,(a,c)=>(b(),ye(C(Ui),{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"]]),ep=tv;ep.install=e=>{e.component(tv.__name,tv)};const FJ={key:0,dir:"auto",class:"paragraph-node"},OJ=["custom-id"],RJ={dir:"auto",class:"paragraph-node"},BJ=["custom-id"],kc=hn(qe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=P(()=>{var p;return(p=t.node)!=null?p:t.item}),s=us(()=>t.customId),o=P(()=>!!s.value.paragraph),i=P(()=>!!s.value.text),r=P(()=>{var p;return Jh((p=n.value)==null?void 0:p.children,!o.value)}),l=P(()=>{var p;if(o.value)return null;const h=(p=n.value)==null?void 0:p.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=h.slice(1);if(!_.every(g=>g?.type==="list"))return null;const k=Jh([m]);return k?{paragraphChildren:k,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=P(()=>a()?Ec(r.value):null),u=P(()=>{var p;return a()?Ec((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=P(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade)),(p,h)=>{var m,_;return b(),I("li",pn({class:"list-item",dir:"auto"},f.value),[r.value?(b(),I("p",FJ,[c.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,OJ)):(b(),ye(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?(b(),I(Be,{key:1},[w("p",RJ,[u.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,BJ)):(b(),ye(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"]))]),(b(!0),I(Be,null,nt(l.value.nestedLists,(k,g)=>(b(),ye(C(_o),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:h[0]||(h[0]=v=>p.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(b(),ye(C(_o),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=k=>p.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);kc.install=e=>{e.component(kc.__name,kc)};const bc=hn(qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=us(()=>e.customId),n=P(()=>t.value.list_item||kc);return(s,o)=>(b(),ye($s(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(b(!0),I(Be,null,nt(e.node.items,(i,r)=>{var l;return b(),ye($s(n.value),pn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);bc.install=e=>{e.component(bc.__name,bc)};const v5=Symbol("ViewportPriority");function DJ(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function p(){if(f!=null){try{l?.(f)}catch{}f=null}}function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||p()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&_())},{timeout:1200}))}Ke(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);p()}},{flush:"sync"});const k=(g,v)=>{const y=Q(!1);let A,L=!1;const $=new Promise(N=>{A=()=>{L||(L=!0,N())}}),x=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()};if(!o||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x};const E=(function(N,F){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(O,D){var W,z,V;return{root:(W=e?.(O??null))!=null?W:null,rootMargin:(z=D?.rootMargin)!=null?z:"300px",threshold:(V=D?.threshold)!=null?V:0}})(N,F);if(a&&(R=S,(T=c)&&T.root===R.root&&T.rootMargin===R.rootMargin&&T.threshold===R.threshold))return a;var T,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(O=>{for(const D of O)(D.isIntersecting||D.intersectionRatio>0)&&m(D.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const O of u.keys())a.observe(O);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),_(),{isVisible:y,whenVisible:$,destroy:x}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x})};return An(v5,k),k}function PJ(){var e,t;const n=Ut(v5,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const p=s.get(f);if(p){if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.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 p=Q(!1);let h,m=!1;const _=new Promise(v=>{h=()=>{m||(m=!0,v())}}),k=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(f,{resolve:h,visible:p}),g.observe(f),i.add(f),d(),{isVisible:p,whenVisible:_,destroy:k}):(p.value=!0,h(),{isVisible:p,whenVisible:_,destroy:k})}}const HJ={key:2,class:"html-block-node__raw"},WJ=["innerHTML"],zJ={key:1,class:"html-block-node__placeholder"},Pu=hn(qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),o=P(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=P(()=>{var L,$;const x=(L=s?.value)!=null?L:{};return Bt(it({},x),{customId:($=t.customId)!=null?$:x.customId,htmlPolicy:o.value})}),r=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1}),l=P(()=>{const L=Pg(t.node.attrs,o.value);if(!L)return;const $=Yh(L);return Object.keys($).length>0?$:void 0}),a=P(()=>{const L=String(t.node.tag||"").trim(),$=Pg(t.node.attrs,o.value,L);if(!$)return;const x=Yh($);return Object.keys(x).length>0?x:void 0}),c=us(()=>t.customId),u=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Q(null),f=Q(typeof window>"u"),p=Q(t.node.content),h=P(()=>Array.isArray(t.node.children)?t.node.children:[]),m=P(()=>String(t.node.tag||"div")),_=P(()=>{const L=m.value.trim().toLowerCase();return n6.has(L)||Fy(L,o.value)}),k=P(()=>h.value.length>0&&!!t.node.tag&&!_.value),g=P(()=>{var L,$,x;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=p.value)!=null?L:""};const E=($=p.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:yc(E,o.value)};if(t.node.loading){const F=Xh(E,c.value,o.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:E}:{mode:"dynamic",nodes:F}}if(!h5(E,c.value))return{mode:"html",content:yc(E,o.value)};const N=Xh(E,c.value,o.value);return N===null?{mode:"html",content:yc(E,o.value)}:{mode:"dynamic",nodes:N}}),v=PJ(),y=Q(null),A=!!t.node.loading;return typeof window<"u"?(Ke(d,L=>{var $,x;if((x=($=y.value)==null?void 0:$.destroy)==null||x.call($),y.value=null,!A)return f.value=!0,void(p.value=t.node.content);if(!L)return void(f.value=!1);const E=v(L,{rootMargin:"400px"});y.value=E,f.value=E.isVisible.value,E.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ke(()=>t.node.content,L=>{A&&!f.value||(p.value=L)})):f.value=!0,es(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(b(),ye($s(k.value?m.value:"div"),pn({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:Ee(()=>[f.value?(b(),I(Be,{key:0},[g.value.mode==="structured"?(b(),ye(C(r),pn({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(b(),ye(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(b(),I("pre",HJ,B(g.value.content),1)):(b(),I("div",pn({key:3},l.value,{innerHTML:g.value.content}),null,16,WJ))],64)):(b(),I("div",zJ,[In(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Pu.install=e=>{e.component(Pu.__name,Pu)};const UJ={dir:"auto",class:"paragraph-node"},jJ=["custom-id"],na=hn(qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=P(()=>{var x;return(x=s?.value)!=null?x:"safe"}),c=P(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=P(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=P(()=>{var x,E;return(E=t.customHtmlTags)!=null?E:(x=l?.value)==null?void 0:x.customHtmlTags}),f=P(()=>{var x,E;const N=(x=l?.value)!=null?x:{};return Bt(it({},N),{customId:(E=t.customId)!=null?E:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1});function h(x){var E;return x.type==="text"&&String((E=x.content)!=null?E:"").trim()===""}const m=P(()=>t.node.children.filter(x=>!h(x))),_=P(()=>m.value.length>0&&m.value.every(x=>x.type==="image"||(function(E){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(T=>!h(T)):[]})(E);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(x))),k=P(()=>new Set(Fc(d.value))),g=P(()=>{if(!_.value||m.value.length<=1)return t.node.children;const x=[];for(let E=0;E<t.node.children.length;E++){const N=t.node.children[E];if(!h(N)){x.push(N);continue}const F=x.length>0,S=t.node.children.slice(E+1).some(T=>!h(T));F&&S&&x.push(Bt(it({},N),{content:" ",raw:" "}))}return x}),v=P(()=>o?.value===!1&&!n.value.text),y=P(()=>v.value?Ec(g.value):null);function A(x,E){return{node:x,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=P(()=>it({inline_code:qs,image:il,link:ro,hardbreak:rl,emphasis:lo,strong:oo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,html_inline:Ho,html_block:Pu,emoji:yo,checkbox:Do,math_inline:Ci,checkbox_input:Do,reference:so,footnote_anchor:Du,footnote_reference:Po,text:Zn},n.value)),$=P(()=>g.value.map((x,E)=>{var N;const F=(function(S){var T,R,O,D;if(S.type==="html_block"||S.type==="html_inline"){const W=String((T=S.tag)!=null?T:"").trim().toLowerCase()||r6(S.content);if(W&&!k.value.has(W)&&l6((R=S.content)!=null?R:S.raw,W)){const z=String((D=(O=S.content)!=null?O:S.raw)!=null?D:"");return{child:{type:"text",content:z,raw:z},component:Zn,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Td(String(S.type)))}})(x);return Bt(it({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?jy(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:x})}));return(x,E)=>(b(),I("p",UJ,[y.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(y.value),9,jJ)):(b(!0),I(Be,{key:1},nt($.value,N=>{return b(),I(Be,{key:N.key},[_.value&&h(N.originalChild)?(b(),I(Be,{key:0},[Ge(B((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(b(),ye($s(N.component),pn({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[N.hasSlotChildren?(b(),ye(C(p),pn({key:0,ref_for:!0},f.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(b(),ye(C(p),pn({key:1,ref_for:!0},f.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),ye($s(N.component),pn({key:2,ref_for:!0},A(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);na.install=e=>{e.component(na.__name,na)};const qJ={class:"table-node-wrapper"},VJ=["aria-busy"],KJ={key:0},GJ=["custom-id"],YJ=["aria-label","onPointerdown"],ZJ=["custom-id"],QJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Hu=hn(qe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=P(()=>{var k;return(k=t.node.loading)!=null&&k}),s=P(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=Q(null),i=Q([]);let r=null;const l=P(()=>t.node.header.cells.length),a=P(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=P(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade));const u=us(()=>t.customId),d=P(()=>!!u.value.text),f=P(()=>!!u.value.paragraph),p=new WeakMap;function h(k){const g=t.fade===!1&&!d.value,v=!f.value,y=p.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=Jh(k.children,v,!0),L={simpleChildren:A,plainText:A&&g?Ec(A):null};return p.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return Ke(l,()=>{_(),i.value=[]}),es(_),(k,g)=>(b(),I("div",qJ,[w("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),I("colgroup",KJ,[(b(!0),I(Be,null,nt(e.node.header.cells,(v,y)=>(b(),I("col",{key:y,style:qt(c.value[y])},null,4))),128))])):le("",!0),w("thead",null,[w("tr",null,[(b(!0),I(Be,null,nt(e.node.header.cells,(v,y)=>(b(),I("th",{key:y,dir:"auto",class:De([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[h(v).plainText!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(h(v).plainText),9,GJ)):h(v).simpleChildren?(b(),ye(C(fd),{key:1,nodes:h(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(b(),ye(C(_o),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>k.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(b(),I("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(L,$){if($.button!==0)return;const x=(function(){var F;const S=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],T=>Math.round(T.getBoundingClientRect().width))})(),E=x[L],N=x[L+1];E&&N&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:E,nextStartWidth:N,widths:x},i.value=x,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,A)},null,40,YJ)):le("",!0)],2))),128))])]),w("tbody",null,[(b(!0),I(Be,null,nt(s.value,(v,y)=>(b(),I("tr",{key:y},[(b(!0),I(Be,null,nt(v.cells,(A,L)=>(b(),I("td",{key:L,class:De([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(A).plainText!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(h(A).plainText),9,ZJ)):h(A).simpleChildren?(b(),ye(C(fd),{key:1,nodes:h(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),ye(C(_o),{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:g[1]||(g[1]=$=>k.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,VJ),ie(cl,{name:"table-node-fade"},{default:Ee(()=>[n.value?(b(),I("div",QJ,[In(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):le("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Hu.install=e=>{e.component(Hu.__name,Hu)};const XJ={class:"hr-node"},eh=hn({},[["render",function(e,t){return b(),I("hr",XJ)}],["__scopeId","data-v-39b2349c"]]);eh.install=e=>{e.component(eh.__name,eh)};const JJ={class:"unknown-node"},nv=qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),I("div",JJ,B(e.node.raw),1))}),th=hn(qe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=P(()=>`vmr-container vmr-container-${t.node.name}`),s=us(()=>t.customId),o=P(()=>it({text:Zn,paragraph:na,heading:ep,inline_code:qs,link:ro,image:il,strong:oo,emphasis:lo,strikethrough:io,insert:xo,subscript:bo,superscript:ko,checkbox:Do,checkbox_input:Do,hardbreak:rl,math_inline:Ci,reference:so,list:bc,math_block:g5,table:Hu},s.value));return(i,r)=>(b(),I("div",pn({class:n.value},e.node.attrs),[(b(!0),I(Be,null,nt(e.node.children,(l,a)=>{return b(),ye($s((c=l.type,o.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"]]);th.install=e=>{e.component(th.__name,th)};const eee=["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"],hS=[[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 tee(e){if(e<=255)return eee[e];let t=0,n=hS.length-1;for(;t<=n;){const s=t+n>>1,o=hS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const nee=/[ \t\n\r\f]+/g,see=/[\t\n\r\f]| {2,}|^ | $/;let f0=null;const oee=new RegExp("\\p{Script=Arabic}","u"),sm=new RegExp("\\p{M}","u"),y5=new RegExp("\\p{Nd}","u");function pS(e){return oee.test(e)}function mS(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 gr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(mS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(mS(n))return!0}}return!1}const iee=new Set([" "," ","","\uFEFF"]);function ree(e){return gr(e)}function sv(e){return!(function(t){const n=tp(t);return n!==null&&(qy.has(n)||la.has(n))})(e)&&!(function(t){const n=tp(t);return n!==null&&iee.has(n)})(e)}const qy=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),om=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Vy=new Set(["'","’"]),la=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),lee=new Set([":",".","،","؛"]),aee=new Set(["၏"]),cee=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function uee(e){if(Ky(e))return!0;let t=!1;for(const n of e)if(la.has(n))t=!0;else if(!t||!sm.test(n))return!1;return t}function dee(e){for(const t of e)if(!qy.has(t)&&!la.has(t))return!1;return e.length>0}function fee(e){if(Ky(e))return!0;for(const t of e)if(!om.has(t)&&!Vy.has(t)&&!sm.test(t))return!1;return e.length>0}function Ky(e){let t=!1;for(const n of e)if(n!=="\\"&&!sm.test(n)){if(!(om.has(n)||la.has(n)||Vy.has(n)))return!1;t=!0}return t}function k5(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function tp(e){if(e.length===0)return null;const t=k5(e,e.length);return e.slice(t)}function hee(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(sm.test(s))n--;else{if(!om.has(s)&&!Vy.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function pee(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function gS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function vS(e,t){return e&&t!==null&&lee.has(t)}function mee(e){const t=tp(e);return t!==null&&aee.has(t)}function gee(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 ov(e){let t=e.length;for(;t>0;){const n=k5(e,t),s=e.slice(n,t);if(cee.has(s))return!0;if(!la.has(s))return!1;t=n}return!1}function vee(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
275
275
|
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const yee=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ei(e){return e.length===1?e[0]:e.join("")}function kee(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),ei(n)}function bee(e,t,n,s){if(!yee.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=vee(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:ei(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:ei(r),isWordLike:a,kind:i,start:l}),o}function h0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const xee=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function _ee(e,t){const n=e.texts[t];return!!n.startsWith("www.")||xee.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function wee(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const See=new Set([":","-","/","×",",",".","+","–","—"]),yS=/^[A-Za-z0-9_]+[,:;]*$/,kS=/[,:;]+$/;function bS(e){for(const t of e)if(y5.test(t))return!0;return!1}function nh(e){if(e.length===0)return!1;for(const t of e)if(!y5.test(t)&&!See.has(t))return!1;return!0}function xS(e,t,n){var s,o,i;const r=(f0===null&&(f0=new Intl.Segmenter(void 0,{granularity:"word"})),f0);let l=0;const a=[],c=[],u=[],d=[],f=[],p=[],h=[],m=[],_=[],k=[],g=[],v=[];for(const x of r.segment(e))for(const E of bee(x.segment,(s=x.isWordLike)!=null&&s,x.index,n)){let N=function(){p[z]!==null&&(c[z]=[gS(a,p,h,z)],p[z]=null),c[z].push(E.text),u[z]=u[z]||E.isWordLike,m[z]=m[z]||T,_[z]=_[z]||R,k[z]=D,g[z]=W,v[z]=vS(_[z],O)};const F=E.kind==="text",S=pee(E.text,E.isWordLike,E.kind),T=gr(E.text),R=pS(E.text),O=tp(E.text),D=ov(E.text),W=mee(E.text),z=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[z]==="text"&&T&&m[z]&&k[z]||F&&l>0&&d[z]==="text"&&dee(E.text)&&m[z]||F&&l>0&&d[z]==="text"&&g[z]?N():F&&l>0&&d[z]==="text"&&E.isWordLike&&R&&v[z]?(N(),u[z]=!0):S!==null&&l>0&&d[z]==="text"&&p[z]===S?h[z]=((o=h[z])!=null?o:1)+1:F&&!E.isWordLike&&l>0&&d[z]==="text"&&(uee(E.text)||E.text==="-"&&u[z])?N():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,f[l]=E.start,p[l]=S,h[l]=S===null?0:1,m[l]=T,_[l]=R,k[l]=D,g[l]=W,v[l]=vS(R,O),l++)}for(let x=0;x<l;x++)p[x]===null?a[x]=ei(c[x]):a[x]=gS(a,p,h,x);for(let x=1;x<l;x++)d[x]==="text"&&!u[x]&&Ky(a[x])&&d[x-1]==="text"&&(a[x-1]+=a[x],u[x-1]=u[x-1]||u[x],a[x]="");const y=Array.from({length:l},()=>null);let A=-1;for(let x=l-1;x>=0;x--){const E=a[x];if(E.length!==0){if(d[x]==="text"&&!u[x]&&fee(E)&&A>=0&&d[A]==="text"){const N=(i=y[A])!=null?i:[];N.push(E),y[A]=N,f[A]=f[x],a[x]="";continue}A=x}}for(let x=0;x<l;x++){const E=y[x];E!=null&&(a[x]=kee(E,a[x]))}let L=0;for(let x=0;x<l;x++){const E=a[x];E.length!==0&&(L!==x&&(a[L]=E,u[L]=u[x],d[L]=d[x],f[L]=f[x]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(x){const E=x.texts.slice(),N=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let T=0;T<E.length-1;T++){if(F[T]!=="text"||F[T+1]!=="text"||!gr(E[T])||!gr(E[T+1]))continue;const R=hee(E[T]);R!==null&&(E[T]=R.head,E[T+1]=R.tail+E[T+1],S[T+1]=S[T]+R.head.length)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T],O=x.kinds[T],D=x.isWordLike[T];if(O==="text"&&D&&yS.test(R)){const W=[R];let z=kS.test(R),V=T+1;for(;z&&V<x.len&&x.kinds[V]==="text"&&x.isWordLike[V]&&yS.test(x.texts[V]);){const U=x.texts[V];W.push(U),z=kS.test(U),V++}E.push(ei(W)),N.push(!0),F.push("text"),S.push(x.starts[T]),T=V-1;continue}E.push(R),N.push(D),F.push(O),S.push(x.starts[T])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T];if(x.kinds[T]==="text"&&R.includes("-")){const O=R.split("-");let D=O.length>1;for(let W=0;W<O.length;W++){const z=O[W];if(!D)break;z.length!==0&&bS(z)&&nh(z)||(D=!1)}if(D){let W=0;for(let z=0;z<O.length;z++){const V=O[z],U=z<O.length-1?`${V}-`:V;E.push(U),N.push(!0),F.push("text"),S.push(x.starts[T]+W),W+=U.length}continue}}E.push(R),N.push(x.isWordLike[T]),F.push(x.kinds[T]),S.push(x.starts[T])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T],O=x.kinds[T];if(O==="text"&&nh(R)&&bS(R)){const D=[R];let W=T+1;for(;W<x.len&&x.kinds[W]==="text"&&nh(x.texts[W]);)D.push(x.texts[W]),W++;E.push(ei(D)),N.push(!0),F.push("text"),S.push(x.starts[T]),T=W-1;continue}E.push(R),N.push(x.isWordLike[T]),F.push(O),S.push(x.starts[T])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T];if(E.push(R),N.push(x.isWordLike[T]),F.push(x.kinds[T]),S.push(x.starts[T]),!wee(R))continue;const O=T+1;if(O>=x.len||h0(x.kinds[O]))continue;const D=[],W=x.starts[O];let z=O;for(;z<x.len&&!h0(x.kinds[z]);)D.push(x.texts[z]),z++;D.length>0&&(E.push(ei(D)),N.push(!0),F.push("text"),S.push(W),T=z-1)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=x.texts.slice(),N=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let R=0;R<x.len;R++){if(F[R]!=="text"||!_ee(x,R))continue;const O=[E[R]];let D=R+1;for(;D<x.len&&!h0(F[D]);){O.push(E[D]),N[R]=!0;const W=E[D].includes("?");if(F[D]="text",E[D]="",D++,W)break}E[R]=ei(O)}let T=0;for(let R=0;R<E.length;R++){const O=E[R];O.length!==0&&(T!==R&&(E[T]=O,N[T]=N[R],F[T]=F[R],S[T]=S[R]),T++)}return E.length=T,N.length=T,F.length=T,S.length=T,{len:T,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];let T=0;for(;T<x.len;){const R=[x.texts[T]];let O=x.isWordLike[T],D=x.kinds[T],W=x.starts[T];if(D==="glue"){const z=[R[0]],V=W;for(T++;T<x.len&&x.kinds[T]==="glue";)z.push(x.texts[T]),T++;const U=ei(z);if(!(T<x.len&&x.kinds[T]==="text")){E.push(U),N.push(!1),F.push("glue"),S.push(V);continue}R[0]=U,R.push(x.texts[T]),O=x.isWordLike[T],D="text",W=V,T++}else T++;if(D==="text")for(;T<x.len&&x.kinds[T]==="glue";){const z=[];for(;T<x.len&&x.kinds[T]==="glue";)z.push(x.texts[T]),T++;const V=ei(z);T<x.len&&x.kinds[T]==="text"?(R.push(V,x.texts[T]),O=O||x.isWordLike[T],T++):R.push(V)}E.push(ei(R)),N.push(O),F.push(D),S.push(W)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let x=0;x<$.len-1;x++){const E=gee($.texts[x]);E!==null&&($.kinds[x]!=="space"&&$.kinds[x]!=="preserved-space"||$.kinds[x+1]!=="text"||!pS($.texts[x+1])||($.texts[x]=E.space,$.isWordLike[x]=!1,$.kinds[x]=$.kinds[x]==="preserved-space"?"preserved-space":"space",$.texts[x+1]=E.marks+$.texts[x+1],$.starts[x+1]=$.starts[x]+E.space.length))}return $}function Cee(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Ha=null;const _S=new Map;let Wa=null;const Aee=new RegExp("\\p{Emoji_Presentation}","u"),Mee=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let p0=null;const wS=new Map;function iv(){if(Ha!==null)return Ha;if(typeof OffscreenCanvas<"u")return Ha=new OffscreenCanvas(1,1).getContext("2d"),Ha;if(typeof document<"u")return Ha=document.createElement("canvas").getContext("2d"),Ha;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Wr(e,t){let n=t.get(e);return n===void 0&&(n={width:iv().measureText(e).width,containsCJK:gr(e)},t.set(e,n)),n}function im(){if(Wa!==null)return Wa;if(typeof navigator>"u")return Wa={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Wa;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 Wa={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Wa}function b5(){return p0===null&&(p0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),p0}function Eee(e){return Aee.test(e)||e.includes("️")}function Pl(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=b5();for(const a of l.segment(i))Eee(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function Tee(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 Nee(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function SS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+im().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,p=0;function h(y=u,A=d,L=a){l++,a=0,c=!1,f=-1,p=0}function m(y,A){c=!0,u=y+1,d=0,a=A}function _(y,A,L){c=!0,u=y,d=A+1,a=L}function k(y,A){c?(a+=A,u=y+1,d=0):m(y,A)}function g(y,A){const L=i[y];for(let $=A;$<L.length;$++){const x=L[$];c?a+x>r?(h(),_(y,$,x)):(a+=x,u=y,d=$+1):_(y,$,x)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=Tee(e,v),!(v>=s.length)));){const y=s[v],A=o[v],L=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+y>r){if(L){k(v,y),h(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){h();continue}h(f,0,p);continue}if(y>t&&i[v]!==null){h(),g(v,0),v++;continue}h()}else k(v,y),L&&(f=v+1,p=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),L&&(f=v+1,p=a-y),v++}return c&&h(),l}let m0=null;function Iee(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,p){s=[d],o=f,i=p,r=ov(d),l=om.has(d)}function u(d,f){s.push(d),i=i||f;const p=ov(d);r=d.length===1&&la.has(d)&&r||p,l=!1}for(const d of(m0===null&&(m0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),m0).segment(e)){const f=d.segment,p=gr(f);s.length!==0?l||qy.has(f)||la.has(f)||t.carryCJKAfterClosingQuote&&p&&r?u(f,p):i||p?(a(),c(f,d.index,p)):u(f,p):c(f,d.index,p)}return a(),n}function $ee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=gr(e[0].text),i=sv(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=gr(a.text),u=sv(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function Lee(e,t,n,s){const o=im(),{cache:i,emojiCorrection:r}=(function($,x){iv().font=$;const E=(function(S){let T=_S.get(S);return T||(T=new Map,_S.set(S,T)),T})($),N=(function(S){const T=S.match(/(\d+(?:\.\d+)?)\s*px/);return T?parseFloat(T[1]):16})($),F=x?(function(S,T){let R=wS.get(S);if(R!==void 0)return R;const O=iv();O.font=S;const D=O.measureText("😀").width;if(R=0,D>T+.5&&typeof document<"u"&&document.body!==null){const W=document.createElement("span");W.style.font=S,W.style.display="inline-block",W.style.visibility="hidden",W.style.position="absolute",W.textContent="😀",document.body.appendChild(W);const z=W.getBoundingClientRect().width;document.body.removeChild(W),D-z>.5&&(R=D-z)}return wS.set(S,R),R})($,N):0;return{cache:E,fontSize:N,emojiCorrection:F}})(t,(l=e.normalized,Mee.test(l)));var l;const a=Pl("-",Wr("-",i),r),c=8*Pl(" ",Wr(" ",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=[],p=[];let h=e.chunks.length<=1;const m=null,_=[],k=n?[]:null,g=Array.from({length:e.len});function v($,x,E,N,F,S,T){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(h=!1),u.push(x),d.push(E),f.push(N),p.push(F),_.push(T),k!==null&&k.push($)}function y($,x,E,N,F){const S=Wr($,i),T=Pl($,S,r),R=x==="space"||x==="preserved-space"||x==="zero-width-break"?0:T,O=x==="space"||x==="zero-width-break"?0:T;if(F&&N&&$.length>1){let D="sum-graphemes";nh($)?D="pair-context":o.preferPrefixWidthsForBreakableRuns&&(D="segment-prefixes");const W=(function(z,V,U,re,ae){if(V.breakableFitAdvances!==void 0)return V.breakableFitAdvances;const te=b5(),Z=[];for(const Ye of te.segment(z))Z.push(Ye.segment);if(Z.length<=1)return V.breakableFitAdvances=null,V.breakableFitAdvances;if(ae==="sum-graphemes"){const Ye=[];for(const ve of Z){const Y=Wr(ve,U);Ye.push(Pl(ve,Y,re))}return V.breakableFitAdvances=Ye,V.breakableFitAdvances}if(ae==="pair-context"||Z.length>96){const Ye=[];let ve=null,Y=0;for(const ce of Z){const fe=Pl(ce,Wr(ce,U),re);if(ve===null)Ye.push(fe);else{const j=ve+ce,se=Wr(j,U);Ye.push(Pl(j,se,re)-Y)}ve=ce,Y=fe}return V.breakableFitAdvances=Ye,V.breakableFitAdvances}const ne=[];let ke="",Se=0;for(const Ye of Z){ke+=Ye;const ve=Pl(ke,Wr(ke,U),re);ne.push(ve-Se),Se=ve}return V.breakableFitAdvances=ne,V.breakableFitAdvances})($,S,i,r,D);return void v($,T,R,O,x,E,W)}v($,T,R,O,x,E,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const x=e.texts[$],E=e.isWordLike[$],N=e.kinds[$],F=e.starts[$];if(N==="soft-hyphen"){v(x,0,a,a,N,F,null);continue}if(N==="hard-break"){v(x,0,0,0,N,F,null);continue}if(N==="tab"){v(x,0,0,0,N,F,null);continue}const S=Wr(x,i);if(N==="text"&&S.containsCJK){const T=Iee(x,o),R=s==="keep-all"?$ee(T):T;for(let O=0;O<R.length;O++){const D=R[O];y(D.text,"text",F+D.start,E,s==="keep-all"||!gr(D.text))}continue}y(x,N,F,E,!0)}const A=(function($,x,E){const N=[];for(let F=0;F<$.length;F++){const S=$[F],T=S.startSegmentIndex<x.length?x[S.startSegmentIndex]:E,R=S.endSegmentIndex<x.length?x[S.endSegmentIndex]:E,O=S.consumedEndSegmentIndex<x.length?x[S.consumedEndSegmentIndex]:E;N.push({startSegmentIndex:T,endSegmentIndex:R,consumedEndSegmentIndex:O})}return N})(e.chunks,g,u.length),L=m===null?null:(function($,x){const E=(function(F){const S=F.length;if(S===0)return null;const T=new Array(S);let R=!1;for(let U=0;U<S;){const re=F.charCodeAt(U);let ae=re,te=1;if(re>=55296&&re<=56319&&U+1<S){const ne=F.charCodeAt(U+1);ne>=56320&&ne<=57343&&(ae=ne-56320+(re-55296<<10)+65536,te=2)}const Z=tee(ae);Z!=="R"&&Z!=="AL"&&Z!=="AN"||(R=!0);for(let ne=0;ne<te;ne++)T[U+ne]=Z;U+=te}if(!R)return null;let O=0;for(let U=0;U<S;U++){const re=T[U];if(re==="L"){O=0;break}if(re==="R"||re==="AL"){O=1;break}}const D=new Int8Array(S);for(let U=0;U<S;U++)D[U]=O;const W=1&O?"R":"L",z=W;let V=z;for(let U=0;U<S;U++)T[U]==="NSM"?T[U]=V:V=T[U];V=z;for(let U=0;U<S;U++){const re=T[U];re==="EN"?T[U]=V==="AL"?"AN":"EN":re!=="R"&&re!=="L"&&re!=="AL"||(V=re)}for(let U=0;U<S;U++)T[U]==="AL"&&(T[U]="R");for(let U=1;U<S-1;U++)T[U]==="ES"&&T[U-1]==="EN"&&T[U+1]==="EN"&&(T[U]="EN"),T[U]!=="CS"||T[U-1]!=="EN"&&T[U-1]!=="AN"||T[U+1]!==T[U-1]||(T[U]=T[U-1]);for(let U=0;U<S;U++){if(T[U]!=="EN")continue;let re;for(re=U-1;re>=0&&T[re]==="ET";re--)T[re]="EN";for(re=U+1;re<S&&T[re]==="ET";re++)T[re]="EN"}for(let U=0;U<S;U++){const re=T[U];re!=="WS"&&re!=="ES"&&re!=="ET"&&re!=="CS"||(T[U]="ON")}V=z;for(let U=0;U<S;U++){const re=T[U];re==="EN"?T[U]=V==="L"?"L":"EN":re!=="R"&&re!=="L"||(V=re)}for(let U=0;U<S;U++){if(T[U]!=="ON")continue;let re=U+1;for(;re<S&&T[re]==="ON";)re++;const ae=(U>0?T[U-1]:z)!=="L"?"R":"L";if(ae===((re<S?T[re]:z)!=="L"?"R":"L"))for(let te=U;te<re;te++)T[te]=ae;U=re-1}for(let U=0;U<S;U++)T[U]==="ON"&&(T[U]=W);for(let U=0;U<S;U++){const re=T[U];1&D[U]?re!=="L"&&re!=="AN"&&re!=="EN"||D[U]++:re==="R"?D[U]++:re!=="AN"&&re!=="EN"||(D[U]+=2)}return D})($);if(E===null)return null;const N=new Int8Array(x.length);for(let F=0;F<x.length;F++)N[F]=E[x[F]];return N})(e.normalized,m);return k!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:k}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function Fee(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return Lee((function(c,u,d="normal",f="normal"){const p=(function(_){const k=_??"normal";return k==="pre-wrap"?{mode:k,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:k,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),h=p.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
|
|
276
276
|
`).replace(/[\r\f]/g,`
|
|
277
277
|
`):_.replace(/\r\n/g,`
|
|
278
278
|
`)})(c):(function(_){if(!see.test(_))return _;let k=_.replace(nee," ");return k.charCodeAt(0)===32&&(k=k.slice(1)),k.length>0&&k.charCodeAt(k.length-1)===32&&(k=k.slice(0,-1)),k})(c);if(h.length===0)return{normalized:h,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const k=[],g=[],v=[],y=[];let A=null,L=!1,$=0,x=!1,E=!1;function N(){A!==null&&(k.push(ei(A)),g.push(L),v.push("text"),y.push($),A=null)}for(let F=0;F<_.len;F++){const S=_.texts[F],T=_.kinds[F],R=_.isWordLike[F],O=_.starts[F];if(T==="text"){const D=ree(S),W=sv(S);if(A!==null&&x&&E){A.push(S),L=L||R,x=x||D,E=W;continue}N(),A=[S],L=R,$=O,x=D,E=W;continue}N(),k.push(S),g.push(R),v.push(T),y.push(O)}return N(),{len:k.length,texts:k,isWordLike:g,kinds:v,starts:y}})(xS(h,u,p)):xS(h,u,p);return it({normalized:h,chunks:Cee(m,p)},m)})(s,im(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const g0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",ms=(()=>{const e=globalThis;if(e[g0])return e[g0];const t={configs:{},controllers:{},revision:fa(0),preparedCache:new Map,blockEstimateCache:new Map};return e[g0]=t,t})();let du=null;const CS=ms.revision;function AS(e){var t;return e&&(t=ms.configs[e])!=null?t:null}function MS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Oee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function v0(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!Oee(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
279
|
-
`)}return o.length>0?o:null}function y0(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(du!=null)return du;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return du=!!((i=r.getContext)!=null&&i.call(r,"2d")),du}catch{return du=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=ms.blockEstimateCache.get(r);if(l)return ms.blockEstimateCache.delete(r),ms.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(p,h,m){const _=`${m}\0${h}\0${p}`,k=ms.preparedCache.get(_);if(k)return ms.preparedCache.delete(_),ms.preparedCache.set(_,k),k.prepared;const g=Fee(p,h,{whiteSpace:m});for(ms.preparedCache.set(_,{prepared:g});ms.preparedCache.size>240;){const v=ms.preparedCache.keys().next().value;if(!v)break;ms.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(p,h,m){const _=(function(k,g){return k.simpleLineWalkFastPath?SS(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return SS(v,y);const{widths:A,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:x,breakableFitAdvances:E,discretionaryHyphenWidth:N,tabStopAdvance:F,chunks:S}=v;if(A.length===0||S.length===0)return 0;const T=im(),R=T.lineFitEpsilon,O=y+R;let D=0,W=0,z=!1,V=0,U=0,re=-1,ae=0,te=0,Z=null;function ne(){re=-1,ae=0,te=0,Z=null}function ke(se=V,ge=U,ue=W){D++,W=0,z=!1,ne()}function Se(se,ge){z=!0,V=se+1,U=0,W=ge}function Ye(se,ge,ue){z=!0,V=se,U=ge+1,W=ue}function ve(se,ge){z?(W+=ge,V=se+1,U=0):Se(se,ge)}function Y(se,ge,ue,pe){if(!ge)return;const q=se==="tab"?0:L[ue],J=se==="tab"?pe:$[ue];re=ue+1,ae=W-pe+q,te=W-pe+J,Z=se}function ce(se,ge){const ue=E[se];for(let pe=ge;pe<ue.length;pe++){const q=ue[pe];z?W+q>O?(ke(),Ye(se,pe,q)):(W+=q,V=se,U=pe+1):Ye(se,pe,q)}z&&V===se&&U===ue.length&&(V=se+1,U=0)}function fe(se){if(Z!=="soft-hyphen")return!1;const ge=E[se];if(ge==null)return!1;const{fitCount:ue,fittedWidth:pe}=(function(q,J,he,Te,Ie){let Oe=0,de=J;for(;Oe<q.length;){const $e=de+q[Oe];if((Oe+1<q.length?$e+Ie:$e)>he+Te)break;de=$e,Oe++}return{fitCount:Oe,fittedWidth:de}})(ge,W,y,R,N);return ue!==0&&(W=pe,V=se,U=ue,ne(),ue===ge.length?(V=se+1,U=0,!0):(ke(se,ue,pe+N),ce(se,ue),!0))}function j(se){D++,ne()}for(let se=0;se<S.length;se++){const ge=S[se];if(ge.startSegmentIndex===ge.endSegmentIndex){j();continue}z=!1,W=0,ge.startSegmentIndex,V=ge.startSegmentIndex,U=0,ne();let ue=ge.startSegmentIndex;for(;ue<ge.endSegmentIndex;){const pe=x[ue],q=pe==="space"||pe==="preserved-space"||pe==="tab"||pe==="zero-width-break"||pe==="soft-hyphen",J=pe==="tab"?Nee(W,F):A[ue];if(pe!=="soft-hyphen")if(z){if(W+J>O){const he=W+(pe==="tab"?0:L[ue]),Te=W+(pe==="tab"?J:$[ue]);if(Z==="soft-hyphen"&&T.preferEarlySoftHyphenBreak&&ae<=O){ke(re,0,te);continue}if(Z==="soft-hyphen"&&fe(ue)){ue++;continue}if(q&&he<=O){ve(ue,J),ke(ue+1,0,Te),ue++;continue}if(re>=0&&ae<=O){if(V>re||V===re&&U>0){ke();continue}const Ie=re;ke(Ie,0,te),ue=Ie;continue}if(J>y&&E[ue]!==null){ke(),ce(ue,0),ue++;continue}ke();continue}ve(ue,J),Y(pe,q,ue,J),ue++}else J>y&&E[ue]!==null?ce(ue,0):Se(ue,J),Y(pe,q,ue,J),ue++;else z&&(V=ue+1,U=0,re=ue+1,ae=W+N,te=W+N,Z=pe),ue++}if(z){const pe=re===ge.consumedEndSegmentIndex?te:W;ke(ge.consumedEndSegmentIndex,0,pe)}}return D})(k,g)})(p,h);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(ms.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});ms.blockEstimateCache.size>4e3;){const p=ms.blockEstimateCache.keys().next().value;if(!p)break;ms.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function x5(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=v0(e.children);return i&&n.paragraph?y0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=v0(e.children),l=n.headings[i];return r&&l?y0(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=v0((o=i[0])==null?void 0:o.children);return r?y0(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=x5(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 If(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Ree(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,p;return u.diff?Math.max(If(String((d=u.originalCode)!=null?d:"")),If(String((f=u.updatedCode)!=null?f:"")),If(String((p=u.code)!=null?p:""))):If((function(h,m){const _=String(h??"");return m?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(p,h){const m=typeof p?.fontSize=="number"&&p.fontSize>0?p.fontSize:h?13:12;return typeof p?.lineHeight=="number"&&p.lineHeight>0?p.lineHeight:h?30:Math.round(1.5*m)})(u,r),f=(function(p,h){var m,_;if(!h)return 0;const k=typeof((m=p?.padding)==null?void 0:m.top)=="number"?p.padding.top:10,g=typeof((_=p?.padding)==null?void 0:_.bottom)=="number"?p.padding.bottom:22;return Math.max(0,k)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else s==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(o?40:0)),contentHeight:c,rendererKind:s}}function Bee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function k0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=MS(s.lineHeight,1.5*MS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Bee(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Dee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function ES(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))Dee.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const Pee=!1;function
|
|
279
|
+
`)}return o.length>0?o:null}function y0(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(du!=null)return du;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return du=!!((i=r.getContext)!=null&&i.call(r,"2d")),du}catch{return du=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=ms.blockEstimateCache.get(r);if(l)return ms.blockEstimateCache.delete(r),ms.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(p,h,m){const _=`${m}\0${h}\0${p}`,k=ms.preparedCache.get(_);if(k)return ms.preparedCache.delete(_),ms.preparedCache.set(_,k),k.prepared;const g=Fee(p,h,{whiteSpace:m});for(ms.preparedCache.set(_,{prepared:g});ms.preparedCache.size>240;){const v=ms.preparedCache.keys().next().value;if(!v)break;ms.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(p,h,m){const _=(function(k,g){return k.simpleLineWalkFastPath?SS(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return SS(v,y);const{widths:A,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:x,breakableFitAdvances:E,discretionaryHyphenWidth:N,tabStopAdvance:F,chunks:S}=v;if(A.length===0||S.length===0)return 0;const T=im(),R=T.lineFitEpsilon,O=y+R;let D=0,W=0,z=!1,V=0,U=0,re=-1,ae=0,te=0,Z=null;function ne(){re=-1,ae=0,te=0,Z=null}function ke(se=V,ge=U,ue=W){D++,W=0,z=!1,ne()}function Se(se,ge){z=!0,V=se+1,U=0,W=ge}function Ye(se,ge,ue){z=!0,V=se,U=ge+1,W=ue}function ve(se,ge){z?(W+=ge,V=se+1,U=0):Se(se,ge)}function Y(se,ge,ue,pe){if(!ge)return;const q=se==="tab"?0:L[ue],J=se==="tab"?pe:$[ue];re=ue+1,ae=W-pe+q,te=W-pe+J,Z=se}function ce(se,ge){const ue=E[se];for(let pe=ge;pe<ue.length;pe++){const q=ue[pe];z?W+q>O?(ke(),Ye(se,pe,q)):(W+=q,V=se,U=pe+1):Ye(se,pe,q)}z&&V===se&&U===ue.length&&(V=se+1,U=0)}function fe(se){if(Z!=="soft-hyphen")return!1;const ge=E[se];if(ge==null)return!1;const{fitCount:ue,fittedWidth:pe}=(function(q,J,he,Te,Ie){let Oe=0,de=J;for(;Oe<q.length;){const $e=de+q[Oe];if((Oe+1<q.length?$e+Ie:$e)>he+Te)break;de=$e,Oe++}return{fitCount:Oe,fittedWidth:de}})(ge,W,y,R,N);return ue!==0&&(W=pe,V=se,U=ue,ne(),ue===ge.length?(V=se+1,U=0,!0):(ke(se,ue,pe+N),ce(se,ue),!0))}function j(se){D++,ne()}for(let se=0;se<S.length;se++){const ge=S[se];if(ge.startSegmentIndex===ge.endSegmentIndex){j();continue}z=!1,W=0,ge.startSegmentIndex,V=ge.startSegmentIndex,U=0,ne();let ue=ge.startSegmentIndex;for(;ue<ge.endSegmentIndex;){const pe=x[ue],q=pe==="space"||pe==="preserved-space"||pe==="tab"||pe==="zero-width-break"||pe==="soft-hyphen",J=pe==="tab"?Nee(W,F):A[ue];if(pe!=="soft-hyphen")if(z){if(W+J>O){const he=W+(pe==="tab"?0:L[ue]),Te=W+(pe==="tab"?J:$[ue]);if(Z==="soft-hyphen"&&T.preferEarlySoftHyphenBreak&&ae<=O){ke(re,0,te);continue}if(Z==="soft-hyphen"&&fe(ue)){ue++;continue}if(q&&he<=O){ve(ue,J),ke(ue+1,0,Te),ue++;continue}if(re>=0&&ae<=O){if(V>re||V===re&&U>0){ke();continue}const Ie=re;ke(Ie,0,te),ue=Ie;continue}if(J>y&&E[ue]!==null){ke(),ce(ue,0),ue++;continue}ke();continue}ve(ue,J),Y(pe,q,ue,J),ue++}else J>y&&E[ue]!==null?ce(ue,0):Se(ue,J),Y(pe,q,ue,J),ue++;else z&&(V=ue+1,U=0,re=ue+1,ae=W+N,te=W+N,Z=pe),ue++}if(z){const pe=re===ge.consumedEndSegmentIndex?te:W;ke(ge.consumedEndSegmentIndex,0,pe)}}return D})(k,g)})(p,h);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(ms.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});ms.blockEstimateCache.size>4e3;){const p=ms.blockEstimateCache.keys().next().value;if(!p)break;ms.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function x5(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=v0(e.children);return i&&n.paragraph?y0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=v0(e.children),l=n.headings[i];return r&&l?y0(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=v0((o=i[0])==null?void 0:o.children);return r?y0(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=x5(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 If(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Ree(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,p;return u.diff?Math.max(If(String((d=u.originalCode)!=null?d:"")),If(String((f=u.updatedCode)!=null?f:"")),If(String((p=u.code)!=null?p:""))):If((function(h,m){const _=String(h??"");return m?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(p,h){const m=typeof p?.fontSize=="number"&&p.fontSize>0?p.fontSize:h?13:12;return typeof p?.lineHeight=="number"&&p.lineHeight>0?p.lineHeight:h?30:Math.round(1.5*m)})(u,r),f=(function(p,h){var m,_;if(!h)return 0;const k=typeof((m=p?.padding)==null?void 0:m.top)=="number"?p.padding.top:10,g=typeof((_=p?.padding)==null?void 0:_.bottom)=="number"?p.padding.bottom:22;return Math.max(0,k)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else s==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(o?40:0)),contentHeight:c,rendererKind:s}}function Bee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function k0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=MS(s.lineHeight,1.5*MS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Bee(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Dee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function ES(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))Dee.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const Pee=!1;function cxe(){return Pee}function TS(e,t,n,s){var o;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,p){return Number.isFinite(f)?Math.min(Math.max(0,f),p):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const p=s.getNormalizedScrollTop(e,t,!1),h=Math.abs(p-r);h<u&&(u=h,c=f)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const _5=Symbol("MarkstreamMathBlockMinHeightCache");function uxe(){return Ut(_5,null)}const Hee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Wee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],zee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),w5=["raw","content","code","originalCode","updatedCode"],NS=new WeakMap,IS=new WeakMap;let Uee=1;function gi(){return typeof performance<"u"?performance.now():Date.now()}function $S(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ii(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=NS.get(t);return n||(n=Uee++,NS.set(t,n)),String(n)}function LS(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:ii(t),customMarkdownIt:ii(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:ii(e.validateLink),preTransformTokens:ii(e.preTransformTokens),postTransformTokens:ii(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function FS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
280
280
|
`,t-1)+1;return e.slice(n,t).trim()}function OS(e){const t=S5(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function S5(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function C5(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 Gy(e){const t=String(e??"");return`${t.length}:${C5(t)}`}function rv(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?Gy(r):`${r.length}:${C5(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ii(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${ii(s)}`;const i=ii(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>rv(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}:${rv(r[c],t,n+1)}`).join(";")}`}return typeof e}function np(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function A5(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>np(s)?pl(s,t,n+1):A5(s,t,n+1)).join(",")}`:np(e)?pl(e,t,n):rv(e,t,n)}function jee(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!w5.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${Gy(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${ii(o)}`:zee.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${A5(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${ii(o)}`:""}).filter(Boolean).join(";")}function qee(e){return w5.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Gy(n)}`:""}).filter(Boolean).join(";")}function pl(e,t=new WeakMap,n=0){const s=IS.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${ii(o)}`;const r=ii(o);t.set(o,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],p=f.length?f.slice(0,200).map(h=>pl(h,c,u+1)).join("|"):"";return[a.type,qee(d),jee(d,c,u),f.length,p].join(":")})(e,t,n);return IS.set(o,l),l}function M5(e,t){return pl(e)===pl(t)}function Yy(e,t,n){const s=gi(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=gi()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function RS(e,t,n){return Yy(t,n,()=>pl(e))}function E5(e,t,n){return RS(e,n,"stabilizeSignatureMs")===RS(t,n,"stabilizeSignatureMs")}function b0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function BS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function Vee(e,t){return e.length===t.length&&e===t}function Zy(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=s[d],p=o[d];if(typeof f!=typeof p)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,p))return!1}else if(typeof p!="string"||!Vee(f,p))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!np(d)||!np(f))return null;const p=Zy(d,f,n+1);if(p==null)return null;if(!p)return!1}return!0}function Kee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Zy(e,t);return n??M5(e,t)}function Gee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return Yy(n,"stabilizeSignatureMs",()=>{s=Zy(e,t)}),s??E5(e,t,n)}function Yee(e,t){const n={};for(const s of Hee){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function Zee(e,t){var n;const s=Ww(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:P(()=>!1),r=Q(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,p=0,h=gi();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const E=t.renderContent.value;r.value!==E&&(r.value=E),h=gi()}Ke([t.renderContent,t.effectiveFinal,i],([E,N,F])=>{r.value!==E&&(!F||N||(function(S,T){if(!S&&T||T.length<=80||T.length<S.length||!T.startsWith(S))return!0;const R=T.slice(S.length);return!!R&&(!!OS(FS(T))||!(!R.includes(`
|
|
281
281
|
|
|
282
282
|
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
|
|
283
|
-
`)&&!(function(O){const D=FS(O);if(OS(D))return!1;const W=S5(D);return W.length>=2&&W.some(z=>z.trim())})(T))})(r.value,E)?_():(function(){if(p+=1,l)return;const S=Math.max(0,(function(T){const R=T.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(gi()-h));S<=0?_():l=setTimeout(_,S)})())},{flush:"sync",immediate:!0}),Sv(m);const k=P(()=>{var E,N,F,S;return mK(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(N=t.customComponentsMap)==null?void 0:N.value)!=null?F:{},Object.entries(S).map(([T,R])=>{const O=di(T);return R==null||!O||Td(O)||t6.has(O)||Ad.has(O)?"":O}).filter(Boolean)))}),g=P(()=>{const{key:E,tags:N}=gK(k.value);if(!E)return s;const F=o.get(E);if(F)return F;const S=Ww(t.instanceMsgId,{customHtmlTags:N});return o.set(E,S),S}),v=P(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=P(()=>{var E,N;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,T=k.value,R=S!=null,O=T.length>0;return R||O||F.streamParse==null?it(it(Bt(it({},F),{streamParse:(N=F.streamParse)==null||N}),R?{final:S}:{}),O?{customHtmlTags:T}:{}):F}),A=P(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(N=>String(N).trim().toLowerCase()).filter(Boolean))}),L=P(()=>LS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=P(()=>LS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ke([L,$],([E,N],[F,S])=>{F&&(E===F&&N===S||(_(),N!==S&&(a=[],d="")))},{flush:"sync"});const x=P(()=>{var E,N,F,S,T,R,O,D;if((E=e.nodes)!=null&&E.length)return a=[],d="",mt(e.nodes.slice());const W=r.value;if(!W)return a=[],d="",[];const z=t.debugPerformanceEnabled.value,V=z?gi():0,U=v.value,re=L.value,ae=$.value;c&&re!==c&&(function(ge){var ue,pe;(pe=(ue=ge.stream)==null?void 0:ue.reset)==null||pe.call(ue)})(U),u&&ae!==u&&(a=[],d="");const te=a.length>0&&W.startsWith(d)&&ae===u,Z=z?$S(U):null,ne=z?{}:void 0,ke=ne?Bt(it({},y.value),{__timing:ne}):y.value,Se=U6(W,U,ke),Ye=z?gi():0,ve=z?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Y,ce=z?b0(Se.length):void 0,fe=0,j=0;if(te){const ge=z?gi():0;if(ve){const ue=(function(pe,q,J){if(!q.length)return{nodes:pe,metrics:b0(pe.length)};const he=(function(Oe,de,$e){const Qe=Math.min(Oe.length,de.length);for(let tt=0;tt<Qe;tt++)if(!Gee(de[tt],Oe[tt],$e))return tt;return Oe.length===de.length?-1:Qe})(pe,q,J);if(he<0)return{nodes:q,metrics:{reusedNodeCount:pe.length,dirtyStartIndex:he,stablePrefixNodeCount:pe.length,dirtyTailNodeCount:0}};const Te=pe.slice();let Ie=he;for(let Oe=0;Oe<he;Oe++)Te[Oe]=q[Oe];for(let Oe=he;Oe<pe.length;Oe++){const de=q[Oe],$e=pe[Oe];de&&E5(de,$e,J)&&(Te[Oe]=de,Ie+=1)}return{nodes:Te,metrics:{reusedNodeCount:Ie,dirtyStartIndex:he,stablePrefixNodeCount:he,dirtyTailNodeCount:BS(he,pe,q)}}})(Se,a,ve);Y=ue.nodes,ce=ue.metrics}else{const ue=(function(pe,q){if(!q.length)return{nodes:pe,metrics:b0(pe.length)};const J=(function(Ie,Oe){const de=Math.min(Ie.length,Oe.length);for(let $e=0;$e<de;$e++)if(!Kee(Oe[$e],Ie[$e]))return $e;return Ie.length===Oe.length?-1:de})(pe,q);if(J<0)return{nodes:q,metrics:{reusedNodeCount:pe.length,dirtyStartIndex:J,stablePrefixNodeCount:pe.length,dirtyTailNodeCount:0}};const he=pe.slice();let Te=J;for(let Ie=0;Ie<J;Ie++)he[Ie]=q[Ie];for(let Ie=J;Ie<pe.length;Ie++){const Oe=q[Ie],de=pe[Ie];Oe&&M5(Oe,de)&&(he[Ie]=Oe,Te+=1)}return{nodes:he,metrics:{reusedNodeCount:Te,dirtyStartIndex:J,stablePrefixNodeCount:J,dirtyTailNodeCount:BS(J,pe,q)}}})(Se,a);Y=ue.nodes,ce=ue.metrics}fe=z?gi()-ge:0,j=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?Y.length:ce.dirtyStartIndex}else Y=Se;ve?(function(ge,ue,pe=0){for(let q=Math.max(0,pe);q<ge.length;q++)Yy(ue,"primeSignatureMs",()=>pl(ge[q]))})(Y,ve,j):(function(ge,ue=0){for(let pe=Math.max(0,ue);pe<ge.length;pe++)pl(ge[pe])})(Y,j);const se=z?gi()-Ye:0;if(f+=1,d=W,c=re,u=ae,a=Y,z){const ge=$S(U),ue=typeof ge?.total=="number"&&ge.total>((N=Z?.total)!=null?N:0);t.logPerf(ue?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(gi()-V),nodes:Y.length,contentLength:W.length,parseCommitCount:f,parseCoalescedCount:p,nodeReuseMs:se,signatureMs:(F=ve?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=ve?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(T=ve?.primeSignatureMs)!=null?T:0,signatureCallCount:(R=ve?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(O=ve?.stabilizeSignatureCallCount)!=null?O:0,primeSignatureCallCount:(D=ve?.primeSignatureCallCount)!=null?D:0,stabilizeMs:fe},ce??{}),ne?Object.fromEntries(Wee.map(pe=>{var q;return[pe,(q=ne[pe])!=null?q:0]})):{}),ge?{streamMode:ge.lastMode,streamDelta:Yee(ge,Z),streamStats:ge}:{}))}return mt(Y)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:x}}function Qee(e){const{isClient:t}=e,n=Q(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,p){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const _=n.value,k=_.has(f);if(p){if(k)return;const v=new Set(_);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(_);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,p]of o.entries())f<c||(p(),o.delete(f));for(const[f,p]of s.entries())f<c||(p.destroy(),s.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function Xee(e={}){const t=Q(""),n=Q(""),s=Q(!1),o=JQ(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=P(()=>Math.max(0,t.value.length-n.value.length)),a=P(()=>l.value===0),c=P(()=>s.value&&a.value);return wv()&&Sv(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const DS=/auto|scroll|overlay/i;function Jee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return DS.test(t)||DS.test(n)}function ete(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 tte=qe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=P(()=>{var n,s;return Vg((s=oc(e.estimatedPreviewHeightPx))!=null?s:jg(String((n=e.node.code)!=null?n:"")))});return()=>dn("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?dn("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)"}},[dn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[dn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),dn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),dn("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},()=>dn("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,dn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[dn("div",{class:"absolute inset-0"},[dn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),nte=qe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=P(()=>{var n,s;return qg((s=oc(e.estimatedPreviewHeightPx))!=null?s:Ug(String((n=e.node.code)!=null?n:"")))});return()=>dn("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?dn("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)"}},[dn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[dn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),dn("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},()=>dn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[dn("span",{class:"action-icon block"})])))]):null,dn("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)"}},[dn("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"}})])])}}),ste=["data-custom-id"],ote={class:"m-0 p-0"},ite=["data-probe"],rte=["data-node-index","data-node-type"],T5=hn(qe(Bt(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Os(),r=Ut("markstreamNestedRendererProps",void 0);function l(M){var H,K;const G=s[M];return(function(oe){const be=i?.vnode.props;return!!be&&(Object.prototype.hasOwnProperty.call(be,oe)||Object.prototype.hasOwnProperty.call(be,String(oe).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?G:(K=(H=r?.value)==null?void 0:H[M])!=null?K:G}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=P(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=P(()=>{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=P(()=>a[c.value]),f=P(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),p=P(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),h=P(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),m=P(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),_=P(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),k=P(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),g=P(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),v=P(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),y=P(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=P(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),L=P(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),$=P(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return p.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(M){o("height-change",M)}function N(M){o("virtual-state-change",M)}function F(M){o("anchor-change",M)}const S=Q(),T=Q(null),R=Q(null),O=Q(null),D=Ss({1:null,2:null,3:null,4:null,5:null,6:null}),W=Q(!1),z=new Map,V=Q(0),U=Q(0),re=Q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ae(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const K=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return te(typeof K=="function"?K():K)}function te(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?te(M.value):typeof M=="object"&&"$el"in M?te(M.$el):null:null}const{isClient:Z,renderAsFragment:ne,debugPerformanceEnabled:ke,resolvedShowTooltips:Se,resolvedHtmlPolicy:Ye,inheritedSmoothStreaming:ve,ownsTypewriterCursor:Y}=(function(M){const H=typeof window<"u",K=bd(),G=Ut("markstreamHtmlPolicy",void 0),oe=Ut("markstreamTypewriterCursor",void 0),be=Ut("markstreamSmoothStreaming",void 0),Me=P(()=>M.renderAsFragment===!0),Ne=P(()=>!!(M.debugPerformance&&H&&typeof console<"u")),He=P(()=>{var We;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Re=(We=K.showTooltips)!=null?We:K["show-tooltips"];return Re===""||Re===!0||Re==="true"||Re!==!1&&Re!=="false"&&void 0}),Fe=P(()=>{var We,Re;return(Re=(We=M.htmlPolicy)!=null?We:G?.value)!=null?Re:"safe"}),Ue=P(()=>oe?.value!==!0);return{isClient:H,renderAsFragment:Me,debugPerformanceEnabled:Ne,resolvedShowTooltips:He,resolvedHtmlPolicy:Fe,inheritedSmoothStreaming:be,inheritedTypewriterCursor:oe,ownsTypewriterCursor:Ue}})(x),{resolveViewportRoot:ce,resolveScrollContainer:fe,isReverseFlexScrollRoot:j,getNormalizedScrollTop:se,getOffsetTopWithinRoot:ge}=(function(M,H){function K(){var Ne,He;return(He=(Ne=H.scrollRoot)==null?void 0:Ne.call(H))!=null?He:null}function G(Ne){if(typeof window>"u")return null;const He=K();if(He)return He;const Fe=Ne??M.value;if(!Fe)return null;const Ue=Fe.ownerDocument||document,We=Ue.scrollingElement||Ue.documentElement;let Re=Fe;for(;Re&&Re!==Ue.body&&Re!==We;){if(Jee(window.getComputedStyle(Re))&&ete(Re))return Re;Re=Re.parentElement}return null}function oe(Ne){if(!H.isClient)return!1;try{const He=window.getComputedStyle(Ne);return!!(He.display||"").toLowerCase().includes("flex")&&(He.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function be(Ne,He,Fe){var Ue,We;if(Fe)return Me(He);const Re=Ne.scrollTop;if(!oe(Ne))return Re;const ze=Re<0?-Re:Re;return Math.max(0,((Ue=Ne.scrollHeight)!=null?Ue:0)-((We=Ne.clientHeight)!=null?We:0))-ze}function Me(Ne){var He,Fe,Ue,We,Re;const ze=Number((He=Ne.scrollingElement)==null?void 0:He.scrollTop),Je=Number((Ue=(Fe=Ne.documentElement)==null?void 0:Fe.scrollTop)!=null?Ue:0),et=Number((Re=(We=Ne.body)==null?void 0:We.scrollTop)!=null?Re:0);return Math.max(0,Number.isFinite(ze)?ze:0,Number.isFinite(Je)?Je:0,Number.isFinite(et)?et:0)}return{resolveViewportRoot:G,resolveScrollContainer:function(Ne){var He,Fe,Ue,We;const Re=K();if(Re)return Re;const ze=G((He=Ne??M.value)!=null?He:null);if(ze)return ze;const Je=(We=(Ue=Ne?.ownerDocument)!=null?Ue:(Fe=M.value)==null?void 0:Fe.ownerDocument)!=null?We:typeof document<"u"?document:null;return Je?.scrollingElement||Je?.documentElement||null},isReverseFlexScrollRoot:oe,getNormalizedScrollTop:be,getOffsetTopWithinRoot:function(Ne,He){const Fe=He.ownerDocument||Ne.ownerDocument||document;if((function(ze,Je){return ze===Je.documentElement||ze===Je.body||ze===Je.scrollingElement})(He,Fe))return Ne.getBoundingClientRect().top+Me(Fe);const Ue=He.getBoundingClientRect(),We=Ne.getBoundingClientRect(),Re=be(He,Fe,!1);return We.top-Ue.top+Re}}})(S,{isClient:Z,scrollRoot:ae});An("markstreamShowTooltips",Se),An("markstreamHtmlPolicy",Ye),An("markstreamTypewriter",P(()=>x.typewriter!==!1)),An("markstreamFade",P(()=>x.fade!==!1)),An("markstreamTypewriterCursor",P(()=>!0)),An("markstreamTextStreamState",z),An("markstreamStreamVersion",V),An("markstreamParseOptions",P(()=>x.parseOptions)),An("markstreamCustomMarkdownIt",P(()=>x.customMarkdownIt));const{smoothStreamingEnabled:ue,renderContent:pe,effectiveFinal:q}=(function(M,H){const K=Xee(M.smoothStreamingOptions),G=P(()=>{var Fe,Ue,We;return M.smoothStreaming!==!1&&!((Fe=M.nodes)!=null&&Fe.length)&&(M.smoothStreaming===!0||!((Ue=H.inheritedSmoothStreaming)!=null&&Ue.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((We=M.maxLiveNodes)!=null?We:0)<=0)}),oe=Q(!H.isClient||M.smoothStreaming===!0);ln(()=>{oe.value=!0});const be=P(()=>oe.value&&G.value),Me=P(()=>{var Fe;return be.value?K.visible.value:(Fe=M.content)!=null?Fe:""}),Ne=P(()=>{var Fe,Ue;const We=(Fe=M.parseOptions)!=null?Fe:{};return(Ue=M.final)!=null?Ue:We.final}),He=P(()=>{const Fe=Ne.value;return be.value&&Fe!=null?!!Fe&&K.caughtUp.value:Fe});return Ke([()=>M.content,()=>M.nodes,be,Ne],([Fe,Ue,We,Re])=>{if(Ue?.length)return void K.reset("");const ze=Fe??"";if(!We)return K.reset(ze),void(Re&&K.finish({flush:!0}));const Je=K.source.value;ze?ze===Je||(ze.startsWith(Je)?K.enqueue(ze.slice(Je.length)):K.reset(ze)):K.reset(""),Re&&K.finish()},{immediate:!0}),{smoothStream:K,smoothStreamingEligible:G,smoothStreamingEnabled:be,renderContent:Me,requestedFinal:Ne,effectiveFinal:He}})(x,{isClient:Z,inheritedSmoothStreaming:ve});An("markstreamSmoothStreaming",ue);const J=Q(!1);let he="",Te=!1,Ie=null;function Oe(){Z&&Ie!=null&&(window.clearTimeout(Ie),Ie=null)}function de(){J.value=!1,Oe()}function $e(M,H){if(!ke.value)return;const K=(function(){if(!ke.value)return null;const G=xt(Qe),oe=xt(tt),be=Math.max(wt,oe);if(G<=0&&be<=0)return null;const Me={total:G,maxPerFrame:be,byLabel:(Ne=Qe,Object.fromEntries(Array.from(Ne.entries()).sort((He,Fe)=>Fe[1]-He[1]||He[0].localeCompare(Fe[0]))))};var Ne;return Qe.clear(),tt.clear(),wt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,K?Bt(it({},H),{layoutReads:K}):H)}Ke([pe,()=>s.nodes,q],([M,H,K])=>{const G=M??"";return H?.length||K===!0?(de(),he=G,void(Te=!0)):Te?(he&&G.length>he.length&&G.startsWith(he)?(J.value=!0,Z&&(Oe(),Ie=window.setTimeout(()=>{var oe;Ie=null,q.value===!0||(oe=s.nodes)!=null&&oe.length||(Ea(),J.value=!1,Ki())},1200))):(G.length<he.length||!G.startsWith(he))&&de(),void(he=G)):(he=G,void(Te=!0))},{flush:"sync",immediate:!0});const Qe=new Map,tt=new Map;let vt=!1,wt=0;function xt(M){let H=0;for(const K of M.values())H+=K;return H}function Rt(){wt=Math.max(wt,xt(tt)),tt.clear(),vt=!1}function yt(M,H){return(function(K){var G,oe;ke.value&&(Qe.set(K,((G=Qe.get(K))!=null?G:0)+1),tt.set(K,((oe=tt.get(K))!=null?oe:0)+1),vt||(vt=!0,Z&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Rt):typeof queueMicrotask!="function"?setTimeout(Rt,0):queueMicrotask(Rt)))})(M),H()}const nn=x.customId?`renderer-${x.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,xn=(function(M){const H=new Map;return{scope:M,cache:H,clear:()=>H.clear()}})(nn),ns=P(()=>`${nn}:${V.value}`);An(_5,xn);const Wt=us(()=>x.customId),{effectiveCustomHtmlTagsSet:_n,mergedParseOptions:gn,parsedNodes:ot}=Zee(x,{instanceMsgId:nn,renderContent:pe,effectiveFinal:q,smoothStreamingEnabled:ue,debugPerformanceEnabled:ke,customComponentsMap:Wt,logPerf:$e});Ke(ot,()=>{xn.clear(),V.value+=1},{immediate:!0});const ds=P(()=>({customId:x.customId,customHtmlTags:gn.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:Ye.value,viewportPriority:x.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:x.codeBlockStream,codeBlockDarkTheme:x.codeBlockDarkTheme,codeBlockLightTheme:x.codeBlockLightTheme,codeBlockMonacoOptions:x.codeBlockMonacoOptions,renderCodeBlocksAsPre:x.renderCodeBlocksAsPre,codeBlockMinWidth:x.codeBlockMinWidth,codeBlockMaxWidth:x.codeBlockMaxWidth,codeBlockProps:x.codeBlockProps,mermaidProps:x.mermaidProps,d2Props:x.d2Props,infographicProps:x.infographicProps,showTooltips:Se.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));An("markstreamNestedRendererProps",ds);const ys=P(()=>ot.value),fs=P(()=>ot.value.length),Xe=Q(null),Ze=Q(null),Mt=Q(null),Dt=Q(null),zt=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),wn=!zt&&x.customId?AS(x.customId):null,Rn=P(()=>wn?(CS.value,AS(x.customId)):null),hs=P(()=>{var M;return!!(Z&&!ne.value&&x.customId&&!zt&&((M=Rn.value)!=null&&M.enabled))}),ss=P(()=>{var M;return!!(!ne.value&&((M=s.virtualScroll)!=null&&M.enabled))}),sn=Q(!1);ln(()=>{sn.value=!0});const Lt=P(()=>!!(Z&&ss.value));An("markstreamHostScrollManaged",Lt);const Vs=P(()=>!!(sn.value&&Lt.value)),an=P(()=>hs.value||Lt.value),So=P(()=>hs.value||Vs.value),Co=P(()=>{var M;return an.value&&((M=Rn.value)==null?void 0:M.textEstimation)!==!1}),Rs=P(()=>{var M;return an.value&&((M=Rn.value)==null?void 0:M.codeBlockEstimation)!==!1});function fi(){const M=U.value||yt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const co=P(()=>{const M=fi();return M>0?Math.max(1,Math.round(M)):640}),jo=P(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),Ot=P(()=>{var M;return!ne.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?ot.value.length>0:ot.value.length>jo.value)}),Bs=P(()=>Ot.value||hs.value||Lt.value),qn=P(()=>x.viewportPriority!==!1&&!W.value),Cs=DJ(M=>{var H;return ce((H=M??S.value)!=null?H:null)},qn),{requestFrame:On,cancelFrame:Hn,hasIdleCallback:hi,isTestEnv:Xn}=(function(M){const H=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,K=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,G=M.isClient&&typeof window.requestIdleCallback=="function",oe=(function(){var be;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(be=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:be.value;return Me?.env})();return{requestFrame:H,cancelFrame:K,hasIdleCallback:G,isTestEnv:oe?.NODE_ENV==="test"}})({isClient:Z}),{resolvedBatchSize:qo,resolvedInitialBatch:Ks,batchingEnabled:Mi,incrementalRenderingActive:Ao,renderedCount:Vn,previousRenderContext:Vo,adaptiveBatchSize:ji,previousBatchConfig:Ko}=(function(M,H){var K;const G=P(()=>{var We;const Re=Math.trunc((We=M.renderBatchSize)!=null?We:80);return Number.isFinite(Re)?Math.max(0,Re):0}),oe=P(()=>{var We;const Re=Math.trunc((We=M.initialRenderBatchSize)!=null?We:G.value);return Number.isFinite(Re)?Math.max(0,Re):G.value}),be=P(()=>!H.renderAsFragment.value&&M.batchRendering!==!1&&G.value>0&&H.isClient&&!H.isTestEnv),Me=Q(0),Ne=Q({key:M.indexKey,total:0}),He=Q(Math.max(1,G.value||1)),Fe=P(()=>{var We;return be.value&&((We=M.maxLiveNodes)!=null?We:0)<=0}),Ue=Q({batchSize:G.value,initial:oe.value,delay:(K=M.renderBatchDelay)!=null?K:16,enabled:Fe.value});return{resolvedBatchSize:G,resolvedInitialBatch:oe,batchingEnabled:be,incrementalRenderingActive:Fe,renderedCount:Me,previousRenderContext:Ne,adaptiveBatchSize:He,previousBatchConfig:Ue}})(x,{isClient:Z,isTestEnv:Xn,renderAsFragment:ne}),Bn=new Map,Kn=new Map,Mo=new WeakMap;let rt=null;const xe=new WeakMap,Le=new Map,we=Q(0),X=P(()=>(we.value,Array.from(Bn.entries()).sort((M,H)=>M[0]-H[0]))),me=Q(null),je=Q(null);let lt=null,ee=0,_e=null;const{activeRestoreAnchor:Ae,getRelativeScrollTopWithinContainer:Pe,setRelativeScrollTopWithinContainer:st,resolveAnchorOffset:at,clearRestoreReconcile:Nt,scheduleRestoreReconcile:Zt,captureRestoreAnchor:Qt,restoreAnchor:As,getAnchorDrift:Cr}=(function(M){const{isClient:H,containerRef:K,parsedNodeCount:G,requestFrame:oe,cancelFrame:be,resolveScrollContainer:Me,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:He,isReverseFlexScrollRoot:Fe,estimateIndexForOffset:Ue,estimateHeightRange:We,getFallbackNodeHeight:Re,clamp:ze}=M,Je=Q(null);let et=null,St=[];function ct(){const Tt=Me(),Ht=K.value;if(!Tt||!Ht)return null;const Pt=Tt.ownerDocument||Ht.ownerDocument||document;if(Tt===Pt.documentElement||Tt===Pt.body||Tt===Pt.scrollingElement){const cn=Ht.getBoundingClientRect();return Math.max(0,-cn.top)}return Math.max(0,Ne(Tt,Pt,!1)-He(Ht,Tt))}function dt(Tt){var Ht;const Pt=Me(),cn=K.value;if(!Pt||!cn)return;const Io=Math.max(0,Tt),Gs=Pt.ownerDocument||cn.ownerDocument||document,pi=Gs.defaultView||(typeof window<"u"?window:null);if(Pt===Gs.documentElement||Pt===Gs.body||Pt===Gs.scrollingElement){const Ir=Ne(Pt,Gs,!0)+cn.getBoundingClientRect().top;return void((Ht=pi?.scrollTo)==null||Ht.call(pi,0,Math.max(0,Ir+Io)))}TS(Pt,Gs,He(cn,Pt)+Io,{isReverseFlexScrollRoot:Ir=>{var $r;return($r=Fe?.(Ir))!=null&&$r},getNormalizedScrollTop:Ne})}function At(Tt){const Ht=G.value,Pt=ze(Tt.nodeIndex,0,Math.max(0,Ht-1));return We(0,Pt)+Math.max(0,Tt.offsetWithinNodePx)}function Ct(){if(et!=null&&(be?.(et),et=null),H)for(const Tt of St)window.clearTimeout(Tt);St=[]}function Jt(Tt){const Ht=At(Tt),Pt=ct();Pt!=null&&Math.abs(Pt-Ht)<=.5||dt(Ht)}return{activeRestoreAnchor:Je,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:dt,resolveAnchorOffset:At,clearRestoreReconcile:Ct,applyRestoreAnchor:Jt,scheduleRestoreReconcile:function(){Je.value&&H&&et==null&&(et=oe?oe(()=>{et=null,Je.value&&Jt(Je.value)}):null,et==null&&Je.value&&Jt(Je.value))},captureRestoreAnchor:function(){const Tt=ct(),Ht=G.value;if(Tt==null||Ht<=0)return null;const Pt=ze(Ue(Tt+1),0,Ht-1),cn=We(0,Pt),Io=Re(Pt);return{nodeIndex:Pt,offsetWithinNodePx:ze(Tt-cn,0,Math.max(0,Io-1))}},restoreAnchor:function(Tt){const Ht=G.value;if(Je.value={nodeIndex:ze(Tt.nodeIndex,0,Math.max(0,Ht-1)),offsetWithinNodePx:Math.max(0,Tt.offsetWithinNodePx)},Ct(),Jt(Je.value),H)for(const Pt of[0,120,280,480])St.push(window.setTimeout(()=>{Je.value&&Jt(Je.value)},Pt))},getAnchorDrift:function(Tt){const Ht=ct();return Ht==null?null:Ht-At(Tt)}}})({isClient:Z,containerRef:S,parsedNodeCount:fs,requestFrame:On,cancelFrame:Hn,resolveScrollContainer:()=>me.value||fe(),getNormalizedScrollTop:se,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:j,estimateIndexForOffset:Jm,estimateHeightRange:Nr,getFallbackNodeHeight:Wd,clamp:Ts}),{nodeHeights:Vt,heightStats:vn,heightTreeSize:$n,heightSumTree:ks,heightKnownTree:bs,averageNodeHeight:Ms,resetHeightMeasurements:va,pruneHeightMeasurements:gm,rebuildHeightTrees:$d,recordNodeHeight:UM,removeNodeHeights:jM,exportHeightCache:qM,importHeightCache:VM,fenwickRangeSum:Ld}=(function(M={}){const H=Ss({}),K=Ss({total:0,count:0}),G=Q(0),oe=Q([]),be=Q([]);function Me(){for(const Re of Object.keys(H))delete H[Number(Re)];K.total=0,K.count=0,G.value=0,oe.value=[],be.value=[]}function Ne(Re,ze,Je){for(let et=ze+1;et<Re.length;et+=et&-et)Re[et]+=Je}function He(Re,ze){let Je=0;for(let et=ze+1;et>0;et-=et&-et)Je+=Re[et];return Je}function Fe(Re){G.value=Re;const ze=new Array(Re+1).fill(0),Je=new Array(Re+1).fill(0);for(const[et,St]of Object.entries(H)){const ct=Number(et),dt=Number(St);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0||(Ne(ze,ct,dt),Ne(Je,ct,1))}oe.value=ze,be.value=Je}function Ue(Re){if(!Number.isInteger(Re)||Re<0)return!1;const ze=H[Re];if(!Number.isFinite(ze)||ze<=0)return!1;if(delete H[Re],K.total=Math.max(0,K.total-ze),K.count=Math.max(0,K.count-1),G.value>Re){const Je=oe.value,et=be.value;Je.length&&et.length&&(Ne(Je,Re,-ze),Ne(et,Re,-1))}return!0}const We=P(()=>K.count>0?Math.max(12,K.total/K.count):32);return{nodeHeights:H,heightStats:K,heightTreeSize:G,heightSumTree:oe,heightKnownTree:be,averageNodeHeight:We,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Re){if(Re<=0)return void Me();let ze=0,Je=0;for(const[et,St]of Object.entries(H)){const ct=Number(et),dt=Number(St);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0?delete H[ct]:(ze+=dt,Je++)}K.total=ze,K.count=Je},rebuildHeightTrees:Fe,recordNodeHeight:function(Re,ze,Je={}){(function(et,St,ct={}){var dt;if(!Number.isFinite(St)||St<=0)return!1;const At=H[et];if(At&&(ct.allowShrink===!1&&St<At||Math.abs(St-At)<=1))return!1;if(H[et]=St,At?K.total+=St-At:(K.total+=St,K.count++),G.value>et){const Ct=oe.value,Jt=be.value;if(Ct.length&&Jt.length)if(At){const Tt=St-At;Tt!==0&&Ne(Ct,et,Tt)}else Ne(Ct,et,St),Ne(Jt,et,1)}ct.notify!==!1&&((dt=M.onHeightRecorded)==null||dt.call(M))})(Re,ze,Bt(it({},Je),{notify:!0}))},removeNodeHeight:function(Re,ze={}){var Je;const et=Ue(Re);return et&&ze.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},removeNodeHeights:function(Re,ze={}){var Je;let et=0;for(const St of Re)Ue(Number(St))&&et++;return et>0&&ze.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},exportHeightCache:function(){return Object.entries(H).map(([Re,ze])=>({index:Number(Re),height:Number(ze)})).filter(Re=>Number.isFinite(Re.index)&&Re.index>=0&&Number.isFinite(Re.height)&&Re.height>0).sort((Re,ze)=>Re.index-ze.index)},importHeightCache:function(Re,ze={}){var Je;if(!Array.isArray(Re))return;const et=G.value;let St=!1;if(ze.mode!=="merge"){const ct=Object.keys(H);if(ct.length>0){for(const dt of ct)delete H[Number(dt)];St=!0}}for(const ct of Re){const dt=Number(ct.index),At=Number(ct.height);if(!Number.isInteger(dt)||dt<0||et>0&&dt>=et||!Number.isFinite(At)||At<=0)continue;const Ct=H[dt];Ct&&Math.abs(Ct-At)<=1||(H[dt]=At,St=!0)}St&&((function(){let ct=0,dt=0;const At=G.value;for(const[Ct,Jt]of Object.entries(H)){const Tt=Number(Ct),Ht=Number(Jt);!Number.isFinite(Tt)||Tt<0||At>0&&Tt>=At||!Number.isFinite(Ht)||Ht<=0?delete H[Tt]:(ct+=Ht,dt++)}K.total=ct,K.count=dt})(),et>0&&Fe(et),(Je=M.onHeightRecorded)==null||Je.call(M))},fenwickRangeSum:function(Re,ze,Je){if(Je<=ze)return 0;const et=He(Re,Je-1);return ze<=0?et:et-He(Re,ze-1)}}})({onHeightRecorded:()=>{Yo(),Lt.value&&Jc(),Ae.value&&Zt(),je.value&&Ca(),Ln("node-resize")}});function Fd(){va(),Le.clear()}function Tk(M){!Number.isInteger(M)||M<0||M>=ot.value.length||Le.set(M,zc(M))}function Nk(M,H,K={}){const G=Vt[M];UM(M,H,K);const oe=Vt[M];oe&&oe>0?Tk(M):G&&Le.delete(M)}function Ik(M,H){const K=yt("getNodeLayoutHeight.slot.offsetHeight",()=>{var G,oe;return(oe=(G=Bn.get(M))==null?void 0:G.offsetHeight)!=null?oe:0});return K>0?K:yt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function $k(M,H={}){VM(M,H),jm()}const Ar=P(()=>{var M;return!ne.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!Ot.value&&!(ot.value.length>900)&&qn.value}),Lk=P(()=>!!Cs&&(Ar.value||Ot.value)),Fk=P(()=>Ot.value||Lt.value),{liveNodeBufferResolved:Dc,focusIndex:Go,liveRange:Es,updateLiveRange:wl}=(function(M,H){const{parsedNodeCount:K,virtualizationEnabled:G,maxLiveNodesResolved:oe,clamp:be}=H,Me=P(()=>{var Fe;return Math.max(0,(Fe=M.liveNodeBuffer)!=null?Fe:60)}),Ne=Q(0),He=Ss({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Ne,liveRange:He,updateLiveRange:function(){const Fe=K.value;if(!G.value||Fe===0)return He.start=0,void(He.end=Fe);const Ue=Math.min(oe.value,Fe),We=Me.value,Re=be(Ne.value-We,0,Math.max(0,Fe-Ue));He.start=Re,He.end=Math.min(Fe,Re+Ue)}}})(x,{parsedNodeCount:fs,virtualizationEnabled:Ot,maxLiveNodesResolved:jo,clamp:Ts}),Ei=new Map,Sl=new Map,Mr=new Map,Od=[],qi=new Map,Er=new Set,Ok=Q(0);let vm=!1;const Rk=P(()=>(Ok.value,Er.size)),Eo=new Map,Ti=new Map,Bk=Q(0),ym=P(()=>{Bk.value;let M=0;for(const H of Eo.values())M+=Math.max(0,H);return M});let To=null,km=!0,Dk=[0],Pk="";function Yo(){km=!0}const Rd=P(()=>{if(!Ot.value)return ot.value.length;const M=Dc.value,H=Math.max(Es.end+M,Ks.value),K=Math.min(ot.value.length,H);return Math.max(Vn.value,K)});function Bd(){vm||(vm=!0,queueMicrotask(()=>{vm=!1,Ok.value+=1}))}function Hk(M,H,K="node-resize"){if(!Z||typeof window>"u")return null;const G=window.setTimeout(()=>{Er.delete(G)&&Bd();try{H()}finally{Ln(K)}},Math.max(0,M));return Er.add(G),Bd(),G}function Dd(M){Z&&M!=null&&(Er.delete(M)&&Bd(),window.clearTimeout(M))}function Wk(){if(Z&&typeof window<"u")for(const M of Er)window.clearTimeout(M);Er.size&&(Er.clear(),Bd()),Od.length=0,Mr.clear()}function KM(M){var H,K;return(K=(H=Dt.value)==null?void 0:H[M])!=null?K:null}const{cancelScheduledFocusSync:bm,scheduleFocusSync:Ni}=(function(M){const{isClient:H,containerRef:K,virtualizationEnabled:G,requestFrame:oe,cancelFrame:be,syncFocusToScroll:Me}=M;let Ne=null;function He(){var Ue,We,Re;return(Re=(We=(Ue=K.value)==null?void 0:Ue.ownerDocument)==null?void 0:We.defaultView)!=null?Re:typeof window<"u"?window:null}function Fe(){if(!Ne)return;const Ue=He();Ne.viaTimeout?Ue?Ue.clearTimeout(Ne.id):clearTimeout(Ne.id):be?.(Ne.id),Ne=null}return{cancelScheduledFocusSync:Fe,scheduleFocusSync:function(Ue={}){if(!G.value)return;if(!H)return void Me(!0);if(Ue.immediate)return Fe(),void Me(!0);if(Ne)return;const We=()=>{Ne=null,Me()};if(oe)return void(Ne={id:oe(We),viaTimeout:!1});const Re=He();Ne={id:Re?Re.setTimeout(We,16):setTimeout(We,16),viaTimeout:!0}}}})({isClient:Z,containerRef:S,virtualizationEnabled:Ot,requestFrame:On,cancelFrame:Hn,syncFocusToScroll:function(M=!1){var H;if(!Ot.value)return;const K=me.value||fe();if(!K)return;const G=K.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,oe=G?.defaultView||(typeof window<"u"?window:null),be=K===G?.documentElement||K===G?.body,Me=ot.value.length;if(!be&&Me>0&&j(K)){const Je=yt("syncFocusToScroll.clientHeight",()=>K.clientHeight||0),et=yt("syncFocusToScroll.scrollTop",()=>K.scrollTop),St=et<0?-et:et,ct=(function(At){var Ct,Jt;const Tt=ot.value;if(!Tt.length)return 0;if(At<=0)return Math.max(0,Tt.length-1);if(an.value){const Pt=(Ct=Cm()[Tt.length])!=null?Ct:0;return Yk(Math.max(0,Pt-At))}if($n.value===Tt.length){const Pt=Nr(0,Tt.length);return Jm(Math.max(0,Pt-At))}let Ht=At;for(let Pt=Tt.length-1;Pt>=0;Pt--){const cn=(Jt=Vt[Pt])!=null?Jt:Ms.value;if(Ht<=cn)return Pt;Ht-=cn}return 0})(Math.max(0,St)+.5*Math.max(0,Je)),dt=Ts(ct,0,Math.max(0,Me-1));return void((M||Math.abs(dt-Go.value)>1)&&(Go.value=dt,wl()))}const Ne=be?null:yt("syncFocusToScroll.root.getBoundingClientRect",()=>K.getBoundingClientRect()),He=be?0:Ne.top,Fe=be?yt("syncFocusToScroll.viewport.clientHeight",()=>{var Je,et;return(et=(Je=oe?.innerHeight)!=null?Je:K.clientHeight)!=null?et:0}):Ne.bottom,Ue=X.value;let We=null,Re=null;for(const[Je,et]of Ue){if(!et)continue;const St=yt("syncFocusToScroll.slot.getBoundingClientRect",()=>et.getBoundingClientRect());St.bottom<=He||St.top>=Fe||(We==null&&(We=Je),Re=Je)}if(We==null||Re==null){const Je=S.value;if(!Je)return;const et=be?{top:0}:yt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>K.getBoundingClientRect()),St=yt("syncFocusToScroll.fallback.scrollTop",()=>se(K,G,be)),ct=be?(()=>{const Ct=yt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Je.getBoundingClientRect()),Jt=(be?0:et.top)-Ct.top;return Math.max(0,Jt)})():(()=>{const Ct=ge(Je,K);return Math.max(0,St-Ct)})(),dt=be?yt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,Jt,Tt,Ht;return(Ht=(Tt=(Jt=oe?.innerHeight)!=null?Jt:(Ct=G?.documentElement)==null?void 0:Ct.clientHeight)!=null?Tt:K.clientHeight)!=null?Ht:0}):yt("syncFocusToScroll.fallback.root.clientHeight",()=>K.clientHeight),At=Jm(ct+.5*Math.max(0,dt));return Go.value=Ts(At,0,Math.max(0,ot.value.length-1)),void wl()}const ze=Math.round((We+Re)/2);!M&&Math.abs(ze-Go.value)<=1||(Go.value=Ts(ze,0,Math.max(0,ot.value.length-1)),wl())}}),{visibleNodeIndices:xm,nodeVisibilityHandles:ya,nodeVisibilityWatchStops:Pd,nodeVisibilityFallbackTimers:zk,clearVisibilityFallback:Hd,markNodeVisible:Tr,cleanupNodeVisibility:GM,destroyNodeVisibilityState:_m}=Qee({isClient:Z,shouldTrackVisibleNodeIndices:()=>Ar.value,shouldCleanupNodeVisibility:()=>Ot.value,onNodeMarkedVisible:M=>{Ot.value?Ni():Go.value=Ts(M,0,Math.max(0,ot.value.length-1))},onNodeVisibilityCleaned:M=>{Bn.delete(M)&&v2()}}),{cleanupScrollListener:Uk,setupScrollListener:YM}=(function(M){const{isClient:H,virtualizationEnabled:K,listenerEnabled:G,scrollRootElement:oe,resolveScrollContainer:be,scheduleFocusSync:Me,onScroll:Ne}=M;let He=null,Fe=null;function Ue(){He&&(He(),He=null),Fe=null,oe.value=null}function We(Re){const ze=M.getScrollTop?M.getScrollTop(Re):Re.scrollTop;return Math.max(0,Number.isFinite(ze)?Math.abs(ze):0)}return{cleanupScrollListener:Ue,setupScrollListener:function(){if(!H)return;if(!((Re=G?.value)!=null?Re:K.value))return void Ue();var Re;const ze=be();if(!ze)return void Ue();if(oe.value===ze&&He)return;Ue(),Fe=We(ze);const Je=()=>{if(Ne?.(),K.value){const et=(function(St){const ct=We(St),dt=Fe;Fe=ct;const At=Math.max(480,.75*(St.clientHeight||0));return dt==null?ct>At?{immediate:!0}:void 0:Math.abs(ct-dt)>At?{immediate:!0}:void 0})(ze);et?Me(et):Me()}};ze.addEventListener("scroll",Je,{passive:!0}),oe.value=ze,He=()=>{ze.removeEventListener("scroll",Je)}}}})({isClient:Z,virtualizationEnabled:Ot,listenerEnabled:Fk,scrollRootElement:me,resolveScrollContainer:fe,scheduleFocusSync:Ni,onScroll:function(){const M=je.value;if(!M)return;const H=Wc();if(!H||(function(G){if(Kc()>=ee)return _e=null,!1;const oe=_e;if(oe==null)return!0;const be=Math.abs(G.scrollTop-oe)<=2;return be||(_e=null),be})(H))return;const K=o2(H);K!=null?(K<-32||Math.abs(Math.max(0,K)-Math.max(0,M.distanceFromBottomPx))>32)&&Sa("restore"):Sa("restore")},getScrollTop:M=>{var H;const K=M.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,G=M===K.documentElement||M===K.body||M===K.scrollingElement;return yt("scrollListener.getScrollTop",()=>se(M,K,G))}});function Ts(M,H,K){return Math.min(Math.max(M,H),K)}function wm(M){return M?.firstElementChild}function jk(M,H){var K;return M?(K=M.matches)!=null&&K.call(M,H)?M:M.querySelector(H):null}function qk(){if(!an.value)return void(U.value=0);const M=yt("updateExperimentContainerWidth.clientWidth",()=>{var H,K;return(K=(H=S.value)==null?void 0:H.clientWidth)!=null?K:0});U.value=M>0?M:0}let Pc=null;function Sm(){Pc?.disconnect(),Pc=null}const Vk=ki({loader:()=>zn(null,null,function*(){return(yield eo(()=>import("./index8-CHlcChT0.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:m5,delay:0,suspensible:!1});function Kk(M){return M===Vk}const Gk=P(()=>u.value==="pre"?$o:u.value==="shiki"?Vk:d0),Cl=P(()=>{const M=ot.value;if(!M.length||!an.value)return M.map(()=>null);const H=U.value||yt("estimatedNodeHeights.clientWidth",()=>{var K;return((K=S.value)==null?void 0:K.clientWidth)||0});return!Number.isFinite(H)||H<=0?M.map(()=>null):M.map((K,G)=>{const oe=Vt[G],be=typeof oe=="number"&&oe>0;if(Co.value&&!be){const Ne=x5(K,H,re.value);if(Ne)return Ne}if(Rs.value&&K.type==="code_block"){const Ne=(function(He){if(He.type!=="code_block")return null;const Fe=N2(He,Gd(He));return Kk(Fe)?"markdown":Fe===$o?"pre":Fe===Gk.value||Fe===d0?"monaco":null})(K);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return Ree(K,{rendererKind:Ne,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Me=x.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function Wd(M){var H;const K=Vt[M];if(Number.isFinite(K)&&K>0)return K;const G=(H=Cl.value[M])==null?void 0:H.height;return Number.isFinite(G)&&G>0?G:Math.max(Ms.value,(function(oe){var be,Me,Ne,He,Fe,Ue,We,Re,ze,Je,et,St,ct;const dt=ot.value[oe];if(!dt||typeof dt!="object")return 32;const At=String((be=dt.type)!=null?be:""),Ct=fi()||640;switch(At){case"heading":return 44;case"paragraph":return ka(String((Ne=(Me=dt.raw)!=null?Me:dt.content)!=null?Ne:""),Ct,34);case"list":{const Jt=Array.isArray(dt.items)?dt.items.length:1;return Math.max(48,30*Jt+12)}case"list_item":return ka(String((Fe=(He=dt.raw)!=null?He:dt.content)!=null?Fe:""),Ct,34);case"blockquote":return ka(String((We=(Ue=dt.raw)!=null?Ue:dt.content)!=null?We:""),Ct,56);case"table":{const Jt=Array.isArray(dt.rows)?dt.rows.length:Array.isArray(dt.children)?dt.children.length:3;return Math.max(120,38*Jt+48)}case"code_block":return ka(String((ze=(Re=dt.code)!=null?Re:dt.raw)!=null?ze:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ka(String((et=(Je=dt.raw)!=null?Je:dt.content)!=null?et:""),Ct,96);case"thematic_break":return 24;default:return ka(String((ct=(St=dt.raw)!=null?St:dt.content)!=null?ct:""),Ct,40)}})(M))}function ka(M,H,K,G=22){const oe=String(M??"");if(!oe)return K;const be=Math.max(18,Math.floor(Math.max(320,H)/8)),Me=oe.split(/\r?\n/).length,Ne=Math.ceil(oe.length/be),He=Math.max(1,Me,Ne);return Math.max(K,Math.ceil(He*G+12))}function Hc(M){const H=Number(M);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function Cm(){var M,H;const K=ot.value.length,G=Hc(U.value||yt("getFallbackHeightPrefix.clientWidth",()=>{var Ne;return((Ne=S.value)==null?void 0:Ne.clientWidth)||0})),oe=((M=s.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(s.virtualScroll.measurementKey),be=[K,vn.count,Math.round(vn.total),Math.round(100*Ms.value),oe,G,an.value?1:0,CS.value,V.value].join(":");if(!km&&Pk===be)return Dk;const Me=new Array(K+1);Me[0]=0;for(let Ne=0;Ne<K;Ne++)Me[Ne+1]=Me[Ne]+(an.value?Wd(Ne):(H=Vt[Ne])!=null?H:Ms.value);return Dk=Me,Pk=be,km=!1,Me}function Yk(M){var H,K;const G=ot.value.length;if(G<=0||M<=0)return 0;const oe=Cm();if(M>=((H=oe[G])!=null?H:0))return G-1;let be=0,Me=G-1,Ne=G-1;for(;be<=Me;){const He=be+Me>>1;((K=oe[He+1])!=null?K:0)>=M?(Ne=He,Me=He-1):be=He+1}return Ne}function Nr(M,H){var K,G;if(M>=H)return 0;if(an.value)return(function(Me,Ne){var He,Fe;const Ue=ot.value.length,We=Ts(Math.trunc(Me),0,Ue),Re=Ts(Math.trunc(Ne),We,Ue);if(We>=Re)return 0;const ze=Cm();return((He=ze[Re])!=null?He:0)-((Fe=ze[We])!=null?Fe:0)})(M,H);if($n.value!==ot.value.length){let Me=0;for(let Ne=M;Ne<H;Ne++)Me+=(K=Vt[Ne])!=null?K:Ms.value;return Me}const oe=ks.value,be=bs.value;if(!oe.length||!be.length){let Me=0;for(let Ne=M;Ne<H;Ne++)Me+=(G=Vt[Ne])!=null?G:Ms.value;return Me}return Ld(oe,M,H)+(H-M-Ld(be,M,H))*Ms.value}Ke(()=>ot.value.length,M=>{Yo(),M<=0?Fd():(M<$n.value&&gm(M),M!==$n.value&&$d(M))},{immediate:!0});const ZM=P(()=>{if(!Ot.value)return ot.value.map((G,oe)=>({node:G,index:oe}));const M=ot.value.length,H=Ts(Es.start,0,M),K=Ts(Es.end,H,M);return ot.value.slice(H,K).map((G,oe)=>({node:G,index:H+oe}))}),Am=P(()=>Ot.value?Nr(0,Math.min(Es.start,ot.value.length)):0),Mm=P(()=>{if(!Ot.value)return 0;const M=ot.value.length;return Nr(Math.min(Es.end,M),M)});function Zk(){if(!an.value)return 0;let M=0;const H=Cl.value;for(let K=0;K<H.length;K++){if(!H[K])continue;const G=Vt[K];Number.isFinite(G)&&G>0||M++}return M}function Qk(){const M=ot.value.length;return{totalNodes:M,measuredCount:vn.count,estimatedCount:Zk(),averageNodeHeight:Ms.value,topSpacerHeight:Am.value,bottomSpacerHeight:Mm.value,estimatedTotalHeight:Nr(0,M),width:Al()}}function QM(){const M=ot.value,H=Qk();return Bt(it({},H),{probe:{paragraphReady:!!re.value.paragraph,listItemReady:!!re.value.listItem,listWrapperOverhead:re.value.listWrapperOverhead,headingReadyLevels:Object.entries(re.value.headings).filter(([,K])=>!!K).map(([K])=>Number(K))},nodes:M.map((K,G)=>{var oe,be,Me,Ne,He,Fe,Ue,We,Re;return{index:G,type:K.type,estimateKind:(be=(oe=Cl.value[G])==null?void 0:oe.kind)!=null?be:null,rendererKind:(Ne=(Me=Cl.value[G])==null?void 0:Me.rendererKind)!=null?Ne:null,estimatedHeight:(Fe=(He=Cl.value[G])==null?void 0:He.height)!=null?Fe:null,estimatedContentHeight:(We=(Ue=Cl.value[G])==null?void 0:Ue.contentHeight)!=null?We:null,measuredHeight:(Re=Vt[G])!=null?Re:null}})})}function Em(){return s.indexKey!=null?String(s.indexKey):ss.value?`virtual-${Dn()}`:"markdown-renderer"}function Xk(M){const H=String(M),K=`${Em()}-`;if(!H.startsWith(K))return null;const G=H.slice(K.length).match(/^(\d+)(?:$|-)/);if(!G)return null;const oe=Number(G[1]);return!Number.isInteger(oe)||oe<0||oe>=ot.value.length?null:oe}function Dn(){var M,H,K;const G=(M=s.virtualScroll)==null?void 0:M.sessionKey;return String(G!=null&&G!==""?G:(K=(H=s.indexKey)!=null?H:x.customId)!=null?K:nn)}function ps(){var M;const H=(M=s.virtualScroll)==null?void 0:M.threadKey;return H==null||H===""?void 0:String(H)}function Tm(M){var H;return(M??"")===((H=ps())!=null?H:"")}function XM(){var M;const H=(M=s.virtualScroll)==null?void 0:M.measurementKey;return H==null?"":String(H)}function JM(){var M,H;const K=u.value,G=K==="monaco"?x.codeBlockMonacoOptions:void 0,oe=x.codeBlockProps,be=K==="shiki";return[x.isDark?"dark":"light",K==="monaco"?"code-rich":K==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",xs(x.codeBlockMinWidth),xs(x.codeBlockMaxWidth),...be?[Zh((M=oe?.themes)!=null?M:x.themes,(H=oe?.langs)!=null?H:x.langs)]:[],xs(G?.fontSize),xs(G?.lineHeight),xs(G?.fontFamily),xs(G?.tabSize),xs(G?.MAX_HEIGHT),xs(G?.wordWrap),xs(G?.wrappingIndent),xs(G?.padding),xs(oe?.showHeader),xs(oe?.showCopyButton),xs(oe?.showExpandButton),xs(oe?.showPreviewButton),xs(oe?.showCollapseButton),xs(oe?.showFontSizeButtons)].join("\0")}function Vi(){return[XM(),JM()].join("\0")}function Al(){return fi()}const zd=P(()=>Hc(Al())),No=P(()=>[Vi(),zd.value].join("\0")),e8=P(()=>{var M;return ss.value?["virtual",(M=ps())!=null?M:"",Dn(),No.value].join("\0"):s.indexKey});function ba(){Bk.value+=1}function Nm(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=ot.value.length||M.sessionKey!==Dn()||M.threadKey!==ps()||M.layoutEpochKey!==No.value)}function Jk(M){const H=String(M),K=Ti.get(H);return K?Nm(K)?K.index:null:Xk(H)}function e2(M="async-node"){(Eo.size||Ti.size)&&(Eo.clear(),Ti.clear(),ba(),Ln(M))}const xa=Ut(Hg,null),Im={reportHeight(M,H){if(!Lt.value)return;const K=Jk(M);if(K==null)return;const G=Ei.get(K);if(!G)return;const oe=Number(H),be=Ik(K,G);Nk(K,Number.isFinite(oe)&&oe>0?Math.max(oe,be||0):be)},markPending(M){if(!Lt.value)return;const H=Xk(M);H!=null&&(function(K,G){var oe;const be=Ti.get(K);if(be&&Nm(be))return Eo.set(K,Math.max(0,(oe=Eo.get(K))!=null?oe:0)+1),ba(),void Ln("async-node");Eo.set(K,1),Ti.set(K,(function(Me){return{index:Me,sessionKey:Dn(),threadKey:ps(),layoutEpochKey:No.value}})(G)),ba(),Ln("async-node")})(String(M),H)},markSettled(M){if(!Lt.value)return;const H=String(M),K=Jk(M);(K!=null||(function(G){return Eo.has(String(G))})(H))&&(function(G){var oe;const be=(oe=Eo.get(G))!=null?oe:0;return!(be<=0||(be<=1?(Eo.delete(G),Ti.delete(G)):Eo.set(G,be-1),ba(),be===1&&Ln("async-node"),0))})(H)&&K!=null&&Ki()}};function t8(){let M=0;for(const H of Ei.values())M+=yt("getVisibleDomHeight.offsetHeight",()=>{var K;return(K=H?.offsetHeight)!=null?K:0});return Math.ceil(Math.max(0,M))}An(Hg,{reportHeight(M,H){Im.reportHeight(M,H),xa?.reportHeight(M,H)},markPending(M){Im.markPending(M),xa?.markPending(M)},markSettled(M){Im.markSettled(M),xa?.markSettled(M)}});let $m,Lm=null,_a=null;function Ud(M){return M!==!1&&M!=null&&M!==""}function t2(){return Ot.value?(function(){if(!Ot.value)return!0;const M=ot.value.length,H=Ts(Es.start,0,M),K=Ts(Es.end,H,M);if(H>=K)return!0;for(let G=H;G<K;G++)if(!Bn.has(G)||e1(G)&&!Ei.has(G))return!1;return!0})():Vn.value>=Rd.value}function Fm(){return q.value===!0&&!J.value&&ym.value===0&&Er.size===0&&qi.size===0&&To==null&&t2()}function n2(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.settleMode)!=="manual"||Lm===Dn()&&$m===ps())return!0;const K=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!Ud(K)&&_a===eu(K)}function Om(){return Fm()&&n2()}function n8(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 Ml(M="manual",H){const K=Qk(),G=(function(oe){return oe||(q.value!==!0?ot.value.length>0?"streaming":"estimating":!t2()||qi.size>0||To!=null?"measuring":Om()?"settled":"settling")})(H);return{sessionKey:Dn(),threadKey:ps(),phase:G,nodeCount:K.totalNodes,liveRange:{start:Es.start,end:Es.end},renderedCount:Vn.value,measuredCount:K.measuredCount,estimatedCount:K.estimatedCount,averageNodeHeight:K.averageNodeHeight,topSpacerHeight:K.topSpacerHeight,bottomSpacerHeight:K.bottomSpacerHeight,visibleDomHeight:t8(),totalHeight:s2(),width:K.width,final:q.value===!0,stable:Om(),confidence:n8(G,K),reason:M}}function Wc(){const M=me.value||fe(),H=S.value;if(!M||!H)return null;const K=M.ownerDocument||H.ownerDocument||document,G=M===K.documentElement||M===K.body||M===K.scrollingElement,oe=yt("getScrollBox.scrollTop",()=>se(M,K,G)),be=yt("getScrollBox.scrollHeight",()=>{var Ne,He,Fe,Ue,We;return G?Math.max((He=(Ne=K.documentElement)==null?void 0:Ne.scrollHeight)!=null?He:0,(Ue=(Fe=K.body)==null?void 0:Fe.scrollHeight)!=null?Ue:0,(We=M.scrollHeight)!=null?We:0):M.scrollHeight}),Me=yt("getScrollBox.clientHeight",()=>{var Ne;return G?((Ne=K.documentElement)==null?void 0:Ne.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:K,isViewportRoot:G,scrollTop:oe,scrollHeight:be,clientHeight:Me}}function s2(){const M=ot.value.length,H=Math.max(0,Nr(0,M)),K=yt("getRendererLogicalHeight.offsetHeight",()=>{var oe,be;return(be=(oe=S.value)==null?void 0:oe.offsetHeight)!=null?be:0}),G=Math.max(0,K>0?K:yt("getRendererLogicalHeight.scrollHeight",()=>{var oe,be;return(be=(oe=S.value)==null?void 0:oe.scrollHeight)!=null?be:0}));return M<=0?Math.ceil(K):Ot.value?H>0?Math.max(1,Math.ceil(H),(function(){let oe=Am.value+Mm.value;for(const be of Bn.values())be&&(oe+=Math.max(0,yt("getVirtualizedDomLogicalHeight.offsetHeight",()=>be.offsetHeight||0)));return Math.ceil(Math.max(0,oe))})(),(function(oe,be){return oe<=0||be<=0?0:be<=oe+Math.max(512,.05*oe)?Math.ceil(be):0})(H,G)):Math.max(1,Math.ceil(G)):Lt.value?H>0||vn.count>0||Zk()>0?(Ao.value&&Vn.value,Math.max(1,Math.ceil(G),Math.ceil(H))):Math.ceil(G):Math.max(1,Math.ceil(G),Math.ceil(H))}function o2(M){const H=S.value;if(!H)return null;const K=yt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(oe){return oe.isViewportRoot?oe.clientHeight:yt("getViewportBottomInRoot.getBoundingClientRect",()=>oe.root.getBoundingClientRect().bottom)})(M)-K.bottom}function s8(M={}){const H=M.requireViewport!==!1,K=(function(be=64){const Me=Wc(),Ne=S.value;if(!Me||!Ne)return!1;const He=(function(Ue){if(Ue.isViewportRoot)return{top:0,bottom:Ue.clientHeight};const We=yt("getVirtualViewportRect.getBoundingClientRect",()=>Ue.root.getBoundingClientRect());return{top:We.top,bottom:We.bottom}})(Me),Fe=yt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ne.getBoundingClientRect());return Fe.bottom>=He.top-be&&Fe.top<=He.bottom+be})();if(H&&!K)return null;const G=(function(){const be=Wc(),Me=S.value;if(!be||!Me||Math.max(0,be.scrollHeight-be.scrollTop-be.clientHeight)>64)return null;const Ne=o2(be);return Ne==null?null:Ne>=-8&&Ne<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ne)}:null})();if(G)return{anchor:G,captured:!0};const oe=Qt();if(oe)return{anchor:{type:"node",nodeIndex:oe.nodeIndex,offsetWithinNodePx:oe.offsetWithinNodePx},captured:K};if(M.allowFallback===!0){const be=(function(){const Me=ot.value.length;return Me<=0?null:{type:"node",nodeIndex:Ts(Go.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return be?{anchor:be,captured:!1}:null}return null}function Rm(M){let H=2166136261;for(let K=0;K<M.length;K++)H^=M.charCodeAt(K),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function o8(M,H){let K=M;for(let G=0;G<H.length;G++)K^=H.charCodeAt(G),K=Math.imul(K,16777619);return K^=31,K=Math.imul(K,16777619),K}const i8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function jd(M,H=new WeakSet,K=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(G){const oe=G.length>8192?`${G.slice(0,8192)}...${G.length}`:G;return`${G.length}:${Rm(oe)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(H.has(M))return"cycle";if(K>=6)return"max-depth";H.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Fe=[];for(let Ue=0;Ue<M.length;Ue++)Fe.push(jd(M[Ue],H,K+1));return`a:${M.length}:${Fe.join(",")}`}const be=[],Me=[],Ne=Math.max(0,M.length-32);let He=2166136261;for(let Fe=0;Fe<M.length;Fe++){const Ue=jd(M[Fe],H,K+1);He=o8(He,Ue),Fe<32&&be.push(Ue),Fe>=Ne&&Me.push(Ue)}return[`a:${M.length}`,`h=${be.join(",")}`,`t=${Me.join(",")}`,`all=${(He>>>0).toString(36)}`].join(":")}const G=M,oe=Object.keys(G).filter(be=>{const Me=G[be];return be!=="parent"&&be!=="el"&&be!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||i8.has(be))}).sort();return`o:${oe.length}:${oe.map(be=>`${be}=${jd(G[be],H,K+1)}`).join(";")}`}finally{H.delete(M)}}let i2=-1,Bm="";function zc(M){const H=ot.value[M];return H?Rm(jd(H)):""}function Dm(){const M=V.value;if(i2===M)return Bm;let H=2166136261;for(let K=0;K<ot.value.length;K++){const G=zc(K);for(let oe=0;oe<G.length;oe++)H^=G.charCodeAt(oe),H=Math.imul(H,16777619)}return Bm=(H>>>0).toString(36),i2=M,Bm}function wa(M,H={}){var K;const G=H.includeHeightCache===!0,oe=(K=H.includeContentHash)!=null?K:G,be=G?(function(Ne){const He=(function(){var et,St;const ct=Number((St=(et=s.virtualScroll)==null?void 0:et.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(He)||Ne.length<=He)return Ne;const Fe=new Map,Ue=et=>{!et||Fe.size>=He||Fe.set(et.index,et)},We=ot.value.length,Re=Ts(Es.start-2*Dc.value,0,We),ze=Ts(Es.end+2*Dc.value,Re,We);for(const et of Ne)et.index>=Re&&et.index<ze&&Ue(et);const Je=Math.max(1,Math.ceil(Ne.length/He));for(let et=0;et<Ne.length&&Fe.size<He;et+=Je)Ue(Ne[et]);for(let et=Ne.length-1;et>=0&&Fe.size<He;et-=Je)Ue(Ne[et]);return Array.from(Fe.values()).sort((et,St)=>et.index-St.index).slice(0,He)})(qM().map(Ne=>{var He;const Fe=ot.value[Ne.index];return Fe?Bt(it({},Ne),{nodeType:String((He=Fe.type)!=null?He:""),signature:zc(Ne.index)}):null}).filter(Ne=>!!Ne)):[],Me=s8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Me||be.length||H.includeEmptyState===!0?Bt(it({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:oe?Dm():void 0,measurementKey:Vi()||void 0,heightCache:be.length?be:void 0}):null}function Pm(M){var H,K;const G=Wc();if(!G)return;const oe=(function(Ne){const He=S.value;if(!He)return null;const Fe=ge(He,Ne.root),Ue=ot.value.length,We=yt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>He.offsetHeight||0),Re=Math.max(0,We>0?We:Ue>0?yt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>He.scrollHeight||0):0),ze=s2();return Fe+Math.max(Re,ze)})(G);if(oe==null)return;const be=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,oe-G.clientHeight-be);(function(Ne){ee=Kc()+120,_e=Ne})(Me),G.isViewportRoot?(K=(H=G.doc.defaultView)==null?void 0:H.scrollTo)==null||K.call(H,0,Me):TS(G.root,G.doc,Me,{isReverseFlexScrollRoot:j,getNormalizedScrollTop:se})}const Hm=[];function r2(){if(Z)for(lt!=null&&(Hn?.(lt),lt=null);Hm.length;){const M=Hm.pop();M!=null&&window.clearTimeout(M)}}function Sa(M){const H=!!je.value;je.value=null,ee=0,_e=null,r2(),H&&M&&Ln(M)}function Ca(){if(!je.value||!Z||lt!=null)return;const M=()=>{lt=null;const H=je.value;H&&Pm(H)};lt=On?On(M):null,lt==null&&M()}function l2(M,H={}){const K=ot.value.length;return K<=0?[]:M.filter(G=>!(!Number.isInteger(G.index)||G.index<0||G.index>=K)&&!(!Number.isFinite(G.height)||G.height<=0)&&!(H.requireSignature&&!G.signature)&&!(H.requireCompatibilityMetadata&&!G.nodeType&&!G.signature)&&(function(oe){var be;const Me=ot.value[oe.index];return!(!Me||oe.nodeType&&oe.nodeType!==String((be=Me.type)!=null?be:"")||oe.signature&&oe.signature!==zc(oe.index))})(G))}function a2(M){const H=Hc(Al()),K=Hc(M);return H!==-1&&K!==-1&&H===K}function Wm(M){var H;const K=Number(M?.width);if(Number.isFinite(K)&&K>0)return K;const G=Number((H=M?.metrics)==null?void 0:H.width);return Number.isFinite(G)&&G>0?G:null}function c2(M){var H;return M.sessionKey===Dn()&&!!Tm(M.threadKey)&&((H=M.measurementKey)!=null?H:"")===Vi()&&!!a2(Wm(M))&&!!(function(K){const G=K.heightCache;return!!G?.length&&(u2(K)?G.some(oe=>!!(oe.nodeType||oe.signature)):G.some(oe=>!!oe.signature))})(M)}function u2(M){return!!(M.contentHash&&M.contentHash===Dm())}function r8(M){return!u2(M)}let El=null,Tl=null,qd=null,Uc=null,jc=null;function zm(M){var H;const K=M.map(oe=>{var be,Me;return[oe.index,Math.round(10*oe.height),(be=oe.nodeType)!=null?be:"",(Me=oe.signature)!=null?Me:""].join("")}).join(""),G=Hc(Al());return[(H=ps())!=null?H:"",Dn(),Vi(),ot.value.length,G,M.length,Rm(K)].join(":")}function d2(M=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Lt.value||!M?.length||ot.value.length<=0||!a2((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const K=l2(M,{requireSignature:!0});if(!K.length)return!1;const G=zm(K);return G===El?(Tl="standalone",!0):($k(K,{mode:"merge"}),Yo(),El=G,Tl="standalone",Yc(),Ln("restore"),!0)}function Um(M,H={}){var K,G,oe;if(!Lt.value||!M||M.sessionKey!==Dn()||!Tm(M.threadKey)||ot.value.length<=0)return!1;const be=!!((K=M.heightCache)!=null&&K.length)&&!Vd(),Me=!M.anchor||M.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:M.anchor,Ne=H.restoreAnchor===!0&&!!Me&&!Vd()&&Number(Wm(M))>0;let He=!1;if((G=M.heightCache)!=null&&G.length&&c2(M)){const Ue=l2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:r8(M)});Ue.length&&($k(Ue,{mode:"merge"}),Yo(),El=zm(Ue),Tl="restore",Yc(),He=!0)}if(be||Ne)return!1;if(!H.restoreAnchor||!Me)return He&&Ln("restore"),!0;const Fe=(function(Ue,We){var Re;const ze=Ue.anchor,Je=ze?ze.type==="bottom"?`bottom:${Math.round(ze.distanceFromBottomPx)}`:`node:${ze.nodeIndex}:${Math.round(ze.offsetWithinNodePx)}`:"none";return[(Re=ps())!=null?Re:"",Dn(),Vi(),zd.value,We,Je].join(":")})(M,(oe=H.restoreToken)!=null?oe:"imperative");return qd===Fe?(He&&Ln("restore"),!0):(qd=Fe,(function(Ue){const We=()=>{if(Ue.type==="node")return Sa(),void As({nodeIndex:Ue.nodeIndex,offsetWithinNodePx:Ue.offsetWithinNodePx});if(Nt(),Ae.value=null,je.value=Ue,r2(),Pm(Ue),Z)for(const Re of[0,120,280,480])Hm.push(window.setTimeout(()=>{const ze=je.value;ze&&Pm(ze)},Re))};(function(Re){if(!Ot.value)return!1;const ze=ot.value.length;return!(ze<=0||(Go.value=Re.type==="node"?Ts(Re.nodeIndex,0,ze-1):ze-1,wl(),0))})(Ue)?pt(We):We()})(Me),Ln("restore"),!0)}function Vd(){const M=Al();return Number.isFinite(M)&&M>0}function f2(M){var H;return M.sessionKey===Dn()&&!!Tm(M.threadKey)&&(ot.value.length<=0||!(!((H=M.heightCache)!=null&&H.length)||Vd())||!(!(M.anchor&&Number(Wm(M))>0)||Vd()))}function jm(){Le.clear();for(const M of Object.keys(Vt)){const H=Number(M);Number.isInteger(H)&&H>=0&&H<ot.value.length&&Tk(H)}}function qc(){To!=null&&(Hn?.(To),To=null),t1()}function h2(){return!Z||Xn?Promise.resolve():new Promise(M=>{let H=!1,K=null;const G=()=>{H||(H=!0,K!=null&&window.clearTimeout(K),M())};if(On)return On(G),void(K=window.setTimeout(G,50));K=window.setTimeout(G,0)})}function qm(M,H=ps(),K=No.value){return Dn()===M&&ps()===H&&No.value===K}function Vm(){return zn(this,arguments,function*(M={}){var H,K,G,oe,be;const Me=Dn(),Ne=ps(),He=No.value,Fe=(H=M.frames)!=null?H:2,Ue=(K=M.timeoutMs)!=null?K:120,We=(G=M.reason)!=null?G:"manual",Re=M.expectedSettledTokenKey,ze=M.flushPendingTimers===!0,Je=Ml(We),et=()=>Bt(it({},Je),{phase:Je.final?"settling":Je.phase,stable:!1,confidence:Je.confidence==="final"?"mixed":Je.confidence,reason:We}),St=()=>qm(Me,Ne,He)&&(Re==null||Gc()===Re);for(let Ct=0;Ct<Fe;Ct++){if(yield pt(),!St()||(yield h2(),!St()))return et();Ki(),qc()}if(yield(function(Ct){return!Z||Ct<=0?Promise.resolve():new Promise(Jt=>window.setTimeout(Jt,Ct))})(Ue),!St()||(ze&&Wk(),Ki(),qc(),!St()))return et();const ct=Fm();ct&&(Lm=Me,$m=Ne,((oe=s.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&Re!=null&&Ud((be=s.virtualScroll)==null?void 0:be.settledToken)&&Gc()===Re&&(_a=eu(s.virtualScroll.settledToken)));const dt=St()&&ct&&n2(),At=Ml(We,dt?"final":void 0);return Qm(At,!0),At})}let Km="content",Nl=null,Il=null,Gm=0,Vc=null,Aa=null,Ym=null,Zm=null;function Kc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function p2(M){var H,K;const G=Vc;if(!G)return!0;const oe=(K=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?K:1;return Math.abs(M.totalHeight-G.totalHeight)>oe||M.sessionKey!==G.sessionKey||M.phase!==G.phase||M.stable!==G.stable||M.final!==G.final||M.threadKey!==G.threadKey||M.nodeCount!==G.nodeCount||M.measuredCount!==G.measuredCount||M.width!==G.width}function xs(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 Gc(M=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return xs(M)}function m2(M,H){var K,G;return[M,H.sessionKey,(K=H.threadKey)!=null?K:"",Vi(),Dm(),xs((G=s.virtualScroll)==null?void 0:G.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function Yc(){Ym=null,Zm=null,Aa=null}function l8(M){const H=M.heightCache;return H?.length?zm(H):""}function Zc(M){var H,K,G;const oe=M.metrics,be=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:"",(K=M.measurementKey)!=null?K:Vi(),(G=M.contentHash)!=null?G:"",l8(M),be,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 Qm(M,H=!1){if(!Lt.value||(function(Me=!1){return!Me&&ss.value&&!Vs.value})(H))return;const K=H||p2(M),G=(function(Me,Ne=!1){return Ne||Me.stable||Me.phase==="final"?{state:wa(Me,{includeHeightCache:!0})}:{state:wa(Me)}})(M,H),oe=G.state,be=!!(oe&&(K||(function(Me,Ne=!1){return!!Ne||Zc(Me)!==Aa})(oe,H)));if(K&&(E(M),Vc=M,Gm=Kc()),oe&&be&&(N(oe),oe.anchor&&F(oe.anchor),Aa=Zc(oe)),M.stable){const Me=m2("settled",M);if(Me!==Ym){Ym=Me;const Ne=wa(M,{includeHeightCache:!0});Ne&&(N(Ne),Aa=Zc(Ne)),(function(He){o("render-settled",He)})(M)}}if(M.phase==="final"){const Me=m2("final",M);if(Me!==Zm){Zm=Me;const Ne=wa(M,{includeHeightCache:!0});Ne&&(N(Ne),Aa=Zc(Ne)),(function(He){o("render-final",He)})(M)}}}function Xm(){Nl!=null&&(Hn?.(Nl),Nl=null),Il!=null&&Z&&(window.clearTimeout(Il),Il=null)}function g2(){Nl=null,Il=null,(function(M){if(qi.size>0||To!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Km)&&(Ki(),qc()),Qm(Ml(Km))}function Ln(M){var H,K;if(!Lt.value||(Km=M,Nl!=null||Il!=null))return;const G=Math.max(0,(K=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?K:32),oe=Math.max(0,G-(Kc()-Gm)),be=()=>{Il=null,Nl=On?On(g2):null,Nl==null&&g2()};Z&&oe>0?Il=window.setTimeout(be,oe):be()}function Jm(M){var H;if(M<=0)return 0;const K=ot.value;if(an.value)return Yk(M);if($n.value===K.length&&ks.value.length&&bs.value.length){const oe=Ms.value,be=ks.value,Me=bs.value,Ne=We=>We<=0?0:Ld(be,0,We)+(We-Ld(Me,0,We))*oe;let He=0,Fe=K.length-1,Ue=K.length-1;for(;He<=Fe;){const We=He+Fe>>1;Ne(We+1)>=M?(Ue=We,Fe=We-1):He=We+1}return Ue}let G=M;for(let oe=0;oe<K.length;oe++){const be=(H=Vt[oe])!=null?H:Ms.value;if(G<=be)return oe;G-=be}return Math.max(0,K.length-1)}function v2(){we.value+=1}function e1(M){return!(Ao.value&&M>=Vn.value)&&(!Ar.value||M<Ks.value||xm.value.has(M))}function Ma(M){const H=Pd.get(M);H&&(H(),Pd.delete(M));const K=ya.get(M);K&&(K.destroy(),ya.delete(M)),Hd(M)}function y2(M,H){let K=!1;if(H){const be=Bn.get(M);Bn.set(M,H),be!==H&&(K=!0)}else Bn.delete(M)&&(K=!0);if(K&&v2(),H||Hd(M),!Lk.value||!Cs||!Ot.value&&Ar.value&&!W.value&&ya.size>=640&&(W.value||(W.value=!0,_m()),!Lk.value||!Cs))return Ma(M),void(H&&Tr(M,!0));if(M<Ks.value&&!Ot.value||xm.value.has(M))return Ma(M),void Tr(M,!0);if(!H)return void Ma(M);Ma(M);const G=Cs(H,{rootMargin:"400px"});if(!G)return;ya.set(M,G),Tr(M,G.isVisible.value),Ar.value&&(function(be){if(!Z||!Ar.value)return;Hd(be);const Me=be%17*23,Ne=window.setTimeout(()=>{if(zk.delete(be),!Ar.value||xm.value.has(be))return;const He=Bn.get(be);if(!He)return;const Fe=fe(He),Ue=He.ownerDocument||document,We=Ue.defaultView||window,Re=!Fe||Fe===Ue.documentElement||Fe===Ue.body,ze=!Re&&Fe?yt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Fe.getBoundingClientRect()):null,Je=Re?0:ze.top,et=Re?yt("nodeVisibilityFallback.clientHeight",()=>{var ct,dt;return(dt=(ct=We.innerHeight)!=null?ct:Fe?.clientHeight)!=null?dt:0}):ze.bottom,St=yt("nodeVisibilityFallback.node.getBoundingClientRect",()=>He.getBoundingClientRect());St.bottom>=Je-500&&St.top<=et+500&&Tr(be,!0)},1800+Me);zk.set(be,Ne)})(M);let oe=null;oe=Ke(()=>G.isVisible.value,be=>{if(be){Hd(M),Tr(M,!0),oe?.(),Pd.delete(M),ya.get(M)===G&&ya.delete(M);try{G.destroy()}catch{}}},{immediate:!0}),Pd.set(M,oe),Ot.value&&Ni()}function t1(){To=null;for(const[M,H]of qi)qi.delete(M),Ei.get(M)===H.el&&Sl.get(M)===H.version&&Nk(M,H.height,{allowShrink:H.allowShrink})}function Ea(){To!=null&&(Hn?.(To),To=null),qi.clear()}function Kd(M,H){(function(K,G,oe){var be;if(!Number.isFinite(oe)||oe<=0||Ei.get(K)!==G)return;const Me=Sl.get(K);if(Me==null)return;const Ne=ot.value[K],He=J.value&&q.value!==!0&&!((be=s.nodes)!=null&&be.length)&&K>=ot.value.length-2,Fe=!(Ne?.loading===!0||He),Ue=qi.get(K),We=Ue?Ue.allowShrink&&Fe:Fe,Re=Ue&&!We?Math.max(Ue.height,oe):oe;qi.set(K,{height:Re,allowShrink:We,version:Me,el:G}),To==null&&(To=On?On(t1):null,To==null&&t1())})(M,H,Ik(M,H))}function Ki(){for(const[M,H]of Ei)H&&Kd(M,H)}function k2(){rt?.disconnect(),rt=null,Kn.clear()}function n1(){for(;Od.length;)Dd(Od.pop())}Ke(Vs,M=>{M&&Ln("content")},{flush:"post"}),t({getVirtualMetrics:Ml,captureVirtualState:function(M={}){var H;return wa(Ml("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(H=M.includeEmptyState)==null||H})},restoreVirtualState:function(M,H={}){const K=H.restoreAnchor===!0,G=H.restoreToken==null?"imperative":String(H.restoreToken);Uc=M,jc={restoreAnchor:K,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!Um(M,{restoreAnchor:K,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&f2(M)||(Uc=null,jc=null)},forceMeasure:function(M="manual"){return zn(this,null,function*(){yield pt(),yield h2(),Ki(),qc(),yield pt();const H=Ml(M);return Qm(H,!0),H})},settle:Vm,scrollToNode:function(M,H="start"){Sa(),Nt();const K=ot.value.length;if(K<=0)return;const G=Ts(M,0,K-1),oe=()=>{var be;const Me=at({nodeIndex:G,offsetWithinNodePx:0}),Ne=Wd(G),He=Wc(),Fe=(be=He?.clientHeight)!=null?be:0,Ue=Pe();let We=Me;if(H==="center")We=Me-Fe/2+Ne/2;else if(H==="end")We=Me-Fe+Ne;else if(H==="nearest"&&Ue!=null){if(Me>=Ue&&Me+Ne<=Ue+Fe)return;We=Me<Ue?Me:Me-Fe+Ne}st(Math.max(0,We)),Ni({immediate:!0}),Ot.value&&(Go.value=G,wl())};if(Ot.value)return Go.value=G,wl(),void pt(oe);oe()}}),Ke(()=>Bs.value,M=>{if(!M){k2();for(const H of Mr.values())for(const K of H)Dd(K);Mr.clear(),Sl.clear(),n1(),Ea()}},{immediate:!0}),Ke(q,M=>{M&&(function(){if(Z&&q.value&&Ei.size){n1();for(const H of[80,240,640]){const K=Hk(H,()=>{for(const[G,oe]of Ei)oe&&Kd(G,oe)},"final");K!=null&&Od.push(K)}}})(),Ln(M?"final":"content")}),Ke([()=>ot.value.length,()=>Vn.value],()=>{je.value&&Ca(),Ln("content")},{flush:"post",immediate:!0}),Ke([()=>Es.start,()=>Es.end],()=>{Ln("batch")},{flush:"post"});const{cleanupBatchScheduler:a8}=(function(M){const{props:H,isClient:K,isTestEnv:G,parsedNodesIdentity:oe,parsedNodeCount:be,desiredRenderedCount:Me,datasetKey:Ne,batchingEnabled:He,incrementalRenderingActive:Fe,resolvedBatchSize:Ue,resolvedInitialBatch:We,renderedCount:Re,adaptiveBatchSize:ze,previousRenderContext:Je,previousBatchConfig:et,requestFrame:St,cancelFrame:ct,hasIdleCallback:dt,cleanupNodeVisibility:At,onDatasetKeyChanged:Ct,onDatasetChanged:Jt}=M;let Tt=null,Ht=null,Pt=!1,cn=null,Io=null,Gs=0,pi=!1,Ir=!1;const $r=new Set,Ll=new Set;function B2(){if(K){Tt!=null&&(ct?.(Tt),Tt=null),Ht!=null&&(window.clearTimeout(Ht),Ht=null),Io!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Io),Io=null),Gs+=1;for(const Ds of $r)ct?.(Ds);$r.clear();for(const Ds of Ll)window.clearTimeout(Ds);Ll.clear(),Pt=!1,cn=null,pi=!1,Ir=!1}}function ef(){return typeof performance<"u"?performance.now():Date.now()}function D2(Ds){(function(Gi){var Lr;if(!Fe.value)return;const Yi=Math.max(2,(Lr=H.renderBatchBudgetMs)!=null?Lr:6),Zi=Math.max(1,Ue.value||1),mi=Math.max(1,Math.floor(Zi/4));Gi>1.2*Yi?ze.value=Math.max(mi,Math.floor(.7*ze.value)):Gi<.5*Yi&&ze.value<Zi&&(ze.value=Math.min(Zi,Math.ceil(1.2*ze.value)))})(Ds),pi=!1;const uo=Ir||Re.value<Me.value;Ir=!1,uo&&W2()}function P2(Ds,uo={}){var Gi,Lr;if(!Fe.value)return;const Yi=Me.value;if(Re.value>=Yi)return;const Zi=Math.max(1,Ds),mi=()=>{const Ia=ef();let $a=0;Tt=null,Ht=null,Io=null,Pt=!1;const La=cn??Zi;cn=null;const u1=ef();Re.value=Math.min(Yi,Re.value+La),At(Re.value),$a=ef()-u1,(function(d1,z2){if(!K)return void D2(z2);pi=!0;const U2=++Gs;pt().then(()=>{var j2;if(U2!==Gs)return;const E8=ef(),T8=Math.max(z2,E8-d1),q2=()=>{U2===Gs&&D2(T8)};if(St){let K2=!1,Qi=null;const G2=()=>{K2||(K2=!0,q2())},tf=St(()=>{$r.delete(tf),Qi!=null&&(window.clearTimeout(Qi),Ll.delete(Qi),Qi=null),G2()});return $r.add(tf),Qi=window.setTimeout(()=>{Qi!=null&&Ll.delete(Qi),Qi=null,ct?.(tf),$r.delete(tf),G2()},Math.max(32,(j2=H.renderBatchIdleTimeoutMs)!=null?j2:120)),void Ll.add(Qi)}const V2=window.setTimeout(()=>{Ll.delete(V2),q2()},0);Ll.add(V2)})})(Ia,$a)};if(!K||uo.immediate)return void mi();const Fr=Math.max(0,(Gi=H.renderBatchDelay)!=null?Gi:16);if(cn=cn!=null?Math.max(cn,Zi):Zi,!Pt){if(Pt=!0,!G&&dt&&window.requestIdleCallback){const Ia=Math.max(0,(Lr=H.renderBatchIdleTimeoutMs)!=null?Lr:120);return void(Io=window.requestIdleCallback(()=>mi(),{timeout:Ia}))}St&&!G?Tt=St(()=>{Fr!==0?Ht=window.setTimeout(()=>mi(),Fr):mi()}):Ht=window.setTimeout(()=>mi(),Fr)}}function H2(Ds,uo={}){pi?Ir=!0:Ds==null?W2():P2(Ds,uo)}function W2(){Fe.value&&P2(He.value?Math.max(1,Math.round(ze.value)):Math.max(1,Ue.value))}return Ke([oe,be,Ne,Fe,Ue,We,()=>H.renderBatchDelay],()=>{var Ds;const uo=be.value,Gi=Je.value,Lr=Ne.value,Yi=!Object.is(Lr,Gi.key),Zi=uo!==Gi.total,mi=Yi||Zi;Je.value={key:Lr,total:uo};const Fr=et.value,Ia=(Ds=H.renderBatchDelay)!=null?Ds:16,$a=Fr.batchSize!==Ue.value||Fr.initial!==We.value||Fr.delay!==Ia||Fr.enabled!==Fe.value;et.value={batchSize:Ue.value,initial:We.value,delay:Ia,enabled:Fe.value},Yi&&Ct(uo),(mi||$a||!Fe.value)&&B2(),(mi||$a)&&(ze.value=Math.max(1,Ue.value||1)),mi&&Jt();const La=Me.value;if(!uo)return Re.value=0,void At(0);if(!Fe.value)return Re.value=La,void At(Re.value);const u1=Yi||Gi.total===0;Re.value=u1||$a?Math.min(La,We.value):Math.min(Re.value,La);const d1=Math.max(1,We.value||Ue.value||uo);Re.value<La?H2(d1,{immediate:!K}):At(Re.value)},{immediate:!0}),Ke(Me,(Ds,uo)=>{Fe.value&&(typeof uo=="number"&&Ds<=uo||Ds>Re.value&&H2())}),{cleanupBatchScheduler:B2}})({props:x,isClient:Z,isTestEnv:Xn,parsedNodesIdentity:ys,parsedNodeCount:fs,desiredRenderedCount:Rd,datasetKey:e8,batchingEnabled:Mi,incrementalRenderingActive:Ao,resolvedBatchSize:qo,resolvedInitialBatch:Ks,renderedCount:Vn,adaptiveBatchSize:ji,previousRenderContext:Vo,previousBatchConfig:Ko,requestFrame:On,cancelFrame:Hn,hasIdleCallback:hi,cleanupNodeVisibility:GM,onDatasetKeyChanged:M=>{Ea(),Fd(),Yo(),Yc(),M>0&&$d(M)},onDatasetChanged:()=>{Ot.value&&Ni({immediate:!0})}});Ke([Fk,Ot,()=>S.value,()=>ae()],([M,H])=>{if(!M)return Uk(),void bm();YM(),H?Ni({immediate:!0}):bm()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,()=>Ot.value],M=>zn(null,[M],function*([H,K]){K&&H&&Z&&(yield pt(),Ni({immediate:!0}))}),{flush:"post"}),Ke(an,M=>{M&&(function(){var H;if(Xe.value&&Ze.value&&Mt.value&&((H=Dt.value)!=null&&H[1]))return;const K=mt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),G=mt({type:"list_item",children:[K],raw:"- Probe paragraph text"}),oe=mt({type:"list",ordered:!1,items:[G],raw:"- Probe paragraph text"});Xe.value=K,Ze.value=G,Mt.value=oe;const be={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)be[Me]=mt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});Dt.value=be})()},{immediate:!0}),Ke([()=>S.value,an],()=>{if(!an.value)return Sm(),void(U.value=0);qk(),Sm(),an.value&&S.value&&typeof ResizeObserver<"u"&&(Pc=new ResizeObserver(()=>{qk(),Ae.value&&Zt(),je.value&&Ca(),Ln("resize")}),Pc.observe(S.value))},{immediate:!0}),Ke([an,co,No],()=>zn(null,null,function*(){if(!an.value)return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Yo();yield pt(),(function(){if(!an.value||typeof window>"u")return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Yo();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=jk(wm(T.value),".paragraph-node");M.paragraph=k0(T.value,H,"pre-wrap");const K=wm(R.value),G=K?.querySelector(".paragraph-node");M.listItem=k0(R.value,G,"pre-wrap");const oe=yt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Ne;return(Ne=(Me=O.value)==null?void 0:Me.offsetHeight)!=null?Ne:0}),be=yt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Ne;return(Ne=(Me=R.value)==null?void 0:Me.offsetHeight)!=null?Ne:0});M.listWrapperOverhead=Math.max(0,oe-be);for(let Me=1;Me<=6;Me++){const Ne=jk(wm(D[Me]),`h${Me}`);M.headings[Me]=k0(D[Me],Ne,"pre-wrap")}re.value=M,Yo()})()}),{flush:"post",immediate:!0}),Ke(()=>ot.value.length,()=>{Ot.value&&Ni({immediate:!0})}),Ke([an,U],()=>{Yo(),Ot.value&&Ni({immediate:!0}),Ae.value&&Zt(),je.value&&Ca(),Ln("resize")},{immediate:!1}),Ke(()=>Ar.value,M=>{if(M)for(const[H,K]of Bn)y2(H,K);else{_m();for(const[H,K]of Bn)K&&Tr(H,!0)}},{immediate:!1}),Ke([()=>x.viewportPriority,()=>ot.value.length],([M,H])=>{M!==!1?W.value&&H<=200&&(W.value=!1):W.value=!1}),Ke(()=>Vn.value,()=>{Ot.value&&Ni({immediate:!0})}),Ke([Go,jo,Dc,()=>ot.value.length,Ot],()=>{wl()},{immediate:!0});let Qc=null,Xc=!1,Ta=null;function Jc(){Qc=null,Lm=null,$m=void 0,_a=null,Yc()}function s1(){Ea(),Fd(),Yo(),Le.clear();const M=ot.value.length;M>0&&$d(M),jm()}function o1(){Xm(),Wk(),Vc=null,El=null,Tl=null,qd=null,Uc=null,jc=null,Xc=!1,Jc(),e2("restore"),Nt(),Sa()}function eu(M){var H;return[(H=ps())!=null?H:"",Dn(),Vi(),zd.value,Gc(M),ot.value.length,Math.round(Nr(0,ot.value.length)),Math.round(Al()),vn.count,Math.round(vn.total)].join(":")}function b2(){return zn(this,null,function*(){var M,H,K,G;const oe=(M=s.virtualScroll)==null?void 0:M.settledToken,be=Gc(oe),Me=Dn(),Ne=ps(),He=No.value;if(Lt.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&Ud(oe))if(Fm()){if(eu(oe)!==_a&&!Xc){Xc=!0;try{const Fe=yield Vm({reason:"manual",expectedSettledTokenKey:be}),Ue=Gc()===be;qm(Me,Ne,He)&&Fe.sessionKey===Me&&Fe.threadKey===Ne&&Ue&&Fe.stable&&Fe.phase==="final"&&(_a=eu((K=s.virtualScroll)==null?void 0:K.settledToken))}finally{Xc=!1,yield pt();const Fe=(G=s.virtualScroll)==null?void 0:G.settledToken,Ue=Ud(Fe)?eu(Fe):"";qm(Me,Ne,He)&&Ue&&_a!==Ue&&b2()}}}else Ln("manual")})}Ke(Lt,(M,H)=>{if(M!==H){if(!M)return o1(),void Xm();o1(),s1(),Ta=No.value,Ln("content")}},{flush:"post"}),Ke([Lt,No],([M,H])=>{M?Ta!=null?Ta!==H&&(Ta=H,(function(K="resize"){Ea(),Fd(),Yo(),Le.clear();const G=ot.value.length;G>0&&$d(G),jm(),El=null,Tl=null,qd=null,Vc=null,Xc=!1,Jc(),d2(),pt(()=>{Ki(),Ae.value&&Zt(),je.value&&Ca(),Ln(K)})})("resize")):Ta=H:Ta=null},{flush:"post",immediate:!0}),Ke([Lt,()=>Dn(),()=>ps()],([M])=>{M&&(o1(),s1(),e2("content"),Ln("content"))}),Ke([Lt,()=>Dn(),()=>ps(),No,()=>ot.value.length],([M])=>{M&&(function(H="async-node"){let K=!1;for(const[G,oe]of Array.from(Ti.entries()))Nm(oe)||(Ti.delete(G),Eo.delete(G),K=!0);K&&(ba(),Ln(H))})("async-node")},{flush:"post"}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>s.indexKey,()=>V.value],([M])=>{M&&(Yc(),(function(H="content"){if(!Lt.value)return;const K=[],G=ot.value.length;for(const oe of Array.from(Le.keys())){if(oe>=G){K.push(oe);continue}const be=zc(oe),Me=Le.get(oe);Me!=null&&Me!==be&&K.push(oe),Le.set(oe,be)}for(const oe of Array.from(Le.keys()))oe>=G&&Le.delete(oe);K.length&&((function(oe,be={}){const Me=Array.from(oe,Number);jM(Me,be)>0&&(function(He){for(const Fe of He)Le.delete(Fe)})(Me)})(K,{notify:!1}),Yo(),Jc(),Ae.value&&Zt(),je.value&&Ca(),Ln(H))})("content"))},{flush:"post",immediate:!0}),Ke([Lt,()=>ot.value.length,()=>Dn(),()=>ps()],([M,H,K,G],[oe,be,Me,Ne])=>{M&&oe&&K===Me&&G===Ne&&H!==be&&Jc()},{flush:"post"}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>ot.value.length,()=>Dn(),U],()=>{d2()},{flush:"post",immediate:!0}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>ot.value.length,()=>Dn(),U],M=>zn(null,[M],function*([H,K]){if(!H||!K)return;yield pt();const G=(function(){var oe;const be=(oe=s.virtualScroll)==null?void 0:oe.restoreAnchor;return be==null||be===!1?null:be===!0?"true":String(be)})();Um(K,{restoreAnchor:G!=null,restoreToken:G??void 0})}),{flush:"post",immediate:!0}),Ke([Lt,U,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var H;if(!M)return;const K=(H=s.virtualScroll)==null?void 0:H.restoreState;K&&El&&Tl==="restore"&&(c2(K)||(s1(),El=null,Tl=null,Ln("resize")))},{flush:"post"}),Ke([Lt,()=>ot.value.length,()=>Dn(),U],M=>zn(null,[M],function*([H]){var K;const G=Uc,oe=jc;H&&G&&(yield pt(),!Um(G,{restoreAnchor:oe?.restoreAnchor===!0,restoreToken:(K=oe?.restoreToken)!=null?K:"imperative",allowUncapturedAnchor:oe?.allowUncapturedAnchor===!0})&&f2(G)||(Uc=null,jc=null))}),{flush:"post",immediate:!0}),Ke([Lt,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>Dn(),()=>ps(),No,ym,Rk,()=>Vn.value,Rd,()=>vn.count,()=>vn.total],([M,H,K])=>{if(!M||H!==!0||K==="manual"||!Om())return;const G=(function(){var oe;const be=ot.value.length;return[(oe=ps())!=null?oe:"",Dn(),Vi(),zd.value,be,Math.round(Nr(0,be)),Math.round(Al()),vn.count,Math.round(vn.total)].join(":")})();Qc!==G&&(Qc=G,Vm({reason:"final"}).then(oe=>{oe.stable||Qc!==G||(Qc=null)}))},{flush:"post",immediate:!0}),Ke([Lt,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settledToken},()=>Dn(),()=>ps(),No,ym,Rk,()=>Vn.value,Rd,()=>ot.value.length,()=>vn.count,()=>vn.total],()=>{b2()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,Ot,jo,Dc,()=>Es.start,()=>Es.end],([M,H,K,G,oe,be])=>{ke.value&&$e("virtualization",{nodes:M,virtualization:H,maxLiveNodes:K,buffer:G,focusIndex:Go.value,scroll:H?(()=>{const Me=me.value||fe();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:be},rendered:Vn.value})}),Ke([()=>x.customId],([M],H,K)=>{if(!M||zt)return;const G=(function(oe,be){return oe?(ms.controllers[oe]=be,()=>{ms.controllers[oe]===be&&delete ms.controllers[oe]}):()=>{}})(M,{captureRestoreAnchor:Qt,restoreAnchor:As,getAnchorDrift:Cr,getReport:QM});K(()=>{G()})},{immediate:!0}),es(()=>{(function(){if(Lt.value)try{Ki(),qc();const M=Ml("manual");p2(M)&&(E(M),Vc=M,Gm=Kc());const H=wa(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(N(H),H.anchor&&F(H.anchor),Aa=Zc(H))}catch{}})(),a8(),_m(),Oe(),k2();for(const M of Mr.values())for(const H of M)Dd(H);Mr.clear(),Sl.clear(),Le.clear(),n1(),Ea(),Sm(),Nt(),Sa(),Xm(),Uk(),bm()});const c8=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index11-DyrslmWY.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),$o}}),loadingComponent:nte,delay:0}),u8=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index10-RB_ZIgWs.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),$o}}),loadingComponent:tte,delay:0}),d8=ki(()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index7-CL9Ie_DH.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),$o}})),x2={text:Zn,paragraph:na,heading:ep,code_block:d0,list:bc,list_item:kc,blockquote:Qf,table:Hu,definition_list:Xf,footnote:Jf,footnote_reference:Po,footnote_anchor:Du,admonition:sh,vmr_container:th,hardbreak:rl,link:ro,image:il,thematic_break:eh,math_inline:Ci,math_block:g5,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,checkbox:Do,checkbox_input:Do,inline_code:qs,html_inline:Ho,reference:so,html_block:Pu},f8=P(()=>Em()),_2=P(()=>ES(x.codeBlockProps)),h8=P(()=>ES(x.codeBlockProps,{omit:["langs"]})),w2=P(()=>it(it({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,monacoOptions:x.codeBlockMonacoOptions,themes:x.themes,langs:u.value==="shiki"?x.langs:void 0,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),h8.value)),S2=P(()=>it(Bt(it({},w2.value),{langs:x.langs}),_2.value));function C2(M){return typeof M=="boolean"?M:void 0}const p8=P(()=>{const M=x.codeBlockProps||{},H={},K=C2(M.showLineNumbers);K!==void 0&&(H.showLineNumbers=K);const G=C2(M.diffInline);G!==void 0&&(H.diffInline=G);const oe=(function(be){const Me=Number(be);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return oe!==void 0&&(H.reservedHeightPx=oe),H}),m8=P(()=>it(it({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),_2.value)),g8=P(()=>it({},x.mermaidProps||{})),A2=P(()=>it({},x.d2Props||{})),v8=P(()=>it({},x.infographicProps||{})),tu=P(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:gn.value.customHtmlTags})),y8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltip:Se.value}:{})),k8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),b8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),x8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{}));function _8(M){return Array.isArray(M.children)&&M.children.length>0}const i1=P(()=>ZM.value.map(M=>{var H,K,G,oe,be,Me,Ne,He;let Fe=(function(ct){var dt,At,Ct,Jt,Tt,Ht,Pt;if(ct.type!=="code_block")return ct;const cn=ct,Io=[String((dt=cn.language)!=null?dt:""),String((At=cn.loading)!=null?At:""),String((Ct=cn.diff)!=null?Ct:""),String((Jt=cn.code)!=null?Jt:""),String((Tt=cn.originalCode)!=null?Tt:""),String((Ht=cn.updatedCode)!=null?Ht:""),String((Pt=cn.raw)!=null?Pt:"")].join("\0"),Gs=xe.get(cn);if(Gs&&Gs.signature===Io)return Gs.node;const pi=it({},cn);return xe.set(cn,{signature:Io,node:pi}),pi})(M.node);const Ue=Gd(Fe);let We=N2(Fe,Ue);if((Fe.type==="html_block"||Fe.type==="html_inline")&&We===x2[Fe.type]){const ct=Fe,dt=String((H=ct.tag)!=null?H:"").trim().toLowerCase()||r6(ct.content);if(dt){const At=Wt.value[dt];if(_n.value.has(dt)&&At)We=At,Fe=Bt(it({},ct),{type:dt,tag:dt,content:yK(ct.content,dt)});else if(l6((K=ct.content)!=null?K:ct.raw,dt)){const Ct=String((oe=(G=ct.content)!=null?G:ct.raw)!=null?oe:"");Fe.type==="html_inline"?(We=Zn,Fe={type:"text",content:Ct,raw:Ct}):(We=na,Fe={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const Re=Fe.type==="code_block"&&u.value==="pre"&&We===$o&&!r1(Wt.value,Ue);let ze=it({},(function(ct,dt,At){const Ct=dt??Gd(ct);if(ct.type==="code_block"){const Jt=Ct?r1(Wt.value,Ct):void 0;if(At&&u.value==="pre"&&!Jt&&At===$o)return p8.value;if(At&&Ct&&At===Jt)return Ct==="mermaid"?E2(ct):Ct==="infographic"?T2(ct):Ct==="d2"||Ct==="d2lang"?A2.value:S2.value;if(At&&At===Wt.value.code_block)return S2.value;if(Kk(At))return m8.value}return Ct==="mermaid"?E2(ct):Ct==="infographic"?T2(ct):Ct==="d2"||Ct==="d2lang"?A2.value:ct.type==="link"?y8.value:ct.type==="list"?k8.value:ct.type==="blockquote"?b8.value:ct.type==="table"?x8.value:ct.type==="code_block"?w2.value:tu.value})(Fe,Ue,We));const Je=Cl.value[M.index];Fe.type==="code_block"&&Je?.kind==="code-block"&&(ze=Bt(it({},ze),Re?{reservedHeightPx:(be=Je.height)!=null?be:Je.contentHeight}:{estimatedHeightPx:Je.height,estimatedContentHeightPx:Je.contentHeight})),Re||Fe.type!=="code_block"||Ue!=="mermaid"||oc(ze.estimatedPreviewHeightPx)!=null||(ze=Bt(it({},ze),{estimatedPreviewHeightPx:qg(Ug(String((Me=Fe.code)!=null?Me:"")))})),Re||Fe.type!=="code_block"||Ue!=="infographic"||oc(ze.estimatedPreviewHeightPx)!=null||(ze=Bt(it({},ze),{estimatedPreviewHeightPx:Vg(jg(String((Ne=Fe.code)!=null?Ne:"")))})),Fe.type==="math_block"&&(ze=Bt(it({},ze),{cacheScope:ns.value}));const et=(function(ct,dt){const At=String(ct.type);return!Td(At)&&Wt.value[At]===dt})(Fe,We),St=et?jy(Fe,Ye.value):void 0;return Bt(it({},M),{node:Fe,component:We,bindings:ze,customBindings:it(it({},St??{}),ze),rendersCustomNode:et,hasSlotChildren:_8(Fe),slotContent:String((He=Fe.content)!=null?He:""),isCodeBlock:Fe.type==="code_block",indexKey:`${f8.value}-${M.index}`})}));function Gd(M){var H;return M?.type==="code_block"?String((H=M.language)!=null?H:"").trim().toLowerCase():""}function r1(M,H){const K=H.trim().toLowerCase();if(K)for(const G of[K,By(K),t5(K)]){const oe=G&&M[G];if(oe)return oe}}function M2(M,H,K,G){var oe,be;const Me=it({},M.value);return oc(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=G(K(String((oe=H?.code)!=null?oe:"")),void 0,Me.maxHeight==="none"?null:(be=oc(Me.maxHeight))!=null?be:void 0)),Me}function E2(M){return M2(g8,M,Ug,qg)}function T2(M){return M2(v8,M,jg,Vg)}function N2(M,H){if(!M)return nv;const K=Wt.value,G=K[String(M.type)];if(M.type==="code_block"){const oe=H??Gd(M),be=oe?r1(K,oe):void 0;return be||(u.value==="pre"?K.code_block||$o:oe==="mermaid"?K.mermaid||c8:oe==="infographic"?K.infographic||u8:oe==="d2"||oe==="d2lang"?K.d2||d8:G||K.code_block||Gk.value)}return G||x2[String(M.type)]||nv}function l1(M){o("click",M)}function w8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",M)}function S8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",M)}function I2(M){o("mouseover",M)}function $2(M){o("mouseout",M)}const $l=Q(null),Ii=Q(!1);let nu,Na=null,a1=0,Yd=0,Zd=0;const L2=["code_block","admonition","table","math_block","html_block","image","thematic_break"],C8=new Set(L2),F2=[".typewriter-cursor",".height-estimation-probes",...L2.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function O2(M){if(!M||typeof M!="object")return!1;const H=M.type;return typeof H=="string"&&C8.has(H)}function Qd(M){var H,K;if(!M||typeof M!="object")return 0;const G=M,oe=(K=(H=G.raw)!=null?H:G.content)!=null?K:G.code;if(typeof oe=="string")return oe.length;const be=G.children;if(Array.isArray(be))return be.reduce((Ne,He)=>Ne+Qd(He),0);const Me=G.items;return Array.isArray(Me)?Me.reduce((Ne,He)=>Ne+Qd(He),0):0}function Xd(){nu&&(clearTimeout(nu),nu=void 0)}function R2(){a1+=1,Na!=null&&(Hn?.(Na),Na=null)}function Jd(){R2(),$l.value&&($l.value.style.visibility="hidden")}function A8(M){var H;if(M.nodeType!==Node.TEXT_NODE||!((H=M.textContent)!=null?H:"").trim())return!1;const K=M.parentElement;return!!K&&!K.closest(F2)}function M8(M){let H=M.lastChild;for(;H;){if(A8(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const K=H;if(!K.matches(F2)&&K.lastChild){H=K.lastChild;continue}}for(;H&&H!==M&&!H.previousSibling;)H=H.parentNode;if(!H||H===M)break;H=H.previousSibling}return null}function c1(){if(!Z||!Ii.value||Na!=null)return;const M=a1,H=()=>{Na=null,M===a1&&(function(){var K,G;if(!(Z&&Ii.value&&S.value&&$l.value))return;const oe=S.value,be=$l.value;be.style.visibility="hidden";const Me=(function(){const We=i1.value;for(let Re=We.length-1;Re>=0;Re--){const ze=We[Re];if(!ze||O2(ze.node)||!e1(ze.index))continue;const Je=Bn.get(ze.index);if(!Je)continue;const et=M8(Je);if(et)return et}return null})();if(!Me)return;let Ne=0,He=0,Fe=20,Ue=!1;if(Me?.textContent){const We=Me.textContent.length,Re=document.createRange();Re.setStart(Me,Math.max(0,We-1)),Re.setEnd(Me,We);const ze=typeof Re.getClientRects=="function"?Re.getClientRects():void 0,Je=(G=ze?.[ze.length-1])!=null?G:(K=Me.parentElement)==null?void 0:K.getBoundingClientRect();if(Je){const et=yt("typewriterCursor.root.getBoundingClientRect",()=>oe.getBoundingClientRect());Ne=Je.right-et.left+oe.scrollLeft,He=Je.top-et.top+oe.scrollTop,Fe=Je.height||Fe,Ue=!0}Re.detach()}Ue&&(be.style.transform=`translate(${Math.max(0,Ne)}px, ${Math.max(0,He)}px)`,be.style.height=`${Fe}px`,be.style.visibility="visible")})()};On?Na=On(H):H()}return Ke([pe,()=>s.content,()=>s.nodes,()=>x.typewriter,q],()=>zn(null,null,function*(){var M,H;if(!Z||ne.value||!Y.value)return;if(q.value)return Ii.value=!1,Xd(),void Jd();if((M=s.nodes)!=null&&M.length)return Ii.value=!1,Xd(),Jd(),Yd=((H=s.content)!=null?H:"").length,void(Zd=pe.value.length);const K=(function(){var Ne,He;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((Fe,Ue)=>Fe+Qd(Ue),0):((He=s.content)!=null?He:"").length})(),G=(function(){var Ne;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((He,Fe)=>He+Qd(Fe),0):pe.value.length})(),oe=!O2(ot.value[ot.value.length-1]),be=K>Yd,Me=G>Zd;if(x.typewriter===!1||!oe||!be&&!Me)return x.typewriter!==!1&&oe||(Ii.value=!1,Jd()),Yd=K,void(Zd=G);Yd=K,Zd=G,Ii.value=!0,$l.value&&($l.value.style.visibility="hidden"),Xd(),yield pt(),c1(),nu=setTimeout(()=>{nu=void 0,Ii.value=!1},3e3)}),{flush:"post",immediate:!0}),Ke(Ii,M=>zn(null,null,function*(){M?(yield pt(),c1()):Jd()}),{flush:"post"}),Ke([()=>Vn.value,()=>Es.start,()=>Es.end],()=>zn(null,null,function*(){Z&&!ne.value&&Y.value&&Ii.value&&(yield pt(),c1())}),{flush:"post"}),es(()=>{Xd(),R2(),xn.clear()}),(M,H)=>{const K=eT("NodeRenderer",!0);return C(ne)?(b(!0),I(Be,{key:0},nt(i1.value,G=>(b(),I(Be,{key:G.index},[G.rendersCustomNode?(b(),ye($s(G.component),pn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:l1,onMouseover:I2,onMouseout:$2,onCopy:H[0]||(H[0]=oe=>o("copy",oe)),onHandleArtifactClick:H[1]||(H[1]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:l1,onMouseover:I2,onMouseout:$2,onCopy:H[2]||(H[2]=oe=>o("copy",oe)),onHandleArtifactClick:H[3]||(H[3]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),I("div",{key:1,ref_key:"containerRef",ref:S,class:De(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:Ot.value},{"virtual-scroll-coordinated":Vs.value}]]),"data-custom-id":x.customId,onClick:l1,onMouseover:w8,onMouseout:S8},[So.value||Ot.value?(b(),I(Be,{key:0},[So.value?(b(),I("div",{key:0,class:"height-estimation-probes",style:qt({width:`${co.value}px`}),"aria-hidden":"true"},[w("div",{ref_key:"paragraphProbeWrapperRef",ref:T,class:"node-content","data-probe":"paragraph"},[ie(C(na),{node:Xe.value,"index-key":"probe-paragraph"},null,8,["node"])],512),w("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[w("ul",ote,[ie(C(kc),{node:Ze.value,"index-key":"probe-list-item"},null,8,["node"])])],512),w("div",{ref_key:"listProbeWrapperRef",ref:O,class:"node-content","data-probe":"list"},[ie(C(bc),{node:Mt.value,"index-key":"probe-list"},null,8,["node"])],512),(b(),I(Be,null,nt(6,G=>w("div",{key:`probe-heading-${G}`,ref_for:!0,ref:oe=>(function(be,Me){be<1||be>6||(D[be]=Me)})(G,oe),class:"node-content","data-probe":`heading-${G}`},[ie(C(ep),{node:KM(G),"index-key":`probe-heading-${G}`},null,8,["node","index-key"])],8,ite)),64))],4)):le("",!0),Ot.value?(b(),I("div",{key:1,class:"node-spacer",style:qt({height:`${Am.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],64)):le("",!0),(b(!0),I(Be,null,nt(i1.value,G=>(b(),I("div",{key:G.index,ref_for:!0,ref:oe=>y2(G.index,oe),class:"node-slot","data-node-index":G.index,"data-node-type":G.node.type},[e1(G.index)?(b(),I("div",{key:0,ref_for:!0,ref:oe=>(function(be,Me){var Ne;Me||(function(We){const Re=`${Em()}-${We}`;let ze=!1;for(const Je of Array.from(Eo.keys())){const et=Ti.get(Je);(et?.index===We||Je===Re||Je.startsWith(`${Re}-`))&&(Eo.delete(Je),Ti.delete(Je),ze=!0)}ze&&(ba(),Ln("async-node"))})(be),qi.delete(be),(function(We){var Re;const ze=((Re=Sl.get(We))!=null?Re:0)+1;Sl.set(We,ze)})(be);const He=Mr.get(be);if(He){for(const We of He)Dd(We);Mr.delete(be)}if((function(We){const Re=Kn.get(We);Re&&(rt?.unobserve(Re),Mo.delete(Re),Kn.delete(We))})(be),!Me||!Bs.value)return Ei.delete(be),void Sl.delete(be);Ei.set(be,Me);const Fe=()=>{Kd(be,Me)};queueMicrotask(Fe);const Ue=(rt||typeof ResizeObserver>"u"||(rt=new ResizeObserver(We=>{if(We.length)for(const Re of We){const ze=Mo.get(Re.target),Je=Kn.get(ze??-1);ze!=null&&Je&&Kd(ze,Je)}else Ki()})),rt);if(Ue&&(Kn.set(be,Me),Mo.set(Me,be),Ue.observe(Me)),typeof window<"u"){const We=((Ne=ot.value[be])==null?void 0:Ne.type)==="code_block"?[16,80,240,800]:q.value?[80]:[];if(We.length){const Re=We.map(ze=>Hk(ze,Fe,"node-resize")).filter(ze=>ze!=null);Re.length&&Mr.set(be,Re)}}})(G.index,oe),class:"node-content"},[G.isCodeBlock?G.rendersCustomNode?(b(),ye($s(G.component),pn({key:1,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[8]||(H[8]=oe=>o("copy",oe)),onHandleArtifactClick:H[9]||(H[9]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:2,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[10]||(H[10]=oe=>o("copy",oe)),onHandleArtifactClick:H[11]||(H[11]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),ye(cl,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[G.rendersCustomNode?(b(),ye($s(G.component),pn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[4]||(H[4]=oe=>o("copy",oe)),onHandleArtifactClick:H[5]||(H[5]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[6]||(H[6]=oe=>o("copy",oe)),onHandleArtifactClick:H[7]||(H[7]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),I("div",{key:1,class:"node-placeholder",style:qt({height:`${Wd(G.index)}px`})},null,4))],8,rte))),128)),Ii.value?(b(),I("span",{key:1,ref_key:"typewriterCursorRef",ref:$l,class:"typewriter-cursor","aria-hidden":"true"},null,512)):le("",!0),Ot.value?(b(),I("div",{key:2,class:"node-spacer",style:qt({height:`${Mm.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],42,ste))}}})),[["__scopeId","data-v-2e8e6e17"]]),_o=T5;_o.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",_o.__name,_o.name].filter(n=>!!n));for(const n of t)e.component(n,T5)};const Qy=Object.freeze(Object.defineProperty({__proto__:null,default:_o},Symbol.toStringTag,{value:"Module"})),lte={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"},ate={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"},cte={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"},ute={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"},dte={class:"admonition-title"},fte=["aria-expanded","aria-controls"],hte=["id"],sh=hn(qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=P(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Q(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(b(),I("div",{class:De(["admonition",[`admonition-${s.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(b(),I("svg",lte,[...u[1]||(u[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(b(),I("svg",ate,[...u[2]||(u[2]=[w("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),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(b(),I("svg",cte,[...u[3]||(u[3]=[w("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),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(b(),I("svg",ute,[...u[4]||(u[4]=[w("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),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):le("",!0),w("span",dte,B(i.value),1),s.node.collapsible?(b(),I("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),I("svg",{style:qt({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]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,fte)):le("",!0)]),Tn(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(_o),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,hte),[[oi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);sh.install=e=>{e.component(sh.__name,sh)};const N5=()=>eo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let $f=null,pte=N5;function axe(){return zn(this,null,function*(){if($f)return $f;const e=pte;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===N5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?($f=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),$f):null})}function cxe(){return!1}function uxe(){return zn(this,null,function*(){return null})}const Lf=Q(!1);let PS=!1;function x0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function mte(){return!PS&&typeof window<"u"&&typeof document<"u"&&(PS=!0,Lf.value=x0(),new MutationObserver(()=>{Lf.value=x0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Lf.value=x0()})),Lf}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"],gte=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),lv=[...I5].sort((e,t)=>t.length-e.length).join("|"),_0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${lv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${lv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),$5=/[),.;!?,。;!?)]+$/;function vte(e){const t=e.toLowerCase();return I5.some(n=>t.endsWith(`.${n}`))}function yte(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${lv}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function kte(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace($5,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=gte.has(i),a=vte(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function bte(e,t={}){const n=[];_0.lastIndex=0;let s;for(;(s=_0.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace($5,""),u=a.length-c.length;a=c;const d=kte(a,t);if(!d)continue;const f=s.index+r,p=f+a.length;n.push({...d,start:f,end:p,text:a}),u>0&&(_0.lastIndex-=u)}return n}const xte=12e4,_te=6e4,wte=32,Ste=3e4,HS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Cte(e){let t=0,n=0,s=0;HS.lastIndex=0;let o;for(;(o=HS.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=xte||n>=_te||t>=wte||s>=Ste?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Ate(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Mte(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Ete={key:1,class:"diff-wrap"},Tte={class:"diff-bar"},Nte=["aria-label","onClick"],Ite={class:"diff-pre"},$te={key:0,class:"diff-sign"},Lte={class:"diff-text"},Fte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",WS="github-light",zS="github-dark",Ote=qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){uX(),wX(),fX(),EX(),dX(new Ate),MX(new Mte);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Et(),s=Ut("resolveImage"),o=Q(null),i=e,r=P(()=>!i.streaming),l=P(()=>yte(i.text??"")),a=P(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Cte(i.text??"")),c=mte(),u=P(()=>!i.streaming),d=Ss(new Map),f=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function _(R){if(!s)return;const O=[];for(const D of[p,h]){D.lastIndex=0;let W;for(;(W=D.exec(R))!==null;)O.push(W[2]??"")}for(const D of O)!D||!m(D)||d.has(D)||f.has(D)||(f.add(D),s(D).then(W=>{d.set(D,W!==D?W:"")}).catch(()=>{d.set(D,"")}).finally(()=>{f.delete(D)}))}function k(R){if(!s)return R;const O=D=>{if(!m(D))return null;const W=d.get(D);return W===void 0?Fte:W===""?null:W};return R.replace(p,(D,W,z,V)=>{const U=O(z);return U===null?D:`${W}${U}${V}`}).replace(h,(D,W,z,V)=>{const U=O(z);return U===null?D:`${W}${U}${V}`})}Ke(()=>i.text,R=>_(R??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),O=[];let D=R.nextNode();for(;D;){const W=D,z=W.parentElement;z&&!z.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&O.push(W),D=R.nextNode()}for(const W of O){const z=bte(W.data,{aliases:l.value});if(z.length===0||!W.parentNode)continue;const V=document.createDocumentFragment();let U=0;for(const re of z){re.start>U&&V.append(document.createTextNode(W.data.slice(U,re.start)));const ae=document.createElement("button");ae.type="button",ae.className="md-file-link",ae.textContent=re.text,ae.title=re.line?`${re.path}:${re.line}`:re.path,ae.addEventListener("click",te=>{te.preventDefault(),te.stopPropagation(),i.openFile?.({path:re.path,line:re.line})}),V.append(ae),U=re.end}U<W.data.length&&V.append(document.createTextNode(W.data.slice(U))),W.parentNode.replaceChild(V,W)}}function v(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(R){let O=R.length;for(const D of["#","?"]){const W=R.indexOf(D);W!==-1&&W<O&&(O=W)}return R.slice(0,O)}function A(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const O of R){if(O.dataset.mdLinkHandled==="true"||O.closest("svg"))continue;const D=O.getAttribute("href")??"";v(D)&&(O.dataset.mdLinkHandled="true",O.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),i.openFile?.({path:y(D)})}))}}function L(){pt().then(()=>{g(),A()})}Ke(()=>i.text,L),Ke(()=>i.streaming,L);let $=null;ln(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),fn(()=>{$?.disconnect()});const x={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=P(()=>{const R=k(i.text??""),O=[];let D=0;E.lastIndex=0;let W;for(;(W=E.exec(R))!==null;){const V=W[1]??"",U=R.slice(D,W.index)+(V||"");U.trim()&&O.push({kind:"md",text:U}),O.push({kind:"diff",code:W[2]??""}),D=E.lastIndex}const z=R.slice(D);return(z.trim()||O.length===0)&&O.push({kind:"md",text:z}),O});function F(R){return R.split(`
|
|
284
|
-
`).map(O=>O.startsWith("@@")?{type:"hunk",sign:"",text:O}:/^\+(?!\+\+)/.test(O)?{type:"add",sign:"+",text:O.slice(1)}:/^-(?!--)/.test(O)?{type:"del",sign:"-",text:O.slice(1)}:O.startsWith(" ")?{type:"ctx",sign:"",text:O.slice(1)}:{type:"ctx",sign:"",text:O})}const S=Q(null);function T(R,O){js(R).then(D=>{D&&(S.value=O,setTimeout(()=>{S.value=null},1400))})}return(R,O)=>(b(),I("div",{ref_key:"mdRef",ref:o,class:"md"},[(b(!0),I(Be,null,nt(N.value,(D,W)=>(b(),I(Be,{key:W},[D.kind==="md"?(b(),ye(C(_o),{key:0,content:D.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":WS,"code-block-dark-theme":zS,themes:[WS,zS],"code-block-props":x,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(b(),I("div",Ete,[w("div",Tte,[O[0]||(O[0]=w("span",{class:"diff-lang"},"diff",-1)),ie(jt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:z=>T(D.code,W)},[ie(Ve,{name:S.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,Nte)]),_:2},1032,["text"])]),w("pre",Ite,[w("code",null,[(b(!0),I(Be,null,nt(F(D.code),(z,V)=>(b(),I("span",{key:V,class:De(["diff-line",`diff-${z.type}`])},[z.type!=="hunk"?(b(),I("span",$te,B(z.sign),1)):le("",!0),w("span",Lte,B(z.text),1)],2))),128))])])]))],64))),128))],512))}}),rm=ut(Ote,[["__scopeId","data-v-cb379ba3"]]),Rte={class:"tc-anim"},Bte={class:"prev-anim"},Dte={class:"prev"},Pte=qe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=P(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=P(()=>n.foldable&&o.value.length>1),r=P(()=>n.streaming||!i.value),l=P(()=>o.value.at(-1)??""),a=Q(null);return ln(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ke(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||pt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(b(),I("div",{class:De(["think",{mob:e.mobile}])},[i.value?(b(),I("div",{key:0,class:De(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[w("div",Rte,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513)]),w("div",Bte,[w("span",Dte,B(l.value),1)])],2)):(b(),I("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513))],2))}}),Hte=ut(Pte,[["__scopeId","data-v-fdc551ea"]]),Wte={class:"activity-notice",role:"status"},zte={"aria-hidden":"true"},Ute={class:"an-label"},jte=qe({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(b(),I("div",Wte,[w("span",zte,[ie(wo,{size:"sm"})]),w("span",Ute,B(e.label),1)]))}}),qte=ut(jte,[["__scopeId","data-v-0d497074"]]);function Vte(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const Kte=qe({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Et(),s=Q(!1),o=P(()=>{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=P(()=>s.value?o.value:Vte(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(b(),I("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},B(i.value),1))}}),L5=ut(Kte,[["__scopeId","data-v-9672fbd5"]]);function Gte(e){return e.length===1?`0${e}`:e}function Yte(e,t){return`${String(Number(e))}:${Gte(t)}`}const US=e=>/^\d+$/.test(e);function Zte(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[s,o,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(s==="*"&&o==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(s);if(u&&o==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(s==="0"&&o==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(o);if(s==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(US(s)&&US(o)&&c){const f=Yte(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const Qte=["data-turn-id"],Xte={class:"cn-bubble"},Jte={class:"cn-title"},ene={key:0,class:"cn-prompt"},tne={class:"cn-meta"},nne={key:0,class:"cn-meta-item"},sne={key:1,class:"cn-meta-item"},one=["aria-label"],ine=["title"],rne=qe({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Et(),s=P(()=>t.cron),o=P(()=>s.value?.missedCount!==void 0),i=P(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=P(()=>{const u=s.value?.cron;return u?Zte(u,n):""}),l=P(()=>o.value?"error":"ok"),a=P(()=>{const u=s.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=P(()=>t.text??"");return(u,d)=>(b(),I("div",{class:De(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",Xte,[w("span",Jte,B(i.value),1),c.value?(b(),I("span",ene,B(c.value),1)):le("",!0)]),w("div",tne,[ie(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(b(),I("span",nne,B(r.value),1)):le("",!0),a.value?(b(),I("span",sne,B(a.value),1)):le("",!0),w("span",{class:De(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):(b(),ye(Ve,{key:1,name:"close",size:"sm"}))],10,one),s.value?.jobId?(b(),I("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:s.value.jobId})},B(s.value.jobId),9,ine)):le("",!0),e.createdAt?(b(),ye(L5,{key:3,time:e.createdAt},null,8,["time"])):le("",!0)])],10,Qte))}}),lne=ut(rne,[["__scopeId","data-v-a62a6587"]]);function F5(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 av(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function ane(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function vi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:av(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:F5(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 Wu(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 jS(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 Xy(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:jS(e.source)};case"video":return{type:"video",source:jS(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 cv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Xy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function cne(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 une(e){return{content:e.content.map(cne),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 dne(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function O5(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 fne(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function hne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(fne),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function R5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(hne),createdAt:e.created_at}}function pne(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 mne(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=pne(s);return{answers:t,method:e.method,note:e.note}}function uv(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function qS(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 zr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function za(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Qo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function gne(e){if(!e||typeof e!="object")return null;const t=e,n=zr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:zr(t,"goalId")??zr(t,"goal_id")??"goal",objective:zr(t,"objective")??"",completionCriterion:zr(t,"completionCriterion")??zr(t,"completion_criterion"),status:n,turnsUsed:za(t,"turnsUsed")??za(t,"turns_used")??0,tokensUsed:za(t,"tokensUsed")??za(t,"tokens_used")??0,wallClockMs:za(t,"wallClockMs")??za(t,"wall_clock_ms")??0,terminalReason:zr(t,"terminalReason")??zr(t,"terminal_reason"),budget:{tokenBudget:Qo(o,"tokenBudget")??Qo(o,"token_budget"),remainingTokens:Qo(o,"remainingTokens")??Qo(o,"remaining_tokens"),turnBudget:Qo(o,"turnBudget")??Qo(o,"turn_budget"),remainingTurns:Qo(o,"remainingTurns")??Qo(o,"remaining_turns"),wallClockBudgetMs:Qo(o,"wallClockBudgetMs")??Qo(o,"wall_clock_budget_ms"),remainingWallClockMs:Qo(o,"remainingWallClockMs")??Qo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function vne(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:vi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:vi(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:Wu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Wu(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:av(t.payload.status),previousStatus:av(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:F5(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=gne(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:cv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Xy),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:O5(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:R5(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:uv(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 yne(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 VS(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,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,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 kne(e){return e.session_id}function bne(e){return e.seq}const xne="main",_ne=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function ir(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 wne(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 KS(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function Qs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Wl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Xo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Sne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=Qs(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=Qs(t,"goalId")??Qs(t,"goal_id")??"goal",r=Qs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:Qs(t,"completionCriterion")??Qs(t,"completion_criterion"),status:o,turnsUsed:Wl(t,"turnsUsed")??Wl(t,"turns_used")??0,tokensUsed:Wl(t,"tokensUsed")??Wl(t,"tokens_used")??0,wallClockMs:Wl(t,"wallClockMs")??Wl(t,"wall_clock_ms")??0,terminalReason:Qs(t,"terminalReason")??Qs(t,"terminal_reason"),budget:{tokenBudget:Xo(s,"tokenBudget")??Xo(s,"token_budget"),remainingTokens:Xo(s,"remainingTokens")??Xo(s,"remaining_tokens"),turnBudget:Xo(s,"turnBudget")??Xo(s,"turn_budget"),remainingTurns:Xo(s,"remainingTurns")??Xo(s,"remaining_turns"),wallClockBudgetMs:Xo(s,"wallClockBudgetMs")??Xo(s,"wall_clock_budget_ms"),remainingWallClockMs:Xo(s,"remainingWallClockMs")??Xo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function ic(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Cne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=Qs(t,"name")??Qs(t,"toolName")??"tool",s=pa(Ane(n)),o=Mne(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=Qs(n,"text");if(o)return w0(o);const i=Qs(n,"message");if(i)return w0(i)}const s=Qs(t,"message");if(s)return w0(s)}return null}function Ane(e){return e.replace(/_\d+$/,"")}const GS=2e3;function w0(e){return e.length>GS?`${e.slice(0,GS)}…`:e}function Mne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return nd(e,n)}function Ene(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=Qs(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ic(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),p=[];return f&&p.push({type:"taskCreated",sessionId:t,task:f}),p.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),p}const r=Cne(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ic(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 YS(e,t,n){const s={id:ir("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Tne(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function Nne(e){return Array.isArray(e)?e.map(t=>Xy(t)):[]}function ZS(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function Ine(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function $ne(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function QS(e,t){e.messages.find(n=>n.id===t)}function Lne(e,t,n,s,o,i){const r={id:ir("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function S0(e,t){return e.messages.find(n=>n.id===t)}function XS(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 Fne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=KS(),e.set(u,d)),d}function s(u){e.set(u,KS())}function o(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){s(u);const f=n(u),p=d.promptId??ir("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=YS(f,u,p);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:p},{type:"messageCreated",message:fu(h)}]}function l(u,d,f,p){try{return c(u,d,f,p)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,p){const h=n(f),m=d,_=[],k=m?.agentId;if(typeof k=="string"&&k!==xne){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(_ne.has(u))return Ene(h,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=Nne(m?.content);if(y.length===0)break;h.currentPromptId=g;const A=Tne(h,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:fu(A)});break}case"turn.started":{const g=m?.turnId,v=h.currentPromptId??ir("pr_");h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v),h.turnTextLen=0,h.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=ir("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=YS(h,f,v);h.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:fu(y)});break}case"thinking.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const y=a(h.turnThinkLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=ZS(h,g,"thinking",v);if(A<0)break;h.turnThinkLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const y=a(h.turnTextLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=ZS(h,g,"text",v);if(A<0)break;h.turnTextLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=h.currentAssistantMsgId,v=m?.turnId,y=h.turnPromptId.get(v)??h.currentPromptId;if(!g||!y)break;const A=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};Ine(h,g,A,L,$);const x=S0(h,g);x&&x.content.length-1,h.toolStartTimes.set(A,Date.now()),x&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:x.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=$ne(m??{});g&&v&&_.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=ir("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=m?.toolCallId,A=m?.output,L=m?.isError??!1;h.toolStartTimes.get(y)??Date.now(),h.toolStartTimes.delete(y);const $=Lne(h,f,y,A,L,v);_.push({type:"messageCreated",message:fu($)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=h.currentAssistantMsgId,v=wne(m?.usage);if(h.totalInput+=v.input,h.totalOutput+=v.output,h.totalCacheRead+=v.cacheRead,h.totalCacheCreate+=v.cacheCreate,g){QS(h,g);const y=S0(h,g);y&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:XS(h),model:h.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=h.currentAssistantMsgId,v=m?.reason??"completed",y=Wl(m??{},"durationMs");if(g){QS(h,g);const $=S0(h,g);$&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:$.content.map(x=>({...x})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}h.turnCount++;const A=XS(h);_.push({type:"sessionUsageUpdated",sessionId:f,usage:A});const L=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:f,status:L,previousStatus:"running"}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{h.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:ir("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};h.subagentMeta.set(v.id,v),_.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=ic(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=ic(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=ic(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=ic(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):ir("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:yn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:A,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Sne(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=Qs(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:ir("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};h.messages.push(y),_.push({type:"messageCreated",message:fu(y)})}break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const One=new Set(["server_hello","ack","ping","resync_required","error","pong"]),JS=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated","cron.fired"]),Rne=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"]),Bne=new Set(["assistant.delta","thinking.delta"]);function Dne(e,t){if(One.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Bne.has(s)?Pne(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Rne.has(s)?{route:"protocol"}:JS.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:JS.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Pne(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 oh 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 Ya 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 ml(e){return e instanceof oh||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function B5(e){return e instanceof Ya||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const eC=1e3,C0=16384,A0=500,M0=50,Hne=6,Wne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,zne=/^[A-Za-z0-9+/=_-]{200,}$/;let E0=null;function Ai(){if(E0!==null)return E0;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=Qn($t.debug)==="1"),E0=e,e}const tl=[];let Une=1;const Jy=Q(0),bu=fa(!1);function jne(){return tl}function qne(){tl.length=0,Jy.value++}function _l(e){bu.value||(tl.push({id:Une++,ts:Date.now(),...e}),tl.length>eC&&tl.splice(0,tl.length-eC),Jy.value++)}function fv(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return zne.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>A0?`${o.slice(0,A0)}… [+${o.length-A0} chars]`:o}if(n!=="object")return String(e);if(t>=Hne)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,M0).map(i=>fv(i,t+1));return e.length>M0&&o.push(`[+${e.length-M0} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=Wne.test(o)?"[redacted]":fv(i,t+1);return s}function ga(e){if(e===void 0)return;const t=fv(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>C0)return{_truncated:`detail JSON was ${n.length} chars; first ${C0} kept`,preview:n.slice(0,C0)}}catch{return"[unserializable detail]"}return t}function T0(e){Ai()&&_l({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ga(e.body)}})}function Ff(e){if(!Ai())return;const t=e.code!==0;_l({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:ga(e.data)}})}function hu(e){Ai()&&_l({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 Ua(e,t){Ai()&&_l({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ga(t)})}function Vne(e){if(!Ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;_l({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:ga(e)})}function Kne(e){if(!Ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);_l({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ga(t.payload)})}const Gne={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function N0(e,t,n){Ai()&&_l({source:"client",kind:`client:${e}`,label:`${Gne[e]} ${t}`,detail:ga(n)})}function ar(e,t){Ai()&&_l({source:"client",kind:"client:event",label:`· ${e}`,detail:ga(t)})}let tC=!1;function Yne(){if(!(tC||!Ai())){tC=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{N0("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;N0("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{N0(e,n.map(Zne).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Zne(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 D5(e=tl){if(typeof document>"u")return;const t=new Blob([Qne(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function Qne(e=tl){return e.map(t=>JSON.stringify(t)).join(`
|
|
283
|
+
`)&&!(function(O){const D=FS(O);if(OS(D))return!1;const W=S5(D);return W.length>=2&&W.some(z=>z.trim())})(T))})(r.value,E)?_():(function(){if(p+=1,l)return;const S=Math.max(0,(function(T){const R=T.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(gi()-h));S<=0?_():l=setTimeout(_,S)})())},{flush:"sync",immediate:!0}),Sv(m);const k=P(()=>{var E,N,F,S;return mK(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(N=t.customComponentsMap)==null?void 0:N.value)!=null?F:{},Object.entries(S).map(([T,R])=>{const O=di(T);return R==null||!O||Td(O)||t6.has(O)||Ad.has(O)?"":O}).filter(Boolean)))}),g=P(()=>{const{key:E,tags:N}=gK(k.value);if(!E)return s;const F=o.get(E);if(F)return F;const S=Ww(t.instanceMsgId,{customHtmlTags:N});return o.set(E,S),S}),v=P(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=P(()=>{var E,N;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,T=k.value,R=S!=null,O=T.length>0;return R||O||F.streamParse==null?it(it(Bt(it({},F),{streamParse:(N=F.streamParse)==null||N}),R?{final:S}:{}),O?{customHtmlTags:T}:{}):F}),A=P(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(N=>String(N).trim().toLowerCase()).filter(Boolean))}),L=P(()=>LS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=P(()=>LS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ke([L,$],([E,N],[F,S])=>{F&&(E===F&&N===S||(_(),N!==S&&(a=[],d="")))},{flush:"sync"});const x=P(()=>{var E,N,F,S,T,R,O,D;if((E=e.nodes)!=null&&E.length)return a=[],d="",mt(e.nodes.slice());const W=r.value;if(!W)return a=[],d="",[];const z=t.debugPerformanceEnabled.value,V=z?gi():0,U=v.value,re=L.value,ae=$.value;c&&re!==c&&(function(ge){var ue,pe;(pe=(ue=ge.stream)==null?void 0:ue.reset)==null||pe.call(ue)})(U),u&&ae!==u&&(a=[],d="");const te=a.length>0&&W.startsWith(d)&&ae===u,Z=z?$S(U):null,ne=z?{}:void 0,ke=ne?Bt(it({},y.value),{__timing:ne}):y.value,Se=U6(W,U,ke),Ye=z?gi():0,ve=z?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Y,ce=z?b0(Se.length):void 0,fe=0,j=0;if(te){const ge=z?gi():0;if(ve){const ue=(function(pe,q,J){if(!q.length)return{nodes:pe,metrics:b0(pe.length)};const he=(function(Oe,de,$e){const Qe=Math.min(Oe.length,de.length);for(let tt=0;tt<Qe;tt++)if(!Gee(de[tt],Oe[tt],$e))return tt;return Oe.length===de.length?-1:Qe})(pe,q,J);if(he<0)return{nodes:q,metrics:{reusedNodeCount:pe.length,dirtyStartIndex:he,stablePrefixNodeCount:pe.length,dirtyTailNodeCount:0}};const Te=pe.slice();let Ie=he;for(let Oe=0;Oe<he;Oe++)Te[Oe]=q[Oe];for(let Oe=he;Oe<pe.length;Oe++){const de=q[Oe],$e=pe[Oe];de&&E5(de,$e,J)&&(Te[Oe]=de,Ie+=1)}return{nodes:Te,metrics:{reusedNodeCount:Ie,dirtyStartIndex:he,stablePrefixNodeCount:he,dirtyTailNodeCount:BS(he,pe,q)}}})(Se,a,ve);Y=ue.nodes,ce=ue.metrics}else{const ue=(function(pe,q){if(!q.length)return{nodes:pe,metrics:b0(pe.length)};const J=(function(Ie,Oe){const de=Math.min(Ie.length,Oe.length);for(let $e=0;$e<de;$e++)if(!Kee(Oe[$e],Ie[$e]))return $e;return Ie.length===Oe.length?-1:de})(pe,q);if(J<0)return{nodes:q,metrics:{reusedNodeCount:pe.length,dirtyStartIndex:J,stablePrefixNodeCount:pe.length,dirtyTailNodeCount:0}};const he=pe.slice();let Te=J;for(let Ie=0;Ie<J;Ie++)he[Ie]=q[Ie];for(let Ie=J;Ie<pe.length;Ie++){const Oe=q[Ie],de=pe[Ie];Oe&&M5(Oe,de)&&(he[Ie]=Oe,Te+=1)}return{nodes:he,metrics:{reusedNodeCount:Te,dirtyStartIndex:J,stablePrefixNodeCount:J,dirtyTailNodeCount:BS(J,pe,q)}}})(Se,a);Y=ue.nodes,ce=ue.metrics}fe=z?gi()-ge:0,j=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?Y.length:ce.dirtyStartIndex}else Y=Se;ve?(function(ge,ue,pe=0){for(let q=Math.max(0,pe);q<ge.length;q++)Yy(ue,"primeSignatureMs",()=>pl(ge[q]))})(Y,ve,j):(function(ge,ue=0){for(let pe=Math.max(0,ue);pe<ge.length;pe++)pl(ge[pe])})(Y,j);const se=z?gi()-Ye:0;if(f+=1,d=W,c=re,u=ae,a=Y,z){const ge=$S(U),ue=typeof ge?.total=="number"&&ge.total>((N=Z?.total)!=null?N:0);t.logPerf(ue?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(gi()-V),nodes:Y.length,contentLength:W.length,parseCommitCount:f,parseCoalescedCount:p,nodeReuseMs:se,signatureMs:(F=ve?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=ve?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(T=ve?.primeSignatureMs)!=null?T:0,signatureCallCount:(R=ve?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(O=ve?.stabilizeSignatureCallCount)!=null?O:0,primeSignatureCallCount:(D=ve?.primeSignatureCallCount)!=null?D:0,stabilizeMs:fe},ce??{}),ne?Object.fromEntries(Wee.map(pe=>{var q;return[pe,(q=ne[pe])!=null?q:0]})):{}),ge?{streamMode:ge.lastMode,streamDelta:Yee(ge,Z),streamStats:ge}:{}))}return mt(Y)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:x}}function Qee(e){const{isClient:t}=e,n=Q(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,p){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const _=n.value,k=_.has(f);if(p){if(k)return;const v=new Set(_);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(_);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,p]of o.entries())f<c||(p(),o.delete(f));for(const[f,p]of s.entries())f<c||(p.destroy(),s.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function Xee(e={}){const t=Q(""),n=Q(""),s=Q(!1),o=JQ(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=P(()=>Math.max(0,t.value.length-n.value.length)),a=P(()=>l.value===0),c=P(()=>s.value&&a.value);return wv()&&Sv(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const DS=/auto|scroll|overlay/i;function Jee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return DS.test(t)||DS.test(n)}function ete(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 tte=qe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=P(()=>{var n,s;return Vg((s=oc(e.estimatedPreviewHeightPx))!=null?s:jg(String((n=e.node.code)!=null?n:"")))});return()=>dn("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?dn("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)"}},[dn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[dn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),dn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),dn("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},()=>dn("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,dn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[dn("div",{class:"absolute inset-0"},[dn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),nte=qe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=P(()=>{var n,s;return qg((s=oc(e.estimatedPreviewHeightPx))!=null?s:Ug(String((n=e.node.code)!=null?n:"")))});return()=>dn("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?dn("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)"}},[dn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[dn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),dn("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},()=>dn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[dn("span",{class:"action-icon block"})])))]):null,dn("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)"}},[dn("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"}})])])}}),ste=["data-custom-id"],ote={class:"m-0 p-0"},ite=["data-probe"],rte=["data-node-index","data-node-type"],T5=hn(qe(Bt(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Os(),r=Ut("markstreamNestedRendererProps",void 0);function l(M){var H,K;const G=s[M];return(function(oe){const be=i?.vnode.props;return!!be&&(Object.prototype.hasOwnProperty.call(be,oe)||Object.prototype.hasOwnProperty.call(be,String(oe).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?G:(K=(H=r?.value)==null?void 0:H[M])!=null?K:G}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=P(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=P(()=>{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=P(()=>a[c.value]),f=P(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),p=P(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),h=P(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),m=P(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),_=P(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),k=P(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),g=P(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),v=P(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),y=P(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=P(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),L=P(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),$=P(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return p.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(M){o("height-change",M)}function N(M){o("virtual-state-change",M)}function F(M){o("anchor-change",M)}const S=Q(),T=Q(null),R=Q(null),O=Q(null),D=Ss({1:null,2:null,3:null,4:null,5:null,6:null}),W=Q(!1),z=new Map,V=Q(0),U=Q(0),re=Q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ae(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const K=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return te(typeof K=="function"?K():K)}function te(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?te(M.value):typeof M=="object"&&"$el"in M?te(M.$el):null:null}const{isClient:Z,renderAsFragment:ne,debugPerformanceEnabled:ke,resolvedShowTooltips:Se,resolvedHtmlPolicy:Ye,inheritedSmoothStreaming:ve,ownsTypewriterCursor:Y}=(function(M){const H=typeof window<"u",K=bd(),G=Ut("markstreamHtmlPolicy",void 0),oe=Ut("markstreamTypewriterCursor",void 0),be=Ut("markstreamSmoothStreaming",void 0),Me=P(()=>M.renderAsFragment===!0),Ne=P(()=>!!(M.debugPerformance&&H&&typeof console<"u")),He=P(()=>{var We;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Re=(We=K.showTooltips)!=null?We:K["show-tooltips"];return Re===""||Re===!0||Re==="true"||Re!==!1&&Re!=="false"&&void 0}),Fe=P(()=>{var We,Re;return(Re=(We=M.htmlPolicy)!=null?We:G?.value)!=null?Re:"safe"}),Ue=P(()=>oe?.value!==!0);return{isClient:H,renderAsFragment:Me,debugPerformanceEnabled:Ne,resolvedShowTooltips:He,resolvedHtmlPolicy:Fe,inheritedSmoothStreaming:be,inheritedTypewriterCursor:oe,ownsTypewriterCursor:Ue}})(x),{resolveViewportRoot:ce,resolveScrollContainer:fe,isReverseFlexScrollRoot:j,getNormalizedScrollTop:se,getOffsetTopWithinRoot:ge}=(function(M,H){function K(){var Ne,He;return(He=(Ne=H.scrollRoot)==null?void 0:Ne.call(H))!=null?He:null}function G(Ne){if(typeof window>"u")return null;const He=K();if(He)return He;const Fe=Ne??M.value;if(!Fe)return null;const Ue=Fe.ownerDocument||document,We=Ue.scrollingElement||Ue.documentElement;let Re=Fe;for(;Re&&Re!==Ue.body&&Re!==We;){if(Jee(window.getComputedStyle(Re))&&ete(Re))return Re;Re=Re.parentElement}return null}function oe(Ne){if(!H.isClient)return!1;try{const He=window.getComputedStyle(Ne);return!!(He.display||"").toLowerCase().includes("flex")&&(He.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function be(Ne,He,Fe){var Ue,We;if(Fe)return Me(He);const Re=Ne.scrollTop;if(!oe(Ne))return Re;const ze=Re<0?-Re:Re;return Math.max(0,((Ue=Ne.scrollHeight)!=null?Ue:0)-((We=Ne.clientHeight)!=null?We:0))-ze}function Me(Ne){var He,Fe,Ue,We,Re;const ze=Number((He=Ne.scrollingElement)==null?void 0:He.scrollTop),Je=Number((Ue=(Fe=Ne.documentElement)==null?void 0:Fe.scrollTop)!=null?Ue:0),et=Number((Re=(We=Ne.body)==null?void 0:We.scrollTop)!=null?Re:0);return Math.max(0,Number.isFinite(ze)?ze:0,Number.isFinite(Je)?Je:0,Number.isFinite(et)?et:0)}return{resolveViewportRoot:G,resolveScrollContainer:function(Ne){var He,Fe,Ue,We;const Re=K();if(Re)return Re;const ze=G((He=Ne??M.value)!=null?He:null);if(ze)return ze;const Je=(We=(Ue=Ne?.ownerDocument)!=null?Ue:(Fe=M.value)==null?void 0:Fe.ownerDocument)!=null?We:typeof document<"u"?document:null;return Je?.scrollingElement||Je?.documentElement||null},isReverseFlexScrollRoot:oe,getNormalizedScrollTop:be,getOffsetTopWithinRoot:function(Ne,He){const Fe=He.ownerDocument||Ne.ownerDocument||document;if((function(ze,Je){return ze===Je.documentElement||ze===Je.body||ze===Je.scrollingElement})(He,Fe))return Ne.getBoundingClientRect().top+Me(Fe);const Ue=He.getBoundingClientRect(),We=Ne.getBoundingClientRect(),Re=be(He,Fe,!1);return We.top-Ue.top+Re}}})(S,{isClient:Z,scrollRoot:ae});An("markstreamShowTooltips",Se),An("markstreamHtmlPolicy",Ye),An("markstreamTypewriter",P(()=>x.typewriter!==!1)),An("markstreamFade",P(()=>x.fade!==!1)),An("markstreamTypewriterCursor",P(()=>!0)),An("markstreamTextStreamState",z),An("markstreamStreamVersion",V),An("markstreamParseOptions",P(()=>x.parseOptions)),An("markstreamCustomMarkdownIt",P(()=>x.customMarkdownIt));const{smoothStreamingEnabled:ue,renderContent:pe,effectiveFinal:q}=(function(M,H){const K=Xee(M.smoothStreamingOptions),G=P(()=>{var Fe,Ue,We;return M.smoothStreaming!==!1&&!((Fe=M.nodes)!=null&&Fe.length)&&(M.smoothStreaming===!0||!((Ue=H.inheritedSmoothStreaming)!=null&&Ue.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((We=M.maxLiveNodes)!=null?We:0)<=0)}),oe=Q(!H.isClient||M.smoothStreaming===!0);ln(()=>{oe.value=!0});const be=P(()=>oe.value&&G.value),Me=P(()=>{var Fe;return be.value?K.visible.value:(Fe=M.content)!=null?Fe:""}),Ne=P(()=>{var Fe,Ue;const We=(Fe=M.parseOptions)!=null?Fe:{};return(Ue=M.final)!=null?Ue:We.final}),He=P(()=>{const Fe=Ne.value;return be.value&&Fe!=null?!!Fe&&K.caughtUp.value:Fe});return Ke([()=>M.content,()=>M.nodes,be,Ne],([Fe,Ue,We,Re])=>{if(Ue?.length)return void K.reset("");const ze=Fe??"";if(!We)return K.reset(ze),void(Re&&K.finish({flush:!0}));const Je=K.source.value;ze?ze===Je||(ze.startsWith(Je)?K.enqueue(ze.slice(Je.length)):K.reset(ze)):K.reset(""),Re&&K.finish()},{immediate:!0}),{smoothStream:K,smoothStreamingEligible:G,smoothStreamingEnabled:be,renderContent:Me,requestedFinal:Ne,effectiveFinal:He}})(x,{isClient:Z,inheritedSmoothStreaming:ve});An("markstreamSmoothStreaming",ue);const J=Q(!1);let he="",Te=!1,Ie=null;function Oe(){Z&&Ie!=null&&(window.clearTimeout(Ie),Ie=null)}function de(){J.value=!1,Oe()}function $e(M,H){if(!ke.value)return;const K=(function(){if(!ke.value)return null;const G=xt(Qe),oe=xt(tt),be=Math.max(wt,oe);if(G<=0&&be<=0)return null;const Me={total:G,maxPerFrame:be,byLabel:(Ne=Qe,Object.fromEntries(Array.from(Ne.entries()).sort((He,Fe)=>Fe[1]-He[1]||He[0].localeCompare(Fe[0]))))};var Ne;return Qe.clear(),tt.clear(),wt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,K?Bt(it({},H),{layoutReads:K}):H)}Ke([pe,()=>s.nodes,q],([M,H,K])=>{const G=M??"";return H?.length||K===!0?(de(),he=G,void(Te=!0)):Te?(he&&G.length>he.length&&G.startsWith(he)?(J.value=!0,Z&&(Oe(),Ie=window.setTimeout(()=>{var oe;Ie=null,q.value===!0||(oe=s.nodes)!=null&&oe.length||(Ea(),J.value=!1,Ki())},1200))):(G.length<he.length||!G.startsWith(he))&&de(),void(he=G)):(he=G,void(Te=!0))},{flush:"sync",immediate:!0});const Qe=new Map,tt=new Map;let vt=!1,wt=0;function xt(M){let H=0;for(const K of M.values())H+=K;return H}function Rt(){wt=Math.max(wt,xt(tt)),tt.clear(),vt=!1}function yt(M,H){return(function(K){var G,oe;ke.value&&(Qe.set(K,((G=Qe.get(K))!=null?G:0)+1),tt.set(K,((oe=tt.get(K))!=null?oe:0)+1),vt||(vt=!0,Z&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Rt):typeof queueMicrotask!="function"?setTimeout(Rt,0):queueMicrotask(Rt)))})(M),H()}const nn=x.customId?`renderer-${x.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,xn=(function(M){const H=new Map;return{scope:M,cache:H,clear:()=>H.clear()}})(nn),ns=P(()=>`${nn}:${V.value}`);An(_5,xn);const Wt=us(()=>x.customId),{effectiveCustomHtmlTagsSet:_n,mergedParseOptions:gn,parsedNodes:ot}=Zee(x,{instanceMsgId:nn,renderContent:pe,effectiveFinal:q,smoothStreamingEnabled:ue,debugPerformanceEnabled:ke,customComponentsMap:Wt,logPerf:$e});Ke(ot,()=>{xn.clear(),V.value+=1},{immediate:!0});const ds=P(()=>({customId:x.customId,customHtmlTags:gn.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:Ye.value,viewportPriority:x.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:x.codeBlockStream,codeBlockDarkTheme:x.codeBlockDarkTheme,codeBlockLightTheme:x.codeBlockLightTheme,codeBlockMonacoOptions:x.codeBlockMonacoOptions,renderCodeBlocksAsPre:x.renderCodeBlocksAsPre,codeBlockMinWidth:x.codeBlockMinWidth,codeBlockMaxWidth:x.codeBlockMaxWidth,codeBlockProps:x.codeBlockProps,mermaidProps:x.mermaidProps,d2Props:x.d2Props,infographicProps:x.infographicProps,showTooltips:Se.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));An("markstreamNestedRendererProps",ds);const ys=P(()=>ot.value),fs=P(()=>ot.value.length),Xe=Q(null),Ze=Q(null),Mt=Q(null),Dt=Q(null),zt=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),wn=!zt&&x.customId?AS(x.customId):null,Rn=P(()=>wn?(CS.value,AS(x.customId)):null),hs=P(()=>{var M;return!!(Z&&!ne.value&&x.customId&&!zt&&((M=Rn.value)!=null&&M.enabled))}),ss=P(()=>{var M;return!!(!ne.value&&((M=s.virtualScroll)!=null&&M.enabled))}),sn=Q(!1);ln(()=>{sn.value=!0});const Lt=P(()=>!!(Z&&ss.value));An("markstreamHostScrollManaged",Lt);const Vs=P(()=>!!(sn.value&&Lt.value)),an=P(()=>hs.value||Lt.value),So=P(()=>hs.value||Vs.value),Co=P(()=>{var M;return an.value&&((M=Rn.value)==null?void 0:M.textEstimation)!==!1}),Rs=P(()=>{var M;return an.value&&((M=Rn.value)==null?void 0:M.codeBlockEstimation)!==!1});function fi(){const M=U.value||yt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const co=P(()=>{const M=fi();return M>0?Math.max(1,Math.round(M)):640}),jo=P(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),Ot=P(()=>{var M;return!ne.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?ot.value.length>0:ot.value.length>jo.value)}),Bs=P(()=>Ot.value||hs.value||Lt.value),qn=P(()=>x.viewportPriority!==!1&&!W.value),Cs=DJ(M=>{var H;return ce((H=M??S.value)!=null?H:null)},qn),{requestFrame:On,cancelFrame:Hn,hasIdleCallback:hi,isTestEnv:Xn}=(function(M){const H=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,K=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,G=M.isClient&&typeof window.requestIdleCallback=="function",oe=(function(){var be;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(be=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:be.value;return Me?.env})();return{requestFrame:H,cancelFrame:K,hasIdleCallback:G,isTestEnv:oe?.NODE_ENV==="test"}})({isClient:Z}),{resolvedBatchSize:qo,resolvedInitialBatch:Ks,batchingEnabled:Mi,incrementalRenderingActive:Ao,renderedCount:Vn,previousRenderContext:Vo,adaptiveBatchSize:ji,previousBatchConfig:Ko}=(function(M,H){var K;const G=P(()=>{var We;const Re=Math.trunc((We=M.renderBatchSize)!=null?We:80);return Number.isFinite(Re)?Math.max(0,Re):0}),oe=P(()=>{var We;const Re=Math.trunc((We=M.initialRenderBatchSize)!=null?We:G.value);return Number.isFinite(Re)?Math.max(0,Re):G.value}),be=P(()=>!H.renderAsFragment.value&&M.batchRendering!==!1&&G.value>0&&H.isClient&&!H.isTestEnv),Me=Q(0),Ne=Q({key:M.indexKey,total:0}),He=Q(Math.max(1,G.value||1)),Fe=P(()=>{var We;return be.value&&((We=M.maxLiveNodes)!=null?We:0)<=0}),Ue=Q({batchSize:G.value,initial:oe.value,delay:(K=M.renderBatchDelay)!=null?K:16,enabled:Fe.value});return{resolvedBatchSize:G,resolvedInitialBatch:oe,batchingEnabled:be,incrementalRenderingActive:Fe,renderedCount:Me,previousRenderContext:Ne,adaptiveBatchSize:He,previousBatchConfig:Ue}})(x,{isClient:Z,isTestEnv:Xn,renderAsFragment:ne}),Bn=new Map,Kn=new Map,Mo=new WeakMap;let rt=null;const xe=new WeakMap,Le=new Map,we=Q(0),X=P(()=>(we.value,Array.from(Bn.entries()).sort((M,H)=>M[0]-H[0]))),me=Q(null),je=Q(null);let lt=null,ee=0,_e=null;const{activeRestoreAnchor:Ae,getRelativeScrollTopWithinContainer:Pe,setRelativeScrollTopWithinContainer:st,resolveAnchorOffset:at,clearRestoreReconcile:Nt,scheduleRestoreReconcile:Zt,captureRestoreAnchor:Qt,restoreAnchor:As,getAnchorDrift:Cr}=(function(M){const{isClient:H,containerRef:K,parsedNodeCount:G,requestFrame:oe,cancelFrame:be,resolveScrollContainer:Me,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:He,isReverseFlexScrollRoot:Fe,estimateIndexForOffset:Ue,estimateHeightRange:We,getFallbackNodeHeight:Re,clamp:ze}=M,Je=Q(null);let et=null,St=[];function ct(){const Tt=Me(),Ht=K.value;if(!Tt||!Ht)return null;const Pt=Tt.ownerDocument||Ht.ownerDocument||document;if(Tt===Pt.documentElement||Tt===Pt.body||Tt===Pt.scrollingElement){const cn=Ht.getBoundingClientRect();return Math.max(0,-cn.top)}return Math.max(0,Ne(Tt,Pt,!1)-He(Ht,Tt))}function dt(Tt){var Ht;const Pt=Me(),cn=K.value;if(!Pt||!cn)return;const Io=Math.max(0,Tt),Gs=Pt.ownerDocument||cn.ownerDocument||document,pi=Gs.defaultView||(typeof window<"u"?window:null);if(Pt===Gs.documentElement||Pt===Gs.body||Pt===Gs.scrollingElement){const Ir=Ne(Pt,Gs,!0)+cn.getBoundingClientRect().top;return void((Ht=pi?.scrollTo)==null||Ht.call(pi,0,Math.max(0,Ir+Io)))}TS(Pt,Gs,He(cn,Pt)+Io,{isReverseFlexScrollRoot:Ir=>{var $r;return($r=Fe?.(Ir))!=null&&$r},getNormalizedScrollTop:Ne})}function At(Tt){const Ht=G.value,Pt=ze(Tt.nodeIndex,0,Math.max(0,Ht-1));return We(0,Pt)+Math.max(0,Tt.offsetWithinNodePx)}function Ct(){if(et!=null&&(be?.(et),et=null),H)for(const Tt of St)window.clearTimeout(Tt);St=[]}function Jt(Tt){const Ht=At(Tt),Pt=ct();Pt!=null&&Math.abs(Pt-Ht)<=.5||dt(Ht)}return{activeRestoreAnchor:Je,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:dt,resolveAnchorOffset:At,clearRestoreReconcile:Ct,applyRestoreAnchor:Jt,scheduleRestoreReconcile:function(){Je.value&&H&&et==null&&(et=oe?oe(()=>{et=null,Je.value&&Jt(Je.value)}):null,et==null&&Je.value&&Jt(Je.value))},captureRestoreAnchor:function(){const Tt=ct(),Ht=G.value;if(Tt==null||Ht<=0)return null;const Pt=ze(Ue(Tt+1),0,Ht-1),cn=We(0,Pt),Io=Re(Pt);return{nodeIndex:Pt,offsetWithinNodePx:ze(Tt-cn,0,Math.max(0,Io-1))}},restoreAnchor:function(Tt){const Ht=G.value;if(Je.value={nodeIndex:ze(Tt.nodeIndex,0,Math.max(0,Ht-1)),offsetWithinNodePx:Math.max(0,Tt.offsetWithinNodePx)},Ct(),Jt(Je.value),H)for(const Pt of[0,120,280,480])St.push(window.setTimeout(()=>{Je.value&&Jt(Je.value)},Pt))},getAnchorDrift:function(Tt){const Ht=ct();return Ht==null?null:Ht-At(Tt)}}})({isClient:Z,containerRef:S,parsedNodeCount:fs,requestFrame:On,cancelFrame:Hn,resolveScrollContainer:()=>me.value||fe(),getNormalizedScrollTop:se,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:j,estimateIndexForOffset:Jm,estimateHeightRange:Nr,getFallbackNodeHeight:Wd,clamp:Ts}),{nodeHeights:Vt,heightStats:vn,heightTreeSize:$n,heightSumTree:ks,heightKnownTree:bs,averageNodeHeight:Ms,resetHeightMeasurements:va,pruneHeightMeasurements:gm,rebuildHeightTrees:$d,recordNodeHeight:UM,removeNodeHeights:jM,exportHeightCache:qM,importHeightCache:VM,fenwickRangeSum:Ld}=(function(M={}){const H=Ss({}),K=Ss({total:0,count:0}),G=Q(0),oe=Q([]),be=Q([]);function Me(){for(const Re of Object.keys(H))delete H[Number(Re)];K.total=0,K.count=0,G.value=0,oe.value=[],be.value=[]}function Ne(Re,ze,Je){for(let et=ze+1;et<Re.length;et+=et&-et)Re[et]+=Je}function He(Re,ze){let Je=0;for(let et=ze+1;et>0;et-=et&-et)Je+=Re[et];return Je}function Fe(Re){G.value=Re;const ze=new Array(Re+1).fill(0),Je=new Array(Re+1).fill(0);for(const[et,St]of Object.entries(H)){const ct=Number(et),dt=Number(St);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0||(Ne(ze,ct,dt),Ne(Je,ct,1))}oe.value=ze,be.value=Je}function Ue(Re){if(!Number.isInteger(Re)||Re<0)return!1;const ze=H[Re];if(!Number.isFinite(ze)||ze<=0)return!1;if(delete H[Re],K.total=Math.max(0,K.total-ze),K.count=Math.max(0,K.count-1),G.value>Re){const Je=oe.value,et=be.value;Je.length&&et.length&&(Ne(Je,Re,-ze),Ne(et,Re,-1))}return!0}const We=P(()=>K.count>0?Math.max(12,K.total/K.count):32);return{nodeHeights:H,heightStats:K,heightTreeSize:G,heightSumTree:oe,heightKnownTree:be,averageNodeHeight:We,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Re){if(Re<=0)return void Me();let ze=0,Je=0;for(const[et,St]of Object.entries(H)){const ct=Number(et),dt=Number(St);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0?delete H[ct]:(ze+=dt,Je++)}K.total=ze,K.count=Je},rebuildHeightTrees:Fe,recordNodeHeight:function(Re,ze,Je={}){(function(et,St,ct={}){var dt;if(!Number.isFinite(St)||St<=0)return!1;const At=H[et];if(At&&(ct.allowShrink===!1&&St<At||Math.abs(St-At)<=1))return!1;if(H[et]=St,At?K.total+=St-At:(K.total+=St,K.count++),G.value>et){const Ct=oe.value,Jt=be.value;if(Ct.length&&Jt.length)if(At){const Tt=St-At;Tt!==0&&Ne(Ct,et,Tt)}else Ne(Ct,et,St),Ne(Jt,et,1)}ct.notify!==!1&&((dt=M.onHeightRecorded)==null||dt.call(M))})(Re,ze,Bt(it({},Je),{notify:!0}))},removeNodeHeight:function(Re,ze={}){var Je;const et=Ue(Re);return et&&ze.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},removeNodeHeights:function(Re,ze={}){var Je;let et=0;for(const St of Re)Ue(Number(St))&&et++;return et>0&&ze.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},exportHeightCache:function(){return Object.entries(H).map(([Re,ze])=>({index:Number(Re),height:Number(ze)})).filter(Re=>Number.isFinite(Re.index)&&Re.index>=0&&Number.isFinite(Re.height)&&Re.height>0).sort((Re,ze)=>Re.index-ze.index)},importHeightCache:function(Re,ze={}){var Je;if(!Array.isArray(Re))return;const et=G.value;let St=!1;if(ze.mode!=="merge"){const ct=Object.keys(H);if(ct.length>0){for(const dt of ct)delete H[Number(dt)];St=!0}}for(const ct of Re){const dt=Number(ct.index),At=Number(ct.height);if(!Number.isInteger(dt)||dt<0||et>0&&dt>=et||!Number.isFinite(At)||At<=0)continue;const Ct=H[dt];Ct&&Math.abs(Ct-At)<=1||(H[dt]=At,St=!0)}St&&((function(){let ct=0,dt=0;const At=G.value;for(const[Ct,Jt]of Object.entries(H)){const Tt=Number(Ct),Ht=Number(Jt);!Number.isFinite(Tt)||Tt<0||At>0&&Tt>=At||!Number.isFinite(Ht)||Ht<=0?delete H[Tt]:(ct+=Ht,dt++)}K.total=ct,K.count=dt})(),et>0&&Fe(et),(Je=M.onHeightRecorded)==null||Je.call(M))},fenwickRangeSum:function(Re,ze,Je){if(Je<=ze)return 0;const et=He(Re,Je-1);return ze<=0?et:et-He(Re,ze-1)}}})({onHeightRecorded:()=>{Yo(),Lt.value&&Jc(),Ae.value&&Zt(),je.value&&Ca(),Ln("node-resize")}});function Fd(){va(),Le.clear()}function Tk(M){!Number.isInteger(M)||M<0||M>=ot.value.length||Le.set(M,zc(M))}function Nk(M,H,K={}){const G=Vt[M];UM(M,H,K);const oe=Vt[M];oe&&oe>0?Tk(M):G&&Le.delete(M)}function Ik(M,H){const K=yt("getNodeLayoutHeight.slot.offsetHeight",()=>{var G,oe;return(oe=(G=Bn.get(M))==null?void 0:G.offsetHeight)!=null?oe:0});return K>0?K:yt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function $k(M,H={}){VM(M,H),jm()}const Ar=P(()=>{var M;return!ne.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!Ot.value&&!(ot.value.length>900)&&qn.value}),Lk=P(()=>!!Cs&&(Ar.value||Ot.value)),Fk=P(()=>Ot.value||Lt.value),{liveNodeBufferResolved:Dc,focusIndex:Go,liveRange:Es,updateLiveRange:wl}=(function(M,H){const{parsedNodeCount:K,virtualizationEnabled:G,maxLiveNodesResolved:oe,clamp:be}=H,Me=P(()=>{var Fe;return Math.max(0,(Fe=M.liveNodeBuffer)!=null?Fe:60)}),Ne=Q(0),He=Ss({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Ne,liveRange:He,updateLiveRange:function(){const Fe=K.value;if(!G.value||Fe===0)return He.start=0,void(He.end=Fe);const Ue=Math.min(oe.value,Fe),We=Me.value,Re=be(Ne.value-We,0,Math.max(0,Fe-Ue));He.start=Re,He.end=Math.min(Fe,Re+Ue)}}})(x,{parsedNodeCount:fs,virtualizationEnabled:Ot,maxLiveNodesResolved:jo,clamp:Ts}),Ei=new Map,Sl=new Map,Mr=new Map,Od=[],qi=new Map,Er=new Set,Ok=Q(0);let vm=!1;const Rk=P(()=>(Ok.value,Er.size)),Eo=new Map,Ti=new Map,Bk=Q(0),ym=P(()=>{Bk.value;let M=0;for(const H of Eo.values())M+=Math.max(0,H);return M});let To=null,km=!0,Dk=[0],Pk="";function Yo(){km=!0}const Rd=P(()=>{if(!Ot.value)return ot.value.length;const M=Dc.value,H=Math.max(Es.end+M,Ks.value),K=Math.min(ot.value.length,H);return Math.max(Vn.value,K)});function Bd(){vm||(vm=!0,queueMicrotask(()=>{vm=!1,Ok.value+=1}))}function Hk(M,H,K="node-resize"){if(!Z||typeof window>"u")return null;const G=window.setTimeout(()=>{Er.delete(G)&&Bd();try{H()}finally{Ln(K)}},Math.max(0,M));return Er.add(G),Bd(),G}function Dd(M){Z&&M!=null&&(Er.delete(M)&&Bd(),window.clearTimeout(M))}function Wk(){if(Z&&typeof window<"u")for(const M of Er)window.clearTimeout(M);Er.size&&(Er.clear(),Bd()),Od.length=0,Mr.clear()}function KM(M){var H,K;return(K=(H=Dt.value)==null?void 0:H[M])!=null?K:null}const{cancelScheduledFocusSync:bm,scheduleFocusSync:Ni}=(function(M){const{isClient:H,containerRef:K,virtualizationEnabled:G,requestFrame:oe,cancelFrame:be,syncFocusToScroll:Me}=M;let Ne=null;function He(){var Ue,We,Re;return(Re=(We=(Ue=K.value)==null?void 0:Ue.ownerDocument)==null?void 0:We.defaultView)!=null?Re:typeof window<"u"?window:null}function Fe(){if(!Ne)return;const Ue=He();Ne.viaTimeout?Ue?Ue.clearTimeout(Ne.id):clearTimeout(Ne.id):be?.(Ne.id),Ne=null}return{cancelScheduledFocusSync:Fe,scheduleFocusSync:function(Ue={}){if(!G.value)return;if(!H)return void Me(!0);if(Ue.immediate)return Fe(),void Me(!0);if(Ne)return;const We=()=>{Ne=null,Me()};if(oe)return void(Ne={id:oe(We),viaTimeout:!1});const Re=He();Ne={id:Re?Re.setTimeout(We,16):setTimeout(We,16),viaTimeout:!0}}}})({isClient:Z,containerRef:S,virtualizationEnabled:Ot,requestFrame:On,cancelFrame:Hn,syncFocusToScroll:function(M=!1){var H;if(!Ot.value)return;const K=me.value||fe();if(!K)return;const G=K.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,oe=G?.defaultView||(typeof window<"u"?window:null),be=K===G?.documentElement||K===G?.body,Me=ot.value.length;if(!be&&Me>0&&j(K)){const Je=yt("syncFocusToScroll.clientHeight",()=>K.clientHeight||0),et=yt("syncFocusToScroll.scrollTop",()=>K.scrollTop),St=et<0?-et:et,ct=(function(At){var Ct,Jt;const Tt=ot.value;if(!Tt.length)return 0;if(At<=0)return Math.max(0,Tt.length-1);if(an.value){const Pt=(Ct=Cm()[Tt.length])!=null?Ct:0;return Yk(Math.max(0,Pt-At))}if($n.value===Tt.length){const Pt=Nr(0,Tt.length);return Jm(Math.max(0,Pt-At))}let Ht=At;for(let Pt=Tt.length-1;Pt>=0;Pt--){const cn=(Jt=Vt[Pt])!=null?Jt:Ms.value;if(Ht<=cn)return Pt;Ht-=cn}return 0})(Math.max(0,St)+.5*Math.max(0,Je)),dt=Ts(ct,0,Math.max(0,Me-1));return void((M||Math.abs(dt-Go.value)>1)&&(Go.value=dt,wl()))}const Ne=be?null:yt("syncFocusToScroll.root.getBoundingClientRect",()=>K.getBoundingClientRect()),He=be?0:Ne.top,Fe=be?yt("syncFocusToScroll.viewport.clientHeight",()=>{var Je,et;return(et=(Je=oe?.innerHeight)!=null?Je:K.clientHeight)!=null?et:0}):Ne.bottom,Ue=X.value;let We=null,Re=null;for(const[Je,et]of Ue){if(!et)continue;const St=yt("syncFocusToScroll.slot.getBoundingClientRect",()=>et.getBoundingClientRect());St.bottom<=He||St.top>=Fe||(We==null&&(We=Je),Re=Je)}if(We==null||Re==null){const Je=S.value;if(!Je)return;const et=be?{top:0}:yt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>K.getBoundingClientRect()),St=yt("syncFocusToScroll.fallback.scrollTop",()=>se(K,G,be)),ct=be?(()=>{const Ct=yt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Je.getBoundingClientRect()),Jt=(be?0:et.top)-Ct.top;return Math.max(0,Jt)})():(()=>{const Ct=ge(Je,K);return Math.max(0,St-Ct)})(),dt=be?yt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,Jt,Tt,Ht;return(Ht=(Tt=(Jt=oe?.innerHeight)!=null?Jt:(Ct=G?.documentElement)==null?void 0:Ct.clientHeight)!=null?Tt:K.clientHeight)!=null?Ht:0}):yt("syncFocusToScroll.fallback.root.clientHeight",()=>K.clientHeight),At=Jm(ct+.5*Math.max(0,dt));return Go.value=Ts(At,0,Math.max(0,ot.value.length-1)),void wl()}const ze=Math.round((We+Re)/2);!M&&Math.abs(ze-Go.value)<=1||(Go.value=Ts(ze,0,Math.max(0,ot.value.length-1)),wl())}}),{visibleNodeIndices:xm,nodeVisibilityHandles:ya,nodeVisibilityWatchStops:Pd,nodeVisibilityFallbackTimers:zk,clearVisibilityFallback:Hd,markNodeVisible:Tr,cleanupNodeVisibility:GM,destroyNodeVisibilityState:_m}=Qee({isClient:Z,shouldTrackVisibleNodeIndices:()=>Ar.value,shouldCleanupNodeVisibility:()=>Ot.value,onNodeMarkedVisible:M=>{Ot.value?Ni():Go.value=Ts(M,0,Math.max(0,ot.value.length-1))},onNodeVisibilityCleaned:M=>{Bn.delete(M)&&v2()}}),{cleanupScrollListener:Uk,setupScrollListener:YM}=(function(M){const{isClient:H,virtualizationEnabled:K,listenerEnabled:G,scrollRootElement:oe,resolveScrollContainer:be,scheduleFocusSync:Me,onScroll:Ne}=M;let He=null,Fe=null;function Ue(){He&&(He(),He=null),Fe=null,oe.value=null}function We(Re){const ze=M.getScrollTop?M.getScrollTop(Re):Re.scrollTop;return Math.max(0,Number.isFinite(ze)?Math.abs(ze):0)}return{cleanupScrollListener:Ue,setupScrollListener:function(){if(!H)return;if(!((Re=G?.value)!=null?Re:K.value))return void Ue();var Re;const ze=be();if(!ze)return void Ue();if(oe.value===ze&&He)return;Ue(),Fe=We(ze);const Je=()=>{if(Ne?.(),K.value){const et=(function(St){const ct=We(St),dt=Fe;Fe=ct;const At=Math.max(480,.75*(St.clientHeight||0));return dt==null?ct>At?{immediate:!0}:void 0:Math.abs(ct-dt)>At?{immediate:!0}:void 0})(ze);et?Me(et):Me()}};ze.addEventListener("scroll",Je,{passive:!0}),oe.value=ze,He=()=>{ze.removeEventListener("scroll",Je)}}}})({isClient:Z,virtualizationEnabled:Ot,listenerEnabled:Fk,scrollRootElement:me,resolveScrollContainer:fe,scheduleFocusSync:Ni,onScroll:function(){const M=je.value;if(!M)return;const H=Wc();if(!H||(function(G){if(Kc()>=ee)return _e=null,!1;const oe=_e;if(oe==null)return!0;const be=Math.abs(G.scrollTop-oe)<=2;return be||(_e=null),be})(H))return;const K=o2(H);K!=null?(K<-32||Math.abs(Math.max(0,K)-Math.max(0,M.distanceFromBottomPx))>32)&&Sa("restore"):Sa("restore")},getScrollTop:M=>{var H;const K=M.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,G=M===K.documentElement||M===K.body||M===K.scrollingElement;return yt("scrollListener.getScrollTop",()=>se(M,K,G))}});function Ts(M,H,K){return Math.min(Math.max(M,H),K)}function wm(M){return M?.firstElementChild}function jk(M,H){var K;return M?(K=M.matches)!=null&&K.call(M,H)?M:M.querySelector(H):null}function qk(){if(!an.value)return void(U.value=0);const M=yt("updateExperimentContainerWidth.clientWidth",()=>{var H,K;return(K=(H=S.value)==null?void 0:H.clientWidth)!=null?K:0});U.value=M>0?M:0}let Pc=null;function Sm(){Pc?.disconnect(),Pc=null}const Vk=ki({loader:()=>zn(null,null,function*(){return(yield eo(()=>import("./index8-1BPQUZEF.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:m5,delay:0,suspensible:!1});function Kk(M){return M===Vk}const Gk=P(()=>u.value==="pre"?$o:u.value==="shiki"?Vk:d0),Cl=P(()=>{const M=ot.value;if(!M.length||!an.value)return M.map(()=>null);const H=U.value||yt("estimatedNodeHeights.clientWidth",()=>{var K;return((K=S.value)==null?void 0:K.clientWidth)||0});return!Number.isFinite(H)||H<=0?M.map(()=>null):M.map((K,G)=>{const oe=Vt[G],be=typeof oe=="number"&&oe>0;if(Co.value&&!be){const Ne=x5(K,H,re.value);if(Ne)return Ne}if(Rs.value&&K.type==="code_block"){const Ne=(function(He){if(He.type!=="code_block")return null;const Fe=N2(He,Gd(He));return Kk(Fe)?"markdown":Fe===$o?"pre":Fe===Gk.value||Fe===d0?"monaco":null})(K);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return Ree(K,{rendererKind:Ne,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Me=x.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function Wd(M){var H;const K=Vt[M];if(Number.isFinite(K)&&K>0)return K;const G=(H=Cl.value[M])==null?void 0:H.height;return Number.isFinite(G)&&G>0?G:Math.max(Ms.value,(function(oe){var be,Me,Ne,He,Fe,Ue,We,Re,ze,Je,et,St,ct;const dt=ot.value[oe];if(!dt||typeof dt!="object")return 32;const At=String((be=dt.type)!=null?be:""),Ct=fi()||640;switch(At){case"heading":return 44;case"paragraph":return ka(String((Ne=(Me=dt.raw)!=null?Me:dt.content)!=null?Ne:""),Ct,34);case"list":{const Jt=Array.isArray(dt.items)?dt.items.length:1;return Math.max(48,30*Jt+12)}case"list_item":return ka(String((Fe=(He=dt.raw)!=null?He:dt.content)!=null?Fe:""),Ct,34);case"blockquote":return ka(String((We=(Ue=dt.raw)!=null?Ue:dt.content)!=null?We:""),Ct,56);case"table":{const Jt=Array.isArray(dt.rows)?dt.rows.length:Array.isArray(dt.children)?dt.children.length:3;return Math.max(120,38*Jt+48)}case"code_block":return ka(String((ze=(Re=dt.code)!=null?Re:dt.raw)!=null?ze:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ka(String((et=(Je=dt.raw)!=null?Je:dt.content)!=null?et:""),Ct,96);case"thematic_break":return 24;default:return ka(String((ct=(St=dt.raw)!=null?St:dt.content)!=null?ct:""),Ct,40)}})(M))}function ka(M,H,K,G=22){const oe=String(M??"");if(!oe)return K;const be=Math.max(18,Math.floor(Math.max(320,H)/8)),Me=oe.split(/\r?\n/).length,Ne=Math.ceil(oe.length/be),He=Math.max(1,Me,Ne);return Math.max(K,Math.ceil(He*G+12))}function Hc(M){const H=Number(M);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function Cm(){var M,H;const K=ot.value.length,G=Hc(U.value||yt("getFallbackHeightPrefix.clientWidth",()=>{var Ne;return((Ne=S.value)==null?void 0:Ne.clientWidth)||0})),oe=((M=s.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(s.virtualScroll.measurementKey),be=[K,vn.count,Math.round(vn.total),Math.round(100*Ms.value),oe,G,an.value?1:0,CS.value,V.value].join(":");if(!km&&Pk===be)return Dk;const Me=new Array(K+1);Me[0]=0;for(let Ne=0;Ne<K;Ne++)Me[Ne+1]=Me[Ne]+(an.value?Wd(Ne):(H=Vt[Ne])!=null?H:Ms.value);return Dk=Me,Pk=be,km=!1,Me}function Yk(M){var H,K;const G=ot.value.length;if(G<=0||M<=0)return 0;const oe=Cm();if(M>=((H=oe[G])!=null?H:0))return G-1;let be=0,Me=G-1,Ne=G-1;for(;be<=Me;){const He=be+Me>>1;((K=oe[He+1])!=null?K:0)>=M?(Ne=He,Me=He-1):be=He+1}return Ne}function Nr(M,H){var K,G;if(M>=H)return 0;if(an.value)return(function(Me,Ne){var He,Fe;const Ue=ot.value.length,We=Ts(Math.trunc(Me),0,Ue),Re=Ts(Math.trunc(Ne),We,Ue);if(We>=Re)return 0;const ze=Cm();return((He=ze[Re])!=null?He:0)-((Fe=ze[We])!=null?Fe:0)})(M,H);if($n.value!==ot.value.length){let Me=0;for(let Ne=M;Ne<H;Ne++)Me+=(K=Vt[Ne])!=null?K:Ms.value;return Me}const oe=ks.value,be=bs.value;if(!oe.length||!be.length){let Me=0;for(let Ne=M;Ne<H;Ne++)Me+=(G=Vt[Ne])!=null?G:Ms.value;return Me}return Ld(oe,M,H)+(H-M-Ld(be,M,H))*Ms.value}Ke(()=>ot.value.length,M=>{Yo(),M<=0?Fd():(M<$n.value&&gm(M),M!==$n.value&&$d(M))},{immediate:!0});const ZM=P(()=>{if(!Ot.value)return ot.value.map((G,oe)=>({node:G,index:oe}));const M=ot.value.length,H=Ts(Es.start,0,M),K=Ts(Es.end,H,M);return ot.value.slice(H,K).map((G,oe)=>({node:G,index:H+oe}))}),Am=P(()=>Ot.value?Nr(0,Math.min(Es.start,ot.value.length)):0),Mm=P(()=>{if(!Ot.value)return 0;const M=ot.value.length;return Nr(Math.min(Es.end,M),M)});function Zk(){if(!an.value)return 0;let M=0;const H=Cl.value;for(let K=0;K<H.length;K++){if(!H[K])continue;const G=Vt[K];Number.isFinite(G)&&G>0||M++}return M}function Qk(){const M=ot.value.length;return{totalNodes:M,measuredCount:vn.count,estimatedCount:Zk(),averageNodeHeight:Ms.value,topSpacerHeight:Am.value,bottomSpacerHeight:Mm.value,estimatedTotalHeight:Nr(0,M),width:Al()}}function QM(){const M=ot.value,H=Qk();return Bt(it({},H),{probe:{paragraphReady:!!re.value.paragraph,listItemReady:!!re.value.listItem,listWrapperOverhead:re.value.listWrapperOverhead,headingReadyLevels:Object.entries(re.value.headings).filter(([,K])=>!!K).map(([K])=>Number(K))},nodes:M.map((K,G)=>{var oe,be,Me,Ne,He,Fe,Ue,We,Re;return{index:G,type:K.type,estimateKind:(be=(oe=Cl.value[G])==null?void 0:oe.kind)!=null?be:null,rendererKind:(Ne=(Me=Cl.value[G])==null?void 0:Me.rendererKind)!=null?Ne:null,estimatedHeight:(Fe=(He=Cl.value[G])==null?void 0:He.height)!=null?Fe:null,estimatedContentHeight:(We=(Ue=Cl.value[G])==null?void 0:Ue.contentHeight)!=null?We:null,measuredHeight:(Re=Vt[G])!=null?Re:null}})})}function Em(){return s.indexKey!=null?String(s.indexKey):ss.value?`virtual-${Dn()}`:"markdown-renderer"}function Xk(M){const H=String(M),K=`${Em()}-`;if(!H.startsWith(K))return null;const G=H.slice(K.length).match(/^(\d+)(?:$|-)/);if(!G)return null;const oe=Number(G[1]);return!Number.isInteger(oe)||oe<0||oe>=ot.value.length?null:oe}function Dn(){var M,H,K;const G=(M=s.virtualScroll)==null?void 0:M.sessionKey;return String(G!=null&&G!==""?G:(K=(H=s.indexKey)!=null?H:x.customId)!=null?K:nn)}function ps(){var M;const H=(M=s.virtualScroll)==null?void 0:M.threadKey;return H==null||H===""?void 0:String(H)}function Tm(M){var H;return(M??"")===((H=ps())!=null?H:"")}function XM(){var M;const H=(M=s.virtualScroll)==null?void 0:M.measurementKey;return H==null?"":String(H)}function JM(){var M,H;const K=u.value,G=K==="monaco"?x.codeBlockMonacoOptions:void 0,oe=x.codeBlockProps,be=K==="shiki";return[x.isDark?"dark":"light",K==="monaco"?"code-rich":K==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",xs(x.codeBlockMinWidth),xs(x.codeBlockMaxWidth),...be?[Zh((M=oe?.themes)!=null?M:x.themes,(H=oe?.langs)!=null?H:x.langs)]:[],xs(G?.fontSize),xs(G?.lineHeight),xs(G?.fontFamily),xs(G?.tabSize),xs(G?.MAX_HEIGHT),xs(G?.wordWrap),xs(G?.wrappingIndent),xs(G?.padding),xs(oe?.showHeader),xs(oe?.showCopyButton),xs(oe?.showExpandButton),xs(oe?.showPreviewButton),xs(oe?.showCollapseButton),xs(oe?.showFontSizeButtons)].join("\0")}function Vi(){return[XM(),JM()].join("\0")}function Al(){return fi()}const zd=P(()=>Hc(Al())),No=P(()=>[Vi(),zd.value].join("\0")),e8=P(()=>{var M;return ss.value?["virtual",(M=ps())!=null?M:"",Dn(),No.value].join("\0"):s.indexKey});function ba(){Bk.value+=1}function Nm(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=ot.value.length||M.sessionKey!==Dn()||M.threadKey!==ps()||M.layoutEpochKey!==No.value)}function Jk(M){const H=String(M),K=Ti.get(H);return K?Nm(K)?K.index:null:Xk(H)}function e2(M="async-node"){(Eo.size||Ti.size)&&(Eo.clear(),Ti.clear(),ba(),Ln(M))}const xa=Ut(Hg,null),Im={reportHeight(M,H){if(!Lt.value)return;const K=Jk(M);if(K==null)return;const G=Ei.get(K);if(!G)return;const oe=Number(H),be=Ik(K,G);Nk(K,Number.isFinite(oe)&&oe>0?Math.max(oe,be||0):be)},markPending(M){if(!Lt.value)return;const H=Xk(M);H!=null&&(function(K,G){var oe;const be=Ti.get(K);if(be&&Nm(be))return Eo.set(K,Math.max(0,(oe=Eo.get(K))!=null?oe:0)+1),ba(),void Ln("async-node");Eo.set(K,1),Ti.set(K,(function(Me){return{index:Me,sessionKey:Dn(),threadKey:ps(),layoutEpochKey:No.value}})(G)),ba(),Ln("async-node")})(String(M),H)},markSettled(M){if(!Lt.value)return;const H=String(M),K=Jk(M);(K!=null||(function(G){return Eo.has(String(G))})(H))&&(function(G){var oe;const be=(oe=Eo.get(G))!=null?oe:0;return!(be<=0||(be<=1?(Eo.delete(G),Ti.delete(G)):Eo.set(G,be-1),ba(),be===1&&Ln("async-node"),0))})(H)&&K!=null&&Ki()}};function t8(){let M=0;for(const H of Ei.values())M+=yt("getVisibleDomHeight.offsetHeight",()=>{var K;return(K=H?.offsetHeight)!=null?K:0});return Math.ceil(Math.max(0,M))}An(Hg,{reportHeight(M,H){Im.reportHeight(M,H),xa?.reportHeight(M,H)},markPending(M){Im.markPending(M),xa?.markPending(M)},markSettled(M){Im.markSettled(M),xa?.markSettled(M)}});let $m,Lm=null,_a=null;function Ud(M){return M!==!1&&M!=null&&M!==""}function t2(){return Ot.value?(function(){if(!Ot.value)return!0;const M=ot.value.length,H=Ts(Es.start,0,M),K=Ts(Es.end,H,M);if(H>=K)return!0;for(let G=H;G<K;G++)if(!Bn.has(G)||e1(G)&&!Ei.has(G))return!1;return!0})():Vn.value>=Rd.value}function Fm(){return q.value===!0&&!J.value&&ym.value===0&&Er.size===0&&qi.size===0&&To==null&&t2()}function n2(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.settleMode)!=="manual"||Lm===Dn()&&$m===ps())return!0;const K=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!Ud(K)&&_a===eu(K)}function Om(){return Fm()&&n2()}function n8(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 Ml(M="manual",H){const K=Qk(),G=(function(oe){return oe||(q.value!==!0?ot.value.length>0?"streaming":"estimating":!t2()||qi.size>0||To!=null?"measuring":Om()?"settled":"settling")})(H);return{sessionKey:Dn(),threadKey:ps(),phase:G,nodeCount:K.totalNodes,liveRange:{start:Es.start,end:Es.end},renderedCount:Vn.value,measuredCount:K.measuredCount,estimatedCount:K.estimatedCount,averageNodeHeight:K.averageNodeHeight,topSpacerHeight:K.topSpacerHeight,bottomSpacerHeight:K.bottomSpacerHeight,visibleDomHeight:t8(),totalHeight:s2(),width:K.width,final:q.value===!0,stable:Om(),confidence:n8(G,K),reason:M}}function Wc(){const M=me.value||fe(),H=S.value;if(!M||!H)return null;const K=M.ownerDocument||H.ownerDocument||document,G=M===K.documentElement||M===K.body||M===K.scrollingElement,oe=yt("getScrollBox.scrollTop",()=>se(M,K,G)),be=yt("getScrollBox.scrollHeight",()=>{var Ne,He,Fe,Ue,We;return G?Math.max((He=(Ne=K.documentElement)==null?void 0:Ne.scrollHeight)!=null?He:0,(Ue=(Fe=K.body)==null?void 0:Fe.scrollHeight)!=null?Ue:0,(We=M.scrollHeight)!=null?We:0):M.scrollHeight}),Me=yt("getScrollBox.clientHeight",()=>{var Ne;return G?((Ne=K.documentElement)==null?void 0:Ne.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:K,isViewportRoot:G,scrollTop:oe,scrollHeight:be,clientHeight:Me}}function s2(){const M=ot.value.length,H=Math.max(0,Nr(0,M)),K=yt("getRendererLogicalHeight.offsetHeight",()=>{var oe,be;return(be=(oe=S.value)==null?void 0:oe.offsetHeight)!=null?be:0}),G=Math.max(0,K>0?K:yt("getRendererLogicalHeight.scrollHeight",()=>{var oe,be;return(be=(oe=S.value)==null?void 0:oe.scrollHeight)!=null?be:0}));return M<=0?Math.ceil(K):Ot.value?H>0?Math.max(1,Math.ceil(H),(function(){let oe=Am.value+Mm.value;for(const be of Bn.values())be&&(oe+=Math.max(0,yt("getVirtualizedDomLogicalHeight.offsetHeight",()=>be.offsetHeight||0)));return Math.ceil(Math.max(0,oe))})(),(function(oe,be){return oe<=0||be<=0?0:be<=oe+Math.max(512,.05*oe)?Math.ceil(be):0})(H,G)):Math.max(1,Math.ceil(G)):Lt.value?H>0||vn.count>0||Zk()>0?(Ao.value&&Vn.value,Math.max(1,Math.ceil(G),Math.ceil(H))):Math.ceil(G):Math.max(1,Math.ceil(G),Math.ceil(H))}function o2(M){const H=S.value;if(!H)return null;const K=yt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(oe){return oe.isViewportRoot?oe.clientHeight:yt("getViewportBottomInRoot.getBoundingClientRect",()=>oe.root.getBoundingClientRect().bottom)})(M)-K.bottom}function s8(M={}){const H=M.requireViewport!==!1,K=(function(be=64){const Me=Wc(),Ne=S.value;if(!Me||!Ne)return!1;const He=(function(Ue){if(Ue.isViewportRoot)return{top:0,bottom:Ue.clientHeight};const We=yt("getVirtualViewportRect.getBoundingClientRect",()=>Ue.root.getBoundingClientRect());return{top:We.top,bottom:We.bottom}})(Me),Fe=yt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ne.getBoundingClientRect());return Fe.bottom>=He.top-be&&Fe.top<=He.bottom+be})();if(H&&!K)return null;const G=(function(){const be=Wc(),Me=S.value;if(!be||!Me||Math.max(0,be.scrollHeight-be.scrollTop-be.clientHeight)>64)return null;const Ne=o2(be);return Ne==null?null:Ne>=-8&&Ne<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ne)}:null})();if(G)return{anchor:G,captured:!0};const oe=Qt();if(oe)return{anchor:{type:"node",nodeIndex:oe.nodeIndex,offsetWithinNodePx:oe.offsetWithinNodePx},captured:K};if(M.allowFallback===!0){const be=(function(){const Me=ot.value.length;return Me<=0?null:{type:"node",nodeIndex:Ts(Go.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return be?{anchor:be,captured:!1}:null}return null}function Rm(M){let H=2166136261;for(let K=0;K<M.length;K++)H^=M.charCodeAt(K),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function o8(M,H){let K=M;for(let G=0;G<H.length;G++)K^=H.charCodeAt(G),K=Math.imul(K,16777619);return K^=31,K=Math.imul(K,16777619),K}const i8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function jd(M,H=new WeakSet,K=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(G){const oe=G.length>8192?`${G.slice(0,8192)}...${G.length}`:G;return`${G.length}:${Rm(oe)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(H.has(M))return"cycle";if(K>=6)return"max-depth";H.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Fe=[];for(let Ue=0;Ue<M.length;Ue++)Fe.push(jd(M[Ue],H,K+1));return`a:${M.length}:${Fe.join(",")}`}const be=[],Me=[],Ne=Math.max(0,M.length-32);let He=2166136261;for(let Fe=0;Fe<M.length;Fe++){const Ue=jd(M[Fe],H,K+1);He=o8(He,Ue),Fe<32&&be.push(Ue),Fe>=Ne&&Me.push(Ue)}return[`a:${M.length}`,`h=${be.join(",")}`,`t=${Me.join(",")}`,`all=${(He>>>0).toString(36)}`].join(":")}const G=M,oe=Object.keys(G).filter(be=>{const Me=G[be];return be!=="parent"&&be!=="el"&&be!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||i8.has(be))}).sort();return`o:${oe.length}:${oe.map(be=>`${be}=${jd(G[be],H,K+1)}`).join(";")}`}finally{H.delete(M)}}let i2=-1,Bm="";function zc(M){const H=ot.value[M];return H?Rm(jd(H)):""}function Dm(){const M=V.value;if(i2===M)return Bm;let H=2166136261;for(let K=0;K<ot.value.length;K++){const G=zc(K);for(let oe=0;oe<G.length;oe++)H^=G.charCodeAt(oe),H=Math.imul(H,16777619)}return Bm=(H>>>0).toString(36),i2=M,Bm}function wa(M,H={}){var K;const G=H.includeHeightCache===!0,oe=(K=H.includeContentHash)!=null?K:G,be=G?(function(Ne){const He=(function(){var et,St;const ct=Number((St=(et=s.virtualScroll)==null?void 0:et.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(He)||Ne.length<=He)return Ne;const Fe=new Map,Ue=et=>{!et||Fe.size>=He||Fe.set(et.index,et)},We=ot.value.length,Re=Ts(Es.start-2*Dc.value,0,We),ze=Ts(Es.end+2*Dc.value,Re,We);for(const et of Ne)et.index>=Re&&et.index<ze&&Ue(et);const Je=Math.max(1,Math.ceil(Ne.length/He));for(let et=0;et<Ne.length&&Fe.size<He;et+=Je)Ue(Ne[et]);for(let et=Ne.length-1;et>=0&&Fe.size<He;et-=Je)Ue(Ne[et]);return Array.from(Fe.values()).sort((et,St)=>et.index-St.index).slice(0,He)})(qM().map(Ne=>{var He;const Fe=ot.value[Ne.index];return Fe?Bt(it({},Ne),{nodeType:String((He=Fe.type)!=null?He:""),signature:zc(Ne.index)}):null}).filter(Ne=>!!Ne)):[],Me=s8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Me||be.length||H.includeEmptyState===!0?Bt(it({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:oe?Dm():void 0,measurementKey:Vi()||void 0,heightCache:be.length?be:void 0}):null}function Pm(M){var H,K;const G=Wc();if(!G)return;const oe=(function(Ne){const He=S.value;if(!He)return null;const Fe=ge(He,Ne.root),Ue=ot.value.length,We=yt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>He.offsetHeight||0),Re=Math.max(0,We>0?We:Ue>0?yt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>He.scrollHeight||0):0),ze=s2();return Fe+Math.max(Re,ze)})(G);if(oe==null)return;const be=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,oe-G.clientHeight-be);(function(Ne){ee=Kc()+120,_e=Ne})(Me),G.isViewportRoot?(K=(H=G.doc.defaultView)==null?void 0:H.scrollTo)==null||K.call(H,0,Me):TS(G.root,G.doc,Me,{isReverseFlexScrollRoot:j,getNormalizedScrollTop:se})}const Hm=[];function r2(){if(Z)for(lt!=null&&(Hn?.(lt),lt=null);Hm.length;){const M=Hm.pop();M!=null&&window.clearTimeout(M)}}function Sa(M){const H=!!je.value;je.value=null,ee=0,_e=null,r2(),H&&M&&Ln(M)}function Ca(){if(!je.value||!Z||lt!=null)return;const M=()=>{lt=null;const H=je.value;H&&Pm(H)};lt=On?On(M):null,lt==null&&M()}function l2(M,H={}){const K=ot.value.length;return K<=0?[]:M.filter(G=>!(!Number.isInteger(G.index)||G.index<0||G.index>=K)&&!(!Number.isFinite(G.height)||G.height<=0)&&!(H.requireSignature&&!G.signature)&&!(H.requireCompatibilityMetadata&&!G.nodeType&&!G.signature)&&(function(oe){var be;const Me=ot.value[oe.index];return!(!Me||oe.nodeType&&oe.nodeType!==String((be=Me.type)!=null?be:"")||oe.signature&&oe.signature!==zc(oe.index))})(G))}function a2(M){const H=Hc(Al()),K=Hc(M);return H!==-1&&K!==-1&&H===K}function Wm(M){var H;const K=Number(M?.width);if(Number.isFinite(K)&&K>0)return K;const G=Number((H=M?.metrics)==null?void 0:H.width);return Number.isFinite(G)&&G>0?G:null}function c2(M){var H;return M.sessionKey===Dn()&&!!Tm(M.threadKey)&&((H=M.measurementKey)!=null?H:"")===Vi()&&!!a2(Wm(M))&&!!(function(K){const G=K.heightCache;return!!G?.length&&(u2(K)?G.some(oe=>!!(oe.nodeType||oe.signature)):G.some(oe=>!!oe.signature))})(M)}function u2(M){return!!(M.contentHash&&M.contentHash===Dm())}function r8(M){return!u2(M)}let El=null,Tl=null,qd=null,Uc=null,jc=null;function zm(M){var H;const K=M.map(oe=>{var be,Me;return[oe.index,Math.round(10*oe.height),(be=oe.nodeType)!=null?be:"",(Me=oe.signature)!=null?Me:""].join("")}).join(""),G=Hc(Al());return[(H=ps())!=null?H:"",Dn(),Vi(),ot.value.length,G,M.length,Rm(K)].join(":")}function d2(M=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Lt.value||!M?.length||ot.value.length<=0||!a2((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const K=l2(M,{requireSignature:!0});if(!K.length)return!1;const G=zm(K);return G===El?(Tl="standalone",!0):($k(K,{mode:"merge"}),Yo(),El=G,Tl="standalone",Yc(),Ln("restore"),!0)}function Um(M,H={}){var K,G,oe;if(!Lt.value||!M||M.sessionKey!==Dn()||!Tm(M.threadKey)||ot.value.length<=0)return!1;const be=!!((K=M.heightCache)!=null&&K.length)&&!Vd(),Me=!M.anchor||M.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:M.anchor,Ne=H.restoreAnchor===!0&&!!Me&&!Vd()&&Number(Wm(M))>0;let He=!1;if((G=M.heightCache)!=null&&G.length&&c2(M)){const Ue=l2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:r8(M)});Ue.length&&($k(Ue,{mode:"merge"}),Yo(),El=zm(Ue),Tl="restore",Yc(),He=!0)}if(be||Ne)return!1;if(!H.restoreAnchor||!Me)return He&&Ln("restore"),!0;const Fe=(function(Ue,We){var Re;const ze=Ue.anchor,Je=ze?ze.type==="bottom"?`bottom:${Math.round(ze.distanceFromBottomPx)}`:`node:${ze.nodeIndex}:${Math.round(ze.offsetWithinNodePx)}`:"none";return[(Re=ps())!=null?Re:"",Dn(),Vi(),zd.value,We,Je].join(":")})(M,(oe=H.restoreToken)!=null?oe:"imperative");return qd===Fe?(He&&Ln("restore"),!0):(qd=Fe,(function(Ue){const We=()=>{if(Ue.type==="node")return Sa(),void As({nodeIndex:Ue.nodeIndex,offsetWithinNodePx:Ue.offsetWithinNodePx});if(Nt(),Ae.value=null,je.value=Ue,r2(),Pm(Ue),Z)for(const Re of[0,120,280,480])Hm.push(window.setTimeout(()=>{const ze=je.value;ze&&Pm(ze)},Re))};(function(Re){if(!Ot.value)return!1;const ze=ot.value.length;return!(ze<=0||(Go.value=Re.type==="node"?Ts(Re.nodeIndex,0,ze-1):ze-1,wl(),0))})(Ue)?pt(We):We()})(Me),Ln("restore"),!0)}function Vd(){const M=Al();return Number.isFinite(M)&&M>0}function f2(M){var H;return M.sessionKey===Dn()&&!!Tm(M.threadKey)&&(ot.value.length<=0||!(!((H=M.heightCache)!=null&&H.length)||Vd())||!(!(M.anchor&&Number(Wm(M))>0)||Vd()))}function jm(){Le.clear();for(const M of Object.keys(Vt)){const H=Number(M);Number.isInteger(H)&&H>=0&&H<ot.value.length&&Tk(H)}}function qc(){To!=null&&(Hn?.(To),To=null),t1()}function h2(){return!Z||Xn?Promise.resolve():new Promise(M=>{let H=!1,K=null;const G=()=>{H||(H=!0,K!=null&&window.clearTimeout(K),M())};if(On)return On(G),void(K=window.setTimeout(G,50));K=window.setTimeout(G,0)})}function qm(M,H=ps(),K=No.value){return Dn()===M&&ps()===H&&No.value===K}function Vm(){return zn(this,arguments,function*(M={}){var H,K,G,oe,be;const Me=Dn(),Ne=ps(),He=No.value,Fe=(H=M.frames)!=null?H:2,Ue=(K=M.timeoutMs)!=null?K:120,We=(G=M.reason)!=null?G:"manual",Re=M.expectedSettledTokenKey,ze=M.flushPendingTimers===!0,Je=Ml(We),et=()=>Bt(it({},Je),{phase:Je.final?"settling":Je.phase,stable:!1,confidence:Je.confidence==="final"?"mixed":Je.confidence,reason:We}),St=()=>qm(Me,Ne,He)&&(Re==null||Gc()===Re);for(let Ct=0;Ct<Fe;Ct++){if(yield pt(),!St()||(yield h2(),!St()))return et();Ki(),qc()}if(yield(function(Ct){return!Z||Ct<=0?Promise.resolve():new Promise(Jt=>window.setTimeout(Jt,Ct))})(Ue),!St()||(ze&&Wk(),Ki(),qc(),!St()))return et();const ct=Fm();ct&&(Lm=Me,$m=Ne,((oe=s.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&Re!=null&&Ud((be=s.virtualScroll)==null?void 0:be.settledToken)&&Gc()===Re&&(_a=eu(s.virtualScroll.settledToken)));const dt=St()&&ct&&n2(),At=Ml(We,dt?"final":void 0);return Qm(At,!0),At})}let Km="content",Nl=null,Il=null,Gm=0,Vc=null,Aa=null,Ym=null,Zm=null;function Kc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function p2(M){var H,K;const G=Vc;if(!G)return!0;const oe=(K=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?K:1;return Math.abs(M.totalHeight-G.totalHeight)>oe||M.sessionKey!==G.sessionKey||M.phase!==G.phase||M.stable!==G.stable||M.final!==G.final||M.threadKey!==G.threadKey||M.nodeCount!==G.nodeCount||M.measuredCount!==G.measuredCount||M.width!==G.width}function xs(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 Gc(M=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return xs(M)}function m2(M,H){var K,G;return[M,H.sessionKey,(K=H.threadKey)!=null?K:"",Vi(),Dm(),xs((G=s.virtualScroll)==null?void 0:G.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function Yc(){Ym=null,Zm=null,Aa=null}function l8(M){const H=M.heightCache;return H?.length?zm(H):""}function Zc(M){var H,K,G;const oe=M.metrics,be=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:"",(K=M.measurementKey)!=null?K:Vi(),(G=M.contentHash)!=null?G:"",l8(M),be,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 Qm(M,H=!1){if(!Lt.value||(function(Me=!1){return!Me&&ss.value&&!Vs.value})(H))return;const K=H||p2(M),G=(function(Me,Ne=!1){return Ne||Me.stable||Me.phase==="final"?{state:wa(Me,{includeHeightCache:!0})}:{state:wa(Me)}})(M,H),oe=G.state,be=!!(oe&&(K||(function(Me,Ne=!1){return!!Ne||Zc(Me)!==Aa})(oe,H)));if(K&&(E(M),Vc=M,Gm=Kc()),oe&&be&&(N(oe),oe.anchor&&F(oe.anchor),Aa=Zc(oe)),M.stable){const Me=m2("settled",M);if(Me!==Ym){Ym=Me;const Ne=wa(M,{includeHeightCache:!0});Ne&&(N(Ne),Aa=Zc(Ne)),(function(He){o("render-settled",He)})(M)}}if(M.phase==="final"){const Me=m2("final",M);if(Me!==Zm){Zm=Me;const Ne=wa(M,{includeHeightCache:!0});Ne&&(N(Ne),Aa=Zc(Ne)),(function(He){o("render-final",He)})(M)}}}function Xm(){Nl!=null&&(Hn?.(Nl),Nl=null),Il!=null&&Z&&(window.clearTimeout(Il),Il=null)}function g2(){Nl=null,Il=null,(function(M){if(qi.size>0||To!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Km)&&(Ki(),qc()),Qm(Ml(Km))}function Ln(M){var H,K;if(!Lt.value||(Km=M,Nl!=null||Il!=null))return;const G=Math.max(0,(K=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?K:32),oe=Math.max(0,G-(Kc()-Gm)),be=()=>{Il=null,Nl=On?On(g2):null,Nl==null&&g2()};Z&&oe>0?Il=window.setTimeout(be,oe):be()}function Jm(M){var H;if(M<=0)return 0;const K=ot.value;if(an.value)return Yk(M);if($n.value===K.length&&ks.value.length&&bs.value.length){const oe=Ms.value,be=ks.value,Me=bs.value,Ne=We=>We<=0?0:Ld(be,0,We)+(We-Ld(Me,0,We))*oe;let He=0,Fe=K.length-1,Ue=K.length-1;for(;He<=Fe;){const We=He+Fe>>1;Ne(We+1)>=M?(Ue=We,Fe=We-1):He=We+1}return Ue}let G=M;for(let oe=0;oe<K.length;oe++){const be=(H=Vt[oe])!=null?H:Ms.value;if(G<=be)return oe;G-=be}return Math.max(0,K.length-1)}function v2(){we.value+=1}function e1(M){return!(Ao.value&&M>=Vn.value)&&(!Ar.value||M<Ks.value||xm.value.has(M))}function Ma(M){const H=Pd.get(M);H&&(H(),Pd.delete(M));const K=ya.get(M);K&&(K.destroy(),ya.delete(M)),Hd(M)}function y2(M,H){let K=!1;if(H){const be=Bn.get(M);Bn.set(M,H),be!==H&&(K=!0)}else Bn.delete(M)&&(K=!0);if(K&&v2(),H||Hd(M),!Lk.value||!Cs||!Ot.value&&Ar.value&&!W.value&&ya.size>=640&&(W.value||(W.value=!0,_m()),!Lk.value||!Cs))return Ma(M),void(H&&Tr(M,!0));if(M<Ks.value&&!Ot.value||xm.value.has(M))return Ma(M),void Tr(M,!0);if(!H)return void Ma(M);Ma(M);const G=Cs(H,{rootMargin:"400px"});if(!G)return;ya.set(M,G),Tr(M,G.isVisible.value),Ar.value&&(function(be){if(!Z||!Ar.value)return;Hd(be);const Me=be%17*23,Ne=window.setTimeout(()=>{if(zk.delete(be),!Ar.value||xm.value.has(be))return;const He=Bn.get(be);if(!He)return;const Fe=fe(He),Ue=He.ownerDocument||document,We=Ue.defaultView||window,Re=!Fe||Fe===Ue.documentElement||Fe===Ue.body,ze=!Re&&Fe?yt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Fe.getBoundingClientRect()):null,Je=Re?0:ze.top,et=Re?yt("nodeVisibilityFallback.clientHeight",()=>{var ct,dt;return(dt=(ct=We.innerHeight)!=null?ct:Fe?.clientHeight)!=null?dt:0}):ze.bottom,St=yt("nodeVisibilityFallback.node.getBoundingClientRect",()=>He.getBoundingClientRect());St.bottom>=Je-500&&St.top<=et+500&&Tr(be,!0)},1800+Me);zk.set(be,Ne)})(M);let oe=null;oe=Ke(()=>G.isVisible.value,be=>{if(be){Hd(M),Tr(M,!0),oe?.(),Pd.delete(M),ya.get(M)===G&&ya.delete(M);try{G.destroy()}catch{}}},{immediate:!0}),Pd.set(M,oe),Ot.value&&Ni()}function t1(){To=null;for(const[M,H]of qi)qi.delete(M),Ei.get(M)===H.el&&Sl.get(M)===H.version&&Nk(M,H.height,{allowShrink:H.allowShrink})}function Ea(){To!=null&&(Hn?.(To),To=null),qi.clear()}function Kd(M,H){(function(K,G,oe){var be;if(!Number.isFinite(oe)||oe<=0||Ei.get(K)!==G)return;const Me=Sl.get(K);if(Me==null)return;const Ne=ot.value[K],He=J.value&&q.value!==!0&&!((be=s.nodes)!=null&&be.length)&&K>=ot.value.length-2,Fe=!(Ne?.loading===!0||He),Ue=qi.get(K),We=Ue?Ue.allowShrink&&Fe:Fe,Re=Ue&&!We?Math.max(Ue.height,oe):oe;qi.set(K,{height:Re,allowShrink:We,version:Me,el:G}),To==null&&(To=On?On(t1):null,To==null&&t1())})(M,H,Ik(M,H))}function Ki(){for(const[M,H]of Ei)H&&Kd(M,H)}function k2(){rt?.disconnect(),rt=null,Kn.clear()}function n1(){for(;Od.length;)Dd(Od.pop())}Ke(Vs,M=>{M&&Ln("content")},{flush:"post"}),t({getVirtualMetrics:Ml,captureVirtualState:function(M={}){var H;return wa(Ml("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(H=M.includeEmptyState)==null||H})},restoreVirtualState:function(M,H={}){const K=H.restoreAnchor===!0,G=H.restoreToken==null?"imperative":String(H.restoreToken);Uc=M,jc={restoreAnchor:K,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!Um(M,{restoreAnchor:K,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&f2(M)||(Uc=null,jc=null)},forceMeasure:function(M="manual"){return zn(this,null,function*(){yield pt(),yield h2(),Ki(),qc(),yield pt();const H=Ml(M);return Qm(H,!0),H})},settle:Vm,scrollToNode:function(M,H="start"){Sa(),Nt();const K=ot.value.length;if(K<=0)return;const G=Ts(M,0,K-1),oe=()=>{var be;const Me=at({nodeIndex:G,offsetWithinNodePx:0}),Ne=Wd(G),He=Wc(),Fe=(be=He?.clientHeight)!=null?be:0,Ue=Pe();let We=Me;if(H==="center")We=Me-Fe/2+Ne/2;else if(H==="end")We=Me-Fe+Ne;else if(H==="nearest"&&Ue!=null){if(Me>=Ue&&Me+Ne<=Ue+Fe)return;We=Me<Ue?Me:Me-Fe+Ne}st(Math.max(0,We)),Ni({immediate:!0}),Ot.value&&(Go.value=G,wl())};if(Ot.value)return Go.value=G,wl(),void pt(oe);oe()}}),Ke(()=>Bs.value,M=>{if(!M){k2();for(const H of Mr.values())for(const K of H)Dd(K);Mr.clear(),Sl.clear(),n1(),Ea()}},{immediate:!0}),Ke(q,M=>{M&&(function(){if(Z&&q.value&&Ei.size){n1();for(const H of[80,240,640]){const K=Hk(H,()=>{for(const[G,oe]of Ei)oe&&Kd(G,oe)},"final");K!=null&&Od.push(K)}}})(),Ln(M?"final":"content")}),Ke([()=>ot.value.length,()=>Vn.value],()=>{je.value&&Ca(),Ln("content")},{flush:"post",immediate:!0}),Ke([()=>Es.start,()=>Es.end],()=>{Ln("batch")},{flush:"post"});const{cleanupBatchScheduler:a8}=(function(M){const{props:H,isClient:K,isTestEnv:G,parsedNodesIdentity:oe,parsedNodeCount:be,desiredRenderedCount:Me,datasetKey:Ne,batchingEnabled:He,incrementalRenderingActive:Fe,resolvedBatchSize:Ue,resolvedInitialBatch:We,renderedCount:Re,adaptiveBatchSize:ze,previousRenderContext:Je,previousBatchConfig:et,requestFrame:St,cancelFrame:ct,hasIdleCallback:dt,cleanupNodeVisibility:At,onDatasetKeyChanged:Ct,onDatasetChanged:Jt}=M;let Tt=null,Ht=null,Pt=!1,cn=null,Io=null,Gs=0,pi=!1,Ir=!1;const $r=new Set,Ll=new Set;function B2(){if(K){Tt!=null&&(ct?.(Tt),Tt=null),Ht!=null&&(window.clearTimeout(Ht),Ht=null),Io!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Io),Io=null),Gs+=1;for(const Ds of $r)ct?.(Ds);$r.clear();for(const Ds of Ll)window.clearTimeout(Ds);Ll.clear(),Pt=!1,cn=null,pi=!1,Ir=!1}}function ef(){return typeof performance<"u"?performance.now():Date.now()}function D2(Ds){(function(Gi){var Lr;if(!Fe.value)return;const Yi=Math.max(2,(Lr=H.renderBatchBudgetMs)!=null?Lr:6),Zi=Math.max(1,Ue.value||1),mi=Math.max(1,Math.floor(Zi/4));Gi>1.2*Yi?ze.value=Math.max(mi,Math.floor(.7*ze.value)):Gi<.5*Yi&&ze.value<Zi&&(ze.value=Math.min(Zi,Math.ceil(1.2*ze.value)))})(Ds),pi=!1;const uo=Ir||Re.value<Me.value;Ir=!1,uo&&W2()}function P2(Ds,uo={}){var Gi,Lr;if(!Fe.value)return;const Yi=Me.value;if(Re.value>=Yi)return;const Zi=Math.max(1,Ds),mi=()=>{const Ia=ef();let $a=0;Tt=null,Ht=null,Io=null,Pt=!1;const La=cn??Zi;cn=null;const u1=ef();Re.value=Math.min(Yi,Re.value+La),At(Re.value),$a=ef()-u1,(function(d1,z2){if(!K)return void D2(z2);pi=!0;const U2=++Gs;pt().then(()=>{var j2;if(U2!==Gs)return;const E8=ef(),T8=Math.max(z2,E8-d1),q2=()=>{U2===Gs&&D2(T8)};if(St){let K2=!1,Qi=null;const G2=()=>{K2||(K2=!0,q2())},tf=St(()=>{$r.delete(tf),Qi!=null&&(window.clearTimeout(Qi),Ll.delete(Qi),Qi=null),G2()});return $r.add(tf),Qi=window.setTimeout(()=>{Qi!=null&&Ll.delete(Qi),Qi=null,ct?.(tf),$r.delete(tf),G2()},Math.max(32,(j2=H.renderBatchIdleTimeoutMs)!=null?j2:120)),void Ll.add(Qi)}const V2=window.setTimeout(()=>{Ll.delete(V2),q2()},0);Ll.add(V2)})})(Ia,$a)};if(!K||uo.immediate)return void mi();const Fr=Math.max(0,(Gi=H.renderBatchDelay)!=null?Gi:16);if(cn=cn!=null?Math.max(cn,Zi):Zi,!Pt){if(Pt=!0,!G&&dt&&window.requestIdleCallback){const Ia=Math.max(0,(Lr=H.renderBatchIdleTimeoutMs)!=null?Lr:120);return void(Io=window.requestIdleCallback(()=>mi(),{timeout:Ia}))}St&&!G?Tt=St(()=>{Fr!==0?Ht=window.setTimeout(()=>mi(),Fr):mi()}):Ht=window.setTimeout(()=>mi(),Fr)}}function H2(Ds,uo={}){pi?Ir=!0:Ds==null?W2():P2(Ds,uo)}function W2(){Fe.value&&P2(He.value?Math.max(1,Math.round(ze.value)):Math.max(1,Ue.value))}return Ke([oe,be,Ne,Fe,Ue,We,()=>H.renderBatchDelay],()=>{var Ds;const uo=be.value,Gi=Je.value,Lr=Ne.value,Yi=!Object.is(Lr,Gi.key),Zi=uo!==Gi.total,mi=Yi||Zi;Je.value={key:Lr,total:uo};const Fr=et.value,Ia=(Ds=H.renderBatchDelay)!=null?Ds:16,$a=Fr.batchSize!==Ue.value||Fr.initial!==We.value||Fr.delay!==Ia||Fr.enabled!==Fe.value;et.value={batchSize:Ue.value,initial:We.value,delay:Ia,enabled:Fe.value},Yi&&Ct(uo),(mi||$a||!Fe.value)&&B2(),(mi||$a)&&(ze.value=Math.max(1,Ue.value||1)),mi&&Jt();const La=Me.value;if(!uo)return Re.value=0,void At(0);if(!Fe.value)return Re.value=La,void At(Re.value);const u1=Yi||Gi.total===0;Re.value=u1||$a?Math.min(La,We.value):Math.min(Re.value,La);const d1=Math.max(1,We.value||Ue.value||uo);Re.value<La?H2(d1,{immediate:!K}):At(Re.value)},{immediate:!0}),Ke(Me,(Ds,uo)=>{Fe.value&&(typeof uo=="number"&&Ds<=uo||Ds>Re.value&&H2())}),{cleanupBatchScheduler:B2}})({props:x,isClient:Z,isTestEnv:Xn,parsedNodesIdentity:ys,parsedNodeCount:fs,desiredRenderedCount:Rd,datasetKey:e8,batchingEnabled:Mi,incrementalRenderingActive:Ao,resolvedBatchSize:qo,resolvedInitialBatch:Ks,renderedCount:Vn,adaptiveBatchSize:ji,previousRenderContext:Vo,previousBatchConfig:Ko,requestFrame:On,cancelFrame:Hn,hasIdleCallback:hi,cleanupNodeVisibility:GM,onDatasetKeyChanged:M=>{Ea(),Fd(),Yo(),Yc(),M>0&&$d(M)},onDatasetChanged:()=>{Ot.value&&Ni({immediate:!0})}});Ke([Fk,Ot,()=>S.value,()=>ae()],([M,H])=>{if(!M)return Uk(),void bm();YM(),H?Ni({immediate:!0}):bm()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,()=>Ot.value],M=>zn(null,[M],function*([H,K]){K&&H&&Z&&(yield pt(),Ni({immediate:!0}))}),{flush:"post"}),Ke(an,M=>{M&&(function(){var H;if(Xe.value&&Ze.value&&Mt.value&&((H=Dt.value)!=null&&H[1]))return;const K=mt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),G=mt({type:"list_item",children:[K],raw:"- Probe paragraph text"}),oe=mt({type:"list",ordered:!1,items:[G],raw:"- Probe paragraph text"});Xe.value=K,Ze.value=G,Mt.value=oe;const be={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)be[Me]=mt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});Dt.value=be})()},{immediate:!0}),Ke([()=>S.value,an],()=>{if(!an.value)return Sm(),void(U.value=0);qk(),Sm(),an.value&&S.value&&typeof ResizeObserver<"u"&&(Pc=new ResizeObserver(()=>{qk(),Ae.value&&Zt(),je.value&&Ca(),Ln("resize")}),Pc.observe(S.value))},{immediate:!0}),Ke([an,co,No],()=>zn(null,null,function*(){if(!an.value)return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Yo();yield pt(),(function(){if(!an.value||typeof window>"u")return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Yo();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=jk(wm(T.value),".paragraph-node");M.paragraph=k0(T.value,H,"pre-wrap");const K=wm(R.value),G=K?.querySelector(".paragraph-node");M.listItem=k0(R.value,G,"pre-wrap");const oe=yt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Ne;return(Ne=(Me=O.value)==null?void 0:Me.offsetHeight)!=null?Ne:0}),be=yt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Ne;return(Ne=(Me=R.value)==null?void 0:Me.offsetHeight)!=null?Ne:0});M.listWrapperOverhead=Math.max(0,oe-be);for(let Me=1;Me<=6;Me++){const Ne=jk(wm(D[Me]),`h${Me}`);M.headings[Me]=k0(D[Me],Ne,"pre-wrap")}re.value=M,Yo()})()}),{flush:"post",immediate:!0}),Ke(()=>ot.value.length,()=>{Ot.value&&Ni({immediate:!0})}),Ke([an,U],()=>{Yo(),Ot.value&&Ni({immediate:!0}),Ae.value&&Zt(),je.value&&Ca(),Ln("resize")},{immediate:!1}),Ke(()=>Ar.value,M=>{if(M)for(const[H,K]of Bn)y2(H,K);else{_m();for(const[H,K]of Bn)K&&Tr(H,!0)}},{immediate:!1}),Ke([()=>x.viewportPriority,()=>ot.value.length],([M,H])=>{M!==!1?W.value&&H<=200&&(W.value=!1):W.value=!1}),Ke(()=>Vn.value,()=>{Ot.value&&Ni({immediate:!0})}),Ke([Go,jo,Dc,()=>ot.value.length,Ot],()=>{wl()},{immediate:!0});let Qc=null,Xc=!1,Ta=null;function Jc(){Qc=null,Lm=null,$m=void 0,_a=null,Yc()}function s1(){Ea(),Fd(),Yo(),Le.clear();const M=ot.value.length;M>0&&$d(M),jm()}function o1(){Xm(),Wk(),Vc=null,El=null,Tl=null,qd=null,Uc=null,jc=null,Xc=!1,Jc(),e2("restore"),Nt(),Sa()}function eu(M){var H;return[(H=ps())!=null?H:"",Dn(),Vi(),zd.value,Gc(M),ot.value.length,Math.round(Nr(0,ot.value.length)),Math.round(Al()),vn.count,Math.round(vn.total)].join(":")}function b2(){return zn(this,null,function*(){var M,H,K,G;const oe=(M=s.virtualScroll)==null?void 0:M.settledToken,be=Gc(oe),Me=Dn(),Ne=ps(),He=No.value;if(Lt.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&Ud(oe))if(Fm()){if(eu(oe)!==_a&&!Xc){Xc=!0;try{const Fe=yield Vm({reason:"manual",expectedSettledTokenKey:be}),Ue=Gc()===be;qm(Me,Ne,He)&&Fe.sessionKey===Me&&Fe.threadKey===Ne&&Ue&&Fe.stable&&Fe.phase==="final"&&(_a=eu((K=s.virtualScroll)==null?void 0:K.settledToken))}finally{Xc=!1,yield pt();const Fe=(G=s.virtualScroll)==null?void 0:G.settledToken,Ue=Ud(Fe)?eu(Fe):"";qm(Me,Ne,He)&&Ue&&_a!==Ue&&b2()}}}else Ln("manual")})}Ke(Lt,(M,H)=>{if(M!==H){if(!M)return o1(),void Xm();o1(),s1(),Ta=No.value,Ln("content")}},{flush:"post"}),Ke([Lt,No],([M,H])=>{M?Ta!=null?Ta!==H&&(Ta=H,(function(K="resize"){Ea(),Fd(),Yo(),Le.clear();const G=ot.value.length;G>0&&$d(G),jm(),El=null,Tl=null,qd=null,Vc=null,Xc=!1,Jc(),d2(),pt(()=>{Ki(),Ae.value&&Zt(),je.value&&Ca(),Ln(K)})})("resize")):Ta=H:Ta=null},{flush:"post",immediate:!0}),Ke([Lt,()=>Dn(),()=>ps()],([M])=>{M&&(o1(),s1(),e2("content"),Ln("content"))}),Ke([Lt,()=>Dn(),()=>ps(),No,()=>ot.value.length],([M])=>{M&&(function(H="async-node"){let K=!1;for(const[G,oe]of Array.from(Ti.entries()))Nm(oe)||(Ti.delete(G),Eo.delete(G),K=!0);K&&(ba(),Ln(H))})("async-node")},{flush:"post"}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>s.indexKey,()=>V.value],([M])=>{M&&(Yc(),(function(H="content"){if(!Lt.value)return;const K=[],G=ot.value.length;for(const oe of Array.from(Le.keys())){if(oe>=G){K.push(oe);continue}const be=zc(oe),Me=Le.get(oe);Me!=null&&Me!==be&&K.push(oe),Le.set(oe,be)}for(const oe of Array.from(Le.keys()))oe>=G&&Le.delete(oe);K.length&&((function(oe,be={}){const Me=Array.from(oe,Number);jM(Me,be)>0&&(function(He){for(const Fe of He)Le.delete(Fe)})(Me)})(K,{notify:!1}),Yo(),Jc(),Ae.value&&Zt(),je.value&&Ca(),Ln(H))})("content"))},{flush:"post",immediate:!0}),Ke([Lt,()=>ot.value.length,()=>Dn(),()=>ps()],([M,H,K,G],[oe,be,Me,Ne])=>{M&&oe&&K===Me&&G===Ne&&H!==be&&Jc()},{flush:"post"}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>ot.value.length,()=>Dn(),U],()=>{d2()},{flush:"post",immediate:!0}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>ot.value.length,()=>Dn(),U],M=>zn(null,[M],function*([H,K]){if(!H||!K)return;yield pt();const G=(function(){var oe;const be=(oe=s.virtualScroll)==null?void 0:oe.restoreAnchor;return be==null||be===!1?null:be===!0?"true":String(be)})();Um(K,{restoreAnchor:G!=null,restoreToken:G??void 0})}),{flush:"post",immediate:!0}),Ke([Lt,U,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var H;if(!M)return;const K=(H=s.virtualScroll)==null?void 0:H.restoreState;K&&El&&Tl==="restore"&&(c2(K)||(s1(),El=null,Tl=null,Ln("resize")))},{flush:"post"}),Ke([Lt,()=>ot.value.length,()=>Dn(),U],M=>zn(null,[M],function*([H]){var K;const G=Uc,oe=jc;H&&G&&(yield pt(),!Um(G,{restoreAnchor:oe?.restoreAnchor===!0,restoreToken:(K=oe?.restoreToken)!=null?K:"imperative",allowUncapturedAnchor:oe?.allowUncapturedAnchor===!0})&&f2(G)||(Uc=null,jc=null))}),{flush:"post",immediate:!0}),Ke([Lt,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>Dn(),()=>ps(),No,ym,Rk,()=>Vn.value,Rd,()=>vn.count,()=>vn.total],([M,H,K])=>{if(!M||H!==!0||K==="manual"||!Om())return;const G=(function(){var oe;const be=ot.value.length;return[(oe=ps())!=null?oe:"",Dn(),Vi(),zd.value,be,Math.round(Nr(0,be)),Math.round(Al()),vn.count,Math.round(vn.total)].join(":")})();Qc!==G&&(Qc=G,Vm({reason:"final"}).then(oe=>{oe.stable||Qc!==G||(Qc=null)}))},{flush:"post",immediate:!0}),Ke([Lt,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settledToken},()=>Dn(),()=>ps(),No,ym,Rk,()=>Vn.value,Rd,()=>ot.value.length,()=>vn.count,()=>vn.total],()=>{b2()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,Ot,jo,Dc,()=>Es.start,()=>Es.end],([M,H,K,G,oe,be])=>{ke.value&&$e("virtualization",{nodes:M,virtualization:H,maxLiveNodes:K,buffer:G,focusIndex:Go.value,scroll:H?(()=>{const Me=me.value||fe();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:be},rendered:Vn.value})}),Ke([()=>x.customId],([M],H,K)=>{if(!M||zt)return;const G=(function(oe,be){return oe?(ms.controllers[oe]=be,()=>{ms.controllers[oe]===be&&delete ms.controllers[oe]}):()=>{}})(M,{captureRestoreAnchor:Qt,restoreAnchor:As,getAnchorDrift:Cr,getReport:QM});K(()=>{G()})},{immediate:!0}),es(()=>{(function(){if(Lt.value)try{Ki(),qc();const M=Ml("manual");p2(M)&&(E(M),Vc=M,Gm=Kc());const H=wa(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(N(H),H.anchor&&F(H.anchor),Aa=Zc(H))}catch{}})(),a8(),_m(),Oe(),k2();for(const M of Mr.values())for(const H of M)Dd(H);Mr.clear(),Sl.clear(),Le.clear(),n1(),Ea(),Sm(),Nt(),Sa(),Xm(),Uk(),bm()});const c8=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index11-m1oYWviR.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),$o}}),loadingComponent:nte,delay:0}),u8=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index10-UVo4gjYR.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),$o}}),loadingComponent:tte,delay:0}),d8=ki(()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index7-BUH5Peml.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),$o}})),x2={text:Zn,paragraph:na,heading:ep,code_block:d0,list:bc,list_item:kc,blockquote:Qf,table:Hu,definition_list:Xf,footnote:Jf,footnote_reference:Po,footnote_anchor:Du,admonition:sh,vmr_container:th,hardbreak:rl,link:ro,image:il,thematic_break:eh,math_inline:Ci,math_block:g5,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,checkbox:Do,checkbox_input:Do,inline_code:qs,html_inline:Ho,reference:so,html_block:Pu},f8=P(()=>Em()),_2=P(()=>ES(x.codeBlockProps)),h8=P(()=>ES(x.codeBlockProps,{omit:["langs"]})),w2=P(()=>it(it({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,monacoOptions:x.codeBlockMonacoOptions,themes:x.themes,langs:u.value==="shiki"?x.langs:void 0,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),h8.value)),S2=P(()=>it(Bt(it({},w2.value),{langs:x.langs}),_2.value));function C2(M){return typeof M=="boolean"?M:void 0}const p8=P(()=>{const M=x.codeBlockProps||{},H={},K=C2(M.showLineNumbers);K!==void 0&&(H.showLineNumbers=K);const G=C2(M.diffInline);G!==void 0&&(H.diffInline=G);const oe=(function(be){const Me=Number(be);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return oe!==void 0&&(H.reservedHeightPx=oe),H}),m8=P(()=>it(it({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),_2.value)),g8=P(()=>it({},x.mermaidProps||{})),A2=P(()=>it({},x.d2Props||{})),v8=P(()=>it({},x.infographicProps||{})),tu=P(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:gn.value.customHtmlTags})),y8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltip:Se.value}:{})),k8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),b8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),x8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{}));function _8(M){return Array.isArray(M.children)&&M.children.length>0}const i1=P(()=>ZM.value.map(M=>{var H,K,G,oe,be,Me,Ne,He;let Fe=(function(ct){var dt,At,Ct,Jt,Tt,Ht,Pt;if(ct.type!=="code_block")return ct;const cn=ct,Io=[String((dt=cn.language)!=null?dt:""),String((At=cn.loading)!=null?At:""),String((Ct=cn.diff)!=null?Ct:""),String((Jt=cn.code)!=null?Jt:""),String((Tt=cn.originalCode)!=null?Tt:""),String((Ht=cn.updatedCode)!=null?Ht:""),String((Pt=cn.raw)!=null?Pt:"")].join("\0"),Gs=xe.get(cn);if(Gs&&Gs.signature===Io)return Gs.node;const pi=it({},cn);return xe.set(cn,{signature:Io,node:pi}),pi})(M.node);const Ue=Gd(Fe);let We=N2(Fe,Ue);if((Fe.type==="html_block"||Fe.type==="html_inline")&&We===x2[Fe.type]){const ct=Fe,dt=String((H=ct.tag)!=null?H:"").trim().toLowerCase()||r6(ct.content);if(dt){const At=Wt.value[dt];if(_n.value.has(dt)&&At)We=At,Fe=Bt(it({},ct),{type:dt,tag:dt,content:yK(ct.content,dt)});else if(l6((K=ct.content)!=null?K:ct.raw,dt)){const Ct=String((oe=(G=ct.content)!=null?G:ct.raw)!=null?oe:"");Fe.type==="html_inline"?(We=Zn,Fe={type:"text",content:Ct,raw:Ct}):(We=na,Fe={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const Re=Fe.type==="code_block"&&u.value==="pre"&&We===$o&&!r1(Wt.value,Ue);let ze=it({},(function(ct,dt,At){const Ct=dt??Gd(ct);if(ct.type==="code_block"){const Jt=Ct?r1(Wt.value,Ct):void 0;if(At&&u.value==="pre"&&!Jt&&At===$o)return p8.value;if(At&&Ct&&At===Jt)return Ct==="mermaid"?E2(ct):Ct==="infographic"?T2(ct):Ct==="d2"||Ct==="d2lang"?A2.value:S2.value;if(At&&At===Wt.value.code_block)return S2.value;if(Kk(At))return m8.value}return Ct==="mermaid"?E2(ct):Ct==="infographic"?T2(ct):Ct==="d2"||Ct==="d2lang"?A2.value:ct.type==="link"?y8.value:ct.type==="list"?k8.value:ct.type==="blockquote"?b8.value:ct.type==="table"?x8.value:ct.type==="code_block"?w2.value:tu.value})(Fe,Ue,We));const Je=Cl.value[M.index];Fe.type==="code_block"&&Je?.kind==="code-block"&&(ze=Bt(it({},ze),Re?{reservedHeightPx:(be=Je.height)!=null?be:Je.contentHeight}:{estimatedHeightPx:Je.height,estimatedContentHeightPx:Je.contentHeight})),Re||Fe.type!=="code_block"||Ue!=="mermaid"||oc(ze.estimatedPreviewHeightPx)!=null||(ze=Bt(it({},ze),{estimatedPreviewHeightPx:qg(Ug(String((Me=Fe.code)!=null?Me:"")))})),Re||Fe.type!=="code_block"||Ue!=="infographic"||oc(ze.estimatedPreviewHeightPx)!=null||(ze=Bt(it({},ze),{estimatedPreviewHeightPx:Vg(jg(String((Ne=Fe.code)!=null?Ne:"")))})),Fe.type==="math_block"&&(ze=Bt(it({},ze),{cacheScope:ns.value}));const et=(function(ct,dt){const At=String(ct.type);return!Td(At)&&Wt.value[At]===dt})(Fe,We),St=et?jy(Fe,Ye.value):void 0;return Bt(it({},M),{node:Fe,component:We,bindings:ze,customBindings:it(it({},St??{}),ze),rendersCustomNode:et,hasSlotChildren:_8(Fe),slotContent:String((He=Fe.content)!=null?He:""),isCodeBlock:Fe.type==="code_block",indexKey:`${f8.value}-${M.index}`})}));function Gd(M){var H;return M?.type==="code_block"?String((H=M.language)!=null?H:"").trim().toLowerCase():""}function r1(M,H){const K=H.trim().toLowerCase();if(K)for(const G of[K,By(K),t5(K)]){const oe=G&&M[G];if(oe)return oe}}function M2(M,H,K,G){var oe,be;const Me=it({},M.value);return oc(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=G(K(String((oe=H?.code)!=null?oe:"")),void 0,Me.maxHeight==="none"?null:(be=oc(Me.maxHeight))!=null?be:void 0)),Me}function E2(M){return M2(g8,M,Ug,qg)}function T2(M){return M2(v8,M,jg,Vg)}function N2(M,H){if(!M)return nv;const K=Wt.value,G=K[String(M.type)];if(M.type==="code_block"){const oe=H??Gd(M),be=oe?r1(K,oe):void 0;return be||(u.value==="pre"?K.code_block||$o:oe==="mermaid"?K.mermaid||c8:oe==="infographic"?K.infographic||u8:oe==="d2"||oe==="d2lang"?K.d2||d8:G||K.code_block||Gk.value)}return G||x2[String(M.type)]||nv}function l1(M){o("click",M)}function w8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",M)}function S8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",M)}function I2(M){o("mouseover",M)}function $2(M){o("mouseout",M)}const $l=Q(null),Ii=Q(!1);let nu,Na=null,a1=0,Yd=0,Zd=0;const L2=["code_block","admonition","table","math_block","html_block","image","thematic_break"],C8=new Set(L2),F2=[".typewriter-cursor",".height-estimation-probes",...L2.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function O2(M){if(!M||typeof M!="object")return!1;const H=M.type;return typeof H=="string"&&C8.has(H)}function Qd(M){var H,K;if(!M||typeof M!="object")return 0;const G=M,oe=(K=(H=G.raw)!=null?H:G.content)!=null?K:G.code;if(typeof oe=="string")return oe.length;const be=G.children;if(Array.isArray(be))return be.reduce((Ne,He)=>Ne+Qd(He),0);const Me=G.items;return Array.isArray(Me)?Me.reduce((Ne,He)=>Ne+Qd(He),0):0}function Xd(){nu&&(clearTimeout(nu),nu=void 0)}function R2(){a1+=1,Na!=null&&(Hn?.(Na),Na=null)}function Jd(){R2(),$l.value&&($l.value.style.visibility="hidden")}function A8(M){var H;if(M.nodeType!==Node.TEXT_NODE||!((H=M.textContent)!=null?H:"").trim())return!1;const K=M.parentElement;return!!K&&!K.closest(F2)}function M8(M){let H=M.lastChild;for(;H;){if(A8(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const K=H;if(!K.matches(F2)&&K.lastChild){H=K.lastChild;continue}}for(;H&&H!==M&&!H.previousSibling;)H=H.parentNode;if(!H||H===M)break;H=H.previousSibling}return null}function c1(){if(!Z||!Ii.value||Na!=null)return;const M=a1,H=()=>{Na=null,M===a1&&(function(){var K,G;if(!(Z&&Ii.value&&S.value&&$l.value))return;const oe=S.value,be=$l.value;be.style.visibility="hidden";const Me=(function(){const We=i1.value;for(let Re=We.length-1;Re>=0;Re--){const ze=We[Re];if(!ze||O2(ze.node)||!e1(ze.index))continue;const Je=Bn.get(ze.index);if(!Je)continue;const et=M8(Je);if(et)return et}return null})();if(!Me)return;let Ne=0,He=0,Fe=20,Ue=!1;if(Me?.textContent){const We=Me.textContent.length,Re=document.createRange();Re.setStart(Me,Math.max(0,We-1)),Re.setEnd(Me,We);const ze=typeof Re.getClientRects=="function"?Re.getClientRects():void 0,Je=(G=ze?.[ze.length-1])!=null?G:(K=Me.parentElement)==null?void 0:K.getBoundingClientRect();if(Je){const et=yt("typewriterCursor.root.getBoundingClientRect",()=>oe.getBoundingClientRect());Ne=Je.right-et.left+oe.scrollLeft,He=Je.top-et.top+oe.scrollTop,Fe=Je.height||Fe,Ue=!0}Re.detach()}Ue&&(be.style.transform=`translate(${Math.max(0,Ne)}px, ${Math.max(0,He)}px)`,be.style.height=`${Fe}px`,be.style.visibility="visible")})()};On?Na=On(H):H()}return Ke([pe,()=>s.content,()=>s.nodes,()=>x.typewriter,q],()=>zn(null,null,function*(){var M,H;if(!Z||ne.value||!Y.value)return;if(q.value)return Ii.value=!1,Xd(),void Jd();if((M=s.nodes)!=null&&M.length)return Ii.value=!1,Xd(),Jd(),Yd=((H=s.content)!=null?H:"").length,void(Zd=pe.value.length);const K=(function(){var Ne,He;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((Fe,Ue)=>Fe+Qd(Ue),0):((He=s.content)!=null?He:"").length})(),G=(function(){var Ne;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((He,Fe)=>He+Qd(Fe),0):pe.value.length})(),oe=!O2(ot.value[ot.value.length-1]),be=K>Yd,Me=G>Zd;if(x.typewriter===!1||!oe||!be&&!Me)return x.typewriter!==!1&&oe||(Ii.value=!1,Jd()),Yd=K,void(Zd=G);Yd=K,Zd=G,Ii.value=!0,$l.value&&($l.value.style.visibility="hidden"),Xd(),yield pt(),c1(),nu=setTimeout(()=>{nu=void 0,Ii.value=!1},3e3)}),{flush:"post",immediate:!0}),Ke(Ii,M=>zn(null,null,function*(){M?(yield pt(),c1()):Jd()}),{flush:"post"}),Ke([()=>Vn.value,()=>Es.start,()=>Es.end],()=>zn(null,null,function*(){Z&&!ne.value&&Y.value&&Ii.value&&(yield pt(),c1())}),{flush:"post"}),es(()=>{Xd(),R2(),xn.clear()}),(M,H)=>{const K=eT("NodeRenderer",!0);return C(ne)?(b(!0),I(Be,{key:0},nt(i1.value,G=>(b(),I(Be,{key:G.index},[G.rendersCustomNode?(b(),ye($s(G.component),pn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:l1,onMouseover:I2,onMouseout:$2,onCopy:H[0]||(H[0]=oe=>o("copy",oe)),onHandleArtifactClick:H[1]||(H[1]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:l1,onMouseover:I2,onMouseout:$2,onCopy:H[2]||(H[2]=oe=>o("copy",oe)),onHandleArtifactClick:H[3]||(H[3]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),I("div",{key:1,ref_key:"containerRef",ref:S,class:De(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:Ot.value},{"virtual-scroll-coordinated":Vs.value}]]),"data-custom-id":x.customId,onClick:l1,onMouseover:w8,onMouseout:S8},[So.value||Ot.value?(b(),I(Be,{key:0},[So.value?(b(),I("div",{key:0,class:"height-estimation-probes",style:qt({width:`${co.value}px`}),"aria-hidden":"true"},[w("div",{ref_key:"paragraphProbeWrapperRef",ref:T,class:"node-content","data-probe":"paragraph"},[ie(C(na),{node:Xe.value,"index-key":"probe-paragraph"},null,8,["node"])],512),w("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[w("ul",ote,[ie(C(kc),{node:Ze.value,"index-key":"probe-list-item"},null,8,["node"])])],512),w("div",{ref_key:"listProbeWrapperRef",ref:O,class:"node-content","data-probe":"list"},[ie(C(bc),{node:Mt.value,"index-key":"probe-list"},null,8,["node"])],512),(b(),I(Be,null,nt(6,G=>w("div",{key:`probe-heading-${G}`,ref_for:!0,ref:oe=>(function(be,Me){be<1||be>6||(D[be]=Me)})(G,oe),class:"node-content","data-probe":`heading-${G}`},[ie(C(ep),{node:KM(G),"index-key":`probe-heading-${G}`},null,8,["node","index-key"])],8,ite)),64))],4)):le("",!0),Ot.value?(b(),I("div",{key:1,class:"node-spacer",style:qt({height:`${Am.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],64)):le("",!0),(b(!0),I(Be,null,nt(i1.value,G=>(b(),I("div",{key:G.index,ref_for:!0,ref:oe=>y2(G.index,oe),class:"node-slot","data-node-index":G.index,"data-node-type":G.node.type},[e1(G.index)?(b(),I("div",{key:0,ref_for:!0,ref:oe=>(function(be,Me){var Ne;Me||(function(We){const Re=`${Em()}-${We}`;let ze=!1;for(const Je of Array.from(Eo.keys())){const et=Ti.get(Je);(et?.index===We||Je===Re||Je.startsWith(`${Re}-`))&&(Eo.delete(Je),Ti.delete(Je),ze=!0)}ze&&(ba(),Ln("async-node"))})(be),qi.delete(be),(function(We){var Re;const ze=((Re=Sl.get(We))!=null?Re:0)+1;Sl.set(We,ze)})(be);const He=Mr.get(be);if(He){for(const We of He)Dd(We);Mr.delete(be)}if((function(We){const Re=Kn.get(We);Re&&(rt?.unobserve(Re),Mo.delete(Re),Kn.delete(We))})(be),!Me||!Bs.value)return Ei.delete(be),void Sl.delete(be);Ei.set(be,Me);const Fe=()=>{Kd(be,Me)};queueMicrotask(Fe);const Ue=(rt||typeof ResizeObserver>"u"||(rt=new ResizeObserver(We=>{if(We.length)for(const Re of We){const ze=Mo.get(Re.target),Je=Kn.get(ze??-1);ze!=null&&Je&&Kd(ze,Je)}else Ki()})),rt);if(Ue&&(Kn.set(be,Me),Mo.set(Me,be),Ue.observe(Me)),typeof window<"u"){const We=((Ne=ot.value[be])==null?void 0:Ne.type)==="code_block"?[16,80,240,800]:q.value?[80]:[];if(We.length){const Re=We.map(ze=>Hk(ze,Fe,"node-resize")).filter(ze=>ze!=null);Re.length&&Mr.set(be,Re)}}})(G.index,oe),class:"node-content"},[G.isCodeBlock?G.rendersCustomNode?(b(),ye($s(G.component),pn({key:1,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[8]||(H[8]=oe=>o("copy",oe)),onHandleArtifactClick:H[9]||(H[9]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:2,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[10]||(H[10]=oe=>o("copy",oe)),onHandleArtifactClick:H[11]||(H[11]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),ye(cl,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[G.rendersCustomNode?(b(),ye($s(G.component),pn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[4]||(H[4]=oe=>o("copy",oe)),onHandleArtifactClick:H[5]||(H[5]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[6]||(H[6]=oe=>o("copy",oe)),onHandleArtifactClick:H[7]||(H[7]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),I("div",{key:1,class:"node-placeholder",style:qt({height:`${Wd(G.index)}px`})},null,4))],8,rte))),128)),Ii.value?(b(),I("span",{key:1,ref_key:"typewriterCursorRef",ref:$l,class:"typewriter-cursor","aria-hidden":"true"},null,512)):le("",!0),Ot.value?(b(),I("div",{key:2,class:"node-spacer",style:qt({height:`${Mm.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],42,ste))}}})),[["__scopeId","data-v-2e8e6e17"]]),_o=T5;_o.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",_o.__name,_o.name].filter(n=>!!n));for(const n of t)e.component(n,T5)};const Qy=Object.freeze(Object.defineProperty({__proto__:null,default:_o},Symbol.toStringTag,{value:"Module"})),lte={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"},ate={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"},cte={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"},ute={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"},dte={class:"admonition-title"},fte=["aria-expanded","aria-controls"],hte=["id"],sh=hn(qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=P(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Q(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(b(),I("div",{class:De(["admonition",[`admonition-${s.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(b(),I("svg",lte,[...u[1]||(u[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(b(),I("svg",ate,[...u[2]||(u[2]=[w("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),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(b(),I("svg",cte,[...u[3]||(u[3]=[w("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),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(b(),I("svg",ute,[...u[4]||(u[4]=[w("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),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):le("",!0),w("span",dte,B(i.value),1),s.node.collapsible?(b(),I("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),I("svg",{style:qt({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]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,fte)):le("",!0)]),Tn(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(_o),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,hte),[[oi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);sh.install=e=>{e.component(sh.__name,sh)};const N5=()=>eo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let $f=null,pte=N5;function dxe(){return zn(this,null,function*(){if($f)return $f;const e=pte;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===N5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?($f=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),$f):null})}function fxe(){return!1}function hxe(){return zn(this,null,function*(){return null})}const Lf=Q(!1);let PS=!1;function x0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function mte(){return!PS&&typeof window<"u"&&typeof document<"u"&&(PS=!0,Lf.value=x0(),new MutationObserver(()=>{Lf.value=x0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Lf.value=x0()})),Lf}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"],gte=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),lv=[...I5].sort((e,t)=>t.length-e.length).join("|"),_0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${lv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${lv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),$5=/[),.;!?,。;!?)]+$/;function vte(e){const t=e.toLowerCase();return I5.some(n=>t.endsWith(`.${n}`))}function yte(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${lv}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function kte(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace($5,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=gte.has(i),a=vte(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function bte(e,t={}){const n=[];_0.lastIndex=0;let s;for(;(s=_0.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace($5,""),u=a.length-c.length;a=c;const d=kte(a,t);if(!d)continue;const f=s.index+r,p=f+a.length;n.push({...d,start:f,end:p,text:a}),u>0&&(_0.lastIndex-=u)}return n}const xte=12e4,_te=6e4,wte=32,Ste=3e4,HS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Cte(e){let t=0,n=0,s=0;HS.lastIndex=0;let o;for(;(o=HS.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=xte||n>=_te||t>=wte||s>=Ste?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Ate(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Mte(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Ete={key:1,class:"diff-wrap"},Tte={class:"diff-bar"},Nte=["aria-label","onClick"],Ite={class:"diff-pre"},$te={key:0,class:"diff-sign"},Lte={class:"diff-text"},Fte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",WS="github-light",zS="github-dark",Ote=qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){uX(),wX(),fX(),EX(),dX(new Ate),MX(new Mte);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Et(),s=Ut("resolveImage"),o=Q(null),i=e,r=P(()=>!i.streaming),l=P(()=>yte(i.text??"")),a=P(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Cte(i.text??"")),c=mte(),u=P(()=>!i.streaming),d=Ss(new Map),f=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function _(R){if(!s)return;const O=[];for(const D of[p,h]){D.lastIndex=0;let W;for(;(W=D.exec(R))!==null;)O.push(W[2]??"")}for(const D of O)!D||!m(D)||d.has(D)||f.has(D)||(f.add(D),s(D).then(W=>{d.set(D,W!==D?W:"")}).catch(()=>{d.set(D,"")}).finally(()=>{f.delete(D)}))}function k(R){if(!s)return R;const O=D=>{if(!m(D))return null;const W=d.get(D);return W===void 0?Fte:W===""?null:W};return R.replace(p,(D,W,z,V)=>{const U=O(z);return U===null?D:`${W}${U}${V}`}).replace(h,(D,W,z,V)=>{const U=O(z);return U===null?D:`${W}${U}${V}`})}Ke(()=>i.text,R=>_(R??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),O=[];let D=R.nextNode();for(;D;){const W=D,z=W.parentElement;z&&!z.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&O.push(W),D=R.nextNode()}for(const W of O){const z=bte(W.data,{aliases:l.value});if(z.length===0||!W.parentNode)continue;const V=document.createDocumentFragment();let U=0;for(const re of z){re.start>U&&V.append(document.createTextNode(W.data.slice(U,re.start)));const ae=document.createElement("button");ae.type="button",ae.className="md-file-link",ae.textContent=re.text,ae.title=re.line?`${re.path}:${re.line}`:re.path,ae.addEventListener("click",te=>{te.preventDefault(),te.stopPropagation(),i.openFile?.({path:re.path,line:re.line})}),V.append(ae),U=re.end}U<W.data.length&&V.append(document.createTextNode(W.data.slice(U))),W.parentNode.replaceChild(V,W)}}function v(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(R){let O=R.length;for(const D of["#","?"]){const W=R.indexOf(D);W!==-1&&W<O&&(O=W)}return R.slice(0,O)}function A(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const O of R){if(O.dataset.mdLinkHandled==="true"||O.closest("svg"))continue;const D=O.getAttribute("href")??"";v(D)&&(O.dataset.mdLinkHandled="true",O.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),i.openFile?.({path:y(D)})}))}}function L(){pt().then(()=>{g(),A()})}Ke(()=>i.text,L),Ke(()=>i.streaming,L);let $=null;ln(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),fn(()=>{$?.disconnect()});const x={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=P(()=>{const R=k(i.text??""),O=[];let D=0;E.lastIndex=0;let W;for(;(W=E.exec(R))!==null;){const V=W[1]??"",U=R.slice(D,W.index)+(V||"");U.trim()&&O.push({kind:"md",text:U}),O.push({kind:"diff",code:W[2]??""}),D=E.lastIndex}const z=R.slice(D);return(z.trim()||O.length===0)&&O.push({kind:"md",text:z}),O});function F(R){return R.split(`
|
|
284
|
+
`).map(O=>O.startsWith("@@")?{type:"hunk",sign:"",text:O}:/^\+(?!\+\+)/.test(O)?{type:"add",sign:"+",text:O.slice(1)}:/^-(?!--)/.test(O)?{type:"del",sign:"-",text:O.slice(1)}:O.startsWith(" ")?{type:"ctx",sign:"",text:O.slice(1)}:{type:"ctx",sign:"",text:O})}const S=Q(null);function T(R,O){js(R).then(D=>{D&&(S.value=O,setTimeout(()=>{S.value=null},1400))})}return(R,O)=>(b(),I("div",{ref_key:"mdRef",ref:o,class:"md"},[(b(!0),I(Be,null,nt(N.value,(D,W)=>(b(),I(Be,{key:W},[D.kind==="md"?(b(),ye(C(_o),{key:0,content:D.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":WS,"code-block-dark-theme":zS,themes:[WS,zS],"code-block-props":x,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(b(),I("div",Ete,[w("div",Tte,[O[0]||(O[0]=w("span",{class:"diff-lang"},"diff",-1)),ie(jt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:z=>T(D.code,W)},[ie(Ve,{name:S.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,Nte)]),_:2},1032,["text"])]),w("pre",Ite,[w("code",null,[(b(!0),I(Be,null,nt(F(D.code),(z,V)=>(b(),I("span",{key:V,class:De(["diff-line",`diff-${z.type}`])},[z.type!=="hunk"?(b(),I("span",$te,B(z.sign),1)):le("",!0),w("span",Lte,B(z.text),1)],2))),128))])])]))],64))),128))],512))}}),rm=ut(Ote,[["__scopeId","data-v-cb379ba3"]]),Rte={class:"tc-anim"},Bte={class:"prev-anim"},Dte={class:"prev"},Pte=qe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=P(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=P(()=>n.foldable&&o.value.length>1),r=P(()=>n.streaming||!i.value),l=P(()=>o.value.at(-1)??""),a=Q(null);return ln(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ke(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||pt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(b(),I("div",{class:De(["think",{mob:e.mobile}])},[i.value?(b(),I("div",{key:0,class:De(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[w("div",Rte,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513)]),w("div",Bte,[w("span",Dte,B(l.value),1)])],2)):(b(),I("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513))],2))}}),Hte=ut(Pte,[["__scopeId","data-v-fdc551ea"]]),Wte={class:"activity-notice",role:"status"},zte={"aria-hidden":"true"},Ute={class:"an-label"},jte=qe({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(b(),I("div",Wte,[w("span",zte,[ie(wo,{size:"sm"})]),w("span",Ute,B(e.label),1)]))}}),qte=ut(jte,[["__scopeId","data-v-0d497074"]]);function Vte(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const Kte=qe({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Et(),s=Q(!1),o=P(()=>{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=P(()=>s.value?o.value:Vte(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(b(),I("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},B(i.value),1))}}),L5=ut(Kte,[["__scopeId","data-v-9672fbd5"]]);function Gte(e){return e.length===1?`0${e}`:e}function Yte(e,t){return`${String(Number(e))}:${Gte(t)}`}const US=e=>/^\d+$/.test(e);function Zte(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[s,o,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(s==="*"&&o==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(s);if(u&&o==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(s==="0"&&o==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(o);if(s==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(US(s)&&US(o)&&c){const f=Yte(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const Qte=["data-turn-id"],Xte={class:"cn-bubble"},Jte={class:"cn-title"},ene={key:0,class:"cn-prompt"},tne={class:"cn-meta"},nne={key:0,class:"cn-meta-item"},sne={key:1,class:"cn-meta-item"},one=["aria-label"],ine=["title"],rne=qe({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Et(),s=P(()=>t.cron),o=P(()=>s.value?.missedCount!==void 0),i=P(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=P(()=>{const u=s.value?.cron;return u?Zte(u,n):""}),l=P(()=>o.value?"error":"ok"),a=P(()=>{const u=s.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=P(()=>t.text??"");return(u,d)=>(b(),I("div",{class:De(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",Xte,[w("span",Jte,B(i.value),1),c.value?(b(),I("span",ene,B(c.value),1)):le("",!0)]),w("div",tne,[ie(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(b(),I("span",nne,B(r.value),1)):le("",!0),a.value?(b(),I("span",sne,B(a.value),1)):le("",!0),w("span",{class:De(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):(b(),ye(Ve,{key:1,name:"close",size:"sm"}))],10,one),s.value?.jobId?(b(),I("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:s.value.jobId})},B(s.value.jobId),9,ine)):le("",!0),e.createdAt?(b(),ye(L5,{key:3,time:e.createdAt},null,8,["time"])):le("",!0)])],10,Qte))}}),lne=ut(rne,[["__scopeId","data-v-a62a6587"]]);function F5(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 av(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function ane(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function vi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:av(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:F5(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 Wu(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 jS(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 Xy(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:jS(e.source)};case"video":return{type:"video",source:jS(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 cv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Xy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function cne(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 une(e){return{content:e.content.map(cne),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 dne(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function O5(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 fne(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function hne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(fne),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function R5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(hne),createdAt:e.created_at}}function pne(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 mne(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=pne(s);return{answers:t,method:e.method,note:e.note}}function uv(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function qS(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 zr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function za(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Qo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function gne(e){if(!e||typeof e!="object")return null;const t=e,n=zr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:zr(t,"goalId")??zr(t,"goal_id")??"goal",objective:zr(t,"objective")??"",completionCriterion:zr(t,"completionCriterion")??zr(t,"completion_criterion"),status:n,turnsUsed:za(t,"turnsUsed")??za(t,"turns_used")??0,tokensUsed:za(t,"tokensUsed")??za(t,"tokens_used")??0,wallClockMs:za(t,"wallClockMs")??za(t,"wall_clock_ms")??0,terminalReason:zr(t,"terminalReason")??zr(t,"terminal_reason"),budget:{tokenBudget:Qo(o,"tokenBudget")??Qo(o,"token_budget"),remainingTokens:Qo(o,"remainingTokens")??Qo(o,"remaining_tokens"),turnBudget:Qo(o,"turnBudget")??Qo(o,"turn_budget"),remainingTurns:Qo(o,"remainingTurns")??Qo(o,"remaining_turns"),wallClockBudgetMs:Qo(o,"wallClockBudgetMs")??Qo(o,"wall_clock_budget_ms"),remainingWallClockMs:Qo(o,"remainingWallClockMs")??Qo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function vne(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:vi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:vi(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:Wu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Wu(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:av(t.payload.status),previousStatus:av(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:F5(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=gne(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:cv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Xy),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:O5(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:R5(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:uv(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 yne(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 VS(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,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,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 kne(e){return e.session_id}function bne(e){return e.seq}const xne="main",_ne=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function ir(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 wne(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 KS(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function Qs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Wl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Xo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Sne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=Qs(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=Qs(t,"goalId")??Qs(t,"goal_id")??"goal",r=Qs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:Qs(t,"completionCriterion")??Qs(t,"completion_criterion"),status:o,turnsUsed:Wl(t,"turnsUsed")??Wl(t,"turns_used")??0,tokensUsed:Wl(t,"tokensUsed")??Wl(t,"tokens_used")??0,wallClockMs:Wl(t,"wallClockMs")??Wl(t,"wall_clock_ms")??0,terminalReason:Qs(t,"terminalReason")??Qs(t,"terminal_reason"),budget:{tokenBudget:Xo(s,"tokenBudget")??Xo(s,"token_budget"),remainingTokens:Xo(s,"remainingTokens")??Xo(s,"remaining_tokens"),turnBudget:Xo(s,"turnBudget")??Xo(s,"turn_budget"),remainingTurns:Xo(s,"remainingTurns")??Xo(s,"remaining_turns"),wallClockBudgetMs:Xo(s,"wallClockBudgetMs")??Xo(s,"wall_clock_budget_ms"),remainingWallClockMs:Xo(s,"remainingWallClockMs")??Xo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function ic(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Cne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=Qs(t,"name")??Qs(t,"toolName")??"tool",s=pa(Ane(n)),o=Mne(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=Qs(n,"text");if(o)return w0(o);const i=Qs(n,"message");if(i)return w0(i)}const s=Qs(t,"message");if(s)return w0(s)}return null}function Ane(e){return e.replace(/_\d+$/,"")}const GS=2e3;function w0(e){return e.length>GS?`${e.slice(0,GS)}…`:e}function Mne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return nd(e,n)}function Ene(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=Qs(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ic(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),p=[];return f&&p.push({type:"taskCreated",sessionId:t,task:f}),p.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),p}const r=Cne(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ic(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 YS(e,t,n){const s={id:ir("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Tne(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function Nne(e){return Array.isArray(e)?e.map(t=>Xy(t)):[]}function ZS(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function Ine(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function $ne(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function QS(e,t){e.messages.find(n=>n.id===t)}function Lne(e,t,n,s,o,i){const r={id:ir("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function S0(e,t){return e.messages.find(n=>n.id===t)}function XS(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 Fne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=KS(),e.set(u,d)),d}function s(u){e.set(u,KS())}function o(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){s(u);const f=n(u),p=d.promptId??ir("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=YS(f,u,p);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:fu(h)}]}function l(u,d,f,p){try{return c(u,d,f,p)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,p){const h=n(f),m=d,_=[],k=m?.agentId;if(typeof k=="string"&&k!==xne){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(_ne.has(u))return Ene(h,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=Nne(m?.content);if(y.length===0)break;h.currentPromptId=g;const A=Tne(h,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:fu(A)});break}case"turn.started":{const g=m?.turnId,v=h.currentPromptId??ir("pr_");h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v),h.turnTextLen=0,h.turnThinkLen=0;break}case"turn.step.started":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=ir("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=YS(h,f,v);h.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:fu(y)});break}case"thinking.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const y=a(h.turnThinkLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=ZS(h,g,"thinking",v);if(A<0)break;h.turnThinkLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const y=a(h.turnTextLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=ZS(h,g,"text",v);if(A<0)break;h.turnTextLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=h.currentAssistantMsgId,v=m?.turnId,y=h.turnPromptId.get(v)??h.currentPromptId;if(!g||!y)break;const A=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};Ine(h,g,A,L,$);const x=S0(h,g);x&&x.content.length-1,h.toolStartTimes.set(A,Date.now()),x&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:x.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=$ne(m??{});g&&v&&_.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=ir("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=m?.toolCallId,A=m?.output,L=m?.isError??!1;h.toolStartTimes.get(y)??Date.now(),h.toolStartTimes.delete(y);const $=Lne(h,f,y,A,L,v);_.push({type:"messageCreated",message:fu($)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=h.currentAssistantMsgId,v=wne(m?.usage);if(h.totalInput+=v.input,h.totalOutput+=v.output,h.totalCacheRead+=v.cacheRead,h.totalCacheCreate+=v.cacheCreate,g){QS(h,g);const y=S0(h,g);y&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:XS(h),model:h.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=h.currentAssistantMsgId,v=m?.reason??"completed",y=Wl(m??{},"durationMs");if(g){QS(h,g);const L=S0(h,g);L&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:L.content.map($=>({...$})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}h.turnCount++;const A=XS(h);_.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{h.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:ir("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};h.subagentMeta.set(v.id,v),_.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=ic(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=ic(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=ic(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=ic(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):ir("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:yn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:A,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Sne(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=Qs(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:ir("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};h.messages.push(y),_.push({type:"messageCreated",message:fu(y)})}break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const One=new Set(["server_hello","ack","ping","resync_required","error","pong"]),JS=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated","cron.fired"]),Rne=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"]),Bne=new Set(["assistant.delta","thinking.delta"]);function Dne(e,t){if(One.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Bne.has(s)?Pne(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Rne.has(s)?{route:"protocol"}:JS.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:JS.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Pne(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 oh 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 Ya 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 ml(e){return e instanceof oh||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function B5(e){return e instanceof Ya||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const eC=1e3,C0=16384,A0=500,M0=50,Hne=6,Wne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,zne=/^[A-Za-z0-9+/=_-]{200,}$/;let E0=null;function Ai(){if(E0!==null)return E0;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=Qn($t.debug)==="1"),E0=e,e}const tl=[];let Une=1;const Jy=Q(0),bu=fa(!1);function jne(){return tl}function qne(){tl.length=0,Jy.value++}function _l(e){bu.value||(tl.push({id:Une++,ts:Date.now(),...e}),tl.length>eC&&tl.splice(0,tl.length-eC),Jy.value++)}function fv(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return zne.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>A0?`${o.slice(0,A0)}… [+${o.length-A0} chars]`:o}if(n!=="object")return String(e);if(t>=Hne)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,M0).map(i=>fv(i,t+1));return e.length>M0&&o.push(`[+${e.length-M0} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=Wne.test(o)?"[redacted]":fv(i,t+1);return s}function ga(e){if(e===void 0)return;const t=fv(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>C0)return{_truncated:`detail JSON was ${n.length} chars; first ${C0} kept`,preview:n.slice(0,C0)}}catch{return"[unserializable detail]"}return t}function T0(e){Ai()&&_l({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ga(e.body)}})}function Ff(e){if(!Ai())return;const t=e.code!==0;_l({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:ga(e.data)}})}function hu(e){Ai()&&_l({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 Ua(e,t){Ai()&&_l({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ga(t)})}function Vne(e){if(!Ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;_l({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:ga(e)})}function Kne(e){if(!Ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);_l({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ga(t.payload)})}const Gne={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function N0(e,t,n){Ai()&&_l({source:"client",kind:`client:${e}`,label:`${Gne[e]} ${t}`,detail:ga(n)})}function ar(e,t){Ai()&&_l({source:"client",kind:"client:event",label:`· ${e}`,detail:ga(t)})}let tC=!1;function Yne(){if(!(tC||!Ai())){tC=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{N0("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;N0("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{N0(e,n.map(Zne).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Zne(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 D5(e=tl){if(typeof document>"u")return;const t=new Blob([Qne(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function Qne(e=tl){return e.map(t=>JSON.stringify(t)).join(`
|
|
285
285
|
`)}const ek="kimi-web.server-credential",Xne="token";let hd;const hv=new Set;function Jne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Xne);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function ese(){try{return globalThis.sessionStorage?.getItem(ek)??void 0}catch{return}}function tse(){const e=Jne();return e?(H5(e),!0):(hd=ese(),hd!==void 0)}function P5(){return hd}function H5(e){hd=e;try{globalThis.sessionStorage?.setItem(ek,e)}catch{}}function nse(){hd=void 0;try{globalThis.sessionStorage?.removeItem(ek)}catch{}}function sse(e){return hv.add(e),()=>{hv.delete(e)}}function ose(){nse();for(const e of hv)try{e()}catch{}}const Za=3e4,W5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",nC=500,ise=40101;function I0(){try{return AbortSignal.timeout(Za)}catch{return}}function rse(e,t){let n="",s=e;for(let o=0;o<t;o++)n=W5[s%32]+n,s=Math.floor(s/32);return n}function lse(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=>W5[n%32]).join("")}function $0(){return`${rse(Date.now(),10)}${lse(16)}`}function ase(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function sC(e){try{const t=await e.text();return t?t.length>nC?`${t.slice(0,nC)}...`:t:void 0}catch{return}}class cse{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=Mu(this.origin,t),s=$0(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();T0({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:I0()})}catch(a){throw hu({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new Ya({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:Za,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return Ff({method:"GET",path:t,requestId:s,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),Ff({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new oh({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??s,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=Mu(this.origin,t),o=$0(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();T0({method:"POST",path:t,url:s,requestId:o,body:ase(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:I0()})}catch(u){throw hu({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new Ya({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:Za,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw hu({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Ya({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:Za,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await sC(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(Ff({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new oh({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,s,o,i=[]){let r=Mu(this.origin,n);if(o){const p=new URLSearchParams;for(const[m,_]of Object.entries(o))_!==void 0&&p.set(m,String(_));const h=p.toString();h&&(r=`${r}?${h}`)}const l=$0(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();T0({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:I0()})}catch(p){throw hu({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new Ya({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Za,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(p){throw hu({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new Ya({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Za,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await sC(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(Ff({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 oh({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===ise)&&ose()}}const use="kimi-code.bearer.",dse=3e4;class fse{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),Ua("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=P5(),n=t!==void 0?[`${use}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{Ua("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));Kne(i),this.handleFrame(i)}catch(i){Ua("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{Ua("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{Ua("close",o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Ua("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=Of(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Of(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(Of(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,dse),s=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:s}}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 s=n.payload?.heartbeat_ms;typeof s=="number"&&s>0&&(this.heartbeatMs=s),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=Of(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=Dne(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Vne(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Of(e,t){return`${e}\0${t}`}function L0(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 oC(e){return e==="auto_compact"||e==="manual_compact"}class hse{http;config;constructor(t){this.config=t,this.http=new cse(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}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?ane(t.status):void 0,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(vi),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return vi(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return vi(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return vi(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return vi(n)}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(cv),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:vi(n.session),messages:n.messages.items.map(cv),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(O5),pendingQuestions:n.pending_questions.map(R5)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,une(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return vi(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return vi(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(vi)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,dne(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,mne(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(uv)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return uv(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(L0)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return L0(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return L0(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(qS)])):void 0;return{items:o.items.map(qS),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Mu(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Wu)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Wu(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const s=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Wu(s)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(yne)}async listProviders(){return(await this.http.get("/providers")).items.map(VS)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return VS(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return F0(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return F0(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return F0(t)}async getConfig(){const t=await this.http.get("/config");return dv(t)}async setConfig(t){const n={},s={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=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return dv(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return Mu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=HN(this.config.serverHttpUrl,this.config.clientId),s=Fne(),o=new fse(n,this.config.clientId,{onWireEvent:i=>{const r=kne(i),l=bne(i),a=vne(i);a.type==="historyCompacted"&&!oC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!oC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}}function F0(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 iC;function ft(){return iC??=new hse(ON()),iC}const pse=["src","controls","muted"],mse=["src","alt"],O0=qe({__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=Q(t.fileId?"":t.url),s=Q(null),o=Q(!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(o.value)try{const f=await ft().getFileBlob(t.fileId),p=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(p);return}i=p,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ke(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),ln(()=>{typeof IntersectionObserver=="function"&&s.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(s.value)):o.value=!0}),es(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(b(),I("video",{key:0,ref_key:"mediaEl",ref:s,class:De(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,pse)):(b(),I("img",{key:1,ref_key:"mediaEl",ref:s,class:De(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,mse))}}),gse=["aria-label"],vse=120,yse=60,kse=qe({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*vse}ms`,"--moon-frame-fast-delay":`${s*yse}ms`}}return(s,o)=>(b(),I("span",{class:De(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(b(),I(Be,null,nt(t,(i,r)=>w("span",{key:i,class:"ui-moon__frame",style:qt(n(r)),"aria-hidden":"true"},B(i),5)),64))],10,gse))}}),z5=ut(kse,[["__scopeId","data-v-a6b7ec07"]]),bse={class:"chat"},xse={key:0,class:"chat-loading"},_se={class:"chat-loading-text"},wse={key:1,class:"chat-empty"},Sse={key:1,class:"top-sentinel-text"},Cse={key:0,class:"u-turn"},Ase=["data-turn-id"],Mse={key:0,class:"u-imgs"},Ese=["aria-label","onClick"],Tse={key:1,class:"skill-act"},Nse={class:"skill-act-head"},Ise={key:0,class:"skill-act-args"},$se={key:2,class:"skill-act"},Lse={class:"skill-act-head"},Fse={key:0,class:"skill-act-args"},Ose={key:3,class:"u-text"},Rse={key:0,class:"u-meta"},Bse=["aria-label","onClick"],Dse=["aria-label","onClick"],Pse=["data-turn-id"],Hse=["onClick"],Wse={class:"cd-view"},zse={key:1,class:"cd-label"},Use=["data-turn-id"],jse={key:1,class:"msg"},qse={key:0,class:"a-msg-ft"},Vse={key:0,class:"a-duration"},Kse=["aria-label","onClick"],Gse={key:4,class:"sending-placeholder"},Yse={key:5,class:"q-stack"},Zse={class:"q-head"},Qse={class:"q-title"},Xse={class:"q-hint"},Jse=["onDragover","onDrop"],eoe={class:"u-bub q-bub"},toe=["title","onDragstart"],noe=["title","onClick"],soe={key:0,class:"u-text q-text"},ooe={key:1,class:"q-text q-text-placeholder"},ioe={key:0,class:"q-imgs"},roe={key:1,class:"q-tag q-tag-next"},loe={key:2,class:"q-tag q-tag-idx"},aoe=["aria-label","onClick"],coe=2500,uoe=qe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:s}=Et(),{confirm:o}=kl();fn(()=>{U!==null&&(clearTimeout(U),U=null),T!==null&&(clearTimeout(T),T=null),E!==null&&(clearTimeout(E),E=null)});const i=e,r=Q(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(ne=>{ne[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))}ln(a),fn(()=>{l?.disconnect(),l=null}),Ke(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{pt().then(a)});const c=P(()=>{if(!i.running||i.turns.length===0)return null;const ne=i.turns.at(-1);return ne.role==="assistant"?ne.id:null}),u=P(()=>i.sending||i.running),d=n,f=Q(null),p=Q(null);function h(ne){return(ne.attachments?.length??0)>0}function m(ne){d("editQueued",ne)}function _(ne,ke){if(f.value=ne,!ke.dataTransfer)return;ke.dataTransfer.effectAllowed="move",ke.dataTransfer.setData("text/plain",String(ne));const Se=ke.currentTarget?.closest(".q-turn");Se&&ke.dataTransfer.setDragImage(Se,24,24)}function k(ne,ke){if(f.value===null)return;ke.preventDefault(),ke.dataTransfer&&(ke.dataTransfer.dropEffect="move");const Se=ke.currentTarget.getBoundingClientRect(),Ye=ke.clientY<Se.top+Se.height/2?"before":"after";p.value={index:ne,position:Ye}}function g(ne,ke){ke.preventDefault();const Se=f.value,Ye=p.value?.position??"before";if(f.value=null,p.value=null,Se===null)return;let ve=Ye==="before"?ne:ne+1;Se<ve&&(ve-=1),Se!==ve&&d("reorderQueue",{from:Se,to:ve})}function v(){f.value=null,p.value=null}const y=P(()=>{for(let ne=i.turns.length-1;ne>=0;ne--)if(i.turns[ne].role==="user")return i.turns[ne].id;return null});function A(ne){return ne.role==="user"&&ne.id===y.value&&!i.running&&!i.sending&&!ne.skillActivation&&!ne.pluginCommand}function L(ne){const ke=ne.compaction,Se=ke?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof ke?.tokensBefore=="number"&&typeof ke?.tokensAfter=="number"?Se+s("conversation.compactedTokens",{before:Gx(ke.tokensBefore),after:Gx(ke.tokensAfter)}):Se}const $=Q(null),x=Q(null);let E=null;async function N(ne){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&F(ne)}function F(ne){x.value===null&&(x.value=ne.id,d("editMessage",{text:ne.text,images:ne.images}),E=setTimeout(()=>{E=null,x.value=null},coe))}Ke(()=>i.turns,ne=>{x.value!==null&&(ne.some(ke=>ke.id===x.value)||(x.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const S=Q(!1);let T=null;function R(){if(i.turns.length===0)return;const ne=[];for(const Se of i.turns){if(Se.role==="compaction"||Se.role==="cron")continue;const Ye=Se.role==="user"?"User":"Assistant",ve=XW(Se);ve.trim()&&ne.push(`**${Ye}**
|
|
286
286
|
|
|
287
287
|
${ve}`)}const ke=ne.join(`
|
|
@@ -295,28 +295,28 @@ ${ve}`)}const ke=ne.join(`
|
|
|
295
295
|
`)??"";m&&await d(m,h.id,r)}return(h,m)=>(b(),I("div",qle,[w("div",Vle,[w("span",Kle,B(C(s)("tasks.tag")),1),w("span",Gle,B(e.tasks.length),1)]),w("div",Yle,[e.tasks.length===0?(b(),I("div",Zle,B(C(s)("tasks.emptyTasks")),1)):(b(!0),I(Be,{key:1},nt(e.tasks,_=>(b(),I("div",{key:_.id,class:De(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:c(_)}])},[w("div",{class:"tp-main",role:c(_)?"button":void 0,onClick:k=>a(_)},[ie(K5,{status:u(_.state)},null,8,["status"]),w("span",Xle,B(_.name),1),ie(Ro,{variant:"neutral",size:"sm"},{default:Ee(()=>[Ge(B(_.kind),1)]),_:2},1024),w("span",Jle,B(_.timing),1),_.state==="run"?(b(),I("button",{key:0,class:"tp-stop",onClick:bt(k=>n("cancel",_.id),["stop"])},B(C(s)("tasks.stop")),9,eae)):le("",!0),_.kind==="subagent"?(b(),ye(Ve,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(_)?(b(),ye(Ve,{key:2,class:De(["tp-chevron",{open:o.has(_.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):le("",!0)],8,Qle),o.has(_.id)&&l(_)?(b(),I("div",tae,[_.meta?(b(),I("div",nae,[w("button",{class:De(["tp-copy",{copied:i.has(_.id)}]),onClick:bt(k=>f(_),["stop"])},B(i.has(_.id)?"已复制":"复制"),11,sae),w("pre",oae,[w("code",null,[w("span",iae,B(_.meta),1)])])])):le("",!0),_.output&&_.output.length>0?(b(),I("div",rae,[w("button",{class:De(["tp-copy",{copied:r.has(_.id)}]),onClick:bt(k=>p(_),["stop"])},B(r.has(_.id)?"已复制":"复制"),11,lae),w("pre",aae,[w("code",null,[m[0]||(m[0]=Ge(`
|
|
296
296
|
`,-1)),(b(!0),I(Be,null,nt(_.output,(k,g)=>(b(),I("span",{key:g,class:"tp-line"},B(k),1))),128)),m[1]||(m[1]=Ge(`
|
|
297
297
|
`,-1))])])])):le("",!0)])):le("",!0)],2))),128))])]))}}),lC=ut(cae,[["__scopeId","data-v-28fd5fc0"]]),uae={class:"todo-card"},dae={key:0,class:"tc-empty"},fae={class:"tc-name"},hae=qe({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Et();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(b(),I("div",uae,[t.todos.length===0?(b(),I("div",dae,[i[0]||(i[0]=w("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"},[w("path",{d:"M9 11l2 2 4-4"}),w("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),w("span",null,B(C(n)("tasks.emptyTodo")),1)])):le("",!0),(b(!0),I(Be,null,nt(t.todos,(r,l)=>(b(),I("div",{key:l,class:De(["tc-row",`s-${r.status}`])},[ie(K5,{status:s(r.status)},null,8,["status"]),w("span",fae,B(r.title),1)],2))),128))]))}}),pae=ut(hae,[["__scopeId","data-v-01c65735"]]),mae=["disabled","aria-pressed"],gae=qe({__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?(b(),I("button",{key:0,class:De(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[In(t.$slots,"default",{},void 0,!0)],10,mae)):(b(),I("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[In(t.$slots,"default",{},void 0,!0)],2))}}),B0=ut(gae,[["__scopeId","data-v-317ace1a"]]),vae={class:"dock-work-head"},yae={key:0,class:"dock-work-tab static"},kae={key:1,class:"dock-work-tab static"},bae={key:2,class:"dock-work-tab static"},xae={class:"dock-work-body"},_ae={class:"dw-count"},wae={class:"dw-count"},Sae={class:"dw-count"},Cae=qe({__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 s=e,o=n,{t:i}=Et(),r=Q(null),l=Q(null),a=Q(null);function c(p){return r.value?(r.value.loadForEdit(p),!0):!1}function u(p){r.value?.loadAttachmentsForEdit(p)}function d(){r.value?.focus()}function f(p){if(!s.dockPanel)return;const h=p.target;h&&(l.value?.contains(h)||a.value?.contains(h)||o("close-dock-panel"))}return Ke(()=>s.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),p&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),fn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(p,h)=>(b(),I("div",{class:De(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=bt(()=>{},["stop"]))},[ie(cl,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(b(),I("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=bt(()=>{},["stop"]))},[w("div",vae,[e.dockPanel==="bash"?(b(),I("span",yae,B(C(i)("tasks.dockBash"))+" · "+B(e.bashRunning)+" "+B(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(b(),I("span",kae,B(C(i)("tasks.dockSubagent"))+" · "+B(e.subagentRunning)+" "+B(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(b(),I("span",bae,B(C(i)("tasks.dockTodos"))+" · "+B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1)):le("",!0)]),w("div",xae,[e.dockPanel==="bash"?(b(),ye(lC,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=m=>o("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(b(),ye(lC,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=m=>o("cancelTask",m)),onOpen:h[2]||(h[2]=m=>o("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(b(),ye(pae,{key:2,todos:e.todos??[]},null,8,["todos"])):le("",!0)])],512)):le("",!0)]),_:1}),e.goal?(b(),ye(Are,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=m=>o("controlGoal",m))},null,8,["goal","force-expanded"])):le("",!0),e.hasDockWork?(b(),I("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(b(),ye(B0,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=m=>o("toggle-dock-panel","bash"))},{default:Ee(()=>[ie(Ve,{name:"clock",size:"md"}),w("span",null,B(C(i)("tasks.dockBash")),1),w("span",_ae,[h[29]||(h[29]=Ge("(",-1)),w("b",null,B(e.bashTasks.length),1),h[30]||(h[30]=Ge(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),e.subagentTasks.length>0?(b(),ye(B0,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=m=>o("toggle-dock-panel","subagent"))},{default:Ee(()=>[ie(Ve,{name:"sparkles",size:"md"}),w("span",null,B(C(i)("tasks.dockSubagent")),1),w("span",wae,[h[31]||(h[31]=Ge("(",-1)),w("b",null,B(e.subagentTasks.length),1),h[32]||(h[32]=Ge(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),(e.todos?.length??0)>0?(b(),ye(B0,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=m=>o("toggle-dock-panel","todos"))},{default:Ee(()=>[ie(Ve,{name:"check-list",size:"md"}),w("span",null,B(C(i)("tasks.dockTodos")),1),w("span",Sae,[h[33]||(h[33]=Ge("(",-1)),w("b",null,B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1),h[34]||(h[34]=Ge(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0)],512)):le("",!0),e.pendingQuestion?(b(),ye(Jre,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(m,_)=>o("answer",m,_)),onDismiss:h[9]||(h[9]=m=>o("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(b(),ye(Ule,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=m=>o("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(b(),ye(V5,{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:h[11]||(h[11]=m=>o("submit",m)),onSteer:h[12]||(h[12]=m=>o("steer",m)),onCommand:h[13]||(h[13]=m=>o("command",m)),onInterrupt:h[14]||(h[14]=m=>o("interrupt")),onSetPermission:h[15]||(h[15]=m=>o("setPermission",m)),onSetThinking:h[16]||(h[16]=m=>o("setThinking",m)),onTogglePlan:h[17]||(h[17]=m=>o("togglePlan")),onToggleSwarm:h[18]||(h[18]=m=>o("toggleSwarm")),onToggleGoal:h[19]||(h[19]=m=>o("toggleGoal")),onOpenBtw:h[20]||(h[20]=m=>o("openBtw")),onCreateGoal:h[21]||(h[21]=m=>o("createGoal",m)),onControlGoal:h[22]||(h[22]=m=>o("controlGoal",m)),onFocusGoal:h[23]||(h[23]=m=>o("focusGoal")),onFocusSwarm:h[24]||(h[24]=m=>o("focusSwarm")),onCompact:h[25]||(h[25]=m=>o("compact")),onPickModel:h[26]||(h[26]=m=>o("pickModel")),onSelectModel:h[27]||(h[27]=m=>o("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))}}),Aae=ut(Cae,[["__scopeId","data-v-67df0d16"]]),Mae=["aria-label","aria-hidden"],Eae={class:"toc-scroll"},Tae=["onClick"],Nae={class:"toc-label"},Iae=240,$ae=qe({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=Q(null),r=Q(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,p=d.getBoundingClientRect().right;r.value=p-f>=Iae}const c=P(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ke(c,u=>{l?.disconnect(),l=null,u&&pt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),es(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(b(),I("nav",{key:0,ref_key:"navRef",ref:i,class:De(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":C(o)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[w("div",Eae,[(b(!0),I(Be,null,nt(e.items,f=>(b(),I("button",{key:f.id,type:"button",class:De(["toc-row",{active:e.activeTurnId===f.id}]),onClick:p=>s("select",f.id)},[d[0]||(d[0]=w("span",{class:"toc-bar"},null,-1)),w("span",Nae,B(f.title),1)],10,Tae))),128))])],10,Mae)):le("",!0)}}),Lae=ut($ae,[["__scopeId","data-v-0a2a2a96"]]),Fae=5;function Oae(e,t,n,s=Fae){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const Rae={class:"chat-layout"},Bae={class:"empty-hint"},Dae={key:0,class:"empty-hint-text"},Pae={type:"button",class:"ws-pick-btn",tabindex:"-1"},Hae={class:"ws-pick-name"},Wae={class:"ws-pick-menu"},zae={type:"button",class:"ws-pick-item ws-pick-more",tabindex:"-1"},Uae={type:"button",class:"ws-pick-action",tabindex:"-1"},jae={class:"ws-pick-name"},qae={key:1,class:"ws-pick-menu"},Vae=["onClick"],Kae={class:"ws-pick-item-name"},Gae={class:"ws-pick-item-path"},Yae=["aria-label"],Zae={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Qae={class:"abort-toast-text"},D0=80,aC=1e3,Xae=420,Jae=3e3,ece=qe({__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},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{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"],setup(e,{expose:t,emit:n}){const{t:s,locale:o}=Et(),i=e,r=n,l=Q(!1),a=Q(!1),c=Q(null),u=Q(null),d=Q(""),f=P(()=>d.value?{"--ws-pick-menu-width":d.value}:void 0);let p=null;const h=P(()=>i.workspaces?.find(X=>X.id===i.activeWorkspaceId)?.name??i.workspaceName??""),m=P(()=>(i.workspaces?.length??0)>0),_=P(()=>Oae(i.workspaces??[],i.activeWorkspaceId,a.value)),k=P(()=>(i.workspaces?.length??0)-_.value.length);Ke(l,we=>{we||(a.value=!1)});function g(we){l.value=!1,we!==i.activeWorkspaceId&&r("selectWorkspace",we)}function v(we){const X=Number.parseFloat(we);return Number.isFinite(X)?X:0}function y(we){return`${we.fontStyle||"normal"} ${we.fontWeight||"400"} ${we.fontSize} ${we.fontFamily}`}function A(we){return we.letterSpacing==="normal"?0:v(we.letterSpacing)}function L(we,X){if(!we)return 0;const me=U3(we,y(X),{letterSpacing:A(X)});return j3(me)}function $(){const we=c.value?.getBoundingClientRect().width??window.innerWidth;return Math.max(0,we*.75)}function x(){const we=u.value;if(!we)return;const X=we.querySelector(".ws-pick-item-path");if(!X)return;const me=getComputedStyle(X),je=(i.workspaces??[]).reduce((lt,ee)=>Math.max(lt,L(ee.shortPath,me)),0);d.value=je?`${Math.ceil(Math.min(je,$()))}px`:""}function E(){typeof window>"u"||pt(()=>{p!==null&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{p=null,x()})})}Ke(()=>[i.activeWorkspaceId,i.workspaceName,i.workspaces?.map(we=>`${we.id}\0${we.name}\0${we.shortPath}`).join("")??"",k.value,o.value],E,{immediate:!0}),ln(()=>{E(),window.addEventListener("resize",E),document.fonts?.ready.then(E)}),fn(()=>{p!==null&&window.cancelAnimationFrame(p),window.removeEventListener("resize",E)}),Ac($t.contentAlign);const N=Q(null),F=Q(null),S=Q(null),T=Q(!1),R=Q(0);let O=null;function D(we,X){const me=S.value??F.value;return!me||me.loadForEdit(we)===!1?!1:(me.loadAttachmentsForEdit(X??[]),!0)}function W(){T.value=!0,O!==null&&clearTimeout(O),O=setTimeout(()=>{O=null,T.value=!1},2e3)}function z(){R.value++}const V=P(()=>i.tasks.filter(we=>we.kind!=="subagent")),U=P(()=>i.tasks.filter(we=>we.kind==="subagent"&&we.runInBackground)),re=P(()=>V.value.filter(we=>we.state==="run").length),ae=P(()=>U.value.filter(we=>we.state==="run").length);function te(we){const X=i.tasks,me=X.find(lt=>lt.id===we)??X.find(lt=>lt.parentToolCallId===we);if(me)return me.id;const je=X.filter(lt=>lt.kind==="subagent"&&!lt.parentToolCallId);if(je.length===1)return je[0].id}An("resolveAgentTaskId",te),An("pinScroll",ss);const Z=P(()=>(i.todos??[]).filter(we=>we.status==="done").length),ne=P(()=>V.value.length>0||U.value.length>0||(i.todos?.length??0)>0||(i.queued?.length??0)>0),ke=Q(null),Se=P(()=>i.gitInfo?i.changes?.length??0:0);function Ye(we){ke.value=ke.value===we?null:we}function ve(){ke.value=null}Ke(ne,we=>{we||ve()});function Y(we){if(we.role==="compaction")return s("conversation.compactedPlain");if(we.role==="user"){if(we.skillActivation)return`/${we.skillActivation.name}`;if(we.pluginCommand)return`/${we.pluginCommand.pluginId}:${we.pluginCommand.commandName}`;const me=we.text.trim().replaceAll(/\s+/g," ");return me.length>0?me:"user"}const X=(we.text||we.thinking||"").trim().replaceAll(/\s+/g," ");return X.length>0?X:(we.tools?.length??0)>0?`${we.tools.length} tools`:"kimi"}const ce=P(()=>i.turns.filter(we=>we.role==="user").map((we,X)=>({id:we.id,role:we.role,no:X+1,title:Y(we)}))),fe=Q(null);function j(){const we=q.value;if(!we)return;const X=we.querySelectorAll(".turn-anchor[data-turn-id]");if(X.length===0)return;const me=ce.value;if(me.length===0)return;const je=new Set(me.map(Ae=>Ae.id));if(wt()<=D0){fe.value=me[me.length-1].id;return}const lt=we.getBoundingClientRect(),ee=lt.height/2;let _e=null;X.forEach(Ae=>{const Pe=Ae.dataset.turnId;if(!Pe||!je.has(Pe))return;Ae.getBoundingClientRect().top-lt.top<=ee&&(_e=Pe)}),fe.value=_e??me[0].id}const se=P(()=>i.questions&&i.questions.length>0?i.questions[0]:void 0),ge=P(()=>{const we=se.value;if(we)return i.pendingQuestionActions?.[we.questionId]}),ue=P(()=>i.approvals&&i.approvals.length>0?i.approvals[0]:void 0),pe=P(()=>{const we=ue.value;return we?!!i.pendingApprovalActions?.[we.approvalId]:!1}),q=Q(null),J=Q(null),he=Q(0),Te=Q(0),Ie=P(()=>({"--panes-scrollbar-width":`${he.value}px`}));function Oe(we){return we instanceof HTMLElement?we:we&&"$el"in we&&we.$el instanceof HTMLElement?we.$el:null}function de(){const we=q.value;he.value=we?Math.max(0,we.offsetWidth-we.clientWidth):0,Te.value=J.value?.offsetHeight??0}function $e(we){const X=Oe(we);q.value=X,X&&Vo()}function Qe(we){const X=Oe(we);J.value=X??null,we&&"loadForEdit"in we&&typeof we.loadForEdit=="function"&&"focus"in we&&typeof we.focus=="function"?S.value={loadForEdit:we.loadForEdit.bind(we),loadAttachmentsForEdit:"loadAttachmentsForEdit"in we&&typeof we.loadAttachmentsForEdit=="function"?we.loadAttachmentsForEdit.bind(we):()=>{},focus:we.focus.bind(we)}:S.value=null,Vn()}const tt=Q(!0),vt=Q(!1);function wt(){const we=q.value;return we?we.scrollHeight-we.scrollTop-we.clientHeight:0}let xt=0,Rt=0,yt=0,nn=0,xn=0,ns=0;function Wt(){return Date.now()<Rt}function _n(){const we=q.value;if(!we)return;const X=we.scrollTop;if(hs()){xt=X;return}if(performance.now()-yt<100){xt=X;return}const me=wt();if(Wt()){tt.value=!0,vt.value=!1,xt=X;return}X<xt-1&&me>1?(tt.value=!1,vt.value=!0):me<=D0&&X>xt+1&&(tt.value=!0,vt.value=!1),xt=X,j()}function gn(we=!1){const X=q.value;tt.value=!0,vt.value=!1,X&&(!we&&performance.now()<nn||(we&&typeof X.scrollTo=="function"?(yt=performance.now(),nn=performance.now()+Xae,X.scrollTo({top:X.scrollHeight,behavior:"smooth"})):X.scrollTop=X.scrollHeight,xt=X.scrollTop))}function ot(we,X){const me=we.querySelectorAll(".turn-anchor");for(const je of me)if(je.offsetTop>=X){const lt=je.dataset.turnId;if(lt)return{id:lt,top:je.offsetTop}}return null}async function ds(){if(!i.sessionId||!i.loadOlderMessages||i.loadingMore||!i.hasMoreMessages)return;const we=i.sessionId,X=q.value,me=X?.scrollTop??0,je=X?.scrollHeight??0,lt=X?ot(X,me):null;Ks.value=!0;try{await i.loadOlderMessages(we),await pt()}finally{Ks.value=!1}if(i.sessionId!==we)return;const ee=q.value;if(!ee)return;let _e=0;if(lt){const Ae=ee.querySelector(`.turn-anchor[data-turn-id="${ys(lt.id)}"]`);Ae&&(_e=Ae.offsetTop-lt.top)}_e===0&&(_e=ee.scrollHeight-je),ee.scrollTop=me+_e}function ys(we){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(we):we.replaceAll(/["\\]/g,"\\$&")}function fs(we){const X=q.value;if(!X)return;const me=X.querySelector(`.turn-anchor[data-turn-id="${ys(we)}"]`);me&&(tt.value=!1,vt.value=wt()>D0,me.scrollIntoView({behavior:"smooth",block:"center"}))}function Xe(){const we=q.value;if(!we)return"none";const X=we.firstElementChild,me=X instanceof HTMLElement?X.offsetHeight:0,je=J.value?.offsetHeight??0;return`${we.scrollHeight}:${we.clientHeight}:${me}:${je}`}function Ze(we){return typeof requestAnimationFrame=="function"?requestAnimationFrame(we):setTimeout(we,16)}function Mt(we){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(we):clearTimeout(we)}let Dt=0,zt=0,wn=null,Rn=0;function hs(){return performance.now()<Dt}function ss(we,X=260){const me=q.value;if(!me||(wn=we,Rn=we.getBoundingClientRect().top,Dt=performance.now()+X,zt))return;const je=()=>{if(zt=0,performance.now()>=Dt||!wn){wn=null;return}const lt=wn.getBoundingClientRect().top-Rn;lt&&(me.scrollTop+=lt),zt=Ze(je)};zt=Ze(je)}function sn(we=36){if(!tt.value&&!Wt())return;const X=++ns;let me="",je=0,lt=0;xn&&(Mt(xn),xn=0);const ee=()=>{if(xn=0,X!==ns||!tt.value&&!Wt())return;gn(!1);const _e=Xe();je=_e===me?je+1:0,me=_e,lt++,je<3&<<we&&(xn=Ze(ee))};xn=Ze(ee)}function Lt(we,X){return we!==void 0&&we.length>0&&X.length>=we.length&&we.firstId!==X.firstId&&we.lastId===X.lastId&&we.lastTextLen===X.lastTextLen&&we.lastThinkingLen===X.lastThinkingLen&&we.lastToolsLen===X.lastToolsLen&&we.approvalIds===X.approvalIds}const Vs=P(()=>{const we=(i.approvals??[]).map(ee=>ee.approvalId).join(","),X=i.turns,me=X.at(-1),je=me?.thinking?.length??0,lt=me?.tools?.reduce((ee,_e)=>ee+_e.name.length+(_e.arg?.length??0)+(_e.output?.join("").length??0),0)??0;return{length:X.length,firstId:X[0]?.id??"",lastId:me?.id??"",lastTextLen:me?.text.length??0,lastThinkingLen:je,lastToolsLen:lt,approvalIds:we}});Ke(Vs,async(we,X)=>{if(Ks.value&&Lt(X,we)){j();return}await pt(),tt.value||Wt()?gn(we.length<X.length):vt.value=!0,j()}),Ke(J,()=>{Vn()}),Ke(()=>i.mobile,async()=>{await pt(),de()});const an=new Map;Ke(()=>i.fileReloadKey,async(we,X)=>{const me=q.value;X&&me&&an.set(String(X),{top:me.scrollTop,following:tt.value}),await pt();const je=q.value,lt=we?an.get(String(we)):void 0;lt&&je?(tt.value=lt.following,je.scrollTop=lt.top,xt=lt.top,lt.following&&sn()):(tt.value=!0,xt=0,gn(!1),sn()),j()}),Ke(()=>i.sessionLoading,async(we,X)=>{we||!X||(tt.value=!0,await pt(),sn(),j())}),Ke(()=>i.running,async(we,X)=>{we||!X||!tt.value&&!Wt()||(await pt(),sn(48),j())});function So(){tt.value=!0,vt.value=!1,Rt=Date.now()+aC,pt(()=>{gn(!0),sn(16)})}function Co(we){So(),r("submit",we)}function Rs(we){tt.value=!0,vt.value=!1,Rt=Date.now()+aC,r("editMessage",we)}function fi(we){const X=i.queued?.[we],me=X?.text??"";D(me,X?.attachments)&&r("editQueued",we)}function co(we){r("reorderQueue",we)}function jo(we,X){So(),r("answer",we,X)}function Ot(we,X){!we||!X||r("approval",we,X)}let Bs=null,qn=null,Cs=null,On=null,Hn=0,hi=0,Xn=0,qo=!1;const Ks=Q(!1);function Mi(we){if(Ks.value||(qo=qo||we,Xn))return;Xn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:me=>setTimeout(me,16))(()=>{Xn=0;const me=qo;qo=!1,!hs()&&(tt.value||Wt()?gn(!1):me&&(vt.value=!0))})}function Ao(){if(!qn)return;const we=q.value?.firstElementChild??null;we!==Cs&&(Cs&&qn.unobserve(Cs),Cs=we,we&&qn.observe(we))}function Vn(){if(!qn)return;const we=J.value;we!==On&&(On&&qn.unobserve(On),On=we,we&&qn.observe(we))}function Vo(){const we=q.value;de(),Bs&&(Bs.disconnect(),we&&Bs.observe(we,{childList:!0,subtree:!0,characterData:!0})),qn&&(qn.disconnect(),Cs=null,On=null,we&&qn.observe(we),Ao(),Vn()),Hn=we?.scrollHeight??0,hi=we?.clientHeight??0}function ji(){Ao(),Mi(!0)}function Ko(){typeof document>"u"||document.visibilityState==="visible"&&tt.value&&sn()}const Bn=Q(!1);let Kn=null;function Mo(){Bn.value=!0,Kn!==null&&clearTimeout(Kn),Kn=setTimeout(()=>{Bn.value=!1},Jae)}function rt(){Mo(),r("interrupt")}function xe(we){we.key==="Escape"&&(i.running||i.sending)&&(we.preventDefault(),rt())}ln(()=>{pt(()=>{typeof MutationObserver=="function"&&(Bs=new MutationObserver(ji)),typeof ResizeObserver=="function"&&(qn=new ResizeObserver(()=>{de();const we=q.value;if(!we)return;const{scrollHeight:X,clientHeight:me}=we,je=X>Hn+1,lt=me<hi-1;Hn=X,hi=me,!hs()&&(je||lt)&&Mi(!1)})),Vo(),sn(48),j(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ko),document.addEventListener("keydown",xe))})}),fn(()=>{Bs&&Bs.disconnect(),qn&&qn.disconnect(),Xn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Xn),xn&&Mt(xn),zt&&Mt(zt),Kn!==null&&clearTimeout(Kn),O!==null&&(clearTimeout(O),O=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ko),document.removeEventListener("keydown",xe))});function Le(){(S.value??F.value)?.focus()}return t({loadComposerForEdit:D,focusComposer:Le}),(we,X)=>(b(),I("section",{class:De(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(b(),ye(woe,{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":Se.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:T.value,onOpenChanges:X[0]||(X[0]=me=>r("openChanges")),onCopyAll:X[1]||(X[1]=me=>N.value?.copyConversation()),onCopyFinalSummary:X[2]||(X[2]=me=>N.value?.copyFinalSummary()),onOpenPr:X[3]||(X[3]=me=>e.pr&&r("openPr",e.pr.url)),onRenameSession:X[4]||(X[4]=(me,je)=>r("renameSession",me,je)),onForkSession:X[5]||(X[5]=me=>r("forkSession",me)),onArchiveSession:X[6]||(X[6]=me=>r("archiveSession",me))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):le("",!0),e.conversationToc?(b(),ye(Lae,{key:1,items:ce.value,"active-turn-id":fe.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:fs},null,8,["items","active-turn-id","mobile","session-loading"])):le("",!0),w("div",Rae,[w("div",{ref:$e,class:"panes chat-scroll",onScrollPassive:_n},[w("div",{ref_key:"contentWrapRef",ref:c,class:De(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(b(),I(Be,{key:0},[X[55]||(X[55]=w("div",{class:"empty-spacer"},null,-1)),w("div",Bae,[w("span",{class:De(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(b(),ye(wo,{key:0,size:"sm"})):le("",!0),w("span",null,B(e.starting?C(s)("conversation.starting"):C(s)("composer.emptyConversationTitle")),1)],2),e.starting?le("",!0):(b(),I("span",Dae,B(C(s)("composer.emptyConversation")),1)),m.value&&!e.starting?(b(),I("div",{key:1,class:"ws-pick",style:qt(f.value)},[w("div",{ref_key:"wsPickMeasureRef",ref:u,class:"ws-pick-measure","aria-hidden":"true"},[w("button",Pae,[ie(Ve,{name:"folder",size:"sm"}),w("span",Hae,B(h.value),1),ie(Ve,{class:"ws-pick-chev",name:"chevron-down",size:"sm"})]),w("div",Wae,[X[53]||(X[53]=w("button",{type:"button",class:"ws-pick-item",tabindex:"-1"},[w("span",{class:"ws-pick-item-name"}),w("span",{class:"ws-pick-item-path"})],-1)),w("button",zae,[w("span",null,B(C(s)("conversation.moreWorkspaces",{count:k.value})),1)]),w("button",Uae,[ie(Ve,{name:"plus",size:"sm"}),w("span",null,B(C(s)("conversation.addWorkspace")),1)])])],512),ie(jt,{text:C(s)("conversation.switchWorkspace")},{default:Ee(()=>[w("button",{type:"button",class:"ws-pick-btn",onClick:X[7]||(X[7]=bt(me=>l.value=!l.value,["stop"]))},[ie(Ve,{name:"folder",size:"sm"}),w("span",jae,B(h.value),1),ie(Ve,{class:De(["ws-pick-chev",{open:l.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),l.value?(b(),I("div",{key:0,class:"ws-pick-backdrop",onClick:X[8]||(X[8]=me=>l.value=!1)})):le("",!0),l.value?(b(),I("div",qae,[(b(!0),I(Be,null,nt(_.value,me=>(b(),I("button",{key:me.id,type:"button",class:De(["ws-pick-item",{on:me.id===e.activeWorkspaceId}]),onClick:bt(je=>g(me.id),["stop"])},[w("span",Kae,B(me.name),1),w("span",Gae,B(me.shortPath),1)],10,Vae))),128)),k.value>0?(b(),I("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:X[9]||(X[9]=bt(me=>a.value=!a.value,["stop"]))},[w("span",null,B(C(s)("conversation.moreWorkspaces",{count:k.value})),1)])):le("",!0),X[54]||(X[54]=w("div",{class:"ws-pick-divider"},null,-1)),w("button",{type:"button",class:"ws-pick-action",onClick:X[10]||(X[10]=bt(me=>{l.value=!1,r("addWorkspace")},["stop"]))},[ie(Ve,{name:"plus",size:"sm"}),w("span",null,B(C(s)("conversation.addWorkspace")),1)])])):le("",!0)],4)):e.starting?le("",!0):(b(),I("button",{key:2,type:"button",class:"empty-add-workspace",onClick:X[11]||(X[11]=me=>r("addWorkspace"))},[ie(Ve,{name:"folder-plus",size:"sm"}),w("span",null,B(C(s)("conversation.addWorkspace")),1)]))]),ie(V5,{ref_key:"emptyComposerRef",ref:F,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:Co,onSteer:X[12]||(X[12]=me=>r("steer",me)),onCommand:X[13]||(X[13]=me=>r("command",me)),onInterrupt:rt,onUnqueue:X[14]||(X[14]=me=>r("unqueue",me)),onEditQueued:X[15]||(X[15]=me=>r("editQueued",me)),onSetPermission:X[16]||(X[16]=me=>r("setPermission",me)),onSetThinking:X[17]||(X[17]=me=>r("setThinking",me)),onTogglePlan:X[18]||(X[18]=me=>r("togglePlan")),onToggleSwarm:X[19]||(X[19]=me=>r("toggleSwarm")),onToggleGoal:X[20]||(X[20]=me=>r("toggleGoal")),onOpenBtw:X[21]||(X[21]=me=>r("command","/btw")),onCreateGoal:X[22]||(X[22]=me=>r("createGoal",me)),onControlGoal:X[23]||(X[23]=me=>r("controlGoal",me)),onFocusGoal:z,onCompact:X[24]||(X[24]=me=>r("compact")),onPickModel:X[25]||(X[25]=me=>r("pickModel")),onSelectModel:X[26]||(X[26]=me=>r("selectModel",me))},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"]),X[56]||(X[56]=w("div",{class:"empty-spacer"},null,-1))],64)):(b(),ye(U5,{ref_key:"chatPaneRef",ref:N,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":tt.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:X[27]||(X[27]=me=>r("openFile",me)),onOpenMedia:X[28]||(X[28]=me=>r("openMedia",me)),onCopyConversationCopied:W,onOpenThinking:X[29]||(X[29]=me=>r("openThinking",me)),onOpenCompaction:X[30]||(X[30]=me=>r("openCompaction",me)),onOpenAgent:X[31]||(X[31]=me=>r("openAgent",me)),onOpenToolDiff:X[32]||(X[32]=me=>r("openToolDiff",me)),onEditMessage:Rs,onLoadOlderMessages:ds,onUnqueue:X[33]||(X[33]=me=>r("unqueue",me)),onEditQueued:fi,onReorderQueue:co},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],32),e.turns.length===0&&!e.sessionLoading?le("",!0):(b(),ye(Aae,{key:0,ref:Qe,style:qt(Ie.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":R.value,"dock-panel":ke.value,"bash-tasks":V.value,"subagent-tasks":U.value,"bash-running":re.value,"subagent-running":ae.value,"todo-done-count":Z.value,"has-dock-work":ne.value,todos:e.todos,"pending-question":se.value,"question-busy-kind":ge.value,"pending-approval":ue.value,"approval-busy":pe.value,mobile:e.mobile,onToggleDockPanel:X[34]||(X[34]=me=>Ye(me)),onCloseDockPanel:X[35]||(X[35]=me=>ve()),onOpenAgent:X[36]||(X[36]=me=>r("openAgent",me)),onAnswer:jo,onDismiss:X[37]||(X[37]=me=>r("dismiss",me)),onApproval:Ot,onCancelTask:X[38]||(X[38]=me=>r("cancelTask",me)),onControlGoal:X[39]||(X[39]=me=>r("controlGoal",me)),onSubmit:Co,onSteer:X[40]||(X[40]=me=>r("steer",me)),onCommand:X[41]||(X[41]=me=>r("command",me)),onInterrupt:rt,onSetPermission:X[42]||(X[42]=me=>r("setPermission",me)),onSetThinking:X[43]||(X[43]=me=>r("setThinking",me)),onTogglePlan:X[44]||(X[44]=me=>r("togglePlan")),onToggleSwarm:X[45]||(X[45]=me=>r("toggleSwarm")),onToggleGoal:X[46]||(X[46]=me=>r("toggleGoal")),onOpenBtw:X[47]||(X[47]=me=>r("command","/btw")),onCreateGoal:X[48]||(X[48]=me=>r("createGoal",me)),onFocusGoal:z,onCompact:X[49]||(X[49]=me=>r("compact")),onPickModel:X[50]||(X[50]=me=>r("pickModel")),onSelectModel:X[51]||(X[51]=me=>r("selectModel",me))},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(cl,{name:"pill"},{default:Ee(()=>[vt.value?(b(),I("button",{key:0,class:"newmsg-pill",style:qt({bottom:`${Te.value+12}px`}),"aria-label":C(s)("conversation.jumpToLatestAria"),onClick:X[52]||(X[52]=me=>gn(!0))},[ie(Ve,{class:"pill-chevron",name:"chevron-down",size:"md"}),Ge(" "+B(C(s)("conversation.newMessages")),1)],12,Yae)):le("",!0)]),_:1}),ie(cl,{name:"abort-toast"},{default:Ee(()=>[Bn.value?(b(),I("div",Zae,[w("span",Qae,B(C(s)("conversation.manuallyAborted")),1)])):le("",!0)]),_:1})],2))}}),tce=ut(ece,[["__scopeId","data-v-cc90eb04"]]),nce=["aria-selected","onClick"],sce=qe({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),I("div",{class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(b(!0),I(Be,null,nt(e.options,i=>(b(),I("button",{key:i.value,class:De(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},B(i.label),11,nce))),128))],2))}}),to=ut(sce,[["__scopeId","data-v-d1aaccd7"]]),oce={class:"ui-panel-header__title"},ice={key:0,class:"ui-panel-header__sub"},rce=qe({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-panel-header",{wrap:e.wrap}])},[w("span",oce,B(e.title),1),ie(jt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(b(),I("span",ice,B(e.subtitle),1)):le("",!0)]),_:1},8,["text"]),In(t.$slots,"default",{},void 0,!0),e.closable?(b(),ye(Nn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])):le("",!0)],2))}}),ca=ut(rce,[["__scopeId","data-v-c47879ad"]]),lce={key:0,class:"fp-empty fp-error"},ace={key:1,class:"fp-empty"},cce={key:2,class:"fp-loading"},uce={class:"fp-path"},dce={class:"fp-meta"},fce={key:0,class:"fp-lines"},hce={class:"fp-size"},pce={key:3,class:"fp-search"},mce=["placeholder"],gce={key:0,class:"fp-search-count"},vce=["href","aria-label"],yce={key:1,class:"fp-code"},kce={class:"fp-line-table"},bce=["data-line"],xce={class:"fp-gutter"},_ce=["innerHTML"],wce={key:1,class:"fp-body fp-code"},Sce={class:"fp-line-table"},Cce=["data-line"],Ace={class:"fp-gutter"},Mce=["innerHTML"],Ece={key:2,class:"fp-body"},Tce=["srcdoc","title"],Nce={key:1,class:"fp-code"},Ice={class:"fp-line-table"},$ce=["data-line"],Lce={class:"fp-gutter"},Fce=["innerHTML"],Oce={key:3,class:"fp-body fp-pdf-wrap"},Rce=["src","title"],Bce={key:1,class:"fp-binary-card"},Dce={class:"fp-binary-label"},Pce={key:4,class:"fp-body fp-table-wrap"},Hce={class:"fp-table"},Wce=["data-line"],zce={key:5,class:"fp-body fp-image-wrap"},Uce=["src","alt"],jce={key:1,class:"fp-binary-card"},qce={class:"fp-binary-icon"},Vce={class:"fp-binary-label"},Kce={key:6,class:"fp-body fp-code"},Gce={class:"fp-line-table"},Yce=["data-line"],Zce={class:"fp-gutter"},Qce=["innerHTML"],Xce={key:7,class:"fp-body fp-binary-wrap"},Jce={class:"fp-binary-card"},eue={class:"fp-binary-icon"},tue={class:"fp-binary-label"},nue=qe({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Et();function s(ve,Y){const ce=Y?Y.split("/").filter(Boolean):[];for(const fe of ve.split("/"))fe===""||fe==="."||(fe===".."?ce.pop():ce.push(fe));return ce.join("/")}const o=Ut("resolveImage",async ve=>ve),i=P(()=>{const ve=c.file?.path??"",Y=ve.lastIndexOf("/");return Y>0?ve.slice(0,Y):""});function r(ve){if(/^(https?:|data:|blob:)/i.test(ve)||ve.startsWith("/"))return ve;const Y=i.value;return Y?s(ve,Y):ve}async function l(ve){const Y=r(ve);return o?o(Y):Y}An("resolveImage",l);function a(ve){let Y=ve.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(Y)||Y.startsWith("/"))return ve;for(const fe of["#","?"]){const j=Y.indexOf(fe);j!==-1&&(Y=Y.slice(0,j))}const ce=i.value;return{...ve,path:s(Y,ce)}}const c=e,u=t;function d(ve){c.openFile?.(a(ve))}const f=Q(null),p=P(()=>{const ve=c.file;if(!ve)return"binary";const Y=ve.mime??"",ce=ve.languageId??"",fe=ve.path.toLowerCase();return Y==="text/markdown"||ce==="markdown"||ce==="md"||fe.endsWith(".mdx")?"markdown":Y==="application/json"||ce==="json"?"json":Y==="text/html"||ce==="html"||fe.endsWith(".html")||fe.endsWith(".htm")?"html":Y==="application/pdf"||fe.endsWith(".pdf")?"pdf":Y==="text/csv"||ce==="csv"||fe.endsWith(".csv")?"csv":Y.startsWith("image/")?"image":ve.isBinary?"binary":Y.startsWith("text/")||ce!==""?"text":"binary"});function h(ve){const Y=atob(ve),ce=Uint8Array.from(Y,fe=>fe.charCodeAt(0));return new TextDecoder().decode(ce)}const m=P(()=>{const ve=c.file;if(!ve)return"";if(ve.encoding==="base64")try{return h(ve.content)}catch{return ve.content}return ve.content}),_=P(()=>{if(p.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=P(()=>c.file?(p.value==="json"?_.value:m.value).split(`
|
|
298
|
-
`):[]),g=P(()=>c.file?p.value==="json"?_.value:m.value:""),v=Q(""),y=Q(0),A=P(()=>{const ve=v.value.trim().toLowerCase();if(!ve)return[];const Y=[];return k.value.forEach((ce,fe)=>{ce.toLowerCase().includes(ve)&&Y.push(fe+1)}),Y});Ke(v,()=>{y.value=0});function L(ve,Y=!1){ve&&pt(()=>{const ce=f.value?.querySelector(".fp-body"),fe=ce?.querySelector(`[data-line="${ve}"]`);if(!ce||!fe)return;Y&&(ce.scrollTop=0);const j=ce.getBoundingClientRect(),se=fe.getBoundingClientRect(),ge=se.top-j.top+ce.scrollTop;ce.scrollTop=ge-ce.clientHeight/2+se.height/2})}Ke(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(ve){const Y=A.value;Y.length!==0&&(y.value=(y.value+ve+Y.length)%Y.length,L(Y[y.value]))}function x(ve){const Y=A.value;return{target:c.line===ve,hit:Y.includes(ve),active:Y[y.value]===ve}}function E(ve){return ve<1024?`${ve} B`:ve<1024*1024?`${(ve/1024).toFixed(1)} KB`:`${(ve/(1024*1024)).toFixed(1)} MB`}const N=Q(!1),F=Q(!1);function S(){c.file&&js(g.value).then(ve=>{ve&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function T(){c.file&&js(c.file.path).then(ve=>{ve&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const R=Q("preview"),O=Q("preview"),D=Q("fit");function W(ve){R.value=ve}function z(ve){O.value=ve}function V(ve){D.value=ve}Ke(p,ve=>{R.value=ve==="html"?"preview":"source",O.value="preview",D.value="fit"});const U=P(()=>{const ve=c.file;return!ve||p.value!=="image"?null:ve.sourceUrl?ve.sourceUrl:ve.encoding==="base64"?`data:${ve.mime};base64,${ve.content}`:ve.mime==="image/svg+xml"?`data:${ve.mime};charset=utf-8,${encodeURIComponent(ve.content)}`:null}),re=P(()=>{const ve=c.file;return!ve||p.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ve.encoding==="base64"?`data:${ve.mime};base64,${ve.content}`:null}),ae=P(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function te(ve){const Y=[];let ce="",fe=!1;for(let j=0;j<ve.length;j++){const se=ve[j];se==='"'&&ve[j+1]==='"'?(ce+='"',j++):se==='"'?fe=!fe:se===","&&!fe?(Y.push(ce),ce=""):ce+=se}return Y.push(ce),Y}const Z=P(()=>k.value.slice(0,200).map(te));function ne(ve){return ve.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function ke(){const ve=c.file;if(!ve)return"";const Y=ve.languageId?.toLowerCase();return Y||(ve.path.split(".").pop()?.toLowerCase()??"")}function Se(ve){const Y=ke();let ce=ne(ve);return p.value==="json"||Y==="json"||Y==="jsonc"?(ce=ce.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),ce=ce.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),ce=ce.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ce=ce.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ce):p.value==="html"||Y==="html"||Y==="xml"||Y==="svg"?(ce=ce.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ce=ce.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ce):(ce=ce.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>'),ce=ce.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ce)}function Ye(ve,Y=55){return!ve||ve.length<=Y?ve:"…"+ve.slice(ve.length-Y+1)}return(ve,Y)=>(b(),I("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(b(),I("div",lce,[w("span",null,B(e.error),1),e.closable?(b(),ye(Ft,{key:0,variant:"secondary",size:"sm",onClick:Y[0]||(Y[0]=ce=>u("close"))},{default:Ee(()=>[Ge(B(C(n)("filePreview.close")),1)]),_:1})):le("",!0)])):!e.file&&!e.loading?(b(),I("div",ace,B(C(n)("filePreview.empty")),1)):e.loading?(b(),I("div",cce,[Y[7]||(Y[7]=w("span",{class:"spinner"},null,-1)),w("span",null,B(C(n)("filePreview.loading")),1)])):e.file?(b(),I(Be,{key:3},[ie(ca,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:Y[6]||(Y[6]=ce=>u("close"))},{default:Ee(()=>[ie(jt,{text:e.file.path},{default:Ee(()=>[w("span",uce,B(Ye(e.file.path)),1)]),_:1},8,["text"]),w("span",dce,[e.file.lineCount?(b(),I("span",fce,B(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):le("",!0),w("span",hce,B(E(e.file.size)),1)]),p.value==="html"?(b(),ye(to,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):le("",!0),p.value==="markdown"?(b(),ye(to,{key:1,"model-value":O.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"])):le("",!0),p.value==="image"?(b(),ye(to,{key:2,"model-value":D.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":V},null,8,["model-value","options"])):le("",!0),p.value==="text"||p.value==="json"||p.value==="html"||p.value==="csv"?(b(),I("div",pce,[Tn(w("input",{"onUpdate:modelValue":Y[1]||(Y[1]=ce=>v.value=ce),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,mce),[[ao,v.value]]),v.value.trim()?(b(),I("span",gce,B(A.value.length),1)):le("",!0),ie(Nn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:Y[2]||(Y[2]=ce=>$(-1))},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Nn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:Y[3]||(Y[3]=ce=>$(1))},{default:Ee(()=>[ie(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):le("",!0),ie(Nn,{size:"sm",class:De({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:T},{default:Ee(()=>[F.value?(b(),ye(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ye(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(b(),ye(Nn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:Y[4]||(Y[4]=ce=>u("openExternal"))},{default:Ee(()=>[ie(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):le("",!0),e.externalActions?(b(),ye(Nn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:Y[5]||(Y[5]=ce=>u("reveal"))},{default:Ee(()=>[ie(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):le("",!0),e.downloadUrl?(b(),I("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,vce)):le("",!0),!e.file.isBinary&&p.value!=="image"?(b(),ye(Nn,{key:7,size:"sm",class:De({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[N.value?(b(),ye(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ye(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):le("",!0)]),_:1},8,["title","closable","close-label"]),p.value==="markdown"?(b(),I("div",{key:0,class:De(["fp-body",{"fp-markdown":O.value==="preview"}])},[O.value==="preview"?(b(),ye(rm,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(b(),I("div",yce,[w("div",kce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",xce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,_ce)],10,bce))),128))])]))],2)):p.value==="json"?(b(),I("div",wce,[w("div",Sce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Ace,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Mce)],10,Cce))),128))])])):p.value==="html"?(b(),I("div",Ece,[R.value==="preview"?(b(),I("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ae.value,title:e.file.path},null,8,Tce)):(b(),I("div",Nce,[w("div",Ice,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Lce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Fce)],10,$ce))),128))])]))])):p.value==="pdf"?(b(),I("div",Oce,[re.value?(b(),I("iframe",{key:0,class:"fp-pdf-frame",src:re.value,title:e.file.path},null,8,Rce)):(b(),I("div",Bce,[w("span",Dce,B(C(n)("filePreview.pdfNoPreview")),1)]))])):p.value==="csv"?(b(),I("div",Pce,[w("table",Hce,[w("tbody",null,[(b(!0),I(Be,null,nt(Z.value,(ce,fe)=>(b(),I("tr",{key:fe,class:De(x(fe+1)),"data-line":fe+1},[w("th",null,B(fe+1),1),(b(!0),I(Be,null,nt(ce,(j,se)=>(b(),I("td",{key:se},B(j),1))),128))],10,Wce))),128))])])])):p.value==="image"?(b(),I("div",zce,[U.value?(b(),I("img",{key:0,src:U.value,alt:e.file.path,class:De(["fp-image",{actual:D.value==="actual"}])},null,10,Uce)):(b(),I("div",jce,[w("span",qce,[ie(Ve,{name:"image-off",size:"lg"})]),w("span",Vce,B(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):p.value==="text"?(b(),I("div",Kce,[w("div",Gce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Zce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Qce)],10,Yce))),128))])])):(b(),I("div",Xce,[w("div",Jce,[w("span",eue,[ie(Ve,{name:"file-off",size:"lg"})]),w("span",tue,B(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):le("",!0)],512))}}),sue=ut(nue,[["__scopeId","data-v-62bfaf2d"]]),oue={class:"tp"},iue=qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=Q(null);return Ke(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||pt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(b(),I("div",oue,[ie(ca,{title:C(o)("common.preview"),subtitle:e.subtitle??C(o)("thinking.panelTitle"),"close-label":C(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),w("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},B(e.text),513)]))}}),cC=ut(iue,[["__scopeId","data-v-cf9c560b"]]),rue={class:"ap"},lue={key:0,class:"ap-type"},aue={key:1,class:"ap-reason"},cue={key:2,class:"ap-field"},uue={class:"ap-field-body"},due={key:3,class:"ap-field"},fue={class:"ap-field-body ap-live"},hue={key:4,class:"ap-field"},pue={class:"ap-field-body ap-progress"},mue={key:0,class:"ap-call"},gue={key:1,class:"ap-output"},vue=["onClick"],yue={key:5,class:"ap-field"},kue={class:"ap-field-body"},bue=8,uC=5,dC=2,xue=qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=P(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=P(()=>(n.member.text??"").trimEnd());function l(m){const _=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},_.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},_.push(k));return _}const a=P(()=>l(i.value)),c=Q(new Set);function u(m){return c.value.has(m)}function d(m){const _=new Set(c.value);_.has(m)?_.delete(m):_.add(m),c.value=_}function f(m){return m.output.length-uC-dC}function p(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const h=Q(null);return Ke(()=>i.value.length+r.value.length,()=>{const m=h.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||pt(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})},{immediate:!0}),(m,_)=>(b(),I("div",rue,[ie(ca,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:_[0]||(_[0]=k=>s("close"))},{default:Ee(()=>[ie(Ro,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Ge(B(p(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:h,class:"ap-body"},[e.member.subagentType?(b(),I("div",lue,B(e.member.subagentType),1)):le("",!0),e.member.suspendedReason?(b(),I("div",aue,B(e.member.suspendedReason),1)):le("",!0),e.member.prompt?(b(),I("div",cue,[_[1]||(_[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",uue,B(e.member.prompt),1)])):le("",!0),r.value?(b(),I("div",due,[_[2]||(_[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",fue,B(r.value),1)])):le("",!0),a.value.length>0?(b(),I("div",hue,[_[4]||(_[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",pue,[(b(!0),I(Be,null,nt(a.value,k=>(b(),I("div",{key:k.key,class:"ap-group"},[k.call?(b(),I("div",mue,[_[3]||(_[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Ge(" "+B(k.call),1)])):le("",!0),k.output.length>0?(b(),I("div",gue,[k.output.length<=bue||u(k.key)?(b(!0),I(Be,{key:0},nt(k.output,(g,v)=>(b(),I("div",{key:v,class:"ap-out-line"},B(g),1))),128)):(b(),I(Be,{key:1},[(b(!0),I(Be,null,nt(k.output.slice(0,uC),(g,v)=>(b(),I("div",{key:v,class:"ap-out-line"},B(g),1))),128)),w("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+B(f(k))+" more) ",9,vue),(b(!0),I(Be,null,nt(k.output.slice(-dC),(g,v)=>(b(),I("div",{key:"t"+v,class:"ap-out-line"},B(g),1))),128))],64))])):le("",!0)]))),128))])])):le("",!0),e.member.summary?(b(),I("div",yue,[_[5]||(_[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",kue,B(e.member.summary),1)])):le("",!0)],512)]))}}),_ue=ut(xue,[["__scopeId","data-v-715bd93e"]]),wue={class:"diff-lines"},Sue={key:0,class:"hunk-text"},Cue={class:"dl-gutter old"},Aue={class:"dl-gutter new"},Mue={class:"dl-sign"},Eue={class:"dl-text"},Tue=qe({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(b(),I("div",wue,[(b(!0),I(Be,null,nt(e.lines,(r,l)=>(b(),I("div",{key:l,class:De(["dl",s(r)])},[r.type==="hunk"?(b(),I("span",Sue,B(r.text),1)):(b(),I(Be,{key:1},[w("span",Cue,B(t(r)),1),w("span",Aue,B(n(r)),1),w("span",Mue,B(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",Eue,B(r.text),1)],64))],2))),128))]))}}),G5=ut(Tue,[["__scopeId","data-v-2f6bc1cc"]]),Nue={class:"tdp"},Iue={class:"tdp-body"},$ue={key:1,class:"tdp-output"},Lue={key:2,class:"tdp-empty"},Fue=qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Et();return(o,i)=>(b(),I("div",Nue,[ie(ca,{title:e.target.title,subtitle:e.target.path,"close-label":C(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),w("div",Iue,[e.target.lines&&e.target.lines.length>0?(b(),ye(G5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(b(),I("div",$ue,[(b(!0),I(Be,null,nt(e.target.output,(r,l)=>(b(),I("div",{key:l},B(r),1))),128))])):(b(),I("div",Lue,B(C(s)("diff.noDiff")),1))])]))}}),Oue=ut(Fue,[["__scopeId","data-v-76f2fbca"]]),Rue={class:"sc"},Bue={key:0,class:"sc-empty"},Due={key:2,class:"sc-loading","aria-hidden":"true"},Pue={class:"sc-composer"},Hue=["placeholder"],Wue=["disabled"],zue=qe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=P(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=P(()=>n.title?.trim()||o("sideChat.title")),l=P(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=Q(""),c=Q(null),u=Q(null);function d(){const k=a.value.trim();k&&(s("send",k),a.value="",pt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const p=P(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((A,L)=>A+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Ke(p,async()=>{!n.running&&!n.sending||(await pt(),f())});const h=P(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function _(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(b(),I("div",Rue,[ie(ca,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(b(),I("div",Bue,B(C(o)("sideChat.empty")),1)):(b(),ye(U5,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),h.value?(b(),I("div",Due,[ie(z5)])):le("",!0)],512),w("div",Pue,[Tn(w("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,Hue),[[ao,a.value]]),ie(jt,{text:C(o)("sideChat.send")},{default:Ee(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(Ve,{name:"arrow-right",size:"sm"})],8,Wue)]),_:1},8,["text"])])]))}}),Uue=ut(zue,[["__scopeId","data-v-9ee5df02"]]),jue={class:"changes-pane"},que={class:"dv-path"},Vue={class:"diff-head"},Kue={class:"back-label"},Gue={key:0,class:"empty-state"},Yue={key:1,class:"dv-lines-wrap"},Zue={key:2,class:"empty-state"},Que={class:"dv-change-count"},Xue={class:"ch-head"},Jue={class:"br-label"},ede={class:"br-name"},tde={key:0,class:"sync-info"},nde={key:0,class:"ahead"},sde={key:0,class:"behind"},ode={key:1,class:"empty-head"},ide={key:0,class:"ch-list"},rde=["onClick"],lde={class:"fpath"},ade={key:1,class:"ch-list ch-tree"},cde={class:"tree-list"},ude=["onClick"],dde={class:"tree-name"},fde=["onClick"],hde={class:"tree-name"},pde={key:2,class:"empty-state"},mde={key:3,class:"empty-state"},gde=qe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=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=P(()=>s.gitInfo!==null),u=P(()=>s.changes.length>0),d=P(()=>(s.selectedDiffPath??null)!==null),f=P(()=>s.mode==="detail"||s.mode==="full"&&d.value),p=P(()=>s.fileDiff??[]),h=P(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function _(){o("back")}function k(){o("close")}const g=Q("list");function v(F){g.value=F}function y(F){const S={children:[]},T=[...F].sort((R,O)=>R.path.localeCompare(O.path));for(const R of T){const O=R.path.split("/");let D=S;for(let W=0;W<O.length;W++){const z=O[W],V=W===O.length-1,U=O.slice(0,W+1).join("/");let re=D.children.find(ae=>ae.name===z&&ae.kind===(V?"file":"folder"));re||(re={name:z,path:U,kind:V?"file":"folder",status:V?R.status:void 0,children:[]},D.children.push(re)),D=re}}return S.children}const A=P(()=>y(s.changes)),L=Q(new Set);function $(F){return!L.value.has(F)}const x=P(()=>{const F=[];function S(T,R){for(const O of T)F.push({node:O,depth:R}),O.kind==="folder"&&$(O.path)&&S(O.children,R+1)}return S(A.value,0),F});function E(F){const S=new Set(L.value);S.has(F.path)?S.delete(F.path):S.add(F.path),L.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(b(),I("div",jue,[f.value?(b(),I(Be,{key:0},[ie(ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[ie(jt,{text:e.selectedDiffPath??""},{default:Ee(()=>[w("span",que,B(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",Vue,[e.hideBack?le("",!0):(b(),ye(Ft,{key:0,variant:"ghost",size:"sm",onClick:_},{default:Ee(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",Kue,B(C(n)("diff.back")),1)]),_:1}))]),h.value?(b(),I("div",Gue,B(C(n)("diff.loading")),1)):p.value.length>0?(b(),I("div",Yue,[ie(G5,{lines:p.value},null,8,["lines"])])):(b(),I("div",Zue,B(C(n)("diff.noDiff")),1))],64)):(b(),I(Be,{key:1},[ie(ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[w("span",Que,B(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(to,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),w("div",Xue,[c.value?(b(),I(Be,{key:0},[w("span",Jue,B(C(n)("diff.branch")),1),w("span",ede,B(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(b(),I("span",tde,[ie(jt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(b(),I("span",nde,"↑"+B(e.gitInfo.ahead),1)):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(b(),I("span",sde,"↓"+B(e.gitInfo.behind),1)):le("",!0)]),_:1},8,["text"])])):le("",!0)],64)):(b(),I("span",ode,B(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(b(),I("div",ide,[(b(!0),I(Be,null,nt(e.changes,T=>(b(),ye(jt,{key:T.path,text:T.path},{default:Ee(()=>[w("button",{type:"button",class:"ch-row",onClick:R=>m(T.path)},[w("span",{class:De(["badge",i(T.status)])},B(l(T.status)),3),w("span",lde,B(a(T.path)),1)],8,rde)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(b(),I("div",ade,[w("ul",cde,[(b(!0),I(Be,null,nt(x.value,({node:T,depth:R})=>(b(),I("li",{key:T.path,class:"tree-node"},[T.kind==="folder"?(b(),I("button",{key:0,type:"button",class:"tree-row tree-folder",style:qt({paddingLeft:N(R)}),onClick:O=>E(T)},[ie(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",dde,B(T.name),1)],12,ude)):(b(),ye(jt,{key:1,text:T.path},{default:Ee(()=>[w("button",{type:"button",class:"tree-row tree-file",style:qt({paddingLeft:N(R)}),onClick:O=>m(T.path)},[w("span",{class:De(["badge",i(T.status)])},B(l(T.status)),3),w("span",hde,B(T.name),1)],12,fde)]),_:2},1032,["text"]))]))),128))])])):c.value?(b(),I("div",pde,B(C(n)("diff.clean")),1)):(b(),I("div",mde,B(C(n)("diff.empty")),1))],64))]))}}),vde=ut(gde,[["__scopeId","data-v-7778610a"]]);function ik(e,t){let n=null;ln(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,pt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),es(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const yde=["type","value","placeholder","disabled","readonly"],kde=qe({__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 s=n,o=Q();function i(a){s("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,c)=>(b(),I("input",{ref_key:"el",ref:o,class:De(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,yde))}}),sa=ut(kde,[["__scopeId","data-v-340f0da2"]]),bde={class:"search-wrap"},xde={key:0,class:"tab-strip"},_de={key:1,class:"state-row"},wde={key:2,class:"state-row unavail"},Sde={key:3,class:"model-list"},Cde=["aria-selected","onClick","onMouseenter"],Ade={class:"check"},Mde={class:"model-main"},Ede={class:"model-name"},Tde={class:"model-id"},Nde={key:0,class:"caps"},Ide={class:"model-provider"},$de={class:"model-ctx"},Lde={key:0,class:"empty"},Fde={class:"footer-hint"},Ode=qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=Q(""),a=Q(null),c=Q(null),u=Q("all");ik(c,a);const d=P(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const A of s.models)v.has(A.provider)||(v.add(A.provider),y.push({id:A.provider,label:A.provider}));return y}),f=P(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const L=(A.displayName??A.model).toLowerCase().includes(v),$=A.provider.toLowerCase().includes(v),x=A.id.toLowerCase().includes(v);return!v||L||$||x});return u.value!=="all"?y:y.sort((A,L)=>{const $=r(A.id)?1:0;return(r(L.id)?1:0)-$})}),p=P(()=>f.value),h=Q(0);Ke([l,u],()=>{h.value=0}),Ke(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ke(p,v=>{h.value=Math.min(h.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),h.value=Math.min(h.value+1,p.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),h.value=Math.max(h.value-1,0);else if(v.key==="Enter"){const y=p.value[h.value];y&&o("select",y.id)}}ln(()=>{document.addEventListener("keydown",m)}),fn(()=>{document.removeEventListener("keydown",m)});function _(v){o("select",v)}function k(v){return p.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=A=>o("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",bde,[ie(sa,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(b(),I("div",xde,[(b(!0),I(Be,null,nt(d.value,A=>(b(),ye(Ft,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(A.id)},{default:Ee(()=>[Ge(B(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):le("",!0),e.loading?(b(),I("div",_de,[ie(wo,{size:"sm"}),w("span",null,B(C(n)("model.loading")),1)])):e.unavailable?(b(),I("div",wde,[ie(Ve,{name:"alert-triangle",size:"lg"}),w("span",null,B(C(n)("model.unavailable")),1)])):(b(),I("div",Sde,[(b(!0),I(Be,null,nt(p.value,A=>(b(),I("div",{key:A.id,class:De(["model-row",{"is-current":A.id===e.current,"is-selected":k(A)===h.value}]),role:"option","aria-selected":A.id===e.current,onClick:L=>_(A.id),onMouseenter:L=>h.value=k(A)},[w("span",Ade,[A.id===e.current?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),w("span",Mde,[w("span",Ede,B(A.displayName??A.model),1),w("span",Tde,B(A.id),1),A.capabilities&&A.capabilities.length>0?(b(),I("span",Nde,[(b(!0),I(Be,null,nt(A.capabilities,L=>(b(),ye(Ro,{key:L,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(L),1)]),_:2},1024))),128))])):le("",!0)]),w("span",Ide,B(A.provider),1),w("span",$de,B(C(n)("model.contextSuffix",{size:Math.round(A.maxContextSize/1e3)})),1),ie(Nn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt(L=>o("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(b(),ye(Ve,{key:0,name:"star",size:"md"})):(b(),ye(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Cde))),128)),p.value.length===0&&!e.loading&&!e.unavailable?(b(),I("div",Lde,B(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):le("",!0)])),w("div",Fde,B(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Rde=ut(Ode,[["__scopeId","data-v-e93073d7"]]),Bde={key:0,class:"ui-field__label"},Dde={key:1,class:"ui-field__error"},Pde={key:2,class:"ui-field__hint"},Hde=qe({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(b(),I("label",Bde,B(e.label),1)):le("",!0),In(t.$slots,"default",{},void 0,!0),e.error?(b(),I("span",Dde,B(e.error),1)):e.hint?(b(),I("span",Pde,B(e.hint),1)):le("",!0)],2))}}),xu=ut(Hde,[["__scopeId","data-v-49bce958"]]),Wde=["value","disabled"],zde=qe({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(b(),I("select",{class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[In(o.$slots,"default",{},void 0,!0)],42,Wde))}}),gv=ut(zde,[["__scopeId","data-v-92a040fd"]]),Ude={class:"prov-list"},jde={key:0,class:"state-row"},qde={key:1,class:"state-row unavail"},Vde={key:2,class:"empty"},Kde={class:"prov-info"},Gde={class:"prov-type"},Yde={key:0,class:"prov-url"},Zde={class:"prov-meta"},Qde={key:0},Xde={class:"prov-actions"},Jde={key:0,class:"add-section"},efe={key:0,class:"add-btns"},tfe={key:1,class:"add-form"},nfe=["value"],sfe={key:0,class:"add-error"},ofe={class:"form-btns"},ife={class:"footer-hint"},rfe=qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=Q(null);ik(o);const i=t;async function r(k){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",k)}const l=Q(!1),a=Ss({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Q(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function p(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function h(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}ln(()=>document.addEventListener("keydown",h)),fn(()=>document.removeEventListener("keydown",h));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function _(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",Ude,[e.loading?(b(),I("div",jde,[ie(wo,{size:"sm"}),w("span",null,B(C(n)("providers.loading")),1)])):e.unavailable?(b(),I("div",qde,[ie(Ve,{name:"alert-triangle",size:"md"}),w("span",null,B(C(n)("providers.unavailable")),1)])):e.providers.length===0?(b(),I("div",Vde,B(C(n)("providers.empty")),1)):(b(!0),I(Be,{key:3},nt(e.providers,v=>(b(),I("div",{key:v.id,class:"prov-row"},[ie(jt,{text:_(v.status)},{default:Ee(()=>[w("span",{class:De(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:qt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",Kde,[w("span",Gde,B(v.type),1),v.baseUrl?(b(),I("span",Yde,B(v.baseUrl),1)):le("",!0),w("span",Zde,[ie(Ro,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Ge(B(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(b(),I("span",Qde," · "+B(C(n)("providers.modelCount",{count:v.models.length})),1)):le("",!0)])]),w("div",Xde,[ie(jt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:Ee(()=>[ie(Ft,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:Ee(()=>[Ge(B(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(jt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:Ee(()=>[ie(Ft,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:Ee(()=>[Ge(B(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?le("",!0):(b(),I("div",Jde,[l.value?(b(),I("div",tfe,[ie(xu,{label:C(n)("providers.fieldType")},{default:Ee(()=>[ie(gv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:Ee(()=>[(b(),I(Be,null,nt(u,v=>w("option",{key:v,value:v},B(v),9,nfe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[ie(sa,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[ie(sa,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[ie(sa,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(b(),I("div",sfe,B(c.value),1)):le("",!0),w("div",ofe,[ie(Ft,{variant:"primary",size:"sm",onClick:p},{default:Ee(()=>[Ge(B(C(n)("providers.add")),1)]),_:1}),ie(Ft,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ge(B(C(n)("common.cancel")),1)]),_:1})])])):(b(),I("div",efe,[ie(Ft,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Ge(" "+B(C(n)("providers.loginKimi")),1)]),_:1}),ie(Ft,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Ge(" "+B(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Ft,{variant:"primary",size:"sm",onClick:d},{default:Ee(()=>[ie(Ve,{name:"plus",size:"sm"}),Ge(" "+B(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",ife,B(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),lfe=ut(rfe,[["__scopeId","data-v-fb6f1365"]]),afe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},cfe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},ufe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},P0=qe({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(b(),I("svg",afe,[...n[0]||(n[0]=[w("circle",{cx:"18",cy:"18",r:"15"},null,-1),w("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(b(),I("svg",cfe,[...n[1]||(n[1]=[w("circle",{cx:"14",cy:"14",r:"12"},null,-1),w("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),w("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(b(),I("svg",ufe,[...n[2]||(n[2]=[w("path",{d:"M14 3 L26 24 H2 Z"},null,-1),w("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),w("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),dfe={key:0,class:"center-body"},ffe={class:"center-text"},hfe={key:1,class:"nb"},pfe={class:"nb-lead"},mfe=["href"],gfe={class:"nb-or"},vfe={class:"nb-fallback"},yfe={class:"nb-fb-text"},kfe=["href"],bfe={class:"nb-code-row"},xfe={class:"nb-code"},_fe={class:"nb-status"},wfe={class:"nb-status-text"},Sfe={class:"nb-countdown"},Cfe={key:2,class:"center-body"},Afe={class:"center-text success-text"},Mfe={class:"center-hint"},Efe={class:"center-body"},Tfe={class:"center-text err-text"},Nfe={class:"center-hint"},Ife={class:"actions"},$fe={class:"center-body"},Lfe={class:"center-text warn-text"},Ffe={class:"center-hint"},Ofe={class:"actions"},Rfe=qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Et(),s=Q(!0),o=t,i=e,r=Q("starting"),l=Q(null),a=Q(0),c=Q(!1);let u=null,d=null;ln(async()=>{await f()}),fn(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",p(),h(y.interval)}function p(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(y){u&&clearTimeout(u),u=setTimeout(async()=>{const A=await i.onPollOAuthLogin();A?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):A?.status==="expired"||A?.status==="cancelled"?(m(),r.value="expired"):h(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function k(){!l.value||!await js(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(y){const A=Math.floor(y/60),L=y%60;return`${A}:${String(L).padStart(2,"0")}`}return(y,A)=>(b(),ye(Sr,{open:s.value,"onUpdate:open":A[0]||(A[0]=L=>s.value=L),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:Ee(()=>[r.value==="starting"?(b(),I("div",dfe,[ie(wo,{size:"md"}),w("span",ffe,B(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(b(),I("div",hfe,[w("div",pfe,B(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Ge(B(C(n)("login.authorizeInBrowser"))+" ",1),ie(Ve,{name:"external-link",size:"sm"})],8,mfe),w("div",gfe,B(C(n)("login.orDivider")),1),w("div",vfe,[w("div",yfe,[Ge(B(C(n)("login.fallbackPrefix")),1),w("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},B(l.value.verificationUri),9,kfe),Ge(B(C(n)("login.fallbackSuffix")),1)]),w("div",bfe,[w("span",xfe,B(l.value.userCode),1),ie(Ft,{class:De(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:Ee(()=>[c.value?(b(),I(Be,{key:0},[ie(Ve,{name:"check",size:"sm"}),Ge(" "+B(C(n)("login.copied")),1)],64)):(b(),I(Be,{key:1},[ie(Ve,{name:"copy",size:"sm"}),Ge(" "+B(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",_fe,[ie(wo,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",wfe,B(C(n)("login.waitingAutoClose")),1),w("span",Sfe,B(v(a.value)),1)])])):r.value==="success"?(b(),I("div",Cfe,[ie(P0,{kind:"success"}),w("span",Afe,B(C(n)("login.success")),1),w("span",Mfe,B(C(n)("login.successHint")),1)])):r.value==="expired"?(b(),I(Be,{key:3},[w("div",Efe,[ie(P0,{kind:"expired"}),w("span",Tfe,B(C(n)("login.expiredTitle")),1),w("span",Nfe,B(C(n)("login.expiredHint")),1)]),w("div",Ife,[ie(Ft,{variant:"primary",onClick:_},{default:Ee(()=>[Ge(B(C(n)("login.retry")),1)]),_:1}),ie(Ft,{variant:"secondary",onClick:g},{default:Ee(()=>[Ge(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(b(),I(Be,{key:4},[w("div",$fe,[ie(P0,{kind:"error"}),w("span",Lfe,B(C(n)("login.errorTitle")),1),w("span",Ffe,B(C(n)("login.errorHint")),1)]),w("div",Ofe,[ie(Ft,{variant:"primary",onClick:_},{default:Ee(()=>[Ge(B(C(n)("login.retry")),1)]),_:1}),ie(Ft,{variant:"secondary",onClick:g},{default:Ee(()=>[Ge(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):le("",!0)]),_:1},8,["open","title"]))}}),Bfe=ut(Rfe,[["__scopeId","data-v-b228800e"]]);function Dfe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Pfe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Hfe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),a=new Map;for(const p of t)l.has(p.root)||a.has(p.root)||a.set(p.root,{...p});for(const p of n){const h=p.cwd;h&&(l.has(h)||a.has(h)||a.set(h,{id:p.workspaceId??h,root:h,name:Dfe(h),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const p of n){const h=Pfe(t,p);c.set(h,(c.get(h)??0)+1)}const u=[...new Set(t.filter(p=>!l.has(p.root)).map(p=>p.root))],d=[...a.keys()].filter(p=>!u.includes(p));d.sort((p,h)=>p.localeCompare(h));const f=[];for(const p of[...u,...d]){const h=a.get(p),m=c.get(h.id)??c.get(h.root)??0,_=r[h.id]===!1?m:Math.max(h.sessionCount,m);let k=h.branch;!k&&i&&o===h.root&&(k=i),f.push({...h,sessionCount:_,branch:k})}return f}function Wfe(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 s=e.filter(o=>{const i=Date.parse(o.createdAt);return!Number.isNaN(i)&&i<n});return s.length>0?[...s,...t]:t}function zfe(e){const t=new Map,n=new Set;function s(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&s(i)});return t.set(i,l),l}function o(i){if(t.has(i)){n.add(i);return}s(i)}return{run:s,request:o}}const Ufe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function jfe(e){return Ufe.has(e.type)}function qfe(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Vfe(e,t,n=qfe){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}const Y5=["blue","mono"],Z5=["light","dark","system"],Q5=14,Kfe=12,Gfe=20;function Yfe(){const e=Qn($t.accent);return e&&Y5.includes(e)?e:"blue"}function Zfe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Qfe(){const e=Qn($t.colorScheme);return e&&Z5.includes(e)?e:"system"}function Xfe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function rk(e){return Number.isFinite(e)?Math.min(Gfe,Math.max(Kfe,Math.round(e))):Q5}function Jfe(){const e=Qn($t.uiFontSize);return e===null?Q5:rk(Number(e))}function ehe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${rk(e)}px`)}const lk=Q(Qfe()),ak=Q(Yfe()),ck=Q(Jfe());Ke(lk,Xfe,{immediate:!0});Ke(ak,Zfe,{immediate:!0});Ke(ck,ehe,{immediate:!0});function the(e){Z5.includes(e)&&(lk.value=e,ts($t.colorScheme,e))}function nhe(e){Y5.includes(e)&&(ak.value=e,ts($t.accent,e))}function she(e){const t=rk(e);ck.value=t,ts($t.uiFontSize,String(t))}const ohe=600,ihe=250,lm=250,rhe=1e3,lhe=160,ip=Q(!1);let ql=[],Yl=null,rp=-lm;function ahe(){ql=[],rp=-lm,ip.value=!1,Yl!==null&&(clearTimeout(Yl),Yl=null)}function che(){ip.value=!0,Yl!==null&&clearTimeout(Yl),Yl=setTimeout(()=>{Yl=null,ql=[],rp=-lm,ip.value=!1},rhe)}function uhe(e){if(e<=0)return;const t=Date.now();ql.push({time:t,chars:e});const n=t-ohe;if(ql=ql.filter(l=>l.time>=n),t-rp<lm)return;rp=t;const s=ql[0]?.time??t,o=Math.max(t-s,ihe);ql.reduce((l,a)=>l+a.chars,0)/o*1e3>=lhe&&che()}function X5(){return{colorScheme:lk,accent:ak,uiFontSize:ck,fastMoon:ip,setColorScheme:the,setAccent:nhe,setUiFontSize:she,resetFastMoon:ahe,recordMoonDelta:uhe}}function dhe(e,t,n){return e==="idle"&&!t&&!n}function uk(e,t){const n=Qn(e);return n===null?t:n==="1"}const dk=Q(uk($t.notifyOnComplete,!0)),fk=Q(uk($t.notifyOnQuestion,!1)),hk=Q(uk($t.notifyOnApproval,!1)),pk=Q(typeof Notification<"u"?Notification.permission:"denied"),fhe="/favicon.ico";async function mk(e,t,n){if(!n){e.value=!1,ts(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}pk.value=s,s==="granted"&&(e.value=!0,ts(t,"1"))}function hhe(e){return mk(dk,$t.notifyOnComplete,e)}function phe(e){return mk(fk,$t.notifyOnQuestion,e)}function mhe(e){return mk(hk,$t.notifyOnApproval,e)}function gk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function ghe(e){return{title:yn.global.t("settings.notifyTitle"),body:gk(e,yn.global.t("settings.notifyFallback"))}}function vhe(e,t){return{title:yn.global.t("settings.notifyQuestionTitle"),body:gk(t,e,yn.global.t("settings.notifyQuestionFallback"))}}function yhe(e,t){return{title:yn.global.t("settings.notifyApprovalTitle"),body:gk(t,e,yn.global.t("settings.notifyApprovalFallback"))}}function vk(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{pk.value=i,i==="granted"&&fC(t,n,s)});return}fC(t,n,s)}}function fC(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:fhe});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function khe(e,t){vk(dk.value,t,ghe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function bhe(e){vk(fk.value,e,vhe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function xhe(e){vk(hk.value,e,yhe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function _he(){return{notifyOnComplete:dk,notifyOnQuestion:fk,notifyOnApproval:hk,notifyPermission:pk,setNotifyOnComplete:hhe,setNotifyOnQuestion:phe,setNotifyOnApproval:mhe,maybeNotifyCompletion:khe,maybeNotifyQuestion:bhe,maybeNotifyApproval:xhe}}function whe(){return Qn($t.soundOnComplete)==="1"}const Bc=Q(whe());function She(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let H0=null;function J5(){const e=She();if(!e)return null;if(H0===null)try{H0=new e}catch{return null}return H0}function eM(){if(!Bc.value)return;const e=J5();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 hC=!1;function Che(){if(hC||typeof window>"u")return;hC=!0;const e=()=>{eM()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Che();function Ahe(e){Bc.value=e,ts($t.soundOnComplete,e?"1":"0"),e&&eM()}function pC(e,t,n,s,o){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(o,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+s),i.start(l),i.stop(l+s+.02)}function yk(){const e=J5();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{pC(e,880,0,.16,.18),pC(e,1320,.1,.22,.16),ar("sound: chime scheduled",{state:e.state})}catch(t){ar("sound: failed to play",{error:String(t)})}}function Mhe(){Bc.value&&yk()}function Ehe(){Bc.value&&yk()}function The(){Bc.value&&yk()}function Nhe(){return{soundOnComplete:Bc,setSoundOnComplete:Ahe,maybePlayCompletionSound:Mhe,maybePlayQuestionSound:Ehe,maybePlayApprovalSound:The}}function mC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const Ihe=1e3,$he=4096,gC=32*1024;function Lhe(e,t){let n=null,s;const o=new Set;async function i(f){try{const h=await ft().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:mC(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,p){if(e.activeSessionId!==f)return;const h=p??e.tasksBySession[f]??[],m=ft(),_=new Map;if(await Promise.all(h.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!o.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:gC});y.outputPreview!==void 0&&_.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),_.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=_.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const p=ft();let h;try{h=await p.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async v=>{const y=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!A)&&!(A&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await p.getTask(f,v.id,{withOutput:!0,outputBytes:y?$he:gC});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{A&&o.add(v.id)}}));const _=e.tasksBySession[f]??[],k=new Map(_.map(v=>[v.id,v])),g=h.map(v=>{const y=k.get(v.id),A=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:A?.preview??y?.outputPreview,outputBytes:A?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:mC(g,_)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Ihe))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=Q(0);let d=null;return Ke(()=>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}),Ke(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[f]??[];return{sid:f,hasRunning:p.some(h=>h.status==="running")}},({sid:f,hasRunning:p},h,m)=>{let _;p&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:P(()=>u.value),loadTasksForSession:i}}const tM=$t.starredModels;function Fhe(){try{const e=Qn(tM);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Ohe(e){try{ts(tM,JSON.stringify(e))}catch{}}function Rhe(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Q([]),d=Q(Fhe()),f=Q({}),p=Q({}),h=Q([]),m=Q(null);function _(V){if(!(V==null||V.length===0))return u.value.find(U=>U.id===V||U.model===V)}function k(){const V=e.activeSessionId?e.sessions.find(U=>U.id===e.activeSessionId):void 0;return _(V?.model??m.value??e.defaultModel)}function g(V){const U=aa(k(),V);return e.thinking=U,l(U),U}async function v(V){try{const re=await ft().listSkills(V);f.value={...f.value,[V]:re}}catch{}}async function y(V){try{const re=await ft().listSkillsForWorkspace(V);p.value={...p.value,[V]:re}}catch{}}async function A(){try{const V=ft();u.value=await V.listModels(),g(e.thinking)}catch(V){n("loadModels",V)}}async function L(){try{const V=await ft().refreshOAuthProviderModels();for(const U of V.failed)n("refreshOAuthProviderModels",new Error(U.reason),{message:U.provider})}catch{}}async function $(){try{const V=ft();h.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function x(V){const U=e.activeSessionId,re=aa(_(V),e.thinking),ae=e.thinking;if(!U)return m.value=V,g(re),!0;const te=e.sessions.find(Z=>Z.id===U)?.model;a(U,Z=>({...Z,model:V})),re!==ae&&(e.thinking=re,l(re));try{await ft().updateSession(U,{model:V,thinking:re!==ae?re:void 0})}catch(Z){return a(U,ne=>({...ne,model:te??ne.model})),re!==ae&&(e.thinking=ae,l(ae)),n("setModel",Z,{sessionId:U}),!1}return await s(U),!0}function E(V){const U=new Set(d.value);U.has(V)?U.delete(V):U.add(V),d.value=Array.from(U),Ohe(d.value)}async function N(V,U,re){const ae=re??e.activeSessionId;if(!ae)return;const te=i.value==="idle"&&!r.has(ae),Z=`msg_skill_opt_${Date.now().toString(36)}`;if(te){r.add(ae),e.sendingBySession={...e.sendingBySession,[ae]:!0};const ne={id:Z,sessionId:ae,role:"user",content:[{type:"text",text:`/${V}${U?` ${U}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:U}}};c(ae,ke=>[...ke,ne])}try{await ft().activateSkill(ae,V,U)}catch(ne){te&&(r.delete(ae),e.sendingBySession={...e.sendingBySession,[ae]:!1},c(ae,ke=>ke.filter(Se=>Se.id!==Z))),n("activateSkill",ne,{sessionId:ae})}}async function F(V){try{await ft().addProvider(V),await Promise.all([$(),A()])}catch(U){n("addProvider",U)}}async function S(V){try{await ft().deleteProvider(V),await Promise.all([$(),A()])}catch(U){n("deleteProvider",U)}}async function T(V){try{const U=await ft().refreshProvider(V);for(const re of U.failed)n("refreshProvider",new Error(re.reason),{message:re.provider});await Promise.all([$(),A()])}catch(U){n("refreshProvider",U)}}async function R(){try{const V=await ft().refreshAllProviders();for(const U of V.failed)n("refreshAllProviders",new Error(U.reason),{message:U.provider});await Promise.all([$(),A()])}catch(V){n("refreshAllProviders",V)}}async function O(){try{return await ft().startOAuthLogin()}catch{return null}}async function D(){try{return await ft().pollOAuthLogin()}catch{return null}}async function W(){try{await ft().cancelOAuthLogin()}catch{}}function z(V){const U=g(V);o({thinking:U})}return{models:u,starredModelIds:d,providers:h,draftModel:m,skillsBySession:f,skillsByWorkspace:p,loadSkillsForSession:v,loadSkillsForWorkspace:y,loadModels:A,refreshOAuthProviderModels:L,loadProviders:$,setModel:x,toggleStarModel:E,activateSkill:N,addProvider:F,deleteProvider:S,refreshProvider:T,refreshAllProviders:R,startOAuthLogin:O,pollOAuthLogin:D,cancelOAuthLogin:W,setThinking:z}}const nM="kimiWeb.compaction",Bhe=/^read[_-]?media(?:file)?$/i,Dhe=/^data:([^;]+);base64,(.*)$/s,Phe=/^<(image|video|audio)\s+path="([^"]+)">$/,Hhe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Whe=/Mime type:\s*([^.\s]+)/i,zhe=/Size:\s*(\d+)\s*bytes/i,Uhe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function jhe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function qhe(e){const t=Hhe.exec(e.trim());return t?{kind:t[1],path:jhe(t[2])}:null}const Vhe=/^f_[A-Za-z0-9]{10,}$/;function Khe(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return Vhe.test(s)?s:void 0}function Ghe(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 Yhe(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 Zhe(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Qhe(e,t){if(!Bhe.test(e))return;const n=Yhe(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const p=d.text,h=Phe.exec(p);h&&(o=h[1],s=h[2]);const m=Whe.exec(p);m?.[1]&&(i=m[1]);const _=zhe.exec(p);_?.[1]&&(r=Number(_[1]));const k=Uhe.exec(p);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Zhe(d);f&&(a=f)}if(a===null)return;const c=Dhe.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Ghe(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Xhe(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
298
|
+
`):[]),g=P(()=>c.file?p.value==="json"?_.value:m.value:""),v=Q(""),y=Q(0),A=P(()=>{const ve=v.value.trim().toLowerCase();if(!ve)return[];const Y=[];return k.value.forEach((ce,fe)=>{ce.toLowerCase().includes(ve)&&Y.push(fe+1)}),Y});Ke(v,()=>{y.value=0});function L(ve,Y=!1){ve&&pt(()=>{const ce=f.value?.querySelector(".fp-body"),fe=ce?.querySelector(`[data-line="${ve}"]`);if(!ce||!fe)return;Y&&(ce.scrollTop=0);const j=ce.getBoundingClientRect(),se=fe.getBoundingClientRect(),ge=se.top-j.top+ce.scrollTop;ce.scrollTop=ge-ce.clientHeight/2+se.height/2})}Ke(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(ve){const Y=A.value;Y.length!==0&&(y.value=(y.value+ve+Y.length)%Y.length,L(Y[y.value]))}function x(ve){const Y=A.value;return{target:c.line===ve,hit:Y.includes(ve),active:Y[y.value]===ve}}function E(ve){return ve<1024?`${ve} B`:ve<1024*1024?`${(ve/1024).toFixed(1)} KB`:`${(ve/(1024*1024)).toFixed(1)} MB`}const N=Q(!1),F=Q(!1);function S(){c.file&&js(g.value).then(ve=>{ve&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function T(){c.file&&js(c.file.path).then(ve=>{ve&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const R=Q("preview"),O=Q("preview"),D=Q("fit");function W(ve){R.value=ve}function z(ve){O.value=ve}function V(ve){D.value=ve}Ke(p,ve=>{R.value=ve==="html"?"preview":"source",O.value="preview",D.value="fit"});const U=P(()=>{const ve=c.file;return!ve||p.value!=="image"?null:ve.sourceUrl?ve.sourceUrl:ve.encoding==="base64"?`data:${ve.mime};base64,${ve.content}`:ve.mime==="image/svg+xml"?`data:${ve.mime};charset=utf-8,${encodeURIComponent(ve.content)}`:null}),re=P(()=>{const ve=c.file;return!ve||p.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ve.encoding==="base64"?`data:${ve.mime};base64,${ve.content}`:null}),ae=P(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function te(ve){const Y=[];let ce="",fe=!1;for(let j=0;j<ve.length;j++){const se=ve[j];se==='"'&&ve[j+1]==='"'?(ce+='"',j++):se==='"'?fe=!fe:se===","&&!fe?(Y.push(ce),ce=""):ce+=se}return Y.push(ce),Y}const Z=P(()=>k.value.slice(0,200).map(te));function ne(ve){return ve.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function ke(){const ve=c.file;if(!ve)return"";const Y=ve.languageId?.toLowerCase();return Y||(ve.path.split(".").pop()?.toLowerCase()??"")}function Se(ve){const Y=ke();let ce=ne(ve);return p.value==="json"||Y==="json"||Y==="jsonc"?(ce=ce.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),ce=ce.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),ce=ce.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ce=ce.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ce):p.value==="html"||Y==="html"||Y==="xml"||Y==="svg"?(ce=ce.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ce=ce.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ce):(ce=ce.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>'),ce=ce.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ce)}function Ye(ve,Y=55){return!ve||ve.length<=Y?ve:"…"+ve.slice(ve.length-Y+1)}return(ve,Y)=>(b(),I("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(b(),I("div",lce,[w("span",null,B(e.error),1),e.closable?(b(),ye(Ft,{key:0,variant:"secondary",size:"sm",onClick:Y[0]||(Y[0]=ce=>u("close"))},{default:Ee(()=>[Ge(B(C(n)("filePreview.close")),1)]),_:1})):le("",!0)])):!e.file&&!e.loading?(b(),I("div",ace,B(C(n)("filePreview.empty")),1)):e.loading?(b(),I("div",cce,[Y[7]||(Y[7]=w("span",{class:"spinner"},null,-1)),w("span",null,B(C(n)("filePreview.loading")),1)])):e.file?(b(),I(Be,{key:3},[ie(ca,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:Y[6]||(Y[6]=ce=>u("close"))},{default:Ee(()=>[ie(jt,{text:e.file.path},{default:Ee(()=>[w("span",uce,B(Ye(e.file.path)),1)]),_:1},8,["text"]),w("span",dce,[e.file.lineCount?(b(),I("span",fce,B(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):le("",!0),w("span",hce,B(E(e.file.size)),1)]),p.value==="html"?(b(),ye(to,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):le("",!0),p.value==="markdown"?(b(),ye(to,{key:1,"model-value":O.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"])):le("",!0),p.value==="image"?(b(),ye(to,{key:2,"model-value":D.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":V},null,8,["model-value","options"])):le("",!0),p.value==="text"||p.value==="json"||p.value==="html"||p.value==="csv"?(b(),I("div",pce,[Tn(w("input",{"onUpdate:modelValue":Y[1]||(Y[1]=ce=>v.value=ce),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,mce),[[ao,v.value]]),v.value.trim()?(b(),I("span",gce,B(A.value.length),1)):le("",!0),ie(Nn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:Y[2]||(Y[2]=ce=>$(-1))},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Nn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:Y[3]||(Y[3]=ce=>$(1))},{default:Ee(()=>[ie(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):le("",!0),ie(Nn,{size:"sm",class:De({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:T},{default:Ee(()=>[F.value?(b(),ye(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ye(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(b(),ye(Nn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:Y[4]||(Y[4]=ce=>u("openExternal"))},{default:Ee(()=>[ie(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):le("",!0),e.externalActions?(b(),ye(Nn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:Y[5]||(Y[5]=ce=>u("reveal"))},{default:Ee(()=>[ie(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):le("",!0),e.downloadUrl?(b(),I("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,vce)):le("",!0),!e.file.isBinary&&p.value!=="image"?(b(),ye(Nn,{key:7,size:"sm",class:De({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[N.value?(b(),ye(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ye(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):le("",!0)]),_:1},8,["title","closable","close-label"]),p.value==="markdown"?(b(),I("div",{key:0,class:De(["fp-body",{"fp-markdown":O.value==="preview"}])},[O.value==="preview"?(b(),ye(rm,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(b(),I("div",yce,[w("div",kce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",xce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,_ce)],10,bce))),128))])]))],2)):p.value==="json"?(b(),I("div",wce,[w("div",Sce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Ace,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Mce)],10,Cce))),128))])])):p.value==="html"?(b(),I("div",Ece,[R.value==="preview"?(b(),I("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ae.value,title:e.file.path},null,8,Tce)):(b(),I("div",Nce,[w("div",Ice,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Lce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Fce)],10,$ce))),128))])]))])):p.value==="pdf"?(b(),I("div",Oce,[re.value?(b(),I("iframe",{key:0,class:"fp-pdf-frame",src:re.value,title:e.file.path},null,8,Rce)):(b(),I("div",Bce,[w("span",Dce,B(C(n)("filePreview.pdfNoPreview")),1)]))])):p.value==="csv"?(b(),I("div",Pce,[w("table",Hce,[w("tbody",null,[(b(!0),I(Be,null,nt(Z.value,(ce,fe)=>(b(),I("tr",{key:fe,class:De(x(fe+1)),"data-line":fe+1},[w("th",null,B(fe+1),1),(b(!0),I(Be,null,nt(ce,(j,se)=>(b(),I("td",{key:se},B(j),1))),128))],10,Wce))),128))])])])):p.value==="image"?(b(),I("div",zce,[U.value?(b(),I("img",{key:0,src:U.value,alt:e.file.path,class:De(["fp-image",{actual:D.value==="actual"}])},null,10,Uce)):(b(),I("div",jce,[w("span",qce,[ie(Ve,{name:"image-off",size:"lg"})]),w("span",Vce,B(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):p.value==="text"?(b(),I("div",Kce,[w("div",Gce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Zce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Qce)],10,Yce))),128))])])):(b(),I("div",Xce,[w("div",Jce,[w("span",eue,[ie(Ve,{name:"file-off",size:"lg"})]),w("span",tue,B(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):le("",!0)],512))}}),sue=ut(nue,[["__scopeId","data-v-62bfaf2d"]]),oue={class:"tp"},iue=qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=Q(null);return Ke(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||pt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(b(),I("div",oue,[ie(ca,{title:C(o)("common.preview"),subtitle:e.subtitle??C(o)("thinking.panelTitle"),"close-label":C(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),w("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},B(e.text),513)]))}}),cC=ut(iue,[["__scopeId","data-v-cf9c560b"]]),rue={class:"ap"},lue={key:0,class:"ap-type"},aue={key:1,class:"ap-reason"},cue={key:2,class:"ap-field"},uue={class:"ap-field-body"},due={key:3,class:"ap-field"},fue={class:"ap-field-body ap-live"},hue={key:4,class:"ap-field"},pue={class:"ap-field-body ap-progress"},mue={key:0,class:"ap-call"},gue={key:1,class:"ap-output"},vue=["onClick"],yue={key:5,class:"ap-field"},kue={class:"ap-field-body"},bue=8,uC=5,dC=2,xue=qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=P(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=P(()=>(n.member.text??"").trimEnd());function l(m){const _=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},_.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},_.push(k));return _}const a=P(()=>l(i.value)),c=Q(new Set);function u(m){return c.value.has(m)}function d(m){const _=new Set(c.value);_.has(m)?_.delete(m):_.add(m),c.value=_}function f(m){return m.output.length-uC-dC}function p(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const h=Q(null);return Ke(()=>i.value.length+r.value.length,()=>{const m=h.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||pt(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})},{immediate:!0}),(m,_)=>(b(),I("div",rue,[ie(ca,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:_[0]||(_[0]=k=>s("close"))},{default:Ee(()=>[ie(Ro,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Ge(B(p(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:h,class:"ap-body"},[e.member.subagentType?(b(),I("div",lue,B(e.member.subagentType),1)):le("",!0),e.member.suspendedReason?(b(),I("div",aue,B(e.member.suspendedReason),1)):le("",!0),e.member.prompt?(b(),I("div",cue,[_[1]||(_[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",uue,B(e.member.prompt),1)])):le("",!0),r.value?(b(),I("div",due,[_[2]||(_[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",fue,B(r.value),1)])):le("",!0),a.value.length>0?(b(),I("div",hue,[_[4]||(_[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",pue,[(b(!0),I(Be,null,nt(a.value,k=>(b(),I("div",{key:k.key,class:"ap-group"},[k.call?(b(),I("div",mue,[_[3]||(_[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Ge(" "+B(k.call),1)])):le("",!0),k.output.length>0?(b(),I("div",gue,[k.output.length<=bue||u(k.key)?(b(!0),I(Be,{key:0},nt(k.output,(g,v)=>(b(),I("div",{key:v,class:"ap-out-line"},B(g),1))),128)):(b(),I(Be,{key:1},[(b(!0),I(Be,null,nt(k.output.slice(0,uC),(g,v)=>(b(),I("div",{key:v,class:"ap-out-line"},B(g),1))),128)),w("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+B(f(k))+" more) ",9,vue),(b(!0),I(Be,null,nt(k.output.slice(-dC),(g,v)=>(b(),I("div",{key:"t"+v,class:"ap-out-line"},B(g),1))),128))],64))])):le("",!0)]))),128))])])):le("",!0),e.member.summary?(b(),I("div",yue,[_[5]||(_[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",kue,B(e.member.summary),1)])):le("",!0)],512)]))}}),_ue=ut(xue,[["__scopeId","data-v-715bd93e"]]),wue={class:"diff-lines"},Sue={key:0,class:"hunk-text"},Cue={class:"dl-gutter old"},Aue={class:"dl-gutter new"},Mue={class:"dl-sign"},Eue={class:"dl-text"},Tue=qe({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(b(),I("div",wue,[(b(!0),I(Be,null,nt(e.lines,(r,l)=>(b(),I("div",{key:l,class:De(["dl",s(r)])},[r.type==="hunk"?(b(),I("span",Sue,B(r.text),1)):(b(),I(Be,{key:1},[w("span",Cue,B(t(r)),1),w("span",Aue,B(n(r)),1),w("span",Mue,B(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",Eue,B(r.text),1)],64))],2))),128))]))}}),G5=ut(Tue,[["__scopeId","data-v-2f6bc1cc"]]),Nue={class:"tdp"},Iue={class:"tdp-body"},$ue={key:1,class:"tdp-output"},Lue={key:2,class:"tdp-empty"},Fue=qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Et();return(o,i)=>(b(),I("div",Nue,[ie(ca,{title:e.target.title,subtitle:e.target.path,"close-label":C(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),w("div",Iue,[e.target.lines&&e.target.lines.length>0?(b(),ye(G5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(b(),I("div",$ue,[(b(!0),I(Be,null,nt(e.target.output,(r,l)=>(b(),I("div",{key:l},B(r),1))),128))])):(b(),I("div",Lue,B(C(s)("diff.noDiff")),1))])]))}}),Oue=ut(Fue,[["__scopeId","data-v-76f2fbca"]]),Rue={class:"sc"},Bue={key:0,class:"sc-empty"},Due={key:2,class:"sc-loading","aria-hidden":"true"},Pue={class:"sc-composer"},Hue=["placeholder"],Wue=["disabled"],zue=qe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=P(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=P(()=>n.title?.trim()||o("sideChat.title")),l=P(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=Q(""),c=Q(null),u=Q(null);function d(){const k=a.value.trim();k&&(s("send",k),a.value="",pt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const p=P(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((A,L)=>A+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Ke(p,async()=>{!n.running&&!n.sending||(await pt(),f())});const h=P(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function _(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(b(),I("div",Rue,[ie(ca,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(b(),I("div",Bue,B(C(o)("sideChat.empty")),1)):(b(),ye(U5,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),h.value?(b(),I("div",Due,[ie(z5)])):le("",!0)],512),w("div",Pue,[Tn(w("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,Hue),[[ao,a.value]]),ie(jt,{text:C(o)("sideChat.send")},{default:Ee(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(Ve,{name:"arrow-right",size:"sm"})],8,Wue)]),_:1},8,["text"])])]))}}),Uue=ut(zue,[["__scopeId","data-v-9ee5df02"]]),jue={class:"changes-pane"},que={class:"dv-path"},Vue={class:"diff-head"},Kue={class:"back-label"},Gue={key:0,class:"empty-state"},Yue={key:1,class:"dv-lines-wrap"},Zue={key:2,class:"empty-state"},Que={class:"dv-change-count"},Xue={class:"ch-head"},Jue={class:"br-label"},ede={class:"br-name"},tde={key:0,class:"sync-info"},nde={key:0,class:"ahead"},sde={key:0,class:"behind"},ode={key:1,class:"empty-head"},ide={key:0,class:"ch-list"},rde=["onClick"],lde={class:"fpath"},ade={key:1,class:"ch-list ch-tree"},cde={class:"tree-list"},ude=["onClick"],dde={class:"tree-name"},fde=["onClick"],hde={class:"tree-name"},pde={key:2,class:"empty-state"},mde={key:3,class:"empty-state"},gde=qe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=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=P(()=>s.gitInfo!==null),u=P(()=>s.changes.length>0),d=P(()=>(s.selectedDiffPath??null)!==null),f=P(()=>s.mode==="detail"||s.mode==="full"&&d.value),p=P(()=>s.fileDiff??[]),h=P(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function _(){o("back")}function k(){o("close")}const g=Q("list");function v(F){g.value=F}function y(F){const S={children:[]},T=[...F].sort((R,O)=>R.path.localeCompare(O.path));for(const R of T){const O=R.path.split("/");let D=S;for(let W=0;W<O.length;W++){const z=O[W],V=W===O.length-1,U=O.slice(0,W+1).join("/");let re=D.children.find(ae=>ae.name===z&&ae.kind===(V?"file":"folder"));re||(re={name:z,path:U,kind:V?"file":"folder",status:V?R.status:void 0,children:[]},D.children.push(re)),D=re}}return S.children}const A=P(()=>y(s.changes)),L=Q(new Set);function $(F){return!L.value.has(F)}const x=P(()=>{const F=[];function S(T,R){for(const O of T)F.push({node:O,depth:R}),O.kind==="folder"&&$(O.path)&&S(O.children,R+1)}return S(A.value,0),F});function E(F){const S=new Set(L.value);S.has(F.path)?S.delete(F.path):S.add(F.path),L.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(b(),I("div",jue,[f.value?(b(),I(Be,{key:0},[ie(ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[ie(jt,{text:e.selectedDiffPath??""},{default:Ee(()=>[w("span",que,B(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",Vue,[e.hideBack?le("",!0):(b(),ye(Ft,{key:0,variant:"ghost",size:"sm",onClick:_},{default:Ee(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",Kue,B(C(n)("diff.back")),1)]),_:1}))]),h.value?(b(),I("div",Gue,B(C(n)("diff.loading")),1)):p.value.length>0?(b(),I("div",Yue,[ie(G5,{lines:p.value},null,8,["lines"])])):(b(),I("div",Zue,B(C(n)("diff.noDiff")),1))],64)):(b(),I(Be,{key:1},[ie(ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[w("span",Que,B(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(to,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),w("div",Xue,[c.value?(b(),I(Be,{key:0},[w("span",Jue,B(C(n)("diff.branch")),1),w("span",ede,B(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(b(),I("span",tde,[ie(jt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(b(),I("span",nde,"↑"+B(e.gitInfo.ahead),1)):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(b(),I("span",sde,"↓"+B(e.gitInfo.behind),1)):le("",!0)]),_:1},8,["text"])])):le("",!0)],64)):(b(),I("span",ode,B(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(b(),I("div",ide,[(b(!0),I(Be,null,nt(e.changes,T=>(b(),ye(jt,{key:T.path,text:T.path},{default:Ee(()=>[w("button",{type:"button",class:"ch-row",onClick:R=>m(T.path)},[w("span",{class:De(["badge",i(T.status)])},B(l(T.status)),3),w("span",lde,B(a(T.path)),1)],8,rde)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(b(),I("div",ade,[w("ul",cde,[(b(!0),I(Be,null,nt(x.value,({node:T,depth:R})=>(b(),I("li",{key:T.path,class:"tree-node"},[T.kind==="folder"?(b(),I("button",{key:0,type:"button",class:"tree-row tree-folder",style:qt({paddingLeft:N(R)}),onClick:O=>E(T)},[ie(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",dde,B(T.name),1)],12,ude)):(b(),ye(jt,{key:1,text:T.path},{default:Ee(()=>[w("button",{type:"button",class:"tree-row tree-file",style:qt({paddingLeft:N(R)}),onClick:O=>m(T.path)},[w("span",{class:De(["badge",i(T.status)])},B(l(T.status)),3),w("span",hde,B(T.name),1)],12,fde)]),_:2},1032,["text"]))]))),128))])])):c.value?(b(),I("div",pde,B(C(n)("diff.clean")),1)):(b(),I("div",mde,B(C(n)("diff.empty")),1))],64))]))}}),vde=ut(gde,[["__scopeId","data-v-7778610a"]]);function ik(e,t){let n=null;ln(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,pt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),es(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const yde=["type","value","placeholder","disabled","readonly"],kde=qe({__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 s=n,o=Q();function i(a){s("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,c)=>(b(),I("input",{ref_key:"el",ref:o,class:De(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,yde))}}),sa=ut(kde,[["__scopeId","data-v-340f0da2"]]),bde={class:"search-wrap"},xde={key:0,class:"tab-strip"},_de={key:1,class:"state-row"},wde={key:2,class:"state-row unavail"},Sde={key:3,class:"model-list"},Cde=["aria-selected","onClick","onMouseenter"],Ade={class:"check"},Mde={class:"model-main"},Ede={class:"model-name"},Tde={class:"model-id"},Nde={key:0,class:"caps"},Ide={class:"model-provider"},$de={class:"model-ctx"},Lde={key:0,class:"empty"},Fde={class:"footer-hint"},Ode=qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=Q(""),a=Q(null),c=Q(null),u=Q("all");ik(c,a);const d=P(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const A of s.models)v.has(A.provider)||(v.add(A.provider),y.push({id:A.provider,label:A.provider}));return y}),f=P(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const L=(A.displayName??A.model).toLowerCase().includes(v),$=A.provider.toLowerCase().includes(v),x=A.id.toLowerCase().includes(v);return!v||L||$||x});return u.value!=="all"?y:y.sort((A,L)=>{const $=r(A.id)?1:0;return(r(L.id)?1:0)-$})}),p=P(()=>f.value),h=Q(0);Ke([l,u],()=>{h.value=0}),Ke(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ke(p,v=>{h.value=Math.min(h.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),h.value=Math.min(h.value+1,p.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),h.value=Math.max(h.value-1,0);else if(v.key==="Enter"){const y=p.value[h.value];y&&o("select",y.id)}}ln(()=>{document.addEventListener("keydown",m)}),fn(()=>{document.removeEventListener("keydown",m)});function _(v){o("select",v)}function k(v){return p.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=A=>o("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",bde,[ie(sa,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(b(),I("div",xde,[(b(!0),I(Be,null,nt(d.value,A=>(b(),ye(Ft,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(A.id)},{default:Ee(()=>[Ge(B(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):le("",!0),e.loading?(b(),I("div",_de,[ie(wo,{size:"sm"}),w("span",null,B(C(n)("model.loading")),1)])):e.unavailable?(b(),I("div",wde,[ie(Ve,{name:"alert-triangle",size:"lg"}),w("span",null,B(C(n)("model.unavailable")),1)])):(b(),I("div",Sde,[(b(!0),I(Be,null,nt(p.value,A=>(b(),I("div",{key:A.id,class:De(["model-row",{"is-current":A.id===e.current,"is-selected":k(A)===h.value}]),role:"option","aria-selected":A.id===e.current,onClick:L=>_(A.id),onMouseenter:L=>h.value=k(A)},[w("span",Ade,[A.id===e.current?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),w("span",Mde,[w("span",Ede,B(A.displayName??A.model),1),w("span",Tde,B(A.id),1),A.capabilities&&A.capabilities.length>0?(b(),I("span",Nde,[(b(!0),I(Be,null,nt(A.capabilities,L=>(b(),ye(Ro,{key:L,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(L),1)]),_:2},1024))),128))])):le("",!0)]),w("span",Ide,B(A.provider),1),w("span",$de,B(C(n)("model.contextSuffix",{size:Math.round(A.maxContextSize/1e3)})),1),ie(Nn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt(L=>o("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(b(),ye(Ve,{key:0,name:"star",size:"md"})):(b(),ye(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Cde))),128)),p.value.length===0&&!e.loading&&!e.unavailable?(b(),I("div",Lde,B(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):le("",!0)])),w("div",Fde,B(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Rde=ut(Ode,[["__scopeId","data-v-e93073d7"]]),Bde={key:0,class:"ui-field__label"},Dde={key:1,class:"ui-field__error"},Pde={key:2,class:"ui-field__hint"},Hde=qe({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(b(),I("label",Bde,B(e.label),1)):le("",!0),In(t.$slots,"default",{},void 0,!0),e.error?(b(),I("span",Dde,B(e.error),1)):e.hint?(b(),I("span",Pde,B(e.hint),1)):le("",!0)],2))}}),xu=ut(Hde,[["__scopeId","data-v-49bce958"]]),Wde=["value","disabled"],zde=qe({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(b(),I("select",{class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[In(o.$slots,"default",{},void 0,!0)],42,Wde))}}),gv=ut(zde,[["__scopeId","data-v-92a040fd"]]),Ude={class:"prov-list"},jde={key:0,class:"state-row"},qde={key:1,class:"state-row unavail"},Vde={key:2,class:"empty"},Kde={class:"prov-info"},Gde={class:"prov-type"},Yde={key:0,class:"prov-url"},Zde={class:"prov-meta"},Qde={key:0},Xde={class:"prov-actions"},Jde={key:0,class:"add-section"},efe={key:0,class:"add-btns"},tfe={key:1,class:"add-form"},nfe=["value"],sfe={key:0,class:"add-error"},ofe={class:"form-btns"},ife={class:"footer-hint"},rfe=qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=Q(null);ik(o);const i=t;async function r(k){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",k)}const l=Q(!1),a=Ss({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Q(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function p(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function h(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}ln(()=>document.addEventListener("keydown",h)),fn(()=>document.removeEventListener("keydown",h));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function _(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",Ude,[e.loading?(b(),I("div",jde,[ie(wo,{size:"sm"}),w("span",null,B(C(n)("providers.loading")),1)])):e.unavailable?(b(),I("div",qde,[ie(Ve,{name:"alert-triangle",size:"md"}),w("span",null,B(C(n)("providers.unavailable")),1)])):e.providers.length===0?(b(),I("div",Vde,B(C(n)("providers.empty")),1)):(b(!0),I(Be,{key:3},nt(e.providers,v=>(b(),I("div",{key:v.id,class:"prov-row"},[ie(jt,{text:_(v.status)},{default:Ee(()=>[w("span",{class:De(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:qt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",Kde,[w("span",Gde,B(v.type),1),v.baseUrl?(b(),I("span",Yde,B(v.baseUrl),1)):le("",!0),w("span",Zde,[ie(Ro,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Ge(B(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(b(),I("span",Qde," · "+B(C(n)("providers.modelCount",{count:v.models.length})),1)):le("",!0)])]),w("div",Xde,[ie(jt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:Ee(()=>[ie(Ft,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:Ee(()=>[Ge(B(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(jt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:Ee(()=>[ie(Ft,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:Ee(()=>[Ge(B(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?le("",!0):(b(),I("div",Jde,[l.value?(b(),I("div",tfe,[ie(xu,{label:C(n)("providers.fieldType")},{default:Ee(()=>[ie(gv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:Ee(()=>[(b(),I(Be,null,nt(u,v=>w("option",{key:v,value:v},B(v),9,nfe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[ie(sa,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[ie(sa,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[ie(sa,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(b(),I("div",sfe,B(c.value),1)):le("",!0),w("div",ofe,[ie(Ft,{variant:"primary",size:"sm",onClick:p},{default:Ee(()=>[Ge(B(C(n)("providers.add")),1)]),_:1}),ie(Ft,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ge(B(C(n)("common.cancel")),1)]),_:1})])])):(b(),I("div",efe,[ie(Ft,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Ge(" "+B(C(n)("providers.loginKimi")),1)]),_:1}),ie(Ft,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Ge(" "+B(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Ft,{variant:"primary",size:"sm",onClick:d},{default:Ee(()=>[ie(Ve,{name:"plus",size:"sm"}),Ge(" "+B(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",ife,B(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),lfe=ut(rfe,[["__scopeId","data-v-fb6f1365"]]),afe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},cfe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},ufe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},P0=qe({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(b(),I("svg",afe,[...n[0]||(n[0]=[w("circle",{cx:"18",cy:"18",r:"15"},null,-1),w("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(b(),I("svg",cfe,[...n[1]||(n[1]=[w("circle",{cx:"14",cy:"14",r:"12"},null,-1),w("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),w("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(b(),I("svg",ufe,[...n[2]||(n[2]=[w("path",{d:"M14 3 L26 24 H2 Z"},null,-1),w("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),w("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),dfe={key:0,class:"center-body"},ffe={class:"center-text"},hfe={key:1,class:"nb"},pfe={class:"nb-lead"},mfe=["href"],gfe={class:"nb-or"},vfe={class:"nb-fallback"},yfe={class:"nb-fb-text"},kfe=["href"],bfe={class:"nb-code-row"},xfe={class:"nb-code"},_fe={class:"nb-status"},wfe={class:"nb-status-text"},Sfe={class:"nb-countdown"},Cfe={key:2,class:"center-body"},Afe={class:"center-text success-text"},Mfe={class:"center-hint"},Efe={class:"center-body"},Tfe={class:"center-text err-text"},Nfe={class:"center-hint"},Ife={class:"actions"},$fe={class:"center-body"},Lfe={class:"center-text warn-text"},Ffe={class:"center-hint"},Ofe={class:"actions"},Rfe=qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Et(),s=Q(!0),o=t,i=e,r=Q("starting"),l=Q(null),a=Q(0),c=Q(!1);let u=null,d=null;ln(async()=>{await f()}),fn(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",p(),h(y.interval)}function p(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(y){u&&clearTimeout(u),u=setTimeout(async()=>{const A=await i.onPollOAuthLogin();A?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):A?.status==="expired"||A?.status==="cancelled"?(m(),r.value="expired"):h(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function k(){!l.value||!await js(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(y){const A=Math.floor(y/60),L=y%60;return`${A}:${String(L).padStart(2,"0")}`}return(y,A)=>(b(),ye(Sr,{open:s.value,"onUpdate:open":A[0]||(A[0]=L=>s.value=L),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:Ee(()=>[r.value==="starting"?(b(),I("div",dfe,[ie(wo,{size:"md"}),w("span",ffe,B(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(b(),I("div",hfe,[w("div",pfe,B(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Ge(B(C(n)("login.authorizeInBrowser"))+" ",1),ie(Ve,{name:"external-link",size:"sm"})],8,mfe),w("div",gfe,B(C(n)("login.orDivider")),1),w("div",vfe,[w("div",yfe,[Ge(B(C(n)("login.fallbackPrefix")),1),w("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},B(l.value.verificationUri),9,kfe),Ge(B(C(n)("login.fallbackSuffix")),1)]),w("div",bfe,[w("span",xfe,B(l.value.userCode),1),ie(Ft,{class:De(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:Ee(()=>[c.value?(b(),I(Be,{key:0},[ie(Ve,{name:"check",size:"sm"}),Ge(" "+B(C(n)("login.copied")),1)],64)):(b(),I(Be,{key:1},[ie(Ve,{name:"copy",size:"sm"}),Ge(" "+B(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",_fe,[ie(wo,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",wfe,B(C(n)("login.waitingAutoClose")),1),w("span",Sfe,B(v(a.value)),1)])])):r.value==="success"?(b(),I("div",Cfe,[ie(P0,{kind:"success"}),w("span",Afe,B(C(n)("login.success")),1),w("span",Mfe,B(C(n)("login.successHint")),1)])):r.value==="expired"?(b(),I(Be,{key:3},[w("div",Efe,[ie(P0,{kind:"expired"}),w("span",Tfe,B(C(n)("login.expiredTitle")),1),w("span",Nfe,B(C(n)("login.expiredHint")),1)]),w("div",Ife,[ie(Ft,{variant:"primary",onClick:_},{default:Ee(()=>[Ge(B(C(n)("login.retry")),1)]),_:1}),ie(Ft,{variant:"secondary",onClick:g},{default:Ee(()=>[Ge(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(b(),I(Be,{key:4},[w("div",$fe,[ie(P0,{kind:"error"}),w("span",Lfe,B(C(n)("login.errorTitle")),1),w("span",Ffe,B(C(n)("login.errorHint")),1)]),w("div",Ofe,[ie(Ft,{variant:"primary",onClick:_},{default:Ee(()=>[Ge(B(C(n)("login.retry")),1)]),_:1}),ie(Ft,{variant:"secondary",onClick:g},{default:Ee(()=>[Ge(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):le("",!0)]),_:1},8,["open","title"]))}}),Bfe=ut(Rfe,[["__scopeId","data-v-b228800e"]]);function Dfe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Pfe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Hfe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),a=new Map;for(const p of t)l.has(p.root)||a.has(p.root)||a.set(p.root,{...p});for(const p of n){const h=p.cwd;h&&(l.has(h)||a.has(h)||a.set(h,{id:p.workspaceId??h,root:h,name:Dfe(h),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const p of n){const h=Pfe(t,p);c.set(h,(c.get(h)??0)+1)}const u=[...new Set(t.filter(p=>!l.has(p.root)).map(p=>p.root))],d=[...a.keys()].filter(p=>!u.includes(p));d.sort((p,h)=>p.localeCompare(h));const f=[];for(const p of[...u,...d]){const h=a.get(p),m=c.get(h.id)??c.get(h.root)??0,_=r[h.id]===!1?m:Math.max(h.sessionCount,m);let k=h.branch;!k&&i&&o===h.root&&(k=i),f.push({...h,sessionCount:_,branch:k})}return f}function Wfe(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 s=e.filter(o=>{const i=Date.parse(o.createdAt);return!Number.isNaN(i)&&i<n});return s.length>0?[...s,...t]:t}function zfe(e){const t=new Map,n=new Set;function s(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&s(i)});return t.set(i,l),l}function o(i){if(t.has(i)){n.add(i);return}s(i)}return{run:s,request:o}}const Ufe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function jfe(e){return Ufe.has(e.type)}function qfe(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Vfe(e,t,n=qfe){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}const Y5=["blue","mono"],Z5=["light","dark","system"],Q5=14,Kfe=12,Gfe=20;function Yfe(){const e=Qn($t.accent);return e&&Y5.includes(e)?e:"blue"}function Zfe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Qfe(){const e=Qn($t.colorScheme);return e&&Z5.includes(e)?e:"system"}function Xfe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function rk(e){return Number.isFinite(e)?Math.min(Gfe,Math.max(Kfe,Math.round(e))):Q5}function Jfe(){const e=Qn($t.uiFontSize);return e===null?Q5:rk(Number(e))}function ehe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${rk(e)}px`)}const lk=Q(Qfe()),ak=Q(Yfe()),ck=Q(Jfe());Ke(lk,Xfe,{immediate:!0});Ke(ak,Zfe,{immediate:!0});Ke(ck,ehe,{immediate:!0});function the(e){Z5.includes(e)&&(lk.value=e,ts($t.colorScheme,e))}function nhe(e){Y5.includes(e)&&(ak.value=e,ts($t.accent,e))}function she(e){const t=rk(e);ck.value=t,ts($t.uiFontSize,String(t))}const ohe=600,ihe=250,lm=250,rhe=1e3,lhe=160,ip=Q(!1);let ql=[],Yl=null,rp=-lm;function ahe(){ql=[],rp=-lm,ip.value=!1,Yl!==null&&(clearTimeout(Yl),Yl=null)}function che(){ip.value=!0,Yl!==null&&clearTimeout(Yl),Yl=setTimeout(()=>{Yl=null,ql=[],rp=-lm,ip.value=!1},rhe)}function uhe(e){if(e<=0)return;const t=Date.now();ql.push({time:t,chars:e});const n=t-ohe;if(ql=ql.filter(l=>l.time>=n),t-rp<lm)return;rp=t;const s=ql[0]?.time??t,o=Math.max(t-s,ihe);ql.reduce((l,a)=>l+a.chars,0)/o*1e3>=lhe&&che()}function X5(){return{colorScheme:lk,accent:ak,uiFontSize:ck,fastMoon:ip,setColorScheme:the,setAccent:nhe,setUiFontSize:she,resetFastMoon:ahe,recordMoonDelta:uhe}}function dhe(e,t,n){return e==="idle"&&!t&&!n}function uk(e,t){const n=Qn(e);return n===null?t:n==="1"}const dk=Q(uk($t.notifyOnComplete,!0)),fk=Q(uk($t.notifyOnQuestion,!1)),hk=Q(uk($t.notifyOnApproval,!1)),pk=Q(typeof Notification<"u"?Notification.permission:"denied"),fhe="/favicon.ico";async function mk(e,t,n){if(!n){e.value=!1,ts(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}pk.value=s,s==="granted"&&(e.value=!0,ts(t,"1"))}function hhe(e){return mk(dk,$t.notifyOnComplete,e)}function phe(e){return mk(fk,$t.notifyOnQuestion,e)}function mhe(e){return mk(hk,$t.notifyOnApproval,e)}function gk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function ghe(e){return{title:yn.global.t("settings.notifyTitle"),body:gk(e,yn.global.t("settings.notifyFallback"))}}function vhe(e,t){return{title:yn.global.t("settings.notifyQuestionTitle"),body:gk(t,e,yn.global.t("settings.notifyQuestionFallback"))}}function yhe(e,t){return{title:yn.global.t("settings.notifyApprovalTitle"),body:gk(t,e,yn.global.t("settings.notifyApprovalFallback"))}}function vk(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{pk.value=i,i==="granted"&&fC(t,n,s)});return}fC(t,n,s)}}function fC(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:fhe});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function khe(e,t){vk(dk.value,t,ghe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function bhe(e){vk(fk.value,e,vhe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function xhe(e){vk(hk.value,e,yhe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function _he(){return{notifyOnComplete:dk,notifyOnQuestion:fk,notifyOnApproval:hk,notifyPermission:pk,setNotifyOnComplete:hhe,setNotifyOnQuestion:phe,setNotifyOnApproval:mhe,maybeNotifyCompletion:khe,maybeNotifyQuestion:bhe,maybeNotifyApproval:xhe}}function whe(){return Qn($t.soundOnComplete)==="1"}const Bc=Q(whe());function She(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let H0=null;function J5(){const e=She();if(!e)return null;if(H0===null)try{H0=new e}catch{return null}return H0}function eM(){if(!Bc.value)return;const e=J5();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 hC=!1;function Che(){if(hC||typeof window>"u")return;hC=!0;const e=()=>{eM()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Che();function Ahe(e){Bc.value=e,ts($t.soundOnComplete,e?"1":"0"),e&&eM()}function pC(e,t,n,s,o){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(o,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+s),i.start(l),i.stop(l+s+.02)}function yk(){const e=J5();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{pC(e,880,0,.16,.18),pC(e,1320,.1,.22,.16),ar("sound: chime scheduled",{state:e.state})}catch(t){ar("sound: failed to play",{error:String(t)})}}function Mhe(){Bc.value&&yk()}function Ehe(){Bc.value&&yk()}function The(){Bc.value&&yk()}function Nhe(){return{soundOnComplete:Bc,setSoundOnComplete:Ahe,maybePlayCompletionSound:Mhe,maybePlayQuestionSound:Ehe,maybePlayApprovalSound:The}}function mC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const Ihe=1e3,$he=4096,gC=32*1024;function Lhe(e,t){let n=null,s;const o=new Set;async function i(f){try{const h=await ft().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:mC(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,p){if(e.activeSessionId!==f)return;const h=p??e.tasksBySession[f]??[],m=ft(),_=new Map;if(await Promise.all(h.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!o.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:gC});y.outputPreview!==void 0&&_.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),_.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=_.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const p=ft();let h;try{h=await p.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async v=>{const y=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!A)&&!(A&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await p.getTask(f,v.id,{withOutput:!0,outputBytes:y?$he:gC});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{A&&o.add(v.id)}}));const _=e.tasksBySession[f]??[],k=new Map(_.map(v=>[v.id,v])),g=h.map(v=>{const y=k.get(v.id),A=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:A?.preview??y?.outputPreview,outputBytes:A?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:mC(g,_)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Ihe))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=Q(0);let d=null;return Ke(()=>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}),Ke(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[f]??[];return{sid:f,hasRunning:p.some(h=>h.status==="running")}},({sid:f,hasRunning:p},h,m)=>{let _;p&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:P(()=>u.value),loadTasksForSession:i}}const tM=$t.starredModels;function Fhe(){try{const e=Qn(tM);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Ohe(e){try{ts(tM,JSON.stringify(e))}catch{}}function Rhe(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Q([]),d=Q(Fhe()),f=Q({}),p=Q({}),h=Q([]),m=Q(null);function _(V){if(!(V==null||V.length===0))return u.value.find(U=>U.id===V||U.model===V)}function k(){const V=e.activeSessionId?e.sessions.find(U=>U.id===e.activeSessionId):void 0;return _(V?.model??m.value??e.defaultModel)}function g(V){const U=aa(k(),V);return e.thinking=U,l(U),U}async function v(V){try{const re=await ft().listSkills(V);f.value={...f.value,[V]:re}}catch{}}async function y(V){try{const re=await ft().listSkillsForWorkspace(V);p.value={...p.value,[V]:re}}catch{}}async function A(){try{const V=ft();u.value=await V.listModels(),g(e.thinking)}catch(V){n("loadModels",V)}}async function L(){try{const V=await ft().refreshOAuthProviderModels();for(const U of V.failed)n("refreshOAuthProviderModels",new Error(U.reason),{message:U.provider})}catch{}}async function $(){try{const V=ft();h.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function x(V){const U=e.activeSessionId,re=aa(_(V),e.thinking),ae=e.thinking;if(!U)return m.value=V,g(re),!0;const te=e.sessions.find(Z=>Z.id===U)?.model;a(U,Z=>({...Z,model:V})),re!==ae&&(e.thinking=re,l(re));try{await ft().updateSession(U,{model:V,thinking:re!==ae?re:void 0})}catch(Z){return a(U,ne=>({...ne,model:te??ne.model})),re!==ae&&(e.thinking=ae,l(ae)),n("setModel",Z,{sessionId:U}),!1}return await s(U),!0}function E(V){const U=new Set(d.value);U.has(V)?U.delete(V):U.add(V),d.value=Array.from(U),Ohe(d.value)}async function N(V,U,re){const ae=re??e.activeSessionId;if(!ae)return;const te=i.value==="idle"&&!r.has(ae),Z=`msg_skill_opt_${Date.now().toString(36)}`;if(te){r.add(ae),e.sendingBySession={...e.sendingBySession,[ae]:!0};const ne={id:Z,sessionId:ae,role:"user",content:[{type:"text",text:`/${V}${U?` ${U}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:U}}};c(ae,ke=>[...ke,ne])}try{await ft().activateSkill(ae,V,U)}catch(ne){te&&(r.delete(ae),e.sendingBySession={...e.sendingBySession,[ae]:!1},c(ae,ke=>ke.filter(Se=>Se.id!==Z))),n("activateSkill",ne,{sessionId:ae})}}async function F(V){try{await ft().addProvider(V),await Promise.all([$(),A()])}catch(U){n("addProvider",U)}}async function S(V){try{await ft().deleteProvider(V),await Promise.all([$(),A()])}catch(U){n("deleteProvider",U)}}async function T(V){try{const U=await ft().refreshProvider(V);for(const re of U.failed)n("refreshProvider",new Error(re.reason),{message:re.provider});await Promise.all([$(),A()])}catch(U){n("refreshProvider",U)}}async function R(){try{const V=await ft().refreshAllProviders();for(const U of V.failed)n("refreshAllProviders",new Error(U.reason),{message:U.provider});await Promise.all([$(),A()])}catch(V){n("refreshAllProviders",V)}}async function O(){try{return await ft().startOAuthLogin()}catch{return null}}async function D(){try{return await ft().pollOAuthLogin()}catch{return null}}async function W(){try{await ft().cancelOAuthLogin()}catch{}}function z(V){const U=g(V);o({thinking:U})}return{models:u,starredModelIds:d,providers:h,draftModel:m,skillsBySession:f,skillsByWorkspace:p,loadSkillsForSession:v,loadSkillsForWorkspace:y,loadModels:A,refreshOAuthProviderModels:L,loadProviders:$,setModel:x,toggleStarModel:E,activateSkill:N,addProvider:F,deleteProvider:S,refreshProvider:T,refreshAllProviders:R,startOAuthLogin:O,pollOAuthLogin:D,cancelOAuthLogin:W,setThinking:z}}const nM="kimiWeb.compaction",Bhe=/^read[_-]?media(?:file)?$/i,Dhe=/^data:([^;]+);base64,(.*)$/s,Phe=/^<(image|video|audio)\s+path="([^"]+)">$/,Hhe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Whe=/Mime type:\s*([^.\s]+)/i,zhe=/Size:\s*(\d+)\s*bytes/i,Uhe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,jhe="<system>Image compressed to fit model limits:",qhe=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Vhe(e){return e.includes(jhe)?e.replace(qhe,""):e}function Khe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Ghe(e){const t=Hhe.exec(e.trim());return t?{kind:t[1],path:Khe(t[2])}:null}const Yhe=/^f_[A-Za-z0-9]{10,}$/;function Zhe(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return Yhe.test(s)?s:void 0}function Qhe(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 Xhe(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 Jhe(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function epe(e,t){if(!Bhe.test(e))return;const n=Xhe(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const p=d.text,h=Phe.exec(p);h&&(o=h[1],s=h[2]);const m=Whe.exec(p);m?.[1]&&(i=m[1]);const _=zhe.exec(p);_?.[1]&&(r=Number(_[1]));const k=Uhe.exec(p);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Jhe(d);f&&(a=f)}if(a===null)return;const c=Dhe.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Qhe(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function tpe(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
299
299
|
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
300
300
|
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
301
301
|
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
302
|
-
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function
|
|
302
|
+
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function npe(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 spe(e,t){const n=e.split(`
|
|
303
303
|
`),s=t.split(`
|
|
304
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function
|
|
304
|
+
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function ope(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:spe(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const s=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function ipe(e){const t=`<prompt>
|
|
305
305
|
`,n=`
|
|
306
|
-
</prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):
|
|
306
|
+
</prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):rpe(e)}function rpe(e){const t=e.split(`
|
|
307
307
|
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
308
|
-
`):e}function
|
|
309
|
-
`);return
|
|
308
|
+
`):e}function lpe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function ape(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
309
|
+
`);return ipe(t)}function cpe(e,t){const n=e.metadata?.origin??{},s=ape(e);return t==="cron_missed"?{text:s,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:s,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 upe(e,t,n){const{text:s,cron:o}=cpe(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function dpe(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 fpe(e){return e.metadata?.origin?.kind==="compaction_summary"}function hpe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function ppe(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 sM(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);let a=null;function c(f=!1){if(!a)return;const p=a;if(a=null,!f||!s)for(let h=0;h<p.tools.length;h++){const m=p.tools[h];if(m.status!=="running")continue;const _={...m,status:"ok"};p.tools[h]=_;const k=p.blocks.find(g=>g.kind==="tool"&&g.tool.id===_.id);k&&k.kind==="tool"&&(k.tool=_)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
|
|
310
310
|
`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
|
|
311
311
|
`):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(f,p){for(const h of p)if(h.type==="text"){if(h.text){f.textParts.push(h.text);const m=f.blocks.at(-1);m&&m.kind==="text"?m.text+=`
|
|
312
312
|
`+h.text:f.blocks.push({kind:"text",text:h.text})}}else if(h.type==="thinking"){if(h.thinking){f.thinkingParts.push(h.thinking);const m=f.blocks.at(-1);m&&m.kind==="thinking"?m.thinking+=`
|
|
313
|
-
`+h.thinking:f.blocks.push({kind:"thinking",thinking:h.thinking})}}else if(h.type==="toolUse"){const m=l.get(h.toolCallId),_={id:h.toolCallId,name:h.toolName,arg:typeof h.input=="string"?h.input:JSON.stringify(h.input),status:"running",output:h.outputLines,planPath:h.toolName==="ExitPlanMode"?o[h.toolCallId]?.path:void 0};f.tools.push(_),f.blocks.push({kind:"tool",tool:_}),m&&(f.approval=
|
|
314
|
-
`),compaction:{trigger:k?.trigger,tokensBefore:k?.tokensBefore,tokensAfter:k?.tokensAfter}});continue}if(f.role==="user"){const k=
|
|
315
|
-
`),images:L.length>0?L:void 0,skillActivation:v?{name:g.skillName,args:g.skillArgs}:void 0,pluginCommand:y?{pluginId:g.pluginId,commandName:g.commandName,args:g.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){a&&u(a,f.content);continue}const p=f.promptId;
|
|
316
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&hpe(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const vv="/sessions/";function vC(e){const{pathname:t}=e;if(!t.startsWith(vv))return;const n=t.slice(vv.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function mpe(e){return e===void 0||e.length===0?"/":`${vv}${encodeURIComponent(e)}`}const gpe=50,yv=5,vpe=40402,ype=40410,kpe=40902;function W0(e){return ml(e)&&e.code===kpe}const bpe=40904;function xpe(e){return ml(e)&&e.code===bpe}const Hl=Ss({}),Rf=Ss({}),z0=Ss({}),Fi=Ss(new Set);function _pe(e,t){const{t:n}=yn.global,{confirm:s}=kl(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:p,appendSession:h,forgetSession:m,setActiveSessionId:_,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:A,hasLoadedMessages:L,refreshSessionStatus:$,persistSessionProfile:x,mergedWorkspaces:E,workspacesView:N,status:F,workspaceIdForSession:S,savePermissionToStorage:T,savePlanModeToStorage:R,saveSwarmModeToStorage:O,saveGoalModeToStorage:D,draftModes:W,saveUnread:z,saveActiveWorkspaceToStorage:V,saveHiddenWorkspacesToStorage:U,goalErrorMessage:re,resetFastMoon:ae,initialized:te,selectedDiffPath:Z,fileDiffLines:ne,fileDiffLoading:ke}=t;async function Se(ee){if(e.messagesLoadingMoreBySession[ee])return;const _e=e.messagesBySession[ee];if(!_e||_e.length===0)return;const Ae=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!1};try{const Pe=await ft().listMessages(ee,{beforeId:Ae,pageSize:gpe}),st=[...Pe.items].reverse();k(ee,at=>[...st,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ee]:Pe.hasMore}}catch(Pe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!0},l("loadOlderMessages",Pe,{sessionId:ee})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!1}}}function Ye(ee){o.loadTasksForSession(ee),ce(ee),$(ee),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,ee)||r.loadSkillsForSession(ee)}async function ve(ee){const _e=e.activeSessionId;if(_e){Z.value=ee,ne.value=[],ke.value=!0;try{const Pe=await ft().getFileDiff(_e,ee);if(Z.value!==ee)return;ne.value=ppe(Pe.diff)}catch(Ae){Z.value===ee&&(ne.value=[]),console.warn("[loadFileDiff] diff unavailable for",ee,Ae)}finally{Z.value===ee&&(ke.value=!1)}}}function Y(){Z.value=null,ne.value=[],ke.value=!1}async function ce(ee){try{const Ae=await ft().getGitStatus(ee);e.gitStatusBySession={...e.gitStatusBySession,[ee]:Ae}}catch{}}async function fe(){try{const _e=await ft().getAuth();e.authReady=_e.ready,e.defaultModel=_e.defaultModel,e.managedProviderStatus=_e.managedProvider?.status??null}catch{}}async function j(){try{const ee=ft();e.config=await ee.getConfig()}catch{}}async function se(ee){try{const Ae=await ft().setConfig(ee);return e.config=Ae,e.defaultModel=Ae.defaultModel??null,!0}catch(_e){return l("setConfig",_e),!1}}const ge=100,ue=30,pe=720*60*1e3;async function q(){const ee=ft(),_e=[];let Ae;for(;;){const Pe=await ee.listSessions({pageSize:ge,beforeId:Ae,excludeEmpty:!0});if(_e.push(...Pe.items),!Pe.hasMore||Pe.items.length===0)break;Ae=Pe.items[Pe.items.length-1].id}return _e}async function J(ee){const _e=ft(),Ae=[],Pe=Date.now(),st=Qt=>Pe-new Date(Qt.updatedAt).getTime();let at,Nt=!1,Zt=!0;for(;;){let Qt;try{Qt=await _e.listSessions({workspaceId:ee,pageSize:yv,beforeId:at,excludeEmpty:!0})}catch(Vt){if(Zt)throw Vt;break}if(Nt=Qt.hasMore,Qt.items.length===0)break;const As=Qt.items[Qt.items.length-1],Cr=st(As)>=pe;if(!Zt&&Cr){const Vt=Qt.items.findIndex($n=>st($n)>=pe),vn=Vt>=0?Vt+1:Qt.items.length;Ae.push(...Qt.items.slice(0,vn)),Nt=Qt.hasMore||vn<Qt.items.length;break}if(Ae.push(...Qt.items),Zt=!1,!Qt.hasMore||Cr)break;at=As.id}return{workspaceId:ee,page:{items:Ae,hasMore:Nt}}}async function he(){const ee=e.workspaces;if(ee.length===0){const Nt=await q().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Nt}const _e=await Promise.all(ee.map(Nt=>J(Nt.id).catch(()=>({workspaceId:Nt.id,page:{items:[],hasMore:!1}})))),Ae=[],Pe={},st={},at={};for(const{workspaceId:Nt,page:Zt}of _e)Ae.push(...Zt.items),Pe[Nt]=Zt.hasMore,st[Nt]=Zt.items.length>0?Zt.items[Zt.items.length-1].id:void 0,at[Nt]=Math.max(Zt.items.length,yv);return e.sessionsHasMoreByWorkspace=Pe,e.sessionsCursorByWorkspace=st,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Ae.sort((Nt,Zt)=>new Date(Zt.updatedAt).getTime()-new Date(Nt.updatedAt).getTime()),Ae}async function Te(ee){if(e.sessionsLoadingMoreByWorkspace[ee]||e.sessionsHasMoreByWorkspace[ee]===!1)return;const _e=e.sessionsCursorByWorkspace[ee];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!0};try{const Ae=await ft().listSessions({workspaceId:ee,pageSize:ue,beforeId:_e,excludeEmpty:!0}),Pe=new Set(e.sessions.map(at=>at.id)),st=Ae.items.filter(at=>!Pe.has(at.id));st.length>0&&d([...e.sessions,...st]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[ee]:Ae.items.length>0?Ae.items[Ae.items.length-1].id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[ee]:Ae.hasMore}}catch(Ae){l("loadMoreSessions",Ae)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!1}}}}async function Ie(){if(e.sessionsFullyLoaded)return;const ee=await q().catch(()=>null);if(ee===null)return;d(ee),e.sessionsFullyLoaded=!0;const _e={};for(const Ae of e.workspaces)_e[Ae.id]=!1;e.sessionsHasMoreByWorkspace=_e}async function Oe(){e.loading=!0;try{const ee=ft();await Promise.all([ee.getHealth().catch(()=>null),ee.getMeta().then(Nt=>{e.serverVersion=Nt.serverVersion,e.availableOpenInApps=Nt.openInApps,e.dangerousBypassAuth=Nt.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),await fe(),await j(),await de();const _e=await he();d(_e);const Ae=_e[0],Pe=e.activeWorkspaceId;!(Pe!==null&&E.value.some(Nt=>Nt.id===Pe))&&Ae&&Qe(S(Ae)),Xe();const at=typeof window<"u"?vC(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(Zt=>Zt.id===at)||await ds(at))&&await Ze(at,{urlMode:"replace"}),!e.activeSessionId&&_e.length>0&&await Ze(_e[0].id,{urlMode:"replace"})}catch(ee){l("load",ee)}finally{e.loading=!1,te.value=!0}}async function de(){try{const ee=ft(),[_e,Ae]=await Promise.all([ee.listWorkspaces().catch(()=>[]),ee.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=$e(_e),e.fsHome=Ae.home||null,e.recentRoots=Ae.recentRoots}catch{}}function $e(ee){const _e=gf();return Object.keys(_e).length===0?ee:ee.map(Ae=>{const Pe=_e[Ae.root];return Pe!==void 0?{...Ae,name:Pe}:Ae})}function Qe(ee){e.activeWorkspaceId=ee,V(ee)}function tt(ee){Qe(ee);const _e=e.sessions.filter(Ae=>S(Ae)===ee);if(_e.length>0){const Ae=_e[0];Ae&&Ae.id!==e.activeSessionId&&Ze(Ae.id)}else _(void 0),ot(void 0,"push")}function vt(ee){const _e=gf()[ee.root],Ae=_e!==void 0?{...ee,name:_e}:ee;e.hiddenWorkspaceRoots.includes(Ae.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Ae.root),U(e.hiddenWorkspaceRoots));const Pe=e.workspaces.findIndex(at=>at.id===Ae.id||at.root===Ae.root);if(Pe===-1){e.workspaces=[Ae,...e.workspaces];return}const st=[...e.workspaces];st[Pe]=Ae,e.workspaces=st}function wt(ee){if(ee.type==="workspaceCreated"||ee.type==="workspaceUpdated"){vt(ee.workspace);return}const _e=e.workspaces.find(Pe=>Pe.id===ee.workspaceId)?.root??ee.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],U(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Pe=>Pe.id!==ee.workspaceId&&Pe.root!==_e),e.activeWorkspaceId===ee.workspaceId||e.activeWorkspaceId===_e){const Pe=N.value[0]?.id??null;if(e.activeWorkspaceId=Pe,Pe)V(Pe);else try{Ac($t.activeWorkspace)}catch{}_(void 0),e.sessionLoading=!1,Y(),ot(void 0,"replace")}}function xt(){_(void 0),ot(void 0,"push")}function Rt(ee){Qe(ee),xt(),Y()}async function yt(ee){const _e=E.value.find(As=>As.id===ee);if(!_e)return null;const Ae=ft();let Pe,st=_e.root;try{const As=await Ae.addWorkspace({root:_e.root});Pe=As.id,st=As.root,vt(As)}catch{}const at=r.draftModel.value??void 0,Nt=await Ae.createSession({workspaceId:Pe,cwd:st,model:at});r.draftModel.value=null;const Zt=at!==void 0&&(!Nt.model||Nt.model.length===0)?{...Nt,model:at}:Nt;p(Zt),Qe(Nt.workspaceId??Pe??ee),await Ze(Nt.id);const Qt=Nt.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[Qt]:!0},R()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Qt]:!0},O()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Qt]:!0},D()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,Qt}async function nn(ee,_e,Ae){if(!Fi.has(ee)){Fi.add(ee);try{const Pe=await yt(ee);if(!Pe)return;await Dt(Pe,_e,Ae)}catch(Pe){l("startSessionAndSendPrompt",Pe)}finally{Fi.delete(ee)}}}async function xn(ee,_e,Ae){if(!Fi.has(ee)){Fi.add(ee);try{const Pe=await yt(ee);if(!Pe)return;const st=e.planModeBySession[Pe]??!1,at=e.swarmModeBySession[Pe]??!1,Nt=e.sessions.find(Qt=>Qt.id===Pe),Zt=(Nt?.model&&Nt.model.length>0?Nt.model:e.defaultModel)??void 0;await x({model:Zt,planMode:st,swarmMode:at,permissionMode:e.permission,thinking:Mt(Zt)},Pe),await r.activateSkill(_e,Ae,Pe)}catch(Pe){l("startSessionAndActivateSkill",Pe)}finally{Fi.delete(ee)}}}async function ns(ee,_e){if(!Fi.has(ee)){Fi.add(ee);try{const Ae=await yt(ee);if(!Ae)return;await i.openSideChatOn(Ae,_e)}catch(Ae){l("startSessionAndOpenSideChat",Ae)}finally{Fi.delete(ee)}}}async function Wt(ee){const _e=ee.trim();if(!_e)return!1;const Ae=ft();try{const Pe=await Ae.addWorkspace({root:_e});return vt(Pe),Rt(Pe.id),!0}catch{return!1}}async function _n(ee){try{return await ft().browseFs(ee)}catch{return{path:"",parent:null,entries:[]}}}async function gn(){try{return await ft().getFsHome()}catch{return{home:"",recentRoots:[]}}}function ot(ee,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const Ae=mpe(ee);if(window.location.pathname!==Ae)try{_e==="push"?window.history.pushState(null,"",Ae):window.history.replaceState(null,"",Ae)}catch{}}async function ds(ee){try{const _e=await ft().getSession(ee);return e.sessions.some(Ae=>Ae.id===_e.id)||h(_e),!0}catch{return!1}}function ys(){const ee=vC(window.location);if(ee===void 0){_(void 0);return}if(ee!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===ee)){Ze(ee,{urlMode:"none"});return}(async()=>{if(await ds(ee)){await Ze(ee,{urlMode:"none"});return}const _e=e.sessions[0];_e?await Ze(_e.id,{urlMode:"replace"}):(_(void 0),ot(void 0,"replace"))})()}}let fs=!1;function Xe(){fs||typeof window>"u"||(fs=!0,window.addEventListener("popstate",ys))}async function Ze(ee,_e){const Ae=L(ee),Pe=!Ae&&u.has(ee);u.delete(ee);try{ot(ee,_e?.urlMode??"push"),e.sessionLoading=!Ae&&!Pe,_(ee),ae(),e.unreadBySession[ee]&&(e.unreadBySession={...e.unreadBySession,[ee]:!1},z({[ee]:!1})),Y();const st=e.sessions.find(at=>at.id===ee);if(st){const at=S(st);e.activeWorkspaceId!==at&&Qe(at)}if(Ae){if(await A(ee)==="not-found")return}else if(await y(ee)==="not-found")return;Ye(ee)}catch(st){l("selectSession",st,{sessionId:ee})}finally{e.activeSessionId===ee&&(e.sessionLoading=!1)}}function Mt(ee){const _e=ee===void 0?void 0:r.models.value.find(Ae=>Ae.model===ee||Ae.id===ee||Ae.displayName===ee);return aa(_e,e.thinking)}async function Dt(ee,_e,Ae){c.add(ee),e.sendingBySession={...e.sendingBySession,[ee]:!0};const Pe=g();try{const st=ft(),at=[];_e&&at.push({type:"text",text:_e});for(const $n of Ae??[])$n.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:$n.fileId}}):at.push({type:"image",source:{kind:"file",fileId:$n.fileId}});if(at.length===0)return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},!1;const Nt={id:Pe,sessionId:ee,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(ee,$n=>[...$n,Nt]);const Zt=e.sessions.find($n=>$n.id===ee),Qt=(Zt?.model&&Zt.model.length>0?Zt.model:e.defaultModel)??void 0,As=e.planModeBySession[ee]??!1,Cr=e.swarmModeBySession[ee]??!1,Vt=e.goalModeBySession[ee]??!1;if(Vt&&_e)try{await st.updateSession(ee,{goalObjective:_e.trim()})}catch($n){return l("createGoal",$n,{sessionId:ee}),c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,ks=>ks.some(bs=>bs.id===Pe)?ks.filter(bs=>bs.id!==Pe):ks),!1}const vn=await st.submitPrompt(ee,{content:at,model:Qt,thinking:Mt(Qt),permissionMode:e.permission,planMode:As,swarmMode:Cr});return Vt&&(e.goalModeBySession={...e.goalModeBySession,[ee]:!1},D()),e.promptIdBySession={...e.promptIdBySession,[ee]:vn.promptId},k(ee,$n=>{const ks=$n.findIndex(Ms=>Ms.id===Pe);if(ks===-1)return $n;const bs=[...$n];return bs[ks]={...bs[ks],promptId:bs[ks].promptId??vn.promptId},bs}),v()?.bindNextPromptId(ee,vn.promptId),!0}catch(st){return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,at=>at.some(Nt=>Nt.id===Pe)?at.filter(Nt=>Nt.id!==Pe):at),l("sendPrompt",st,{sessionId:ee}),!1}}async function zt(ee,_e){const Ae=e.activeSessionId;if(Ae){if(a.value!=="idle"||c.has(Ae)){hs(ee,_e);return}await Dt(Ae,ee,_e)}}async function wn(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[],st=[],at=[];for(const Vt of Pe){const vn=Vt.text.trim();vn&&st.push(vn),Vt.attachments?.length&&at.push(...Vt.attachments)}const Nt=ee.trim();if(Nt&&st.push(Nt),_e?.length&&at.push(..._e),st.length===0&&at.length===0)return;Pe.length>0&&(e.queuedBySession={...e.queuedBySession,[Ae]:[]});const Zt=st.join(`
|
|
313
|
+
`+h.thinking:f.blocks.push({kind:"thinking",thinking:h.thinking})}}else if(h.type==="toolUse"){const m=l.get(h.toolCallId),_={id:h.toolCallId,name:h.toolName,arg:typeof h.input=="string"?h.input:JSON.stringify(h.input),status:"running",output:h.outputLines,planPath:h.toolName==="ExitPlanMode"?o[h.toolCallId]?.path:void 0};f.tools.push(_),f.blocks.push({kind:"tool",tool:_}),m&&(f.approval=ope(m),f.approvalId=m.approvalId)}else if(h.type==="toolResult"){const m=f.tools.findIndex(_=>_.id===h.toolCallId);if(m!==-1){const _=f.tools[m],k={..._,status:h.isError?"error":"ok",output:tpe(h.output),media:h.isError?void 0:epe(_.name,h.output)};k.name==="ExitPlanMode"&&!k.planPath&&(k.planPath=ppe(k.output)),f.tools[m]=k;const g=f.blocks.find(v=>v.kind==="tool"&&v.tool.id===h.toolCallId);g&&g.kind==="tool"&&(g.tool=k)}}}function d(f){if(f.type==="image"||f.type==="video"){const p=f.type,h=f.source;if(h.kind==="url")return{url:h.url,kind:p};if(h.kind==="base64")return{url:`data:${h.mediaType};base64,${h.data}`,kind:p};if(h.kind==="file"&&n)return{url:n(h.fileId),kind:p,fileId:h.fileId}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image",fileId:f.fileId};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video",fileId:f.fileId}}}for(const f of e){if(f.role==="system")continue;if(fpe(f)){c();const k=f.metadata?.[nM];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(g=>g.type==="text").map(g=>g.text).join(`
|
|
314
|
+
`),compaction:{trigger:k?.trigger,tokensBefore:k?.tokensBefore,tokensAfter:k?.tokensAfter}});continue}if(f.role==="user"){const k=lpe(f);if(c(),k!==void 0){i.push(upe(f,r++,k));continue}if(!dpe(f))continue;const g=f.metadata?.origin,v=g?.kind==="skill_activation"&&g?.trigger==="user-slash",y=g?.kind==="plugin_command"&&g?.trigger==="user-slash",A=[],L=[];for(const $ of f.content){if($.type==="text")if(v)A.push(g.skillArgs??"");else if(y)A.push(g.commandArgs??"");else{const E=Ghe($.text);if(E&&(E.kind==="video"||E.kind==="image")&&n){const F=Zhe(E.path);if(F){L.push({url:n(F),kind:E.kind,alt:F,fileId:F});continue}}const N=Vhe($.text);if(N!==$.text&&N.trim().length===0)continue;A.push(N)}const x=d($);x&&L.push({url:x.url,kind:x.kind,alt:$.type==="file"?$.name:void 0,fileId:x.fileId})}i.push({id:f.id,role:"user",no:r++,text:A.join(`
|
|
315
|
+
`),images:L.length>0?L:void 0,skillActivation:v?{name:g.skillName,args:g.skillArgs}:void 0,pluginCommand:y?{pluginId:g.pluginId,commandName:g.commandName,args:g.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){a&&u(a,f.content);continue}const p=f.promptId;hpe(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:f.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const m=a;if(m===null)continue;const _=JSON.stringify(f.content);m.promptId!==void 0&&m.seenSigs.has(_)||(m.seenSigs.add(_),u(m,f.content))}return c(!0),i}function mpe(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=Q({}),l=P(()=>{const E=e.activeSessionId;if(!E)return null;const N=r.value[E];return N?{parentId:E,agentId:N.agentId}:null}),a=P(()=>l.value?.parentId??null),c=P(()=>l.value!==null),u=P(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=P(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(N=>N.id===E.agentId&&N.status==="running"):!1}),f=P(()=>{const E=l.value;if(!E)return[];const N=e.sideChatMessagesByAgent[E.agentId]??[];return sM(N,[],F=>ft().getFileUrl(F),d.value)});function p(E,N){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:N(e.sideChatMessagesByAgent[E]??[])}}function h(E,N){p(E,F=>[...F,N])}function m(E){p(E,N=>{const F=[...N].reverse().findIndex(T=>T.role==="user");if(F===-1)return N;const S=N.length-1-F;return N.filter((T,R)=>R!==S)})}function _(E,N){p(E,F=>{const S=[...F];for(let T=S.length-1;T>=0;T-=1){const R=S[T];if(R.role==="user")return S[T]={...R,promptId:R.promptId??N},S}return F})}function k(E,N,F){F&&p(E,S=>{const T=S.at(-1);if(T?.role==="assistant"){const R=T.content[0],O=R?.type==="text"?R.text:"";return[...S.slice(0,-1),{...T,content:[{type:"text",text:`${O}${F}`}]}]}return[...S,{id:s(),sessionId:N,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function g(E,N,F){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!F)return;const T=(e.sideChatMessagesByAgent[E]??[]).at(-1);(T?.role==="assistant"&&T.content[0]?.type==="text"?T.content[0].text:"").trim().length>0||k(E,N,F)}async function v(E){const N=e.activeSessionId;N&&await y(N,E)}async function y(E,N){if(!r.value[E]){let F;try{({agentId:F}=await ft().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}},o(),i()?.markSideChannelAgent(F)}N&&N.trim()&&await A(E,N.trim())}async function A(E,N){const F=r.value[E],S=N.trim();if(!F||!S)return;const T=E,R=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!0};const O={id:s(),sessionId:T,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};h(R,O);try{const D=e.sessions.find(U=>U.id===T),W=(D?.model&&D.model.length>0?D.model:e.defaultModel)??void 0,z=W===void 0?void 0:t.models().find(U=>U.model===W||U.id===W||U.displayName===W),V=await ft().submitPrompt(T,{content:[{type:"text",text:S}],agentId:R,model:W,thinking:aa(z,e.thinking),permissionMode:e.permission,planMode:e.planModeBySession[T]??!1,swarmMode:e.swarmModeBySession[T]??!1});_(R,V.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[T]:[...e.sideChatUserMessageIdsBySession[T]??[],V.userMessageId]}}catch(D){n("sendSideChatPrompt",D,{sessionId:T}),m(R),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!1}}}function L(){const E=e.activeSessionId;if(!E)return;const{[E]:N,...F}=r.value;r.value=F}async function $(E){const N=l.value;N&&await A(N.parentId,E)}function x(E){if(!r.value[E])return;const{[E]:N,...F}=r.value;r.value=F}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:k,finishSideChatAgent:g,openSideChat:v,openSideChatOn:y,closeSideChat:L,sendSideChatPrompt:$,clearSideChatForSession:x}}function gpe(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 vpe(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
316
|
+
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&gpe(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const vv="/sessions/";function vC(e){const{pathname:t}=e;if(!t.startsWith(vv))return;const n=t.slice(vv.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function ype(e){return e===void 0||e.length===0?"/":`${vv}${encodeURIComponent(e)}`}const kpe=50,yv=5,bpe=40402,xpe=40410,_pe=40902;function W0(e){return ml(e)&&e.code===_pe}const wpe=40904;function Spe(e){return ml(e)&&e.code===wpe}const Hl=Ss({}),Rf=Ss({}),z0=Ss({}),Fi=Ss(new Set);function Cpe(e,t){const{t:n}=yn.global,{confirm:s}=kl(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:p,appendSession:h,forgetSession:m,setActiveSessionId:_,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:A,hasLoadedMessages:L,refreshSessionStatus:$,persistSessionProfile:x,mergedWorkspaces:E,workspacesView:N,status:F,workspaceIdForSession:S,savePermissionToStorage:T,savePlanModeToStorage:R,saveSwarmModeToStorage:O,saveGoalModeToStorage:D,draftModes:W,saveUnread:z,saveActiveWorkspaceToStorage:V,saveHiddenWorkspacesToStorage:U,goalErrorMessage:re,resetFastMoon:ae,initialized:te,selectedDiffPath:Z,fileDiffLines:ne,fileDiffLoading:ke}=t;async function Se(ee){if(e.messagesLoadingMoreBySession[ee])return;const _e=e.messagesBySession[ee];if(!_e||_e.length===0)return;const Ae=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!1};try{const Pe=await ft().listMessages(ee,{beforeId:Ae,pageSize:kpe}),st=[...Pe.items].reverse();k(ee,at=>[...st,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ee]:Pe.hasMore}}catch(Pe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!0},l("loadOlderMessages",Pe,{sessionId:ee})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!1}}}function Ye(ee){o.loadTasksForSession(ee),ce(ee),$(ee),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,ee)||r.loadSkillsForSession(ee)}async function ve(ee){const _e=e.activeSessionId;if(_e){Z.value=ee,ne.value=[],ke.value=!0;try{const Pe=await ft().getFileDiff(_e,ee);if(Z.value!==ee)return;ne.value=vpe(Pe.diff)}catch(Ae){Z.value===ee&&(ne.value=[]),console.warn("[loadFileDiff] diff unavailable for",ee,Ae)}finally{Z.value===ee&&(ke.value=!1)}}}function Y(){Z.value=null,ne.value=[],ke.value=!1}async function ce(ee){try{const Ae=await ft().getGitStatus(ee);e.gitStatusBySession={...e.gitStatusBySession,[ee]:Ae}}catch{}}async function fe(){try{const _e=await ft().getAuth();e.authReady=_e.ready,e.defaultModel=_e.defaultModel,e.managedProviderStatus=_e.managedProvider?.status??null}catch{}}async function j(){try{const ee=ft();e.config=await ee.getConfig()}catch{}}async function se(ee){try{const Ae=await ft().setConfig(ee);return e.config=Ae,e.defaultModel=Ae.defaultModel??null,!0}catch(_e){return l("setConfig",_e),!1}}const ge=100,ue=30,pe=720*60*1e3;async function q(){const ee=ft(),_e=[];let Ae;for(;;){const Pe=await ee.listSessions({pageSize:ge,beforeId:Ae,excludeEmpty:!0});if(_e.push(...Pe.items),!Pe.hasMore||Pe.items.length===0)break;Ae=Pe.items[Pe.items.length-1].id}return _e}async function J(ee){const _e=ft(),Ae=[],Pe=Date.now(),st=Qt=>Pe-new Date(Qt.updatedAt).getTime();let at,Nt=!1,Zt=!0;for(;;){let Qt;try{Qt=await _e.listSessions({workspaceId:ee,pageSize:yv,beforeId:at,excludeEmpty:!0})}catch(Vt){if(Zt)throw Vt;break}if(Nt=Qt.hasMore,Qt.items.length===0)break;const As=Qt.items[Qt.items.length-1],Cr=st(As)>=pe;if(!Zt&&Cr){const Vt=Qt.items.findIndex($n=>st($n)>=pe),vn=Vt>=0?Vt+1:Qt.items.length;Ae.push(...Qt.items.slice(0,vn)),Nt=Qt.hasMore||vn<Qt.items.length;break}if(Ae.push(...Qt.items),Zt=!1,!Qt.hasMore||Cr)break;at=As.id}return{workspaceId:ee,page:{items:Ae,hasMore:Nt}}}async function he(){const ee=e.workspaces;if(ee.length===0){const Nt=await q().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Nt}const _e=await Promise.all(ee.map(Nt=>J(Nt.id).catch(()=>({workspaceId:Nt.id,page:{items:[],hasMore:!1}})))),Ae=[],Pe={},st={},at={};for(const{workspaceId:Nt,page:Zt}of _e)Ae.push(...Zt.items),Pe[Nt]=Zt.hasMore,st[Nt]=Zt.items.length>0?Zt.items[Zt.items.length-1].id:void 0,at[Nt]=Math.max(Zt.items.length,yv);return e.sessionsHasMoreByWorkspace=Pe,e.sessionsCursorByWorkspace=st,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Ae.sort((Nt,Zt)=>new Date(Zt.updatedAt).getTime()-new Date(Nt.updatedAt).getTime()),Ae}async function Te(ee){if(e.sessionsLoadingMoreByWorkspace[ee]||e.sessionsHasMoreByWorkspace[ee]===!1)return;const _e=e.sessionsCursorByWorkspace[ee];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!0};try{const Ae=await ft().listSessions({workspaceId:ee,pageSize:ue,beforeId:_e,excludeEmpty:!0}),Pe=new Set(e.sessions.map(at=>at.id)),st=Ae.items.filter(at=>!Pe.has(at.id));st.length>0&&d([...e.sessions,...st]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[ee]:Ae.items.length>0?Ae.items[Ae.items.length-1].id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[ee]:Ae.hasMore}}catch(Ae){l("loadMoreSessions",Ae)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!1}}}}async function Ie(){if(e.sessionsFullyLoaded)return;const ee=await q().catch(()=>null);if(ee===null)return;d(ee),e.sessionsFullyLoaded=!0;const _e={};for(const Ae of e.workspaces)_e[Ae.id]=!1;e.sessionsHasMoreByWorkspace=_e}async function Oe(){e.loading=!0;try{const ee=ft();await Promise.all([ee.getHealth().catch(()=>null),ee.getMeta().then(Nt=>{e.serverVersion=Nt.serverVersion,e.availableOpenInApps=Nt.openInApps,e.dangerousBypassAuth=Nt.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),await fe(),await j(),await de();const _e=await he();d(_e);const Ae=_e[0],Pe=e.activeWorkspaceId;!(Pe!==null&&E.value.some(Nt=>Nt.id===Pe))&&Ae&&Qe(S(Ae)),Xe();const at=typeof window<"u"?vC(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(Zt=>Zt.id===at)||await ds(at))&&await Ze(at,{urlMode:"replace"}),!e.activeSessionId&&_e.length>0&&await Ze(_e[0].id,{urlMode:"replace"})}catch(ee){l("load",ee)}finally{e.loading=!1,te.value=!0}}async function de(){try{const ee=ft(),[_e,Ae]=await Promise.all([ee.listWorkspaces().catch(()=>[]),ee.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=$e(_e),e.fsHome=Ae.home||null,e.recentRoots=Ae.recentRoots}catch{}}function $e(ee){const _e=gf();return Object.keys(_e).length===0?ee:ee.map(Ae=>{const Pe=_e[Ae.root];return Pe!==void 0?{...Ae,name:Pe}:Ae})}function Qe(ee){e.activeWorkspaceId=ee,V(ee)}function tt(ee){Qe(ee);const _e=e.sessions.filter(Ae=>S(Ae)===ee);if(_e.length>0){const Ae=_e[0];Ae&&Ae.id!==e.activeSessionId&&Ze(Ae.id)}else _(void 0),ot(void 0,"push")}function vt(ee){const _e=gf()[ee.root],Ae=_e!==void 0?{...ee,name:_e}:ee;e.hiddenWorkspaceRoots.includes(Ae.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Ae.root),U(e.hiddenWorkspaceRoots));const Pe=e.workspaces.findIndex(at=>at.id===Ae.id||at.root===Ae.root);if(Pe===-1){e.workspaces=[Ae,...e.workspaces];return}const st=[...e.workspaces];st[Pe]=Ae,e.workspaces=st}function wt(ee){if(ee.type==="workspaceCreated"||ee.type==="workspaceUpdated"){vt(ee.workspace);return}const _e=e.workspaces.find(Pe=>Pe.id===ee.workspaceId)?.root??ee.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],U(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Pe=>Pe.id!==ee.workspaceId&&Pe.root!==_e),e.activeWorkspaceId===ee.workspaceId||e.activeWorkspaceId===_e){const Pe=N.value[0]?.id??null;if(e.activeWorkspaceId=Pe,Pe)V(Pe);else try{Ac($t.activeWorkspace)}catch{}_(void 0),e.sessionLoading=!1,Y(),ot(void 0,"replace")}}function xt(){_(void 0),ot(void 0,"push")}function Rt(ee){Qe(ee),xt(),Y()}async function yt(ee){const _e=E.value.find(As=>As.id===ee);if(!_e)return null;const Ae=ft();let Pe,st=_e.root;try{const As=await Ae.addWorkspace({root:_e.root});Pe=As.id,st=As.root,vt(As)}catch{}const at=r.draftModel.value??void 0,Nt=await Ae.createSession({workspaceId:Pe,cwd:st,model:at});r.draftModel.value=null;const Zt=at!==void 0&&(!Nt.model||Nt.model.length===0)?{...Nt,model:at}:Nt;p(Zt),Qe(Nt.workspaceId??Pe??ee),await Ze(Nt.id);const Qt=Nt.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[Qt]:!0},R()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Qt]:!0},O()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Qt]:!0},D()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,Qt}async function nn(ee,_e,Ae){if(!Fi.has(ee)){Fi.add(ee);try{const Pe=await yt(ee);if(!Pe)return;await Dt(Pe,_e,Ae)}catch(Pe){l("startSessionAndSendPrompt",Pe)}finally{Fi.delete(ee)}}}async function xn(ee,_e,Ae){if(!Fi.has(ee)){Fi.add(ee);try{const Pe=await yt(ee);if(!Pe)return;const st=e.planModeBySession[Pe]??!1,at=e.swarmModeBySession[Pe]??!1,Nt=e.sessions.find(Qt=>Qt.id===Pe),Zt=(Nt?.model&&Nt.model.length>0?Nt.model:e.defaultModel)??void 0;await x({model:Zt,planMode:st,swarmMode:at,permissionMode:e.permission,thinking:Mt(Zt)},Pe),await r.activateSkill(_e,Ae,Pe)}catch(Pe){l("startSessionAndActivateSkill",Pe)}finally{Fi.delete(ee)}}}async function ns(ee,_e){if(!Fi.has(ee)){Fi.add(ee);try{const Ae=await yt(ee);if(!Ae)return;await i.openSideChatOn(Ae,_e)}catch(Ae){l("startSessionAndOpenSideChat",Ae)}finally{Fi.delete(ee)}}}async function Wt(ee){const _e=ee.trim();if(!_e)return!1;const Ae=ft();try{const Pe=await Ae.addWorkspace({root:_e});return vt(Pe),Rt(Pe.id),!0}catch{return!1}}async function _n(ee){try{return await ft().browseFs(ee)}catch{return{path:"",parent:null,entries:[]}}}async function gn(){try{return await ft().getFsHome()}catch{return{home:"",recentRoots:[]}}}function ot(ee,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const Ae=ype(ee);if(window.location.pathname!==Ae)try{_e==="push"?window.history.pushState(null,"",Ae):window.history.replaceState(null,"",Ae)}catch{}}async function ds(ee){try{const _e=await ft().getSession(ee);return e.sessions.some(Ae=>Ae.id===_e.id)||h(_e),!0}catch{return!1}}function ys(){const ee=vC(window.location);if(ee===void 0){_(void 0);return}if(ee!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===ee)){Ze(ee,{urlMode:"none"});return}(async()=>{if(await ds(ee)){await Ze(ee,{urlMode:"none"});return}const _e=e.sessions[0];_e?await Ze(_e.id,{urlMode:"replace"}):(_(void 0),ot(void 0,"replace"))})()}}let fs=!1;function Xe(){fs||typeof window>"u"||(fs=!0,window.addEventListener("popstate",ys))}async function Ze(ee,_e){const Ae=L(ee),Pe=!Ae&&u.has(ee);u.delete(ee);try{ot(ee,_e?.urlMode??"push"),e.sessionLoading=!Ae&&!Pe,_(ee),ae(),e.unreadBySession[ee]&&(e.unreadBySession={...e.unreadBySession,[ee]:!1},z({[ee]:!1})),Y();const st=e.sessions.find(at=>at.id===ee);if(st){const at=S(st);e.activeWorkspaceId!==at&&Qe(at)}if(Ae){if(await A(ee)==="not-found")return}else if(await y(ee)==="not-found")return;Ye(ee)}catch(st){l("selectSession",st,{sessionId:ee})}finally{e.activeSessionId===ee&&(e.sessionLoading=!1)}}function Mt(ee){const _e=ee===void 0?void 0:r.models.value.find(Ae=>Ae.model===ee||Ae.id===ee||Ae.displayName===ee);return aa(_e,e.thinking)}async function Dt(ee,_e,Ae){c.add(ee),e.sendingBySession={...e.sendingBySession,[ee]:!0};const Pe=g();try{const st=ft(),at=[];_e&&at.push({type:"text",text:_e});for(const $n of Ae??[])$n.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:$n.fileId}}):at.push({type:"image",source:{kind:"file",fileId:$n.fileId}});if(at.length===0)return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},!1;const Nt={id:Pe,sessionId:ee,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(ee,$n=>[...$n,Nt]);const Zt=e.sessions.find($n=>$n.id===ee),Qt=(Zt?.model&&Zt.model.length>0?Zt.model:e.defaultModel)??void 0,As=e.planModeBySession[ee]??!1,Cr=e.swarmModeBySession[ee]??!1,Vt=e.goalModeBySession[ee]??!1;if(Vt&&_e)try{await st.updateSession(ee,{goalObjective:_e.trim()})}catch($n){return l("createGoal",$n,{sessionId:ee}),c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,ks=>ks.some(bs=>bs.id===Pe)?ks.filter(bs=>bs.id!==Pe):ks),!1}const vn=await st.submitPrompt(ee,{content:at,model:Qt,thinking:Mt(Qt),permissionMode:e.permission,planMode:As,swarmMode:Cr});return Vt&&(e.goalModeBySession={...e.goalModeBySession,[ee]:!1},D()),e.promptIdBySession={...e.promptIdBySession,[ee]:vn.promptId},k(ee,$n=>{const ks=$n.findIndex(Ms=>Ms.id===Pe);if(ks===-1)return $n;const bs=[...$n];return bs[ks]={...bs[ks],promptId:bs[ks].promptId??vn.promptId},bs}),v()?.bindNextPromptId(ee,vn.promptId),!0}catch(st){return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,at=>at.some(Nt=>Nt.id===Pe)?at.filter(Nt=>Nt.id!==Pe):at),l("sendPrompt",st,{sessionId:ee}),!1}}async function zt(ee,_e){const Ae=e.activeSessionId;if(Ae){if(a.value!=="idle"||c.has(Ae)){hs(ee,_e);return}await Dt(Ae,ee,_e)}}async function wn(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[],st=[],at=[];for(const Vt of Pe){const vn=Vt.text.trim();vn&&st.push(vn),Vt.attachments?.length&&at.push(...Vt.attachments)}const Nt=ee.trim();if(Nt&&st.push(Nt),_e?.length&&at.push(..._e),st.length===0&&at.length===0)return;Pe.length>0&&(e.queuedBySession={...e.queuedBySession,[Ae]:[]});const Zt=st.join(`
|
|
317
317
|
|
|
318
|
-
`);if(a.value==="idle"&&!c.has(Ae)){await Dt(Ae,Zt,at);return}const Qt=[];Zt&&Qt.push({type:"text",text:Zt});for(const Vt of at)Vt.kind==="video"?Qt.push({type:"video",source:{kind:"file",fileId:Vt.fileId}}):Qt.push({type:"image",source:{kind:"file",fileId:Vt.fileId}});const As=g(),Cr={id:As,sessionId:Ae,role:"user",content:Qt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Ae,Vt=>[...Vt,Cr]);try{const Vt=ft(),vn=e.sessions.find(bs=>bs.id===Ae),$n=(vn?.model&&vn.model.length>0?vn.model:e.defaultModel)??void 0,ks=await Vt.submitPrompt(Ae,{content:Qt,model:$n,thinking:Mt($n),permissionMode:e.permission,planMode:e.planModeBySession[Ae]??!1,swarmMode:e.swarmModeBySession[Ae]??!1});if(k(Ae,bs=>{const Ms=bs.findIndex(gm=>gm.id===As);if(Ms===-1)return bs;const va=[...bs];return va[Ms]={...va[Ms],promptId:va[Ms].promptId??ks.promptId},va}),ks.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ae]:ks.promptId},v()?.bindNextPromptId(Ae,ks.promptId);return}try{await Vt.steerPrompts(Ae,[ks.promptId])}catch{}}catch(Vt){k(Ae,vn=>vn.filter($n=>$n.id!==As)),l("steer",Vt,{sessionId:Ae})}}async function Rn(ee,_e){try{const Pe=await ft().uploadFile({file:ee,name:_e});return{fileId:Pe.id,name:Pe.name,mediaType:Pe.mediaType}}catch(Ae){return l("uploadImage",Ae),null}}function hs(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[];e.queuedBySession={...e.queuedBySession,[Ae]:[...Pe,{text:ee,attachments:_e}]}}async function ss(){const ee=e.activeSessionId;if(!ee)return;const _e=e.sessions.find(st=>st.id===ee);let Ae=e.promptIdBySession[ee];if(Ae===void 0){const st=_e?.currentPromptId;st?.startsWith("prompt_")&&(Ae=st)}const Pe=ft();if(Ae!==void 0)try{if((await Pe.abortPrompt(ee,Ae)).aborted)return;const at={...e.promptIdBySession};delete at[ee],e.promptIdBySession=at}catch(st){if(ml(st)&&st.code===
|
|
319
|
-
`)}return null})();try{return await ft().undoSession(_e,ee),await y(_e),Ae}catch(Pe){return l("undo",Pe,{sessionId:_e}),null}}function Bn(ee){const _e=e.activeSessionId;if(!_e)return;const Ae=e.queuedBySession[_e]??[];if(ee<0||ee>=Ae.length)return;const Pe=[...Ae];Pe.splice(ee,1),e.queuedBySession={...e.queuedBySession,[_e]:Pe}}function Kn(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[];if(ee===_e||ee<0||ee>=Pe.length||_e<0||_e>=Pe.length)return;const st=[...Pe],[at]=st.splice(ee,1);at!==void 0&&(st.splice(_e,0,at),e.queuedBySession={...e.queuedBySession,[Ae]:st})}async function Mo(ee){const _e=e.activeSessionId;if(!_e)return[];try{return(await ft().listDirectory(_e,{path:ee,includeGitStatus:!0})).items}catch{return[]}}async function rt(ee){const _e=e.activeSessionId;if(!_e)return null;try{const Pe=await ft().readFile(_e,{path:ee});return{path:Pe.path,content:Pe.content,encoding:Pe.encoding,mime:Pe.mime,languageId:Pe.languageId,isBinary:Pe.isBinary,size:Pe.size,lineCount:Pe.lineCount}}catch{return null}}const xe=10485760;function Le(ee){const _e=e.activeSessionId;return _e?ft().getFileDownloadUrl(_e,ee):null}async function we(ee,_e){const Ae=e.activeSessionId;if(!Ae)return!1;try{return await ft().openFile(Ae,{path:ee,line:_e}),!0}catch(Pe){return l("openFile",Pe,{sessionId:Ae}),!1}}async function X(ee){const _e=e.activeSessionId;if(!_e)return;const Ae=F.value.cwd||".";try{await ft().openInApp(_e,ee,Ae)}catch(Pe){l("openInApp",Pe,{sessionId:_e})}}async function me(ee){const _e=e.activeSessionId;if(!_e)return!1;try{return await ft().revealFile(_e,{path:ee}),!0}catch(Ae){return l("revealFile",Ae,{sessionId:_e}),!1}}async function je(ee){if(/^(https?:|data:|blob:)/i.test(ee))return ee;const _e=e.activeSessionId;if(!_e)return ee;let Ae=ee;if(Ae.startsWith("/")){const Pe=e.sessions.find(st=>st.id===_e)?.cwd;if(Pe&&(Ae===Pe||Ae.startsWith(Pe.endsWith("/")?Pe:`${Pe}/`))){if(Ae=Ae.slice(Pe.length).replace(/^\//,""),!Ae)return ee}else return ee}try{const st=await ft().readFile(_e,{path:Ae,length:xe});return!st.isBinary||st.encoding!=="base64"||st.truncated?ee:`data:${st.mime};base64,${st.content}`}catch{return ee}}async function lt(ee){const _e=e.activeSessionId;if(!_e)return[];try{return(await ft().searchFiles(_e,{query:ee,limit:20})).items.map(st=>({path:st.path,name:st.name}))}catch{return[]}}return{loadFileDiff:ve,clearFileDiff:Y,loadGitStatus:ce,checkAuth:fe,loadConfig:j,updateConfig:se,listAllSessionsGlobal:q,load:Oe,loadWorkspaces:de,loadMoreSessions:Te,loadAllSessions:Ie,selectWorkspace:Qe,openWorkspace:tt,upsertWorkspacePreserveOrder:vt,applyWorkspaceEvent:wt,clearActiveSession:xt,openWorkspaceDraft:Rt,startSessionAndSendPrompt:nn,startSessionAndActivateSkill:xn,startSessionAndOpenSideChat:ns,addWorkspaceByPath:Wt,browseFs:_n,getFsHome:gn,writeSessionUrl:ot,fetchSessionIntoList:ds,onSessionRoutePopState:ys,bindSessionRoute:Xe,selectSession:Ze,submitPromptInternal:Dt,sendPrompt:zt,steerPrompt:wn,uploadImage:Rn,enqueue:hs,unqueue:Bn,reorderQueue:Kn,abortCurrentPrompt:ss,respondApproval:Vs,respondQuestion:an,dismissQuestion:So,pendingQuestionActions:Hl,pendingApprovalActions:Rf,cancelTask:Co,setPlanMode:Rs,togglePlanMode:fi,setSwarmMode:co,toggleSwarmMode:jo,setGoalMode:Ot,toggleGoalMode:Bs,createGoal:qn,controlGoal:Cs,setPermission:On,dismissWarning:Hn,renameSession:hi,renameWorkspace:Xn,deleteWorkspace:qo,archiveSession:Ks,restoreSession:Mi,loadArchivedSessions:Ao,logout:Vn,compact:Vo,forkSession:ji,undo:Ko,listDir:Mo,readFileContent:rt,getFileDownloadUrl:Le,openWorkspaceFile:we,openInApp:X,revealWorkspaceFile:me,resolveImageUrl:je,searchFiles:lt,loadOlderMessages:Se,refreshSessionSidecars:Ye,isStartingFirstPrompt:()=>Fi.size>0}}const wpe="kimiWeb.optimisticUserMessage";function Spe(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Cpe(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Ape(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function U0(e){return e.role==="user"&&e.metadata?.[wpe]===!0}function Mpe(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Epe(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const Tpe=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function yC(e){let t="",n=0;for(const s of e.content)s.type==="text"?Tpe.test(s.text.trim())?n+=1:t+=s.text:(s.type==="image"||s.type==="video"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Npe(e,t){const n=yC(e),s=yC(t);return n.text===s.text&&n.media===s.media}function Ipe(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&Epe(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&Npe(o,t))return s}return-1}function $pe(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function Lpe(e,t,n){const s=Cpe(e);switch(Ape(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[nM]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!Mpe(t.message)){const a=Ipe(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=$pe(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;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 o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?yn.global.t("warnings.errorLabel"):yn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function Fpe(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Ope(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||ha(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:Fpe(a.status)}]:[]})}}return[]}const Rpe=["queued","working","suspended","completed","failed"];function oM(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Bpe(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Dpe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:oM(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Bpe();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function Ppe(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Rpe)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function Hpe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const s=t.get(n.parentToolCallId)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:oM(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,s)}for(const[n,s]of t)t.set(n,s.toSorted((o,i)=>o.swarmIndex-i.swarmIndex||o.id.localeCompare(i.id)));return t}const Di=X5(),Pi=_he(),pd=Nhe(),iM=$t.permission,rM=$t.activeWorkspace,lM=$t.thinking,aM=$t.planMode,cM=$t.swarmMode,uM=$t.goalMode,kC=40401,dM=$t.onboarded,Wpe=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Ac($t.codeFont);Ac($t.theme);function zpe(){try{const e=Qn(iM);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Upe(e){try{ts(iM,e)}catch{}}function jpe(){try{const e=Qn(lM);if(e&&Wpe.test(e))return e}catch{}return"high"}function qpe(e){try{ts(lM,e)}catch{}}function j0(e){const t=Qn(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const s={};for(const[o,i]of Object.entries(n))i===!0&&(s[o]=!0);return s}catch{return{}}}function kk(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ts(e,JSON.stringify(n))}catch{}}function fM(){kk(aM,Ce.planModeBySession)}function hM(){kk(cM,Ce.swarmModeBySession)}function pM(){kk(uM,Ce.goalModeBySession)}function Vpe(){try{return Qn(rM)}catch{return null}}const mM=$t.hiddenWorkspaces;function Kpe(){try{const e=Qn(mM);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Gpe(e){try{ts(mM,JSON.stringify(e))}catch{}}function Ype(e){try{ts(rM,e)}catch{}}function Zpe(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ce=Ss({...Spe(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:zpe(),thinking:jpe(),planModeBySession:j0(aM),swarmModeBySession:j0(cM),goalModeBySession:j0(uM),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:Xv(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Vpe(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Kpe(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),am=Ss({planMode:!1,swarmMode:!1,goalMode:!1});function gM(e){Ce.sessions=e}function cm(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function Qpe(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function Xpe(e){Ce.sessions=[...Ce.sessions,e]}function Jpe(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function vM(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},Jv({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(Ce.unreadBySession=Xv(),vM())});function eme(){if(ci===null||!ci.health().stale)return;ar("ws: stale socket on focus, reconnecting",{activeSessionId:Ce.activeSessionId}),ci.reconnect();const e=Ce.activeSessionId;e&&$M.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(vM(),eme())});function bk(e){Ce.activeSessionId=e}function tme(e){Ce.messagesBySession=e}function nme(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function yM(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function sme(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function kM(e){ci?.unsubscribe(e),Ame(e),lp.flush(),Jpe(e),sme(e),delete Ce.approvalsBySession[e],delete Ce.questionsBySession[e],delete Ce.tasksBySession[e],delete Ce.goalBySession[e],delete Ce.gitStatusBySession[e],delete Ce.lastSeqBySession[e],delete Ce.compactionBySession[e],delete Ce.messagesLoadingMoreBySession[e],delete Ce.messagesHasMoreBySession[e],delete Ce.messagesLoadMoreErrorBySession[e],delete xk[e],NM.delete(e),dm.delete(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.sendingBySession[e],delete Ce.planModeBySession[e],delete Ce.swarmModeBySession[e],delete Ce.goalModeBySession[e],fM(),hM(),pM()}const bM=Q(null),xM=Q([]),_M=Q(!1),wM=Q(!1);async function um(e){let t;try{t=await ft().getSessionStatus(e)}catch{return}cm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmModeBySession={...Ce.swarmModeBySession,[e]:t.swarmMode},Ce.planModeBySession={...Ce.planModeBySession,[e]:t.planMode}}function SM(e,t){const n=t??Ce.activeSessionId;return n?Promise.resolve(ft().updateSession(n,e)).then(()=>um(n)).catch(()=>{}):Promise.resolve()}const CM=$t.conversationToc;function ome(){try{const e=Qn(CM);return e===null?!0:e==="true"}catch{return!0}}function ime(e){try{ts(CM,e?"true":"false")}catch{}}const AM=Q(ome());function rme(e){AM.value=e,ime(e)}function lme(e){try{return Qn(e)??""}catch{return""}}const MM=Q(lme(dM)==="1");function ame(e){MM.value=e;try{ts(dM,e?"1":"0")}catch{}}let ci=null,bC=0;function EM(){return bC+=1,`msg_opt_${Date.now().toString(36)}_${bC}`}const dm=new Set;function cme(e,t,n){const s={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,planReviewByToolCallId:Ce.planReviewByToolCallId,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,lastSeqBySession:Ce.lastSeqBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},o=Lpe(s,e,{sessionId:t,seq:n});gM(o.sessions),bk(o.activeSessionId),tme(o.messagesBySession),Ce.approvalsBySession=o.approvalsBySession,Ce.planReviewByToolCallId=o.planReviewByToolCallId,Ce.questionsBySession=o.questionsBySession,Ce.tasksBySession=o.tasksBySession,Ce.goalBySession=o.goalBySession,Ce.lastSeqBySession=o.lastSeqBySession,Ce.compactionBySession=o.compactionBySession,Ce.config=o.config??null,Ce.warnings=o.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Cn.loadModels(),Cn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Ce.swarmModeBySession={...Ce.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Ce.planModeBySession={...Ce.planModeBySession,[e.sessionId]:e.planMode}))}function ume(e,t){cme(e,t.sessionId,t.seq);const n=Hs.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&Hs.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?Hs.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?Hs.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&Hs.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;Ce.promptIdBySession[s]!==e.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ce.activeSessionId&&Di.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&N1e(e.sessionId,e.status),e.type==="questionRequested"&&I1e(e.sessionId,e.question),e.type==="approvalRequested"&&$1e(e.sessionId,e.approval)}const lp=Vfe(({appEvent:e,meta:t})=>ume(e,t),({appEvent:e})=>jfe(e));function TM(){if(ci!==null||typeof WebSocket>"u")return;Ce.connection="connecting",ci=ft().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ht.applyWorkspaceEvent(t);return}lp({appEvent:t,meta:n})},onResync(t,n,s){lp.flush(),s!==void 0&&(xk[t]=s),$M.request(t)},onError(t,n,s){_k({severity:"error",title:yn.global.t("warnings.wsTitle"),message:n,details:[Wn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Ce.connected=t,Ce.connection=t?"connected":"disconnected",t&&yme()}})}const xk={},NM=new Set;function dme(e){return ml(e)&&e.code===kC?!0:typeof e=="object"&&e!==null&&e.code===kC}function Wn(e,t){if(!(t==null||t===""))return{label:yn.global.t(`warnings.details.${e}`),value:IM(t)}}function IM(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 fme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function hme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function pme(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function mme(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function xC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function gme(e,t,n){const s=B5(t),o=ml(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Wn("operation",e),Wn("sessionId",n??Ce.activeSessionId),Wn("connection",Ce.connection),Wn("timestamp",mme(i??Date.now()))];return s?l.push(Wn("duration",xC(r)),Wn("request",`${t.method} ${t.path}`),Wn("endpoint",t.url),Wn("requestId",t.requestId),Wn("phase",t.phase),Wn("timeout",`${t.timeoutMs}ms`),Wn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Wn("contentType",t.contentType),Wn("responsePreview",t.bodyPreview),Wn("cause",t.cause)):o?l.push(Wn("duration",xC(r)),Wn("code",t.code),Wn("requestId",t.requestId),Wn("message",t.message),Wn("details",t.details)):l.push(Wn("errorName",fme(t)),Wn("message",hme(t)??IM(t)),Wn("stack",pme(t))),l.filter(a=>a!==void 0)}function vme(e,t,n={}){const s=B5(t),o=ml(t),i=n.title??(s?yn.global.t("warnings.daemonNetworkTitle"):o?yn.global.t("warnings.daemonApiTitle"):yn.global.t("warnings.operationFailedTitle")),r=n.message??(s?yn.global.t("warnings.daemonNetworkMessage"):o?t.message:yn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:gme(e,t,n.sessionId)}}function _k(e){Ce.warnings=[...Ce.warnings,e]}function yme(){const e=yn.global.t("warnings.wsTitle"),t=Ce.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ce.warnings.length&&(Ce.warnings=t)}function fm(e,t,n){_k(vme(e,t,n))}const kme={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function bme(e){if(!ml(e))return;const t=kme[e.code];return t?yn.global.t(t):void 0}async function xme(e){if(kM(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await ht.selectSession(t.id,{urlMode:"replace"}):(bk(void 0),Ce.sessionLoading=!1,ht.writeSessionUrl(void 0,"replace"))}const _C=new Set;async function _me(e){if(!_C.has(e)){_C.add(e);try{const t=await ft().getSessionWarnings(e),n=yn.global.t("warnings.noteLabel");for(const s of t)_k(`${n}: ${s.message}`)}catch{}}}async function wk(e){try{const n=await ft().getSessionSnapshot(e);lp.flush(),cm(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),nme(e,Wfe(Ce.messagesBySession[e]??[],n.messages)),Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:n.hasMoreMessages},Ce.approvalsBySession={...Ce.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(Ce.planReviewByToolCallId={...Ce.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return Ce.questionsBySession={...Ce.questionsBySession,[e]:n.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:n.asOfSeq},xk[e]=n.epoch,TM(),ci&&(ci.seedSnapshot(e,n),ci.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),Cme(e)),Sk.delete(e),_me(e),"ok"}catch(t){return dme(t)?(await xme(e),"not-found"):(fm("getSessionSnapshot",t,{title:yn.global.t("warnings.sessionSnapshotTitle"),message:yn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const $M=zfe(wk);function wme(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}const Sme=4,rr=[],Sk=new Set;function Cme(e){const t=rr.indexOf(e);for(t!==-1&&rr.splice(t,1),rr.unshift(e);rr.length>Sme;){let n=-1;for(let o=rr.length-1;o>=0;o--)if(rr[o]!==Ce.activeSessionId){n=o;break}if(n===-1)break;const[s]=rr.splice(n,1);if(s===void 0)break;ci?.unsubscribe(s),Sk.add(s)}}function Ame(e){const t=rr.indexOf(e);t!==-1&&rr.splice(t,1),Sk.delete(e)}async function Mme(e){return wk(e)}function hm(e){const t=Ce.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Hs.sideChatTargetBySession.value[e]?.agentId,o=(Ce.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Ce.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Ck(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return yn.global.t("sessions.justNow");if(i<1)return`${Math.round(o/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=o/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}mo`:`${Math.round(r/365)}y`}catch{return e}}const Eme=3e4,md=Q(0);let q0=null;function Tme(){q0===null&&(q0=setInterval(()=>{md.value=(md.value+1)%Number.MAX_SAFE_INTEGER},Eme),q0.unref?.())}function Nme(e,t){const n=e.split(`
|
|
318
|
+
`);if(a.value==="idle"&&!c.has(Ae)){await Dt(Ae,Zt,at);return}const Qt=[];Zt&&Qt.push({type:"text",text:Zt});for(const Vt of at)Vt.kind==="video"?Qt.push({type:"video",source:{kind:"file",fileId:Vt.fileId}}):Qt.push({type:"image",source:{kind:"file",fileId:Vt.fileId}});const As=g(),Cr={id:As,sessionId:Ae,role:"user",content:Qt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Ae,Vt=>[...Vt,Cr]);try{const Vt=ft(),vn=e.sessions.find(bs=>bs.id===Ae),$n=(vn?.model&&vn.model.length>0?vn.model:e.defaultModel)??void 0,ks=await Vt.submitPrompt(Ae,{content:Qt,model:$n,thinking:Mt($n),permissionMode:e.permission,planMode:e.planModeBySession[Ae]??!1,swarmMode:e.swarmModeBySession[Ae]??!1});if(k(Ae,bs=>{const Ms=bs.findIndex(gm=>gm.id===As);if(Ms===-1)return bs;const va=[...bs];return va[Ms]={...va[Ms],promptId:va[Ms].promptId??ks.promptId},va}),ks.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ae]:ks.promptId},v()?.bindNextPromptId(Ae,ks.promptId);return}try{await Vt.steerPrompts(Ae,[ks.promptId])}catch{}}catch(Vt){k(Ae,vn=>vn.filter($n=>$n.id!==As)),l("steer",Vt,{sessionId:Ae})}}async function Rn(ee,_e){try{const Pe=await ft().uploadFile({file:ee,name:_e});return{fileId:Pe.id,name:Pe.name,mediaType:Pe.mediaType}}catch(Ae){return l("uploadImage",Ae),null}}function hs(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[];e.queuedBySession={...e.queuedBySession,[Ae]:[...Pe,{text:ee,attachments:_e}]}}async function ss(){const ee=e.activeSessionId;if(!ee)return;const _e=e.sessions.find(st=>st.id===ee);let Ae=e.promptIdBySession[ee];if(Ae===void 0){const st=_e?.currentPromptId;st?.startsWith("prompt_")&&(Ae=st)}const Pe=ft();if(Ae!==void 0)try{if((await Pe.abortPrompt(ee,Ae)).aborted)return;const at={...e.promptIdBySession};delete at[ee],e.promptIdBySession=at}catch(st){if(ml(st)&&st.code===bpe){const at={...e.promptIdBySession};delete at[ee],e.promptIdBySession=at}else{l("abortCurrentPrompt",st,{sessionId:ee});return}}try{await Pe.abortSession(ee)}catch(st){l("abortCurrentPrompt",st,{sessionId:ee})}}function sn(ee,_e){const Ae=e.approvalsBySession[ee]??[];e.approvalsBySession={...e.approvalsBySession,[ee]:Ae.filter(Pe=>Pe.approvalId!==_e)}}function Lt(ee,_e){const Ae=e.questionsBySession[ee]??[];e.questionsBySession={...e.questionsBySession,[ee]:Ae.filter(Pe=>Pe.questionId!==_e)}}async function Vs(ee,_e){const Ae=e.activeSessionId;if(Ae&&!Rf[ee]){Rf[ee]=!0;try{const Pe=ft(),st={decision:_e.decision,scope:_e.scope,feedback:_e.feedback,selectedLabel:_e.selectedLabel};await Pe.respondApproval(Ae,ee,st),sn(Ae,ee)}catch(Pe){W0(Pe)?sn(Ae,ee):l("respondApproval",Pe,{sessionId:Ae})}finally{delete Rf[ee]}}}async function an(ee,_e){const Ae=e.activeSessionId;if(Ae&&!Hl[ee]){Hl[ee]="answer";try{await ft().respondQuestion(Ae,ee,_e),Lt(Ae,ee)}catch(Pe){W0(Pe)?Lt(Ae,ee):l("respondQuestion",Pe,{sessionId:Ae})}finally{delete Hl[ee]}}}async function So(ee){const _e=e.activeSessionId;if(_e&&!Hl[ee]){Hl[ee]="dismiss";try{await ft().dismissQuestion(_e,ee),Lt(_e,ee)}catch(Ae){W0(Ae)?Lt(_e,ee):l("dismissQuestion",Ae,{sessionId:_e})}finally{delete Hl[ee]}}}async function Co(ee){const _e=e.activeSessionId;if(_e&&!z0[ee]){z0[ee]=!0;try{await ft().cancelTask(_e,ee);const Pe=e.tasksBySession[_e]??[];e.tasksBySession={...e.tasksBySession,[_e]:Pe.map(st=>st.id===ee?{...st,status:"cancelled"}:st)}}catch(Ae){Spe(Ae)||l("cancelTask",Ae,{sessionId:_e})}finally{delete z0[ee]}}}function Rs(ee){const _e=e.activeSessionId;_e?(e.planModeBySession={...e.planModeBySession,[_e]:ee},R(),x({planMode:ee})):W.planMode=ee}function fi(){const ee=e.activeSessionId,_e=ee?e.planModeBySession[ee]??!1:W.planMode;Rs(!_e)}function co(ee){const _e=e.activeSessionId;_e?(e.swarmModeBySession={...e.swarmModeBySession,[_e]:ee},O(),x({swarmMode:ee})):W.swarmMode=ee}async function jo(){const ee=e.activeSessionId,Ae=!(ee?e.swarmModeBySession[ee]??!1:W.swarmMode);Ae&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||co(Ae)}function Ot(ee){const _e=e.activeSessionId;_e?(e.goalModeBySession={...e.goalModeBySession,[_e]:ee},D()):W.goalMode=ee}function Bs(){const ee=e.activeSessionId,_e=ee?e.goalModeBySession[ee]??!1:W.goalMode;Ot(!_e)}async function qn(ee){const _e=ee.trim();if(!_e||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:_e}),variant:"primary"}))return;let Ae=e.activeSessionId;if(!Ae){const Pe=e.activeWorkspaceId,st=Pe&&N.value.some(at=>at.id===Pe)?Pe:N.value[0]?.id??null;if(!st)return;try{Ae=await yt(st)??void 0}catch(at){l("createGoal",at);return}if(!Ae)return}try{await ft().updateSession(Ae,{goalObjective:_e})}catch(Pe){l("createGoal",Pe,{sessionId:Ae,message:re(Pe)});return}e.goalModeBySession[Ae]&&(e.goalModeBySession={...e.goalModeBySession,[Ae]:!1},D()),e.activeSessionId===Ae?await zt(_e):await Dt(Ae,_e)}function Cs(ee){const _e=e.activeSessionId;_e&&Promise.resolve(ft().updateSession(_e,{goalControl:ee})).catch(Ae=>{l("controlGoal",Ae,{sessionId:_e,message:re(Ae)})})}function On(ee){e.permission=ee,T(ee),x({permissionMode:ee})}function Hn(ee){const _e=[...e.warnings];_e.splice(ee,1),e.warnings=_e}async function hi(ee,_e){try{await ft().updateSession(ee,{title:_e}),f(ee,Pe=>({...Pe,title:_e}))}catch(Ae){l("renameSession",Ae,{sessionId:ee})}}async function Xn(ee,_e){const Ae=e.workspaces.find(st=>st.id===ee)?.root,Pe=()=>{e.workspaces=e.workspaces.map(st=>st.id===ee?{...st,name:_e}:st)};try{if(await ft().updateWorkspace(ee,{name:_e}),Ae!==void 0){const st=gf();Ae in st&&(delete st[Ae],vx(st))}Pe()}catch(st){if(Ae!==void 0&&ml(st)&&st.code===xpe){vx({...gf(),[Ae]:_e}),Pe();return}l("renameWorkspace",st)}}async function qo(ee){const _e=e.workspaces.find(at=>at.id===ee)?.root??E.value.find(at=>at.id===ee)?.root??ee,Ae=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Pe=e.activeWorkspaceId===ee||e.activeWorkspaceId===_e,st=!!(Ae&&(Ae.cwd===_e||Ae.workspaceId===ee||S(Ae)===ee));_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],U(e.hiddenWorkspaceRoots));try{await ft().deleteWorkspace(ee)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==ee&&at.root!==_e),Pe||st){const at=N.value[0]?.id??null;if(e.activeWorkspaceId=at,at)V(at);else try{Ac($t.activeWorkspace)}catch{}}(Pe||st)&&(_(void 0),e.sessionLoading=!1,Y(),ot(void 0,"replace"))}async function Ks(ee){try{await ft().archiveSession(ee),m(ee),i.clearSideChatForSession(ee);const{[ee]:Ae,...Pe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Pe,e.activeSessionId===ee){const st=e.sessions[0];st?await Ze(st.id,{urlMode:"replace"}):(_(void 0),ot(void 0,"replace"))}}catch(_e){l("archiveSession",_e,{sessionId:ee})}}async function Mi(ee){try{const _e=await ft().restoreSession(ee);return p(_e),!0}catch(_e){return l("restoreSession",_e,{sessionId:ee}),!1}}function Ao(ee){return ft().listSessions({archivedOnly:!0,beforeId:ee?.beforeId,pageSize:ee?.pageSize??50})}async function Vn(){try{await ft().logout(),await fe(),await Oe()}catch(ee){l("logout",ee)}}function Vo(ee){const _e=e.activeSessionId;_e&&ft().compactSession(_e,ee).catch(Ae=>{l("compact",Ae,{sessionId:_e})})}async function ji(ee){const _e=ee??e.activeSessionId;if(_e)try{const Ae=await ft().forkSession(_e);p(Ae),await Ze(Ae.id)}catch(Ae){l("fork",Ae,{sessionId:_e})}}async function Ko(ee=1){const _e=e.activeSessionId;if(!_e)return null;const Ae=(()=>{const Pe=e.messagesBySession[_e]??[];for(let st=Pe.length-1;st>=0;st--){const at=Pe[st];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Nt=>Nt.type==="text").map(Nt=>Nt.text).join(`
|
|
319
|
+
`)}return null})();try{return await ft().undoSession(_e,ee),await y(_e),Ae}catch(Pe){return l("undo",Pe,{sessionId:_e}),null}}function Bn(ee){const _e=e.activeSessionId;if(!_e)return;const Ae=e.queuedBySession[_e]??[];if(ee<0||ee>=Ae.length)return;const Pe=[...Ae];Pe.splice(ee,1),e.queuedBySession={...e.queuedBySession,[_e]:Pe}}function Kn(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[];if(ee===_e||ee<0||ee>=Pe.length||_e<0||_e>=Pe.length)return;const st=[...Pe],[at]=st.splice(ee,1);at!==void 0&&(st.splice(_e,0,at),e.queuedBySession={...e.queuedBySession,[Ae]:st})}async function Mo(ee){const _e=e.activeSessionId;if(!_e)return[];try{return(await ft().listDirectory(_e,{path:ee,includeGitStatus:!0})).items}catch{return[]}}async function rt(ee){const _e=e.activeSessionId;if(!_e)return null;try{const Pe=await ft().readFile(_e,{path:ee});return{path:Pe.path,content:Pe.content,encoding:Pe.encoding,mime:Pe.mime,languageId:Pe.languageId,isBinary:Pe.isBinary,size:Pe.size,lineCount:Pe.lineCount}}catch{return null}}const xe=10485760;function Le(ee){const _e=e.activeSessionId;return _e?ft().getFileDownloadUrl(_e,ee):null}async function we(ee,_e){const Ae=e.activeSessionId;if(!Ae)return!1;try{return await ft().openFile(Ae,{path:ee,line:_e}),!0}catch(Pe){return l("openFile",Pe,{sessionId:Ae}),!1}}async function X(ee){const _e=e.activeSessionId;if(!_e)return;const Ae=F.value.cwd||".";try{await ft().openInApp(_e,ee,Ae)}catch(Pe){l("openInApp",Pe,{sessionId:_e})}}async function me(ee){const _e=e.activeSessionId;if(!_e)return!1;try{return await ft().revealFile(_e,{path:ee}),!0}catch(Ae){return l("revealFile",Ae,{sessionId:_e}),!1}}async function je(ee){if(/^(https?:|data:|blob:)/i.test(ee))return ee;const _e=e.activeSessionId;if(!_e)return ee;let Ae=ee;if(Ae.startsWith("/")){const Pe=e.sessions.find(st=>st.id===_e)?.cwd;if(Pe&&(Ae===Pe||Ae.startsWith(Pe.endsWith("/")?Pe:`${Pe}/`))){if(Ae=Ae.slice(Pe.length).replace(/^\//,""),!Ae)return ee}else return ee}try{const st=await ft().readFile(_e,{path:Ae,length:xe});return!st.isBinary||st.encoding!=="base64"||st.truncated?ee:`data:${st.mime};base64,${st.content}`}catch{return ee}}async function lt(ee){const _e=e.activeSessionId;if(!_e)return[];try{return(await ft().searchFiles(_e,{query:ee,limit:20})).items.map(st=>({path:st.path,name:st.name}))}catch{return[]}}return{loadFileDiff:ve,clearFileDiff:Y,loadGitStatus:ce,checkAuth:fe,loadConfig:j,updateConfig:se,listAllSessionsGlobal:q,load:Oe,loadWorkspaces:de,loadMoreSessions:Te,loadAllSessions:Ie,selectWorkspace:Qe,openWorkspace:tt,upsertWorkspacePreserveOrder:vt,applyWorkspaceEvent:wt,clearActiveSession:xt,openWorkspaceDraft:Rt,startSessionAndSendPrompt:nn,startSessionAndActivateSkill:xn,startSessionAndOpenSideChat:ns,addWorkspaceByPath:Wt,browseFs:_n,getFsHome:gn,writeSessionUrl:ot,fetchSessionIntoList:ds,onSessionRoutePopState:ys,bindSessionRoute:Xe,selectSession:Ze,submitPromptInternal:Dt,sendPrompt:zt,steerPrompt:wn,uploadImage:Rn,enqueue:hs,unqueue:Bn,reorderQueue:Kn,abortCurrentPrompt:ss,respondApproval:Vs,respondQuestion:an,dismissQuestion:So,pendingQuestionActions:Hl,pendingApprovalActions:Rf,cancelTask:Co,setPlanMode:Rs,togglePlanMode:fi,setSwarmMode:co,toggleSwarmMode:jo,setGoalMode:Ot,toggleGoalMode:Bs,createGoal:qn,controlGoal:Cs,setPermission:On,dismissWarning:Hn,renameSession:hi,renameWorkspace:Xn,deleteWorkspace:qo,archiveSession:Ks,restoreSession:Mi,loadArchivedSessions:Ao,logout:Vn,compact:Vo,forkSession:ji,undo:Ko,listDir:Mo,readFileContent:rt,getFileDownloadUrl:Le,openWorkspaceFile:we,openInApp:X,revealWorkspaceFile:me,resolveImageUrl:je,searchFiles:lt,loadOlderMessages:Se,refreshSessionSidecars:Ye,isStartingFirstPrompt:()=>Fi.size>0}}const Ape="kimiWeb.optimisticUserMessage";function Mpe(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Epe(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Tpe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function U0(e){return e.role==="user"&&e.metadata?.[Ape]===!0}function Npe(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Ipe(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const $pe=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function yC(e){let t="",n=0;for(const s of e.content)s.type==="text"?$pe.test(s.text.trim())?n+=1:t+=s.text:(s.type==="image"||s.type==="video"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Lpe(e,t){const n=yC(e),s=yC(t);return n.text===s.text&&n.media===s.media}function Fpe(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&Ipe(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&Lpe(o,t))return s}return-1}function Ope(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function Rpe(e,t,n){const s=Epe(e);switch(Tpe(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[nM]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!Npe(t.message)){const a=Fpe(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=Ope(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;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 o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?yn.global.t("warnings.errorLabel"):yn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function Bpe(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Dpe(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||ha(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:Bpe(a.status)}]:[]})}}return[]}const Ppe=["queued","working","suspended","completed","failed"];function oM(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Hpe(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Wpe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:oM(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Hpe();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function zpe(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Ppe)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function Upe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const s=t.get(n.parentToolCallId)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:oM(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,s)}for(const[n,s]of t)t.set(n,s.toSorted((o,i)=>o.swarmIndex-i.swarmIndex||o.id.localeCompare(i.id)));return t}const Di=X5(),Pi=_he(),pd=Nhe(),iM=$t.permission,rM=$t.activeWorkspace,lM=$t.thinking,aM=$t.planMode,cM=$t.swarmMode,uM=$t.goalMode,kC=40401,dM=$t.onboarded,jpe=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Ac($t.codeFont);Ac($t.theme);function qpe(){try{const e=Qn(iM);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Vpe(e){try{ts(iM,e)}catch{}}function Kpe(){try{const e=Qn(lM);if(e&&jpe.test(e))return e}catch{}return"high"}function Gpe(e){try{ts(lM,e)}catch{}}function j0(e){const t=Qn(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const s={};for(const[o,i]of Object.entries(n))i===!0&&(s[o]=!0);return s}catch{return{}}}function kk(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ts(e,JSON.stringify(n))}catch{}}function fM(){kk(aM,Ce.planModeBySession)}function hM(){kk(cM,Ce.swarmModeBySession)}function pM(){kk(uM,Ce.goalModeBySession)}function Ype(){try{return Qn(rM)}catch{return null}}const mM=$t.hiddenWorkspaces;function Zpe(){try{const e=Qn(mM);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Qpe(e){try{ts(mM,JSON.stringify(e))}catch{}}function Xpe(e){try{ts(rM,e)}catch{}}function Jpe(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ce=Ss({...Mpe(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:qpe(),thinking:Kpe(),planModeBySession:j0(aM),swarmModeBySession:j0(cM),goalModeBySession:j0(uM),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:Xv(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Ype(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Zpe(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),am=Ss({planMode:!1,swarmMode:!1,goalMode:!1});function gM(e){Ce.sessions=e}function cm(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function eme(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function tme(e){Ce.sessions=[...Ce.sessions,e]}function nme(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function vM(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},Jv({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(Ce.unreadBySession=Xv(),vM())});function sme(){if(ci===null||!ci.health().stale)return;ar("ws: stale socket on focus, reconnecting",{activeSessionId:Ce.activeSessionId}),ci.reconnect();const e=Ce.activeSessionId;e&&$M.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(vM(),sme())});function bk(e){Ce.activeSessionId=e}function ome(e){Ce.messagesBySession=e}function ime(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function yM(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function rme(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function kM(e){ci?.unsubscribe(e),Tme(e),lp.flush(),nme(e),rme(e),delete Ce.approvalsBySession[e],delete Ce.questionsBySession[e],delete Ce.tasksBySession[e],delete Ce.goalBySession[e],delete Ce.gitStatusBySession[e],delete Ce.lastSeqBySession[e],delete Ce.compactionBySession[e],delete Ce.messagesLoadingMoreBySession[e],delete Ce.messagesHasMoreBySession[e],delete Ce.messagesLoadMoreErrorBySession[e],delete xk[e],NM.delete(e),dm.delete(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.sendingBySession[e],delete Ce.planModeBySession[e],delete Ce.swarmModeBySession[e],delete Ce.goalModeBySession[e],fM(),hM(),pM()}const bM=Q(null),xM=Q([]),_M=Q(!1),wM=Q(!1);async function um(e){let t;try{t=await ft().getSessionStatus(e)}catch{return}cm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmModeBySession={...Ce.swarmModeBySession,[e]:t.swarmMode},Ce.planModeBySession={...Ce.planModeBySession,[e]:t.planMode}}function SM(e,t){const n=t??Ce.activeSessionId;return n?Promise.resolve(ft().updateSession(n,e)).then(()=>um(n)).catch(()=>{}):Promise.resolve()}const CM=$t.conversationToc;function lme(){try{const e=Qn(CM);return e===null?!0:e==="true"}catch{return!0}}function ame(e){try{ts(CM,e?"true":"false")}catch{}}const AM=Q(lme());function cme(e){AM.value=e,ame(e)}function ume(e){try{return Qn(e)??""}catch{return""}}const MM=Q(ume(dM)==="1");function dme(e){MM.value=e;try{ts(dM,e?"1":"0")}catch{}}let ci=null,bC=0;function EM(){return bC+=1,`msg_opt_${Date.now().toString(36)}_${bC}`}const dm=new Set;function fme(e,t,n){const s={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,planReviewByToolCallId:Ce.planReviewByToolCallId,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,lastSeqBySession:Ce.lastSeqBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},o=Rpe(s,e,{sessionId:t,seq:n});gM(o.sessions),bk(o.activeSessionId),ome(o.messagesBySession),Ce.approvalsBySession=o.approvalsBySession,Ce.planReviewByToolCallId=o.planReviewByToolCallId,Ce.questionsBySession=o.questionsBySession,Ce.tasksBySession=o.tasksBySession,Ce.goalBySession=o.goalBySession,Ce.lastSeqBySession=o.lastSeqBySession,Ce.compactionBySession=o.compactionBySession,Ce.config=o.config??null,Ce.warnings=o.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Cn.loadModels(),Cn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Ce.swarmModeBySession={...Ce.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Ce.planModeBySession={...Ce.planModeBySession,[e.sessionId]:e.planMode}))}function hme(e,t){fme(e,t.sessionId,t.seq);const n=Hs.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&Hs.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?Hs.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?Hs.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&Hs.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;Ce.promptIdBySession[s]!==e.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ce.activeSessionId&&Di.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&L1e(e.sessionId,e.status),e.type==="questionRequested"&&F1e(e.sessionId,e.question),e.type==="approvalRequested"&&O1e(e.sessionId,e.approval)}const lp=Vfe(({appEvent:e,meta:t})=>hme(e,t),({appEvent:e})=>jfe(e));function TM(){if(ci!==null||typeof WebSocket>"u")return;Ce.connection="connecting",ci=ft().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ht.applyWorkspaceEvent(t);return}lp({appEvent:t,meta:n})},onResync(t,n,s){lp.flush(),s!==void 0&&(xk[t]=s),$M.request(t)},onError(t,n,s){_k({severity:"error",title:yn.global.t("warnings.wsTitle"),message:n,details:[Wn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Ce.connected=t,Ce.connection=t?"connected":"disconnected",t&&xme()}})}const xk={},NM=new Set;function pme(e){return ml(e)&&e.code===kC?!0:typeof e=="object"&&e!==null&&e.code===kC}function Wn(e,t){if(!(t==null||t===""))return{label:yn.global.t(`warnings.details.${e}`),value:IM(t)}}function IM(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 mme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function gme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function vme(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function yme(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function xC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function kme(e,t,n){const s=B5(t),o=ml(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Wn("operation",e),Wn("sessionId",n??Ce.activeSessionId),Wn("connection",Ce.connection),Wn("timestamp",yme(i??Date.now()))];return s?l.push(Wn("duration",xC(r)),Wn("request",`${t.method} ${t.path}`),Wn("endpoint",t.url),Wn("requestId",t.requestId),Wn("phase",t.phase),Wn("timeout",`${t.timeoutMs}ms`),Wn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Wn("contentType",t.contentType),Wn("responsePreview",t.bodyPreview),Wn("cause",t.cause)):o?l.push(Wn("duration",xC(r)),Wn("code",t.code),Wn("requestId",t.requestId),Wn("message",t.message),Wn("details",t.details)):l.push(Wn("errorName",mme(t)),Wn("message",gme(t)??IM(t)),Wn("stack",vme(t))),l.filter(a=>a!==void 0)}function bme(e,t,n={}){const s=B5(t),o=ml(t),i=n.title??(s?yn.global.t("warnings.daemonNetworkTitle"):o?yn.global.t("warnings.daemonApiTitle"):yn.global.t("warnings.operationFailedTitle")),r=n.message??(s?yn.global.t("warnings.daemonNetworkMessage"):o?t.message:yn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:kme(e,t,n.sessionId)}}function _k(e){Ce.warnings=[...Ce.warnings,e]}function xme(){const e=yn.global.t("warnings.wsTitle"),t=Ce.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ce.warnings.length&&(Ce.warnings=t)}function fm(e,t,n){_k(bme(e,t,n))}const _me={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function wme(e){if(!ml(e))return;const t=_me[e.code];return t?yn.global.t(t):void 0}async function Sme(e){if(kM(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await ht.selectSession(t.id,{urlMode:"replace"}):(bk(void 0),Ce.sessionLoading=!1,ht.writeSessionUrl(void 0,"replace"))}const _C=new Set;async function Cme(e){if(!_C.has(e)){_C.add(e);try{const t=await ft().getSessionWarnings(e),n=yn.global.t("warnings.noteLabel");for(const s of t)_k(`${n}: ${s.message}`)}catch{}}}async function wk(e){try{const n=await ft().getSessionSnapshot(e);lp.flush(),cm(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),ime(e,Wfe(Ce.messagesBySession[e]??[],n.messages)),Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:n.hasMoreMessages},Ce.approvalsBySession={...Ce.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(Ce.planReviewByToolCallId={...Ce.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return Ce.questionsBySession={...Ce.questionsBySession,[e]:n.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:n.asOfSeq},xk[e]=n.epoch,TM(),ci&&(ci.seedSnapshot(e,n),ci.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),Eme(e)),Sk.delete(e),Cme(e),"ok"}catch(t){return pme(t)?(await Sme(e),"not-found"):(fm("getSessionSnapshot",t,{title:yn.global.t("warnings.sessionSnapshotTitle"),message:yn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const $M=zfe(wk);function Ame(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}const Mme=4,rr=[],Sk=new Set;function Eme(e){const t=rr.indexOf(e);for(t!==-1&&rr.splice(t,1),rr.unshift(e);rr.length>Mme;){let n=-1;for(let o=rr.length-1;o>=0;o--)if(rr[o]!==Ce.activeSessionId){n=o;break}if(n===-1)break;const[s]=rr.splice(n,1);if(s===void 0)break;ci?.unsubscribe(s),Sk.add(s)}}function Tme(e){const t=rr.indexOf(e);t!==-1&&rr.splice(t,1),Sk.delete(e)}async function Nme(e){return wk(e)}function hm(e){const t=Ce.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Hs.sideChatTargetBySession.value[e]?.agentId,o=(Ce.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Ce.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Ck(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return yn.global.t("sessions.justNow");if(i<1)return`${Math.round(o/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=o/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}mo`:`${Math.round(r/365)}y`}catch{return e}}const Ime=3e4,md=Q(0);let q0=null;function $me(){q0===null&&(q0=setInterval(()=>{md.value=(md.value+1)%Number.MAX_SAFE_INTEGER},Ime),q0.unref?.())}function Lme(e,t){const n=e.split(`
|
|
320
320
|
`),s=t.split(`
|
|
321
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Ime(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Nme(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const s=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function $me(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 Lme(e){const t=Ce.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Fme(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=yn.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=yn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Lme(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const Ome=P(()=>{const e=Ce.sessions.find(n=>n.id===Ce.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ce.workspaceName,branch:t}}),Rme=P(()=>(md.value,Ce.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Ck(e.updatedAt,e.status),status:e.status,busy:hm(e.id)})))),Bme=P(()=>Ce.activeSessionId??""),Dme=P(()=>{const e=Ce.activeSessionId;if(e)return Cn.skillsBySession.value[e]??[];const t=mm.value;return t?Cn.skillsByWorkspace.value[t]??[]:[]}),Pme=P(()=>{const e=Ce.activeSessionId;return e?Ce.sendingBySession[e]??!1:!1}),Hme=P(()=>ht.isStartingFirstPrompt()),Hs=fpe(Ce,{pushOperationFailure:fm,nextOptimisticMsgId:EM,connectEventsIfNeeded:TM,getEventConn:()=>ci,models:()=>Cn.models.value}),Id=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Hs.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),LM=Lhe(Ce,Id),Wme=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Ce.approvalsBySession[e]??[];return sM(n,s,o=>ft().getFileUrl(o),pm.value!=="idle",Ce.planReviewByToolCallId)}),zme=P(()=>(LM.taskClock.value,Id.value.map(Fme))),FM=P(()=>Dpe(Id.value)),Ume=P(()=>Hpe(Id.value)),Qa=P(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),jme=P(()=>{const e=Ce.activeSessionId;return e?Ope(Ce.messagesBySession[e]??[]):[]}),qme=P(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),Vme=P(()=>Ce.connection),Kme=P(()=>Ce.loading),Gme=P(()=>Ce.sessionLoading),Yme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),Zme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),Qme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),Xme=P(()=>Ce.serverVersion),Jme=P(()=>Ce.dangerousBypassAuth);function e1e(){Ce.dangerousBypassAuth=!1}const t1e=P(()=>Ce.permission),n1e=P(()=>Ce.thinking),OM=P(()=>{const e=Ce.activeSessionId;return e?Ce.planModeBySession[e]??!1:am.planMode}),s1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.swarmModeBySession[e]??!1:am.swarmMode}),o1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.goalModeBySession[e]??!1:am.goalMode}),i1e=P(()=>{const e=Ppe(FM.value);return{plan:OM.value,goal:Qa.value&&Qa.value.status!=="complete"?{status:Qa.value.status,turnsUsed:Qa.value.turnsUsed,elapsedMs:Qa.value.wallClockMs}:null,swarm:e.total>0?e:null}}),r1e=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=ft();return(Ce.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(s=>({fileId:s.fileId,kind:s.kind,url:t.getFileUrl(s.fileId)}))}))}),l1e=P(()=>Ce.warnings),a1e=P(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map($me):[]}),c1e=P(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Ime(t),agentName:t.agentName})):[]}),pm=P(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ce.questionsBySession[e]??[]).length>0?"awaiting-question":hm(e)?"running":"idle":"idle"}),Cn=Rhe(Ce,{pushOperationFailure:fm,refreshSessionStatus:um,persistSessionProfile:SM,activity:pm,inFlightPromptSessions:dm,saveThinkingToStorage:qpe,updateSession:cm,updateSessionMessages:yM}),ap=P(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),u1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),d1e=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),f1e=P(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),RM=P(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=ap.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Cn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Ce.defaultModel)??"—",o=Cn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:ap.value!==null}}),h1e=P(()=>xM.value),p1e=P(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),m1e=P(()=>Ce.authReady),g1e=P(()=>Ce.defaultModel),v1e=P(()=>Ce.managedProviderStatus),y1e=P(()=>Ce.config),k1e=P(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function Tc(e){return Ce.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const Ak=P(()=>Hfe({workspaces:Ce.workspaces,sessions:Ce.sessions,hiddenWorkspaceRoots:Ce.hiddenWorkspaceRoots,activeRoot:Ce.sessions.find(e=>e.id===Ce.activeSessionId)?.cwd,activeBranch:ap.value?.branch??null,sessionsHasMoreByWorkspace:Ce.sessionsHasMoreByWorkspace})),cp=Q(IN()),Nc=Q($N()==="manual"?"manual":"recent");Ke(()=>[Ak.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=jN(n,cp.value);s!==null&&(cp.value=s,$3(s))});const ua=P(()=>{const e=Ak.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Zpe(t.root,Ce.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Nc.value==="recent"){const t=new Map;for(const n of Ce.sessions){if(n.parentSessionId)continue;const s=Tc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return KN(e,t)}return qN(e,cp.value)}),mm=P(()=>{const e=Ce.activeWorkspaceId,t=ua.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ke(mm,e=>{e&&(Object.prototype.hasOwnProperty.call(Cn.skillsByWorkspace.value,e)||Cn.loadSkillsForWorkspace(e))},{immediate:!0});const b1e=P(()=>{const e=mm.value;return e?ua.value.find(t=>t.id===e)??null:null}),x1e=P(()=>{md.value;const e=new Set(ua.value.map(n=>n.id)),t=new Map(ua.value.map(n=>[n.id,n.name]));return Ce.sessions.filter(n=>!n.parentSessionId&&e.has(Tc(n))).map(n=>{const s=Tc(n);return{id:n.id,title:n.title,time:Ck(n.updatedAt,n.status),status:n.status,busy:hm(n.id),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),_1e=P(()=>{md.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Tc(t),s={id:t.id,title:t.title,time:Ck(t.updatedAt,t.status),status:t.status,busy:hm(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return ua.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ce.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ce.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ce.sessionsInitialCountByWorkspace[t.id]??yv}))});function w1e(e){cp.value=e,$3(e),Nc.value!=="manual"&&(Nc.value="manual",L3("manual"))}function S1e(e){Nc.value!==e&&(Nc.value=e,L3(e))}const BM=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),C1e=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),A1e=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),M1e=P(()=>{const e={},t=BM.value;for(const n of Ce.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Tc(n);e[o]=(e[o]??0)+s}return e}),E1e=P(()=>Ce.recentRoots),T1e=P(()=>Ce.availableOpenInApps),ht=_pe(Ce,{taskPoller:LM,sideChat:Hs,modelProvider:Cn,pushOperationFailure:fm,activity:pm,inFlightPromptSessions:dm,sessionsKnownEmpty:NM,setSessions:gM,updateSession:cm,upsertSessionFront:Qpe,appendSession:Xpe,forgetSession:kM,setActiveSessionId:bk,updateSessionMessages:yM,nextOptimisticMsgId:EM,getEventConn:()=>ci,syncSessionFromSnapshot:wk,reopenSession:Mme,hasLoadedMessages:wme,refreshSessionStatus:um,persistSessionProfile:SM,mergedWorkspaces:Ak,workspacesView:ua,status:RM,workspaceIdForSession:Tc,savePermissionToStorage:Upe,savePlanModeToStorage:fM,saveSwarmModeToStorage:hM,saveGoalModeToStorage:pM,draftModes:am,saveUnread:Jv,saveActiveWorkspaceToStorage:Ype,saveHiddenWorkspacesToStorage:Gpe,goalErrorMessage:bme,resetFastMoon:Di.resetFastMoon,initialized:wM,selectedDiffPath:bM,fileDiffLines:xM,fileDiffLoading:_M});function Mk(e){return e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function N1e(e,t){dm.delete(e),Ce.sendingBySession={...Ce.sendingBySession,[e]:!1};const n=Ce.promptIdBySession[e];if(Ce.promptIdBySession[e]!==void 0){const a={...Ce.promptIdBySession};delete a[e],Ce.promptIdBySession=a}e===Ce.activeSessionId?(Di.resetFastMoon(),ht.loadGitStatus(e),um(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},Jv({[e]:!0}));const s=(Ce.approvalsBySession[e]??[]).length>0,o=(Ce.questionsBySession[e]??[]).length>0;dhe(t,s,o)&&Pi.maybeNotifyCompletion(e,{isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(a=>a.id===e)?.title??"",promptId:n,onClick:()=>{ht.selectSession(e)}}),t==="idle"&&pd.maybePlayCompletionSound();const i=Ce.queuedBySession[e]??[];if(i.length===0)return;const[r,...l]=i;Ce.queuedBySession={...Ce.queuedBySession,[e]:l},r!==void 0&&ht.submitPromptInternal(e,r.text,r.attachments).then(a=>{if(!a){const c=Ce.queuedBySession[e]??[];Ce.queuedBySession={...Ce.queuedBySession,[e]:[r,...c]}}})}function I1e(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Pi.maybeNotifyQuestion({isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ht.selectSession(e)}}),pd.maybePlayQuestionSound()}function $1e(e,t){Pi.maybeNotifyApproval({isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ht.selectSession(e)}}),pd.maybePlayApprovalSound()}function Ek(){return Tme(),{workspace:Ome,sessions:Rme,activeSessionId:Bme,workspacesView:ua,workspaceSortMode:Nc,visibleWorkspace:b1e,activeWorkspaceId:mm,sessionsForView:x1e,workspaceGroups:_1e,attentionBySession:BM,pendingBySession:C1e,attentionByWorkspace:M1e,unreadBySession:A1e,recentRoots:E1e,turns:Wme,tasks:zme,activeAppTasks:Id,todos:jme,goal:Qa,swarms:FM,swarmMembersByToolCallId:Ume,activationBadges:i1e,compaction:qme,status:RM,sessionCost:p1e,fileDiff:h1e,selectedDiffPath:bM,fileDiffLoading:_M,changes:d1e,gitInfo:ap,gitDiffStats:f1e,activePullRequest:u1e,changesByPath:k1e,pendingApprovals:c1e,availableOpenInApps:T1e,connection:Vme,loading:Kme,sessionLoading:Gme,loadingMoreMessages:Yme,hasMoreMessages:Zme,loadMoreMessagesError:Qme,serverVersion:Xme,dangerousBypassAuth:Jme,clearDangerousBypassAuth:e1e,initialized:wM,permission:t1e,thinking:n1e,planMode:OM,swarmMode:s1e,goalMode:o1e,queued:r1e,warnings:l1e,questions:a1e,activity:pm,isSending:Pme,isStartingFirstPrompt:Hme,fastMoon:Di.fastMoon,models:Cn.models,starredModelIds:Cn.starredModelIds,providers:Cn.providers,uiFontSize:Di.uiFontSize,setUiFontSize:Di.setUiFontSize,conversationToc:AM,setConversationToc:rme,colorScheme:Di.colorScheme,setColorScheme:Di.setColorScheme,accent:Di.accent,setAccent:Di.setAccent,notifyOnComplete:Pi.notifyOnComplete,notifyOnQuestion:Pi.notifyOnQuestion,notifyOnApproval:Pi.notifyOnApproval,notifyPermission:Pi.notifyPermission,setNotifyOnComplete:Pi.setNotifyOnComplete,setNotifyOnQuestion:Pi.setNotifyOnQuestion,setNotifyOnApproval:Pi.setNotifyOnApproval,soundOnComplete:pd.soundOnComplete,setSoundOnComplete:pd.setSoundOnComplete,onboarded:MM,setOnboarded:ame,load:ht.load,selectSession:ht.selectSession,clearActiveSession:ht.clearActiveSession,loadOlderMessages:ht.loadOlderMessages,loadWorkspaces:ht.loadWorkspaces,loadMoreSessions:ht.loadMoreSessions,loadAllSessions:ht.loadAllSessions,selectWorkspace:ht.selectWorkspace,openWorkspace:ht.openWorkspace,openWorkspaceDraft:ht.openWorkspaceDraft,startSessionAndSendPrompt:ht.startSessionAndSendPrompt,startSessionAndActivateSkill:ht.startSessionAndActivateSkill,startSessionAndOpenSideChat:ht.startSessionAndOpenSideChat,addWorkspaceByPath:ht.addWorkspaceByPath,browseFs:ht.browseFs,getFsHome:ht.getFsHome,sendPrompt:ht.sendPrompt,steerPrompt:ht.steerPrompt,sideChatVisible:Hs.sideChatVisible,sideChatSessionId:Hs.sideChatSessionId,sideChatTurns:Hs.sideChatTurns,sideChatRunning:Hs.sideChatRunning,sideChatSending:Hs.sideChatSending,openSideChat:Hs.openSideChat,closeSideChat:Hs.closeSideChat,sendSideChatPrompt:Hs.sendSideChatPrompt,uploadImage:ht.uploadImage,abortCurrentPrompt:ht.abortCurrentPrompt,respondApproval:ht.respondApproval,respondQuestion:ht.respondQuestion,dismissQuestion:ht.dismissQuestion,pendingQuestionActions:ht.pendingQuestionActions,pendingApprovalActions:ht.pendingApprovalActions,cancelTask:ht.cancelTask,setPermission:ht.setPermission,setThinking:Cn.setThinking,setPlanMode:ht.setPlanMode,togglePlanMode:ht.togglePlanMode,setSwarmMode:ht.setSwarmMode,toggleSwarmMode:ht.toggleSwarmMode,setGoalMode:ht.setGoalMode,toggleGoalMode:ht.toggleGoalMode,createGoal:ht.createGoal,controlGoal:ht.controlGoal,enqueue:ht.enqueue,dismissWarning:ht.dismissWarning,renameSession:ht.renameSession,renameWorkspace:ht.renameWorkspace,deleteWorkspace:ht.deleteWorkspace,reorderWorkspaces:w1e,setWorkspaceSortMode:S1e,archiveSession:ht.archiveSession,restoreSession:ht.restoreSession,loadArchivedSessions:ht.loadArchivedSessions,compact:ht.compact,forkSession:ht.forkSession,undo:ht.undo,unqueue:ht.unqueue,reorderQueue:ht.reorderQueue,searchFiles:ht.searchFiles,loadGitStatus:ht.loadGitStatus,loadFileDiff:ht.loadFileDiff,clearFileDiff:ht.clearFileDiff,listDir:ht.listDir,readFileContent:ht.readFileContent,getFileDownloadUrl:ht.getFileDownloadUrl,openWorkspaceFile:ht.openWorkspaceFile,openInApp:ht.openInApp,revealWorkspaceFile:ht.revealWorkspaceFile,resolveImageUrl:ht.resolveImageUrl,refreshOAuthProviderModels:Cn.refreshOAuthProviderModels,loadModels:Cn.loadModels,loadProviders:Cn.loadProviders,skills:Dme,activateSkill:Cn.activateSkill,setModel:Cn.setModel,toggleStarModel:Cn.toggleStarModel,addProvider:Cn.addProvider,deleteProvider:Cn.deleteProvider,refreshProvider:Cn.refreshProvider,refreshAllProviders:Cn.refreshAllProviders,authReady:m1e,defaultModel:g1e,managedProviderStatus:v1e,config:y1e,updateConfig:ht.updateConfig,checkAuth:ht.checkAuth,startOAuthLogin:Cn.startOAuthLogin,pollOAuthLogin:Cn.pollOAuthLogin,cancelOAuthLogin:Cn.cancelOAuthLogin,logout:ht.logout}}const DM=qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=Et(),n=q3.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&V3(o)}return(o,i)=>(b(),ye(to,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),L1e=["aria-checked","aria-label","disabled"],F1e=qe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),I("button",{class:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[w("span",{class:"ui-switch__thumb"},null,-1)])],10,L1e))}}),er=ut(F1e,[["__scopeId","data-v-dbe22dc4"]]),O1e=["aria-label"],R1e=["aria-selected","onClick"],B1e={class:"body"},D1e={class:"panel"},P1e={class:"sec"},H1e={class:"sec-title"},W1e={class:"row"},z1e={class:"rlabel"},U1e={class:"row"},j1e={class:"rlabel"},q1e={class:"row"},V1e={class:"rlabel"},K1e={class:"num-field"},G1e=["value","aria-label"],Y1e={class:"row"},Z1e={class:"rlabel"},Q1e={class:"row"},X1e={class:"rlabel"},J1e={class:"hint"},e0e={class:"sec"},t0e={class:"sec-title"},n0e={class:"row"},s0e={class:"rlabel"},o0e={key:0,class:"hint"},i0e={class:"row"},r0e={class:"rlabel"},l0e={key:0,class:"hint"},a0e={class:"row"},c0e={class:"rlabel"},u0e={key:0,class:"hint"},d0e={class:"row"},f0e={class:"rlabel"},h0e={class:"panel"},p0e={class:"sec"},m0e={class:"sec-title"},g0e={class:"row"},v0e={class:"rlabel"},y0e={key:0,class:"rvalue"},k0e={class:"actions"},b0e={class:"panel"},x0e={class:"sec"},_0e={class:"sec-head"},w0e={class:"sec-title"},S0e={key:0,class:"saving"},C0e={class:"row"},A0e={class:"rlabel"},M0e={class:"hint"},E0e={key:0,class:"select-wrap"},T0e={key:0,value:"",disabled:""},N0e=["label"],I0e=["value"],$0e={key:1,class:"rvalue mono"},L0e={class:"row"},F0e={class:"rlabel"},O0e={class:"hint"},R0e={class:"row"},B0e={class:"rlabel"},D0e={class:"hint"},P0e={class:"row"},H0e={class:"rlabel"},W0e={class:"hint"},z0e={class:"row"},U0e={class:"rlabel"},j0e={class:"hint"},q0e={key:1,class:"empty-config"},V0e={class:"panel"},K0e={class:"sec"},G0e={class:"sec-title"},Y0e={class:"row"},Z0e={class:"rlabel"},Q0e={class:"rvalue mono"},X0e={class:"row"},J0e={class:"rlabel"},ege={class:"rvalue mono"},tge={key:0,class:"row"},nge={class:"rlabel"},sge={class:"hint"},oge={class:"hint"},ige={class:"row"},rge={class:"rlabel"},lge={key:0,class:"hint"},age={class:"panel"},cge={class:"panel-head"},uge={class:"panel-title"},dge={class:"panel-desc"},fge={class:"archive-toolbar"},hge={class:"archive-search"},pge=["placeholder"],mge={value:"all"},gge=["value"],vge={key:0,class:"archive-empty"},yge={key:0,class:"archive-list"},kge={class:"archive-workspace"},bge={class:"path"},xge={class:"count"},_ge={class:"setting-card"},wge={class:"archive-meta"},Sge={class:"archive-name"},Cge={class:"archive-time"},Age={key:1,class:"archive-empty"},Mge=100,Ege=qe({__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:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q("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=PN(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=Q(null);ik(u);function d(te){te.key==="Escape"&&o("close")}ln(()=>document.addEventListener("keydown",d)),fn(()=>document.removeEventListener("keydown",d));function f(){D5()}const p=P(()=>{const te=new Map;for(const Z of s.models??[])te.set(Z.id,{id:Z.id,label:Z.displayName??Z.model??Z.id,provider:Z.provider});for(const[Z,ne]of Object.entries(s.config?.models??{})){if(te.has(Z))continue;const ke=_(ne);te.set(Z,{id:Z,label:k(Z,ne,ke),provider:ke??Z})}return Array.from(te.values())}),h=P(()=>{const te=new Map;for(const Z of p.value){const ne=te.get(Z.provider)??[];ne.push(Z),te.set(Z.provider,ne)}for(const Z of te.values())Z.sort((ne,ke)=>ne.label.localeCompare(ke.label));return Array.from(te.entries()).toSorted(([Z],[ne])=>Z.localeCompare(ne)).map(([Z,ne])=>({provider:Z,options:ne}))}),m=P(()=>{const te=s.config?.defaultPermissionMode;return te==="auto"||te==="yolo"||te==="manual"?te:"manual"});function _(te){if(!te||typeof te!="object")return;const Z=te;return typeof Z.provider=="string"?Z.provider:void 0}function k(te,Z,ne){if(!Z||typeof Z!="object")return te;const ke=Z,Se=typeof ke.model=="string"?ke.model:void 0,Ye=ne??_(Z);return Se&&Ye?`${te} (${Ye}/${Se})`:Se?`${te} (${Se})`:te}function g(te){return te===!0}function v(te){!te||te===s.config?.defaultModel||o("updateConfig",{defaultModel:te})}function y(te){te!==m.value&&o("updateConfig",{defaultPermissionMode:te})}function A(te){const Z=s.config?.[te];o("updateConfig",{[te]:!g(Z)})}function L(){const te=s.config?.thinking;return!te||typeof te!="object"?!0:te.enabled!==!1}function $(){o("updateConfig",{thinking:{enabled:!L()}})}function x(){const te=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!te})}function E(te){i.value=te}const N=Ek(),F=Q([]),S=Q(!1),T=Q(!1),R=Q(""),O=Q("all"),D=Q("archived-desc");async function W(){if(!(S.value||T.value)){S.value=!0;try{const te=[];let Z;for(;;){const ne=await N.loadArchivedSessions({beforeId:Z,pageSize:Mge});if(te.push(...ne.items),!ne.hasMore||ne.items.length===0)break;const ke=ne.items.at(-1)?.id;if(ke===void 0)break;Z=ke}F.value=te,T.value=!0}catch(te){console.warn("loadAllArchived failed",te)}finally{S.value=!1}}}Ke(i,te=>{te==="archived"&&!T.value&&W()});const z=P(()=>{const te=new Set;for(const Z of F.value)te.add(Z.cwd);return Array.from(te).sort((Z,ne)=>Z.localeCompare(ne))}),V=P(()=>{const te=R.value.trim().toLowerCase();let Z=F.value.filter(ne=>ne.archived===!0);return O.value!=="all"&&(Z=Z.filter(ne=>ne.cwd===O.value)),te&&(Z=Z.filter(ne=>ne.title.toLowerCase().includes(te))),Z=Z.slice(),D.value==="archived-desc"?Z.sort((ne,ke)=>ke.updatedAt.localeCompare(ne.updatedAt)):D.value==="created-desc"?Z.sort((ne,ke)=>ke.createdAt.localeCompare(ne.createdAt)):Z.sort((ne,ke)=>ne.title.localeCompare(ke.title,"zh")),Z}),U=P(()=>{const te=new Map;for(const Z of V.value){const ne=te.get(Z.cwd)??[];ne.push(Z),te.set(Z.cwd,ne)}return Array.from(te.entries()).map(([Z,ne])=>({cwd:Z,items:ne}))});async function re(te){await N.restoreSession(te)&&(F.value=F.value.filter(ne=>ne.id!==te))}function ae(te){const Z=new Date(te);if(Number.isNaN(Z.getTime()))return te;const ne=ke=>String(ke).padStart(2,"0");return`${Z.getFullYear()}-${ne(Z.getMonth()+1)}-${ne(Z.getDate())} ${ne(Z.getHours())}:${ne(Z.getMinutes())}`}return(te,Z)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:Z[19]||(Z[19]=ne=>o("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:u,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(b(),I(Be,null,nt(r,ne=>w("button",{key:ne.id,type:"button",class:De(["tab",{on:i.value===ne.id}]),role:"tab","aria-selected":i.value===ne.id,onClick:ke=>E(ne.id)},B(C(n)(ne.labelKey)),11,R1e)),64))],8,O1e),w("div",B1e,[Tn(w("section",D1e,[w("section",P1e,[w("h3",H1e,B(C(n)("settings.appearance")),1),w("div",W1e,[w("span",z1e,B(C(n)("theme.colorSchemeLabel")),1),ie(to,{"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":Z[0]||(Z[0]=ne=>o("setColorScheme",ne))},null,8,["model-value","options"])]),w("div",U1e,[w("span",j1e,B(C(n)("theme.accentLabel")),1),ie(to,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":Z[1]||(Z[1]=ne=>o("setAccent",ne))},null,8,["model-value","options"])]),w("div",q1e,[w("span",V1e,B(C(n)("settings.uiFontSize")),1),w("label",K1e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:Z[2]||(Z[2]=ne=>o("setUiFontSize",Number(ne.target.value)))},null,40,G1e),Z[20]||(Z[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",Y1e,[w("span",Z1e,B(C(n)("sidebar.language")),1),ie(DM)]),w("div",Q1e,[w("span",X1e,[Ge(B(C(n)("settings.conversationToc"))+" ",1),w("span",J1e,B(C(n)("settings.conversationTocHint")),1)]),ie(er,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":Z[3]||(Z[3]=ne=>o("setConversationToc",ne))},null,8,["model-value","label"])])]),w("section",e0e,[w("h3",t0e,B(C(n)("settings.notifications")),1),w("div",n0e,[w("span",s0e,[Ge(B(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",o0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Z[4]||(Z[4]=ne=>o("setNotify",ne))},null,8,["model-value","disabled","label"])]),w("div",i0e,[w("span",r0e,[Ge(B(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",l0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Z[5]||(Z[5]=ne=>o("setNotifyQuestion",ne))},null,8,["model-value","disabled","label"])]),w("div",a0e,[w("span",c0e,[Ge(B(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",u0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Z[6]||(Z[6]=ne=>o("setNotifyApproval",ne))},null,8,["model-value","disabled","label"])]),w("div",d0e,[w("span",f0e,B(C(n)("settings.soundOnComplete")),1),ie(er,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":Z[7]||(Z[7]=ne=>o("setSound",ne))},null,8,["model-value","label"])])])],512),[[oi,i.value==="general"]]),Tn(w("section",h0e,[w("section",p0e,[w("h3",m0e,B(C(n)("settings.account")),1),w("div",g0e,[w("span",v0e,B(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(jt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(b(),I("span",y0e,B(e.accountModel),1)):le("",!0)]),_:1},8,["text"])]),w("div",k0e,[ie(Ft,{variant:"secondary",size:"sm",onClick:Z[8]||(Z[8]=ne=>{o("openOnboarding"),o("close")})},{default:Ee(()=>[Ge(B(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(b(),ye(Ft,{key:0,variant:"danger-soft",size:"sm",onClick:Z[9]||(Z[9]=ne=>o("logout"))},{default:Ee(()=>[Ge(B(C(n)("sidebar.signOut")),1)]),_:1})):(b(),ye(Ft,{key:1,variant:"primary",size:"sm",onClick:Z[10]||(Z[10]=ne=>o("login"))},{default:Ee(()=>[Ge(B(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[oi,i.value==="account"]]),Tn(w("section",b0e,[w("section",x0e,[w("div",_0e,[w("h3",w0e,B(C(n)("settings.agentDefaults")),1),e.configSaving?(b(),I("span",S0e,B(C(n)("settings.saving")),1)):le("",!0)]),e.config?(b(),I(Be,{key:0},[w("div",C0e,[w("span",A0e,[Ge(B(C(n)("settings.defaultModel"))+" ",1),w("span",M0e,B(C(n)("settings.defaultModelHint")),1)]),h.value.length>0?(b(),I("div",E0e,[ie(gv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:Ee(()=>[e.config.defaultModel?le("",!0):(b(),I("option",T0e,B(C(n)("settings.noDefaultModel")),1)),(b(!0),I(Be,null,nt(h.value,ne=>(b(),I("optgroup",{key:ne.provider,label:ne.provider},[(b(!0),I(Be,null,nt(ne.options,ke=>(b(),I("option",{key:ke.id,value:ke.id},B(ke.label),9,I0e))),128))],8,N0e))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(b(),I("span",$0e,B(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",L0e,[w("span",F0e,[Ge(B(C(n)("settings.defaultPermission"))+" ",1),w("span",O0e,B(C(n)("settings.defaultPermissionHint")),1)]),ie(to,{"model-value":m.value,options:a.map(ne=>({value:ne,label:C(n)(c[ne])})),"onUpdate:modelValue":Z[11]||(Z[11]=ne=>y(ne))},null,8,["model-value","options"])]),w("div",R0e,[w("span",B0e,[Ge(B(C(n)("settings.defaultThinking"))+" ",1),w("span",D0e,B(C(n)("settings.defaultThinkingHint")),1)]),ie(er,{"model-value":L(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":Z[12]||(Z[12]=ne=>$())},null,8,["model-value","disabled","label"])]),w("div",P0e,[w("span",H0e,[Ge(B(C(n)("settings.defaultPlanMode"))+" ",1),w("span",W0e,B(C(n)("settings.defaultPlanModeHint")),1)]),ie(er,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Z[13]||(Z[13]=ne=>A("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",z0e,[w("span",U0e,[Ge(B(C(n)("settings.mergeSkills"))+" ",1),w("span",j0e,B(C(n)("settings.mergeSkillsHint")),1)]),ie(er,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":Z[14]||(Z[14]=ne=>A("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(b(),I("div",q0e,B(C(n)("settings.configUnavailable")),1))])],512),[[oi,i.value==="agent"]]),Tn(w("section",V0e,[w("section",K0e,[w("h3",G0e,B(C(n)("settings.advanced")),1),w("div",Y0e,[w("span",Z0e,B(C(n)("sidebar.daemon")),1),w("span",Q0e,B(C(l)),1)]),w("div",X0e,[w("span",J0e,B(C(n)("settings.serverVersion")),1),w("span",ege,B(e.serverVersion||"-"),1)]),e.config?(b(),I("div",tge,[w("span",nge,[Ge(B(C(n)("settings.telemetry"))+" ",1),w("span",sge,B(C(n)("settings.telemetryHint")),1),w("span",oge,B(C(n)("settings.telemetryRestartHint")),1)]),ie(er,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":Z[15]||(Z[15]=ne=>x())},null,8,["model-value","disabled","label"])])):le("",!0),w("div",ige,[w("span",rge,[Ge(B(C(n)("settings.exportLog"))+" ",1),C(Ai)()?le("",!0):(b(),I("span",lge,B(C(n)("settings.logHint")),1))]),ie(Ft,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ge(B(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[oi,i.value==="advanced"]]),Tn(w("section",age,[w("div",cge,[Z[21]||(Z[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",uge,B(C(n)("settings.archivedTitle")),1),w("p",dge,B(C(n)("settings.archivedDesc")),1)]),w("div",fge,[w("label",hge,[Z[22]||(Z[22]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("circle",{cx:"11",cy:"11",r:"7"}),w("path",{d:"m21 21-4.3-4.3"})],-1)),Tn(w("input",{"onUpdate:modelValue":Z[16]||(Z[16]=ne=>R.value=ne),placeholder:C(n)("settings.archivedSearch")},null,8,pge),[[ao,R.value]])]),ie(gv,{"model-value":O.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Z[17]||(Z[17]=ne=>O.value=ne)},{default:Ee(()=>[w("option",mge,B(C(n)("settings.archivedAllWorkspaces")),1),(b(!0),I(Be,null,nt(z.value,ne=>(b(),I("option",{key:ne,value:ne},B(ne),9,gge))),128))]),_:1},8,["model-value","aria-label"]),ie(to,{size:"sm","model-value":D.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":Z[18]||(Z[18]=ne=>D.value=ne)},null,8,["model-value","options"])]),S.value?(b(),I("div",vge,B(C(n)("settings.archivedLoadingAll")),1)):(b(),I(Be,{key:1},[U.value.length>0?(b(),I("div",yge,[(b(!0),I(Be,null,nt(U.value,ne=>(b(),I("section",{key:ne.cwd,class:"archive-card"},[w("div",kge,[Z[23]||(Z[23]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("path",{d:"M3 7h6l2 2h10v9H3z"}),w("path",{d:"M3 7V5h6l2 2"})],-1)),w("span",bge,B(ne.cwd),1),w("span",xge,B(C(n)("settings.archivedSessionsCount",{count:ne.items.length})),1)]),w("div",_ge,[(b(!0),I(Be,null,nt(ne.items,ke=>(b(),I("div",{key:ke.id,class:"archive-row"},[w("div",wge,[w("div",Sge,B(ke.title),1),w("div",Cge,B(C(n)("settings.archivedAt",{time:ae(ke.updatedAt)})),1)]),ie(Ft,{variant:"secondary",size:"sm",onClick:Se=>re(ke.id)},{default:Ee(()=>[Ge(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(b(),I("div",Age,B(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[oi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Tge=ut(Ege,[["__scopeId","data-v-0c2e1aca"]]),Nge={class:"aw"},Ige={class:"crumbbar"},$ge={class:"crumbs"},Lge={key:0,class:"crumb-sep"},Fge=["onClick"],Oge={key:0,class:"filterbar"},Rge=["placeholder"],Bge={class:"folder-list"},Dge={key:0,class:"fl-loading"},Pge=["onClick"],Hge={class:"folder-name search-rel"},Wge={key:0,class:"git-branch"},zge={key:0,class:"fl-empty"},Uge={key:1,class:"fl-loading"},jge=["onClick"],qge={class:"folder-name"},Vge={key:0,class:"git-branch"},Kge={key:0,class:"fl-empty"},Gge={class:"paste-row"},Yge={class:"paste-input-wrap"},Zge={key:1,class:"add-error",role:"alert"},Qge={class:"actions"},Xge={class:"footer-hint"},Jge=600,eve=6,wC=150,tve=qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=Q(!1),l=Q(!1),a=Q(""),c=Q(null),u=Q([]),d=Q(""),f=Q(!1),p=Q([]),h=P(()=>d.value.trim().length>0);let m=0,_=null;function k(T,R){const O=T.toLowerCase(),D=R.toLowerCase();let W=0;for(let z=0;z<D.length&&W<O.length;z++)D[z]===O[W]&&W++;return W===O.length}async function g(T){const R=a.value,O=T.trim();if(!R||O===""){p.value=[],f.value=!1;return}const D=++m;f.value=!0;const W=[],z=[{path:R,depth:0}];let V=0;for(;z.length>0&&V<Jge&&W.length<wC;){if(D!==m)return;const U=z.shift();V++;let re;try{re=await s.browseFs(U.path)}catch{continue}if(D!==m)return;for(const ae of re.entries){if(!ae.isDir)continue;const te=ae.path.startsWith(R)?ae.path.slice(R.length).replace(/^\/+/,""):ae.path;if(k(O,te||ae.name)&&(W.push({path:ae.path,name:ae.name,rel:te||ae.name,isGitRepo:ae.isGitRepo,branch:ae.branch}),W.length>=wC))break;U.depth+1<eve&&z.push({path:ae.path,depth:U.depth+1})}D===m&&(p.value=[...W])}D===m&&(f.value=!1)}Ke(d,T=>{if(_&&clearTimeout(_),T.trim()===""){m++,p.value=[],f.value=!1;return}_=setTimeout(()=>void g(T),220)});const v=Q(!1),y=Q(""),A=P(()=>y.value.trim()),L=P(()=>{const T=a.value;if(!T)return[];const R=T.split("/").filter(Boolean),O=[{label:"/",path:"/"}];let D="";for(const W of R)D+=`/${W}`,O.push({label:W,path:D});return O}),$=P(()=>a.value.length>0);async function x(T){r.value=!0;try{const R=await s.browseFs(T);if(!R.path){l.value=!0;return}a.value=R.path,c.value=R.parent,u.value=R.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function E(T){T.isDir&&x(T.path)}function N(){c.value&&x(c.value)}function F(){$.value&&o("add",a.value)}function S(){A.value.length!==0&&o("add",A.value)}return ln(async()=>{r.value=!0;try{if(s.defaultPath&&(await x(s.defaultPath),!l.value))return;const T=await s.getFsHome();T.home?await x(T.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),fn(()=>{_&&clearTimeout(_)}),(T,R)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":R[5]||(R[5]=O=>i.value=O),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:R[6]||(R[6]=O=>o("close"))},{default:Ee(()=>[w("div",Nge,[l.value?le("",!0):(b(),I(Be,{key:0},[w("div",Ige,[ie(Nn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:N},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",$ge,[(b(!0),I(Be,null,nt(L.value,(O,D)=>(b(),I(Be,{key:O.path},[D>1?(b(),I("span",Lge,"/")):le("",!0),w("button",{class:De(["crumb",{last:D===L.value.length-1}]),onClick:W=>x(O.path)},B(O.label),11,Fge)],64))),128))])]),r.value?le("",!0):(b(),I("div",Oge,[ie(Ve,{class:"filter-icon",name:"search",size:"md"}),Tn(w("input",{"onUpdate:modelValue":R[0]||(R[0]=O=>d.value=O),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[1]||(R[1]=bt(()=>{},["stop"]))},null,40,Rge),[[ao,d.value]]),f.value?(b(),ye(wo,{key:0,size:"sm"})):le("",!0)])),w("div",Bge,[r.value?(b(),I("div",Dge,B(C(n)("workspace.browsing")),1)):h.value?(b(),I(Be,{key:1},[(b(!0),I(Be,null,nt(p.value,O=>(b(),I("button",{key:O.path,class:"folder-row",onClick:D=>x(O.path)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Hge,B(O.rel),1),O.isGitRepo?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(n)("workspace.gitTag")),1),O.branch?(b(),I("span",Wge,B(O.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,Pge))),128)),!f.value&&p.value.length===0?(b(),I("div",zge,B(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&p.value.length===0?(b(),I("div",Uge,B(C(n)("workspace.searching")),1)):le("",!0)],64)):(b(),I(Be,{key:2},[(b(!0),I(Be,null,nt(u.value,O=>(b(),I("button",{key:O.path,class:"folder-row",onClick:D=>E(O)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",qge,B(O.name),1),O.isGitRepo?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(n)("workspace.gitTag")),1),O.branch?(b(),I("span",Vge,B(O.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,jge))),128)),u.value.length===0?(b(),I("div",Kge,B(C(n)("workspace.noSubfolders")),1)):le("",!0)],64))])],64)),w("div",{class:De(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(b(),ye(Ft,{key:0,variant:"ghost",size:"sm",onClick:R[2]||(R[2]=O=>v.value=!0)},{default:Ee(()=>[Ge(B(C(n)("workspace.pasteToggle")),1)]),_:1})):(b(),ye(xu,{key:1,label:C(n)("workspace.pathLabel")},{default:Ee(()=>[w("div",Gge,[w("div",Yge,[ie(sa,{modelValue:y.value,"onUpdate:modelValue":R[3]||(R[3]=O=>y.value=O),placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:bi(bt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),ie(Nn,{disabled:A.value.length===0,label:C(n)("workspace.add"),onClick:S},{default:Ee(()=>[ie(Ve,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(b(),I("div",Zge,B(e.error),1)):le("",!0),w("div",Qge,[ie(jt,{text:a.value},{default:Ee(()=>[l.value?le("",!0):(b(),ye(Ft,{key:0,variant:"primary",disabled:!$.value,onClick:F},{default:Ee(()=>[Ge(B(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Ft,{variant:"secondary",onClick:R[4]||(R[4]=O=>o("close"))},{default:Ee(()=>[Ge(B(C(n)("workspace.cancel")),1)]),_:1})]),w("div",Xge,B(C(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),nve=ut(tve,[["__scopeId","data-v-ad529757"]]),sve={key:0,class:"confirm-dialog__message"},ove=qe({__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=Q(null);function s(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const o=e,i=t,{t:r}=Et();function l(){i("update:open",!1),i("cancel")}function a(c){if(c.key!=="Enter"||!o.open||o.loading)return;const u=c.target;u instanceof HTMLButtonElement||u instanceof HTMLAnchorElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement||u instanceof HTMLInputElement||(c.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",a),es(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(b(),ye(Sr,{open:e.open,title:e.title,height:"auto","initial-focus":s,"onUpdate:open":u[1]||(u[1]=d=>i("update:open",d)),onClose:l},{foot:Ee(()=>[ie(Ft,{variant:"secondary",disabled:e.loading,onClick:l},{default:Ee(()=>[Ge(B(e.cancelLabel??C(r)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Ft,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:Ee(()=>[Ge(B(e.confirmLabel??C(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(b(),I("p",sve,B(e.message),1)):le("",!0)]),_:1},8,["open","title"]))}}),ive=ut(ove,[["__scopeId","data-v-76e206e7"]]),rve=qe({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=kl();return(s,o)=>(b(),ye(ive,{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,onConfirm:o[0]||(o[0]=i=>C(n)(!0)),onCancel:o[1]||(o[1]=i=>C(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),lve={class:"rows"},ave={class:"row"},cve={class:"row"},uve={class:"row"},dve={class:"row"},fve={class:"row"},hve={class:"row"},pve={class:"ctx-text"},mve={key:0,class:"bar"},gve={class:"row"},vve=qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=P(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=P(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const c=P(()=>{const h=s.status.permission;return h==="yolo"?"var(--color-danger)":h==="auto"?"var(--color-warning)":"var(--color-text)"}),u=P(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=P(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=P(()=>typeof s.costUsd=="number"&&s.costUsd>0),p=P(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(h,m)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":m[0]||(m[0]=_=>i.value=_),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=_=>o("close"))},{default:Ee(()=>[w("dl",lve,[w("div",ave,[w("dt",null,B(C(n)("status.statusModel")),1),w("dd",null,B(e.status.model),1)]),w("div",cve,[w("dt",null,B(C(n)("status.statusThinking")),1),w("dd",null,B(e.thinking),1)]),w("div",uve,[w("dt",null,B(C(n)("status.statusPermission")),1),w("dd",{style:qt({color:c.value})},B(a(e.status.permission)),5)]),w("div",dve,[w("dt",null,B(C(n)("status.statusPlanMode")),1),w("dd",{class:De({"plan-on":e.planMode})},B(u.value),3)]),w("div",fve,[w("dt",null,B(C(n)("status.statusSwarmMode")),1),w("dd",{class:De({"swarm-on":e.swarmMode})},B(d.value),3)]),w("div",hve,[w("dt",null,B(C(n)("status.statusContext")),1),w("dd",null,[w("span",pve,B(l.value),1),e.status.ctxMax>0?(b(),I("span",mve,[w("i",{style:qt({width:r.value+"%"})},null,4)])):le("",!0)])]),w("div",gve,[w("dt",null,B(C(n)("status.statusCost")),1),w("dd",null,B(p.value),1)])])]),_:1},8,["open","title"]))}}),yve=ut(vve,[["__scopeId","data-v-59dd31f3"]]),kve={class:"ui-toast__icon","aria-hidden":"true"},bve={class:"ui-toast__body"},xve={class:"ui-toast__title"},_ve={key:0,class:"ui-toast__msg"},wve=qe({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[w("span",kve,[In(t.$slots,"icon",{},()=>[e.variant==="success"?(b(),ye(Ve,{key:0,name:"check"})):e.variant==="danger"?(b(),ye(Ve,{key:1,name:"close"})):e.variant==="warning"?(b(),ye(Ve,{key:2,name:"alert-triangle"})):(b(),ye(Ve,{key:3,name:"info"}))],!0)]),w("div",bve,[w("div",xve,B(e.title),1),e.message?(b(),I("div",_ve,B(e.message),1)):le("",!0),In(t.$slots,"default",{},void 0,!0)]),ie(Nn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Sve=ut(wve,[["__scopeId","data-v-adc6f346"]]),Cve={key:0,class:"actions"},Ave=["onClick"],Mve=["onClick"],Eve={key:1,class:"details"},Tve=qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et();function i(x){return typeof x=="object"&&x!==null}function r(x){return i(x)?x.title:x}function l(x){return i(x)?x.message??"":""}function a(x){return i(x)?x.details:void 0}function c(x){return i(x)?x.severity==="error":x.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function u(x){return i(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function d(x){if(!i(x))return x;const E=[x.title];x.message&&E.push(x.message);const N=x.details??[];if(N.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const F of N)E.push(`${F.label}: ${F.value}`)}return E.join(`
|
|
322
|
-
`)}let f=1;const p=Q([]),h=new Map,m=new Map;function _(x){const E=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function k(x,E){const N=h.get(x)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(x),E),N.deadline=Date.now()+E,h.set(x,N)}function g(x){const E=h.get(x);E&&E.handle!==null&&clearTimeout(E.handle),h.delete(x)}function v(x){const E=h.get(x);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function y(x){if(p.value.find(F=>F.id===x)?.detailsOpen)return;const N=h.get(x);!N||N.handle!==null||k(x,N.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?v(x.id):y(x.id)}async function L(x){if(!await js(d(x.warning)))return;x.copied=!0;const N=m.get(x.id);N&&clearTimeout(N),m.set(x.id,setTimeout(()=>{x.copied=!1,m.delete(x.id)},1400))}function $(x){g(x);const E=m.get(x);E&&clearTimeout(E),m.delete(x);const N=p.value.findIndex(F=>F.id===x);N!==-1&&(p.value=p.value.filter(F=>F.id!==x),s("dismiss",N))}return Ke(()=>n.warnings,x=>{const E=[...p.value];p.value=x.map(N=>{const F=u(N),S=E.findIndex(O=>O.key===F),T=S===-1?void 0:E.splice(S,1)[0];if(T)return T.warning=N,T;const R={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return k(R.id,_(N)),R});for(const N of E){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),fn(()=>{h.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),h.clear(),m.forEach(x=>clearTimeout(x)),m.clear()}),(x,E)=>(b(),ye(f9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(b(!0),I(Be,null,nt(p.value,N=>(b(),ye(Sve,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:F=>$(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>y(N.id)},{default:Ee(()=>[a(N.warning)?.length?(b(),I("div",Cve,[w("button",{class:"link",type:"button",onClick:F=>A(N)},B(N.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,Ave),w("button",{class:"link",type:"button",onClick:F=>L(N)},B(N.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,Mve)])):le("",!0),N.detailsOpen&&a(N.warning)?.length?(b(),I("dl",Eve,[(b(!0),I(Be,null,nt(a(N.warning),F=>(b(),I("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[w("dt",null,B(F.label),1),w("dd",null,B(F.value),1)]))),128))])):le("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Nve=ut(Tve,[["__scopeId","data-v-92efeff8"]]),Ive={class:"topbar"},$ve={class:"wsq"},Lve=["aria-label"],Fve={class:"tb-path"},Ove={class:"ws"},Rve={class:"se"},Bve={class:"tb-sub"},Dve=qe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=P(()=>s.workspace?.name??n("workspace.noWorkspace")),l=P(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(b(),I("div",Ive,[w("span",$ve,B(i.value),1),w("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[w("span",Fve,[w("span",Ove,B(r.value),1),e.sessionTitle?(b(),I(Be,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",Rve,B(e.sessionTitle),1)],64)):le("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",Bve,[w("span",{class:De(["rd",{on:e.running}])},null,2),w("span",null,B(l.value),1),e.branch?(b(),I(Be,{key:0},[Ge(" · "+B(e.branch),1)],64)):le("",!0),e.sessionCount>0?(b(),I(Be,{key:1},[Ge(" · "+B(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):le("",!0)])],8,Lve),ie(Nn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Ee(()=>[ie(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Pve=ut(Dve,[["__scopeId","data-v-59a11935"]]),Hve={key:0,class:"sheet-root"},Wve=["aria-label"],zve=["aria-label"],Uve={key:0,class:"sheet-head"},jve={class:"sheet-title"},qve={class:"sheet-body"},Vve=qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ke(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),fn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(b(),ye(cl,{name:"sheet"},{default:Ee(()=>[e.modelValue?(b(),I("div",Hve,[w("div",{class:"sheet-scrim",onClick:i}),w("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[w("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,zve),e.title?(b(),I("div",Uve,[w("span",jve,B(e.title),1)])):le("",!0),w("div",qve,[In(l.$slots,"default",{},void 0,!0)])],8,Wve)])):le("",!0)]),_:3}))}}),PM=ut(Vve,[["__scopeId","data-v-4441dd70"]]),Kve={class:"mlist"},Gve={key:0,class:"mempty"},Yve=["onClick"],Zve={class:"mgh-main"},Qve={class:"mgh-name"},Xve={class:"mgh-path"},Jve={key:2,class:"att"},eye={key:0,class:"mempty small"},tye=["onClick"],nye={class:"m"},sye={class:"s"},oye={key:0,class:"att"},iye=["disabled","onClick"],rye=["onClick"],lye=qe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=Q(new Set);function f(S){return d.value.has(S)}function p(S){const T=new Set(d.value);T.has(S)?T.delete(S):T.add(S),d.value=T,y.value=null,x.value=null}const h=Q(new Set);function m(S){return h.value.has(S)}function _(S){const T=new Set(h.value);T.has(S)?T.delete(S):T.add(S),h.value=T}function k(S){if(m(S.workspace.id))return S.sessions;const T=S.sessions.slice(0,S.initialCount);if(o.activeId&&!T.some(R=>R.id===o.activeId)){const R=S.sessions.find(O=>O.id===o.activeId);if(R)return[...T,R]}return T}function g(S){if(!h.value.has(S)){const T=new Set(h.value);T.add(S),h.value=T}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=Q(null);function A(S){y.value=y.value===S?null:S,x.value=null}function L(S){y.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();R&&i("rename",S.id,R)}async function $(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const x=Q(null);function E(S){x.value=x.value===S?null:S,y.value=null}function N(S){js(S.root),x.value=null}async function F(S){x.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,T)=>(b(),ye(PM,{"model-value":e.modelValue,"onUpdate:modelValue":T[2]||(T[2]=R=>i("update:modelValue",R))},{default:Ee(()=>[w("button",{type:"button",class:"newrow",onClick:c},[ie(Ve,{name:"message",size:"sm"}),Ge(" "+B(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:u},[ie(Ve,{name:"folder",size:"sm"}),Ge(" "+B(C(n)("sidebar.newWorkspace")),1)]),w("div",Kve,[e.groups.length===0?(b(),I("div",Gve,B(C(n)("workspace.noWorkspace")),1)):le("",!0),(b(!0),I(Be,null,nt(e.groups,R=>(b(),I("div",{key:R.workspace.id,class:"mgroup"},[w("div",{class:De(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:O=>p(R.workspace.id)},[f(R.workspace.id)?(b(),ye(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(b(),ye(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",Zve,[w("span",Qve,B(R.workspace.name),1),ie(jt,{text:R.workspace.root},{default:Ee(()=>[w("span",Xve,B(R.workspace.branch||R.workspace.shortPath),1)]),_:2},1032,["text"])]),f(R.workspace.id)&&v(R.workspace.id)>0?(b(),I("span",Jve,B(v(R.workspace.id)),1)):le("",!0),ie(Nn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(O=>E(R.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Nn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(O=>a(R.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),x.value===R.workspace.id?(b(),ye(Jl,{key:3,class:"kmenu wsmenu",onClick:T[0]||(T[0]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{size:"lg",onClick:O=>N(R.workspace)},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(Mn,{size:"lg",danger:"",onClick:O=>F(R.workspace)},{default:Ee(()=>[Ge(B(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,Yve),Tn(w("div",null,[R.sessions.length===0?(b(),I("div",eye,B(C(n)("sidebar.noSessions")),1)):le("",!0),(b(!0),I(Be,null,nt(k(R),O=>(b(),I("div",{key:O.id,class:De(["srow",{cur:O.id===e.activeId}]),onClick:D=>l(O.id)},[w("div",nye,[w("div",{class:De(["t",{run:O.busy,aborted:O.status==="aborted"}])},B(O.title),3),w("div",sye,B(O.time),1)]),(e.attentionBySession[O.id]??0)>0?(b(),I("span",oye,B(e.attentionBySession[O.id]),1)):le("",!0),ie(Nn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(D=>A(O.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===O.id?(b(),ye(Jl,{key:1,class:"kmenu",onClick:T[1]||(T[1]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{size:"lg",onClick:D=>L(O)},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(Mn,{size:"lg",danger:"",onClick:D=>$(O.id)},{default:Ee(()=>[Ge(B(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,tye))),128)),R.hasMore||R.loadingMore?(b(),I("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:bt(O=>g(R.workspace.id),["stop"])},B(R.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,iye)):le("",!0),R.sessions.length>R.initialCount?(b(),I("button",{key:2,type:"button",class:"mshow-more",onClick:bt(O=>_(R.workspace.id),["stop"])},B(m(R.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,rye)):le("",!0)],512),[[oi,!f(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),aye=ut(lye,[["__scopeId","data-v-7ca5a6a0"]]),cye={class:"group-title"},uye={class:"srow-main"},dye={class:"srow-label"},fye={class:"srow-sub"},hye={class:"srow read-only"},pye={class:"srow-main"},mye={class:"srow-label"},gye={key:0,class:"srow-sub"},vye={class:"srow-main"},yye={class:"srow-label"},kye={class:"srow-sub"},bye=["aria-checked"],xye={class:"srow-main"},_ye={class:"srow-label"},wye={class:"srow-sub"},Sye=["aria-checked"],Cye={class:"srow-main"},Aye={class:"srow-label"},Mye={class:"srow read-only"},Eye={class:"srow-main"},Tye={class:"srow-label"},Nye={class:"srow-sub"},Iye=["aria-label"],$ye={class:"group-title"},Lye={class:"srow-main"},Fye={class:"srow-label"},Oye={class:"srow-sub"},Rye={class:"srow read-only pref"},Bye={class:"srow-main"},Dye={class:"srow-label"},Pye={class:"srow read-only pref"},Hye={class:"srow-main"},Wye={class:"srow-label"},zye={class:"srow read-only pref"},Uye={class:"srow-main"},jye={class:"srow-label"},qye={class:"num-field"},Vye=["value","aria-label"],Kye={class:"srow-main"},Gye={class:"srow-label"},Yye={class:"srow-sub"},Zye=["aria-checked"],Qye={class:"srow-main"},Xye={class:"srow-label"},Jye={class:"srow-main"},eke={class:"srow-label"},tke={key:2,class:"srow read-only"},nke={class:"srow-main"},ske={class:"srow-label"},oke={class:"srow-val dim"},ike={class:"arch-subhead"},rke={class:"arch-count"},lke={class:"arch-tools"},ake={key:0,class:"arch-empty"},cke={class:"arch-meta"},uke={class:"arch-name"},dke={class:"arch-time"},fke={key:2,class:"arch-empty"},hke=100,pke=qe({__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(),s=e,o=t;function i(ae){o("setColorScheme",ae)}const r=["manual","auto","yolo"],l=P(()=>{const ae=s.status?.modelId??s.status?.model??"";return s.models?.find(te=>te.id===ae||te.model===ae||te.displayName===s.status?.model)}),a=P(()=>Nd(l.value)),c=P(()=>nk(l.value)),u=P(()=>aa(l.value,s.thinking??"off")),d=P(()=>{const ae=c.value,te=u.value;return ae.includes(te)?te:ae.includes("on")?"on":ae[0]??"off"}),f=P(()=>c.value.map(ae=>({value:ae,label:mv(ae)}))),p=P(()=>s.planMode===!0),h=P(()=>s.swarmMode===!0),m=P(()=>{const ae=s.status.permission;return ae==="yolo"?"var(--color-danger)":ae==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),_=P(()=>{const ae=s.status.permission,te=n(ae==="yolo"?"mobile.permYoloSub":ae==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ae} · ${te}`}),k=ae=>`${Math.round(ae/1e3)}k`,g=P(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),v=P(()=>s.status.ctxMax>0?`${k(s.status.ctxUsed)}/${k(s.status.ctxMax)}`:n("status.statusNone"));function y(ae){o("setThinking",sk(l.value,ae))}function A(){const ae=r.indexOf(s.status.permission),te=r[(ae+1)%r.length];o("setPermission",te)}function L(){o("pickModel"),o("update:modelValue",!1)}function $(){o("login"),o("update:modelValue",!1)}function x(){o("logout"),o("update:modelValue",!1)}const E=Ek(),N=Q("main"),F=Q([]),S=Q(!1),T=Q(!1),R=Q(""),O=Q("archived-desc");async function D(){if(!S.value){S.value=!0,T.value=!1;try{const ae=[];let te;for(;;){const Z=await E.loadArchivedSessions({beforeId:te,pageSize:hke});if(ae.push(...Z.items),!Z.hasMore||Z.items.length===0)break;const ne=Z.items.at(-1)?.id;if(ne===void 0)break;te=ne}F.value=ae,T.value=!0}catch(ae){console.warn("loadAllArchived failed",ae)}finally{S.value=!1}}}function W(){N.value="archived",R.value="",D()}function z(){N.value="main"}const V=P(()=>{const ae=R.value.trim().toLowerCase();let te=F.value.filter(Z=>Z.archived===!0);return ae&&(te=te.filter(Z=>Z.title.toLowerCase().includes(ae))),te=te.slice(),O.value==="archived-desc"?te.sort((Z,ne)=>ne.updatedAt.localeCompare(Z.updatedAt)):O.value==="created-desc"?te.sort((Z,ne)=>ne.createdAt.localeCompare(Z.createdAt)):te.sort((Z,ne)=>Z.title.localeCompare(ne.title,"zh")),te});async function U(ae){await E.restoreSession(ae)&&(F.value=F.value.filter(Z=>Z.id!==ae))}function re(ae){const te=new Date(ae);if(Number.isNaN(te.getTime()))return ae;const Z=ne=>String(ne).padStart(2,"0");return`${te.getFullYear()}-${Z(te.getMonth()+1)}-${Z(te.getDate())} ${Z(te.getHours())}:${Z(te.getMinutes())}`}return Ke(()=>s.modelValue,ae=>{ae||(N.value="main")}),(ae,te)=>(b(),ye(PM,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":te[6]||(te[6]=Z=>o("update:modelValue",Z))},{default:Ee(()=>[N.value==="main"?(b(),I(Be,{key:0},[w("div",cye,B(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",uye,[w("span",dye,B(C(n)("status.statusModel")),1),w("span",fye,B(e.status.model),1)]),te[7]||(te[7]=w("span",{class:"chev"},"›",-1))]),w("div",hye,[w("span",pye,[w("span",mye,B(C(n)("status.statusThinking")),1),a.value==="unsupported"?(b(),I("span",gye,B(C(n)("status.modeNotSupported")),1)):le("",!0)]),c.value.length>1?(b(),ye(to,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(b(),I("span",{key:1,class:De(["srow-val",{dim:d.value==="off"}])},B(d.value==="off"?C(n)("status.planOff"):C(mv)(d.value)),3))]),w("button",{type:"button",class:"srow",onClick:te[0]||(te[0]=Z=>o("togglePlan"))},[w("span",vye,[w("span",yye,B(C(n)("status.statusPlanMode")),1),w("span",kye,B(C(n)("mobile.planModeSub")),1)]),w("span",{class:De(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,bye)]),w("button",{type:"button",class:"srow",onClick:te[1]||(te[1]=Z=>o("toggleSwarm"))},[w("span",xye,[w("span",_ye,B(C(n)("status.statusSwarmMode")),1),w("span",wye,B(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:De(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,Sye)]),w("button",{type:"button",class:"srow",onClick:A},[w("span",Cye,[w("span",Aye,B(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:qt({color:m.value})},B(_.value),5)]),te[8]||(te[8]=w("span",{class:"chev"},"›",-1))]),w("div",Mye,[w("span",Eye,[w("span",Tye,B(C(n)("status.statusContext")),1),w("span",Nye,B(v.value),1)]),w("span",{class:"ctx-meter","aria-label":v.value},[w("i",{style:qt({width:g.value+"%"})},null,4)],8,Iye)]),w("div",$ye,B(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:W},[w("span",Lye,[w("span",Fye,B(C(n)("mobile.archivedSessions")),1),w("span",Oye,B(C(n)("mobile.archivedSessionsSub")),1)]),te[9]||(te[9]=w("span",{class:"chev"},"›",-1))]),w("div",Rye,[w("span",Bye,[w("span",Dye,B(C(n)("theme.colorSchemeLabel")),1)]),ie(to,{"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"])]),w("div",Pye,[w("span",Hye,[w("span",Wye,B(C(n)("sidebar.language")),1)]),ie(DM)]),w("div",zye,[w("span",Uye,[w("span",jye,B(C(n)("settings.uiFontSize")),1)]),w("label",qye,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:te[2]||(te[2]=Z=>o("setUiFontSize",Number(Z.target.value)))},null,40,Vye),te[10]||(te[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:te[3]||(te[3]=Z=>o("setConversationToc",!e.conversationToc))},[w("span",Kye,[w("span",Gye,B(C(n)("settings.conversationToc")),1),w("span",Yye,B(C(n)("settings.conversationTocHint")),1)]),w("span",{class:De(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Zye)]),e.authReady?(b(),I("button",{key:0,type:"button",class:"srow acct out",onClick:x},[w("span",Qye,[w("span",Xye,B(C(n)("sidebar.signOut")),1)])])):(b(),I("button",{key:1,type:"button",class:"srow acct in",onClick:$},[w("span",Jye,[w("span",eke,B(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(b(),I("div",tke,[w("span",nke,[w("span",ske,B(C(n)("settings.serverVersion")),1)]),w("span",oke,B(e.serverVersion),1)])):le("",!0)],64)):(b(),I(Be,{key:1},[w("div",ike,[w("button",{type:"button",class:"arch-back",onClick:z},[te[11]||(te[11]=w("span",{class:"chev back"},"‹",-1)),Ge(" "+B(C(n)("mobile.archivedBack")),1)]),w("span",rke,B(C(n)("mobile.sessionCount",{n:V.value.length})),1)]),w("div",lke,[ie(sa,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":te[4]||(te[4]=Z=>R.value=Z)},null,8,["model-value","placeholder"]),ie(to,{size:"sm","model-value":O.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":te[5]||(te[5]=Z=>O.value=Z)},null,8,["model-value","options"])]),S.value?(b(),I("div",ake,B(C(n)("settings.archivedLoadingAll")),1)):V.value.length>0?(b(!0),I(Be,{key:1},nt(V.value,Z=>(b(),I("div",{key:Z.id,class:"arch-row"},[w("div",cke,[w("div",uke,B(Z.title),1),w("div",dke,B(C(n)("settings.archivedAt",{time:re(Z.updatedAt)})),1)]),ie(Ft,{variant:"secondary",size:"sm",onClick:ne=>U(Z.id)},{default:Ee(()=>[Ge(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(b(),I("div",fke,B(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),mke=ut(pke,[["__scopeId","data-v-eeaf31bb"]]),gke={class:"ob-brand"},vke={class:"ob-brand-text"},yke={class:"ob-title"},kke={class:"ob-sub"},bke={class:"ob-sec"},xke={class:"ob-label"},_ke={class:"ob-sec"},wke={class:"ob-label"},Ske={class:"ob-sec"},Cke={class:"ob-label"},Ake=qe({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Et(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=X5();function c(d){o.value!==d&&V3(d)}function u(){n("complete")}return(d,f)=>(b(),ye(Sr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=p=>n("skip"))},{head:Ee(()=>[w("div",gke,[f[4]||(f[4]=w("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[w("defs",null,[w("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[w("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),w("g",{class:"ob-eyes",fill:"#000"},[w("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),w("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),w("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),w("div",vke,[w("div",yke,B(C(s)("onboarding.title")),1),w("div",kke,B(C(s)("onboarding.subtitle")),1)])])]),default:Ee(()=>[w("section",bke,[w("div",xke,B(C(s)("onboarding.languageLabel")),1),ie(to,{"model-value":C(o),options:C(q3).map(p=>({value:p.code,label:p.label})),"onUpdate:modelValue":f[0]||(f[0]=p=>c(p))},null,8,["model-value","options"])]),w("section",_ke,[w("div",wke,B(C(s)("theme.colorSchemeLabel")),1),ie(to,{"model-value":C(i),options:[{value:"light",label:C(s)("theme.light")},{value:"dark",label:C(s)("theme.dark")},{value:"system",label:C(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=p=>C(l)(p))},null,8,["model-value","options"])]),w("section",Ske,[w("div",Cke,B(C(s)("theme.accentLabel")),1),ie(to,{"model-value":C(r),options:[{value:"blue",label:C(s)("theme.accentBlue")},{value:"mono",label:C(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=p=>C(a)(p))},null,8,["model-value","options"])]),ie(Ft,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Ge(B(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),Mke=ut(Ake,[["__scopeId","data-v-fbdd3eab"]]),Eke=["aria-label"],Tke={class:"gload-box"},Nke={class:"gload-text"},Ike=qe({__name:"GlobalLoading",setup(e){const{t}=Et();return(n,s)=>(b(),I("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",Tke,[s[0]||(s[0]=Hv('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-8d6a5c44></path></svg>',1)),ie(wo,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",Nke,B(C(t)("app.connecting")),1)])],8,Eke))}}),$ke=ut(Ike,[["__scopeId","data-v-8d6a5c44"]]),Lke={class:"kap-root"},Fke={class:"kap-head"},Oke={class:"kap-count"},Rke={class:"kap-head-actions"},Bke={class:"kap-filters"},Dke=["value"],Pke={class:"kap-check"},Hke={class:"kap-check"},Wke={class:"kap-view-toggle",role:"group"},zke={key:0,class:"kap-empty"},Uke=["onClick"],jke={class:"kap-ts"},qke={class:"kap-label"},Vke={key:0,class:"kap-detail"},Kke={class:"kap-detail-actions"},Gke=["onClick"],Yke={key:1,class:"kap-agg"},Zke={class:"mono"},Qke={class:"mono"},Xke={class:"num"},Jke={class:"num"},e2e={key:0},t2e={class:"mono"},n2e={class:"num"},s2e={class:"num"},o2e={key:0},i2e=qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=Q("all"),o=Q(""),i=Q(""),r=Q(!1),l=Q("timeline"),a=P(()=>(Jy.value,[...jne()])),c=P(()=>{const E=new Set;for(const N of a.value)N.sessionId&&E.add(N.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=P(()=>{const E=o.value.trim().toLowerCase();return a.value.filter(N=>!(s.value!=="all"&&N.source!==s.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||E&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes(E)))}),f=P(()=>{const E=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,T=E.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};T.count++,N.seq!==void 0&&(T.lastSeq=N.seq),E.set(S,T)}return[...E.values()].sort((N,F)=>F.count-N.count)}),p=P(()=>{const E=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),E.set(F,S)}return[...E.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),h=Q(null),m=Q(!0),_=Q(null),k=Q(null);Ke(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await pt();const E=_.value;E&&(E.scrollTop=E.scrollHeight)});function g(E){h.value=h.value===E?null:E}function v(E){const N=new Date(E),F=(S,T=2)=>String(S).padStart(T,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function y(E){return JSON.stringify(E,null,2)}async function A(E){await js(y(E))&&(k.value=E.id,setTimeout(()=>{k.value===E.id&&(k.value=null)},1500))}function L(){D5(d.value)}function $(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 x(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,N)=>(b(),I("section",Lke,[w("header",Fke,[N[11]||(N[11]=w("strong",null,"KAP debug",-1)),w("span",Oke,B(d.value.length)+"/"+B(a.value.length),1),w("div",Rke,[w("button",{type:"button",class:De({on:C(bu)}),onClick:N[0]||(N[0]=F=>bu.value=!C(bu))},B(C(bu)?"resume":"pause"),3),w("button",{type:"button",onClick:N[1]||(N[1]=F=>C(qne)())},"clear"),w("button",{type:"button",onClick:N[2]||(N[2]=F=>L())},"export jsonl"),ie(jt,{text:"Close window"},{default:Ee(()=>[w("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",Bke,[Tn(w("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>s.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[w("option",{value:"all"},"rest + ws + app",-1),w("option",{value:"rest"},"rest",-1),w("option",{value:"ws"},"ws",-1),w("option",{value:"client"},"app errors",-1)])],512),[[ug,s.value]]),Tn(w("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=w("option",{value:""},"all sessions",-1)),(b(!0),I(Be,null,nt(c.value,F=>(b(),I("option",{key:F,value:F},B(F),9,Dke))),128))],512),[[ug,i.value]]),Tn(w("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ao,o.value]]),w("label",Pke,[Tn(w("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[wh,r.value]]),N[14]||(N[14]=Ge(" errors",-1))]),w("label",Hke,[Tn(w("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[wh,m.value]]),N[15]||(N[15]=Ge(" follow",-1))]),w("div",Wke,[w("button",{type:"button",class:De({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:De({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(b(),I("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(b(),I("div",zke," No trace entries yet. REST calls and WS frames will appear here. ")):le("",!0),(b(!0),I(Be,null,nt(d.value,F=>(b(),I("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:De(["kap-row",{expanded:h.value===F.id}]),onClick:S=>g(F.id)},[w("span",jke,B(v(F.ts)),1),w("span",{class:De(["kap-badge",$(F)])},B(x(F)),3),w("span",qke,B(F.label),1)],10,Uke),h.value===F.id?(b(),I("div",Vke,[w("div",Kke,[w("button",{type:"button",onClick:S=>A(F)},B(k.value===F.id?"copied ✓":"copy json"),9,Gke)]),w("pre",null,B(y(F)),1)])):le("",!0)]))),128))],512)):(b(),I("div",Yke,[N[20]||(N[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[N[17]||(N[17]=w("thead",null,[w("tr",null,[w("th",null,"dir"),w("th",null,"type"),w("th",null,"session"),w("th",null,"count"),w("th",null,"last seq")])],-1)),w("tbody",null,[(b(!0),I(Be,null,nt(f.value,F=>(b(),I("tr",{key:F.key},[w("td",null,B(F.dir),1),w("td",Zke,B(F.eventType),1),w("td",Qke,B(F.sessionId),1),w("td",Xke,B(F.count),1),w("td",Jke,B(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(b(),I("tr",e2e,[...N[16]||(N[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):le("",!0)])]),N[21]||(N[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[N[19]||(N[19]=w("thead",null,[w("tr",null,[w("th",null,"endpoint"),w("th",null,"count"),w("th",null,"errors"),w("th",null,"avg ms")])],-1)),w("tbody",null,[(b(!0),I(Be,null,nt(p.value,F=>(b(),I("tr",{key:F.key},[w("td",t2e,B(F.key),1),w("td",n2e,B(F.count),1),w("td",{class:De(["num",{err:F.errors>0}])},B(F.errors),3),w("td",s2e,B(F.avgMs),1)]))),128)),p.value.length===0?(b(),I("tr",o2e,[...N[18]||(N[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):le("",!0)])])]))]))}}),r2e=ut(i2e,[["__scopeId","data-v-3cda6fe3"]]),l2e=qe({__name:"DebugPanel",setup(e){const t=Q(!1);let n=null,s=null,o=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const p of i){const h=d.getAttribute(p);h!==null?f.setAttribute(p,h):f.removeAttribute(p)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=Sh(r2e,{onClose:()=>u.close()});f.mount(d),s=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return ln(()=>{c()}),es(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(b(),ye(jt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),a2e=ut(l2e,[["__scopeId","data-v-21346738"]]);function c2e({client:e,authLogoRef:t}){const n=P(()=>e.authReady.value),s=P(()=>e.initialized.value&&!n.value),o="/login",i=Q(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)}Ke(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return fn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function u2e({running:e,showAuthGate:t}){const{t:n}=Et(),s=["◐","◓","◑","◒"],o=Q(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ke(e,c=>{c?r():l()},{immediate:!0});const a=P(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});EE(()=>{typeof document<"u"&&(document.title=a.value)}),fn(()=>{l()})}const HM=Q(typeof window>"u"?0:window.innerWidth);let Bf=0,up=!1;function kv(){HM.value=window.innerWidth}function d2e(){up||typeof window>"u"||(window.addEventListener("resize",kv),up=!0,kv())}function f2e(){!up||typeof window>"u"||(window.removeEventListener("resize",kv),up=!1)}function WM(e,t,n){return Math.max(t,e-n)}function bv(e,t,n){return Math.min(n,Math.max(t,e))}function zM(){return ln(()=>{Bf+=1,d2e()}),es(()=>{Bf=Math.max(0,Bf-1),Bf===0&&f2e()}),{viewportWidth:HM}}const h2e="kimi-web.file-preview-width",Xa=320;function p2e({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=zM(),i=P(()=>Math.max(0,o.value-t.value)),r=P(()=>WM(i.value,Xa,Xa));function l(fe){return bv(Math.round(fe),Xa,r.value)}function a(){return l(i.value/2)}const c=P(()=>a()),u=Q(c.value),d=P(()=>bv(u.value,Xa,r.value)),f=Q(null),p=P(()=>{const fe=f.value;if(!fe)return null;const se=e.turns.value.find(ge=>ge.id===fe.turnId)?.blocks?.[fe.blockIndex];return se?.kind==="thinking"?se.thinking:null}),h=P(()=>p.value!==null);function m(fe){const j=f.value;if(j&&j.turnId===fe.turnId&&j.blockIndex===fe.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=fe}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=Q(null),g=P(()=>{const fe=k.value;if(!fe)return null;const j=e.turns.value.find(se=>se.id===fe.turnId);return j?.role==="compaction"&&j.text?j.text:null}),v=P(()=>g.value!==null);function y(fe){if(k.value?.turnId===fe.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=fe}function A(){k.value=null,n.value==="compaction"&&(n.value=null)}const L=Q(null);function $(fe){const j=e.activeAppTasks.value,se=j.find(ue=>ue.id===fe)??j.find(ue=>ue.parentToolCallId===fe);if(se)return se.id;const ge=j.filter(ue=>ue.kind==="subagent"&&!ue.parentToolCallId);if(ge.length===1)return ge[0].id}const x=P(()=>{const fe=L.value;if(!fe)return null;const j=e.activeAppTasks.value.find(se=>se.id===fe.subagentId);return j?Jhe(j):null}),E=P(()=>x.value!==null);function N(fe){const j=$(fe);if(j){if(L.value?.subagentId===j){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:j},n.value="agent"}}function F(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Q(null),T=P(()=>{const fe=S.value;if(!fe)return null;const j=jH(e.turns.value,fe);return j?{id:fe,title:pa(j.name),path:UH(j.arg),lines:j.status==="error"?null:Y3(j),output:j.output}:null}),R=P(()=>T.value!==null);function O(fe){if(n.value==="toolDiff"&&S.value===fe){D();return}n.value="toolDiff",S.value=fe}function D(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const W=Q("list"),z=Q(null);function V(){if(n.value==="diff"){U();return}n.value="diff",W.value="list",z.value=null,e.loadGitStatus(e.activeSessionId.value)}function U(){n.value==="diff"&&(n.value=null),W.value="list",z.value=null,e.clearFileDiff()}async function re(fe){W.value="detail",z.value=fe,await e.loadFileDiff(fe)}async function ae(fe){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,fe):await e.openSideChat(fe),n.value="btw"}function te(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function Z(){n.value==="btw"&&(n.value=null)}const ne=P(()=>e.sideChatVisible.value),ke=P(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||ne.value)),Se=Q(!1),Ye=Q({});function ve(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function Y(fe){if(fe)switch(fe.kind){case"thinking":f.value={turnId:fe.turnId,blockIndex:fe.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:fe.turnId},n.value="compaction";break;case"agent":L.value={subagentId:fe.subagentId},n.value="agent";break;case"toolDiff":S.value=fe.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ce(){return n.value==="thinking"&&h.value?(_(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&R.value?(D(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(U(),!0):n.value==="btw"?(te(),!0):!1}return Ke(e.activeSessionId,(fe,j)=>{if(j){const se=ve();se?Ye.value[j]=se:delete Ye.value[j]}s(),_(),A(),F(),D(),U(),Z(),fe&&Y(Ye.value[fe])}),{PREVIEW_WIDTH_KEY:h2e,PREVIEW_MIN:Xa,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:p,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:E,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:T,toolDiffVisible:R,openToolDiff:O,closeToolDiff:D,detailDiffMode:W,detailDiffPath:z,openDiffDetail:V,closeDiffDetail:U,selectDiffFile:re,btwVisible:ne,openSideChatTab:ae,closeSideChat:te,hideSideChatPanel:Z,sidePanelVisible:ke,panelDragging:Se,closeOpenSidePanel:ce}}const m2e=$t.sidebarWidth,SC=$t.sidebarCollapsed,CC=270,V0=170,g2e=480,v2e=320;function y2e(e={}){const{viewportWidth:t}=zM(),n=Q(CC),s=Q(!1),o=Q(!1),i=P(()=>{const u=v2e+(YC(e.previewOpen)?Xa:0);return Math.min(g2e,WM(t.value,V0,u))}),r=P(()=>bv(n.value,V0,i.value));function l(){try{s.value=Qn(SC)==="true"}catch{s.value=!1}}function a(){try{ts(SC,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:m2e,SIDEBAR_DEFAULT:CC,SIDEBAR_MIN:V0,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function k2e({client:e,detailTarget:t}){const{t:n}=Et(),s=Q(null),o=Q(null),i=Q(!1),r=Q(null),l=Q(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=P(()=>{const $=l.value;return $?e.getFileDownloadUrl($):null}),f=P(()=>s.value!==null);function p($){return $.length>1?$.replace(/\/+$/,""):$}function h($){const x=[];for(const E of $.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){x.pop();continue}x.push(E)}return x.join("/")}function m($){const x=$.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(e.status.value.cwd);if(x.startsWith("/")){if(!E||x!==E&&!x.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===E?"":x.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=h(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=h(x);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function _($){const x=s.value;if(t.value==="file"&&x&&x.path===$.path&&x.line===$.line){y();return}const E=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=$,l.value=null;const N=m($.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if(E!==a)return;F?o.value={...F,path:F.path||N.path}:o.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(F){if(E!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function k($){return/^data:([^;,]+)/i.exec($)?.[1]}function g($){if($.kind!=="image")return;const x=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const E={path:$.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:$.mimeType??k($.url)??"image/*",isBinary:!0,size:$.bytes??0};$.fileId?(i.value=!0,o.value=E,ft().getFileBlob($.fileId).then(N=>{if(x===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(N),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{x===a&&(o.value&&(o.value={...o.value,sourceUrl:$.url}),i.value=!1)})):(i.value=!1,o.value={...E,sourceUrl:$.url})}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ke(t,($,x)=>{x==="file"&&$!=="file"&&v()});function A(){const $=o.value?.path??s.value?.path;$&&e.openWorkspaceFile($,s.value?.line)}function L(){const $=o.value?.path??s.value?.path;$&&e.revealWorkspaceFile($)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:_,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:A,revealPreviewFile:L}}const b2e=640,x2e=`(max-width: ${b2e}px)`;function _2e(){const e=Q(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(x2e);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),fn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),fn(()=>t.removeListener(n))),e}const w2e={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},S2e={class:"server-auth-card"},C2e={class:"server-auth-body"},A2e={class:"server-auth-foot"},M2e=qe({__name:"ServerAuthDialog",setup(e){const t=Q(""),n=Q(null),s=Q(!1);ln(()=>{pt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,H5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(b(),I("div",w2e,[w("div",S2e,[l[1]||(l[1]=w("div",{class:"server-auth-head"},[w("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),w("p",{class:"server-auth-hint"},[Ge(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),Ge("). ")])],-1)),w("div",C2e,[ie(sa,{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:s.value,onKeydown:i},null,8,["modelValue","disabled"])]),w("div",A2e,[ie(Ft,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Ee(()=>[Ge(B(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),E2e=ut(M2e,[["__scopeId","data-v-82150ea4"]]),T2e=["aria-label"],N2e=qe({__name:"InternalBuildBanner",setup(e){const{t}=Et(),n=TR;return(s,o)=>C(n)?(b(),I("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=w("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"},[w("path",{d:"M8 2 14 13H2L8 2Z"}),w("path",{d:"M8 6v3.5"}),w("path",{d:"M8 11.5h.01"})],-1)),w("span",null,B(C(t)("app.internalBuildBanner")),1)],8,T2e)):le("",!0)}}),I2e=ut(N2e,[["__scopeId","data-v-166b3735"]]),$2e={class:"app-shell"},L2e={key:1,class:"auth-page"},F2e={class:"auth-page-inner"},O2e={class:"auth-page-copy"},R2e=["aria-label","aria-hidden"],B2e=qe({__name:"App",setup(e){const t=tse(),n=Q(!t);let s=null;const o=Ek(),i=P(()=>!o.dangerousBypassAuth.value&&n.value);An("resolveImage",o.resolveImageUrl),An("resolveSwarmMembers",rt=>o.swarmMembersByToolCallId.value.get(rt)??[]);const{t:r}=Et(),l=Ai(),a=_2e(),c=Q(!1),u=Q(!1),d=P(()=>{const rt=o.activeSessionId.value;return o.sessions.value.find(xe=>xe.id===rt)?.title??""}),f=P(()=>o.visibleWorkspace.value?.sessionCount??0),p=P(()=>o.activity.value!=="idle"),h=Q(null),{showAuthGate:m,blinkAuthLogo:_}=c2e({client:o,authLogoRef:h});u2e({running:p,showAuthGate:m});function k(rt){const xe=o.status.value.modelId??o.status.value.model??"",Le=o.models.value.find(lt=>lt.id===xe||lt.model===xe||lt.displayName===o.status.value.model),we=nk(Le),X=aa(Le,rt),me=we.indexOf(X),je=we[(me+1)%we.length]??we[0]??"off";return sk(Le,je)}const g=Q(!o.onboarded.value);function v(){o.setOnboarded(!0),g.value=!1}function y(){g.value=!0}ln(()=>{o.load(),Ye(),document.addEventListener("keydown",A,!0),s=sse(()=>{n.value=!0,o.clearDangerousBypassAuth()})}),fn(()=>{document.removeEventListener("keydown",A,!0),s!==null&&(s(),s=null)});function A(rt){rt.key==="Escape"&&(hs.value||ds()&&(rt.stopPropagation(),rt.preventDefault()))}const L=Q(null),$=Q(!1);Ke(o.activeSessionId,()=>{$.value=!0,pt(()=>{$.value=!1})});const{previewTarget:x,previewFile:E,previewLoading:N,previewError:F,previewDownloadUrl:S,previewExternalActions:T,openFilePreview:R,openMediaPreview:O,closeFilePreview:D,openPreviewInEditor:W,revealPreviewFile:z}=k2e({client:o,detailTarget:L}),V=P(()=>L.value!==null),{SIDEBAR_WIDTH_KEY:U,SIDEBAR_DEFAULT:re,SIDEBAR_MIN:ae,sidebarMax:te,sessionColWidth:Z,sidebarCollapsed:ne,sidebarDragging:ke,sideWidth:Se,loadSidebarCollapsed:Ye,toggleSidebarCollapse:ve}=y2e({previewOpen:V}),{PREVIEW_WIDTH_KEY:Y,PREVIEW_MIN:ce,previewDefaultWidth:fe,previewMax:j,previewWidth:se,previewPanelWidth:ge,thinkingPanelText:ue,thinkingVisible:pe,openThinkingPanel:q,closeThinkingPanel:J,compactionPanelText:he,compactionPanelVisible:Te,openCompactionPanel:Ie,closeCompactionPanel:Oe,agentPanelMember:de,openAgentPanel:$e,closeAgentPanel:Qe,toolDiffTarget:tt,openToolDiff:vt,closeToolDiff:wt,detailDiffMode:xt,detailDiffPath:Rt,openDiffDetail:yt,closeDiffDetail:nn,selectDiffFile:xn,btwVisible:ns,openSideChatTab:Wt,closeSideChat:_n,sidePanelVisible:gn,panelDragging:ot,closeOpenSidePanel:ds}=p2e({client:o,sideWidth:Se,detailTarget:L,closeFilePreview:D}),ys=Q(null),fs=Q(!1),Xe=Q(!1),Ze=Q(!1),Mt=Q(!1),Dt=Q(!1),zt=Q(!1),wn=Q(null),Rn=Q(null),hs=P(()=>Ka.value>0||fs.value||Xe.value||Ze.value||Mt.value||Dt.value||zt.value||g.value||c.value||u.value),ss=Q(!1),sn=Q(!1),Lt=Q(!1),Vs=Q(!1),an=Q(!1);async function So(){ss.value=!0,sn.value=!1,fs.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{sn.value=!0}finally{ss.value=!1}}async function Co(){Lt.value=!0,Vs.value=!1,Xe.value=!0;try{await o.loadProviders()}catch{Vs.value=!0}finally{Lt.value=!1}}function Rs(){Ze.value=!0}async function fi(rt){fs.value=!1,await co(rt)}async function co(rt){await o.setModel(rt)&&rt!==o.defaultModel.value&&o.updateConfig({defaultModel:rt})}async function jo(rt){await o.addProvider(rt)}async function Ot(rt){await o.deleteProvider(rt)}async function Bs(rt){await o.refreshProvider(rt)}async function qn(rt){an.value=!0;try{await o.updateConfig(rt)&&await o.checkAuth()}finally{an.value=!1}}async function Cs(){return o.startOAuthLogin()}async function On(){return o.pollOAuthLogin()}async function Hn(){return o.cancelOAuthLogin()}async function hi(){Ze.value=!1,await o.checkAuth(),await o.load()}async function Xn(rt){await o.undo(1),await pt(),ys.value?.loadComposerForEdit(rt.text,rt.images)}function qo(rt){if(rt==="/compact"||rt.startsWith("/compact ")){o.compact(rt.slice(8).trim()||void 0);return}if(rt==="/swarm"||rt.startsWith("/swarm ")){const xe=rt.slice(6).trim();xe==="on"?o.setSwarmMode(!0):xe==="off"?o.setSwarmMode(!1):xe?(o.setSwarmMode(!0),o.sendPrompt(xe)):o.toggleSwarmMode();return}if(rt==="/goal"||rt.startsWith("/goal ")){const xe=rt.slice(5).trim();xe==="pause"||xe==="resume"||xe==="cancel"?o.controlGoal(xe):xe?o.createGoal(xe):o.toggleGoalMode();return}if(rt==="/btw"||rt.startsWith("/btw ")){const xe=rt.slice(4).trim();!xe&&o.sideChatVisible.value?_n():Wt(xe||void 0);return}switch(rt){case"/new":case"/clear":Bn();break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const xe=o.permission.value,Le=xe==="manual"?"auto":xe==="auto"?"yolo":"manual";o.setPermission(Le);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(k(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":Dt.value=!0;break;case"/model":So();break;case"/provider":break;case"/login":Rs();break;default:{const xe=rt.indexOf(" "),Le=Hoe((xe===-1?rt:rt.slice(0,xe)).slice(1)),we=xe===-1?void 0:rt.slice(xe+1).trim()||void 0;if(!Le)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Le,we):o.activateSkill(Le,we);break}}}function Ks(rt){o.unqueue(rt)}function Mi(rt){o.unqueue(rt)}function Ao(rt){o.reorderQueue(rt.from,rt.to)}async function Vn(rt){const xe=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&xe){await o.startSessionAndSendPrompt(xe,rt.text,rt.attachments);return}if(!o.activeSessionId.value&&!xe){wn.value=rt,Mt.value=!0;return}o.sendPrompt(rt.text,rt.attachments)}async function Vo(rt){if(Rn.value=null,!await o.addWorkspaceByPath(rt)){Rn.value=r("workspace.addFailed");return}Mt.value=!1;const Le=wn.value;wn.value=null;const we=o.activeWorkspaceId.value;Le&&we&&await o.startSessionAndSendPrompt(we,Le.text,Le.attachments)}function ji(){wn.value=null,Rn.value=null,Mt.value=!1}function Ko(){pt(()=>{ys.value?.focusComposer()})}function Bn(){const rt=o.activeWorkspaceId.value;rt?o.openWorkspaceDraft(rt):o.clearActiveSession(),Ko()}function Kn(rt){o.openWorkspaceDraft(rt),Ko()}function Mo(rt){rt&&window.open(rt,"_blank","noopener")}return(rt,xe)=>(b(),I("div",$2e,[i.value?(b(),ye(E2e,{key:0})):le("",!0),C(m)?(b(),I("section",L2e,[w("div",F2e,[(b(),I("svg",{ref_key:"authLogoRef",ref:h,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:xe[0]||(xe[0]=bt(()=>{},["prevent"])),onClick:xe[1]||(xe[1]=(...Le)=>C(_)&&C(_)(...Le))},[...xe[96]||(xe[96]=[Hv('<defs data-v-88bcc9de><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-88bcc9de><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-88bcc9de></rect><g class="ch-eyes" fill="#000" data-v-88bcc9de><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-88bcc9de></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-88bcc9de></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-88bcc9de></rect>',2)])],544)),w("div",O2e,[w("h1",null,B(C(r)("app.authPageTitle")),1),w("p",null,B(C(r)("app.authPageMessage")),1)]),ie(Ft,{class:"auth-page-btn",variant:"primary",onClick:Rs},{default:Ee(()=>[ie(Ve,{name:"log-in",size:"md"}),w("span",null,B(C(r)("app.authPageLogin")),1)]),_:1})])])):(b(),I("div",{key:2,class:De(["app",{mobile:C(a),"sidebar-collapsed":C(ne)&&!C(a),"macos-desktop":C(pc)}]),style:qt({"--preview-w":C(ge)+"px"})},[C(a)?(b(),ye(Pve,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:p.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:xe[18]||(xe[18]=Le=>c.value=!0),onOpenSettings:xe[19]||(xe[19]=Le=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(b(),I(Be,{key:0},[ie(GR,{collapsed:C(ne),dragging:C(ke),"col-width":C(Se),"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,onSelect:xe[2]||(xe[2]=Le=>C(o).selectSession(Le)),onCreate:Bn,onCreateInWorkspace:xe[3]||(xe[3]=Le=>Kn(Le)),onSelectWorkspace:xe[4]||(xe[4]=Le=>C(o).openWorkspace(Le)),onAddWorkspace:xe[5]||(xe[5]=Le=>Mt.value=!0),onRename:xe[6]||(xe[6]=(Le,we)=>C(o).renameSession(Le,we)),onArchive:xe[7]||(xe[7]=Le=>C(o).archiveSession(Le)),onFork:xe[8]||(xe[8]=Le=>C(o).forkSession(Le)),onRenameWorkspace:xe[9]||(xe[9]=(Le,we)=>C(o).renameWorkspace(Le,we)),onDeleteWorkspace:xe[10]||(xe[10]=Le=>C(o).deleteWorkspace(Le)),onReorderWorkspaces:xe[11]||(xe[11]=Le=>C(o).reorderWorkspaces(Le)),onSetWorkspaceSortMode:xe[12]||(xe[12]=Le=>C(o).setWorkspaceSortMode(Le)),onLoadMoreSessions:xe[13]||(xe[13]=Le=>void C(o).loadMoreSessions(Le)),onLoadAllSessions:xe[14]||(xe[14]=Le=>void C(o).loadAllSessions()),onOpenSettings:xe[15]||(xe[15]=Le=>zt.value=!0),onCollapse:C(ve)},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","onCollapse"]),Tn(ie(Tx,{class:"side-handle","storage-key":C(U),"default-width":C(re),min:C(ae),max:C(te),"onUpdate:width":xe[16]||(xe[16]=Le=>Z.value=Le),"onUpdate:dragging":xe[17]||(xe[17]=Le=>ke.value=Le)},null,8,["storage-key","default-width","min","max"]),[[oi,!C(ne)]])],64)),ie(tce,{ref_key:"conversationPaneRef",ref:ys,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:p.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,sending:C(o).isSending.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:xe[20]||(xe[20]=Le=>C(yt)()),onSelectWorkspace:xe[21]||(xe[21]=Le=>Kn(Le)),onAddWorkspace:xe[22]||(xe[22]=Le=>Mt.value=!0),onOpenPr:Mo,onSubmit:xe[23]||(xe[23]=Le=>Vn(Le)),onSteer:xe[24]||(xe[24]=Le=>C(o).steerPrompt(Le.text,Le.attachments)),onApproval:xe[25]||(xe[25]=(Le,we)=>C(o).respondApproval(Le,we)),onCancelTask:xe[26]||(xe[26]=Le=>C(o).cancelTask(Le)),onAnswer:xe[27]||(xe[27]=(Le,we)=>C(o).respondQuestion(Le,we)),onDismiss:xe[28]||(xe[28]=Le=>C(o).dismissQuestion(Le)),onCommand:qo,onInterrupt:xe[29]||(xe[29]=Le=>C(o).abortCurrentPrompt()),onUnqueue:Ks,onEditQueued:Mi,onReorderQueue:Ao,onSetPermission:xe[30]||(xe[30]=Le=>C(o).setPermission(Le)),onSetThinking:xe[31]||(xe[31]=Le=>C(o).setThinking(Le)),onTogglePlan:xe[32]||(xe[32]=Le=>C(o).togglePlanMode()),onToggleSwarm:xe[33]||(xe[33]=Le=>C(o).toggleSwarmMode()),onToggleGoal:xe[34]||(xe[34]=Le=>C(o).toggleGoalMode()),onCreateGoal:xe[35]||(xe[35]=Le=>C(o).createGoal(Le)),onControlGoal:xe[36]||(xe[36]=Le=>C(o).controlGoal(Le)),onRefreshGitStatus:xe[37]||(xe[37]=Le=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:xe[38]||(xe[38]=(Le,we)=>C(o).renameSession(Le,we)),onForkSession:xe[39]||(xe[39]=Le=>C(o).forkSession(Le)),onArchiveSession:xe[40]||(xe[40]=Le=>C(o).archiveSession(Le)),onCompact:xe[41]||(xe[41]=Le=>C(o).compact()),onPickModel:xe[42]||(xe[42]=Le=>So()),onSelectModel:xe[43]||(xe[43]=Le=>co(Le)),onOpenFile:xe[44]||(xe[44]=Le=>C(R)(Le)),onOpenMedia:xe[45]||(xe[45]=Le=>C(O)(Le)),onOpenThinking:xe[46]||(xe[46]=Le=>C(q)(Le)),onOpenCompaction:xe[47]||(xe[47]=Le=>C(Ie)(Le)),onOpenAgent:xe[48]||(xe[48]=Le=>C($e)(Le)),onOpenToolDiff:xe[49]||(xe[49]=Le=>C(vt)(Le)),onEditMessage:Xn},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","queued","search-files","upload-image","sending","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(pc)||C(ne))?(b(),ye(Nn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(ne)?C(r)("sidebar.expandSidebar"):C(r)("sidebar.collapseSidebar"),onClick:C(ve)},{default:Ee(()=>[ie(Ve,{name:C(ne)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):le("",!0),C(gn)&&!C(a)?(b(),ye(Tx,{key:3,class:"preview-handle","storage-key":C(Y),"default-width":C(fe),min:C(ce),max:C(j),reverse:"","aria-label":C(r)("layout.resizePreviewAria"),"onUpdate:width":xe[50]||(xe[50]=Le=>se.value=Le),"onUpdate:dragging":xe[51]||(xe[51]=Le=>ot.value=Le)},null,8,["storage-key","default-width","min","max","aria-label"])):le("",!0),!C(a)||C(gn)?(b(),I("aside",{key:4,class:De(["global-preview",{open:C(gn),mobile:C(a),"no-anim":C(ot)||$.value}]),role:"complementary","aria-label":C(r)("layout.detailPanelAria"),"aria-hidden":!C(gn)},[L.value==="thinking"&&C(pe)?(b(),ye(cC,{key:0,text:C(ue)??"",onClose:C(J)},null,8,["text","onClose"])):L.value==="compaction"&&C(Te)?(b(),ye(cC,{key:1,text:C(he)??"",subtitle:C(r)("conversation.summaryTitle"),onClose:C(Oe)},null,8,["text","subtitle","onClose"])):L.value==="agent"&&C(de)?(b(),ye(_ue,{key:2,member:C(de),onClose:C(Qe)},null,8,["member","onClose"])):L.value==="btw"&&C(ns)?(b(),ye(Uue,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:xe[52]||(xe[52]=Le=>C(o).sendSideChatPrompt(Le)),onClose:C(_n)},null,8,["turns","running","sending","onClose"])):L.value==="diff"?(b(),ye(vde,{key:4,mode:C(xt),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(xn),onBack:xe[53]||(xe[53]=Le=>{xt.value="list",Rt.value=null,C(o).clearFileDiff()}),onClose:C(nn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):L.value==="toolDiff"&&C(tt)?(b(),ye(Oue,{key:5,target:C(tt),onClose:C(wt)},null,8,["target","onClose"])):L.value==="file"?(b(),ye(sue,{key:6,file:C(E),loading:C(N),error:C(F),line:C(x)?.line,"download-url":C(S),closable:"","external-actions":C(T),"open-file":C(R),onClose:C(D),onOpenExternal:C(W),onReveal:C(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):le("",!0)],10,R2e)):le("",!0),ie(I2e,{class:"internal-build-fab"}),fs.value?(b(),ye(Rde,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:ss.value,unavailable:sn.value,onSelect:xe[54]||(xe[54]=Le=>fi(Le)),onToggleStar:xe[55]||(xe[55]=Le=>C(o).toggleStarModel(Le)),onClose:xe[56]||(xe[56]=Le=>fs.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):le("",!0),zt.value?(b(),ye(Tge,{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":an.value,"server-version":C(o).serverVersion.value,onSetColorScheme:xe[57]||(xe[57]=Le=>C(o).setColorScheme(Le)),onSetAccent:xe[58]||(xe[58]=Le=>C(o).setAccent(Le)),onSetUiFontSize:xe[59]||(xe[59]=Le=>C(o).setUiFontSize(Le)),onSetNotify:xe[60]||(xe[60]=Le=>C(o).setNotifyOnComplete(Le)),onSetNotifyQuestion:xe[61]||(xe[61]=Le=>C(o).setNotifyOnQuestion(Le)),onSetNotifyApproval:xe[62]||(xe[62]=Le=>C(o).setNotifyOnApproval(Le)),onSetSound:xe[63]||(xe[63]=Le=>C(o).setSoundOnComplete(Le)),onSetConversationToc:xe[64]||(xe[64]=Le=>C(o).setConversationToc(Le)),onUpdateConfig:xe[65]||(xe[65]=Le=>qn(Le)),onLogin:xe[66]||(xe[66]=()=>{zt.value=!1,Rs()}),onLogout:C(o).logout,onOpenOnboarding:xe[67]||(xe[67]=()=>{zt.value=!1,y()}),onOpenProviders:xe[68]||(xe[68]=()=>{zt.value=!1,Co()}),onClose:xe[69]||(xe[69]=Le=>zt.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","onLogout"])):le("",!0),Xe.value?(b(),ye(lfe,{key:7,providers:C(o).providers.value,loading:Lt.value,unavailable:Vs.value,onAdd:xe[70]||(xe[70]=Le=>jo(Le)),onRefresh:xe[71]||(xe[71]=Le=>Bs(Le)),onDelete:xe[72]||(xe[72]=Le=>Ot(Le)),onOpenLogin:xe[73]||(xe[73]=()=>{Xe.value=!1,Rs()}),onClose:xe[74]||(xe[74]=Le=>Xe.value=!1)},null,8,["providers","loading","unavailable"])):le("",!0),Dt.value?(b(),ye(yve,{key:8,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:xe[75]||(xe[75]=Le=>Dt.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):le("",!0),Mt.value?(b(),ye(nve,{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:Rn.value,onAdd:xe[76]||(xe[76]=Le=>Vo(Le)),onClose:ji},null,8,["browse-fs","get-fs-home","default-path","error"])):le("",!0),ie(cl,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?le("",!0):(b(),ye($ke,{key:0}))]),_:1}),g.value&&!C(m)?(b(),ye(Mke,{key:10,onComplete:v,onSkip:v})):le("",!0),ie(Nve,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(b(),ye(a2e,{key:11})):le("",!0),ie(rve),C(a)?(b(),ye(aye,{key:12,modelValue:c.value,"onUpdate:modelValue":xe[77]||(xe[77]=Le=>c.value=Le),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:xe[78]||(xe[78]=Le=>C(o).selectSession(Le)),onCreate:Bn,onCreateInWorkspace:xe[79]||(xe[79]=Le=>Kn(Le)),onAddWorkspace:xe[80]||(xe[80]=Le=>Mt.value=!0),onRename:xe[81]||(xe[81]=(Le,we)=>C(o).renameSession(Le,we)),onArchive:xe[82]||(xe[82]=Le=>C(o).archiveSession(Le)),onDeleteWorkspace:xe[83]||(xe[83]=Le=>C(o).deleteWorkspace(Le)),onLoadMore:xe[84]||(xe[84]=Le=>void C(o).loadMoreSessions(Le))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):le("",!0),C(a)?(b(),ye(mke,{key:13,modelValue:u.value,"onUpdate:modelValue":xe[85]||(xe[85]=Le=>u.value=Le),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:xe[86]||(xe[86]=Le=>So()),onSetThinking:xe[87]||(xe[87]=Le=>C(o).setThinking(Le)),onTogglePlan:xe[88]||(xe[88]=Le=>C(o).togglePlanMode()),onToggleSwarm:xe[89]||(xe[89]=Le=>C(o).toggleSwarmMode()),onSetPermission:xe[90]||(xe[90]=Le=>C(o).setPermission(Le)),onSetColorScheme:xe[91]||(xe[91]=Le=>C(o).setColorScheme(Le)),onSetUiFontSize:xe[92]||(xe[92]=Le=>C(o).setUiFontSize(Le)),onSetConversationToc:xe[93]||(xe[93]=Le=>C(o).setConversationToc(Le)),onLogin:xe[94]||(xe[94]=()=>{u.value=!1,Rs()}),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"])):le("",!0)],6)),Ze.value?(b(),ye(Bfe,{key:3,"on-start-o-auth-login":Cs,"on-poll-o-auth-login":On,"on-cancel-o-auth-login":Hn,onSuccess:hi,onClose:xe[95]||(xe[95]=Le=>Ze.value=!1)})):le("",!0)]))}}),D2e=ut(B2e,[["__scopeId","data-v-88bcc9de"]]);Yne();Sh(D2e).use(yn).mount("#app");export{q8 as $,Fv as A,OE as B,rs as C,Bbe as D,$C as E,Be as F,Hv as G,Ge as H,ie as I,pE as J,abe as K,ki as L,qe as M,l9 as N,fbe as O,hbe as P,gbe as Q,rh as R,fc as S,Ap as T,pbe as U,zv as V,dbe as W,Pbe as X,mbe as Y,$be as Z,H2e as _,l4 as a,$s as a$,Os as a0,wv as a1,G2e as a2,Tv as a3,IT as a4,dn as a5,$c as a6,ebe as a7,zbe as a8,obe as a9,f4 as aA,VE as aB,XE as aC,ln as aD,QE as aE,ZE as aF,Sv as aG,YE as aH,fn as aI,Iv as aJ,kE as aK,b as aL,o9 as aM,X2e as aN,An as aO,ZC as aP,Q2e as aQ,dh as aR,Ss as aS,ah as aT,Q as aU,Abe as aV,w9 as aW,nt as aX,In as aY,eT as aZ,cbe as a_,lbe as aa,rbe as ab,ibe as ac,Ebe as ad,Ube as ae,Ut as af,BT as ag,Sp as ah,nl as ai,br as aj,Jn as ak,Mbe as al,Oo as am,al as an,mt as ao,kbe as ap,bbe as aq,pn as ar,pt as as,zT as at,De as au,P2e as av,qt as aw,qE as ax,GE as ay,es as az,Z2e as b,ZX as b$,Obe as b0,Vu as b1,vh as b2,Lbe as b3,ll as b4,uE as b5,z2e as b6,fa as b7,AE as b8,Fbe as b9,ao as bA,oi as bB,DT as bC,Nbe as bD,Ke as bE,EE as bF,tbe as bG,TE as bH,_be as bI,Ee as bJ,vbe as bK,Tn as bL,bi as bM,Tbe as bN,bt as bO,J2e as bP,hn as bQ,eo as bR,Jbe as bS,PJ as bT,l5 as bU,txe as bV,pX as bW,Hy as bX,exe as bY,Hg as bZ,lxe as b_,W2e as ba,B as bb,Df as bc,ube as bd,Xt as be,q2e as bf,j2e as bg,YC as bh,Cbe as bi,U2e as bj,C as bk,bd as bl,Wbe as bm,Dbe as bn,c9 as bo,nbe as bp,wbe as bq,ME as br,Hbe as bs,ybe as bt,sbe as bu,r4 as bv,wh as bw,y9 as bx,X4 as by,ug as bz,Ibe as c,YX as c0,By as c1,GX as c2,Zbe as c3,lX as c4,Ybe as c5,Zh as c6,Vbe as c7,KX as c8,t5 as c9,rxe as ca,Kbe as cb,cxe as cc,Vg as cd,oc as ce,jg as cf,uxe as cg,axe as ch,Xbe as ci,$o as cj,Gbe as ck,Qbe as cl,gX as cm,ixe as cn,qg as co,Ug as cp,oxe as cq,qbe as cr,sxe as cs,nxe as ct,Ve as cu,jbe as cv,ut as cw,Sbe as d,sl as e,V2e as f,cl as g,f9 as h,K2e as i,Y2e as j,ui as k,vd as l,vs as m,gp as n,xr as o,Rbe as p,P as q,Sh as r,ye as s,le as t,I as u,w as v,_T as w,xbe as x,xT as y,S9 as z};
|
|
321
|
+
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Fme(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Lme(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const s=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Ome(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 Rme(e){const t=Ce.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Bme(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=yn.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=yn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Rme(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const Dme=P(()=>{const e=Ce.sessions.find(n=>n.id===Ce.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ce.workspaceName,branch:t}}),Pme=P(()=>(md.value,Ce.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Ck(e.updatedAt,e.status),status:e.status,busy:hm(e.id)})))),Hme=P(()=>Ce.activeSessionId??""),Wme=P(()=>{const e=Ce.activeSessionId;if(e)return Cn.skillsBySession.value[e]??[];const t=mm.value;return t?Cn.skillsByWorkspace.value[t]??[]:[]}),zme=P(()=>{const e=Ce.activeSessionId;return e?Ce.sendingBySession[e]??!1:!1}),Ume=P(()=>ht.isStartingFirstPrompt()),Hs=mpe(Ce,{pushOperationFailure:fm,nextOptimisticMsgId:EM,connectEventsIfNeeded:TM,getEventConn:()=>ci,models:()=>Cn.models.value}),Id=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Hs.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),LM=Lhe(Ce,Id),jme=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Ce.approvalsBySession[e]??[];return sM(n,s,o=>ft().getFileUrl(o),pm.value!=="idle",Ce.planReviewByToolCallId)}),qme=P(()=>(LM.taskClock.value,Id.value.map(Bme))),FM=P(()=>Wpe(Id.value)),Vme=P(()=>Upe(Id.value)),Qa=P(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),Kme=P(()=>{const e=Ce.activeSessionId;return e?Dpe(Ce.messagesBySession[e]??[]):[]}),Gme=P(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),Yme=P(()=>Ce.connection),Zme=P(()=>Ce.loading),Qme=P(()=>Ce.sessionLoading),Xme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),Jme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),e1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),t1e=P(()=>Ce.serverVersion),n1e=P(()=>Ce.dangerousBypassAuth);function s1e(){Ce.dangerousBypassAuth=!1}const o1e=P(()=>Ce.permission),i1e=P(()=>Ce.thinking),OM=P(()=>{const e=Ce.activeSessionId;return e?Ce.planModeBySession[e]??!1:am.planMode}),r1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.swarmModeBySession[e]??!1:am.swarmMode}),l1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.goalModeBySession[e]??!1:am.goalMode}),a1e=P(()=>{const e=zpe(FM.value);return{plan:OM.value,goal:Qa.value&&Qa.value.status!=="complete"?{status:Qa.value.status,turnsUsed:Qa.value.turnsUsed,elapsedMs:Qa.value.wallClockMs}:null,swarm:e.total>0?e:null}}),c1e=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=ft();return(Ce.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(s=>({fileId:s.fileId,kind:s.kind,url:t.getFileUrl(s.fileId)}))}))}),u1e=P(()=>Ce.warnings),d1e=P(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map(Ome):[]}),f1e=P(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Fme(t),agentName:t.agentName})):[]}),pm=P(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ce.questionsBySession[e]??[]).length>0?"awaiting-question":hm(e)?"running":"idle":"idle"}),Cn=Rhe(Ce,{pushOperationFailure:fm,refreshSessionStatus:um,persistSessionProfile:SM,activity:pm,inFlightPromptSessions:dm,saveThinkingToStorage:Gpe,updateSession:cm,updateSessionMessages:yM}),ap=P(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),h1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),p1e=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),m1e=P(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),RM=P(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=ap.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Cn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Ce.defaultModel)??"—",o=Cn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:ap.value!==null}}),g1e=P(()=>xM.value),v1e=P(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),y1e=P(()=>Ce.authReady),k1e=P(()=>Ce.defaultModel),b1e=P(()=>Ce.managedProviderStatus),x1e=P(()=>Ce.config),_1e=P(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function Tc(e){return Ce.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const Ak=P(()=>Hfe({workspaces:Ce.workspaces,sessions:Ce.sessions,hiddenWorkspaceRoots:Ce.hiddenWorkspaceRoots,activeRoot:Ce.sessions.find(e=>e.id===Ce.activeSessionId)?.cwd,activeBranch:ap.value?.branch??null,sessionsHasMoreByWorkspace:Ce.sessionsHasMoreByWorkspace})),cp=Q(IN()),Nc=Q($N()==="manual"?"manual":"recent");Ke(()=>[Ak.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=jN(n,cp.value);s!==null&&(cp.value=s,$3(s))});const ua=P(()=>{const e=Ak.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Jpe(t.root,Ce.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Nc.value==="recent"){const t=new Map;for(const n of Ce.sessions){if(n.parentSessionId)continue;const s=Tc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return KN(e,t)}return qN(e,cp.value)}),mm=P(()=>{const e=Ce.activeWorkspaceId,t=ua.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ke(mm,e=>{e&&(Object.prototype.hasOwnProperty.call(Cn.skillsByWorkspace.value,e)||Cn.loadSkillsForWorkspace(e))},{immediate:!0});const w1e=P(()=>{const e=mm.value;return e?ua.value.find(t=>t.id===e)??null:null}),S1e=P(()=>{md.value;const e=new Set(ua.value.map(n=>n.id)),t=new Map(ua.value.map(n=>[n.id,n.name]));return Ce.sessions.filter(n=>!n.parentSessionId&&e.has(Tc(n))).map(n=>{const s=Tc(n);return{id:n.id,title:n.title,time:Ck(n.updatedAt,n.status),status:n.status,busy:hm(n.id),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),C1e=P(()=>{md.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Tc(t),s={id:t.id,title:t.title,time:Ck(t.updatedAt,t.status),status:t.status,busy:hm(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return ua.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ce.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ce.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ce.sessionsInitialCountByWorkspace[t.id]??yv}))});function A1e(e){cp.value=e,$3(e),Nc.value!=="manual"&&(Nc.value="manual",L3("manual"))}function M1e(e){Nc.value!==e&&(Nc.value=e,L3(e))}const BM=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),E1e=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),T1e=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),N1e=P(()=>{const e={},t=BM.value;for(const n of Ce.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Tc(n);e[o]=(e[o]??0)+s}return e}),I1e=P(()=>Ce.recentRoots),$1e=P(()=>Ce.availableOpenInApps),ht=Cpe(Ce,{taskPoller:LM,sideChat:Hs,modelProvider:Cn,pushOperationFailure:fm,activity:pm,inFlightPromptSessions:dm,sessionsKnownEmpty:NM,setSessions:gM,updateSession:cm,upsertSessionFront:eme,appendSession:tme,forgetSession:kM,setActiveSessionId:bk,updateSessionMessages:yM,nextOptimisticMsgId:EM,getEventConn:()=>ci,syncSessionFromSnapshot:wk,reopenSession:Nme,hasLoadedMessages:Ame,refreshSessionStatus:um,persistSessionProfile:SM,mergedWorkspaces:Ak,workspacesView:ua,status:RM,workspaceIdForSession:Tc,savePermissionToStorage:Vpe,savePlanModeToStorage:fM,saveSwarmModeToStorage:hM,saveGoalModeToStorage:pM,draftModes:am,saveUnread:Jv,saveActiveWorkspaceToStorage:Xpe,saveHiddenWorkspacesToStorage:Qpe,goalErrorMessage:wme,resetFastMoon:Di.resetFastMoon,initialized:wM,selectedDiffPath:bM,fileDiffLines:xM,fileDiffLoading:_M});function Mk(e){return e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function L1e(e,t){dm.delete(e),Ce.sendingBySession={...Ce.sendingBySession,[e]:!1};const n=Ce.promptIdBySession[e];if(Ce.promptIdBySession[e]!==void 0){const a={...Ce.promptIdBySession};delete a[e],Ce.promptIdBySession=a}e===Ce.activeSessionId?(Di.resetFastMoon(),ht.loadGitStatus(e),um(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},Jv({[e]:!0}));const s=(Ce.approvalsBySession[e]??[]).length>0,o=(Ce.questionsBySession[e]??[]).length>0;dhe(t,s,o)&&Pi.maybeNotifyCompletion(e,{isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(a=>a.id===e)?.title??"",promptId:n,onClick:()=>{ht.selectSession(e)}}),t==="idle"&&pd.maybePlayCompletionSound();const i=Ce.queuedBySession[e]??[];if(i.length===0)return;const[r,...l]=i;Ce.queuedBySession={...Ce.queuedBySession,[e]:l},r!==void 0&&ht.submitPromptInternal(e,r.text,r.attachments).then(a=>{if(!a){const c=Ce.queuedBySession[e]??[];Ce.queuedBySession={...Ce.queuedBySession,[e]:[r,...c]}}})}function F1e(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Pi.maybeNotifyQuestion({isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ht.selectSession(e)}}),pd.maybePlayQuestionSound()}function O1e(e,t){Pi.maybeNotifyApproval({isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ht.selectSession(e)}}),pd.maybePlayApprovalSound()}function Ek(){return $me(),{workspace:Dme,sessions:Pme,activeSessionId:Hme,workspacesView:ua,workspaceSortMode:Nc,visibleWorkspace:w1e,activeWorkspaceId:mm,sessionsForView:S1e,workspaceGroups:C1e,attentionBySession:BM,pendingBySession:E1e,attentionByWorkspace:N1e,unreadBySession:T1e,recentRoots:I1e,turns:jme,tasks:qme,activeAppTasks:Id,todos:Kme,goal:Qa,swarms:FM,swarmMembersByToolCallId:Vme,activationBadges:a1e,compaction:Gme,status:RM,sessionCost:v1e,fileDiff:g1e,selectedDiffPath:bM,fileDiffLoading:_M,changes:p1e,gitInfo:ap,gitDiffStats:m1e,activePullRequest:h1e,changesByPath:_1e,pendingApprovals:f1e,availableOpenInApps:$1e,connection:Yme,loading:Zme,sessionLoading:Qme,loadingMoreMessages:Xme,hasMoreMessages:Jme,loadMoreMessagesError:e1e,serverVersion:t1e,dangerousBypassAuth:n1e,clearDangerousBypassAuth:s1e,initialized:wM,permission:o1e,thinking:i1e,planMode:OM,swarmMode:r1e,goalMode:l1e,queued:c1e,warnings:u1e,questions:d1e,activity:pm,isSending:zme,isStartingFirstPrompt:Ume,fastMoon:Di.fastMoon,models:Cn.models,starredModelIds:Cn.starredModelIds,providers:Cn.providers,uiFontSize:Di.uiFontSize,setUiFontSize:Di.setUiFontSize,conversationToc:AM,setConversationToc:cme,colorScheme:Di.colorScheme,setColorScheme:Di.setColorScheme,accent:Di.accent,setAccent:Di.setAccent,notifyOnComplete:Pi.notifyOnComplete,notifyOnQuestion:Pi.notifyOnQuestion,notifyOnApproval:Pi.notifyOnApproval,notifyPermission:Pi.notifyPermission,setNotifyOnComplete:Pi.setNotifyOnComplete,setNotifyOnQuestion:Pi.setNotifyOnQuestion,setNotifyOnApproval:Pi.setNotifyOnApproval,soundOnComplete:pd.soundOnComplete,setSoundOnComplete:pd.setSoundOnComplete,onboarded:MM,setOnboarded:dme,load:ht.load,selectSession:ht.selectSession,clearActiveSession:ht.clearActiveSession,loadOlderMessages:ht.loadOlderMessages,loadWorkspaces:ht.loadWorkspaces,loadMoreSessions:ht.loadMoreSessions,loadAllSessions:ht.loadAllSessions,selectWorkspace:ht.selectWorkspace,openWorkspace:ht.openWorkspace,openWorkspaceDraft:ht.openWorkspaceDraft,startSessionAndSendPrompt:ht.startSessionAndSendPrompt,startSessionAndActivateSkill:ht.startSessionAndActivateSkill,startSessionAndOpenSideChat:ht.startSessionAndOpenSideChat,addWorkspaceByPath:ht.addWorkspaceByPath,browseFs:ht.browseFs,getFsHome:ht.getFsHome,sendPrompt:ht.sendPrompt,steerPrompt:ht.steerPrompt,sideChatVisible:Hs.sideChatVisible,sideChatSessionId:Hs.sideChatSessionId,sideChatTurns:Hs.sideChatTurns,sideChatRunning:Hs.sideChatRunning,sideChatSending:Hs.sideChatSending,openSideChat:Hs.openSideChat,closeSideChat:Hs.closeSideChat,sendSideChatPrompt:Hs.sendSideChatPrompt,uploadImage:ht.uploadImage,abortCurrentPrompt:ht.abortCurrentPrompt,respondApproval:ht.respondApproval,respondQuestion:ht.respondQuestion,dismissQuestion:ht.dismissQuestion,pendingQuestionActions:ht.pendingQuestionActions,pendingApprovalActions:ht.pendingApprovalActions,cancelTask:ht.cancelTask,setPermission:ht.setPermission,setThinking:Cn.setThinking,setPlanMode:ht.setPlanMode,togglePlanMode:ht.togglePlanMode,setSwarmMode:ht.setSwarmMode,toggleSwarmMode:ht.toggleSwarmMode,setGoalMode:ht.setGoalMode,toggleGoalMode:ht.toggleGoalMode,createGoal:ht.createGoal,controlGoal:ht.controlGoal,enqueue:ht.enqueue,dismissWarning:ht.dismissWarning,renameSession:ht.renameSession,renameWorkspace:ht.renameWorkspace,deleteWorkspace:ht.deleteWorkspace,reorderWorkspaces:A1e,setWorkspaceSortMode:M1e,archiveSession:ht.archiveSession,restoreSession:ht.restoreSession,loadArchivedSessions:ht.loadArchivedSessions,compact:ht.compact,forkSession:ht.forkSession,undo:ht.undo,unqueue:ht.unqueue,reorderQueue:ht.reorderQueue,searchFiles:ht.searchFiles,loadGitStatus:ht.loadGitStatus,loadFileDiff:ht.loadFileDiff,clearFileDiff:ht.clearFileDiff,listDir:ht.listDir,readFileContent:ht.readFileContent,getFileDownloadUrl:ht.getFileDownloadUrl,openWorkspaceFile:ht.openWorkspaceFile,openInApp:ht.openInApp,revealWorkspaceFile:ht.revealWorkspaceFile,resolveImageUrl:ht.resolveImageUrl,refreshOAuthProviderModels:Cn.refreshOAuthProviderModels,loadModels:Cn.loadModels,loadProviders:Cn.loadProviders,skills:Wme,activateSkill:Cn.activateSkill,setModel:Cn.setModel,toggleStarModel:Cn.toggleStarModel,addProvider:Cn.addProvider,deleteProvider:Cn.deleteProvider,refreshProvider:Cn.refreshProvider,refreshAllProviders:Cn.refreshAllProviders,authReady:y1e,defaultModel:k1e,managedProviderStatus:b1e,config:x1e,updateConfig:ht.updateConfig,checkAuth:ht.checkAuth,startOAuthLogin:Cn.startOAuthLogin,pollOAuthLogin:Cn.pollOAuthLogin,cancelOAuthLogin:Cn.cancelOAuthLogin,logout:ht.logout}}const DM=qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=Et(),n=q3.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&V3(o)}return(o,i)=>(b(),ye(to,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),R1e=["aria-checked","aria-label","disabled"],B1e=qe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),I("button",{class:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[w("span",{class:"ui-switch__thumb"},null,-1)])],10,R1e))}}),er=ut(B1e,[["__scopeId","data-v-dbe22dc4"]]),D1e=["aria-label"],P1e=["aria-selected","onClick"],H1e={class:"body"},W1e={class:"panel"},z1e={class:"sec"},U1e={class:"sec-title"},j1e={class:"row"},q1e={class:"rlabel"},V1e={class:"row"},K1e={class:"rlabel"},G1e={class:"row"},Y1e={class:"rlabel"},Z1e={class:"num-field"},Q1e=["value","aria-label"],X1e={class:"row"},J1e={class:"rlabel"},e0e={class:"row"},t0e={class:"rlabel"},n0e={class:"hint"},s0e={class:"sec"},o0e={class:"sec-title"},i0e={class:"row"},r0e={class:"rlabel"},l0e={key:0,class:"hint"},a0e={class:"row"},c0e={class:"rlabel"},u0e={key:0,class:"hint"},d0e={class:"row"},f0e={class:"rlabel"},h0e={key:0,class:"hint"},p0e={class:"row"},m0e={class:"rlabel"},g0e={class:"panel"},v0e={class:"sec"},y0e={class:"sec-title"},k0e={class:"row"},b0e={class:"rlabel"},x0e={key:0,class:"rvalue"},_0e={class:"actions"},w0e={class:"panel"},S0e={class:"sec"},C0e={class:"sec-head"},A0e={class:"sec-title"},M0e={key:0,class:"saving"},E0e={class:"row"},T0e={class:"rlabel"},N0e={class:"hint"},I0e={key:0,class:"select-wrap"},$0e={key:0,value:"",disabled:""},L0e=["label"],F0e=["value"],O0e={key:1,class:"rvalue mono"},R0e={class:"row"},B0e={class:"rlabel"},D0e={class:"hint"},P0e={class:"row"},H0e={class:"rlabel"},W0e={class:"hint"},z0e={class:"row"},U0e={class:"rlabel"},j0e={class:"hint"},q0e={class:"row"},V0e={class:"rlabel"},K0e={class:"hint"},G0e={key:1,class:"empty-config"},Y0e={class:"panel"},Z0e={class:"sec"},Q0e={class:"sec-title"},X0e={class:"row"},J0e={class:"rlabel"},ege={class:"rvalue mono"},tge={class:"row"},nge={class:"rlabel"},sge={class:"rvalue mono"},oge={key:0,class:"row"},ige={class:"rlabel"},rge={class:"hint"},lge={class:"hint"},age={class:"row"},cge={class:"rlabel"},uge={key:0,class:"hint"},dge={class:"panel"},fge={class:"panel-head"},hge={class:"panel-title"},pge={class:"panel-desc"},mge={class:"archive-toolbar"},gge={class:"archive-search"},vge=["placeholder"],yge={value:"all"},kge=["value"],bge={key:0,class:"archive-empty"},xge={key:0,class:"archive-list"},_ge={class:"archive-workspace"},wge={class:"path"},Sge={class:"count"},Cge={class:"setting-card"},Age={class:"archive-meta"},Mge={class:"archive-name"},Ege={class:"archive-time"},Tge={key:1,class:"archive-empty"},Nge=100,Ige=qe({__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:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q("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=PN(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=Q(null);ik(u);function d(te){te.key==="Escape"&&o("close")}ln(()=>document.addEventListener("keydown",d)),fn(()=>document.removeEventListener("keydown",d));function f(){D5()}const p=P(()=>{const te=new Map;for(const Z of s.models??[])te.set(Z.id,{id:Z.id,label:Z.displayName??Z.model??Z.id,provider:Z.provider});for(const[Z,ne]of Object.entries(s.config?.models??{})){if(te.has(Z))continue;const ke=_(ne);te.set(Z,{id:Z,label:k(Z,ne,ke),provider:ke??Z})}return Array.from(te.values())}),h=P(()=>{const te=new Map;for(const Z of p.value){const ne=te.get(Z.provider)??[];ne.push(Z),te.set(Z.provider,ne)}for(const Z of te.values())Z.sort((ne,ke)=>ne.label.localeCompare(ke.label));return Array.from(te.entries()).toSorted(([Z],[ne])=>Z.localeCompare(ne)).map(([Z,ne])=>({provider:Z,options:ne}))}),m=P(()=>{const te=s.config?.defaultPermissionMode;return te==="auto"||te==="yolo"||te==="manual"?te:"manual"});function _(te){if(!te||typeof te!="object")return;const Z=te;return typeof Z.provider=="string"?Z.provider:void 0}function k(te,Z,ne){if(!Z||typeof Z!="object")return te;const ke=Z,Se=typeof ke.model=="string"?ke.model:void 0,Ye=ne??_(Z);return Se&&Ye?`${te} (${Ye}/${Se})`:Se?`${te} (${Se})`:te}function g(te){return te===!0}function v(te){!te||te===s.config?.defaultModel||o("updateConfig",{defaultModel:te})}function y(te){te!==m.value&&o("updateConfig",{defaultPermissionMode:te})}function A(te){const Z=s.config?.[te];o("updateConfig",{[te]:!g(Z)})}function L(){const te=s.config?.thinking;return!te||typeof te!="object"?!0:te.enabled!==!1}function $(){o("updateConfig",{thinking:{enabled:!L()}})}function x(){const te=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!te})}function E(te){i.value=te}const N=Ek(),F=Q([]),S=Q(!1),T=Q(!1),R=Q(""),O=Q("all"),D=Q("archived-desc");async function W(){if(!(S.value||T.value)){S.value=!0;try{const te=[];let Z;for(;;){const ne=await N.loadArchivedSessions({beforeId:Z,pageSize:Nge});if(te.push(...ne.items),!ne.hasMore||ne.items.length===0)break;const ke=ne.items.at(-1)?.id;if(ke===void 0)break;Z=ke}F.value=te,T.value=!0}catch(te){console.warn("loadAllArchived failed",te)}finally{S.value=!1}}}Ke(i,te=>{te==="archived"&&!T.value&&W()});const z=P(()=>{const te=new Set;for(const Z of F.value)te.add(Z.cwd);return Array.from(te).sort((Z,ne)=>Z.localeCompare(ne))}),V=P(()=>{const te=R.value.trim().toLowerCase();let Z=F.value.filter(ne=>ne.archived===!0);return O.value!=="all"&&(Z=Z.filter(ne=>ne.cwd===O.value)),te&&(Z=Z.filter(ne=>ne.title.toLowerCase().includes(te))),Z=Z.slice(),D.value==="archived-desc"?Z.sort((ne,ke)=>ke.updatedAt.localeCompare(ne.updatedAt)):D.value==="created-desc"?Z.sort((ne,ke)=>ke.createdAt.localeCompare(ne.createdAt)):Z.sort((ne,ke)=>ne.title.localeCompare(ke.title,"zh")),Z}),U=P(()=>{const te=new Map;for(const Z of V.value){const ne=te.get(Z.cwd)??[];ne.push(Z),te.set(Z.cwd,ne)}return Array.from(te.entries()).map(([Z,ne])=>({cwd:Z,items:ne}))});async function re(te){await N.restoreSession(te)&&(F.value=F.value.filter(ne=>ne.id!==te))}function ae(te){const Z=new Date(te);if(Number.isNaN(Z.getTime()))return te;const ne=ke=>String(ke).padStart(2,"0");return`${Z.getFullYear()}-${ne(Z.getMonth()+1)}-${ne(Z.getDate())} ${ne(Z.getHours())}:${ne(Z.getMinutes())}`}return(te,Z)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:Z[19]||(Z[19]=ne=>o("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:u,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(b(),I(Be,null,nt(r,ne=>w("button",{key:ne.id,type:"button",class:De(["tab",{on:i.value===ne.id}]),role:"tab","aria-selected":i.value===ne.id,onClick:ke=>E(ne.id)},B(C(n)(ne.labelKey)),11,P1e)),64))],8,D1e),w("div",H1e,[Tn(w("section",W1e,[w("section",z1e,[w("h3",U1e,B(C(n)("settings.appearance")),1),w("div",j1e,[w("span",q1e,B(C(n)("theme.colorSchemeLabel")),1),ie(to,{"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":Z[0]||(Z[0]=ne=>o("setColorScheme",ne))},null,8,["model-value","options"])]),w("div",V1e,[w("span",K1e,B(C(n)("theme.accentLabel")),1),ie(to,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":Z[1]||(Z[1]=ne=>o("setAccent",ne))},null,8,["model-value","options"])]),w("div",G1e,[w("span",Y1e,B(C(n)("settings.uiFontSize")),1),w("label",Z1e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:Z[2]||(Z[2]=ne=>o("setUiFontSize",Number(ne.target.value)))},null,40,Q1e),Z[20]||(Z[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",X1e,[w("span",J1e,B(C(n)("sidebar.language")),1),ie(DM)]),w("div",e0e,[w("span",t0e,[Ge(B(C(n)("settings.conversationToc"))+" ",1),w("span",n0e,B(C(n)("settings.conversationTocHint")),1)]),ie(er,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":Z[3]||(Z[3]=ne=>o("setConversationToc",ne))},null,8,["model-value","label"])])]),w("section",s0e,[w("h3",o0e,B(C(n)("settings.notifications")),1),w("div",i0e,[w("span",r0e,[Ge(B(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",l0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Z[4]||(Z[4]=ne=>o("setNotify",ne))},null,8,["model-value","disabled","label"])]),w("div",a0e,[w("span",c0e,[Ge(B(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",u0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Z[5]||(Z[5]=ne=>o("setNotifyQuestion",ne))},null,8,["model-value","disabled","label"])]),w("div",d0e,[w("span",f0e,[Ge(B(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",h0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Z[6]||(Z[6]=ne=>o("setNotifyApproval",ne))},null,8,["model-value","disabled","label"])]),w("div",p0e,[w("span",m0e,B(C(n)("settings.soundOnComplete")),1),ie(er,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":Z[7]||(Z[7]=ne=>o("setSound",ne))},null,8,["model-value","label"])])])],512),[[oi,i.value==="general"]]),Tn(w("section",g0e,[w("section",v0e,[w("h3",y0e,B(C(n)("settings.account")),1),w("div",k0e,[w("span",b0e,B(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(jt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(b(),I("span",x0e,B(e.accountModel),1)):le("",!0)]),_:1},8,["text"])]),w("div",_0e,[ie(Ft,{variant:"secondary",size:"sm",onClick:Z[8]||(Z[8]=ne=>{o("openOnboarding"),o("close")})},{default:Ee(()=>[Ge(B(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(b(),ye(Ft,{key:0,variant:"danger-soft",size:"sm",onClick:Z[9]||(Z[9]=ne=>o("logout"))},{default:Ee(()=>[Ge(B(C(n)("sidebar.signOut")),1)]),_:1})):(b(),ye(Ft,{key:1,variant:"primary",size:"sm",onClick:Z[10]||(Z[10]=ne=>o("login"))},{default:Ee(()=>[Ge(B(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[oi,i.value==="account"]]),Tn(w("section",w0e,[w("section",S0e,[w("div",C0e,[w("h3",A0e,B(C(n)("settings.agentDefaults")),1),e.configSaving?(b(),I("span",M0e,B(C(n)("settings.saving")),1)):le("",!0)]),e.config?(b(),I(Be,{key:0},[w("div",E0e,[w("span",T0e,[Ge(B(C(n)("settings.defaultModel"))+" ",1),w("span",N0e,B(C(n)("settings.defaultModelHint")),1)]),h.value.length>0?(b(),I("div",I0e,[ie(gv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:Ee(()=>[e.config.defaultModel?le("",!0):(b(),I("option",$0e,B(C(n)("settings.noDefaultModel")),1)),(b(!0),I(Be,null,nt(h.value,ne=>(b(),I("optgroup",{key:ne.provider,label:ne.provider},[(b(!0),I(Be,null,nt(ne.options,ke=>(b(),I("option",{key:ke.id,value:ke.id},B(ke.label),9,F0e))),128))],8,L0e))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(b(),I("span",O0e,B(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",R0e,[w("span",B0e,[Ge(B(C(n)("settings.defaultPermission"))+" ",1),w("span",D0e,B(C(n)("settings.defaultPermissionHint")),1)]),ie(to,{"model-value":m.value,options:a.map(ne=>({value:ne,label:C(n)(c[ne])})),"onUpdate:modelValue":Z[11]||(Z[11]=ne=>y(ne))},null,8,["model-value","options"])]),w("div",P0e,[w("span",H0e,[Ge(B(C(n)("settings.defaultThinking"))+" ",1),w("span",W0e,B(C(n)("settings.defaultThinkingHint")),1)]),ie(er,{"model-value":L(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":Z[12]||(Z[12]=ne=>$())},null,8,["model-value","disabled","label"])]),w("div",z0e,[w("span",U0e,[Ge(B(C(n)("settings.defaultPlanMode"))+" ",1),w("span",j0e,B(C(n)("settings.defaultPlanModeHint")),1)]),ie(er,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Z[13]||(Z[13]=ne=>A("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",q0e,[w("span",V0e,[Ge(B(C(n)("settings.mergeSkills"))+" ",1),w("span",K0e,B(C(n)("settings.mergeSkillsHint")),1)]),ie(er,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":Z[14]||(Z[14]=ne=>A("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(b(),I("div",G0e,B(C(n)("settings.configUnavailable")),1))])],512),[[oi,i.value==="agent"]]),Tn(w("section",Y0e,[w("section",Z0e,[w("h3",Q0e,B(C(n)("settings.advanced")),1),w("div",X0e,[w("span",J0e,B(C(n)("sidebar.daemon")),1),w("span",ege,B(C(l)),1)]),w("div",tge,[w("span",nge,B(C(n)("settings.serverVersion")),1),w("span",sge,B(e.serverVersion||"-"),1)]),e.config?(b(),I("div",oge,[w("span",ige,[Ge(B(C(n)("settings.telemetry"))+" ",1),w("span",rge,B(C(n)("settings.telemetryHint")),1),w("span",lge,B(C(n)("settings.telemetryRestartHint")),1)]),ie(er,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":Z[15]||(Z[15]=ne=>x())},null,8,["model-value","disabled","label"])])):le("",!0),w("div",age,[w("span",cge,[Ge(B(C(n)("settings.exportLog"))+" ",1),C(Ai)()?le("",!0):(b(),I("span",uge,B(C(n)("settings.logHint")),1))]),ie(Ft,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ge(B(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[oi,i.value==="advanced"]]),Tn(w("section",dge,[w("div",fge,[Z[21]||(Z[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",hge,B(C(n)("settings.archivedTitle")),1),w("p",pge,B(C(n)("settings.archivedDesc")),1)]),w("div",mge,[w("label",gge,[Z[22]||(Z[22]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("circle",{cx:"11",cy:"11",r:"7"}),w("path",{d:"m21 21-4.3-4.3"})],-1)),Tn(w("input",{"onUpdate:modelValue":Z[16]||(Z[16]=ne=>R.value=ne),placeholder:C(n)("settings.archivedSearch")},null,8,vge),[[ao,R.value]])]),ie(gv,{"model-value":O.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Z[17]||(Z[17]=ne=>O.value=ne)},{default:Ee(()=>[w("option",yge,B(C(n)("settings.archivedAllWorkspaces")),1),(b(!0),I(Be,null,nt(z.value,ne=>(b(),I("option",{key:ne,value:ne},B(ne),9,kge))),128))]),_:1},8,["model-value","aria-label"]),ie(to,{size:"sm","model-value":D.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":Z[18]||(Z[18]=ne=>D.value=ne)},null,8,["model-value","options"])]),S.value?(b(),I("div",bge,B(C(n)("settings.archivedLoadingAll")),1)):(b(),I(Be,{key:1},[U.value.length>0?(b(),I("div",xge,[(b(!0),I(Be,null,nt(U.value,ne=>(b(),I("section",{key:ne.cwd,class:"archive-card"},[w("div",_ge,[Z[23]||(Z[23]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("path",{d:"M3 7h6l2 2h10v9H3z"}),w("path",{d:"M3 7V5h6l2 2"})],-1)),w("span",wge,B(ne.cwd),1),w("span",Sge,B(C(n)("settings.archivedSessionsCount",{count:ne.items.length})),1)]),w("div",Cge,[(b(!0),I(Be,null,nt(ne.items,ke=>(b(),I("div",{key:ke.id,class:"archive-row"},[w("div",Age,[w("div",Mge,B(ke.title),1),w("div",Ege,B(C(n)("settings.archivedAt",{time:ae(ke.updatedAt)})),1)]),ie(Ft,{variant:"secondary",size:"sm",onClick:Se=>re(ke.id)},{default:Ee(()=>[Ge(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(b(),I("div",Tge,B(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[oi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),$ge=ut(Ige,[["__scopeId","data-v-0c2e1aca"]]),Lge={class:"aw"},Fge={class:"crumbbar"},Oge={class:"crumbs"},Rge={key:0,class:"crumb-sep"},Bge=["onClick"],Dge={key:0,class:"filterbar"},Pge=["placeholder"],Hge={class:"folder-list"},Wge={key:0,class:"fl-loading"},zge=["onClick"],Uge={class:"folder-name search-rel"},jge={key:0,class:"git-branch"},qge={key:0,class:"fl-empty"},Vge={key:1,class:"fl-loading"},Kge=["onClick"],Gge={class:"folder-name"},Yge={key:0,class:"git-branch"},Zge={key:0,class:"fl-empty"},Qge={class:"paste-row"},Xge={class:"paste-input-wrap"},Jge={key:1,class:"add-error",role:"alert"},eve={class:"actions"},tve={class:"footer-hint"},nve=600,sve=6,wC=150,ove=qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=Q(!1),l=Q(!1),a=Q(""),c=Q(null),u=Q([]),d=Q(""),f=Q(!1),p=Q([]),h=P(()=>d.value.trim().length>0);let m=0,_=null;function k(T,R){const O=T.toLowerCase(),D=R.toLowerCase();let W=0;for(let z=0;z<D.length&&W<O.length;z++)D[z]===O[W]&&W++;return W===O.length}async function g(T){const R=a.value,O=T.trim();if(!R||O===""){p.value=[],f.value=!1;return}const D=++m;f.value=!0;const W=[],z=[{path:R,depth:0}];let V=0;for(;z.length>0&&V<nve&&W.length<wC;){if(D!==m)return;const U=z.shift();V++;let re;try{re=await s.browseFs(U.path)}catch{continue}if(D!==m)return;for(const ae of re.entries){if(!ae.isDir)continue;const te=ae.path.startsWith(R)?ae.path.slice(R.length).replace(/^\/+/,""):ae.path;if(k(O,te||ae.name)&&(W.push({path:ae.path,name:ae.name,rel:te||ae.name,isGitRepo:ae.isGitRepo,branch:ae.branch}),W.length>=wC))break;U.depth+1<sve&&z.push({path:ae.path,depth:U.depth+1})}D===m&&(p.value=[...W])}D===m&&(f.value=!1)}Ke(d,T=>{if(_&&clearTimeout(_),T.trim()===""){m++,p.value=[],f.value=!1;return}_=setTimeout(()=>void g(T),220)});const v=Q(!1),y=Q(""),A=P(()=>y.value.trim()),L=P(()=>{const T=a.value;if(!T)return[];const R=T.split("/").filter(Boolean),O=[{label:"/",path:"/"}];let D="";for(const W of R)D+=`/${W}`,O.push({label:W,path:D});return O}),$=P(()=>a.value.length>0);async function x(T){r.value=!0;try{const R=await s.browseFs(T);if(!R.path){l.value=!0;return}a.value=R.path,c.value=R.parent,u.value=R.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function E(T){T.isDir&&x(T.path)}function N(){c.value&&x(c.value)}function F(){$.value&&o("add",a.value)}function S(){A.value.length!==0&&o("add",A.value)}return ln(async()=>{r.value=!0;try{if(s.defaultPath&&(await x(s.defaultPath),!l.value))return;const T=await s.getFsHome();T.home?await x(T.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),fn(()=>{_&&clearTimeout(_)}),(T,R)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":R[5]||(R[5]=O=>i.value=O),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:R[6]||(R[6]=O=>o("close"))},{default:Ee(()=>[w("div",Lge,[l.value?le("",!0):(b(),I(Be,{key:0},[w("div",Fge,[ie(Nn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:N},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",Oge,[(b(!0),I(Be,null,nt(L.value,(O,D)=>(b(),I(Be,{key:O.path},[D>1?(b(),I("span",Rge,"/")):le("",!0),w("button",{class:De(["crumb",{last:D===L.value.length-1}]),onClick:W=>x(O.path)},B(O.label),11,Bge)],64))),128))])]),r.value?le("",!0):(b(),I("div",Dge,[ie(Ve,{class:"filter-icon",name:"search",size:"md"}),Tn(w("input",{"onUpdate:modelValue":R[0]||(R[0]=O=>d.value=O),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[1]||(R[1]=bt(()=>{},["stop"]))},null,40,Pge),[[ao,d.value]]),f.value?(b(),ye(wo,{key:0,size:"sm"})):le("",!0)])),w("div",Hge,[r.value?(b(),I("div",Wge,B(C(n)("workspace.browsing")),1)):h.value?(b(),I(Be,{key:1},[(b(!0),I(Be,null,nt(p.value,O=>(b(),I("button",{key:O.path,class:"folder-row",onClick:D=>x(O.path)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Uge,B(O.rel),1),O.isGitRepo?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(n)("workspace.gitTag")),1),O.branch?(b(),I("span",jge,B(O.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,zge))),128)),!f.value&&p.value.length===0?(b(),I("div",qge,B(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&p.value.length===0?(b(),I("div",Vge,B(C(n)("workspace.searching")),1)):le("",!0)],64)):(b(),I(Be,{key:2},[(b(!0),I(Be,null,nt(u.value,O=>(b(),I("button",{key:O.path,class:"folder-row",onClick:D=>E(O)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Gge,B(O.name),1),O.isGitRepo?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(n)("workspace.gitTag")),1),O.branch?(b(),I("span",Yge,B(O.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,Kge))),128)),u.value.length===0?(b(),I("div",Zge,B(C(n)("workspace.noSubfolders")),1)):le("",!0)],64))])],64)),w("div",{class:De(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(b(),ye(Ft,{key:0,variant:"ghost",size:"sm",onClick:R[2]||(R[2]=O=>v.value=!0)},{default:Ee(()=>[Ge(B(C(n)("workspace.pasteToggle")),1)]),_:1})):(b(),ye(xu,{key:1,label:C(n)("workspace.pathLabel")},{default:Ee(()=>[w("div",Qge,[w("div",Xge,[ie(sa,{modelValue:y.value,"onUpdate:modelValue":R[3]||(R[3]=O=>y.value=O),placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:bi(bt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),ie(Nn,{disabled:A.value.length===0,label:C(n)("workspace.add"),onClick:S},{default:Ee(()=>[ie(Ve,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(b(),I("div",Jge,B(e.error),1)):le("",!0),w("div",eve,[ie(jt,{text:a.value},{default:Ee(()=>[l.value?le("",!0):(b(),ye(Ft,{key:0,variant:"primary",disabled:!$.value,onClick:F},{default:Ee(()=>[Ge(B(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Ft,{variant:"secondary",onClick:R[4]||(R[4]=O=>o("close"))},{default:Ee(()=>[Ge(B(C(n)("workspace.cancel")),1)]),_:1})]),w("div",tve,B(C(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),ive=ut(ove,[["__scopeId","data-v-ad529757"]]),rve={key:0,class:"confirm-dialog__message"},lve=qe({__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=Q(null);function s(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const o=e,i=t,{t:r}=Et();function l(){i("update:open",!1),i("cancel")}function a(c){if(c.key!=="Enter"||!o.open||o.loading)return;const u=c.target;u instanceof HTMLButtonElement||u instanceof HTMLAnchorElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement||u instanceof HTMLInputElement||(c.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",a),es(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(b(),ye(Sr,{open:e.open,title:e.title,height:"auto","initial-focus":s,"onUpdate:open":u[1]||(u[1]=d=>i("update:open",d)),onClose:l},{foot:Ee(()=>[ie(Ft,{variant:"secondary",disabled:e.loading,onClick:l},{default:Ee(()=>[Ge(B(e.cancelLabel??C(r)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Ft,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:Ee(()=>[Ge(B(e.confirmLabel??C(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(b(),I("p",rve,B(e.message),1)):le("",!0)]),_:1},8,["open","title"]))}}),ave=ut(lve,[["__scopeId","data-v-76e206e7"]]),cve=qe({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=kl();return(s,o)=>(b(),ye(ave,{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,onConfirm:o[0]||(o[0]=i=>C(n)(!0)),onCancel:o[1]||(o[1]=i=>C(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),uve={class:"rows"},dve={class:"row"},fve={class:"row"},hve={class:"row"},pve={class:"row"},mve={class:"row"},gve={class:"row"},vve={class:"ctx-text"},yve={key:0,class:"bar"},kve={class:"row"},bve=qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=P(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=P(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const c=P(()=>{const h=s.status.permission;return h==="yolo"?"var(--color-danger)":h==="auto"?"var(--color-warning)":"var(--color-text)"}),u=P(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=P(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=P(()=>typeof s.costUsd=="number"&&s.costUsd>0),p=P(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(h,m)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":m[0]||(m[0]=_=>i.value=_),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=_=>o("close"))},{default:Ee(()=>[w("dl",uve,[w("div",dve,[w("dt",null,B(C(n)("status.statusModel")),1),w("dd",null,B(e.status.model),1)]),w("div",fve,[w("dt",null,B(C(n)("status.statusThinking")),1),w("dd",null,B(e.thinking),1)]),w("div",hve,[w("dt",null,B(C(n)("status.statusPermission")),1),w("dd",{style:qt({color:c.value})},B(a(e.status.permission)),5)]),w("div",pve,[w("dt",null,B(C(n)("status.statusPlanMode")),1),w("dd",{class:De({"plan-on":e.planMode})},B(u.value),3)]),w("div",mve,[w("dt",null,B(C(n)("status.statusSwarmMode")),1),w("dd",{class:De({"swarm-on":e.swarmMode})},B(d.value),3)]),w("div",gve,[w("dt",null,B(C(n)("status.statusContext")),1),w("dd",null,[w("span",vve,B(l.value),1),e.status.ctxMax>0?(b(),I("span",yve,[w("i",{style:qt({width:r.value+"%"})},null,4)])):le("",!0)])]),w("div",kve,[w("dt",null,B(C(n)("status.statusCost")),1),w("dd",null,B(p.value),1)])])]),_:1},8,["open","title"]))}}),xve=ut(bve,[["__scopeId","data-v-59dd31f3"]]),_ve={class:"ui-toast__icon","aria-hidden":"true"},wve={class:"ui-toast__body"},Sve={class:"ui-toast__title"},Cve={key:0,class:"ui-toast__msg"},Ave=qe({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[w("span",_ve,[In(t.$slots,"icon",{},()=>[e.variant==="success"?(b(),ye(Ve,{key:0,name:"check"})):e.variant==="danger"?(b(),ye(Ve,{key:1,name:"close"})):e.variant==="warning"?(b(),ye(Ve,{key:2,name:"alert-triangle"})):(b(),ye(Ve,{key:3,name:"info"}))],!0)]),w("div",wve,[w("div",Sve,B(e.title),1),e.message?(b(),I("div",Cve,B(e.message),1)):le("",!0),In(t.$slots,"default",{},void 0,!0)]),ie(Nn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Mve=ut(Ave,[["__scopeId","data-v-adc6f346"]]),Eve={key:0,class:"actions"},Tve=["onClick"],Nve=["onClick"],Ive={key:1,class:"details"},$ve=qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et();function i(x){return typeof x=="object"&&x!==null}function r(x){return i(x)?x.title:x}function l(x){return i(x)?x.message??"":""}function a(x){return i(x)?x.details:void 0}function c(x){return i(x)?x.severity==="error":x.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function u(x){return i(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function d(x){if(!i(x))return x;const E=[x.title];x.message&&E.push(x.message);const N=x.details??[];if(N.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const F of N)E.push(`${F.label}: ${F.value}`)}return E.join(`
|
|
322
|
+
`)}let f=1;const p=Q([]),h=new Map,m=new Map;function _(x){const E=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function k(x,E){const N=h.get(x)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(x),E),N.deadline=Date.now()+E,h.set(x,N)}function g(x){const E=h.get(x);E&&E.handle!==null&&clearTimeout(E.handle),h.delete(x)}function v(x){const E=h.get(x);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function y(x){if(p.value.find(F=>F.id===x)?.detailsOpen)return;const N=h.get(x);!N||N.handle!==null||k(x,N.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?v(x.id):y(x.id)}async function L(x){if(!await js(d(x.warning)))return;x.copied=!0;const N=m.get(x.id);N&&clearTimeout(N),m.set(x.id,setTimeout(()=>{x.copied=!1,m.delete(x.id)},1400))}function $(x){g(x);const E=m.get(x);E&&clearTimeout(E),m.delete(x);const N=p.value.findIndex(F=>F.id===x);N!==-1&&(p.value=p.value.filter(F=>F.id!==x),s("dismiss",N))}return Ke(()=>n.warnings,x=>{const E=[...p.value];p.value=x.map(N=>{const F=u(N),S=E.findIndex(O=>O.key===F),T=S===-1?void 0:E.splice(S,1)[0];if(T)return T.warning=N,T;const R={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return k(R.id,_(N)),R});for(const N of E){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),fn(()=>{h.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),h.clear(),m.forEach(x=>clearTimeout(x)),m.clear()}),(x,E)=>(b(),ye(f9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(b(!0),I(Be,null,nt(p.value,N=>(b(),ye(Mve,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:F=>$(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>y(N.id)},{default:Ee(()=>[a(N.warning)?.length?(b(),I("div",Eve,[w("button",{class:"link",type:"button",onClick:F=>A(N)},B(N.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,Tve),w("button",{class:"link",type:"button",onClick:F=>L(N)},B(N.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,Nve)])):le("",!0),N.detailsOpen&&a(N.warning)?.length?(b(),I("dl",Ive,[(b(!0),I(Be,null,nt(a(N.warning),F=>(b(),I("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[w("dt",null,B(F.label),1),w("dd",null,B(F.value),1)]))),128))])):le("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Lve=ut($ve,[["__scopeId","data-v-92efeff8"]]),Fve={class:"topbar"},Ove={class:"wsq"},Rve=["aria-label"],Bve={class:"tb-path"},Dve={class:"ws"},Pve={class:"se"},Hve={class:"tb-sub"},Wve=qe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=P(()=>s.workspace?.name??n("workspace.noWorkspace")),l=P(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(b(),I("div",Fve,[w("span",Ove,B(i.value),1),w("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[w("span",Bve,[w("span",Dve,B(r.value),1),e.sessionTitle?(b(),I(Be,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",Pve,B(e.sessionTitle),1)],64)):le("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",Hve,[w("span",{class:De(["rd",{on:e.running}])},null,2),w("span",null,B(l.value),1),e.branch?(b(),I(Be,{key:0},[Ge(" · "+B(e.branch),1)],64)):le("",!0),e.sessionCount>0?(b(),I(Be,{key:1},[Ge(" · "+B(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):le("",!0)])],8,Rve),ie(Nn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Ee(()=>[ie(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),zve=ut(Wve,[["__scopeId","data-v-59a11935"]]),Uve={key:0,class:"sheet-root"},jve=["aria-label"],qve=["aria-label"],Vve={key:0,class:"sheet-head"},Kve={class:"sheet-title"},Gve={class:"sheet-body"},Yve=qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ke(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),fn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(b(),ye(cl,{name:"sheet"},{default:Ee(()=>[e.modelValue?(b(),I("div",Uve,[w("div",{class:"sheet-scrim",onClick:i}),w("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[w("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,qve),e.title?(b(),I("div",Vve,[w("span",Kve,B(e.title),1)])):le("",!0),w("div",Gve,[In(l.$slots,"default",{},void 0,!0)])],8,jve)])):le("",!0)]),_:3}))}}),PM=ut(Yve,[["__scopeId","data-v-4441dd70"]]),Zve={class:"mlist"},Qve={key:0,class:"mempty"},Xve=["onClick"],Jve={class:"mgh-main"},eye={class:"mgh-name"},tye={class:"mgh-path"},nye={key:2,class:"att"},sye={key:0,class:"mempty small"},oye=["onClick"],iye={class:"m"},rye={class:"s"},lye={key:0,class:"att"},aye=["disabled","onClick"],cye=["onClick"],uye=qe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=Q(new Set);function f(S){return d.value.has(S)}function p(S){const T=new Set(d.value);T.has(S)?T.delete(S):T.add(S),d.value=T,y.value=null,x.value=null}const h=Q(new Set);function m(S){return h.value.has(S)}function _(S){const T=new Set(h.value);T.has(S)?T.delete(S):T.add(S),h.value=T}function k(S){if(m(S.workspace.id))return S.sessions;const T=S.sessions.slice(0,S.initialCount);if(o.activeId&&!T.some(R=>R.id===o.activeId)){const R=S.sessions.find(O=>O.id===o.activeId);if(R)return[...T,R]}return T}function g(S){if(!h.value.has(S)){const T=new Set(h.value);T.add(S),h.value=T}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=Q(null);function A(S){y.value=y.value===S?null:S,x.value=null}function L(S){y.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();R&&i("rename",S.id,R)}async function $(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const x=Q(null);function E(S){x.value=x.value===S?null:S,y.value=null}function N(S){js(S.root),x.value=null}async function F(S){x.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,T)=>(b(),ye(PM,{"model-value":e.modelValue,"onUpdate:modelValue":T[2]||(T[2]=R=>i("update:modelValue",R))},{default:Ee(()=>[w("button",{type:"button",class:"newrow",onClick:c},[ie(Ve,{name:"message",size:"sm"}),Ge(" "+B(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:u},[ie(Ve,{name:"folder",size:"sm"}),Ge(" "+B(C(n)("sidebar.newWorkspace")),1)]),w("div",Zve,[e.groups.length===0?(b(),I("div",Qve,B(C(n)("workspace.noWorkspace")),1)):le("",!0),(b(!0),I(Be,null,nt(e.groups,R=>(b(),I("div",{key:R.workspace.id,class:"mgroup"},[w("div",{class:De(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:O=>p(R.workspace.id)},[f(R.workspace.id)?(b(),ye(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(b(),ye(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",Jve,[w("span",eye,B(R.workspace.name),1),ie(jt,{text:R.workspace.root},{default:Ee(()=>[w("span",tye,B(R.workspace.branch||R.workspace.shortPath),1)]),_:2},1032,["text"])]),f(R.workspace.id)&&v(R.workspace.id)>0?(b(),I("span",nye,B(v(R.workspace.id)),1)):le("",!0),ie(Nn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(O=>E(R.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Nn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(O=>a(R.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),x.value===R.workspace.id?(b(),ye(Jl,{key:3,class:"kmenu wsmenu",onClick:T[0]||(T[0]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{size:"lg",onClick:O=>N(R.workspace)},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(Mn,{size:"lg",danger:"",onClick:O=>F(R.workspace)},{default:Ee(()=>[Ge(B(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,Xve),Tn(w("div",null,[R.sessions.length===0?(b(),I("div",sye,B(C(n)("sidebar.noSessions")),1)):le("",!0),(b(!0),I(Be,null,nt(k(R),O=>(b(),I("div",{key:O.id,class:De(["srow",{cur:O.id===e.activeId}]),onClick:D=>l(O.id)},[w("div",iye,[w("div",{class:De(["t",{run:O.busy,aborted:O.status==="aborted"}])},B(O.title),3),w("div",rye,B(O.time),1)]),(e.attentionBySession[O.id]??0)>0?(b(),I("span",lye,B(e.attentionBySession[O.id]),1)):le("",!0),ie(Nn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(D=>A(O.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===O.id?(b(),ye(Jl,{key:1,class:"kmenu",onClick:T[1]||(T[1]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{size:"lg",onClick:D=>L(O)},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(Mn,{size:"lg",danger:"",onClick:D=>$(O.id)},{default:Ee(()=>[Ge(B(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,oye))),128)),R.hasMore||R.loadingMore?(b(),I("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:bt(O=>g(R.workspace.id),["stop"])},B(R.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,aye)):le("",!0),R.sessions.length>R.initialCount?(b(),I("button",{key:2,type:"button",class:"mshow-more",onClick:bt(O=>_(R.workspace.id),["stop"])},B(m(R.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,cye)):le("",!0)],512),[[oi,!f(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),dye=ut(uye,[["__scopeId","data-v-7ca5a6a0"]]),fye={class:"group-title"},hye={class:"srow-main"},pye={class:"srow-label"},mye={class:"srow-sub"},gye={class:"srow read-only"},vye={class:"srow-main"},yye={class:"srow-label"},kye={key:0,class:"srow-sub"},bye={class:"srow-main"},xye={class:"srow-label"},_ye={class:"srow-sub"},wye=["aria-checked"],Sye={class:"srow-main"},Cye={class:"srow-label"},Aye={class:"srow-sub"},Mye=["aria-checked"],Eye={class:"srow-main"},Tye={class:"srow-label"},Nye={class:"srow read-only"},Iye={class:"srow-main"},$ye={class:"srow-label"},Lye={class:"srow-sub"},Fye=["aria-label"],Oye={class:"group-title"},Rye={class:"srow-main"},Bye={class:"srow-label"},Dye={class:"srow-sub"},Pye={class:"srow read-only pref"},Hye={class:"srow-main"},Wye={class:"srow-label"},zye={class:"srow read-only pref"},Uye={class:"srow-main"},jye={class:"srow-label"},qye={class:"srow read-only pref"},Vye={class:"srow-main"},Kye={class:"srow-label"},Gye={class:"num-field"},Yye=["value","aria-label"],Zye={class:"srow-main"},Qye={class:"srow-label"},Xye={class:"srow-sub"},Jye=["aria-checked"],eke={class:"srow-main"},tke={class:"srow-label"},nke={class:"srow-main"},ske={class:"srow-label"},oke={key:2,class:"srow read-only"},ike={class:"srow-main"},rke={class:"srow-label"},lke={class:"srow-val dim"},ake={class:"arch-subhead"},cke={class:"arch-count"},uke={class:"arch-tools"},dke={key:0,class:"arch-empty"},fke={class:"arch-meta"},hke={class:"arch-name"},pke={class:"arch-time"},mke={key:2,class:"arch-empty"},gke=100,vke=qe({__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(),s=e,o=t;function i(ae){o("setColorScheme",ae)}const r=["manual","auto","yolo"],l=P(()=>{const ae=s.status?.modelId??s.status?.model??"";return s.models?.find(te=>te.id===ae||te.model===ae||te.displayName===s.status?.model)}),a=P(()=>Nd(l.value)),c=P(()=>nk(l.value)),u=P(()=>aa(l.value,s.thinking??"off")),d=P(()=>{const ae=c.value,te=u.value;return ae.includes(te)?te:ae.includes("on")?"on":ae[0]??"off"}),f=P(()=>c.value.map(ae=>({value:ae,label:mv(ae)}))),p=P(()=>s.planMode===!0),h=P(()=>s.swarmMode===!0),m=P(()=>{const ae=s.status.permission;return ae==="yolo"?"var(--color-danger)":ae==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),_=P(()=>{const ae=s.status.permission,te=n(ae==="yolo"?"mobile.permYoloSub":ae==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ae} · ${te}`}),k=ae=>`${Math.round(ae/1e3)}k`,g=P(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),v=P(()=>s.status.ctxMax>0?`${k(s.status.ctxUsed)}/${k(s.status.ctxMax)}`:n("status.statusNone"));function y(ae){o("setThinking",sk(l.value,ae))}function A(){const ae=r.indexOf(s.status.permission),te=r[(ae+1)%r.length];o("setPermission",te)}function L(){o("pickModel"),o("update:modelValue",!1)}function $(){o("login"),o("update:modelValue",!1)}function x(){o("logout"),o("update:modelValue",!1)}const E=Ek(),N=Q("main"),F=Q([]),S=Q(!1),T=Q(!1),R=Q(""),O=Q("archived-desc");async function D(){if(!S.value){S.value=!0,T.value=!1;try{const ae=[];let te;for(;;){const Z=await E.loadArchivedSessions({beforeId:te,pageSize:gke});if(ae.push(...Z.items),!Z.hasMore||Z.items.length===0)break;const ne=Z.items.at(-1)?.id;if(ne===void 0)break;te=ne}F.value=ae,T.value=!0}catch(ae){console.warn("loadAllArchived failed",ae)}finally{S.value=!1}}}function W(){N.value="archived",R.value="",D()}function z(){N.value="main"}const V=P(()=>{const ae=R.value.trim().toLowerCase();let te=F.value.filter(Z=>Z.archived===!0);return ae&&(te=te.filter(Z=>Z.title.toLowerCase().includes(ae))),te=te.slice(),O.value==="archived-desc"?te.sort((Z,ne)=>ne.updatedAt.localeCompare(Z.updatedAt)):O.value==="created-desc"?te.sort((Z,ne)=>ne.createdAt.localeCompare(Z.createdAt)):te.sort((Z,ne)=>Z.title.localeCompare(ne.title,"zh")),te});async function U(ae){await E.restoreSession(ae)&&(F.value=F.value.filter(Z=>Z.id!==ae))}function re(ae){const te=new Date(ae);if(Number.isNaN(te.getTime()))return ae;const Z=ne=>String(ne).padStart(2,"0");return`${te.getFullYear()}-${Z(te.getMonth()+1)}-${Z(te.getDate())} ${Z(te.getHours())}:${Z(te.getMinutes())}`}return Ke(()=>s.modelValue,ae=>{ae||(N.value="main")}),(ae,te)=>(b(),ye(PM,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":te[6]||(te[6]=Z=>o("update:modelValue",Z))},{default:Ee(()=>[N.value==="main"?(b(),I(Be,{key:0},[w("div",fye,B(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",hye,[w("span",pye,B(C(n)("status.statusModel")),1),w("span",mye,B(e.status.model),1)]),te[7]||(te[7]=w("span",{class:"chev"},"›",-1))]),w("div",gye,[w("span",vye,[w("span",yye,B(C(n)("status.statusThinking")),1),a.value==="unsupported"?(b(),I("span",kye,B(C(n)("status.modeNotSupported")),1)):le("",!0)]),c.value.length>1?(b(),ye(to,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(b(),I("span",{key:1,class:De(["srow-val",{dim:d.value==="off"}])},B(d.value==="off"?C(n)("status.planOff"):C(mv)(d.value)),3))]),w("button",{type:"button",class:"srow",onClick:te[0]||(te[0]=Z=>o("togglePlan"))},[w("span",bye,[w("span",xye,B(C(n)("status.statusPlanMode")),1),w("span",_ye,B(C(n)("mobile.planModeSub")),1)]),w("span",{class:De(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,wye)]),w("button",{type:"button",class:"srow",onClick:te[1]||(te[1]=Z=>o("toggleSwarm"))},[w("span",Sye,[w("span",Cye,B(C(n)("status.statusSwarmMode")),1),w("span",Aye,B(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:De(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,Mye)]),w("button",{type:"button",class:"srow",onClick:A},[w("span",Eye,[w("span",Tye,B(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:qt({color:m.value})},B(_.value),5)]),te[8]||(te[8]=w("span",{class:"chev"},"›",-1))]),w("div",Nye,[w("span",Iye,[w("span",$ye,B(C(n)("status.statusContext")),1),w("span",Lye,B(v.value),1)]),w("span",{class:"ctx-meter","aria-label":v.value},[w("i",{style:qt({width:g.value+"%"})},null,4)],8,Fye)]),w("div",Oye,B(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:W},[w("span",Rye,[w("span",Bye,B(C(n)("mobile.archivedSessions")),1),w("span",Dye,B(C(n)("mobile.archivedSessionsSub")),1)]),te[9]||(te[9]=w("span",{class:"chev"},"›",-1))]),w("div",Pye,[w("span",Hye,[w("span",Wye,B(C(n)("theme.colorSchemeLabel")),1)]),ie(to,{"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"])]),w("div",zye,[w("span",Uye,[w("span",jye,B(C(n)("sidebar.language")),1)]),ie(DM)]),w("div",qye,[w("span",Vye,[w("span",Kye,B(C(n)("settings.uiFontSize")),1)]),w("label",Gye,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:te[2]||(te[2]=Z=>o("setUiFontSize",Number(Z.target.value)))},null,40,Yye),te[10]||(te[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:te[3]||(te[3]=Z=>o("setConversationToc",!e.conversationToc))},[w("span",Zye,[w("span",Qye,B(C(n)("settings.conversationToc")),1),w("span",Xye,B(C(n)("settings.conversationTocHint")),1)]),w("span",{class:De(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Jye)]),e.authReady?(b(),I("button",{key:0,type:"button",class:"srow acct out",onClick:x},[w("span",eke,[w("span",tke,B(C(n)("sidebar.signOut")),1)])])):(b(),I("button",{key:1,type:"button",class:"srow acct in",onClick:$},[w("span",nke,[w("span",ske,B(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(b(),I("div",oke,[w("span",ike,[w("span",rke,B(C(n)("settings.serverVersion")),1)]),w("span",lke,B(e.serverVersion),1)])):le("",!0)],64)):(b(),I(Be,{key:1},[w("div",ake,[w("button",{type:"button",class:"arch-back",onClick:z},[te[11]||(te[11]=w("span",{class:"chev back"},"‹",-1)),Ge(" "+B(C(n)("mobile.archivedBack")),1)]),w("span",cke,B(C(n)("mobile.sessionCount",{n:V.value.length})),1)]),w("div",uke,[ie(sa,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":te[4]||(te[4]=Z=>R.value=Z)},null,8,["model-value","placeholder"]),ie(to,{size:"sm","model-value":O.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":te[5]||(te[5]=Z=>O.value=Z)},null,8,["model-value","options"])]),S.value?(b(),I("div",dke,B(C(n)("settings.archivedLoadingAll")),1)):V.value.length>0?(b(!0),I(Be,{key:1},nt(V.value,Z=>(b(),I("div",{key:Z.id,class:"arch-row"},[w("div",fke,[w("div",hke,B(Z.title),1),w("div",pke,B(C(n)("settings.archivedAt",{time:re(Z.updatedAt)})),1)]),ie(Ft,{variant:"secondary",size:"sm",onClick:ne=>U(Z.id)},{default:Ee(()=>[Ge(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(b(),I("div",mke,B(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),yke=ut(vke,[["__scopeId","data-v-eeaf31bb"]]),kke={class:"ob-brand"},bke={class:"ob-brand-text"},xke={class:"ob-title"},_ke={class:"ob-sub"},wke={class:"ob-sec"},Ske={class:"ob-label"},Cke={class:"ob-sec"},Ake={class:"ob-label"},Mke={class:"ob-sec"},Eke={class:"ob-label"},Tke=qe({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Et(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=X5();function c(d){o.value!==d&&V3(d)}function u(){n("complete")}return(d,f)=>(b(),ye(Sr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=p=>n("skip"))},{head:Ee(()=>[w("div",kke,[f[4]||(f[4]=w("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[w("defs",null,[w("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[w("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),w("g",{class:"ob-eyes",fill:"#000"},[w("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),w("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),w("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),w("div",bke,[w("div",xke,B(C(s)("onboarding.title")),1),w("div",_ke,B(C(s)("onboarding.subtitle")),1)])])]),default:Ee(()=>[w("section",wke,[w("div",Ske,B(C(s)("onboarding.languageLabel")),1),ie(to,{"model-value":C(o),options:C(q3).map(p=>({value:p.code,label:p.label})),"onUpdate:modelValue":f[0]||(f[0]=p=>c(p))},null,8,["model-value","options"])]),w("section",Cke,[w("div",Ake,B(C(s)("theme.colorSchemeLabel")),1),ie(to,{"model-value":C(i),options:[{value:"light",label:C(s)("theme.light")},{value:"dark",label:C(s)("theme.dark")},{value:"system",label:C(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=p=>C(l)(p))},null,8,["model-value","options"])]),w("section",Mke,[w("div",Eke,B(C(s)("theme.accentLabel")),1),ie(to,{"model-value":C(r),options:[{value:"blue",label:C(s)("theme.accentBlue")},{value:"mono",label:C(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=p=>C(a)(p))},null,8,["model-value","options"])]),ie(Ft,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Ge(B(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),Nke=ut(Tke,[["__scopeId","data-v-fbdd3eab"]]),Ike=["aria-label"],$ke={class:"gload-box"},Lke={class:"gload-text"},Fke=qe({__name:"GlobalLoading",setup(e){const{t}=Et();return(n,s)=>(b(),I("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",$ke,[s[0]||(s[0]=Hv('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-8d6a5c44></path></svg>',1)),ie(wo,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",Lke,B(C(t)("app.connecting")),1)])],8,Ike))}}),Oke=ut(Fke,[["__scopeId","data-v-8d6a5c44"]]),Rke={class:"kap-root"},Bke={class:"kap-head"},Dke={class:"kap-count"},Pke={class:"kap-head-actions"},Hke={class:"kap-filters"},Wke=["value"],zke={class:"kap-check"},Uke={class:"kap-check"},jke={class:"kap-view-toggle",role:"group"},qke={key:0,class:"kap-empty"},Vke=["onClick"],Kke={class:"kap-ts"},Gke={class:"kap-label"},Yke={key:0,class:"kap-detail"},Zke={class:"kap-detail-actions"},Qke=["onClick"],Xke={key:1,class:"kap-agg"},Jke={class:"mono"},e2e={class:"mono"},t2e={class:"num"},n2e={class:"num"},s2e={key:0},o2e={class:"mono"},i2e={class:"num"},r2e={class:"num"},l2e={key:0},a2e=qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=Q("all"),o=Q(""),i=Q(""),r=Q(!1),l=Q("timeline"),a=P(()=>(Jy.value,[...jne()])),c=P(()=>{const E=new Set;for(const N of a.value)N.sessionId&&E.add(N.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=P(()=>{const E=o.value.trim().toLowerCase();return a.value.filter(N=>!(s.value!=="all"&&N.source!==s.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||E&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes(E)))}),f=P(()=>{const E=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,T=E.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};T.count++,N.seq!==void 0&&(T.lastSeq=N.seq),E.set(S,T)}return[...E.values()].sort((N,F)=>F.count-N.count)}),p=P(()=>{const E=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),E.set(F,S)}return[...E.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),h=Q(null),m=Q(!0),_=Q(null),k=Q(null);Ke(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await pt();const E=_.value;E&&(E.scrollTop=E.scrollHeight)});function g(E){h.value=h.value===E?null:E}function v(E){const N=new Date(E),F=(S,T=2)=>String(S).padStart(T,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function y(E){return JSON.stringify(E,null,2)}async function A(E){await js(y(E))&&(k.value=E.id,setTimeout(()=>{k.value===E.id&&(k.value=null)},1500))}function L(){D5(d.value)}function $(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 x(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,N)=>(b(),I("section",Rke,[w("header",Bke,[N[11]||(N[11]=w("strong",null,"KAP debug",-1)),w("span",Dke,B(d.value.length)+"/"+B(a.value.length),1),w("div",Pke,[w("button",{type:"button",class:De({on:C(bu)}),onClick:N[0]||(N[0]=F=>bu.value=!C(bu))},B(C(bu)?"resume":"pause"),3),w("button",{type:"button",onClick:N[1]||(N[1]=F=>C(qne)())},"clear"),w("button",{type:"button",onClick:N[2]||(N[2]=F=>L())},"export jsonl"),ie(jt,{text:"Close window"},{default:Ee(()=>[w("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",Hke,[Tn(w("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>s.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[w("option",{value:"all"},"rest + ws + app",-1),w("option",{value:"rest"},"rest",-1),w("option",{value:"ws"},"ws",-1),w("option",{value:"client"},"app errors",-1)])],512),[[ug,s.value]]),Tn(w("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=w("option",{value:""},"all sessions",-1)),(b(!0),I(Be,null,nt(c.value,F=>(b(),I("option",{key:F,value:F},B(F),9,Wke))),128))],512),[[ug,i.value]]),Tn(w("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ao,o.value]]),w("label",zke,[Tn(w("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[wh,r.value]]),N[14]||(N[14]=Ge(" errors",-1))]),w("label",Uke,[Tn(w("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[wh,m.value]]),N[15]||(N[15]=Ge(" follow",-1))]),w("div",jke,[w("button",{type:"button",class:De({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:De({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(b(),I("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(b(),I("div",qke," No trace entries yet. REST calls and WS frames will appear here. ")):le("",!0),(b(!0),I(Be,null,nt(d.value,F=>(b(),I("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:De(["kap-row",{expanded:h.value===F.id}]),onClick:S=>g(F.id)},[w("span",Kke,B(v(F.ts)),1),w("span",{class:De(["kap-badge",$(F)])},B(x(F)),3),w("span",Gke,B(F.label),1)],10,Vke),h.value===F.id?(b(),I("div",Yke,[w("div",Zke,[w("button",{type:"button",onClick:S=>A(F)},B(k.value===F.id?"copied ✓":"copy json"),9,Qke)]),w("pre",null,B(y(F)),1)])):le("",!0)]))),128))],512)):(b(),I("div",Xke,[N[20]||(N[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[N[17]||(N[17]=w("thead",null,[w("tr",null,[w("th",null,"dir"),w("th",null,"type"),w("th",null,"session"),w("th",null,"count"),w("th",null,"last seq")])],-1)),w("tbody",null,[(b(!0),I(Be,null,nt(f.value,F=>(b(),I("tr",{key:F.key},[w("td",null,B(F.dir),1),w("td",Jke,B(F.eventType),1),w("td",e2e,B(F.sessionId),1),w("td",t2e,B(F.count),1),w("td",n2e,B(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(b(),I("tr",s2e,[...N[16]||(N[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):le("",!0)])]),N[21]||(N[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[N[19]||(N[19]=w("thead",null,[w("tr",null,[w("th",null,"endpoint"),w("th",null,"count"),w("th",null,"errors"),w("th",null,"avg ms")])],-1)),w("tbody",null,[(b(!0),I(Be,null,nt(p.value,F=>(b(),I("tr",{key:F.key},[w("td",o2e,B(F.key),1),w("td",i2e,B(F.count),1),w("td",{class:De(["num",{err:F.errors>0}])},B(F.errors),3),w("td",r2e,B(F.avgMs),1)]))),128)),p.value.length===0?(b(),I("tr",l2e,[...N[18]||(N[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):le("",!0)])])]))]))}}),c2e=ut(a2e,[["__scopeId","data-v-3cda6fe3"]]),u2e=qe({__name:"DebugPanel",setup(e){const t=Q(!1);let n=null,s=null,o=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const p of i){const h=d.getAttribute(p);h!==null?f.setAttribute(p,h):f.removeAttribute(p)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=Sh(c2e,{onClose:()=>u.close()});f.mount(d),s=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return ln(()=>{c()}),es(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(b(),ye(jt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),d2e=ut(u2e,[["__scopeId","data-v-21346738"]]);function f2e({client:e,authLogoRef:t}){const n=P(()=>e.authReady.value),s=P(()=>e.initialized.value&&!n.value),o="/login",i=Q(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)}Ke(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return fn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function h2e({running:e,showAuthGate:t}){const{t:n}=Et(),s=["◐","◓","◑","◒"],o=Q(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ke(e,c=>{c?r():l()},{immediate:!0});const a=P(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});EE(()=>{typeof document<"u"&&(document.title=a.value)}),fn(()=>{l()})}const HM=Q(typeof window>"u"?0:window.innerWidth);let Bf=0,up=!1;function kv(){HM.value=window.innerWidth}function p2e(){up||typeof window>"u"||(window.addEventListener("resize",kv),up=!0,kv())}function m2e(){!up||typeof window>"u"||(window.removeEventListener("resize",kv),up=!1)}function WM(e,t,n){return Math.max(t,e-n)}function bv(e,t,n){return Math.min(n,Math.max(t,e))}function zM(){return ln(()=>{Bf+=1,p2e()}),es(()=>{Bf=Math.max(0,Bf-1),Bf===0&&m2e()}),{viewportWidth:HM}}const g2e="kimi-web.file-preview-width",Xa=320;function v2e({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=zM(),i=P(()=>Math.max(0,o.value-t.value)),r=P(()=>WM(i.value,Xa,Xa));function l(fe){return bv(Math.round(fe),Xa,r.value)}function a(){return l(i.value/2)}const c=P(()=>a()),u=Q(c.value),d=P(()=>bv(u.value,Xa,r.value)),f=Q(null),p=P(()=>{const fe=f.value;if(!fe)return null;const se=e.turns.value.find(ge=>ge.id===fe.turnId)?.blocks?.[fe.blockIndex];return se?.kind==="thinking"?se.thinking:null}),h=P(()=>p.value!==null);function m(fe){const j=f.value;if(j&&j.turnId===fe.turnId&&j.blockIndex===fe.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=fe}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=Q(null),g=P(()=>{const fe=k.value;if(!fe)return null;const j=e.turns.value.find(se=>se.id===fe.turnId);return j?.role==="compaction"&&j.text?j.text:null}),v=P(()=>g.value!==null);function y(fe){if(k.value?.turnId===fe.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=fe}function A(){k.value=null,n.value==="compaction"&&(n.value=null)}const L=Q(null);function $(fe){const j=e.activeAppTasks.value,se=j.find(ue=>ue.id===fe)??j.find(ue=>ue.parentToolCallId===fe);if(se)return se.id;const ge=j.filter(ue=>ue.kind==="subagent"&&!ue.parentToolCallId);if(ge.length===1)return ge[0].id}const x=P(()=>{const fe=L.value;if(!fe)return null;const j=e.activeAppTasks.value.find(se=>se.id===fe.subagentId);return j?npe(j):null}),E=P(()=>x.value!==null);function N(fe){const j=$(fe);if(j){if(L.value?.subagentId===j){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:j},n.value="agent"}}function F(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Q(null),T=P(()=>{const fe=S.value;if(!fe)return null;const j=jH(e.turns.value,fe);return j?{id:fe,title:pa(j.name),path:UH(j.arg),lines:j.status==="error"?null:Y3(j),output:j.output}:null}),R=P(()=>T.value!==null);function O(fe){if(n.value==="toolDiff"&&S.value===fe){D();return}n.value="toolDiff",S.value=fe}function D(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const W=Q("list"),z=Q(null);function V(){if(n.value==="diff"){U();return}n.value="diff",W.value="list",z.value=null,e.loadGitStatus(e.activeSessionId.value)}function U(){n.value==="diff"&&(n.value=null),W.value="list",z.value=null,e.clearFileDiff()}async function re(fe){W.value="detail",z.value=fe,await e.loadFileDiff(fe)}async function ae(fe){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,fe):await e.openSideChat(fe),n.value="btw"}function te(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function Z(){n.value==="btw"&&(n.value=null)}const ne=P(()=>e.sideChatVisible.value),ke=P(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||ne.value)),Se=Q(!1),Ye=Q({});function ve(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function Y(fe){if(fe)switch(fe.kind){case"thinking":f.value={turnId:fe.turnId,blockIndex:fe.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:fe.turnId},n.value="compaction";break;case"agent":L.value={subagentId:fe.subagentId},n.value="agent";break;case"toolDiff":S.value=fe.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ce(){return n.value==="thinking"&&h.value?(_(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&R.value?(D(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(U(),!0):n.value==="btw"?(te(),!0):!1}return Ke(e.activeSessionId,(fe,j)=>{if(j){const se=ve();se?Ye.value[j]=se:delete Ye.value[j]}s(),_(),A(),F(),D(),U(),Z(),fe&&Y(Ye.value[fe])}),{PREVIEW_WIDTH_KEY:g2e,PREVIEW_MIN:Xa,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:p,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:E,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:T,toolDiffVisible:R,openToolDiff:O,closeToolDiff:D,detailDiffMode:W,detailDiffPath:z,openDiffDetail:V,closeDiffDetail:U,selectDiffFile:re,btwVisible:ne,openSideChatTab:ae,closeSideChat:te,hideSideChatPanel:Z,sidePanelVisible:ke,panelDragging:Se,closeOpenSidePanel:ce}}const y2e=$t.sidebarWidth,SC=$t.sidebarCollapsed,CC=270,V0=170,k2e=480,b2e=320;function x2e(e={}){const{viewportWidth:t}=zM(),n=Q(CC),s=Q(!1),o=Q(!1),i=P(()=>{const u=b2e+(YC(e.previewOpen)?Xa:0);return Math.min(k2e,WM(t.value,V0,u))}),r=P(()=>bv(n.value,V0,i.value));function l(){try{s.value=Qn(SC)==="true"}catch{s.value=!1}}function a(){try{ts(SC,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:y2e,SIDEBAR_DEFAULT:CC,SIDEBAR_MIN:V0,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function _2e({client:e,detailTarget:t}){const{t:n}=Et(),s=Q(null),o=Q(null),i=Q(!1),r=Q(null),l=Q(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=P(()=>{const $=l.value;return $?e.getFileDownloadUrl($):null}),f=P(()=>s.value!==null);function p($){return $.length>1?$.replace(/\/+$/,""):$}function h($){const x=[];for(const E of $.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){x.pop();continue}x.push(E)}return x.join("/")}function m($){const x=$.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(e.status.value.cwd);if(x.startsWith("/")){if(!E||x!==E&&!x.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===E?"":x.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=h(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=h(x);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function _($){const x=s.value;if(t.value==="file"&&x&&x.path===$.path&&x.line===$.line){y();return}const E=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=$,l.value=null;const N=m($.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if(E!==a)return;F?o.value={...F,path:F.path||N.path}:o.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(F){if(E!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function k($){return/^data:([^;,]+)/i.exec($)?.[1]}function g($){if($.kind!=="image")return;const x=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const E={path:$.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:$.mimeType??k($.url)??"image/*",isBinary:!0,size:$.bytes??0};$.fileId?(i.value=!0,o.value=E,ft().getFileBlob($.fileId).then(N=>{if(x===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(N),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{x===a&&(o.value&&(o.value={...o.value,sourceUrl:$.url}),i.value=!1)})):(i.value=!1,o.value={...E,sourceUrl:$.url})}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ke(t,($,x)=>{x==="file"&&$!=="file"&&v()});function A(){const $=o.value?.path??s.value?.path;$&&e.openWorkspaceFile($,s.value?.line)}function L(){const $=o.value?.path??s.value?.path;$&&e.revealWorkspaceFile($)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:_,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:A,revealPreviewFile:L}}const w2e=640,S2e=`(max-width: ${w2e}px)`;function C2e(){const e=Q(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(S2e);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),fn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),fn(()=>t.removeListener(n))),e}const A2e={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},M2e={class:"server-auth-card"},E2e={class:"server-auth-body"},T2e={class:"server-auth-foot"},N2e=qe({__name:"ServerAuthDialog",setup(e){const t=Q(""),n=Q(null),s=Q(!1);ln(()=>{pt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,H5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(b(),I("div",A2e,[w("div",M2e,[l[1]||(l[1]=w("div",{class:"server-auth-head"},[w("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),w("p",{class:"server-auth-hint"},[Ge(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),Ge("). ")])],-1)),w("div",E2e,[ie(sa,{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:s.value,onKeydown:i},null,8,["modelValue","disabled"])]),w("div",T2e,[ie(Ft,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Ee(()=>[Ge(B(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),I2e=ut(N2e,[["__scopeId","data-v-82150ea4"]]),$2e=["aria-label"],L2e=qe({__name:"InternalBuildBanner",setup(e){const{t}=Et(),n=TR;return(s,o)=>C(n)?(b(),I("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=w("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"},[w("path",{d:"M8 2 14 13H2L8 2Z"}),w("path",{d:"M8 6v3.5"}),w("path",{d:"M8 11.5h.01"})],-1)),w("span",null,B(C(t)("app.internalBuildBanner")),1)],8,$2e)):le("",!0)}}),F2e=ut(L2e,[["__scopeId","data-v-166b3735"]]),O2e={class:"app-shell"},R2e={key:1,class:"auth-page"},B2e={class:"auth-page-inner"},D2e={class:"auth-page-copy"},P2e=["aria-label","aria-hidden"],H2e=qe({__name:"App",setup(e){const t=tse(),n=Q(!t);let s=null;const o=Ek(),i=P(()=>!o.dangerousBypassAuth.value&&n.value);An("resolveImage",o.resolveImageUrl),An("resolveSwarmMembers",rt=>o.swarmMembersByToolCallId.value.get(rt)??[]);const{t:r}=Et(),l=Ai(),a=C2e(),c=Q(!1),u=Q(!1),d=P(()=>{const rt=o.activeSessionId.value;return o.sessions.value.find(xe=>xe.id===rt)?.title??""}),f=P(()=>o.visibleWorkspace.value?.sessionCount??0),p=P(()=>o.activity.value!=="idle"),h=Q(null),{showAuthGate:m,blinkAuthLogo:_}=f2e({client:o,authLogoRef:h});h2e({running:p,showAuthGate:m});function k(rt){const xe=o.status.value.modelId??o.status.value.model??"",Le=o.models.value.find(lt=>lt.id===xe||lt.model===xe||lt.displayName===o.status.value.model),we=nk(Le),X=aa(Le,rt),me=we.indexOf(X),je=we[(me+1)%we.length]??we[0]??"off";return sk(Le,je)}const g=Q(!o.onboarded.value);function v(){o.setOnboarded(!0),g.value=!1}function y(){g.value=!0}ln(()=>{o.load(),Ye(),document.addEventListener("keydown",A,!0),s=sse(()=>{n.value=!0,o.clearDangerousBypassAuth()})}),fn(()=>{document.removeEventListener("keydown",A,!0),s!==null&&(s(),s=null)});function A(rt){rt.key==="Escape"&&(hs.value||ds()&&(rt.stopPropagation(),rt.preventDefault()))}const L=Q(null),$=Q(!1);Ke(o.activeSessionId,()=>{$.value=!0,pt(()=>{$.value=!1})});const{previewTarget:x,previewFile:E,previewLoading:N,previewError:F,previewDownloadUrl:S,previewExternalActions:T,openFilePreview:R,openMediaPreview:O,closeFilePreview:D,openPreviewInEditor:W,revealPreviewFile:z}=_2e({client:o,detailTarget:L}),V=P(()=>L.value!==null),{SIDEBAR_WIDTH_KEY:U,SIDEBAR_DEFAULT:re,SIDEBAR_MIN:ae,sidebarMax:te,sessionColWidth:Z,sidebarCollapsed:ne,sidebarDragging:ke,sideWidth:Se,loadSidebarCollapsed:Ye,toggleSidebarCollapse:ve}=x2e({previewOpen:V}),{PREVIEW_WIDTH_KEY:Y,PREVIEW_MIN:ce,previewDefaultWidth:fe,previewMax:j,previewWidth:se,previewPanelWidth:ge,thinkingPanelText:ue,thinkingVisible:pe,openThinkingPanel:q,closeThinkingPanel:J,compactionPanelText:he,compactionPanelVisible:Te,openCompactionPanel:Ie,closeCompactionPanel:Oe,agentPanelMember:de,openAgentPanel:$e,closeAgentPanel:Qe,toolDiffTarget:tt,openToolDiff:vt,closeToolDiff:wt,detailDiffMode:xt,detailDiffPath:Rt,openDiffDetail:yt,closeDiffDetail:nn,selectDiffFile:xn,btwVisible:ns,openSideChatTab:Wt,closeSideChat:_n,sidePanelVisible:gn,panelDragging:ot,closeOpenSidePanel:ds}=v2e({client:o,sideWidth:Se,detailTarget:L,closeFilePreview:D}),ys=Q(null),fs=Q(!1),Xe=Q(!1),Ze=Q(!1),Mt=Q(!1),Dt=Q(!1),zt=Q(!1),wn=Q(null),Rn=Q(null),hs=P(()=>Ka.value>0||fs.value||Xe.value||Ze.value||Mt.value||Dt.value||zt.value||g.value||c.value||u.value),ss=Q(!1),sn=Q(!1),Lt=Q(!1),Vs=Q(!1),an=Q(!1);async function So(){ss.value=!0,sn.value=!1,fs.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{sn.value=!0}finally{ss.value=!1}}async function Co(){Lt.value=!0,Vs.value=!1,Xe.value=!0;try{await o.loadProviders()}catch{Vs.value=!0}finally{Lt.value=!1}}function Rs(){Ze.value=!0}async function fi(rt){fs.value=!1,await co(rt)}async function co(rt){await o.setModel(rt)&&rt!==o.defaultModel.value&&o.updateConfig({defaultModel:rt})}async function jo(rt){await o.addProvider(rt)}async function Ot(rt){await o.deleteProvider(rt)}async function Bs(rt){await o.refreshProvider(rt)}async function qn(rt){an.value=!0;try{await o.updateConfig(rt)&&await o.checkAuth()}finally{an.value=!1}}async function Cs(){return o.startOAuthLogin()}async function On(){return o.pollOAuthLogin()}async function Hn(){return o.cancelOAuthLogin()}async function hi(){Ze.value=!1,await o.checkAuth(),await o.load()}async function Xn(rt){await o.undo(1),await pt(),ys.value?.loadComposerForEdit(rt.text,rt.images)}function qo(rt){if(rt==="/compact"||rt.startsWith("/compact ")){o.compact(rt.slice(8).trim()||void 0);return}if(rt==="/swarm"||rt.startsWith("/swarm ")){const xe=rt.slice(6).trim();xe==="on"?o.setSwarmMode(!0):xe==="off"?o.setSwarmMode(!1):xe?(o.setSwarmMode(!0),o.sendPrompt(xe)):o.toggleSwarmMode();return}if(rt==="/goal"||rt.startsWith("/goal ")){const xe=rt.slice(5).trim();xe==="pause"||xe==="resume"||xe==="cancel"?o.controlGoal(xe):xe?o.createGoal(xe):o.toggleGoalMode();return}if(rt==="/btw"||rt.startsWith("/btw ")){const xe=rt.slice(4).trim();!xe&&o.sideChatVisible.value?_n():Wt(xe||void 0);return}switch(rt){case"/new":case"/clear":Bn();break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const xe=o.permission.value,Le=xe==="manual"?"auto":xe==="auto"?"yolo":"manual";o.setPermission(Le);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(k(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":Dt.value=!0;break;case"/model":So();break;case"/provider":break;case"/login":Rs();break;default:{const xe=rt.indexOf(" "),Le=Hoe((xe===-1?rt:rt.slice(0,xe)).slice(1)),we=xe===-1?void 0:rt.slice(xe+1).trim()||void 0;if(!Le)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Le,we):o.activateSkill(Le,we);break}}}function Ks(rt){o.unqueue(rt)}function Mi(rt){o.unqueue(rt)}function Ao(rt){o.reorderQueue(rt.from,rt.to)}async function Vn(rt){const xe=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&xe){await o.startSessionAndSendPrompt(xe,rt.text,rt.attachments);return}if(!o.activeSessionId.value&&!xe){wn.value=rt,Mt.value=!0;return}o.sendPrompt(rt.text,rt.attachments)}async function Vo(rt){if(Rn.value=null,!await o.addWorkspaceByPath(rt)){Rn.value=r("workspace.addFailed");return}Mt.value=!1;const Le=wn.value;wn.value=null;const we=o.activeWorkspaceId.value;Le&&we&&await o.startSessionAndSendPrompt(we,Le.text,Le.attachments)}function ji(){wn.value=null,Rn.value=null,Mt.value=!1}function Ko(){pt(()=>{ys.value?.focusComposer()})}function Bn(){const rt=o.activeWorkspaceId.value;rt?o.openWorkspaceDraft(rt):o.clearActiveSession(),Ko()}function Kn(rt){o.openWorkspaceDraft(rt),Ko()}function Mo(rt){rt&&window.open(rt,"_blank","noopener")}return(rt,xe)=>(b(),I("div",O2e,[i.value?(b(),ye(I2e,{key:0})):le("",!0),C(m)?(b(),I("section",R2e,[w("div",B2e,[(b(),I("svg",{ref_key:"authLogoRef",ref:h,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:xe[0]||(xe[0]=bt(()=>{},["prevent"])),onClick:xe[1]||(xe[1]=(...Le)=>C(_)&&C(_)(...Le))},[...xe[96]||(xe[96]=[Hv('<defs data-v-88bcc9de><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-88bcc9de><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-88bcc9de></rect><g class="ch-eyes" fill="#000" data-v-88bcc9de><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-88bcc9de></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-88bcc9de></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-88bcc9de></rect>',2)])],544)),w("div",D2e,[w("h1",null,B(C(r)("app.authPageTitle")),1),w("p",null,B(C(r)("app.authPageMessage")),1)]),ie(Ft,{class:"auth-page-btn",variant:"primary",onClick:Rs},{default:Ee(()=>[ie(Ve,{name:"log-in",size:"md"}),w("span",null,B(C(r)("app.authPageLogin")),1)]),_:1})])])):(b(),I("div",{key:2,class:De(["app",{mobile:C(a),"sidebar-collapsed":C(ne)&&!C(a),"macos-desktop":C(pc)}]),style:qt({"--preview-w":C(ge)+"px"})},[C(a)?(b(),ye(zve,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:p.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:xe[18]||(xe[18]=Le=>c.value=!0),onOpenSettings:xe[19]||(xe[19]=Le=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(b(),I(Be,{key:0},[ie(GR,{collapsed:C(ne),dragging:C(ke),"col-width":C(Se),"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,onSelect:xe[2]||(xe[2]=Le=>C(o).selectSession(Le)),onCreate:Bn,onCreateInWorkspace:xe[3]||(xe[3]=Le=>Kn(Le)),onSelectWorkspace:xe[4]||(xe[4]=Le=>C(o).openWorkspace(Le)),onAddWorkspace:xe[5]||(xe[5]=Le=>Mt.value=!0),onRename:xe[6]||(xe[6]=(Le,we)=>C(o).renameSession(Le,we)),onArchive:xe[7]||(xe[7]=Le=>C(o).archiveSession(Le)),onFork:xe[8]||(xe[8]=Le=>C(o).forkSession(Le)),onRenameWorkspace:xe[9]||(xe[9]=(Le,we)=>C(o).renameWorkspace(Le,we)),onDeleteWorkspace:xe[10]||(xe[10]=Le=>C(o).deleteWorkspace(Le)),onReorderWorkspaces:xe[11]||(xe[11]=Le=>C(o).reorderWorkspaces(Le)),onSetWorkspaceSortMode:xe[12]||(xe[12]=Le=>C(o).setWorkspaceSortMode(Le)),onLoadMoreSessions:xe[13]||(xe[13]=Le=>void C(o).loadMoreSessions(Le)),onLoadAllSessions:xe[14]||(xe[14]=Le=>void C(o).loadAllSessions()),onOpenSettings:xe[15]||(xe[15]=Le=>zt.value=!0),onCollapse:C(ve)},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","onCollapse"]),Tn(ie(Tx,{class:"side-handle","storage-key":C(U),"default-width":C(re),min:C(ae),max:C(te),"onUpdate:width":xe[16]||(xe[16]=Le=>Z.value=Le),"onUpdate:dragging":xe[17]||(xe[17]=Le=>ke.value=Le)},null,8,["storage-key","default-width","min","max"]),[[oi,!C(ne)]])],64)),ie(tce,{ref_key:"conversationPaneRef",ref:ys,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:p.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,sending:C(o).isSending.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:xe[20]||(xe[20]=Le=>C(yt)()),onSelectWorkspace:xe[21]||(xe[21]=Le=>Kn(Le)),onAddWorkspace:xe[22]||(xe[22]=Le=>Mt.value=!0),onOpenPr:Mo,onSubmit:xe[23]||(xe[23]=Le=>Vn(Le)),onSteer:xe[24]||(xe[24]=Le=>C(o).steerPrompt(Le.text,Le.attachments)),onApproval:xe[25]||(xe[25]=(Le,we)=>C(o).respondApproval(Le,we)),onCancelTask:xe[26]||(xe[26]=Le=>C(o).cancelTask(Le)),onAnswer:xe[27]||(xe[27]=(Le,we)=>C(o).respondQuestion(Le,we)),onDismiss:xe[28]||(xe[28]=Le=>C(o).dismissQuestion(Le)),onCommand:qo,onInterrupt:xe[29]||(xe[29]=Le=>C(o).abortCurrentPrompt()),onUnqueue:Ks,onEditQueued:Mi,onReorderQueue:Ao,onSetPermission:xe[30]||(xe[30]=Le=>C(o).setPermission(Le)),onSetThinking:xe[31]||(xe[31]=Le=>C(o).setThinking(Le)),onTogglePlan:xe[32]||(xe[32]=Le=>C(o).togglePlanMode()),onToggleSwarm:xe[33]||(xe[33]=Le=>C(o).toggleSwarmMode()),onToggleGoal:xe[34]||(xe[34]=Le=>C(o).toggleGoalMode()),onCreateGoal:xe[35]||(xe[35]=Le=>C(o).createGoal(Le)),onControlGoal:xe[36]||(xe[36]=Le=>C(o).controlGoal(Le)),onRefreshGitStatus:xe[37]||(xe[37]=Le=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:xe[38]||(xe[38]=(Le,we)=>C(o).renameSession(Le,we)),onForkSession:xe[39]||(xe[39]=Le=>C(o).forkSession(Le)),onArchiveSession:xe[40]||(xe[40]=Le=>C(o).archiveSession(Le)),onCompact:xe[41]||(xe[41]=Le=>C(o).compact()),onPickModel:xe[42]||(xe[42]=Le=>So()),onSelectModel:xe[43]||(xe[43]=Le=>co(Le)),onOpenFile:xe[44]||(xe[44]=Le=>C(R)(Le)),onOpenMedia:xe[45]||(xe[45]=Le=>C(O)(Le)),onOpenThinking:xe[46]||(xe[46]=Le=>C(q)(Le)),onOpenCompaction:xe[47]||(xe[47]=Le=>C(Ie)(Le)),onOpenAgent:xe[48]||(xe[48]=Le=>C($e)(Le)),onOpenToolDiff:xe[49]||(xe[49]=Le=>C(vt)(Le)),onEditMessage:Xn},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","queued","search-files","upload-image","sending","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(pc)||C(ne))?(b(),ye(Nn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(ne)?C(r)("sidebar.expandSidebar"):C(r)("sidebar.collapseSidebar"),onClick:C(ve)},{default:Ee(()=>[ie(Ve,{name:C(ne)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):le("",!0),C(gn)&&!C(a)?(b(),ye(Tx,{key:3,class:"preview-handle","storage-key":C(Y),"default-width":C(fe),min:C(ce),max:C(j),reverse:"","aria-label":C(r)("layout.resizePreviewAria"),"onUpdate:width":xe[50]||(xe[50]=Le=>se.value=Le),"onUpdate:dragging":xe[51]||(xe[51]=Le=>ot.value=Le)},null,8,["storage-key","default-width","min","max","aria-label"])):le("",!0),!C(a)||C(gn)?(b(),I("aside",{key:4,class:De(["global-preview",{open:C(gn),mobile:C(a),"no-anim":C(ot)||$.value}]),role:"complementary","aria-label":C(r)("layout.detailPanelAria"),"aria-hidden":!C(gn)},[L.value==="thinking"&&C(pe)?(b(),ye(cC,{key:0,text:C(ue)??"",onClose:C(J)},null,8,["text","onClose"])):L.value==="compaction"&&C(Te)?(b(),ye(cC,{key:1,text:C(he)??"",subtitle:C(r)("conversation.summaryTitle"),onClose:C(Oe)},null,8,["text","subtitle","onClose"])):L.value==="agent"&&C(de)?(b(),ye(_ue,{key:2,member:C(de),onClose:C(Qe)},null,8,["member","onClose"])):L.value==="btw"&&C(ns)?(b(),ye(Uue,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:xe[52]||(xe[52]=Le=>C(o).sendSideChatPrompt(Le)),onClose:C(_n)},null,8,["turns","running","sending","onClose"])):L.value==="diff"?(b(),ye(vde,{key:4,mode:C(xt),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(xn),onBack:xe[53]||(xe[53]=Le=>{xt.value="list",Rt.value=null,C(o).clearFileDiff()}),onClose:C(nn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):L.value==="toolDiff"&&C(tt)?(b(),ye(Oue,{key:5,target:C(tt),onClose:C(wt)},null,8,["target","onClose"])):L.value==="file"?(b(),ye(sue,{key:6,file:C(E),loading:C(N),error:C(F),line:C(x)?.line,"download-url":C(S),closable:"","external-actions":C(T),"open-file":C(R),onClose:C(D),onOpenExternal:C(W),onReveal:C(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):le("",!0)],10,P2e)):le("",!0),ie(F2e,{class:"internal-build-fab"}),fs.value?(b(),ye(Rde,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:ss.value,unavailable:sn.value,onSelect:xe[54]||(xe[54]=Le=>fi(Le)),onToggleStar:xe[55]||(xe[55]=Le=>C(o).toggleStarModel(Le)),onClose:xe[56]||(xe[56]=Le=>fs.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):le("",!0),zt.value?(b(),ye($ge,{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":an.value,"server-version":C(o).serverVersion.value,onSetColorScheme:xe[57]||(xe[57]=Le=>C(o).setColorScheme(Le)),onSetAccent:xe[58]||(xe[58]=Le=>C(o).setAccent(Le)),onSetUiFontSize:xe[59]||(xe[59]=Le=>C(o).setUiFontSize(Le)),onSetNotify:xe[60]||(xe[60]=Le=>C(o).setNotifyOnComplete(Le)),onSetNotifyQuestion:xe[61]||(xe[61]=Le=>C(o).setNotifyOnQuestion(Le)),onSetNotifyApproval:xe[62]||(xe[62]=Le=>C(o).setNotifyOnApproval(Le)),onSetSound:xe[63]||(xe[63]=Le=>C(o).setSoundOnComplete(Le)),onSetConversationToc:xe[64]||(xe[64]=Le=>C(o).setConversationToc(Le)),onUpdateConfig:xe[65]||(xe[65]=Le=>qn(Le)),onLogin:xe[66]||(xe[66]=()=>{zt.value=!1,Rs()}),onLogout:C(o).logout,onOpenOnboarding:xe[67]||(xe[67]=()=>{zt.value=!1,y()}),onOpenProviders:xe[68]||(xe[68]=()=>{zt.value=!1,Co()}),onClose:xe[69]||(xe[69]=Le=>zt.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","onLogout"])):le("",!0),Xe.value?(b(),ye(lfe,{key:7,providers:C(o).providers.value,loading:Lt.value,unavailable:Vs.value,onAdd:xe[70]||(xe[70]=Le=>jo(Le)),onRefresh:xe[71]||(xe[71]=Le=>Bs(Le)),onDelete:xe[72]||(xe[72]=Le=>Ot(Le)),onOpenLogin:xe[73]||(xe[73]=()=>{Xe.value=!1,Rs()}),onClose:xe[74]||(xe[74]=Le=>Xe.value=!1)},null,8,["providers","loading","unavailable"])):le("",!0),Dt.value?(b(),ye(xve,{key:8,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:xe[75]||(xe[75]=Le=>Dt.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):le("",!0),Mt.value?(b(),ye(ive,{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:Rn.value,onAdd:xe[76]||(xe[76]=Le=>Vo(Le)),onClose:ji},null,8,["browse-fs","get-fs-home","default-path","error"])):le("",!0),ie(cl,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?le("",!0):(b(),ye(Oke,{key:0}))]),_:1}),g.value&&!C(m)?(b(),ye(Nke,{key:10,onComplete:v,onSkip:v})):le("",!0),ie(Lve,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(b(),ye(d2e,{key:11})):le("",!0),ie(cve),C(a)?(b(),ye(dye,{key:12,modelValue:c.value,"onUpdate:modelValue":xe[77]||(xe[77]=Le=>c.value=Le),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:xe[78]||(xe[78]=Le=>C(o).selectSession(Le)),onCreate:Bn,onCreateInWorkspace:xe[79]||(xe[79]=Le=>Kn(Le)),onAddWorkspace:xe[80]||(xe[80]=Le=>Mt.value=!0),onRename:xe[81]||(xe[81]=(Le,we)=>C(o).renameSession(Le,we)),onArchive:xe[82]||(xe[82]=Le=>C(o).archiveSession(Le)),onDeleteWorkspace:xe[83]||(xe[83]=Le=>C(o).deleteWorkspace(Le)),onLoadMore:xe[84]||(xe[84]=Le=>void C(o).loadMoreSessions(Le))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):le("",!0),C(a)?(b(),ye(yke,{key:13,modelValue:u.value,"onUpdate:modelValue":xe[85]||(xe[85]=Le=>u.value=Le),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:xe[86]||(xe[86]=Le=>So()),onSetThinking:xe[87]||(xe[87]=Le=>C(o).setThinking(Le)),onTogglePlan:xe[88]||(xe[88]=Le=>C(o).togglePlanMode()),onToggleSwarm:xe[89]||(xe[89]=Le=>C(o).toggleSwarmMode()),onSetPermission:xe[90]||(xe[90]=Le=>C(o).setPermission(Le)),onSetColorScheme:xe[91]||(xe[91]=Le=>C(o).setColorScheme(Le)),onSetUiFontSize:xe[92]||(xe[92]=Le=>C(o).setUiFontSize(Le)),onSetConversationToc:xe[93]||(xe[93]=Le=>C(o).setConversationToc(Le)),onLogin:xe[94]||(xe[94]=()=>{u.value=!1,Rs()}),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"])):le("",!0)],6)),Ze.value?(b(),ye(Bfe,{key:3,"on-start-o-auth-login":Cs,"on-poll-o-auth-login":On,"on-cancel-o-auth-login":Hn,onSuccess:hi,onClose:xe[95]||(xe[95]=Le=>Ze.value=!1)})):le("",!0)]))}}),W2e=ut(H2e,[["__scopeId","data-v-88bcc9de"]]);Yne();Sh(W2e).use(yn).mount("#app");export{q8 as $,Fv as A,OE as B,rs as C,Hbe as D,$C as E,Be as F,Hv as G,Ge as H,ie as I,pE as J,dbe as K,ki as L,qe as M,l9 as N,mbe as O,gbe as P,kbe as Q,rh as R,fc as S,Ap as T,vbe as U,zv as V,pbe as W,zbe as X,ybe as Y,Obe as Z,U2e as _,l4 as a,$s as a$,Os as a0,wv as a1,Q2e as a2,Tv as a3,IT as a4,dn as a5,$c as a6,sbe as a7,qbe as a8,lbe as a9,f4 as aA,VE as aB,XE as aC,ln as aD,QE as aE,ZE as aF,Sv as aG,YE as aH,fn as aI,Iv as aJ,kE as aK,b as aL,o9 as aM,tbe as aN,An as aO,ZC as aP,ebe as aQ,dh as aR,Ss as aS,ah as aT,Q as aU,Tbe as aV,w9 as aW,nt as aX,In as aY,eT as aZ,fbe as a_,ube as aa,cbe as ab,abe as ac,Ibe as ad,Vbe as ae,Ut as af,BT as ag,Sp as ah,nl as ai,br as aj,Jn as ak,Nbe as al,Oo as am,al as an,mt as ao,_be as ap,wbe as aq,pn as ar,pt as as,zT as at,De as au,z2e as av,qt as aw,qE as ax,GE as ay,es as az,J2e as b,ZX as b$,Dbe as b0,Vu as b1,vh as b2,Rbe as b3,ll as b4,uE as b5,q2e as b6,fa as b7,AE as b8,Bbe as b9,ao as bA,oi as bB,DT as bC,Lbe as bD,Ke as bE,EE as bF,obe as bG,TE as bH,Cbe as bI,Ee as bJ,bbe as bK,Tn as bL,bi as bM,$be as bN,bt as bO,nbe as bP,hn as bQ,eo as bR,nxe as bS,PJ as bT,l5 as bU,oxe as bV,pX as bW,Hy as bX,sxe as bY,Hg as bZ,uxe as b_,j2e as ba,B as bb,Df as bc,hbe as bd,Xt as be,G2e as bf,K2e as bg,YC as bh,Ebe as bi,V2e as bj,C as bk,bd as bl,jbe as bm,Wbe as bn,c9 as bo,ibe as bp,Abe as bq,ME as br,Ube as bs,xbe as bt,rbe as bu,r4 as bv,wh as bw,y9 as bx,X4 as by,ug as bz,Fbe as c,YX as c0,By as c1,GX as c2,Jbe as c3,lX as c4,Xbe as c5,Zh as c6,Ybe as c7,KX as c8,t5 as c9,cxe as ca,Zbe as cb,fxe as cc,Vg as cd,oc as ce,jg as cf,hxe as cg,dxe as ch,txe as ci,$o as cj,Qbe as ck,exe as cl,gX as cm,axe as cn,qg as co,Ug as cp,lxe as cq,Gbe as cr,rxe as cs,ixe as ct,Ve as cu,Kbe as cv,ut as cw,Mbe as d,sl as e,Y2e as f,cl as g,f9 as h,Z2e as i,X2e as j,ui as k,vd as l,vs as m,gp as n,xr as o,Pbe as p,P as q,Sh as r,ye as s,le as t,I as u,w as v,_T as w,Sbe as x,xT as y,S9 as z};
|