@moonshot-ai/kimi-code 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +4473 -2078
- package/dist-web/assets/{CodeBlockNode-D-Xzv638.js → CodeBlockNode-DDlAJrwY.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-CzicEtaS.js → CodeBlockShell.vue_vue_type_style_index_0_lang-DsCFStZn.js} +1 -1
- package/dist-web/assets/DesignSystemView-B9X_Wri_.css +1 -0
- package/dist-web/assets/DesignSystemView-BbwRX2u4.js +13 -0
- package/dist-web/assets/{Tooltip-Dx3D8Bj3.js → Tooltip-BR3ab6GW.js} +1 -1
- package/dist-web/assets/{arc-9b70PNbl.js → arc-BhuMeKav.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-BYCXsJUz.js → architectureDiagram-3BPJPVTR-BnVP5dyo.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-BvXb4xMt.js → blockDiagram-GPEHLZMM-CSgMO2Ha.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-Dycf7RFH.js → c4Diagram-AAUBKEIU-BSAec2JJ.js} +1 -1
- package/dist-web/assets/channel-CVqhQnas.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-DRHg6fyr.js → chunk-2J33WTMH-CWZ6e0xX.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-CGqaafFW.js → chunk-4BX2VUAB-D85JgHDt.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DoWHxcjn.js → chunk-55IACEB6-CRAS3mDv.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-Cx1vq8Jh.js → chunk-727SXJPM-L0fqaAlt.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-BGRDJbQp.js → chunk-AQP2D5EJ-C15Xm2e2.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-C-jaGe_D.js → chunk-FMBD7UC4-BDbWvCMt.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-BVGFPuZA.js → chunk-ND2GUHAM-DSzhcCso.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-BSizbRaI.js → chunk-QZHKN3VN-FFne1CzC.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-D1VGOBF6.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-D1VGOBF6.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-CBHuY8c2.js → cose-bilkent-S5V4N54A-CjO7E22T.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-BfowwAru.js → dagre-BM42HDAG-BWYtcSBE.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-BobzsYGD.js → diagram-2AECGRRQ-DyMLsE8L.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-dIYo-MU0.js → diagram-5GNKFQAL-Cd6Po60W.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-DsPoNGcQ.js → diagram-KO2AKTUF-CNupkUrU.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-CwKbokzg.js → diagram-LMA3HP47-DoAx9YOA.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BX5dnWUm.js → diagram-OG6HWLK6-CqrQtLGQ.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-CyGyucxN.js → erDiagram-TEJ5UH35-X-6af5GI.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-ByYAVfl1.js → flowDiagram-I6XJVG4X-DfhjR7Ov.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-BU7U7HVN.js → ganttDiagram-6RSMTGT7-DFHQfE0q.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-4BzEpree.js → gitGraphDiagram-PVQCEYII-DOryPD-X.js} +1 -1
- package/dist-web/assets/{index-s-YZ1N8r.js → index-C9lkMths.js} +1 -1
- package/dist-web/assets/{index-DO8V4TRt.js → index-DQ5XP4c3.js} +2 -2
- package/dist-web/assets/index-Dy7xs5tu.js +325 -0
- package/dist-web/assets/index-RxoP2ZJI.css +1 -0
- package/dist-web/assets/{index10-CPYGci3e.js → index10-Dm7kE2rr.js} +1 -1
- package/dist-web/assets/{index11-D6iWwC_8.js → index11-DdA3MM9V.js} +1 -1
- package/dist-web/assets/{index5-Bog59TPE.js → index5-BEFSXtVE.js} +1 -1
- package/dist-web/assets/{index6-BZ_JSMrz.js → index6-DRC2c8Au.js} +1 -1
- package/dist-web/assets/{index7-Bue6SKki.js → index7-BA7Qbpln.js} +1 -1
- package/dist-web/assets/{index8-BqCm7dJ1.js → index8-BJFkvY9w.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-BDmJQWFA.js → infoDiagram-5YYISTIA-ZsB3ppsA.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-ByGBBRBR.js → ishikawaDiagram-YF4QCWOH-B2AYN5_w.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-CNR1wteR.js → journeyDiagram-JHISSGLW-ZRZDTfWd.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-4r01VKm7.js → kanban-definition-UN3LZRKU-C8zrJ_g1.js} +1 -1
- package/dist-web/assets/{linear-C9Ejg6z9.js → linear-yzOEoW_K.js} +1 -1
- package/dist-web/assets/{mermaid.core-XQ4l3YcE.js → mermaid.core-DKDe9fI9.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-KPgj1903.js → mindmap-definition-RKZ34NQL-Ba6Dk5CQ.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-BLJZ-OSy.js → pieDiagram-4H26LBE5-D9E3TqGb.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-C1kVK7ci.js → quadrantDiagram-W4KKPZXB-BQ_noR4u.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-CDsDsHAT.js → requirementDiagram-4Y6WPE33-XC7rugwi.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DWaQa1cY.js → sankeyDiagram-5OEKKPKP-Df-1d5Vn.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CLodwIYE.js → sequenceDiagram-3UESZ5HK-D82eaP5y.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-35tgHlqv.js → stateDiagram-AJRCARHV-Bg5vqbfv.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-C5ugWVoF.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-ugbzvBQA.js → timeline-definition-PNZ67QCA-aGpihFYz.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-BRHN9x89.js → vennDiagram-CIIHVFJN-1X5A7nOP.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-NheX_bap.js → vue.runtime.esm-bundler-CPECXINV.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-BTb5t8a3.js → wardley-L42UT6IY-8CQt8FsK.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CQ569wwX.js → wardleyDiagram-YWT4CUSO-Dcath5AA.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-Dh_87v9-.js → xychartDiagram-2RQKCTM6-ztyWzdXI.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +8 -8
- package/dist-web/assets/DesignSystemView-Daj_1mAu.js +0 -13
- package/dist-web/assets/DesignSystemView-Dyj5tvMI.css +0 -1
- package/dist-web/assets/channel-nqiB9njL.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-BeD_TBdL.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BeD_TBdL.js +0 -1
- package/dist-web/assets/index-CB4HyosH.js +0 -325
- package/dist-web/assets/index-CWshH9Rs.css +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Bs-DGx_Q.js +0 -1
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-BbwRX2u4.js","assets/DesignSystemView-B9X_Wri_.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-DDlAJrwY.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DsCFStZn.js","assets/index8-BJFkvY9w.js","assets/index11-DdA3MM9V.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
|
+
* @vue/shared v3.5.35
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
6
|
+
**/function Xp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Qt={},Tc=[],ki=()=>{},m4=()=>!1,Ud=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Jp=e=>e.startsWith("onUpdate:"),kn=Object.assign,uy=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},_E=Object.prototype.hasOwnProperty,ln=(e,t)=>_E.call(e,t),xt=Array.isArray,Nc=e=>su(e)==="[object Map]",Oa=e=>su(e)==="[object Set]",Ob=e=>su(e)==="[object Date]",SE=e=>su(e)==="[object RegExp]",$t=e=>typeof e=="function",Sn=e=>typeof e=="string",Js=e=>typeof e=="symbol",an=e=>e!==null&&typeof e=="object",dy=e=>(an(e)||$t(e))&&$t(e.then)&&$t(e.catch),g4=Object.prototype.toString,su=e=>g4.call(e),CE=e=>su(e).slice(8,-1),em=e=>su(e)==="[object Object]",tm=e=>Sn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,wa=Xp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),nm=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},AE=/-\w/g,No=nm(e=>e.replace(AE,t=>t.slice(1).toUpperCase())),ME=/\B([A-Z])/g,Is=nm(e=>e.replace(ME,"-$1").toLowerCase()),om=nm(e=>e.charAt(0).toUpperCase()+e.slice(1)),gh=nm(e=>e?`on${om(e)}`:""),qo=(e,t)=>!Object.is(e,t),Ic=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},v4=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},sm=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ph=e=>{const t=Sn(e)?Number(e):NaN;return isNaN(t)?e:t};let Rb;const im=()=>Rb||(Rb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),EE="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",TE=Xp(EE);function Yt(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=Sn(o)?$E(o):Yt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(Sn(e)||an(e))return e}const NE=/;(?![^(]*\))/g,IE=/:([^]+)/,LE=/\/\*[^]*?\*\//g;function $E(e){const t={};return e.replace(LE,"").split(NE).forEach(n=>{if(n){const o=n.split(IE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(Sn(e))t=e;else if(xt(e))for(let n=0;n<e.length;n++){const o=We(e[n]);o&&(t+=o+" ")}else if(an(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Qxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Sn(t)&&(e.class=We(t)),n&&(e.style=Yt(n)),e}const FE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",OE=Xp(FE);function y4(e){return!!e||e===""}function RE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Br(e[o],t[o]);return n}function Br(e,t){if(e===t)return!0;let n=Ob(e),o=Ob(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=Js(e),o=Js(t),n||o)return e===t;if(n=xt(e),o=xt(t),n||o)return n&&o?RE(e,t):!1;if(n=an(e),o=an(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Br(e[r],t[r]))return!1}}return String(e)===String(t)}function rm(e,t){return e.findIndex(n=>Br(n,t))}const k4=e=>!!(e&&e.__v_isRef===!0),O=e=>Sn(e)?e:e==null?"":xt(e)||an(e)&&(e.toString===g4||!$t(e.toString))?k4(e)?O(e.value):JSON.stringify(e,b4,2):String(e),b4=(e,t)=>k4(t)?b4(e,t.value):Nc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[Q1(o,i)+" =>"]=s,n),{})}:Oa(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Q1(n))}:Js(t)?Q1(t):an(t)&&!xt(t)&&!em(t)?String(t):t,Q1=(e,t="")=>{var n;return Js(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function BE(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
|
|
7
|
+
* @vue/reactivity v3.5.35
|
|
8
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
+
* @license MIT
|
|
10
|
+
**/let To;class x4{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&&To&&(To.active?(this.parent=To,this.index=(To.scopes||(To.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=To;try{return To=this,t()}finally{To=n}}}on(){++this._on===1&&(this.prevScope=To,To=this)}off(){if(this._on>0&&--this._on===0){if(To===this)To=this.prevScope;else{let t=To;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function DE(e){return new x4(e)}function fy(){return To}function hy(e,t=!1){To&&To.cleanups.push(e)}let Bn;const X1=new WeakSet;class Hh{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,To&&(To.active?To.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,X1.has(this)&&(X1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||_4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Bb(this),S4(this);const t=Bn,n=Oi;Bn=this,Oi=!0;try{return this.fn()}finally{C4(this),Bn=t,Oi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gy(t);this.deps=this.depsTail=void 0,Bb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?X1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Tg(this)&&this.run()}get dirty(){return Tg(this)}}let w4=0,Xu,Ju;function _4(e,t=!1){if(e.flags|=8,t){e.next=Ju,Ju=e;return}e.next=Xu,Xu=e}function py(){w4++}function my(){if(--w4>0)return;if(Ju){let t=Ju;for(Ju=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Xu;){let t=Xu;for(Xu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function S4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function C4(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),gy(o),PE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function Tg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(A4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function A4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===vd)||(e.globalVersion=vd,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Tg(e))))return;e.flags|=2;const t=e.dep,n=Bn,o=Oi;Bn=e,Oi=!0;try{S4(e);const s=e.fn(e._value);(t.version===0||qo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Bn=n,Oi=o,C4(e),e.flags&=-3}}function gy(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)gy(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function PE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Xxe(e,t){e.effect instanceof Hh&&(e=e.effect.fn);const n=new Hh(e);t&&kn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function Jxe(e){e.effect.stop()}let Oi=!0;const M4=[];function Dr(){M4.push(Oi),Oi=!1}function Pr(){const e=M4.pop();Oi=e===void 0?!0:e}function Bb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Bn;Bn=void 0;try{t()}finally{Bn=n}}}let vd=0;class HE{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 lm{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Bn||!Oi||Bn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Bn)n=this.activeLink=new HE(Bn,this),Bn.deps?(n.prevDep=Bn.depsTail,Bn.depsTail.nextDep=n,Bn.depsTail=n):Bn.deps=Bn.depsTail=n,E4(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Bn.depsTail,n.nextDep=void 0,Bn.depsTail.nextDep=n,Bn.depsTail=n,Bn.deps===n&&(Bn.deps=o)}return n}trigger(t){this.version++,vd++,this.notify(t)}notify(t){py();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{my()}}}function E4(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)E4(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Wh=new WeakMap,_a=Symbol(""),Ng=Symbol(""),yd=Symbol("");function Jo(e,t,n){if(Oi&&Bn){let o=Wh.get(e);o||Wh.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new lm),s.map=o,s.key=n),s.track()}}function Tr(e,t,n,o,s,i){const r=Wh.get(e);if(!r){vd++;return}const l=a=>{a&&a.trigger()};if(py(),t==="clear")r.forEach(l);else{const a=xt(e),c=a&&tm(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===yd||!Js(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(yd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(_a)),Nc(e)&&l(r.get(Ng)));break;case"delete":a||(l(r.get(_a)),Nc(e)&&l(r.get(Ng)));break;case"set":Nc(e)&&l(r.get(_a));break}}my()}function WE(e,t){const n=Wh.get(e);return n&&n.get(t)}function nc(e){const t=en(e);return t===e?t:(Jo(t,"iterate",yd),Ks(e)?t:t.map(Di))}function am(e){return Jo(e=en(e),"iterate",yd),e}function er(e,t){return Hr(e)?Kc(_l(e)?Di(t):t):Di(t)}const zE={__proto__:null,[Symbol.iterator](){return J1(this,Symbol.iterator,e=>er(this,e))},concat(...e){return nc(this).concat(...e.map(t=>xt(t)?nc(t):t))},entries(){return J1(this,"entries",e=>(e[1]=er(this,e[1]),e))},every(e,t){return gr(this,"every",e,t,void 0,arguments)},filter(e,t){return gr(this,"filter",e,t,n=>n.map(o=>er(this,o)),arguments)},find(e,t){return gr(this,"find",e,t,n=>er(this,n),arguments)},findIndex(e,t){return gr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gr(this,"findLast",e,t,n=>er(this,n),arguments)},findLastIndex(e,t){return gr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gr(this,"forEach",e,t,void 0,arguments)},includes(...e){return e0(this,"includes",e)},indexOf(...e){return e0(this,"indexOf",e)},join(e){return nc(this).join(e)},lastIndexOf(...e){return e0(this,"lastIndexOf",e)},map(e,t){return gr(this,"map",e,t,void 0,arguments)},pop(){return Iu(this,"pop")},push(...e){return Iu(this,"push",e)},reduce(e,...t){return Db(this,"reduce",e,t)},reduceRight(e,...t){return Db(this,"reduceRight",e,t)},shift(){return Iu(this,"shift")},some(e,t){return gr(this,"some",e,t,void 0,arguments)},splice(...e){return Iu(this,"splice",e)},toReversed(){return nc(this).toReversed()},toSorted(e){return nc(this).toSorted(e)},toSpliced(...e){return nc(this).toSpliced(...e)},unshift(...e){return Iu(this,"unshift",e)},values(){return J1(this,"values",e=>er(this,e))}};function J1(e,t,n){const o=am(e),s=o[t]();return o!==e&&!Ks(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const UE=Array.prototype;function gr(e,t,n,o,s,i){const r=am(e),l=r!==e&&!Ks(e),a=r[t];if(a!==UE[t]){const d=a.apply(e,i);return l?Di(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,er(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function Db(e,t,n,o){const s=am(e),i=s!==e&&!Ks(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=er(e,c)),n.call(this,c,er(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?er(e,a):a}function e0(e,t,n){const o=en(e);Jo(o,"iterate",yd);const s=o[t](...n);return(s===-1||s===!1)&&dm(n[0])?(n[0]=en(n[0]),o[t](...n)):s}function Iu(e,t,n=[]){Dr(),py();const o=en(e)[t].apply(e,n);return my(),Pr(),o}const qE=Xp("__proto__,__v_isRef,__isVue"),T4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Js));function jE(e){Js(e)||(e=String(e));const t=en(this);return Jo(t,"has",e),t.hasOwnProperty(e)}class N4{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?R4:O4:i?F4:$4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=xt(t);if(!s){let a;if(r&&(a=zE[n]))return a;if(n==="hasOwnProperty")return jE}const l=Reflect.get(t,n,po(t)?t:o);if((Js(n)?T4.has(n):qE(n))||(s||Jo(t,"get",n),i))return l;if(po(l)){const a=r&&tm(n)?l:l.value;return s&&an(a)?zh(a):a}return an(l)?s?zh(l):Bo(l):l}}class I4 extends N4{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=xt(t)&&tm(n);if(!this._isShallow){const c=Hr(i);if(!Ks(o)&&!Hr(o)&&(i=en(i),o=en(o)),!r&&po(i)&&!po(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:ln(t,n),a=Reflect.set(t,n,o,po(t)?t:s);return t===en(s)&&(l?qo(o,i)&&Tr(t,"set",n,o):Tr(t,"add",n,o)),a}deleteProperty(t,n){const o=ln(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Tr(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!Js(n)||!T4.has(n))&&Jo(t,"has",n),o}ownKeys(t){return Jo(t,"iterate",xt(t)?"length":_a),Reflect.ownKeys(t)}}class L4 extends N4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const VE=new I4,KE=new L4,GE=new I4(!0),YE=new L4(!0),Ig=e=>e,Nf=e=>Reflect.getPrototypeOf(e);function ZE(e,t,n){return function(...o){const s=this.__v_raw,i=en(s),r=Nc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Ig:t?Kc:Di;return!t&&Jo(i,"iterate",a?Ng:_a),kn(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 If(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function QE(e,t){const n={get(s){const i=this.__v_raw,r=en(i),l=en(s);e||(qo(s,l)&&Jo(r,"get",s),Jo(r,"get",l));const{has:a}=Nf(r),c=t?Ig:e?Kc:Di;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&Jo(en(s),"iterate",_a),s.size},has(s){const i=this.__v_raw,r=en(i),l=en(s);return e||(qo(s,l)&&Jo(r,"has",s),Jo(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=en(l),c=t?Ig:e?Kc:Di;return!e&&Jo(a,"iterate",_a),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return kn(n,e?{add:If("add"),set:If("set"),delete:If("delete"),clear:If("clear")}:{add(s){const i=en(this),r=Nf(i),l=en(s),a=!t&&!Ks(s)&&!Hr(s)?l:s;return r.has.call(i,a)||qo(s,a)&&r.has.call(i,s)||qo(l,a)&&r.has.call(i,l)||(i.add(a),Tr(i,"add",a,a)),this},set(s,i){!t&&!Ks(i)&&!Hr(i)&&(i=en(i));const r=en(this),{has:l,get:a}=Nf(r);let c=l.call(r,s);c||(s=en(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?qo(i,u)&&Tr(r,"set",s,i):Tr(r,"add",s,i),this},delete(s){const i=en(this),{has:r,get:l}=Nf(i);let a=r.call(i,s);a||(s=en(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Tr(i,"delete",s,void 0),c},clear(){const s=en(this),i=s.size!==0,r=s.clear();return i&&Tr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=ZE(s,e,t)}),n}function cm(e,t){const n=QE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(ln(n,s)&&s in o?n:o,s,i)}const XE={get:cm(!1,!1)},JE={get:cm(!1,!0)},eT={get:cm(!0,!1)},tT={get:cm(!0,!0)},$4=new WeakMap,F4=new WeakMap,O4=new WeakMap,R4=new WeakMap;function nT(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bo(e){return Hr(e)?e:um(e,!1,VE,XE,$4)}function oT(e){return um(e,!1,GE,JE,F4)}function zh(e){return um(e,!0,KE,eT,O4)}function ewe(e){return um(e,!0,YE,tT,R4)}function um(e,t,n,o,s){if(!an(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=nT(CE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function _l(e){return Hr(e)?_l(e.__v_raw):!!(e&&e.__v_isReactive)}function Hr(e){return!!(e&&e.__v_isReadonly)}function Ks(e){return!!(e&&e.__v_isShallow)}function dm(e){return e?!!e.__v_raw:!1}function en(e){const t=e&&e.__v_raw;return t?en(t):e}function pt(e){return!ln(e,"__v_skip")&&Object.isExtensible(e)&&v4(e,"__v_skip",!0),e}const Di=e=>an(e)?Bo(e):e,Kc=e=>an(e)?zh(e):e;function po(e){return e?e.__v_isRef===!0:!1}function X(e){return B4(e,!1)}function Ra(e){return B4(e,!0)}function B4(e,t){return po(e)?e:new sT(e,t)}class sT{constructor(t,n){this.dep=new lm,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:en(t),this._value=n?t:Di(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Ks(t)||Hr(t);t=o?t:en(t),qo(t,n)&&(this._rawValue=t,this._value=o?t:Di(t),this.dep.trigger())}}function twe(e){e.dep&&e.dep.trigger()}function C(e){return po(e)?e.value:e}function D4(e){return $t(e)?e():C(e)}const iT={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return po(s)&&!po(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function P4(e){return _l(e)?e:new Proxy(e,iT)}class rT{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new lm,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function lT(e){return new rT(e)}function nwe(e){const t=xt(e)?new Array(e.length):{};for(const n in e)t[n]=H4(e,n);return t}class aT{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Js(n)?n:String(n),this._raw=en(t);let s=!0,i=t;if(!xt(t)||Js(this._key)||!tm(this._key))do s=!dm(i)||Ks(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&po(this._raw[this._key])){const n=this._object[this._key];if(po(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return WE(this._raw,this._key)}}class cT{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 owe(e,t,n){return po(e)?e:$t(e)?new cT(e):an(e)&&arguments.length>1?H4(e,t,n):X(e)}function H4(e,t,n){return new aT(e,t,n)}class uT{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new lm(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=vd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Bn!==this)return _4(this,!0),!0}get value(){const t=this.dep.track();return A4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function dT(e,t,n=!1){let o,s;return $t(e)?o=e:(o=e.get,s=e.set),new uT(o,s,n)}const swe={GET:"get",HAS:"has",ITERATE:"iterate"},iwe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Lf={},Uh=new WeakMap;let hl;function rwe(){return hl}function fT(e,t=!1,n=hl){if(n){let o=Uh.get(n);o||Uh.set(n,o=[]),o.push(e)}}function hT(e,t,n=Qt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=k=>s?k:Ks(k)||s===!1||s===0?Nr(k,1):Nr(k);let u,d,f,h,p=!1,g=!1;if(po(e)?(d=()=>e.value,p=Ks(e)):_l(e)?(d=()=>c(e),p=!0):xt(e)?(g=!0,p=e.some(k=>_l(k)||Ks(k)),d=()=>e.map(k=>{if(po(k))return k.value;if(_l(k))return c(k);if($t(k))return a?a(k,2):k()})):$t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Dr();try{f()}finally{Pr()}}const k=hl;hl=u;try{return a?a(e,3,[h]):e(h)}finally{hl=k}}:d=ki,t&&s){const k=d,A=s===!0?1/0:s;d=()=>Nr(k(),A)}const b=fy(),v=()=>{u.stop(),b&&b.active&&uy(b.effects,u)};if(i&&t){const k=t;t=(...A)=>{k(...A),v()}}let m=g?new Array(e.length).fill(Lf):Lf;const y=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const A=u.run();if(s||p||(g?A.some(($,I)=>qo($,m[I])):qo(A,m))){f&&f();const $=hl;hl=u;try{const I=[A,m===Lf?void 0:g&&m[0]===Lf?[]:m,h];m=A,a?a(t,3,I):t(...I)}finally{hl=$}}}else u.run()};return l&&l(y),u=new Hh(d),u.scheduler=r?()=>r(y,!1):y,h=k=>fT(k,!1,u),f=u.onStop=()=>{const k=Uh.get(u);if(k){if(a)a(k,4);else for(const A of k)A();Uh.delete(u)}},t?o?y(!0):m=u.run():r?r(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function Nr(e,t=1/0,n){if(t<=0||!an(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,po(e))Nr(e.value,t,n);else if(xt(e))for(let o=0;o<e.length;o++)Nr(e[o],t,n);else if(Oa(e)||Nc(e))e.forEach(o=>{Nr(o,t,n)});else if(em(e)){for(const o in e)Nr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Nr(e[o],t,n)}return e}/**
|
|
11
|
+
* @vue/runtime-core v3.5.35
|
|
12
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
+
* @license MIT
|
|
14
|
+
**/const W4=[];function pT(e){W4.push(e)}function mT(){W4.pop()}function lwe(e,t){}const awe={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"},gT={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 qd(e,t,n,o){try{return o?e(...o):e()}catch(s){iu(s,t,n)}}function wi(e,t,n,o){if($t(e)){const s=qd(e,t,n,o);return s&&dy(s)&&s.catch(i=>{iu(i,t,n)}),s}if(xt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(wi(e[i],t,n,o));return s}}function iu(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Qt;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){Dr(),qd(i,null,10,[e,a,c]),Pr();return}}vT(e,n,s,o,r)}function vT(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const ps=[];let Qi=-1;const Lc=[];let pl=null,hc=0;const z4=Promise.resolve();let qh=null;function mt(e){const t=qh||z4;return e?t.then(this?e.bind(this):e):t}function yT(e){let t=Qi+1,n=ps.length;for(;t<n;){const o=t+n>>>1,s=ps[o],i=kd(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function vy(e){if(!(e.flags&1)){const t=kd(e),n=ps[ps.length-1];!n||!(e.flags&2)&&t>=kd(n)?ps.push(e):ps.splice(yT(t),0,e),e.flags|=1,U4()}}function U4(){qh||(qh=z4.then(q4))}function jh(e){xt(e)?Lc.push(...e):pl&&e.id===-1?pl.splice(hc+1,0,e):e.flags&1||(Lc.push(e),e.flags|=1),U4()}function Pb(e,t,n=Qi+1){for(;n<ps.length;n++){const o=ps[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;ps.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Vh(e){if(Lc.length){const t=[...new Set(Lc)].sort((n,o)=>kd(n)-kd(o));if(Lc.length=0,pl){pl.push(...t);return}for(pl=t,hc=0;hc<pl.length;hc++){const n=pl[hc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pl=null,hc=0}}const kd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function q4(e){try{for(Qi=0;Qi<ps.length;Qi++){const t=ps[Qi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),qd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qi<ps.length;Qi++){const t=ps[Qi];t&&(t.flags&=-2)}Qi=-1,ps.length=0,Vh(),qh=null,(ps.length||Lc.length)&&q4()}}let pc,$f=[];function j4(e,t){var n,o;pc=e,pc?(pc.enabled=!0,$f.forEach(({event:s,args:i})=>pc.emit(s,...i)),$f=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{j4(i,t)}),setTimeout(()=>{pc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,$f=[])},3e3)):$f=[]}let Ko=null,fm=null;function bd(e){const t=Ko;return Ko=e,fm=e&&e.type.__scopeId||null,t}function cwe(e){fm=e}function uwe(){fm=null}const dwe=e=>Ee;function Ee(e,t=Ko,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&Qh(-1);const i=bd(t);let r;try{r=e(...s)}finally{bd(i),o._d&&Qh(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function $n(e,t){if(Ko===null)return e;const n=Gd(Ko),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Qt]=t[s];i&&($t(i)&&(i={mounted:i,updated:i}),i.deep&&Nr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Xi(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Dr(),wi(a,n,8,[e.el,l,e,t]),Pr())}}function In(e,t){if(Vo){let n=Vo.provides;const o=Vo.parent&&Vo.parent.provides;o===n&&(n=Vo.provides=Object.create(o)),n[e]=t}}function Kt(e,t,n=!1){const o=Yo();if(o||Sa){let s=Sa?Sa._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&$t(t)?t.call(o&&o.proxy):t}}function fwe(){return!!(Yo()||Sa)}const kT=Symbol.for("v-scx"),bT=()=>Kt(kT);function xT(e,t){return jd(e,null,t)}function hwe(e,t){return jd(e,null,{flush:"post"})}function wT(e,t){return jd(e,null,{flush:"sync"})}function Qe(e,t,n){return jd(e,t,n)}function jd(e,t,n=Qt){const{immediate:o,deep:s,flush:i,once:r}=n,l=kn({},n),a=t&&o||!t&&i!=="post";let c;if(Ta){if(i==="sync"){const h=bT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=ki,h.resume=ki,h.pause=ki,h}}const u=Vo;l.call=(h,p,g)=>wi(h,u,p,g);let d=!1;i==="post"?l.scheduler=h=>{vo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():vy(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=hT(e,t,l);return Ta&&(c?c.push(f):a&&f()),f}function _T(e,t,n){const o=this.proxy,s=Sn(e)?e.includes(".")?V4(o,e):()=>o[e]:e.bind(o,o);let i;$t(t)?i=t:(i=t.handler,n=t);const r=ru(this),l=jd(s,i.bind(o),n);return r(),l}function V4(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const ul=new WeakMap,K4=Symbol("_vte"),G4=e=>e.__isTeleport,fa=e=>e&&(e.disabled||e.disabled===""),ST=e=>e&&(e.defer||e.defer===""),Hb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Wb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Lg=(e,t)=>{const n=e&&e.to;return Sn(n)?t?t(n):null:n},CT={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:b,parentNode:v}}=c,m=fa(t.props);let{dynamicChildren:y}=t;const k=(I,x,L)=>{I.shapeFlag&16&&u(I.children,x,L,s,i,r,l,a)},A=(I=t)=>{const x=fa(I.props),L=I.target=Lg(I.props,p),E=$g(L,I,g,h);L&&(r!=="svg"&&Hb(L)?r="svg":r!=="mathml"&&Wb(L)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(L),x||(k(I,L,E),zu(I,!1)))},$=I=>{const x=()=>{if(ul.get(I)===x){if(ul.delete(I),fa(I.props)){const L=v(I.el)||n;k(I,L,I.anchor),zu(I,!0)}A(I)}};ul.set(I,x),vo(x,i)};if(e==null){const I=t.el=g(""),x=t.anchor=g("");if(h(I,n,o),h(x,n,o),ST(t.props)||i&&i.pendingBranch){$(t);return}m&&(k(t,n,x),zu(t,!0)),A()}else{t.el=e.el;const I=t.anchor=e.anchor,x=ul.get(e);if(x){x.flags|=8,ul.delete(e),$(t);return}t.targetStart=e.targetStart;const L=t.target=e.target,E=t.targetAnchor=e.targetAnchor,F=fa(e.props),S=F?n:L,N=F?I:E;if(r==="svg"||Hb(L)?r="svg":(r==="mathml"||Wb(L))&&(r="mathml"),y?(f(e.dynamicChildren,y,S,s,i,r,l),My(e,t,!0)):a||d(e,t,S,N,s,i,r,l,!1),m)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ff(t,n,I,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=Lg(t.props,p);D&&Ff(t,D,null,c,0)}else F&&Ff(t,L,E,c,1);zu(t,m)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!fa(f),p=ul.get(e);if(p&&(p.flags|=8,ul.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let g=0;g<l.length;g++){const b=l[g];o(b,t,n,h,!!b.dynamicChildren)}},move:Ff,hydrate:AT};function Ff(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!ul.has(e)&&(!d||fa(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function AT(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,v){let m=v;for(;m;){if(m&&m.nodeType===8){if(m.data==="teleport start anchor")t.targetStart=m;else if(m.data==="teleport anchor"){t.targetAnchor=m,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}m=r(m)}}function h(b,v){v.anchor=d(r(b),v,l(b),n,o,s,i)}const p=t.target=Lg(t.props,a),g=fa(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(g?(h(e,t),f(p,b),t.targetAnchor||$g(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||$g(p,t,u,c),d(b&&r(b),t,p,n,o,s,i))),zu(t,g)}else g&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const hm=CT;function zu(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function $g(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[K4]=r,e&&(o(i,e,s),o(r,e,s)),r}const fi=Symbol("_leaveCb"),Lu=Symbol("_enterCb");function Y4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return cn(()=>{e.isMounted=!0}),mo(()=>{e.isUnmounting=!0}),e}const ri=[Function,Array],Z4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ri,onEnter:ri,onAfterEnter:ri,onEnterCancelled:ri,onBeforeLeave:ri,onLeave:ri,onAfterLeave:ri,onLeaveCancelled:ri,onBeforeAppear:ri,onAppear:ri,onAfterAppear:ri,onAppearCancelled:ri},Q4=e=>{const t=e.subTree;return t.component?Q4(t.component):t},MT={name:"BaseTransition",props:Z4,setup(e,{slots:t}){const n=Yo(),o=Y4();return()=>{const s=t.default&&yy(t.default(),!0),i=s&&s.length?X4(s):n.subTree?ce():void 0;if(!i)return;const r=en(e),{mode:l}=r;if(o.isLeaving)return t0(i);const a=zb(i);if(!a)return t0(i);let c=xd(a,r,o,n,d=>c=d);a.type!==bo&&Tl(a,c);let u=n.subTree&&zb(n.subTree);if(u&&u.type!==bo&&!Ii(u,a)&&Q4(n).type!==bo){let d=xd(u,r,o,n);if(Tl(u,d),l==="out-in"&&a.type!==bo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},t0(i);l==="in-out"&&a.type!==bo?d.delayLeave=(f,h,p)=>{const g=J4(o,u);g[String(u.key)]=u,f[fi]=()=>{h(),f[fi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function X4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==bo){t=n;break}}return t}const ET=MT;function J4(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function xd(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:b,onAppear:v,onAfterAppear:m,onAppearCancelled:y}=t,k=String(e.key),A=J4(n,e),$=(L,E)=>{L&&wi(L,o,9,E)},I=(L,E)=>{const F=E[1];$(L,E),xt(L)?L.every(S=>S.length<=1)&&F():L.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(L){let E=a;if(!n.isMounted)if(i)E=b||a;else return;L[fi]&&L[fi](!0);const F=A[k];F&&Ii(e,F)&&F.el[fi]&&F.el[fi](),$(E,[L])},enter(L){if(A[k]===e)return;let E=c,F=u,S=d;if(!n.isMounted)if(i)E=v||c,F=m||u,S=y||d;else return;let N=!1;L[Lu]=B=>{N||(N=!0,B?$(S,[L]):$(F,[L]),x.delayedLeave&&x.delayedLeave(),L[Lu]=void 0)};const D=L[Lu].bind(null,!1);E?I(E,[L,D]):D()},leave(L,E){const F=String(e.key);if(L[Lu]&&L[Lu](!0),n.isUnmounting)return E();$(f,[L]);let S=!1;L[fi]=D=>{S||(S=!0,E(),D?$(g,[L]):$(p,[L]),L[fi]=void 0,A[F]===e&&delete A[F])};const N=L[fi].bind(null,!1);A[F]=e,h?I(h,[L,N]):N()},clone(L){const E=xd(L,t,n,o,s);return s&&s(E),E}};return x}function t0(e){if(Vd(e))return e=Wr(e),e.children=null,e}function zb(e){if(!Vd(e))return G4(e.type)&&e.children?X4(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&&$t(n.default))return n.default()}}function Tl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Tl(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 yy(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Pe?(r.patchFlag&128&&s++,o=o.concat(yy(r.children,t,l))):(t||r.type!==bo)&&o.push(l!=null?Wr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Ze(e,t){return $t(e)?kn({name:e.name},t,{setup:e}):e}function pwe(){const e=Yo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function ky(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function mwe(e){const t=Yo(),n=Ra(null);if(t){const s=t.refs===Qt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Ub(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Kh=new WeakMap;function $c(e,t,n,o,s=!1){if(xt(e)){e.forEach((g,b)=>$c(g,t&&(xt(t)?t[b]:t),n,o,s));return}if(Or(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&$c(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Gd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Qt?l.refs={}:l.refs,d=l.setupState,f=en(d),h=d===Qt?m4:g=>Ub(u,g)?!1:ln(f,g),p=(g,b)=>!(b&&Ub(u,b));if(c!=null&&c!==a){if(qb(t),Sn(c))u[c]=null,h(c)&&(d[c]=null);else if(po(c)){const g=t;p(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if($t(a))qd(a,l,12,[r,u]);else{const g=Sn(a),b=po(a);if(g||b){const v=()=>{if(e.f){const m=g?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)xt(m)&&uy(m,i);else if(xt(m))m.includes(i)||m.push(i);else if(g)u[a]=[i],h(a)&&(d[a]=u[a]);else{const y=[i];p(a,e.k)&&(a.value=y),e.k&&(u[e.k]=y)}}else g?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const m=()=>{v(),Kh.delete(e)};m.id=-1,Kh.set(e,m),vo(m,n)}else qb(e),v()}}}function qb(e){const t=Kh.get(e);t&&(t.flags|=8,Kh.delete(e))}let jb=!1;const oc=()=>{jb||(console.error("Hydration completed but contains mismatches."),jb=!0)},TT=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",NT=e=>e.namespaceURI.includes("MathML"),Of=e=>{if(e.nodeType===1){if(TT(e))return"svg";if(NT(e))return"mathml"}},xc=e=>e.nodeType===8;function IT(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(y,k)=>{if(!k.hasChildNodes()){n(null,y,k),Vh(),k._vnode=y;return}d(k.firstChild,y,null,null,null),Vh(),k._vnode=y},d=(y,k,A,$,I,x=!1)=>{x=x||!!k.dynamicChildren;const L=xc(y)&&y.data==="[",E=()=>g(y,k,A,$,I,L),{type:F,ref:S,shapeFlag:N,patchFlag:D}=k;let B=y.nodeType;k.el=y,D===-2&&(x=!1,k.dynamicChildren=null);let U=null;switch(F){case Sl:B!==3?k.children===""?(a(k.el=s(""),r(y),y),U=y):U=E():(y.data!==k.children&&(oc(),y.data=k.children),U=i(y));break;case bo:m(y)?(U=i(y),v(k.el=y.content.firstChild,y,A)):B!==8||L?U=E():U=i(y);break;case Oc:if(L&&(y=i(y),B=y.nodeType),B===1||B===3){U=y;const H=!k.children.length;for(let P=0;P<k.staticCount;P++)H&&(k.children+=U.nodeType===1?U.outerHTML:U.data),P===k.staticCount-1&&(k.anchor=U),U=i(U);return L?i(U):U}else E();break;case Pe:L?U=p(y,k,A,$,I,x):U=E();break;default:if(N&1)(B!==1||k.type.toLowerCase()!==y.tagName.toLowerCase())&&!m(y)?U=E():U=f(y,k,A,$,I,x);else if(N&6){k.slotScopeIds=I;const H=r(y);if(L?U=b(y):xc(y)&&y.data==="teleport start"?U=b(y,y.data,"teleport end"):U=i(y),t(k,H,null,A,$,Of(H),x),Or(k)&&!k.type.__asyncResolved){let P;L?(P=re(Pe),P.anchor=U?U.previousSibling:H.lastChild):P=y.nodeType===3?Je(""):re("div"),P.el=y,k.component.subTree=P}}else N&64?B!==8?U=E():U=k.type.hydrate(y,k,A,$,I,x,e,h):N&128&&(U=k.type.hydrate(y,k,A,$,Of(r(y)),I,x,e,d))}return S!=null&&$c(S,null,$,k),U},f=(y,k,A,$,I,x)=>{x=x||!!k.dynamicChildren;const{type:L,props:E,patchFlag:F,shapeFlag:S,dirs:N,transition:D}=k,B=L==="input"||L==="option";if(B||F!==-1){N&&Xi(k,null,A,"created");let U=!1;if(m(y)){U=k3(null,D)&&A&&A.vnode.props&&A.vnode.props.appear;const P=y.content.firstChild;if(U){const Z=P.getAttribute("class");Z&&(P.$cls=Z),D.beforeEnter(P)}v(P,y,A),k.el=y=P}if(S&16&&!(E&&(E.innerHTML||E.textContent))){let P=h(y.firstChild,k,y,A,$,I,x);for(P&&!Rf(y,1)&&oc();P;){const Z=P;P=P.nextSibling,l(Z)}}else if(S&8){let P=k.children;P[0]===`
|
|
15
|
+
`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(P=P.slice(1));const{textContent:Z}=y;Z!==P&&Z!==P.replace(/\r\n|\r/g,`
|
|
16
|
+
`)&&(Rf(y,0)||oc(),y.textContent=k.children)}if(E){if(B||!x||F&48){const P=y.tagName.includes("-");for(const Z in E)(B&&(Z.endsWith("value")||Z==="indeterminate")||Ud(Z)&&!wa(Z)||Z[0]==="."||P&&!wa(Z))&&o(y,Z,null,E[Z],void 0,A)}else if(E.onClick)o(y,"onClick",null,E.onClick,void 0,A);else if(F&4&&_l(E.style))for(const P in E.style)E.style[P]}let H;(H=E&&E.onVnodeBeforeMount)&&Es(H,A,k),N&&Xi(k,null,A,"beforeMount"),((H=E&&E.onVnodeMounted)||N||U)&&_3(()=>{H&&Es(H,A,k),U&&D.enter(y),N&&Xi(k,null,A,"mounted")},$)}return y.nextSibling},h=(y,k,A,$,I,x,L)=>{L=L||!!k.dynamicChildren;const E=k.children,F=E.length;let S=!1;for(let N=0;N<F;N++){const D=L?E[N]:E[N]=Ns(E[N]),B=D.type===Sl;y?(B&&!L&&N+1<F&&Ns(E[N+1]).type===Sl&&(a(s(y.data.slice(D.children.length)),A,i(y)),y.data=D.children),y=d(y,D,$,I,x,L)):B&&!D.children?a(D.el=s(""),A):(S||(S=!0,Rf(A,1)||oc()),n(null,D,A,null,$,I,Of(A),x))}return y},p=(y,k,A,$,I,x)=>{const{slotScopeIds:L}=k;L&&(I=I?I.concat(L):L);const E=r(y),F=h(i(y),k,E,A,$,I,x);return F&&xc(F)&&F.data==="]"?i(k.anchor=F):(oc(),a(k.anchor=c("]"),E,F),F)},g=(y,k,A,$,I,x)=>{if(Rf(y.parentElement,1)||oc(),k.el=null,x){const F=b(y);for(;;){const S=i(y);if(S&&S!==F)l(S);else break}}const L=i(y),E=r(y);return l(y),n(null,k,E,L,A,$,Of(E),I),A&&(A.vnode.el=k.el,gm(A,k.el)),L},b=(y,k="[",A="]")=>{let $=0;for(;y;)if(y=i(y),y&&xc(y)&&(y.data===k&&$++,y.data===A)){if($===0)return i(y);$--}return y},v=(y,k,A)=>{const $=k.parentNode;$&&$.replaceChild(y,k);let I=A;for(;I;)I.vnode.el===k&&(I.vnode.el=I.subTree.el=y),I=I.parent},m=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const Vb="data-allow-mismatch",LT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Rf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Vb);)e=e.parentElement;const n=e&&e.getAttribute(Vb);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(LT[t])}}const $T=im().requestIdleCallback||(e=>setTimeout(e,1)),FT=im().cancelIdleCallback||(e=>clearTimeout(e)),gwe=(e=1e4)=>t=>{const n=$T(t,{timeout:e});return()=>FT(n)};function OT(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const vwe=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(OT(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},ywe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},kwe=(e=[])=>(t,n)=>{Sn(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function RT(e,t){if(xc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(xc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Or=e=>!!e.type.__asyncLoader;function Li(e){$t(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((b,v)=>{a(g,()=>b(f()),()=>v(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ze({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,b){let v=!1;(g.bu||(g.bu=[])).push(()=>v=!0);const m=()=>{v||b()},y=i?()=>{const k=i(m,A=>RT(p,A));k&&(g.bum||(g.bum=[])).push(k)}:m;u?y():h().then(()=>!g.isUnmounted&&y())},get __asyncResolved(){return u},setup(){const p=Vo;if(ky(p),u)return()=>Bf(u,p);const g=y=>{c=null,iu(y,p,13,!o)};if(l&&p.suspense||Ta)return h().then(y=>()=>Bf(y,p)).catch(y=>(g(y),()=>o?re(o,{error:y}):null));const b=X(!1),v=X(),m=X(!!s);return s&&setTimeout(()=>{m.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!v.value){const y=new Error(`Async component timed out after ${r}ms.`);g(y),v.value=y}},r),h().then(()=>{b.value=!0,p.parent&&Vd(p.parent.vnode)&&p.parent.update()}).catch(y=>{g(y),v.value=y}),()=>{if(b.value&&u)return Bf(u,p);if(v.value&&o)return re(o,{error:v.value});if(n&&!m.value)return Bf(n,p)}}})}function Bf(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=re(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Vd=e=>e.type.__isKeepAlive,BT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Yo(),o=n.ctx;if(!o.renderer)return()=>{const m=t.default&&t.default();return m&&m.length===1?m[0]:m};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(m,y,k,A,$)=>{const I=m.component;c(m,y,k,0,l),a(I.vnode,m,y,k,I,l,A,m.slotScopeIds,$),vo(()=>{I.isDeactivated=!1,I.a&&Ic(I.a);const x=m.props&&m.props.onVnodeMounted;x&&Es(x,I.parent,m)},l)},o.deactivate=m=>{const y=m.component;Yh(y.m),Yh(y.a),c(m,f,null,1,l),vo(()=>{y.da&&Ic(y.da);const k=m.props&&m.props.onVnodeUnmounted;k&&Es(k,y.parent,m),y.isDeactivated=!0},l)};function h(m){n0(m),u(m,n,l,!0)}function p(m){s.forEach((y,k)=>{const A=zg(Or(y)?y.type.__asyncResolved||{}:y.type);A&&!m(A)&&g(k)})}function g(m){const y=s.get(m);y&&(!r||!Ii(y,r))?h(y):r&&n0(r),s.delete(m),i.delete(m)}Qe(()=>[e.include,e.exclude],([m,y])=>{m&&p(k=>Uu(m,k)),y&&p(k=>!Uu(y,k))},{flush:"post",deep:!0});let b=null;const v=()=>{b!=null&&(Zh(n.subTree.type)?vo(()=>{s.set(b,Df(n.subTree))},n.subTree.suspense):s.set(b,Df(n.subTree)))};return cn(v),by(v),mo(()=>{s.forEach(m=>{const{subTree:y,suspense:k}=n,A=Df(y);if(m.type===A.type&&m.key===A.key){n0(A);const $=A.component.da;$&&vo($,k);return}h(m)})}),()=>{if(b=null,!t.default)return r=null;const m=t.default(),y=m[0];if(m.length>1)return r=null,m;if(!Nl(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return r=null,y;let k=Df(y);if(k.type===bo)return r=null,k;const A=k.type,$=zg(Or(k)?k.type.__asyncResolved||{}:A),{include:I,exclude:x,max:L}=e;if(I&&(!$||!Uu(I,$))||x&&$&&Uu(x,$))return k.shapeFlag&=-257,r=k,y;const E=k.key==null?A:k.key,F=s.get(E);return k.el&&(k=Wr(k),y.shapeFlag&128&&(y.ssContent=k)),b=E,F?(k.el=F.el,k.component=F.component,k.transition&&Tl(k,k.transition),k.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),L&&i.size>parseInt(L,10)&&g(i.values().next().value)),k.shapeFlag|=256,r=k,Zh(y.type)?y:k}}},bwe=BT;function Uu(e,t){return xt(e)?e.some(n=>Uu(n,t)):Sn(e)?e.split(",").includes(t):SE(e)?(e.lastIndex=0,e.test(t)):!1}function DT(e,t){e3(e,"a",t)}function PT(e,t){e3(e,"da",t)}function e3(e,t,n=Vo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(pm(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Vd(s.parent.vnode)&&HT(o,t,n,s),s=s.parent}}function HT(e,t,n,o){const s=pm(t,e,o,!0);bn(()=>{uy(o[t],s)},n)}function n0(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Df(e){return e.shapeFlag&128?e.ssContent:e}function pm(e,t,n=Vo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Dr();const l=ru(n),a=wi(t,n,e,r);return l(),Pr(),a});return o?s.unshift(i):s.push(i),i}}const Ur=e=>(t,n=Vo)=>{(!Ta||e==="sp")&&pm(e,(...o)=>t(...o),n)},WT=Ur("bm"),cn=Ur("m"),t3=Ur("bu"),by=Ur("u"),mo=Ur("bum"),bn=Ur("um"),zT=Ur("sp"),UT=Ur("rtg"),qT=Ur("rtc");function jT(e,t=Vo){pm("ec",e,t)}const xy="components",VT="directives";function KT(e,t){return wy(xy,e,!0,t)||e}const n3=Symbol.for("v-ndc");function jo(e){return Sn(e)?wy(xy,e,!1)||e:e||n3}function xwe(e){return wy(VT,e)}function wy(e,t,n=!0,o=!1){const s=Ko||Vo;if(s){const i=s.type;if(e===xy){const l=zg(i,!1);if(l&&(l===t||l===No(t)||l===om(No(t))))return i}const r=Kb(s[e]||i[e],t)||Kb(s.appContext[e],t);return!r&&o?i:r}}function Kb(e,t){return e&&(e[t]||e[No(t)]||e[om(No(t))])}function ot(e,t,n,o){let s;const i=n&&n[o],r=xt(e);if(r||Sn(e)){const l=r&&_l(e);let a=!1,c=!1;l&&(a=!Ks(e),c=Hr(e),e=am(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?Kc(Di(e[u])):Di(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(an(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function o3(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(xt(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function Fn(e,t,n={},o,s){if(Ko.ce||Ko.parent&&Or(Ko.parent)&&Ko.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),xe(Pe,null,[re("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&_y(i(n)),l=n.key||r&&r.key,a=xe(Pe,{key:(l&&!Js(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function _y(e){return e.some(t=>Nl(t)?!(t.type===bo||t.type===Pe&&!_y(t.children)):!0)?e:null}function wwe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:gh(o)]=e[o];return n}const Fg=e=>e?E3(e)?Gd(e):Fg(e.parent):null,ed=kn(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=>Fg(e.parent),$root:e=>Fg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Sy(e),$forceUpdate:e=>e.f||(e.f=()=>{vy(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>_T.bind(e)}),o0=(e,t)=>e!==Qt&&!e.__isScriptSetup&&ln(e,t),Og={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(o0(o,t))return r[t]=1,o[t];if(s!==Qt&&ln(s,t))return r[t]=2,s[t];if(ln(i,t))return r[t]=3,i[t];if(n!==Qt&&ln(n,t))return r[t]=4,n[t];Rg&&(r[t]=0)}}const c=ed[t];let u,d;if(c)return t==="$attrs"&&Jo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Qt&&ln(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,ln(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return o0(s,t)?(s[t]=n,!0):o!==Qt&&ln(o,t)?(o[t]=n,!0):ln(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==Qt&&l[0]!=="$"&&ln(e,l)||o0(t,l)||ln(i,l)||ln(o,l)||ln(ed,l)||ln(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ln(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},GT=kn({},Og,{get(e,t){if(t!==Symbol.unscopables)return Og.get(e,t,e)},has(e,t){return t[0]!=="_"&&!TE(t)}});function _we(){return null}function Swe(){return null}function Cwe(e){}function Awe(e){}function Mwe(){return null}function Ewe(){}function Twe(e,t){return null}function Nwe(){return s3().slots}function Kd(){return s3().attrs}function s3(e){const t=Yo();return t.setupContext||(t.setupContext=I3(t))}function wd(e){return xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Iwe(e,t){const n=wd(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?xt(s)||$t(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function Lwe(e,t){return!e||!t?e||t:xt(e)&&xt(t)?e.concat(t):kn({},wd(e),wd(t))}function $we(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Fwe(e){const t=Yo(),n=Ta;let o=e();Sd(),n&&Rc(!1);const s=()=>{ru(t),n&&Rc(!0)},i=()=>{Yo()!==t&&t.scope.off(),Sd(),n&&Rc(!1)};return dy(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Rg=!0;function YT(e){const t=Sy(e),n=e.proxy,o=e.ctx;Rg=!1,t.beforeCreate&&Gb(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:g,deactivated:b,beforeDestroy:v,beforeUnmount:m,destroyed:y,unmounted:k,render:A,renderTracked:$,renderTriggered:I,errorCaptured:x,serverPrefetch:L,expose:E,inheritAttrs:F,components:S,directives:N,filters:D}=t;if(c&&ZT(c,o,null),r)for(const H in r){const P=r[H];$t(P)&&(o[H]=P.bind(n))}if(s){const H=s.call(n,n);an(H)&&(e.data=Bo(H))}if(Rg=!0,i)for(const H in i){const P=i[H],Z=$t(P)?P.bind(n,n):$t(P.get)?P.get.bind(n,n):ki,K=!$t(P)&&$t(P.set)?P.set.bind(n):ki,V=R({get:Z,set:K});Object.defineProperty(o,H,{enumerable:!0,configurable:!0,get:()=>V.value,set:J=>V.value=J})}if(l)for(const H in l)i3(l[H],o,n,H);if(a){const H=$t(a)?a.call(n):a;Reflect.ownKeys(H).forEach(P=>{In(P,H[P])})}u&&Gb(u,e,"c");function U(H,P){xt(P)?P.forEach(Z=>H(Z.bind(n))):P&&H(P.bind(n))}if(U(WT,d),U(cn,f),U(t3,h),U(by,p),U(DT,g),U(PT,b),U(jT,x),U(qT,$),U(UT,I),U(mo,m),U(bn,k),U(zT,L),xt(E))if(E.length){const H=e.exposed||(e.exposed={});E.forEach(P=>{Object.defineProperty(H,P,{get:()=>n[P],set:Z=>n[P]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===ki&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),N&&(e.directives=N),L&&ky(e)}function ZT(e,t,n=ki){xt(e)&&(e=Bg(e));for(const o in e){const s=e[o];let i;an(s)?"default"in s?i=Kt(s.from||o,s.default,!0):i=Kt(s.from||o):i=Kt(s),po(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function Gb(e,t,n){wi(xt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function i3(e,t,n,o){let s=o.includes(".")?V4(n,o):()=>n[o];if(Sn(e)){const i=t[e];$t(i)&&Qe(s,i)}else if($t(e))Qe(s,e.bind(n));else if(an(e))if(xt(e))e.forEach(i=>i3(i,t,n,o));else{const i=$t(e.handler)?e.handler.bind(n):t[e.handler];$t(i)&&Qe(s,i,e)}}function Sy(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>Gh(a,c,r,!0)),Gh(a,t,r)),an(t)&&i.set(t,a),a}function Gh(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Gh(e,i,n,!0),s&&s.forEach(r=>Gh(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=QT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const QT={data:Yb,props:Zb,emits:Zb,methods:qu,computed:qu,beforeCreate:cs,created:cs,beforeMount:cs,mounted:cs,beforeUpdate:cs,updated:cs,beforeDestroy:cs,beforeUnmount:cs,destroyed:cs,unmounted:cs,activated:cs,deactivated:cs,errorCaptured:cs,serverPrefetch:cs,components:qu,directives:qu,watch:JT,provide:Yb,inject:XT};function Yb(e,t){return t?e?function(){return kn($t(e)?e.call(this,this):e,$t(t)?t.call(this,this):t)}:t:e}function XT(e,t){return qu(Bg(e),Bg(t))}function Bg(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function cs(e,t){return e?[...new Set([].concat(e,t))]:t}function qu(e,t){return e?kn(Object.create(null),e,t):t}function Zb(e,t){return e?xt(e)&&xt(t)?[...new Set([...e,...t])]:kn(Object.create(null),wd(e),wd(t??{})):t}function JT(e,t){if(!e)return t;if(!t)return e;const n=kn(Object.create(null),e);for(const o in t)n[o]=cs(e[o],t[o]);return n}function r3(){return{app:null,config:{isNativeTag:m4,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 e9=0;function t9(e,t){return function(o,s=null){$t(o)||(o=kn({},o)),s!=null&&!an(s)&&(s=null);const i=r3(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:e9++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:I9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&$t(u.install)?(r.add(u),u.install(c,...d)):$t(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||re(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,Gd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(wi(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=Sa;Sa=c;try{return u()}finally{Sa=d}}};return c}}let Sa=null;function Owe(e,t,n=Qt){const o=Yo(),s=No(t),i=Is(t),r=l3(e,s),l=lT((a,c)=>{let u,d=Qt,f;return wT(()=>{const h=e[s];qo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!qo(p,u)&&!(d!==Qt&&qo(h,d)))return;const g=o.vnode.props;g&&(t in g||s in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${s}`in g||`onUpdate:${i}`in g)||(u=h,c()),o.emit(`update:${t}`,p),qo(h,p)&&qo(h,d)&&!qo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Qt:l,done:!1}:{done:!0}}}},l}const l3=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${No(t)}Modifiers`]||e[`${Is(t)}Modifiers`];function n9(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Qt;let s=n;const i=t.startsWith("update:"),r=i&&l3(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>Sn(u)?u.trim():u)),r.number&&(s=n.map(sm)));let l,a=o[l=gh(t)]||o[l=gh(No(t))];!a&&i&&(a=o[l=gh(Is(t))]),a&&wi(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,wi(c,e,6,s)}}const o9=new WeakMap;function a3(e,t,n=!1){const o=n?o9:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!$t(e)){const a=c=>{const u=a3(c,t,!0);u&&(l=!0,kn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(an(e)&&o.set(e,null),null):(xt(i)?i.forEach(a=>r[a]=null):kn(r,i),an(e)&&o.set(e,r),r)}function mm(e,t){return!e||!Ud(t)?!1:(t=t.slice(2).replace(/Once$/,""),ln(e,t[0].toLowerCase()+t.slice(1))||ln(e,Is(t))||ln(e,t))}function vh(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:g}=e,b=bd(e);let v,m;try{if(n.shapeFlag&4){const k=s||o,A=k;v=Ns(c.call(A,k,u,d,h,f,p)),m=l}else{const k=t;v=Ns(k.length>1?k(d,{attrs:l,slots:r,emit:a}):k(d,null)),m=t.props?l:i9(l)}}catch(k){td.length=0,iu(k,e,1),v=re(bo)}let y=v;if(m&&g!==!1){const k=Object.keys(m),{shapeFlag:A}=y;k.length&&A&7&&(i&&k.some(Jp)&&(m=r9(m,i)),y=Wr(y,m,!1,!0))}return n.dirs&&(y=Wr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Tl(y,n.transition),v=y,bd(b),v}function s9(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Nl(s)){if(s.type!==bo||s.children==="v-if"){if(n)return;n=s}}else return}return n}const i9=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ud(n))&&((t||(t={}))[n]=e[n]);return t},r9=(e,t)=>{const n={};for(const o in e)(!Jp(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function l9(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?Qb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(c3(r,o,f)&&!mm(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?Qb(o,r,c):!0:!!r;return!1}function Qb(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(c3(t,e,i)&&!mm(n,i))return!0}return!1}function c3(e,t,n){const o=e[n],s=t[n];return n==="style"&&an(o)&&an(s)?!Br(o,s):o!==s}function gm({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const u3={},d3=()=>Object.create(u3),f3=e=>Object.getPrototypeOf(e)===u3;function a9(e,t,n,o=!1){const s={},i=d3();e.propsDefaults=Object.create(null),h3(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:oT(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function c9(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=en(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(mm(e.emitsOptions,f))continue;const h=t[f];if(a)if(ln(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=No(f);s[p]=Dg(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{h3(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!ln(t,d)&&((u=Is(d))===d||!ln(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Dg(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!ln(t,d))&&(delete i[d],c=!0)}c&&Tr(e.attrs,"set","")}function h3(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(wa(a))continue;const c=t[a];let u;s&&ln(s,u=No(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:mm(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=en(n),c=l||Qt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Dg(s,a,d,c[d],e,!ln(c,d))}}return r}function Dg(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=ln(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&$t(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=ru(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===Is(n))&&(o=!0))}return o}const u9=new WeakMap;function p3(e,t,n=!1){const o=n?u9:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!$t(e)){const u=d=>{a=!0;const[f,h]=p3(d,t,!0);kn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return an(e)&&o.set(e,Tc),Tc;if(xt(i))for(let u=0;u<i.length;u++){const d=No(i[u]);Xb(d)&&(r[d]=Qt)}else if(i)for(const u in i){const d=No(u);if(Xb(d)){const f=i[u],h=r[d]=xt(f)||$t(f)?{type:f}:kn({},f),p=h.type;let g=!1,b=!0;if(xt(p))for(let v=0;v<p.length;++v){const m=p[v],y=$t(m)&&m.name;if(y==="Boolean"){g=!0;break}else y==="String"&&(b=!1)}else g=$t(p)&&p.name==="Boolean";h[0]=g,h[1]=b,(g||ln(h,"default"))&&l.push(d)}}const c=[r,l];return an(e)&&o.set(e,c),c}function Xb(e){return e[0]!=="$"&&!wa(e)}const Cy=e=>e==="_"||e==="_ctx"||e==="$stable",Ay=e=>xt(e)?e.map(Ns):[Ns(e)],d9=(e,t,n)=>{if(t._n)return t;const o=Ee((...s)=>Ay(t(...s)),n);return o._c=!1,o},m3=(e,t,n)=>{const o=e._ctx;for(const s in e){if(Cy(s))continue;const i=e[s];if($t(i))t[s]=d9(s,i,o);else if(i!=null){const r=Ay(i);t[s]=()=>r}}},g3=(e,t)=>{const n=Ay(t);e.slots.default=()=>n},v3=(e,t,n)=>{for(const o in t)(n||!Cy(o))&&(e[o]=t[o])},f9=(e,t,n)=>{const o=e.slots=d3();if(e.vnode.shapeFlag&32){const s=t._;s?(v3(o,t,n),n&&v4(o,"_",s,!0)):m3(t,o)}else t&&g3(e,t)},h9=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Qt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:v3(s,t,n):(i=!t.$stable,m3(t,s)),r=t}else t&&(g3(e,t),r={default:1});if(i)for(const l in s)!Cy(l)&&r[l]==null&&delete s[l]},vo=_3;function p9(e){return y3(e)}function m9(e){return y3(e,IT)}function y3(e,t){const n=im();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=ki,insertStaticContent:p}=e,g=(q,ee,ye,fe=null,ve=null,j=null,te=void 0,me=null,Ae=!!ee.dynamicChildren)=>{if(q===ee)return;q&&!Ii(q,ee)&&(fe=Ce(q),J(q,ve,j,!0),q=null),ee.patchFlag===-2&&(Ae=!1,ee.dynamicChildren=null);const{type:$e,ref:De,shapeFlag:ge}=ee;switch($e){case Sl:b(q,ee,ye,fe);break;case bo:v(q,ee,ye,fe);break;case Oc:q==null&&m(ee,ye,fe,te);break;case Pe:S(q,ee,ye,fe,ve,j,te,me,Ae);break;default:ge&1?A(q,ee,ye,fe,ve,j,te,me,Ae):ge&6?N(q,ee,ye,fe,ve,j,te,me,Ae):(ge&64||ge&128)&&$e.process(q,ee,ye,fe,ve,j,te,me,Ae,z)}De!=null&&ve?$c(De,q&&q.ref,j,ee||q,!ee):De==null&&q&&q.ref!=null&&$c(q.ref,null,j,q,!0)},b=(q,ee,ye,fe)=>{if(q==null)o(ee.el=l(ee.children),ye,fe);else{const ve=ee.el=q.el;ee.children!==q.children&&c(ve,ee.children)}},v=(q,ee,ye,fe)=>{q==null?o(ee.el=a(ee.children||""),ye,fe):ee.el=q.el},m=(q,ee,ye,fe)=>{[q.el,q.anchor]=p(q.children,ee,ye,fe,q.el,q.anchor)},y=({el:q,anchor:ee},ye,fe)=>{let ve;for(;q&&q!==ee;)ve=f(q),o(q,ye,fe),q=ve;o(ee,ye,fe)},k=({el:q,anchor:ee})=>{let ye;for(;q&&q!==ee;)ye=f(q),s(q),q=ye;s(ee)},A=(q,ee,ye,fe,ve,j,te,me,Ae)=>{if(ee.type==="svg"?te="svg":ee.type==="math"&&(te="mathml"),q==null)$(ee,ye,fe,ve,j,te,me,Ae);else{const $e=q.el&&q.el._isVueCE?q.el:null;try{$e&&$e._beginPatch(),L(q,ee,ve,j,te,me,Ae)}finally{$e&&$e._endPatch()}}},$=(q,ee,ye,fe,ve,j,te,me)=>{let Ae,$e;const{props:De,shapeFlag:ge,transition:Ne,dirs:et}=q;if(Ae=q.el=r(q.type,j,De&&De.is,De),ge&8?u(Ae,q.children):ge&16&&x(q.children,Ae,null,fe,ve,s0(q,j),te,me),et&&Xi(q,null,fe,"created"),I(Ae,q,q.scopeId,te,fe),De){for(const St in De)St!=="value"&&!wa(St)&&i(Ae,St,null,De[St],j,fe);"value"in De&&i(Ae,"value",null,De.value,j),($e=De.onVnodeBeforeMount)&&Es($e,fe,q)}et&&Xi(q,null,fe,"beforeMount");const rt=k3(ve,Ne);rt&&Ne.beforeEnter(Ae),o(Ae,ee,ye),(($e=De&&De.onVnodeMounted)||rt||et)&&vo(()=>{try{$e&&Es($e,fe,q),rt&&Ne.enter(Ae),et&&Xi(q,null,fe,"mounted")}finally{}},ve)},I=(q,ee,ye,fe,ve)=>{if(ye&&h(q,ye),fe)for(let j=0;j<fe.length;j++)h(q,fe[j]);if(ve){let j=ve.subTree;if(ee===j||Zh(j.type)&&(j.ssContent===ee||j.ssFallback===ee)){const te=ve.vnode;I(q,te,te.scopeId,te.slotScopeIds,ve.parent)}}},x=(q,ee,ye,fe,ve,j,te,me,Ae=0)=>{for(let $e=Ae;$e<q.length;$e++){const De=q[$e]=me?Mr(q[$e]):Ns(q[$e]);g(null,De,ee,ye,fe,ve,j,te,me)}},L=(q,ee,ye,fe,ve,j,te)=>{const me=ee.el=q.el;let{patchFlag:Ae,dynamicChildren:$e,dirs:De}=ee;Ae|=q.patchFlag&16;const ge=q.props||Qt,Ne=ee.props||Qt;let et;if(ye&&na(ye,!1),(et=Ne.onVnodeBeforeUpdate)&&Es(et,ye,ee,q),De&&Xi(ee,q,ye,"beforeUpdate"),ye&&na(ye,!0),(ge.innerHTML&&Ne.innerHTML==null||ge.textContent&&Ne.textContent==null)&&u(me,""),$e?E(q.dynamicChildren,$e,me,ye,fe,s0(ee,ve),j):te||P(q,ee,me,null,ye,fe,s0(ee,ve),j,!1),Ae>0){if(Ae&16)F(me,ge,Ne,ye,ve);else if(Ae&2&&ge.class!==Ne.class&&i(me,"class",null,Ne.class,ve),Ae&4&&i(me,"style",ge.style,Ne.style,ve),Ae&8){const rt=ee.dynamicProps;for(let St=0;St<rt.length;St++){const gt=rt[St],It=ge[gt],Ut=Ne[gt];(Ut!==It||gt==="value")&&i(me,gt,It,Ut,ve,ye)}}Ae&1&&q.children!==ee.children&&u(me,ee.children)}else!te&&$e==null&&F(me,ge,Ne,ye,ve);((et=Ne.onVnodeUpdated)||De)&&vo(()=>{et&&Es(et,ye,ee,q),De&&Xi(ee,q,ye,"updated")},fe)},E=(q,ee,ye,fe,ve,j,te)=>{for(let me=0;me<ee.length;me++){const Ae=q[me],$e=ee[me],De=Ae.el&&(Ae.type===Pe||!Ii(Ae,$e)||Ae.shapeFlag&198)?d(Ae.el):ye;g(Ae,$e,De,null,fe,ve,j,te,!0)}},F=(q,ee,ye,fe,ve)=>{if(ee!==ye){if(ee!==Qt)for(const j in ee)!wa(j)&&!(j in ye)&&i(q,j,ee[j],null,ve,fe);for(const j in ye){if(wa(j))continue;const te=ye[j],me=ee[j];te!==me&&j!=="value"&&i(q,j,me,te,ve,fe)}"value"in ye&&i(q,"value",ee.value,ye.value,ve)}},S=(q,ee,ye,fe,ve,j,te,me,Ae)=>{const $e=ee.el=q?q.el:l(""),De=ee.anchor=q?q.anchor:l("");let{patchFlag:ge,dynamicChildren:Ne,slotScopeIds:et}=ee;et&&(me=me?me.concat(et):et),q==null?(o($e,ye,fe),o(De,ye,fe),x(ee.children||[],ye,De,ve,j,te,me,Ae)):ge>0&&ge&64&&Ne&&q.dynamicChildren&&q.dynamicChildren.length===Ne.length?(E(q.dynamicChildren,Ne,ye,ve,j,te,me),(ee.key!=null||ve&&ee===ve.subTree)&&My(q,ee,!0)):P(q,ee,ye,De,ve,j,te,me,Ae)},N=(q,ee,ye,fe,ve,j,te,me,Ae)=>{ee.slotScopeIds=me,q==null?ee.shapeFlag&512?ve.ctx.activate(ee,ye,fe,te,Ae):D(ee,ye,fe,ve,j,te,Ae):B(q,ee,Ae)},D=(q,ee,ye,fe,ve,j,te)=>{const me=q.component=M3(q,fe,ve);if(Vd(q)&&(me.ctx.renderer=z),T3(me,!1,te),me.asyncDep){if(ve&&ve.registerDep(me,U,te),!q.el){const Ae=me.subTree=re(bo);v(null,Ae,ee,ye),q.placeholder=Ae.el}}else U(me,q,ee,ye,ve,j,te)},B=(q,ee,ye)=>{const fe=ee.component=q.component;if(l9(q,ee,ye))if(fe.asyncDep&&!fe.asyncResolved){H(fe,ee,ye);return}else fe.next=ee,fe.update();else ee.el=q.el,fe.vnode=ee},U=(q,ee,ye,fe,ve,j,te)=>{const me=()=>{if(q.isMounted){let{next:ge,bu:Ne,u:et,parent:rt,vnode:St}=q;{const un=b3(q);if(un){ge&&(ge.el=St.el,H(q,ge,te)),un.asyncDep.then(()=>{vo(()=>{q.isUnmounted||$e()},ve)});return}}let gt=ge,It;na(q,!1),ge?(ge.el=St.el,H(q,ge,te)):ge=St,Ne&&Ic(Ne),(It=ge.props&&ge.props.onVnodeBeforeUpdate)&&Es(It,rt,ge,St),na(q,!0);const Ut=vh(q),ht=q.subTree;q.subTree=Ut,g(ht,Ut,d(ht.el),Ce(ht),q,ve,j),ge.el=Ut.el,gt===null&&gm(q,Ut.el),et&&vo(et,ve),(It=ge.props&&ge.props.onVnodeUpdated)&&vo(()=>Es(It,rt,ge,St),ve)}else{let ge;const{el:Ne,props:et}=ee,{bm:rt,m:St,parent:gt,root:It,type:Ut}=q,ht=Or(ee);if(na(q,!1),rt&&Ic(rt),!ht&&(ge=et&&et.onVnodeBeforeMount)&&Es(ge,gt,ee),na(q,!0),Ne&&ie){const un=()=>{q.subTree=vh(q),ie(Ne,q.subTree,q,ve,null)};ht&&Ut.__asyncHydrate?Ut.__asyncHydrate(Ne,q,un):un()}else{It.ce&&It.ce._hasShadowRoot()&&It.ce._injectChildStyle(Ut,q.parent?q.parent.type:void 0);const un=q.subTree=vh(q);g(null,un,ye,fe,q,ve,j),ee.el=un.el}if(St&&vo(St,ve),!ht&&(ge=et&&et.onVnodeMounted)){const un=ee;vo(()=>Es(ge,gt,un),ve)}(ee.shapeFlag&256||gt&&Or(gt.vnode)&>.vnode.shapeFlag&256)&&q.a&&vo(q.a,ve),q.isMounted=!0,ee=ye=fe=null}};q.scope.on();const Ae=q.effect=new Hh(me);q.scope.off();const $e=q.update=Ae.run.bind(Ae),De=q.job=Ae.runIfDirty.bind(Ae);De.i=q,De.id=q.uid,Ae.scheduler=()=>vy(De),na(q,!0),$e()},H=(q,ee,ye)=>{ee.component=q;const fe=q.vnode.props;q.vnode=ee,q.next=null,c9(q,ee.props,fe,ye),h9(q,ee.children,ye),Dr(),Pb(q),Pr()},P=(q,ee,ye,fe,ve,j,te,me,Ae=!1)=>{const $e=q&&q.children,De=q?q.shapeFlag:0,ge=ee.children,{patchFlag:Ne,shapeFlag:et}=ee;if(Ne>0){if(Ne&128){K($e,ge,ye,fe,ve,j,te,me,Ae);return}else if(Ne&256){Z($e,ge,ye,fe,ve,j,te,me,Ae);return}}et&8?(De&16&&de($e,ve,j),ge!==$e&&u(ye,ge)):De&16?et&16?K($e,ge,ye,fe,ve,j,te,me,Ae):de($e,ve,j,!0):(De&8&&u(ye,""),et&16&&x(ge,ye,fe,ve,j,te,me,Ae))},Z=(q,ee,ye,fe,ve,j,te,me,Ae)=>{q=q||Tc,ee=ee||Tc;const $e=q.length,De=ee.length,ge=Math.min($e,De);let Ne;for(Ne=0;Ne<ge;Ne++){const et=ee[Ne]=Ae?Mr(ee[Ne]):Ns(ee[Ne]);g(q[Ne],et,ye,null,ve,j,te,me,Ae)}$e>De?de(q,ve,j,!0,!1,ge):x(ee,ye,fe,ve,j,te,me,Ae,ge)},K=(q,ee,ye,fe,ve,j,te,me,Ae)=>{let $e=0;const De=ee.length;let ge=q.length-1,Ne=De-1;for(;$e<=ge&&$e<=Ne;){const et=q[$e],rt=ee[$e]=Ae?Mr(ee[$e]):Ns(ee[$e]);if(Ii(et,rt))g(et,rt,ye,null,ve,j,te,me,Ae);else break;$e++}for(;$e<=ge&&$e<=Ne;){const et=q[ge],rt=ee[Ne]=Ae?Mr(ee[Ne]):Ns(ee[Ne]);if(Ii(et,rt))g(et,rt,ye,null,ve,j,te,me,Ae);else break;ge--,Ne--}if($e>ge){if($e<=Ne){const et=Ne+1,rt=et<De?ee[et].el:fe;for(;$e<=Ne;)g(null,ee[$e]=Ae?Mr(ee[$e]):Ns(ee[$e]),ye,rt,ve,j,te,me,Ae),$e++}}else if($e>Ne)for(;$e<=ge;)J(q[$e],ve,j,!0),$e++;else{const et=$e,rt=$e,St=new Map;for($e=rt;$e<=Ne;$e++){const Wt=ee[$e]=Ae?Mr(ee[$e]):Ns(ee[$e]);Wt.key!=null&&St.set(Wt.key,$e)}let gt,It=0;const Ut=Ne-rt+1;let ht=!1,un=0;const dn=new Array(Ut);for($e=0;$e<Ut;$e++)dn[$e]=0;for($e=et;$e<=ge;$e++){const Wt=q[$e];if(It>=Ut){J(Wt,ve,j,!0);continue}let Pn;if(Wt.key!=null)Pn=St.get(Wt.key);else for(gt=rt;gt<=Ne;gt++)if(dn[gt-rt]===0&&Ii(Wt,ee[gt])){Pn=gt;break}Pn===void 0?J(Wt,ve,j,!0):(dn[Pn-rt]=$e+1,Pn>=un?un=Pn:ht=!0,g(Wt,ee[Pn],ye,null,ve,j,te,me,Ae),It++)}const ns=ht?g9(dn):Tc;for(gt=ns.length-1,$e=Ut-1;$e>=0;$e--){const Wt=rt+$e,Pn=ee[Wt],co=ee[Wt+1],it=Wt+1<De?co.el||x3(co):fe;dn[$e]===0?g(null,Pn,ye,it,ve,j,te,me,Ae):ht&&(gt<0||$e!==ns[gt]?V(Pn,ye,it,2):gt--)}}},V=(q,ee,ye,fe,ve=null)=>{const{el:j,type:te,transition:me,children:Ae,shapeFlag:$e}=q;if($e&6){V(q.component.subTree,ee,ye,fe);return}if($e&128){q.suspense.move(ee,ye,fe);return}if($e&64){te.move(q,ee,ye,z);return}if(te===Pe){o(j,ee,ye);for(let ge=0;ge<Ae.length;ge++)V(Ae[ge],ee,ye,fe);o(q.anchor,ee,ye);return}if(te===Oc){y(q,ee,ye);return}if(fe!==2&&$e&1&&me)if(fe===0)me.persisted&&!j[fi]?o(j,ee,ye):(me.beforeEnter(j),o(j,ee,ye),vo(()=>me.enter(j),ve));else{const{leave:ge,delayLeave:Ne,afterLeave:et}=me,rt=()=>{q.ctx.isUnmounted?s(j):o(j,ee,ye)},St=()=>{const gt=j._isLeaving||!!j[fi];j._isLeaving&&j[fi](!0),me.persisted&&!gt?rt():ge(j,()=>{rt(),et&&et()})};Ne?Ne(j,rt,St):St()}else o(j,ee,ye)},J=(q,ee,ye,fe=!1,ve=!1)=>{const{type:j,props:te,ref:me,children:Ae,dynamicChildren:$e,shapeFlag:De,patchFlag:ge,dirs:Ne,cacheIndex:et,memo:rt}=q;if(ge===-2&&(ve=!1),me!=null&&(Dr(),$c(me,null,ye,q,!0),Pr()),et!=null&&(ee.renderCache[et]=void 0),De&256){ee.ctx.deactivate(q);return}const St=De&1&&Ne,gt=!Or(q);let It;if(gt&&(It=te&&te.onVnodeBeforeUnmount)&&Es(It,ee,q),De&6)ue(q.component,ye,fe);else{if(De&128){q.suspense.unmount(ye,fe);return}St&&Xi(q,null,ee,"beforeUnmount"),De&64?q.type.remove(q,ee,ye,z,fe):$e&&!$e.hasOnce&&(j!==Pe||ge>0&&ge&64)?de($e,ee,ye,!1,!0):(j===Pe&&ge&384||!ve&&De&16)&&de(Ae,ee,ye),fe&&he(q)}const Ut=rt!=null&&et==null;(gt&&(It=te&&te.onVnodeUnmounted)||St||Ut)&&vo(()=>{It&&Es(It,ee,q),St&&Xi(q,null,ee,"unmounted"),Ut&&(q.el=null)},ye)},he=q=>{const{type:ee,el:ye,anchor:fe,transition:ve}=q;if(ee===Pe){ne(ye,fe);return}if(ee===Oc){k(q);return}const j=()=>{s(ye),ve&&!ve.persisted&&ve.afterLeave&&ve.afterLeave()};if(q.shapeFlag&1&&ve&&!ve.persisted){const{leave:te,delayLeave:me}=ve,Ae=()=>te(ye,j);me?me(q.el,j,Ae):Ae()}else j()},ne=(q,ee)=>{let ye;for(;q!==ee;)ye=f(q),s(q),q=ye;s(ee)},ue=(q,ee,ye)=>{const{bum:fe,scope:ve,job:j,subTree:te,um:me,m:Ae,a:$e}=q;Yh(Ae),Yh($e),fe&&Ic(fe),ve.stop(),j&&(j.flags|=8,J(te,q,ee,ye)),me&&vo(me,ee),vo(()=>{q.isUnmounted=!0},ee)},de=(q,ee,ye,fe=!1,ve=!1,j=0)=>{for(let te=j;te<q.length;te++)J(q[te],ee,ye,fe,ve)},Ce=q=>{if(q.shapeFlag&6)return Ce(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const ee=f(q.anchor||q.el),ye=ee&&ee[K4];return ye?f(ye):ee};let Ie=!1;const le=(q,ee,ye)=>{let fe;q==null?ee._vnode&&(J(ee._vnode,null,null,!0),fe=ee._vnode.component):g(ee._vnode||null,q,ee,null,null,null,ye),ee._vnode=q,Ie||(Ie=!0,Pb(fe),Vh(),Ie=!1)},z={p:g,um:J,m:V,r:he,mt:D,mc:x,pc:P,pbc:E,n:Ce,o:e};let ae,ie;return t&&([ae,ie]=t(z)),{render:le,hydrate:ae,createApp:t9(le,ae)}}function s0({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 na({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function k3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function My(e,t,n=!1){const o=e.children,s=t.children;if(xt(o)&&xt(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Mr(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&My(r,l)),l.type===Sl&&(l.patchFlag===-1&&(l=s[i]=Mr(l)),l.el=r.el),l.type===bo&&!l.el&&(l.el=r.el)}}function g9(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function b3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:b3(t)}function Yh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function x3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?x3(t.subTree):null}const Zh=e=>e.__isSuspense;let Pg=0;const v9={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)y9(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}k9(e,t,n,o,s,r,l,a,c)}},hydrate:b9,normalize:x9},Rwe=v9;function _d(e,t){const n=e.props&&e.props[t];$t(n)&&n()}function y9(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=w3(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(_d(e,"onPending"),_d(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Fc(f,e.ssFallback)):f.resolve(!1,!0)}function k9(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:g,isInFallback:b,isHydrating:v}=d;if(g)d.pendingBranch=f,Ii(g,f)?(a(g,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(v||(a(p,h,n,o,s,null,i,r,l),Fc(d,h)))):(d.pendingId=Pg++,v?(d.isHydrating=!1,d.activeBranch=g):c(g,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),Fc(d,h))):p&&Ii(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Ii(p,f))a(p,f,n,o,s,d,i,r,l),Fc(d,f);else if(_d(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Pg++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:m,pendingId:y}=d;m>0?setTimeout(()=>{d.pendingId===y&&d.fallback(h)},m):m===0&&d.fallback(h)}}function w3(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:b}}=c;let v;const m=w9(e);m&&t&&t.pendingBranch&&(v=t.pendingId,t.deps++);const y=e.props?Ph(e.props.timeout):void 0,k=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Pg++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,I=!1){const{vnode:x,activeBranch:L,pendingBranch:E,pendingId:F,effects:S,parentComponent:N,container:D,isInFallback:B}=A;let U=!1;if(A.isHydrating)A.isHydrating=!1;else if(!$){U=L&&E.transition&&E.transition.mode==="out-in";let Z=!1;U&&(L.transition.afterLeave=()=>{F===A.pendingId&&(f(E,D,i===k&&!Z?p(L):i,0),jh(S),B&&x.ssFallback&&(x.ssFallback.el=null))}),L&&!A.isFallbackMountPending&&(g(L.el)===D&&(i=p(L),Z=!0),h(L,N,A,!0),!U&&B&&x.ssFallback&&vo(()=>x.ssFallback.el=null,A)),U||f(E,D,i,0)}A.isFallbackMountPending=!1,Fc(A,E),A.pendingBranch=null,A.isInFallback=!1;let H=A.parent,P=!1;for(;H;){if(H.pendingBranch){H.effects.push(...S),P=!0;break}H=H.parent}!P&&!U&&jh(S),A.effects=[],m&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,t.deps===0&&!I&&t.resolve()),_d(x,"onResolve")},fallback($){if(!A.pendingBranch)return;const{vnode:I,activeBranch:x,parentComponent:L,container:E,namespace:F}=A;_d(I,"onFallback");const S=p(x),N=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,$,E,S,L,null,F,l,a),Fc(A,$))},D=$.transition&&$.transition.mode==="out-in";D&&(A.isFallbackMountPending=!0,x.transition.afterLeave=N),A.isInFallback=!0,h(x,L,null,!0),D||N()},move($,I,x){A.activeBranch&&f(A.activeBranch,$,I,x),A.container=$},next(){return A.activeBranch&&p(A.activeBranch)},registerDep($,I,x){const L=!!A.pendingBranch;L&&A.deps++;const E=$.vnode.el;$.asyncDep.catch(F=>{iu(F,$,0)}).then(F=>{if($.isUnmounted||A.isUnmounted||A.pendingId!==$.suspenseId)return;Sd(),$.asyncResolved=!0;const{vnode:S}=$;Hg($,F,!1),E&&(S.el=E);const N=!E&&$.subTree.el;I($,S,g(E||$.subTree.el),E?null:p($.subTree),A,r,x),N&&(S.placeholder=null,b(N)),gm($,S.el),L&&--A.deps===0&&A.resolve()})},unmount($,I){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,$,I),A.pendingBranch&&h(A.pendingBranch,n,$,I)}};return A}function b9(e,t,n,o,s,i,r,l,a){const c=t.suspense=w3(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function x9(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Jb(o?n.default:n),e.ssFallback=o?Jb(n.fallback):re(bo)}function Jb(e){let t;if($t(e)){const n=Ea&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=es,S3())}return xt(e)&&(e=s9(e)),e=Ns(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function _3(e,t){t&&t.pendingBranch?xt(e)?t.effects.push(...e):t.effects.push(e):jh(e)}function Fc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,gm(o,s))}function w9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Sl=Symbol.for("v-txt"),bo=Symbol.for("v-cmt"),Oc=Symbol.for("v-stc"),td=[];let es=null;function w(e=!1){td.push(es=e?null:[])}function S3(){td.pop(),es=td[td.length-1]||null}let Ea=1;function Qh(e,t=!1){Ea+=e,e<0&&es&&t&&(es.hasOnce=!0)}function C3(e){return e.dynamicChildren=Ea>0?es||Tc:null,S3(),Ea>0&&es&&es.push(e),e}function T(e,t,n,o,s,i){return C3(_(e,t,n,o,s,i,!0))}function xe(e,t,n,o,s){return C3(re(e,t,n,o,s,!0))}function Nl(e){return e?e.__v_isVNode===!0:!1}function Ii(e,t){return e.type===t.type&&e.key===t.key}function Bwe(e){}const A3=({key:e})=>e??null,yh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Sn(e)||po(e)||$t(e)?{i:Ko,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&A3(t),ref:t&&yh(t),scopeId:fm,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ko};return l?(Ty(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Sn(n)?8:16),Ea>0&&!r&&es&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&es.push(a),a}const re=_9;function _9(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===n3)&&(e=bo),Nl(e)){const l=Wr(e,t,!0);return n&&Ty(l,n),Ea>0&&!i&&es&&(l.shapeFlag&6?es[es.indexOf(e)]=l:es.push(l)),l.patchFlag=-2,l}if(T9(e)&&(e=e.__vccOpts),t){t=S9(t);let{class:l,style:a}=t;l&&!Sn(l)&&(t.class=We(l)),an(a)&&(dm(a)&&!xt(a)&&(a=kn({},a)),t.style=Yt(a))}const r=Sn(e)?1:Zh(e)?128:G4(e)?64:an(e)?4:$t(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function S9(e){return e?dm(e)||f3(e)?kn({},e):e:null}function Wr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?yn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&A3(c),ref:t&&t.ref?n&&i?xt(i)?i.concat(yh(t)):[i,yh(t)]:yh(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Wr(e.ssContent),ssFallback:e.ssFallback&&Wr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Tl(u,a.clone(u)),u}function Je(e=" ",t=0){return re(Sl,null,e,t)}function Ey(e,t){const n=re(Oc,null,e);return n.staticCount=t,n}function ce(e="",t=!1){return t?(w(),xe(bo,null,e)):re(bo,null,e)}function Ns(e){return e==null||typeof e=="boolean"?re(bo):xt(e)?re(Pe,null,e.slice()):Nl(e)?Mr(e):re(Sl,null,String(e))}function Mr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Wr(e)}function Ty(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(xt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),Ty(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!f3(t)?t._ctx=Ko:s===3&&Ko&&(Ko.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else $t(t)?(t={default:t,_ctx:Ko},n=32):(t=String(t),o&64?(n=16,t=[Je(t)]):n=8);e.children=t,e.shapeFlag|=n}function yn(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=We([t.class,o.class]));else if(s==="style")t.style=Yt([t.style,o.style]);else if(Ud(s)){const i=t[s],r=o[s];r&&i!==r&&!(xt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Jp(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Es(e,t,n,o=null){wi(e,t,7,[n,o])}const C9=r3();let A9=0;function M3(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||C9,i={uid:A9++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new x4(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:p3(o,s),emitsOptions:a3(o,s),emit:null,emitted:null,propsDefaults:Qt,inheritAttrs:o.inheritAttrs,ctx:Qt,data:Qt,props:Qt,attrs:Qt,slots:Qt,refs:Qt,setupState:Qt,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=n9.bind(null,i),e.ce&&e.ce(i),i}let Vo=null;const Yo=()=>Vo||Ko;let Xh,Rc;{const e=im(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};Xh=t("__VUE_INSTANCE_SETTERS__",n=>Vo=n),Rc=t("__VUE_SSR_SETTERS__",n=>Ta=n)}const ru=e=>{const t=Vo;return Xh(e),e.scope.on(),()=>{e.scope.off(),Xh(t)}},Sd=()=>{Vo&&Vo.scope.off(),Xh(null)};function E3(e){return e.vnode.shapeFlag&4}let Ta=!1;function T3(e,t=!1,n=!1){t&&Rc(t);const{props:o,children:s}=e.vnode,i=E3(e);a9(e,o,i,t),f9(e,s,n||t);const r=i?M9(e,t):void 0;return t&&Rc(!1),r}function M9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Og);const{setup:o}=n;if(o){Dr();const s=e.setupContext=o.length>1?I3(e):null,i=ru(e),r=qd(o,e,0,[e.props,s]),l=dy(r);if(Pr(),i(),(l||e.sp)&&!Or(e)&&ky(e),l){if(r.then(Sd,Sd),t)return r.then(a=>{Hg(e,a,t)}).catch(a=>{iu(a,e,0)});e.asyncDep=r}else Hg(e,r,t)}else N3(e,t)}function Hg(e,t,n){$t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:an(t)&&(e.setupState=P4(t)),N3(e,n)}let Jh,Wg;function Dwe(e){Jh=e,Wg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,GT))}}const Pwe=()=>!Jh;function N3(e,t,n){const o=e.type;if(!e.render){if(!t&&Jh&&!o.render){const s=o.template||Sy(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=kn(kn({isCustomElement:i,delimiters:l},r),a);o.render=Jh(s,c)}}e.render=o.render||ki,Wg&&Wg(e)}{const s=ru(e);Dr();try{YT(e)}finally{Pr(),s()}}}const E9={get(e,t){return Jo(e,"get",""),e[t]}};function I3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,E9),slots:e.slots,emit:e.emit,expose:t}}function Gd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(P4(pt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ed)return ed[n](e)},has(t,n){return n in t||n in ed}})):e.proxy}function zg(e,t=!0){return $t(e)?e.displayName||e.name:e.name||t&&e.__name}function T9(e){return $t(e)&&"__vccOpts"in e}const R=(e,t)=>dT(e,t,Ta);function mn(e,t,n){try{Qh(-1);const o=arguments.length;return o===2?an(t)&&!xt(t)?Nl(t)?re(e,null,[t]):re(e,t):re(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Nl(n)&&(n=[n]),re(e,t,n))}finally{Qh(1)}}function Hwe(){}function Wwe(e,t,n,o){const s=n[o];if(s&&N9(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function N9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(qo(n[o],t[o]))return!1;return Ea>0&&es&&es.push(e),!0}const I9="3.5.35",zwe=ki,Uwe=gT,qwe=pc,jwe=j4,L9={createComponentInstance:M3,setupComponent:T3,renderComponentRoot:vh,setCurrentRenderingInstance:bd,isVNode:Nl,normalizeVNode:Ns,getComponentPublicInstance:Gd,ensureValidVNode:_y,pushWarningContext:pT,popWarningContext:mT},Vwe=L9,Kwe=null,Gwe=null,Ywe=null;/**
|
|
17
|
+
* @vue/runtime-dom v3.5.35
|
|
18
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
+
* @license MIT
|
|
20
|
+
**/let Ug;const ex=typeof window<"u"&&window.trustedTypes;if(ex)try{Ug=ex.createPolicy("vue",{createHTML:e=>e})}catch{}const L3=Ug?e=>Ug.createHTML(e):e=>e,$9="http://www.w3.org/2000/svg",F9="http://www.w3.org/1998/Math/MathML",wr=typeof document<"u"?document:null,tx=wr&&wr.createElement("template"),O9={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?wr.createElementNS($9,e):t==="mathml"?wr.createElementNS(F9,e):n?wr.createElement(e,{is:n}):wr.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>wr.createTextNode(e),createComment:e=>wr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>wr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{tx.innerHTML=L3(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=tx.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},tl="transition",$u="animation",Gc=Symbol("_vtc"),$3={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},F3=kn({},Z4,$3),R9=e=>(e.displayName="Transition",e.props=F3,e),Il=R9((e,{slots:t})=>mn(ET,O3(e),t)),oa=(e,t=[])=>{xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},nx=e=>e?xt(e)?e.some(t=>t.length>1):e.length>1:!1;function O3(e){const t={};for(const S in e)S in $3||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=B9(s),g=p&&p[0],b=p&&p[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:k,onLeaveCancelled:A,onBeforeAppear:$=v,onAppear:I=m,onAppearCancelled:x=y}=t,L=(S,N,D,B)=>{S._enterCancelled=B,dl(S,N?u:l),dl(S,N?c:r),D&&D()},E=(S,N)=>{S._isLeaving=!1,dl(S,d),dl(S,h),dl(S,f),N&&N()},F=S=>(N,D)=>{const B=S?I:m,U=()=>L(N,S,D);oa(B,[N,U]),ox(()=>{dl(N,S?a:i),Zi(N,S?u:l),nx(B)||sx(N,o,g,U)})};return kn(t,{onBeforeEnter(S){oa(v,[S]),Zi(S,i),Zi(S,r)},onBeforeAppear(S){oa($,[S]),Zi(S,a),Zi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,N){S._isLeaving=!0;const D=()=>E(S,N);Zi(S,d),S._enterCancelled?(Zi(S,f),qg(S)):(qg(S),Zi(S,f)),ox(()=>{S._isLeaving&&(dl(S,d),Zi(S,h),nx(k)||sx(S,o,b,D))}),oa(k,[S,D])},onEnterCancelled(S){L(S,!1,void 0,!0),oa(y,[S])},onAppearCancelled(S){L(S,!0,void 0,!0),oa(x,[S])},onLeaveCancelled(S){E(S),oa(A,[S])}})}function B9(e){if(e==null)return null;if(an(e))return[i0(e.enter),i0(e.leave)];{const t=i0(e);return[t,t]}}function i0(e){return Ph(e)}function Zi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Gc]||(e[Gc]=new Set)).add(t)}function dl(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Gc];n&&(n.delete(t),n.size||(e[Gc]=void 0))}function ox(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let D9=0;function sx(e,t,n,o){const s=e._endId=++D9,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=R3(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function R3(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${tl}Delay`),i=o(`${tl}Duration`),r=ix(s,i),l=o(`${$u}Delay`),a=o(`${$u}Duration`),c=ix(l,a);let u=null,d=0,f=0;t===tl?r>0&&(u=tl,d=r,f=i.length):t===$u?c>0&&(u=$u,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?tl:$u:null,f=u?u===tl?i.length:a.length:0);const h=u===tl&&/\b(?:transform|all)(?:,|$)/.test(o(`${tl}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function ix(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>rx(n)+rx(e[o])))}function rx(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function qg(e){return(e?e.ownerDocument:document).body.offsetHeight}function P9(e,t,n){const o=e[Gc];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ep=Symbol("_vod"),B3=Symbol("_vsh"),mi={name:"show",beforeMount(e,{value:t},{transition:n}){e[ep]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Fu(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Fu(e,!0),o.enter(e)):o.leave(e,()=>{Fu(e,!1)}):Fu(e,t))},beforeUnmount(e,{value:t}){Fu(e,t)}};function Fu(e,t){e.style.display=t?e[ep]:"none",e[B3]=!t}function H9(){mi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const D3=Symbol("");function Zwe(e){const t=Yo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>tp(i,s))},o=()=>{const s=e(t.proxy);t.ce?tp(t.ce,s):jg(t.subTree,s),n(s)};t3(()=>{jh(o)}),cn(()=>{Qe(o,ki,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),bn(()=>s.disconnect())})}function jg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{jg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)tp(e.el,t);else if(e.type===Pe)e.children.forEach(n=>jg(n,t));else if(e.type===Oc){let{el:n,anchor:o}=e;for(;n&&(tp(n,t),n!==o);)n=n.nextSibling}}function tp(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=BE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[D3]=o}}const W9=/(?:^|;)\s*display\s*:/;function z9(e,t,n){const o=e.style,s=Sn(n);let i=!1;if(n&&!s){if(t)if(Sn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&ju(o,l,"")}else for(const r in t)n[r]==null&&ju(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?q9(e,r,!Sn(t)&&t?t[r]:void 0,l)||ju(o,r,l):ju(o,r,"")}}else if(s){if(t!==n){const r=o[D3];r&&(n+=";"+r),o.cssText=n,i=W9.test(n)}}else t&&e.removeAttribute("style");ep in e&&(e[ep]=i?o.display:"",e[B3]&&(o.display="none"))}const lx=/\s*!important$/;function ju(e,t,n){if(xt(n))n.forEach(o=>ju(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=U9(e,t);lx.test(n)?e.setProperty(Is(o),n.replace(lx,""),"important"):e[o]=n}}const ax=["Webkit","Moz","ms"],r0={};function U9(e,t){const n=r0[t];if(n)return n;let o=No(t);if(o!=="filter"&&o in e)return r0[t]=o;o=om(o);for(let s=0;s<ax.length;s++){const i=ax[s]+o;if(i in e)return r0[t]=i}return t}function q9(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Sn(o)&&n===o}const cx="http://www.w3.org/1999/xlink";function ux(e,t,n,o,s,i=OE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(cx,t.slice(6,t.length)):e.setAttributeNS(cx,t,n):n==null||i&&!y4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Js(n)?String(n):n)}function dx(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?L3(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=y4(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Ir(e,t,n,o){e.addEventListener(t,n,o)}function j9(e,t,n,o){e.removeEventListener(t,n,o)}const fx=Symbol("_vei");function V9(e,t,n,o,s=null){const i=e[fx]||(e[fx]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=K9(t);if(o){const c=i[t]=Z9(o,s);Ir(e,l,c,a)}else r&&(j9(e,l,r,a),i[t]=void 0)}}const hx=/(?:Once|Passive|Capture)$/;function K9(e){let t;if(hx.test(e)){t={};let o;for(;o=e.match(hx);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Is(e.slice(2)),t]}let l0=0;const G9=Promise.resolve(),Y9=()=>l0||(G9.then(()=>l0=0),l0=Date.now());function Z9(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(xt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&wi(c,t,5,l)}}else wi(s,t,5,[o])};return n.value=e,n.attached=Y9(),n}const px=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Q9=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?P9(e,o,r):t==="style"?z9(e,n,o):Ud(t)?Jp(t)||V9(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):X9(e,t,o,r))?(dx(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ux(e,t,o,r,i,t!=="value")):e._isVueCE&&(J9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Sn(o)))?dx(e,No(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),ux(e,t,o,r))};function X9(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&px(t)&&$t(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return px(t)&&Sn(n)?!1:t in e}function J9(e,t){const n=e._def.props;if(!n)return!1;const o=No(t);return Array.isArray(n)?n.some(s=>No(s)===o):Object.keys(n).some(s=>No(s)===o)}const mx={};function eN(e,t,n){let o=Ze(e,t);em(o)&&(o=kn({},o,t));class s extends Ny{constructor(r){super(o,r,n)}}return s.def=o,s}const Qwe=((e,t)=>eN(e,t,vN)),tN=typeof HTMLElement<"u"?HTMLElement:class{};class Ny extends tN{constructor(t,n={},o=sp){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==sp?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(kn({},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 Ny){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,mt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!xt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Ph(this._props[a])),(l||(l=Object.create(null)))[No(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)ln(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=xt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(No))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):mx;const s=No(t);n&&this._numberProps&&this._numberProps[s]&&(o=Ph(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===mx?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Is(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Is(t),n+""):n||this.removeAttribute(Is(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),gN(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=re(this._def,kn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,em(r[0])?kn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Is(i)!==i&&s(Is(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function nN(e){const t=Yo(),n=t&&t.ce;return n||null}function Xwe(){const e=nN();return e&&e.shadowRoot}function Jwe(e="$style"){{const t=Yo();if(!t)return Qt;const n=t.type.__cssModules;if(!n)return Qt;const o=n[e];return o||Qt}}const P3=new WeakMap,H3=new WeakMap,np=Symbol("_moveCb"),gx=Symbol("_enterCb"),oN=e=>(delete e.props.mode,e),sN=oN({name:"TransitionGroup",props:kn({},F3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Yo(),o=Y4();let s,i;return by(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!cN(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(rN),s.forEach(lN);const l=s.filter(aN);qg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Zi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[np]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[np]=null,dl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=en(e),l=O3(r);let a=r.tag||Pe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Tl(u,xd(u,l,o,n)),P3.set(u,W3(u.el)))}i=t.default?yy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Tl(u,xd(u,l,o,n))}return re(a,null,i)}}}),iN=sN;function rN(e){const t=e.el;t[np]&&t[np](),t[gx]&&t[gx]()}function lN(e){H3.set(e,W3(e.el))}function aN(e){const t=P3.get(e),n=H3.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function W3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function cN(e,t,n){const o=e.cloneNode(),s=e[Gc];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=R3(o);return i.removeChild(o),r}const Ll=e=>{const t=e.props["onUpdate:modelValue"]||!1;return xt(t)?n=>Ic(t,n):t};function uN(e){e.target.composing=!0}function vx(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bi=Symbol("_assign");function yx(e,t,n){return t&&(e=e.trim()),n&&(e=sm(e)),e}const _s={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[bi]=Ll(s);const i=o||s.props&&s.props.type==="number";Ir(e,t?"change":"input",r=>{r.target.composing||e[bi](yx(e.value,n,i))}),(n||i)&&Ir(e,"change",()=>{e.value=yx(e.value,n,i)}),t||(Ir(e,"compositionstart",uN),Ir(e,"compositionend",vx),Ir(e,"change",vx))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[bi]=Ll(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?sm(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},op={deep:!0,created(e,t,n){e[bi]=Ll(n),Ir(e,"change",()=>{const o=e._modelValue,s=Yc(e),i=e.checked,r=e[bi];if(xt(o)){const l=rm(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Oa(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(U3(e,i))})},mounted:kx,beforeUpdate(e,t,n){e[bi]=Ll(n),kx(e,t,n)}};function kx(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(xt(t))s=rm(t,o.props.value)>-1;else if(Oa(t))s=t.has(o.props.value);else{if(t===n)return;s=Br(t,U3(e,!0))}e.checked!==s&&(e.checked=s)}const z3={created(e,{value:t},n){e.checked=Br(t,n.props.value),e[bi]=Ll(n),Ir(e,"change",()=>{e[bi](Yc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[bi]=Ll(o),t!==n&&(e.checked=Br(t,o.props.value))}},Vg={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Oa(t);Ir(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?sm(Yc(r)):Yc(r));e[bi](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[bi]=Ll(o)},mounted(e,{value:t}){bx(e,t)},beforeUpdate(e,t,n){e[bi]=Ll(n)},updated(e,{value:t}){e._assigning||bx(e,t)}};function bx(e,t){const n=e.multiple,o=xt(t);if(!(n&&!o&&!Oa(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=Yc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=rm(t,l)>-1}else r.selected=t.has(l);else if(Br(Yc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Yc(e){return"_value"in e?e._value:e.value}function U3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const dN={created(e,t,n){Pf(e,t,n,null,"created")},mounted(e,t,n){Pf(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Pf(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Pf(e,t,n,o,"updated")}};function q3(e,t){switch(e){case"SELECT":return Vg;case"TEXTAREA":return _s;default:switch(t){case"checkbox":return op;case"radio":return z3;default:return _s}}}function Pf(e,t,n,o,s){const r=q3(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function fN(){_s.getSSRProps=({value:e})=>({value:e}),z3.getSSRProps=({value:e},t)=>{if(t.props&&Br(t.props.value,e))return{checked:!0}},op.getSSRProps=({value:e},t)=>{if(xt(e)){if(t.props&&rm(e,t.props.value)>-1)return{checked:!0}}else if(Oa(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},dN.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=q3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const hN=["ctrl","shift","alt","meta"],pN={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)=>hN.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=pN[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},mN={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},nr=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Is(s.key);if(t.some(r=>r===i||mN[r]===i))return e(s)}))},j3=kn({patchProp:Q9},O9);let nd,xx=!1;function V3(){return nd||(nd=p9(j3))}function K3(){return nd=xx?nd:m9(j3),xx=!0,nd}const gN=((...e)=>{V3().render(...e)}),e_e=((...e)=>{K3().hydrate(...e)}),sp=((...e)=>{const t=V3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=Y3(o);if(!s)return;const i=t._component;!$t(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,G3(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),vN=((...e)=>{const t=K3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=Y3(o);if(s)return n(s,!0,G3(s))},t});function G3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Y3(e){return Sn(e)?document.querySelector(e):e}let wx=!1;const t_e=()=>{wx||(wx=!0,fN(),H9())};/*!
|
|
21
|
+
* shared v11.4.5
|
|
22
|
+
* (c) 2026 kazuya kawaguchi
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/function yN(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const ip=typeof window<"u",Bl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),kN=(e,t,n)=>bN({l:e,k:t,s:n}),bN=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),wo=e=>typeof e=="number"&&isFinite(e),Z3=e=>Ly(e)==="[object Date]",Zc=e=>Ly(e)==="[object RegExp]",vm=e=>Jt(e)&&Object.keys(e).length===0,_o=Object.assign,xN=Object.create,_n=(e=null)=>xN(e);let _x;const ya=()=>_x||(_x=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:_n());function Sx(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function wN(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const _N=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,SN=/^(?:href|src|action|formaction)$/i;function Iy(e){return _N.test(e)}function CN(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(o,i),n+=Iy(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function Cx(e,t){if(SN.test(e)&&Iy(t))return"about:blank";const n=e.toLowerCase()==="style"?CN(t):t;return wN(n)}function AN(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${Cx(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${Cx(o,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,s)=>Iy(s)?`${o}about:blank`:n),e}const MN=Object.prototype.hasOwnProperty;function yi(e,t){return MN.call(e,t)}const ro=Array.isArray,Kn=e=>typeof e=="function",yt=e=>typeof e=="string",nn=e=>typeof e=="boolean",on=e=>e!==null&&typeof e=="object",EN=e=>on(e)&&Kn(e.then)&&Kn(e.catch),Q3=Object.prototype.toString,Ly=e=>Q3.call(e),Jt=e=>Ly(e)==="[object Object]",TN=e=>e==null?"":ro(e)||Jt(e)&&e.toString===Q3?JSON.stringify(e,null,2):String(e);function $y(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Hf=e=>!on(e)||ro(e);function kh(e,t){if(Hf(e)||Hf(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(on(o[i])&&!on(s[i])&&(s[i]=Array.isArray(o[i])?[]:_n()),Hf(s[i])||Hf(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
|
|
25
|
+
* message-compiler v11.4.5
|
|
26
|
+
* (c) 2026 kazuya kawaguchi
|
|
27
|
+
* Released under the MIT License.
|
|
28
|
+
*/function NN(e,t,n){return{line:e,column:t,offset:n}}function Kg(e,t,n){return{start:e,end:t}}const hn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},IN=17;function ym(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function LN(e){throw e}const Ki=" ",$N="\r",Qo=`
|
|
29
|
+
`,FN="\u2028",ON="\u2029";function RN(e){const t=e;let n=0,o=1,s=1,i=0;const r=I=>t[I]===$N&&t[I+1]===Qo,l=I=>t[I]===Qo,a=I=>t[I]===ON,c=I=>t[I]===FN,u=I=>r(I)||l(I)||a(I)||c(I),d=()=>n,f=()=>o,h=()=>s,p=()=>i,g=I=>r(I)||a(I)||c(I)?Qo:t[I],b=()=>g(n),v=()=>g(n+i);function m(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function y(){return r(n+i)&&i++,i++,t[n+i]}function k(){n=0,o=1,s=1,i=0}function A(I=0){i=I}function $(){const I=n+i;for(;I!==n;)m();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:b,currentPeek:v,next:m,peek:y,reset:k,resetPeek:A,skipToPeek:$}}const vr=void 0,BN=".",Ax="'",DN="tokenizer";function PN(e,t={}){const n=t.location!==!1,o=RN(e),s=()=>o.index(),i=()=>NN(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(j,te,me,...Ae){const $e=c();if(te.column+=me,te.offset+=me,u){const De=n?Kg($e.startLoc,te):null,ge=ym(j,De,{domain:DN,args:Ae});u(ge)}}function f(j,te,me){j.endLoc=i(),j.currentType=te;const Ae={type:te};return n&&(Ae.loc=Kg(j.startLoc,j.endLoc)),me!=null&&(Ae.value=me),Ae}const h=j=>f(j,13);function p(j,te){return j.currentChar()===te?(j.next(),te):(d(hn.EXPECTED_TOKEN,i(),0,te),"")}function g(j){let te="";for(;j.currentPeek()===Ki||j.currentPeek()===Qo;)te+=j.currentPeek(),j.peek();return te}function b(j){const te=g(j);return j.skipToPeek(),te}function v(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te===95}function m(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=48&&te<=57}function y(j,te){const{currentType:me}=te;if(me!==2)return!1;g(j);const Ae=v(j.currentPeek());return j.resetPeek(),Ae}function k(j,te){const{currentType:me}=te;if(me!==2)return!1;g(j);const Ae=j.currentPeek()==="-"?j.peek():j.currentPeek(),$e=m(Ae);return j.resetPeek(),$e}function A(j,te){const{currentType:me}=te;if(me!==2)return!1;g(j);const Ae=j.currentPeek()===Ax;return j.resetPeek(),Ae}function $(j,te){const{currentType:me}=te;if(me!==7)return!1;g(j);const Ae=j.currentPeek()===".";return j.resetPeek(),Ae}function I(j,te){const{currentType:me}=te;if(me!==8)return!1;g(j);const Ae=v(j.currentPeek());return j.resetPeek(),Ae}function x(j,te){const{currentType:me}=te;if(!(me===7||me===11))return!1;g(j);const Ae=j.currentPeek()===":";return j.resetPeek(),Ae}function L(j,te){const{currentType:me}=te;if(me!==9)return!1;const Ae=()=>{const De=j.currentPeek();return De==="{"?v(j.peek()):De==="@"||De==="|"||De===":"||De==="."||De===Ki||!De?!1:De===Qo?(j.peek(),Ae()):F(j,!1)},$e=Ae();return j.resetPeek(),$e}function E(j){g(j);const te=j.currentPeek()==="|";return j.resetPeek(),te}function F(j,te=!0){const me=($e=!1,De="")=>{const ge=j.currentPeek();return ge==="{"||ge==="@"||!ge?$e:ge==="|"?!(De===Ki||De===Qo):ge===Ki?(j.peek(),me(!0,Ki)):ge===Qo?(j.peek(),me(!0,Qo)):!0},Ae=me();return te&&j.resetPeek(),Ae}function S(j,te){const me=j.currentChar();return me===vr?vr:te(me)?(j.next(),me):null}function N(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36}function D(j){return S(j,N)}function B(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36||te===45}function U(j){return S(j,B)}function H(j){const te=j.charCodeAt(0);return te>=48&&te<=57}function P(j){return S(j,H)}function Z(j){const te=j.charCodeAt(0);return te>=48&&te<=57||te>=65&&te<=70||te>=97&&te<=102}function K(j){return S(j,Z)}function V(j){let te="",me="";for(;te=P(j);)me+=te;return me}function J(j){let te="";for(;;){const me=j.currentChar();if(me==="\\"){const Ae=j.peek();Ae==="{"||Ae==="}"||Ae==="@"||Ae==="|"||Ae==="\\"?(te+=me+Ae,j.next(),j.next()):(j.resetPeek(),te+=me,j.next())}else{if(me==="{"||me==="}"||me==="@"||me==="|"||!me)break;if(me===Ki||me===Qo)if(F(j))te+=me,j.next();else{if(E(j))break;te+=me,j.next()}else te+=me,j.next()}}return te}function he(j){b(j);let te="",me="";for(;te=U(j);)me+=te;const Ae=j.currentChar();if(Ae&&Ae!=="}"&&Ae!==vr&&Ae!==Ki&&Ae!==Qo&&Ae!==" "){const $e=z(j);return d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me+$e),me+$e}return j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),me}function ne(j){b(j);let te="";return j.currentChar()==="-"?(j.next(),te+=`-${V(j)}`):te+=V(j),j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function ue(j){return j!==Ax&&j!==Qo}function de(j){b(j),p(j,"'");let te="",me="";for(;te=S(j,ue);)te==="\\"?me+=Ce(j):me+=te;const Ae=j.currentChar();return Ae===Qo||Ae===vr?(d(hn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ae===Qo&&(j.next(),p(j,"'")),me):(p(j,"'"),me)}function Ce(j){const te=j.currentChar();switch(te){case"\\":case"'":return j.next(),`\\${te}`;case"u":return Ie(j,te,4);case"U":return Ie(j,te,6);default:return d(hn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,te),""}}function Ie(j,te,me){p(j,te);let Ae="";for(let $e=0;$e<me;$e++){const De=K(j);if(!De){d(hn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${te}${Ae}${j.currentChar()}`);break}Ae+=De}return`\\${te}${Ae}`}function le(j){return j!=="{"&&j!=="}"&&j!==Ki&&j!==Qo}function z(j){b(j);let te="",me="";for(;te=S(j,le);)me+=te;return me}function ae(j){let te="",me="";for(;te=D(j);)me+=te;return me}function ie(j){const te=me=>{const Ae=j.currentChar();return Ae==="{"||Ae==="@"||Ae==="|"||Ae==="("||Ae===")"||!Ae||Ae===Ki?me:(me+=Ae,j.next(),te(me))};return te("")}function q(j){b(j);const te=p(j,"|");return b(j),te}function ee(j,te){let me=null;switch(j.currentChar()){case"{":return te.braceNest>=1&&d(hn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),me=f(te,2,"{"),b(j),te.braceNest++,me;case"}":return te.braceNest>0&&te.currentType===2&&d(hn.EMPTY_PLACEHOLDER,i(),0),j.next(),me=f(te,3,"}"),te.braceNest--,te.braceNest>0&&b(j),te.inLinked&&te.braceNest===0&&(te.inLinked=!1),me;case"@":return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),me=ye(j,te)||h(te),te.braceNest=0,me;default:{let $e=!0,De=!0,ge=!0;if(E(j))return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),me=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,me;if(te.braceNest>0&&(te.currentType===4||te.currentType===5||te.currentType===6))return d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te.braceNest=0,fe(j,te);if($e=y(j,te))return me=f(te,4,he(j)),b(j),me;if(De=k(j,te))return me=f(te,5,ne(j)),b(j),me;if(ge=A(j,te))return me=f(te,6,de(j)),b(j),me;if(!$e&&!De&&!ge)return me=f(te,12,z(j)),d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me.value),b(j),me;break}}return me}function ye(j,te){const{currentType:me}=te;let Ae=null;const $e=j.currentChar();switch((me===7||me===8||me===11||me===9)&&($e===Qo||$e===Ki)&&d(hn.INVALID_LINKED_FORMAT,i(),0),$e){case"@":return j.next(),Ae=f(te,7,"@"),te.inLinked=!0,Ae;case".":return b(j),j.next(),f(te,8,".");case":":return b(j),j.next(),f(te,9,":");default:return E(j)?(Ae=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,Ae):$(j,te)||x(j,te)?(b(j),ye(j,te)):I(j,te)?(b(j),f(te,11,ae(j))):L(j,te)?(b(j),$e==="{"?ee(j,te)||Ae:f(te,10,ie(j))):(me===7&&d(hn.INVALID_LINKED_FORMAT,i(),0),te.braceNest=0,te.inLinked=!1,fe(j,te))}}function fe(j,te){let me={type:13};if(te.braceNest>0)return ee(j,te)||h(te);if(te.inLinked)return ye(j,te)||h(te);switch(j.currentChar()){case"{":return ee(j,te)||h(te);case"}":return d(hn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(te,3,"}");case"@":return ye(j,te)||h(te);default:{if(E(j))return me=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,me;if(F(j))return f(te,0,J(j));break}}return me}function ve(){const{currentType:j,offset:te,startLoc:me,endLoc:Ae}=a;return a.lastType=j,a.lastOffset=te,a.lastStartLoc=me,a.lastEndLoc=Ae,a.offset=s(),a.startLoc=i(),o.currentChar()===vr?f(a,13):fe(o,a)}return{nextToken:ve,currentOffset:s,currentPosition:i,context:c}}const HN="parser",WN=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,zN=/\\([\\@{}|])/g;function UN(e,t){return t}function qN(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function jN(e={}){const t=e.location!==!1,{onError:n}=e;function o(v,m,y,k,...A){const $=v.currentPosition();if($.offset+=k,$.column+=k,n){const I=t?Kg(y,$):null,x=ym(m,I,{domain:HN,args:A});n(x)}}function s(v,m,y){const k={type:v};return t&&(k.start=m,k.end=m,k.loc={start:y,end:y}),k}function i(v,m,y,k){t&&(v.end=m,v.loc&&(v.loc.end=y))}function r(v,m){const y=v.context(),k=s(3,y.offset,y.startLoc);return k.value=m.replace(zN,UN),i(k,v.currentOffset(),v.currentPosition()),k}function l(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(5,k,A);return $.index=parseInt(m,10),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function a(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(4,k,A);return $.key=m,v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function c(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(9,k,A);return $.value=m.replace(WN,qN),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function u(v){const m=v.nextToken(),y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(8,k,A);return m.type!==11?(o(v,hn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),$.value="",i($,k,A),{nextConsumeToken:m,node:$}):(m.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(m)),$.value=m.value||"",i($,v.currentOffset(),v.currentPosition()),{node:$})}function d(v,m){const y=v.context(),k=s(7,y.offset,y.startLoc);return k.value=m,i(k,v.currentOffset(),v.currentPosition()),k}function f(v){const m=v.context(),y=s(6,m.offset,m.startLoc);let k=v.nextToken();if(k.type===8){const A=u(v);y.modifier=A.node,k=A.nextConsumeToken||v.nextToken()}switch(k.type!==9&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),k=v.nextToken(),k.type===2&&(k=v.nextToken()),k.type){case 10:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=d(v,k.value||"");break;case 4:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=a(v,k.value||"");break;case 5:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=l(v,k.value||"");break;case 6:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=c(v,k.value||"");break;default:{o(v,hn.UNEXPECTED_EMPTY_LINKED_KEY,m.lastStartLoc,0);const A=v.context(),$=s(7,A.offset,A.startLoc);return $.value="",i($,A.offset,A.startLoc),y.key=$,i(y,A.offset,A.startLoc),{nextConsumeToken:k,node:y}}}return i(y,v.currentOffset(),v.currentPosition()),{node:y}}function h(v){const m=v.context(),y=m.currentType===1?v.currentOffset():m.offset,k=m.currentType===1?m.endLoc:m.startLoc,A=s(2,y,k);A.items=[];let $=null;do{const L=$||v.nextToken();switch($=null,L.type){case 0:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(r(v,L.value||""));break;case 5:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(l(v,L.value||""));break;case 4:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(a(v,L.value||""));break;case 6:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(c(v,L.value||""));break;case 7:{const E=f(v);A.items.push(E.node),$=E.nextConsumeToken||null;break}}}while(m.currentType!==13&&m.currentType!==1);const I=m.currentType===1?m.lastOffset:v.currentOffset(),x=m.currentType===1?m.lastEndLoc:v.currentPosition();return i(A,I,x),A}function p(v,m,y,k){const A=v.context();let $=k.items.length===0;const I=s(1,m,y);I.cases=[],I.cases.push(k);do{const x=h(v);$||($=x.items.length===0),I.cases.push(x)}while(A.currentType!==13);return $&&o(v,hn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),i(I,v.currentOffset(),v.currentPosition()),I}function g(v){const m=v.context(),{offset:y,startLoc:k}=m,A=h(v);return m.currentType===13?A:p(v,y,k,A)}function b(v){const m=PN(v,_o({},e)),y=m.context(),k=s(0,y.offset,y.startLoc);return t&&k.loc&&(k.loc.source=v),k.body=g(m),e.onCacheKey&&(k.cacheKey=e.onCacheKey(v)),y.currentType!==13&&o(m,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),i(k,m.currentOffset(),m.currentPosition()),k}return{parse:b}}function Gi(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function VN(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Mx(e,t){for(let n=0;n<e.length;n++)Fy(e[n],t)}function Fy(e,t){switch(e.type){case 1:Mx(e.cases,t),t.helper("plural");break;case 2:Mx(e.items,t);break;case 6:{Fy(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function KN(e,t={}){const n=VN(e);n.helper("normalize"),e.body&&Fy(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function GN(e){const t=e.body;return t.type===2?Ex(t):t.cases.forEach(n=>Ex(n)),e}function Ex(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=$y(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function mc(e){switch(e.t=e.type,e.type){case 0:{const t=e;mc(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)mc(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)mc(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;mc(t.key),t.k=t.key,delete t.key,t.modifier&&(mc(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function YN(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,b){r.code+=g}function c(g,b=!0){const v=b?o:"";a(s?v+" ".repeat(g):v)}function u(g=!0){const b=++r.indentLevel;g&&c(b)}function d(g=!0){const b=--r.indentLevel;g&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function ZN(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Qc(e,t.key),t.modifier?(e.push(", "),Qc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function QN(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(Qc(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function XN(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(Qc(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function JN(e,t){t.body?Qc(e,t.body):e.push("null")}function Qc(e,t){const{helper:n}=e;switch(t.type){case 0:JN(e,t);break;case 1:XN(e,t);break;case 2:QN(e,t);break;case 6:ZN(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const e7=(e,t={})=>{const n=yt(t.mode)?t.mode:"normal",o=yt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
+
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=YN(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${$y(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Qc(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function t7(e,t={}){const n=_o({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=jN(n).parse(e);return o?(i&&GN(l),s&&mc(l),{ast:l,code:""}):(KN(l,n),e7(l,n))}/*!
|
|
31
|
+
* core-base v11.4.5
|
|
32
|
+
* (c) 2026 kazuya kawaguchi
|
|
33
|
+
* Released under the MIT License.
|
|
34
|
+
*/function n7(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function sr(e){return on(e)&&Oy(e)===0&&(yi(e,"b")||yi(e,"body"))}const X3=["b","body"];function o7(e){return Dl(e,X3)}const J3=["c","cases"];function s7(e){return Dl(e,J3,[])}const eA=["s","static"];function i7(e){return Dl(e,eA)}const tA=["i","items"];function r7(e){return Dl(e,tA,[])}const nA=["t","type"];function Oy(e){return Dl(e,nA)}const oA=["v","value"];function Wf(e,t){const n=Dl(e,oA);if(n!=null)return n;throw Cd(t)}const sA=["m","modifier"];function l7(e){return Dl(e,sA)}const iA=["k","key"];function a7(e){const t=Dl(e,iA);if(t)return t;throw Cd(6)}function Dl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(yi(e,s)&&e[s]!=null)return e[s]}return n}const rA=[...X3,...J3,...eA,...tA,...iA,...sA,...oA,...nA];function Cd(e){return new Error(`unhandled node type: ${e}`)}function a0(e){return n=>c7(n,e)}function c7(e,t){const n=o7(t);if(n==null)throw Cd(0);if(Oy(n)===1){const i=s7(n);return e.plural(i.reduce((r,l)=>[...r,Tx(e,l)],[]))}else return Tx(e,n)}function Tx(e,t){const n=i7(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=r7(t).reduce((s,i)=>[...s,Gg(e,i)],[]);return e.normalize(o)}}function Gg(e,t){const n=Oy(t);switch(n){case 3:return Wf(t,n);case 9:return Wf(t,n);case 4:{const o=t;if(yi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(yi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw Cd(n)}case 5:{const o=t;if(yi(o,"i")&&wo(o.i))return e.interpolate(e.list(o.i));if(yi(o,"index")&&wo(o.index))return e.interpolate(e.list(o.index));throw Cd(n)}case 6:{const o=t,s=l7(o),i=a7(o);return e.linked(Gg(e,i),s?Gg(e,s):void 0,e.type)}case 7:return Wf(t,n);case 8:return Wf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const u7=e=>e;let zf=_n();function d7(e,t={}){let n=!1;const o=t.onError||LN;return t.onError=s=>{n=!0,o(s)},{...t7(e,t),detectError:n}}function f7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yt(e)){nn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||u7)(e),s=zf[o];if(s)return s;const{ast:i,detectError:r}=d7(e,{...t,location:!1,jit:!0}),l=a0(i);return r?l:zf[o]=l}else{const n=e.cacheKey;if(n){const o=zf[n];return o||(zf[n]=a0(e))}else return a0(e)}}let Ad=null;function h7(e){Ad=e}function p7(e,t,n){Ad&&Ad.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const m7=g7("function:translate");function g7(e){return t=>Ad&&Ad.emit(e,t)}const Lr={INVALID_ARGUMENT:IN,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},v7=24;function $r(e){return ym(e,null,void 0)}function Ry(e,t){return t.locale!=null?Nx(t.locale):Nx(e.locale)}let c0;function Nx(e){if(yt(e))return e;if(Kn(e)){if(e.resolvedOnce&&c0!=null)return c0;if(e.constructor.name==="Function"){const t=e();if(EN(t))throw $r(Lr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return c0=t}else throw $r(Lr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw $r(Lr.NOT_SUPPORT_LOCALE_TYPE)}function y7(e,t,n){return[...new Set([n,...ro(t)?t:on(t)?Object.keys(t):yt(t)?[t]:[n]])]}function Yg(e,t,n){const o=yt(n)?n:Md,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;ro(r);)r=Ix(i,r,t);const l=ro(t)||!Jt(t)?t:t.default?t.default:null;r=yt(l)?[l]:l,ro(r)&&Ix(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Ix(e,t,n){let o=!0;for(let s=0;s<t.length&&nn(o);s++){const i=t[s];yt(i)&&(o=k7(e,t[s],n))}return o}function k7(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=b7(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function b7(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(ro(n)||Jt(n))&&n[s]&&(o=n[s])}return o}const Pl=[];Pl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Pl[1]={w:[1],".":[2],"[":[4],o:[7]};Pl[2]={w:[2],i:[3,0],0:[3,0]};Pl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Pl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Pl[5]={"'":[4,0],o:8,l:[5,0]};Pl[6]={'"':[4,0],o:8,l:[6,0]};const x7=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function w7(e){return x7.test(e)}function _7(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function S7(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function C7(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:w7(t)?_7(t):"*"+t}function A7(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=C7(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=S7(i),d=Pl[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const Lx=new Map;function M7(e,t){return on(e)?e[t]:null}function E7(e,t){if(!on(e))return null;let n=Lx.get(t);if(n||(n=A7(t),n&&Lx.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(rA.includes(r)&&sr(s)||!on(s)||!yi(s,r))return null;const l=s[r];if(l===void 0||Kn(s))return null;s=l,i++}return s}const T7="11.4.5",km=-1,Md="en-US",rp="",$x=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function N7(){return{upper:(e,t)=>t==="text"&&yt(e)?e.toUpperCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yt(e)?e.toLowerCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yt(e)?$x(e):t==="vnode"&&on(e)&&"__v_isVNode"in e?$x(e.children):e}}let lA;function I7(e){lA=e}let aA;function L7(e){aA=e}let cA;function $7(e){cA=e}let uA=null;const F7=e=>{uA=e},O7=()=>uA;let dA=null;const Fx=e=>{dA=e},R7=()=>dA;let Ox=0;function B7(e={}){const t=Kn(e.onWarn)?e.onWarn:yN,n=yt(e.version)?e.version:T7,o=yt(e.locale)||Kn(e.locale)?e.locale:Md,s=Kn(o)?Md:o,i=ro(e.fallbackLocale)||Jt(e.fallbackLocale)||yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Jt(e.messages)?e.messages:u0(s),l=Jt(e.datetimeFormats)?e.datetimeFormats:u0(s),a=Jt(e.numberFormats)?e.numberFormats:u0(s),c=_o(_n(),e.modifiers,N7()),u=e.pluralRules||_n(),d=Kn(e.missing)?e.missing:null,f=nn(e.missingWarn)||Zc(e.missingWarn)?e.missingWarn:!0,h=nn(e.fallbackWarn)||Zc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,b=Kn(e.postTranslation)?e.postTranslation:null,v=Jt(e.processor)?e.processor:null,m=nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,k=Kn(e.messageCompiler)?e.messageCompiler:lA,A=Kn(e.messageResolver)?e.messageResolver:aA||M7,$=Kn(e.localeFallbacker)?e.localeFallbacker:cA||y7,I=on(e.fallbackContext)?e.fallbackContext:void 0,x=e,L=on(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,E=on(x.__numberFormatters)?x.__numberFormatters:new Map,F=on(x.__meta)?x.__meta:{};Ox++;const S={version:n,cid:Ox,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:g,postTranslation:b,processor:v,warnHtmlMessage:m,escapeParameter:y,messageCompiler:k,messageResolver:A,localeFallbacker:$,fallbackContext:I,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=L,S.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&p7(S,n,F),S}const u0=e=>({[e]:_n()});function By(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return yt(l)?l:t}else return t}function Ou(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function D7(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function P7(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(D7(e,t[o]))return!0;return!1}function Rx(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!yt(t[0])&&!Z3(t[0])&&!wo(t[0]))return rp;const[a,c,u,d]=Zg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ry(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="datetime format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Jt(m));$++)By(e,a,v,f,y);if(!Jt(m)||!yt(v))return o?km:a;let k=`${v}__${a}`;vm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.DateTimeFormat(v,_o({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const fA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Zg(...e){const[t,n,o,s]=e,i=_n();let r=_n(),l;if(yt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw $r(Lr.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw $r(Lr.INVALID_ISO_DATE_ARGUMENT)}}else if(Z3(t)){if(isNaN(t.getTime()))throw $r(Lr.INVALID_DATE_ARGUMENT);l=t}else if(wo(t))l=t;else throw $r(Lr.INVALID_ARGUMENT);return yt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{fA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Bx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Dx(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!wo(t[0]))return rp;const[a,c,u,d]=Qg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ry(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="number format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Jt(m));$++)By(e,a,v,f,y);if(!Jt(m)||!yt(v))return o?km:a;let k=`${v}__${a}`;vm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.NumberFormat(v,_o({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const hA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Qg(...e){const[t,n,o,s]=e,i=_n();let r=_n();if(!wo(t))throw $r(Lr.INVALID_ARGUMENT);const l=t;return yt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{hA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Px(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const H7=e=>e,W7=e=>"",z7="text",U7=e=>e.length===0?"":$y(e),q7=TN;function d0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function j7(e){const t=wo(e.pluralIndex)?e.pluralIndex:-1;return wo(e.named?.count)?e.named.count:wo(e.named?.n)?e.named.n:t}function V7(e={}){const t=e.locale,n=j7(e),o=yt(t)&&Kn(e.pluralRules?.[t])?e.pluralRules[t]:d0,s=o===d0?void 0:d0,i=v=>v[o(n,v.length,s)],r=e.list||[],l=v=>r[v],a=e.named||_n();wo(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=v=>a[v];function u(v,m){const y=Kn(e.messages)?e.messages(v,!!m):on(e.messages)?e.messages[v]:!1;return y||(e.parent?e.parent.message(v):W7)}const d=v=>e.modifiers?e.modifiers[v]:H7,f=Kn(e.processor?.normalize)?e.processor.normalize:U7,h=Kn(e.processor?.interpolate)?e.processor.interpolate:q7,p=yt(e.processor?.type)?e.processor.type:z7,b={list:l,named:c,plural:i,linked:(v,...m)=>{const[y,k]=m;let A="text",$="";m.length===1?on(y)?($=y.modifier||$,A=y.type||A):yt(y)&&($=y||$):m.length===2&&(yt(y)&&($=y||$),yt(k)&&(A=k||A));const I=u(v,!0)(b),x=I===""||I===void 0?v:I,L=A==="vnode"&&ro(x)&&$?x[0]:x;return $?d($)(L,A):L},message:u,type:p,interpolate:h,normalize:f,values:_o(_n(),r,a)};return b}const Hx=()=>"",hi=e=>Kn(e);function Wx(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Xg(...t),u=nn(c.missingWarn)?c.missingWarn:e.missingWarn,d=nn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=nn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=yt(c.default)||nn(c.default)?nn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||p!=null&&(yt(p)||Kn(p)),b=Ry(e,c);f&&K7(c);let[v,m,y]=h?[a,b,l[b]||_n()]:pA(e,a,b,r,d,u),k=v,A=a;if(!h&&!(yt(k)||sr(k)||hi(k))&&g&&(k=p,A=k),!h&&(!(yt(k)||sr(k)||hi(k))||!yt(m)))return s?km:a;let $=!1;const I=()=>{$=!0},x=hi(k)?k:mA(e,a,m,k,A,I);if($)return k;const L=Z7(e,m,y,c),E=V7(L),F=G7(e,x,E);let S=o?o(F,a):F;if(f&&yt(S)&&(S=AN(S)),__INTLIFY_PROD_DEVTOOLS__){const N={timestamp:Date.now(),key:yt(a)?a:hi(k)?k.key:"",locale:m||(hi(k)?k.locale:""),format:yt(k)?k:hi(k)?k.source:"",message:S};N.meta=_o({},e.__meta,O7()||{}),m7(N)}return S}function K7(e){ro(e.list)?e.list=e.list.map(t=>yt(t)?Sx(t):t):on(e.named)&&Object.keys(e.named).forEach(t=>{yt(e.named[t])&&(e.named[t]=Sx(e.named[t]))})}function pA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=_n(),f,h=null;const p="translate";for(let g=0;g<u.length&&(f=u[g],d=r[f]||_n(),(h=a(d,t))===null&&(h=d[t]),!(yt(h)||sr(h)||hi(h)));g++)if(!P7(f,u)){const b=By(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function mA(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(hi(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,Y7(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function G7(e,t,n){return t(n)}function Xg(...e){const[t,n,o]=e,s=_n();if(!yt(t)&&!wo(t)&&!hi(t)&&!sr(t))throw $r(Lr.INVALID_ARGUMENT);const i=wo(t)?String(t):(hi(t),t);return wo(n)?s.plural=n:yt(n)?s.default=n:Jt(n)&&!vm(n)?s.named=n:ro(n)&&(s.list=n),wo(o)?s.plural=o:yt(o)?s.default=o:Jt(o)&&_o(s,o),[i,s]}function Y7(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>kN(t,n,r)}}function Z7(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let g=r(n,h);if(g==null&&(u||p)){const[b,,v]=pA(u||e,h,t,l,a,c);g=b??r(v,h)}if(yt(g)||sr(g)){let b=!1;const m=mA(e,h,t,g,h,()=>{b=!0});return b?Hx:m}else return hi(g)?g:Hx}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),wo(o.plural)&&(f.pluralIndex=o.plural),f}n7();/*!
|
|
35
|
+
* vue-i18n v11.4.5
|
|
36
|
+
* (c) 2026 kazuya kawaguchi
|
|
37
|
+
* Released under the MIT License.
|
|
38
|
+
*/const Q7="11.4.5";function X7(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ya().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ya().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1)}const vs={UNEXPECTED_RETURN_TYPE:v7,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Ls(e,...t){return ym(e,null,void 0)}const Jg=Bl("__translateVNode"),ev=Bl("__datetimeParts"),tv=Bl("__numberParts"),gA=Bl("__setPluralRules"),vA=Bl("__injectWithOption"),wc=Bl("__dispose");function Ed(e){if(!on(e)||sr(e))return e;for(const t in e)if(yi(e,t))if(!t.includes("."))on(e[t])&&Ed(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=_n()),!on(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(sr(s)?rA.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!sr(s)){const r=s[n[o]];on(r)&&Ed(r)}}return e}function Dy(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Jt(n)?n:ro(o)?_n():{[e]:_n()};if(ro(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||_n(),kh(c,r[a])):kh(c,r)}else yt(l)&&kh(JSON.parse(l),r)}),s==null&&i)for(const l in r)yi(r,l)&&Ed(r[l]);return r}function yA(e){return e.type}function kA(e,t,n){let o=on(t.messages)?t.messages:_n();"__i18nGlobal"in n&&(o=Dy(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(on(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(on(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function zx(e){return re(Sl,null,e,0)}function Td(){return Yo()}const Ux="__INTLIFY_META__",qx=()=>[],J7=()=>!1;let jx=0;function Vx(e){return((t,n,o,s)=>e(n,o,Td()||void 0,s))}const eI=()=>{const e=Td();let t=null;return e&&(t=yA(e)[Ux])?{[Ux]:t}:null};function lp(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=ip?X:Ra;let r=nn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:yt(e.locale)?e.locale:Md),a=i(t&&r?t.fallbackLocale.value:yt(e.fallbackLocale)||ro(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Dy(l.value,e)),u=i(Jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:nn(e.missingWarn)||Zc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:nn(e.fallbackWarn)||Zc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:nn(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,b=Kn(e.missing)?e.missing:null,v=Kn(e.missing)?Vx(e.missing):null,m=Kn(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter;const A=t?t.modifiers:Jt(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,I;I=(()=>{o&&Fx(null);const ge={version:Q7,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:$,missing:v===null?void 0:v,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:m===null?void 0:m,warnHtmlMessage:y,escapeParameter:k,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ge.datetimeFormats=u.value,ge.numberFormats=d.value,ge.__datetimeFormatters=Jt(I)?I.__datetimeFormatters:void 0,ge.__numberFormatters=Jt(I)?I.__numberFormatters:void 0;const Ne=B7(ge);return o&&Fx(Ne),Ne})(),Ou(I,l.value,a.value);function L(){return[l.value,a.value,c.value,u.value,d.value]}const E=R({get:()=>l.value,set:ge=>{I.locale=ge,l.value=ge}}),F=R({get:()=>a.value,set:ge=>{I.fallbackLocale=ge,a.value=ge,Ou(I,l.value,ge)}}),S=R(()=>c.value),N=R(()=>u.value),D=R(()=>d.value);function B(){return Kn(m)?m:null}function U(ge){m=ge,I.postTranslation=ge}function H(){return b}function P(ge){ge!==null&&(v=Vx(ge)),b=ge,I.missing=v}const Z=(ge,Ne,et,rt,St,gt)=>{L();let It;try{__INTLIFY_PROD_DEVTOOLS__,o||(I.fallbackContext=t?R7():void 0),It=ge(I)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(I.fallbackContext=void 0)}if(et!=="translate exists"&&wo(It)&&It===km||et==="translate exists"&&!It){const[Ut,ht]=Ne();return t&&p?rt(t):St(Ut)}else{if(gt(It))return It;throw Ls(vs.UNEXPECTED_RETURN_TYPE)}};function K(...ge){return Z(Ne=>Reflect.apply(Wx,null,[Ne,...ge]),()=>Xg(...ge),"translate",Ne=>Reflect.apply(Ne.t,Ne,[...ge]),Ne=>Ne,Ne=>yt(Ne))}function V(...ge){const[Ne,et,rt]=ge;if(rt&&!on(rt))throw Ls(vs.INVALID_ARGUMENT);return K(Ne,et,_o({resolvedMessage:!0},rt||{}))}function J(...ge){return Z(Ne=>Reflect.apply(Rx,null,[Ne,...ge]),()=>Zg(...ge),"datetime format",Ne=>Reflect.apply(Ne.d,Ne,[...ge]),()=>rp,Ne=>yt(Ne)||ro(Ne))}function he(...ge){return Z(Ne=>Reflect.apply(Dx,null,[Ne,...ge]),()=>Qg(...ge),"number format",Ne=>Reflect.apply(Ne.n,Ne,[...ge]),()=>rp,Ne=>yt(Ne)||ro(Ne))}function ne(ge){return ge.map(Ne=>yt(Ne)||wo(Ne)||nn(Ne)?zx(String(Ne)):Ne)}const de={normalize:ne,interpolate:ge=>ge,type:"vnode"};function Ce(...ge){return Z(Ne=>{let et;const rt=Ne;try{rt.processor=de,et=Reflect.apply(Wx,null,[rt,...ge])}finally{rt.processor=null}return et},()=>Xg(...ge),"translate",Ne=>Ne[Jg](...ge),Ne=>[zx(Ne)],Ne=>ro(Ne))}function Ie(...ge){return Z(Ne=>Reflect.apply(Dx,null,[Ne,...ge]),()=>Qg(...ge),"number format",Ne=>Ne[tv](...ge),qx,Ne=>yt(Ne)||ro(Ne))}function le(...ge){return Z(Ne=>Reflect.apply(Rx,null,[Ne,...ge]),()=>Zg(...ge),"datetime format",Ne=>Ne[ev](...ge),qx,Ne=>yt(Ne)||ro(Ne))}function z(ge){$=ge,I.pluralRules=$}function ae(ge,Ne){return Z(()=>{if(!ge)return!1;const et=yt(Ne)?Ne:l.value,rt=yt(Ne)?[et]:Yg(I,a.value,et);for(let St=0;St<rt.length;St++){const gt=ee(rt[St]);let It=I.messageResolver(gt,ge);if(It===null&&(It=gt[ge]),sr(It)||hi(It)||yt(It))return!0}return!1},()=>[ge],"translate exists",et=>Reflect.apply(et.te,et,[ge,Ne]),J7,et=>nn(et))}function ie(ge){let Ne=null;const et=Yg(I,a.value,l.value);for(let rt=0;rt<et.length;rt++){const St=c.value[et[rt]]||{},gt=I.messageResolver(St,ge);if(gt!=null){Ne=gt;break}}return Ne}function q(ge){const Ne=ie(ge);return Ne??(t?t.tm(ge)||{}:{})}function ee(ge){return c.value[ge]||{}}function ye(ge,Ne){if(s){const et={[ge]:Ne};for(const rt in et)yi(et,rt)&&Ed(et[rt]);Ne=et[ge]}c.value[ge]=Ne,I.messages=c.value}function fe(ge,Ne){c.value[ge]=c.value[ge]||{};const et={[ge]:Ne};if(s)for(const rt in et)yi(et,rt)&&Ed(et[rt]);Ne=et[ge],kh(Ne,c.value[ge]),I.messages=c.value}function ve(ge){return u.value[ge]||{}}function j(ge,Ne){u.value[ge]=Ne,I.datetimeFormats=u.value,Bx(I,ge,Ne)}function te(ge,Ne){u.value[ge]=_o(u.value[ge]||{},Ne),I.datetimeFormats=u.value,Bx(I,ge,Ne)}function me(ge){return d.value[ge]||{}}function Ae(ge,Ne){d.value[ge]=Ne,I.numberFormats=d.value,Px(I,ge,Ne)}function $e(ge,Ne){d.value[ge]=_o(d.value[ge]||{},Ne),I.numberFormats=d.value,Px(I,ge,Ne)}jx++,t&&ip&&(Qe(t.locale,ge=>{r&&(l.value=ge,I.locale=ge,Ou(I,l.value,a.value))}),Qe(t.fallbackLocale,ge=>{r&&(a.value=ge,I.fallbackLocale=ge,Ou(I,l.value,a.value))}));const De={id:jx,locale:E,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(ge){r=ge,ge&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Ou(I,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return $||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(ge){f=ge,I.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ge){h=ge,I.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ge){p=ge},get fallbackFormat(){return g},set fallbackFormat(ge){g=ge,I.fallbackFormat=g},get warnHtmlMessage(){return y},set warnHtmlMessage(ge){y=ge,I.warnHtmlMessage=ge},get escapeParameter(){return k},set escapeParameter(ge){k=ge,I.escapeParameter=ge},t:K,getLocaleMessage:ee,setLocaleMessage:ye,mergeLocaleMessage:fe,getPostTranslationHandler:B,setPostTranslationHandler:U,getMissingHandler:H,setMissingHandler:P,[gA]:z};return De.datetimeFormats=N,De.numberFormats=D,De.rt=V,De.te=ae,De.tm=q,De.d=J,De.n=he,De.getDateTimeFormat=ve,De.setDateTimeFormat=j,De.mergeDateTimeFormat=te,De.getNumberFormat=me,De.setNumberFormat=Ae,De.mergeNumberFormat=$e,De[vA]=n,De[Jg]=Ce,De[ev]=le,De[tv]=Ie,De}function tI(e){const t=yt(e.locale)?e.locale:Md,n=yt(e.fallbackLocale)||ro(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Kn(e.missing)?e.missing:void 0,s=nn(e.silentTranslationWarn)||Zc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=nn(e.silentFallbackWarn)||Zc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=nn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Kn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=nn(e.sync)?e.sync:!0;let p=e.messages;if(Jt(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((I,x)=>{const L=I[x]||(I[x]={});return _o(L,A[x]),I},p||{})}const{__i18n:g,__root:b,__injectWithOption:v}=e,m=e.datetimeFormats,y=e.numberFormats,k=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:k,datetimeFormats:m,numberFormats:y,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:b,__injectWithOption:v}}function nv(e={}){const t=lp(tI(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return nn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=nn(s)?!s:s},get silentFallbackWarn(){return nn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=nn(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function nI(e,t,n){return{beforeCreate(){const o=Td();if(!o)throw Ls(vs.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=Kx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=nv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=Kx(e,s);else{this.$i18n=nv({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&kA(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=Td();if(!o)throw Ls(vs.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function Kx(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[gA](t.pluralizationRules||e.pluralizationRules);const n=Dy(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const Py={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function oI({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},_n())}function bA(){return Pe}const sI=Ze({name:"i18n-t",props:_o({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>wo(e)||!isNaN(e)}},Py),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=_n();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=yt(e.plural)?+e.plural:e.plural);const u=oI(t,a);return s[Jg](e.keypath,u,c)},r=_o(_n(),o),l=yt(e.tag)||on(e.tag)?e.tag:bA();return on(l)?mn(l,r,{default:i}):mn(l,r,i())}}}),Gx=sI;function iI(e){return ro(e)&&!yt(e[0])}function xA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=_n();e.locale&&(c.locale=e.locale),yt(e.format)?c.key=e.format:on(e.format)&&(yt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?_o(_n(),h,{[p]:e.format[p]}):h,_n()));const d=o(e.value,c,u);let f=[c.key];return ro(d)?f=d.map((h,p)=>{const g=s[h.type],b=g?g({[h.type]:h.value,index:p,parts:d}):[h.value];return iI(b)&&(b[0].key=`${h.type}-${p}`),b}):yt(d)&&(f=[d]),f},l=_o(_n(),i),a=yt(e.tag)||on(e.tag)?e.tag:bA();return on(a)?mn(a,l,{default:r}):mn(a,l,r())}}const rI=Ze({name:"i18n-n",props:_o({value:{type:Number,required:!0},format:{type:[String,Object]}},Py),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return xA(e,t,hA,(...o)=>n[tv](...o))}}),Yx=rI;function lI(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function aI(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ls(vs.UNEXPECTED_ERROR);const c=lI(e,l.$),u=Zx(a);return[Reflect.apply(c.t,c,[...Qx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);ip&&(r.__i18nWatcher=Qe(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{ip&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=Zx(l);r.textContent=Reflect.apply(a.t,a,[...Qx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Zx(e){if(yt(e))return{path:e};if(Jt(e)){if(!("path"in e))throw Ls(vs.REQUIRED_VALUE,"path");return e}else throw Ls(vs.INVALID_VALUE)}function Qx(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return yt(n)&&(r.locale=n),wo(s)&&(r.plural=s),wo(i)&&(r.plural=i),[t,l,r]}function cI(e,t,...n){const o=Jt(n[0])?n[0]:{};(nn(o.globalInstall)?o.globalInstall:!0)&&([Gx.name,"I18nT"].forEach(i=>e.component(i,Gx)),[Yx.name,"I18nN"].forEach(i=>e.component(i,Yx)),[ew.name,"I18nD"].forEach(i=>e.component(i,ew))),e.directive("t",aI(t))}const uI=Bl("global-vue-i18n");function dI(e={}){const t=__VUE_I18N_LEGACY_API__&&nn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=nn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=fI(e,t),r=Bl("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Jt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=kI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&cI(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(nI(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Tt(e={}){const t=Td();if(t==null)throw Ls(vs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ls(vs.NOT_INSTALLED);const n=hI(t),o=mI(n),s=yA(t),i=pI(e,s);if(i==="global")return kA(o,e,s),o;if(i==="parent"){let a=Xx(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Ls(vs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=_o({},e),u=Xx(n,t);c.__root=u||o;const d=lp(c);return a.__composerExtend&&(d[wc]=a.__composerExtend(d)),fy()&&hy(()=>{const h=d[wc];h&&(h(),delete d[wc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=_o({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=lp(a),r.__composerExtend&&(l[wc]=r.__composerExtend(l)),vI(r,t,l),r.__setInstance(t,l)}return l}function fI(e,t){const n=DE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>nv(e)):n.run(()=>lp(e));if(o==null)throw Ls(vs.UNEXPECTED_ERROR);return[n,o]}function hI(e){const t=Kt(e.isCE?uI:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ls(e.isCE?vs.NOT_INSTALLED_WITH_PROVIDE:vs.UNEXPECTED_ERROR);return t}function pI(e,t){return vm(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function mI(e){return e.mode==="composition"?e.global:e.global.__composer}function Xx(e,t,n=!1){let o=null;const s=t.root;let i=gI(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[vA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function gI(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function vI(e,t,n){cn(()=>{},t),bn(()=>{const o=n;e.__deleteInstance(t);const s=o[wc];s&&(s(),delete o[wc])},t)}const yI=["locale","fallbackLocale","availableLocales"],Jx=["t","rt","d","n","tm","te"];function kI(e,t){const n=Object.create(null);return yI.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Ls(vs.UNEXPECTED_ERROR);const r=po(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,Jx.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Ls(vs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Jx.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const bI=Ze({name:"i18n-d",props:_o({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Py),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return xA(e,t,fA,(...o)=>n[ev](...o))}}),ew=bI;X7();I7(f7);L7(E7);$7(Yg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ya();e.__INTLIFY__=!0,h7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const xI="modulepreload",wI=function(e){return"/"+e},tw={},ms=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=r(n.map(c=>{if(c=wI(c),c in tw)return;tw[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":xI,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Ft={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function nw(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function ao(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function So(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Xc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Yd(e){const t=ao(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function lu(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Hy(){const e=ao(Ft.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function Wy(e){const n={...Hy()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];So(Ft.unread,JSON.stringify(n))}function _I(){const e=Yd(Ft.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function f0(e){lu(Ft.collapsedWorkspaces,Array.from(e))}function SI(){const e=Yd(Ft.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function wA(e){lu(Ft.workspaceOrder,Array.from(e))}function Uf(){const e=Yd(Ft.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function ow(e){lu(Ft.workspaceNameOverrides,e)}function CI(){return ao(Ft.workspaceSort)}function _A(e){So(Ft.workspaceSort,e)}const sw=Ft.clientId,AI="kimi-code-web",MI="web";function EI(){return{serverHttpUrl:NI(),clientId:FI(),clientName:AI,clientVersion:OI(),clientUiMode:MI}}function TI(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function NI(e){const t=TI(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function II(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function LI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return II(e)}function _c(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function $I(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function FI(){const e=ao(sw);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return So(sw,t),t}function OI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function RI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function BI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Go(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return DI(e)}function DI(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function PI(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function HI(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function WI(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function zI(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const UI={"&":"&","<":"<",">":">",'"':""","'":"'"};function iw(e){return e.replace(/[&<>"']/g,t=>UI[t]??t)}function qI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jI(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return rw(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return rw(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function rw(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function h0(e,t){const n=iw(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(qI(iw(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const gc=X(0),VI=["type","disabled","aria-label"],KI=Ze({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=X();return t({el:n}),(o,s)=>(w(),T("button",{ref_key:"el",ref:n,class:We(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Fn(o.$slots,"default",{},void 0,!0)],10,VI))}}),ct=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Dn=ct(KI,[["__scopeId","data-v-c9e67023"]]),GI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YI(e,t){return w(),T("svg",GI,[...t[0]||(t[0]=[_("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const ZI=pt({name:"kimi-add-conversation",render:YI}),QI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XI(e,t){return w(),T("svg",QI,[...t[0]||(t[0]=[_("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const JI=pt({name:"kimi-folder",render:XI}),eL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tL=["clip-path"],nL=["id"];function oL(e,t){return w(),T("svg",eL,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,tL),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,nL)])])}const sL=pt({name:"kimi-folder-open",render:oL,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),iL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function rL(e,t){return w(),T("svg",iL,[...t[0]||(t[0]=[_("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),_("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),_("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const lL=pt({name:"kimi-more",render:rL}),aL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function cL(e,t){return w(),T("svg",aL,[...t[0]||(t[0]=[_("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const uL=pt({name:"kimi-search",render:cL}),dL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fL(e,t){return w(),T("svg",dL,[...t[0]||(t[0]=[_("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),_("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const hL=pt({name:"kimi-setting",render:fL}),pL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mL(e,t){return w(),T("svg",pL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const gL=pt({name:"tabler-layout-sidebar-left-collapse",render:mL}),vL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yL(e,t){return w(),T("svg",vL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const kL=pt({name:"tabler-layout-sidebar-left-expand",render:yL}),bL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xL(e,t){return w(),T("svg",bL,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const wL=pt({name:"tabler-paperclip",render:xL}),_L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SL(e,t){return w(),T("svg",_L,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const CL=pt({name:"ri-add-line",render:SL}),AL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ML(e,t){return w(),T("svg",AL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const EL=pt({name:"ri-alert-line",render:ML}),TL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NL(e,t){return w(),T("svg",TL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const IL=pt({name:"ri-archive-line",render:NL}),LL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $L(e,t){return w(),T("svg",LL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const FL=pt({name:"ri-arrow-down-line",render:$L}),OL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RL(e,t){return w(),T("svg",OL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const BL=pt({name:"ri-arrow-down-s-line",render:RL}),DL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PL(e,t){return w(),T("svg",DL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const HL=pt({name:"ri-arrow-go-back-line",render:PL}),WL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zL(e,t){return w(),T("svg",WL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const UL=pt({name:"ri-arrow-right-line",render:zL}),qL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jL(e,t){return w(),T("svg",qL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const VL=pt({name:"ri-arrow-right-s-line",render:jL}),KL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GL(e,t){return w(),T("svg",KL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const lw=pt({name:"ri-arrow-up-line",render:GL}),YL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZL(e,t){return w(),T("svg",YL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const QL=pt({name:"ri-arrow-up-s-line",render:ZL}),XL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JL(e,t){return w(),T("svg",XL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const e$=pt({name:"ri-braces-line",render:JL}),t$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function n$(e,t){return w(),T("svg",t$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const o$=pt({name:"ri-calendar-close-line",render:n$}),s$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function i$(e,t){return w(),T("svg",s$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const r$=pt({name:"ri-calendar-schedule-line",render:i$}),l$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function a$(e,t){return w(),T("svg",l$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const c$=pt({name:"ri-calendar-todo-line",render:a$}),u$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function d$(e,t){return w(),T("svg",u$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const f$=pt({name:"ri-check-line",render:d$}),h$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function p$(e,t){return w(),T("svg",h$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const m$=pt({name:"ri-close-line",render:p$}),g$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v$(e,t){return w(),T("svg",g$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const y$=pt({name:"ri-code-line",render:v$}),k$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b$(e,t){return w(),T("svg",k$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const x$=pt({name:"ri-collapse-diagonal-line",render:b$}),w$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _$(e,t){return w(),T("svg",w$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const S$=pt({name:"ri-download-line",render:_$}),C$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A$(e,t){return w(),T("svg",C$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const M$=pt({name:"ri-draggable",render:A$}),E$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T$(e,t){return w(),T("svg",E$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const N$=pt({name:"ri-equalizer-line",render:T$}),I$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L$(e,t){return w(),T("svg",I$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const $$=pt({name:"ri-expand-diagonal-line",render:L$}),F$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O$(e,t){return w(),T("svg",F$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const R$=pt({name:"ri-external-link-line",render:O$}),B$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D$(e,t){return w(),T("svg",B$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const P$=pt({name:"ri-file-add-line",render:D$}),H$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W$(e,t){return w(),T("svg",H$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const z$=pt({name:"ri-file-copy-line",render:W$}),U$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q$(e,t){return w(),T("svg",U$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const j$=pt({name:"ri-file-edit-line",render:q$}),V$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K$(e,t){return w(),T("svg",V$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const aw=pt({name:"ri-file-line",render:K$}),G$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y$(e,t){return w(),T("svg",G$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const Z$=pt({name:"ri-file-text-line",render:Y$}),Q$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X$(e,t){return w(),T("svg",Q$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const J$=pt({name:"ri-flashlight-line",render:X$}),eF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tF(e,t){return w(),T("svg",eF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const nF=pt({name:"ri-folder-add-line",render:tF}),oF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sF(e,t){return w(),T("svg",oF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const iF=pt({name:"ri-folder-fill",render:sF}),rF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lF(e,t){return w(),T("svg",rF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const aF=pt({name:"ri-git-fork-line",render:lF}),cF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uF(e,t){return w(),T("svg",cF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const dF=pt({name:"ri-git-pull-request-line",render:uF}),fF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hF(e,t){return w(),T("svg",fF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const pF=pt({name:"ri-global-line",render:hF}),mF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gF(e,t){return w(),T("svg",mF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const cw=pt({name:"ri-image-line",render:gF}),vF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yF(e,t){return w(),T("svg",vF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const kF=pt({name:"ri-information-line",render:yF}),bF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xF(e,t){return w(),T("svg",bF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const wF=pt({name:"ri-links-line",render:xF}),_F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SF(e,t){return w(),T("svg",_F,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const CF=pt({name:"ri-list-check",render:SF}),AF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MF(e,t){return w(),T("svg",AF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const EF=pt({name:"ri-list-unordered",render:MF}),TF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NF(e,t){return w(),T("svg",TF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const IF=pt({name:"ri-login-box-line",render:NF}),LF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $F(e,t){return w(),T("svg",LF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const FF=pt({name:"ri-mail-line",render:$F}),OF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RF(e,t){return w(),T("svg",OF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const BF=pt({name:"ri-message-line",render:RF}),DF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PF(e,t){return w(),T("svg",DF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const HF=pt({name:"ri-pause-fill",render:PF}),WF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zF(e,t){return w(),T("svg",WF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const UF=pt({name:"ri-pencil-line",render:zF}),qF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jF(e,t){return w(),T("svg",qF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const VF=pt({name:"ri-play-fill",render:jF}),KF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GF(e,t){return w(),T("svg",KF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const YF=pt({name:"ri-question-line",render:GF}),ZF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QF(e,t){return w(),T("svg",ZF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const XF=pt({name:"ri-sort-desc",render:QF}),JF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eO(e,t){return w(),T("svg",JF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const tO=pt({name:"ri-sparkling-line",render:eO}),nO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oO(e,t){return w(),T("svg",nO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const sO=pt({name:"ri-star-fill",render:oO}),iO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rO(e,t){return w(),T("svg",iO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const lO=pt({name:"ri-star-line",render:rO}),aO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cO(e,t){return w(),T("svg",aO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const uO=pt({name:"ri-stop-fill",render:cO}),dO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fO(e,t){return w(),T("svg",dO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const hO=pt({name:"ri-subtract-line",render:fO}),pO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mO(e,t){return w(),T("svg",pO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const gO=pt({name:"ri-target-line",render:mO}),vO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yO(e,t){return w(),T("svg",vO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const kO=pt({name:"ri-terminal-box-line",render:yO}),bO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xO(e,t){return w(),T("svg",bO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const wO=pt({name:"ri-time-line",render:xO}),_O={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SO(e,t){return w(),T("svg",_O,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const CO=pt({name:"ri-tools-line",render:SO}),AO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MO(e,t){return w(),T("svg",AO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const EO=pt({name:"ri-user-line",render:MO}),TO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
+
<path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
|
|
40
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
|
|
41
|
+
</svg>
|
|
42
|
+
`,NO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
+
<path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
|
|
44
|
+
</svg>
|
|
45
|
+
`,IO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
+
<g clip-path="url(#clip0_4626_2033)">
|
|
47
|
+
<path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
|
|
48
|
+
</g>
|
|
49
|
+
<defs>
|
|
50
|
+
<clipPath id="clip0_4626_2033">
|
|
51
|
+
<rect width="24" height="24" fill="white"/>
|
|
52
|
+
</clipPath>
|
|
53
|
+
</defs>
|
|
54
|
+
</svg>
|
|
55
|
+
`,LO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
+
<path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
|
|
57
|
+
<path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
|
|
58
|
+
<path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
|
|
59
|
+
</svg>
|
|
60
|
+
`,$O=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
+
<path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
|
|
62
|
+
</svg>
|
|
63
|
+
`,FO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
64
|
+
<path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
|
|
65
|
+
<path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
|
|
66
|
+
</svg>
|
|
67
|
+
`,OO='<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>',RO='<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>',BO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',DO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',PO='<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>',HO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',WO='<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>',zO='<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>',UO='<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>',qO='<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>',jO='<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>',uw='<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>',VO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',KO='<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>',GO='<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>',YO='<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>',ZO='<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>',QO='<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>',XO='<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>',JO='<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>',eR='<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>',tR='<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>',nR='<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>',oR='<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>',sR='<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>',iR='<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>',rR='<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>',lR='<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>',aR='<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>',dw='<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>',cR='<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>',uR='<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>',dR='<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>',fR='<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>',hR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',pR='<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>',mR='<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>',fw='<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>',gR='<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>',vR='<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>',yR='<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>',kR='<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>',bR='<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>',xR='<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>',wR='<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>',_R='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',SR='<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>',CR='<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>',AR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 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>',MR='<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>',ER='<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>',TR='<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>',NR='<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>',IR='<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>',LR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',$R='<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>',FR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',OR='<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>',RR='<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>',BR='<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>',SA={sm:14,md:16,lg:20};function vt(e,t){return{component:e,svg:t}}const CA={plus:vt(CL,DO),"chat-new":vt(ZI,TO),"calendar-close":vt(o$,GO),"calendar-schedule":vt(r$,YO),"calendar-todo":vt(c$,ZO),close:vt(m$,XO),check:vt(f$,QO),archive:vt(IL,HO),search:vt(uL,$O),copy:vt(z$,lR),link:vt(wF,vR),"external-link":vt(R$,iR),download:vt(S$,tR),undo:vt(HL,UO),send:vt(lw,uw),image:vt(cw,fw),settings:vt(hL,FO),sliders:vt(N$,oR),"log-in":vt(IF,bR),"chevron-down":vt(BL,zO),"chevron-right":vt(VL,jO),"chevron-up":vt(QL,VO),"arrow-up":vt(lw,uw),"arrow-down":vt(FL,WO),"arrow-right":vt(UL,qO),minus:vt(hO,LR),"panel-collapse":vt(gL,OO),"panel-expand":vt(kL,RO),expand:vt($$,sR),collapse:vt(x$,eR),list:vt(EF,kR),sort:vt(XF,MR),grip:vt(M$,nR),folder:vt(sL,IO),"folder-closed":vt(JI,NO),"folder-plus":vt(nF,dR),"folder-solid":vt(iF,fR),file:vt(aw,dw),"file-text":vt(Z$,cR),"file-edit":vt(j$,aR),"file-plus":vt(P$,rR),"file-off":vt(aw,dw),attachment:vt(wL,BO),"image-off":vt(cw,fw),code:vt(y$,JO),terminal:vt(kO,FR),pencil:vt(UF,SR),tool:vt(CO,RR),glob:vt(e$,KO),globe:vt(pF,mR),"check-list":vt(CF,yR),bolt:vt(J$,uR),"git-fork":vt(aF,hR),"git-pull-request":vt(dF,pR),message:vt(BF,wR),mail:vt(FF,xR),user:vt(EO,BR),info:vt(kF,gR),"help-circle":vt(YF,AR),"alert-triangle":vt(EL,PO),clock:vt(wO,OR),sparkles:vt(tO,ER),target:vt(gO,$R),pause:vt(HF,_R),play:vt(VF,CR),stop:vt(uO,IR),star:vt(sO,TR),"star-outline":vt(lO,NR),"dots-horizontal":vt(lL,LO)};function DR(e){return CA[e]}function PR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function vc(e,t="md"){const n=CA[e];return n?PR(n.svg,SA[t]):""}const n_e=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],Ve=Ze({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=R(()=>DR(t.name)),o=R(()=>SA[t.size]);return(s,i)=>n.value?(w(),xe(jo(n.value.component),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):ce("",!0)}}),HR={key:0,class:"ui-dialog__head"},WR={class:"ui-dialog__titles"},zR={key:0,class:"ui-dialog__title"},UR={key:1,class:"ui-dialog__desc"},qR={class:"ui-dialog__body"},jR={key:1,class:"ui-dialog__foot"},VR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',KR=Ze({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=X(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(VR)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?s.value?.querySelector(d)??null:s.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),s.value?.focus();return}const g=document.activeElement;d.shiftKey&&g===h?(d.preventDefault(),p.focus()):!d.shiftKey&&g===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Qe(()=>n.open,async d=>{if(d){gc.value+=1,i=document.activeElement,await mt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else gc.value=Math.max(0,gc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),mo(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(gc.value=Math.max(0,gc.value-1))}),(d,f)=>(w(),xe(hm,{to:"body"},[e.open?(w(),T("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[_("div",{ref_key:"panel",ref:s,class:We(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(w(),T("div",HR,[Fn(d.$slots,"head",{},()=>[_("div",WR,[e.title?(w(),T("div",zR,O(e.title),1)):ce("",!0),e.description?(w(),T("div",UR,O(e.description),1)):ce("",!0)])],!0),re(Dn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[re(Ve,{name:"close",size:"md"})]),_:1})])):ce("",!0),_("div",qR,[Fn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(w(),T("div",jR,[Fn(d.$slots,"foot",{},void 0,!0)])):ce("",!0)],2)],32)):ce("",!0)]))}}),qr=ct(KR,[["__scopeId","data-v-3dce23a4"]]),GR={class:"sd-head"},YR=["placeholder","aria-label"],ZR=["aria-selected","onClick","onMousemove"],QR={class:"sd-meta"},XR=["innerHTML"],JR={class:"sd-time"},eB=["innerHTML"],tB=["innerHTML"],nB={key:1,class:"sd-empty"},oB={class:"sd-hint"},sB=200,iB=Ze({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=X(""),l=X(null),a=X(null),c=R(()=>{const v=r.value.trim().toLowerCase(),m=[];for(const y of o.sessions){const k=y.title??"",A=y.lastPrompt??"",$=y.workspaceName??"",I=v.length>0&&k.toLowerCase().includes(v),x=v.length>0&&A.toLowerCase().includes(v),L=v.length>0&&$.toLowerCase().includes(v);if(!(v.length>0&&!I&&!x&&!L)&&(m.push({session:y,inTitle:I,inWorkspace:L,snippetText:A?jI(A,r.value):""}),m.length>=sB))break}return m}),u=X(0);Qe(r,()=>{u.value=0});function d(v){const m=c.value.length;return m===0?0:Math.max(0,Math.min(m-1,v))}async function f(){await mt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(v){u.value=d(u.value+v),f()}function p(v){s("select",v),s("close")}function g(){const v=c.value[u.value];v&&p(v.session.id)}function b(v){v.key==="ArrowDown"?(v.preventDefault(),h(1)):v.key==="ArrowUp"?(v.preventDefault(),h(-1)):v.key==="Enter"&&(v.preventDefault(),g())}return cn(()=>{l.value?.focus()}),(v,m)=>(w(),xe(qr,{open:i.value,"onUpdate:open":m[1]||(m[1]=y=>i.value=y),size:"lg",height:"fixed",padded:!1,onClose:m[2]||(m[2]=y=>s("close"))},{head:Ee(()=>[_("div",GR,[re(Ve,{class:"sd-search-icon",name:"search",size:"md"}),$n(_("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>r.value=y),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,YR),[[_s,r.value]])])]),foot:Ee(()=>[_("span",oB,O(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[_("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),T(Pe,{key:0},ot(c.value,(y,k)=>(w(),T("button",{key:y.session.id,class:We(["sd-row",{on:k===u.value,active:y.session.id===e.activeId}]),role:"option","aria-selected":k===u.value,onClick:A=>p(y.session.id),onMousemove:A=>u.value=k},[_("span",QR,[re(Ve,{class:"sd-folder",name:"folder-closed",size:"sm"}),_("span",{class:"sd-ws",innerHTML:C(h0)(y.session.workspaceName??y.session.workspaceId??"",y.inWorkspace?r.value:"")},null,8,XR),_("span",JR,O(y.session.time),1)]),_("span",{class:"sd-title",innerHTML:C(h0)(y.session.title,y.inTitle?r.value:"")},null,8,eB),y.snippetText?(w(),T("span",{key:0,class:"sd-snippet",innerHTML:C(h0)(y.snippetText,r.value)},null,8,tB)):ce("",!0)],42,ZR))),128)):(w(),T("div",nB,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),rB=ct(iB,[["__scopeId","data-v-a678f802"]]),lB=["aria-label"],aB=Ze({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),T("span",{class:We(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,lB))}}),Ds=ct(aB,[["__scopeId","data-v-e5c5b17d"]]),cB={key:0,class:"ui-badge__dot","aria-hidden":"true"},uB=Ze({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),T("span",{class:We(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),T("span",cB)):ce("",!0),Fn(t.$slots,"default",{},void 0,!0)],2))}}),Ri=ct(uB,[["__scopeId","data-v-5bc5cd6d"]]),dB=Ze({__name:"Menu",setup(e,{expose:t}){const n=X();return t({el:n}),(o,s)=>(w(),T("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Fn(o.$slots,"default",{},void 0,!0)],512))}}),kl=ct(dB,[["__scopeId","data-v-60e6cd8d"]]),fB={key:0,class:"ui-menu-sep",role:"separator"},hB=["disabled"],pB=Ze({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(w(),T("div",fB)):(w(),T("button",{key:1,class:We(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[Fn(t.$slots,"default",{},void 0,!0)],10,hB))}}),pn=ct(pB,[["__scopeId","data-v-f940771a"]]),nl=6,ol=8,mB=150,gB=Ze({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=X(),o=X(),s=X(!1),i=X(!1),r=X({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const g=o.value;if(!a||!g)return;const b=a.getBoundingClientRect(),v=g.offsetWidth,m=g.offsetHeight,y=window.innerWidth,k=window.innerHeight;let A=t.placement;A==="top"&&b.top-nl-m<ol?A="bottom":A==="bottom"&&b.bottom+nl+m>k-ol?A="top":A==="left"&&b.left-nl-v<ol?A="right":A==="right"&&b.right+nl+v>y-ol&&(A="left");let $=0,I=0;A==="top"?($=b.top-nl-m,I=b.left+b.width/2-v/2):A==="bottom"?($=b.bottom+nl,I=b.left+b.width/2-v/2):A==="left"?($=b.top+b.height/2-m/2,I=b.left-nl-v):($=b.top+b.height/2-m/2,I=b.right+nl),I=Math.min(Math.max(I,ol),y-ol-v),$=Math.min(Math.max($,ol),k-ol-m),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round($)}px`,left:`${Math.round(I)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,mt(()=>{u(),i.value=!0})},mB))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(g){g!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=g,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return cn(()=>{const g=n.value??null;p(g?.firstElementChild??g),g&&(c=new MutationObserver(()=>{const b=g.firstElementChild??null;b!==a&&(f(),p(b??g))}),c.observe(g,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),mo(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(g,b)=>(w(),T(Pe,null,[_("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Fn(g.$slots,"default",{},void 0,!0)],512),(w(),xe(hm,{to:"body"},[$n(_("div",{ref_key:"bubble",ref:o,class:We(["ui-tip__bubble",{positioned:i.value}]),style:Yt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[mi,s.value]])]))],64))}}),Xt=ct(gB,[["__scopeId","data-v-4c261eb6"]]),vB={class:"row"},yB={class:"lead","aria-hidden":"true"},kB={key:1,class:"unread-dot"},bB={class:"left"},xB=["onKeydown"],wB={class:"act"},_B={class:"ts"},SB={class:"menu-time"},CB=Ze({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),s=e,i=n;function r(S){const N=new Date(S);if(Number.isNaN(N.getTime()))return S;const D=B=>String(B).padStart(2,"0");return`${N.getFullYear()}-${D(N.getMonth()+1)}-${D(N.getDate())} ${D(N.getHours())}:${D(N.getMinutes())}`}const l=R(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=X(!1),c=X(null),u=X(null),d=X({});function f(S){const N=S.target;u.value?.el?.contains(N)||c.value?.el?.contains(N)||g()}function h(){const S=c.value?.el;if(!S)return;const N=u.value?.el,D=S.getBoundingClientRect(),B=4,U=8,H=N?.offsetHeight??0,P=N?.offsetWidth??0;let Z=D.bottom+B;Z+H>window.innerHeight-U&&(Z=Math.max(U,D.top-H-B));let K=D.right-P;K<U&&(K=U),d.value={top:`${Math.round(Z)}px`,left:`${Math.round(K)}px`}}async function p(S){if(S.stopPropagation(),a.value){g();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",g),await mt(),h()}function g(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)}bn(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)});const b=X(!1),v=X(""),m=X(null);async function y(){g(),b.value=!0,v.value=s.session.title,await mt();try{m.value?.focus(),m.value?.select()}catch{}}function k(){const S=v.value.trim();S&&i("rename",s.session.id,S),b.value=!1}function A(){b.value=!1}const $=X(!1),I=X(!1);async function x(){const S=await Go(s.session.id);$.value=S,I.value=!S,setTimeout(()=>{$.value=!1,I.value=!1,g()},1500)}function L(){g(),i("fork",s.session.id)}function E(){g(),i("export",s.session.id)}function F(){g(),i("archive",s.session.id)}return t({closeMenu:g}),(S,N)=>(w(),T("div",{class:We(["se",{on:e.active}]),onClick:N[4]||(N[4]=D=>i("select",e.session.id))},[_("div",vB,[_("span",yB,[e.session.busy?(w(),xe(Ds,{key:0,size:"sm"})):e.unread?(w(),T("span",kB)):ce("",!0)]),_("div",bB,[b.value?$n((w(),T("input",{key:0,ref_key:"renameInputRef",ref:m,"onUpdate:modelValue":N[0]||(N[0]=D=>v.value=D),class:"rename-input",onClick:N[1]||(N[1]=bt(()=>{},["stop"])),onKeydown:[nr(bt(k,["stop"]),["enter"]),nr(bt(A,["stop"]),["esc"])],onBlur:k},null,40,xB)),[[_s,v.value]]):(w(),T("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},O(e.session.title),33))]),re(Xt,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!b.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(w(),xe(Ri,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.awaitingAnswer")),1)]),_:1})):ce("",!0)]),_:1},8,["text"]),re(Xt,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!b.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(w(),xe(Ri,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.awaitingPermission")),1)]),_:1})):ce("",!0)]),_:1},8,["text"]),re(Xt,{text:C(o)("workspace.abortedTitle")},{default:Ee(()=>[!b.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(w(),xe(Ri,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.aborted")),1)]),_:1})):ce("",!0)]),_:1},8,["text"]),_("span",wB,[_("span",_B,O(e.session.time),1),b.value?ce("",!0):(w(),xe(Dn,{key:0,ref_key:"kebabRef",ref:c,class:We(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:N[2]||(N[2]=bt(D=>p(D),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(w(),xe(hm,{to:"body"},[a.value?(w(),xe(kl,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:Yt(d.value),onClick:N[3]||(N[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{danger:I.value,onClick:x},{default:Ee(()=>[re(Ve,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(I.value?C(o)("sidebar.copyFailed"):$.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),re(pn,{separator:""}),re(pn,{onClick:y},{default:Ee(()=>[re(Ve,{name:"pencil",size:"sm"}),Je(" "+O(C(o)("sidebar.rename")),1)]),_:1}),re(pn,{onClick:L},{default:Ee(()=>[re(Ve,{name:"git-fork",size:"sm"}),Je(" "+O(C(o)("sidebar.fork")),1)]),_:1}),re(pn,{onClick:E},{default:Ee(()=>[re(Ve,{name:"download",size:"sm"}),Je(" "+O(C(o)("sidebar.export")),1)]),_:1}),re(pn,{danger:"",onClick:F},{default:Ee(()=>[re(Ve,{name:"archive",size:"sm"}),Je(" "+O(C(o)("sidebar.archive")),1)]),_:1}),re(pn,{separator:""}),_("div",SB,O(l.value),1)]),_:1},8,["style"])):ce("",!0)]))],2))}}),AB=ct(CB,[["__scopeId","data-v-c1a3c877"]]),MB={class:"gh-top"},EB={class:"gh-name"},TB=["inert"],NB=["disabled"],IB={class:"show-more-label"},LB={class:"show-more-label"},$B={key:2,class:"group-empty"},FB=Ze({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=R({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=R(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=R(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(w(),T("div",{class:We(["group",{dragging:e.dragging}])},[_("div",{class:We(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=bt(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[_("div",MB,[e.isCollapsed(e.group.workspace.id)?(w(),xe(Ve,{key:0,class:"gh-folder",name:"folder-closed"})):(w(),xe(Ve,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(w(),xe(Xt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[_("span",EB,O(e.group.workspace.name),1)]),_:1},8,["text"])):$n((w(),T("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=nr(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=nr(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=bt(()=>{},["stop"]))},null,544)),[[_s,i.value]]),e.renamingId!==e.group.workspace.id?(w(),T("div",{key:4,class:We(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[re(Dn,{class:We(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=bt(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),re(Dn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=bt(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[re(Ve,{name:"chat-new"})]),_:1},8,["label"])],2)):ce("",!0)])],34),_("div",{class:We(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),T(Pe,null,ot(r.value,p=>(w(),xe(AB,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=g=>s("selectSession",g)),onRename:h[11]||(h[11]=(g,b)=>s("renameSession",g,b)),onArchive:h[12]||(h[12]=g=>s("archiveSession",g)),onFork:h[13]||(h[13]=g=>s("forkSession",g)),onExport:h[14]||(h[14]=g=>s("exportSession",g))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),T("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=bt(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",IB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,NB)):ce("",!0),l.value?(w(),T("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=bt(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",LB,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):ce("",!0),e.group.sessions.length===0?(w(),T("div",$B,O(C(n)("sidebar.noSessions")),1)):ce("",!0)],10,TB)],2))}}),OB=ct(FB,[["__scopeId","data-v-cdac739a"]]),RB="kimi_desktop",BB="platform",hw="kimi-desktop",pw="kimi-desktop-platform";function DB(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(RB)?(sessionStorage.setItem(hw,"1"),e=!0):e=e||sessionStorage.getItem(hw)==="1";const o=n.get(BB);o?(sessionStorage.setItem(pw,o),t=o):t=sessionStorage.getItem(pw)}catch{}return{isDesktop:e,platform:t}}const ov=DB(),PB=ov.isDesktop,Bc=ov.isDesktop&&ov.platform==="darwin",HB={class:"ui-kbd"},WB=Ze({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(w(),T("span",HB,[(w(!0),T(Pe,null,ot(e.keys,o=>(w(),T("kbd",{key:o,class:"ui-kbd__key"},O(o),1))),128))]))}}),kr=ct(WB,[["__scopeId","data-v-32292ed8"]]),zB=["disabled","aria-pressed"],UB=Ze({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(w(),T("button",{key:0,class:We(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[Fn(t.$slots,"default",{},void 0,!0)],10,zB)):(w(),T("span",{key:1,class:We(["ui-pill",{"is-active":e.active}])},[Fn(t.$slots,"default",{},void 0,!0)],2))}}),bh=ct(UB,[["__scopeId","data-v-317ace1a"]]),qB={class:"ch"},jB={class:"ch-brand"},VB={class:"ch-backend-ep"},KB={class:"btn-wrap"},GB={class:"search-input"},YB={key:0,class:"empty"},ZB={class:"side-section-label"},QB={class:"side-section-title"},XB={class:"side-section-actions"},JB=["onDragover","onDrop"],eD={class:"side-footer"},tD={class:"section-menu-check"},nD={class:"section-menu-check"},oD={class:"section-menu-check"},sD={class:"backend-menu-name"},iD={class:"backend-menu-url"},rD=1e3,lD=Ze({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Tt(),o=!1,s=X(null),i=R(()=>""),r=["default","multi"];function l(ze){const Xe=s.value?.presets[ze]??"";return Xe?BI(Xe):""}function a(ze){const Xe=s.value;return Xe!==null&&Xe.current===Xe.presets[ze]}const c=e,u=t,d=X(!1),f=g()?["⌘","K"]:["Ctrl","K"];function h(){u("loadAllSessions"),d.value=!0}function p(ze){(ze.metaKey||ze.ctrlKey)&&ze.key.toLowerCase()==="k"&&(ze.preventDefault(),h())}cn(()=>window.addEventListener("keydown",p)),mo(()=>window.removeEventListener("keydown",p));function g(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const ze=navigator.userAgentData;return ze?.platform==="macOS"||ze?.platform==="iOS"}const b=X(!1);function v(ze){b.value=ze.target.scrollTop>0}const m=X(new Set(_I()));function y(ze){return m.value.has(ze)}function k(ze){const Xe=new Set(m.value);Xe.has(ze)?Xe.delete(ze):Xe.add(ze),m.value=Xe,f0(Xe)}function A(){const ze=new Set(c.groups.map(Xe=>Xe.workspace.id));m.value=ze,f0(ze)}function $(){const ze=new Set;m.value=ze,f0(ze)}const I=R(()=>c.groups.length>0&&c.groups.every(ze=>m.value.has(ze.workspace.id))),x=X(new Set);function L(ze){return x.value.has(ze)}function E(ze){const Xe=new Set(x.value);Xe.has(ze)?Xe.delete(ze):Xe.add(ze),x.value=Xe}function F(ze){if(!x.value.has(ze)){const Xe=new Set(x.value);Xe.add(ze),x.value=Xe}u("loadMoreSessions",ze)}const S=X(null),N=X(null);function D(ze){S.value=ze}function B(){S.value=null,N.value=null}function U(ze){const Xe=ze.currentTarget.getBoundingClientRect();return ze.clientY<Xe.top+Xe.height/2?"before":"after"}function H(ze,Xe){S.value===null||S.value===Xe||(ze.preventDefault(),ze.dataTransfer&&(ze.dataTransfer.dropEffect="move"),N.value={id:Xe,position:U(ze)})}function P(ze){const Xe=S.value,kt=N.value?.id===ze?N.value.position:"before";if(N.value=null,S.value=null,!Xe||Xe===ze)return;const Pt=WI(c.groups.map(On=>On.workspace.id),Xe,ze,kt);u("reorderWorkspaces",Pt)}function Z(ze,Xe){Xe.target.closest(".gh-more, .gh-add")||k(ze)}function K(ze){u("select",ze)}const V=X(null),J=X(""),he=X(null);function ne(){return he}function ue(ze,Xe){V.value=ze,J.value=Xe,mt().then(()=>he.value?.focus())}function de(){const ze=V.value,Xe=J.value.trim();ze&&Xe&&u("renameWorkspace",ze,Xe),V.value=null}function Ce(){V.value=null}function Ie(ze){J.value=ze}const le=X(!1),z=X(null),ae=X({}),ie=X(null);function q(ze){ie.value?.el&&!ie.value.el.contains(ze.target)&&ye()}function ee(ze,Xe){Xe.preventDefault(),Xe.stopPropagation(),z.value=ze,ae.value={top:`${Xe.clientY}px`,left:`${Xe.clientX}px`},le.value=!0,document.addEventListener("mousedown",q,!0)}function ye(){le.value=!1,document.removeEventListener("mousedown",q,!0),z.value=null}function fe(){z.value&&Go(z.value.root),ye()}function ve(){z.value&&ue(z.value.id,z.value.name),ye()}function j(){const ze=z.value;ze&&(ye(),u("deleteWorkspace",ze.id))}const te=X(null),me=X(null),Ae=X({}),$e=X(null);function De(ze){const Xe=ze.target;Xe.closest(".gh-more")||Xe.closest(".ws-menu")||Ne()}async function ge(ze,Xe){if(te.value===ze.id){Ne();return}const kt=Xe.currentTarget;me.value=ze,te.value=ze.id,document.addEventListener("mousedown",De),window.addEventListener("resize",Ne),await mt();const Pt=$e.value?.el,On=kt.getBoundingClientRect(),sn=4,Gt=8,Hn=Pt?.offsetHeight??0,Mn=Pt?.offsetWidth??0;let Ct=On.bottom+sn;Ct+Hn>window.innerHeight-Gt&&(Ct=Math.max(Gt,On.top-Hn-sn));let Po=On.right-Mn;Po<Gt&&(Po=Gt),Ae.value={top:`${Math.round(Ct)}px`,left:`${Math.round(Po)}px`}}function Ne(){te.value=null,me.value=null,document.removeEventListener("mousedown",De),window.removeEventListener("resize",Ne)}function et(ze){Go(ze.root),Ne()}function rt(ze){ue(ze.id,ze.name),Ne()}function St(ze){Ne(),u("deleteWorkspace",ze.id)}const gt=X(!1),It=X({}),Ut=X(null);function ht(ze){const Xe=ze.target;Xe.closest(".side-section-kebab")||Xe.closest(".section-menu")||dn()}async function un(ze){if(gt.value){dn();return}const Xe=ze.currentTarget;gt.value=!0,document.addEventListener("mousedown",ht),window.addEventListener("resize",dn),await mt();const kt=Ut.value?.el,Pt=Xe.getBoundingClientRect(),On=4,sn=8,Gt=kt?.offsetHeight??0,Hn=kt?.offsetWidth??0;let Mn=Pt.bottom+On;Mn+Gt>window.innerHeight-sn&&(Mn=Math.max(sn,Pt.top-Gt-On));let Ct=Pt.right-Hn;Ct<sn&&(Ct=sn),It.value={top:`${Math.round(Mn)}px`,left:`${Math.round(Ct)}px`}}function dn(){gt.value=!1,document.removeEventListener("mousedown",ht),window.removeEventListener("resize",dn)}function ns(ze){u("setWorkspaceSortMode",ze),dn()}const Wt=X(!1),Pn=X({}),co=X(null);function it(ze){const Xe=ze.target;Xe.closest(".ch-backend")||Xe.closest(".backend-menu")||uo()}async function Gn(ze){if(s.value===null)return;if(Wt.value){uo();return}const Xe=ze.currentTarget;Wt.value=!0,document.addEventListener("mousedown",it),window.addEventListener("resize",uo),await mt();const kt=co.value?.el,Pt=Xe.getBoundingClientRect(),On=4,sn=8,Gt=kt?.offsetHeight??0;let Hn=Pt.bottom+On;Hn+Gt>window.innerHeight-sn&&(Hn=Math.max(sn,Pt.top-Gt-On)),Pn.value={top:`${Math.round(Hn)}px`,left:`${Math.round(Math.max(sn,Pt.left))}px`}}function uo(){Wt.value=!1,document.removeEventListener("mousedown",it),window.removeEventListener("resize",uo)}async function Yn(ze){if(a(ze)){uo();return}if(await RI(ze)===null){console.warn("[kimi-web] dev backend switch failed:",ze),uo();return}window.location.reload()}mo(()=>{document.removeEventListener("mousedown",q,!0),document.removeEventListener("mousedown",De),document.removeEventListener("mousedown",ht),document.removeEventListener("mousedown",it),window.removeEventListener("resize",Ne),window.removeEventListener("resize",dn),window.removeEventListener("resize",uo)});const go=X(null);let os;function Un(){const ze=go.value;ze&&(ze.classList.remove("blink-now"),ze.getBoundingClientRect(),ze.classList.add("blink-now"),clearTimeout(os),os=setTimeout(()=>ze.classList.remove("blink-now"),300))}const to=Li(()=>ms(()=>import("./DesignSystemView-BbwRX2u4.js"),__vite__mapDeps([0,1]))),vn=X(!1);let Zn,xn=!1;function Cn(ze){xn=!1,clearTimeout(Zn),ze.currentTarget.setPointerCapture?.(ze.pointerId),Zn=setTimeout(()=>{xn=!0,vn.value=!0},rD)}function An(ze){clearTimeout(Zn);const Xe=ze.currentTarget;Xe.hasPointerCapture?.(ze.pointerId)&&Xe.releasePointerCapture(ze.pointerId)}function Do(){if(xn){xn=!1;return}Un()}return mo(()=>{clearTimeout(Zn)}),(ze,Xe)=>(w(),T("aside",{class:We(["side",{"macos-desktop":C(Bc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Yt({width:e.collapsed?"0px":e.colWidth+"px"})},[_("div",{class:"col",style:Yt({width:e.colWidth+"px"})},[_("div",qB,[_("div",jB,[C(Bc)?ce("",!0):(w(),T(Pe,{key:0},[(w(),T("svg",{ref_key:"logoRef",ref:go,class:We(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Do,onPointerdown:Cn,onPointerup:An,onPointercancel:An},[...Xe[22]||(Xe[22]=[Ey('<defs data-v-1b04ce05><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-1b04ce05><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1b04ce05></rect><g class="ch-eyes" fill="#000" data-v-1b04ce05><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-1b04ce05></rect>',2)])],34)),Xe[23]||(Xe[23]=_("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(w(),xe(bh,{key:0,class:"ch-backend",clickable:s.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:i.value}),onClick:Gn},{default:Ee(()=>[_("span",{class:We(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),_("span",VB," · "+O(i.value),1),s.value!==null?(w(),xe(Ve,{key:0,name:"chevron-down",size:"sm"})):ce("",!0)]),_:1},8,["clickable","title"])):ce("",!0)],64))]),C(Bc)?ce("",!0):(w(),xe(Dn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Xe[0]||(Xe[0]=bt(kt=>u("collapse"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"panel-collapse"})]),_:1},8,["label"]))]),_("div",KB,[_("button",{class:"btn-new-chat",type:"button",onClick:Xe[1]||(Xe[1]=bt(kt=>u("create"),["stop"]))},[re(Ve,{name:"chat-new"}),_("span",null,O(C(n)("sidebar.newChat")),1)]),ce("",!0)]),_("div",{class:We(["search-wrap",{"search-wrap--scrolled":b.value}])},[_("button",{class:"search",type:"button",onClick:h},[re(Ve,{class:"search-icon",name:"search"}),_("span",GB,O(C(n)("sidebar.search")),1),re(kr,{keys:C(f)},null,8,["keys"])])],2),_("div",{class:"sessions",onScroll:v},[e.groups.length===0?(w(),T("div",YB,O(C(n)("workspace.noWorkspace")),1)):(w(),T(Pe,{key:1},[_("div",ZB,[_("span",QB,O(C(n)("sidebar.workspaces")),1),_("div",XB,[re(Dn,{class:"side-section-toggle",size:"sm",label:I.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Xe[3]||(Xe[3]=bt(kt=>I.value?$():A(),["stop"]))},{default:Ee(()=>[I.value?(w(),xe(Ve,{key:0,name:"expand"})):(w(),xe(Ve,{key:1,name:"collapse"}))]),_:1},8,["label"]),re(Dn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":gt.value,onClick:Xe[4]||(Xe[4]=bt(kt=>un(kt),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),T(Pe,null,ot(e.groups,kt=>(w(),T("div",{key:kt.workspace.id,class:We(["ws-drop-target",{"drop-before":N.value?.id===kt.workspace.id&&N.value.position==="before","drop-after":N.value?.id===kt.workspace.id&&N.value.position==="after"}]),onDragover:Pt=>H(Pt,kt.workspace.id),onDrop:Pt=>P(kt.workspace.id)},[re(OB,{group:kt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":V.value,"rename-value":J.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":te.value,dragging:S.value===kt.workspace.id,"is-collapsed":y,"is-expanded":L,onGroupClick:Z,onGroupContextmenu:ee,onToggleWsMenu:ge,onCreateInWorkspace:Xe[5]||(Xe[5]=Pt=>u("createInWorkspace",Pt)),onSelectSession:K,onRenameSession:Xe[6]||(Xe[6]=(Pt,On)=>u("rename",Pt,On)),onArchiveSession:Xe[7]||(Xe[7]=Pt=>u("archive",Pt)),onForkSession:Xe[8]||(Xe[8]=Pt=>u("fork",Pt)),onExportSession:Xe[9]||(Xe[9]=Pt=>u("export",Pt)),onLoadMore:F,onToggleExpand:E,onConfirmRename:de,onCancelRename:Ce,onUpdateRenameValue:Ie,onWsDragstart:D,onWsDragend:B},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,JB))),128))],64))],32),_("div",eD,[_("button",{class:"btn-settings",type:"button",onClick:Xe[10]||(Xe[10]=bt(kt=>u("openSettings"),["stop"]))},[re(Ve,{name:"settings"}),_("span",null,O(C(n)("settings.title")),1)])])],4),le.value?(w(),xe(kl,{key:0,ref_key:"ghMenuRef",ref:ie,class:"gh-menu",style:Yt(ae.value),onClick:Xe[11]||(Xe[11]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:fe},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(pn,{onClick:ve},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1}),re(pn,{danger:"",onClick:j},{default:Ee(()=>[Je(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ce("",!0),te.value!==null&&me.value?(w(),xe(kl,{key:1,ref_key:"wsMenuRef",ref:$e,class:"ws-menu",style:Yt(Ae.value),onClick:Xe[15]||(Xe[15]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:Xe[12]||(Xe[12]=kt=>et(me.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(pn,{separator:""}),re(pn,{onClick:Xe[13]||(Xe[13]=kt=>rt(me.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1}),re(pn,{separator:""}),re(pn,{danger:"",onClick:Xe[14]||(Xe[14]=kt=>St(me.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ce("",!0),gt.value?(w(),xe(kl,{key:2,ref_key:"sectionMenuRef",ref:Ut,class:"section-menu",style:Yt(It.value),onClick:Xe[18]||(Xe[18]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:Xe[16]||(Xe[16]=kt=>ns("manual"))},{default:Ee(()=>[_("span",tD,[e.workspaceSortMode==="manual"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),Je(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),re(pn,{onClick:Xe[17]||(Xe[17]=kt=>ns("recent"))},{default:Ee(()=>[_("span",nD,[e.workspaceSortMode==="recent"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),Je(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):ce("",!0),Wt.value?(w(),xe(kl,{key:3,ref_key:"backendMenuRef",ref:co,class:"backend-menu",style:Yt(Pn.value),onClick:Xe[19]||(Xe[19]=bt(()=>{},["stop"]))},{default:Ee(()=>[(w(),T(Pe,null,ot(r,kt=>re(pn,{key:kt,onClick:Pt=>Yn(kt)},{default:Ee(()=>[_("span",oD,[a(kt)?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",sD,O(kt),1),_("span",iD,O(l(kt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):ce("",!0),d.value?(w(),xe(rB,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:K,onClose:Xe[20]||(Xe[20]=kt=>d.value=!1)},null,8,["sessions","active-id"])):ce("",!0),(w(),xe(hm,{to:"body"},[vn.value?(w(),xe(C(to),{key:0,onClose:Xe[21]||(Xe[21]=kt=>vn.value=!1)})):ce("",!0)]))],6))}}),aD=ct(lD,[["__scopeId","data-v-1b04ce05"]]);function cD(e){try{const t=ao(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function uD(e,t){try{So(e,String(t))}catch{}}function dD(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(v){return Number.isFinite(v)?Math.min(D4(s),Math.max(o,Math.round(v))):n}const l=X(r(cD(t)??n)),a=X(!1);function c(v){const m=r(v);l.value=m,uD(t,m)}let u=0,d=0,f=null,h=-1;function p(v){if(!a.value)return;const m=v.clientX-u;c(d+(i?-m:m))}function g(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",g),f.removeEventListener("pointercancel",g)}f=null,h=-1}}function b(v){v.preventDefault(),a.value=!0,u=v.clientX,d=r(l.value),f=v.currentTarget,h=v.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",g),f.addEventListener("pointercancel",g)}return mo(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const fD=["aria-label"],hD=Ze({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),{width:i,dragging:r,onPointerDown:l}=dD({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Qe(i,a=>o("update:width",a)),Qe(r,a=>o("update:dragging",a)),(a,c)=>(w(),T("div",{class:We(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[_("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,fD))}}),mw=ct(hD,[["__scopeId","data-v-48fd0a6d"]]),pD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},mD={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},gD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},vD={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},yD={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"}},kD={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},bD={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},xD={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the kimi-code process and try again."},wD={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"},_D={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size} ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},SD={justNow:"just now"},CD={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"},AD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},MD={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"},ED={panelTitle:"Thinking",close:"Close"},TD={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"},ND={},ID={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"}},LD={searching:"Searching…",noMatch:"No matches"},$D={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},FD={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},OD={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)"}},RD={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},BD={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"},DD={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},PD={preview:"预览",confirm:"确认",cancel:"取消"},HD={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},WD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},zD={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},UD={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:"收起"}},qD={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},jD={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},VD={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 kimi-code 进程后重试"},KD={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 关闭"},GD={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},YD={justNow:"刚刚"},ZD={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:"拒绝并退出"},QD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},XD={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:"展开"},JD={panelTitle:"思考过程",close:"关闭"},eP={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},tP={},nP={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:"无法读取这个文件"}},oP={searching:"搜索中…",noMatch:"无匹配"},sP={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},iP={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},rP={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} 个)"}},lP={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},aP={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},cP={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},uP={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"},dP={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",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},hP={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},pP={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},mP={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},gP={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"},vP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},yP={en:{common:pD,app:mD,sidebar:gD,workspace:vD,conversation:yD,status:kD,composer:bD,login:xD,providers:wD,model:_D,sessions:SD,approval:CD,question:AD,tasks:MD,thinking:ED,diff:TD,fileTree:ND,filePreview:ID,mention:LD,warnings:$D,commands:FD,tools:OD,layout:RD,mobile:BD,theme:DD,onboarding:uP,settings:fP,header:pP,sideChat:gP},zh:{common:PD,app:HD,sidebar:WD,workspace:zD,conversation:UD,status:qD,composer:jD,login:VD,providers:KD,model:GD,sessions:YD,approval:ZD,question:QD,tasks:XD,thinking:JD,diff:eP,fileTree:tP,filePreview:nP,mention:oP,warnings:sP,commands:iP,tools:rP,layout:lP,mobile:aP,theme:cP,onboarding:dP,settings:hP,header:mP,sideChat:vP}},AA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function kP(){const e=ao(Ft.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const wn=dI({legacy:!1,locale:kP(),fallbackLocale:"en",messages:yP});function MA(e){wn.global.locale.value=e,So(Ft.locale,e)}const Xo=wn.global.t,bP={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"},xP={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 Ba(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return xP[t]??t}function Da(e){const t=bP[Ba(e)];return t?Xo(t):e}const wP={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 bm(e){const t=Ba(e);let n=wP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),vc(n,"sm")}const EA=80;function _P(e,t=EA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function SP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function CP(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 Zt(e){return typeof e=="string"&&e.length>0?e:void 0}function fl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function AP(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 p0(e){return Zt(e.path)??Zt(e.file_path)??Zt(e.filePath)??Zt(e.filename)}const MP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function EP(e){const t=Zt(e);if(!t)return;const n=MP[t];return n?Xo(n):t}function TP(e){const t=fl(e.value),n=Zt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return Xo("tools.goal.turns",{value:t});case"tokens":return Xo("tools.goal.tokens",{value:t});case"milliseconds":return Xo("tools.goal.milliseconds",{value:t});case"seconds":return Xo("tools.goal.seconds",{value:t});case"minutes":return Xo("tools.goal.minutes",{value:t});case"hours":return Xo("tools.goal.hours",{value:t});default:return Xo("tools.goal.budget",{value:t,unit:n})}}const NP=64;function Nd(e,t,n=!1){const o=(s,i=EA)=>n?s.trim():_P(s,i);try{const s=CP(t);if(!n&&SP(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Ba(e)){case"read":{const r=p0(s);if(!r)return i();const l=fl(s.offset)??fl(s.line_start)??fl(s.start_line),a=fl(s.limit)??fl(s.length),c=fl(s.line_end)??fl(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=p0(s);return r?o(`${r} ${Xo("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=p0(s);return r?o(r):i()}case"bash":{const r=Zt(s.command)??Zt(s.cmd)??Zt(s.script);return r?o(r,NP):i()}case"grep":case"search":{const r=Zt(s.pattern)??Zt(s.query)??Zt(s.regex),l=Zt(s.path)??Zt(s.glob)??Zt(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=Zt(s.pattern)??Zt(s.glob)??Zt(s.query),l=Zt(s.path)??Zt(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):Zt(s.path)?o(Zt(s.path)):i()}case"ls":{const r=Zt(s.path)??Zt(s.dir)??Zt(s.directory)??Zt(s.cwd);return r?o(r):i()}case"web_fetch":{const r=Zt(s.url)??Zt(s.uri);return r?o(AP(r)):i()}case"todo":case"task":{const r=Zt(s.description)??Zt(s.title)??Zt(s.prompt)??Zt(s.name)??Zt(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(Xo("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Zt(s.objective),l=Zt(s.completionCriterion);return r&&l?o(Xo("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=TP(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=EP(s.status);return r?o(Xo("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function IP(e){try{switch(Ba(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Xo("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return Xo("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Xo("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const LP=Ze({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=R(()=>n(t.status));return(s,i)=>(w(),T("span",{class:We(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Id=ct(LP,[["__scopeId","data-v-e36198e5"]]),$P=["innerHTML"],FP={class:"bh-text"},OP={class:"a"},RP={key:0,class:"p"},BP={class:"rt"},DP=["aria-label"],PP={key:0,class:"tm"},HP=["inert"],WP={class:"bb-pad"},zP=Ze({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,o=Kt("pinScroll",()=>{}),s=X(null);function i(){n("toggle");const r=s.value;r&&mt(()=>o(r))}return(r,l)=>(w(),T("div",{class:We(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[_("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(w(),T("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,$P)):ce("",!0),_("span",FP,[_("span",OP,O(e.name),1),re(Xt,{text:e.arg},{default:Ee(()=>[e.arg?(w(),T("span",RP,O(e.arg),1)):ce("",!0)]),_:1},8,["text"])]),_("span",BP,[_("span",{class:We(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),xe(Ve,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),xe(Id,{key:2,status:"suspended"})):(w(),xe(Id,{key:3,status:"running"}))],10,DP),Fn(r.$slots,"trailing"),e.time?(w(),T("span",PP,O(e.time),1)):ce("",!0)]),e.expandable?(w(),xe(Ve,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ce("",!0)],512),_("div",{class:We(["bb",{open:e.open}]),inert:!e.open},[_("div",WP,[Fn(r.$slots,"default")])],10,HP)],2))}}),xm=ct(zP,[["__scopeId","data-v-fef8aad2"]]),UP={key:0,class:"at-type"},qP={key:1,class:"at-task"},jP={key:2,class:"bb-code"},VP=Ze({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(v){if(!v)return{};try{const m=JSON.parse(v);return{description:typeof m.description=="string"?m.description:void 0,subagentType:typeof m.subagent_type=="string"?m.subagent_type:void 0,prompt:typeof m.prompt=="string"?m.prompt:void 0}}catch{return{}}}const r=R(()=>i(o.tool.arg)),l=R(()=>!!o.tool.output&&o.tool.output.length>0),a=R(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=X(o.tool.defaultExpanded===!0&&a.value),u=R(()=>o.tool.status),d=R(()=>Da(o.tool.name)),f=R(()=>bm(o.tool.name)),h=R(()=>r.value.description||r.value.subagentType||""),p=Kt("resolveAgentTaskId"),g=R(()=>p?p(o.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Qe(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(v,m)=>(w(),xe(xm,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:Ee(()=>[g.value?(w(),T("button",{key:0,type:"button",class:"at-open",onClick:m[0]||(m[0]=bt(y=>s("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):ce("",!0)]),default:Ee(()=>[r.value.subagentType?(w(),T("div",UP,O(r.value.subagentType),1)):ce("",!0),r.value.prompt?(w(),T("div",qP,O(r.value.prompt),1)):ce("",!0),l.value?(w(),T("div",jP,[(w(!0),T(Pe,null,ot(e.tool.output??[],(y,k)=>(w(),T("div",{key:k},O(y),1))),128))])):ce("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),KP=ct(VP,[["__scopeId","data-v-14ef8750"]]);function GP(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const o=[];for(const s of n){if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];o.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return o}catch{return[]}}const qf={recognized:!1,answers:{},note:""};function YP(e){const t=e?.[0];if(!t)return qf;let n;try{n=JSON.parse(t)}catch{return qf}if(!n||typeof n!="object"||Array.isArray(n))return qf;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return qf;const s={};for(const[i,r]of Object.entries(o))typeof r=="string"?s[i]=r:r===!0&&(s[i]=!0);return{recognized:!0,answers:s,note:typeof n.note=="string"?n.note:""}}function ZP(e,t,n){return e[t]??e[`q_${n}`]}const QP=/^opt_\d+_(\d+)$/;function XP(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const o=n.get(e);if(o!==void 0)return{selected:new Set([o]),otherText:"",indeterminate:!1};const s=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){s.add(a);continue}const c=QP.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const JP={key:0,class:"chip"},eH={key:0,class:"au-dismissed"},tH={key:1,class:"au-list"},nH={class:"au-q"},oH={key:0,class:"au-hdr"},sH={class:"au-qtext"},iH={class:"au-opts"},rH={class:"au-glyph"},lH={class:"au-label"},aH={key:0,class:"au-desc"},cH={key:0,class:"au-opt sel"},uH={class:"au-glyph"},dH={class:"au-label"},fH={key:1,class:"au-opt sel"},hH={class:"au-label"},pH={key:2,class:"au-raw"},mH=80,gH=Ze({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Tt();function o(I,x=mH){const L=I.trim();return L.length>x?L.slice(0,x-1)+"…":L}const s=R(()=>GP(t.tool.arg)),i=R(()=>YP(t.tool.output)),r=R(()=>i.value.recognized),l=R(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=R(()=>s.value.map((I,x)=>XP(ZP(i.value.answers,I.question,x),I.options))),c=R(()=>Object.keys(i.value.answers).length);function u(I,x){return a.value[I]?.selected.has(x)??!1}function d(I){return a.value[I]?.otherText??""}function f(I){return a.value[I]?.indeterminate??!1}function h(I,x){return I?x?"■":"□":x?"●":"○"}const p=R(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const I=s.value[0]?.question??"",x=o(I);return s.value.length<=1?x:`${x} ${n("tools.ask.more",{count:s.value.length-1})}`}),g=R(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),b=R(()=>!!t.tool.output&&t.tool.output.length>0),v=R(()=>r.value&&(s.value.length>0||l.value)||b.value),m=X(t.tool.defaultExpanded===!0&&v.value),y=R(()=>t.tool.status),k=R(()=>Da(t.tool.name)),A=R(()=>bm(t.tool.name));function $(){v.value&&(m.value=!m.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(m.value=!0)}),(I,x)=>(w(),xe(xm,{status:y.value,icon:A.value,name:k.value,arg:m.value?"":p.value,time:e.tool.timing,open:m.value,expandable:v.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:$},{trailing:Ee(()=>[g.value?(w(),T("span",JP,O(g.value),1)):ce("",!0)]),default:Ee(()=>[l.value?(w(),T("div",eH,O(i.value.note),1)):r.value?(w(),T("div",tH,[(w(!0),T(Pe,null,ot(s.value,(L,E)=>(w(),T("div",{key:E,class:"au-block"},[_("div",nH,[L.header?(w(),T("span",oH,O(L.header),1)):ce("",!0),_("span",sH,O(L.question),1)]),_("div",iH,[(w(!0),T(Pe,null,ot(L.options,(F,S)=>(w(),T("div",{key:S,class:We(["au-opt",{sel:u(E,S)}])},[_("span",rH,O(h(L.multiSelect,u(E,S))),1),_("span",lH,O(F.label),1),F.description?(w(),T("span",aH,O(F.description),1)):ce("",!0)],2))),128)),d(E)?(w(),T("div",cH,[_("span",uH,O(h(L.multiSelect,!0)),1),_("span",dH,O(d(E)),1)])):ce("",!0),f(E)?(w(),T("div",fH,[x[0]||(x[0]=_("span",{class:"au-glyph"},"●",-1)),_("span",hH,O(C(n)("tools.ask.answered")),1)])):ce("",!0)])]))),128))])):(w(),T("div",pH,[(w(!0),T(Pe,null,ot(e.tool.output??[],(L,E)=>(w(),T("div",{key:E},O(L),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),vH=ct(gH,[["__scopeId","data-v-a9a0f259"]]),yH=1e6,gw=5e3;function vw(e){if(e==="")return[];const t=e.split(`
|
|
68
|
+
`);return t.at(-1)===""&&t.pop(),t}function kH(e,t){const n=vw(e),o=vw(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>gw||i>gw||(s+1)*(i+1)>yH)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function bH(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function TA(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 NA(e){const t=Ba(e.name);if(t!=="edit"&&t!=="write")return null;const n=TA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:kH(o,s)}return null}function xH(e){const t=TA(e);return t&&typeof t.path=="string"?t.path:void 0}function wH(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const _H={key:0,class:"bb-empty"},yw=50,SH=Ze({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=R(()=>t.lines??[]),o=R(()=>n.value.length>yw),s={"--tool-output-visible-lines":String(yw)};return(i,r)=>(w(),T("div",{class:We(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(w(),T("div",_H,O(e.emptyText),1)):ce("",!0),(w(!0),T(Pe,null,ot(n.value,(l,a)=>(w(),T("div",{key:a},O(l),1))),128))],2))}}),IA=ct(SH,[["__scopeId","data-v-262bbea0"]]),CH={key:0,class:"chip"},AH={key:0,class:"bb-summary"},MH=Ze({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.tool.status),i=R(()=>Da(n.tool.name)),r=R(()=>bm(n.tool.name)),l=R(()=>Nd(n.tool.name,n.tool.arg)),a=R(()=>Nd(n.tool.name,n.tool.arg,!0)),c=R(()=>NA(n.tool)),u=R(()=>{const g=c.value;if(g&&n.tool.status!=="error"){const{added:b,removed:v}=bH(g);if(b||v)return`+${b} −${v}`}return""}),d=R(()=>!!n.tool.output&&n.tool.output.length>0),f=X(!1),h=R(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(g,b)=>(w(),xe(xm,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Ee(()=>[u.value?(w(),T("span",CH,O(u.value),1)):ce("",!0)]),default:Ee(()=>[a.value?(w(),T("div",AH,O(a.value),1)):ce("",!0),re(IA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),EH=ct(MH,[["__scopeId","data-v-74e1da99"]]),TH={key:0,class:"chip"},NH={key:0,class:"bb-summary"},IH=Ze({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=R(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=R(()=>!!t.tool.output&&t.tool.output.length>0),s=R(()=>o.value||n.value),i=X(t.tool.defaultExpanded===!0&&s.value),r=R(()=>t.tool.status),l=R(()=>Da(t.tool.name)),a=R(()=>bm(t.tool.name)),c=R(()=>Nd(t.tool.name,t.tool.arg)),u=R(()=>Nd(t.tool.name,t.tool.arg,!0)),d=R(()=>IP({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(w(),xe(xm,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Ee(()=>[d.value?(w(),T("span",TH,O(d.value),1)):ce("",!0)]),default:Ee(()=>[u.value?(w(),T("div",NH,O(u.value),1)):ce("",!0),re(IA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),LH=ct(IH,[["__scopeId","data-v-aa4edcb0"]]),$H={class:"media-title"},FH=["src","alt"],OH=["src"],RH=["src"],BH=Ze({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=R(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(w(),T("div",{key:0,class:We(["media-tool",{mob:e.mobile}])},[re(Xt,{text:s.value.path||l.value},{default:Ee(()=>[_("div",$H,O(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(w(),xe(Xt,{key:0,text:s.value.path||l.value},{default:Ee(()=>[_("button",{type:"button",class:"media-image-button",onClick:a},[_("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,FH)])]),_:1},8,["text"])):s.value.kind==="video"?(w(),T("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,OH)):(w(),T("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,RH))],2)):ce("",!0)}}),DH=ct(BH,[["__scopeId","data-v-bec13b73"]]),PH=/<summary>([\s\S]*?)<\/summary>/,HH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,m0=/<subagent\b([^>]*)>|<\/subagent>/g,WH="</subagent>",kw=/(completed|failed|aborted):\s*(\d+)/g,bw=/([a-z_]+)="([^"]*)"/g;function zH(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function UH(e){const t={};bw.lastIndex=0;let n;for(;(n=bw.exec(e))!==null;)t[n[1]]=zH(n[2]);return t}function qH(e){const t={completed:0,failed:0,aborted:0};kw.lastIndex=0;let n;for(;(n=kw.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function jH(e,t){const n=UH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function VH(e){const t=[],n=[];m0.lastIndex=0;let o;for(;(o=m0.exec(e))!==null;)if(o[0]===WH){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(jH(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:m0.lastIndex}):n.push(null);return t}function KH(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
|
|
69
|
+
`):e;if(!t.includes("<agent_swarm_result>"))return null;const n=PH.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=qH(n),r=HH.exec(t)?.[1]?.trim(),l=VH(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function xw(e){return e?e.split(`
|
|
70
|
+
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function GH(e){return e.suspendedReason||xw(e.text)||xw(e.outputLines?.join(`
|
|
71
|
+
`))||e.summary||""}function YH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
72
|
+
`):e.summary??""}function ZH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function ww(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
73
|
+
`)[0]??"",phase:ZH(e.outcome),body:e.body}}function QH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function XH(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:GH(s),phase:s.phase,body:YH(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>QH(i,s))).map((s,i)=>ww(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>ww(s,i))}const JH=["aria-expanded"],eW={class:"title"},tW={key:0,class:"meta"},nW={key:1,class:"sum-txt"},oW={class:"rt"},sW={class:"status"},iW={key:0,class:"chip"},rW={key:1,class:"tm"},lW={class:"body"},aW={class:"overview"},cW={class:"overview-line"},uW={class:"big"},dW={key:0,class:"lbl"},fW={key:1,class:"lbl"},hW={key:2,class:"lbl"},pW={key:0,class:"seg","aria-hidden":"true"},mW={key:1,class:"legend"},gW=["aria-expanded","onClick"],vW={class:"mname"},yW={class:"mact"},kW={class:"mphase"},bW={key:1,class:"fallback-output"},xW={key:2,class:"waiting"},wW=Ze({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Tt(),n=e;function o(E){if(!E)return{};try{const F=JSON.parse(E),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Kt("resolveSwarmMembers"),i=R(()=>o(n.tool.arg)),r=R(()=>Da(n.tool.name)),l=R(()=>i.value.description??""),a=R(()=>s?.(n.tool.id)??[]),c=R(()=>KH(n.tool.output)),u=R(()=>n.tool.status),d=R(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=R(()=>XH(a.value,c.value)),h=R(()=>{const E={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)E[F.phase]++;return E}),p=R(()=>f.value.length||i.value.itemCount||0),g=R(()=>h.value.completed+h.value.failed),b=R(()=>h.value.working+h.value.suspended+h.value.queued),v=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],m=R(()=>v.map(({phase:E,cls:F})=>({phase:E,count:h.value[E],cls:F})).filter(E=>E.count>0)),y=X(u.value==="running"||b.value>0);function k(){y.value=!y.value}const A=R(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
74
|
+
`).trim()),$=X(new Set);function I(E){const F=new Set($.value);F.has(E)?F.delete(E):F.add(E),$.value=F}function x(E){return $.value.has(E)}function L(E){return t(`tools.swarm.phase${E[0].toUpperCase()}${E.slice(1)}`)}return(E,F)=>(w(),T("div",{class:We(["swarm-card",{open:y.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":y.value,onClick:k},[re(Ve,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",eW,O(r.value),1),l.value?(w(),T("span",tW,"·")):ce("",!0),l.value?(w(),T("span",nW,O(l.value),1)):ce("",!0),_("span",oW,[_("span",sW,[d.value==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):d.value==="error"?(w(),xe(Ve,{key:1,name:"close",size:"sm"})):(w(),xe(Id,{key:2,status:"running"}))]),g.value>0||p.value>0?(w(),T("span",iW,O(g.value)+" / "+O(p.value),1)):ce("",!0),e.tool.timing?(w(),T("span",rW,O(e.tool.timing),1)):ce("",!0)]),re(Ve,{class:"car",name:y.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,JH),$n(_("div",lW,[_("div",aW,[_("div",cW,[_("span",uW,O(C(t)("tools.swarm.progress",{done:g.value,total:p.value})),1),d.value==="running"&&p.value>0?(w(),T("span",dW,O(C(t)("tools.swarm.runningSub",{count:b.value})),1)):c.value?(w(),T("span",fW,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(w(),T("span",hW,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&m.value.length>0?(w(),T("div",pW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase,class:We(S.cls),style:Yt({flex:S.count})},null,6))),128))])):ce("",!0),m.value.length>1?(w(),T("div",mW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase},[_("i",{class:We(["lg-dot",S.cls])},null,2),Je(O(L(S.phase))+" "+O(S.count),1)]))),128))])):ce("",!0)]),f.value.length>0?(w(!0),T(Pe,{key:0},ot(f.value,S=>(w(),T("div",{key:S.id,class:We(["member",[`phase-${S.phase}`,{open:x(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":x(S.id),onClick:N=>I(S.id)},[re(Id,{class:"row-dot",status:S.phase},null,8,["status"]),re(Xt,{text:S.name},{default:Ee(()=>[_("span",vW,O(S.name),1)]),_:2},1032,["text"]),S.activity?(w(),xe(Xt,{key:0,text:S.activity},{default:Ee(()=>[_("span",yW,O(S.activity),1)]),_:2},1032,["text"])):ce("",!0),_("span",kW,O(L(S.phase)),1),re(Ve,{class:"mcar",name:x(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,gW),$n(_("div",{class:"member-body"},O(S.body),513),[[mi,x(S.id)]])],2))),128)):A.value?(w(),T("div",bW,O(A.value),1)):(w(),T("div",xW,O(C(t)("tools.swarm.waiting")),1))],512),[[mi,y.value]])],2))}}),_W=ct(wW,[["__scopeId","data-v-4b58e128"]]);function SW(e){if(e.media&&e.status==="ok")return DH;const t=Ba(e.name);return t==="edit"||t==="write"||t==="multi_edit"?EH:t==="task"?KP:t==="agentswarm"?_W:t==="askuserquestion"?vH:LH}const LA=Ze({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>SW(n.tool));return(i,r)=>(w(),xe(jo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function ir(e){if(e>=1024*1024)return`${_w(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):_w(t)}k`}return String(e)}function _w(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function CW(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function wm(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function AW(e){return!(e.tool.status==="ok"&&e.tool.media)}function MW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function EW(e){const t=wm(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(AW(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function TW(e){return wm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
75
|
+
|
|
76
|
+
`)}function NW(e){const t=[];for(const n of wm(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
77
|
+
> ${n.thinking.split(`
|
|
78
|
+
`).join(`
|
|
79
|
+
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
|
|
80
|
+
`);t.push(`\`\`\`
|
|
81
|
+
[${n.tool.name}]
|
|
82
|
+
${o}
|
|
83
|
+
\`\`\``)}return t.join(`
|
|
84
|
+
|
|
85
|
+
`)}function $A(e){return e.tool.id||`tool-${e.sourceIndex}`}function IW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?$A({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const LW=["aria-expanded"],$W={class:"tg-title"},FW={class:"tg-meta"},OW=["inert"],RW={class:"tool-group-body-inner"},BW=Ze({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=X(!0),i=R(()=>n.tools.length),r=R(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Tt(),a=R(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=Kt("pinScroll",()=>{}),d=X(null);function f(){c();const h=d.value;h&&mt(()=>u(h))}return(h,p)=>(w(),T("div",{class:We(["tool-group",{open:s.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[re(Id,{status:r.value},null,8,["status"]),re(Ve,{class:"tg-ic",name:"list",size:"sm"}),_("span",$W,O(C(l)("tools.group.title",i.value)),1),_("span",FW,"· "+O(a.value),1),re(Ve,{class:"tg-car",name:"chevron-right",size:"sm"})],8,LW),_("div",{class:We(["tool-group-body",{open:s.value}]),inert:!s.value},[_("div",RW,[(w(!0),T(Pe,null,ot(e.tools,(g,b)=>(w(),xe(LA,{key:C($A)(g),tool:g.tool,mobile:e.mobile,"stack-position":C(MW)(b,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=v=>o("openMedia",v)),onOpenFile:p[1]||(p[1]=v=>o("openFile",v)),onOpenToolDiff:p[2]||(p[2]=v=>o("openToolDiff",v)),onOpenAgent:p[3]||(p[3]=v=>o("openAgent",v))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,OW)],2))}}),DW=ct(BW,[["__scopeId","data-v-37eb334f"]]);var PW=Object.create,zy=Object.defineProperty,HW=Object.getOwnPropertyDescriptor,FA=Object.getOwnPropertyNames,WW=Object.getPrototypeOf,zW=Object.prototype.hasOwnProperty,OA=(e,t)=>function(){return t||(0,e[FA(e)[0]])((t={exports:{}}).exports,t),t.exports},RA=e=>{let t={};for(var n in e)zy(t,n,{get:e[n],enumerable:!0});return t},UW=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=FA(t),i=0,r=s.length,l;i<r;i++)l=s[i],!zW.call(e,l)&&l!==n&&zy(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=HW(t,l))||o.enumerable});return e},BA=(e,t,n)=>(n=e!=null?PW(WW(e)):{},UW(zy(n,"default",{value:e,enumerable:!0}),e));function qW(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function jW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function VW(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function KW(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
86
|
+
`:`<hr class="footnotes-sep">
|
|
87
|
+
`)+`<section class="footnotes">
|
|
88
|
+
<ol class="footnotes-list">
|
|
89
|
+
`}function GW(){return`</ol>
|
|
90
|
+
</section>
|
|
91
|
+
`}function YW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function ZW(){return`</li>
|
|
92
|
+
`}function QW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function XW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=VW,e.renderer.rules.footnote_block_open=KW,e.renderer.rules.footnote_block_close=GW,e.renderer.rules.footnote_open=YW,e.renderer.rules.footnote_close=ZW,e.renderer.rules.footnote_anchor=QW,e.renderer.rules.footnote_caption=jW,e.renderer.rules.footnote_anchor_name=qW;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:p},g.level=l.level++,l.tokens.push(g);const b=l.bMarks[a],v=l.tShift[a],m=l.sCount[a],y=l.parentType,k=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let $=A;for(;h<f;){const x=l.src.charCodeAt(h);if(n(x))x===9?$+=4-$%4:$++;else break;h++}l.tShift[a]=h-k,l.sCount[a]=$-A,l.bMarks[a]=k,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=y,l.blkIndent-=4,l.tShift[a]=v,l.sCount[a]=m,l.bMarks[a]=b;const I=new l.Token("footnote_reference_close","",-1);return I.level=--l.level,l.tokens.push(I),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,g=h.length;p<g;p++){const b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const y=new l.Token("paragraph_open","p",1);y.block=!0,a.push(y);const k=new l.Token("inline","",0);k.children=h[p].tokens,k.content=h[p].content,a.push(k);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let v;l.tokens[l.tokens.length-1].type==="paragraph_close"?v=l.tokens.pop():v=null;const m=h[p].count>0?h[p].count:1;for(let y=0;y<m;y++){const k=new l.Token("footnote_anchor","",0);k.meta={id:p,subId:y,label:h[p].label},l.tokens.push(k)}v&&l.tokens.push(v),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function JW(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function ez(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const tz=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function nz(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(tz,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function oz(e){e.inline.ruler.after("emphasis","sub",nz)}const sz=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function iz(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(sz,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function rz(e){e.inline.ruler.after("emphasis","sup",iz)}var lz=OA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),g.core.ruler.after("inline","github-task-lists",function(v){for(var m=v.tokens,y=0,k=2;k<m.length;k++)s(m,k)&&(i(m[k],y,b,v.Token),y+=1,n(m[k-2],"class",b.liClass),n(m[o(m,k-2)],"class",b.ulClass))})};function n(g,b,v){var m=g.attrIndex(b),y=[b,v];m<0?g.attrPush(y):g.attrs[m]=y}function o(g,b){for(var v=g[b].level-1,m=b-1;m>=0;m--)if(g[m].level===v)return m;return-1}function s(g,b){return d(g[b])&&f(g[b-1])&&h(g[b-2])&&p(g[b])}function i(g,b,v,m){var y=v.idPrefix+b;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(y,m)),g.children.push(a(m)),g.children.unshift(r(g,y,v,m)),v.divWrap&&(g.children.unshift(c(v,m)),g.children.push(u(m)))}function r(g,b,v,m){var y=new m("checkbox_input","input",0);return y.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&y.attrs.push(["checked","true"]),v.disabled===!0&&y.attrs.push(["disabled","true"]),y}function l(g,b){var v=new b("label_open","label",1);return v.attrs=[["for",g]],v}function a(g){return new g("label_close","label",-1)}function c(g,b){var v=new b("checkbox_open","div",0);return v.attrs=[["class",g.divClass]],v}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function p(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),az=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),cz=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),g0;const uz=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),dz=(g0=String.fromCodePoint)!==null&&g0!==void 0?g0:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function fz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=uz.get(e))!==null&&t!==void 0?t:e}var Ro;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ro||(Ro={}));const hz=32;var bl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bl||(bl={}));function sv(e){return e>=Ro.ZERO&&e<=Ro.NINE}function pz(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_F||e>=Ro.LOWER_A&&e<=Ro.LOWER_F}function mz(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_Z||e>=Ro.LOWER_A&&e<=Ro.LOWER_Z||sv(e)}function gz(e){return e===Ro.EQUALS||mz(e)}var Oo;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Oo||(Oo={}));var vl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vl||(vl={}));var vz=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vl.Strict}startEntity(e){this.decodeMode=e,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Oo.EntityStart:return e.charCodeAt(t)===Ro.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(e,t));case Oo.NumericStart:return this.stateNumericStart(e,t);case Oo.NumericDecimal:return this.stateNumericDecimal(e,t);case Oo.NumericHex:return this.stateNumericHex(e,t);case Oo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|hz)===Ro.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Oo.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(sv(o)||pz(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(sv(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ro.SEMI)this.consumed+=1;else if(this.decodeMode===vl.Strict)return 0;return this.emitCodePoint(fz(this.result),this.consumed),this.errors&&(e!==Ro.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&bl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=yz(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===vl.Attribute&&(s===0||gz(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&bl.VALUE_LENGTH)>>14,s!==0){if(i===Ro.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==vl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&bl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~bl.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==vl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}};function DA(e){let t="";const n=new vz(e,o=>t+=dz(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function yz(e,t,n,o){const s=(t&bl.BRANCH_LENGTH)>>7,i=t&bl.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const kz=DA(az);DA(cz);function Uy(e,t=vl.Legacy){return kz(e,t)}var bz=BA(lz());const Sw={};function xz(e){let t=Sw[e];if(t)return t;t=Sw[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function _m(e,t){typeof t!="string"&&(t=_m.defaultChars);const n=xz(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}_m.defaultChars=";/?:@&=+$,#";_m.componentChars="";var iv=_m;const Cw={};function wz(e){let t=Cw[e];if(t)return t;t=Cw[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Sm(e,t,n){typeof t!="string"&&(n=t,t=Sm.defaultChars),typeof n>"u"&&(n=!0);const o=wz(t);let s="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}Sm.defaultChars=";/?:@&=+$,-_.!~*'()#";Sm.componentChars="-_.!~*'()";var PA=Sm;function qy(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function ap(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const _z=/^([a-z0-9.+-]+:)/i,Sz=/:[0-9]*$/,Cz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Az=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
93
|
+
`," "]),Mz=["'"].concat(Az),Aw=["%","/","?",";","#"].concat(Mz),Mw=["/","?","#"],Ez=255,Ew=/^[+a-z0-9A-Z_-]{0,63}$/,Tz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Tw={javascript:!0,"javascript:":!0},Nw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Nz(e,t){if(e&&e instanceof ap)return e;const n=new ap;return n.parse(e,t),n}ap.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=Cz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=_z.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&Tw[r])&&(i=i.substr(2),this.slashes=!0)),!Tw[r]&&(s||r&&!Nw[r])){let c=-1;for(let p=0;p<Mw.length;p++)o=i.indexOf(Mw[p]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<Aw.length;p++)o=i.indexOf(Aw[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let g=0,b=p.length;g<b;g++){const v=p[g];if(v&&!v.match(Ew)){let m="";for(let y=0,k=v.length;y<k;y++)v.charCodeAt(y)>127?m+="x":m+=v[y];if(!m.match(Ew)){const y=p.slice(0,g),k=p.slice(g+1),A=v.match(Tz);A&&(y.push(A[1]),k.unshift(A[2])),k.length&&(i=k.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>Ez&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Nw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ap.prototype.parseHost=function(e){let t=Sz.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var jy=Nz,HA=RA({decode:()=>iv,encode:()=>PA,format:()=>qy,parse:()=>jy}),WA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zA=/[\0-\x1F\x7F-\x9F]/,Iz=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,UA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Lz=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,qA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,$z=RA({Any:()=>WA,Cc:()=>zA,Cf:()=>Iz,P:()=>UA,S:()=>Lz,Z:()=>qA}),Fz=Object.defineProperty,jA=e=>{let t={};for(var n in e)Fz(t,n,{get:e[n],enumerable:!0});return t},xo=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Oz=jA({arrayReplaceAt:()=>zz,assign:()=>Hz,countLines:()=>io,escapeHtml:()=>Qz,escapeRE:()=>Jz,fromCodePoint:()=>$d,has:()=>Pz,isMdAsciiPunct:()=>dp,isPunctChar:()=>up,isPunctCode:()=>rv,isSpace:()=>Wz,isString:()=>Bz,isValidEntityCode:()=>Am,isWhiteSpace:()=>Ld,lib:()=>eU,mdurl:()=>HA,normalizeReference:()=>Cm,ucmicro:()=>cp,unescapeAll:()=>Fd,unescapeMd:()=>Vz});const cp=$z;function Rz(e){return Object.prototype.toString.call(e)}function Bz(e){return Rz(e)==="[object String]"}const Dz=Object.prototype.hasOwnProperty;function Pz(e,t){return Dz.call(e,t)}function Hz(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function Wz(e){return e===9||e===32}function Ld(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function up(e){return cp.P.test(e)||cp.S.test(e)}const Iw=new Map;function rv(e){if(dp(e))return!0;const t=Iw.get(e);if(t!==void 0)return t;const n=up(String.fromCharCode(e));return Iw.set(e,n),n}function dp(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Cm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function zz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Am(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function $d(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const VA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Uz=new RegExp(`${VA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),qz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function jz(e,t){if(t.charCodeAt(0)===35&&qz.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Am(o)?$d(o):e}const n=Uy(e);return n!==e?n:e}function Vz(e){return e.includes("\\")?e.replace(VA,"$1"):e}function Fd(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Uz,(t,n,o)=>n||jz(t,o))}const Kz=/[&<>"]/,Gz=/[&<>"]/g,Yz={"&":"&","<":"<",">":">",'"':"""};function Zz(e){return Yz[e]}function Qz(e){return Kz.test(e)?e.replace(Gz,Zz):e}const Xz=/[.?*+^$[\]\\(){}|-]/g;function Jz(e){return e.replace(Xz,"\\$&")}const eU={mdurl:HA,ucmicro:cp};function io(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
94
|
+
`,n+1))!==-1;)t++;return t}const tU=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,nU=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,oU=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Vy=["references","footnotes","abbreviations","abbr","abbrs"],Ky=Symbol.for("markdown-it-ts.global-state"),Gy=Object.prototype.hasOwnProperty;function Lw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Cl(e){if(Array.isArray(e))return e.map(t=>Cl(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=Cl(e[n]);return t}return e}function fp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function lv(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!lv(e[n],t[n]))return!1;return!0}if($i(e)||$i(t)){if(!$i(e)||!$i(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!Gy.call(t,s)||!lv(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function KA(e,t){if(Array.isArray(e))return e[Number(t)];if($i(e))return e[t]}function sU(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Cl(t[n]);return e}if($i(e)&&$i(t)){for(const n of Object.keys(e))Gy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Cl(t[n]);return e}return Cl(t)}function iU(e,t,n){const o=n.ownedKeys??[],s=e[t];if($i(s)||Array.isArray(s)){const i=new Set(fp(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=Cl(KA(n.value,r)):delete s[r];!n.existed&&fp(s).length===0&&delete e[t];return}n.existed?e[t]=Cl(n.value):delete e[t]}function Yy(e){const t=e[Ky];return Lw(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Lw(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function rU(e,t){Object.defineProperty(e,Ky,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ts(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:tU.test(e)?"footnote-definition":nU.test(e)?"abbreviation-definition":oU.test(e)?"reference-definition":null}function Zd(e){return Yy(e)?.reason??null}function Dc(e,t,n){if(Zd(e)&&zr(e),!t)return n();Zy(e,t);try{const o=n();return Qy(e),o}catch(o){throw zr(e),o}}function Zy(e,t){try{zr(e);const n={};for(const o of Vy)n[o]=Gy.call(e,o)?{existed:!0,value:Cl(e[o])}:{existed:!1};rU(e,{reason:t,snapshot:n})}catch{}}function Qy(e){const t=Yy(e);if(t)for(const n of Vy){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!$i(s)&&!Array.isArray(s))continue;const i=new Set(fp(o.existed?o.value:void 0));o.ownedKeys=fp(s).filter(r=>i.has(r)?!lv(s[r],KA(o.value,r)):!0)}}function zr(e){const t=Yy(e);if(t){for(const n of Vy){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){iU(e,n,o);continue}o.existed?e[n]=sU(e[n],o.value):delete e[n]}delete e[Ky]}}const av=Symbol.for("markdown-it-ts.diagnostics");function Mm(e,t){if(e)try{const n=e[av];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[av]=o,o}catch{return}}function _r(e){return Mm(e,!1)}function lU(e){if(e)try{const t=e[av];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function us(e){lU(e)}function yo(e,t){const n=Mm(e,!0);n&&(n.strategy=t)}function v0(e,t){const n=Mm(e,!0);n&&(n.chunk=t)}function GA(e,t){const n=Mm(e,!0);n&&(n.unbounded=t)}function aU(e){const t={};e=e||{},t.src_Any=WA.source,t.src_Cc=zA.source,t.src_Z=qA.source,t.src_P=UA.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function cv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Em(e){return Object.prototype.toString.call(e)}function cU(e){return Em(e)==="[object String]"}function uU(e){return Em(e)==="[object Object]"}function dU(e){return Em(e)==="[object RegExp]"}function $w(e){return Em(e)==="[object Function]"}function fU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const YA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function hU(e){return Object.keys(e||{}).reduce(function(t,n){return t||YA.hasOwnProperty(n)},!1)}const pU={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},mU="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",gU="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function vU(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Fw(){return function(e,t){t.normalize(e)}}function hp(e){const t=e.re=aU(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(mU),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,uU(a)){dU(a.validate)?c.validate=vU(a.validate):$w(a.validate)?c.validate=a.validate:i(l,a),$w(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Fw();return}if(cU(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Fw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(fU).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function ZA(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ei(e,t){if(!(this instanceof ei))return new ei(e,t);t||hU(e)&&(t=e,e={}),this.__opts__=cv({},YA,t),this.__schemas__=cv({},pU,e),this.__compiled__={},this.__tlds__=gU,this.__tlds_replaced__=!1,this.re={},hp(this)}ei.prototype.add=function(t,n){return this.__schemas__[t]=n,hp(this),this};ei.prototype.set=function(t){return this.__opts__=cv(this.__opts__,t),this};ei.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};ei.prototype.pretest=function(t){return this.re.pretest.test(t)};ei.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ei.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new ZA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};ei.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new ZA(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ei.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),hp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,hp(this),this)};ei.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ei.prototype.onCompile=function(){};var QA=ei,yU=OA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,b=Math.floor,v=String.fromCharCode;function m(B){throw new RangeError(p[B])}function y(B,U){const H=[];let P=B.length;for(;P--;)H[P]=U(B[P]);return H}function k(B,U){const H=B.split("@");let P="";H.length>1&&(P=H[0]+"@",B=H[1]),B=B.replace(h,".");const Z=y(B.split("."),U).join(".");return P+Z}function A(B){const U=[];let H=0;const P=B.length;for(;H<P;){const Z=B.charCodeAt(H++);if(Z>=55296&&Z<=56319&&H<P){const K=B.charCodeAt(H++);(K&64512)==56320?U.push(((Z&1023)<<10)+(K&1023)+65536):(U.push(Z),H--)}else U.push(Z)}return U}const $=B=>String.fromCodePoint(...B),I=function(B){return B>=48&&B<58?26+(B-48):B>=65&&B<91?B-65:B>=97&&B<123?B-97:36},x=function(B,U){return B+22+75*(B<26)-((U!=0)<<5)},L=function(B,U,H){let P=0;for(B=H?b(B/700):B>>1,B+=b(B/U);B>g*26>>1;P+=36)B=b(B/g);return b(P+(g+1)*B/(B+38))},E=function(B){const U=[],H=B.length;let P=0,Z=128,K=72,V=B.lastIndexOf("-");V<0&&(V=0);for(let J=0;J<V;++J)B.charCodeAt(J)>=128&&m("not-basic"),U.push(B.charCodeAt(J));for(let J=V>0?V+1:0;J<H;){const he=P;for(let ue=1,de=36;;de+=36){J>=H&&m("invalid-input");const Ce=I(B.charCodeAt(J++));Ce>=36&&m("invalid-input"),Ce>b((2147483647-P)/ue)&&m("overflow"),P+=Ce*ue;const Ie=de<=K?1:de>=K+26?26:de-K;if(Ce<Ie)break;const le=36-Ie;ue>b(2147483647/le)&&m("overflow"),ue*=le}const ne=U.length+1;K=L(P-he,ne,he==0),b(P/ne)>2147483647-Z&&m("overflow"),Z+=b(P/ne),P%=ne,U.splice(P++,0,Z)}return String.fromCodePoint(...U)},F=function(B){const U=[];B=A(B);const H=B.length;let P=128,Z=0,K=72;for(const he of B)he<128&&U.push(v(he));const V=U.length;let J=V;for(V&&U.push("-");J<H;){let he=2147483647;for(const ue of B)ue>=P&&ue<he&&(he=ue);const ne=J+1;he-P>b((2147483647-Z)/ne)&&m("overflow"),Z+=(he-P)*ne,P=he;for(const ue of B)if(ue<P&&++Z>2147483647&&m("overflow"),ue===P){let de=Z;for(let Ce=36;;Ce+=36){const Ie=Ce<=K?1:Ce>=K+26?26:Ce-K;if(de<Ie)break;const le=de-Ie,z=36-Ie;U.push(v(x(Ie+le%z,0))),de=b(le/z)}U.push(v(x(de,0))),K=L(Z,ne,J===V),Z=0,++J}++Z,++P}return U.join("")},D={version:"2.3.1",ucs2:{decode:A,encode:$},decode:E,encode:F,toASCII:function(B){return k(B,function(U){return f.test(U)?"xn--"+F(U):U})},toUnicode:function(B){return k(B,function(U){return d.test(U)?E(U.slice(4).toLowerCase()):U})}};t.exports=D})}),XA=BA(yU());function Xy(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=Fd(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=Fd(e.slice(t,s)),i.pos=s,i.ok=!0),i}var JA=Xy;const xh=-2;function kU(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return xh}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return xh;if(r===91){s++,i++;continue}i++}return-1}function Jy(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=kU(l,t,a,n);if(f!==xh)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var pp=Jy;function ek(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=Fd(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Fd(e.slice(t,i)),r}var e6=ek;function Tm(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function tk(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function bU(e,t,n){const o=Tm(e,t),s=[t,n];o<0?tk(e,s):e.attrs[o]=s}function xU(e,t){const n=Tm(e,t);return n>=0?e.attrs[n][1]:null}function wU(e,t,n){const o=Tm(e,t);o<0?tk(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var _U=jA({attrGet:()=>xU,attrIndex:()=>Tm,attrJoin:()=>wU,attrPush:()=>tk,attrSet:()=>bU,parseLinkDestination:()=>Xy,parseLinkLabel:()=>Jy,parseLinkTitle:()=>ek});function SU(e){return e.includes("\r")||e.includes("\0")}function t6(e){return typeof e=="string"?e:e.toString()}function CU(e){if(e.inlineMode){const t=new xo("inline","",0);t.content=t6(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const AU=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,MU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function EU(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(MU.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(AU.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}return!1}var TU=EU;function NU(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(o,c);f.includes(`
|
|
95
|
+
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var IU=NU;function Ow(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function LU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Ow(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Ow(t[o].delimiters)}var $U=LU;function FU(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function Rw(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function OU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Rw(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Rw(e,t[o].delimiters)}const Bw={tokenize:FU,postProcess:OU};function n6(e){return Uy(e)}function nk(e){return e>=48&&e<=57}function RU(e){const t=e|32;return nk(e)||t>=97&&t<=102}function o6(e){const t=e|32;return t>=97&&t<=122}function BU(e){return o6(e)||nk(e)}function DU(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?RU(l):nk(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function PU(e,t,n){let o=t+1;if(o>=n||!o6(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&BU(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return n6(s)!==s?s:null}function HU(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=DU(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=Am(i)?$d(i):$d(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=PU(e.src,n,o);if(s){const i=n6(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var WU=HU;const s6=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),uv=new Array(128),i6=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);uv[e]=`\\${t}`,i6[e]=s6[e]?t:uv[e]}function Dw(e,t,n){e.pending&&e.pushPending();const o=new xo("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function zU(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Dw(e,i6[i],uv[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return Dw(e,i<256&&s6[i]?r:l,l),e.pos=n+1,!0}var UU=zU;function qU(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var jU=qU;const r6=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,l6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",VU=new RegExp(`^(?:${r6}|${l6}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),KU=new RegExp(`^(?:${r6}|${l6})`);function a6(e){return e===32||e===9||e===10||e===12||e===13}function GU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||a6(t)}function YU(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!a6(n))return!1}return!1}function ZU(e){const t=e|32;return t>=97&&t<=122}function QU(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!ZU(i))return!1;const r=s.slice(o).match(VU);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,GU(l)&&e.linkLevel++,YU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var XU=QU;function JU(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=pp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=JA(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=e6(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=pp(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[Cm(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const g=[];e.md.inline.parse(o,e.md,e.env,g);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=g,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var eq=JU;function tq(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=pp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(s=JA(e.src,p,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?p=s.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(s=e6(e.src,p,e.posMax),p<d&&a!==p&&s.ok)for(l=s.str,p=s.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=pp(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[Cm(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var nq=tq;function c6(e){const t=e|32;return t>=97&&t<=122}function oq(e){return e>=48&&e<=57}function sq(e){return c6(e)||oq(e)||e===43||e===45||e===46}function iq(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&sq(e.charCodeAt(t));)t--;return t++,t>=e.length||!c6(e.charCodeAt(t))?null:e.slice(t)}function rq(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function lq(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=iq(e.pending);if(!s)return!1;const i=rq(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function aq(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var cq=aq;function uq(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function Pw(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function dq(e){const t=e.delimiters;Pw(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Pw(e,n[o].delimiters)}const Hw={tokenize:uq,postProcess:dq};function Ww(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function fq(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||Ww(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!Ww(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var hq=fq;function ok(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function pq(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function mq(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function u6(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:ok(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Pc(e,t,n,o,s,i){const r=u6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=mq(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=ok()}function gq(e){const t=u6(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=pq(s.samples)}return t.completedAt=ok(),t}var zw=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},d6=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new xo("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new xo(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new xo(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=Ld(l),u=Ld(a),d=rv(l),f=rv(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};d6.prototype.Token=xo;const vq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function f6(e){return!vq.test(e)}var yq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new zw,this.ruler2=new zw,this.ruler.push("text",hq),this.ruler.push("linkify",lq),this.ruler.push("newline",cq),this.ruler.push("escape",UU),this.ruler.push("backticks",IU),this.ruler.push("strikethrough",Hw.tokenize),this.ruler.push("emphasis",Bw.tokenize),this.ruler.push("link",nq),this.ruler.push("image",eq),this.ruler.push("autolink",TU),this.ruler.push("html_inline",XU),this.ruler.push("entity",WU),this.ruler2.push("balance_pairs",$U),this.ruler2.push("strikethrough",Hw.postProcess),this.ruler2.push("emphasis",Bw.postProcess),this.ruler2.push("fragments_join",jU),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<o;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Pc(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<o;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Pc(e.env,"inline",s[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&f6(e)){const a=new xo("text","",0);a.content=e,o.push(a);return}const s=new d6(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Pc(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function kq(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&f6(i.content)){const r=new xo("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const bq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,xq=/[0-9a-z]/i;function wq(e){return/^<a[>\s]/i.test(e)}function _q(e){return/^<\/a\s*>/i.test(e)}function Sq(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!bq.test(o)||!xq.test(s))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function Cq(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(wq(l.content)&&i>0&&i--,_q(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>Sq(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],g=e.md.normalizeLink(p.url);if(!e.md.validateLink(g))continue;let b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const v=p.index;if(v>f){const A=new xo("text","",0);A.content=a.slice(f,v),A.level=d,u.push(A)}const m=new xo("link_open","a",1);m.attrs=[["href",g]],m.level=d++,m.markup="linkify",m.info="auto",u.push(m);const y=new xo("text","",0);y.content=b,y.level=d,u.push(y);const k=new xo("link_close","a",-1);k.level=--d,k.markup="linkify",k.info="auto",u.push(k),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new xo("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const Aq=/\r\n?|\n/g,Mq=/\0/g;function Eq(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(Aq,`
|
|
96
|
+
`)),o&&(s=s.replace(Mq,"�")),e.src=s}const h6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Tq=/\((?:c|tm|r)\)/i,Nq=/\((c|tm|r)\)/gi,Iq={c:"©",r:"®",tm:"™"};function Lq(e,t){return Iq[t.toLowerCase()]}function $q(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(Nq,Lq)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Fq(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&h6.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Oq(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");Tq.test(o)&&$q(n.children||[]),h6.test(o)&&Fq(n.children||[])}}var Rq=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const Bq=/['"]/,Uw=/['"]/g,qw="’";function jf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Dq(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){Uw.lastIndex=c;const d=Uw.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let g=32;if(d.index-1>=0)g=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const v=dp(g)||up(String.fromCharCode(g)),m=dp(b)||up(String.fromCharCode(b)),y=Ld(g),k=Ld(b);if(k?f=!1:m&&(y||v||(f=!1)),y?h=!1:v&&(k||m||(h=!1)),b===34&&d[0]==='"'&&g>=48&&g<=57&&(h=f=!1),f&&h&&(f=v,h=m),!f&&!h){p&&(r.content=jf(r.content,d.index,qw));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===p&&o[n].level===l){A=o[n];let $,I;p?($=s[2]||"‘",I=s[3]||"’"):($=s[0]||"“",I=s[1]||"”"),r.content=jf(r.content,d.index,I),e[A.token].content=jf(e[A.token].content,A.pos,$),c+=I.length-1,A.token===i&&(c+=$.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=jf(r.content,d.index,qw))}}}function Pq(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!Bq.test(o)||!n.children||Dq(n.children,e)}}function Hq(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const Wq=/^(?:vbscript|javascript|file|data):/,zq=/^data:image\/(?:gif|png|jpeg|webp);/,p6=["http:","https:","mailto:"];function m6(e){const t=e.trim().toLowerCase();return Wq.test(t)?zq.test(t):!0}function g6(e){const t=jy(e,!0);if(t.hostname&&(!t.protocol||p6.includes(t.protocol)))try{t.hostname=XA.default.toASCII(t.hostname)}catch{}return PA(qy(t))}function v6(e){const t=jy(e,!0);if(t.hostname&&(!t.protocol||p6.includes(t.protocol)))try{t.hostname=XA.default.toUnicode(t.hostname)}catch{}return iv(qy(t),`${iv.defaultChars}%`)}function Uq(e){switch(e){case 9:case 32:return!0}return!1}function qq(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],g=[],b=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.parentType;e.parentType="blockquote";let y=!1,k;for(k=t;k<n;k++){const L=a[k]<e.blkIndent;if(u=i[k]+l[k],d=r[k],u>=d)break;if(s.charCodeAt(u++)===62&&!L){let F=a[k]+1,S,N;s.charCodeAt(u)===32?(u++,F++,N=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[k]+F)%4===3?(u++,F++,N=!1):N=!0):S=!1;let D=F;for(h.push(i[k]),i[k]=u;u<d;){const B=s.charCodeAt(u);if(Uq(B))B===9?D+=4-(D+c[k]+(N?1:0))%4:D++;else break;u++}y=u>=d,p.push(c[k]),c[k]=a[k]+1+(S?1:0),g.push(a[k]),a[k]=D-F,b.push(l[k]),l[k]=u-i[k];continue}if(y)break;let E=!1;for(let F=0,S=v.length;F<S;F++)if(v[F](e,k,n,!0)){E=!0;break}if(E){e.lineMax=k,e.blkIndent!==0&&(h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]-=e.blkIndent);break}h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]=-1}const A=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const I=[t,0];$.map=I,e.md.block.tokenize(e,t,k);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=f,e.parentType=m,I[1]=e.line;for(let L=0;L<b.length;L++)i[L+t]=h[L],l[L+t]=b[L],a[L+t]=g[L],c[L+t]=p[L];return e.blkIndent=A,!0}function jq(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
|
|
97
|
+
`,i.map=[t,e.line],!0}function Vq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const jw=["","h1","h2","h3","h4","h5","h6"],Vw=["","#","##","###","####","#####","######"];function Kw(e){switch(e){case 9:case 32:return!0}return!1}function Kq(e,t,n,o){const s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!Kw(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&Kw(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",jw[d],1);h.markup=Vw[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const g=e.push("heading_close",jw[d],-1);return g.markup=Vw[d],!0}function Gq(e){switch(e){case 9:case 32:return!0}return!1}function Yq(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!Gq(c))return!1;c===r&&l++}if(l<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const sc=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${KU.source}\\s*$`),/^$/,!1]];function Zq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<sc.length&&!sc[l][0].test(r);l++);if(l===sc.length)return!1;if(o)return sc[l][2];let a=t+1;if(!sc[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),sc[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function Gw(e){switch(e){case 9:case 32:return!0}return!1}const od={Pipe:1,ParagraphTerminator:2};function Qq(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var y6=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=od.Pipe|od.ParagraphTerminator),!a)if(Gw(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,Qq(f)&&(c|=od.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new xo(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new xo(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const g=this.src,b=this.bsCount,v=this.tShift;for(;f<h&&p<n;){const m=g.charCodeAt(f);if(m===9||m===32)m===9?p+=4-(p+b[u])%4:p++;else if(f-d<v[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,g;for(d+1<t||o?g=l[d]+1:g=l[d];p<g&&f<n;){const b=i.charCodeAt(p);if(Gw(b))b===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,g):s[u]=i.slice(p,g)}return s.join("")}};y6.prototype.Token=xo;function Xq(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function k6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function b6(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&od.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:Xq(n,o,s)}const Yw=["","h1","h2"];function Jq(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=k6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const k=i[p]+r[p],A=l[p];if(k>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(k),h===45||h===61)){let I=k+1,x=I;for(;I<A&&s.charCodeAt(I)===h;)I++;for(x=I;I<A;){const L=s.charCodeAt(I);if(L!==9&&L!==32)break;I++}if(I>=A){f=h===61?1:2;break}if(x-k>1)continue}if(a[p]<0||u&&!b6(e,p,s,k,A))continue;let $=!1;for(let I=0,x=o.length;I<x;I++)if(o[I](e,p,n,!0)){$=!0;break}if($)break}if(!f)return!1;let g;if(p===t+1){const k=i[t]+r[t];let A=l[t];for(;A>k;){const $=s.charCodeAt(A-1);if($!==9&&$!==32)break;A--}g=s.slice(k,A)}else g=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",v=e.push("heading_open",Yw[f],1);v.markup=b,v.map=[t,e.line];const m=e.push("inline","",0);m.content=g,m.map=[t,e.line-1],m.children=[];const y=e.push("heading_close",Yw[f],-1);return y.markup=b,e.parentType=d,!0}function x6(e){switch(e){case 9:case 32:return!0}return!1}function Zw(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!x6(i.charCodeAt(l))?-1:l}function Qw(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!x6(c))?-1:a}function ej(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const tj=["0","1","2","3","4","5","6","7","8","9"];function nj(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function oj(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,g=e.tShift,b=e.eMarks,v=e.sCount,m=e.bsCount,y=p[l]+g[l];if(y>=b[l])return!1;const k=h.charCodeAt(y);if(k>=48&&k<=57){if(f=Qw(e,l),f<0||(u=!0,r=y,d=ej(e,l,f),c&&d!==1))return!1}else if(k===42||k===45||k===43){if(f=Zw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),$=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const I=[l,0];e.tokens[e.tokens.length-1].map=I,e.tokens[e.tokens.length-1].markup=$;let x=!1;const L=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=b[l];const S=v[l]+f-(p[l]+g[l]);let N=S;for(;i<s;){const ne=h.charCodeAt(i);if(ne===9)N+=4-(N+m[l])%4;else if(ne===32)N++;else break;i++}const D=i;let B;D>=s?B=1:B=N-S,B>4&&(B=1);const U=S+B,H=e.push("list_item_open","li",1);H.markup=$;const P=[l,0];H.map=P,u&&(H.info=f-r-1===1?tj[h.charCodeAt(r)-48]:h.slice(r,f-1));const Z=e.tight,K=e.tShift[l],V=e.sCount[l],J=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=U,e.tight=!0,e.tShift[l]=D-p[l],e.sCount[l]=N,D>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||x)&&(a=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=J,e.tShift[l]=K,e.sCount[l]=V,e.tight=Z,e.push("list_item_close","li",-1).markup=$,l=e.line,P[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let he=!1;for(let ne=0,ue=E.length;ne<ue;ne++)if(E[ne](e,l,n,!0)){he=!0;break}if(he)break;if(u){if(f=Qw(e,l),f<0)break;r=p[l]+g[l]}else if(f=Zw(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=$:e.push("bullet_list_close","ul",-1).markup=$,I[1]=l,e.line=l,e.parentType=F,a&&nj(e,L),!0}function Xw(e){return e===9||e===32}function sj(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=k6(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const y=r[f]+l[f],k=a[f];if(y<k){const A=i.charCodeAt(y);if(A===42||A===45||A===43){if(y+1>=k||Xw(i.charCodeAt(y+1)))break}else if(A>=48&&A<=57&&y+1<k){let $=y+1;for(;;){if($>=k){$=-1;break}const I=i.charCodeAt($++);if(I>=48&&I<=57){if($-y>=10){$=-1;break}continue}if((I===41||I===46)&&($>=k||Xw(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const b=r[f]+l[f],v=a[f];if(d&&!b6(e,f,i,b,v))continue;let m=!1;for(let y=0,k=o.length;y<k;y++)if(o[y](e,f,n,!0)){m=!0;break}if(m)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const g=e.push("inline","",0);return g.content=h,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function Vf(e){switch(e){case 9:case 32:return!0}return!1}function ij(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==91)return!1;function a(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let A=!1;if(e.sCount[y]-e.blkIndent>3&&(A=!0),e.sCount[y]<0&&(A=!0),!A){const x=e.parentType;e.parentType="reference";let L=!1;for(let E=0,F=l.length;E<F;E++)if(l[E](e,y,k,!0)){L=!0;break}if(e.parentType=x,L)return null}const $=e.bMarks[y]+e.tShift[y],I=e.eMarks[y];return e.src.slice($,I+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const y=c.charCodeAt(s);if(y===91)return!1;if(y===93){u=s;break}else if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(y===92&&(s++,s<i&&c.charCodeAt(s)===10)){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Vf(y))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,g=s;for(;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Vf(y))break}let b=e.md.helpers.parseLinkTitle(c,s,i);for(;b.can_continue;){const y=a(r);if(y===null)break;c+=y,s=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,s,i,b)}let v;for(s<i&&g!==s&&b.ok?(v=b.str,s=b.pos):(v="",s=h,r=p);s<i&&Vf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&v)for(v="",s=h,r=p;s<i&&Vf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const m=Cm(c.slice(1,u));return m?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[m]>"u"&&(e.env.references[m]={title:v,href:f}),e.line=r),!0):!1}function y0(e){switch(e){case 9:case 32:return!0}return!1}const rj=65536;function k0(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function lj(e,t){if(e.lineFlags)return(e.lineFlags[t]&od.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Jw(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function aj(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!y0(l)||r===45&&y0(l)||!lj(e,t))return!1;for(;i<e.eMarks[s];){const k=e.src.charCodeAt(i);if(k!==124&&k!==45&&k!==58&&!y0(k))return!1;i++}let a=k0(e,t+1),c=a.split("|");const u=[];for(let k=0;k<c.length;k++){const A=c[k].trim();if(!A){if(k===0||k===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=k0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Jw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),g=[t,0];p.map=g;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let k=0;k<c.length;k++){const A=e.push("th_open","th",1);u[k]&&(A.attrs=[["style",`text-align:${u[k]}`]]);const $=e.push("inline","",0);$.content=c[k].trim(),$.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let m,y=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let k=!1;for(let $=0,I=h.length;$<I;$++)if(h[$](e,s,n,!0)){k=!0;break}if(k||(a=k0(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=Jw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),y+=d-c.length,y>rj))break;if(s===t+2){const $=e.push("tbody_open","tbody",1);$.map=m=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let $=0;$<d;$++){const I=e.push("td_open","td",1);u[$]&&(I.attrs=[["style",`text-align:${u[$]}`]]);const x=e.push("inline","",0);x.content=c[$]?c[$].trim():"",x.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return m&&(e.push("tbody_close","tbody",-1),m[1]=s),e.push("table_close","table",-1),g[1]=s,e.parentType=f,e.line=s,!0}var cj=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Pc(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Kf=[["table",aj,["paragraph","reference"]],["code",jq],["fence",Vq,["paragraph","reference","blockquote","list"]],["blockquote",qq,["paragraph","reference","blockquote","list"]],["hr",Yq,["paragraph","reference","blockquote","list"]],["list",oj,["paragraph","reference","blockquote"]],["reference",ij],["html_block",Zq,["paragraph","reference","blockquote"]],["heading",Kq,["paragraph","reference","blockquote"]],["lheading",Jq],["paragraph",sj]];var uj=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new cj;for(let e=0;e<Kf.length;e++)this.ruler.push(Kf[e][0],Kf[e][1],{alt:(Kf[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++)if(p=o[g](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[g].fn(e,u,n,!1);const v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Pc(e.env,"block",f[g].name,v-b,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new y6(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},w6=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};w6.prototype.Token=xo;const e_=[["normalize",Eq],["block",CU],["inline",kq],["linkify",Cq],["replacements",Oq],["smartquotes",Pq],["text_join",Hq]],dj={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},fj={parseLinkLabel:Jy,parseLinkDestination:Xy,parseLinkTitle:ek};function hj(){return{...dj}}function pj(){return{...fj}}var mj=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new uj,this.inline=new yq,this.ruler=new Rq;for(let e=0;e<e_.length;e++){const[t,n]=e_[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:hj(),helpers:pj(),normalizeLink:g6,normalizeLinkText:v6,validateLink:m6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new QA),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new w6(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Pc(e.env,"core",t[n].name,s-o,!0,!1)}gq(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&SU(e))return this.parse(t6(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const gj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function mp(e){return!gj.test(e)}function Vu(e,t){const n=e.indexOf(`
|
|
98
|
+
`,t);return n===-1?e.length:n}function wh(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function t_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function b0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function vj(e){if(e.length>3)return mp(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const yj=["","h1","h2","h3","h4","h5","h6"],kj=["","#","##","###","####","#####","######"],n_=0,x0=1,w0=2;function Vs(e,t,n,o){const s=new xo(e,t,n);return s.level=o,s.block=!0,s}function _6(e,t,n){const o=Vs("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new xo("text","",0);return s.content=e,o.children=[s],o}function bj(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!mp(u))return!1;const d=yj[i],f=kj[i],h=Vs("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(_6(u,s,1));const p=Vs("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function xj(e,t,n){const o=Vs("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(_6(t,n,1)),e.push(Vs("paragraph_close","p",-1,0))}function wj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function _0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function _j(e,t){const n=Vs("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function Sj(e,t,n){const o=Vs("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Vs("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Vs("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new xo("text","",0);r.content=t,i.children=[r],e.push(i);const l=Vs("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Vs("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function Cj(e){const t=Vs("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function Aj(e,t,n,o){if(!t_(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=Vu(e,l);if(t_(e,l,c)&&wh(e,l+3,c)){const u=Vs("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function Mj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?n_:w0,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Vu(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!wh(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!bj(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=_0(e,h),l+=1+r-h;continue}if(c===45){if(!b0(e,r,a))return null;const h=l;let p=r,g=l,b=null,v=null;for(;p<e.length;){const k=Vu(e,p);if(!b0(e,p,k))break;const A=p+2,$=k===A+1?e[A]:e.slice(A,k);if(!vj($))return null;b===null&&(b=_j(t,h)),v=Sj(t,$,g),p=k<e.length?k+1:k,g++}if(b===null||v===null)return null;let m=p,y=g;for(;m<e.length;){if(e.charCodeAt(m)===10){m++,y++;continue}const k=Vu(e,m);if(!wh(e,m,k)){if(b0(e,m,k))return null;break}m=k<e.length?k+1:k,y++}b.map[1]=y,v.map[1]=y,Cj(t),r=m,l=y;continue}if(c===96){const h=Aj(e,r,a,l);if(!h)return null;t.push(h.token),r=_0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=wj(e,r,a);let d;if(n===w0?d=mp(u):n===x0&&u===o?d=s:(d=mp(u),n===n_?(i&&(n=u===o?x0:w0),o=u,s=d,i=!0):n===x0&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!wh(e,f,Vu(e,f)))return null;xj(t,u,l),r=_0(e,f),l+=1+r-f}return t}const Ej=/[&<>"]/,o_=/[&<>"]/g,Tj=/&/g,Nj=/[<>"]/g,Ij={"&":"&","<":"<",">":">",'"':"""};function S0(e){return Ij[e]||e}function Ln(e){if(e.length===0)return"";if(e.length<32)return Ej.test(e)?e.replace(o_,S0):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(Tj,"&"):t?e.replace(o_,S0):e.replace(Nj,S0)}const Lj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),$j=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function S6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Lj,(t,n,o)=>{if(n)return n;if($j.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Am(i)?$d(i):"�"}const s=Uy(t);return s!==t?s:t})}const Fj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Oj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Rj=/"/g;function Sc(e,t){const n=e.indexOf(`
|
|
99
|
+
`,t);return n===-1?e.length:n}function gp(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Gf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Bj(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!gp(e,t,Sc(e,t))}function s_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Dj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function sk(e){return Oj.test(e)?Fj.test(e)?null:e.replace(Rj,"""):e}function Pj(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=sk(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
100
|
+
`}function i_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Hj(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
101
|
+
`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
|
|
102
|
+
`}function Wj(e,t,n){const o=t+2;if(n===o+1)return Hj(e,o);const s=sk(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
103
|
+
`}function zj(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function Uj(e,t,n,o){if(!s_(e,t,n))return null;const s=zj(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=Sc(e,l);if(s_(e,l,a)&&gp(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${Ln(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${Ln(c)}</code></pre>
|
|
104
|
+
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function r_(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=Sc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!gp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const g=Pj(e,t,u);if(g===null)return null;o?s.push(g):n+=g,t=Gf(e,u<e.length?u+1:u);continue}if(d===45){let g=t;for(;g<e.length;){const y=Sc(e,g);if(!i_(e,g,y))break;g=y<e.length?y+1:y}if(g===t)return null;const b=e.slice(t,g);let v;if(b===r)v=l;else{let y=t;for(v=`<ul>
|
|
105
|
+
`;y<g;){const k=Sc(e,y),A=Wj(e,y,k);if(A===null)return null;v+=A,y=k<e.length?k+1:k}v+=`</ul>
|
|
106
|
+
`,r=b,l=v}let m=Gf(e,g);for(;m<e.length;){if(e.charCodeAt(m)===10){m++;continue}const y=Sc(e,m);if(!gp(e,m,y)){if(i_(e,m,y))return null;break}m=y<e.length?y+1:y}o?s.push(v):n+=v,t=m;continue}if(d===96){const g=Uj(e,t,u,i);if(!g)return null;o?s.push(g.html):n+=g.html,t=Gf(e,g.nextPos);continue}const f=Dj(e,t,u);let h;if(f===a)h=c;else{const g=sk(f);if(g===null)return null;h=`<p>${g}</p>
|
|
107
|
+
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&Bj(e,p))return null;o?s.push(h):n+=h,t=Gf(e,p)}return o?s.join(""):n}const qj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function vp(e,t,n={},o){us(n);const s={...qj,...o||{}},i=Ts(t);if(s.fallbackOnGlobalState!==!1&&i)return v0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Dc(n,i,()=>e.core.parse(t,n,e).tokens);let r=_h(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=Gj(r,s.maxChunks)),Sh(t,r))return v0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Dc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return v0(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),Dc(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&Vj(f,l),Kj(a,f),l+=u.lineCount}return a})}function _h(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
108
|
+
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const g=Yj(e,f,h);if(t.fenceAware){let m=f;for(;m<h;){const k=e.charCodeAt(m);if(k===32||k===9)m++;else break}const y=e[m];if(y==="`"||y==="~"){let k=m;for(;k<h&&e[k]===y;)k++;const A=k-m;A>=3&&(u?u.marker===y&&A>=u.length&&(u=null):u={marker:y,length:A})}}const b=p-f;s+=b,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=b);const v=g;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(v)d(p);else{const m=Math.max(10,Math.floor(t.maxChunkLines*.5)),y=Math.max(t.maxChunkChars,8e3);(a>=m||c>=y)&&d(p)}f=p}return n&&d(e.length),o}function Sh(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!jj(e,t[s].end))return!0;return!1}function jj(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function Vj(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function Kj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Gj(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),o+=l}return n}function Yj(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const C6=4e6,A6=8e4,Zj=1e4,Qj=200,Xj=1e4,Jj=200;function M6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function eV(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function sl(e){return e.length===0?0:io(e)+(e.charCodeAt(e.length-1)===10?0:1)}function tV(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function nV(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
|
|
109
|
+
`,o);s===-1&&(s=e.length);let i=o;for(;i<s;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function oV(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return tV(e,n+1,e.length-1)?!nV(e,t):!1}function sV(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??Xj:e.options.fullChunkSizeChars??Zj),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??Jj:e.options.fullChunkSizeLines??Qj);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var Qd=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=sl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=_h(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Sh(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,sl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!oV(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,sl(this.pending)),null;const n=_h(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,sl(this.pending)),null;const o=Sh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sl(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=_h(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Sh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sl(this.pending)}]:n;this.commitRanges(o,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:sl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+sl(this.pending);return sV(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Zd(e)&&zr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ts(t);n&&(Zy(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&eV(r,a),this.options.retainTokens!==!1&&M6(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&Qy(t),n}catch(o){throw this.markedGlobalStateReason&&(zr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){GA(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function iV(e,t,n={},o={}){us(n);const s=new Qd(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function rV(e,t,n={},o={}){us(n);const s=new Qd(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function lV(e,t,n,o={},s={}){us(o);const i=new Qd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function aV(e,t,n,o={},s={}){us(o);const i=new Qd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function E6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??C6,s=e.options.autoUnboundedThresholdLines??A6;return t>=o||n>=s}function T6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??C6))return"yes";const o=e.options.autoUnboundedThresholdLines??A6;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function sd(e,t,n={},o={}){us(n);const s=Ts(t);if(Zd(n)&&zr(n),o.fallbackOnGlobalState!==!1&&s)return GA(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:io(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),Dc(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Qd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){M6(i,l)}});if(s&&Zy(n,s),r.feed(t),r.flushForce(n),s&&(Qy(n),o.fallbackOnGlobalState===!1)){const l=_r(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Hc=(e,t,n)=>e<t?t:e>n?n:e;function N6(e){return e.experimental?{...e,...e.experimental}:e}const l_=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],a_=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function I6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function cV(e,t=Math.max(0,e/40|0),n={}){const o=N6(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<l_.length;l++){const a=l_[l];if(e<=a.max){if(a.strategy!=="adaptive")return I6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Hc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Hc(Math.ceil(t/i),150,700),maxChunks:Hc(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function c_(e,t=Math.max(0,e/40|0),n={}){const o=N6(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<a_.length;l++){const a=a_[l];if(e<=a.max){if(a.strategy!=="adaptive")return I6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Hc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Hc(Math.ceil(t/i),150,700),maxChunks:Hc(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var uV={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},dV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},fV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Nm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Ch(e,t){if(Nm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const u_=e=>Nm(e)?e:Promise.resolve(e);function id(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Ln(e)}}function $l(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${id(t[0])}="${Ln(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${id(s[0])}="${Ln(s[1])}"`}return n}function L6(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function rd(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
|
|
110
|
+
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Ln(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
|
|
111
|
+
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${$l(r)}>${t}</code></pre>
|
|
112
|
+
`}return`<pre><code${$l(e.attrs)}>${t}</code></pre>
|
|
113
|
+
`}function yp(e){return!e.attrs||e.attrs.length===0?`<code>${Ln(e.content)}</code>`:`<code${$l(e.attrs)}>${Ln(e.content)}</code>`}function dv(e){const t=Ln(e.content);return e.attrs?`<pre${$l(e.attrs)}><code>${t}</code></pre>
|
|
114
|
+
`:`<pre><code>${t}</code></pre>
|
|
115
|
+
`}function hV(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${Ln(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Ln(n[0][1])}">`}return null}function d_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${id(t[0][0])}="${Ln(t[0][1])}">`:t.length===2?`<a ${id(t[0][0])}="${Ln(t[0][1])}" ${id(t[1][0])}="${Ln(t[1][1])}">`:`<a${$l(t)}>`}function pV(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function f_(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function kp(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+$l(n);return o===0&&t&&(i+=" /"),`${i}>`}const mV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Yf=Object.prototype.hasOwnProperty,Tn={code_inline(e,t){return yp(e[t])},code_block(e,t){return dv(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?S6(i.info).trim():"",{langName:l,langAttrs:a}=L6(r),c=n.highlight,u=Ln(i.content);if(!c)return rd(i,u,r,l,n);const d=c(i.content,l,a);return Nm(d)?d.then(f=>rd(i,f||u,r,l,n)):rd(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],kp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
116
|
+
`:`<br>
|
|
117
|
+
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
118
|
+
`:`<br>
|
|
119
|
+
`:`
|
|
120
|
+
`},text(e,t){return Ln(e[t].content)},text_special(e,t){return Ln(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function h_(e,t,n){const o=e.info?S6(e.info).trim():"",{langName:s,langAttrs:i}=L6(o),r=t.highlight,l=Ln(e.content);if(!r)return rd(e,l,o,s,t);const a=r(e.content,s,i);if(Nm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return rd(e,a||l,o,s,t)}function Zf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Tn.text)return l.content.length===0?"":Ln(l.content);break;case"text_special":if(s.text_special===Tn.text_special)return l.content.length===0?"":Ln(l.content);break;case"softbreak":if(s.softbreak===Tn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Tn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Tn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Tn.code_inline)return yp(l);break}const a=s[l.type];if(!a)return kp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Ch(c,l.type)}var gV=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Tn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",g=!1,b="";for(let v=0;v<e.length;v++){const m=e[v],y=m.type,k=v>0&&e[v-1].hidden?`
|
|
121
|
+
`:"";if(y==="list_item_open"&&(!m.attrs||m.attrs.length===0)&&v+3<e.length){const I=e[v+1],x=e[v+2],L=e[v+3];if(I.type==="paragraph_open"&&I.hidden&&x.type==="inline"&&L.type==="paragraph_close"&&L.hidden){b+=`${k}<li>${this.renderInlineTokens(x.children||[],o,s)}`,v+=3;continue}}if(v+2<e.length){const I=e[v+1],x=e[v+2];if(I.type==="inline"&&x.nesting===-1&&x.tag===m.tag&&!x.hidden){const L=hV(m,k);if(L!==null){b+=`${L+this.renderInlineTokens(I.children||[],o,s)}</${m.tag}>
|
|
122
|
+
`,v+=2;continue}}}if(y==="inline"){const I=m.children||[];if(I.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
|
|
123
|
+
`:`<br>
|
|
124
|
+
`,p=o.breaks?h:`
|
|
125
|
+
`,g=!0);const x=I[0];switch(x.type){case"text":if(l===Tn.text){b+=Ln(x.content);continue}break;case"text_special":if(a===Tn.text_special){b+=Ln(x.content);continue}break;case"softbreak":if(c===Tn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Tn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Tn.html_inline){b+=x.content;continue}break;case"code_inline":if(f===Tn.code_inline){b+=yp(x);continue}break}}b+=this.renderInlineTokens(I,o,s);continue}const A=i[y];if(!A){const I=m.attrs;if(!m.hidden){if(!I||I.length===0)switch(y){case"hr":b+=r?`<hr />
|
|
126
|
+
`:`<hr>
|
|
127
|
+
`;continue;case"heading_open":b+=`<${m.tag}>`;continue;case"heading_close":b+=`</${m.tag}>
|
|
128
|
+
`;continue;case"paragraph_open":b+=`${k}<p>`;continue;case"paragraph_close":b+=`</p>
|
|
129
|
+
`;continue;case"list_item_open":{const x=e[v+1];b+=k+(x&&(x.type==="inline"||x.hidden||x.nesting===-1&&x.tag==="li")?"<li>":`<li>
|
|
130
|
+
`);continue}case"list_item_close":b+=`</li>
|
|
131
|
+
`;continue;case"bullet_list_open":b+=`${k}<ul>
|
|
132
|
+
`;continue;case"bullet_list_close":b+=`</ul>
|
|
133
|
+
`;continue;case"blockquote_open":b+=k+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
134
|
+
`);continue;case"blockquote_close":b+=`</blockquote>
|
|
135
|
+
`;continue;case"ordered_list_open":b+=`${k}<ol>
|
|
136
|
+
`;continue;case"ordered_list_close":b+=`</ol>
|
|
137
|
+
`;continue;case"table_open":b+=`${k}<table>
|
|
138
|
+
`;continue;case"table_close":b+=`</table>
|
|
139
|
+
`;continue;case"thead_open":b+=`${k}<thead>
|
|
140
|
+
`;continue;case"thead_close":b+=`</thead>
|
|
141
|
+
`;continue;case"tbody_open":b+=`${k}<tbody>
|
|
142
|
+
`;continue;case"tbody_close":b+=`</tbody>
|
|
143
|
+
`;continue;case"tr_open":b+=`${k}<tr>
|
|
144
|
+
`;continue;case"tr_close":b+=`</tr>
|
|
145
|
+
`;continue;case"td_open":b+=`${k}<td>`;continue;case"td_close":b+=`</td>
|
|
146
|
+
`;continue;case"th_open":b+=`${k}<th>`;continue;case"th_close":b+=`</th>
|
|
147
|
+
`;continue}else if(I.length===1){const x=I[0];if(y==="ordered_list_open"&&x[0]==="start"){b+=`${k}<ol start="${Ln(x[1])}">
|
|
148
|
+
`;continue}if(y==="td_open"&&x[0]==="style"){b+=`${k}<td style="${Ln(x[1])}">`;continue}if(y==="th_open"&&x[0]==="style"){b+=`${k}<th style="${Ln(x[1])}">`;continue}}}b+=this.renderToken(e,v,o);continue}if(y==="code_block"&&A===Tn.code_block){b+=dv(m);continue}if(y==="fence"&&A===Tn.fence){b+=h_(m,o);continue}if(y==="html_block"&&A===Tn.html_block){b+=m.content;continue}const $=A(e,v,o,s,this);typeof $=="string"?b+=$:b+=Ch($,m.type)}return b}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await u_(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return $l(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
149
|
+
`:"",u=a?`>
|
|
150
|
+
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+$l(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const o=()=>(n||(n={...t}),n);if(Yf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Yf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Yf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Yf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...mV,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Tn.code_block)return dv(t);if(i==="html_block"&&s.html_block===Tn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):kp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Tn.fence)return h_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Ch(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,g=o.strong_close,b=t.xhtmlOut===!0,v=b?`<br />
|
|
151
|
+
`:`<br>
|
|
152
|
+
`,m=t.breaks?v:`
|
|
153
|
+
`;if(e.length===1)return Zf(e,t,n,this,o,v,m);let y="";for(let k=0;k<e.length;k++){const A=e[k];if(A.type==="link_open"&&!u&&!d&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="link_close"&&pV(x)){const L=`${d_(A)+Zf([x],t,n,this,o,v,m)}</a>`;if(r===Tn.softbreak&&k+3<e.length&&e[k+3].type==="softbreak"){y+=L+m,k+=3;continue}y+=L,k+=2;continue}}if(A.type==="link_open"&&!u&&!d&&k+1<e.length&&e[k+1].type==="link_close"){y+=`${d_(A)}</a>`,k+=1;continue}if(A.type==="em_open"&&!f&&!h&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="em_close"&&f_(x)){y+=`<em>${Zf([x],t,n,this,o,v,m)}</em>`,k+=2;continue}}if(A.type==="strong_open"&&!p&&!g&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="strong_close"&&f_(x)){y+=`<strong>${Zf([x],t,n,this,o,v,m)}</strong>`,k+=2;continue}}switch(A.type){case"text":if(s===Tn.text){const x=A.content.length===0?"":Ln(A.content);if(a===Tn.html_inline&&k+1<e.length&&e[k+1].type==="html_inline"){for(y+=x+e[++k].content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}y+=x;continue}break;case"text_special":if(i===Tn.text_special){A.content.length!==0&&(y+=Ln(A.content));continue}break;case"softbreak":if(r===Tn.softbreak){y+=m;continue}break;case"hardbreak":if(l===Tn.hardbreak){y+=v;continue}break;case"html_inline":if(a===Tn.html_inline){for(y+=A.content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}break;case"code_inline":if(c===Tn.code_inline){y+=yp(A);continue}break}const $=o[A.type];if(!$){y+=A.block?this.renderToken(e,k,t):kp(A,b);continue}const I=$(e,k,t,n,this);typeof I=="string"?y+=I:y+=Ch(I,A.type)}return y}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await u_(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
|
|
154
|
+
`;break}}return o}},vV=gV;const yV=[],C0=4096;function kV(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
|
|
155
|
+
`,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function bV(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function xV(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!$6(e[n],t[n]))return!1;return!0}function $6(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!bV(e.attrs,t.attrs)||!xV(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function p_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var wV=class{core;cache=null;stats=p_();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=p_(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(us(o??s?.env),!s||o&&o!==s.env){const N=o??{},D=!!n.__explicitStreamChunkFallbackSetting,B=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,U=!!n.options?.streamChunkedFallback,H=!D&&B,P=U||H,Z=n.options?.streamChunkAdaptive!==!1,K=n.options?.streamChunkTargetChunks??8,V=n.options?.streamChunkSizeChars,J=n.options?.streamChunkSizeLines,he=n.options?.streamChunkMaxChunks,ne=!!n.__explicitStreamChunkConfig,ue=n.options?.autoTuneChunks!==!1,de=n.options?.streamChunkFenceAware??!0,Ce=n.options?.streamLargeCachePolicy??"retain",Ie=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,le=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let z,ae=!1;if(Ce==="skip"&&(ae=e.length>=Ie,!ae&&le!==void 0&&(z=io(e),ae=z>=le)),ae){const q=this.parseFullDocument(e,N,n,z,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!_r(N)?.unbounded}),q.tokens}else if(P){const q=(me,Ae,$e)=>me<Ae?Ae:me>$e?$e:me;z===void 0&&(z=io(e));const ee=ue&&!ne?c_(e.length,z,n.options):null,ye=ee?.maxChunkChars??(Z?q(Math.ceil(e.length/K),8e3,64e3):V??1e4),fe=ee?.maxChunkLines??(Z?q(Math.ceil(z/K),150,700):J??200),ve=ee?.maxChunks??(Z?q(Math.ceil(e.length/64e3),K,32):he),j=e.length>0&&e.charCodeAt(e.length-1)===10,te=H&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ee?.strategy!=="plain";if((U||te)&&(e.length>=ye*2||z>=fe*2)&&j){const me=vp(n,e,N,{maxChunkChars:ye,maxChunkLines:fe,fenceAware:ee?.fenceAware??de,maxChunks:ve});return this.cache={src:e,tokens:me,env:N,lineCount:z,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,z),this.recordChunkedParseResult(N,U?"explicit-initial-large-doc":"default-initial-large-doc"),me}}const ie=this.parseFullDocument(e,N,n,z);return z=ie.lineCount,this.cache={src:e,tokens:ie.tokens,env:N,lineCount:z,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!_r(N)?.unbounded}),ie.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",yo(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=Ts(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ts(e),a=r||l;if(a){const N=o??s.env;zr(N);const D=Ts(e),B=this.parseFullDocument(e,N,n),U=B.tokens,H=B.lineCount;return this.cache={src:e,tokens:U,env:N,lineCount:H,lastSegment:void 0,globalStateReason:D},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!_r(N)?.unbounded}),U}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const N=o??s.env,D=this.parseFullDocument(e,N,n),B=D.tokens,U=D.lineCount;return this.cache={src:e,tokens:B,env:N,lineCount:U,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,U),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!_r(N)?.unbounded}),B}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const N=s.lineCount??io(s.src);let D=3;u.length>5e3?D=8:u.length>1e3?D=6:u.length>200&&(D=4),D=Math.min(D,N);let B=null;const U=n.options?.streamContextParseStrategy??"chars",H=n.options?.streamContextParseMinChars??200,P=n.options?.streamContextParseMinLines??2;let Z;const K=()=>(Z===void 0&&(Z=io(u)),Z),V=this.canDirectlyParseAppend(s),J=V&&this.shouldUseUnboundedAppend(e,s,u);let he=!1;if(!V)switch(U){case"lines":he=K()>=P;break;case"constructs":if(u.length>=H){he=!0;break}if(kV(u)){he=!0;break}he=K()>=P;break;case"chars":default:he=u.length>=H}if(D>0&&he){const de=this.getTailLines(s.src,D)+u;try{const Ce=this.core.parse(de,s.env,n).tokens,Ie=Ce.findIndex(le=>le.map&&typeof le.map[1]=="number"&&le.map[1]>D);if(Ie!==-1){const le=Ce.slice(Ie),z=N-D;z!==0&&this.shiftTokenLines(le,z),B={tokens:le}}}catch{B=null}}else B=null;if(!B){const de=N;if(J)B={tokens:sd(n,u,s.env,{mode:"stream"})},de>0&&this.shiftTokenLines(B.tokens,de);else{const Ce=this.core.parse(u,s.env,n);de>0&&this.shiftTokenLines(Ce.tokens,de),B=Ce}}let ne=0;if(s.tokens.length>0&&B.tokens.length>0){const de=s.tokens[s.tokens.length-1],Ce=B.tokens[0];try{de.type==="inline"&&Ce.type==="inline"&&(Ce.children&&Ce.children.length>0&&(de.children||(de.children=[]),this.appendTokens(de.children,Ce.children)),de.content=(de.content||"")+(Ce.content||""),ne=1)}catch{ne=0}}const ue=s.tokens.length;if(B.tokens.length>ne){const de=s.tokens,Ce=B.tokens,Ie=Math.min(de.length,Ce.length-ne);let le=0;for(let z=Ie;z>0;z--){let ae=!0;for(let ie=0;ie<z;ie++){const q=de[de.length-z+ie],ee=Ce[ne+ie];if(!$6(q,ee)){ae=!1;break}}if(ae){le=z;break}}le>0&&(ne+=le),Ce.length>ne&&this.appendTokens(s.tokens,Ce,ne)}if(s.src=e,s.globalStateReason=null,s.lineCount=N+(Z??K()),s.tokens.length>ue){const de=this.getLastSegment(s.tokens,e,ue,s.tokens.length,e.length-u.length,N);de?s.lastSegment=de:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,J&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",yo(s.env,{area:"stream",path:J?"stream-unbounded-append":"stream-append",reason:J?"large-delta":"safe-append",unbounded:J}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",yo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,v=g||b,m=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,$=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,x=n.options?.autoTuneChunks!==!1,L=n.options?.streamChunkFenceAware??!0;let E=u&&s.lineCount!==void 0?s.lineCount+io(u):void 0;if(v){E===void 0&&(E=io(e));const N=(K,V,J)=>K<V?V:K>J?J:K,D=x&&!I?c_(e.length,E,n.options):null,B=D?.maxChunkChars??(m?N(Math.ceil(e.length/y),8e3,64e3):k??1e4),U=D?.maxChunkLines??(m?N(Math.ceil(E/y),150,700):A??200),H=D?.maxChunks??(m?N(Math.ceil(e.length/64e3),y,32):$),P=e.length>0&&e.charCodeAt(e.length-1)===10,Z=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&D?.strategy!=="plain";if((g||Z)&&(e.length>=B*2||E>=U*2)&&P){const K=vp(n,e,d,{maxChunkChars:B,maxChunkLines:U,fenceAware:D?.fenceAware??L,maxChunks:H});return this.cache={src:e,tokens:K,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const F=this.parseFullDocument(e,d,n,E),S=F.tokens;return E=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!_r(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=_r(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",yo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!_r(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",yo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ts(e);Zd(t)&&zr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?T6(n,e.length,o):"no";if(r==="yes"){const a=sd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?io(e):0)}}let l=o;if(r==="need-lines"&&(l=io(e),E6(n,e.length,l))){const a=sd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?io(e):0),{tokens:Dc(t,i,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS?!0:io(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
156
|
+
`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
157
|
+
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+io(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
|
|
158
|
+
`,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??yV}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??io(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-C0))+t,o=Ts(n);return e.globalStateCarry=n.length>C0?n.slice(n.length-C0):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
|
|
159
|
+
`,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
|
|
160
|
+
`,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??io(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+io(i);t.lineCount=g;const b=this.getDocLineCount(e,g);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const g=s.lineEnd-2;g!==0&&this.shiftTokenLines(p,g);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,v=t.lineCount??io(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const m=v+io(i);t.lineCount=m;const y=this.getDocLineCount(e,m);if(r.map&&(r.map[1]=y),h.tbodyOpenIndex>=0){const k=t.tokens[h.tbodyOpenIndex];k?.map&&(k.map[1]=y)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
161
|
+
`);if(t<0)return null;const n=e.indexOf(`
|
|
162
|
+
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=s)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=io(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const m_={default:dV,zero:fV,commonmark:uV};function _V(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function SV(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function g_(e){return e.experimental?{...e,...e.experimental}:e}function ui(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function v_(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(ui(t,s)||ui(e,s))return!0}return!1}function y_(e,t,n){return ui(t,n)||ui(e,n)}function k_(e,t){const n=_r(e)?.chunk;if(n?.fallback){yo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}yo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function CV(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:"retain",streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=m_[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=g_(n),typeof n.quotes=="string"){const x=n.quotes;x.length>=4?n.quotes=[x[0],x[1],x[2],x[3]]:n.quotes=["“","”","‘","’"]}let r=v_(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=v_(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=y_(i?.options,s,"fullChunkedFallback"),c=y_(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new mj;let p=null;const g=()=>(p||(p=new vV(n)),p);let b=null;const v=()=>(b||(b=new wV(h)),b);let m=null;const y=()=>(m||(m=new QA),m),k=x=>!u&&!!d&&!SV(x,d),A=(x,L)=>o==="default"&&!u&&p===null&&f!==null&&x.parse===f&&k(x)&&!x.stream.enabled&&L<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.xhtmlOut===!1&&x.options.breaks===!1&&x.options.langPrefix==="language-"&&x.options.linkify===!1&&x.options.typographer===!1&&x.options.highlight===null,$=(x,L)=>o==="default"&&!u&&k(x)&&!x.stream.enabled&&!x.options.fullChunkedFallback&&L<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.linkify===!1&&x.options.typographer===!1,I={core:h,block:h.block,inline:h.inline,get linkify(){const x=y();return Object.defineProperty(this,"linkify",{value:x,writable:!0,configurable:!0}),x},get renderer(){const x=g();return Object.defineProperty(this,"renderer",{value:x,writable:!0,configurable:!0}),x},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(x){const L=g_(x);return this.options={...this.options,...L},(ui(x,"fullChunkSizeChars")||ui(x,"fullChunkSizeLines")||ui(x,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ui(x,"streamChunkSizeChars")||ui(x,"streamChunkSizeLines")||ui(x,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ui(x,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ui(x,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(L),typeof L.stream=="boolean"&&(this.stream.enabled=L.stream,b&&(b.reset(),b.resetStats())),this},configure(x){const L=typeof x=="string"?m_[x]:x;if(!L)throw new Error("Wrong `markdown-it` preset, can't be empty");if(L.options&&this.set(L.options),L.components){const E=L.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(x,L){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const N of F){if(!N)continue;const D=N.enable(E,!0);for(let B=0;B<D.length;B++)S.add(D[B])}if(!L){const N=E.filter(D=>!S.has(D));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},disable(x,L){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const N of F){if(!N)continue;const D=N.disable(E,!0);for(let B=0;B<D.length;B++)S.add(D[B])}if(!L){const N=E.filter(D=>!S.has(D));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},use(x,...L){const E=typeof x=="function"?x:x&&typeof x.default=="function"?x.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...L],S=x;return u=!0,E.apply(S,F),this},render(x,L){if(A(this,x.length)){L!==void 0&&us(L);const S=r_(x);if(S!==null)return L!==void 0&&yo(L,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=L??{},F=this.parse(x,E);return g().render(F,this.options,E)},async renderAsync(x,L){if(A(this,x.length)){L!==void 0&&us(L);const S=r_(x);if(S!==null)return L!==void 0&&yo(L,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=L??{},F=this.parse(x,E);return g().renderAsync(F,this.options,E)},renderIterable(x,L={}){const E=this.parseIterable(x,L);return g().render(E,this.options,L)},async renderAsyncIterable(x,L={}){const E=await this.parseAsyncIterable(x,L);return g().renderAsync(E,this.options,L)},renderInline(x,L={}){const E=this.parseInline(x,L);return g().render(E,this.options,L)},validateLink:m6,normalizeLink:g6,normalizeLinkText:v6,utils:Oz,helpers:{..._U},parse(x,L){if(typeof x!="string")throw new TypeError("Input data should be a String");if(L!==void 0&&us(L),$(this,x.length)){const N=Mj(x);if(N!==null)return L!==void 0&&yo(L,{area:"parse",path:"stock-fast",reason:"stock-subset"}),N}const E=L??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const N=T6(this,x.length);if(N==="yes"){const D=sd(this,x,E);return yo(L,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),D}N==="need-lines"&&(F=io(x))}if(!this.stream.enabled){const N=x.length,D=this.options.autoTuneChunks!==!1,B=r,U=!a&&k(this),H=!!this.options.fullChunkedFallback,P=U&&N>=2e5;let Z;(H||P||F!==void 0)&&(Z=F??io(x));const K=(H||P)&&D&&!B?cV(N,Z,this.options):null;if(H||P){const V=Z??0;if(H?N>=(this.options.fullChunkThresholdChars??2e4)||V>=(this.options.fullChunkThresholdLines??400):P){if(K&&K.strategy!=="plain"){const J=vp(this,x,E,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return L&&k_(L,H?"explicit-full-chunk":"default-large-string"),J}if(H){const J=(ae,ie,q)=>ae<ie?ie:ae>q?q:ae,he=this.options.fullChunkAdaptive!==!1,ne=this.options.fullChunkTargetChunks??8,ue=J(Math.ceil(N/ne),8e3,64e3),de=J(Math.ceil(V/ne),150,700),Ce=he?ue:this.options.fullChunkSizeChars??1e4,Ie=he?de:this.options.fullChunkSizeLines??200,le=he?J(Math.ceil(N/64e3),ne,32):this.options.fullChunkMaxChunks,z=vp(this,x,E,{maxChunkChars:Ce,maxChunkLines:Ie,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:le});return L&&k_(L,"explicit-full-chunk"),z}}}if(F!==void 0&&k(this)&&E6(this,N,Z??F)){const V=sd(this,x,E);return yo(L,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const S=Ts(x);return yo(L,{area:"parse",path:"plain",reason:"default-plain"}),Dc(E,S,()=>h.parse(x,E,this).tokens)},parseIterable(x,L={}){return us(L),iV(this,x,L)},parseAsyncIterable(x,L={}){return us(L),rV(this,x,L)},parseIterableToSink(x,L,E={}){return us(E),lV(this,x,L,E)},parseAsyncIterableToSink(x,L,E={}){return us(E),aV(this,x,L,E)},parseInline(x,L={}){if(typeof x!="string")throw new TypeError("Input data should be a String");us(L),Zd(L)&&zr(L);const E=h.createState(x,L,this);return E.inlineMode=!0,h.process(E),E.tokens}};if(I.stream={enabled:!!n.stream,parse(x,L){return I.stream.enabled?v().parse(x,L,I):I.parse(x,L??{})},reset(){v().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const x=i.components;x.core?.rules&&I.core.ruler.enableOnly(x.core.rules),x.block?.rules&&I.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&I.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&I.inline.ruler2.enableOnly(x.inline2.rules)}return d=_V(I),f=I.parse,I}var AV=CV;const F6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],MV=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],O6=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],EV=["svg","g","path"],TV=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],NV=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],IV=["action","data","href","src","srcset","poster","xlink:href","formaction"],LV=["script"],$V=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Pa=new Set(F6),FV=new Set(O6),Od=new Set([...F6,...MV,...O6,...EV]),R6=new Set([...Od,...TV]),OV=new Set(NV),RV=new Set(IV),Xd=new Set(LV),B6=new Set($V);function D6(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const BV={amp:"&",bsol:"\\",colon:":",newline:`
|
|
163
|
+
`,sol:"/",tab:" "};function P6(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return BV[String(s??"").toLowerCase()]??t})}const Qf=new Set(["http","https","mailto","tel"]),DV=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),sa=new Set(["http","https"]);function H6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function PV(e,t,n){if(!ld(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function ld(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function HV(e,t){return t==="href"||t==="xlink:href"?ld(e,t)?Qf:sa:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?sa:(ld(e,t),Qf)}function Ca(e,t={}){const n=D6(P6(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=H6(n);return i?i==="file"?!PV(n,o,s):ld(o,s)?DV.has(i):!HV(o,s).has(i):!1}function WV(e){const t=P6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=H6(D6(t).toLowerCase());return n==="http"||n==="https"}function zV(e,t={}){const n=String(e??"").trim();return n?Ca(n,t)?"":n:""}function b_(e){return zV(e,{tagName:"img",attrName:"src"})}function UV(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,g,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,g,b)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,g){let b,v=!1,m=f.bMarks[h]+f.tShift[h],y=f.eMarks[h];if(l!==f.src.charCodeAt(m))return!1;for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);const k=Math.floor((b-m)/a);if(k<i)return!1;b-=(b-m)%a;const A=f.src.slice(m,b),$=f.src.slice(b,y);if(!c($,A))return!1;if(g)return!0;let I=h;for(;I++,!(I>=p||(m=f.bMarks[I]+f.tShift[I],y=f.eMarks[I],m<y&&f.sCount[I]<f.blkIndent));)if(l===f.src.charCodeAt(m)&&!(f.sCount[I]-f.blkIndent>=4)){for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);if(!(Math.floor((b-m)/a)<k)&&(b-=(b-m)%a,b=f.skipSpaces(b),!(b<y))){v=!0;break}}const x=f.parentType,L=f.lineMax;f.parentType="container",f.lineMax=I;const E=f.push("container_"+t+"_open","div",1);E.markup=A,E.block=!0,E.info=$,E.map=[h,I],f.md.block.tokenize(f,h+1,I);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(m,b),F.block=!0,f.parentType=x,f.lineMax=L,f.line=I+(v?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function qV(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let b=0;b<a.length;b++){const v=a[b];if(v==="\\"){b++;continue}if(!u&&v==="'"){c=!c;continue}if(!c&&v==='"'){u=!u;continue}if(!c&&!u&&v===":"){d=b;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let g;if(!h)g="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{g=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=h}else/^-?\d+(?:\.\d+)?$/.test(h)?g=Number(h):h==="true"||h==="false"?g=h==="true":h==="null"?g=null:g=h;l[p]=g}return l}function jV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(UV,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
164
|
+
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),g=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,g?.startsWith("{")){let A=0,$=-1;for(let I=0;I<g.length;I++)if(g[I]==="{"?A++:g[I]==="}"&&A--,A===0){$=I+1;break}$>0&&(h=g.slice(0,$))}h||(f=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let v=n+1,m=!1;for(;v<=o;){const A=i.bMarks[v]+i.tShift[v],$=i.eMarks[v];if(i.src.slice(A,$).trim()===":::"){m=!0;break}v++}m||(v=o);const y=i.push("vmr_container_open","div",1);if(y.attrSet("class",`vmr-container vmr-container-${u}`),y.meta={...y.meta??{},unclosed:!m&&!b},f&&y.attrSet("data-args",f),h)try{const A=JSON.parse(h);for(const[$,I]of Object.entries(A)){const x=I!=null&&typeof I=="object";y.attrSet(`data-${$}`,x?JSON.stringify(I):String(I))}}catch{const A=qV(h);if(A)for(const[$,I]of Object.entries(A)){const x=I!=null&&typeof I=="object";y.attrSet(`data-${$}`,x?JSON.stringify(I):String(I))}else y.attrSet("data-attrs",h)}const k=[];for(let A=n+1;A<v;A++){const $=i.bMarks[A]+i.tShift[A],I=i.eMarks[A];k.push(i.src.slice($,I))}if(k.some(A=>A.trim().length>0)){let A=k.join(`
|
|
165
|
+
`);A.endsWith(`
|
|
166
|
+
`)||(A+=`
|
|
167
|
+
`),A.endsWith(`
|
|
168
|
+
|
|
169
|
+
`)||(A+=`
|
|
170
|
+
`);const $=i.tokens[i.tokens.length-1];$&&($.raw=A);const I=[];i.md.block.parse(A,i.md,i.env,I),i.tokens.push(...I)}return m&&i.push("vmr_container_close","div",-1),i.line=m?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function Im(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const VV=/^[a-z][a-z0-9_-]*$/;function x_(e){return VV.test(String(e??"").trim().toLowerCase())}function _i(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return x_(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":x_(s)?s:""}function au(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=_i(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function KV(...e){const t=new Set,n=[];for(const o of e)for(const s of au(o))t.has(s)||(t.add(s),n.push(s));return n}function GV(e){const t=au(e);return{key:t.join(","),tags:t}}function W6(e){return _i(e)}function YV(e,t){const n=String(e??""),o=_i(t);if(!o)return!1;const s=Gs(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function z6(e,t){const n=_i(t);return!!n&&!Od.has(n)&&!YV(e,n)}function ZV(e,t){const n=String(e??""),o=_i(t);if(!o)return n;const s=Gs(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const U6=Pa,QV=Od,q6=new Set(FV);q6.delete("details");const XV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,JV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,fv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,eK=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function bp(e){return(e.match(fv)?.[1]??"").toLowerCase()}function ik(e){return/^\s*<\s*\//.test(e)}function rk(e,t){return U6.has(t)||/\/\s*>\s*$/.test(e)}function tK(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=bp(i);if(r===t){if(ik(i)){if(n===0)return o;n--;continue}rk(i,r)||n++}}return-1}function nK(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=bp(s);if(i===t){if(ik(s)){n>0&&n--;continue}rk(s,i)||n++}}return n}function w_(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Gs(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function oK(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Gs(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function xp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function sK(e){const t=e;return t.meta||(t.meta={}),t.meta}function A0(e,t,n){const o=sK(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function iK(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Gs(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
|
|
171
|
+
`),s=!1)},a=h=>{r(h)},c=h=>{for(let g=0;g<o.length;g++)o[g].raw+=h,g<o.length-1&&(o[g].inner+=h);const p=o.pop();A0(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Gs(p)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!u(h),f=(h,p,g)=>{const b=g??(h.type==="html_inline"?bp(p):"");if(!(b&&t.has(b))){r(p);return}const v=ik(p),m=!v&&rk(p,b);if(v){if(!o.length||o[o.length-1].tag!==b){r(p);return}c(p);return}if(r(p),m){A0(h,p,"");return}o.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let g=0,b=!0;for(const v of h.children){const m=xp(v),y=v.type==="html_inline"?bp(m):"",k=y&&t.has(y);let A=m;if(b&&p&&m&&(o.length||k)){const $=p.indexOf(m,g);if($!==-1)a(p.slice(g,$)),A=p.slice($,$+m.length),g=$+m.length;else{if(o.length&&!k)continue;b=!1}}f(v,A,y)}b&&p&&g<p.length&&o.length&&a(p.slice(g)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=xp(h),g=h.type==="html_block"?u(p):null;if(g){c(`${s?`
|
|
172
|
+
`:""}${g}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)A0(h.token,h.raw,h.inner)}function rK(e){return/^\s*<\s*[!?]/.test(e)}function lK(e){const t=new Set(QV);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function __(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function aK(e,t){let n=null;for(const i of e.matchAll(XV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();__(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(JV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();__(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function cK(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function uK(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(cK(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(fv);if(!h){i("<",c),u=d+1;continue}const p=Jn(f);if(p===-1){i("<",c),u=d+1;continue}const g=f.slice(0,p+1),b=(h[1]??"").toLowerCase();t.has(b)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=aK(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=xp(a),s=o.buffer;const c=Jn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=xp(a),u=(c.match(fv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Jn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const dK=["a","span","strong","em","b","i","u"];function fK(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=_i(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const y of g){const k=_i(String(y??""));k&&p.add(k)}const b=lK(Array.from(p)),v=new Set(dK);for(const y of p)v.add(y);return{autoCloseInlineTagSet:v,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:y=>p.has(y)||!b.has(y)||q6.has(y)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const g=p.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const b={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:g}=o(f);for(const b of h){const v=b;if(v.type!=="inline"||!Array.isArray(v.children))continue;const m=String(v.content??""),y=v.children.length?v.children:m.includes("<")?[{type:"text",content:m,raw:m}]:null;if(y)try{const k=uK(y,p);if(v.children=k.children,k.pendingBuffer){const A=m.lastIndexOf(k.pendingBuffer);if(A!==-1){const $=m.slice(0,A);v.content=$,typeof v.raw=="string"&&(v.raw=$)}}}catch(k){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",k)}}iK(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:g,shouldMergeHtmlBlockTag:b}=o(f),v=[];for(let m=0;m<h.length;m++){const y=h[m];if(v.length>0){const[A,$]=v[v.length-1];if(m!==$){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const I=String(y.content??y.raw??"");if(I){const x=h[$],L=`${String(x.content||"")}
|
|
173
|
+
${I}`,E=Jn(L),F=E===-1?null:w_(L,A,E+1);if(F){const S=L.slice(0,F.end),N=L.slice(F.end);x.content=S,x.loading=!1,h.splice(m,1),v.pop();const D=d(x,N)?[]:c(N,u(h,m,"paragraph"));D.length&&h.splice(m,0,...D),m--;continue}x.content=L,x.loading!==!1&&(x.loading=!0)}h.splice(m,1),m--;continue}}const k=s(y);if(k){if(rK(k))continue;const A=(k.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(k);if(!A||!b(A))continue;if(i(y,k),!$)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(k)&&oK(k,A)>0&&v.push([A,m]);else if(v.length>0&&A&&v[v.length-1][0]===A){const[,I]=v[v.length-1],x=h[I];x.content=`${String(x.content||"")}
|
|
174
|
+
${k}`,x.loading=!1,v.pop(),h.splice(m,1),m--}continue}else if(v.length>0){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const A=y.content||"",$=new RegExp(`<\\s*\\/\\s*${v[v.length-1][0]}\\s*>`,"i").test(A);if(A){const[,I]=v[v.length-1],x=h[I];x.content=`${x.content||""}
|
|
175
|
+
${A}`,x.loading!==!1&&(x.loading=!$)}$&&v.pop(),h.splice(m,1),m--}else continue}if(g.size>0){const m=new Map,y=new Map,k=I=>{let x=m.get(I);return x||(x=new RegExp(`<\\s*${I}\\b`,"i"),m.set(I,x)),x},A=I=>{let x=y.get(I);return x||(x=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),y.set(I,x)),x},$=[];for(let I=0;I<h.length;I++){const x=h[I],L=String(x.content??"");if($.length>0){const F=$[$.length-1],S=h[F.index],N=x.type==="html_block"?A(F.tag).exec(L):null;if(N){const U=N.index+N[0].length,H=L.slice(0,U),P=L.slice(U);S.content=`${String(S.content??"")}
|
|
176
|
+
${H}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),$.pop();const Z=d(S,P)?[]:c(P,u(h,I,"paragraph"));Z.length?h.splice(I,1,...Z):(h.splice(I,1),I--);continue}if(x.type!=="inline")continue;const D=Array.isArray(x.children)?x.children:[],B=tK(D,F.tag);if(B!==-1){const U=D.slice(0,B+1),H=D.slice(B+1),P=U.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
177
|
+
${P}`,Array.isArray(S.children)&&S.children.push(...U),H.length){const Z=H.map(K=>String(K.content??K.raw??"")).join("");if(Z.trim()){const K=Z.replace(/^\s+/,"");if(d(S,Z))h.splice(I,1),I--;else if(K.startsWith("<"))h.splice(I,1,{type:"html_block",content:K});else{const V=c(Z,u(h,I,"paragraph"));h.splice(I,1,...V)}}else h.splice(I,1),I--}else h.splice(I,1),I--;$.pop();continue}S.content=`${String(S.content??"")}
|
|
178
|
+
${L}`,Array.isArray(S.children)&&S.children.push(...D),h.splice(I,1),I--;continue}if(x.type!=="inline")continue;const E=Array.isArray(x.children)?x.children:[];for(const F of g)if((E.length?nK(E,F):k(F).test(L)&&!A(F).test(L)?1:0)>0){$.push({tag:F,index:I});break}}}{let m=0;for(let y=0;y<h.length;y++){const k=h[y];if(k.type==="paragraph_open"){m++;continue}k.type==="paragraph_close"&&(m>0?m--:(h.splice(y,1),y--))}}for(let m=0;m<h.length;m++){const y=h[m];if(y.type==="html_block"){const x=(y.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(x.startsWith("!")||x.startsWith("?")){y.loading=!1;continue}if(g.has(x)){const B=String(y.content??""),U=Jn(B),H=U===-1?null:w_(B,x,U+1);y.loading=H?!1:y.loading!==void 0?y.loading:!0;const P=H?.start??-1,Z=H?H.end-H.start:0;if(P!==-1){const K=B.slice(0,P+Z);let V="";U!==-1&&U<P&&(V=B.slice(U+1,P)),y.children=[{type:x,content:V,raw:K,attrs:[],tag:x,loading:!1}],y.content=K,y.raw=K;const J=c(B.slice(P+Z)||"","text");J.length&&h.splice(m+1,0,...J)}else y.children=[{type:x,content:"",raw:B,attrs:[],tag:x,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(x))continue;y.type="inline";const L=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let E;for(;(E=L.exec(y.content||""))!==null;)E[1],E[2]||E[3]||E[4];const F=String(y.content??""),S=new RegExp(`<\\/\\s*${x}\\s*>`,"i").exec(F),N=S?S.index:-1,D=S?S[0].length:0;if(N!==-1){const B=F.slice(0,N+D),U=(F.slice(N+D)||"").replace(/^\s+/,"");y.children=[{type:"html_block",content:B,tag:x,loading:!1}],y.content=B,y.raw=B,U&&h.splice(m+1,0,U.startsWith("<")?{type:"html_block",content:U}:{type:"text",content:U,raw:U})}else y.children=[{type:"html_block",content:y.content,tag:x,loading:!0}];continue}if(!y||y.type!=="inline")continue;if(y.children.length===2&&y.children[0].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),L=y.children[1],E=String(L?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(L?.type==="html_inline"&&E===x)continue;p.has(x)?(y.children[0].loading=!0,y.children[0].tag=x,y.children.push({type:"html_inline",tag:x,loading:!0,content:`</${x}>`})):y.children=[{type:"html_block",loading:!0,tag:x,content:String(y.children[0]?.content??"")+String(y.children[1]?.content??"")}];continue}else if(y.children.length===3&&y.children[0].type==="html_inline"&&y.children[2].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(x))continue;y.children=[{type:"html_block",loading:!1,tag:x,content:y.children.map(L=>L.content).join("")}];continue}if(!y.content?.startsWith("<")||y.children?.length!==1)continue;const k=String(y.content),A=y,$=A.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(k)&&(A.children.length=0);continue}const I=String($.content??k).match(eK)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(k)||U6.has(I)){A.children=[{type:"html_inline",content:k}];continue}A.children.length=0}}})}function hK(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function pK(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!hK(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const j6=/\.([a-z0-9]{1,15})$/i,mK=/[_()[\]{}<>]/u,gK=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,vK=/[?#@]/u,yK=/[\\/]/u,kK=/^[\p{L}\p{N}./\\-]+$/u,bK=/^[A-Za-z0-9-]{1,63}$/u,xK=/^xn--[a-z0-9-]{2,59}$/i,wK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,_K=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,SK=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,CK=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,AK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,MK=new Set(["ai","md","py","rs","sh","zip"]),V6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),EK=new Set([...V6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),TK=new Set(["com","dev","io","page","site"]),NK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),IK=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Rd(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function M0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Rd(n)?n:void 0}function S_(e,t){if(!Rd(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function C_(e){const t=Jd(e);return Rd(t)?t:void 0}function LK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function A_(e,t){if(!Rd(t))return;const n=String(e??"").trim().split(/\s+/u).map(LK).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>wp(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>wp(s,{marketTicker:!0}))&&(o.marketTicker=!0),Rd(o)?o:void 0}function Hl(e,t=!1){let n;return{options(o){return t||o==null?S_(e,n):S_(e,M0(C_(o),A_(o,n)))},remember(o){const s=C_(o);n=t?M0(n,s):M0(s,A_(o,n))},reset(){n=void 0}}}function M_(e){return bK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function $K(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return M_(n)||xK.test(n)?t.every(M_):!1}function K6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function FK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function OK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function G6(e,t,n){const o=FK(t);return K6(e)&&OK(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function Jd(e){const t=String(e??"");return{explicitFilename:SK.test(t),filename:CK.test(t),marketTicker:AK.test(t)}}function RK(e){return $K(e.split(/[\\/]/)[0]??"")}function BK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function DK(e){if(mK.test(e)||!kK.test(e))return!0;if(yK.test(e))return!RK(e);const t=e.replace(j6,"");return K6(t)?!0:t.split(".").filter(Boolean).some(BK)}function PK(e,t,n){if(!(n?EK:V6).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?_K:wK).test(o)}function wp(e,t={}){if(!e||gK.test(e)||vK.test(e))return!1;const n=e.match(j6);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return PK(e,o,t.marketTicker===!0)?!0:IK.has(o)?!MK.has(o)||t.filename?!0:DK(e):!!(t.explicitFilename&&TK.has(o)||t.filename&&NK.has(o))}const E_=["!"];function Ms(e){return{type:"text",content:e,raw:e}}function ia(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function ra(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function il(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function HK(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Ms(t))}}function T_(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function WK(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function zK(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function UK(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function qK(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=jK(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function jK(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Jd(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=UK(e,o,i),l=WK(s);if(s.markup==="linkify"&&r&&!G6(r,l,t)&&wp(r,n)){e.splice(o,i-o+1,Ms(r));continue}const a=T_(l,E_);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=T_(u.content,E_);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let v=c+1;v<i;v++){const m=e[v];m?.type==="text"&&typeof m.content=="string"&&(p+=m.content)}u.content=h,u.raw=h;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const v=encodeURI(p);if(v&&l.endsWith(v))b=l.slice(0,l.length-v.length);else{const m=f?encodeURI(f):"",y=m?l.indexOf(m):-1;y!==-1&&(b=l.slice(0,y))}}b!==l&&zK(s,b),p&&e.splice(i+1,0,Ms(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Ms(r));const c=i[1],u=l[1].length;ia(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(il(c,d,!e[o+4]?.content?.startsWith(")"))),ra(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Ms(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Ms(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),ia(a,f),a.push(il(c,h,!e[o+4]?.content?.startsWith(")"))),ra(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(Ms(p)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(il(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Ms(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(il(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Ms(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;ia(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;p<e.length;p++){const g=d?d[1].length:e[o-3].markup.length,b=e[p];if(g===1&&b.type==="em_close")break;if(g===2&&b.type==="strong_close")break;if(g===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;ra(f,p)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Ms(l)),ia(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(il(a,c,u)),ra(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Ms(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(Ms(r)),ia(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(il(l,a,c)),ra(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Ms(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(Ms(r)),ia(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(il(a,c,d)),ra(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];ia(a,2),a.push(il(r,l,!1)),ra(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;HK(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function VK(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=KK(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function KK(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function GK(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=YK(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function YK(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="__"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="_"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=ZK(l),l}function ZK(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=QK(e,n+6);if(u){t.push(o),t.push(s),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(o)}return t}function QK(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function XK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=sG(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function N_(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function I_(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function L_(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function Y6(e,t){if(!e.startsWith("|")||e.includes(`
|
|
179
|
+
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function E0(e){return Y6(e)!==null}function Z6(e){return/^:?-+:?$/.test(e.trim())}function JK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(Z6)}function eG(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function tG(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(Z6)&&eG(n)}function nG(e){return e==="|"||e==="|:"}function oG(e){const t=Y6(e);return t!==null&&t.every(n=>!n.includes(":"))}function sG(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
180
|
+
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
181
|
+
`),d=!t&&!r.includes(`
|
|
182
|
+
`)&&/\r?\n$/.test(n)&&E0(r);if(!t&&(r.includes(`
|
|
183
|
+
`)&&u.length===0&&E0(a)&&tG(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>L_(p)),h=[...N_(),...f,...I_()];o.splice(s-1,3,...h)}else if(r.includes(`
|
|
184
|
+
`)&&u.length===0&&E0(a)&&JK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>L_(p)),h=[...N_(),...f,...I_()];o.splice(s-1,3,...h)}else r.includes(`
|
|
185
|
+
`)&&u.length===0&&oG(a)&&nG(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function iG(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a<s;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var rG=iG;const lG=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],_p=lG.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),aG=/\\[a-z]+/i,Q6="(?:\\\\|\\u0008)",cG=new RegExp(String.raw`${Q6}(?:${_p})\s*\{[^}]+\}`,"i"),uG=new RegExp(String.raw`(?:${Q6})?(?:${_p})\s*\{`,"i"),dG=/\\(?:text|frac|left|right|times)/,fG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,hG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,pG=/[A-Z]+\s*\([^)]+\)/i,mG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,gG=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,vG=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,yG={"\b":"\\b","\v":"\\v","\f":"\\f"};function kG(e){let t="";for(const n of e)t+=yG[n]??n;return t}function Cc(e){if(!e)return!1;const t=kG(e),n=t.trim();if(vG.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=aG.test(t),s=cG.test(t),i=uG.test(t),r=dG.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=fG.test(t)&&!hG.test(t),c=pG.test(t),u=mG.test(n),d=gG.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const X6="__markstreamMathPluginApplied",hv=80,J6=2e4,$_=J6+4096;function eM(e){return!!e[X6]}function bG(e){e[X6]=!0}const tM=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],xG=["cdot","mathbf{","partial","mu_{"],nM=tM.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),oM="[ \r\b\f\v]",wG=new RegExp(`([^\\\\])(${xG.map(e=>e).join("|")})+`,"g"),_G=/span\{([^}]+)\}/,SG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,CG=/(^|[^\\])\\\r?\n/g,AG=/(^|[^\\])\\$/g,MG=new RegExp(`(${oM})|(${nM})\\b`,"g"),F_=new Map,O_=new Map;function EG(e){if(!e)return MG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=F_.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${oM})|(${s})\\b`,"g");return F_.set(n,i),i}function TG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=O_.get(o);if(s)return s;const i=e?[_p,nM].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),_p].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return O_.set(o,r),r}const R_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function B_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function D_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function rl(e,t){const n=t?.commands??tM,o=t?.escapeExclamation??!0,s=t?.commands==null,i=EG(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&R_[u]!==void 0)return`\\${R_[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=TG(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(_G,"span\\{$1\\}").replace(SG,"\\operatorname{span}\\{$1\\}"),l=l.replace(CG,`$1\\\\
|
|
186
|
+
`),l=l.replace(AG,"$1\\\\"),l=l.replace(wG,"$1\\$2"),l}function P_(e){const t=e.trim();return!(!Cc(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function sM(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Sp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function NG(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function ef(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function pv(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(ef(e,o)){n=o+1;continue}return o}return-1}function T0(e,t){let n=t;for(;n<e.length;){const o=pv(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function Ku(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!ef(e,s))return s;o=s+Math.max(1,t.length)}return-1}function H_(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Sp(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}ef(e,a)||i++,r=a+Math.max(1,t.length)}return i}function lk(e,t,n){const o=Dd(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Dd(o.slice(0,s)).trim()||ef(o,s))return-1;const i=sM(o);if(Sp(i,s))return-1;const r=H_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>H_(o,n,0,s,i))return-1;return s}function Bd(e){return e===" "||e===" "}function Dd(e){let t=e.length;for(;t>0&&Bd(e[t-1]);)t--;return e.slice(0,t)}function W_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
187
|
+
`&&t++;return t}function z_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function IG(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!Bd(s))return!1}return n>=3}function LG(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function $G(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(LG)}function FG(e){let t=0;if(!z_(e[t]))return!1;for(;z_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Bd(e[t+1])}function iM(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Bd(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Bd(t[1])||FG(t)||IG(t)||$G(t))}function U_(e,t){return e?t?`${e}
|
|
188
|
+
${t}`:e:t}function mv(e){const t=String(e??"").trim();return t?Cc(t):!1}function q_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function rM(e){if(e.length<=$_)return{source:e,lineOffset:0};let t=e.length-$_;const n=e.indexOf(`
|
|
189
|
+
`,t);return n===-1?{source:"",lineOffset:W_(e)}:(t=n+1,{source:e.slice(t),lineOffset:W_(e.slice(0,t))})}function lM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=rM(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-hv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Dd(o[r]);if(l&&!iM(l)){for(const[a,c]of i)if(lk(l,a,c)!==-1)return!0}}return!1}function OG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=rM(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-hv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Dd(s[l]);for(const[c,u]of r){const d=lk(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>hv){h=!0;break}const g=s[p],b=Ku(g,u);if(b!==-1){const v=U_(f,g.slice(0,b));if(!mv(v)){h=!0;break}const m=g.slice(b+u.length),y=m.trim()?`suffix:${q_(m)}`:"nosuffix";return["closed",c,o+l,d,o+p,b,q_(v),y].join(":")}if(iM(g)){h=!0;break}if(f=U_(f,g),f.length>J6){h=!0;break}}if(!h&&mv(f))return["pending",c,o+l,d].join(":")}}return null}function N0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function RG(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function I0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function BG(e,t){bG(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(m,y)=>{let k=y;for(;k<m.length&&(m[k]===" "||m[k]===" ");)k++;if(k===y||!(m[k]===`
|
|
190
|
+
`||m[k]==="\r"&&m[k+1]===`
|
|
191
|
+
`))return y;const A=m.slice(y,k),$=a.push("text","",0);return $.content=A,k};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let m=a.pos+1;for(;a.src[m]==="$";)m++;const y=m-a.pos,k=a.src[m];if(y>=3&&(!k||/\s/.test(k))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,m),a.pos=m,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let g=p,b=p;const v=p;for(const[m,y]of f){const k=a.src,A=sM(k),$=NG(k,u);let I=!1;m==="$$"&&g!==v&&(g=v);let x=-1,L=-1,E=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,g=a.pos;return}if(S==="\\)"||S==="\\("){const B=a.push("text_special","",0);B.content=S==="\\)"?")":"(",B.markup=S,a.pos=a.pos+S.length,g=a.pos;return}if(!S)return;if(m==="$$"&&S.includes("$")){let B=0;for(;B<S.length;){const U=pv(S,B);if(U===-1){const de=S.slice(B);if(de){const Ce=a.push("text","",0);Ce.content=de,a.pos=a.pos+de.length,g=a.pos}break}if(U>0&&S[U-1]==="$"||U+1<S.length&&S[U+1]==="$"){const de=S.slice(B,U+1);if(de){const Ce=a.push("text","",0);Ce.content=de,a.pos=a.pos+de.length,g=a.pos}B=U+1;continue}const H=S.slice(B,U);if(H){const de=a.push("text","",0);de.content=H,a.pos=a.pos+H.length,g=a.pos}const P=T0(S,U+1);if(P===-1){const de=S.slice(U),Ce=a.push("text","",0);Ce.content=de,a.pos=a.pos+de.length,g=a.pos;break}const Z=S.slice(U+1,P),K=Z.includes("`"),V=!Z||!Z.trim(),J=S[P+1],he=N0(Z,J),ne=I0(Z);if(!K&&!V&&!he&&!ne){const de=a.push("math_inline","math",0);de.content=rl(Z,t),de.markup="$",de.raw=`$${Z}$`,de.loading=!1,a.pos=a.pos+(P-U+1),g=a.pos,B=P+1;continue}const ue=a.push("text","",0);ue.content="$",a.pos=a.pos+1,g=a.pos,B=U+1}return}const N=S.indexOf("![");if(N!==-1){if(N>0){const H=S.slice(0,N),P=a.push("text","",0);P.content=H,a.pos=a.pos+H.length,g=a.pos}const B=S.slice(N).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,H,P]=B,Z=P.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=Z?Z[1]:P,V=Z&&Z[2]?Z[2]:null,J=a.push("image","img",0);J.attrs=[["src",K],["alt",H]],V&&J.attrs.push(["title",V]),J.content=H,J.children=[{type:"text",content:H,tag:""}],a.pos=a.pos+B[0].length,g=a.pos;const he=S.slice(N+B[0].length);he&&F(he);return}const U=a.push("text","",0);U.content=S,a.pos=a.pos+S.length,g=a.pos;return}const D=a.push("text","",0);D.content=S,a.pos=a.pos+S.length,g=a.pos};for(;!(g>=k.length);){const S=k.indexOf(m,g);if(S===-1)break;if(ef(k,S)){g=S+Math.max(1,m.length);continue}const N=Sp(A,S);if(N){g=N[1];continue}const D=Sp($,S);if(D){g=D[1];continue}if(S===x&&g===L){if(E++,E>2){g=S+Math.max(1,m.length);continue}}else E=0,x=S,L=g;if(m==="("&&S>0){let he=S-1;for(;he>=0&&k[he]===" ";)he--;if(he>=0&&k[he]==="]"){g=S+m.length;continue}}if(m==="$"&&S>0&&k[S-1]==="$"){g=S+1;continue}if(m==="$"&&S<k.length-1&&k[S+1]==="$"){g=S+2;continue}const B=m==="$"?T0(k,S+m.length):rG(k,S+m.length,m,y);if(B===-1){const he=k.slice(S+m.length);if(he.includes(m)){g=k.indexOf(m,S+m.length);continue}if(B===-1){const ne=m==="$"&&RG(he);if(u&&!c&&!ne&&Cc(he)&&!he.includes("`")){if(g=S+m.length,I=!0,!l){a.pending="";const ue=b?k.slice(b,g):k.slice(0,g),de=B_(ue)%2===1;if(b)F(k.slice(b,g));else{let Ce=k.slice(0,g);Ce.endsWith(m)&&(Ce=Ce.slice(0,Ce.length-m.length)),F(Ce)}if(de){const Ce=D_(ue)?.marker??"**",Ie=a.push("strong_open","",0);Ie.markup=Ce;const le=a.push("math_inline","math",0);le.content=rl(he,t),le.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",le.raw=`${m}${he}${y}`,le.loading=!0,Ie.content=he,a.push("strong_close","",0)}else{const Ce=a.push("math_inline","math",0);Ce.content=rl(he,t),Ce.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Ce.raw=`${m}${he}${y}`,Ce.loading=!0}a.pos=k.length}g=k.length,b=g}break}}const U=k.slice(S+m.length,B),H=U.includes("`"),P=!U||!U.trim(),Z=m==="$",K=k[B+y.length],V=Z&&N0(U,K),J=Z&&I0(U);if(c?H||P||V||J:H||P||V||J||!Z&&!Cc(U)){g=B+y.length;const he=k.slice(a.pos,g);a.pending||(F(he),b=g);continue}if(I=!0,!l){const he=k.slice(a.pos-(a.pending??"").length,S);let ne=k.slice(0,g)?k.slice(b,S):he;const ue=B_(ne)%2===1;S!==a.pos&&ue&&(ne=a.pending+k.slice(a.pos,S));const de=ue?D_(ne):null,Ce=de?.marker??"**";if(a.pending!==ne)if(a.pending="",ue)if(de){const Ie=ne.slice(de.index+Ce.length);F(ne.slice(0,de.index));const le=a.push("strong_open","",0);le.markup=Ce;const z=a.push("text","",0);z.content=Ie,a.push("strong_close","",0)}else F(ne);else F(ne);if(ue){const Ie=a.push("strong_open","",0);Ie.markup=Ce;const le=a.push("math_inline","math",0);le.content=rl(U,t),le.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",le.raw=`${m}${U}${y}`,le.loading=!1;const z=k.slice(B+y.length).startsWith(Ce);return z&&a.push("strong_close","",0),a.pos=d(k,B+y.length),g=a.pos,b=g,z||a.push("strong_close","",0),!0}else{const Ie=a.push("math_inline","math",0);Ie.content=rl(U,t),Ie.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Ie.raw=`${m}${U}${y}`,Ie.loading=!1}}return g=d(k,B+y.length),b=g,a.pos=g,!0}if(I){if(l)a.pos=g;else{if(m==="$$"&&g<k.length&&k.slice(g).includes("$")){let S=g;for(;!(S>=k.length);){const N=pv(k,S);if(N===-1)break;if(N+1<k.length&&k[N+1]==="$"){S=N+2;continue}if(N>0&&k[N-1]==="$"){S=N+1;continue}const D=T0(k,N+1);if(D===-1)break;const B=k.slice(N+1,D),U=B.includes("`"),H=!B||!B.trim(),P=k[D+1],Z=N0(B,P),K=I0(B);if(!U&&!H&&!Z&&!K){const V=k.slice(g,N);V&&F(V);const J=a.push("math_inline","math",0);J.content=rl(B,t),J.markup="$",J.raw=`$${B}$`,J.loading=!1,g=D+1,S=D+1}else F("$"),S=N+1}S<k.length&&F(k.slice(S))}else g<k.length&&F(k.slice(g));a.pos=k.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let g=u.src.slice(p,u.eMarks[l]).trim(),b=!1,v="",m="",y=!1,k="",A=!1;for(const[V,J]of h)if(g.startsWith(V))if(V.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=V,m=J;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=V,m=J;break}continue}else{const he=u.tokens[u.tokens.length-1];if(he&&he.type==="list_item_open"&&he.mark==="-"&&g.slice(V.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const ne=g.indexOf("]");if(g.slice(ne).trim()!=="]")continue;const ue=g.slice(V.length,ne);if(V==="["?P_(ue):Cc(ue)){b=!0,v=V,m=J;break}continue}}else{b=!0,v=V,m=J;break}else if((V==="$$"||V==="\\[")&&g.endsWith(V)&&l+1<a){const he=lk(g,V,J);if(he===-1)continue;k=Dd(g.slice(0,he)),A=!0;const ne=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(ne,u.eMarks[l+1]).trim(),y=!0,b=!0,v=V,m=J;break}if(!b)return!1;if(c&&!A)return!0;const $=g.indexOf(v),I=$+v.length,x=!f&&v==="["?g.indexOf("\\]",I):-1,L=x>=0?"\\]":m,E=x>=0?x:Ku(g,m,I);if(!y&&E>v.length){const V=g.slice($+v.length,E),J=u.push("math_block","math",0);J.content=rl(V),J.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",J.map=[l,l+1],J.raw=`${v}${V}${L}`,J.block=!0,J.loading=!1,u.line=l+1;const he=g.slice(E+L.length);return he.trim()&&n(u,he,l),!0}let F=l,S="",N=!1,D="",B=l;const U=y?g:g===v?"":g.slice(v.length),H=!f&&v==="\\["?"]":"",P=Ku(U,m);if(P!==-1){const V=P;S=U.slice(0,V),D=U.slice(V+m.length),B=y?l+1:l,N=!0,F=B}else for(U&&!y&&(S=U),F=l+1;F<a;F++){const V=u.bMarks[F]+u.tShift[F],J=u.eMarks[F],he=u.src.slice(V,J),ne=he.trim();if(!f&&v==="["&&ne==="\\]"){m="\\]",N=!0;break}if(H&&he.trim()===H){m=H,N=!0;break}if(ne===m){N=!0;break}else if(!f&&v==="["&&he.includes("\\]")){N=!0;const ue=he.indexOf("\\]");m="\\]";const de=he.slice(0,ue);de&&(S+=(S?`
|
|
192
|
+
`:"")+de),D=he.slice(ue+m.length),B=F;break}else if(Ku(he,m)!==-1){N=!0;const ue=Ku(he,m),de=he.slice(0,ue);de&&(S+=(S?`
|
|
193
|
+
`:"")+de),D=he.slice(ue+m.length),B=F;break}S+=(S?`
|
|
194
|
+
`:"")+he}if((!d||f)&&!N)return!1;const Z=/^\s*!\[/.test(S);if(!(A?!Z&&mv(S):v==="$$"?!Z:v==="["?P_(S):Cc(S)))return!1;if(c)return!0;k&&n(u,k,l);const K=u.push("math_block","math",0);return K.content=rl(S),K.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",K.raw=`${v}${S}${S.startsWith(`
|
|
195
|
+
`)?`
|
|
196
|
+
`:""}${m}`,K.map=[l,F+1],K.block=!0,K.loading=!N,u.line=F+1,D.trim()&&n(u,D,B),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function DG(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}function PG(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new AV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Ca(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&BG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&jV(i),e.enableFixIndentedCodeBlock!==!1&&pK(i),qK(i),GK(i),VK(i),XK(i),DG(i),fK(i,{customHtmlTags:e.customHtmlTags}),i}function Aa(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>Aa(n))),t}function HG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function WG(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function zG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Xf(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...eo(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const j_=/\r?\n[ \t]*`+\s*$/,aM=["diff ","index ","--- ","+++ ","@@ "],UG=/\r?\n/;function qG(e){const t=String(e??"");return t?aM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function V_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function jG(e,t){const n=[],o=[],s=[],i=[],r=e.split(UG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!aM.some(g=>p.startsWith(g)))if(p.startsWith("-")){const g=p.slice(1);s.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(p.startsWith("+")){const g=p.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{V_(n,o,s,i);const g=a&&p.startsWith(" ")?p.slice(1):p;n.push(g),o.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&qG(p)||c(p)}(t||s.length>0||i.length>0)&&V_(n,o,s,i);const d=n.join(`
|
|
197
|
+
`),f=o.join(`
|
|
198
|
+
`);return{original:t&&l&&d?`${d}
|
|
199
|
+
`:d,updated:t&&l&&f?`${f}
|
|
200
|
+
`:f}}function ak(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(j_.test(a)&&(a=a.replace(j_,"")),r){const{original:c,updated:u}=jG(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function VG(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function KG(){return{type:"hardbreak",raw:`\\
|
|
201
|
+
`}}function GG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let L0=null;const $0=new WeakMap;function K_(){return L0||(L0={customTagSet:null,allowedTagSet:Fm()}),L0}function cM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function uM(e){return/^<\s*\//.test(e)}function dM(e,t){return/\/\s*>\s*$/.test(t)||Pa.has(e)}function YG(e){if(!e||e.length===0)return K_();const t=$0.get(e);if(t)return t;const n=e.map(_i).filter(Boolean);if(!n.length){const s=K_();return $0.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Fm({customHtmlTags:e})};return $0.set(e,o),o}function fM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function ZG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Cp(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function QG(e,t,n){const o=e.slice();return Cp(o,"href")||o.push(["href",t]),n!=null&&!Cp(o,"title")&&o.push(["title",n]),o}function gv(e){return e.map(fM).join("")}function Ah(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Ah(o.children)});continue}t.push(o)}return t}function XG(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=cM(r),a=uM(r),c=dM(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function F0(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?XG(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:gv(o),innerTokens:s,nextIndex:i}}function JG(e,t,n,o,s,i,r){const l=String(e.content??""),a=cM(l),{customTagSet:c,allowedTagSet:u}=YG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!F0(t,n,a).closed){const A=fM(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=uM(l),f=dM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=F0(t,n,a),$=Im(l),I=A.innerTokens,x=String(Cp($,"href")??""),L=Cp($,"title"),E=L==null?null:String(L),F=QG($,x,E),S=Ah(I.length?o(I,s,i,r):[]),N=I.length?gv(I):x||"";return!S.length&&N&&S.push({type:"text",content:N,raw:N}),[{type:"link",href:x,title:E,text:N,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=F0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Ah(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=Ah(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let g=h.html||l,b=!h.closed,v=!1;if(!h.closed){const A=`</${a}>`;g.toLowerCase().includes(A.toLowerCase())||(g+=A),v=!0,b=!0}const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(l))!==null;){const A=k[1],$=k[2]||k[3]||k[4]||"";m.push([A,$])}if(c?.has(a)){const A=ZG(e);return[{type:a,tag:a,attrs:m,content:A?A.inner:h.innerTokens.length?gv(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??g,loading:e.loading||b,autoClosed:v},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:m,content:g,children:p,raw:g,loading:b,autoClosed:v},h.nextIndex]}function hM(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>hM(t)).join(""):String(e.content??"")}function eY(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>hM(t)).join("")}function G_(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=eY(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function tY(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function nY(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function oY(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Ap(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function sY(e,t,n){const o=e.slice();return Ap(o,"href")||o.push(["href",t]),n!=null&&!Ap(o,"title")&&o.push(["title",n]),o}function Jf(e,t,n){const o=e[t],s=oY(o.attrs),i=String(Ap(s,"href")??""),r=Ap(s,"title"),l=r==null?null:String(r),a=sY(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(b=>b.type==="strong_open")){const b=String(h.content??""),v=String(h.raw??b),m=Aa(h);m.content=b.slice(0,-2),m.raw=v.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=m}const p=eo(f,void 0,void 0,n),g=p.map(b=>{const v=b;return"content"in b?String(v.content??""):String(v.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:p,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Y_(e){const t=e.content??"",n=e.raw==="$$"?`$${t}$`:e.raw||"";return{type:"math_inline",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function iY(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Z_(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const rY=/\\([\\()[\]`$|*_\-!])/g;function lY(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(rY,"$1")===t))return n}function Ru(e,t,n,o){const s=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...o,__insideStrong:!0};return s.push(...eo(l,lY(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function aY(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...eo(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function cY(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function uY(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const dY=/[^~]*~{2,}[^~]+/,fY=/\*\*/,hY=/[[_*^~]/,pY=/\\([\\()[\]`$|*_\-!])/g,ck=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),mY=/\s/u,gY=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,vY=/\p{P}/u,yY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,kY=/:\/\//;function bY(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function pM(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&ck.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Fl(e){return!!e&&mY.test(e)}function Ol(e){return!!e&&(gY.test(e)||vY.test(e))}function xY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function wY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function _Y(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?pM(e,o):t.indexOf("*",o);if(i===-1)break;if(wY(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function SY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function CY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function AY(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(CY(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function MY(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&ck.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function EY(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&ck.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function TY(e,t,n){const o=EY(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const NY=/[\p{L}\p{N}]/u,IY=/^[\p{L}\p{N}]+$/u;function vv(e){return e?NY.test(e):!1}function mM(e){return e?IY.test(e):!1}function ad(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:vv(o)&&vv(s)}}function LY(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=ad(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!mM(e.slice(o.end,s.start)))return s.end}return-1}function $Y(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function FY(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=ad(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function OY(e){return e?yY.test(e)||kY.test(e):!1}function RY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function eo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Jd(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function g(z,ae){const ie=e.length===1?t:String(ae.content??""),q=[],ee=LY(z);if(ee!==-1){A(z.slice(0,ee),z.slice(0,ee));const fe=z.slice(ee);return fe&&(E({type:"text",content:fe,raw:fe}),u--),u++,!0}if(dY.test(z)){const fe=z.indexOf("~~");fe!==-1&&q.push({type:"strikethrough",index:fe})}if(fY.test(z)){const fe=z.indexOf("**");fe!==-1&&q.push({type:"strong",index:fe})}if(/[^*]*\*[^*]+/.test(z)){const fe=ie?pM(ie,0):z.indexOf("*");if(ie&&fe===-1)return!1;fe!==-1&&q.push({type:"emphasis",index:fe})}q.sort((fe,ve)=>fe.index!==ve.index?fe.index-ve.index:fe.type===ve.type?0:fe.type==="strong"?-1:ve.type==="strong"?1:0);const ye=q[0];if(!ye)return!1;if(ye.type==="strikethrough"){const fe=ye.index,ve=fe>-1?z.slice(0,fe):"";if(ve&&A(ve,ve),fe===-1)return u++,!0;const j=z.indexOf("~~",fe+2),te=j===-1?z.slice(fe+2):z.slice(fe+2,j),me=j===-1?"":z.slice(j+2),{node:Ae}=Z_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:te,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),k(Ae),me&&(E({type:"text",content:me,raw:me}),u--),u++,!0}if(ye.type==="strong"){const fe=ye.index,ve=fe>-1?z.slice(0,fe):"";if(ve&&A(ve,ve),fe===-1)return u++,!0;if(t&&fe===0){let De=!1,ge=0;for(;ge<z.length&&z[ge]==="*";)ge++;if(t.startsWith("\\*")&&(De=!0),De){let Ne=0,et=0;for(;et<t.length&&Ne<ge;)if(t[et]==="\\"&&et+1<t.length&&t[et+1]==="*")Ne+=1,et+=2;else{if(t[et]==="*")break;et++}if(Ne>=2)return A(z,z),u++,!0}}if(t&&(z.match(/\*/g)||[]).length>bY(t))return A(z.slice(ve.length),z.slice(ve.length)),u++,!0;const j=ad(z,fe);if(j.len>=3){const De=FY(z,fe+j.len);if(De!==-1){const ge=z.slice(fe+j.len,De);if($Y(ge)){const{node:Ne}=Ru([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);p(),k(Ne);const et=z.slice(De+3);return et&&(E({type:"text",content:et,raw:et}),u--),u++,!0}}}if(!SY(z,fe)){const De=z.slice(fe,fe+j.len);A(De,De);const ge=z.slice(fe+j.len);return ge&&(E({type:"text",content:ge,raw:ge}),u--),u++,!0}const te=AY(z,fe+2);let me="",Ae="";if(te.index!==-1){me=z.slice(fe+2,te.index),Ae=z.slice(te.index+2);const De=te.index,ge=ad(z,De);if(j.intraword&&ge.intraword&&!mM(me)||!me&&j.len>=4&&j.intraword)return A(z.slice(ve.length),z.slice(ve.length)),u++,!0}else{if(d||te.sawInvalidClose||j.intraword)return A(z.slice(ve.length),z.slice(ve.length)),u++,!0;me=z.slice(fe+2),Ae=""}if(!me&&/^\*+$/.test(Ae))return A(z,z),u++,!0;const{node:$e}=Ru([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:me,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),k($e),Ae&&(E({type:"text",content:Ae,raw:Ae}),u--),u++,!0}if(ye.type==="emphasis"){let fe=ye.index;fe===-1&&(fe=0);const ve=z.slice(0,fe);if(ve&&A(ve,ve),!xY(z,fe)){A(z[fe],z[fe]);const De=z.slice(fe+1);return De&&(E({type:"text",content:De,raw:De}),u--),u++,!0}const j=ad(z,fe),te=_Y(ie,z,fe+1),me=te.index,Ae=e[u+1];if(o?.final&&Ae?.type==="em_open"&&me!==-1&&z.slice(fe+1,me).trim()!==z.slice(fe+1,me)||me===-1&&(te.sawInvalidClose||o?.final||j.intraword||!vv(z[fe+1])))return A(z.slice(fe),z.slice(fe)),u++,!0;const{node:$e}=Xf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:me>-1?z.slice(fe+1,me):z.slice(fe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),k($e),me!==-1&&me<z.length-1){const De=z.slice(me+1);De&&(E({type:"text",content:De,raw:De}),u--)}return u++,!0}return!1}function b(z,ae){if(!z.includes("`"))return!1;const q=(Ae=>{for(let $e=0;$e<Ae.length;$e++){if(Ae[$e]!=="`")continue;let De=0;for(let ge=$e-1;ge>=0&&Ae[ge]==="\\";ge--)De++;if(De%2===0)return $e}return-1})(z);if(q===-1)return!1;let ee=1;for(let Ae=q+1;Ae<z.length&&z[Ae]==="`";Ae++)ee++;const ye="`".repeat(ee),fe=q+ee,ve=z.indexOf(ye,fe);if(ve===-1){if(ee===1){const $e=z.slice(0,q),De=z.slice(q+1);return $e&&(g($e,ae)?u--:A($e,$e)),m({type:"inline_code",code:De,raw:String(De)}),u++,!0}let Ae=z;for(let $e=u+1;$e<e.length;$e++)Ae+=String((e[$e].content??"")+(e[$e].markup??""));return u=e.length-1,A(Ae,Ae),u++,!0}p();const j=z.slice(0,q),te=z.slice(q+ee,ve),me=z.slice(ve+ee);return j&&(g(j,ae)?u--:A(j,j)),m({type:"inline_code",code:te,raw:String(te??"")}),me&&(E({type:"text",content:me,raw:me}),u--),u++,!0}function v(z){const ae=l?.__markdownIt;if(!ae||e.length<=1||!e.some(ye=>ye?.type==="math_inline")||!hY.test(z))return null;const ie=ae.parseInline(z,{__markstreamFinal:!!o?.final});if(!Array.isArray(ie)||ie.length===0)return null;const q=(ie.find(ye=>ye?.type==="inline")?.children??[]).filter(ye=>!(ye?.type==="text"&&String(ye.content??"")===""));if(!q.length||!q.some(ye=>ye?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===z)return null;const ee=eo(q,z,n,o);return ee.length?ee:null}function m(z){p(),a.push(z)}function y(z){p();const ae=Aa(z);a.push(ae)}function k(z){m(z)}function A(z,ae){c?(c.content+=z,c.raw+=ae??z):(c={type:"text",content:String(z??""),raw:String(ae??z??"")},a.push(c))}function $(z,ae){if(!z)return;const ie=eo([{...ae,type:"text",content:z,raw:z}],z,n,o);if(ie.length===1&&ie[0]?.type==="text"){const q=ie[0];A(String(q.content??""),String(q.raw??q.content??""));return}for(const q of ie)k(q)}function I(z,ae){return String(z.markup??"").startsWith(ae)}function x(z){return z.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function L(z,ae){let ie=z;const q=String(ae.content??"");return ie.endsWith("\\")&&!I(ae,"\\\\")&&!q.endsWith("\\\\")&&(ie=ie.slice(0,-1)),ie.endsWith("(")&&!I(ae,"\\(")&&!q.endsWith("\\(")&&(ie=ie.slice(0,-1)),/\*+$/.test(ie)&&!I(ae,"\\*")&&!q.endsWith("\\*")&&(ie=ie.replace(/\*+$/,"")),ie}for(;u<e.length;){const z=e[u];E(z)}function E(z){switch(z.type){case"text":S(z);break;case"softbreak":c?(c.content+=`
|
|
202
|
+
`,c.raw+=`
|
|
203
|
+
`):(c={type:"text",content:`
|
|
204
|
+
`,raw:`
|
|
205
|
+
`},a.push(c)),u++;break;case"code_inline":k(tY(z)),u++;break;case"html_inline":{const[ae,ie]=JG(z,e,u,eo,t,n,o);k(ae),u=ie;break}case"link_open":N(z);break;case"image":he(z)||(p(),k(G_(z)),u++);break;case"strong_open":{p();const{node:ae,nextIndex:ie}=Ru(e,u,z.content,o);k(ae),u=ie;break}case"em_open":{p();const{node:ae,nextIndex:ie}=Xf(e,u,o);k(ae),u=ie;break}case"s_open":{p();const{node:ae,nextIndex:ie}=Z_(e,u,o);k(ae),u=ie;break}case"mark_open":{p();const{node:ae,nextIndex:ie}=GG(e,u,o);k(ae),u=ie;break}case"ins_open":{p();const{node:ae,nextIndex:ie}=nY(e,u,o);k(ae),u=ie;break}case"sub_open":{p();const{node:ae,nextIndex:ie}=aY(e,u,o);k(ae),u=ie;break}case"sup_open":{p();const{node:ae,nextIndex:ie}=cY(e,u,o);k(ae),u=ie;break}case"sub":p(),k({type:"subscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`~${String(z.content??"")}~`}),u++;break;case"sup":p(),k({type:"superscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`^${String(z.content??"")}^`}),u++;break;case"emoji":{p();const ae=e[u-1];ae?.type==="text"&&/\|:-+/.test(String(ae.content??""))?A("",""):k(zG(z)),u++;break}case"checkbox":p(),k(HG(z)),u++;break;case"checkbox_input":p(),k(WG(z)),u++;break;case"footnote_ref":p(),k(VG(z)),u++;break;case"footnote_anchor":{p();const ae=z.meta??{};m({type:"footnote_anchor",id:String(ae.label??z.content??""),raw:String(z.content??"")}),u++;break}case"hardbreak":p(),k(KG()),u++;break;case"fence":p(),k(ak(e[u])),u++;break;case"math_inline":p(),!z.content&&z.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(k(Y_({...z,content:e[u+1].content})),u+=2):k(Y_(z)),u++;break;case"reference":B(z);break;case"text_special":A(String(z.content??""),String(z.content??"")),u++;break;default:{const ae=z;if(z.type==="link"&&ae.href!=null&&o?.validateLink&&!o.validateLink(String(ae.href))){p();const ie=String(ae.text??"");A(ie,ie),u++}else ne(z)||H(z)||Z(z)||U(z)||y(z),u++;break}}}function F(z,ae,ie,q){const ee=uY({...ae,content:z});if(c){c.content+=L(ee.content,ae),c.raw+=ee.raw;return}const ye=ie?.tag==="br"&&e[u-2]?.content==="[";q||(ee.content=L(ee.content,ae)),c=ee,c.center=ye,a.push(c)}function S(z){const ae=String(z.content??""),ie=e.length===1&&ae.includes("\\")&&typeof t=="string"?String(t):"";let q=ie?MY(ie):ae.replace(pY,"$1");if(z.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const ee=q.indexOf("$");ee!==-1&&ee===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let ye=a.length,fe="";for(let me=a.length-1;me>=0;me--){const Ae=a[me];if(Ae.type!=="text")break;ye=me,fe=String(Ae.content??"")+fe}ye<a.length&&(q.startsWith(fe)?(c=null,a.length=ye):c=a[a.length-1]);const ve=e[u+1];if((q==="`"||q==="|"||q==="$")&&!I(z,`\\${q}`)||/^\*+$/.test(q)&&!I(z,"\\*")){u++;return}if(!ve&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(J(q)||ue(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){F(q,z,e[u-1],ve),u++;return}if(le(q))return;const j=e[u-1];if(q==="["&&!ve?.markup?.includes("*")&&!I(z,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!I(z,"\\]")){u++;return}if(b(ae,z)||Ie(q)||(e[u+1]?.type!=="link_open"||x(q))&&Ce(q,z))return;const te=v(ae);if(te){p();for(const me of te)k(me);u++;return}g(q,z)||(F(q,z,j,ve),u++)}function N(z){if(D(z))return;if(de()){const{node:ve,nextIndex:j}=Jf(e,u,o),te=String(ve.text||ve.href||"");A(te,te),u=j;return}p();const{node:ae,nextIndex:ie}=Jf(e,u,o);u=ie;const q=ae.text||ae.href||"";if(z.markup==="linkify"&&!G6(q,ae.href,t)&&wp(q,l?.__linkifyDemotionContext)){A(q,q);return}const ee=ae.children.length===1&&ae.children[0]?.type==="text";if(ae.loading&&t&&ae.text===ae.href&&ee){const ve=RY(t,ae.href);ve&&(ae.text=ve,ae.children=[{type:"text",content:ve,raw:ve}],ae.raw=`[${ve}](${ae.href}${ae.title?` "${ae.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(ae.href)){A(ae.text,ae.text);return}const ye=z.attrs?.find(([ve])=>ve==="href")?.[1],fe=String(ye??"");if(t&&fe){const ve=t.indexOf("](");if(ve!==-1){const j=t.indexOf(")",ve+2);j===-1?ae.loading=!0:ae.loading&&t.slice(ve+2,j).includes(fe)&&(ae.loading=!1)}}U(ae)||m(ae)}function D(z){if(z.markup!=="linkify")return!1;const{node:ae,nextIndex:ie}=Jf(e,u,o);return P(ae,ie)?(u=ie,!0):!1}function B(z){p(),k(iY(z)),u++}function U(z){if(z.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const ie=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ie)return!1;const q=z,ee=String(q.href??""),ye=String(q.text??""),fe=String(ie[2]??""),ve=ee.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ee||!(ye===ee||ye===ve||OY(ye)))return!1;const j=String(ie[1]??"");return j?(ae.content=j,ae.raw=j):a.pop(),m({...z,text:fe,children:[{type:"text",content:fe,raw:fe}],raw:`[${fe}](${ee}${q.title?` "${q.title}"`:""})`}),!0}function H(z){if(z.type!=="link")return!1;const ae=z,ie=String(ae.href??"");return ie?P({href:ie,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},u+1):!1}function P(z,ae){const ie=a[a.length-1];if(ie?.type!=="image"||ie.src||!ie.loading||!String(ie.raw??"").endsWith("]("))return!1;const q=e[ae],ee=String(q?.content??"");if(q?.type!=="text"||!ee.startsWith(")"))return!1;a.pop(),c=null;const ye=String(ie.alt??"");m({type:"image",src:z.href,alt:ye,title:z.title,raw:``,loading:!!z.loading});const fe=ee.slice(1),ve=Aa(q);return ve.content=fe,ve.raw=fe,h()[ae]=ve,!0}function Z(z){if(z.type!=="link")return!1;const ae=a[a.length-1],ie=e[u-1];if(!ae||ae.type!=="text"||ie?.type!=="text")return!1;const q=String(ae.content??""),ee=String(ie.content??"");if(!q.endsWith("!")||!ee.endsWith("!")||I(ie,"\\!"))return!1;const ye=q.slice(0,-1);ye?(ae.content=ye,ae.raw=ye,c=ae):(a.pop(),c=null);const fe=z,ve=String(fe.text??fe.children?.map(me=>String(me?.content??me?.raw??"")).join("")??""),j=String(fe.href??""),te=fe.title==null||fe.title===""?null:String(fe.title);return m({type:"image",src:j,alt:ve,title:te,raw:``,loading:!!fe.loading}),!0}function K(z,ae="",ie=null){const q=String(z.alt??z.raw??"");return{type:"link",href:ae,title:ie,text:q,children:[z],raw:`[${q}](${ae}${ie?` "${ie}"`:""})`,loading:!0}}function V(z){const ae=z.startsWith(";return{type:"image",src:"",alt:q===-1?ie.replace(/\]$/,""):ie.slice(0,q),title:null,raw:ae,loading:!0}}function J(z){const ae=z.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&TY(t,ae,"["))return!1;const ie=z.slice(0,ae);return ie&&A(ie,ie),m(K(V(z.slice(ae+1)))),u++,!0}function he(z){if(o?.final)return!1;const ae=e[u-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||I(ae,"\\["))return!1;const ie=a[a.length-1];if(ie?.type==="text"&&ie.content.endsWith("[")){const q=ie.content.slice(0,-1);q?(ie.content=q,ie.raw=q,c=ie):(a.pop(),c=null)}return m(K(G_(z))),u++,!0}function ne(z){if(z.type!=="link")return!1;const ae=z,ie=String(ae.raw??""),q=String(ae.text??"");if(!ie.startsWith("[![")&&!q.startsWith("!["))return!1;const ee=ae.title==null||ae.title===""?null:String(ae.title);return m(K({type:"image",src:String(ae.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:ee,raw:ie.startsWith("[)return!1;const ae=e[u-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&I(ae,"\\["))return!1;const ie=a[a.length-1];if(ie?.type!=="image"&&ie?.type!=="link")return!1;const q=ie,ee=ie?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,ye=ee?ee.children[0]:a.pop();if(!ye||ye.type!=="image")return!1;const fe=e[u+1];let ve=String(ee?.href??""),j=ee?.title==null?null:String(ee.title),te=!0;if(fe?.type==="link_open"){const{node:Ae,nextIndex:$e}=Jf(e,u+1,o);ve=Ae.href,j=Ae.title,te=!0,u=$e}else{if(ve=z.slice(2),ve.includes('"')){const Ae=ve.split('"');ve=String(Ae[0]??"").trim(),j=Ae[1]==null?null:String(Ae[1]).trim()}u++}const me=K(ye,ve,j);return me.loading=te,m(me),!0}function de(){const z=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&z?.type==="text"&&String(z.content??"").endsWith("[")&&I(z,"\\[")}function Ce(z,ae){const ie=z.indexOf("[");if(ie===-1)return!1;let q=z.slice(0,ie);const ee=z.indexOf("](",ie);if(ee!==-1){const ye=e[u+2];let fe=z.slice(ie+1,ee);if(fe.includes("[")){const De=fe.indexOf("[");q+=z.slice(0,ie+De+1);const ge=ie+De+1;fe=z.slice(ge+1,ee)}const ve=e[u+1];if(z.endsWith("](")&&ve?.type==="link_open"&&ye){const De=e[u+4];let ge=4,Ne=!0;if(De?.type==="text"){const rt=String(De.content??"");if(rt.startsWith(")")){Ne=!1;const St=rt.slice(1);if(St){const gt=Aa(De);gt.content=St,gt.raw=St,h()[u+4]=gt}else ge++}else rt==="."&&ge++}$(q,ae);const et=String(ye.content??"");return o?.validateLink&&!o.validateLink(et)?A(fe,fe):m({type:"link",href:et,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:Ne}),u+=ge,!0}const j=z.indexOf(")",ee),te=j!==-1?z.slice(ee+2,j):"",me=j===-1;let Ae=q.match(/\*+$/);if(Ae&&(q=q.replace(/\*+$/,"")),$(q,ae),Ae||(Ae=fe.match(/^\*+/)),!d&&Ae){const De=Ae[0].length;fe=fe.replace(/^\*+/,"").replace(/\*+$/,"");const ge=[];if(De===1?ge.push({type:"em_open",tag:"em",nesting:1}):De===2?ge.push({type:"strong_open",tag:"strong",nesting:1}):De===3&&(ge.push({type:"strong_open",tag:"strong",nesting:1}),ge.push({type:"em_open",tag:"em",nesting:1})),ge.push({type:"link",href:te,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:me}),De===1){ge.push({type:"em_close",tag:"em",nesting:-1});const{node:Ne}=Xf(ge,0,o);k(Ne)}else if(De===2){ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Ru(ge,0,void 0,o);k(Ne)}else if(De===3){ge.push({type:"em_close",tag:"em",nesting:-1}),ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Ru(ge,0,void 0,o);k(Ne)}else{const{node:Ne}=Xf(ge,0,o);k(Ne)}}else o?.validateLink&&!o.validateLink(te)?A(fe,fe):m({type:"link",href:te,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:me});const $e=j!==-1?z.slice(j+1):"";return $e&&(E({type:"text",content:$e,raw:$e}),u--),u++,!0}return!1}function Ie(z){const ae=z.indexOf("![");if(ae===-1)return!1;const ie=z.slice(0,ae);return ie&&!c?c={type:"text",content:ie,raw:ie}:ie&&c&&(c.content+=ie),c&&(a.push(c),c=null),m(V(z.slice(ae))),u++,!0}function le(z){if(!(z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=z.slice(1).match(/[^\s\]]/);if(ae===null)return u++,!0;if(ae&&/x/i.test(ae[0])){const ie=ae[0]==="x"||ae[0]==="X";return m({type:"checkbox_input",checked:ie,raw:ie?"[x]":"[ ]"}),u++,!0}return!1}return a}function BY(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function DY(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function PY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function cu(e,t,n){const o=e[t],s=[],i=Hl(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=PY(c)?Aa(c):c,d=e[a-1];u!==c&&(DY(u),BY(u));const f=String(u.content??"");l.push({type:"paragraph",children:eo(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=uu(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=cu(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=dk(e,a,i.options(),uk);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
|
|
206
|
+
`)},r+1]}function HY(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Hl(o,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:eo(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=cu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=uu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Lm(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
|
|
207
|
+
${r.map(c=>c.raw).join(`
|
|
208
|
+
`)}
|
|
209
|
+
:::`},a+1]}const WY=new Set(["warning","info","note","tip","danger","caution"]);function zY(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return WY.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function UY(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=zY(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Hl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let g=f.length-1;g>=0;g--){const b=f[g];if(b.type==="text"&&/:+/.test(b.content)){h=g;break}}const p={type:"paragraph",children:eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=cu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=uu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Lm(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
|
|
210
|
+
${l.map(d=>d.raw).join(`
|
|
211
|
+
`)}
|
|
212
|
+
:::`},c+1]}const qY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function jY(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=qY.exec(String(o.info??""));return s?HY(e,t,s,n):null}const uk={parseContainer:(e,t,n)=>UY(e,t,n),matchAdmonition:jY};function uu(e,t,n){const o=[],s=Hl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:eo(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=cu(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=uu(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=dk(e,i,s.options(),uk);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
|
|
213
|
+
`)},i+1]}function VY(e){if(e.info?.startsWith("diff"))return ak(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function KY(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Hl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=eo(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:eo(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
214
|
+
`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
|
|
215
|
+
`)},s+1]}function GY(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Hl(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:eo(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
|
|
216
|
+
`)}`},l+1]}function YY(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:eo(a.children||[],c,void 0,n),raw:c}}function ZY(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=Jn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=Jn(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function gM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=Jn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Pa.has(n),l=Im(s),a=(o===-1?-1:ZY(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
217
|
+
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function QY(e){const t=String(e.content??""),n=e.raw==="$$"?`$$${t}$$`:String(e.raw??"");return{type:"math_block",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function XY(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function vM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function yM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return vM(n)?n:void 0}function JY(e,t,n){const o=yM(Jd(t),n);if(!vM(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function eZ(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),g=XY(e[c].attrs),b=a.length,v=!f&&!r,m=v?s?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:eo(h.children||[],p,void 0,JY(n,m,v?u:void 0)),raw:p,align:g}),v&&(u=yM(u,Jd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
218
|
+
`)},o+1]}function tZ(){return{type:"thematic_break",raw:"---"}}let O0=null;const R0=new WeakMap;function Q_(){return O0||(O0={allowedTagSet:Fm(),customTagSet:null}),O0}function nZ(e){if(!e||e.length===0)return Q_();const t=R0.get(e);if(t)return t;const n=e.map(_i).filter(Boolean);if(!n.length){const s=Q_();return R0.set(e,s),s}const o={allowedTagSet:Fm({customHtmlTags:e}),customTagSet:new Set(n)};return R0.set(e,o),o}function oZ(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const g=p.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(h.startsWith("data-")){const g=h.slice(5);try{r[g]=JSON.parse(p)}catch{r[g]=p}}}const l=[],a=Hl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:eo(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=cu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=uu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Lm(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
219
|
+
`,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
|
|
220
|
+
`),f+=`
|
|
221
|
+
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function sZ(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function iZ(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function rZ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Gs(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=Jn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=Jn(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function lZ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Jn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const g=e.indexOf(">",p);if(g===-1)return null;if(u--,u===0){const b=g+1;return{raw:e.slice(r,b),end:b}}d=g+1;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function yv(e){return Number.isFinite(e)&&e>0?e:0}function aZ(e,t){const n=yv(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
|
|
222
|
+
`&&(o++,o===n))return s+1;return e.length}function Lm(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[YY(e,t,n),t+3];case"code_block":return[VY(o),t+1];case"fence":return[ak(o),t+1];case"math_block":return[QY(o),t+1];case"html_block":{const s=gM(o),i=s.tag?nZ(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?aZ(l,Number(o.map?.[0]??0)):0,u=lZ(l,r,Math.max(yv(a),yv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=Jn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),g=f===-1?null:rZ(d,r,f+1),b=g?.start??-1;let v="";f!==-1&&(b!==-1&&f<b?v=d.slice(f+1,b):v=d.slice(f+1)),b===-1&&(v=iZ(v,r));const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(h))!==null;){const $=k[1];if(!$||$.toLowerCase()===r)continue;const I=k[2]||k[3]||k[4]||"";m.push([$,I])}const A=!n?.final&&!p&&g==null;return[{type:r,tag:r,content:sZ(v),raw:String(u?.raw??s.raw??d),loading:A,attrs:m.length?m:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=eZ(e,t,n);return[s,i]}case"dl_open":{const[s,i]=KY(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=GY(e,t,n);return[s,i]}case"hr":return[tZ(),t+1]}return null}function dk(e,t,n,o){const s=Lm(e,t,n);if(s)return s;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(o?.parseContainer)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return oZ(e,t,n)}return null}function cZ(){return{type:"hardbreak",raw:`\\
|
|
223
|
+
`}}function uZ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:eo(o.children||[],s,void 0,n),raw:s}}const X_=new WeakMap,$m=new WeakMap,dZ=["$$","\\["];function Jc(){return typeof performance<"u"?performance.now():Date.now()}function fk(e,t,n){e&&(e[t]=(e[t]??0)+n)}function kM(e){return e.__timing}function B0(e,t,n){return t&&fk(t,"parseMarkdownToStructureTotalMs",Jc()-n),e}function J_(e,t,n){if(!n)return lS(e,t);const o=Jc(),s=lS(e,t);return fk(n,"processTokensMs",Jc()-o),s}function fZ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=au(t);return n.length?new Set(n):null}function hZ(e,t){const n=e;let o=X_.get(n);o||(o=new Map,X_.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function pZ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function eh(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=ha(s.value,n))}}function ha(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(ha(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(ha(l,t),ha(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(ha(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),eh(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),eh(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),eh(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!pZ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),eh(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=ha(i[r],t);return s}function bM(e,t=!0){if(!t)return Aa(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>bM(a,t)):t&&r&&typeof r=="object"&&(l=ha(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function eS(e,t=!0){return e.map(n=>bM(n,t))}function xM(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function mZ(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function gZ(e){$m.delete(e)}function vZ(e,t,n){$m.set(e,{source:t,key:n,pendingCandidate:n===null&&lM(t)})}function yZ(e){return e.endsWith("$")||e.endsWith("\\")}function kZ(e){const t=Math.max(e.lastIndexOf(`
|
|
224
|
+
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return dZ.some(o=>n.endsWith(o))}function bZ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||kZ(e)&&/[\r\n]/.test(t)):!1}function xZ(e,t){if(!eM(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=$m.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!bZ(s.source,l)&&!yZ(t)){s.source=t;return}}const i=OG(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),vZ(e,t,i)}function wZ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function _Z(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function D0(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&_Z(e,t)}function tS(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function SZ(e){for(let t=0;t+5<e.length;t++)if(tS(e,t)&&tS(e,t+3)&&D0(e[t],e[t+3])&&D0(e[t+1],e[t+4])&&D0(e[t+2],e[t+5]))return!0;return!1}function CZ(e,t,n){return eM(e)&&lM(t)&&SZ(n)}function AZ(e){const t=$m.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function nS(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!xM(e,o)||(xZ(e,t),AZ(e)))return e.parse(t,n);const s=e.stream.parse(t,hZ(e,n));if(CZ(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!wZ(o))return s;const i=kM(o);if(!i)return eS(s,!0);const r=Jc(),l=eS(s,!0);return fk(i,"tokenCloneMs",Jc()-r),l}function Fm(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Od;const n=new Set(Od);for(const o of au(t))o&&n.add(o);return n}function MZ(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:e.type==="hardbreak"?"<br>":""}function oS(e){return{type:"paragraph",children:e,raw:e.map(MZ).join("")}}function sS(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=fZ(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(oS(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(oS(c)),a}function EZ(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function cd(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function TZ(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Gs(t)}\s*>\s*$`,"i").test(n)}function hk(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${Gs(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Jn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Pa.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Gs(o)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const g=Jn(e.slice(p));if(g===-1)return null;u--;const b=p+g+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;const b=e.slice(p,p+g+1);/\/\s*>$/.test(b)||u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function NZ(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
|
|
225
|
+
`){n++;continue}return-1}return o===t.length?n:-1}function IZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
226
|
+
</${t}>`}function iS(e){return e.replace(/\r\n/g,`
|
|
227
|
+
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function LZ(e,t,n){return n?e.includes(n,t)?!0:iS(e.slice(Math.max(0,t))).includes(iS(n)):!1}function $Z(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
228
|
+
`&&n++,n):e[n]===`
|
|
229
|
+
`?n+1:t}function rS(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function FZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function pk(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Gs(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function wM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const OZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),RZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function BZ(e){return/\n\s*\n/.test(e)||RZ.test(e)}function DZ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>OZ.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!BZ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function PZ(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||B6.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Jn(l);if(a===-1)return s;const c=pk(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=ud(u,t,wM(n,o));return DZ(u,d)?{...s,children:d}:s})}function ud(e,t,n){return e.trim()?SM(e,t,{...n,__disableStreamParse:!0}):[]}function HZ(e,t,n){const o=ud(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function WZ(e,t,n){const o=gM({content:e}),s=Jn(e),i=pk(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=HZ(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function zZ(e,t,n){const o=Jn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=hk(s,"summary",0);if(!i)return ud(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...ud(r,t,n),WZ(i.raw,t,n),...ud(l,t,n)]}function _M(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=cd(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!rS(c)){r.push(c);continue}const f=String(c.raw??cd(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,g=-1;for(let Z=a+1;Z<e.length;Z++){const K=e[Z];if(rS(K)){p++;continue}if(FZ(K)&&(p--,p===0)){g=Z;break}}const b=hk(t,"details",h),v=g===-1&&b?.closed===!0,m=v?(()=>{const Z=pk(f,"details");return Z!==-1?f.slice(0,Z):f})():f,[y]=_M(v?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,o,s,h+f.length),k=zZ(m,n,wM(o,s)),A=g===-1?"</details>":String(e[g].raw??cd(e[g])??"</details>"),$=v||g!==-1&&b?.closed===!0,I=A.replace(/[\t\r\n ]+$/,""),x=$?(()=>{const Z=(b?.raw??"").lastIndexOf(I);return Z===-1?t.length:h+Z})():t.length,L=Jn(f),E=v&&L!==-1?h+L+1:h+f.length,F=t.slice(E,x===-1?t.length:x),S=n.parse(F,{__markstreamFinal:s}),N=n.renderer.render(S,n.options,{__markstreamFinal:s}),D=x+I.length,B=$?Math.max(x+A.length,$Z(t,D)):t.length,U=$?t.slice(x,B):A,H=$?t.slice(h,B):t.slice(h),P=v&&L!==-1?f.slice(0,L+1):f;if(r.push({...c,tag:"details",attrs:Im(f.slice(0,L+1)),raw:H,content:`${P}${N}${U}`,children:[...k,...y],loading:!s&&!$}),l=$?B:t.length,g===-1&&!v)break;g!==-1&&(a=g)}return[r,l]}function UZ(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=cd(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=hk(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),h=IZ(u.raw,c,u.closed),p=!t&&!u.closed,g=d!==h||f!==u.raw||!!r.loading!==p,b=Jn(u.raw),v=b===-1?"":u.raw.slice(0,b+1),m=v?Im(v):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=m.length?m:void 0,!g)continue;let y=NZ(u.raw,f);y===-1&&(y=0);const k=i+1;for(;k<o.length;){if(u.closed&&TZ(o[k],c)){o.splice(k,1);continue}const A=cd(o[k]);if(!A)break;const $=u.raw.indexOf(A,y);if($===-1){if(LZ(n,u.end,A))break;o.splice(k,1);continue}y=$+A.length,o.splice(k,1)}}return o}function qZ(e){const t=l=>l===" "||l===" "||l===`
|
|
230
|
+
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=g=>{const b=g.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=g=>{const b=g.charCodeAt(0);return b>=48&&b<=57},d=g=>g==="!"||c(g),f=g=>c(g)||u(g)||g===":"||g==="-",h=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=m=>m===" "||m===" ",h=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;const k=m[y];if(k!=="`"&&k!=="~")return null;let A=y;for(;A<m.length&&m[A]===k;)A++;const $=A-y;return $<3?null:{markerChar:k,markerLen:$,rest:m.slice(A)}},p=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;let k=!1;for(;y<m.length&&m[y]===">";)for(k=!0,y++;y<m.length&&f(m[y]);)y++;return k?m.slice(y):null},g=m=>{const y=h(m);if(y)return y;const k=p(m);return k==null?null:h(k)};let b=0;const v=l.split(/\r?\n/);for(const m of v){const y=b,k=b+m.length;if(a<y)break;const A=g(m);if(A){const $=A.markerChar,I=A.markerLen;c?$===u&&I>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=$,d=I)}if(a<=k)break;b=k+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
|
|
231
|
+
`||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
232
|
+
`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function jZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const g=p.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let g=0;for(let b=0;b<p.length;b++){const v=p[b];if(v===" "){if(g++,g>=4)return!0;continue}if(v===" ")return!0;break}return!1},r=p=>{let g=!1,b=!1;for(let v=0;v<p.length;v++){const m=p[v];if(m==="\\"){v++;continue}if(!b&&m==="'"){g=!g;continue}if(!g&&m==='"'){b=!b;continue}if(!g&&!b&&m===">")return v}return-1},l=p=>{let g=0;for(;g<p.length&&o(p[g]);)g++;const b=p[g];if(b!=="`"&&b!=="~")return null;let v=g;for(;v<p.length&&p[v]===b;)v++;const m=v-g;return m<3?null:{markerChar:b,markerLen:m,rest:p.slice(v)}},a=(p,g)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let v=!1,m=0;for(;m<p.length;){const y=p[m];if(y!=="<"){o(y)||(v=!0),m++;continue}const k=r(p.slice(m));if(k===-1){v=!0,m++;continue}const A=p.slice(m,m+k+1);let $=1;for(;$<A.length&&o(A[$]);)$++;if($>=A.length){v=!0,m++;continue}const I=A[$];if(I==="!"||I==="?"){v=!0,m+=k+1;continue}if(I==="/"){v=!0,m+=k+1;continue}const x=$;for(;$<A.length&&s(A[$]);)$++;if($===x){v=!0,m++;continue}const L=A.slice(x,$).toLowerCase(),E=A[$];if(E&&E!==" "&&E!==" "&&E!==">"&&E!=="/"){v=!0,m++;continue}const F=new RegExp(String.raw`<\s*\/\s*${L}\s*>`,"i"),S=/\/\s*>$/.test(A),N=F.test(p.slice(m+k+1)),D=F.test(e.slice(g+m+k+1)),B=/[\r\n]/.test(e.slice(g+m+k+1));if(v&&n.has(L)&&!S&&!N&&(D||B))return m;v=!0,m+=k+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
233
|
+
`,h),g=p!==-1,b=g&&p>h&&e[p-1]==="\r",v=g?b?p-1:p:e.length,m=e.slice(h,v),y=g?b?`\r
|
|
234
|
+
`:`
|
|
235
|
+
`:"",k=l(m);let A=m;if(!c&&!k){const $=a(m,h);if($!==-1){const I=y||`
|
|
236
|
+
`;A=`${m.slice(0,$).replace(/[ \t]+$/,"")}${I}${I}${m.slice($).replace(/^[ \t]+/,"")}`}}f+=A,f+=y,k&&(c?k.markerChar===u&&k.markerLen>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=k.markerChar,d=k.markerLen)),h=g?p+1:e.length}return f}function VZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const g=d[p];if(g==="\\"){p++;continue}if(!h&&g==="'"){f=!f;continue}if(!f&&g==='"'){h=!h;continue}if(!f&&!h&&g===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let b=g+1;for(;b<d.length&&o(d[b]);)b++;if(b>=d.length||d[b]!=="/"){g=d.indexOf("<",g+1);continue}for(b++;b<d.length&&o(d[b]);)b++;if(b+p.length>d.length){g=d.indexOf("<",g+1);continue}let v=!0;for(let y=0;y<p.length;y++){const k=d[b+y];if((k>="A"&&k<="Z"?String.fromCharCode(k.charCodeAt(0)+32):k)!==p[y]){v=!1;break}}if(!v){g=d.indexOf("<",g+1);continue}let m=b+p.length;if(m<d.length&&s(d[m])){g=d.indexOf("<",g+1);continue}for(;m<d.length&&o(d[m]);)m++;if(m<d.length&&d[m]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const g=r(d.slice(f));if(g===-1)return d;const b=f+g;if(l(d,b+1,p))return d;const v=i(d.slice(b+1));return v?`${d.slice(0,b+1)}
|
|
237
|
+
${v}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
238
|
+
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
239
|
+
`:`
|
|
240
|
+
`,u=d+1}return c}function KZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,g=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;g=h}return p?{prefix:f.slice(0,g),content:f.slice(g)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let g=h;for(;g<f.length&&f[g]===p;)g++;const b=g-h;return b<3?null:{markerChar:p,markerLen:b,rest:f.slice(g)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
241
|
+
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",g=h?p?f-1:f:e.length,b=e.slice(d,g),v=h?p?`\r
|
|
242
|
+
`:`
|
|
243
|
+
`:"",m=s(b),y=m?.prefix??"",k=m?.content??b,A=i(k);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let $=k;if(!l&&$.includes("</"))for(const I of r)$=$.replace(I,(x,L,E,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return x;const S=F.slice(0,E).replace(/^[\t ]+/,"");if(S.length>0){const N=L.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",D=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!N||!D||N!==D)return x}return`${L}
|
|
244
|
+
|
|
245
|
+
`});if(y){const I=y+$.split(`
|
|
246
|
+
`).join(`
|
|
247
|
+
${y}`);u+=I}else u+=$;u+=v,d=h?f+1:e.length}return u}function GZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let N=0;for(let D=0;D<S.length;D++){const B=S[D];if(B===" "){if(N++,N>=4)return!0;continue}if(B===" ")return!0;break}return!1},i=S=>{const N=S.charCodeAt(0);return N>=65&&N<=90||N>=97&&N<=122||N>=48&&N<=57||S==="_"||S==="-"||S===":"},r=S=>{let N=0;for(;N<S.length&&o(S[N]);)N++;return S.slice(N)},l=S=>{let N=0,D=!1,B=0;for(;N<S.length;){for(;N<S.length&&o(S[N]);)N++;if(N>=S.length||S[N]!==">")break;for(D=!0,N++;N<S.length&&o(S[N]);)N++;B=N}if(!D)return null;const U=S.slice(0,B);return{prefix:U,key:U.replace(/[ \t]+$/,""),content:S.slice(B)}},a=S=>r(S).startsWith("<"),c=S=>{for(let N=0;N<S.length;N++){const D=S[N];if(D!==" "&&D!==" ")return!1}return!0},u=S=>{if(s(S))return"";const N=r(S);if(!N.startsWith("<"))return"";let D=1;for(;D<N.length&&o(N[D]);)D++;if(D>=N.length||N[D]==="/"||N[D]==="!"||N[D]==="?")return"";const B=D;for(;D<N.length&&i(N[D]);)D++;if(D===B)return"";const U=N.slice(B,D).toLowerCase();if(!n.has(U))return"";const H=N[D];return H&&H!==" "&&H!==" "&&H!==">"&&H!=="/"?"":U},d=S=>{if(s(S))return null;const N=r(S);if(!N.startsWith("<"))return null;let D=1;for(;D<N.length&&o(N[D]);)D++;if(D>=N.length)return null;const B=N[D]==="/";if(B)for(D++;D<N.length&&o(N[D]);)D++;const U=N[D];if(!U||U==="!"||U==="?")return null;const H=D;for(;D<N.length&&i(N[D]);)D++;if(D===H)return null;const P=N.slice(H,D).toLowerCase();if(!n.has(P))return null;const Z=N[D];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(B)return{type:"close",name:P};if(/\/\s*>\s*$/.test(N))return{type:"open",name:P,complete:!0};const K=N.indexOf(">",D);if(K!==-1){const V=N.slice(K+1);if(new RegExp(`<\\s*\\/\\s*${P}\\s*>`,"i").test(V))return{type:"open",name:P,complete:!0}}return{type:"open",name:P,complete:!1}},f=S=>{if(s(S))return null;const N=r(S).replace(/[ \t]+$/,"");if(!N.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(N))return null;const D=N.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(D?.[1])return D[1].toLowerCase();const B=N.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!B?.[1]||!B[2])return null;const U=B[1].toLowerCase();return U===B[2].toLowerCase()?U:null};let h=!1,p="",g=0;const b=S=>{let N=0;for(;N<S.length&&o(S[N]);)N++;const D=S[N];if(D!=="`"&&D!=="~")return null;let B=N;for(;B<S.length&&S[B]===D;)B++;const U=B-N;return U<3?null:{markerChar:D,markerLen:U,rest:S.slice(B)}},v=S=>b(S),m=S=>{const N=r(S);return N?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(N):!1},y=(S,N,D)=>{let B=S,U=0;for(;B<e.length;){const H=e.indexOf(`
|
|
248
|
+
`,B),P=H!==-1,Z=P&&H>B&&e[H-1]==="\r",K=P?Z?H-1:H:e.length,V=e.slice(B,K),J=l(V),he=J?.key??"";if(U>0&&N&&he!==N)break;const ne=J?.content??V,ue=d(ne);if(ue?.name===D){if(ue.type==="open")ue.complete||U++;else if(U>0&&(U--,U===0))return!1}else if(U>0&&(c(ne)||m(ne)))return!0;if(P)B=H+1;else break}return!1};let k="",A=0,$=!0,I=!1,x=!1,L=`
|
|
249
|
+
`;const E=[];let F="";for(;A<e.length;){const S=e.indexOf(`
|
|
250
|
+
`,A),N=S!==-1,D=N&&S>A&&e[S-1]==="\r",B=N?D?S-1:S:e.length,U=e.slice(A,B),H=N?D?`\r
|
|
251
|
+
`:`
|
|
252
|
+
`:"",P=l(U),Z=P?.key??"",K=P?.content??U,V=v(K);V&&(h?V.markerChar===p&&V.markerLen>=g&&/^\s*$/.test(V.rest)&&(h=!1,p="",g=0):(h=!0,p=V.markerChar,g=V.markerLen));const J=E.length>0;if(!h&&!J){const ne=u(K),ue=!!ne&&!$&&I&&x&&y(A,Z,ne);ne&&!$&&(!I||ue)&&(Z&&F&&Z===F?k+=`${Z}${L}`:Z||(k+=L))}if(k+=U,k+=H,H&&(L=H),!h){const ne=d(K);if(ne){if(ne.type==="open")ne.complete||E.push(ne.name);else for(let ue=E.length-1;ue>=0;ue--)if(E[ue]===ne.name){E.length=ue;break}}}const he=c(K);$=he,I=!he&&a(K),x=!he&&!!f(K),F=Z,A=N?S+1:e.length}return k}function SM(e,t,n={}){const o=kM(n),s=o?Jc():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(mZ(t,n)&&(t.stream.reset(),gZ(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
|
|
253
|
+
`)?`
|
|
254
|
+
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
|
|
255
|
+
`)?`
|
|
256
|
+
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
|
|
257
|
+
`)?`
|
|
258
|
+
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
259
|
+
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
|
|
260
|
+
`)?`
|
|
261
|
+
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,v,m)=>`${v}${m.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
|
|
262
|
+
`)?`
|
|
263
|
+
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
264
|
+
`))),n.customHtmlTags?.length&&r.includes("<")){const b=au(n.customHtmlTags);if(b.length&&(r=jZ(r,b),r=VZ(r,b),r=GZ(r,b),r=KZ(r,b),r.includes("</")))for(const v of b){const m=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(m,"$1$2$2")}}i||(r=qZ(r));const l=EZ(r);if(l){const b=n.preTransformTokens,v=n.postTransformTokens;if(xM(t,n)||typeof b=="function"||typeof v=="function"){const m=nS(t,r,{__markstreamFinal:i},n),y=typeof b=="function"&&b(m)||m;typeof v=="function"&&v(y)}return B0(l,o,s)}const a=nS(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return B0([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=J_(d,p,o);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const v=b[0],m=v?.type;v&&typeof m=="string"?g=J_(b,void 0,o):g=b}}if(g=UZ(g,i,r),g=_M(g,r,t,n,i)[0],g=PZ(g,t,n,i),i){const b=new WeakSet,v=m=>{if(!m||typeof m!="object"||b.has(m))return;if(b.add(m),Array.isArray(m)){for(const k of m)v(k);return}const y=m;y.type==="html_block"&&y.loading===!0&&(y.loading=!1);for(const k of Object.values(y))v(k)};v(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),B0(g,o,s)}function lS(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Hl(t);let s=0;for(;s<e.length;){const i=dk(e,s,o.options(),uk);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=uZ(e,s,o.options(l)),c=sS(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=cu(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=uu(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(cZ()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=eo(r.children||[],l,void 0,o.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=sS(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const YZ=new Set([...Xd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),ZZ=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"]),aS=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function cS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function QZ(e){return typeof e=="string"?e:e==null?"":String(e)}function CM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function yl(e){return QZ(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function AM(e){return yl(e).replace(/`/g,"`")}function Om(e){return String(e??"").trim().toLowerCase()}function mk(e,t="safe"){const n=Om(e);return n?t==="escape"?!0:t==="trusted"?Xd.has(n):!ZZ.has(n):!1}function MM(e,t="safe"){const n=Om(e);return n?t==="escape"?!0:t==="trusted"?Xd.has(n):YZ.has(n):!1}function uS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${AM(o)}"`).join("")}function XZ(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||Ca(s,{tagName:t,attrName:"srcset"})})}function EM(e,t,n,o){return OV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?XZ(t,o):!!(RV.has(e)&&t&&Ca(t,{tagName:o,attrName:e}))}function pa(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function TM(e,t,n,o=!1){if(t!=="safe"||Om(n)!=="a")return e;const s=pa(e,"href");if(o&&(!s||!e[s])){const a=pa(e,"target"),c=pa(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=pa(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=pa(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 dS(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!CM(r)||EM(l,i,t,n)||(o[r]=i)}return TM(o,t,n,!!pa(e,"href"))}function NM(e,t){const n=e.toLowerCase();return R6.has(n)?!1:cS(t,n)||cS(t,e)}function gk(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!CM(r)||EM(l,i,t,n)||(o[r]=i)}return TM(o,t,n,!!pa(e,"href"))}function Mp(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function kv(e,t="safe",n){const o=gk(Mp(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function JZ(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function eQ(e){const t={};for(const[n,o]of Object.entries(e))t[n]=JZ(o,n);return t}function fS(e){return e.trim().length>0}function tQ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);fS(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);fS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Pa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function nQ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Pa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function oQ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${yl(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${yl(o)}`:` ${yl(o)}="${AM(s)}"`).join("");return e.type==="self_closing"?`<${yl(t)}${n} />`:`<${yl(t)}${n}>`}function sQ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;aS.lastIndex=0;let n;for(;(n=aS.exec(e))!==null;)if(NM(n[1],t))return!0;return!1}function Wc(e,t="safe"){if(!e)return"";if(t==="escape")return yl(e);const n=nQ(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(yl(r.content??""));continue}const l=Om(r.tagName);if(!l)continue;if(MM(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"&&mk(l,t)){s.push(oQ(r));continue}if(r.type==="self_closing"){s.push(`<${l}${uS(dS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${uS(dS(r.attrs??{},t,l))}>`),Pa.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const iQ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],hS="http://www.w3.org/2000/svg",rQ=new Set(["script","style","iframe","object","embed","link","meta"]),lQ=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"]),aQ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),cQ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),uQ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function dQ(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 hQ(e){const t=e.nodeName.toLowerCase();return t==="use"?dQ(e):t==="image"?fQ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():uQ.has(t)}function pQ(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 mQ(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?Ca(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ca(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Ca(i,{tagName:o,attrName:s})?"":i:""}function gQ(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function IM(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function LM(e){const t=IM(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=gQ(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function pS(e){const t=IM(e);return iQ.some(n=>n.test(t))||LM(t)}function vQ(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 th(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function $M(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!rQ.has(o)){if(o==="br"){t.push(`
|
|
265
|
+
`);return}for(const s of Array.from(n.childNodes))$M(s,t)}}function yQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];$M(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=th(t.getAttribute("width")),i=th(t.getAttribute("height")),r=th(t.getAttribute("x")),l=th(t.getAttribute("y")),a=e.ownerDocument.createElementNS(hS,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(hS,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function kQ(e){yQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!lQ.has(o)){n.remove();continue}if(o==="style"&&pS(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&pS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(aQ.has(r)&&i.value){const l=mQ(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(cQ.has(r)&&i.value&&LM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=pQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}vQ(n)}}function o_e(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 kQ(n),bQ(n)?null:n}catch{return null}}function bQ(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){hQ(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const mS=[];function P0(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function xQ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function wQ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function gS(e=`editor-${Date.now()}`,t={}){const n=PG(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=h=>f[h]??o[h]??h}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...g]=h;typeof p=="function"&&n.use(p,...g)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(mS.length)for(const f of mS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(oz),n.use(rz),n.use(ez);const i=bz,r=i.default??i;n.use(r),n.use(JW),n.use(XW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,g=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const v of h.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const m=v.map[0],y=v.map[1],k=v.markup,A=k[0],$=k.length,I=b[Math.max(0,y-1)]??"";let x=0;for(;x<I.length&&(I[x]===" "||I[x]===" ");)x++;let L=0;for(;x+L<I.length&&I[x+L]===A;)L++;let E=x+L;for(;E<I.length&&(I[E]===" "||I[E]===" ");)E++;const F=g?!0:y>m+1&&L>=$&&E===I.length,S=v;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,g=p.pos;if(p.src[g]!=="~")return!1;const b=p.src[g-1],v=p.src[g+1];if(/\d/.test(b)&&/\d/.test(v)){if(!h){const m=p.push("text","",0);m.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],g=String(p.info??"").trim(),b=String(p.content??""),v=btoa(unescape(encodeURIComponent(b))),m=xQ(g),y=P0(m),k=wQ(`editor-${e}-${h}-${m}`),A=P0(s("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${y}" id="${k}">
|
|
266
|
+
<div class="code-header">
|
|
267
|
+
<span class="code-lang">${P0(m.toUpperCase())}</span>
|
|
268
|
+
<button class="copy-button" data-code="${v}">${A}</button>
|
|
269
|
+
</div>
|
|
270
|
+
<div class="code-editor"></div>
|
|
271
|
+
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const g=a.exec(p.src.slice(p.pos));if(!g)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=p.src.slice(p.pos+g[0].length);if(v.startsWith("](")||v.startsWith("(")||u(v))return!1;if(!h){const m=g[1],y=p.push("reference","span",0);y.content=m,y.markup=g[0],y.raw=g[0]}return p.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const g=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}function _Q({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 FM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:_Q({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const vS=new WeakMap;function SQ(e){let t=vS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},vS.set(e,t)),t}function yS(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function vk(e){return!!(e.themes?.length||e.langs?.length)}function OM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function CQ(e,t){return!t?.length||e.registeredAllLangs?!0:OM(e.registeredLangs,t)}function H0(e,t){return vk(t)&&OM(e.registeredThemes,t.themes)&&CQ(e,t.langs)}function AQ(e,t){if(!vk(t))return t;const n=yS(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:yS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const MQ={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 EQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function RM(e){const t=EQ(e);return MQ[t]??t}function BM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>RM(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function DM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function TQ(e){return DM(e)?.join("\0")??""}function PM(e,t){const n=DM(e),o=BM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function Ep(e,t){return`${TQ(e)}\0\0${BM(t)?.join("\0")??""}`}function s_e(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=PM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:Ep(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function i_e(e,t={},n){if(!e)return"ready";const o=PM(t.themes,t.langs),s=Ep(o.themes,o.langs),i=n&&n===s?n:s,r=SQ(e);if(r.completed.has(i))return"ready";if(H0(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||H0(r,o))return r.completed.add(i),"ready";const c=AQ(r,o),u=Ep(c.themes,c.langs);return r.completed.has(u)||H0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(vk(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 ic(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function kS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var NQ=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=bS();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=bS();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,g=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=FQ(p/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const v=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),m=$Q(this.source.slice(this.visible.length),v,this.segmenter);m.text&&(this.visible+=m.text,this.charBudget=Math.max(0,this.charBudget-m.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=ic(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ic(o,1e3,1)),this.normalizedTargetLatencyMs=ic(s,900,1),this.normalizedCatchUpLatencyMs=ic(i,350,1),this.normalizedCatchUpThreshold=kS(r,600),this.normalizedStartDelayMs=kS(a,80),this.maxCommitFps=Math.trunc(ic(l,30,1)),this.maxCharsPerCommit=Math.trunc(ic(c,80,1)),this.flushOnFinish=u,this.segmenter=LQ(),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 IQ(e={},t){const n=new NQ(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 LQ(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function $Q(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function bS(){return typeof performance<"u"?performance.now():Date.now()}function FQ(e,t,n){return Math.min(n,Math.max(t,e))}var OQ=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const bv=Symbol.for("markstream-vue:node-lifecycle"),xS='<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>',wS='<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>',RQ={id:"material",core:{"":wS,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:wS,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:xS,csharp:xS,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>ms(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},xv=new Map;let _S="material";const Ac=new Map,SS=new Map;let wv=null;function BQ(e){xv.set(e.id,e)}function DQ(e){return OQ(this,null,function*(){var t,n,o;if(Ac.has(e.id))return(t=Ac.get(e.id))!=null?t:null;let s=SS.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Ac.set(e.id,i),wv?.(),i)).catch(()=>(Ac.set(e.id,null),null)),SS.set(e.id,s)),s})}const PQ=Ra(0);wv=()=>{PQ.value++},BQ(RQ);const HQ={"":"",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 yk(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=HQ[n])!=null?t:n}function r_e(e){const t=yk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function l_e(e){return(function(o){const s=xv.get(_S);if(!s)return;const i=s.core[o];if(i)return i;const r=Ac.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!Ac.has(s.id)&&DQ(s)})(yk(e))||((n=(t=xv.get(_S))==null?void 0:t.fallback)!=null?n:"");var t,n}const a_e={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 HM=!1;function c_e(){return HM}function u_e(){HM=!0}var Rm=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let js=null,Mh=!1,Bm=bk;function Dm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function kk(){try{const e=globalThis;return Dm(e?.katex)}catch{return null}}function bk(){return Rm(null,null,function*(){const e=kk();if(e)return e;const t=yield ms(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ms(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Dm(t)})}function WQ(e){Bm=e,js=null,Mh=!1}function zQ(e){WQ(bk)}function WM(){return typeof Bm=="function"}function d_e(){var e;const t=Bm;if(!t||t===bk)return null;if(js)return js;const n=kk();if(n)return js=n,js;try{const o=t();return o&&typeof o?.then!="function"?(js=(e=Dm(o))!=null?e:o,js):null}catch{return null}}function xk(){return Rm(this,null,function*(){var e;const t=kk();if(t)return js=t,js;if(js)return js;if(Mh)return null;const n=Bm;if(!n)return Mh=!0,null;try{const o=yield n();if(o)return js=(e=Dm(o))!=null?e:o,js}catch{}return Mh=!0,null})}function zM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let xl=null,ml=null;const pi=new Map,Fr=new Map;let Tp=5;const ka=new Set;function Pd(){if(pi.size<Tp&&ka.size){const e=Array.from(ka);ka.clear();for(const t of e)try{t()}catch{}}}function UQ(e){xl=e,ml=null,xl.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=pi.get(n);if(i)if(pi.delete(n),clearTimeout(i.timeoutId),Pd(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Fr.set(a,o),Fr.size>200){const c=Fr.keys().next().value;Fr.delete(c)}}i.resolve(o)}},xl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of pi.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));pi.clear(),Pd()}}function qQ(){var e;xl&&((e=xl.terminate)==null||e.call(xl)),xl=null,ml=null}function jQ(e,t=!0,n=2e3,o){return Rm(this,null,function*(){performance.now();const s=zM(e);if(!WM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(ml)return Promise.reject(ml);const i=`${t?"d":"i"}:${s}`,r=Fr.get(i);if(r)return Promise.resolve(r);const l=xl||(ml=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),ml.name="WorkerInitError",ml.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(ml);if(pi.size>=Tp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=pi.size,a.max=Tp,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{pi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Pd()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),pi.has(u)&&pi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Pd()},{once:!0});const f=a,h=c;pi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function f_e(e,t=!0,n){const o=`${t?"d":"i"}:${zM(e)}`;if(Fr.set(o,n),Fr.size>200){const s=Fr.keys().next().value;Fr.delete(s)}}const VQ="WORKER_BUSY";function KQ(e=2e3,t){return pi.size<Tp?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),ka.delete(r),n())};if(ka.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,ka.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>Pd()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),ka.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Bu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function h_e(e){return Rm(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!WM()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(s=o.timeout)!=null?s:Bu.timeout,c=(i=o.waitTimeout)!=null?i:Bu.waitTimeout,u=(r=o.backoffMs)!=null?r:Bu.backoffMs,d=(l=o.maxRetries)!=null?l:Bu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Bu.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield jQ(t,n,a,h)}catch(g){if(g?.code!==VQ||p>=f)throw g;if(p++,yield KQ(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function Mc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function GQ(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function _v(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=GQ(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function Sv(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 UM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Cv(e,t=360,n=500){return UM(e,t,n)}function Av(e,t=360,n=500){return UM(e,t,n)}var YQ=Object.defineProperty,ZQ=Object.defineProperties,QQ=Object.getOwnPropertyDescriptors,CS=Object.getOwnPropertySymbols,XQ=Object.prototype.hasOwnProperty,JQ=Object.prototype.propertyIsEnumerable,AS=(e,t,n)=>t in e?YQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qM=(e,t)=>{for(var n in t||(t={}))XQ.call(t,n)&&AS(e,n,t[n]);if(CS)for(var n of CS(t))JQ.call(t,n)&&AS(e,n,t[n]);return e},wk=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const _k=()=>ms(()=>import("./mermaid.core-DKDe9fI9.js").then(e=>e.bn),[]);let br=null,Sk=_k;function eX(e){Sk=e,br=null}function tX(e){eX(_k)}function nX(){return typeof Sk=="function"}function MS(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=qM({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},ZQ(n,QQ(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function ES(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=qM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function p_e(){return wk(this,null,function*(){if(br)return br;const e=(function(){try{const o=globalThis;return MS(o?.mermaid)}catch{return null}})();if(e)return br=e,ES(br),br;const t=Sk;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===_k?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(br=MS(n),ES(br),br):null})}let hs=null,gl=null;const Uo=new Map;let TS=5,NS=!1;const oX="WORKER_BUSY",sX="MERMAID_DISABLED";function iX(e){hs=e,gl=null;const t=e;hs.onmessage=n=>{if(hs!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Uo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},hs.onerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{NS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error(`Worker error: ${n.message}`));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},hs.onmessageerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{NS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error("Worker messageerror"));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function rX(){var e;if(hs)try{for(const[t,n]of Uo.entries())n.reject(new Error("Worker cleared"));Uo.clear(),(e=hs.terminate)==null||e.call(hs)}catch{}hs=null,gl=null}function jM(e,t,n=1400){if(!nX()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=sX,Promise.reject(s)}if(gl)return Promise.reject(gl);const o=hs||(gl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),gl.name="WorkerInitError",gl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(gl);if(Uo.size>=TS){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=oX,s.inFlight=Uo.size,s.max=TS,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Uo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};Uo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return Uo.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=Uo.get(r);f&&f.reject(d)},n)})}function m_e(e,t,n=1400){return wk(this,null,function*(){try{return yield jM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function g_e(e,t,n=1400){return wk(this,null,function*(){try{return yield jM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function v_e(){if(hs)try{for(const[e,t]of Uo.entries())t.reject(new Error("Worker terminated"));Uo.clear(),hs.terminate()}finally{hs=null}}var lX=Object.defineProperty,aX=Object.defineProperties,cX=Object.getOwnPropertyDescriptors,IS=Object.getOwnPropertySymbols,uX=Object.prototype.hasOwnProperty,dX=Object.prototype.propertyIsEnumerable,LS=(e,t,n)=>t in e?lX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))uX.call(t,n)&&LS(e,n,t[n]);if(IS)for(var n of IS(t))dX.call(t,n)&&LS(e,n,t[n]);return e},Dt=(e,t)=>aX(e,cX(t)),Xn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const fX="__global__",W0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Mv=(()=>{const e=globalThis;if(e[W0])return e[W0];const t={scopedCustomComponents:{},revision:Ra(0)};return e[W0]=t,t})(),$S=Mv.revision,hX=Symbol("markstreamCustomComponents"),pX=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 tf(e){return pX.has(String(e).trim().toLowerCase())}function mX(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function z0(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([_i(n),_i(mX(n))]))!s||tf(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function Co(e){const t=Kt(hX,null);return R(()=>{var n;return $S.value,(function(o,s={}){return $S.value,lt(lt(lt({},z0(Mv.scopedCustomComponents[fX]||{})),z0(s)),z0((function(i){return i&&Mv.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const gX=["aria-label"],vX={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"},yX={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"},gn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ys=gn(Ze({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),T("svg",yX,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),T("svg",vX,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,gX))}),[["__scopeId","data-v-be21ab83"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const kX={class:"emoji-node"},$s=gn(Ze({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",kX,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);$s.install=e=>{e.component($s.__name,$s)};const bX=["id"],xX=["title"],Zs=gn(Ze({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(w(),T("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,xX)],8,bX))}}),[["__scopeId","data-v-c1463a29"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const VM=(()=>{try{return!1}catch{}return!1})();function U0(e){VM&&console.warn(e)}function FS(e,t="safe",n){return gk(e,t,n)}function KM(e){return eQ(e)}function q0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function Ck(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=kv((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),q0(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),q0(r.value)]):Object.entries(s).map(([r,l])=>[r,q0(l)]):null,t,n);var s;if(!o)return;const i=KM(Mp(o));return Object.keys(i).length>0?i:void 0}function OS(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function Du(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function j0(e,t,n,o,s,i,r=!1){const l=(function(d,f){return NM(d,f)})(e,o);if(Xd.has(e.toLowerCase())||!l&&MM(e,i))return null;if(!l&&mk(e,i))return r?[OS(e,t,!0)]:[OS(e,t),...n,`</${e}>`];const a=gk(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=KM(a);return mn(d,Dt(lt({},f),{key:u}),n.length>0?n:void 0)}return mn(e,Dt(lt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function GM(e,t){return sQ(e,t)}function Np(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=j0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Du(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),g=j0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Du(c[c.length-1].children,g):Du(u,g),p.tagName.toLowerCase()!==f&&c.length>h&&U0(`Auto-closing unclosed tag: <${p.tagName}>`)}else U0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=j0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Du(c[c.length-1].children,f):Du(u,f),U0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(tQ(e),t,n)}catch(s){return o=s,VM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const wX=["innerHTML"],Qs=gn(Ze({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=R(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=Co(()=>t.customId),i=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=R(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Wc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Np(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!GM(l,s.value))return{mode:"html",content:Wc(l,o.value)};const a=Np(l,s.value,o.value);return a===null?{mode:"html",content:Wc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),T("span",{key:0,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[re(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),T("span",{key:1,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(w(),T("span",{key:2,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,wX))}}),[["__scopeId","data-v-d17f12b0"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const _X={class:"inline-code"},SX={key:0},ts=gn(Ze({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Kd(),o=Kt("markstreamFade",void 0),s=Kt("markstreamTextStreamState",void 0),i=Kt("markstreamStreamVersion",void 0),r=R(()=>{const m=n.fade;return m===""||m===!0||m==="true"||m!==!1&&m!=="false"&&void 0}),l=R(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=R(()=>{var m;return String((m=t.node.code)!=null?m:"")}),c=R(()=>!l.value),u=R(()=>{var m;const y=(m=n["index-key"])!=null?m:n.indexKey;return y==null||y===""?"":String(y)}),d=X(t.node.code),f=X("");let h=i?.value;const p=X(0);function g(){return d.value+f.value}function b(){f.value&&(d.value=g(),f.value="")}Qe([()=>t.node.code,u,l,()=>i?.value],([m,y,k,A])=>{const $=String(m??""),I=u.value,x=A!==h;h=A;const L=FM({nextContent:$,persistedContent:I?s?.get(I):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=L.settledContent,f.value=L.streamedDelta,L.appended&&(p.value+=1),I&&s?.set(I,$)},{immediate:!0}),Qe(l,m=>{var y;m||(y=g(),d.value=y,f.value="")});const v=R(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(m,y)=>(w(),T("code",_X,[c.value?(w(),T(Pe,{key:0},[Je(O(a.value),1)],64)):(w(),T(Pe,{key:1},[d.value?(w(),T("span",SX,O(d.value),1)):ce("",!0),f.value?(w(),T("span",{key:1,class:We(["inline-code-stream-delta",[v.value]]),onAnimationend:b},O(f.value),35)):ce("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);ts.install=e=>{e.component(ts.__name,ts)};const Ev=X(!1),RS=X(""),BS=X("top"),dd=X(null),fd=X(null),Tv=X(null),Nv=X(null),DS=X(null);let Eh=null,Th=null,Iv=0;function YM(){Eh&&(clearTimeout(Eh),Eh=null),Th&&(clearTimeout(Th),Th=null)}let nh=!1,oh=null,PS=!1;function CX(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Iv;YM();const l=()=>Xn(null,null,function*(){var a,c;if(yield(function(){return Xn(this,null,function*(){if(!nh&&!PS&&typeof document<"u"){oh!=null||(oh=Xn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ms(()=>import("./vue.runtime.esm-bundler-CPECXINV.js"),[]),ms(()=>import("./Tooltip-BR3ab6GW.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:Ev.value,"anchor-el":dd.value,content:RS.value,placement:BS.value,id:fd.value,originX:Tv.value,originY:Nv.value,isDark:(p=DS.value)!=null?p:void 0})}}).mount(h),nh=!0}));try{yield oh}catch(u){nh=!1,oh=null,PS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),nh&&r===Iv){fd.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,dd.value=e,RS.value=t,BS.value=n,Tv.value=(a=s?.x)!=null?a:null,Nv.value=(c=s?.y)!=null?c:null,DS.value=typeof i=="boolean"?i:null,Ev.value=!0;try{e.setAttribute("aria-describedby",fd.value)}catch{}}});o?l():Eh=setTimeout(l,80)}function AX(e=!1){Iv+=1,YM();const t=()=>{if(dd.value&&fd.value)try{dd.value.removeAttribute("aria-describedby")}catch{}Ev.value=!1,dd.value=null,fd.value=null,Tv.value=null,Nv.value=null};e?t():Th=setTimeout(t,120)}const Lv={"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..."},$v=e=>{var t;return(t=Lv[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function HS(e){return{t(t){if(e.te&&Lv[t]&&!e.te(t))return $v(t);const n=e.t(t);return n===t&&Lv[t]?$v(t):n}}}function MX(){const e=(function(){var t,n;try{const o=Yo(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return HS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return HS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:$v}}function EX(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const TX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],NX={key:1,class:"image-placeholder"},IX={key:1,class:"image-node__raw-text"},LX={key:0,class:"image-shimmer-overlay"},$X={key:1,class:"image-node__raw-text"},FX={key:2,class:"image-error"},Al=gn(Ze({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,s=X(!1),i=X(!1),r=X(""),l=X("primary"),a=X(null),c=Kd(),u=Kt(bv,null);let d="",f=null;const h=R(()=>b_(n.node.src)),p=R(()=>b_(n.fallbackSrc)),g=R(()=>r.value),b=R(()=>!n.lazy),v=R(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),m=R(()=>l.value==="failed"),y=R(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),k=R(()=>EX(n,c));function A(D=k.value){D&&a.value&&u?.reportHeight(D,a.value.offsetHeight)}function $(D=k.value){D&&mt(()=>{A(D)})}function I(){f&&(clearTimeout(f),f=null)}function x(){const D=k.value;D&&d!==D&&(d&&u?.markSettled(d),I(),d=D,u?.markPending(D),typeof window<"u"&&(f=window.setTimeout(()=>{d===D&&($(D),L())},8e3)))}function L(){return Xn(this,null,function*(){const D=d;D&&(I(),d="",yield mt(),A(D),u?.markSettled(D))})}function E(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,s.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,o("error",r.value),$()}function F(){s.value=!0,i.value=!1,o("load",g.value),$()}function S(D){D.preventDefault(),s.value&&!i.value&&o("click",[D,g.value])}const{t:N}=MX();return Qe([h,p,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Qe([v,s,i,g,()=>n.lazy],([D,B,U,H,P])=>D&&H&&!U?B?(L(),void $()):P?(x(),void $()):void(B||U||x()):(L(),void $()),{flush:"post",immediate:!0}),mo(()=>{(function(){const D=d;D&&(I(),d="",u?.markSettled(D))})()}),(D,B)=>{var U,H,P,Z,K;return w(),T("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[v.value?(w(),T("img",{key:0,src:g.value,alt:String((H=(U=n.node.alt)!=null?U:n.node.title)!=null?H:""),title:String((Z=(P=n.node.title)!=null?P:n.node.alt)!=null?Z:""),class:We(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(K=n.node.alt)!=null?K:C(N)("image.preview"),onError:E,onLoad:F,onClick:S},null,42,TX)):ce("",!0),e.node.loading&&!i.value?(w(),T("span",NX,[n.usePlaceholder?Fn(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[0]||(B[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",IX,O(e.node.raw),1))])):ce("",!0),re(Il,{name:"shimmer-fade"},{default:Ee(()=>[y.value&&!e.node.loading?(w(),T("span",LX,[n.usePlaceholder?Fn(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[1]||(B[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",$X,O(e.node.raw),1))])):ce("",!0)]),_:3}),m.value?(w(),T("span",FX,[Fn(D.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[2]||(B[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),_("span",null,O(C(N)("image.loadError")),1)],!0)])):ce("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Al.install=e=>{e.component(Al.__name,Al)};const OX={key:2},lr=Ze({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamNestedRendererProps",void 0),i=R(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=R(()=>{var p,g;const b=(p=s?.value)!=null?p:{};return Dt(lt({},b),{customId:(g=t.customId)!=null?g:b.customId,htmlPolicy:i.value})}),l=Li({loader:()=>Promise.resolve().then(()=>Lk),suspensible:!1}),a=R(()=>t.components[String(t.node.type)]),c=R(()=>!!(a.value&&n.value[t.node.type]&&!tf(String(t.node.type)))),u=R(()=>c.value?Ck(t.node,i.value):void 0),d=R(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=R(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=R(()=>{var p,g;return String((g=(p=t.node.content)!=null?p:t.node.raw)!=null?g:"")});return(p,g)=>a.value&&c.value?(w(),xe(jo(a.value),yn({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?(w(),xe(C(l),yn({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?(w(),xe(C(l),yn({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"])):ce("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),xe(jo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),T("span",OX,O(h.value),1)):ce("",!0)}}),RX=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],BX={key:0,translate:"no",class:"markstream-pre__diff-code"},DX={class:"markstream-pre__diff-number","aria-hidden":"true"},PX={class:"markstream-pre__diff-content"},HX={class:"markstream-pre__diff-content-inner"},WX={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},zX=["textContent"],qs=Ze({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=R(()=>{var S,N,D;const B=String((N=(S=t.node)==null?void 0:S.language)!=null?N:"");return String((D=String(B).split(/\s+/g)[0])!=null?D:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=R(()=>`language-${n.value}`),s=R(()=>{var S,N,D,B,U;return((S=t.node)==null?void 0:S.diff)===!0?String((D=(N=t.node)==null?void 0:N.code)!=null?D:""):(function(H,P){const Z=String(H??"");return P?Z:Z.replace(/\r\n$|\n$|\r$/,"")})((B=t.node)==null?void 0:B.code,((U=t.node)==null?void 0:U.loading)===!0)}),i=R(()=>s.value.split(/\r\n|\n|\r/)),r=R(()=>Array.from({length:Math.max(1,i.value.length)},(S,N)=>N+1)),l=R(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=R(()=>l.value&&t.diffInline===!0),c=R(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const N=`${Math.ceil(S)}px`;return{height:N,minHeight:N,maxHeight:N,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,N="context",D={}){const B=u(S);return{code:S,kind:B&&N!=="hunk"&&!D.preserveBlankKind?"context":N,empty:B}}function f(S){const N=String(S??"");return N?N.split(/\r\n|\n|\r/):[]}function h(S,N){return!u(S[N])||N<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function g(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,N){const D=f(S),B=f(N),U=(function(J,he){const ne=J.length,ue=he.length;if((ne+1)*(ue+1)>15e5)return null;const de=ue+1,Ce=new Uint32Array((ne+1)*(ue+1));for(let ae=1;ae<=ne;ae++)for(let ie=1;ie<=ue;ie++){const q=ae*de+ie;if(J[ae-1]===he[ie-1])Ce[q]=Ce[(ae-1)*de+(ie-1)]+1;else{const ee=Ce[(ae-1)*de+ie],ye=Ce[ae*de+(ie-1)];Ce[q]=ee>=ye?ee:ye}}const Ie=[];let le=ne,z=ue;for(;le>0&&z>0;)J[le-1]===he[z-1]?(Ie.push({originalIndex:le-1,modifiedIndex:z-1}),le--,z--):Ce[(le-1)*de+z]>=Ce[le*de+(z-1)]?le--:z--;return Ie.reverse(),Ie})(D,B);if(U){const J=[];let he=0,ne=0;for(const ue of U){for(;he<ue.originalIndex;)J.push(Dt(lt({},d(D[he],"removed",{preserveBlankKind:h(D,he)})),{key:`inline-removed-source-${he}`,number:""})),he++;for(;ne<ue.modifiedIndex;)J.push(Dt(lt({},d(B[ne],"added",{preserveBlankKind:h(B,ne)})),{key:`inline-added-source-${ne}`,number:ne+1})),ne++;J.push(Dt(lt({},d(B[ue.modifiedIndex])),{key:`inline-context-source-${ue.originalIndex}-${ue.modifiedIndex}`,number:ue.modifiedIndex+1})),he=ue.originalIndex+1,ne=ue.modifiedIndex+1}for(;he<D.length;)J.push(Dt(lt({},d(D[he],"removed",{preserveBlankKind:h(D,he)})),{key:`inline-removed-source-${he}`,number:""})),he++;for(;ne<B.length;)J.push(Dt(lt({},d(B[ne],"added",{preserveBlankKind:h(B,ne)})),{key:`inline-added-source-${ne}`,number:ne+1})),ne++;return J}const H=[];let P=0,Z=D.length-1,K=B.length-1;for(;P<=Z&&P<=K&&D[P]===B[P];)H.push(Dt(lt({},d(B[P])),{key:`inline-prefix-${P}`,number:P+1})),P++;const V=[];for(;Z>=P&&K>=P&&D[Z]===B[K];)V.unshift(Dt(lt({},d(B[K])),{key:`inline-suffix-${K}`,number:K+1})),Z--,K--;for(let J=P;J<=Z;J++)H.push(Dt(lt({},d(D[J],"removed",{preserveBlankKind:h(D,J)})),{key:`inline-removed-source-${J}`,number:""}));for(let J=P;J<=K;J++)H.push(Dt(lt({},d(B[J],"added",{preserveBlankKind:h(B,J)})),{key:`inline-added-source-${J}`,number:J+1}));return H.concat(V)}const v=R(()=>{var S,N,D,B;const U=(function(K){const V=K.some(he=>p(he)),J=K.some(he=>g(he));return V&&J||(function(){var he,ne,ue,de;if(n.value==="diff")return!0;const Ce=(de=(ue=String((ne=(he=t.node)==null?void 0:he.raw)!=null?ne:"").split(/\r?\n/,1)[0])==null?void 0:ue.trim())!=null?de:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(V||J)})(i.value),H=(function(){var K,V;return((K=t.node)==null?void 0:K.originalCode)!=null||((V=t.node)==null?void 0:V.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:U?(function(K){const V=[];let J=1;for(const[he,ne]of K.entries())if(ne.startsWith("@@"))V.push(Dt(lt({},d(ne,"hunk")),{key:`inline-hunk-${he}`,number:""}));else if(p(ne))V.push(Dt(lt({},d(ne.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${he}`,number:""}));else if(g(ne))V.push(Dt(lt({},d(ne.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${he}`,number:J++}));else{const ue=ne.startsWith(" ")?ne.slice(1):ne;V.push(Dt(lt({},d(ue)),{key:`inline-context-${he}`,number:J})),J++}return V})(i.value):b((S=t.node)==null?void 0:S.originalCode,(N=t.node)==null?void 0:N.updatedCode)}];if(!U&&H){const K=f((D=t.node)==null?void 0:D.originalCode),V=f((B=t.node)==null?void 0:B.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((J,he)=>{const ne=V[he]===J?"context":"removed";return Dt(lt({},d(J,ne,{preserveBlankKind:h(K,he)})),{key:`original-${he}`,number:he+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:V.map((J,he)=>{const ne=K[he]===J?"context":"added";return Dt(lt({},d(J,ne,{preserveBlankKind:h(V,he)})),{key:`modified-${he}`,number:he+1})})}]}const P=[],Z=[];for(const K of i.value)if(K.startsWith("@@"))P.push(d(K,"hunk")),Z.push(d(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))P.push(d(K.slice(1),"removed",{preserveBlankKind:!0}));else if(K.startsWith("+")&&!K.startsWith("+++"))Z.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const V=K.startsWith(" ")?K.slice(1):K;P.push(d(V)),Z.push(d(V))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:P.map((K,V)=>Dt(lt({},K),{key:`original-${V}`,number:V+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((K,V)=>Dt(lt({},K),{key:`modified-${V}`,number:V+1}))}]}),m=R(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),y=X(null),k=X([]);let A=null,$=null;function I(S){const N=Number.parseFloat(String(S??""));return Number.isFinite(N)&&N>0?N:0}function x(S,N){var D;if(!S)return N;const B=S.querySelector(".markstream-pre__diff-content"),U=B?.getBoundingClientRect(),H=(D=U?.height)!=null?D:0;return Math.max(N,Math.ceil(H))}function L(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,N;A=null;const D=y.value;if(!D||!l.value)return void(k.value.length&&(k.value=[]));const B=(function(J){const he=window.getComputedStyle(J),ne=I(he.getPropertyValue("--markstream-pre-diff-line-height"));if(ne>0)return ne;const ue=I(he.lineHeight);return ue>0?ue:18})(D),U=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),H=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),P=Math.max(U.length,H.length),Z=[];for(let J=0;J<P;J++){const he=x((S=U[J])!=null?S:null,B),ne=x((N=H[J])!=null?N:null,B),ue=Math.max(B,he,ne);Z.push({rowHeight:ue,originalHeight:he,modifiedHeight:ne})}var K,V;K=k.value,V=Z,K.length===V.length&&K.every((J,he)=>{const ne=V[he];return ne&&Math.abs(J.rowHeight-ne.rowHeight)<=.5&&Math.abs(J.originalHeight-ne.originalHeight)<=.5&&Math.abs(J.modifiedHeight-ne.modifiedHeight)<=.5})||(k.value=Z)})()}))}function E(S){$?.disconnect(),$=null,S&&l.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{L()}),$.observe(S))}function F(S,N){const D=k.value[S];if(!D)return;const B=N==="original"?D.originalHeight:D.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(D.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(B)}px`}}return Qe(y,S=>{E(S),mt(()=>L())},{flush:"post"}),Qe([l,v],()=>{E(y.value),mt(()=>L())},{flush:"post",immediate:!0}),mo(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),$?.disconnect(),$=null}),(S,N)=>(w(),T("pre",{ref_key:"preRef",ref:y,style:Yt(c.value),class:We([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":m.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),T("code",BX,[(w(!0),T(Pe,null,ot(v.value,D=>(w(),T("span",{key:D.key,class:We(["markstream-pre__diff-pane",D.className])},[(w(!0),T(Pe,null,ot(D.lines,(B,U)=>(w(),T("span",{key:B.key,class:We(["markstream-pre__diff-line",[`markstream-pre__diff-line--${B.kind}`,{"markstream-pre__diff-line--empty":B.empty}]]),style:Yt(F(U,D.key))},[N[0]||(N[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",DX,O(B.number),1),_("span",PX,[_("span",HX,O(B.code),1)])],6))),128))],2))),128))])):(w(),T(Pe,{key:1},[t.showLineNumbers?(w(),T("span",WX,[(w(!0),T(Pe,null,ot(r.value,D=>(w(),T("span",{key:D,class:"markstream-pre__line-number"},O(D),1))),128))])):ce("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:O(s.value)},null,8,zX)],64))],14,RX))}});qs.install=e=>{e.component(qs.__name,qs)};const V0=Ra(!1);let WS=null;const UX={key:0},lo=gn(Ze({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(WS||(WS=xk().then(v=>{V0.value=!!v}).catch(()=>{V0.value=!1})),zh(V0)),o=Kd(),s=Kt("markstreamFade",void 0),i=Kt("markstreamTextStreamState",void 0),r=Kt("markstreamStreamVersion",void 0),l=R(()=>{const v=o.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=R(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=R(()=>{var v;const m=(v=o["index-key"])!=null?v:o.indexKey;return m==null||m===""?"":String(m)}),u=X(t.node.content),d=X("");let f=r?.value;const h=X(0);function p(){return u.value+d.value}function g(){d.value&&(u.value=p(),d.value="")}Qe([()=>t.node.content,c,a,()=>r?.value],([v,m,y,k])=>{const A=String(v??""),$=c.value,I=k!==f;f=k;const x=FM({nextContent:A,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:I});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(h.value+=1),$&&i?.set($,A)},{immediate:!0}),Qe(a,v=>{var m;v||(m=p(),u.value=m,d.value="")});const b=R(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(v,m)=>(w(),T("span",{class:We([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),T("span",UX,O(u.value),1)):ce("",!0),d.value?(w(),T("span",{key:1,class:We(["text-node-stream-delta",[b.value]]),onAnimationend:g},O(d.value),35)):ce("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);lo.install=e=>{e.component(lo.__name,lo)};const ZM=Ze({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return mn(qs,Dt(lt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),K0=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./CodeBlockNode-DDlAJrwY.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),qs}}),loadingComponent:ZM,delay:0,suspensible:!1}),Pi=Li(()=>Xn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return mn(lo,Dt(lt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{if(yield xk())return(yield ms(()=>import("./index6-DRC2c8Au.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return mn(lo,Dt(lt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),QM=Li(()=>Xn(null,null,function*(){try{if(yield xk())return(yield ms(()=>import("./index5-BEFSXtVE.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return mn(lo,Dt(lt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),ys=gn(Ze({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),T("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ys.install=e=>{e.component(ys.__name,ys)};const qX={class:"superscript-node"},Fs=gn(Ze({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:lo,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sup",qX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const jX={class:"subscript-node"},Os=gn(Ze({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:lo,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,superscript:Fs,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sub",jX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Os.install=e=>{e.component(Os.__name,Os)};const VX={class:"strong-node"},ks=gn(Ze({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:lo,inline_code:ts,link:xs,html_inline:Qs,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("strong",VX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);ks.install=e=>{e.component(ks.__name,ks)};const KX={class:"strikethrough-node"},bs=gn(Ze({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:lo,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("del",KX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);bs.install=e=>{e.component(bs.__name,bs)};const GX=["href","title","aria-label","aria-hidden","target","rel"],YX=["aria-hidden"],ZX={class:"link-text-wrapper relative inline-flex"},QX={class:"leading-[normal] link-text"},xs=gn(Ze({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Kt("markstreamShowTooltips",void 0),o=R(()=>{const v=n?.value;return typeof v=="boolean"?v:t.showTooltip}),s=R(()=>{var v,m,y,k,A;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(v=t.animationOpacity)!=null?v:.35,x=Math.max(.12,Math.min(.5*I,I)),L={"--underline-height":`${(m=t.underlineHeight)!=null?m:2}px`,"--underline-bottom":$,"--underline-opacity":String(I),"--underline-rest-opacity":String(x),"--underline-duration":`${(y=t.animationDuration)!=null?y:1.6}s`,"--underline-timing":(k=t.animationTiming)!=null?k:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(L["--link-color"]=t.color),L}),i=Co(()=>t.customId),r=R(()=>lt({text:lo,strong:ks,strikethrough:bs,emphasis:ws,image:Al,html_inline:Qs,inline_code:ts},i.value)),l=Kd(),a=R(()=>{var v,m;const y=(v=t.node)==null?void 0:v.attrs;if(!y||typeof y!="object")return{};const k={};if(Array.isArray(y))for(const A of y)Array.isArray(A)&&A[0]&&(k[String(A[0])]=String((m=A[1])!=null?m:""));else for(const[A,$]of Object.entries(y))A&&$!=null&&$!==!1&&(k[A]=$===!0?"":String($));return FS(k,"safe","a")}),c=R(()=>lt(lt({},l),a.value)),u=R(()=>{var v,m;return FS({href:String((m=(v=t.node)==null?void 0:v.href)!=null?m:"")},"safe","a").href}),d=R(()=>{if(!u.value)return;const v=c.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(WV(u.value)?"_blank":void 0)}),f=R(()=>{var v;return String((v=d.value)!=null?v:"").trim().toLowerCase()==="_blank"}),h=R(()=>{if(!u.value)return;const v=c.value.rel,m=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),y=new Set(Array.from(m).filter(k=>k.toLowerCase()!=="opener"));return f.value&&(y.add("noopener"),y.add("noreferrer")),y.size>0?Array.from(y).join(" "):void 0}),p=R(()=>{const v=lt({},c.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function g(){o.value&&AX()}const b=R(()=>{var v,m;const y=(v=t.node)==null?void 0:v.title;return typeof y=="string"&&y.trim().length>0?y:String((m=u.value)!=null?m:"")});return(v,m)=>{var y,k;return e.node.loading?(w(),T("span",yn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[_("span",ZX,[_("span",QX,[re(C(lo),{class:"leading-[normal] link-text",node:{type:"text",content:String((y=e.node.text)!=null?y:""),raw:String((k=e.node.text)!=null?k:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),m[1]||(m[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,YX)):(w(),T("a",yn({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:m[0]||(m[0]=A=>(function($){var I,x,L,E;if(!o.value)return;const F=$,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,N=((I=t.node)==null?void 0:I.title)||((x=u.value)!=null&&x.includes("xn--")&&((E=(L=t.node)==null?void 0:L.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";CX($.currentTarget,N,"top",!1,S)})(A)),onMouseleave:g}),[(w(!0),T(Pe,null,ot(e.node.children,(A,$)=>(w(),xe(C(lr),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,GX))}}}),[["__scopeId","data-v-367e6ca4"]]);xs.install=e=>{e.component(xs.__name,xs)};const XX={class:"insert-node"},Rs=gn(Ze({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:lo,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("ins",XX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Rs.install=e=>{e.component(Rs.__name,Rs)};const JX={class:"highlight-node"},Xs=gn(Ze({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:lo,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("mark",JX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const eJ={class:"emphasis-node"},ws=gn(Ze({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:lo,inline_code:ts,link:xs,html_inline:Qs,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("em",eJ,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);ws.install=e=>{e.component(ws.__name,ws)};const tJ={class:"hard-break"},Ml=gn(Ze({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("br",tJ))}),[["__scopeId","data-v-50c58f70"]]);Ml.install=e=>{e.component(Ml.__name,Ml)};const Hd=Ze({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=pt({checkbox:Ys,checkbox_input:Ys,emoji:$s,emphasis:ws,hardbreak:Ml,highlight:Xs,inline_code:ts,insert:Rs,link:xs,reference:ys,strikethrough:bs,strong:ks,subscript:Os,superscript:Fs,text:lo}),o=Co(()=>t.customId),s=R(()=>{const i=o.value;return Object.keys(i).length>0?lt(lt({},n),i):n});return(i,r)=>(w(!0),T(Pe,null,ot(e.nodes,(l,a)=>(w(),xe(C(lr),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Fv(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(Fv)}function Ip(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Fv))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(Fv)?s:null}function eu(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const nJ=["cite"],oJ={key:0,dir:"auto",class:"paragraph-node"},sJ=["custom-id"],Nh=gn(Ze({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>!!n.value.paragraph),s=R(()=>!!n.value.text),i=R(()=>Ip(t.node.children,!o.value)),r=R(()=>t.fade!==!1||s.value?null:eu(i.value));return In("markstreamShowTooltips",R(()=>t.showTooltips)),In("markstreamFade",R(()=>t.fade)),(l,a)=>(w(),T("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),T("p",oJ,[r.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,sJ)):(w(),xe(C(Hd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),xe(C(Bs),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,nJ))}}),[["__scopeId","data-v-abfecebc"]]);Nh.install=e=>{e.component(Nh.__name,Nh)};const iJ={class:"definition-list"},rJ={class:"definition-term"},lJ={class:"definition-desc"},Ih=gn(Ze({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("dl",iJ,[(w(!0),T(Pe,null,ot(t.node.items,(s,i)=>(w(),T(Pe,{key:i},[_("dt",rJ,[re(C(Bs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",lJ,[re(C(Bs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Ih.install=e=>{e.component(Ih.__name,Ih)};const aJ=["href","title"],hd=gn(Ze({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(w(),T("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,aJ))}}),[["__scopeId","data-v-e1eb37b6"]]);hd.install=e=>{e.component(hd.__name,hd)};const cJ=["id"],uJ={class:"flex-1"},Lh=Ze({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",uJ,[re(C(Bs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,cJ))}});Lh.install=e=>{e.component(Lh.__name,Lh)};const dJ=["custom-id"],Ov=gn(Ze({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamFade",void 0),s=R(()=>o?.value!==!1||n.value.text?null:eu(t.node.children)),i=R(()=>lt({text:lo,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,footnote_reference:Zs,hardbreak:Ml,math_inline:Pi,reference:ys},n.value));return(r,l)=>(w(),xe(jo(`h${e.node.level}`),yn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[s.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(s.value),9,dJ)):(w(!0),T(Pe,{key:1},ot(e.node.children,(a,c)=>(w(),xe(C(lr),{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"]]),Lp=Ov;Lp.install=e=>{e.component(Ov.__name,Ov)};const fJ={key:0,dir:"auto",class:"paragraph-node"},hJ=["custom-id"],pJ={dir:"auto",class:"paragraph-node"},mJ=["custom-id"],zc=gn(Ze({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=R(()=>{var h;return(h=t.node)!=null?h:t.item}),o=Co(()=>t.customId),s=R(()=>!!o.value.paragraph),i=R(()=>!!o.value.text),r=R(()=>{var h;return Ip((h=n.value)==null?void 0:h.children,!s.value)}),l=R(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const g=p[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const b=p.slice(1);if(!b.every(m=>m?.type==="list"))return null;const v=Ip([g]);return v?{paragraphChildren:v,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=R(()=>a()?eu(r.value):null),u=R(()=>{var h;return a()?eu((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=R(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return In("markstreamShowTooltips",R(()=>t.showTooltips)),In("markstreamFade",R(()=>t.fade)),(h,p)=>{var g,b;return w(),T("li",yn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),T("p",fJ,[c.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,hJ)):(w(),xe(C(Hd),{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?(w(),T(Pe,{key:1},[_("p",pJ,[u.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,mJ)):(w(),xe(C(Hd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),T(Pe,null,ot(l.value.nestedLists,(v,m)=>(w(),xe(C(Bs),{key:m,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${m}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=y=>h.$emit("copy",y))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),xe(C(Bs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(g=n.value)==null?void 0:g.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=v=>h.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);zc.install=e=>{e.component(zc.__name,zc)};const Uc=gn(Ze({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Co(()=>e.customId),n=R(()=>t.value.list_item||zc);return(o,s)=>(w(),xe(jo(e.node.ordered?"ol":"ul"),{class:We(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(w(!0),T(Pe,null,ot(e.node.items,(i,r)=>{var l;return w(),xe(jo(n.value),yn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Uc.install=e=>{e.component(Uc.__name,Uc)};const XM=Symbol("ViewportPriority");function gJ(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?X(t):t,r=s?(n=window.requestIdleCallback)!=null?n:m=>window.setTimeout(()=>m({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:m=>window.clearTimeout(m):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function g(m){const y=u.get(m);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const m=d.values().next().value;m&&(d.delete(m),g(m),d.size&&b())},{timeout:1200}))}Qe(i,m=>{if(!m){for(const y of Array.from(u.keys()))g(y);h()}},{flush:"sync"});const v=(m,y)=>{const k=X(!1);let A,$=!1;const I=new Promise(E=>{A=()=>{$||($=!0,E())}}),x=()=>{try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()};if(!s||!i.value)return k.value=!0,A(),{isVisible:k,whenVisible:I,destroy:x};const L=(function(E,F){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(B,U){var H,P,Z;return{root:(H=e?.(B??null))!=null?H:null,rootMargin:(P=U?.rootMargin)!=null?P:"300px",threshold:(Z=U?.threshold)!=null?Z:0}})(E,F);if(a&&(D=S,(N=c)&&N.root===D.root&&N.rootMargin===D.rootMargin&&N.threshold===D.threshold))return a;var N,D;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(B=>{for(const U of B)(U.isIntersecting||U.intersectionRatio>0)&&g(U.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const B of u.keys())a.observe(B);return a})(m,y);return L?(u.set(m,{resolve:A,visible:k}),L.observe(m),d.add(m),b(),{isVisible:k,whenVisible:I,destroy:x}):(k.value=!0,A(),{isVisible:k,whenVisible:I,destroy:x})};return In(XM,v),v}function vJ(){var e,t;const n=Kt(XM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=o.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=X(!1);let p,g=!1;const b=new Promise(y=>{p=()=>{g||(g=!0,y())}}),v=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},m=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(y=>{for(const k of y)(k.isIntersecting||k.intersectionRatio>0)&&u(k.target)},{root:null,rootMargin:"300px",threshold:0}),s));return m?(o.set(f,{resolve:p,visible:h}),m.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:v}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:v})}}const yJ={key:2,class:"html-block-node__raw"},kJ=["innerHTML"],bJ={key:1,class:"html-block-node__placeholder"},pd=gn(Ze({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=Kt("markstreamNestedRendererProps",void 0),s=R(()=>{var $,I;return(I=($=t.htmlPolicy)!=null?$:n?.value)!=null?I:"safe"}),i=R(()=>{var $,I;const x=($=o?.value)!=null?$:{};return Dt(lt({},x),{customId:(I=t.customId)!=null?I:x.customId,htmlPolicy:s.value})}),r=Li({loader:()=>Promise.resolve().then(()=>Lk),suspensible:!1}),l=R(()=>{const $=kv(t.node.attrs,s.value);if(!$)return;const I=Mp($);return Object.keys(I).length>0?I:void 0}),a=R(()=>{const $=String(t.node.tag||"").trim(),I=kv(t.node.attrs,s.value,$);if(!I)return;const x=Mp(I);return Object.keys(x).length>0?x:void 0}),c=Co(()=>t.customId),u=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=X(null),f=X(typeof window>"u"),h=X(t.node.content),p=R(()=>Array.isArray(t.node.children)?t.node.children:[]),g=R(()=>String(t.node.tag||"div")),b=R(()=>{const $=g.value.trim().toLowerCase();return B6.has($)||mk($,s.value)}),v=R(()=>p.value.length>0&&!!t.node.tag&&!b.value),m=R(()=>{var $,I,x;if(v.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:($=h.value)!=null?$:""};const L=(I=h.value)!=null?I:t.node.content;if(!L)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Wc(L,s.value)};if(t.node.loading){const F=Np(L,c.value,s.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:L}:{mode:"dynamic",nodes:F}}if(!GM(L,c.value))return{mode:"html",content:Wc(L,s.value)};const E=Np(L,c.value,s.value);return E===null?{mode:"html",content:Wc(L,s.value)}:{mode:"dynamic",nodes:E}}),y=vJ(),k=X(null),A=!!t.node.loading;return typeof window<"u"?(Qe(d,$=>{var I,x;if((x=(I=k.value)==null?void 0:I.destroy)==null||x.call(I),k.value=null,!A)return f.value=!0,void(h.value=t.node.content);if(!$)return void(f.value=!1);const L=y($,{rootMargin:"400px"});k.value=L,f.value=L.isVisible.value,L.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Qe(()=>t.node.content,$=>{A&&!f.value||(h.value=$)})):f.value=!0,mo(()=>{var $,I;(I=($=k.value)==null?void 0:$.destroy)==null||I.call($),k.value=null}),($,I)=>(w(),xe(jo(v.value?g.value:"div"),yn({ref_key:"htmlRef",ref:d,class:"html-block-node"},v.value?a.value:void 0),{default:Ee(()=>[f.value?(w(),T(Pe,{key:0},[m.value.mode==="structured"?(w(),xe(C(r),yn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):m.value.mode==="dynamic"?(w(),xe(C(u),{key:1,nodes:m.value.nodes},null,8,["nodes"])):m.value.mode==="text"?(w(),T("pre",yJ,O(m.value.content),1)):(w(),T("div",yn({key:3},l.value,{innerHTML:m.value.content}),null,16,kJ))],64)):(w(),T("div",bJ,[Fn($.$slots,"placeholder",{node:e.node},()=>[I[0]||(I[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),I[1]||(I[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),I[2]||(I[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);pd.install=e=>{e.component(pd.__name,pd)};const xJ={dir:"auto",class:"paragraph-node"},wJ=["custom-id"],Ma=gn(Ze({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamFade",void 0),i=Kt("markstreamParseOptions",void 0),r=Kt("markstreamCustomMarkdownIt",void 0),l=Kt("markstreamNestedRendererProps",void 0),a=R(()=>{var x;return(x=o?.value)!=null?x:"safe"}),c=R(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=R(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=R(()=>{var x,L;return(L=t.customHtmlTags)!=null?L:(x=l?.value)==null?void 0:x.customHtmlTags}),f=R(()=>{var x,L;const E=(x=l?.value)!=null?x:{};return Dt(lt({},E),{customId:(L=t.customId)!=null?L:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Li({loader:()=>Promise.resolve().then(()=>Lk),suspensible:!1});function p(x){var L;return x.type==="text"&&String((L=x.content)!=null?L:"").trim()===""}const g=R(()=>t.node.children.filter(x=>!p(x))),b=R(()=>g.value.length>0&&g.value.every(x=>x.type==="image"||(function(L){var E;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(N=>!p(N)):[]})(L);return F.length===1&&((E=F[0])==null?void 0:E.type)==="image"})(x))),v=R(()=>new Set(au(d.value))),m=R(()=>{if(!b.value||g.value.length<=1)return t.node.children;const x=[];for(let L=0;L<t.node.children.length;L++){const E=t.node.children[L];if(!p(E)){x.push(E);continue}const F=x.length>0,S=t.node.children.slice(L+1).some(N=>!p(N));F&&S&&x.push(Dt(lt({},E),{content:" ",raw:" "}))}return x}),y=R(()=>s?.value===!1&&!n.value.text),k=R(()=>y.value?eu(m.value):null);function A(x,L){return{node:x,"index-key":`${t.indexKey}-${L}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=R(()=>lt({inline_code:ts,image:Al,link:xs,hardbreak:Ml,emphasis:ws,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,html_inline:Qs,html_block:pd,emoji:$s,checkbox:Ys,math_inline:Pi,checkbox_input:Ys,reference:ys,footnote_anchor:hd,footnote_reference:Zs,text:lo},n.value)),I=R(()=>m.value.map((x,L)=>{var E;const F=(function(S){var N,D,B,U;if(S.type==="html_block"||S.type==="html_inline"){const H=String((N=S.tag)!=null?N:"").trim().toLowerCase()||W6(S.content);if(H&&!v.value.has(H)&&z6((D=S.content)!=null?D:S.raw,H)){const P=String((U=(B=S.content)!=null?B:S.raw)!=null?U:"");return{child:{type:"text",content:P,raw:P},component:lo,isCustomComponent:!1}}}return{child:S,component:$.value[S.type],isCustomComponent:!!(n.value[S.type]&&!tf(String(S.type)))}})(x);return Dt(lt({},F),{index:L,key:`${t.indexKey||"paragraph"}-${L}`,customAttrs:F.isCustomComponent?Ck(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((E=F.child.content)!=null?E:""),originalChild:x})}));return(x,L)=>(w(),T("p",xJ,[k.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(k.value),9,wJ)):(w(!0),T(Pe,{key:1},ot(I.value,E=>{return w(),T(Pe,{key:E.key},[b.value&&p(E.originalChild)?(w(),T(Pe,{key:0},[Je(O((F=E.originalChild,String((S=F.content)!=null?S:""))),1)],64)):E.isCustomComponent?(w(),xe(jo(E.component),yn({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[E.hasSlotChildren?(w(),xe(C(h),yn({key:0,ref_for:!0},f.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(w(),xe(C(h),yn({key:1,ref_for:!0},f.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),xe(jo(E.component),yn({key:2,ref_for:!0},A(E.child,E.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ma.install=e=>{e.component(Ma.__name,Ma)};const _J={class:"table-node-wrapper"},SJ=["aria-busy"],CJ={key:0},AJ=["custom-id"],MJ=["aria-label","onPointerdown"],EJ=["custom-id"],TJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},md=gn(Ze({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=R(()=>{var v;return(v=t.node.loading)!=null&&v}),o=R(()=>{var v;return(v=t.node.rows)!=null?v:[]}),s=X(null),i=X([]);let r=null;const l=R(()=>t.node.header.cells.length),a=R(()=>i.value.some(v=>Number.isFinite(v)&&v>0)),c=R(()=>a.value?i.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);In("markstreamShowTooltips",R(()=>t.showTooltips)),In("markstreamFade",R(()=>t.fade));const u=Co(()=>t.customId),d=R(()=>!!u.value.text),f=R(()=>!!u.value.paragraph),h=new WeakMap;function p(v){const m=t.fade===!1&&!d.value,y=!f.value,k=h.get(v);if(k?.children===v.children&&k.textFastPath===m&&k.paragraphFastPath===y)return k.info;const A=Ip(v.children,y,!0),$={simpleChildren:A,plainText:A&&m?eu(A):null};return h.set(v,{children:v.children,textFastPath:m,paragraphFastPath:y,info:$}),$}function g(v){if(!r)return;v.preventDefault();const m=r.startWidth+r.nextStartWidth,y=Math.min(48,Math.floor(m/2)),k=Math.max(y,Math.min(m-y,Math.round(r.startWidth+v.clientX-r.startX))),A=[...r.widths];A[r.index]=k,A[r.index+1]=m-k,i.value=A}function b(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Qe(l,()=>{b(),i.value=[]}),mo(b),(v,m)=>(w(),T("div",_J,[_("table",{ref_key:"tableRef",ref:s,class:We(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),T("colgroup",CJ,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("col",{key:k,style:Yt(c.value[k])},null,4))),128))])):ce("",!0),_("thead",null,[_("tr",null,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("th",{key:k,dir:"auto",class:We([y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"])},[p(y).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(y).plainText),9,AJ)):p(y).simpleChildren?(w(),xe(C(Hd),{key:1,nodes:p(y).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${k}`},null,8,["nodes","custom-id","index-key"])):(w(),xe(C(Bs),{key:2,nodes:y.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[0]||(m[0]=A=>v.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),k<e.node.header.cells.length-1?(w(),T("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${k+1} and ${k+2}`,onPointerdown:A=>(function($,I){if(I.button!==0)return;const x=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],N=>Math.round(N.getBoundingClientRect().width))})(),L=x[$],E=x[$+1];L&&E&&(I.preventDefault(),r={index:$,startX:I.clientX,startWidth:L,nextStartWidth:E,widths:x},i.value=x,window.addEventListener("pointermove",g),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(k,A)},null,40,MJ)):ce("",!0)],2))),128))])]),_("tbody",null,[(w(!0),T(Pe,null,ot(o.value,(y,k)=>(w(),T("tr",{key:k},[(w(!0),T(Pe,null,ot(y.cells,(A,$)=>(w(),T("td",{key:$,class:We([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(A).plainText),9,EJ)):p(A).simpleChildren?(w(),xe(C(Hd),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${k}-${$}`},null,8,["nodes","custom-id","index-key"])):(w(),xe(C(Bs),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[1]||(m[1]=I=>v.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,SJ),re(Il,{name:"table-node-fade"},{default:Ee(()=>[n.value?(w(),T("div",TJ,[Fn(v.$slots,"loading",{isLoading:n.value},()=>[m[2]||(m[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),m[3]||(m[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):ce("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);md.install=e=>{e.component(md.__name,md)};const NJ={class:"hr-node"},$h=gn({},[["render",function(e,t){return w(),T("hr",NJ)}],["__scopeId","data-v-39b2349c"]]);$h.install=e=>{e.component($h.__name,$h)};const IJ={class:"unknown-node"},Rv=Ze({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),T("div",IJ,O(e.node.raw),1))}),Fh=gn(Ze({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=R(()=>`vmr-container vmr-container-${t.node.name}`),o=Co(()=>t.customId),s=R(()=>lt({text:lo,paragraph:Ma,heading:Lp,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,checkbox:Ys,checkbox_input:Ys,hardbreak:Ml,math_inline:Pi,reference:ys,list:Uc,math_block:QM,table:md},o.value));return(i,r)=>(w(),T("div",yn({class:n.value},e.node.attrs),[(w(!0),T(Pe,null,ot(e.node.children,(l,a)=>{return w(),xe(jo((c=l.type,s.value[c]||Rv)),{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"]]);Fh.install=e=>{e.component(Fh.__name,Fh)};const LJ=["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"],zS=[[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 $J(e){if(e<=255)return LJ[e];let t=0,n=zS.length-1;for(;t<=n;){const o=t+n>>1,s=zS[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const FJ=/[ \t\n\r\f]+/g,OJ=/[\t\n\r\f]| {2,}|^ | $/;let G0=null;const RJ=new RegExp("\\p{Script=Arabic}","u"),Pm=new RegExp("\\p{M}","u"),JM=new RegExp("\\p{Nd}","u");function US(e){return RJ.test(e)}function qS(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 Rr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(qS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(qS(n))return!0}}return!1}const BJ=new Set([" "," ","","\uFEFF"]);function DJ(e){return Rr(e)}function Bv(e){return!(function(t){const n=$p(t);return n!==null&&(Ak.has(n)||Na.has(n))})(e)&&!(function(t){const n=$p(t);return n!==null&&BJ.has(n)})(e)}const Ak=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Hm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Mk=new Set(["'","’"]),Na=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),PJ=new Set([":",".","،","؛"]),HJ=new Set(["၏"]),WJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function zJ(e){if(Ek(e))return!0;let t=!1;for(const n of e)if(Na.has(n))t=!0;else if(!t||!Pm.test(n))return!1;return t}function UJ(e){for(const t of e)if(!Ak.has(t)&&!Na.has(t))return!1;return e.length>0}function qJ(e){if(Ek(e))return!0;for(const t of e)if(!Hm.has(t)&&!Mk.has(t)&&!Pm.test(t))return!1;return e.length>0}function Ek(e){let t=!1;for(const n of e)if(n!=="\\"&&!Pm.test(n)){if(!(Hm.has(n)||Na.has(n)||Mk.has(n)))return!1;t=!0}return t}function e5(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function $p(e){if(e.length===0)return null;const t=e5(e,e.length);return e.slice(t)}function jJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Pm.test(o))n--;else{if(!Hm.has(o)&&!Mk.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function VJ(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function jS(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function VS(e,t){return e&&t!==null&&PJ.has(t)}function KJ(e){const t=$p(e);return t!==null&&HJ.has(t)}function GJ(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 Dv(e){let t=e.length;for(;t>0;){const n=e5(e,t),o=e.slice(n,t);if(WJ.has(o))return!0;if(!Na.has(o))return!1;t=n}return!1}function YJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
272
|
+
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const ZJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function di(e){return e.length===1?e[0]:e.join("")}function QJ(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),di(n)}function XJ(e,t,n,o){if(!ZJ.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=YJ(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:di(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:di(r),isWordLike:a,kind:i,start:l}),s}function Y0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const JJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function eee(e,t){const n=e.texts[t];return!!n.startsWith("www.")||JJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function tee(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const nee=new Set([":","-","/","×",",",".","+","–","—"]),KS=/^[A-Za-z0-9_]+[,:;]*$/,GS=/[,:;]+$/;function YS(e){for(const t of e)if(JM.test(t))return!0;return!1}function Oh(e){if(e.length===0)return!1;for(const t of e)if(!JM.test(t)&&!nee.has(t))return!1;return!0}function ZS(e,t,n){var o,s,i;const r=(G0===null&&(G0=new Intl.Segmenter(void 0,{granularity:"word"})),G0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[],v=[],m=[],y=[];for(const x of r.segment(e))for(const L of XJ(x.segment,(o=x.isWordLike)!=null&&o,x.index,n)){let E=function(){h[P]!==null&&(c[P]=[jS(a,h,p,P)],h[P]=null),c[P].push(L.text),u[P]=u[P]||L.isWordLike,g[P]=g[P]||N,b[P]=b[P]||D,v[P]=U,m[P]=H,y[P]=VS(b[P],B)};const F=L.kind==="text",S=VJ(L.text,L.isWordLike,L.kind),N=Rr(L.text),D=US(L.text),B=$p(L.text),U=Dv(L.text),H=KJ(L.text),P=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[P]==="text"&&N&&g[P]&&v[P]||F&&l>0&&d[P]==="text"&&UJ(L.text)&&g[P]||F&&l>0&&d[P]==="text"&&m[P]?E():F&&l>0&&d[P]==="text"&&L.isWordLike&&D&&y[P]?(E(),u[P]=!0):S!==null&&l>0&&d[P]==="text"&&h[P]===S?p[P]=((s=p[P])!=null?s:1)+1:F&&!L.isWordLike&&l>0&&d[P]==="text"&&(zJ(L.text)||L.text==="-"&&u[P])?E():(a[l]=L.text,c[l]=[L.text],u[l]=L.isWordLike,d[l]=L.kind,f[l]=L.start,h[l]=S,p[l]=S===null?0:1,g[l]=N,b[l]=D,v[l]=U,m[l]=H,y[l]=VS(D,B),l++)}for(let x=0;x<l;x++)h[x]===null?a[x]=di(c[x]):a[x]=jS(a,h,p,x);for(let x=1;x<l;x++)d[x]==="text"&&!u[x]&&Ek(a[x])&&d[x-1]==="text"&&(a[x-1]+=a[x],u[x-1]=u[x-1]||u[x],a[x]="");const k=Array.from({length:l},()=>null);let A=-1;for(let x=l-1;x>=0;x--){const L=a[x];if(L.length!==0){if(d[x]==="text"&&!u[x]&&qJ(L)&&A>=0&&d[A]==="text"){const E=(i=k[A])!=null?i:[];E.push(L),k[A]=E,f[A]=f[x],a[x]="";continue}A=x}}for(let x=0;x<l;x++){const L=k[x];L!=null&&(a[x]=QJ(L,a[x]))}let $=0;for(let x=0;x<l;x++){const L=a[x];L.length!==0&&($!==x&&(a[$]=L,u[$]=u[x],d[$]=d[x],f[$]=f[x]),$++)}a.length=$,u.length=$,d.length=$,f.length=$;const I=(function(x){const L=x.texts.slice(),E=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let N=0;N<L.length-1;N++){if(F[N]!=="text"||F[N+1]!=="text"||!Rr(L[N])||!Rr(L[N+1]))continue;const D=jJ(L[N]);D!==null&&(L[N]=D.head,L[N+1]=D.tail+L[N+1],S[N+1]=S[N]+D.head.length)}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N],B=x.kinds[N],U=x.isWordLike[N];if(B==="text"&&U&&KS.test(D)){const H=[D];let P=GS.test(D),Z=N+1;for(;P&&Z<x.len&&x.kinds[Z]==="text"&&x.isWordLike[Z]&&KS.test(x.texts[Z]);){const K=x.texts[Z];H.push(K),P=GS.test(K),Z++}L.push(di(H)),E.push(!0),F.push("text"),S.push(x.starts[N]),N=Z-1;continue}L.push(D),E.push(U),F.push(B),S.push(x.starts[N])}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N];if(x.kinds[N]==="text"&&D.includes("-")){const B=D.split("-");let U=B.length>1;for(let H=0;H<B.length;H++){const P=B[H];if(!U)break;P.length!==0&&YS(P)&&Oh(P)||(U=!1)}if(U){let H=0;for(let P=0;P<B.length;P++){const Z=B[P],K=P<B.length-1?`${Z}-`:Z;L.push(K),E.push(!0),F.push("text"),S.push(x.starts[N]+H),H+=K.length}continue}}L.push(D),E.push(x.isWordLike[N]),F.push(x.kinds[N]),S.push(x.starts[N])}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N],B=x.kinds[N];if(B==="text"&&Oh(D)&&YS(D)){const U=[D];let H=N+1;for(;H<x.len&&x.kinds[H]==="text"&&Oh(x.texts[H]);)U.push(x.texts[H]),H++;L.push(di(U)),E.push(!0),F.push("text"),S.push(x.starts[N]),N=H-1;continue}L.push(D),E.push(x.isWordLike[N]),F.push(B),S.push(x.starts[N])}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N];if(L.push(D),E.push(x.isWordLike[N]),F.push(x.kinds[N]),S.push(x.starts[N]),!tee(D))continue;const B=N+1;if(B>=x.len||Y0(x.kinds[B]))continue;const U=[],H=x.starts[B];let P=B;for(;P<x.len&&!Y0(x.kinds[P]);)U.push(x.texts[P]),P++;U.length>0&&(L.push(di(U)),E.push(!0),F.push("text"),S.push(H),N=P-1)}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=x.texts.slice(),E=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let D=0;D<x.len;D++){if(F[D]!=="text"||!eee(x,D))continue;const B=[L[D]];let U=D+1;for(;U<x.len&&!Y0(F[U]);){B.push(L[U]),E[D]=!0;const H=L[U].includes("?");if(F[U]="text",L[U]="",U++,H)break}L[D]=di(B)}let N=0;for(let D=0;D<L.length;D++){const B=L[D];B.length!==0&&(N!==D&&(L[N]=B,E[N]=E[D],F[N]=F[D],S[N]=S[D]),N++)}return L.length=N,E.length=N,F.length=N,S.length=N,{len:N,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];let N=0;for(;N<x.len;){const D=[x.texts[N]];let B=x.isWordLike[N],U=x.kinds[N],H=x.starts[N];if(U==="glue"){const P=[D[0]],Z=H;for(N++;N<x.len&&x.kinds[N]==="glue";)P.push(x.texts[N]),N++;const K=di(P);if(!(N<x.len&&x.kinds[N]==="text")){L.push(K),E.push(!1),F.push("glue"),S.push(Z);continue}D[0]=K,D.push(x.texts[N]),B=x.isWordLike[N],U="text",H=Z,N++}else N++;if(U==="text")for(;N<x.len&&x.kinds[N]==="glue";){const P=[];for(;N<x.len&&x.kinds[N]==="glue";)P.push(x.texts[N]),N++;const Z=di(P);N<x.len&&x.kinds[N]==="text"?(D.push(Z,x.texts[N]),B=B||x.isWordLike[N],N++):D.push(Z)}L.push(di(D)),E.push(B),F.push(U),S.push(H)}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})({len:$,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let x=0;x<I.len-1;x++){const L=GJ(I.texts[x]);L!==null&&(I.kinds[x]!=="space"&&I.kinds[x]!=="preserved-space"||I.kinds[x+1]!=="text"||!US(I.texts[x+1])||(I.texts[x]=L.space,I.isWordLike[x]=!1,I.kinds[x]=I.kinds[x]==="preserved-space"?"preserved-space":"space",I.texts[x+1]=L.marks+I.texts[x+1],I.starts[x+1]=I.starts[x]+L.space.length))}return I}function oee(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let rc=null;const QS=new Map;let lc=null;const see=new RegExp("\\p{Emoji_Presentation}","u"),iee=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Z0=null;const XS=new Map;function Pv(){if(rc!==null)return rc;if(typeof OffscreenCanvas<"u")return rc=new OffscreenCanvas(1,1).getContext("2d"),rc;if(typeof document<"u")return rc=document.createElement("canvas").getContext("2d"),rc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ll(e,t){let n=t.get(e);return n===void 0&&(n={width:Pv().measureText(e).width,containsCJK:Rr(e)},t.set(e,n)),n}function Wm(){if(lc!==null)return lc;if(typeof navigator>"u")return lc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},lc;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 lc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},lc}function t5(){return Z0===null&&(Z0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Z0}function ree(e){return see.test(e)||e.includes("️")}function la(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=t5();for(const a of l.segment(i))ree(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function lee(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 aee(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function JS(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+Wm().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(k=u,A=d,$=a){l++,a=0,c=!1,f=-1,h=0}function g(k,A){c=!0,u=k+1,d=0,a=A}function b(k,A,$){c=!0,u=k,d=A+1,a=$}function v(k,A){c?(a+=A,u=k+1,d=0):g(k,A)}function m(k,A){const $=i[k];for(let I=A;I<$.length;I++){const x=$[I];c?a+x>r?(p(),b(k,I,x)):(a+=x,u=k,d=I+1):b(k,I,x)}c&&u===k&&d===$.length&&(u=k+1,d=0)}let y=0;for(;y<o.length&&(c||(y=lee(e,y),!(y>=o.length)));){const k=o[y],A=s[y],$=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+k>r){if($){v(y,k),p(y+1,0,a-k),y++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(k>t&&i[y]!==null){p(),m(y,0),y++;continue}p()}else v(y,k),$&&(f=y+1,h=a-k),y++;else k>t&&i[y]!==null?m(y,0):g(y,k),$&&(f=y+1,h=a-k),y++}return c&&p(),l}let Q0=null;function cee(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Dv(d),l=Hm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Dv(d);r=d.length===1&&Na.has(d)&&r||h,l=!1}for(const d of(Q0===null&&(Q0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Q0).segment(e)){const f=d.segment,h=Rr(f);o.length!==0?l||Ak.has(f)||Na.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function uee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Rr(e[0].text),i=Bv(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=Rr(a.text),u=Bv(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function dee(e,t,n,o){const s=Wm(),{cache:i,emojiCorrection:r}=(function(I,x){Pv().font=I;const L=(function(S){let N=QS.get(S);return N||(N=new Map,QS.set(S,N)),N})(I),E=(function(S){const N=S.match(/(\d+(?:\.\d+)?)\s*px/);return N?parseFloat(N[1]):16})(I),F=x?(function(S,N){let D=XS.get(S);if(D!==void 0)return D;const B=Pv();B.font=S;const U=B.measureText("😀").width;if(D=0,U>N+.5&&typeof document<"u"&&document.body!==null){const H=document.createElement("span");H.style.font=S,H.style.display="inline-block",H.style.visibility="hidden",H.style.position="absolute",H.textContent="😀",document.body.appendChild(H);const P=H.getBoundingClientRect().width;document.body.removeChild(H),U-P>.5&&(D=U-P)}return XS.set(S,D),D})(I,E):0;return{cache:L,fontSize:E,emojiCorrection:F}})(t,(l=e.normalized,iee.test(l)));var l;const a=la("-",ll("-",i),r),c=8*la(" ",ll(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const g=null,b=[],v=n?[]:null,m=Array.from({length:e.len});function y(I,x,L,E,F,S,N){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(x),d.push(L),f.push(E),h.push(F),b.push(N),v!==null&&v.push(I)}function k(I,x,L,E,F){const S=ll(I,i),N=la(I,S,r),D=x==="space"||x==="preserved-space"||x==="zero-width-break"?0:N,B=x==="space"||x==="zero-width-break"?0:N;if(F&&E&&I.length>1){let U="sum-graphemes";Oh(I)?U="pair-context":s.preferPrefixWidthsForBreakableRuns&&(U="segment-prefixes");const H=(function(P,Z,K,V,J){if(Z.breakableFitAdvances!==void 0)return Z.breakableFitAdvances;const he=t5(),ne=[];for(const Ie of he.segment(P))ne.push(Ie.segment);if(ne.length<=1)return Z.breakableFitAdvances=null,Z.breakableFitAdvances;if(J==="sum-graphemes"){const Ie=[];for(const le of ne){const z=ll(le,K);Ie.push(la(le,z,V))}return Z.breakableFitAdvances=Ie,Z.breakableFitAdvances}if(J==="pair-context"||ne.length>96){const Ie=[];let le=null,z=0;for(const ae of ne){const ie=la(ae,ll(ae,K),V);if(le===null)Ie.push(ie);else{const q=le+ae,ee=ll(q,K);Ie.push(la(q,ee,V)-z)}le=ae,z=ie}return Z.breakableFitAdvances=Ie,Z.breakableFitAdvances}const ue=[];let de="",Ce=0;for(const Ie of ne){de+=Ie;const le=la(de,ll(de,K),V);ue.push(le-Ce),Ce=le}return Z.breakableFitAdvances=ue,Z.breakableFitAdvances})(I,S,i,r,U);return void y(I,N,D,B,x,L,H)}y(I,N,D,B,x,L,null)}for(let I=0;I<e.len;I++){m[I]=u.length;const x=e.texts[I],L=e.isWordLike[I],E=e.kinds[I],F=e.starts[I];if(E==="soft-hyphen"){y(x,0,a,a,E,F,null);continue}if(E==="hard-break"){y(x,0,0,0,E,F,null);continue}if(E==="tab"){y(x,0,0,0,E,F,null);continue}const S=ll(x,i);if(E==="text"&&S.containsCJK){const N=cee(x,s),D=o==="keep-all"?uee(N):N;for(let B=0;B<D.length;B++){const U=D[B];k(U.text,"text",F+U.start,L,o==="keep-all"||!Rr(U.text))}continue}k(x,E,F,L,!0)}const A=(function(I,x,L){const E=[];for(let F=0;F<I.length;F++){const S=I[F],N=S.startSegmentIndex<x.length?x[S.startSegmentIndex]:L,D=S.endSegmentIndex<x.length?x[S.endSegmentIndex]:L,B=S.consumedEndSegmentIndex<x.length?x[S.consumedEndSegmentIndex]:L;E.push({startSegmentIndex:N,endSegmentIndex:D,consumedEndSegmentIndex:B})}return E})(e.chunks,m,u.length),$=g===null?null:(function(I,x){const L=(function(F){const S=F.length;if(S===0)return null;const N=new Array(S);let D=!1;for(let K=0;K<S;){const V=F.charCodeAt(K);let J=V,he=1;if(V>=55296&&V<=56319&&K+1<S){const ue=F.charCodeAt(K+1);ue>=56320&&ue<=57343&&(J=ue-56320+(V-55296<<10)+65536,he=2)}const ne=$J(J);ne!=="R"&&ne!=="AL"&&ne!=="AN"||(D=!0);for(let ue=0;ue<he;ue++)N[K+ue]=ne;K+=he}if(!D)return null;let B=0;for(let K=0;K<S;K++){const V=N[K];if(V==="L"){B=0;break}if(V==="R"||V==="AL"){B=1;break}}const U=new Int8Array(S);for(let K=0;K<S;K++)U[K]=B;const H=1&B?"R":"L",P=H;let Z=P;for(let K=0;K<S;K++)N[K]==="NSM"?N[K]=Z:Z=N[K];Z=P;for(let K=0;K<S;K++){const V=N[K];V==="EN"?N[K]=Z==="AL"?"AN":"EN":V!=="R"&&V!=="L"&&V!=="AL"||(Z=V)}for(let K=0;K<S;K++)N[K]==="AL"&&(N[K]="R");for(let K=1;K<S-1;K++)N[K]==="ES"&&N[K-1]==="EN"&&N[K+1]==="EN"&&(N[K]="EN"),N[K]!=="CS"||N[K-1]!=="EN"&&N[K-1]!=="AN"||N[K+1]!==N[K-1]||(N[K]=N[K-1]);for(let K=0;K<S;K++){if(N[K]!=="EN")continue;let V;for(V=K-1;V>=0&&N[V]==="ET";V--)N[V]="EN";for(V=K+1;V<S&&N[V]==="ET";V++)N[V]="EN"}for(let K=0;K<S;K++){const V=N[K];V!=="WS"&&V!=="ES"&&V!=="ET"&&V!=="CS"||(N[K]="ON")}Z=P;for(let K=0;K<S;K++){const V=N[K];V==="EN"?N[K]=Z==="L"?"L":"EN":V!=="R"&&V!=="L"||(Z=V)}for(let K=0;K<S;K++){if(N[K]!=="ON")continue;let V=K+1;for(;V<S&&N[V]==="ON";)V++;const J=(K>0?N[K-1]:P)!=="L"?"R":"L";if(J===((V<S?N[V]:P)!=="L"?"R":"L"))for(let he=K;he<V;he++)N[he]=J;K=V-1}for(let K=0;K<S;K++)N[K]==="ON"&&(N[K]=H);for(let K=0;K<S;K++){const V=N[K];1&U[K]?V!=="L"&&V!=="AN"&&V!=="EN"||U[K]++:V==="R"?U[K]++:V!=="AN"&&V!=="EN"||(U[K]+=2)}return U})(I);if(L===null)return null;const E=new Int8Array(x.length);for(let F=0;F<x.length;F++)E[F]=L[x[F]];return E})(e.normalized,g);return v!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:v}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function fee(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return dee((function(c,u,d="normal",f="normal"){const h=(function(b){const v=b??"normal";return v==="pre-wrap"?{mode:v,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:v,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
|
|
273
|
+
`).replace(/[\r\f]/g,`
|
|
274
|
+
`):b.replace(/\r\n/g,`
|
|
275
|
+
`)})(c):(function(b){if(!OJ.test(b))return b;let v=b.replace(FJ," ");return v.charCodeAt(0)===32&&(v=v.slice(1)),v.length>0&&v.charCodeAt(v.length-1)===32&&(v=v.slice(0,-1)),v})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=f==="keep-all"?(function(b){if(b.len<=1)return b;const v=[],m=[],y=[],k=[];let A=null,$=!1,I=0,x=!1,L=!1;function E(){A!==null&&(v.push(di(A)),m.push($),y.push("text"),k.push(I),A=null)}for(let F=0;F<b.len;F++){const S=b.texts[F],N=b.kinds[F],D=b.isWordLike[F],B=b.starts[F];if(N==="text"){const U=DJ(S),H=Bv(S);if(A!==null&&x&&L){A.push(S),$=$||D,x=x||U,L=H;continue}E(),A=[S],$=D,I=B,x=U,L=H;continue}E(),v.push(S),m.push(D),y.push(N),k.push(B)}return E(),{len:v.length,texts:v,isWordLike:m,kinds:y,starts:k}})(ZS(p,u,h)):ZS(p,u,h);return lt({normalized:p,chunks:oee(g,h)},g)})(o,Wm(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const X0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Eo=(()=>{const e=globalThis;if(e[X0])return e[X0];const t={configs:{},controllers:{},revision:Ra(0),preparedCache:new Map,blockEstimateCache:new Map};return e[X0]=t,t})();let Pu=null;const eC=Eo.revision;function tC(e){var t;return e&&(t=Eo.configs[e])!=null?t:null}function nC(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function hee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function J0(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!hee(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
|
|
276
|
+
`)}return s.length>0?s:null}function eg(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Pu!=null)return Pu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Pu=!!((i=r.getContext)!=null&&i.call(r,"2d")),Pu}catch{return Pu=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Eo.blockEstimateCache.get(r);if(l)return Eo.blockEstimateCache.delete(r),Eo.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,g){const b=`${g}\0${p}\0${h}`,v=Eo.preparedCache.get(b);if(v)return Eo.preparedCache.delete(b),Eo.preparedCache.set(b,v),v.prepared;const m=fee(h,p,{whiteSpace:g});for(Eo.preparedCache.set(b,{prepared:m});Eo.preparedCache.size>240;){const y=Eo.preparedCache.keys().next().value;if(!y)break;Eo.preparedCache.delete(y)}return m})(e,n.font,a),u=(function(h,p,g){const b=(function(v,m){return v.simpleLineWalkFastPath?JS(v,m):(function(y,k){if(y.simpleLineWalkFastPath)return JS(y,k);const{widths:A,lineEndFitAdvances:$,lineEndPaintAdvances:I,kinds:x,breakableFitAdvances:L,discretionaryHyphenWidth:E,tabStopAdvance:F,chunks:S}=y;if(A.length===0||S.length===0)return 0;const N=Wm(),D=N.lineFitEpsilon,B=k+D;let U=0,H=0,P=!1,Z=0,K=0,V=-1,J=0,he=0,ne=null;function ue(){V=-1,J=0,he=0,ne=null}function de(ee=Z,ye=K,fe=H){U++,H=0,P=!1,ue()}function Ce(ee,ye){P=!0,Z=ee+1,K=0,H=ye}function Ie(ee,ye,fe){P=!0,Z=ee,K=ye+1,H=fe}function le(ee,ye){P?(H+=ye,Z=ee+1,K=0):Ce(ee,ye)}function z(ee,ye,fe,ve){if(!ye)return;const j=ee==="tab"?0:$[fe],te=ee==="tab"?ve:I[fe];V=fe+1,J=H-ve+j,he=H-ve+te,ne=ee}function ae(ee,ye){const fe=L[ee];for(let ve=ye;ve<fe.length;ve++){const j=fe[ve];P?H+j>B?(de(),Ie(ee,ve,j)):(H+=j,Z=ee,K=ve+1):Ie(ee,ve,j)}P&&Z===ee&&K===fe.length&&(Z=ee+1,K=0)}function ie(ee){if(ne!=="soft-hyphen")return!1;const ye=L[ee];if(ye==null)return!1;const{fitCount:fe,fittedWidth:ve}=(function(j,te,me,Ae,$e){let De=0,ge=te;for(;De<j.length;){const Ne=ge+j[De];if((De+1<j.length?Ne+$e:Ne)>me+Ae)break;ge=Ne,De++}return{fitCount:De,fittedWidth:ge}})(ye,H,k,D,E);return fe!==0&&(H=ve,Z=ee,K=fe,ue(),fe===ye.length?(Z=ee+1,K=0,!0):(de(ee,fe,ve+E),ae(ee,fe),!0))}function q(ee){U++,ue()}for(let ee=0;ee<S.length;ee++){const ye=S[ee];if(ye.startSegmentIndex===ye.endSegmentIndex){q();continue}P=!1,H=0,ye.startSegmentIndex,Z=ye.startSegmentIndex,K=0,ue();let fe=ye.startSegmentIndex;for(;fe<ye.endSegmentIndex;){const ve=x[fe],j=ve==="space"||ve==="preserved-space"||ve==="tab"||ve==="zero-width-break"||ve==="soft-hyphen",te=ve==="tab"?aee(H,F):A[fe];if(ve!=="soft-hyphen")if(P){if(H+te>B){const me=H+(ve==="tab"?0:$[fe]),Ae=H+(ve==="tab"?te:I[fe]);if(ne==="soft-hyphen"&&N.preferEarlySoftHyphenBreak&&J<=B){de(V,0,he);continue}if(ne==="soft-hyphen"&&ie(fe)){fe++;continue}if(j&&me<=B){le(fe,te),de(fe+1,0,Ae),fe++;continue}if(V>=0&&J<=B){if(Z>V||Z===V&&K>0){de();continue}const $e=V;de($e,0,he),fe=$e;continue}if(te>k&&L[fe]!==null){de(),ae(fe,0),fe++;continue}de();continue}le(fe,te),z(ve,j,fe,te),fe++}else te>k&&L[fe]!==null?ae(fe,0):Ce(fe,te),z(ve,j,fe,te),fe++;else P&&(Z=fe+1,K=0,V=fe+1,J=H+E,he=H+E,ne=ve),fe++}if(P){const ve=V===ye.consumedEndSegmentIndex?he:H;de(ye.consumedEndSegmentIndex,0,ve)}}return U})(v,m)})(h,p);return{lineCount:b,height:b*g}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Eo.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Eo.blockEstimateCache.size>4e3;){const h=Eo.blockEstimateCache.keys().next().value;if(!h)break;Eo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function n5(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=J0(e.children);return i&&n.paragraph?eg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=J0(e.children),l=n.headings[i];return r&&l?eg(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=J0((s=i[0])==null?void 0:s.children);return r?eg(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=n5(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 sh(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function pee(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(sh(String((d=u.originalCode)!=null?d:"")),sh(String((f=u.updatedCode)!=null?f:"")),sh(String((h=u.code)!=null?h:""))):sh((function(p,g){const b=String(p??"");return g?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const g=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*g)})(u,r),f=(function(h,p){var g,b;if(!p)return 0;const v=typeof((g=h?.padding)==null?void 0:g.top)=="number"?h.padding.top:10,m=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,v)+Math.max(0,m)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function mee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function tg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=nC(o.lineHeight,1.5*nC(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:mee(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const gee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function oC(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))gee.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const vee=!1;function y_e(){return vee}function sC(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const o5=Symbol("MarkstreamMathBlockMinHeightCache");function k_e(){return Kt(o5,null)}const yee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],kee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],bee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),s5=["raw","content","code","originalCode","updatedCode"],iC=new WeakMap,rC=new WeakMap;let xee=1;function Ti(){return typeof performance<"u"?performance.now():Date.now()}function lC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function gi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=iC.get(t);return n||(n=xee++,iC.set(t,n)),String(n)}function aC(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:gi(t),customMarkdownIt:gi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:gi(e.validateLink),preTransformTokens:gi(e.preTransformTokens),postTransformTokens:gi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function cC(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
277
|
+
`,t-1)+1;return e.slice(n,t).trim()}function uC(e){const t=i5(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function i5(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function r5(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 Tk(e){const t=String(e??"");return`${t.length}:${r5(t)}`}function Hv(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?Tk(r):`${r.length}:${r5(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${gi(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${gi(o)}`;const i=gi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Hv(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}:${Hv(r[c],t,n+1)}`).join(";")}`}return typeof e}function Fp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function l5(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Fp(o)?Rl(o,t,n+1):l5(o,t,n+1)).join(",")}`:Fp(e)?Rl(e,t,n):Hv(e,t,n)}function wee(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!s5.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${Tk(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${gi(s)}`:bee.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${l5(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${gi(s)}`:""}).filter(Boolean).join(";")}function _ee(e){return s5.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Tk(n)}`:""}).filter(Boolean).join(";")}function Rl(e,t=new WeakMap,n=0){const o=rC.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${gi(s)}`;const r=gi(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Rl(p,c,u+1)).join("|"):"";return[a.type,_ee(d),wee(d,c,u),f.length,h].join(":")})(e,t,n);return rC.set(s,l),l}function a5(e,t){return Rl(e)===Rl(t)}function Nk(e,t,n){const o=Ti(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ti()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function dC(e,t,n){return Nk(t,n,()=>Rl(e))}function c5(e,t,n){return dC(e,n,"stabilizeSignatureMs")===dC(t,n,"stabilizeSignatureMs")}function ng(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function fC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function See(e,t){return e.length===t.length&&e===t}function Ik(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!See(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Fp(d)||!Fp(f))return null;const h=Ik(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function Cee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Ik(e,t);return n??a5(e,t)}function Aee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return Nk(n,"stabilizeSignatureMs",()=>{o=Ik(e,t)}),o??c5(e,t,n)}function Mee(e,t){const n={};for(const o of yee){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function Eee(e,t){var n;const o=gS(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:R(()=>!1),r=X(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ti();function g(){l&&(clearTimeout(l),l=void 0)}function b(){g();const L=t.renderContent.value;r.value!==L&&(r.value=L),p=Ti()}Qe([t.renderContent,t.effectiveFinal,i],([L,E,F])=>{r.value!==L&&(!F||E||(function(S,N){if(!S&&N||N.length<=80||N.length<S.length||!N.startsWith(S))return!0;const D=N.slice(S.length);return!!D&&(!!uC(cC(N))||!(!D.includes(`
|
|
278
|
+
|
|
279
|
+
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(D))||D.endsWith(`
|
|
280
|
+
`)&&!(function(B){const U=cC(B);if(uC(U))return!1;const H=i5(U);return H.length>=2&&H.some(P=>P.trim())})(N))})(r.value,L)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(N){const D=N.parseCoalesceMs;return typeof D=="number"&&Number.isFinite(D)&&D>=0?D:80})(e)-(Ti()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),hy(g);const v=R(()=>{var L,E,F,S;return KV(e.customHtmlTags,(L=e.parseOptions)==null?void 0:L.customHtmlTags,(S=(F=(E=t.customComponentsMap)==null?void 0:E.value)!=null?F:{},Object.entries(S).map(([N,D])=>{const B=_i(N);return D==null||!B||tf(B)||R6.has(B)||Xd.has(B)?"":B}).filter(Boolean)))}),m=R(()=>{const{key:L,tags:E}=GV(v.value);if(!L)return o;const F=s.get(L);if(F)return F;const S=gS(t.instanceMsgId,{customHtmlTags:E});return s.set(L,S),S}),y=R(()=>{const L=m.value;return e.customMarkdownIt?e.customMarkdownIt(L):L}),k=R(()=>{var L,E;const F=(L=e.parseOptions)!=null?L:{},S=t.effectiveFinal.value,N=v.value,D=S!=null,B=N.length>0;return D||B||F.streamParse==null?lt(lt(Dt(lt({},F),{streamParse:(E=F.streamParse)==null||E}),D?{final:S}:{}),B?{customHtmlTags:N}:{}):F}),A=R(()=>{var L;return new Set(((L=k.value.customHtmlTags)!=null?L:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),$=R(()=>aC(k.value,y.value,e.customMarkdownIt,{includeFinal:!0})),I=R(()=>aC(k.value,y.value,e.customMarkdownIt,{includeFinal:!1}));Qe([$,I],([L,E],[F,S])=>{F&&(L===F&&E===S||(b(),E!==S&&(a=[],d="")))},{flush:"sync"});const x=R(()=>{var L,E,F,S,N,D,B,U;if((L=e.nodes)!=null&&L.length)return a=[],d="",pt(e.nodes.slice());const H=r.value;if(!H)return a=[],d="",[];const P=t.debugPerformanceEnabled.value,Z=P?Ti():0,K=y.value,V=$.value,J=I.value;c&&V!==c&&(function(ye){var fe,ve;(ve=(fe=ye.stream)==null?void 0:fe.reset)==null||ve.call(fe)})(K),u&&J!==u&&(a=[],d="");const he=a.length>0&&H.startsWith(d)&&J===u,ne=P?lC(K):null,ue=P?{}:void 0,de=ue?Dt(lt({},k.value),{__timing:ue}):k.value,Ce=SM(H,K,de),Ie=P?Ti():0,le=P?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let z,ae=P?ng(Ce.length):void 0,ie=0,q=0;if(he){const ye=P?Ti():0;if(le){const fe=(function(ve,j,te){if(!j.length)return{nodes:ve,metrics:ng(ve.length)};const me=(function(De,ge,Ne){const et=Math.min(De.length,ge.length);for(let rt=0;rt<et;rt++)if(!Aee(ge[rt],De[rt],Ne))return rt;return De.length===ge.length?-1:et})(ve,j,te);if(me<0)return{nodes:j,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:me,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const Ae=ve.slice();let $e=me;for(let De=0;De<me;De++)Ae[De]=j[De];for(let De=me;De<ve.length;De++){const ge=j[De],Ne=ve[De];ge&&c5(ge,Ne,te)&&(Ae[De]=ge,$e+=1)}return{nodes:Ae,metrics:{reusedNodeCount:$e,dirtyStartIndex:me,stablePrefixNodeCount:me,dirtyTailNodeCount:fC(me,ve,j)}}})(Ce,a,le);z=fe.nodes,ae=fe.metrics}else{const fe=(function(ve,j){if(!j.length)return{nodes:ve,metrics:ng(ve.length)};const te=(function($e,De){const ge=Math.min($e.length,De.length);for(let Ne=0;Ne<ge;Ne++)if(!Cee(De[Ne],$e[Ne]))return Ne;return $e.length===De.length?-1:ge})(ve,j);if(te<0)return{nodes:j,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:te,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const me=ve.slice();let Ae=te;for(let $e=0;$e<te;$e++)me[$e]=j[$e];for(let $e=te;$e<ve.length;$e++){const De=j[$e],ge=ve[$e];De&&a5(De,ge)&&(me[$e]=De,Ae+=1)}return{nodes:me,metrics:{reusedNodeCount:Ae,dirtyStartIndex:te,stablePrefixNodeCount:te,dirtyTailNodeCount:fC(te,ve,j)}}})(Ce,a);z=fe.nodes,ae=fe.metrics}ie=P?Ti()-ye:0,q=ae?.dirtyStartIndex==null||ae.dirtyStartIndex<0?z.length:ae.dirtyStartIndex}else z=Ce;le?(function(ye,fe,ve=0){for(let j=Math.max(0,ve);j<ye.length;j++)Nk(fe,"primeSignatureMs",()=>Rl(ye[j]))})(z,le,q):(function(ye,fe=0){for(let ve=Math.max(0,fe);ve<ye.length;ve++)Rl(ye[ve])})(z,q);const ee=P?Ti()-Ie:0;if(f+=1,d=H,c=V,u=J,a=z,P){const ye=lC(K),fe=typeof ye?.total=="number"&&ye.total>((E=ne?.total)!=null?E:0);t.logPerf(fe?"parse(stream)":"parse(sync)",lt(lt(lt({rendererId:t.instanceMsgId,ms:Math.round(Ti()-Z),nodes:z.length,contentLength:H.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:ee,signatureMs:(F=le?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(N=le?.primeSignatureMs)!=null?N:0,signatureCallCount:(D=le?.signatureCallCount)!=null?D:0,stabilizeSignatureCallCount:(B=le?.stabilizeSignatureCallCount)!=null?B:0,primeSignatureCallCount:(U=le?.primeSignatureCallCount)!=null?U:0,stabilizeMs:ie},ae??{}),ue?Object.fromEntries(kee.map(ve=>{var j;return[ve,(j=ue[ve])!=null?j:0]})):{}),ye?{streamMode:ye.lastMode,streamDelta:Mee(ye,ne),streamStats:ye}:{}))}return pt(z)});return{effectiveCustomHtmlTags:v,effectiveCustomHtmlTagsSet:A,mdBase:m,mdInstance:y,mergedParseOptions:k,parsedNodes:x}}function Tee(e){const{isClient:t}=e,n=X(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((g=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!g)return;var p,g;const b=n.value,v=b.has(f);if(h){if(v)return;const y=new Set(b);return y.add(f),void(n.value=y)}if(!v)return;const m=new Set(b);m.delete(f),n.value=m})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function Nee(e={}){const t=X(""),n=X(""),o=X(!1),s=IQ(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=R(()=>Math.max(0,t.value.length-n.value.length)),a=R(()=>l.value===0),c=R(()=>o.value&&a.value);return fy()&&hy(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const hC=/auto|scroll|overlay/i;function Iee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return hC.test(t)||hC.test(n)}function Lee(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 $ee=Ze({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return Av((o=Mc(e.estimatedPreviewHeightPx))!=null?o:Sv(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),mn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),mn("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},()=>mn("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,mn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[mn("div",{class:"absolute inset-0"},[mn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),Fee=Ze({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return Cv((o=Mc(e.estimatedPreviewHeightPx))!=null?o:_v(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),mn("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},()=>mn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[mn("span",{class:"action-icon block"})])))]):null,mn("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)"}},[mn("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"}})])])}}),Oee=["data-custom-id"],Ree={class:"m-0 p-0"},Bee=["data-probe"],Dee=["data-node-index","data-node-type"],u5=gn(Ze(Dt(lt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=Yo(),r=Kt("markstreamNestedRendererProps",void 0);function l(M){var W,G;const Y=o[M];return(function(se){const Se=i?.vnode.props;return!!Se&&(Object.prototype.hasOwnProperty.call(Se,se)||Object.prototype.hasOwnProperty.call(Se,String(se).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?Y:(G=(W=r?.value)==null?void 0:W[M])!=null?G:Y}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=R(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=R(()=>{const M=l("renderCodeBlocksAsPre"),W=l("codeRenderer");return M===!0?"pre":W==="pre"||W==="shiki"||W==="monaco"?W:M===!1||c.value==="docs"?"monaco":"pre"}),d=R(()=>a[c.value]),f=R(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),h=R(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),p=R(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),g=R(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),b=R(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),v=R(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),m=R(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),y=R(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),k=R(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=R(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),$=R(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),I=R(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return v.value},get renderBatchBudgetMs(){return m.value},get renderBatchIdleTimeoutMs(){return y.value},get deferNodesUntilVisible(){return k.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return $.value},get nodeVirtual(){return I.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function L(M){s("height-change",M)}function E(M){s("virtual-state-change",M)}function F(M){s("anchor-change",M)}const S=X(),N=X(null),D=X(null),B=X(null),U=Bo({1:null,2:null,3:null,4:null,5:null,6:null}),H=X(!1),P=new Map,Z=X(0),K=X(0),V=X({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function J(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const G=(W=o.virtualScroll)==null?void 0:W.scrollRoot;return he(typeof G=="function"?G():G)}function he(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?he(M.value):typeof M=="object"&&"$el"in M?he(M.$el):null:null}const{isClient:ne,renderAsFragment:ue,debugPerformanceEnabled:de,resolvedShowTooltips:Ce,resolvedHtmlPolicy:Ie,inheritedSmoothStreaming:le,ownsTypewriterCursor:z}=(function(M){const W=typeof window<"u",G=Kd(),Y=Kt("markstreamHtmlPolicy",void 0),se=Kt("markstreamTypewriterCursor",void 0),Se=Kt("markstreamSmoothStreaming",void 0),Me=R(()=>M.renderAsFragment===!0),Le=R(()=>!!(M.debugPerformance&&W&&typeof console<"u")),qe=R(()=>{var je;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Be=(je=G.showTooltips)!=null?je:G["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Re=R(()=>{var je,Be;return(Be=(je=M.htmlPolicy)!=null?je:Y?.value)!=null?Be:"safe"}),Ge=R(()=>se?.value!==!0);return{isClient:W,renderAsFragment:Me,debugPerformanceEnabled:Le,resolvedShowTooltips:qe,resolvedHtmlPolicy:Re,inheritedSmoothStreaming:Se,inheritedTypewriterCursor:se,ownsTypewriterCursor:Ge}})(x),{resolveViewportRoot:ae,resolveScrollContainer:ie,isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ye}=(function(M,W){function G(){var Le,qe;return(qe=(Le=W.scrollRoot)==null?void 0:Le.call(W))!=null?qe:null}function Y(Le){if(typeof window>"u")return null;const qe=G();if(qe)return qe;const Re=Le??M.value;if(!Re)return null;const Ge=Re.ownerDocument||document,je=Ge.scrollingElement||Ge.documentElement;let Be=Re;for(;Be&&Be!==Ge.body&&Be!==je;){if(Iee(window.getComputedStyle(Be))&&Lee(Be))return Be;Be=Be.parentElement}return null}function se(Le){if(!W.isClient)return!1;try{const qe=window.getComputedStyle(Le);return!!(qe.display||"").toLowerCase().includes("flex")&&(qe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Se(Le,qe,Re){var Ge,je;if(Re)return Me(qe);const Be=Le.scrollTop;if(!se(Le))return Be;const Ke=Be<0?-Be:Be;return Math.max(0,((Ge=Le.scrollHeight)!=null?Ge:0)-((je=Le.clientHeight)!=null?je:0))-Ke}function Me(Le){var qe,Re,Ge,je,Be;const Ke=Number((qe=Le.scrollingElement)==null?void 0:qe.scrollTop),tt=Number((Ge=(Re=Le.documentElement)==null?void 0:Re.scrollTop)!=null?Ge:0),nt=Number((Be=(je=Le.body)==null?void 0:je.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Ke)?Ke:0,Number.isFinite(tt)?tt:0,Number.isFinite(nt)?nt:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(Le){var qe,Re,Ge,je;const Be=G();if(Be)return Be;const Ke=Y((qe=Le??M.value)!=null?qe:null);if(Ke)return Ke;const tt=(je=(Ge=Le?.ownerDocument)!=null?Ge:(Re=M.value)==null?void 0:Re.ownerDocument)!=null?je:typeof document<"u"?document:null;return tt?.scrollingElement||tt?.documentElement||null},isReverseFlexScrollRoot:se,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:function(Le,qe){const Re=qe.ownerDocument||Le.ownerDocument||document;if((function(Ke,tt){return Ke===tt.documentElement||Ke===tt.body||Ke===tt.scrollingElement})(qe,Re))return Le.getBoundingClientRect().top+Me(Re);const Ge=qe.getBoundingClientRect(),je=Le.getBoundingClientRect(),Be=Se(qe,Re,!1);return je.top-Ge.top+Be}}})(S,{isClient:ne,scrollRoot:J});In("markstreamShowTooltips",Ce),In("markstreamHtmlPolicy",Ie),In("markstreamTypewriter",R(()=>x.typewriter!==!1)),In("markstreamFade",R(()=>x.fade!==!1)),In("markstreamTypewriterCursor",R(()=>!0)),In("markstreamTextStreamState",P),In("markstreamStreamVersion",Z),In("markstreamParseOptions",R(()=>x.parseOptions)),In("markstreamCustomMarkdownIt",R(()=>x.customMarkdownIt));const{smoothStreamingEnabled:fe,renderContent:ve,effectiveFinal:j}=(function(M,W){const G=Nee(M.smoothStreamingOptions),Y=R(()=>{var Re,Ge,je;return M.smoothStreaming!==!1&&!((Re=M.nodes)!=null&&Re.length)&&(M.smoothStreaming===!0||!((Ge=W.inheritedSmoothStreaming)!=null&&Ge.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((je=M.maxLiveNodes)!=null?je:0)<=0)}),se=X(!W.isClient||M.smoothStreaming===!0);cn(()=>{se.value=!0});const Se=R(()=>se.value&&Y.value),Me=R(()=>{var Re;return Se.value?G.visible.value:(Re=M.content)!=null?Re:""}),Le=R(()=>{var Re,Ge;const je=(Re=M.parseOptions)!=null?Re:{};return(Ge=M.final)!=null?Ge:je.final}),qe=R(()=>{const Re=Le.value;return Se.value&&Re!=null?!!Re&&G.caughtUp.value:Re});return Qe([()=>M.content,()=>M.nodes,Se,Le],([Re,Ge,je,Be])=>{if(Ge?.length)return void G.reset("");const Ke=Re??"";if(!je)return G.reset(Ke),void(Be&&G.finish({flush:!0}));const tt=G.source.value;Ke?Ke===tt||(Ke.startsWith(tt)?G.enqueue(Ke.slice(tt.length)):G.reset(Ke)):G.reset(""),Be&&G.finish()},{immediate:!0}),{smoothStream:G,smoothStreamingEligible:Y,smoothStreamingEnabled:Se,renderContent:Me,requestedFinal:Le,effectiveFinal:qe}})(x,{isClient:ne,inheritedSmoothStreaming:le});In("markstreamSmoothStreaming",fe);const te=X(!1);let me="",Ae=!1,$e=null;function De(){ne&&$e!=null&&(window.clearTimeout($e),$e=null)}function ge(){te.value=!1,De()}function Ne(M,W){if(!de.value)return;const G=(function(){if(!de.value)return null;const Y=It(et),se=It(rt),Se=Math.max(gt,se);if(Y<=0&&Se<=0)return null;const Me={total:Y,maxPerFrame:Se,byLabel:(Le=et,Object.fromEntries(Array.from(Le.entries()).sort((qe,Re)=>Re[1]-qe[1]||qe[0].localeCompare(Re[0]))))};var Le;return et.clear(),rt.clear(),gt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,G?Dt(lt({},W),{layoutReads:G}):W)}Qe([ve,()=>o.nodes,j],([M,W,G])=>{const Y=M??"";return W?.length||G===!0?(ge(),me=Y,void(Ae=!0)):Ae?(me&&Y.length>me.length&&Y.startsWith(me)?(te.value=!0,ne&&(De(),$e=window.setTimeout(()=>{var se;$e=null,j.value===!0||(se=o.nodes)!=null&&se.length||(Za(),te.value=!1,dr())},1200))):(Y.length<me.length||!Y.startsWith(me))&&ge(),void(me=Y)):(me=Y,void(Ae=!0))},{flush:"sync",immediate:!0});const et=new Map,rt=new Map;let St=!1,gt=0;function It(M){let W=0;for(const G of M.values())W+=G;return W}function Ut(){gt=Math.max(gt,It(rt)),rt.clear(),St=!1}function ht(M,W){return(function(G){var Y,se;de.value&&(et.set(G,((Y=et.get(G))!=null?Y:0)+1),rt.set(G,((se=rt.get(G))!=null?se:0)+1),St||(St=!0,ne&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ut):typeof queueMicrotask!="function"?setTimeout(Ut,0):queueMicrotask(Ut)))})(M),W()}const un=x.customId?`renderer-${x.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,dn=(function(M){const W=new Map;return{scope:M,cache:W,clear:()=>W.clear()}})(un),ns=R(()=>`${un}:${Z.value}`);In(o5,dn);const Wt=Co(()=>x.customId),{effectiveCustomHtmlTagsSet:Pn,mergedParseOptions:co,parsedNodes:it}=Eee(x,{instanceMsgId:un,renderContent:ve,effectiveFinal:j,smoothStreamingEnabled:fe,debugPerformanceEnabled:de,customComponentsMap:Wt,logPerf:Ne});Qe(it,()=>{dn.clear(),Z.value+=1},{immediate:!0});const Gn=R(()=>({customId:x.customId,customHtmlTags:co.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:Ie.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:Ce.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));In("markstreamNestedRendererProps",Gn);const uo=R(()=>it.value),Yn=R(()=>it.value.length),go=X(null),os=X(null),Un=X(null),to=X(null),vn=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Zn=!vn&&x.customId?tC(x.customId):null,xn=R(()=>Zn?(eC.value,tC(x.customId)):null),Cn=R(()=>{var M;return!!(ne&&!ue.value&&x.customId&&!vn&&((M=xn.value)!=null&&M.enabled))}),An=R(()=>{var M;return!!(!ue.value&&((M=o.virtualScroll)!=null&&M.enabled))}),Do=X(!1);cn(()=>{Do.value=!0});const ze=R(()=>!!(ne&&An.value));In("markstreamHostScrollManaged",ze);const Xe=R(()=>!!(Do.value&&ze.value)),kt=R(()=>Cn.value||ze.value),Pt=R(()=>Cn.value||Xe.value),On=R(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.textEstimation)!==!1}),sn=R(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.codeBlockEstimation)!==!1});function Gt(){const M=K.value||ht("getMeasuredContainerWidth.clientWidth",()=>{var W;return((W=S.value)==null?void 0:W.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const Hn=R(()=>{const M=Gt();return M>0?Math.max(1,Math.round(M)):640}),Mn=R(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),Ct=R(()=>{var M;return!ue.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?it.value.length>0:it.value.length>Mn.value)}),Po=R(()=>Ct.value||Cn.value||ze.value),Ao=R(()=>x.viewportPriority!==!1&&!H.value),ss=gJ(M=>{var W;return ae((W=M??S.value)!=null?W:null)},Ao),{requestFrame:En,cancelFrame:qn,hasIdleCallback:Ps,isTestEnv:ti}=(function(M){const W=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,G=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=M.isClient&&typeof window.requestIdleCallback=="function",se=(function(){var Se;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(Se=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Se.value;return Me?.env})();return{requestFrame:W,cancelFrame:G,hasIdleCallback:Y,isTestEnv:se?.NODE_ENV==="test"}})({isClient:ne}),{resolvedBatchSize:Io,resolvedInitialBatch:Ss,batchingEnabled:Wi,incrementalRenderingActive:Si,renderedCount:fo,previousRenderContext:ni,adaptiveBatchSize:Ci,previousBatchConfig:ar}=(function(M,W){var G;const Y=R(()=>{var je;const Be=Math.trunc((je=M.renderBatchSize)!=null?je:80);return Number.isFinite(Be)?Math.max(0,Be):0}),se=R(()=>{var je;const Be=Math.trunc((je=M.initialRenderBatchSize)!=null?je:Y.value);return Number.isFinite(Be)?Math.max(0,Be):Y.value}),Se=R(()=>!W.renderAsFragment.value&&M.batchRendering!==!1&&Y.value>0&&W.isClient&&!W.isTestEnv),Me=X(0),Le=X({key:M.indexKey,total:0}),qe=X(Math.max(1,Y.value||1)),Re=R(()=>{var je;return Se.value&&((je=M.maxLiveNodes)!=null?je:0)<=0}),Ge=X({batchSize:Y.value,initial:se.value,delay:(G=M.renderBatchDelay)!=null?G:16,enabled:Re.value});return{resolvedBatchSize:Y,resolvedInitialBatch:se,batchingEnabled:Se,incrementalRenderingActive:Re,renderedCount:Me,previousRenderContext:Le,adaptiveBatchSize:qe,previousBatchConfig:Ge}})(x,{isClient:ne,isTestEnv:ti,renderAsFragment:ue}),no=new Map,is=new Map,rs=new WeakMap;let Lo=null;const Ai=new WeakMap,Wn=new Map,$o=X(0),oi=R(()=>($o.value,Array.from(no.entries()).sort((M,W)=>M[0]-W[0]))),Ue=X(null),Fe=X(null);let oe=null,Te=0,pe=null;const{activeRestoreAnchor:_e,getRelativeScrollTopWithinContainer:He,setRelativeScrollTopWithinContainer:Ot,resolveAnchorOffset:Bt,clearRestoreReconcile:rn,scheduleRestoreReconcile:zn,captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:ke}=(function(M){const{isClient:W,containerRef:G,parsedNodeCount:Y,requestFrame:se,cancelFrame:Se,resolveScrollContainer:Me,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:qe,isReverseFlexScrollRoot:Re,estimateIndexForOffset:Ge,estimateHeightRange:je,getFallbackNodeHeight:Be,clamp:Ke}=M,tt=X(null);let nt=null,_t=[];function at(){const Lt=Me(),qt=G.value;if(!Lt||!qt)return null;const zt=Lt.ownerDocument||qt.ownerDocument||document;if(Lt===zt.documentElement||Lt===zt.body||Lt===zt.scrollingElement){const fn=qt.getBoundingClientRect();return Math.max(0,-fn.top)}return Math.max(0,Le(Lt,zt,!1)-qe(qt,Lt))}function ft(Lt){var qt;const zt=Me(),fn=G.value;if(!zt||!fn)return;const Us=Math.max(0,Lt),as=zt.ownerDocument||fn.ownerDocument||document,Mi=as.defaultView||(typeof window<"u"?window:null);if(zt===as.documentElement||zt===as.body||zt===as.scrollingElement){const Qr=Le(zt,as,!0)+fn.getBoundingClientRect().top;return void((qt=Mi?.scrollTo)==null||qt.call(Mi,0,Math.max(0,Qr+Us)))}sC(zt,as,qe(fn,zt)+Us,{isReverseFlexScrollRoot:Qr=>{var Xr;return(Xr=Re?.(Qr))!=null&&Xr},getNormalizedScrollTop:Le})}function Et(Lt){const qt=Y.value,zt=Ke(Lt.nodeIndex,0,Math.max(0,qt-1));return je(0,zt)+Math.max(0,Lt.offsetWithinNodePx)}function At(){if(nt!=null&&(Se?.(nt),nt=null),W)for(const Lt of _t)window.clearTimeout(Lt);_t=[]}function tn(Lt){const qt=Et(Lt),zt=at();zt!=null&&Math.abs(zt-qt)<=.5||ft(qt)}return{activeRestoreAnchor:tt,getRelativeScrollTopWithinContainer:at,setRelativeScrollTopWithinContainer:ft,resolveAnchorOffset:Et,clearRestoreReconcile:At,applyRestoreAnchor:tn,scheduleRestoreReconcile:function(){tt.value&&W&&nt==null&&(nt=se?se(()=>{nt=null,tt.value&&tn(tt.value)}):null,nt==null&&tt.value&&tn(tt.value))},captureRestoreAnchor:function(){const Lt=at(),qt=Y.value;if(Lt==null||qt<=0)return null;const zt=Ke(Ge(Lt+1),0,qt-1),fn=je(0,zt),Us=Be(zt);return{nodeIndex:zt,offsetWithinNodePx:Ke(Lt-fn,0,Math.max(0,Us-1))}},restoreAnchor:function(Lt){const qt=Y.value;if(tt.value={nodeIndex:Ke(Lt.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,Lt.offsetWithinNodePx)},At(),tn(tt.value),W)for(const zt of[0,120,280,480])_t.push(window.setTimeout(()=>{tt.value&&tn(tt.value)},zt))},getAnchorDrift:function(Lt){const qt=at();return qt==null?null:qt-Et(Lt)}}})({isClient:ne,containerRef:S,parsedNodeCount:Yn,requestFrame:En,cancelFrame:qn,resolveScrollContainer:()=>Ue.value||ie(),getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ye,isReverseFlexScrollRoot:q,estimateIndexForOffset:D1,estimateHeightRange:Zr,getFallbackNodeHeight:mf,clamp:Wo}),{nodeHeights:be,heightStats:Oe,heightTreeSize:Ye,heightSumTree:st,heightKnownTree:wt,averageNodeHeight:Ht,resetHeightMeasurements:jn,pruneHeightMeasurements:jt,rebuildHeightTrees:oo,recordNodeHeight:ls,removeNodeHeights:Mt,exportHeightCache:Nt,importHeightCache:Vt,fenwickRangeSum:ho}=(function(M={}){const W=Bo({}),G=Bo({total:0,count:0}),Y=X(0),se=X([]),Se=X([]);function Me(){for(const Be of Object.keys(W))delete W[Number(Be)];G.total=0,G.count=0,Y.value=0,se.value=[],Se.value=[]}function Le(Be,Ke,tt){for(let nt=Ke+1;nt<Be.length;nt+=nt&-nt)Be[nt]+=tt}function qe(Be,Ke){let tt=0;for(let nt=Ke+1;nt>0;nt-=nt&-nt)tt+=Be[nt];return tt}function Re(Be){Y.value=Be;const Ke=new Array(Be+1).fill(0),tt=new Array(Be+1).fill(0);for(const[nt,_t]of Object.entries(W)){const at=Number(nt),ft=Number(_t);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0||(Le(Ke,at,ft),Le(tt,at,1))}se.value=Ke,Se.value=tt}function Ge(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Ke=W[Be];if(!Number.isFinite(Ke)||Ke<=0)return!1;if(delete W[Be],G.total=Math.max(0,G.total-Ke),G.count=Math.max(0,G.count-1),Y.value>Be){const tt=se.value,nt=Se.value;tt.length&&nt.length&&(Le(tt,Be,-Ke),Le(nt,Be,-1))}return!0}const je=R(()=>G.count>0?Math.max(12,G.total/G.count):32);return{nodeHeights:W,heightStats:G,heightTreeSize:Y,heightSumTree:se,heightKnownTree:Se,averageNodeHeight:je,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Be){if(Be<=0)return void Me();let Ke=0,tt=0;for(const[nt,_t]of Object.entries(W)){const at=Number(nt),ft=Number(_t);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0?delete W[at]:(Ke+=ft,tt++)}G.total=Ke,G.count=tt},rebuildHeightTrees:Re,recordNodeHeight:function(Be,Ke,tt={}){(function(nt,_t,at={}){var ft;if(!Number.isFinite(_t)||_t<=0)return!1;const Et=W[nt];if(Et&&(at.allowShrink===!1&&_t<Et||Math.abs(_t-Et)<=1))return!1;if(W[nt]=_t,Et?G.total+=_t-Et:(G.total+=_t,G.count++),Y.value>nt){const At=se.value,tn=Se.value;if(At.length&&tn.length)if(Et){const Lt=_t-Et;Lt!==0&&Le(At,nt,Lt)}else Le(At,nt,_t),Le(tn,nt,1)}at.notify!==!1&&((ft=M.onHeightRecorded)==null||ft.call(M))})(Be,Ke,Dt(lt({},tt),{notify:!0}))},removeNodeHeight:function(Be,Ke={}){var tt;const nt=Ge(Be);return nt&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},removeNodeHeights:function(Be,Ke={}){var tt;let nt=0;for(const _t of Be)Ge(Number(_t))&&nt++;return nt>0&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},exportHeightCache:function(){return Object.entries(W).map(([Be,Ke])=>({index:Number(Be),height:Number(Ke)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Ke)=>Be.index-Ke.index)},importHeightCache:function(Be,Ke={}){var tt;if(!Array.isArray(Be))return;const nt=Y.value;let _t=!1;if(Ke.mode!=="merge"){const at=Object.keys(W);if(at.length>0){for(const ft of at)delete W[Number(ft)];_t=!0}}for(const at of Be){const ft=Number(at.index),Et=Number(at.height);if(!Number.isInteger(ft)||ft<0||nt>0&&ft>=nt||!Number.isFinite(Et)||Et<=0)continue;const At=W[ft];At&&Math.abs(At-Et)<=1||(W[ft]=Et,_t=!0)}_t&&((function(){let at=0,ft=0;const Et=Y.value;for(const[At,tn]of Object.entries(W)){const Lt=Number(At),qt=Number(tn);!Number.isFinite(Lt)||Lt<0||Et>0&&Lt>=Et||!Number.isFinite(qt)||qt<=0?delete W[Lt]:(at+=qt,ft++)}G.total=at,G.count=ft})(),nt>0&&Re(nt),(tt=M.onHeightRecorded)==null||tt.call(M))},fenwickRangeSum:function(Be,Ke,tt){if(tt<=Ke)return 0;const nt=qe(Be,tt-1);return Ke<=0?nt:nt-qe(Be,Ke-1)}}})({onHeightRecorded:()=>{ii(),ze.value&&Mu(),_e.value&&zn(),Fe.value&&Ka(),Rn("node-resize")}});function so(){jn(),Wn.clear()}function zi(M){!Number.isInteger(M)||M<0||M>=it.value.length||Wn.set(M,gu(M))}function Ul(M,W,G={}){const Y=be[M];ls(M,W,G);const se=be[M];se&&se>0?zi(M):Y&&Wn.delete(M)}function ql(M,W){const G=ht("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,se;return(se=(Y=no.get(M))==null?void 0:Y.offsetHeight)!=null?se:0});return G>0?G:ht("getNodeLayoutHeight.content.offsetHeight",()=>W.offsetHeight)}function af(M,W={}){Vt(M,W),T1()}const Vr=R(()=>{var M;return!ue.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!Ct.value&&!(it.value.length>900)&&Ao.value}),k2=R(()=>!!ss&&(Vr.value||Ct.value)),b2=R(()=>Ct.value||ze.value),{liveNodeBufferResolved:fu,focusIndex:si,liveRange:Ho,updateLiveRange:jl}=(function(M,W){const{parsedNodeCount:G,virtualizationEnabled:Y,maxLiveNodesResolved:se,clamp:Se}=W,Me=R(()=>{var Re;return Math.max(0,(Re=M.liveNodeBuffer)!=null?Re:60)}),Le=X(0),qe=Bo({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Le,liveRange:qe,updateLiveRange:function(){const Re=G.value;if(!Y.value||Re===0)return qe.start=0,void(qe.end=Re);const Ge=Math.min(se.value,Re),je=Me.value,Be=Se(Le.value-je,0,Math.max(0,Re-Ge));qe.start=Be,qe.end=Math.min(Re,Be+Ge)}}})(x,{parsedNodeCount:Yn,virtualizationEnabled:Ct,maxLiveNodesResolved:Mn,clamp:Wo}),Ui=new Map,Vl=new Map,Kr=new Map,cf=[],cr=new Map,Gr=new Set,x2=X(0);let n1=!1;const w2=R(()=>(x2.value,Gr.size)),Hs=new Map,qi=new Map,_2=X(0),o1=R(()=>{_2.value;let M=0;for(const W of Hs.values())M+=Math.max(0,W);return M});let Ws=null,s1=!0,S2=[0],C2="";function ii(){s1=!0}const uf=R(()=>{if(!Ct.value)return it.value.length;const M=fu.value,W=Math.max(Ho.end+M,Ss.value),G=Math.min(it.value.length,W);return Math.max(fo.value,G)});function df(){n1||(n1=!0,queueMicrotask(()=>{n1=!1,x2.value+=1}))}function A2(M,W,G="node-resize"){if(!ne||typeof window>"u")return null;const Y=window.setTimeout(()=>{Gr.delete(Y)&&df();try{W()}finally{Rn(G)}},Math.max(0,M));return Gr.add(Y),df(),Y}function ff(M){ne&&M!=null&&(Gr.delete(M)&&df(),window.clearTimeout(M))}function M2(){if(ne&&typeof window<"u")for(const M of Gr)window.clearTimeout(M);Gr.size&&(Gr.clear(),df()),cf.length=0,Kr.clear()}function H8(M){var W,G;return(G=(W=to.value)==null?void 0:W[M])!=null?G:null}const{cancelScheduledFocusSync:i1,scheduleFocusSync:ji}=(function(M){const{isClient:W,containerRef:G,virtualizationEnabled:Y,requestFrame:se,cancelFrame:Se,syncFocusToScroll:Me}=M;let Le=null;function qe(){var Ge,je,Be;return(Be=(je=(Ge=G.value)==null?void 0:Ge.ownerDocument)==null?void 0:je.defaultView)!=null?Be:typeof window<"u"?window:null}function Re(){if(!Le)return;const Ge=qe();Le.viaTimeout?Ge?Ge.clearTimeout(Le.id):clearTimeout(Le.id):Se?.(Le.id),Le=null}return{cancelScheduledFocusSync:Re,scheduleFocusSync:function(Ge={}){if(!Y.value)return;if(!W)return void Me(!0);if(Ge.immediate)return Re(),void Me(!0);if(Le)return;const je=()=>{Le=null,Me()};if(se)return void(Le={id:se(je),viaTimeout:!1});const Be=qe();Le={id:Be?Be.setTimeout(je,16):setTimeout(je,16),viaTimeout:!0}}}})({isClient:ne,containerRef:S,virtualizationEnabled:Ct,requestFrame:En,cancelFrame:qn,syncFocusToScroll:function(M=!1){var W;if(!Ct.value)return;const G=Ue.value||ie();if(!G)return;const Y=G.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,se=Y?.defaultView||(typeof window<"u"?window:null),Se=G===Y?.documentElement||G===Y?.body,Me=it.value.length;if(!Se&&Me>0&&q(G)){const tt=ht("syncFocusToScroll.clientHeight",()=>G.clientHeight||0),nt=ht("syncFocusToScroll.scrollTop",()=>G.scrollTop),_t=nt<0?-nt:nt,at=(function(Et){var At,tn;const Lt=it.value;if(!Lt.length)return 0;if(Et<=0)return Math.max(0,Lt.length-1);if(kt.value){const zt=(At=u1()[Lt.length])!=null?At:0;return O2(Math.max(0,zt-Et))}if(Ye.value===Lt.length){const zt=Zr(0,Lt.length);return D1(Math.max(0,zt-Et))}let qt=Et;for(let zt=Lt.length-1;zt>=0;zt--){const fn=(tn=be[zt])!=null?tn:Ht.value;if(qt<=fn)return zt;qt-=fn}return 0})(Math.max(0,_t)+.5*Math.max(0,tt)),ft=Wo(at,0,Math.max(0,Me-1));return void((M||Math.abs(ft-si.value)>1)&&(si.value=ft,jl()))}const Le=Se?null:ht("syncFocusToScroll.root.getBoundingClientRect",()=>G.getBoundingClientRect()),qe=Se?0:Le.top,Re=Se?ht("syncFocusToScroll.viewport.clientHeight",()=>{var tt,nt;return(nt=(tt=se?.innerHeight)!=null?tt:G.clientHeight)!=null?nt:0}):Le.bottom,Ge=oi.value;let je=null,Be=null;for(const[tt,nt]of Ge){if(!nt)continue;const _t=ht("syncFocusToScroll.slot.getBoundingClientRect",()=>nt.getBoundingClientRect());_t.bottom<=qe||_t.top>=Re||(je==null&&(je=tt),Be=tt)}if(je==null||Be==null){const tt=S.value;if(!tt)return;const nt=Se?{top:0}:ht("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>G.getBoundingClientRect()),_t=ht("syncFocusToScroll.fallback.scrollTop",()=>ee(G,Y,Se)),at=Se?(()=>{const At=ht("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>tt.getBoundingClientRect()),tn=(Se?0:nt.top)-At.top;return Math.max(0,tn)})():(()=>{const At=ye(tt,G);return Math.max(0,_t-At)})(),ft=Se?ht("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var At,tn,Lt,qt;return(qt=(Lt=(tn=se?.innerHeight)!=null?tn:(At=Y?.documentElement)==null?void 0:At.clientHeight)!=null?Lt:G.clientHeight)!=null?qt:0}):ht("syncFocusToScroll.fallback.root.clientHeight",()=>G.clientHeight),Et=D1(at+.5*Math.max(0,ft));return si.value=Wo(Et,0,Math.max(0,it.value.length-1)),void jl()}const Ke=Math.round((je+Be)/2);!M&&Math.abs(Ke-si.value)<=1||(si.value=Wo(Ke,0,Math.max(0,it.value.length-1)),jl())}}),{visibleNodeIndices:r1,nodeVisibilityHandles:Ha,nodeVisibilityWatchStops:hf,nodeVisibilityFallbackTimers:E2,clearVisibilityFallback:pf,markNodeVisible:Yr,cleanupNodeVisibility:W8,destroyNodeVisibilityState:l1}=Tee({isClient:ne,shouldTrackVisibleNodeIndices:()=>Vr.value,shouldCleanupNodeVisibility:()=>Ct.value,onNodeMarkedVisible:M=>{Ct.value?ji():si.value=Wo(M,0,Math.max(0,it.value.length-1))},onNodeVisibilityCleaned:M=>{no.delete(M)&&ob()}}),{cleanupScrollListener:T2,setupScrollListener:z8}=(function(M){const{isClient:W,virtualizationEnabled:G,listenerEnabled:Y,scrollRootElement:se,resolveScrollContainer:Se,scheduleFocusSync:Me,onScroll:Le}=M;let qe=null,Re=null;function Ge(){qe&&(qe(),qe=null),Re=null,se.value=null}function je(Be){const Ke=M.getScrollTop?M.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Ke)?Math.abs(Ke):0)}return{cleanupScrollListener:Ge,setupScrollListener:function(){if(!W)return;if(!((Be=Y?.value)!=null?Be:G.value))return void Ge();var Be;const Ke=Se();if(!Ke)return void Ge();if(se.value===Ke&&qe)return;Ge(),Re=je(Ke);const tt=()=>{if(Le?.(),G.value){const nt=(function(_t){const at=je(_t),ft=Re;Re=at;const Et=Math.max(480,.75*(_t.clientHeight||0));return ft==null?at>Et?{immediate:!0}:void 0:Math.abs(at-ft)>Et?{immediate:!0}:void 0})(Ke);nt?Me(nt):Me()}};Ke.addEventListener("scroll",tt,{passive:!0}),se.value=Ke,qe=()=>{Ke.removeEventListener("scroll",tt)}}}})({isClient:ne,virtualizationEnabled:Ct,listenerEnabled:b2,scrollRootElement:Ue,resolveScrollContainer:ie,scheduleFocusSync:ji,onScroll:function(){const M=Fe.value;if(!M)return;const W=mu();if(!W||(function(Y){if(xu()>=Te)return pe=null,!1;const se=pe;if(se==null)return!0;const Se=Math.abs(Y.scrollTop-se)<=2;return Se||(pe=null),Se})(W))return;const G=q2(W);G!=null?(G<-32||Math.abs(Math.max(0,G)-Math.max(0,M.distanceFromBottomPx))>32)&&Va("restore"):Va("restore")},getScrollTop:M=>{var W;const G=M.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement;return ht("scrollListener.getScrollTop",()=>ee(M,G,Y))}});function Wo(M,W,G){return Math.min(Math.max(M,W),G)}function a1(M){return M?.firstElementChild}function N2(M,W){var G;return M?(G=M.matches)!=null&&G.call(M,W)?M:M.querySelector(W):null}function I2(){if(!kt.value)return void(K.value=0);const M=ht("updateExperimentContainerWidth.clientWidth",()=>{var W,G;return(G=(W=S.value)==null?void 0:W.clientWidth)!=null?G:0});K.value=M>0?M:0}let hu=null;function c1(){hu?.disconnect(),hu=null}const L2=Li({loader:()=>Xn(null,null,function*(){return(yield ms(()=>import("./index8-BJFkvY9w.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:ZM,delay:0,suspensible:!1});function $2(M){return M===L2}const F2=R(()=>u.value==="pre"?qs:u.value==="shiki"?L2:K0),Kl=R(()=>{const M=it.value;if(!M.length||!kt.value)return M.map(()=>null);const W=K.value||ht("estimatedNodeHeights.clientWidth",()=>{var G;return((G=S.value)==null?void 0:G.clientWidth)||0});return!Number.isFinite(W)||W<=0?M.map(()=>null):M.map((G,Y)=>{const se=be[Y],Se=typeof se=="number"&&se>0;if(On.value&&!Se){const Le=n5(G,W,V.value);if(Le)return Le}if(sn.value&&G.type==="code_block"){const Le=(function(qe){if(qe.type!=="code_block")return null;const Re=gb(qe,wf(qe));return $2(Re)?"markdown":Re===qs?"pre":Re===F2.value||Re===K0?"monaco":null})(G);if(Le==="monaco"||Le==="markdown"||Le==="pre")return pee(G,{rendererKind:Le,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Me=x.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function mf(M){var W;const G=be[M];if(Number.isFinite(G)&&G>0)return G;const Y=(W=Kl.value[M])==null?void 0:W.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Ht.value,(function(se){var Se,Me,Le,qe,Re,Ge,je,Be,Ke,tt,nt,_t,at;const ft=it.value[se];if(!ft||typeof ft!="object")return 32;const Et=String((Se=ft.type)!=null?Se:""),At=Gt()||640;switch(Et){case"heading":return 44;case"paragraph":return Wa(String((Le=(Me=ft.raw)!=null?Me:ft.content)!=null?Le:""),At,34);case"list":{const tn=Array.isArray(ft.items)?ft.items.length:1;return Math.max(48,30*tn+12)}case"list_item":return Wa(String((Re=(qe=ft.raw)!=null?qe:ft.content)!=null?Re:""),At,34);case"blockquote":return Wa(String((je=(Ge=ft.raw)!=null?Ge:ft.content)!=null?je:""),At,56);case"table":{const tn=Array.isArray(ft.rows)?ft.rows.length:Array.isArray(ft.children)?ft.children.length:3;return Math.max(120,38*tn+48)}case"code_block":return Wa(String((Ke=(Be=ft.code)!=null?Be:ft.raw)!=null?Ke:""),At,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Wa(String((nt=(tt=ft.raw)!=null?tt:ft.content)!=null?nt:""),At,96);case"thematic_break":return 24;default:return Wa(String((at=(_t=ft.raw)!=null?_t:ft.content)!=null?at:""),At,40)}})(M))}function Wa(M,W,G,Y=22){const se=String(M??"");if(!se)return G;const Se=Math.max(18,Math.floor(Math.max(320,W)/8)),Me=se.split(/\r?\n/).length,Le=Math.ceil(se.length/Se),qe=Math.max(1,Me,Le);return Math.max(G,Math.ceil(qe*Y+12))}function pu(M){const W=Number(M);return!Number.isFinite(W)||W<=0?-1:Math.round(W/32)}function u1(){var M,W;const G=it.value.length,Y=pu(K.value||ht("getFallbackHeightPrefix.clientWidth",()=>{var Le;return((Le=S.value)==null?void 0:Le.clientWidth)||0})),se=((M=o.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(o.virtualScroll.measurementKey),Se=[G,Oe.count,Math.round(Oe.total),Math.round(100*Ht.value),se,Y,kt.value?1:0,eC.value,Z.value].join(":");if(!s1&&C2===Se)return S2;const Me=new Array(G+1);Me[0]=0;for(let Le=0;Le<G;Le++)Me[Le+1]=Me[Le]+(kt.value?mf(Le):(W=be[Le])!=null?W:Ht.value);return S2=Me,C2=Se,s1=!1,Me}function O2(M){var W,G;const Y=it.value.length;if(Y<=0||M<=0)return 0;const se=u1();if(M>=((W=se[Y])!=null?W:0))return Y-1;let Se=0,Me=Y-1,Le=Y-1;for(;Se<=Me;){const qe=Se+Me>>1;((G=se[qe+1])!=null?G:0)>=M?(Le=qe,Me=qe-1):Se=qe+1}return Le}function Zr(M,W){var G,Y;if(M>=W)return 0;if(kt.value)return(function(Me,Le){var qe,Re;const Ge=it.value.length,je=Wo(Math.trunc(Me),0,Ge),Be=Wo(Math.trunc(Le),je,Ge);if(je>=Be)return 0;const Ke=u1();return((qe=Ke[Be])!=null?qe:0)-((Re=Ke[je])!=null?Re:0)})(M,W);if(Ye.value!==it.value.length){let Me=0;for(let Le=M;Le<W;Le++)Me+=(G=be[Le])!=null?G:Ht.value;return Me}const se=st.value,Se=wt.value;if(!se.length||!Se.length){let Me=0;for(let Le=M;Le<W;Le++)Me+=(Y=be[Le])!=null?Y:Ht.value;return Me}return ho(se,M,W)+(W-M-ho(Se,M,W))*Ht.value}Qe(()=>it.value.length,M=>{ii(),M<=0?so():(M<Ye.value&&jt(M),M!==Ye.value&&oo(M))},{immediate:!0});const U8=R(()=>{if(!Ct.value)return it.value.map((Y,se)=>({node:Y,index:se}));const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);return it.value.slice(W,G).map((Y,se)=>({node:Y,index:W+se}))}),d1=R(()=>Ct.value?Zr(0,Math.min(Ho.start,it.value.length)):0),f1=R(()=>{if(!Ct.value)return 0;const M=it.value.length;return Zr(Math.min(Ho.end,M),M)});function R2(){if(!kt.value)return 0;let M=0;const W=Kl.value;for(let G=0;G<W.length;G++){if(!W[G])continue;const Y=be[G];Number.isFinite(Y)&&Y>0||M++}return M}function B2(){const M=it.value.length;return{totalNodes:M,measuredCount:Oe.count,estimatedCount:R2(),averageNodeHeight:Ht.value,topSpacerHeight:d1.value,bottomSpacerHeight:f1.value,estimatedTotalHeight:Zr(0,M),width:Gl()}}function q8(){const M=it.value,W=B2();return Dt(lt({},W),{probe:{paragraphReady:!!V.value.paragraph,listItemReady:!!V.value.listItem,listWrapperOverhead:V.value.listWrapperOverhead,headingReadyLevels:Object.entries(V.value.headings).filter(([,G])=>!!G).map(([G])=>Number(G))},nodes:M.map((G,Y)=>{var se,Se,Me,Le,qe,Re,Ge,je,Be;return{index:Y,type:G.type,estimateKind:(Se=(se=Kl.value[Y])==null?void 0:se.kind)!=null?Se:null,rendererKind:(Le=(Me=Kl.value[Y])==null?void 0:Me.rendererKind)!=null?Le:null,estimatedHeight:(Re=(qe=Kl.value[Y])==null?void 0:qe.height)!=null?Re:null,estimatedContentHeight:(je=(Ge=Kl.value[Y])==null?void 0:Ge.contentHeight)!=null?je:null,measuredHeight:(Be=be[Y])!=null?Be:null}})})}function h1(){return o.indexKey!=null?String(o.indexKey):An.value?`virtual-${Vn()}`:"markdown-renderer"}function D2(M){const W=String(M),G=`${h1()}-`;if(!W.startsWith(G))return null;const Y=W.slice(G.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const se=Number(Y[1]);return!Number.isInteger(se)||se<0||se>=it.value.length?null:se}function Vn(){var M,W,G;const Y=(M=o.virtualScroll)==null?void 0:M.sessionKey;return String(Y!=null&&Y!==""?Y:(G=(W=o.indexKey)!=null?W:x.customId)!=null?G:un)}function Mo(){var M;const W=(M=o.virtualScroll)==null?void 0:M.threadKey;return W==null||W===""?void 0:String(W)}function p1(M){var W;return(M??"")===((W=Mo())!=null?W:"")}function j8(){var M;const W=(M=o.virtualScroll)==null?void 0:M.measurementKey;return W==null?"":String(W)}function V8(){var M,W;const G=u.value,Y=G==="monaco"?x.codeBlockMonacoOptions:void 0,se=x.codeBlockProps,Se=G==="shiki";return[x.isDark?"dark":"light",G==="monaco"?"code-rich":G==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",Fo(x.codeBlockMinWidth),Fo(x.codeBlockMaxWidth),...Se?[Ep((M=se?.themes)!=null?M:x.themes,(W=se?.langs)!=null?W:x.langs)]:[],Fo(Y?.fontSize),Fo(Y?.lineHeight),Fo(Y?.fontFamily),Fo(Y?.tabSize),Fo(Y?.MAX_HEIGHT),Fo(Y?.wordWrap),Fo(Y?.wrappingIndent),Fo(Y?.padding),Fo(se?.showHeader),Fo(se?.showCopyButton),Fo(se?.showExpandButton),Fo(se?.showPreviewButton),Fo(se?.showCollapseButton),Fo(se?.showFontSizeButtons)].join("\0")}function ur(){return[j8(),V8()].join("\0")}function Gl(){return Gt()}const gf=R(()=>pu(Gl())),zs=R(()=>[ur(),gf.value].join("\0")),K8=R(()=>{var M;return An.value?["virtual",(M=Mo())!=null?M:"",Vn(),zs.value].join("\0"):o.indexKey});function za(){_2.value+=1}function m1(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=it.value.length||M.sessionKey!==Vn()||M.threadKey!==Mo()||M.layoutEpochKey!==zs.value)}function P2(M){const W=String(M),G=qi.get(W);return G?m1(G)?G.index:null:D2(W)}function H2(M="async-node"){(Hs.size||qi.size)&&(Hs.clear(),qi.clear(),za(),Rn(M))}const Ua=Kt(bv,null),g1={reportHeight(M,W){if(!ze.value)return;const G=P2(M);if(G==null)return;const Y=Ui.get(G);if(!Y)return;const se=Number(W),Se=ql(G,Y);Ul(G,Number.isFinite(se)&&se>0?Math.max(se,Se||0):Se)},markPending(M){if(!ze.value)return;const W=D2(M);W!=null&&(function(G,Y){var se;const Se=qi.get(G);if(Se&&m1(Se))return Hs.set(G,Math.max(0,(se=Hs.get(G))!=null?se:0)+1),za(),void Rn("async-node");Hs.set(G,1),qi.set(G,(function(Me){return{index:Me,sessionKey:Vn(),threadKey:Mo(),layoutEpochKey:zs.value}})(Y)),za(),Rn("async-node")})(String(M),W)},markSettled(M){if(!ze.value)return;const W=String(M),G=P2(M);(G!=null||(function(Y){return Hs.has(String(Y))})(W))&&(function(Y){var se;const Se=(se=Hs.get(Y))!=null?se:0;return!(Se<=0||(Se<=1?(Hs.delete(Y),qi.delete(Y)):Hs.set(Y,Se-1),za(),Se===1&&Rn("async-node"),0))})(W)&&G!=null&&dr()}};function G8(){let M=0;for(const W of Ui.values())M+=ht("getVisibleDomHeight.offsetHeight",()=>{var G;return(G=W?.offsetHeight)!=null?G:0});return Math.ceil(Math.max(0,M))}In(bv,{reportHeight(M,W){g1.reportHeight(M,W),Ua?.reportHeight(M,W)},markPending(M){g1.markPending(M),Ua?.markPending(M)},markSettled(M){g1.markSettled(M),Ua?.markSettled(M)}});let v1,y1=null,qa=null;function vf(M){return M!==!1&&M!=null&&M!==""}function W2(){return Ct.value?(function(){if(!Ct.value)return!0;const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);if(W>=G)return!0;for(let Y=W;Y<G;Y++)if(!no.has(Y)||P1(Y)&&!Ui.has(Y))return!1;return!0})():fo.value>=uf.value}function k1(){return j.value===!0&&!te.value&&o1.value===0&&Gr.size===0&&cr.size===0&&Ws==null&&W2()}function z2(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.settleMode)!=="manual"||y1===Vn()&&v1===Mo())return!0;const G=(W=o.virtualScroll)==null?void 0:W.settledToken;return!!vf(G)&&qa===Eu(G)}function b1(){return k1()&&z2()}function Y8(M,W){return W.totalNodes<=0?M==="final"?"final":"estimate":W.measuredCount>=W.totalNodes?M==="final"?"final":"measured":W.measuredCount>0||W.estimatedCount>0?"mixed":"estimate"}function Yl(M="manual",W){const G=B2(),Y=(function(se){return se||(j.value!==!0?it.value.length>0?"streaming":"estimating":!W2()||cr.size>0||Ws!=null?"measuring":b1()?"settled":"settling")})(W);return{sessionKey:Vn(),threadKey:Mo(),phase:Y,nodeCount:G.totalNodes,liveRange:{start:Ho.start,end:Ho.end},renderedCount:fo.value,measuredCount:G.measuredCount,estimatedCount:G.estimatedCount,averageNodeHeight:G.averageNodeHeight,topSpacerHeight:G.topSpacerHeight,bottomSpacerHeight:G.bottomSpacerHeight,visibleDomHeight:G8(),totalHeight:U2(),width:G.width,final:j.value===!0,stable:b1(),confidence:Y8(Y,G),reason:M}}function mu(){const M=Ue.value||ie(),W=S.value;if(!M||!W)return null;const G=M.ownerDocument||W.ownerDocument||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement,se=ht("getScrollBox.scrollTop",()=>ee(M,G,Y)),Se=ht("getScrollBox.scrollHeight",()=>{var Le,qe,Re,Ge,je;return Y?Math.max((qe=(Le=G.documentElement)==null?void 0:Le.scrollHeight)!=null?qe:0,(Ge=(Re=G.body)==null?void 0:Re.scrollHeight)!=null?Ge:0,(je=M.scrollHeight)!=null?je:0):M.scrollHeight}),Me=ht("getScrollBox.clientHeight",()=>{var Le;return Y?((Le=G.documentElement)==null?void 0:Le.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:G,isViewportRoot:Y,scrollTop:se,scrollHeight:Se,clientHeight:Me}}function U2(){const M=it.value.length,W=Math.max(0,Zr(0,M)),G=ht("getRendererLogicalHeight.offsetHeight",()=>{var se,Se;return(Se=(se=S.value)==null?void 0:se.offsetHeight)!=null?Se:0}),Y=Math.max(0,G>0?G:ht("getRendererLogicalHeight.scrollHeight",()=>{var se,Se;return(Se=(se=S.value)==null?void 0:se.scrollHeight)!=null?Se:0}));return M<=0?Math.ceil(G):Ct.value?W>0?Math.max(1,Math.ceil(W),(function(){let se=d1.value+f1.value;for(const Se of no.values())Se&&(se+=Math.max(0,ht("getVirtualizedDomLogicalHeight.offsetHeight",()=>Se.offsetHeight||0)));return Math.ceil(Math.max(0,se))})(),(function(se,Se){return se<=0||Se<=0?0:Se<=se+Math.max(512,.05*se)?Math.ceil(Se):0})(W,Y)):Math.max(1,Math.ceil(Y)):ze.value?W>0||Oe.count>0||R2()>0?(Si.value&&fo.value,Math.max(1,Math.ceil(Y),Math.ceil(W))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(W))}function q2(M){const W=S.value;if(!W)return null;const G=ht("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>W.getBoundingClientRect());return(function(se){return se.isViewportRoot?se.clientHeight:ht("getViewportBottomInRoot.getBoundingClientRect",()=>se.root.getBoundingClientRect().bottom)})(M)-G.bottom}function Z8(M={}){const W=M.requireViewport!==!1,G=(function(Se=64){const Me=mu(),Le=S.value;if(!Me||!Le)return!1;const qe=(function(Ge){if(Ge.isViewportRoot)return{top:0,bottom:Ge.clientHeight};const je=ht("getVirtualViewportRect.getBoundingClientRect",()=>Ge.root.getBoundingClientRect());return{top:je.top,bottom:je.bottom}})(Me),Re=ht("isRendererNearVirtualViewport.getBoundingClientRect",()=>Le.getBoundingClientRect());return Re.bottom>=qe.top-Se&&Re.top<=qe.bottom+Se})();if(W&&!G)return null;const Y=(function(){const Se=mu(),Me=S.value;if(!Se||!Me||Math.max(0,Se.scrollHeight-Se.scrollTop-Se.clientHeight)>64)return null;const Le=q2(Se);return Le==null?null:Le>=-8&&Le<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Le)}:null})();if(Y)return{anchor:Y,captured:!0};const se=Cs();if(se)return{anchor:{type:"node",nodeIndex:se.nodeIndex,offsetWithinNodePx:se.offsetWithinNodePx},captured:G};if(M.allowFallback===!0){const Se=(function(){const Me=it.value.length;return Me<=0?null:{type:"node",nodeIndex:Wo(si.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return Se?{anchor:Se,captured:!1}:null}return null}function x1(M){let W=2166136261;for(let G=0;G<M.length;G++)W^=M.charCodeAt(G),W=Math.imul(W,16777619);return(W>>>0).toString(36)}function Q8(M,W){let G=M;for(let Y=0;Y<W.length;Y++)G^=W.charCodeAt(Y),G=Math.imul(G,16777619);return G^=31,G=Math.imul(G,16777619),G}const X8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function yf(M,W=new WeakSet,G=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(Y){const se=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${x1(se)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(W.has(M))return"cycle";if(G>=6)return"max-depth";W.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Re=[];for(let Ge=0;Ge<M.length;Ge++)Re.push(yf(M[Ge],W,G+1));return`a:${M.length}:${Re.join(",")}`}const Se=[],Me=[],Le=Math.max(0,M.length-32);let qe=2166136261;for(let Re=0;Re<M.length;Re++){const Ge=yf(M[Re],W,G+1);qe=Q8(qe,Ge),Re<32&&Se.push(Ge),Re>=Le&&Me.push(Ge)}return[`a:${M.length}`,`h=${Se.join(",")}`,`t=${Me.join(",")}`,`all=${(qe>>>0).toString(36)}`].join(":")}const Y=M,se=Object.keys(Y).filter(Se=>{const Me=Y[Se];return Se!=="parent"&&Se!=="el"&&Se!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||X8.has(Se))}).sort();return`o:${se.length}:${se.map(Se=>`${Se}=${yf(Y[Se],W,G+1)}`).join(";")}`}finally{W.delete(M)}}let j2=-1,w1="";function gu(M){const W=it.value[M];return W?x1(yf(W)):""}function _1(){const M=Z.value;if(j2===M)return w1;let W=2166136261;for(let G=0;G<it.value.length;G++){const Y=gu(G);for(let se=0;se<Y.length;se++)W^=Y.charCodeAt(se),W=Math.imul(W,16777619)}return w1=(W>>>0).toString(36),j2=M,w1}function ja(M,W={}){var G;const Y=W.includeHeightCache===!0,se=(G=W.includeContentHash)!=null?G:Y,Se=Y?(function(Le){const qe=(function(){var nt,_t;const at=Number((_t=(nt=o.virtualScroll)==null?void 0:nt.heightCacheLimit)!=null?_t:5e3);return!Number.isFinite(at)||at<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(at))})();if(!Number.isFinite(qe)||Le.length<=qe)return Le;const Re=new Map,Ge=nt=>{!nt||Re.size>=qe||Re.set(nt.index,nt)},je=it.value.length,Be=Wo(Ho.start-2*fu.value,0,je),Ke=Wo(Ho.end+2*fu.value,Be,je);for(const nt of Le)nt.index>=Be&&nt.index<Ke&&Ge(nt);const tt=Math.max(1,Math.ceil(Le.length/qe));for(let nt=0;nt<Le.length&&Re.size<qe;nt+=tt)Ge(Le[nt]);for(let nt=Le.length-1;nt>=0&&Re.size<qe;nt-=tt)Ge(Le[nt]);return Array.from(Re.values()).sort((nt,_t)=>nt.index-_t.index).slice(0,qe)})(Nt().map(Le=>{var qe;const Re=it.value[Le.index];return Re?Dt(lt({},Le),{nodeType:String((qe=Re.type)!=null?qe:""),signature:gu(Le.index)}):null}).filter(Le=>!!Le)):[],Me=Z8({allowFallback:W.allowAnchorFallback===!0,requireViewport:W.requireViewport});return Me||Se.length||W.includeEmptyState===!0?Dt(lt({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:se?_1():void 0,measurementKey:ur()||void 0,heightCache:Se.length?Se:void 0}):null}function S1(M){var W,G;const Y=mu();if(!Y)return;const se=(function(Le){const qe=S.value;if(!qe)return null;const Re=ye(qe,Le.root),Ge=it.value.length,je=ht("getRendererBottomOffsetWithinRoot.offsetHeight",()=>qe.offsetHeight||0),Be=Math.max(0,je>0?je:Ge>0?ht("getRendererBottomOffsetWithinRoot.scrollHeight",()=>qe.scrollHeight||0):0),Ke=U2();return Re+Math.max(Be,Ke)})(Y);if(se==null)return;const Se=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,se-Y.clientHeight-Se);(function(Le){Te=xu()+120,pe=Le})(Me),Y.isViewportRoot?(G=(W=Y.doc.defaultView)==null?void 0:W.scrollTo)==null||G.call(W,0,Me):sC(Y.root,Y.doc,Me,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee})}const C1=[];function V2(){if(ne)for(oe!=null&&(qn?.(oe),oe=null);C1.length;){const M=C1.pop();M!=null&&window.clearTimeout(M)}}function Va(M){const W=!!Fe.value;Fe.value=null,Te=0,pe=null,V2(),W&&M&&Rn(M)}function Ka(){if(!Fe.value||!ne||oe!=null)return;const M=()=>{oe=null;const W=Fe.value;W&&S1(W)};oe=En?En(M):null,oe==null&&M()}function K2(M,W={}){const G=it.value.length;return G<=0?[]:M.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=G)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(W.requireSignature&&!Y.signature)&&!(W.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(se){var Se;const Me=it.value[se.index];return!(!Me||se.nodeType&&se.nodeType!==String((Se=Me.type)!=null?Se:"")||se.signature&&se.signature!==gu(se.index))})(Y))}function G2(M){const W=pu(Gl()),G=pu(M);return W!==-1&&G!==-1&&W===G}function A1(M){var W;const G=Number(M?.width);if(Number.isFinite(G)&&G>0)return G;const Y=Number((W=M?.metrics)==null?void 0:W.width);return Number.isFinite(Y)&&Y>0?Y:null}function Y2(M){var W;return M.sessionKey===Vn()&&!!p1(M.threadKey)&&((W=M.measurementKey)!=null?W:"")===ur()&&!!G2(A1(M))&&!!(function(G){const Y=G.heightCache;return!!Y?.length&&(Z2(G)?Y.some(se=>!!(se.nodeType||se.signature)):Y.some(se=>!!se.signature))})(M)}function Z2(M){return!!(M.contentHash&&M.contentHash===_1())}function J8(M){return!Z2(M)}let Zl=null,Ql=null,kf=null,vu=null,yu=null;function M1(M){var W;const G=M.map(se=>{var Se,Me;return[se.index,Math.round(10*se.height),(Se=se.nodeType)!=null?Se:"",(Me=se.signature)!=null?Me:""].join("")}).join(""),Y=pu(Gl());return[(W=Mo())!=null?W:"",Vn(),ur(),it.value.length,Y,M.length,x1(G)].join(":")}function Q2(M=(W=>(W=o.virtualScroll)==null?void 0:W.heightCache)()){if(!ze.value||!M?.length||it.value.length<=0||!G2((W=o.virtualScroll)==null?void 0:W.heightCacheWidth))return!1;var W;const G=K2(M,{requireSignature:!0});if(!G.length)return!1;const Y=M1(G);return Y===Zl?(Ql="standalone",!0):(af(G,{mode:"merge"}),ii(),Zl=Y,Ql="standalone",_u(),Rn("restore"),!0)}function E1(M,W={}){var G,Y,se;if(!ze.value||!M||M.sessionKey!==Vn()||!p1(M.threadKey)||it.value.length<=0)return!1;const Se=!!((G=M.heightCache)!=null&&G.length)&&!bf(),Me=!M.anchor||M.anchorCaptured===!1&&W.allowUncapturedAnchor!==!0?null:M.anchor,Le=W.restoreAnchor===!0&&!!Me&&!bf()&&Number(A1(M))>0;let qe=!1;if((Y=M.heightCache)!=null&&Y.length&&Y2(M)){const Ge=K2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:J8(M)});Ge.length&&(af(Ge,{mode:"merge"}),ii(),Zl=M1(Ge),Ql="restore",_u(),qe=!0)}if(Se||Le)return!1;if(!W.restoreAnchor||!Me)return qe&&Rn("restore"),!0;const Re=(function(Ge,je){var Be;const Ke=Ge.anchor,tt=Ke?Ke.type==="bottom"?`bottom:${Math.round(Ke.distanceFromBottomPx)}`:`node:${Ke.nodeIndex}:${Math.round(Ke.offsetWithinNodePx)}`:"none";return[(Be=Mo())!=null?Be:"",Vn(),ur(),gf.value,je,tt].join(":")})(M,(se=W.restoreToken)!=null?se:"imperative");return kf===Re?(qe&&Rn("restore"),!0):(kf=Re,(function(Ge){const je=()=>{if(Ge.type==="node")return Va(),void Q({nodeIndex:Ge.nodeIndex,offsetWithinNodePx:Ge.offsetWithinNodePx});if(rn(),_e.value=null,Fe.value=Ge,V2(),S1(Ge),ne)for(const Be of[0,120,280,480])C1.push(window.setTimeout(()=>{const Ke=Fe.value;Ke&&S1(Ke)},Be))};(function(Be){if(!Ct.value)return!1;const Ke=it.value.length;return!(Ke<=0||(si.value=Be.type==="node"?Wo(Be.nodeIndex,0,Ke-1):Ke-1,jl(),0))})(Ge)?mt(je):je()})(Me),Rn("restore"),!0)}function bf(){const M=Gl();return Number.isFinite(M)&&M>0}function X2(M){var W;return M.sessionKey===Vn()&&!!p1(M.threadKey)&&(it.value.length<=0||!(!((W=M.heightCache)!=null&&W.length)||bf())||!(!(M.anchor&&Number(A1(M))>0)||bf()))}function T1(){Wn.clear();for(const M of Object.keys(be)){const W=Number(M);Number.isInteger(W)&&W>=0&&W<it.value.length&&zi(W)}}function ku(){Ws!=null&&(qn?.(Ws),Ws=null),H1()}function J2(){return!ne||ti?Promise.resolve():new Promise(M=>{let W=!1,G=null;const Y=()=>{W||(W=!0,G!=null&&window.clearTimeout(G),M())};if(En)return En(Y),void(G=window.setTimeout(Y,50));G=window.setTimeout(Y,0)})}function N1(M,W=Mo(),G=zs.value){return Vn()===M&&Mo()===W&&zs.value===G}function I1(){return Xn(this,arguments,function*(M={}){var W,G,Y,se,Se;const Me=Vn(),Le=Mo(),qe=zs.value,Re=(W=M.frames)!=null?W:2,Ge=(G=M.timeoutMs)!=null?G:120,je=(Y=M.reason)!=null?Y:"manual",Be=M.expectedSettledTokenKey,Ke=M.flushPendingTimers===!0,tt=Yl(je),nt=()=>Dt(lt({},tt),{phase:tt.final?"settling":tt.phase,stable:!1,confidence:tt.confidence==="final"?"mixed":tt.confidence,reason:je}),_t=()=>N1(Me,Le,qe)&&(Be==null||wu()===Be);for(let At=0;At<Re;At++){if(yield mt(),!_t()||(yield J2(),!_t()))return nt();dr(),ku()}if(yield(function(At){return!ne||At<=0?Promise.resolve():new Promise(tn=>window.setTimeout(tn,At))})(Ge),!_t()||(Ke&&M2(),dr(),ku(),!_t()))return nt();const at=k1();at&&(y1=Me,v1=Le,((se=o.virtualScroll)==null?void 0:se.settleMode)==="manual"&&Be!=null&&vf((Se=o.virtualScroll)==null?void 0:Se.settledToken)&&wu()===Be&&(qa=Eu(o.virtualScroll.settledToken)));const ft=_t()&&at&&z2(),Et=Yl(je,ft?"final":void 0);return R1(Et,!0),Et})}let L1="content",Xl=null,Jl=null,$1=0,bu=null,Ga=null,F1=null,O1=null;function xu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function eb(M){var W,G;const Y=bu;if(!Y)return!0;const se=(G=(W=o.virtualScroll)==null?void 0:W.heightDiffThresholdPx)!=null?G:1;return Math.abs(M.totalHeight-Y.totalHeight)>se||M.sessionKey!==Y.sessionKey||M.phase!==Y.phase||M.stable!==Y.stable||M.final!==Y.final||M.threadKey!==Y.threadKey||M.nodeCount!==Y.nodeCount||M.measuredCount!==Y.measuredCount||M.width!==Y.width}function Fo(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 wu(M=(W=>(W=o.virtualScroll)==null?void 0:W.settledToken)()){return Fo(M)}function tb(M,W){var G,Y;return[M,W.sessionKey,(G=W.threadKey)!=null?G:"",ur(),_1(),Fo((Y=o.virtualScroll)==null?void 0:Y.settledToken),Math.round(W.totalHeight),Math.round(W.width)].join("\0")}function _u(){F1=null,O1=null,Ga=null}function eE(M){const W=M.heightCache;return W?.length?M1(W):""}function Su(M){var W,G,Y;const se=M.metrics,Se=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,(W=M.threadKey)!=null?W:"",(G=M.measurementKey)!=null?G:ur(),(Y=M.contentHash)!=null?Y:"",eE(M),Se,M.anchorCaptured?1:0,se.liveRange.start,se.liveRange.end,se.renderedCount,se.nodeCount,Math.round(se.totalHeight),Math.round(se.width),se.phase,se.stable?1:0].join("\0")}function R1(M,W=!1){if(!ze.value||(function(Me=!1){return!Me&&An.value&&!Xe.value})(W))return;const G=W||eb(M),Y=(function(Me,Le=!1){return Le||Me.stable||Me.phase==="final"?{state:ja(Me,{includeHeightCache:!0})}:{state:ja(Me)}})(M,W),se=Y.state,Se=!!(se&&(G||(function(Me,Le=!1){return!!Le||Su(Me)!==Ga})(se,W)));if(G&&(L(M),bu=M,$1=xu()),se&&Se&&(E(se),se.anchor&&F(se.anchor),Ga=Su(se)),M.stable){const Me=tb("settled",M);if(Me!==F1){F1=Me;const Le=ja(M,{includeHeightCache:!0});Le&&(E(Le),Ga=Su(Le)),(function(qe){s("render-settled",qe)})(M)}}if(M.phase==="final"){const Me=tb("final",M);if(Me!==O1){O1=Me;const Le=ja(M,{includeHeightCache:!0});Le&&(E(Le),Ga=Su(Le)),(function(qe){s("render-final",qe)})(M)}}}function B1(){Xl!=null&&(qn?.(Xl),Xl=null),Jl!=null&&ne&&(window.clearTimeout(Jl),Jl=null)}function nb(){Xl=null,Jl=null,(function(M){if(cr.size>0||Ws!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(L1)&&(dr(),ku()),R1(Yl(L1))}function Rn(M){var W,G;if(!ze.value||(L1=M,Xl!=null||Jl!=null))return;const Y=Math.max(0,(G=(W=o.virtualScroll)==null?void 0:W.emitIntervalMs)!=null?G:32),se=Math.max(0,Y-(xu()-$1)),Se=()=>{Jl=null,Xl=En?En(nb):null,Xl==null&&nb()};ne&&se>0?Jl=window.setTimeout(Se,se):Se()}function D1(M){var W;if(M<=0)return 0;const G=it.value;if(kt.value)return O2(M);if(Ye.value===G.length&&st.value.length&&wt.value.length){const se=Ht.value,Se=st.value,Me=wt.value,Le=je=>je<=0?0:ho(Se,0,je)+(je-ho(Me,0,je))*se;let qe=0,Re=G.length-1,Ge=G.length-1;for(;qe<=Re;){const je=qe+Re>>1;Le(je+1)>=M?(Ge=je,Re=je-1):qe=je+1}return Ge}let Y=M;for(let se=0;se<G.length;se++){const Se=(W=be[se])!=null?W:Ht.value;if(Y<=Se)return se;Y-=Se}return Math.max(0,G.length-1)}function ob(){$o.value+=1}function P1(M){return!(Si.value&&M>=fo.value)&&(!Vr.value||M<Ss.value||r1.value.has(M))}function Ya(M){const W=hf.get(M);W&&(W(),hf.delete(M));const G=Ha.get(M);G&&(G.destroy(),Ha.delete(M)),pf(M)}function sb(M,W){let G=!1;if(W){const Se=no.get(M);no.set(M,W),Se!==W&&(G=!0)}else no.delete(M)&&(G=!0);if(G&&ob(),W||pf(M),!k2.value||!ss||!Ct.value&&Vr.value&&!H.value&&Ha.size>=640&&(H.value||(H.value=!0,l1()),!k2.value||!ss))return Ya(M),void(W&&Yr(M,!0));if(M<Ss.value&&!Ct.value||r1.value.has(M))return Ya(M),void Yr(M,!0);if(!W)return void Ya(M);Ya(M);const Y=ss(W,{rootMargin:"400px"});if(!Y)return;Ha.set(M,Y),Yr(M,Y.isVisible.value),Vr.value&&(function(Se){if(!ne||!Vr.value)return;pf(Se);const Me=Se%17*23,Le=window.setTimeout(()=>{if(E2.delete(Se),!Vr.value||r1.value.has(Se))return;const qe=no.get(Se);if(!qe)return;const Re=ie(qe),Ge=qe.ownerDocument||document,je=Ge.defaultView||window,Be=!Re||Re===Ge.documentElement||Re===Ge.body,Ke=!Be&&Re?ht("nodeVisibilityFallback.root.getBoundingClientRect",()=>Re.getBoundingClientRect()):null,tt=Be?0:Ke.top,nt=Be?ht("nodeVisibilityFallback.clientHeight",()=>{var at,ft;return(ft=(at=je.innerHeight)!=null?at:Re?.clientHeight)!=null?ft:0}):Ke.bottom,_t=ht("nodeVisibilityFallback.node.getBoundingClientRect",()=>qe.getBoundingClientRect());_t.bottom>=tt-500&&_t.top<=nt+500&&Yr(Se,!0)},1800+Me);E2.set(Se,Le)})(M);let se=null;se=Qe(()=>Y.isVisible.value,Se=>{if(Se){pf(M),Yr(M,!0),se?.(),hf.delete(M),Ha.get(M)===Y&&Ha.delete(M);try{Y.destroy()}catch{}}},{immediate:!0}),hf.set(M,se),Ct.value&&ji()}function H1(){Ws=null;for(const[M,W]of cr)cr.delete(M),Ui.get(M)===W.el&&Vl.get(M)===W.version&&Ul(M,W.height,{allowShrink:W.allowShrink})}function Za(){Ws!=null&&(qn?.(Ws),Ws=null),cr.clear()}function xf(M,W){(function(G,Y,se){var Se;if(!Number.isFinite(se)||se<=0||Ui.get(G)!==Y)return;const Me=Vl.get(G);if(Me==null)return;const Le=it.value[G],qe=te.value&&j.value!==!0&&!((Se=o.nodes)!=null&&Se.length)&&G>=it.value.length-2,Re=!(Le?.loading===!0||qe),Ge=cr.get(G),je=Ge?Ge.allowShrink&&Re:Re,Be=Ge&&!je?Math.max(Ge.height,se):se;cr.set(G,{height:Be,allowShrink:je,version:Me,el:Y}),Ws==null&&(Ws=En?En(H1):null,Ws==null&&H1())})(M,W,ql(M,W))}function dr(){for(const[M,W]of Ui)W&&xf(M,W)}function ib(){Lo?.disconnect(),Lo=null,is.clear()}function W1(){for(;cf.length;)ff(cf.pop())}Qe(Xe,M=>{M&&Rn("content")},{flush:"post"}),t({getVirtualMetrics:Yl,captureVirtualState:function(M={}){var W;return ja(Yl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(W=M.includeEmptyState)==null||W})},restoreVirtualState:function(M,W={}){const G=W.restoreAnchor===!0,Y=W.restoreToken==null?"imperative":String(W.restoreToken);vu=M,yu={restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0},!E1(M,{restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0})&&X2(M)||(vu=null,yu=null)},forceMeasure:function(M="manual"){return Xn(this,null,function*(){yield mt(),yield J2(),dr(),ku(),yield mt();const W=Yl(M);return R1(W,!0),W})},settle:I1,scrollToNode:function(M,W="start"){Va(),rn();const G=it.value.length;if(G<=0)return;const Y=Wo(M,0,G-1),se=()=>{var Se;const Me=Bt({nodeIndex:Y,offsetWithinNodePx:0}),Le=mf(Y),qe=mu(),Re=(Se=qe?.clientHeight)!=null?Se:0,Ge=He();let je=Me;if(W==="center")je=Me-Re/2+Le/2;else if(W==="end")je=Me-Re+Le;else if(W==="nearest"&&Ge!=null){if(Me>=Ge&&Me+Le<=Ge+Re)return;je=Me<Ge?Me:Me-Re+Le}Ot(Math.max(0,je)),ji({immediate:!0}),Ct.value&&(si.value=Y,jl())};if(Ct.value)return si.value=Y,jl(),void mt(se);se()}}),Qe(()=>Po.value,M=>{if(!M){ib();for(const W of Kr.values())for(const G of W)ff(G);Kr.clear(),Vl.clear(),W1(),Za()}},{immediate:!0}),Qe(j,M=>{M&&(function(){if(ne&&j.value&&Ui.size){W1();for(const W of[80,240,640]){const G=A2(W,()=>{for(const[Y,se]of Ui)se&&xf(Y,se)},"final");G!=null&&cf.push(G)}}})(),Rn(M?"final":"content")}),Qe([()=>it.value.length,()=>fo.value],()=>{Fe.value&&Ka(),Rn("content")},{flush:"post",immediate:!0}),Qe([()=>Ho.start,()=>Ho.end],()=>{Rn("batch")},{flush:"post"});const{cleanupBatchScheduler:tE}=(function(M){const{props:W,isClient:G,isTestEnv:Y,parsedNodesIdentity:se,parsedNodeCount:Se,desiredRenderedCount:Me,datasetKey:Le,batchingEnabled:qe,incrementalRenderingActive:Re,resolvedBatchSize:Ge,resolvedInitialBatch:je,renderedCount:Be,adaptiveBatchSize:Ke,previousRenderContext:tt,previousBatchConfig:nt,requestFrame:_t,cancelFrame:at,hasIdleCallback:ft,cleanupNodeVisibility:Et,onDatasetKeyChanged:At,onDatasetChanged:tn}=M;let Lt=null,qt=null,zt=!1,fn=null,Us=null,as=0,Mi=!1,Qr=!1;const Xr=new Set,ta=new Set;function _b(){if(G){Lt!=null&&(at?.(Lt),Lt=null),qt!=null&&(window.clearTimeout(qt),qt=null),Us!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Us),Us=null),as+=1;for(const Zo of Xr)at?.(Zo);Xr.clear();for(const Zo of ta)window.clearTimeout(Zo);ta.clear(),zt=!1,fn=null,Mi=!1,Qr=!1}}function Ef(){return typeof performance<"u"?performance.now():Date.now()}function Sb(Zo){(function(fr){var Jr;if(!Re.value)return;const hr=Math.max(2,(Jr=W.renderBatchBudgetMs)!=null?Jr:6),pr=Math.max(1,Ge.value||1),Ei=Math.max(1,Math.floor(pr/4));fr>1.2*hr?Ke.value=Math.max(Ei,Math.floor(.7*Ke.value)):fr<.5*hr&&Ke.value<pr&&(Ke.value=Math.min(pr,Math.ceil(1.2*Ke.value)))})(Zo),Mi=!1;const As=Qr||Be.value<Me.value;Qr=!1,As&&Mb()}function Cb(Zo,As={}){var fr,Jr;if(!Re.value)return;const hr=Me.value;if(Be.value>=hr)return;const pr=Math.max(1,Zo),Ei=()=>{const Ja=Ef();let ec=0;Lt=null,qt=null,Us=null,zt=!1;const tc=fn??pr;fn=null;const Y1=Ef();Be.value=Math.min(hr,Be.value+tc),Et(Be.value),ec=Ef()-Y1,(function(Z1,Eb){if(!G)return void Sb(Eb);Mi=!0;const Tb=++as;mt().then(()=>{var Nb;if(Tb!==as)return;const xE=Ef(),wE=Math.max(Eb,xE-Z1),Ib=()=>{Tb===as&&Sb(wE)};if(_t){let $b=!1,mr=null;const Fb=()=>{$b||($b=!0,Ib())},Tf=_t(()=>{Xr.delete(Tf),mr!=null&&(window.clearTimeout(mr),ta.delete(mr),mr=null),Fb()});return Xr.add(Tf),mr=window.setTimeout(()=>{mr!=null&&ta.delete(mr),mr=null,at?.(Tf),Xr.delete(Tf),Fb()},Math.max(32,(Nb=W.renderBatchIdleTimeoutMs)!=null?Nb:120)),void ta.add(mr)}const Lb=window.setTimeout(()=>{ta.delete(Lb),Ib()},0);ta.add(Lb)})})(Ja,ec)};if(!G||As.immediate)return void Ei();const el=Math.max(0,(fr=W.renderBatchDelay)!=null?fr:16);if(fn=fn!=null?Math.max(fn,pr):pr,!zt){if(zt=!0,!Y&&ft&&window.requestIdleCallback){const Ja=Math.max(0,(Jr=W.renderBatchIdleTimeoutMs)!=null?Jr:120);return void(Us=window.requestIdleCallback(()=>Ei(),{timeout:Ja}))}_t&&!Y?Lt=_t(()=>{el!==0?qt=window.setTimeout(()=>Ei(),el):Ei()}):qt=window.setTimeout(()=>Ei(),el)}}function Ab(Zo,As={}){Mi?Qr=!0:Zo==null?Mb():Cb(Zo,As)}function Mb(){Re.value&&Cb(qe.value?Math.max(1,Math.round(Ke.value)):Math.max(1,Ge.value))}return Qe([se,Se,Le,Re,Ge,je,()=>W.renderBatchDelay],()=>{var Zo;const As=Se.value,fr=tt.value,Jr=Le.value,hr=!Object.is(Jr,fr.key),pr=As!==fr.total,Ei=hr||pr;tt.value={key:Jr,total:As};const el=nt.value,Ja=(Zo=W.renderBatchDelay)!=null?Zo:16,ec=el.batchSize!==Ge.value||el.initial!==je.value||el.delay!==Ja||el.enabled!==Re.value;nt.value={batchSize:Ge.value,initial:je.value,delay:Ja,enabled:Re.value},hr&&At(As),(Ei||ec||!Re.value)&&_b(),(Ei||ec)&&(Ke.value=Math.max(1,Ge.value||1)),Ei&&tn();const tc=Me.value;if(!As)return Be.value=0,void Et(0);if(!Re.value)return Be.value=tc,void Et(Be.value);const Y1=hr||fr.total===0;Be.value=Y1||ec?Math.min(tc,je.value):Math.min(Be.value,tc);const Z1=Math.max(1,je.value||Ge.value||As);Be.value<tc?Ab(Z1,{immediate:!G}):Et(Be.value)},{immediate:!0}),Qe(Me,(Zo,As)=>{Re.value&&(typeof As=="number"&&Zo<=As||Zo>Be.value&&Ab())}),{cleanupBatchScheduler:_b}})({props:x,isClient:ne,isTestEnv:ti,parsedNodesIdentity:uo,parsedNodeCount:Yn,desiredRenderedCount:uf,datasetKey:K8,batchingEnabled:Wi,incrementalRenderingActive:Si,resolvedBatchSize:Io,resolvedInitialBatch:Ss,renderedCount:fo,adaptiveBatchSize:Ci,previousRenderContext:ni,previousBatchConfig:ar,requestFrame:En,cancelFrame:qn,hasIdleCallback:Ps,cleanupNodeVisibility:W8,onDatasetKeyChanged:M=>{Za(),so(),ii(),_u(),M>0&&oo(M)},onDatasetChanged:()=>{Ct.value&&ji({immediate:!0})}});Qe([b2,Ct,()=>S.value,()=>J()],([M,W])=>{if(!M)return T2(),void i1();z8(),W?ji({immediate:!0}):i1()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,()=>Ct.value],M=>Xn(null,[M],function*([W,G]){G&&W&&ne&&(yield mt(),ji({immediate:!0}))}),{flush:"post"}),Qe(kt,M=>{M&&(function(){var W;if(go.value&&os.value&&Un.value&&((W=to.value)!=null&&W[1]))return;const G=pt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=pt({type:"list_item",children:[G],raw:"- Probe paragraph text"}),se=pt({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});go.value=G,os.value=Y,Un.value=se;const Se={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)Se[Me]=pt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});to.value=Se})()},{immediate:!0}),Qe([()=>S.value,kt],()=>{if(!kt.value)return c1(),void(K.value=0);I2(),c1(),kt.value&&S.value&&typeof ResizeObserver<"u"&&(hu=new ResizeObserver(()=>{I2(),_e.value&&zn(),Fe.value&&Ka(),Rn("resize")}),hu.observe(S.value))},{immediate:!0}),Qe([kt,Hn,zs],()=>Xn(null,null,function*(){if(!kt.value)return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();yield mt(),(function(){if(!kt.value||typeof window>"u")return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},W=N2(a1(N.value),".paragraph-node");M.paragraph=tg(N.value,W,"pre-wrap");const G=a1(D.value),Y=G?.querySelector(".paragraph-node");M.listItem=tg(D.value,Y,"pre-wrap");const se=ht("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Le;return(Le=(Me=B.value)==null?void 0:Me.offsetHeight)!=null?Le:0}),Se=ht("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Le;return(Le=(Me=D.value)==null?void 0:Me.offsetHeight)!=null?Le:0});M.listWrapperOverhead=Math.max(0,se-Se);for(let Me=1;Me<=6;Me++){const Le=N2(a1(U[Me]),`h${Me}`);M.headings[Me]=tg(U[Me],Le,"pre-wrap")}V.value=M,ii()})()}),{flush:"post",immediate:!0}),Qe(()=>it.value.length,()=>{Ct.value&&ji({immediate:!0})}),Qe([kt,K],()=>{ii(),Ct.value&&ji({immediate:!0}),_e.value&&zn(),Fe.value&&Ka(),Rn("resize")},{immediate:!1}),Qe(()=>Vr.value,M=>{if(M)for(const[W,G]of no)sb(W,G);else{l1();for(const[W,G]of no)G&&Yr(W,!0)}},{immediate:!1}),Qe([()=>x.viewportPriority,()=>it.value.length],([M,W])=>{M!==!1?H.value&&W<=200&&(H.value=!1):H.value=!1}),Qe(()=>fo.value,()=>{Ct.value&&ji({immediate:!0})}),Qe([si,Mn,fu,()=>it.value.length,Ct],()=>{jl()},{immediate:!0});let Cu=null,Au=!1,Qa=null;function Mu(){Cu=null,y1=null,v1=void 0,qa=null,_u()}function z1(){Za(),so(),ii(),Wn.clear();const M=it.value.length;M>0&&oo(M),T1()}function U1(){B1(),M2(),bu=null,Zl=null,Ql=null,kf=null,vu=null,yu=null,Au=!1,Mu(),H2("restore"),rn(),Va()}function Eu(M){var W;return[(W=Mo())!=null?W:"",Vn(),ur(),gf.value,wu(M),it.value.length,Math.round(Zr(0,it.value.length)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")}function rb(){return Xn(this,null,function*(){var M,W,G,Y;const se=(M=o.virtualScroll)==null?void 0:M.settledToken,Se=wu(se),Me=Vn(),Le=Mo(),qe=zs.value;if(ze.value&&((W=o.virtualScroll)==null?void 0:W.settleMode)==="manual"&&vf(se))if(k1()){if(Eu(se)!==qa&&!Au){Au=!0;try{const Re=yield I1({reason:"manual",expectedSettledTokenKey:Se}),Ge=wu()===Se;N1(Me,Le,qe)&&Re.sessionKey===Me&&Re.threadKey===Le&&Ge&&Re.stable&&Re.phase==="final"&&(qa=Eu((G=o.virtualScroll)==null?void 0:G.settledToken))}finally{Au=!1,yield mt();const Re=(Y=o.virtualScroll)==null?void 0:Y.settledToken,Ge=vf(Re)?Eu(Re):"";N1(Me,Le,qe)&&Ge&&qa!==Ge&&rb()}}}else Rn("manual")})}Qe(ze,(M,W)=>{if(M!==W){if(!M)return U1(),void B1();U1(),z1(),Qa=zs.value,Rn("content")}},{flush:"post"}),Qe([ze,zs],([M,W])=>{M?Qa!=null?Qa!==W&&(Qa=W,(function(G="resize"){Za(),so(),ii(),Wn.clear();const Y=it.value.length;Y>0&&oo(Y),T1(),Zl=null,Ql=null,kf=null,bu=null,Au=!1,Mu(),Q2(),mt(()=>{dr(),_e.value&&zn(),Fe.value&&Ka(),Rn(G)})})("resize")):Qa=W:Qa=null},{flush:"post",immediate:!0}),Qe([ze,()=>Vn(),()=>Mo()],([M])=>{M&&(U1(),z1(),H2("content"),Rn("content"))}),Qe([ze,()=>Vn(),()=>Mo(),zs,()=>it.value.length],([M])=>{M&&(function(W="async-node"){let G=!1;for(const[Y,se]of Array.from(qi.entries()))m1(se)||(qi.delete(Y),Hs.delete(Y),G=!0);G&&(za(),Rn(W))})("async-node")},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>o.indexKey,()=>Z.value],([M])=>{M&&(_u(),(function(W="content"){if(!ze.value)return;const G=[],Y=it.value.length;for(const se of Array.from(Wn.keys())){if(se>=Y){G.push(se);continue}const Se=gu(se),Me=Wn.get(se);Me!=null&&Me!==Se&&G.push(se),Wn.set(se,Se)}for(const se of Array.from(Wn.keys()))se>=Y&&Wn.delete(se);G.length&&((function(se,Se={}){const Me=Array.from(se,Number);Mt(Me,Se)>0&&(function(qe){for(const Re of qe)Wn.delete(Re)})(Me)})(G,{notify:!1}),ii(),Mu(),_e.value&&zn(),Fe.value&&Ka(),Rn(W))})("content"))},{flush:"post",immediate:!0}),Qe([ze,()=>it.value.length,()=>Vn(),()=>Mo()],([M,W,G,Y],[se,Se,Me,Le])=>{M&&se&&G===Me&&Y===Le&&W!==Se&&Mu()},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],()=>{Q2()},{flush:"post",immediate:!0}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W,G]){if(!W||!G)return;yield mt();const Y=(function(){var se;const Se=(se=o.virtualScroll)==null?void 0:se.restoreAnchor;return Se==null||Se===!1?null:Se===!0?"true":String(Se)})();E1(G,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Qe([ze,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var W;if(!M)return;const G=(W=o.virtualScroll)==null?void 0:W.restoreState;G&&Zl&&Ql==="restore"&&(Y2(G)||(z1(),Zl=null,Ql=null,Rn("resize")))},{flush:"post"}),Qe([ze,()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W]){var G;const Y=vu,se=yu;W&&Y&&(yield mt(),!E1(Y,{restoreAnchor:se?.restoreAnchor===!0,restoreToken:(G=se?.restoreToken)!=null?G:"imperative",allowUncapturedAnchor:se?.allowUncapturedAnchor===!0})&&X2(Y)||(vu=null,yu=null))}),{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>Vn(),()=>Mo(),zs,o1,w2,()=>fo.value,uf,()=>Oe.count,()=>Oe.total],([M,W,G])=>{if(!M||W!==!0||G==="manual"||!b1())return;const Y=(function(){var se;const Se=it.value.length;return[(se=Mo())!=null?se:"",Vn(),ur(),gf.value,Se,Math.round(Zr(0,Se)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")})();Cu!==Y&&(Cu=Y,I1({reason:"final"}).then(se=>{se.stable||Cu!==Y||(Cu=null)}))},{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settledToken},()=>Vn(),()=>Mo(),zs,o1,w2,()=>fo.value,uf,()=>it.value.length,()=>Oe.count,()=>Oe.total],()=>{rb()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,Ct,Mn,fu,()=>Ho.start,()=>Ho.end],([M,W,G,Y,se,Se])=>{de.value&&Ne("virtualization",{nodes:M,virtualization:W,maxLiveNodes:G,buffer:Y,focusIndex:si.value,scroll:W?(()=>{const Me=Ue.value||ie();return Me?{reverse:q(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:se,end:Se},rendered:fo.value})}),Qe([()=>x.customId],([M],W,G)=>{if(!M||vn)return;const Y=(function(se,Se){return se?(Eo.controllers[se]=Se,()=>{Eo.controllers[se]===Se&&delete Eo.controllers[se]}):()=>{}})(M,{captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:ke,getReport:q8});G(()=>{Y()})},{immediate:!0}),mo(()=>{(function(){if(ze.value)try{dr(),ku();const M=Yl("manual");eb(M)&&(L(M),bu=M,$1=xu());const W=ja(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});W&&(E(W),W.anchor&&F(W.anchor),Ga=Su(W))}catch{}})(),tE(),l1(),De(),ib();for(const M of Kr.values())for(const W of M)ff(W);Kr.clear(),Vl.clear(),Wn.clear(),W1(),Za(),c1(),rn(),Va(),B1(),T2(),i1()});const nE=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index11-DdA3MM9V.js"),__vite__mapDeps([8,5]))).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',M),qs}}),loadingComponent:Fee,delay:0}),oE=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index10-Dm7kE2rr.js"),[])).default}catch(M){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',M),qs}}),loadingComponent:$ee,delay:0}),sE=Li(()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index7-BA7Qbpln.js"),[])).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',M),qs}})),lb={text:lo,paragraph:Ma,heading:Lp,code_block:K0,list:Uc,list_item:zc,blockquote:Nh,table:md,definition_list:Ih,footnote:Lh,footnote_reference:Zs,footnote_anchor:hd,admonition:Rh,vmr_container:Fh,hardbreak:Ml,link:xs,image:Al,thematic_break:$h,math_inline:Pi,math_block:QM,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,inline_code:ts,html_inline:Qs,reference:ys,html_block:pd},iE=R(()=>h1()),ab=R(()=>oC(x.codeBlockProps)),rE=R(()=>oC(x.codeBlockProps,{omit:["langs"]})),cb=R(()=>lt(lt({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 Ce.value=="boolean"?{showTooltips:Ce.value}:{}),rE.value)),ub=R(()=>lt(Dt(lt({},cb.value),{langs:x.langs}),ab.value));function db(M){return typeof M=="boolean"?M:void 0}const lE=R(()=>{const M=x.codeBlockProps||{},W={},G=db(M.showLineNumbers);G!==void 0&&(W.showLineNumbers=G);const Y=db(M.diffInline);Y!==void 0&&(W.diffInline=Y);const se=(function(Se){const Me=Number(Se);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return se!==void 0&&(W.reservedHeightPx=se),W}),aE=R(()=>lt(lt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{}),ab.value)),cE=R(()=>lt({},x.mermaidProps||{})),fb=R(()=>lt({},x.d2Props||{})),uE=R(()=>lt({},x.infographicProps||{})),Tu=R(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:co.value.customHtmlTags})),dE=R(()=>lt(lt({},Tu.value),typeof Ce.value=="boolean"?{showTooltip:Ce.value}:{})),fE=R(()=>lt(lt({},Tu.value),typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{})),hE=R(()=>lt(lt({},Tu.value),typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{})),pE=R(()=>lt(lt({},Tu.value),typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{}));function mE(M){return Array.isArray(M.children)&&M.children.length>0}const q1=R(()=>U8.value.map(M=>{var W,G,Y,se,Se,Me,Le,qe;let Re=(function(at){var ft,Et,At,tn,Lt,qt,zt;if(at.type!=="code_block")return at;const fn=at,Us=[String((ft=fn.language)!=null?ft:""),String((Et=fn.loading)!=null?Et:""),String((At=fn.diff)!=null?At:""),String((tn=fn.code)!=null?tn:""),String((Lt=fn.originalCode)!=null?Lt:""),String((qt=fn.updatedCode)!=null?qt:""),String((zt=fn.raw)!=null?zt:"")].join("\0"),as=Ai.get(fn);if(as&&as.signature===Us)return as.node;const Mi=lt({},fn);return Ai.set(fn,{signature:Us,node:Mi}),Mi})(M.node);const Ge=wf(Re);let je=gb(Re,Ge);if((Re.type==="html_block"||Re.type==="html_inline")&&je===lb[Re.type]){const at=Re,ft=String((W=at.tag)!=null?W:"").trim().toLowerCase()||W6(at.content);if(ft){const Et=Wt.value[ft];if(Pn.value.has(ft)&&Et)je=Et,Re=Dt(lt({},at),{type:ft,tag:ft,content:ZV(at.content,ft)});else if(z6((G=at.content)!=null?G:at.raw,ft)){const At=String((se=(Y=at.content)!=null?Y:at.raw)!=null?se:"");Re.type==="html_inline"?(je=lo,Re={type:"text",content:At,raw:At}):(je=Ma,Re={type:"paragraph",children:[{type:"text",content:At,raw:At}],raw:At})}}}const Be=Re.type==="code_block"&&u.value==="pre"&&je===qs&&!j1(Wt.value,Ge);let Ke=lt({},(function(at,ft,Et){const At=ft??wf(at);if(at.type==="code_block"){const tn=At?j1(Wt.value,At):void 0;if(Et&&u.value==="pre"&&!tn&&Et===qs)return lE.value;if(Et&&At&&Et===tn)return At==="mermaid"?pb(at):At==="infographic"?mb(at):At==="d2"||At==="d2lang"?fb.value:ub.value;if(Et&&Et===Wt.value.code_block)return ub.value;if($2(Et))return aE.value}return At==="mermaid"?pb(at):At==="infographic"?mb(at):At==="d2"||At==="d2lang"?fb.value:at.type==="link"?dE.value:at.type==="list"?fE.value:at.type==="blockquote"?hE.value:at.type==="table"?pE.value:at.type==="code_block"?cb.value:Tu.value})(Re,Ge,je));const tt=Kl.value[M.index];Re.type==="code_block"&&tt?.kind==="code-block"&&(Ke=Dt(lt({},Ke),Be?{reservedHeightPx:(Se=tt.height)!=null?Se:tt.contentHeight}:{estimatedHeightPx:tt.height,estimatedContentHeightPx:tt.contentHeight})),Be||Re.type!=="code_block"||Ge!=="mermaid"||Mc(Ke.estimatedPreviewHeightPx)!=null||(Ke=Dt(lt({},Ke),{estimatedPreviewHeightPx:Cv(_v(String((Me=Re.code)!=null?Me:"")))})),Be||Re.type!=="code_block"||Ge!=="infographic"||Mc(Ke.estimatedPreviewHeightPx)!=null||(Ke=Dt(lt({},Ke),{estimatedPreviewHeightPx:Av(Sv(String((Le=Re.code)!=null?Le:"")))})),Re.type==="math_block"&&(Ke=Dt(lt({},Ke),{cacheScope:ns.value}));const nt=(function(at,ft){const Et=String(at.type);return!tf(Et)&&Wt.value[Et]===ft})(Re,je),_t=nt?Ck(Re,Ie.value):void 0;return Dt(lt({},M),{node:Re,component:je,bindings:Ke,customBindings:lt(lt({},_t??{}),Ke),rendersCustomNode:nt,hasSlotChildren:mE(Re),slotContent:String((qe=Re.content)!=null?qe:""),isCodeBlock:Re.type==="code_block",indexKey:`${iE.value}-${M.index}`})}));function wf(M){var W;return M?.type==="code_block"?String((W=M.language)!=null?W:"").trim().toLowerCase():""}function j1(M,W){const G=W.trim().toLowerCase();if(G)for(const Y of[G,yk(G),RM(G)]){const se=Y&&M[Y];if(se)return se}}function hb(M,W,G,Y){var se,Se;const Me=lt({},M.value);return Mc(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=Y(G(String((se=W?.code)!=null?se:"")),void 0,Me.maxHeight==="none"?null:(Se=Mc(Me.maxHeight))!=null?Se:void 0)),Me}function pb(M){return hb(cE,M,_v,Cv)}function mb(M){return hb(uE,M,Sv,Av)}function gb(M,W){if(!M)return Rv;const G=Wt.value,Y=G[String(M.type)];if(M.type==="code_block"){const se=W??wf(M),Se=se?j1(G,se):void 0;return Se||(u.value==="pre"?G.code_block||qs:se==="mermaid"?G.mermaid||nE:se==="infographic"?G.infographic||oE:se==="d2"||se==="d2lang"?G.d2||sE:Y||G.code_block||F2.value)}return Y||lb[String(M.type)]||Rv}function V1(M){s("click",M)}function gE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseover",M)}function vE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseout",M)}function vb(M){s("mouseover",M)}function yb(M){s("mouseout",M)}const ea=X(null),Vi=X(!1);let Nu,Xa=null,K1=0,_f=0,Sf=0;const kb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],yE=new Set(kb),bb=[".typewriter-cursor",".height-estimation-probes",...kb.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function xb(M){if(!M||typeof M!="object")return!1;const W=M.type;return typeof W=="string"&&yE.has(W)}function Cf(M){var W,G;if(!M||typeof M!="object")return 0;const Y=M,se=(G=(W=Y.raw)!=null?W:Y.content)!=null?G:Y.code;if(typeof se=="string")return se.length;const Se=Y.children;if(Array.isArray(Se))return Se.reduce((Le,qe)=>Le+Cf(qe),0);const Me=Y.items;return Array.isArray(Me)?Me.reduce((Le,qe)=>Le+Cf(qe),0):0}function Af(){Nu&&(clearTimeout(Nu),Nu=void 0)}function wb(){K1+=1,Xa!=null&&(qn?.(Xa),Xa=null)}function Mf(){wb(),ea.value&&(ea.value.style.visibility="hidden")}function kE(M){var W;if(M.nodeType!==Node.TEXT_NODE||!((W=M.textContent)!=null?W:"").trim())return!1;const G=M.parentElement;return!!G&&!G.closest(bb)}function bE(M){let W=M.lastChild;for(;W;){if(kE(W))return W;if(W.nodeType===Node.ELEMENT_NODE){const G=W;if(!G.matches(bb)&&G.lastChild){W=G.lastChild;continue}}for(;W&&W!==M&&!W.previousSibling;)W=W.parentNode;if(!W||W===M)break;W=W.previousSibling}return null}function G1(){if(!ne||!Vi.value||Xa!=null)return;const M=K1,W=()=>{Xa=null,M===K1&&(function(){var G,Y;if(!(ne&&Vi.value&&S.value&&ea.value))return;const se=S.value,Se=ea.value;Se.style.visibility="hidden";const Me=(function(){const je=q1.value;for(let Be=je.length-1;Be>=0;Be--){const Ke=je[Be];if(!Ke||xb(Ke.node)||!P1(Ke.index))continue;const tt=no.get(Ke.index);if(!tt)continue;const nt=bE(tt);if(nt)return nt}return null})();if(!Me)return;let Le=0,qe=0,Re=20,Ge=!1;if(Me?.textContent){const je=Me.textContent.length,Be=document.createRange();Be.setStart(Me,Math.max(0,je-1)),Be.setEnd(Me,je);const Ke=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,tt=(Y=Ke?.[Ke.length-1])!=null?Y:(G=Me.parentElement)==null?void 0:G.getBoundingClientRect();if(tt){const nt=ht("typewriterCursor.root.getBoundingClientRect",()=>se.getBoundingClientRect());Le=tt.right-nt.left+se.scrollLeft,qe=tt.top-nt.top+se.scrollTop,Re=tt.height||Re,Ge=!0}Be.detach()}Ge&&(Se.style.transform=`translate(${Math.max(0,Le)}px, ${Math.max(0,qe)}px)`,Se.style.height=`${Re}px`,Se.style.visibility="visible")})()};En?Xa=En(W):W()}return Qe([ve,()=>o.content,()=>o.nodes,()=>x.typewriter,j],()=>Xn(null,null,function*(){var M,W;if(!ne||ue.value||!z.value)return;if(j.value)return Vi.value=!1,Af(),void Mf();if((M=o.nodes)!=null&&M.length)return Vi.value=!1,Af(),Mf(),_f=((W=o.content)!=null?W:"").length,void(Sf=ve.value.length);const G=(function(){var Le,qe;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((Re,Ge)=>Re+Cf(Ge),0):((qe=o.content)!=null?qe:"").length})(),Y=(function(){var Le;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((qe,Re)=>qe+Cf(Re),0):ve.value.length})(),se=!xb(it.value[it.value.length-1]),Se=G>_f,Me=Y>Sf;if(x.typewriter===!1||!se||!Se&&!Me)return x.typewriter!==!1&&se||(Vi.value=!1,Mf()),_f=G,void(Sf=Y);_f=G,Sf=Y,Vi.value=!0,ea.value&&(ea.value.style.visibility="hidden"),Af(),yield mt(),G1(),Nu=setTimeout(()=>{Nu=void 0,Vi.value=!1},3e3)}),{flush:"post",immediate:!0}),Qe(Vi,M=>Xn(null,null,function*(){M?(yield mt(),G1()):Mf()}),{flush:"post"}),Qe([()=>fo.value,()=>Ho.start,()=>Ho.end],()=>Xn(null,null,function*(){ne&&!ue.value&&z.value&&Vi.value&&(yield mt(),G1())}),{flush:"post"}),mo(()=>{Af(),wb(),dn.clear()}),(M,W)=>{const G=KT("NodeRenderer",!0);return C(ue)?(w(!0),T(Pe,{key:0},ot(q1.value,Y=>(w(),T(Pe,{key:Y.index},[Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:V1,onMouseover:vb,onMouseout:yb,onCopy:W[0]||(W[0]=se=>s("copy",se)),onHandleArtifactClick:W[1]||(W[1]=se=>s("handleArtifactClick",se))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:V1,onMouseover:vb,onMouseout:yb,onCopy:W[2]||(W[2]=se=>s("copy",se)),onHandleArtifactClick:W[3]||(W[3]=se=>s("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),T("div",{key:1,ref_key:"containerRef",ref:S,class:We(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:Ct.value},{"virtual-scroll-coordinated":Xe.value}]]),"data-custom-id":x.customId,onClick:V1,onMouseover:gE,onMouseout:vE},[Pt.value||Ct.value?(w(),T(Pe,{key:0},[Pt.value?(w(),T("div",{key:0,class:"height-estimation-probes",style:Yt({width:`${Hn.value}px`}),"aria-hidden":"true"},[_("div",{ref_key:"paragraphProbeWrapperRef",ref:N,class:"node-content","data-probe":"paragraph"},[re(C(Ma),{node:go.value,"index-key":"probe-paragraph"},null,8,["node"])],512),_("div",{ref_key:"listItemProbeWrapperRef",ref:D,class:"node-content","data-probe":"list-item"},[_("ul",Ree,[re(C(zc),{node:os.value,"index-key":"probe-list-item"},null,8,["node"])])],512),_("div",{ref_key:"listProbeWrapperRef",ref:B,class:"node-content","data-probe":"list"},[re(C(Uc),{node:Un.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),T(Pe,null,ot(6,Y=>_("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:se=>(function(Se,Me){Se<1||Se>6||(U[Se]=Me)})(Y,se),class:"node-content","data-probe":`heading-${Y}`},[re(C(Lp),{node:H8(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,Bee)),64))],4)):ce("",!0),Ct.value?(w(),T("div",{key:1,class:"node-spacer",style:Yt({height:`${d1.value}px`}),"aria-hidden":"true"},null,4)):ce("",!0)],64)):ce("",!0),(w(!0),T(Pe,null,ot(q1.value,Y=>(w(),T("div",{key:Y.index,ref_for:!0,ref:se=>sb(Y.index,se),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[P1(Y.index)?(w(),T("div",{key:0,ref_for:!0,ref:se=>(function(Se,Me){var Le;Me||(function(je){const Be=`${h1()}-${je}`;let Ke=!1;for(const tt of Array.from(Hs.keys())){const nt=qi.get(tt);(nt?.index===je||tt===Be||tt.startsWith(`${Be}-`))&&(Hs.delete(tt),qi.delete(tt),Ke=!0)}Ke&&(za(),Rn("async-node"))})(Se),cr.delete(Se),(function(je){var Be;const Ke=((Be=Vl.get(je))!=null?Be:0)+1;Vl.set(je,Ke)})(Se);const qe=Kr.get(Se);if(qe){for(const je of qe)ff(je);Kr.delete(Se)}if((function(je){const Be=is.get(je);Be&&(Lo?.unobserve(Be),rs.delete(Be),is.delete(je))})(Se),!Me||!Po.value)return Ui.delete(Se),void Vl.delete(Se);Ui.set(Se,Me);const Re=()=>{xf(Se,Me)};queueMicrotask(Re);const Ge=(Lo||typeof ResizeObserver>"u"||(Lo=new ResizeObserver(je=>{if(je.length)for(const Be of je){const Ke=rs.get(Be.target),tt=is.get(Ke??-1);Ke!=null&&tt&&xf(Ke,tt)}else dr()})),Lo);if(Ge&&(is.set(Se,Me),rs.set(Me,Se),Ge.observe(Me)),typeof window<"u"){const je=((Le=it.value[Se])==null?void 0:Le.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(je.length){const Be=je.map(Ke=>A2(Ke,Re,"node-resize")).filter(Ke=>Ke!=null);Be.length&&Kr.set(Se,Be)}}})(Y.index,se),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[8]||(W[8]=se=>s("copy",se)),onHandleArtifactClick:W[9]||(W[9]=se=>s("handleArtifactClick",se))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[10]||(W[10]=se=>s("copy",se)),onHandleArtifactClick:W[11]||(W[11]=se=>s("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(Il,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[4]||(W[4]=se=>s("copy",se)),onHandleArtifactClick:W[5]||(W[5]=se=>s("handleArtifactClick",se))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[6]||(W[6]=se=>s("copy",se)),onHandleArtifactClick:W[7]||(W[7]=se=>s("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),T("div",{key:1,class:"node-placeholder",style:Yt({height:`${mf(Y.index)}px`})},null,4))],8,Dee))),128)),Vi.value?(w(),T("span",{key:1,ref_key:"typewriterCursorRef",ref:ea,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ce("",!0),Ct.value?(w(),T("div",{key:2,class:"node-spacer",style:Yt({height:`${f1.value}px`}),"aria-hidden":"true"},null,4)):ce("",!0)],42,Oee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Bs=u5;Bs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Bs.__name,Bs.name].filter(n=>!!n));for(const n of t)e.component(n,u5)};const Lk=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),Pee={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"},Hee={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"},Wee={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"},zee={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"},Uee={class:"admonition-title"},qee=["aria-expanded","aria-controls"],jee=["id"],Rh=gn(Ze({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=R(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=X(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),T("div",{class:We(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(w(),T("svg",Pee,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(w(),T("svg",Hee,[...u[2]||(u[2]=[_("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(w(),T("svg",Wee,[...u[3]||(u[3]=[_("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(w(),T("svg",zee,[...u[4]||(u[4]=[_("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):ce("",!0),_("span",Uee,O(i.value),1),o.node.collapsible?(w(),T("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),T("svg",{style:Yt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,qee)):ce("",!0)]),$n(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[re(C(Bs),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,jee),[[mi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Rh.install=e=>{e.component(Rh.__name,Rh)};const d5=()=>ms(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let ih=null,Vee=d5;function b_e(){return Xn(this,null,function*(){if(ih)return ih;const e=Vee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===d5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(ih=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),ih):null})}function x_e(){return!1}function w_e(){return Xn(this,null,function*(){return null})}const rh=X(!1);let pC=!1;function og(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Kee(){return!pC&&typeof window<"u"&&typeof document<"u"&&(pC=!0,rh.value=og(),new MutationObserver(()=>{rh.value=og()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{rh.value=og()})),rh}const f5=["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"],Gee=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Wv=[...f5].sort((e,t)=>t.length-e.length).join("|"),sg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Wv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Wv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),h5=/[),.;!?,。;!?)]+$/;function Yee(e){const t=e.toLowerCase();return f5.some(n=>t.endsWith(`.${n}`))}function Zee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Wv}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function Qee(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(h5,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Gee.has(i),a=Yee(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function Xee(e,t={}){const n=[];sg.lastIndex=0;let o;for(;(o=sg.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(h5,""),u=a.length-c.length;a=c;const d=Qee(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(sg.lastIndex-=u)}return n}const Jee=12e4,ete=6e4,tte=32,nte=3e4,mC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function ote(e){let t=0,n=0,o=0;mC.lastIndex=0;let s;for(;(s=mC.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Jee||n>=ete||t>=tte||o>=nte?"pre":"shiki",codeFenceCount:t,codeChars:n}}function ste(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function ite(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const rte={key:1,class:"diff-wrap"},lte={class:"diff-bar"},ate=["aria-label","onClick"],cte={class:"diff-pre"},ute={key:0,class:"diff-sign"},dte={class:"diff-text"},fte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",gC="github-light",vC="github-dark",hte=Ze({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){zQ(),tX(),qQ(),rX(),UQ(new ste),iX(new ite);function t(B){return B.inline.ruler.disable("math"),B}const{t:n}=Tt(),o=Kt("resolveImage"),s=X(null),i=e,r=R(()=>!i.streaming),l=R(()=>Zee(i.text??"")),a=R(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:ote(i.text??"")),c=Kee(),u=R(()=>!i.streaming),d=Bo(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(B){return!/^(https?:|data:|blob:)/i.test(B)}function b(B){if(!o)return;const U=[];for(const H of[h,p]){H.lastIndex=0;let P;for(;(P=H.exec(B))!==null;)U.push(P[2]??"")}for(const H of U)!H||!g(H)||d.has(H)||f.has(H)||(f.add(H),o(H).then(P=>{d.set(H,P!==H?P:"")}).catch(()=>{d.set(H,"")}).finally(()=>{f.delete(H)}))}function v(B){if(!o)return B;const U=H=>{if(!g(H))return null;const P=d.get(H);return P===void 0?fte:P===""?null:P};return B.replace(h,(H,P,Z,K)=>{const V=U(Z);return V===null?H:`${P}${V}${K}`}).replace(p,(H,P,Z,K)=>{const V=U(Z);return V===null?H:`${P}${V}${K}`})}Qe(()=>i.text,B=>b(B??""),{immediate:!0});function m(){if(!s.value||!i.openFile||i.streaming)return;const B=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),U=[];let H=B.nextNode();for(;H;){const P=H,Z=P.parentElement;Z&&!Z.closest("a, pre, .md-file-link, svg")&&P.data.trim().length>0&&U.push(P),H=B.nextNode()}for(const P of U){const Z=Xee(P.data,{aliases:l.value});if(Z.length===0||!P.parentNode)continue;const K=document.createDocumentFragment();let V=0;for(const J of Z){J.start>V&&K.append(document.createTextNode(P.data.slice(V,J.start)));const he=document.createElement("button");he.type="button",he.className="md-file-link",he.textContent=J.text,he.title=J.line?`${J.path}:${J.line}`:J.path,he.addEventListener("click",ne=>{ne.preventDefault(),ne.stopPropagation(),i.openFile?.({path:J.path,line:J.line})}),K.append(he),V=J.end}V<P.data.length&&K.append(document.createTextNode(P.data.slice(V))),P.parentNode.replaceChild(K,P)}}function y(B){return!(!B||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(B))}function k(B){let U=B.length;for(const H of["#","?"]){const P=B.indexOf(H);P!==-1&&P<U&&(U=P)}return B.slice(0,U)}function A(){if(!s.value||!i.openFile||i.streaming)return;const B=s.value.querySelectorAll("a[href]");for(const U of B){if(U.dataset.mdLinkHandled==="true"||U.closest("svg"))continue;const H=U.getAttribute("href")??"";y(H)&&(U.dataset.mdLinkHandled="true",U.addEventListener("click",P=>{P.preventDefault(),P.stopPropagation(),i.openFile?.({path:k(H)})}))}}function $(){mt().then(()=>{m(),A()})}Qe(()=>i.text,$),Qe(()=>i.streaming,$);let I=null;cn(()=>{$(),s.value&&(I=new MutationObserver($),I.observe(s.value,{childList:!0,subtree:!0}))}),bn(()=>{I?.disconnect()});const x={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1};function L(B){const U=typeof navigator<"u"?navigator.clipboard:void 0;U&&typeof U.writeText=="function"||Go(B)}const E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,F=R(()=>{const B=v(i.text??""),U=[];let H=0;E.lastIndex=0;let P;for(;(P=E.exec(B))!==null;){const K=P[1]??"",V=B.slice(H,P.index)+(K||"");V.trim()&&U.push({kind:"md",text:V}),U.push({kind:"diff",code:P[2]??""}),H=E.lastIndex}const Z=B.slice(H);return(Z.trim()||U.length===0)&&U.push({kind:"md",text:Z}),U});function S(B){return B.split(`
|
|
281
|
+
`).map(U=>U.startsWith("@@")?{type:"hunk",sign:"",text:U}:/^\+(?!\+\+)/.test(U)?{type:"add",sign:"+",text:U.slice(1)}:/^-(?!--)/.test(U)?{type:"del",sign:"-",text:U.slice(1)}:U.startsWith(" ")?{type:"ctx",sign:"",text:U.slice(1)}:{type:"ctx",sign:"",text:U})}const N=X(null);function D(B,U){Go(B).then(H=>{H&&(N.value=U,setTimeout(()=>{N.value=null},1400))})}return(B,U)=>(w(),T("div",{ref_key:"mdRef",ref:s,class:"md"},[(w(!0),T(Pe,null,ot(F.value,(H,P)=>(w(),T(Pe,{key:P},[H.kind==="md"?(w(),xe(C(Bs),{key:0,content:H.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":gC,"code-block-dark-theme":vC,themes:[gC,vC],"code-block-props":x,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:L},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(w(),T("div",rte,[_("div",lte,[U[0]||(U[0]=_("span",{class:"diff-lang"},"diff",-1)),re(Xt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:Z=>D(H.code,P)},[re(Ve,{name:N.value===P?"check":"copy",size:"sm"},null,8,["name"])],8,ate)]),_:2},1032,["text"])]),_("pre",cte,[_("code",null,[(w(!0),T(Pe,null,ot(S(H.code),(Z,K)=>(w(),T("span",{key:K,class:We(["diff-line",`diff-${Z.type}`])},[Z.type!=="hunk"?(w(),T("span",ute,O(Z.sign),1)):ce("",!0),_("span",dte,O(Z.text),1)],2))),128))])])]))],64))),128))],512))}}),zm=ct(hte,[["__scopeId","data-v-fbd17874"]]),pte={class:"tc-anim"},mte={class:"prev-anim"},gte={class:"prev"},vte=Ze({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=R(()=>n.foldable&&s.value.length>1),r=R(()=>n.streaming||!i.value),l=R(()=>s.value.at(-1)??""),a=X(null);return cn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Qe(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||mt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),T("div",{class:We(["think",{mob:e.mobile}])},[i.value?(w(),T("div",{key:0,class:We(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[_("div",pte,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),_("div",mte,[_("span",gte,O(l.value),1)])],2)):(w(),T("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),yte=ct(vte,[["__scopeId","data-v-fdc551ea"]]),kte={class:"activity-notice",role:"status"},bte={"aria-hidden":"true"},xte={class:"an-label"},wte=Ze({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),T("div",kte,[_("span",bte,[re(Ds,{size:"sm"})]),_("span",xte,O(e.label),1)]))}}),_te=ct(wte,[["__scopeId","data-v-0d497074"]]);function Ste(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const Cte=Ze({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Tt(),o=X(!1),s=R(()=>{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=R(()=>o.value?s.value:Ste(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(w(),T("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},O(i.value),1))}}),p5=ct(Cte,[["__scopeId","data-v-9672fbd5"]]);function Ate(e){return e.length===1?`0${e}`:e}function Mte(e,t){return`${String(Number(e))}:${Ate(t)}`}const yC=e=>/^\d+$/.test(e);function Ete(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(yC(o)&&yC(s)&&c){const f=Mte(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const Tte=["data-turn-id"],Nte={class:"cn-bubble"},Ite={class:"cn-title"},Lte={key:0,class:"cn-prompt"},$te={class:"cn-meta"},Fte={key:0,class:"cn-meta-item"},Ote={key:1,class:"cn-meta-item"},Rte=["aria-label"],Bte=["title"],Dte=Ze({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Tt(),o=R(()=>t.cron),s=R(()=>o.value?.missedCount!==void 0),i=R(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=R(()=>{const u=o.value?.cron;return u?Ete(u,n):""}),l=R(()=>s.value?"error":"ok"),a=R(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=R(()=>t.text??"");return(u,d)=>(w(),T("div",{class:We(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",Nte,[_("span",Ite,O(i.value),1),c.value?(w(),T("span",Lte,O(c.value),1)):ce("",!0)]),_("div",$te,[re(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(w(),T("span",Fte,O(r.value),1)):ce("",!0),a.value?(w(),T("span",Ote,O(a.value),1)):ce("",!0),_("span",{class:We(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):(w(),xe(Ve,{key:1,name:"close",size:"sm"}))],10,Rte),o.value?.jobId?(w(),T("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},O(o.value.jobId),9,Bte)):ce("",!0),e.createdAt?(w(),xe(p5,{key:3,time:e.createdAt},null,8,["time"])):ce("",!0)])],10,Tte))}}),Pte=ct(Dte,[["__scopeId","data-v-a62a6587"]]),Hte=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],m5=500,Op=256*1024,kC=200,ig=16384,rg=500,lg=50,ag=50,Wte=6,zte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Ute=/^[A-Za-z0-9+/=_-]{200,}$/;let cg=null;function Hi(){if(cg!==null)return cg;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=ao(Ft.debug)==="1"),cg=e,e}const El=[],Ec=[];let Gu=0;const ma=[];let Yu=0,qte=1;const Rp=new TextEncoder,jte=new Set(Hte),$k=X(0),Zu=Ra(!1);function Vte(){return El}function Kte(){El.length=0,Ec.length=0,Gu=0,ma.length=0,Yu=0,$k.value++}function jr(e){if(!Zu.value){try{const t={id:qte++,ts:Date.now(),source:e.source,kind:String(qc(e.kind)),label:String(qc(e.label)),sessionId:e.sessionId===void 0?void 0:String(qc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Wl(e.detail)},n=JSON.stringify(t),o=Rp.encode(n).byteLength;if(o>Op)return;for(El.push(t),Ec.push(n),Gu+=o+(Ec.length>1?1:0);El.length>m5||Gu>Op;){const s=Ec.shift();El.shift(),s!==void 0&&(Gu-=Rp.encode(s).byteLength,Ec.length>0&&(Gu-=1))}}catch{return}$k.value++}}function aa(e){if(typeof e=="string")return e.length<=kC?e:e.slice(0,kC)}function li(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Gte(e,t){if(jte.has(e))try{const n={ts:Date.now(),event:e,sessionId:aa(t?.sessionId),status:aa(t?.status),operation:aa(t?.operation),seq:li(t?.seq),durationMs:li(t?.durationMs),messageCount:li(t?.messageCount),contentCount:li(t?.contentCount),mediaCount:li(t?.mediaCount),sessionCount:li(t?.sessionCount),workspaceCount:li(t?.workspaceCount),promptId:aa(t?.promptId),zipBytes:li(t?.zipBytes),errorName:aa(t?.errorName),errorCode:li(t?.errorCode),requestId:aa(t?.requestId),phase:aa(t?.phase),httpStatus:li(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:li(t?.line),col:li(t?.col)},o=JSON.stringify(n),s=Rp.encode(o).byteLength;if(s>Op)return;for(ma.push(o),Yu+=s+(ma.length>1?1:0);ma.length>m5||Yu>Op;){const i=ma.shift();i!==void 0&&(Yu-=Rp.encode(i).byteLength,ma.length>0&&(Yu-=1))}}catch{return}}function qc(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return Ute.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>rg?`${i.slice(0,rg)}… [+${i.length-rg} chars]`:i}if(n!=="object")return String(e);if(t>=Wte)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,lg).map(r=>qc(r,t+1));return e.length>lg&&i.push(`[+${e.length-lg} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,ag))o[i]=zte.test(i)?"[redacted]":qc(r,t+1);return s.length>ag&&(o._truncatedKeys=s.length-ag),o}function Wl(e){if(e===void 0)return;const t=qc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>ig)return{_truncated:`detail JSON was ${n.length} chars; first ${ig} kept`,preview:n.slice(0,ig)}}catch{return"[unserializable detail]"}return t}function lh(e){Hi()&&jr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Wl(e.body)}})}function ac(e){if(!Hi())return;const t=e.code!==0;jr({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:Wl(e.data)}})}function al(e){Hi()&&jr({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 cc(e,t){Hi()&&jr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Wl(t)})}function Yte(e){if(!Hi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;jr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Wl(e)})}function Zte(e){if(!Hi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);jr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Wl(t.payload)})}const Qte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Xte(e,t,n){Hi()&&jr({source:"client",kind:`client:${e}`,label:`${Qte[e]} ${t}`,detail:Wl(n)})}function Er(e,t){Hi()&&jr({source:"client",kind:"client:event",label:`· ${e}`,detail:Wl(t)})}function ko(e,t){Gte(e,t),jr({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let ug=!1,ah=null;function Jte(){if(ug)return()=>ah?.();ug=!0;const e=[];try{if(typeof window<"u"){const n=s=>{ko("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;ko("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Hi())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{Xte(n,i.map(ene).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(ah===t){for(const n of e.toReversed())n();ah=null,ug=!1}};return ah=t,t}function ene(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 g5(e=El){if(typeof document>"u")return;const t=new Blob([tne(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function tne(e=El){return e===El?Ec.join(`
|
|
282
|
+
`):e.map(t=>JSON.stringify(t)).join(`
|
|
283
|
+
`)}function nne(){return ma.join(`
|
|
284
|
+
`)}function v5(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 zv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ni(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:v5(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 gd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function bC(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 Fk(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:bC(e.source)};case"video":return{type:"video",source:bC(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 Uv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Fk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function one(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 sne(e){return{content:e.content.map(one),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 ine(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function y5(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 rne(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function lne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(rne),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function k5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(lne),createdAt:e.created_at}}function ane(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 cne(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=ane(o);return{answers:t,method:e.method,note:e.note}}function Bh(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function xC(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 cl(e,t){const n=e[t];return typeof n=="string"?n:void 0}function uc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ai(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function b5(e){if(!e||typeof e!="object")return null;const t=e,n=cl(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:cl(t,"goalId")??cl(t,"goal_id")??"goal",objective:cl(t,"objective")??"",completionCriterion:cl(t,"completionCriterion")??cl(t,"completion_criterion"),status:n,turnsUsed:uc(t,"turnsUsed")??uc(t,"turns_used")??0,tokensUsed:uc(t,"tokensUsed")??uc(t,"tokens_used")??0,wallClockMs:uc(t,"wallClockMs")??uc(t,"wall_clock_ms")??0,terminalReason:cl(t,"terminalReason")??cl(t,"terminal_reason"),budget:{tokenBudget:ai(s,"tokenBudget")??ai(s,"token_budget"),remainingTokens:ai(s,"remainingTokens")??ai(s,"remaining_tokens"),turnBudget:ai(s,"turnBudget")??ai(s,"turn_budget"),remainingTurns:ai(s,"remainingTurns")??ai(s,"remaining_turns"),wallClockBudgetMs:ai(s,"wallClockBudgetMs")??ai(s,"wall_clock_budget_ms"),remainingWallClockMs:ai(s,"remainingWallClockMs")??ai(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function une(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ni(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:gd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:gd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:v5(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=b5(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:Uv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Fk),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:y5(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:k5(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:Bh(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:qv(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 dne(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 wC(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 qv(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function fne(e){return e.session_id}function hne(e){return e.seq}const pne="main",mne=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function Sr(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 gne(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 _C(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map,retryReuseMsgId:void 0}}function ds(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ua(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ci(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function vne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=ds(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=ds(t,"goalId")??ds(t,"goal_id")??"goal",r=ds(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ds(t,"completionCriterion")??ds(t,"completion_criterion"),status:s,turnsUsed:ua(t,"turnsUsed")??ua(t,"turns_used")??0,tokensUsed:ua(t,"tokensUsed")??ua(t,"tokens_used")??0,wallClockMs:ua(t,"wallClockMs")??ua(t,"wall_clock_ms")??0,terminalReason:ds(t,"terminalReason")??ds(t,"terminal_reason"),budget:{tokenBudget:ci(o,"tokenBudget")??ci(o,"token_budget"),remainingTokens:ci(o,"remainingTokens")??ci(o,"remaining_tokens"),turnBudget:ci(o,"turnBudget")??ci(o,"turn_budget"),remainingTurns:ci(o,"remainingTurns")??ci(o,"remaining_turns"),wallClockBudgetMs:ci(o,"wallClockBudgetMs")??ci(o,"wall_clock_budget_ms"),remainingWallClockMs:ci(o,"remainingWallClockMs")??ci(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function ga(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function yne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ds(t,"name")??ds(t,"toolName")??"tool",o=Da(kne(n)),s=bne(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=ds(n,"text");if(s)return dg(s);const i=ds(n,"message");if(i)return dg(i)}const o=ds(t,"message");if(o)return dg(o)}return null}function kne(e){return e.replace(/_\d+$/,"")}const SC=2e3;function dg(e){return e.length>SC?`${e.slice(0,SC)}…`:e}function bne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Nd(e,n)}function xne(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=ds(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ga(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=yne(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ga(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 Hu(e){return{...e,content:e.content.map(t=>({...t}))}}function CC(e,t,n){const o={id:Sr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function wne(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function _ne(e){return Array.isArray(e)?e.map(t=>Fk(t)):[]}function AC(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function Sne(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function Cne(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function MC(e,t){e.messages.find(n=>n.id===t)}function Ane(e,t,n,o,s,i){const r={id:Sr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Wu(e,t){return e.messages.find(n=>n.id===t)}function EC(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 Mne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=_C(),e.set(u,d)),d}function o(u){e.set(u,_C())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??Sr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=CC(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const b=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:b}),f.toolStartTimes.set(g.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:Hu(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),g=d,b=[],v=g?.agentId;if(typeof v=="string"&&v!==pne){const m=t.has(v);if(m&&(u==="thinking.delta"||u==="assistant.delta")){const y=g?.delta??"";return y?[{type:"agentDelta",sessionId:f,agentId:v,delta:{[u==="thinking.delta"?"thinking":"text"]:y}}]:[]}if(m&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:v,reason:g?.reason}];if(mne.has(u))return xne(p,f,v,u,g??{},t)}switch(u){case"session.meta.updated":{const m=g?.patch?.title??g?.title,y=g?.patch?.lastPrompt,k={};typeof m=="string"&&m.length>0&&(k.title=m),typeof y=="string"&&(k.lastPrompt=y),(k.title!==void 0||k.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...k});break}case"prompt.submitted":{const m=g?.promptId,y=g?.userMessageId;if(!m||!y)break;const k=_ne(g?.content);if(k.length===0)break;p.currentPromptId=m;const A=wne(p,f,m,y,k,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:Hu(A)});break}case"turn.started":{const m=g?.turnId,y=p.currentPromptId??Sr("pr_");p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y),p.turnTextLen=0,p.turnThinkLen=0,b.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;if(y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,Wu(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const k=CC(p,f,y);p.currentAssistantMsgId=k.id,b.push({type:"messageCreated",message:Hu(k)});break}case"thinking.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const k=a(p.turnThinkLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=AC(p,m,"thinking",y);if(A<0)break;p.turnThinkLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{thinking:y}});break}case"assistant.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const k=a(p.turnTextLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=AC(p,m,"text",y);if(A<0)break;p.turnTextLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{text:y}});break}case"tool.use":case"tool.call.started":{const m=p.currentAssistantMsgId,y=g?.turnId,k=p.turnPromptId.get(y)??p.currentPromptId;if(!m||!k)break;const A=g?.toolCallId,$=g?.name??g?.toolName??"",I=g?.args??g?.input??{};Sne(p,m,A,$,I);const x=Wu(p,m);x&&x.content.length-1,p.toolStartTimes.set(A,Date.now()),x&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:x.content.map(L=>({...L})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const m=g?.toolCallId,y=Cne(g??{});m&&y&&b.push({type:"toolOutput",sessionId:f,toolCallId:m,outputChunk:y.outputChunk,stream:y.stream});break}case"tool.result":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y));const k=g?.toolCallId,A=g?.output,$=g?.isError??!1;p.toolStartTimes.get(k)??Date.now(),p.toolStartTimes.delete(k);const I=Ane(p,f,k,A,$,y);b.push({type:"messageCreated",message:Hu(I)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const m=p.currentAssistantMsgId,y=gne(g?.usage);if(p.totalInput+=y.input,p.totalOutput+=y.output,p.totalCacheRead+=y.cacheRead,p.totalCacheCreate+=y.cacheCreate,m){MC(p,m);const k=Wu(p,m);k&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:k.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(p.model=g.model),g?.contextTokens!==void 0&&(p.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(p.contextLimit=g.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:EC(p),model:p.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0});break}case"turn.ended":{const m=p.currentAssistantMsgId,y=g?.reason??"completed",k=ua(g??{},"durationMs");if(b.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:g?.reason}),m){MC(p,m);const $=Wu(p,m);$&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:$.content.map(I=>({...I})),status:y==="failed"||y==="blocked"?"error":"completed",durationMs:k})}p.turnCount++;const A=EC(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptCompleted",sessionId:f,promptId:m,reason:g?.reason??"completed"});break}case"prompt.aborted":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptAborted",sessionId:f,promptId:m});break}case"turn.step.retrying":{const m=p.currentAssistantMsgId;if(m!==void 0){const y=Wu(p,m);y!==void 0&&(y.content=y.content.filter(k=>k.type!=="text"&&k.type!=="thinking"&&k.type!=="toolUse"),b.push({type:"messageUpdated",sessionId:f,messageId:m,content:y.content.map(k=>({...k})),status:"pending"}),p.retryReuseMsgId=m)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const y={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:Sr("task_"),sessionId:f,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0,runInBackground:g?.runInBackground===!0};p.subagentMeta.set(y.id,y),b.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.started":{const m=ga(p,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.suspended":{const m=ga(p,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.completed":{const m=typeof g?.resultSummary=="string"?g.resultSummary:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:m});break}case"subagent.failed":{const m=typeof g?.error=="string"?g.error:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:m});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message,name:g?.name,details:g?.details,retryable:g?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"task.started":{const m=g?.info??{},y=typeof m.startedAt=="number"?new Date(m.startedAt).toISOString():void 0,k=typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):Sr("task_"),A=typeof m.description=="string"?m.description:typeof m.command=="string"?m.command:wn.global.t("tasks.defaultDescription");if(m.kind==="agent"){const I=typeof m.agentId=="string"&&m.agentId.length>0?m.agentId:void 0;if(I!==void 0){const x=ga(p,f,I,{description:A,backgroundTaskId:k,runInBackground:!0});x&&b.push({type:"taskCreated",sessionId:f,task:x})}else b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,subagentPhase:"queued",runInBackground:!0}});break}const $=typeof m.command=="string"?m.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"bash",description:A,command:$,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"task.terminated":{const m=g?.info??{},y=m.status==="failed"||typeof m.exitCode=="number"&&m.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):"",status:y?"failed":"completed"});break}case"compaction.completed":{const m=g?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof m.tokensBefore=="number"?m.tokensBefore:void 0,tokensAfter:typeof m.tokensAfter=="number"?m.tokensAfter:void 0,summary:typeof m.summary=="string"?m.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const m=vne(g?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:m?.status==="complete"?null:m});break}case"cron.fired":{const m=g?.origin,y=ds(g??{},"prompt");if(m&&typeof m=="object"&&m.kind==="cron_job"&&y){const k={id:Sr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:y}],createdAt:new Date().toISOString(),metadata:{origin:m}};p.messages.push(k),b.push({type:"messageCreated",message:Hu(k)})}break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const Ene=new Set(["server_hello","ack","ping","resync_required","error","pong"]),TC=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),Tne=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"]),Nne=new Set(["assistant.delta","thinking.delta"]);function Ine(e,t){if(Ene.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return Nne.has(o)?Lne(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?Tne.has(o)?{route:"protocol"}:TC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:TC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function Lne(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 Qu 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 xr 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 vi(e){return e instanceof Qu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Ok(e){return e instanceof xr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const zo="kimi-web.server-credential",$ne="token",Fne=10080*60*1e3;let or;const jv=new Set;function One(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get($ne);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function Vv(e){return{version:1,credential:e,expiresAt:Date.now()+Fne}}function Rne(e){return JSON.stringify(e)}function Rk(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Kv(e){globalThis.localStorage?.setItem(zo,Rne(e))}function Bne(){try{const e=globalThis.localStorage?.getItem(zo);if(e){const n=Rk(e);if(n===void 0){const o=Vv(e);let s=!1;try{Kv(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(zo),globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo);return}const t=globalThis.sessionStorage?.getItem(zo);if(t){const n=Vv(t);let o=!1;try{Kv(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo),o=!0}catch{}return o?n:void 0}return}catch{return}}function Dne(){const e=One();return e?(w5(e),!0):(or=Bne(),or!==void 0)}function x5(){if(or!==void 0){if(or.expiresAt<=Date.now()){Pne(or);return}return or.credential}}function Pne(e){or=void 0;try{globalThis.sessionStorage?.removeItem(zo);const t=globalThis.localStorage?.getItem(zo),n=t==null?void 0:Rk(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(zo)}catch{}}function w5(e){const t=Vv(e);or=t;try{Kv(t)}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}}function Hne(){const e=or;or=void 0;try{const t=globalThis.localStorage?.getItem(zo),o=(t==null?void 0:Rk(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(zo),globalThis.sessionStorage?.removeItem(zo)}catch{}}function Wne(e){return jv.add(e),()=>{jv.delete(e)}}function zne(){Hne();for(const e of jv)try{e()}catch{}}const yc=3e4,ch=5*6e4,_5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",NC=500,S5=40101;function uh(e=yc){try{return AbortSignal.timeout(e)}catch{return}}function Une(e,t){let n="",o=e;for(let s=0;s<t;s++)n=_5[o%32]+n,o=Math.floor(o/32);return n}function qne(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=>_5[n%32]).join("")}function dh(){return`${Une(Date.now(),10)}${qne(16)}`}function jne(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function fg(e){try{const t=await e.text();return t?t.length>NC?`${t.slice(0,NC)}...`:t:void 0}catch{return}}class Vne{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=_c(this.origin,t),o=dh(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();lh({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:uh()})}catch(a){throw al({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new xr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:yc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return ac({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),ac({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new Qu({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=_c(this.origin,t),r=dh(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();lh({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:uh(ch)})}catch(h){throw al({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new xr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:ch,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const b=h?.code??c.status,v=h?.msg??c.statusText;throw ac({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:b,msg:v,envelopeRequestId:h?.request_id}),new Qu({code:b,msg:v,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),g=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:g}),new xr({message:`Invalid ZIP response from ${s} ${t}`,cause:g,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ch,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await fg(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new xr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ch,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return ac({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=_c(this.origin,t),s=dh(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();lh({method:"POST",path:t,url:o,requestId:s,body:jne(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:uh()})}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new xr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:yc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new xr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:yc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await fg(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(ac({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Qu({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=_c(this.origin,n);if(s){const h=new URLSearchParams;for(const[g,b]of Object.entries(s))b!==void 0&&h.set(g,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=dh(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();lh({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:uh()})}catch(h){throw al({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new xr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:yc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw al({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new xr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:yc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await fg(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(ac({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 Qu({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=x5();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===S5)&&zne()}}const Kne="kimi-code.bearer.",Gne=3e4;class Yne{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),cc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=x5(),n=t!==void 0?[`${Kne}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{cc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));Zte(i),this.handleFrame(i)}catch(i){cc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{cc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{cc("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,cc("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=fh(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(fh(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(fh(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,Gne),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,i=n.seq,r=fh(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=Ine(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Yte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function fh(e,t){return`${e}\0${t}`}function Zne(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function IC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function hg(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 LC(e){return e==="auto_compact"||e==="manual_compact"}class Qne{http;config;constructor(t){this.config=t,this.http=new Vne(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Ni),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return Ni(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ni(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Ni(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return b5(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ni(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(Uv),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();ko("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Ni(o.session),messages:o.messages.items.map(Uv),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(y5),pendingQuestions:o.pending_questions.map(k5),subagents:(o.subagents??[]).map(Bh)};return ko("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw ko("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...IC(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(`
|
|
285
|
+
`).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:Zne(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();ko("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,sne(n));return ko("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw ko("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...IC(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Ni(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Ni(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ni)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,ine(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,cne(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(Bh)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return Bh(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(hg)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return hg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return hg(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(xC)])):void 0;return{items:s.items.map(xC),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return _c(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(gd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return gd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return gd(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir}))}}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(dne)}async listProviders(){return(await this.http.get("/providers")).items.map(wC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const o=await this.http.post("/providers",n);return wC(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return pg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return pg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return pg(t)}async getConfig(){const t=await this.http.get("/config");return qv(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return qv(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return _c(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=$I(this.config.serverHttpUrl,this.config.clientId),o=Mne(),s=new Yne(n,this.config.clientId,{onWireEvent:i=>{const r=fne(i),l=hne(i),a=une(i);a.type==="historyCompacted"&&!LC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!LC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function pg(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 $C;function dt(){return $C??=new Qne(EI()),$C}const Xne=["src","controls","muted"],Jne=["src","alt"],C5=Ze({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=X(t.fileId?"":t.url),o=X(null),s=X(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await dt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Qe(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),cn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),mo(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(w(),T("video",{key:0,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Xne)):(w(),T("img",{key:1,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Jne))}}),eoe=["title","data-kind"],toe=["aria-label"],noe={class:"att-tile"},ooe={class:"att-name"},soe={key:1,class:"att-err"},ioe=["aria-label"],roe=Ze({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=R(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=R(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=R(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(w(),T("span",{class:We(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[_("span",noe,[e.kind==="image"&&e.url?(w(),xe(C5,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(w(),xe(Ve,{key:1,name:"play",size:"sm"})):e.kind==="image"?(w(),xe(Ve,{key:2,name:"image",size:"sm"})):(w(),xe(Ve,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",ooe,O(l.value),1),e.uploading?(w(),xe(Ds,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(w(),T("span",soe,[re(Ve,{name:"info",size:"sm"})])):ce("",!0)],8,toe),e.removable?(w(),xe(Xt,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ee(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[re(Ve,{name:"close",size:"sm"})],8,ioe)]),_:1},8,["text"])):ce("",!0)],10,eoe))}}),A5=ct(roe,[["__scopeId","data-v-12ec975b"]]),loe=["aria-label"],aoe=120,coe=60,uoe=Ze({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*aoe}ms`,"--moon-frame-fast-delay":`${o*coe}ms`}}return(o,s)=>(w(),T("span",{class:We(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),T(Pe,null,ot(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:Yt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,loe))}}),M5=ct(uoe,[["__scopeId","data-v-a6b7ec07"]]),tr=X(null),jc=X(!1);function Bk(e){const t=tr.value;!t||jc.value||(tr.value=null,t.resolve(e))}async function doe(){const e=tr.value;if(!(!e||jc.value)){if(!e.action){Bk(!0);return}jc.value=!0;try{await e.action(),tr.value===e&&(tr.value=null),e.resolve(!0)}catch(t){tr.value===e&&(tr.value=null),e.reject(t)}finally{jc.value=!1}}}function foe(e){return jc.value?Promise.resolve(!1):(tr.value&&Bk(!1),new Promise((t,n)=>{tr.value={...e,resolve:t,reject:n}}))}function nf(){return{current:tr,busy:jc,confirm:foe,settle:Bk,runAction:doe}}const hoe=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,poe=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,moe=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,FC="text/plain;charset=utf-8";function goe(e,t){const n=(t??"").toLowerCase();if(hoe.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:FC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:poe.test(o)?FC:moe.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function E5(e,t,n){const o=goe(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await dt().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const voe={class:"chat"},yoe={key:0,class:"chat-loading"},koe={class:"chat-loading-text"},boe={key:1,class:"chat-empty"},xoe={key:1,class:"top-sentinel-text"},woe={key:0,class:"u-turn"},_oe=["data-turn-id"],Soe={key:0,class:"u-atts"},Coe={key:1,class:"skill-act"},Aoe={class:"skill-act-head"},Moe={key:0,class:"skill-act-args"},Eoe={key:2,class:"skill-act"},Toe={class:"skill-act-head"},Noe={key:0,class:"skill-act-args"},Ioe={key:3,class:"u-text"},Loe={key:0,class:"u-meta"},$oe=["aria-label","onClick"],Foe=["aria-label","onClick"],Ooe=["data-turn-id"],Roe=["onClick"],Boe={class:"cd-view"},Doe={key:1,class:"cd-label"},Poe=["data-turn-id"],Hoe={key:1,class:"msg"},Woe={key:0,class:"a-msg-ft"},zoe={key:0,class:"a-duration"},Uoe=["aria-label","onClick"],qoe={key:4,class:"sending-placeholder"},joe={key:5,class:"q-stack"},Voe={class:"q-head"},Koe={class:"q-title"},Goe={class:"q-hint"},Yoe=["onDragover","onDrop"],Zoe={class:"u-bub q-bub"},Qoe=["title","onDragstart"],Xoe=["title","onClick"],Joe={key:0,class:"u-text q-text"},ese={key:1,class:"q-text q-text-placeholder"},tse={key:0,class:"q-imgs"},nse={key:0,class:"q-file"},ose={key:1,class:"q-tag q-tag-next"},sse={key:2,class:"q-tag q-tag-idx"},ise=["aria-label","onClick"],rse={key:0,class:"open-unsupported",role:"status"},lse=2500,ase=Ze({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),{confirm:s}=nf();bn(()=>{K!==null&&(clearTimeout(K),K=null),N!==null&&(clearTimeout(N),N=null),L!==null&&(clearTimeout(L),L=null),ue!==null&&(clearTimeout(ue),ue=null)});const i=e,r=X(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Ie=>{Ie[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))}cn(a),bn(()=>{l?.disconnect(),l=null}),Qe(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{mt().then(a)});const c=R(()=>{if(!i.turnActive||i.turns.length===0)return null;const Ie=i.turns.at(-1);return Ie.role==="assistant"?Ie.id:null}),u=R(()=>i.working),d=n,f=X(null),h=X(null);function p(Ie){return(Ie.attachments?.length??0)>0}function g(Ie){d("editQueued",Ie)}function b(Ie,le){if(f.value=Ie,!le.dataTransfer)return;le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",String(Ie));const z=le.currentTarget?.closest(".q-turn");z&&le.dataTransfer.setDragImage(z,24,24)}function v(Ie,le){if(f.value===null)return;le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move");const z=le.currentTarget.getBoundingClientRect(),ae=le.clientY<z.top+z.height/2?"before":"after";h.value={index:Ie,position:ae}}function m(Ie,le){le.preventDefault();const z=f.value,ae=h.value?.position??"before";if(f.value=null,h.value=null,z===null)return;let ie=ae==="before"?Ie:Ie+1;z<ie&&(ie-=1),z!==ie&&d("reorderQueue",{from:z,to:ie})}function y(){f.value=null,h.value=null}const k=R(()=>{for(let Ie=i.turns.length-1;Ie>=0;Ie--)if(i.turns[Ie].role==="user")return i.turns[Ie].id;return null});function A(Ie){return Ie.role==="user"&&Ie.id===k.value&&!i.working&&!Ie.skillActivation&&!Ie.pluginCommand}function $(Ie){const le=Ie.compaction,z=le?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof le?.tokensBefore=="number"&&typeof le?.tokensAfter=="number"?z+o("conversation.compactedTokens",{before:ir(le.tokensBefore),after:ir(le.tokensAfter)}):z}const I=X(null),x=X(null);let L=null;async function E(Ie){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(Ie)}function F(Ie){x.value===null&&(x.value=Ie.id,d("editMessage",{text:Ie.text,attachments:Ie.attachments}),L=setTimeout(()=>{L=null,x.value=null},lse))}Qe(()=>i.turns,Ie=>{x.value!==null&&(Ie.some(le=>le.id===x.value)||(x.value=null,L!==null&&(clearTimeout(L),L=null)))},{flush:"post"});const S=X(!1);let N=null;function D(){if(i.turns.length===0)return;const Ie=[];for(const z of i.turns){if(z.role==="compaction"||z.role==="cron")continue;const ae=z.role==="user"?"User":"Assistant",ie=NW(z);ie.trim()&&Ie.push(`**${ae}**
|
|
286
|
+
|
|
287
|
+
${ie}`)}const le=Ie.join(`
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
`);Go(le).then(z=>{z&&(S.value=!0,d("copyConversationCopied"),N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,S.value=!1},2e3))}).catch(()=>{})}function B(Ie){const le=[];for(let z=Ie;z>=0;z--){const ae=i.turns[z];if(!ae||ae.role!=="assistant")break;le.unshift(ae)}return le}function U(Ie){return B(Ie).map(le=>TW(le)).filter(Boolean).join(`
|
|
292
|
+
|
|
293
|
+
`)}function H(){for(let Ie=i.turns.length-1;Ie>=0;Ie-=1)if(i.turns[Ie]?.role==="assistant")return U(Ie);return""}function P(){const Ie=H();Ie.trim()&&Go(Ie).then(le=>{le&&(S.value=!0,d("copyConversationCopied"),N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:D,copyFinalSummary:P});function Z(Ie){const le=i.turns[Ie];if(!le||le.role!=="assistant")return!1;const z=i.turns[Ie+1];return!z||z.role!=="assistant"}let K=null;function V(Ie){const le=i.turns[Ie];if(!le)return;const z=U(Ie);z.trim()&&Go(z).then(ae=>{ae&&(I.value=le.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,I.value=null},1400))}).catch(()=>{})}function J(Ie){const le=Ie.text;le.trim()&&Go(le).then(z=>{z&&(I.value=Ie.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,I.value=null},1400))}).catch(()=>{})}function he(Ie){return{kind:Ie.kind==="video"?"video":"image",url:Ie.url,path:Ie.name,fileId:Ie.fileId}}const ne=X(null);let ue=null;function de(Ie){if(Ie.kind==="image"||Ie.kind==="video"){d("openMedia",he(Ie));return}Ie.fileId!==void 0&&E5(Ie.fileId,Ie.name,Ie.mediaType).then(le=>{le==="unsupported"&&(ne.value=Ie.name??Ie.fileId??"",ue!==null&&clearTimeout(ue),ue=setTimeout(()=>{ue=null,ne.value=null},2400))})}function Ce(Ie,le){return Ie.id!==c.value?!1:le.sourceIndex===wm(Ie).length-1}return(Ie,le)=>(w(),T(Pe,null,[_("div",voe,[e.sessionLoading?(w(),T("div",yoe,[re(Ds,{size:"sm"}),_("span",koe,O(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),T("div",boe)):ce("",!0),e.hasMoreMessages||e.loadingMore?(w(),T("div",{key:2,ref_key:"topSentinelRef",ref:r,class:We(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),T("span",xoe,[re(Ds,{size:"sm"}),Je(" "+O(C(o)("conversation.loadingOlder")),1)])):(w(),T("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:le[0]||(le[0]=z=>d("loadOlderMessages"))},O(C(o)("conversation.loadOlder")),1))],2)):ce("",!0),(w(!0),T(Pe,null,ot(e.turns,(z,ae)=>(w(),T(Pe,{key:z.id},[z.role==="user"?(w(),T("div",woe,[_("div",{class:We(["u-bub turn-anchor",{undoing:x.value===z.id}]),"data-turn-id":z.id},[z.attachments&&z.attachments.length>0?(w(),T("div",Soe,[(w(!0),T(Pe,null,ot(z.attachments,(ie,q)=>(w(),xe(A5,{key:q,kind:ie.kind,name:ie.name,url:ie.url,"file-id":ie.fileId,"media-type":ie.mediaType,size:ie.size,onActivate:ee=>de(ie)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ce("",!0),z.skillActivation?(w(),T("div",Coe,[_("div",Aoe,[le[9]||(le[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,O(C(o)("conversation.activatedSkill",{name:z.skillActivation.name})),1)]),z.skillActivation.args?(w(),T("div",Moe,O(z.skillActivation.args),1)):ce("",!0)])):z.pluginCommand?(w(),T("div",Eoe,[_("div",Toe,[le[10]||(le[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+O(z.pluginCommand.pluginId)+":"+O(z.pluginCommand.commandName),1)]),z.pluginCommand.args?(w(),T("div",Noe,O(z.pluginCommand.args),1)):ce("",!0)])):(w(),T("div",Ioe,O(z.text),1))],10,_oe),z.createdAt||A(z)?(w(),T("div",Loe,[A(z)?(w(),T("div",{key:0,class:We(["u-edit-wrap",{undoing:x.value===z.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:ie=>E(z)},[re(Ve,{name:"undo",size:"sm"})],8,$oe)],2)):ce("",!0),z.text.trim().length>0?(w(),T("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:bt(ie=>J(z),["stop"])},[I.value!==z.id?(w(),xe(Ve,{key:0,name:"copy",size:"sm"})):(w(),xe(Ve,{key:1,name:"check",size:"sm"}))],8,Foe)):ce("",!0),z.createdAt?(w(),xe(p5,{key:2,time:z.createdAt},null,8,["time"])):ce("",!0)])):ce("",!0)])):z.role==="compaction"?(w(),T("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":z.id,role:"separator"},[le[11]||(le[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),z.text?(w(),T("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ie=>d("openCompaction",{turnId:z.id})},[_("span",null,O($(z)),1),_("span",Boe,O(C(o)("conversation.viewSummary")),1)],8,Roe)):(w(),T("span",Doe,O($(z)),1)),le[12]||(le[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Ooe)):z.role==="cron"?(w(),xe(Pte,{key:2,text:z.text,cron:z.cron,"turn-id":z.id,"created-at":z.createdAt},null,8,["text","cron","turn-id","created-at"])):(w(),T("div",{key:3,class:"a-msg turn-anchor","data-turn-id":z.id},[(w(!0),T(Pe,null,ot(C(EW)(z),(ie,q)=>(w(),T(Pe,{key:C(IW)(ie,q)},[ie.kind==="thinking"?(w(),xe(yte,{key:0,text:ie.thinking,mobile:"",streaming:Ce(z,ie),onOpen:ee=>d("openThinking",{turnId:z.id,blockIndex:ie.sourceIndex})},null,8,["text","streaming","onOpen"])):ie.kind==="text"&&ie.text?(w(),T("div",Hoe,[re(zm,{text:ie.text,streaming:Ce(z,ie),"open-file":ee=>d("openFile",ee)},null,8,["text","streaming","open-file"])])):ie.kind==="tool-stack"?(w(),xe(DW,{key:2,tools:ie.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[1]||(le[1]=ee=>d("openMedia",ee)),onOpenFile:le[2]||(le[2]=ee=>d("openFile",ee)),onOpenToolDiff:le[3]||(le[3]=ee=>d("openToolDiff",ee)),onOpenAgent:le[4]||(le[4]=ee=>d("openAgent",ee))},null,8,["tools","tool-diff-panel"])):ie.kind==="tool"?(w(),xe(LA,{key:3,tool:ie.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[5]||(le[5]=ee=>d("openMedia",ee)),onOpenFile:le[6]||(le[6]=ee=>d("openFile",ee)),onOpenToolDiff:le[7]||(le[7]=ee=>d("openToolDiff",ee)),onOpenAgent:le[8]||(le[8]=ee=>d("openAgent",ee))},null,8,["tool","tool-diff-panel"])):ce("",!0)],64))),128)),z.id!==c.value&&Z(ae)&&(U(ae).trim().length>0||z.durationMs!==void 0)?(w(),T("div",Woe,[re(Xt,{text:`${z.durationMs} ms`},{default:Ee(()=>[z.durationMs!==void 0?(w(),T("span",zoe,O(C(CW)(z.durationMs)),1)):ce("",!0)]),_:2},1032,["text"]),U(ae).trim().length>0?(w(),T("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:ie=>V(ae)},[I.value!==z.id?(w(),xe(Ve,{key:0,name:"copy",size:"sm"})):(w(),xe(Ve,{key:1,name:"check",size:"sm"}))],8,Uoe)):ce("",!0)])):ce("",!0)],8,Poe))],64))),128)),e.compaction?(w(),xe(_te,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):ce("",!0),u.value?(w(),T("div",qoe,[re(M5,{fast:e.fastMoon},null,8,["fast"])])):ce("",!0),e.queued.length>0?(w(),T("div",joe,[_("div",Voe,[_("span",Koe,[re(Ve,{name:"mail",size:"sm"}),Je(" "+O(C(o)("composer.queueLabel"))+" · ",1),_("b",null,O(e.queued.length),1)]),_("span",Goe,O(C(o)("composer.queueAutoDrain")),1)]),(w(!0),T(Pe,null,ot(e.queued,(z,ae)=>(w(),T("div",{key:ae,class:We(["u-turn q-turn",{"q-dragging":f.value===ae,"drop-before":h.value?.index===ae&&h.value.position==="before","drop-after":h.value?.index===ae&&h.value.position==="after"}]),onDragover:ie=>v(ae,ie),onDrop:ie=>m(ae,ie)},[_("div",Zoe,[_("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:ie=>b(ae,ie),onDragend:y},[re(Ve,{name:"grip",size:"sm"})],40,Qoe),_("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:ie=>g(ae)},[z.text?(w(),T("span",Joe,O(z.text),1)):(w(),T("span",ese,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(C(o)("composer.queuedAttachments",{n:z.attachments?.length??0})),1)]))],8,Xoe),p(z)?(w(),T("div",tse,[(w(!0),T(Pe,null,ot(z.attachments,(ie,q)=>(w(),T(Pe,{key:q},[ie.kind==="file"?(w(),T("span",nse,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(ie.name??ie.fileId),1)])):(w(),xe(C5,{key:1,url:ie.url,kind:ie.kind,"file-id":ie.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ce("",!0),ae===0?(w(),T("span",ose,O(C(o)("composer.queueNext")),1)):(w(),T("span",sse,"#"+O(ae+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:bt(ie=>d("unqueue",ae),["stop"])},[re(Ve,{name:"close",size:"sm"})],8,ise)])],42,Yoe))),128))])):ce("",!0)]),ne.value!==null?(w(),T("div",rse,O(C(o)("composer.attachmentOpenUnsupported",{name:ne.value})),1)):ce("",!0)],64))}}),T5=ct(ase,[["__scopeId","data-v-7c31d582"]]),cse={class:"ch-id"},use={key:0,class:"ch-ws"},dse={key:1,class:"ch-sep"},fse=["onKeydown"],hse={class:"ch-ses"},pse={key:0,class:"ch-pill ch-sync-pill"},mse={key:0,class:"ch-ahead"},gse={key:1,class:"ch-behind"},vse={key:1,class:"ch-pill ch-diff-pill"},yse={key:0,class:"ch-add"},kse={key:1,class:"ch-del"},bse=Ze({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=R(()=>o.ahead??0),r=R(()=>o.behind??0),l=R(()=>o.gitDiffStats?.totalAdditions??0),a=R(()=>o.gitDiffStats?.totalDeletions??0),c=R(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function f(Z){const K=d(Z);return u[K]?`pr-${K}`:"pr-unknown"}function h(Z){return n(u[d(Z)]??"header.prStatusUnknown")}const p=X(!1),g=X(null),b=X(null),v=X({});function m(Z){const K=Z.target;b.value?.el?.contains(K)||g.value?.el?.contains(K)||A()}function y(){A()}async function k(Z){if(Z.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",y),await mt();const K=g.value?.el,V=b.value?.el;if(!K||!V)return;const J=K.getBoundingClientRect(),he=4,ne=8,ue=V.offsetWidth,de=V.offsetHeight;let Ce=J.bottom+he;Ce+de>window.innerHeight-ne&&(Ce=Math.max(ne,J.top-de-he));let Ie=J.left;Ie+ue>window.innerWidth-ne&&(Ie=Math.max(ne,J.right-ue)),v.value={top:`${Math.round(Ce)}px`,left:`${Math.round(Ie)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)}bn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)});function $(){s("copyAll"),A()}function I(){s("copyFinalSummary"),A()}const x=X(!1);function L(){o.sessionId&&Go(o.sessionId).then(Z=>{Z&&(x.value=!0,setTimeout(()=>{x.value=!1},1200))})}const E=X(!1),F=X(""),S=X(null);async function N(){if(A(),!!o.sessionId){E.value=!0,F.value=o.sessionTitle??"",await mt();try{S.value?.focus(),S.value?.select()}catch{}}}function D(){const Z=F.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),E.value=!1}function B(){E.value=!1}function U(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function H(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function P(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(Z,K)=>(w(),T("header",{class:We(["chat-header",{"macos-desktop":C(Bc)}])},[_("div",cse,[e.workspaceName?(w(),T("span",use,O(e.workspaceName),1)):ce("",!0),e.workspaceName&&e.sessionTitle?(w(),T("span",dse,"/")):ce("",!0),E.value?$n((w(),T("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":K[0]||(K[0]=V=>F.value=V),class:"ch-rename",type:"text",onKeydown:[nr(bt(D,["stop"]),["enter"]),nr(bt(B,["stop"]),["esc"])],onBlur:D,onClick:K[1]||(K[1]=bt(()=>{},["stop"]))},null,40,fse)),[[_s,F.value]]):e.sessionTitle?(w(),xe(Xt,{key:3,text:e.sessionTitle},{default:Ee(()=>[_("span",hse,O(e.sessionTitle),1)]),_:1},8,["text"])):ce("",!0)]),re(Dn,{ref_key:"kebabRef",ref:g,class:We(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:K[2]||(K[2]=bt(V=>k(V),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(w(),xe(kl,{key:0,ref_key:"menuRef",ref:b,class:"ch-menu",style:Yt(v.value),onClick:K[3]||(K[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:$},{default:Ee(()=>[re(Ve,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),re(pn,{onClick:I},{default:Ee(()=>[re(Ve,{name:"file-text",size:"sm"}),Je(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),T(Pe,{key:0},[re(pn,{separator:""}),re(pn,{onClick:L},{default:Ee(()=>[re(Ve,{name:x.value?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(x.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),re(pn,{onClick:N},{default:Ee(()=>[re(Ve,{name:"pencil",size:"sm"}),Je(" "+O(C(n)("header.renameSession")),1)]),_:1}),re(pn,{onClick:U},{default:Ee(()=>[re(Ve,{name:"git-fork",size:"sm"}),Je(" "+O(C(n)("header.forkSession")),1)]),_:1}),re(pn,{onClick:H},{default:Ee(()=>[re(Ve,{name:"download",size:"sm"}),Je(" "+O(C(n)("header.exportSession")),1)]),_:1}),re(pn,{danger:"",onClick:P},{default:Ee(()=>[re(Ve,{name:"archive",size:"sm"}),Je(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):ce("",!0)]),_:1},8,["style"])):ce("",!0),K[6]||(K[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),T("button",{key:1,type:"button",class:"ch-git",onClick:K[4]||(K[4]=V=>s("openChanges"))},[_("span",{class:We(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(w(),T("span",pse,[i.value>0?(w(),T("span",mse,"↑"+O(i.value),1)):ce("",!0),r.value>0?(w(),T("span",gse,"↓"+O(r.value),1)):ce("",!0)])):ce("",!0),c.value?(w(),T("span",vse,[l.value>0?(w(),T("span",yse,"+"+O(l.value),1)):ce("",!0),a.value>0?(w(),T("span",kse,"-"+O(a.value),1)):ce("",!0)])):ce("",!0)])):ce("",!0),e.pr?(w(),T("button",{key:2,type:"button",class:We(["ch-pill ch-pr",f(e.pr.state)]),onClick:K[5]||(K[5]=V=>e.pr&&s("openPr",e.pr.url))},[re(Ve,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+O(e.pr.number)+" · "+O(h(e.pr.state)),1)],2)):ce("",!0)],2))}}),xse=ct(bse,[["__scopeId","data-v-fa4451d4"]]),wse=["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"],OC=[[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 _se(e){if(e<=255)return wse[e];let t=0,n=OC.length-1;for(;t<=n;){const o=t+n>>1,s=OC[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function Sse(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=_se(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!o)return null;let s=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){s=0;break}if(u==="R"||u==="AL"){s=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=s;const r=s&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let g=c;g<u;g++)n[g]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function Cse(e,t){const n=Sse(e);if(n===null)return null;const o=new Int8Array(t.length);for(let s=0;s<t.length;s++)o[s]=n[t[s]];return o}const Ase=/[ \t\n\r\f]+/g,Mse=/[\t\n\r\f]| {2,}|^ | $/;function Ese(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Tse(e){if(!Mse.test(e))return e;let t=e.replace(Ase," ");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 Nse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
294
|
+
`).replace(/[\r\f]/g,`
|
|
295
|
+
`):e}let mg=null,Ise;function Lse(){return mg===null&&(mg=new Intl.Segmenter(Ise,{granularity:"word"})),mg}const $se=/\p{Script=Arabic}/u,zl=/\p{M}/u,Dk=/\p{Nd}/u;function RC(e){return $se.test(e)}function BC(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 rr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){const s=(n-55296<<10)+(o-56320)+65536;if(BC(s))return!0;t++;continue}}if(BC(n))return!0}}return!1}function Fse(e){const t=of(e);return t!==null&&(Pk.has(t)||Ia.has(t))}const Ose=new Set([" "," ","","\uFEFF"]),Rse=new Set(["-","‐","–","—"]);function Bse(e){const t=of(e);return t!==null&&Ose.has(t)}function Dse(e){const t=of(e);return t!==null&&Rse.has(t)}function N5(e,t){return Bse(e)?!1:t?!(Fse(e)||Dse(e)):!0}const Pk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Um=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Hk=new Set(["'","’"]),Ia=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Pse=new Set([":",".","،","؛"]),Hse=new Set(["၏"]),Wse=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function zse(e){if(Wk(e))return!0;let t=!1;for(const n of e){if(Ia.has(n)||jm(n)){t=!0;continue}if(!(t&&zl.test(n)))return!1}return t}function Use(e){for(const t of e)if(!Pk.has(t)&&!Ia.has(t))return!1;return e.length>0}function qse(e){if(Wk(e))return!0;for(const t of e)if(!Um.has(t)&&!Hk.has(t)&&!zl.test(t)&&!jm(t))return!1;return e.length>0}function Wk(e){let t=!1;for(const n of e)if(!(n==="\\"||zl.test(n))){if(Um.has(n)||Ia.has(n)||Hk.has(n)){t=!0;continue}return!1}return t}function qm(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function of(e){if(e.length===0)return null;const t=qm(e,e.length);return e.slice(t)}function jse(e){for(const t of e)if(!zl.test(t))return t;return null}function Vse(e){for(let t=e.length;t>0;){const n=qm(e,t),o=e.slice(n,t);if(!zl.test(o))return o;t=n}return null}const Kse=[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 Gse(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function jm(e){const t=e.codePointAt(0);return t!==void 0&&Gse(t,Kse)}function Yse(e){const t=Vse(e);return t!==null&&jm(t)}function Zse(e){const t=jse(e);return t!==null&&Dk.test(t)}function Qse(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(zl.test(o)){n--;continue}if(Um.has(o)||Hk.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Xse(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function DC(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function PC(e,t){return e&&t!==null&&Pse.has(t)}function Jse(e){const t=of(e);return t!==null&&Hse.has(t)}function eie(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 Gv(e){let t=e.length;for(;t>0;){const n=qm(e,t),o=e.slice(n,t);if(Wse.has(o))return!0;if(!Ia.has(o))return!1;t=n}return!1}function tie(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
296
|
+
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const nie=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Bi(e){return e.length===1?e[0]:e.join("")}function oie(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Bi(n)}function sie(e,t,n,o){if(!nie.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=tie(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:Bi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:Bi(r),isWordLike:a,kind:i,start:l}),s}function Yv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const iie=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function rie(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:iie.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function lie(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function aie(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let r=0;r<e.len;r++){if(o[r]!=="text"||!rie(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!Yv(o[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(o[a]="text",t[a]="",a++,c)break}t[r]=Bi(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],o[i]=o[r],s[i]=s[r]),i++)}return t.length=i,n.length=i,o.length=i,s.length=i,{len:i,texts:t,isWordLike:n,kinds:o,starts:s}}function cie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i]),!lie(r))continue;const l=i+1;if(l>=e.len||Yv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!Yv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Bi(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const uie=new Set([":","-","/","×",",",".","+","–","—"]),die=/[\p{P}\p{S}\p{Co}]/u,fie=/\p{Emoji_Presentation}/u,hie=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function pie(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function I5(e){const t=e.charCodeAt(0);return t<128?pie(t):!hie.has(e)&&!fie.test(e)&&die.test(e)}function HC(e){let t=!1;for(const n of e)if(!zl.test(n)){if(!I5(n))return!1;t=!0}return t}function mie(e){for(let t=e.length;t>0;){const n=qm(e,t),o=e.slice(n,t);if(zl.test(o)){t=n;continue}return I5(o)||jm(o)}return!1}function gie(e,t,n,o){const s=!t&&HC(e),i=!o&&HC(n),r=Yse(e),l=(t||r)&&mie(e);return!s&&!i&&!l||rr(e)||rr(n)?!1:(t||s||r)&&(o||i)}function L5(e){for(const t of e)if(Dk.test(t))return!0;return!1}function Bp(e){if(e.length===0)return!1;for(const t of e)if(!(Dk.test(t)||uie.has(t)))return!1;return!0}function vie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Bp(r)&&L5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Bp(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Bi(a)),n.push(!0),o.push("text"),s.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),o.push(l),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function yie(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&gie(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(Bi(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function kie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!L5(u)||!Bp(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),o.push("text"),s.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function bie(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=Bi(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),o.push("glue"),s.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=Bi(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(Bi(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function xie(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let i=0;i<t.length-1;i++){if(o[i]!=="text"||o[i+1]!=="text"||!rr(t[i])||!rr(t[i+1]))continue;const r=Qse(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],s[i+1]=s[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function wie(e,t,n){const o=Lse();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[];for(const $ of o.segment(e))for(const I of sie($.segment,$.isWordLike??!1,$.index,n)){let U=function(){u[B]!==null&&(r[B]=[DC(i,u,d,B)],u[B]=null),r[B].push(I.text),l[B]=l[B]||I.isWordLike,f[B]=f[B]||E,h[B]=h[B]||F,p[B]=N,g[B]=D,b[B]=PC(h[B],S)};const x=I.kind==="text",L=Xse(I.text,I.isWordLike,I.kind),E=rr(I.text),F=RC(I.text),S=of(I.text),N=Gv(I.text),D=Jse(I.text),B=s-1;t.carryCJKAfterClosingQuote&&x&&s>0&&a[B]==="text"&&E&&f[B]&&p[B]||x&&s>0&&a[B]==="text"&&Use(I.text)&&f[B]||x&&s>0&&a[B]==="text"&&g[B]?U():x&&s>0&&a[B]==="text"&&I.isWordLike&&F&&b[B]?(U(),l[B]=!0):L!==null&&s>0&&a[B]==="text"&&u[B]===L?d[B]=(d[B]??1)+1:x&&!I.isWordLike&&s>0&&a[B]==="text"&&!f[B]&&(zse(I.text)||I.text==="-"&&l[B])?U():(i[s]=I.text,r[s]=[I.text],l[s]=I.isWordLike,a[s]=I.kind,c[s]=I.start,u[s]=L,d[s]=L===null?0:1,f[s]=E,h[s]=F,p[s]=N,g[s]=D,b[s]=PC(F,S),s++)}for(let $=0;$<s;$++){if(u[$]!==null){i[$]=DC(i,u,d,$);continue}i[$]=Bi(r[$])}for(let $=1;$<s;$++)a[$]==="text"&&!l[$]&&Wk(i[$])&&a[$-1]==="text"&&!f[$-1]&&(i[$-1]+=i[$],l[$-1]=l[$-1]||l[$],i[$]="");const v=Array.from({length:s},()=>null);let m=-1;for(let $=s-1;$>=0;$--){const I=i[$];if(I.length!==0){if(a[$]==="text"&&!l[$]&&m>=0&&a[m]==="text"&&(qse(I)||I==="-"&&Zse(i[m]))){const x=v[m]??[];x.push(I),v[m]=x,c[m]=c[$],i[$]="";continue}m=$}}for(let $=0;$<s;$++){const I=v[$];I!=null&&(i[$]=oie(I,i[$]))}let y=0;for(let $=0;$<s;$++){const I=i[$];I.length!==0&&(y!==$&&(i[y]=I,l[y]=l[$],a[y]=a[$],c[y]=c[$]),y++)}i.length=y,l.length=y,a.length=y,c.length=y;const k=bie({len:y,texts:i,isWordLike:l,kinds:a,starts:c}),A=xie(yie(kie(vie(cie(aie(k))))));for(let $=0;$<A.len-1;$++){const I=eie(A.texts[$]);I!==null&&(A.kinds[$]!=="space"&&A.kinds[$]!=="preserved-space"||A.kinds[$+1]!=="text"||!RC(A.texts[$+1])||(A.texts[$]=I.space,A.isWordLike[$]=!1,A.kinds[$]=A.kinds[$]==="preserved-space"?"preserved-space":"space",A.texts[$+1]=I.marks+A.texts[$+1],A.starts[$+1]=A.starts[$]+I.space.length))}return A}function _ie(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Sie(e,t,n){if(t.len<=1)return t;const o=[],s=[],i=[],r=[];let l=-1,a=!1;function c(f){o.push(t.texts[f]),s.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let v=f;v<h;v++)p=p||t.isWordLike[v];const g=t.starts[f],b=h<t.len?t.starts[h]:e.length;o.push(e.slice(g,b)),s.push(p),i.push("text"),r.push(g)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!N5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||rr(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function Cie(e,t,n="normal",o="normal"){const s=Ese(n),i=s.mode==="pre-wrap"?Nse(e):Tse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=wie(i,t,s),l=o==="keep-all"?Sie(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:_ie(l,s),...l}}let dc=null;const WC=new Map;let fc=null;const Aie=96,Mie=/\p{Emoji_Presentation}/u,Eie=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let gg=null;const zC=new Map;function zk(){if(dc!==null)return dc;if(typeof OffscreenCanvas<"u")return dc=new OffscreenCanvas(1,1).getContext("2d"),dc;if(typeof document<"u")return dc=document.createElement("canvas").getContext("2d"),dc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Tie(e){let t=WC.get(e);return t||(t=new Map,WC.set(e,t)),t}function wl(e,t){let n=t.get(e);return n===void 0&&(n={width:zk().measureText(e).width,containsCJK:rr(e)},t.set(e,n)),n}function Vm(){if(fc!==null)return fc;if(typeof navigator>"u")return fc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},fc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return fc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},fc}function Nie(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function $5(){return gg===null&&(gg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),gg}function Iie(e){return Mie.test(e)||e.includes("️")}function Lie(e){return Eie.test(e)}function $ie(e,t){let n=zC.get(e);if(n!==void 0)return n;const o=zk();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return zC.set(e,n),n}function Fie(e){let t=0;const n=$5();for(const o of n.segment(e))Iie(o.segment)&&t++;return t}function Oie(e,t){return t.emojiCount===void 0&&(t.emojiCount=Fie(e)),t.emojiCount}function ba(e,t,n){return n===0?t.width:t.width-Oie(e,t)*n}function Rie(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=$5(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=wl(d,n);u.push(ba(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>Aie){const u=[];let d=null,f=0;for(const h of r){const p=wl(h,n),g=ba(h,p,o);if(d===null)u.push(g);else{const b=d+h,v=wl(b,n);u.push(ba(b,v,o)-f)}d=h,f=g}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=wl(a,n),f=ba(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Bie(e,t){const n=zk();n.font=e;const o=Tie(e),s=Nie(e),i=t?$ie(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function Die(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function F5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function O5(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!Die(o))break;t++}return t}function Pie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Hie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Uk(e,t){return t===0?0:e+t}function Wie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function zie(e,t,n,o,s){const i=t==="tab"?s+Wie(e,n):e.lineEndFitAdvances[n];return Uk(o,i)}function UC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return Uk(o,s)}function qC(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return Uk(o,i)}function Uie(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function qie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Dp(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function jie(e,t,n,o,s){if(e.letterSpacing===0)return 0;if(s>0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Vie(e,t,n,o,s,i){return t+jie(e,n,o,s,i)}function Kie(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=Vm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,g=0,b=0,v=-1,m=0;function y(){v=-1,m=0}function k(E=g,F=b,S=d){u++,n?.(S,h,p,E,F),d=0,f=!1,y()}function A(E,F){f=!0,h=E,p=0,g=E+1,b=0,d=F}function $(E,F,S){f=!0,h=E,p=F,g=E,b=F+1,d=S}function I(E,F){if(!f){A(E,F);return}d+=F,g=E+1,b=0}function x(E,F){const S=i[E],N=r[E]??null;let D=N===null?-1:Dp(N,0,F+1),B=-1,U=0,H=F;for(;H<S.length;){const P=S[H];if(!f)$(E,H,P);else if(d+P>c){if(N!==null&&B>F){k(E,B,U),H=B,D=Dp(N,D,H+1),B=-1,U=0;continue}k(),$(E,H,P)}else d+=P,g=E,b=H+1;const Z=H+1;N!==null&&N[D]===Z&&(B=Z,U=d,D++),H++}f&&g===E&&b===S.length&&(g=E+1,b=0)}let L=0;for(;L<o.length&&!(!f&&(L=O5(e,L),L>=o.length));){const E=o[L],F=s[L],S=F5(F);if(!f){E>c&&i[L]!==null?x(L,0):A(L,E),S&&(v=L+1,m=d-E),L++;continue}if(d+E>c){if(S){I(L,E),k(L+1,0,d-E),L++;continue}if(v>=0){if(g>v||g===v&&b>0){k();continue}k(v,0,m);continue}if(E>c&&i[L]!==null){k(),x(L,0),L++;continue}k();continue}I(L,E),S&&(v=L+1,m=d-E),L++}return f&&k(),u}function Gie(e,t,n){if(e.simpleLineWalkFastPath)return Kie(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=Vm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,g=0,b=0,v=0,m=0,y=-1,k=0,A=0,$=null;function I(){y=-1,k=0,A=0,$=null}function x(){return $==="soft-hyphen"&&y===v&&m===0?A:h}function L(U=v,H=m,P){f++,n!==void 0&&n(Vie(e,P??x(),g,b,U,H),g,b,U,H),h=0,p=!1,I()}function E(U,H){p=!0,g=U,b=0,v=U+1,m=0,h=H}function F(U,H,P){p=!0,g=U,b=H,v=U,m=H+1,h=P}function S(U,H){if(!p){E(U,H);return}h+=H,v=U+1,m=0}function N(U,H,P,Z,K,V){if(!H)return;const J=UC(e,U,P,K),he=qC(e,U,P,K,Z);y=P+1,k=h-V+J,A=h-V+he,$=U}function D(U,H){const P=i[U],Z=r[U]??null;let K=Z===null?-1:Dp(Z,0,H+1),V=-1,J=0,he=H;for(;he<P.length;){const ne=P[he];if(!p)F(U,he,ne);else{const de=Uie(e,!0,ne),Ce=h+de;if(qie(e,Ce)>d){if(Z!==null&&V>H){L(U,V,J),he=V,K=Dp(Z,K,he+1),V=-1,J=0;continue}L(),F(U,he,ne)}else h=Ce,v=U,m=he+1}const ue=he+1;Z!==null&&Z[K]===ue&&(V=ue,J=h,K++),he++}p&&v===U&&m===P.length&&(v=U+1,m=0)}function B(U){f++,n?.(0,U.startSegmentIndex,0,U.consumedEndSegmentIndex,0),I()}for(let U=0;U<a.length;U++){const H=a[U];if(H.startSegmentIndex===H.endSegmentIndex){B(H);continue}p=!1,h=0,g=H.startSegmentIndex,b=0,v=H.startSegmentIndex,m=0,I();let P=H.startSegmentIndex;for(;P<H.endSegmentIndex&&!(!p&&(P=O5(e,P,H.endSegmentIndex),P>=H.endSegmentIndex));){const Z=s[P],K=F5(Z),V=Hie(e,p,P),J=Z==="tab"?Pie(h+V,e.tabStopAdvance):o[P],he=V+J,ne=zie(e,Z,P,V,J);if(Z==="soft-hyphen"){p&&(v=P+1,m=0,y=P+1,k=h+l,A=h+l,$=Z),P++;continue}if(!p){ne>d&&i[P]!==null?D(P,0):E(P,J),N(Z,K,P,J,V,he),P++;continue}if(h+ne>d){const de=h+UC(e,Z,P,V),Ce=h+qC(e,Z,P,V,J);if($==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&k<=d){L(y,0,A);continue}if(K&&de<=d){S(P,he),L(P+1,0,Ce),P++;continue}if(y>=0&&k<=d){if(v>y||v===y&&m>0){L();continue}const Ie=y;L(Ie,0,A),P=Ie;continue}if(ne>d&&i[P]!==null){L(),D(P,0),P++;continue}L();continue}S(P,he),N(Z,K,P,J,V,he),P++}if(p){const Z=y===H.consumedEndSegmentIndex?A:h;L(H.consumedEndSegmentIndex,0,Z)}}return f}let vg=null;function qk(){return vg===null&&(vg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),vg}function Yie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function Zie(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Gv(d),l=Um.has(d)}function u(d,f){o.push(d),i=i||f;const h=Gv(d);d.length===1&&Ia.has(d)?r=r||h:r=h,l=!1}for(const d of qk().segment(e)){const f=d.segment,h=rr(f);if(o.length===0){c(f,d.index,h);continue}if(l||Pk.has(f)||Ia.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function Qie(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})}function l(a){if(!(s<0)){if(i)s+1===a?o.push(t[s]):r(s,a);else for(let c=s;c<a;c++)o.push(t[c]);s=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];s>=0&&!N5(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||rr(c.text)}return l(t.length),o}function jC(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=qk();for(const s of o.segment(e))n++;return n}function Xie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Jie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of qk().segment(e))n++,Xie(o.segment)&&t.push(n);return t.length===0?null:t}function ere(e,t,n){return t>1?e+(t-1)*n:e}function tre(e,t,n,o,s){const i=Vm(),{cache:r,emojiCorrection:l}=Bie(t,Lie(e.normalized)),a=ba("-",wl("-",r),l)+(s===0?0:s*2),u=ba(" ",wl(" ",r),l)*8,d=s!==0;if(e.len===0)return Yie();const f=[],h=[],p=[],g=[];let b=e.chunks.length<=1&&!d;const v=n?[]:null,m=[],y=[],k=[],A=n?[]:null,$=Array.from({length:e.len});function I(F,S,N,D,B,U,H,P,Z){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(b=!1),f.push(S),h.push(N),p.push(D),g.push(B),v?.push(U),m.push(H),y.push(P),d&&k.push(Z),A!==null&&A.push(F)}function x(F,S,N,D,B){const U=wl(F,r),H=d?jC(F,S):0,P=ere(ba(F,U,l),H,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:P,K=Z===0?0:Z+(H>0?s:0),V=S==="space"||S==="zero-width-break"?0:P;if(B&&D&&F.length>1){let J="sum-graphemes";s!==0?J="segment-prefixes":Bp(F)?J="pair-context":i.preferPrefixWidthsForBreakableRuns&&(J="segment-prefixes");const he=Rie(F,U,r,l,J),ne=he===null||o==="keep-all"?null:Jie(F);I(F,P,K,V,S,N,he,ne,H);return}I(F,P,K,V,S,N,null,null,H)}for(let F=0;F<e.len;F++){$[F]=f.length;const S=e.texts[F],N=e.isWordLike[F],D=e.kinds[F],B=e.starts[F];if(D==="soft-hyphen"){I(S,0,a,a,D,B,null,null,0);continue}if(D==="hard-break"){I(S,0,0,0,D,B,null,null,0);continue}if(D==="tab"){I(S,0,0,0,D,B,null,null,d?jC(S,D):0);continue}const U=wl(S,r);if(D==="text"&&U.containsCJK){const H=Zie(S,i),P=o==="keep-all"?Qie(S,H,i.breakKeepAllAfterPunctuation):H;for(let Z=0;Z<P.length;Z++){const K=P[Z];x(K.text,"text",B+K.start,N,o==="keep-all"||!rr(K.text))}continue}x(S,D,B,N,!0)}const L=nre(e.chunks,$,f.length),E=v===null?null:Cse(e.normalized,v);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:L,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:L}}function nre(e,t,n){const o=[];for(let s=0;s<e.length;s++){const i=e[s],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;o.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return o}function ore(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=Cie(e,Vm(),o?.whiteSpace,s);return tre(r,t,n,s,i)}function sre(e,t,n){return ore(e,t,!0,n)}function ire(e){let t=0;return Gie(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const rre={key:0,class:"slash-menu",role:"listbox"},lre=["aria-selected","onMouseenter","onMousedown"],are={class:"slash-name"},cre={class:"slash-desc"},ure=Ze({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X([]);return Qe(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),T("div",rre,[(w(!0),T(Pe,null,ot(e.items,(a,c)=>(w(),T("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:We(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:bt(u=>s("select",a),["prevent"])},[_("span",are,O(a.name),1),_("span",cre,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,lre))),128))])):ce("",!0)}}),dre=ct(ure,[["__scopeId","data-v-f60b70d9"]]),fre={class:"mention-menu",role:"listbox"},hre={key:0,class:"mention-state dim"},pre={key:1,class:"mention-state dim"},mre=["aria-selected","onMouseenter","onMousedown"],gre=["innerHTML"],vre={class:"mention-name"},yre={class:"mention-path"},kre=Ze({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=vc("folder","sm"),r=vc("code","sm"),l=vc("file-text","sm"),a=vc("image","sm"),c=vc("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const g=p.path;if(g.endsWith("/"))return i;const b=p.name||g.split("/").pop()||g,v=b.lastIndexOf("."),m=v>0?b.slice(v+1).toLowerCase():"";return m?u.has(m)?r:d.has(m)?l:f.has(m)?a:c:c}return(p,g)=>(w(),T("div",fre,[n.loading?(w(),T("div",hre,O(C(s)("mention.searching")),1)):n.items.length===0?(w(),T("div",pre,O(C(s)("mention.noMatch")),1)):(w(!0),T(Pe,{key:2},ot(n.items,(b,v)=>(w(),T("div",{key:b.path,class:We(["mention-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:m=>o("hover",v),onMousedown:bt(m=>o("select",b),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,gre),_("span",vre,O(b.name),1),_("span",yre,O(b.path),1)],42,mre))),128))]))}}),bre=ct(kre,[["__scopeId","data-v-f4d6b958"]]),R5=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function xre(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Pp="skill:";function wre(e){return e.startsWith(Pp)?e.slice(Pp.length):e}function B5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Pp}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...R5,...t]}function _re(e,t=R5){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function Km(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function D5(e){return e?.supportEfforts??[]}function Sre(e){return e[Math.floor(e.length/2)]}function Gm(e){if(Km(e)==="unsupported")return"off";const t=D5(e);return t.length>0?e?.defaultEffort??Sre(t):"on"}function Ym(e){const t=D5(e),n=Km(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Zv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Cre(e){return e!=="off"}function P5(e,t){return Ym(e).includes(t)}function jk(e,t){return t==="off"?"off":t==="on"?Gm(e):t}function Hp(e,t){return t??Gm(e)}function Are(e){return e==="off"?{enabled:!1}:e==="on"?{enabled:!0}:{enabled:!0,effort:e}}function Mre(e,t,n,o){return!n||e===void 0?t:o!==void 0&&P5(e,o)?o:Gm(e)}const Wp=100;function Ere(e){const t=Yd(Ft.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Wp?n.slice(-Wp):n,s={[e]:o};return lu(Ft.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Tre(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=X(Ere(s())),r=R(()=>i.value[s()??""]??[]);let l=-1,a="";function c(v){const m=s();if(l=-1,!m)return;const y=v.trim();if(!y)return;const k=i.value[m]??[];if(k.at(-1)===y)return;const A=[...k,y],$=A.length>Wp?A.slice(-Wp):A;i.value={...i.value,[m]:$},lu(Ft.inputHistory,i.value)}function u(){const v=n.value;return v?(v.selectionStart??0)===0:!1}function d(v){t.value=v,mt(()=>{const m=n.value;if(!m)return;o();const y=v.length;m.setSelectionRange(y,y)})}function f(){const v=r.value;if(v.length!==0){if(l===-1)a=t.value,l=v.length-1;else if(l>0)l-=1;else return;d(v[l])}}function h(){if(l===-1)return;const v=r.value;l<v.length-1?(l+=1,d(v[l])):(l=-1,d(a))}function p(){l=-1}function g(){return l!==-1}function b(){return r.value.length>0}return Qe(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:g,hasHistory:b}}function Nre(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=X(!1),c=X([]),u=X(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=_re(h,B5(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,mt(()=>{const p=n.value;if(!p)return;const g=t.value.length;p.setSelectionRange(g,g),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function Ire(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=X(!1),r=X([]),l=X(0),a=X(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let g=p-1;for(;g>=0&&!/\s/.test(h[g]);)g--;g++;const b=h.slice(g,p);return b.startsWith("@")?{token:b.slice(1),start:g,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const g=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const g=t.value;t.value=g.slice(0,p.start)+h.path+g.slice(p.end),i.value=!1,mt(()=>{const b=n.value;if(!b)return;const v=p.start+h.path.length;b.setSelectionRange(v,v),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Lre(e){const{sessionId:t}=e;function n(c){return ao(nw(c))??""}function o(c,u){const d=nw(c);u?So(d,u):Xc(d)}const s=X(n(t())),i=X(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Qe(s,c=>{mt(r),o(t(),c)}),Qe(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),mt(r))});function l(c){s.value=c,mt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function $re(e){const{uploadImage:t,sessionId:n}=e,o=X({}),s=R(()=>o.value[n()??""]??[]),i=X(null),r=X(null),l=X(!1);let a=0;function c(){return`att_${++a}`}function u(H,P){o.value={...o.value,[H]:P}}function d(H){if(H.previewUrl!==void 0)try{URL.revokeObjectURL(H.previewUrl)}catch{}}function f(H){return H.startsWith("image/")?"image":H.startsWith("video/")?"video":"file"}async function h(H){const P=t();if(!P)return;const Z=n()??"";if(H.length!==0)for(const K of H){const V=f(K.type),J=c(),he=V==="file"?void 0:URL.createObjectURL(K),ne={localId:J,name:K.name,kind:V,previewUrl:he,mediaType:K.type||"application/octet-stream",size:K.size,uploading:!0};u(Z,[...o.value[Z]??[],ne]),P(K,K.name).then(ue=>{const de=o.value[Z]??[];u(Z,de.map(Ce=>Ce.localId===J?{...Ce,uploading:!1,fileId:ue?.fileId,mediaType:ue?.mediaType??Ce.mediaType,error:ue===null}:Ce))}).catch(()=>{const ue=o.value[Z]??[];u(Z,ue.map(de=>de.localId===J?{...de,uploading:!1,error:!0}:de))})}}function p(H){const P=n()??"",Z=o.value[P]??[],K=Z.find(V=>V.localId===H);i.value?.localId===H&&(i.value=null),K&&d(K),u(P,Z.filter(V=>V.localId!==H))}function g(H){i.value=H}function b(){i.value=null}function v(){r.value?.click()}function m(H){const P=H.target,Z=Array.from(P.files??[]);h(Z),P.value=""}function y(H){if(!t())return;const P=H.clipboardData;if(!P)return;const Z=[],K=new Set,V=(J,he)=>{const ne=`${J.size}:${J.type}:${he}`;if(K.has(ne))return;K.add(ne);const ue=J.type.split("/")[1]??"png",de=he.includes(".")?he:`paste-${Date.now()}.${ue}`;Z.push(J instanceof File?J:new File([J],de,{type:J.type}))};for(const J of Array.from(P.items))if(J.kind==="file"){const he=J.getAsFile();he&&V(he,he.name||`paste-${Date.now()}.${J.type.split("/")[1]??"png"}`)}for(const J of Array.from(P.files))V(J,J.name);Z.length!==0&&(H.preventDefault(),h(Z))}let k=0;function A(H){!t()||!Array.from(H.dataTransfer?.items??[]).some(Z=>Z.kind==="file")||(H.preventDefault(),H.stopPropagation(),l.value=!0)}function $(){l.value=!1}function I(H){if(k=0,l.value=!1,!t())return;H.preventDefault(),H.stopPropagation();const P=Array.from(H.dataTransfer?.files??[]);h(P)}function x(H){return Array.from(H.dataTransfer?.items??[]).some(P=>P.kind==="file")}function L(H){!t()||!x(H)||(H.preventDefault(),k+=1,l.value=!0)}function E(H){!t()||!x(H)||H.preventDefault()}function F(H){!t()||!x(H)||(k=Math.max(0,k-1),k===0&&(l.value=!1))}function S(H){if(k=0,l.value=!1,!t())return;H.preventDefault();const P=Array.from(H.dataTransfer?.files??[]);h(P)}function N(){const H=n()??"";for(const P of o.value[H]??[])d(P);u(H,[])}function D(H,P,Z){const K=o.value[H]??[];K.some(V=>V.localId===P)&&u(H,K.map(V=>V.localId===P?{...V,...Z}:V))}function B(H){return fetch(H).then(P=>{if(!P.ok)throw new Error(`fetch failed: ${P.status}`);return P.blob()})}function U(H){const P=n()??"";for(const Z of o.value[P]??[])d(Z);u(P,[]);for(const Z of H){const K=c(),V=/^data:/i.test(Z.url),J=/^blob:/i.test(Z.url),he=Z.name??Z.kind;if(Z.fileId){const ne={localId:K,name:he,kind:Z.kind,previewUrl:Z.kind==="file"?void 0:Z.url,uploading:!1,fileId:Z.fileId};u(P,[...o.value[P]??[],ne]),Z.kind!=="file"&&!V&&!J&&dt().getFileBlob(Z.fileId).then(ue=>{const de=URL.createObjectURL(ue);if(!(o.value[P]??[]).some(Ie=>Ie.localId===K)){URL.revokeObjectURL(de);return}D(P,K,{previewUrl:de})}).catch(()=>{})}else{if(!Z.url)continue;const ne=t();if(!ne)continue;const ue={localId:K,name:he,kind:Z.kind,previewUrl:Z.url,uploading:!0};u(P,[...o.value[P]??[],ue]),B(Z.url).then(de=>{const Ce=he.includes(".")?he:`${he}.${de.type.split("/")[1]??"bin"}`;return ne(de,Ce)}).then(de=>{if(de===null){const Ce=o.value[P]??[];u(P,Ce.filter(Ie=>Ie.localId!==K));return}D(P,K,{uploading:!1,fileId:de.fileId})}).catch(()=>{const de=o.value[P]??[];u(P,de.filter(Ce=>Ce.localId!==K))})}}}return Qe(n,()=>{i.value=null}),cn(()=>{document.addEventListener("paste",y),document.addEventListener("dragenter",L),document.addEventListener("dragover",E),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),bn(()=>{document.removeEventListener("paste",y),document.removeEventListener("dragenter",L),document.removeEventListener("dragover",E),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const H of Object.values(o.value))for(const P of H)d(P);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:g,closeAttachmentPreview:b,openFilePicker:v,handleFileInputChange:m,handleDragOver:A,handleDragLeave:$,handleDrop:I,clearAfterSubmit:N,loadAttachments:U}}const Fre=["type","disabled"],Ore={class:"ui-button__content"},Rre=Ze({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),T("button",{class:We(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(w(),xe(Ds,{key:0,size:"sm",class:"ui-button__spinner"})):ce("",!0),_("span",Ore,[Fn(t.$slots,"default",{},void 0,!0)])],10,Fre))}}),Rt=ct(Rre,[["__scopeId","data-v-e58393a8"]]),Bre={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Dre=["stroke-dasharray","stroke-dashoffset"],yg=7,Pre=Ze({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*yg;return(o,s)=>(w(),T("svg",Bre,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:yg,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:yg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Dre)]))}}),Hre=ct(Pre,[["__scopeId","data-v-a364f1f1"]]),Wre={key:0,class:"att-strip"},zre={class:"att-lightbox-card"},Ure=["src"],qre=["src","alt"],jre={class:"att-lightbox-name"},Vre={class:"composer-card"},Kre={class:"cin-wrap"},Gre={class:"input-row"},Yre=["placeholder","disabled"],Zre=["aria-label"],Qre={class:"toolbar-left"},Xre=["onKeydown"],Jre=["onClick"],ele={class:"pd-check"},tle={class:"pd-info"},nle={class:"pd-desc"},ole={class:"mode-label"},sle={key:0,class:"mode-tag"},ile={key:1,class:"mode-tag"},rle={key:2,class:"mode-tag"},lle={class:"mode-row-icon"},ale={class:"mode-row-info"},cle={class:"mode-row-name"},ule={class:"mode-row-desc"},dle={class:"mode-row-icon"},fle={class:"mode-row-info"},hle={class:"mode-row-name"},ple={class:"mode-row-desc"},mle={class:"mode-row-icon"},gle={class:"mode-row-info"},vle={class:"mode-row-name"},yle={class:"mode-row-desc"},kle={key:0,class:"mode-row-actions"},ble={class:"toolbar-right"},xle=["aria-label"],wle=["onKeydown"],_le={key:0,class:"think-suffix"},Sle=["aria-label"],Cle=["aria-label","disabled"],Ale={key:0,class:"md-section"},Mle=["onClick"],Ele={class:"md-check"},Tle={class:"md-name"},Nle={class:"md-provider"},Ile={key:1,class:"md-divider"},Lle={key:2,class:"md-section"},$le=["onClick"],Fle={class:"md-check"},Ole={class:"md-name"},Rle={key:3,class:"md-divider"},Ble={class:"md-name"},Dle={key:0,class:"md-note"},Ple=["aria-label"],Hle=["disabled","onClick"],Wle={class:"md-name"},zle={class:"drop-card"},VC=36,Ule=Ze({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=R(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Tt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Lre({sessionId:()=>o.sessionId}),h=X(!1);function p(){h.value=!h.value,mt(()=>{u(),m(),c.value?.focus()})}function g(){h.value&&(h.value=!1,mt(u))}function b(Ue){if(typeof getComputedStyle>"u")return VC;const Fe=Number.parseFloat(getComputedStyle(Ue).minHeight);return Number.isFinite(Fe)&&Fe>0?Fe:VC}const v=X(!1);function m(){const Ue=c.value;v.value=!!Ue&&Ue.scrollHeight>b(Ue)}Qe(a,()=>{mt(m)}),Qe(()=>o.sessionId,()=>{h.value=!1});const y=Tre({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:k,items:A,active:$,update:I,select:x}=Nre({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ue=>i("command",Ue),historyPush:Ue=>y.push(Ue),clearDraft:f}),{open:L,items:E,active:F,loading:S,update:N,select:D}=Ire({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function B(){y.resetBrowsing(),I(),N()}const{attachments:U,previewAttachment:H,fileInputRef:P,isDragOver:Z,removeAttachment:K,openAttachmentPreview:V,closeAttachmentPreview:J,openFilePicker:he,handleFileInputChange:ne,handleDragOver:ue,handleDragLeave:de,handleDrop:Ce,clearAfterSubmit:Ie,loadAttachments:le}=$re({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});cn(()=>{a.value&&mt(()=>{u(),m()})}),bn(()=>{document.removeEventListener("mousedown",Gt),j()});function z(){c.value?.focus({preventScroll:!0})}function ae(Ue){le(Ue)}t({loadForEdit:d,loadAttachmentsForEdit:ae,focus:z});function ie(Ue){return{fileId:Ue.fileId,kind:Ue.kind,name:Ue.name,mediaType:Ue.mediaType,size:Ue.size}}function q(Ue){if(Ue.kind==="file"){Ue.fileId!==void 0&&E5(Ue.fileId,Ue.name,Ue.mediaType);return}V(Ue)}function ee(){const Ue=a.value.trim();if(U.value.some(Te=>Te.uploading))return;const Fe=U.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ue&&Fe.length===0)return;if(y.push(Ue),Ue){const Te=xre(Ue),pe=Te?B5(o.skills).some(_e=>_e.name===Te.cmd||_e.name===`/${Pp}${Te.cmd.slice(1)}`):!1;if(Te&&pe){a.value="",f(),k.value=!1,g(),i("command",Te.arg?`${Te.cmd} ${Te.arg}`:Te.cmd);return}}const oe={text:Ue,attachments:Fe.map(Te=>ie(Te))};H.value=null,Ie(),a.value="",f(),k.value=!1,L.value=!1,g(),i("submit",oe)}function ye(){if(!o.running||U.value.some(Te=>Te.uploading))return;const Ue=a.value.trim(),Fe=U.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ue&&Fe.length===0&&o.queued.length===0)return;const oe={text:Ue,attachments:Fe.map(Te=>ie(Te))};Ie(),y.push(Ue),a.value="",f(),k.value=!1,L.value=!1,g(),i("steer",oe)}let fe=!1,ve=null;function j(){ve!==null&&(clearTimeout(ve),ve=null)}function te(){j(),fe=!0}function me(){j(),ve=setTimeout(()=>{ve=null,fe=!1},0)}function Ae(Ue){return fe||Ue.isComposing||Ue.keyCode===229}function $e(Ue){if(!Ae(Ue)){if(Ue.key==="Escape"){if(Ne.value){Ue.preventDefault(),gt();return}if(et.value){Ue.preventDefault(),Ut();return}}if(k.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),$.value=($.value+1)%A.value.length;return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),$.value=($.value-1+A.value.length)%A.value.length;return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=A.value[$.value];Fe&&x(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),k.value=!1;return}}if(L.value&&!S.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),F.value=(F.value+1)%Math.max(1,E.value.length);return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),F.value=(F.value-1+Math.max(1,E.value.length))%Math.max(1,E.value.length);return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=E.value[F.value];Fe&&D(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),L.value=!1;return}}if(Ue.key==="s"&&(Ue.ctrlKey||Ue.metaKey)&&!Ue.shiftKey&&!Ue.altKey){o.running&&(Ue.preventDefault(),ye());return}if(!h.value&&!k.value&&!L.value&&!Ue.shiftKey&&!Ue.altKey&&!Ue.metaKey&&!Ue.ctrlKey){const Fe=y.isBrowsing();if(Ue.key==="ArrowUp"&&y.hasHistory()&&(Fe||y.caretAtTextStart())){Ue.preventDefault(),y.recallOlder();return}if(Ue.key==="ArrowDown"&&Fe){Ue.preventDefault(),y.recallNewer();return}}if(Ue.key==="Enter"&&!Ue.shiftKey){if(h.value&&!(Ue.metaKey||Ue.ctrlKey))return;Ue.preventDefault(),ee()}}}const De=R(()=>r("composer.send")),ge=R(()=>!!o.uploadImage),Ne=X(!1),et=X(!1),rt=X(null);function St(){Ne.value=!Ne.value,Ne.value?(et.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function gt(){Ne.value=!1,et.value||document.removeEventListener("click",ht,!0)}function It(){et.value=!et.value,et.value?(Ne.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function Ut(){et.value=!1,Ne.value||document.removeEventListener("click",ht,!0)}function ht(Ue){rt.value&&!rt.value.contains(Ue.target)&&(gt(),Ut())}bn(()=>{document.removeEventListener("click",ht,!0)});const un=R(()=>{const Ue=o.status?.ctxMax??0;return Ue<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Ue*100)))}),dn=R(()=>{const Ue=ir(o.status?.ctxUsed??0),Fe=ir(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ue,max:Fe,pct:un.value})}),ns=R(()=>un.value>=80),Wt=R(()=>o.models?.find(Ue=>Ue.id===o.status?.modelId)),Pn=R(()=>Km(Wt.value)),co=R(()=>Ym(Wt.value)),it=R(()=>Hp(Wt.value,o.thinking)),Gn=R(()=>co.value.includes(it.value)?it.value:""),uo=R(()=>Cre(it.value)),Yn=R(()=>Pn.value==="unsupported"||co.value.length<=1),go=R(()=>{if(!uo.value)return"";const Ue=(Wt.value?.supportEfforts?.length??0)>0,Fe=it.value;return Ue&&Fe!=="on"?r("composer.thinkingSuffixEffort",{level:Fe}):r("composer.thinkingSuffix")});function os(Ue){Yn.value||i("setThinking",jk(Wt.value,Ue))}function Un(Ue){return Ue==="on"?r("status.thinkingOn"):Ue==="off"?r("status.thinkingOff"):Zv(Ue)}const to=R(()=>o.planMode===!0),vn=R(()=>o.swarmMode===!0),Zn=R(()=>o.goal?.status??o.activationBadges?.goal?.status??null),xn=R(()=>Zn.value!==null&&Zn.value!=="complete"),Cn=R(()=>xn.value||o.goalMode===!0),An=R(()=>Zn.value==="active"),Do=R(()=>Zn.value==="paused"||Zn.value==="blocked"),ze=X(!1),Xe=X(null),kt=X(null),Pt=X({}),On=R(()=>to.value||vn.value||Cn.value);function sn(){ze.value=!1,document.removeEventListener("mousedown",Gt)}function Gt(Ue){const Fe=Ue.target;Xe.value?.contains(Fe)||kt.value?.contains(Fe)||sn()}function Hn(){if(ze.value){sn();return}gt(),Ut();const Ue=Xe.value?.getBoundingClientRect();Ue&&(Pt.value={left:`${Math.round(Ue.left)}px`,bottom:`${Math.round(window.innerHeight-Ue.top+8)}px`}),ze.value=!0,setTimeout(()=>document.addEventListener("mousedown",Gt),0)}const Mn=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Ct=["status.planDesc","status.swarmDesc","status.goalDesc"],Po=X(null),Ao=X(""),ss=X("");function En(Ue){const Fe={};return Ue&&(Fe["--composer-menu-desc-width"]=Ue),Fe}const qn=R(()=>En(Ao.value)),Ps=R(()=>En(ss.value)),ti=R(()=>({...Pt.value,...Ps.value}));let Io=null;function Ss(Ue){const Fe=Number.parseFloat(Ue);return Number.isFinite(Fe)?Fe:0}function Wi(Ue){return`${Ue.fontStyle||"normal"} ${Ue.fontWeight||"400"} ${Ue.fontSize} ${Ue.fontFamily}`}function Si(Ue){return Ue.letterSpacing==="normal"?0:Ss(Ue.letterSpacing)}function fo(Ue,Fe){if(!Ue)return 0;const oe=sre(Ue,Wi(Fe),{letterSpacing:Si(Fe)});return ire(oe)}function ni(){const Ue=Po.value?.querySelector(".pd-desc");if(!Ue)return;const Fe=getComputedStyle(Ue),oe=Math.max(0,...Mn.map(pe=>fo(r(pe.descKey),Fe))),Te=Math.max(0,...Ct.map(pe=>fo(r(pe),Fe)));Ao.value=oe>0?`${Math.ceil(oe)}px`:"",ss.value=Te>0?`${Math.ceil(Te)}px`:""}function Ci(){typeof window>"u"||(Io!==null&&window.cancelAnimationFrame(Io),mt(()=>{Io=window.requestAnimationFrame(()=>{Io=null,ni()})}))}Qe(l,Ci,{immediate:!0}),cn(()=>{Ci(),document.fonts?.ready.then(Ci)}),bn(()=>{Io!==null&&(window.cancelAnimationFrame(Io),Io=null)});function ar(Ue){i("setPermission",Ue),Ut()}const no=R(()=>Mn.find(Ue=>Ue.mode===o.status?.permission)),is=R(()=>no.value?r(no.value.labelKey):""),rs=R(()=>Wt.value?.provider??""),Lo=R(()=>!rs.value||!o.models?.length?[]:o.models.filter(Ue=>Ue.provider===rs.value)),Ai=R(()=>new Set(o.starredIds??[]));function Wn(Ue){return Ai.value.has(Ue)}const $o=R(()=>o.models?.length?o.models.filter(Ue=>Wn(Ue.id)&&Ue.provider!==rs.value):[]);function oi(Ue){i("selectModel",Ue),gt()}return(Ue,Fe)=>(w(),T("div",{class:We(["composer",{"drag-over":C(Z),expanded:h.value}]),onDragover:Fe[18]||(Fe[18]=(...oe)=>C(ue)&&C(ue)(...oe)),onDragleave:Fe[19]||(Fe[19]=(...oe)=>C(de)&&C(de)(...oe)),onDrop:Fe[20]||(Fe[20]=(...oe)=>C(Ce)&&C(Ce)(...oe))},[C(U).length>0?(w(),T("div",Wre,[(w(!0),T(Pe,null,ot(C(U),oe=>(w(),xe(A5,{key:oe.localId,kind:oe.kind,name:oe.name,url:oe.previewUrl,"file-id":oe.fileId,"media-type":oe.mediaType,size:oe.size,uploading:oe.uploading,error:oe.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:oe.name}),onActivate:Te=>q(oe),onRemove:Te=>C(K)(oe.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ce("",!0),C(H)?(w(),T("div",{key:1,class:"att-lightbox",onClick:Fe[1]||(Fe[1]=bt((...oe)=>C(J)&&C(J)(...oe),["self"]))},[_("div",zre,[re(Xt,{text:C(r)("model.close")},{default:Ee(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:Fe[0]||(Fe[0]=(...oe)=>C(J)&&C(J)(...oe))},"✕")]),_:1},8,["text"]),C(H).kind==="video"?(w(),T("video",{key:0,class:"att-lightbox-media",src:C(H).previewUrl,controls:"",playsinline:""},null,8,Ure)):(w(),T("img",{key:1,class:"att-lightbox-media",src:C(H).previewUrl,alt:C(H).name},null,8,qre)),_("div",jre,O(C(H).name),1)])])):ce("",!0),_("div",Vre,[_("div",Kre,[C(k)?(w(),xe(dre,{key:0,items:C(A),"active-index":C($),onSelect:C(x),onHover:Fe[2]||(Fe[2]=oe=>$.value=oe)},null,8,["items","active-index","onSelect"])):ce("",!0),C(L)?(w(),xe(bre,{key:1,items:C(E),"active-index":C(F),loading:C(S),onSelect:C(D),onHover:Fe[3]||(Fe[3]=oe=>F.value=oe)},null,8,["items","active-index","loading","onSelect"])):ce("",!0),_("div",Gre,[$n(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Fe[4]||(Fe[4]=oe=>po(a)?a.value=oe:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:$e,onCompositionstart:te,onCompositionend:me,onInput:B},null,40,Yre),[[_s,C(a)]]),h.value||v.value?(w(),T("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(w(),xe(Ve,{key:0,name:"collapse",size:"sm"})):(w(),xe(Ve,{key:1,name:"expand",size:"sm"}))],8,Zre)):ce("",!0)])]),ge.value?(w(),T("input",{key:0,ref_key:"fileInputRef",ref:P,type:"file",multiple:"",class:"file-input-hidden",onChange:Fe[5]||(Fe[5]=(...oe)=>C(ne)&&C(ne)(...oe))},null,544)):ce("",!0),_("div",{ref_key:"toolbarRef",ref:rt,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Po,class:"menu-measure","aria-hidden":"true"},[...Fe[21]||(Fe[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",Qre,[ge.value?(w(),xe(Dn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(he)},{default:Ee(()=>[re(Ve,{name:"attachment"})]),_:1},8,["label","onClick"])):ce("",!0),e.status?(w(),T("span",{key:1,class:We(["perm-pill",["perm-"+e.status.permission,{open:et.value}]]),role:"button",tabindex:"0",onClick:bt(It,["stop"]),onKeydown:[nr(It,["enter"]),nr(bt(It,["prevent"]),["space"])]},O(is.value),43,Xre)):ce("",!0),et.value&&e.status?(w(),T("div",{key:2,class:"perm-dropdown",style:Yt(qn.value),role:"menu",onClick:Fe[6]||(Fe[6]=bt(()=>{},["stop"]))},[(w(),T(Pe,null,ot(Mn,oe=>_("button",{key:oe.mode,class:We(["pd-row",{"is-current":oe.mode===e.status.permission}]),role:"menuitem",onClick:Te=>ar(oe.mode)},[_("span",ele,[oe.mode===e.status.permission?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",tle,[_("span",{class:"pd-name",style:Yt({color:oe.color})},O(C(r)(oe.labelKey)),5),_("span",nle,O(C(r)(oe.descKey)),1)])],10,Jre)),64))],4)):ce("",!0),e.status?(w(),T("div",{key:3,ref_key:"modesRef",ref:Xe,class:"modes"},[_("button",{type:"button",class:We(["mode-pill",{on:On.value,open:ze.value}]),onClick:bt(Hn,["stop"])},[_("span",ole,O(C(r)("status.modesLabel")),1),to.value?(w(),T("span",sle,O(C(r)("status.planLabel")),1)):ce("",!0),vn.value?(w(),T("span",ile,O(C(r)("status.swarmLabel")),1)):ce("",!0),Cn.value?(w(),T("span",rle,O(C(r)("status.goalLabel")),1)):ce("",!0)],2),ze.value?(w(),T("div",{key:0,ref_key:"modesMenuRef",ref:kt,class:"modes-menu",style:Yt(ti.value),role:"menu"},[_("button",{type:"button",class:We(["mode-row",{on:to.value}]),role:"menuitem",onClick:Fe[7]||(Fe[7]=oe=>i("togglePlan"))},[_("span",lle,[re(Ve,{name:"file-edit",size:"sm"})]),_("span",ale,[_("span",cle,O(C(r)("status.planLabel")),1),_("span",ule,O(C(r)("status.planDesc")),1)]),_("span",{class:We(["mode-switch",{on:to.value}])},[...Fe[22]||(Fe[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:We(["mode-row",{on:vn.value}]),role:"menuitem",onClick:Fe[8]||(Fe[8]=oe=>i("toggleSwarm"))},[_("span",dle,[re(Ve,{name:"sparkles",size:"sm"})]),_("span",fle,[_("span",hle,O(C(r)("status.swarmLabel")),1),_("span",ple,O(C(r)("status.swarmDesc")),1)]),_("span",{class:We(["mode-switch",{on:vn.value}])},[...Fe[23]||(Fe[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:We(["mode-row mode-row-goal",{on:xn.value||o.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:Fe[9]||(Fe[9]=oe=>xn.value?i("focusGoal"):i("toggleGoal"))},[_("span",mle,[re(Ve,{name:"target",size:"sm"})]),_("span",gle,[_("span",vle,O(C(r)("status.goalLabel")),1),_("span",yle,O(C(r)("status.goalDesc")),1)]),xn.value?ce("",!0):(w(),T("span",{key:0,class:We(["mode-switch",{on:o.goalMode}])},[...Fe[24]||(Fe[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),xn.value?(w(),T("div",kle,[An.value?(w(),xe(Rt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:Fe[10]||(Fe[10]=oe=>i("controlGoal","pause"))},{default:Ee(()=>[re(Ve,{name:"pause",size:"sm"}),_("span",null,O(C(r)("status.goalPause")),1)]),_:1})):ce("",!0),Do.value?(w(),xe(Rt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:Fe[11]||(Fe[11]=oe=>i("controlGoal","resume"))},{default:Ee(()=>[re(Ve,{name:"play",size:"sm"}),_("span",null,O(C(r)("status.goalResume")),1)]),_:1})):ce("",!0),re(Rt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:Fe[12]||(Fe[12]=oe=>i("controlGoal","cancel"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"}),_("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):ce("",!0)],2)],4)):ce("",!0)],512)):ce("",!0)]),_("div",ble,[ns.value?(w(),T("button",{key:0,class:"compact-chip",onClick:Fe[13]||(Fe[13]=bt(oe=>i("compact"),["stop"]))},"/compact")):ce("",!0),re(Xt,{text:dn.value},{default:Ee(()=>[e.status&&!e.hideContext?(w(),T("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":dn.value},[re(Hre,{pct:un.value},null,8,["pct"])],8,xle)):ce("",!0)]),_:1},8,["text"]),e.status?(w(),T("span",{key:1,class:We(["model-pill",{open:Ne.value}]),role:"button",tabindex:"0",onClick:bt(St,["stop"]),onKeydown:[nr(St,["enter"]),nr(bt(St,["prevent"]),["space"])]},[_("b",null,O(e.status.model),1),go.value?(w(),T("span",_le,O(go.value),1)):ce("",!0),re(Ve,{class:"cv",name:"chevron-down",size:"sm"})],42,wle)):ce("",!0),e.running?(w(),xe(Xt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:Fe[14]||(Fe[14]=oe=>i("interrupt"))},[re(Ve,{name:"stop",size:"sm"})],8,Sle)]),_:1},8,["text"])):ce("",!0),_("button",{class:We(["send",{"is-starting":e.starting}]),"aria-label":De.value,disabled:e.starting,onClick:Fe[15]||(Fe[15]=oe=>ee())},[e.starting?(w(),xe(Ds,{key:0,size:"sm"})):(w(),xe(Ve,{key:1,name:"send",size:"sm"}))],10,Cle)]),Ne.value&&e.status?(w(),T("div",{key:0,class:"model-dropdown",role:"menu",onClick:Fe[17]||(Fe[17]=bt(()=>{},["stop"]))},[$o.value.length>0?(w(),T("div",Ale,O(C(r)("status.starredModels")),1)):ce("",!0),(w(!0),T(Pe,null,ot($o.value,oe=>(w(),T("button",{key:oe.id,class:We(["md-row",{"is-current":oe.id===e.status.modelId}]),role:"menuitem",onClick:Te=>oi(oe.id)},[_("span",Ele,[oe.id===e.status.modelId?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",Tle,O(oe.displayName??oe.model),1),_("span",Nle,O(oe.provider),1),re(Ve,{class:"md-star",name:"star",size:"sm"})],10,Mle))),128)),$o.value.length>0?(w(),T("div",Ile)):ce("",!0),Lo.value.length>0?(w(),T("div",Lle,O(rs.value),1)):ce("",!0),(w(!0),T(Pe,null,ot(Lo.value,oe=>(w(),T("button",{key:oe.id,class:We(["md-row",{"is-current":oe.id===e.status.modelId}]),role:"menuitem",onClick:Te=>oi(oe.id)},[_("span",Fle,[oe.id===e.status.modelId?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",Ole,O(oe.displayName??oe.model),1),Wn(oe.id)?(w(),xe(Ve,{key:0,class:"md-star",name:"star",size:"sm"})):ce("",!0)],10,$le))),128)),Lo.value.length>0?(w(),T("div",Rle)):ce("",!0),_("div",{class:We(["md-thinking",{"is-readonly":Yn.value}])},[_("span",Ble,O(C(r)("status.thinkingLabel")),1),Pn.value==="unsupported"?(w(),T("span",Dle,O(C(r)("status.modeNotSupported")),1)):(w(),T("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(w(!0),T(Pe,null,ot(co.value,oe=>(w(),T("button",{key:oe,type:"button",class:We(["effort-seg",{"is-active":oe===Gn.value}]),disabled:Yn.value,onClick:Te=>os(oe)},O(Un(oe)),11,Hle))),128))],8,Ple))],2),Fe[25]||(Fe[25]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:Fe[16]||(Fe[16]=oe=>{gt(),i("pickModel")})},[_("span",Wle,O(C(r)("status.moreModels")),1)])])):ce("",!0)],512)]),_("div",{class:We(["drop-overlay",{show:C(Z)}]),"aria-hidden":"true"},[_("div",zle,[re(Ve,{name:"file-plus",size:"lg"}),_("span",null,O(C(r)("composer.dropToAttach")),1)])],2)],34))}}),H5=ct(Ule,[["__scopeId","data-v-9e2863b5"]]),qle={key:0,class:"ui-card__head"},jle={class:"ui-card__body"},Vle={key:1,class:"ui-card__foot"},Kle=Ze({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),T("div",qle,[Fn(t.$slots,"head",{},void 0,!0)])):ce("",!0),_("div",jle,[Fn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),T("div",Vle,[Fn(t.$slots,"foot",{},void 0,!0)])):ce("",!0)],2))}}),Vk=ct(Kle,[["__scopeId","data-v-9c9f9a9a"]]),Gle={class:"goal-kicker"},Yle={key:0,class:"goal-progress","aria-hidden":"true"},Zle={class:"goal-full"},Qle={key:0,class:"goal-criterion"},Xle=["inert","aria-hidden"],Jle={class:"goal-meta"},eae={key:0},tae={class:"goal-actions"},nae=Ze({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),{confirm:i}=nf(),r=X(!1);Qe(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=R(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(w(),xe(Vk,{class:We(["goal-strip",{expanded:r.value}])},{head:Ee(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[re(Ve,{class:"goal-icon",name:"target",size:"md"}),_("span",Gle,O(C(s)("status.goalLabel")),1),_("span",{class:We(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),re(Ri,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Je(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(w(),T("span",Yle,[_("span",{class:"goal-progress-fill",style:Yt({width:`${l.value}%`})},null,4)])):ce("",!0),re(Ve,{class:We(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ee(()=>[_("div",Zle,O(e.goal.objective),1),e.goal.completionCriterion?(w(),T("div",Qle,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,O(e.goal.completionCriterion),1)])):ce("",!0)]),foot:Ee(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",Jle,[_("span",null,O(e.goal.turnsUsed)+" turns",1),_("span",null,O(C(ir)(e.goal.tokensUsed))+" tokens",1),_("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(w(),T("span",eae,O(l.value)+"% token budget",1)):ce("",!0)]),_("div",tae,[e.goal.status==="active"?(w(),xe(Rt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=bt(h=>o("controlGoal","pause"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"pause",size:"md"}),_("span",null,O(C(s)("status.goalPause")),1)]),_:1})):ce("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(w(),xe(Rt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=bt(h=>o("controlGoal","resume"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"play",size:"md"}),_("span",null,O(C(s)("status.goalResume")),1)]),_:1})):ce("",!0),re(Rt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:bt(u,["stop"])},{default:Ee(()=>[re(Ve,{name:"close",size:"md"}),_("span",null,O(C(s)("status.goalCancel")),1)]),_:1})])],8,Xle)]),_:1},8,["class"]))}}),oae=ct(nae,[["__scopeId","data-v-44bef30f"]]),sae={class:"qh"},iae={class:"qtitle"},rae={key:0,class:"qstep"},lae={key:1,class:"qmin-peek"},aae={class:"qbody"},cae=["aria-label"],uae=["aria-selected","aria-label","onClick"],dae={class:"qstep-num"},fae={key:1,class:"qheader-chip"},hae={class:"qtext"},pae={class:"qopts"},mae=["onClick"],gae={class:"qopt-key"},vae={class:"qopt-glyph"},yae={key:0,class:"chk"},kae={key:1,class:"rad"},bae={class:"qopt-text"},xae={class:"qopt-label"},wae={key:0,class:"qopt-desc"},_ae={class:"qopt-glyph"},Sae={key:0,class:"chk"},Cae={key:1,class:"rad"},Aae={class:"qopt-label"},Mae=["placeholder"],Eae={class:"qfoot"},Tae=Ze({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Tt(),s=t,i=X(0),r=X(!1),l=R(()=>n.question.questions[i.value]),a=R(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(U){U>=0&&U<a.value&&(i.value=U)}function f(U){const H=p.value[U];return H?H.kind==="multi"?H.optionIds.length>0:H.kind==="multiWithOther"?H.optionIds.length>0||H.otherText.trim().length>0:H.kind==="other"?H.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=X({});function g(U){return U.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${U.label} ${U.description??""}`.toLowerCase())}function b(){const U={...p.value};let H=!1;for(const P of n.question.questions){if(U[P.id])continue;const Z=P.options.filter(g);Z.length!==0&&(U[P.id]=P.multiSelect?{kind:"multi",optionIds:Z.map(K=>K.id)}:{kind:"single",optionId:Z[0].id},H=!0)}H&&(p.value=U)}Qe(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},y.value={}}),Qe(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function v(U,H){const P=p.value[U];if(P&&P.kind==="single"&&P.optionId===H){const Z={...p.value};delete Z[U],p.value=Z}else p.value={...p.value,[U]:{kind:"single",optionId:H}}}function m(U,H){const P=p.value[U],Z=P&&(P.kind==="multi"||P.kind==="multiWithOther")?P.kind==="multi"?[...P.optionIds]:[...P.optionIds]:[],K=Z.indexOf(H);K>=0?Z.splice(K,1):Z.push(H);const V=p.value[U],J=V&&V.kind==="multiWithOther"?V.otherText:"";J?p.value={...p.value,[U]:{kind:"multiWithOther",optionIds:Z,otherText:J}}:p.value={...p.value,[U]:{kind:"multi",optionIds:Z}}}const y=X({}),k=X(null);function A(U){const H=n.question.questions.find(Z=>Z.id===U),P=y.value[U]??"";if(H.multiSelect){const Z=p.value[U],K=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];p.value={...p.value,[U]:{kind:"multiWithOther",optionIds:K,otherText:P}}}else p.value={...p.value,[U]:{kind:"other",text:P}}}function $(U){A(U),mt(()=>k.value?.focus())}function I(U,H){const P=p.value[U];return P?P.kind==="single"?P.optionId===H:P.kind==="multi"||P.kind==="multiWithOther"?P.optionIds.includes(H):!1:!1}function x(U){const H=p.value[U];return!!(H&&(H.kind==="other"||H.kind==="multiWithOther"))}function L(){return n.question.questions.every(U=>f(U.id))}const E=R(()=>n.busyKind==="answer"),F=R(()=>n.busyKind==="dismiss"),S=R(()=>!!n.busyKind);function N(){if(S.value||!L())return;const U={answers:p.value,method:"click"};s("answer",n.question.questionId,U)}function D(){S.value||s("dismiss",n.question.questionId)}function B(U){const H=(document.activeElement?.tagName??"").toLowerCase(),P=H==="input"||H==="textarea";if(S.value)return;if(U.key==="Enter"){if(U.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():L()&&N();return}if(P)return;if(U.key==="Escape"){U.preventDefault(),D();return}if(r.value)return;const Z=parseInt(U.key,10);if(!isNaN(Z)&&Z>=1&&Z<=9){U.preventDefault();const K=l.value,V=Z-1,J=K.options[V];J&&(K.multiSelect?m(K.id,J.id):v(K.id,J.id))}}return cn(()=>document.addEventListener("keydown",B)),bn(()=>document.removeEventListener("keydown",B)),(U,H)=>(w(),xe(Vk,{class:We(["qcard",{minimized:r.value}])},o3({head:Ee(()=>[_("div",sae,[H[5]||(H[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",iae,O(C(o)("question.title")),1),a.value>1&&!r.value?(w(),T("span",rae,O(C(o)("question.step",{current:i.value+1,total:a.value})),1)):ce("",!0),r.value?(w(),T("span",lae,O(l.value.question),1)):ce("",!0),re(Dn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:H[0]||(H[0]=P=>r.value=!r.value)},{default:Ee(()=>[r.value?(w(),xe(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),xe(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[_("div",aae,[a.value>1?(w(),T("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(w(!0),T(Pe,null,ot(n.question.questions,(P,Z)=>(w(),T("button",{key:P.id,type:"button",class:We(["qstep-dot",{active:Z===i.value,answered:f(P.id)}]),"aria-selected":Z===i.value,"aria-label":C(o)("question.step",{current:Z+1,total:a.value}),onClick:K=>d(Z)},[_("span",dae,O(Z+1),1)],10,uae))),128))],8,cae)):ce("",!0),l.value.header?(w(),T("div",fae,[re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(l.value.header),1)]),_:1})])):ce("",!0),_("div",hae,O(l.value.question),1),l.value.body?(w(),xe(zm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ce("",!0),_("div",pae,[(w(!0),T(Pe,null,ot(l.value.options,(P,Z)=>(w(),T("label",{key:P.id,class:We(["qopt",{selected:I(l.value.id,P.id)}]),onClick:bt(K=>l.value.multiSelect?m(l.value.id,P.id):v(l.value.id,P.id),["prevent"])},[_("span",gae,O(Z+1),1),_("span",vae,[l.value.multiSelect?(w(),T("span",yae,O(I(l.value.id,P.id)?"■":"□"),1)):(w(),T("span",kae,O(I(l.value.id,P.id)?"●":"○"),1))]),_("span",bae,[_("span",xae,O(P.label),1),P.description?(w(),T("span",wae,O(P.description),1)):ce("",!0)])],10,mae))),128)),l.value.allowOther?(w(),T("label",{key:0,class:We(["qopt",{selected:x(l.value.id)}]),onClick:H[4]||(H[4]=bt(P=>$(l.value.id),["prevent"]))},[H[6]||(H[6]=_("span",{class:"qopt-key"},null,-1)),_("span",_ae,[l.value.multiSelect?(w(),T("span",Sae,O(x(l.value.id)?"■":"□"),1)):(w(),T("span",Cae,O(x(l.value.id)?"●":"○"),1))]),_("span",Aae,O(l.value.otherLabel??C(o)("question.otherDefault")),1),$n(_("input",{ref_key:"otherInputEl",ref:k,"onUpdate:modelValue":H[1]||(H[1]=P=>y.value[l.value.id]=P),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:H[2]||(H[2]=P=>A(l.value.id)),onFocus:H[3]||(H[3]=P=>A(l.value.id))},null,40,Mae),[[_s,y.value[l.value.id]]])],2)):ce("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[_("div",Eae,[i.value<a.value-1?(w(),xe(Rt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ee(()=>[Je(O(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),xe(Rt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!L(),loading:E.value,onClick:N},{default:Ee(()=>[Je(O(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),xe(Rt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Je(O(C(o)("question.back")),1)]),_:1},8,["disabled"])):ce("",!0),re(Rt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:D},{default:Ee(()=>[Je(O(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Nae=ct(Tae,[["__scopeId","data-v-14c58ac1"]]),Iae={class:"ah"},Lae={class:"akind"},$ae={class:"apath"},Fae={class:"ah-path"},Oae={key:1,class:"diff"},Rae={class:"dg"},Bae={class:"dc"},Dae={key:2,class:"body-shell"},Pae={class:"shell-cmd"},Hae={key:0,class:"shell-cwd"},Wae={key:1,class:"shell-danger"},zae={key:3,class:"body-file"},Uae={class:"file-bar"},qae={class:"file-lang"},jae={class:"file-content"},Vae={class:"file-ln"},Kae={class:"file-text"},Gae={key:4,class:"body-chip"},Yae={class:"chip-label"},Zae={class:"chip-value"},Qae={key:0,class:"chip-detail"},Xae={key:5,class:"body-chip"},Jae={key:0,class:"chip-label"},ece={class:"chip-value"},tce={key:6,class:"body-chip"},nce={class:"chip-label"},oce={class:"chip-value"},sce={key:0,class:"chip-detail"},ice={key:7,class:"body-chip"},rce={class:"chip-label"},lce={class:"chip-value"},ace={key:0,class:"chip-detail"},cce={key:8,class:"body-todo"},uce={class:"todo-glyph"},dce={key:9,class:"body-plan"},fce={key:10,class:"body-generic"},hce={class:"gen-text"},pce={key:11,class:"feedback-wrap"},mce=["placeholder"],gce={class:"feedback-hint"},vce={key:0,class:"plan-actions"},yce={key:1,class:"abtn"},kce=Ze({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>{const E=n.block;return E.kind!=="plan_review"?null:{plan:E.plan,path:E.path,options:E.options??[]}}),r=X(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const E=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${E}`)}const c=X(!1),u=X(""),d=X(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const E=u.value.trim();i.value?v("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:E||void 0}):v("feedback",{decision:"rejected",feedback:E||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function g(E){E.key==="Enter"&&!E.shiftKey?(E.preventDefault(),h()):E.key==="Escape"&&(E.preventDefault(),p())}const b=X(null);Qe(()=>n.busy,E=>{E||(b.value=null)});function v(E,F){n.busy||(b.value=E,o("decide",F))}function m(){v("approve",{decision:"approved"})}function y(){v("approveSession",{decision:"approved",scope:"session"})}function k(){v("reject",{decision:"rejected"})}function A(){v("approvePlan",{decision:"approved"})}function $(E){v(`option:${E}`,{decision:"approved",selectedLabel:E})}function I(){n.busy||f()}function x(){v("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function L(E){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){E.key==="1"?(E.preventDefault(),A()):E.key==="2"?(E.preventDefault(),I()):E.key==="3"&&(E.preventDefault(),x());return}E.key==="1"&&S.options[0]?(E.preventDefault(),$(S.options[0].label)):E.key==="2"&&S.options[1]?(E.preventDefault(),$(S.options[1].label)):E.key==="3"&&S.options[2]&&(E.preventDefault(),$(S.options[2].label));return}E.key==="1"?(E.preventDefault(),m()):E.key==="2"?(E.preventDefault(),y()):E.key==="3"?(E.preventDefault(),k()):E.key==="4"&&(E.preventDefault(),f())}return cn(()=>document.addEventListener("keydown",L)),bn(()=>document.removeEventListener("keydown",L)),(E,F)=>(w(),xe(Vk,{class:We(["appr",{minimized:r.value}])},o3({head:Ee(()=>[_("div",Iae,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",Lae,O(a()),1),_("span",$ae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),T(Pe,{key:0},[Je(O(e.block.path),1)],64)):e.block.kind==="shell"?(w(),T(Pe,{key:1},[Je(O(e.block.command),1)],64)):e.block.kind==="url"?(w(),T(Pe,{key:2},[Je(O(e.block.url),1)],64)):e.block.kind==="search"?(w(),T(Pe,{key:3},[Je(O(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),T(Pe,{key:4},[Je(O(e.block.name),1)],64)):e.block.kind==="generic"?(w(),T(Pe,{key:5},[Je(O(e.block.summary),1)],64)):ce("",!0)]),e.agentName&&!r.value?(w(),xe(Ri,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ce("",!0),r.value?ce("",!0):(w(),xe(Ri,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Je(O(C(s)("approval.required")),1)]),_:1})),re(Dn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ee(()=>[r.value?(w(),xe(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),xe(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),xe(Xt,{key:0,text:e.block.path},{default:Ee(()=>[_("div",Fae,O(e.block.path),1)]),_:1},8,["text"])):ce("",!0),e.block.kind==="diff"?(w(),T("div",Oae,[(w(!0),T(Pe,null,ot(e.block.diff,(S,N)=>(w(),T("div",{key:N,class:We(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",Rae,O(S.gutter),1),_("span",Bae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),T("div",Dae,[_("div",Pae,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),Je(" "+O(e.block.command),1)]),e.block.cwd?(w(),T("div",Hae,"cwd: "+O(e.block.cwd),1)):ce("",!0),e.block.danger?(w(),T("div",Wae,O(C(s)("approval.danger",{detail:e.block.danger})),1)):ce("",!0)])):e.block.kind==="file"?(w(),T("div",zae,[_("div",Uae,[_("span",qae,O(e.block.language??""),1)]),_("div",jae,[(w(!0),T(Pe,null,ot(e.block.content.split(`
|
|
297
|
+
`),(S,N)=>(w(),T("div",{key:N,class:"file-line"},[_("span",Vae,O(N+1),1),_("span",Kae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),T("div",Gae,[_("span",Yae,O(e.block.op),1),_("span",Zae,O(e.block.path),1),e.block.detail?(w(),T("span",Qae,O(e.block.detail),1)):ce("",!0)])):e.block.kind==="url"?(w(),T("div",Xae,[e.block.method?(w(),T("span",Jae,O(e.block.method),1)):ce("",!0),_("span",ece,O(e.block.url),1)])):e.block.kind==="search"?(w(),T("div",tce,[_("span",nce,O(C(s)("approval.searchQueryLabel")),1),_("span",oce,O(e.block.query),1),e.block.scope?(w(),T("span",sce,O(C(s)("approval.searchScope",{scope:e.block.scope})),1)):ce("",!0)])):e.block.kind==="invocation"?(w(),T("div",ice,[_("span",rce,O(e.block.kind2),1),_("span",lce,O(e.block.name),1),e.block.description?(w(),T("span",ace,O(e.block.description),1)):ce("",!0)])):e.block.kind==="todo"?(w(),T("div",cce,[(w(!0),T(Pe,null,ot(e.block.items,(S,N)=>(w(),T("div",{key:N,class:"todo-item"},[_("span",uce,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:We(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),T("div",dce,[re(zm,{text:e.block.plan},null,8,["text"])])):(w(),T("div",fce,[_("span",hce,O(e.block.summary),1)])),c.value?(w(),T("div",pce,[$n(_("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,mce),[[_s,u.value]]),_("div",gce,O(C(s)("approval.feedbackHint")),1)])):ce("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(w(),T("div",vce,[i.value.options.length>0?(w(!0),T(Pe,{key:0},ot(i.value.options,(S,N)=>(w(),xe(Xt,{key:N,text:S.description},{default:Ee(()=>[re(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:D=>$(S.label)},{default:Ee(()=>[Je(O(S.label),1),re(kr,{class:"k",keys:[String(N+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),xe(Rt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ee(()=>[Je(O(C(s)("approval.approvePlan")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:I},{default:Ee(()=>[Je(O(C(s)("approval.revise")),1),i.value.options.length===0?(w(),xe(kr,{key:0,class:"k",keys:["2"]})):ce("",!0)]),_:1},8,["disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:x},{default:Ee(()=>[Je(O(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),xe(kr,{key:0,class:"k",keys:["3"]})):ce("",!0)]),_:1},8,["loading","disabled"])])):(w(),T("div",yce,[re(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:m},{default:Ee(()=>[Je(O(C(s)("approval.approve")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:y},{default:Ee(()=>[Je(O(C(s)("approval.approveSession")),1),re(kr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:k},{default:Ee(()=>[Je(O(C(s)("approval.reject")),1),re(kr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Je(O(C(s)("approval.feedback")),1),re(kr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),bce=ct(kce,[["__scopeId","data-v-458a9d7d"]]),xce=Ze({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(w(),T("span",{class:We(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),W5=ct(xce,[["__scopeId","data-v-f595d935"]]),wce={class:"taskspane"},_ce={class:"tp-head"},Sce={class:"tp-title"},Cce={class:"tp-count"},Ace={class:"tp-list"},Mce={key:0,class:"tp-empty"},Ece=["role","onClick"],Tce={class:"tp-name"},Nce={class:"tp-time"},Ice=["onClick"],Lce={key:0,class:"tp-detail"},$ce={key:0,class:"tp-codebox"},Fce=["onClick"],Oce={class:"tp-pre"},Rce={class:"tp-cmd"},Bce={key:1,class:"tp-codebox"},Dce=["onClick"],Pce={class:"tp-pre"},Hce=Ze({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Tt(),s=Bo(new Set),i=Bo(new Set),r=Bo(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,g,b){await Go(p)&&(b.add(g),setTimeout(()=>b.delete(g),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const g=p.output?.join(`
|
|
298
|
+
`)??"";g&&await d(g,p.id,r)}return(p,g)=>(w(),T("div",wce,[_("div",_ce,[_("span",Sce,O(C(o)("tasks.tag")),1),_("span",Cce,O(e.tasks.length),1)]),_("div",Ace,[e.tasks.length===0?(w(),T("div",Mce,O(C(o)("tasks.emptyTasks")),1)):(w(!0),T(Pe,{key:1},ot(e.tasks,b=>(w(),T("div",{key:b.id,class:We(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[_("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:v=>a(b)},[re(W5,{status:u(b.state)},null,8,["status"]),_("span",Tce,O(b.name),1),re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(b.kind),1)]),_:2},1024),_("span",Nce,O(b.timing),1),b.state==="run"?(w(),T("button",{key:0,class:"tp-stop",onClick:bt(v=>n("cancel",b.id),["stop"])},O(C(o)("tasks.stop")),9,Ice)):ce("",!0),b.kind==="subagent"?(w(),xe(Ve,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(w(),xe(Ve,{key:2,class:We(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ce("",!0)],8,Ece),s.has(b.id)&&l(b)?(w(),T("div",Lce,[b.meta?(w(),T("div",$ce,[_("button",{class:We(["tp-copy",{copied:i.has(b.id)}]),onClick:bt(v=>f(b),["stop"])},O(i.has(b.id)?"已复制":"复制"),11,Fce),_("pre",Oce,[_("code",null,[_("span",Rce,O(b.meta),1)])])])):ce("",!0),b.output&&b.output.length>0?(w(),T("div",Bce,[_("button",{class:We(["tp-copy",{copied:r.has(b.id)}]),onClick:bt(v=>h(b),["stop"])},O(r.has(b.id)?"已复制":"复制"),11,Dce),_("pre",Pce,[_("code",null,[g[0]||(g[0]=Je(`
|
|
299
|
+
`,-1)),(w(!0),T(Pe,null,ot(b.output,(v,m)=>(w(),T("span",{key:m,class:"tp-line"},O(v),1))),128)),g[1]||(g[1]=Je(`
|
|
300
|
+
`,-1))])])])):ce("",!0)])):ce("",!0)],2))),128))])]))}}),KC=ct(Hce,[["__scopeId","data-v-28fd5fc0"]]),Wce={class:"todo-card"},zce={key:0,class:"tc-empty"},Uce={class:"tc-name"},qce=Ze({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(w(),T("div",Wce,[t.todos.length===0?(w(),T("div",zce,[i[0]||(i[0]=_("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,O(C(n)("tasks.emptyTodo")),1)])):ce("",!0),(w(!0),T(Pe,null,ot(t.todos,(r,l)=>(w(),T("div",{key:l,class:We(["tc-row",`s-${r.status}`])},[re(W5,{status:o(r.status)},null,8,["status"]),_("span",Uce,O(r.title),1)],2))),128))]))}}),jce=ct(qce,[["__scopeId","data-v-01c65735"]]),Vce={class:"dock-work-head"},Kce={key:0,class:"dock-work-tab static"},Gce={key:1,class:"dock-work-tab static"},Yce={key:2,class:"dock-work-tab static"},Zce={class:"dock-work-body"},Qce={class:"dw-count"},Xce={class:"dw-count"},Jce={class:"dw-count"},eue=Ze({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Tt(),r=X(null),l=X(null),a=X(null),c=X(null);function u(b){return r.value?(r.value.loadForEdit(b),!0):!1}function d(b){r.value?.loadAttachmentsForEdit(b)}function f(){r.value?.focus()}function h(b){if(!o.dockPanel)return;const v=b.target;v&&(l.value?.contains(v)||a.value?.contains(v)||s("close-dock-panel"))}Qe(()=>o.dockPanel,b=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),b&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function g(){const b=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${b}px`)}return cn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(g),p.observe(c.value),g())}),bn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(b,v)=>(w(),T("div",{ref_key:"dockRef",ref:c,class:We(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:v[28]||(v[28]=bt(()=>{},["stop"]))},[re(Il,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(w(),T("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:v[3]||(v[3]=bt(()=>{},["stop"]))},[_("div",Vce,[e.dockPanel==="bash"?(w(),T("span",Kce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),T("span",Gce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),T("span",Yce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):ce("",!0)]),_("div",Zce,[e.dockPanel==="bash"?(w(),xe(KC,{key:0,tasks:e.bashTasks,onCancel:v[0]||(v[0]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),xe(KC,{key:1,tasks:e.subagentTasks,onCancel:v[1]||(v[1]=m=>s("cancelTask",m)),onOpen:v[2]||(v[2]=m=>s("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),xe(jce,{key:2,todos:e.todos??[]},null,8,["todos"])):ce("",!0)])],512)):ce("",!0)]),_:1}),e.goal?(w(),xe(oae,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:v[4]||(v[4]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):ce("",!0),e.hasDockWork?(w(),T("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),xe(bh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:v[5]||(v[5]=m=>s("toggle-dock-panel","bash"))},{default:Ee(()=>[re(Ve,{name:"clock",size:"md"}),_("span",null,O(C(i)("tasks.dockBash")),1),_("span",Qce,[v[29]||(v[29]=Je("(",-1)),_("b",null,O(e.bashTasks.length),1),v[30]||(v[30]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ce("",!0),e.subagentTasks.length>0?(w(),xe(bh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:v[6]||(v[6]=m=>s("toggle-dock-panel","subagent"))},{default:Ee(()=>[re(Ve,{name:"sparkles",size:"md"}),_("span",null,O(C(i)("tasks.dockSubagent")),1),_("span",Xce,[v[31]||(v[31]=Je("(",-1)),_("b",null,O(e.subagentTasks.length),1),v[32]||(v[32]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ce("",!0),(e.todos?.length??0)>0?(w(),xe(bh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:v[7]||(v[7]=m=>s("toggle-dock-panel","todos"))},{default:Ee(()=>[re(Ve,{name:"check-list",size:"md"}),_("span",null,O(C(i)("tasks.dockTodos")),1),_("span",Jce,[v[33]||(v[33]=Je("(",-1)),_("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),v[34]||(v[34]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ce("",!0)],512)):ce("",!0),e.pendingQuestion?(w(),xe(Nae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:v[8]||(v[8]=(m,y)=>s("answer",m,y)),onDismiss:v[9]||(v[9]=m=>s("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),xe(bce,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:v[10]||(v[10]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(w(),xe(H5,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:v[11]||(v[11]=m=>s("submit",m)),onSteer:v[12]||(v[12]=m=>s("steer",m)),onCommand:v[13]||(v[13]=m=>s("command",m)),onInterrupt:v[14]||(v[14]=m=>s("interrupt")),onSetPermission:v[15]||(v[15]=m=>s("setPermission",m)),onSetThinking:v[16]||(v[16]=m=>s("setThinking",m)),onTogglePlan:v[17]||(v[17]=m=>s("togglePlan")),onToggleSwarm:v[18]||(v[18]=m=>s("toggleSwarm")),onToggleGoal:v[19]||(v[19]=m=>s("toggleGoal")),onOpenBtw:v[20]||(v[20]=m=>s("openBtw")),onCreateGoal:v[21]||(v[21]=m=>s("createGoal",m)),onControlGoal:v[22]||(v[22]=m=>s("controlGoal",m)),onFocusGoal:v[23]||(v[23]=m=>s("focusGoal")),onFocusSwarm:v[24]||(v[24]=m=>s("focusSwarm")),onCompact:v[25]||(v[25]=m=>s("compact")),onPickModel:v[26]||(v[26]=m=>s("pickModel")),onSelectModel:v[27]||(v[27]=m=>s("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),tue=ct(eue,[["__scopeId","data-v-9e5ec0f2"]]),nue=["aria-label","aria-hidden"],oue={class:"toc-scroll"},sue=["onClick"],iue={class:"toc-label"},rue=240,lue=Ze({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=X(null),r=X(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=rue}const c=R(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Qe(c,u=>{l?.disconnect(),l=null,u&&mt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),mo(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),T("nav",{key:0,ref_key:"navRef",ref:i,class:We(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",oue,[(w(!0),T(Pe,null,ot(e.items,f=>(w(),T("button",{key:f.id,type:"button",class:We(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",iue,O(f.title),1)],10,sue))),128))])],10,nue)):ce("",!0)}}),aue=ct(lue,[["__scopeId","data-v-3f1c1f66"]]),cue=5;function uue(e,t,n,o=cue){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const due={class:"chat-layout"},fue={class:"empty-hint"},hue={key:0,class:"empty-hint-text"},pue={key:1,class:"ws-pick"},mue={class:"ws-pick-name"},gue={key:1,class:"ws-pick-menu"},vue=["onClick"],yue={class:"ws-pick-item-name"},kue={class:"ws-pick-item-path"},bue=["aria-label"],xue={key:0,class:"abort-toast",role:"status","aria-live":"polite"},wue={class:"abort-toast-text"},kg=80,GC=1e3,_ue=420,Sue=3e3,Cue=Ze({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),s=e,i=n,r=X(!1),l=X(!1),a=R(()=>s.workspaces?.find(_e=>_e.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=R(()=>(s.workspaces?.length??0)>0),u=R(()=>uue(s.workspaces??[],s.activeWorkspaceId,l.value)),d=R(()=>(s.workspaces?.length??0)-u.value.length);Qe(r,pe=>{pe||(l.value=!1)});function f(pe){r.value=!1,pe!==s.activeWorkspaceId&&i("selectWorkspace",pe)}Xc(Ft.contentAlign);const h=X(null),p=X(null),g=X(null),b=X(!1),v=X(0);let m=null;function y(pe,_e){const He=g.value??p.value;return!He||He.loadForEdit(pe)===!1?!1:(He.loadAttachmentsForEdit(_e??[]),!0)}function k(){b.value=!0,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,b.value=!1},2e3)}function A(){v.value++}const $=R(()=>s.tasks.filter(pe=>pe.kind!=="subagent")),I=R(()=>s.tasks.filter(pe=>pe.kind==="subagent"&&pe.runInBackground)),x=R(()=>$.value.filter(pe=>pe.state==="run").length),L=R(()=>I.value.filter(pe=>pe.state==="run").length);function E(pe){const _e=s.tasks,He=_e.find(Bt=>Bt.id===pe)??_e.find(Bt=>Bt.parentToolCallId===pe);if(He)return He.id;const Ot=_e.filter(Bt=>Bt.kind==="subagent"&&!Bt.parentToolCallId);if(Ot.length===1)return Ot[0].id}In("resolveAgentTaskId",E),In("pinScroll",to);const F=R(()=>(s.todos??[]).filter(pe=>pe.status==="done").length),S=R(()=>$.value.length>0||I.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),N=X(null),D=R(()=>s.gitInfo?s.changes?.length??0:0);function B(pe){N.value=N.value===pe?null:pe}function U(){N.value=null}Qe(S,pe=>{pe||U()});function H(pe){if(pe.role==="compaction")return o("conversation.compactedPlain");if(pe.role==="user"){if(pe.skillActivation)return`/${pe.skillActivation.name}`;if(pe.pluginCommand)return`/${pe.pluginCommand.pluginId}:${pe.pluginCommand.commandName}`;const He=pe.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const _e=(pe.text||pe.thinking||"").trim().replaceAll(/\s+/g," ");return _e.length>0?_e:(pe.tools?.length??0)>0?`${pe.tools.length} tools`:"kimi"}const P=R(()=>s.turns.filter(pe=>pe.role==="user").map((pe,_e)=>({id:pe.id,role:pe.role,no:_e+1,title:H(pe)}))),Z=X(null);function K(){const pe=le.value;if(!pe)return;const _e=pe.querySelectorAll(".turn-anchor[data-turn-id]");if(_e.length===0)return;const He=P.value;if(He.length===0)return;const Ot=new Set(He.map(Cs=>Cs.id));if(me()<=kg){Z.value=He[He.length-1].id;return}const Bt=pe.getBoundingClientRect(),rn=Bt.height/2;let zn=null;_e.forEach(Cs=>{const Q=Cs.dataset.turnId;if(!Q||!Ot.has(Q))return;Cs.getBoundingClientRect().top-Bt.top<=rn&&(zn=Q)}),Z.value=zn??He[0].id}const V=X(!1);let J=0;function he(){J||(J=it(()=>{J=0,ne()}))}function ne(){const pe=le.value,_e=!s.mobile&&s.conversationToc&&pe?pe.closest(".con")?.querySelector(".conversation-toc"):null,He=_e?.querySelector(".toc-bar");let Ot=!1;if(pe&&_e&&He){const Bt=He.getBoundingClientRect(),rn=_e.getBoundingClientRect(),zn=Bt.left+Bt.width/2;Ot=Array.from(pe.querySelectorAll(".table-node-wrapper")).some(Cs=>{const Q=Cs.getBoundingClientRect();return Q.left<=zn&&zn<=Q.right&&Q.top<rn.bottom&&Q.bottom>rn.top})}V.value!==Ot&&(V.value=Ot)}const ue=R(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),de=R(()=>{const pe=ue.value;if(pe)return s.pendingQuestionActions?.[pe.questionId]}),Ce=R(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Ie=R(()=>{const pe=Ce.value;return pe?!!s.pendingApprovalActions?.[pe.approvalId]:!1}),le=X(null),z=X(null),ae=X(0),ie=X(0),q=R(()=>({"--panes-scrollbar-width":`${ae.value}px`}));function ee(pe){return pe instanceof HTMLElement?pe:pe&&"$el"in pe&&pe.$el instanceof HTMLElement?pe.$el:null}function ye(){const pe=le.value;ae.value=pe?Math.max(0,pe.offsetWidth-pe.clientWidth):0,ie.value=z.value?.offsetHeight??0}function fe(pe){const _e=ee(pe);le.value=_e,_e&&rs()}function ve(pe){const _e=ee(pe);z.value=_e??null,pe&&"loadForEdit"in pe&&typeof pe.loadForEdit=="function"&&"focus"in pe&&typeof pe.focus=="function"?g.value={loadForEdit:pe.loadForEdit.bind(pe),loadAttachmentsForEdit:"loadAttachmentsForEdit"in pe&&typeof pe.loadAttachmentsForEdit=="function"?pe.loadAttachmentsForEdit.bind(pe):()=>{},focus:pe.focus.bind(pe)}:g.value=null,is()}const j=X(!0),te=X(!1);function me(){const pe=le.value;return pe?pe.scrollHeight-pe.scrollTop-pe.clientHeight:0}let Ae=0,$e=0,De=0,ge=0,Ne=0,et=0;function rt(){return Date.now()<$e}function St(){he();const pe=le.value;if(!pe)return;const _e=pe.scrollTop;if(Un()){Ae=_e;return}if(performance.now()-De<100){Ae=_e;return}const He=me();if(rt()){j.value=!0,te.value=!1,Ae=_e;return}_e<Ae-1&&He>1?(j.value=!1,te.value=!0):He<=kg&&_e>Ae+1&&(j.value=!0,te.value=!1),Ae=_e,K()}function gt(pe=!1){const _e=le.value;j.value=!0,te.value=!1,_e&&(!pe&&performance.now()<ge||(pe&&typeof _e.scrollTo=="function"?(De=performance.now(),ge=performance.now()+_ue,_e.scrollTo({top:_e.scrollHeight,behavior:"smooth"})):_e.scrollTop=_e.scrollHeight,Ae=_e.scrollTop))}function It(pe,_e){return(_e.closest("[inert]")?.closest(".tool-group")??_e).getBoundingClientRect().top-pe.getBoundingClientRect().top+pe.scrollTop}function Ut(pe,_e){const He=Array.from(pe.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(rn=>({node:rn,top:It(pe,rn)})),Ot=He.findIndex(rn=>rn.top>=_e),Bt=Ot<0?Math.max(0,He.length-1):Ot;return He.slice(Bt,Bt+2).flatMap(rn=>{const zn=rn.node.dataset.scrollAnchorId,Cs=zn??rn.node.dataset.turnId;return Cs?[{kind:zn?"tool":"turn",id:Cs,top:rn.top}]:[]})}const ht=new Map;function un(pe,_e){for(const He of _e.anchors){const Ot=He.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Bt=pe.querySelector(`[${Ot}="${Wt(He.id)}"]`);if(Bt)return It(pe,Bt)-He.top}return pe.scrollHeight-_e.oldHeight}function dn(pe,_e,He=pe.scrollTop){return pe.scrollTop=He+un(pe,_e),Ae=pe.scrollTop,pe.scrollTop}async function ns(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||En.value||!s.hasMoreMessages)return;const pe=s.sessionId,_e=le.value,He=_e?.scrollTop??0,Ot={anchors:_e?Ut(_e,He):[],oldHeight:_e?.scrollHeight??0};qn(pe,!0),ti();try{if(await mt(),await s.loadOlderMessages(pe),await mt(),s.sessionId!==pe){ht.set(pe,Ot);return}const Bt=le.value;if(!Bt)return;dn(Bt,Ot),ht.delete(pe)}finally{qn(pe,!1)}}function Wt(pe){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(pe):pe.replaceAll(/["\\]/g,"\\$&")}function Pn(pe){const _e=le.value;if(!_e)return;const He=_e.querySelector(`.turn-anchor[data-turn-id="${Wt(pe)}"]`);He&&(Io(),j.value=!1,te.value=me()>kg,He.scrollIntoView({behavior:"smooth",block:"center"}))}function co(){const pe=le.value;if(!pe)return"none";const _e=pe.firstElementChild,He=_e instanceof HTMLElement?_e.offsetHeight:0,Ot=z.value?.offsetHeight??0;return`${pe.scrollHeight}:${pe.clientHeight}:${He}:${Ot}`}function it(pe){return typeof requestAnimationFrame=="function"?requestAnimationFrame(pe):setTimeout(pe,16)}function Gn(pe){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(pe):clearTimeout(pe)}let uo=0,Yn=0,go=null,os=0;function Un(){return performance.now()<uo}function to(pe,_e=260){const He=le.value;if(!He||(go=pe,os=pe.getBoundingClientRect().top,uo=performance.now()+_e,Yn))return;const Ot=()=>{if(Yn=0,performance.now()>=uo||!go){go=null;return}const Bt=go.getBoundingClientRect().top-os;Bt&&(He.scrollTop+=Bt),Yn=it(Ot)};Yn=it(Ot)}function vn(pe=36){if(!j.value&&!rt())return;const _e=++et;let He="",Ot=0,Bt=0;Ne&&(Gn(Ne),Ne=0);const rn=()=>{if(Ne=0,_e!==et||!j.value&&!rt())return;gt(!1);const zn=co();Ot=zn===He?Ot+1:0,He=zn,Bt++,Ot<3&&Bt<pe&&(Ne=it(rn))};Ne=it(rn)}function Zn(pe,_e){return pe!==void 0&&pe.length>0&&_e.length>=pe.length&&pe.firstId!==_e.firstId&&pe.lastId===_e.lastId&&pe.lastTextLen===_e.lastTextLen&&pe.lastThinkingLen===_e.lastThinkingLen&&pe.lastToolsLen===_e.lastToolsLen&&pe.approvalIds===_e.approvalIds}const xn=R(()=>{const pe=(s.approvals??[]).map(rn=>rn.approvalId).join(","),_e=s.turns,He=_e.at(-1),Ot=He?.thinking?.length??0,Bt=He?.tools?.reduce((rn,zn)=>rn+zn.name.length+(zn.arg?.length??0)+(zn.output?.join("").length??0),0)??0;return{length:_e.length,firstId:_e[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:Ot,lastToolsLen:Bt,approvalIds:pe}});Qe(xn,async(pe,_e)=>{if(En.value&&Zn(_e,pe)){K();return}await mt(),j.value||rt()?gt(pe.length<_e.length):te.value=!0,K()}),Qe(z,()=>{is()}),Qe(()=>s.mobile,async()=>{await mt(),ye()});const Cn=new Map;Qe(()=>s.fileReloadKey,async(pe,_e)=>{const He=le.value;_e&&He&&Cn.set(String(_e),{top:He.scrollTop,following:j.value}),Io(),await mt();const Ot=le.value,Bt=pe?Cn.get(String(pe)):void 0;if(Bt&&Ot){const rn=ht.get(String(pe)),zn=rn?dn(Ot,rn,Bt.top):Bt.top;rn&&ht.delete(String(pe)),j.value=Bt.following,Ot.scrollTop=zn,Ae=Ot.scrollTop,te.value=!Bt.following&&me()>1,Bt.following&&vn()}else j.value=!0,Ae=0,gt(!1),vn();K()}),Qe(()=>s.sessionLoading,async(pe,_e)=>{pe||!_e||(j.value=!0,await mt(),vn(),K())}),Qe(()=>s.turnActive,async(pe,_e)=>{pe||!_e||!j.value&&!rt()||(await mt(),vn(48),K())});function An(){j.value=!0,te.value=!1,$e=Date.now()+GC,mt(()=>{gt(!0),vn(16)})}function Do(pe){An(),i("submit",pe)}function ze(pe){j.value=!0,te.value=!1,$e=Date.now()+GC,i("editMessage",pe)}function Xe(pe){const _e=s.queued?.[pe],He=_e?.text??"";y(He,_e?.attachments)&&i("editQueued",pe)}function kt(pe){i("reorderQueue",pe)}function Pt(pe,_e){An(),i("answer",pe,_e)}function On(pe,_e){!pe||!_e||i("approval",pe,_e)}let sn=null,Gt=null,Hn=null,Mn=null,Ct=0,Po=0,Ao=0;const ss=X(new Set),En=R(()=>!!s.sessionId&&ss.value.has(s.sessionId));function qn(pe,_e){const He=new Set(ss.value);_e?He.add(pe):He.delete(pe),ss.value=He}function Ps(){En.value||Ao||(Ao=it(()=>{Ao=0,!En.value&&(Un()||(j.value||rt())&>(!1))}))}function ti(){et++,Ne&&(Gn(Ne),Ne=0),Ao&&(Gn(Ao),Ao=0)}function Io(){const pe=le.value;if($e=0,ti(),uo=0,go=null,pe){const _e=pe.scrollTop;typeof pe.scrollTo=="function"?pe.scrollTo({top:_e,behavior:"auto"}):pe.scrollTop=_e}ge=0,De=Number.NEGATIVE_INFINITY,pe&&(Ae=pe.scrollTop)}function Ss(){const pe=le.value;!pe||pe.scrollHeight-pe.clientHeight<=1&&!s.hasMoreMessages||(j.value=!1,Io(),pe.scrollHeight-pe.clientHeight>1&&(te.value=!0))}function Wi(pe){const _e=le.value;if(!_e)return!1;for(const He of pe.composedPath()){if(He===_e)return!1;if(He instanceof HTMLElement&&He.scrollHeight>He.clientHeight+1&&He.scrollTop>1)return!0}return!1}function Si(pe){pe.defaultPrevented||pe.ctrlKey||pe.shiftKey||pe.deltaY>=0||Wi(pe)||Ss()}function fo(pe){const _e=le.value;if(!_e||pe.defaultPrevented||pe.button!==0||pe.pointerType==="touch")return;const He=_e.getBoundingClientRect(),Ot=_e.offsetWidth-_e.clientWidth,Bt=Ot>0?Ot:12;pe.target===_e&&pe.clientX>=He.right-Bt&&Ss()}let ni=null;function Ci(pe){ni=pe.touches.length===1?pe.touches[0].clientY:null}function ar(pe){const _e=pe.touches.length===1?pe.touches[0].clientY:null;_e!==null&&ni!==null&&_e>ni+2&&!Wi(pe)&&Ss(),ni=_e}function no(){if(!Gt)return;const pe=le.value?.firstElementChild??null;pe!==Hn&&(Hn&&Gt.unobserve(Hn),Hn=pe,pe&&Gt.observe(pe))}function is(){if(!Gt)return;const pe=z.value;pe!==Mn&&(Mn&&Gt.unobserve(Mn),Mn=pe,pe&&Gt.observe(pe))}function rs(){const pe=le.value;ye(),sn&&(sn.disconnect(),pe&&sn.observe(pe,{childList:!0,subtree:!0,characterData:!0})),Gt&&(Gt.disconnect(),Hn=null,Mn=null,pe&&Gt.observe(pe),no(),is()),Ct=pe?.scrollHeight??0,Po=pe?.clientHeight??0,he()}function Lo(){no(),Ps(),he()}function Ai(){typeof document>"u"||document.visibilityState==="visible"&&j.value&&vn()}const Wn=X(!1);let $o=null;function oi(){Wn.value=!0,$o!==null&&clearTimeout($o),$o=setTimeout(()=>{Wn.value=!1},Sue)}function Ue(){oi(),i("interrupt")}function Fe(pe){pe.key==="Escape"&&(s.running||s.working)&&(pe.preventDefault(),Ue())}function oe(){j.value&&Ps()}cn(()=>{mt(()=>{typeof MutationObserver=="function"&&(sn=new MutationObserver(Lo)),typeof ResizeObserver=="function"&&(Gt=new ResizeObserver(()=>{he(),ye();const pe=le.value;if(!pe)return;const{scrollHeight:_e,clientHeight:He}=pe,Ot=_e>Ct+1,Bt=He<Po-1;Ct=_e,Po=He,!Un()&&(Ot||Bt)&&Ps()})),rs(),vn(48),K(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ai),document.addEventListener("keydown",Fe)),window.visualViewport?.addEventListener("resize",oe)})}),bn(()=>{sn&&sn.disconnect(),Gt&&Gt.disconnect(),Ao&&Gn(Ao),Ne&&Gn(Ne),Yn&&Gn(Yn),J&&Gn(J),$o!==null&&clearTimeout($o),m!==null&&(clearTimeout(m),m=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ai),document.removeEventListener("keydown",Fe)),window.visualViewport?.removeEventListener("resize",oe)});function Te(){(g.value??p.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:Te}),(pe,_e)=>(w(),T("section",{class:We(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),xe(xse,{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":D.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:_e[0]||(_e[0]=He=>i("openChanges")),onCopyAll:_e[1]||(_e[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:_e[2]||(_e[2]=He=>h.value?.copyFinalSummary()),onOpenPr:_e[3]||(_e[3]=He=>e.pr&&i("openPr",e.pr.url)),onRenameSession:_e[4]||(_e[4]=(He,Ot)=>i("renameSession",He,Ot)),onForkSession:_e[5]||(_e[5]=He=>i("forkSession",He)),onArchiveSession:_e[6]||(_e[6]=He=>i("archiveSession",He)),onExportSession:_e[7]||(_e[7]=He=>i("exportSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ce("",!0),e.conversationToc?(w(),xe(aue,{key:1,items:P.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:V.value,onSelect:Pn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ce("",!0),_("div",due,[_("div",{ref:fe,class:We(["panes chat-scroll",{"is-following":j.value,"history-prepending":En.value}]),onScrollPassive:St,onWheelPassive:Si,onPointerdownPassive:fo,onTouchstartPassive:Ci,onTouchmovePassive:ar},[_("div",{class:We(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),T(Pe,{key:0},[_e[55]||(_e[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",fue,[_("span",{class:We(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(w(),xe(Ds,{key:0,size:"sm"})):ce("",!0),_("span",null,O(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?ce("",!0):(w(),T("span",hue,O(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(w(),T("div",pue,[re(Xt,{text:C(o)("conversation.switchWorkspace")},{default:Ee(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:_e[8]||(_e[8]=bt(He=>r.value=!r.value,["stop"]))},[re(Ve,{name:"folder",size:"sm"}),_("span",mue,O(a.value),1),re(Ve,{class:We(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(w(),T("div",{key:0,class:"ws-pick-backdrop",onClick:_e[9]||(_e[9]=He=>r.value=!1)})):ce("",!0),r.value?(w(),T("div",gue,[(w(!0),T(Pe,null,ot(u.value,He=>(w(),T("button",{key:He.id,type:"button",class:We(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:bt(Ot=>f(He.id),["stop"])},[_("span",yue,O(He.name),1),_("span",kue,O(He.shortPath),1)],10,vue))),128)),d.value>0?(w(),T("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:_e[10]||(_e[10]=bt(He=>l.value=!l.value,["stop"]))},[_("span",null,O(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):ce("",!0),_e[54]||(_e[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:_e[11]||(_e[11]=bt(He=>{r.value=!1,i("addWorkspace")},["stop"]))},[re(Ve,{name:"plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)])])):ce("",!0)])):e.starting?ce("",!0):(w(),T("button",{key:2,type:"button",class:"empty-add-workspace",onClick:_e[12]||(_e[12]=He=>i("addWorkspace"))},[re(Ve,{name:"folder-plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)]))]),re(H5,{ref_key:"emptyComposerRef",ref:p,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Do,onSteer:_e[13]||(_e[13]=He=>i("steer",He)),onCommand:_e[14]||(_e[14]=He=>i("command",He)),onInterrupt:Ue,onUnqueue:_e[15]||(_e[15]=He=>i("unqueue",He)),onEditQueued:_e[16]||(_e[16]=He=>i("editQueued",He)),onSetPermission:_e[17]||(_e[17]=He=>i("setPermission",He)),onSetThinking:_e[18]||(_e[18]=He=>i("setThinking",He)),onTogglePlan:_e[19]||(_e[19]=He=>i("togglePlan")),onToggleSwarm:_e[20]||(_e[20]=He=>i("toggleSwarm")),onToggleGoal:_e[21]||(_e[21]=He=>i("toggleGoal")),onOpenBtw:_e[22]||(_e[22]=He=>i("command","/btw")),onCreateGoal:_e[23]||(_e[23]=He=>i("createGoal",He)),onControlGoal:_e[24]||(_e[24]=He=>i("controlGoal",He)),onFocusGoal:A,onCompact:_e[25]||(_e[25]=He=>i("compact")),onPickModel:_e[26]||(_e[26]=He=>i("pickModel")),onSelectModel:_e[27]||(_e[27]=He=>i("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),_e[56]||(_e[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(w(),xe(T5,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":j.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:_e[28]||(_e[28]=He=>i("openFile",He)),onOpenMedia:_e[29]||(_e[29]=He=>i("openMedia",He)),onCopyConversationCopied:k,onOpenThinking:_e[30]||(_e[30]=He=>i("openThinking",He)),onOpenCompaction:_e[31]||(_e[31]=He=>i("openCompaction",He)),onOpenAgent:_e[32]||(_e[32]=He=>i("openAgent",He)),onOpenToolDiff:_e[33]||(_e[33]=He=>i("openToolDiff",He)),onEditMessage:ze,onLoadOlderMessages:ns,onUnqueue:_e[34]||(_e[34]=He=>i("unqueue",He)),onEditQueued:Xe,onReorderQueue:kt},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ce("",!0):(w(),xe(tue,{key:0,ref:ve,style:Yt(q.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":v.value,"dock-panel":N.value,"bash-tasks":$.value,"subagent-tasks":I.value,"bash-running":x.value,"subagent-running":L.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ue.value,"question-busy-kind":de.value,"pending-approval":Ce.value,"approval-busy":Ie.value,mobile:e.mobile,onToggleDockPanel:_e[35]||(_e[35]=He=>B(He)),onCloseDockPanel:_e[36]||(_e[36]=He=>U()),onOpenAgent:_e[37]||(_e[37]=He=>i("openAgent",He)),onAnswer:Pt,onDismiss:_e[38]||(_e[38]=He=>i("dismiss",He)),onApproval:On,onCancelTask:_e[39]||(_e[39]=He=>i("cancelTask",He)),onControlGoal:_e[40]||(_e[40]=He=>i("controlGoal",He)),onSubmit:Do,onSteer:_e[41]||(_e[41]=He=>i("steer",He)),onCommand:_e[42]||(_e[42]=He=>i("command",He)),onInterrupt:Ue,onSetPermission:_e[43]||(_e[43]=He=>i("setPermission",He)),onSetThinking:_e[44]||(_e[44]=He=>i("setThinking",He)),onTogglePlan:_e[45]||(_e[45]=He=>i("togglePlan")),onToggleSwarm:_e[46]||(_e[46]=He=>i("toggleSwarm")),onToggleGoal:_e[47]||(_e[47]=He=>i("toggleGoal")),onOpenBtw:_e[48]||(_e[48]=He=>i("command","/btw")),onCreateGoal:_e[49]||(_e[49]=He=>i("createGoal",He)),onFocusGoal:A,onCompact:_e[50]||(_e[50]=He=>i("compact")),onPickModel:_e[51]||(_e[51]=He=>i("pickModel")),onSelectModel:_e[52]||(_e[52]=He=>i("selectModel",He))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),re(Il,{name:"pill"},{default:Ee(()=>[te.value?(w(),T("button",{key:0,class:"newmsg-pill",style:Yt({bottom:`${ie.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:_e[53]||(_e[53]=He=>gt(!0))},[re(Ve,{class:"pill-chevron",name:"chevron-down",size:"md"}),Je(" "+O(C(o)("conversation.newMessages")),1)],12,bue)):ce("",!0)]),_:1}),re(Il,{name:"abort-toast"},{default:Ee(()=>[Wn.value?(w(),T("div",xue,[_("span",wue,O(C(o)("conversation.manuallyAborted")),1)])):ce("",!0)]),_:1})],2))}}),Aue=ct(Cue,[["__scopeId","data-v-0bbe2565"]]),Mue=["aria-selected","onClick"],Eue=Ze({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("div",{class:We(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),T(Pe,null,ot(e.options,i=>(w(),T("button",{key:i.value,class:We(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},O(i.label),11,Mue))),128))],2))}}),gs=ct(Eue,[["__scopeId","data-v-d1aaccd7"]]),Tue={class:"ui-panel-header__title"},Nue={key:0,class:"ui-panel-header__sub"},Iue=Ze({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-panel-header",{wrap:e.wrap}])},[_("span",Tue,O(e.title),1),re(Xt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(w(),T("span",Nue,O(e.subtitle),1)):ce("",!0)]),_:1},8,["text"]),Fn(t.$slots,"default",{},void 0,!0),e.closable?(w(),xe(Dn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])):ce("",!0)],2))}}),La=ct(Iue,[["__scopeId","data-v-c47879ad"]]),Lue={key:0,class:"fp-empty fp-error"},$ue={key:1,class:"fp-empty"},Fue={key:2,class:"fp-loading"},Oue={class:"fp-path"},Rue={class:"fp-meta"},Bue={key:0,class:"fp-lines"},Due={class:"fp-size"},Pue={key:3,class:"fp-search"},Hue=["placeholder"],Wue={key:0,class:"fp-search-count"},zue=["href","aria-label"],Uue={key:1,class:"fp-code"},que={class:"fp-line-table"},jue=["data-line"],Vue={class:"fp-gutter"},Kue=["innerHTML"],Gue={key:1,class:"fp-body fp-code"},Yue={class:"fp-line-table"},Zue=["data-line"],Que={class:"fp-gutter"},Xue=["innerHTML"],Jue={key:2,class:"fp-body"},ede=["srcdoc","title"],tde={key:1,class:"fp-code"},nde={class:"fp-line-table"},ode=["data-line"],sde={class:"fp-gutter"},ide=["innerHTML"],rde={key:3,class:"fp-body fp-pdf-wrap"},lde=["src","title"],ade={key:1,class:"fp-binary-card"},cde={class:"fp-binary-label"},ude={key:4,class:"fp-body fp-table-wrap"},dde={class:"fp-table"},fde=["data-line"],hde={key:5,class:"fp-body fp-image-wrap"},pde=["src","alt"],mde={key:1,class:"fp-binary-card"},gde={class:"fp-binary-icon"},vde={class:"fp-binary-label"},yde={key:6,class:"fp-body fp-code"},kde={class:"fp-line-table"},bde=["data-line"],xde={class:"fp-gutter"},wde=["innerHTML"],_de={key:7,class:"fp-body fp-binary-wrap"},Sde={class:"fp-binary-card"},Cde={class:"fp-binary-icon"},Ade={class:"fp-binary-label"},Mde=Ze({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Tt();function o(le,z){const ae=z?z.split("/").filter(Boolean):[];for(const ie of le.split("/"))ie===""||ie==="."||(ie===".."?ae.pop():ae.push(ie));return ae.join("/")}const s=Kt("resolveImage",async le=>le),i=R(()=>{const le=c.file?.path??"",z=le.lastIndexOf("/");return z>0?le.slice(0,z):""});function r(le){if(/^(https?:|data:|blob:)/i.test(le)||le.startsWith("/"))return le;const z=i.value;return z?o(le,z):le}async function l(le){const z=r(le);return s?s(z):z}In("resolveImage",l);function a(le){let z=le.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(z)||z.startsWith("/"))return le;for(const ie of["#","?"]){const q=z.indexOf(ie);q!==-1&&(z=z.slice(0,q))}const ae=i.value;return{...le,path:o(z,ae)}}const c=e,u=t;function d(le){c.openFile?.(a(le))}const f=X(null),h=R(()=>{const le=c.file;if(!le)return"binary";const z=le.mime??"",ae=le.languageId??"",ie=le.path.toLowerCase();return z==="text/markdown"||ae==="markdown"||ae==="md"||ie.endsWith(".mdx")?"markdown":z==="application/json"||ae==="json"?"json":z==="text/html"||ae==="html"||ie.endsWith(".html")||ie.endsWith(".htm")?"html":z==="application/pdf"||ie.endsWith(".pdf")?"pdf":z==="text/csv"||ae==="csv"||ie.endsWith(".csv")?"csv":z.startsWith("image/")?"image":le.isBinary?"binary":z.startsWith("text/")||ae!==""?"text":"binary"});function p(le){const z=atob(le),ae=Uint8Array.from(z,ie=>ie.charCodeAt(0));return new TextDecoder().decode(ae)}const g=R(()=>{const le=c.file;if(!le)return"";if(le.encoding==="base64")try{return p(le.content)}catch{return le.content}return le.content}),b=R(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),v=R(()=>c.file?(h.value==="json"?b.value:g.value).split(`
|
|
301
|
+
`):[]),m=R(()=>c.file?h.value==="json"?b.value:g.value:""),y=X(""),k=X(0),A=R(()=>{const le=y.value.trim().toLowerCase();if(!le)return[];const z=[];return v.value.forEach((ae,ie)=>{ae.toLowerCase().includes(le)&&z.push(ie+1)}),z});Qe(y,()=>{k.value=0});function $(le,z=!1){le&&mt(()=>{const ae=f.value?.querySelector(".fp-body"),ie=ae?.querySelector(`[data-line="${le}"]`);if(!ae||!ie)return;z&&(ae.scrollTop=0);const q=ae.getBoundingClientRect(),ee=ie.getBoundingClientRect(),ye=ee.top-q.top+ae.scrollTop;ae.scrollTop=ye-ae.clientHeight/2+ee.height/2})}Qe(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function I(le){const z=A.value;z.length!==0&&(k.value=(k.value+le+z.length)%z.length,$(z[k.value]))}function x(le){const z=A.value;return{target:c.line===le,hit:z.includes(le),active:z[k.value]===le}}function L(le){return le<1024?`${le} B`:le<1024*1024?`${(le/1024).toFixed(1)} KB`:`${(le/(1024*1024)).toFixed(1)} MB`}const E=X(!1),F=X(!1);function S(){c.file&&Go(m.value).then(le=>{le&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function N(){c.file&&Go(c.file.path).then(le=>{le&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const D=X("preview"),B=X("preview"),U=X("fit");function H(le){D.value=le}function P(le){B.value=le}function Z(le){U.value=le}Qe(h,le=>{D.value=le==="html"?"preview":"source",B.value="preview",U.value="fit"});const K=R(()=>{const le=c.file;return!le||h.value!=="image"?null:le.sourceUrl?le.sourceUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:le.mime==="image/svg+xml"?`data:${le.mime};charset=utf-8,${encodeURIComponent(le.content)}`:null}),V=R(()=>{const le=c.file;return!le||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:null}),J=R(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,g.value].join(""):"");function he(le){const z=[];let ae="",ie=!1;for(let q=0;q<le.length;q++){const ee=le[q];ee==='"'&&le[q+1]==='"'?(ae+='"',q++):ee==='"'?ie=!ie:ee===","&&!ie?(z.push(ae),ae=""):ae+=ee}return z.push(ae),z}const ne=R(()=>v.value.slice(0,200).map(he));function ue(le){return le.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function de(){const le=c.file;if(!le)return"";const z=le.languageId?.toLowerCase();return z||(le.path.split(".").pop()?.toLowerCase()??"")}function Ce(le){const z=de();let ae=ue(le);return h.value==="json"||z==="json"||z==="jsonc"?(ae=ae.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),ae=ae.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),ae=ae.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ae=ae.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ae):h.value==="html"||z==="html"||z==="xml"||z==="svg"?(ae=ae.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ae=ae.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ae):(ae=ae.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),ae=ae.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ae)}function Ie(le,z=55){return!le||le.length<=z?le:"…"+le.slice(le.length-z+1)}return(le,z)=>(w(),T("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),T("div",Lue,[_("span",null,O(e.error),1),e.closable?(w(),xe(Rt,{key:0,variant:"secondary",size:"sm",onClick:z[0]||(z[0]=ae=>u("close"))},{default:Ee(()=>[Je(O(C(n)("filePreview.close")),1)]),_:1})):ce("",!0)])):!e.file&&!e.loading?(w(),T("div",$ue,O(C(n)("filePreview.empty")),1)):e.loading?(w(),T("div",Fue,[z[7]||(z[7]=_("span",{class:"spinner"},null,-1)),_("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(w(),T(Pe,{key:3},[re(La,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:z[6]||(z[6]=ae=>u("close"))},{default:Ee(()=>[re(Xt,{text:e.file.path},{default:Ee(()=>[_("span",Oue,O(Ie(e.file.path)),1)]),_:1},8,["text"]),_("span",Rue,[e.file.lineCount?(w(),T("span",Bue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ce("",!0),_("span",Due,O(L(e.file.size)),1)]),h.value==="html"?(w(),xe(gs,{key:0,"model-value":D.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":H},null,8,["model-value","options"])):ce("",!0),h.value==="markdown"?(w(),xe(gs,{key:1,"model-value":B.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":P},null,8,["model-value","options"])):ce("",!0),h.value==="image"?(w(),xe(gs,{key:2,"model-value":U.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Z},null,8,["model-value","options"])):ce("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),T("div",Pue,[$n(_("input",{"onUpdate:modelValue":z[1]||(z[1]=ae=>y.value=ae),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Hue),[[_s,y.value]]),y.value.trim()?(w(),T("span",Wue,O(A.value.length),1)):ce("",!0),re(Dn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:z[2]||(z[2]=ae=>I(-1))},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),re(Dn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:z[3]||(z[3]=ae=>I(1))},{default:Ee(()=>[re(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ce("",!0),re(Dn,{size:"sm",class:We({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:N},{default:Ee(()=>[F.value?(w(),xe(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),xe(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),xe(Dn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:z[4]||(z[4]=ae=>u("openExternal"))},{default:Ee(()=>[re(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):ce("",!0),e.externalActions?(w(),xe(Dn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:z[5]||(z[5]=ae=>u("reveal"))},{default:Ee(()=>[re(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):ce("",!0),e.downloadUrl?(w(),T("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[re(Ve,{name:"download",size:"md"})],8,zue)):ce("",!0),!e.file.isBinary&&h.value!=="image"?(w(),xe(Dn,{key:7,size:"sm",class:We({copied:E.value}),label:E.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[E.value?(w(),xe(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),xe(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ce("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),T("div",{key:0,class:We(["fp-body",{"fp-markdown":B.value==="preview"}])},[B.value==="preview"?(w(),xe(zm,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),T("div",Uue,[_("div",que,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",Vue,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,Kue)],10,jue))),128))])]))],2)):h.value==="json"?(w(),T("div",Gue,[_("div",Yue,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",Que,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,Xue)],10,Zue))),128))])])):h.value==="html"?(w(),T("div",Jue,[D.value==="preview"?(w(),T("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:J.value,title:e.file.path},null,8,ede)):(w(),T("div",tde,[_("div",nde,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",sde,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,ide)],10,ode))),128))])]))])):h.value==="pdf"?(w(),T("div",rde,[V.value?(w(),T("iframe",{key:0,class:"fp-pdf-frame",src:V.value,title:e.file.path},null,8,lde)):(w(),T("div",ade,[_("span",cde,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),T("div",ude,[_("table",dde,[_("tbody",null,[(w(!0),T(Pe,null,ot(ne.value,(ae,ie)=>(w(),T("tr",{key:ie,class:We(x(ie+1)),"data-line":ie+1},[_("th",null,O(ie+1),1),(w(!0),T(Pe,null,ot(ae,(q,ee)=>(w(),T("td",{key:ee},O(q),1))),128))],10,fde))),128))])])])):h.value==="image"?(w(),T("div",hde,[K.value?(w(),T("img",{key:0,src:K.value,alt:e.file.path,class:We(["fp-image",{actual:U.value==="actual"}])},null,10,pde)):(w(),T("div",mde,[_("span",gde,[re(Ve,{name:"image-off",size:"lg"})]),_("span",vde,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:L(e.file.size)})),1)]))])):h.value==="text"?(w(),T("div",yde,[_("div",kde,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",xde,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,wde)],10,bde))),128))])])):(w(),T("div",_de,[_("div",Sde,[_("span",Cde,[re(Ve,{name:"file-off",size:"lg"})]),_("span",Ade,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:L(e.file.size)})),1)])]))],64)):ce("",!0)],512))}}),Ede=ct(Mde,[["__scopeId","data-v-62bfaf2d"]]),Tde={class:"tp"},Nde=Ze({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=X(null);return Qe(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||mt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),T("div",Tde,[re(La,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),YC=ct(Nde,[["__scopeId","data-v-cf9c560b"]]),Ide={class:"ap"},Lde={key:0,class:"ap-type"},$de={key:1,class:"ap-reason"},Fde={key:2,class:"ap-field"},Ode={class:"ap-field-body"},Rde={key:3,class:"ap-field"},Bde={class:"ap-field-body ap-live"},Dde={key:4,class:"ap-field"},Pde={class:"ap-field-body ap-progress"},Hde={key:0,class:"ap-call"},Wde={key:1,class:"ap-output"},zde=["onClick"],Ude={key:5,class:"ap-field"},qde={class:"ap-field-body"},jde=8,ZC=5,QC=2,Vde=Ze({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>(n.member.outputLines??[]).map(g=>g.trimEnd()).filter(g=>g.length>0)),r=R(()=>(n.member.text??"").trimEnd());function l(g){const b=[];let v=null,m=0;for(const y of g)y.startsWith("Calling ")?(v={key:`g${m++}`,call:y,output:[]},b.push(v)):v?v.output.push(y):(v={key:`g${m++}`,call:"",output:[y]},b.push(v));return b}const a=R(()=>l(i.value)),c=X(new Set);function u(g){return c.value.has(g)}function d(g){const b=new Set(c.value);b.has(g)?b.delete(g):b.add(g),c.value=b}function f(g){return g.output.length-ZC-QC}function h(g){switch(g){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=X(null);return Qe(()=>i.value.length+r.value.length,()=>{const g=p.value;!g||!(g.scrollHeight-g.scrollTop-g.clientHeight<24)||mt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(g,b)=>(w(),T("div",Ide,[re(La,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:b[0]||(b[0]=v=>o("close"))},{default:Ee(()=>[re(Ri,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Je(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),T("div",Lde,O(e.member.subagentType),1)):ce("",!0),e.member.suspendedReason?(w(),T("div",$de,O(e.member.suspendedReason),1)):ce("",!0),e.member.prompt?(w(),T("div",Fde,[b[1]||(b[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",Ode,O(e.member.prompt),1)])):ce("",!0),r.value?(w(),T("div",Rde,[b[2]||(b[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",Bde,O(r.value),1)])):ce("",!0),a.value.length>0?(w(),T("div",Dde,[b[4]||(b[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",Pde,[(w(!0),T(Pe,null,ot(a.value,v=>(w(),T("div",{key:v.key,class:"ap-group"},[v.call?(w(),T("div",Hde,[b[3]||(b[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Je(" "+O(v.call),1)])):ce("",!0),v.output.length>0?(w(),T("div",Wde,[v.output.length<=jde||u(v.key)?(w(!0),T(Pe,{key:0},ot(v.output,(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)):(w(),T(Pe,{key:1},[(w(!0),T(Pe,null,ot(v.output.slice(0,ZC),(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:m=>d(v.key)}," … ("+O(f(v))+" more) ",9,zde),(w(!0),T(Pe,null,ot(v.output.slice(-QC),(m,y)=>(w(),T("div",{key:"t"+y,class:"ap-out-line"},O(m),1))),128))],64))])):ce("",!0)]))),128))])])):ce("",!0),e.member.summary?(w(),T("div",Ude,[b[5]||(b[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",qde,O(e.member.summary),1)])):ce("",!0)],512)]))}}),Kde=ct(Vde,[["__scopeId","data-v-715bd93e"]]),Gde={class:"diff-lines"},Yde={key:0,class:"hunk-text"},Zde={class:"dl-gutter old"},Qde={class:"dl-gutter new"},Xde={class:"dl-sign"},Jde={class:"dl-text"},efe=Ze({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(w(),T("div",Gde,[(w(!0),T(Pe,null,ot(e.lines,(r,l)=>(w(),T("div",{key:l,class:We(["dl",o(r)])},[r.type==="hunk"?(w(),T("span",Yde,O(r.text),1)):(w(),T(Pe,{key:1},[_("span",Zde,O(t(r)),1),_("span",Qde,O(n(r)),1),_("span",Xde,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",Jde,O(r.text),1)],64))],2))),128))]))}}),z5=ct(efe,[["__scopeId","data-v-2f6bc1cc"]]),tfe={class:"tdp"},nfe={class:"tdp-body"},ofe={key:1,class:"tdp-output"},sfe={key:2,class:"tdp-empty"},ife=Ze({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Tt();return(s,i)=>(w(),T("div",tfe,[re(La,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",nfe,[e.target.lines&&e.target.lines.length>0?(w(),xe(z5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),T("div",ofe,[(w(!0),T(Pe,null,ot(e.target.output,(r,l)=>(w(),T("div",{key:l},O(r),1))),128))])):(w(),T("div",sfe,O(C(o)("diff.noDiff")),1))])]))}}),rfe=ct(ife,[["__scopeId","data-v-76f2fbca"]]),lfe={class:"sc"},afe={key:0,class:"sc-empty"},cfe={key:2,class:"sc-loading","aria-hidden":"true"},ufe={class:"sc-composer"},dfe=["placeholder"],ffe=["disabled"],hfe=Ze({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>n.turns.find(m=>m.role==="user")?.text?.trim()??""),r=R(()=>n.title?.trim()||s("sideChat.title")),l=R(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=X(""),c=X(null),u=X(null);function d(){const v=a.value.trim();v&&(o("send",v),a.value="",mt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const v=u.value;v&&(v.scrollTop=v.scrollHeight)}const h=R(()=>{const v=n.turns;if(v.length===0)return"0";const m=v.at(-1),y=m.thinking?.length??0,k=m.tools?.reduce((A,$)=>A+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${v.length}:${m.text.length}:${y}:${k}`});Qe(h,async()=>{!n.running&&!n.sending||(await mt(),f())});const p=R(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),d())}function b(){const v=c.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}return(v,m)=>(w(),T("div",lfe,[re(La,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:m[0]||(m[0]=y=>o("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),T("div",afe,O(C(s)("sideChat.empty")),1)):(w(),xe(T5,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(w(),T("div",cfe,[re(M5)])):ce("",!0)],512),_("div",ufe,[$n(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":m[1]||(m[1]=y=>a.value=y),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:b,onKeydown:g},null,40,dfe),[[_s,a.value]]),re(Xt,{text:C(s)("sideChat.send")},{default:Ee(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[re(Ve,{name:"arrow-right",size:"sm"})],8,ffe)]),_:1},8,["text"])])]))}}),pfe=ct(hfe,[["__scopeId","data-v-f973798f"]]),mfe={class:"changes-pane"},gfe={class:"dv-path"},vfe={class:"diff-head"},yfe={class:"back-label"},kfe={key:0,class:"empty-state"},bfe={key:1,class:"dv-lines-wrap"},xfe={key:2,class:"empty-state"},wfe={class:"dv-change-count"},_fe={class:"ch-head"},Sfe={class:"br-label"},Cfe={class:"br-name"},Afe={key:0,class:"sync-info"},Mfe={key:0,class:"ahead"},Efe={key:0,class:"behind"},Tfe={key:1,class:"empty-head"},Nfe={key:0,class:"ch-list"},Ife=["onClick"],Lfe={class:"fpath"},$fe={key:1,class:"ch-list ch-tree"},Ffe={class:"tree-list"},Ofe=["onClick"],Rfe={class:"tree-name"},Bfe=["onClick"],Dfe={class:"tree-name"},Pfe={key:2,class:"empty-state"},Hfe={key:3,class:"empty-state"},Wfe=Ze({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=R(()=>o.gitInfo!==null),u=R(()=>o.changes.length>0),d=R(()=>(o.selectedDiffPath??null)!==null),f=R(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=R(()=>o.fileDiff??[]),p=R(()=>o.fileDiffLoading===!0);function g(F){s("open",F)}function b(){s("back")}function v(){s("close")}const m=X("list");function y(F){m.value=F}function k(F){const S={children:[]},N=[...F].sort((D,B)=>D.path.localeCompare(B.path));for(const D of N){const B=D.path.split("/");let U=S;for(let H=0;H<B.length;H++){const P=B[H],Z=H===B.length-1,K=B.slice(0,H+1).join("/");let V=U.children.find(J=>J.name===P&&J.kind===(Z?"file":"folder"));V||(V={name:P,path:K,kind:Z?"file":"folder",status:Z?D.status:void 0,children:[]},U.children.push(V)),U=V}}return S.children}const A=R(()=>k(o.changes)),$=X(new Set);function I(F){return!$.value.has(F)}const x=R(()=>{const F=[];function S(N,D){for(const B of N)F.push({node:B,depth:D}),B.kind==="folder"&&I(B.path)&&S(B.children,D+1)}return S(A.value,0),F});function L(F){const S=new Set($.value);S.has(F.path)?S.delete(F.path):S.add(F.path),$.value=S}function E(F){return`${16+F*16}px`}return(F,S)=>(w(),T("div",mfe,[f.value?(w(),T(Pe,{key:0},[re(La,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[re(Xt,{text:e.selectedDiffPath??""},{default:Ee(()=>[_("span",gfe,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",vfe,[e.hideBack?ce("",!0):(w(),xe(Rt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:Ee(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",yfe,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(w(),T("div",kfe,O(C(n)("diff.loading")),1)):h.value.length>0?(w(),T("div",bfe,[re(z5,{lines:h.value},null,8,["lines"])])):(w(),T("div",xfe,O(C(n)("diff.noDiff")),1))],64)):(w(),T(Pe,{key:1},[re(La,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[_("span",wfe,O(C(n)("diff.changeCount",{count:e.changes.length})),1),re(gs,{"model-value":m.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":y},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",_fe,[c.value?(w(),T(Pe,{key:0},[_("span",Sfe,O(C(n)("diff.branch")),1),_("span",Cfe,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),T("span",Afe,[re(Xt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(w(),T("span",Mfe,"↑"+O(e.gitInfo.ahead),1)):ce("",!0)]),_:1},8,["text"]),re(Xt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(w(),T("span",Efe,"↓"+O(e.gitInfo.behind),1)):ce("",!0)]),_:1},8,["text"])])):ce("",!0)],64)):(w(),T("span",Tfe,O(C(n)("diff.empty")),1))]),u.value&&m.value==="list"?(w(),T("div",Nfe,[(w(!0),T(Pe,null,ot(e.changes,N=>(w(),xe(Xt,{key:N.path,text:N.path},{default:Ee(()=>[_("button",{type:"button",class:"ch-row",onClick:D=>g(N.path)},[_("span",{class:We(["badge",i(N.status)])},O(l(N.status)),3),_("span",Lfe,O(a(N.path)),1)],8,Ife)]),_:2},1032,["text"]))),128))])):u.value&&m.value==="tree"?(w(),T("div",$fe,[_("ul",Ffe,[(w(!0),T(Pe,null,ot(x.value,({node:N,depth:D})=>(w(),T("li",{key:N.path,class:"tree-node"},[N.kind==="folder"?(w(),T("button",{key:0,type:"button",class:"tree-row tree-folder",style:Yt({paddingLeft:E(D)}),onClick:B=>L(N)},[re(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",Rfe,O(N.name),1)],12,Ofe)):(w(),xe(Xt,{key:1,text:N.path},{default:Ee(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Yt({paddingLeft:E(D)}),onClick:B=>g(N.path)},[_("span",{class:We(["badge",i(N.status)])},O(l(N.status)),3),_("span",Dfe,O(N.name),1)],12,Bfe)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),T("div",Pfe,O(C(n)("diff.clean")),1)):(w(),T("div",Hfe,O(C(n)("diff.empty")),1))],64))]))}}),zfe=ct(Wfe,[["__scopeId","data-v-7778610a"]]);function Kk(e,t){let n=null;cn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,mt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),mo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Ufe=["type","value","placeholder","disabled","readonly"],qfe=Ze({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=X();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(w(),T("input",{ref_key:"el",ref:s,class:We(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,Ufe))}}),Vc=ct(qfe,[["__scopeId","data-v-340f0da2"]]),jfe={class:"search-wrap"},Vfe={key:0,class:"tab-strip"},Kfe={key:1,class:"state-row"},Gfe={key:2,class:"state-row unavail"},Yfe={key:3,class:"model-list"},Zfe=["aria-selected","onClick","onMouseenter"],Qfe={class:"check"},Xfe={class:"model-main"},Jfe={class:"model-name"},ehe={class:"model-id"},the={key:0,class:"caps"},nhe={class:"model-provider"},ohe={class:"model-ctx"},she={key:0,class:"empty"},ihe={class:"footer-hint"},rhe=Ze({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=R(()=>new Set(o.starredIds??[]));function r(y){return i.value.has(y)}const l=X(""),a=X(null),c=X(null),u=X("all");Kk(c,a);const d=R(()=>{const y=new Set,k=[{id:"all",label:n("model.allTab")}];for(const A of o.models)y.has(A.provider)||(y.add(A.provider),k.push({id:A.provider,label:A.provider}));return k}),f=R(()=>{const y=l.value.toLowerCase().trim(),k=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const $=(A.displayName??A.model).toLowerCase().includes(y),I=A.provider.toLowerCase().includes(y),x=A.id.toLowerCase().includes(y);return!y||$||I||x});return u.value!=="all"?k:k.sort((A,$)=>{const I=r(A.id)?1:0;return(r($.id)?1:0)-I})}),h=R(()=>f.value),p=X(0);Qe([l,u],()=>{p.value=0}),Qe(d,y=>{y.some(k=>k.id===u.value)||(u.value="all")}),Qe(h,y=>{p.value=Math.min(p.value,Math.max(y.length-1,0))});function g(y){if(y.key==="Escape"){s("close");return}if(y.key==="ArrowDown")y.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(y.key==="ArrowUp")y.preventDefault(),p.value=Math.max(p.value-1,0);else if(y.key==="Enter"){const k=h.value[p.value];k&&s("select",k.id)}}cn(()=>{document.addEventListener("keydown",g)}),bn(()=>{document.removeEventListener("keydown",g)});function b(y){s("select",y)}function v(y){return h.value.indexOf(y)}function m(y){u.value=y}return(y,k)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:k[1]||(k[1]=A=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",jfe,[re(Vc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),T("div",Vfe,[(w(!0),T(Pe,null,ot(d.value,A=>(w(),xe(Rt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:$=>m(A.id)},{default:Ee(()=>[Je(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ce("",!0),e.loading?(w(),T("div",Kfe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(w(),T("div",Gfe,[re(Ve,{name:"alert-triangle",size:"lg"}),_("span",null,O(C(n)("model.unavailable")),1)])):(w(),T("div",Yfe,[(w(!0),T(Pe,null,ot(h.value,A=>(w(),T("div",{key:A.id,class:We(["model-row",{"is-current":A.id===e.current,"is-selected":v(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:$=>b(A.id),onMouseenter:$=>p.value=v(A)},[_("span",Qfe,[A.id===e.current?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",Xfe,[_("span",Jfe,O(A.displayName??A.model),1),_("span",ehe,O(A.id),1),A.capabilities&&A.capabilities.length>0?(w(),T("span",the,[(w(!0),T(Pe,null,ot(A.capabilities,$=>(w(),xe(Ri,{key:$,variant:"info",size:"sm"},{default:Ee(()=>[Je(O($),1)]),_:2},1024))),128))])):ce("",!0)]),_("span",nhe,O(A.provider),1),_("span",ohe,O(C(n)("model.contextSuffix",{size:C(ir)(A.maxContextSize)})),1),re(Dn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt($=>s("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(w(),xe(Ve,{key:0,name:"star",size:"md"})):(w(),xe(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Zfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),T("div",she,O(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ce("",!0)])),_("div",ihe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),lhe=ct(rhe,[["__scopeId","data-v-56cefe51"]]),ahe={key:0,class:"ui-field__label"},che={key:1,class:"ui-field__error"},uhe={key:2,class:"ui-field__hint"},dhe=Ze({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),T("label",ahe,O(e.label),1)):ce("",!0),Fn(t.$slots,"default",{},void 0,!0),e.error?(w(),T("span",che,O(e.error),1)):e.hint?(w(),T("span",uhe,O(e.hint),1)):ce("",!0)],2))}}),hh=ct(dhe,[["__scopeId","data-v-49bce958"]]),fhe=["value","disabled"],hhe=Ze({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(w(),T("select",{class:We(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[Fn(s.$slots,"default",{},void 0,!0)],42,fhe))}}),Qv=ct(hhe,[["__scopeId","data-v-92a040fd"]]),phe={class:"prov-list"},mhe={key:0,class:"state-row"},ghe={key:1,class:"state-row unavail"},vhe={key:2,class:"empty"},yhe={class:"prov-info"},khe={class:"prov-type"},bhe={key:0,class:"prov-url"},xhe={class:"prov-meta"},whe={key:0},_he={class:"prov-actions"},She={key:0,class:"add-section"},Che={key:0,class:"add-btns"},Ahe={key:1,class:"add-form"},Mhe=["value"],Ehe={key:0,class:"add-error"},The={class:"form-btns"},Nhe={class:"footer-hint"},Ihe=Ze({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=X(null);Kk(o);const s=t;function i(b){s("delete",b)}const r=X(!1),l=Bo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=X(""),c=["moonshot","anthropic","openai","custom"];function u(){l.type="moonshot",l.apiKey="",l.baseUrl="",l.defaultModel="",a.value="",r.value=!0}function d(){r.value=!1}function f(){if(!l.apiKey.trim()){a.value=n("providers.apiKeyRequired");return}a.value="",s("add",{type:l.type,apiKey:l.apiKey.trim()||void 0,baseUrl:l.baseUrl.trim()||void 0,defaultModel:l.defaultModel.trim()||void 0}),r.value=!1}function h(b){if(b.key==="Escape"){if(r.value){d();return}s("close")}}cn(()=>document.addEventListener("keydown",h)),bn(()=>document.removeEventListener("keydown",h));function p(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function g(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:v[6]||(v[6]=m=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",phe,[e.loading?(w(),T("div",mhe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(w(),T("div",ghe,[re(Ve,{name:"alert-triangle",size:"md"}),_("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),T("div",vhe,O(C(n)("providers.empty")),1)):(w(!0),T(Pe,{key:3},ot(e.providers,m=>(w(),T("div",{key:m.id,class:"prov-row"},[re(Xt,{text:g(m.status)},{default:Ee(()=>[_("span",{class:We(["status-dot",{"status-dot--empty":m.status!=="connected"&&m.status!=="error"}]),style:Yt(m.status==="connected"||m.status==="error"?{background:p(m.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",yhe,[_("span",khe,O(m.type),1),m.baseUrl?(w(),T("span",bhe,O(m.baseUrl),1)):ce("",!0),_("span",xhe,[re(Ri,{variant:m.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Je(O(m.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),m.models&&m.models.length>0?(w(),T("span",whe," · "+O(C(n)("providers.modelCount",{count:m.models.length})),1)):ce("",!0)])]),_("div",_he,[re(Xt,{text:C(n)("providers.refreshTitle",{type:m.type})},{default:Ee(()=>[re(Rt,{variant:"secondary",size:"sm",onClick:y=>s("refresh",m.id)},{default:Ee(()=>[Je(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),re(Xt,{text:C(n)("providers.deleteTitle",{type:m.type})},{default:Ee(()=>[re(Rt,{variant:"danger-soft",size:"sm",onClick:y=>i(m.id)},{default:Ee(()=>[Je(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ce("",!0):(w(),T("div",She,[r.value?(w(),T("div",Ahe,[re(hh,{label:C(n)("providers.fieldType")},{default:Ee(()=>[re(Qv,{modelValue:l.type,"onUpdate:modelValue":v[2]||(v[2]=m=>l.type=m)},{default:Ee(()=>[(w(),T(Pe,null,ot(c,m=>_("option",{key:m,value:m},O(m),9,Mhe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),re(hh,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[re(Vc,{modelValue:l.apiKey,"onUpdate:modelValue":v[3]||(v[3]=m=>l.apiKey=m),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),re(hh,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[re(Vc,{modelValue:l.baseUrl,"onUpdate:modelValue":v[4]||(v[4]=m=>l.baseUrl=m),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),re(hh,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[re(Vc,{modelValue:l.defaultModel,"onUpdate:modelValue":v[5]||(v[5]=m=>l.defaultModel=m),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(w(),T("div",Ehe,O(a.value),1)):ce("",!0),_("div",The,[re(Rt,{variant:"primary",size:"sm",onClick:f},{default:Ee(()=>[Je(O(C(n)("providers.add")),1)]),_:1}),re(Rt,{variant:"secondary",size:"sm",onClick:d},{default:Ee(()=>[Je(O(C(n)("common.cancel")),1)]),_:1})])])):(w(),T("div",Che,[re(Rt,{variant:"secondary",size:"sm",onClick:v[0]||(v[0]=m=>s("openLogin","moonshot"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),re(Rt,{variant:"secondary",size:"sm",onClick:v[1]||(v[1]=m=>s("openLogin","anthropic"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),re(Rt,{variant:"primary",size:"sm",onClick:u},{default:Ee(()=>[re(Ve,{name:"plus",size:"sm"}),Je(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),_("div",Nhe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Lhe=ct(Ihe,[["__scopeId","data-v-cf73278e"]]),$he={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Fhe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Ohe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},bg=Ze({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),T("svg",$he,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),T("svg",Fhe,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),T("svg",Ohe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Rhe={key:0,class:"center-body"},Bhe={class:"center-text"},Dhe={key:1,class:"nb"},Phe={class:"nb-lead"},Hhe=["href"],Whe={class:"nb-or"},zhe={class:"nb-fallback"},Uhe={class:"nb-fb-text"},qhe=["href"],jhe={class:"nb-code-row"},Vhe={class:"nb-code"},Khe={class:"nb-status"},Ghe={class:"nb-status-text"},Yhe={class:"nb-countdown"},Zhe={key:2,class:"center-body"},Qhe={class:"center-text success-text"},Xhe={class:"center-hint"},Jhe={class:"center-body"},epe={class:"center-text err-text"},tpe={class:"center-hint"},npe={class:"actions"},ope={class:"center-body"},spe={class:"center-text warn-text"},ipe={class:"center-hint"},rpe={class:"actions"},lpe=3,ape=Ze({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=X(!0),s=t,i=e,r=X("starting"),l=X(!1),a=X(null),c=X(0),u=X(!1);let d=null,f=null,h=0;cn(async()=>{await p()}),bn(()=>{v()});async function p(){v(),a.value=null,l.value=!1,h=0,r.value="starting";const $=await i.onStartOAuthLogin();if(!$){r.value="error";return}if($.status==="authenticated"){v(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:$.flowId,verificationUri:$.verificationUri,verificationUriComplete:$.verificationUriComplete,userCode:$.userCode,expiresIn:$.expiresIn,interval:$.interval},c.value=$.expiresIn,r.value="device-code",g(),b($.interval)}function g(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function b($){d&&clearTimeout(d),d=setTimeout(async()=>{const I=await i.onPollOAuthLogin();if(I===null){if(h+=1,h>=lpe){v(),l.value=!0,r.value="error";return}b($);return}h=0,I.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):I.status==="expired"||I.status==="cancelled"?(v(),r.value="expired"):b($)},$*1e3)}function v(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function m(){await p()}async function y(){!a.value||!await Go(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function k(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A($){const I=Math.floor($/60),x=$%60;return`${I}:${String(x).padStart(2,"0")}`}return($,I)=>(w(),xe(qr,{open:o.value,"onUpdate:open":I[0]||(I[0]=x=>o.value=x),title:C(n)("login.title"),"close-on-overlay":!1,onClose:k},{default:Ee(()=>[r.value==="starting"?(w(),T("div",Rhe,[re(Ds,{size:"md"}),_("span",Bhe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(w(),T("div",Dhe,[_("div",Phe,O(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Je(O(C(n)("login.authorizeInBrowser"))+" ",1),re(Ve,{name:"external-link",size:"sm"})],8,Hhe),_("div",Whe,O(C(n)("login.orDivider")),1),_("div",zhe,[_("div",Uhe,[Je(O(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(a.value.verificationUri),9,qhe),Je(O(C(n)("login.fallbackSuffix")),1)]),_("div",jhe,[_("span",Vhe,O(a.value.userCode),1),re(Rt,{class:We(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:y},{default:Ee(()=>[u.value?(w(),T(Pe,{key:0},[re(Ve,{name:"check",size:"sm"}),Je(" "+O(C(n)("login.copied")),1)],64)):(w(),T(Pe,{key:1},[re(Ve,{name:"copy",size:"sm"}),Je(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",Khe,[re(Ds,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",Ghe,O(C(n)("login.waitingAutoClose")),1),_("span",Yhe,O(A(c.value)),1)])])):r.value==="success"?(w(),T("div",Zhe,[re(bg,{kind:"success"}),_("span",Qhe,O(C(n)("login.success")),1),_("span",Xhe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(w(),T(Pe,{key:3},[_("div",Jhe,[re(bg,{kind:"expired"}),_("span",epe,O(C(n)("login.expiredTitle")),1),_("span",tpe,O(C(n)("login.expiredHint")),1)]),_("div",npe,[re(Rt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Rt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),T(Pe,{key:4},[_("div",ope,[re(bg,{kind:"error"}),_("span",spe,O(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",ipe,O(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",rpe,[re(Rt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Rt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):ce("",!0)]),_:1},8,["open","title"]))}}),cpe=ct(ape,[["__scopeId","data-v-8308a28f"]]);function upe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const dpe=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function Fi(e){const t=e.replaceAll("\\","/"),n=dpe.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function fpe(e,t){const n=Fi(t.cwd);return e.find(o=>Fi(o.root)===n)?.id??t.workspaceId??t.cwd}function hpe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(Fi)),r=new Map;for(const d of t){const f=Fi(d.root);i.has(f)||r.has(f)||r.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const h=Fi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:upe(f),sessionCount:0})}const l=new Map;for(const d of n){const f=fpe(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=Fi(d.root);!i.has(f)&&!a.includes(f)&&a.push(f)}const c=[...r.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>r.get(d).root.localeCompare(r.get(f).root));const u=[];for(const d of[...a,...c]){const f=r.get(d),h=l.get(f.id)??l.get(f.root)??0,p=s[f.id]===!1?h:Math.max(f.sessionCount,h);u.push({...f,sessionCount:p})}return u}function ppe(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function XC(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function mpe(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function gpe(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const vpe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function ype(e){return vpe.has(e.type)}const kpe=50,bpe=100,Xv=32*1024,xpe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,kpe)},cancelTask(e){clearTimeout(e)}};function wpe(e,t,n={}){const o=n.scheduler??xpe,s=Math.max(1,Math.floor(n.maxItemsPerSlice??bpe)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const g=()=>{if(u||l!==null||a!==null||d()===0)return;const v=++c,m=()=>{v===c&&p()};l=o.requestFrame(m),a=o.requestTask(m)};p=()=>{f();let v=0;for(;!u&&v<s&&r<i.length;){const m=i[r++];e(m),v+=1}h(),g()};const b=(v=>{if(!u){if(t(v)){const m=i.length>r?i.at(-1):void 0,y=m===void 0?void 0:n.coalesce?.(m,v);y===void 0?i.push(v):i[i.length-1]=y,g();return}if(d()===0){e(v);return}i.push(v),p()}});return b.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},b.discard=v=>{if(u||d()===0)return;let m=r;for(let y=r;y<i.length;y+=1){const k=i[y];v(k)||(i[m++]=k)}i.length=m,h(),d()===0?f():g()},b.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},b}function Jv(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function _pe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=Jv(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=Xv)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+Xv,o.value.length);r<o.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function Spe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=Jv(e.appEvent),i=Jv(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>Xv)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const U5=["blue","mono"],q5=["light","dark","system"],j5=14,Cpe=12,Ape=20;function Mpe(){const e=ao(Ft.accent);return e&&U5.includes(e)?e:"blue"}function Epe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Tpe(){const e=ao(Ft.colorScheme);return e&&q5.includes(e)?e:"system"}function Npe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function Gk(e){return Number.isFinite(e)?Math.min(Ape,Math.max(Cpe,Math.round(e))):j5}function Ipe(){const e=ao(Ft.uiFontSize);return e===null?j5:Gk(Number(e))}function Lpe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Gk(e)}px`)}const Yk=X(Tpe()),Zk=X(Mpe()),Qk=X(Ipe());Qe(Yk,Npe,{immediate:!0});Qe(Zk,Epe,{immediate:!0});Qe(Qk,Lpe,{immediate:!0});function $pe(e){q5.includes(e)&&(Yk.value=e,So(Ft.colorScheme,e))}function Fpe(e){U5.includes(e)&&(Zk.value=e,So(Ft.accent,e))}function Ope(e){const t=Gk(e);Qk.value=t,So(Ft.uiFontSize,String(t))}const Rpe=600,Bpe=250,Zm=250,Dpe=1e3,Ppe=160,zp=X(!1);let va=[],xa=null,Up=-Zm;function Hpe(){va=[],Up=-Zm,zp.value=!1,xa!==null&&(clearTimeout(xa),xa=null)}function Wpe(){zp.value=!0,xa!==null&&clearTimeout(xa),xa=setTimeout(()=>{xa=null,va=[],Up=-Zm,zp.value=!1},Dpe)}function zpe(e){if(e<=0)return;const t=Date.now();va.push({time:t,chars:e});const n=t-Rpe;if(va=va.filter(l=>l.time>=n),t-Up<Zm)return;Up=t;const o=va[0]?.time??t,s=Math.max(t-o,Bpe);va.reduce((l,a)=>l+a.chars,0)/s*1e3>=Ppe&&Wpe()}function V5(){return{colorScheme:Yk,accent:Zk,uiFontSize:Qk,fastMoon:zp,setColorScheme:$pe,setAccent:Fpe,setUiFontSize:Ope,resetFastMoon:Hpe,recordMoonDelta:zpe}}function Upe(e,t,n){return e==="idle"&&!t&&!n}function Xk(e,t){const n=ao(e);return n===null?t:n==="1"}const Jk=X(Xk(Ft.notifyOnComplete,!0)),e2=X(Xk(Ft.notifyOnQuestion,!1)),t2=X(Xk(Ft.notifyOnApproval,!1)),n2=X(typeof Notification<"u"?Notification.permission:"denied"),qpe="/favicon.ico";async function o2(e,t,n){if(!n){e.value=!1,So(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}n2.value=o,o==="granted"&&(e.value=!0,So(t,"1"))}function jpe(e){return o2(Jk,Ft.notifyOnComplete,e)}function Vpe(e){return o2(e2,Ft.notifyOnQuestion,e)}function Kpe(e){return o2(t2,Ft.notifyOnApproval,e)}function s2(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Gpe(e){return{title:wn.global.t("settings.notifyTitle"),body:s2(e,wn.global.t("settings.notifyFallback"))}}function Ype(e,t){return{title:wn.global.t("settings.notifyQuestionTitle"),body:s2(t,e,wn.global.t("settings.notifyQuestionFallback"))}}function Zpe(e,t){return{title:wn.global.t("settings.notifyApprovalTitle"),body:s2(t,e,wn.global.t("settings.notifyApprovalFallback"))}}function i2(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{n2.value=i,i==="granted"&&JC(t,n,o)});return}JC(t,n,o)}}function JC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:qpe});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Qpe(e,t){i2(Jk.value,t,Gpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function Xpe(e){i2(e2.value,e,Ype(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function Jpe(e){i2(t2.value,e,Zpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function eme(){return{notifyOnComplete:Jk,notifyOnQuestion:e2,notifyOnApproval:t2,notifyPermission:n2,setNotifyOnComplete:jpe,setNotifyOnQuestion:Vpe,setNotifyOnApproval:Kpe,maybeNotifyCompletion:Qpe,maybeNotifyQuestion:Xpe,maybeNotifyApproval:Jpe}}function tme(){return ao(Ft.soundOnComplete)==="1"}const du=X(tme());function nme(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let xg=null;function K5(){const e=nme();if(!e)return null;if(xg===null)try{xg=new e}catch{return null}return xg}function G5(){if(!du.value)return;const e=K5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Er("sound: audio context resumed",{state:e.state})},t=>{Er("sound: audio context resume rejected",{error:String(t)})})}let e4=!1;function ome(){if(e4||typeof window>"u")return;e4=!0;const e=()=>{G5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}ome();function sme(e){du.value=e,So(Ft.soundOnComplete,e?"1":"0"),e&&G5()}function t4(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function r2(){const e=K5();if(e===null){Er("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Er("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Er("sound: context resumed for next time",{state:e.state})},t=>{Er("sound: resume rejected",{error:String(t)})});return}try{t4(e,880,0,.16,.18),t4(e,1320,.1,.22,.16),Er("sound: chime scheduled",{state:e.state})}catch(t){Er("sound: failed to play",{error:String(t)})}}function ime(){du.value&&r2()}function rme(){du.value&&r2()}function lme(){du.value&&r2()}function ame(){return{soundOnComplete:du,setSoundOnComplete:sme,maybePlayCompletionSound:ime,maybePlayQuestionSound:rme,maybePlayApprovalSound:lme}}const cme=1e3,ume=4096,n4=32*1024;function dme(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await dt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:XC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],g=dt(),b=new Map;if(await Promise.all(p.map(async m=>{if((m.status==="completed"||m.status==="failed"||m.status==="cancelled")&&!s.has(m.id)&&!((m.outputLines?.length??0)>0))try{const k=await g.getTask(f,m.id,{withOutput:!0,outputBytes:n4});k.outputPreview!==void 0&&b.set(m.id,{preview:k.outputPreview,bytes:k.outputBytes}),s.add(m.id)}catch{}})),b.size===0)return;const v=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:v.map(m=>{const y=b.get(m.id)??(m.backgroundTaskId!==void 0?b.get(m.backgroundTaskId):void 0);return y?{...m,outputPreview:y.preview,outputBytes:y.bytes}:m})}}async function l(f){if(e.activeSessionId!==f)return;const h=dt();let p;try{p=await h.listTasks(f)}catch{return}const g=new Map;await Promise.all(p.map(async y=>{const k=y.status==="running",A=y.status==="completed"||y.status==="failed"||y.status==="cancelled";if(!(!k&&!A)&&!(A&&(s.has(y.id)||(y.outputLines?.length??0)>0)))try{const $=await h.getTask(f,y.id,{withOutput:!0,outputBytes:k?ume:n4});$.outputPreview!==void 0&&g.set(y.id,{preview:$.outputPreview,bytes:$.outputBytes}),A&&s.add(y.id)}catch{}}));const b=e.tasksBySession[f]??[],v=new Map(b.map(y=>[y.id,y])),m=p.map(y=>{const k=v.get(y.id),A=g.get(y.id);return{...y,outputLines:k?.outputLines,text:k?.text,outputPreview:A?.preview??k?.outputPreview,outputBytes:A?.bytes??k?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:XC(m,b)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},cme))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=X(0);let d=null;return Qe(()=>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}),Qe(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,g)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(m=>m.status==="running")||c()},1500):c(),g(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:R(()=>u.value),loadTasksForSession:i}}function fme(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 hme(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
|
|
302
|
+
`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&fme(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const ey="/sessions/";function o4(e){const{pathname:t}=e;if(!t.startsWith(ey))return;const n=t.slice(ey.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function pme(e){return e===void 0||e.length===0?"/":`${ey}${encodeURIComponent(e)}`}const mme=50,ty=5,gme=40402,vme=40410,yme=40902,kme=2e3;function wg(e){return vi(e)&&e.code===yme}const bme=40904;function xme(e){return vi(e)&&e.code===bme}const ca=Bo({}),ph=Bo({}),_g=Bo({}),Yi=Bo(new Set),Qm=new Map,$a=new Map,qp=new Map;let wme=0;const da=new Map,_me=3;let s4=0;function Sme(){return s4+=1,`${Date.now().toString(36)}-${s4}`}function Cme(e){return{generation:Qm.get(e)??0,pending:($a.get(e)?.size??0)>0}}function ny(e){const t=++wme;Qm.set(e,t);const n=$a.get(e)??new Set;return n.add(t),$a.set(e,n),t}function oy(e,t){const n=$a.get(e);if(n===void 0||(n.delete(t),n.size>0))return;$a.delete(e);const o=qp.get(e);qp.delete(e),o?.()}function Ame(e){Qm.delete(e),$a.delete(e),qp.delete(e),da.delete(e)}function Mme(e,t){return!t.pending&&t.generation===(Qm.get(e)??0)}function Eme(e,t){if(($a.get(e)?.size??0)===0){t();return}qp.set(e,t)}function Tme(e,t){const{t:n}=wn.global,{confirm:o}=nf(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:g,updateSessionMessages:b,nextOptimisticMsgId:v,getEventConn:m,syncSessionFromSnapshot:y,reopenSession:k,hasLoadedMessages:A,refreshSessionStatus:$,refreshSessionGoal:I,persistSessionProfile:x,mergedWorkspaces:L,workspacesView:E,status:F,workspaceIdForSession:S,savePermissionToStorage:N,savePlanModeToStorage:D,saveSwarmModeToStorage:B,saveGoalModeToStorage:U,draftModes:H,saveUnread:P,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:K,goalErrorMessage:V,resetFastMoon:J,initialized:he,connectIssue:ne,selectedDiffPath:ue,fileDiffLines:de,fileDiffLoading:Ce}=t;let Ie=!1;async function le(Q){if(e.messagesLoadingMoreBySession[Q])return;const ke=e.messagesBySession[Q];if(!ke||ke.length===0)return;const be=ke[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!1};try{const Oe=await dt().listMessages(Q,{beforeId:be,pageSize:mme}),Ye=[...Oe.items].reverse();b(Q,st=>[...Ye,...st]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[Q]:Oe.hasMore}}catch(Oe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!0},l("loadOlderMessages",Oe,{sessionId:Q})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!1}}}function z(Q){s.loadTasksForSession(Q),q(Q),$(Q),I(Q),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,Q)||r.loadSkillsForSession(Q)}async function ae(Q){const ke=e.activeSessionId;if(ke){ue.value=Q,de.value=[],Ce.value=!0;try{const Oe=await dt().getFileDiff(ke,Q);if(ue.value!==Q)return;de.value=hme(Oe.diff)}catch(be){ue.value===Q&&(de.value=[]),console.warn("[loadFileDiff] diff unavailable for",Q,be)}finally{ue.value===Q&&(Ce.value=!1)}}}function ie(){ue.value=null,de.value=[],Ce.value=!1}async function q(Q){try{const be=await dt().getGitStatus(Q);e.gitStatusBySession={...e.gitStatusBySession,[Q]:be}}catch{}}async function ee(){try{const ke=await dt().getAuth();return e.authReady=ke.ready,e.defaultModel=ke.defaultModel,e.managedProviderStatus=ke.managedProvider?.status??null,ne.value=null,"proceed"}catch(Q){return vi(Q)&&(Q.code===401||Q.code===S5)?(ne.value=null,"server-auth-required"):(ne.value=(Q instanceof Error?Q.message:String(Q)).slice(0,140),"retry")}}async function ye(){let Q=!0;for(;;){const ke=await ee();if(ke!=="retry")return ke;Q&&(ne.value=null,Q=!1),await new Promise(be=>{setTimeout(be,kme)})}}async function fe(){try{const Q=dt();e.config=await Q.getConfig()}catch{}}async function ve(Q){try{const be=await dt().setConfig(Q);return e.config=be,e.defaultModel=be.defaultModel??null,!0}catch(ke){return l("setConfig",ke),!1}}const j=100,te=30,me=720*60*1e3;async function Ae(){const Q=dt(),ke=[];let be,Oe;for(;;){let Ye;try{Ye=await Q.listSessions({pageSize:j,beforeId:be,excludeEmpty:!0})}catch(st){if(ke.length===0)throw st;Oe=st;break}if(ke.push(...Ye.items),!Ye.hasMore||Ye.items.length===0)break;be=Ye.items[Ye.items.length-1].id}return{sessions:ke,error:Oe}}function $e(Q){const ke=new Map(e.sessions.map(be=>[be.id,be.usage]));u(Q.map(be=>{const Oe=ke.get(be.id);return Oe!==void 0&&zv(be.usage)&&!zv(Oe)?{...be,usage:Oe}:be}))}function De(Q){const ke=[...Q],be=new Set(ke.map(Oe=>Oe.id));for(const Oe of e.sessions)be.has(Oe.id)||(ke.push(Oe),be.add(Oe.id));return ke.sort((Oe,Ye)=>new Date(Ye.updatedAt).getTime()-new Date(Oe.updatedAt).getTime()),ke}async function ge(Q){const ke=dt(),be=[],Oe=Date.now(),Ye=jt=>Oe-new Date(jt.updatedAt).getTime();let st,wt=!1,Ht=!0,jn;for(;;){let jt;try{jt=await ke.listSessions({workspaceId:Q,pageSize:ty,beforeId:st,excludeEmpty:!0})}catch(Mt){if(Ht)throw Mt;jn=Mt,wt=!0;break}if(wt=jt.hasMore,jt.items.length===0)break;const oo=jt.items[jt.items.length-1],ls=Ye(oo)>=me;if(!Ht&&ls){const Mt=jt.items.findIndex(Vt=>Ye(Vt)>=me),Nt=Mt>=0?Mt+1:jt.items.length;be.push(...jt.items.slice(0,Nt)),wt=jt.hasMore||Nt<jt.items.length;break}if(be.push(...jt.items),Ht=!1,!jt.hasMore||ls)break;st=oo.id}return{workspaceId:Q,page:{items:be,hasMore:wt},error:jn}}async function Ne(){const Q=e.workspaces;if(Q.length===0){const Mt=await Ae(),Nt=Mt.error===void 0?Mt.sessions:De(Mt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Mt.error===void 0,Mt.error!==void 0&&l("load",Mt.error),Nt}const ke=await Promise.allSettled(Q.map(Mt=>ge(Mt.id))),be=[],Oe=new Set,Ye=new Map,st=new Set;let wt;for(let Mt=0;Mt<ke.length;Mt++){const Nt=ke[Mt];if(Nt.status==="fulfilled"){Ye.set(Nt.value.workspaceId,Nt.value.page),Nt.value.error!==void 0&&(st.size===0&&(wt=Nt.value.error),st.add(Nt.value.workspaceId));for(const Vt of Nt.value.page.items)Oe.has(Vt.id)||(be.push(Vt),Oe.add(Vt.id));continue}st.size===0&&(wt=Nt.reason),st.add(Q[Mt].id)}if(Ye.size===0){l("load",wt);return}const Ht=new Set(Q.filter(Mt=>st.has(Mt.id)).map(Mt=>Mt.root)),jn=new Set(Q.map(Mt=>Mt.id));for(const Mt of e.sessions)!(Mt.workspaceId!==void 0&&jn.has(Mt.workspaceId)?st.has(Mt.workspaceId):Ht.has(Mt.cwd)||st.has(S(Mt)))||Oe.has(Mt.id)||(be.push(Mt),Oe.add(Mt.id));const jt={},oo={},ls={};for(const{id:Mt}of Q){const Nt=Ye.get(Mt);if(Nt===void 0){const Vt=e.sessionsHasMoreByWorkspace[Mt],ho=e.sessionsCursorByWorkspace[Mt],so=e.sessionsInitialCountByWorkspace[Mt];Vt!==void 0&&(jt[Mt]=Vt),ho!==void 0&&(oo[Mt]=ho),so!==void 0&&(ls[Mt]=so);continue}jt[Mt]=Nt.hasMore,oo[Mt]=Nt.items.length>0?Nt.items[Nt.items.length-1].id:void 0,ls[Mt]=Math.max(Nt.items.length,ty)}return e.sessionsHasMoreByWorkspace=jt,e.sessionsCursorByWorkspace=oo,e.sessionsInitialCountByWorkspace=ls,e.sessionsFullyLoaded=!1,be.sort((Mt,Nt)=>new Date(Nt.updatedAt).getTime()-new Date(Mt.updatedAt).getTime()),st.size>0&&l("load",wt),be}async function et(Q){if(e.sessionsLoadingMoreByWorkspace[Q]||e.sessionsHasMoreByWorkspace[Q]===!1)return;const ke=e.sessionsCursorByWorkspace[Q];if(ke!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!0};try{const be=await dt().listSessions({workspaceId:Q,pageSize:te,beforeId:ke,excludeEmpty:!0}),Oe=new Set(e.sessions.map(st=>st.id)),Ye=be.items.filter(st=>!Oe.has(st.id));Ye.length>0&&u([...e.sessions,...Ye]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Q]:be.items.length>0?be.items[be.items.length-1].id:ke},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Q]:be.hasMore}}catch(be){l("loadMoreSessions",be)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!1}}}}async function rt(){if(e.sessionsFullyLoaded)return;const Q=await Ae().catch(Oe=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Oe),null));if(Q===null)return;const ke=Q.error===void 0?Q.sessions:De(Q.sessions);if($e(ke),e.sessionsFullyLoaded=Q.error===void 0,Q.error!==void 0)return;const be={};for(const Oe of e.workspaces)be[Oe.id]=!1;e.sessionsHasMoreByWorkspace=be}async function St(){const Q=await dt().getMeta().catch(()=>null);Q!==null&&(e.serverVersion=Q.serverVersion,e.availableOpenInApps=Q.openInApps,e.dangerousBypassAuth=Q.dangerousBypassAuth,e.backend=Q.backend)}async function gt(){const Q=Date.now();let ke="accepted";ko("app:load:start"),e.loading=!0;const be=!he.value;let Oe=!0;try{if(be&&await ye()==="server-auth-required"){Oe=!1,ke="auth-required";return}const Ye=dt();await Promise.all([Ye.getHealth().catch(()=>null),St(),r.loadModels()]),be||await ee(),await fe(),await It();const st=await Ne(),wt=st??e.sessions;st!==void 0&&$e(st);const Ht=wt[0],jn=e.activeWorkspaceId;!(jn!==null&&L.value.some(ls=>ls.id===jn))&&Ht&&ht(S(Ht)),xn();const oo=typeof window<"u"?o4(window.location):void 0;!e.activeSessionId&&oo!==void 0&&(e.sessions.some(Mt=>Mt.id===oo)||await to(oo))&&await Cn(oo,{urlMode:"replace"}),!e.activeSessionId&&wt.length>0&&await Cn(wt[0].id,{urlMode:"replace"})}catch(Ye){ke="failed",l("load",Ye)}finally{e.loading=!1,Oe&&(he.value=!0),ko("app:load:complete",{status:ke,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-Q})}}async function It(){try{const Q=dt(),[ke,be]=await Promise.all([Q.listWorkspaces().catch(()=>[]),Q.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Ut(ke),e.fsHome=be.home||null,e.recentRoots=be.recentRoots}catch{}}function Ut(Q){const ke=Uf();return Object.keys(ke).length===0?Q:Q.map(be=>{const Oe=ke[be.root];return Oe!==void 0?{...be,name:Oe}:be})}function ht(Q){e.activeWorkspaceId=Q,Z(Q)}function un(Q){ht(Q);const ke=e.sessions.filter(be=>S(be)===Q);if(ke.length>0){const be=ke[0];be&&be.id!==e.activeSessionId&&Cn(be.id)}else g(void 0),Un(void 0,"push")}function dn(Q){const ke=Uf()[Q.root],be=ke!==void 0?{...Q,name:ke}:Q,Oe=Fi(be.root);e.hiddenWorkspaceRoots.some(wt=>Fi(wt)===Oe)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(wt=>Fi(wt)!==Oe),K(e.hiddenWorkspaceRoots));const Ye=e.workspaces.findIndex(wt=>wt.id===be.id||wt.root===be.root);if(Ye===-1){e.workspaces=[be,...e.workspaces];return}const st=[...e.workspaces];st[Ye]=be,e.workspaces=st}function ns(Q){if(Q.type==="workspaceCreated"||Q.type==="workspaceUpdated"){dn(Q.workspace);return}const ke=e.workspaces.find(Oe=>Oe.id===Q.workspaceId)?.root??Q.root;if(ke&&!e.hiddenWorkspaceRoots.includes(ke)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ke],K(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Oe=>Oe.id!==Q.workspaceId&&Oe.root!==ke),e.activeWorkspaceId===Q.workspaceId||e.activeWorkspaceId===ke){const Oe=E.value[0]?.id??null;if(e.activeWorkspaceId=Oe,Oe)Z(Oe);else try{Xc(Ft.activeWorkspace)}catch{}g(void 0),e.sessionLoading=!1,ie(),Un(void 0,"replace")}}function Wt(){g(void 0),Un(void 0,"push")}function Pn(Q){ht(Q),Wt(),ie()}async function co(Q){const ke=L.value.find(jt=>jt.id===Q);if(!ke)return null;const be=dt();let Oe,Ye=ke.root;try{const jt=await be.addWorkspace({root:ke.root});Oe=jt.id,Ye=jt.root,dn(jt)}catch{}const st=r.draftModel.value??void 0,wt=await be.createSession({workspaceId:Oe,cwd:Ye,model:st});r.draftModel.value=null;const Ht=st!==void 0&&(!wt.model||wt.model.length===0)?{...wt,model:st}:wt;f(Ht),ht(wt.workspaceId??Oe??Q),await Cn(wt.id);const jn=wt.id;return H.planMode&&(e.planModeBySession={...e.planModeBySession,[jn]:!0},D()),H.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[jn]:!0},B()),H.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[jn]:!0},U()),H.planMode=!1,H.swarmMode=!1,H.goalMode=!1,jn}async function it(Q,ke,be){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await co(Q);if(!Oe)return;await An(Oe,ke,be)}catch(Oe){l("startSessionAndSendPrompt",Oe)}finally{Yi.delete(Q)}}}async function Gn(Q,ke,be){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await co(Q);if(!Oe)return;const Ye=e.planModeBySession[Oe]??!1,st=e.swarmModeBySession[Oe]??!1,wt=e.sessions.find(jt=>jt.id===Oe),Ht=(wt?.model&&wt.model.length>0?wt.model:e.defaultModel)??void 0;if(!await x({model:Ht,planMode:Ye,swarmMode:st,permissionMode:e.permission},Oe))return;await r.activateSkill(ke,be,Oe)}catch(Oe){l("startSessionAndActivateSkill",Oe)}finally{Yi.delete(Q)}}}async function uo(Q,ke){if(!Yi.has(Q)){Yi.add(Q);try{const be=await co(Q);if(!be)return;await i.openSideChatOn(be,ke)}catch(be){l("startSessionAndOpenSideChat",be)}finally{Yi.delete(Q)}}}async function Yn(Q){const ke=Q.trim();if(!ke)return!1;const be=dt();try{const Oe=await be.addWorkspace({root:ke});return dn(Oe),Pn(Oe.id),!0}catch(Oe){return console.warn("[kimi-web] addWorkspaceByPath failed for",ke,Oe),!1}}async function go(Q){try{return await dt().browseFs(Q)}catch{return{path:"",parent:null,entries:[]}}}async function os(){try{return await dt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Un(Q,ke){if(ke==="none"||typeof window>"u"||!window.history)return;const be=pme(Q);if(window.location.pathname!==be)try{ke==="push"?window.history.pushState(null,"",be):window.history.replaceState(null,"",be)}catch{}}async function to(Q){try{const ke=await dt().getSession(Q);return e.sessions.some(be=>be.id===ke.id)||h(ke),!0}catch{return!1}}function vn(){const Q=o4(window.location);if(Q===void 0){g(void 0);return}if(Q!==e.activeSessionId){if(e.sessions.some(ke=>ke.id===Q)){Cn(Q,{urlMode:"none"});return}(async()=>{if(await to(Q)){await Cn(Q,{urlMode:"none"});return}const ke=e.sessions[0];ke?await Cn(ke.id,{urlMode:"replace"}):(g(void 0),Un(void 0,"replace"))})()}}let Zn=!1;function xn(){Zn||typeof window>"u"||(Zn=!0,window.addEventListener("popstate",vn))}async function Cn(Q,ke){const be=A(Q),Oe=!be&&c.has(Q);c.delete(Q);try{Un(Q,ke?.urlMode??"push"),e.sessionLoading=!be&&!Oe,g(Q),J(),e.unreadBySession[Q]&&(e.unreadBySession={...e.unreadBySession,[Q]:!1},P({[Q]:!1})),ie();const Ye=e.sessions.find(st=>st.id===Q);if(Ye){const st=S(Ye);e.activeWorkspaceId!==st&&ht(st)}if(be){if(await k(Q)==="not-found")return}else if(await y(Q)==="not-found")return;z(Q)}catch(Ye){l("selectSession",Ye,{sessionId:Q})}finally{e.activeSessionId===Q&&(e.sessionLoading=!1)}}async function An(Q,ke,be){const Oe=ny(Q);e.inFlightBySession={...e.inFlightBySession,[Q]:!0};const Ye=v();try{const st=dt(),wt=[];ke&&wt.push({type:"text",text:ke});for(const Vt of be??[])Vt.kind==="video"?wt.push({type:"video",source:{kind:"file",fileId:Vt.fileId}}):Vt.kind==="file"?wt.push({type:"file",fileId:Vt.fileId,name:Vt.name??"",mediaType:Vt.mediaType||"application/octet-stream",size:Vt.size??0}):wt.push({type:"image",source:{kind:"file",fileId:Vt.fileId}});if(wt.length===0)return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},"rejected";const Ht={id:Ye,sessionId:Q,role:"user",content:wt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Q,Vt=>[...Vt,Ht]);const jn=e.sessions.find(Vt=>Vt.id===Q),jt=(jn?.model&&jn.model.length>0?jn.model:e.defaultModel)??void 0,oo=e.planModeBySession[Q]??!1,ls=e.swarmModeBySession[Q]??!1,Mt=e.goalModeBySession[Q]??!1;if(Mt&&ke)try{await st.updateSession(Q,{goalObjective:ke.trim()})}catch(Vt){return l("createGoal",Vt,{sessionId:Q}),e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,ho=>ho.some(so=>so.id===Ye)?ho.filter(so=>so.id!==Ye):ho),"rejected"}const Nt=await st.submitPrompt(Q,{content:wt,model:jt,thinking:r.thinkingLevelForModelId(jt)??e.thinking,permissionMode:e.permission,planMode:oo,swarmMode:ls});return Mt&&(e.goalModeBySession={...e.goalModeBySession,[Q]:!1},U()),e.promptIdBySession={...e.promptIdBySession,[Q]:Nt.promptId},b(Q,Vt=>{const ho=Vt.findIndex(zi=>zi.id===Ye);if(ho===-1)return Vt;const so=[...Vt];return so[ho]={...so[ho],promptId:so[ho].promptId??Nt.promptId},so}),m()?.bindNextPromptId(Q,Nt.promptId),"ok"}catch(st){return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,wt=>wt.some(Ht=>Ht.id===Ye)?wt.filter(Ht=>Ht.id!==Ye):wt),l("sendPrompt",st,{sessionId:Q}),vi(st)?"rejected":"uncertain"}finally{oy(Q,Oe)}}async function Do(Q,ke){const be=e.activeSessionId;if(be){if(a.value!=="idle"||e.inFlightBySession[be]){kt(Q,ke);return}if((e.queuedBySession[be]?.length??0)>0){kt(Q,ke),Pt(be);return}await An(be,Q,ke)}}async function ze(Q,ke){const be=e.activeSessionId;if(!be)return;const Oe=e.queuedBySession[be]??[],Ye=[],st=[];for(const Nt of Oe){const Vt=Nt.text.trim();Vt&&Ye.push(Vt),Nt.attachments?.length&&st.push(...Nt.attachments)}const wt=Q.trim();if(wt&&Ye.push(wt),ke?.length&&st.push(...ke),Ye.length===0&&st.length===0)return;Oe.length>0&&(e.queuedBySession={...e.queuedBySession,[be]:[]});const Ht=Ye.join(`
|
|
303
|
+
|
|
304
|
+
`),jn=()=>{if(Oe.length===0)return;const Nt=e.queuedBySession[be]??[];e.queuedBySession={...e.queuedBySession,[be]:[...Oe,...Nt]}};if(a.value==="idle"&&!e.inFlightBySession[be]){await An(be,Ht,st)==="rejected"&&jn();return}const jt=[];Ht&&jt.push({type:"text",text:Ht});for(const Nt of st)Nt.kind==="video"?jt.push({type:"video",source:{kind:"file",fileId:Nt.fileId}}):Nt.kind==="file"?jt.push({type:"file",fileId:Nt.fileId,name:Nt.name??"",mediaType:Nt.mediaType||"application/octet-stream",size:Nt.size??0}):jt.push({type:"image",source:{kind:"file",fileId:Nt.fileId}});const oo=v(),ls={id:oo,sessionId:be,role:"user",content:jt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(be,Nt=>[...Nt,ls]);const Mt=ny(be);try{const Nt=dt(),Vt=e.sessions.find(zi=>zi.id===be),ho=(Vt?.model&&Vt.model.length>0?Vt.model:e.defaultModel)??void 0,so=await Nt.submitPrompt(be,{content:jt,model:ho,thinking:r.thinkingLevelForModelId(ho)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[be]??!1,swarmMode:e.swarmModeBySession[be]??!1});if(b(be,zi=>{const Ul=zi.findIndex(af=>af.id===oo);if(Ul===-1)return zi;const ql=[...zi];return ql[Ul]={...ql[Ul],promptId:ql[Ul].promptId??so.promptId},ql}),so.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[be]:so.promptId},m()?.bindNextPromptId(be,so.promptId);return}try{await Nt.steerPrompts(be,[so.promptId])}catch{}}catch(Nt){b(be,Vt=>Vt.filter(ho=>ho.id!==oo)),vi(Nt)&&jn(),l("steer",Nt,{sessionId:be})}finally{oy(be,Mt)}}async function Xe(Q,ke){try{const Oe=await dt().uploadFile({file:Q,name:ke});return{fileId:Oe.id,name:Oe.name,mediaType:Oe.mediaType}}catch(be){return l("uploadImage",be),null}}function kt(Q,ke){const be=e.activeSessionId;if(!be)return;const Oe=e.queuedBySession[be]??[],Ye={text:Q,attachments:ke,id:Sme()};e.queuedBySession={...e.queuedBySession,[be]:[...Oe,Ye]}}function Pt(Q){const[ke,...be]=e.queuedBySession[Q]??[];ke!==void 0&&(e.queuedBySession={...e.queuedBySession,[Q]:be},An(Q,ke.text,ke.attachments).then(Oe=>{if(Oe==="ok"){da.delete(Q);return}if(Oe==="uncertain"){da.delete(Q);return}if(!e.sessions.some(jn=>jn.id===Q)){da.delete(Q);return}const Ye=ke.id??ke.text,st=da.get(Q),wt=st!==void 0&&st.key===Ye?st.count+1:1;if(wt>=_me){da.delete(Q),(e.queuedBySession[Q]?.length??0)>0&&Pt(Q);return}da.set(Q,{key:Ye,count:wt});const Ht=e.queuedBySession[Q]??[];e.queuedBySession={...e.queuedBySession,[Q]:[ke,...Ht]}}))}function On(Q,ke){const be=e.inFlightBySession[Q]===!0;if(e.inFlightBySession={...e.inFlightBySession,[Q]:!1},e.promptIdBySession[Q]!==void 0){const Ye={...e.promptIdBySession};delete Ye[Q],e.promptIdBySession=Ye}return Q===e.activeSessionId&&J(),(be||ke?.turnWasActive===!0||(e.turnActiveBySession[Q]??!1))&&Pt(Q),be}function sn(Q,ke){ke.inFlightTurn!==null&&ke.busy||On(Q)}async function Gt(){const Q=e.activeSessionId;if(!Q)return;const ke=e.sessions.find(Ye=>Ye.id===Q);let be=e.promptIdBySession[Q];if(be===void 0){const Ye=ke?.currentPromptId;Ye!==void 0&&Ye.length>0&&!Ye.startsWith("pr_")&&(be=Ye)}const Oe=dt();if(be!==void 0)try{if((await Oe.abortPrompt(Q,be)).aborted)return;const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}catch(Ye){if(vi(Ye)&&Ye.code===gme){const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}else{l("abortCurrentPrompt",Ye,{sessionId:Q});return}}try{await Oe.abortSession(Q)}catch(Ye){l("abortCurrentPrompt",Ye,{sessionId:Q})}}function Hn(Q,ke){const be=e.approvalsBySession[Q]??[];e.approvalsBySession={...e.approvalsBySession,[Q]:be.filter(Oe=>Oe.approvalId!==ke)}}function Mn(Q,ke){const be=e.questionsBySession[Q]??[];e.questionsBySession={...e.questionsBySession,[Q]:be.filter(Oe=>Oe.questionId!==ke)}}async function Ct(Q,ke){const be=e.activeSessionId;if(be&&!ph[Q]){ph[Q]=!0;try{const Oe=dt(),Ye={decision:ke.decision,scope:ke.scope,feedback:ke.feedback,selectedLabel:ke.selectedLabel};await Oe.respondApproval(be,Q,Ye),Hn(be,Q)}catch(Oe){wg(Oe)?Hn(be,Q):l("respondApproval",Oe,{sessionId:be})}finally{delete ph[Q]}}}async function Po(Q,ke){const be=e.activeSessionId;if(be&&!ca[Q]){ca[Q]="answer";try{await dt().respondQuestion(be,Q,ke),Mn(be,Q)}catch(Oe){wg(Oe)?Mn(be,Q):l("respondQuestion",Oe,{sessionId:be})}finally{delete ca[Q]}}}async function Ao(Q){const ke=e.activeSessionId;if(ke&&!ca[Q]){ca[Q]="dismiss";try{await dt().dismissQuestion(ke,Q),Mn(ke,Q)}catch(be){wg(be)?Mn(ke,Q):l("dismissQuestion",be,{sessionId:ke})}finally{delete ca[Q]}}}async function ss(Q){const ke=e.activeSessionId;if(ke&&!_g[Q]){_g[Q]=!0;try{const be=dt(),Oe=(e.tasksBySession[ke]??[]).find(st=>st.id===Q)?.backgroundTaskId;await be.cancelTask(ke,Oe??Q);const Ye=e.tasksBySession[ke]??[];e.tasksBySession={...e.tasksBySession,[ke]:Ye.map(st=>st.id===Q?{...st,status:"cancelled"}:st)}}catch(be){xme(be)||l("cancelTask",be,{sessionId:ke})}finally{delete _g[Q]}}}function En(Q){const ke=e.activeSessionId;ke?(e.planModeBySession={...e.planModeBySession,[ke]:Q},D(),x({planMode:Q})):H.planMode=Q}function qn(){const Q=e.activeSessionId,ke=Q?e.planModeBySession[Q]??!1:H.planMode;En(!ke)}function Ps(Q){const ke=e.activeSessionId;ke?(e.swarmModeBySession={...e.swarmModeBySession,[ke]:Q},B(),x({swarmMode:Q})):H.swarmMode=Q}async function ti(){const Q=e.activeSessionId,be=!(Q?e.swarmModeBySession[Q]??!1:H.swarmMode);be&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Ps(be)}function Io(Q){const ke=e.activeSessionId;ke?(e.goalModeBySession={...e.goalModeBySession,[ke]:Q},U()):H.goalMode=Q}function Ss(){const Q=e.activeSessionId,ke=Q?e.goalModeBySession[Q]??!1:H.goalMode;Io(!ke)}async function Wi(Q){const ke=Q.trim();if(!ke||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:ke}),variant:"primary"}))return;let be=e.activeSessionId;if(!be){const Oe=e.activeWorkspaceId,Ye=Oe&&E.value.some(st=>st.id===Oe)?Oe:E.value[0]?.id??null;if(!Ye)return;try{be=await co(Ye)??void 0}catch(st){l("createGoal",st);return}if(!be)return}try{await dt().updateSession(be,{goalObjective:ke})}catch(Oe){l("createGoal",Oe,{sessionId:be,message:V(Oe)});return}e.goalModeBySession[be]&&(e.goalModeBySession={...e.goalModeBySession,[be]:!1},U()),e.activeSessionId===be?await Do(ke):await An(be,ke)}function Si(Q){const ke=e.activeSessionId;ke&&Promise.resolve(dt().updateSession(ke,{goalControl:Q})).catch(be=>{l("controlGoal",be,{sessionId:ke,message:V(be)})})}function fo(Q){e.permission=Q,N(Q),x({permissionMode:Q})}function ni(Q){const ke=[...e.warnings];ke.splice(Q,1),e.warnings=ke}async function Ci(Q,ke){try{await dt().updateSession(Q,{title:ke}),d(Q,Oe=>({...Oe,title:ke}))}catch(be){l("renameSession",be,{sessionId:Q})}}async function ar(Q,ke){const be=e.workspaces.find(Ye=>Ye.id===Q)?.root,Oe=()=>{e.workspaces=e.workspaces.map(Ye=>Ye.id===Q?{...Ye,name:ke}:Ye)};try{if(await dt().updateWorkspace(Q,{name:ke}),be!==void 0){const Ye=Uf();be in Ye&&(delete Ye[be],ow(Ye))}Oe()}catch(Ye){if(be!==void 0&&vi(Ye)&&Ye.code===vme){ow({...Uf(),[be]:ke}),Oe();return}l("renameWorkspace",Ye)}}async function no(Q){const ke=e.workspaces.find(st=>st.id===Q)?.root??L.value.find(st=>st.id===Q)?.root??Q,be=e.activeSessionId?e.sessions.find(st=>st.id===e.activeSessionId):void 0,Oe=e.activeWorkspaceId===Q||e.activeWorkspaceId===ke,Ye=!!(be&&(be.cwd===ke||be.workspaceId===Q||S(be)===Q));ke&&!e.hiddenWorkspaceRoots.includes(ke)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ke],K(e.hiddenWorkspaceRoots));try{await dt().deleteWorkspace(Q)}catch(st){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",Q,st)}if(e.workspaces=e.workspaces.filter(st=>st.id!==Q&&st.root!==ke),Oe||Ye){const st=E.value[0]?.id??null;if(e.activeWorkspaceId=st,st)Z(st);else try{Xc(Ft.activeWorkspace)}catch{}}(Oe||Ye)&&(g(void 0),e.sessionLoading=!1,ie(),Un(void 0,"replace"))}async function is(Q){try{await dt().archiveSession(Q),p(Q),i.clearSideChatForSession(Q);const{[Q]:be,...Oe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Oe,e.activeSessionId===Q){const Ye=e.sessions[0];Ye?await Cn(Ye.id,{urlMode:"replace"}):(g(void 0),Un(void 0,"replace"))}}catch(ke){l("archiveSession",ke,{sessionId:Q})}}async function rs(Q){if(Ie)return;const ke=Q??e.activeSessionId;if(!ke){const Oe=n("commands.export.noSession");ko("export:failed",{status:"no-session"}),l("exportSession",new Error(Oe),{message:Oe});return}Ie=!0;const be=Date.now();ko("export:start",{sessionId:ke});try{const Oe=nne(),{blob:Ye,fileName:st}=await dt().exportSession(ke,Oe);if(typeof document>"u")throw new Error("Document is unavailable");const wt=URL.createObjectURL(Ye);let Ht;try{Ht=document.createElement("a"),Ht.href=wt,Ht.download=st,document.body.append(Ht),Ht.click()}finally{Ht?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(wt)}catch{}},0)}ko("export:accepted",{sessionId:ke,status:"accepted",zipBytes:Ye.size,durationMs:Date.now()-be})}catch(Oe){const Ye=typeof Oe=="object"&&Oe!==null?Oe:void 0;ko("export:failed",{sessionId:ke,status:"failed",durationMs:Date.now()-be,errorName:typeof Ye?.name=="string"?Ye.name:typeof Oe,errorCode:typeof Ye?.code=="number"?Ye.code:void 0,requestId:typeof Ye?.requestId=="string"?Ye.requestId:void 0,phase:typeof Ye?.phase=="string"?Ye.phase:void 0,httpStatus:typeof Ye?.status=="number"?Ye.status:void 0}),l("exportSession",Oe,{sessionId:ke})}finally{Ie=!1}}async function Lo(Q){try{const ke=await dt().restoreSession(Q);return f(ke),!0}catch(ke){return l("restoreSession",ke,{sessionId:Q}),!1}}function Ai(Q){return dt().listSessions({archivedOnly:!0,beforeId:Q?.beforeId,pageSize:Q?.pageSize??50})}async function Wn(){try{await dt().logout(),await ee(),await gt()}catch(Q){l("logout",Q)}}function $o(Q){const ke=e.activeSessionId;ke&&dt().compactSession(ke,Q).catch(be=>{l("compact",be,{sessionId:ke})})}async function oi(Q){const ke=Q??e.activeSessionId;if(ke)try{const be=await dt().forkSession(ke);f(be),await Cn(be.id)}catch(be){l("fork",be,{sessionId:ke})}}async function Ue(Q=1){const ke=e.activeSessionId;if(!ke)return null;const be=(()=>{const Oe=e.messagesBySession[ke]??[];for(let Ye=Oe.length-1;Ye>=0;Ye--){const st=Oe[Ye];if(st.role==="user"&&!(st.metadata?.origin&&st.metadata.origin.kind!=="user"))return st.content.filter(wt=>wt.type==="text").map(wt=>wt.text).join(`
|
|
305
|
+
`)}return null})();try{return await dt().undoSession(ke,Q),await y(ke),be}catch(Oe){return l("undo",Oe,{sessionId:ke}),null}}function Fe(Q){const ke=e.activeSessionId;if(!ke)return;const be=e.queuedBySession[ke]??[];if(Q<0||Q>=be.length)return;const Oe=[...be];Oe.splice(Q,1),e.queuedBySession={...e.queuedBySession,[ke]:Oe}}function oe(Q,ke){const be=e.activeSessionId;if(!be)return;const Oe=e.queuedBySession[be]??[];if(Q===ke||Q<0||Q>=Oe.length||ke<0||ke>=Oe.length)return;const Ye=[...Oe],[st]=Ye.splice(Q,1);st!==void 0&&(Ye.splice(ke,0,st),e.queuedBySession={...e.queuedBySession,[be]:Ye})}async function Te(Q){const ke=e.activeSessionId;if(!ke)return[];try{return(await dt().listDirectory(ke,{path:Q,includeGitStatus:!0})).items}catch{return[]}}async function pe(Q){const ke=e.activeSessionId;if(!ke)return null;try{const Oe=await dt().readFile(ke,{path:Q});return{path:Oe.path,content:Oe.content,encoding:Oe.encoding,mime:Oe.mime,languageId:Oe.languageId,isBinary:Oe.isBinary,size:Oe.size,lineCount:Oe.lineCount}}catch(be){return console.warn("[kimi-web] readFileContent failed for",Q,be),null}}const _e=10485760;function He(Q){const ke=e.activeSessionId;return ke?dt().getFileDownloadUrl(ke,Q):null}async function Ot(Q,ke){const be=e.activeSessionId;if(!be)return!1;try{return await dt().openFile(be,{path:Q,line:ke}),!0}catch(Oe){return l("openFile",Oe,{sessionId:be}),!1}}async function Bt(Q){const ke=e.activeSessionId;if(!ke)return;const be=F.value.cwd||".";try{await dt().openInApp(ke,Q,be)}catch(Oe){l("openInApp",Oe,{sessionId:ke})}}async function rn(Q){const ke=e.activeSessionId;if(!ke)return!1;try{return await dt().revealFile(ke,{path:Q}),!0}catch(be){return l("revealFile",be,{sessionId:ke}),!1}}async function zn(Q){if(/^(https?:|data:|blob:)/i.test(Q))return Q;const ke=e.activeSessionId;if(!ke)return Q;let be=Q;if(be.startsWith("/")){const Oe=e.sessions.find(Ye=>Ye.id===ke)?.cwd;if(Oe&&(be===Oe||be.startsWith(Oe.endsWith("/")?Oe:`${Oe}/`))){if(be=be.slice(Oe.length).replace(/^\//,""),!be)return Q}else return Q}try{const Ye=await dt().readFile(ke,{path:be,length:_e});return!Ye.isBinary||Ye.encoding!=="base64"||Ye.truncated?Q:`data:${Ye.mime};base64,${Ye.content}`}catch{return Q}}async function Cs(Q){const ke=e.activeSessionId;if(!ke)return[];try{return(await dt().searchFiles(ke,{query:Q,limit:20})).items.map(Ye=>({path:Ye.path,name:Ye.name}))}catch{return[]}}return{loadFileDiff:ae,clearFileDiff:ie,loadGitStatus:q,checkAuth:ee,loadConfig:fe,updateConfig:ve,listAllSessionsGlobal:Ae,load:gt,refreshServerMeta:St,loadWorkspaces:It,loadMoreSessions:et,loadAllSessions:rt,selectWorkspace:ht,openWorkspace:un,upsertWorkspacePreserveOrder:dn,applyWorkspaceEvent:ns,clearActiveSession:Wt,openWorkspaceDraft:Pn,startSessionAndSendPrompt:it,startSessionAndActivateSkill:Gn,startSessionAndOpenSideChat:uo,addWorkspaceByPath:Yn,browseFs:go,getFsHome:os,writeSessionUrl:Un,fetchSessionIntoList:to,onSessionRoutePopState:vn,bindSessionRoute:xn,selectSession:Cn,submitPromptInternal:An,finishPromptLocal:On,localTurnStartState:Cme,isLocalTurnSnapshotCurrent:Mme,afterLocalTurnStartsSettle:Eme,handleSessionSnapshot:sn,sendPrompt:Do,steerPrompt:ze,uploadImage:Xe,enqueue:kt,unqueue:Fe,reorderQueue:oe,abortCurrentPrompt:Gt,respondApproval:Ct,respondQuestion:Po,dismissQuestion:Ao,pendingQuestionActions:ca,pendingApprovalActions:ph,cancelTask:ss,setPlanMode:En,togglePlanMode:qn,setSwarmMode:Ps,toggleSwarmMode:ti,setGoalMode:Io,toggleGoalMode:Ss,createGoal:Wi,controlGoal:Si,setPermission:fo,dismissWarning:ni,renameSession:Ci,renameWorkspace:ar,deleteWorkspace:no,archiveSession:is,exportSession:rs,restoreSession:Lo,loadArchivedSessions:Ai,logout:Wn,compact:$o,forkSession:oi,undo:Ue,listDir:Te,readFileContent:pe,getFileDownloadUrl:He,openWorkspaceFile:Ot,openInApp:Bt,revealWorkspaceFile:rn,resolveImageUrl:zn,searchFiles:Cs,loadOlderMessages:le,refreshSessionSidecars:z,isStartingFirstPrompt:()=>Yi.size>0}}const Y5=Ft.starredModels,i4=new Error("profile persist failed");function Nme(){try{const e=ao(Y5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Ime(e){try{So(Y5,JSON.stringify(e))}catch{}}function Lme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,loadThinkingForModel:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=X([]),d=X(Nme()),f=X({}),h=X({}),p=X([]),g=X(null);function b(V){if(!(V==null||V.length===0))return u.value.find(J=>J.id===V)??u.value.find(J=>J.model===V)}function v(){const V=e.activeSessionId?e.sessions.find(he=>he.id===e.activeSessionId):void 0,J=V===void 0?g.value??e.defaultModel:V.model||e.defaultModel;return b(J)?.id??J??void 0}function m(V){const J=r(V.id);return J!==void 0&&P5(V,J)?J:Gm(V)}function y(V){if(V===void 0)return;const J=b(V);return J===void 0?void 0:m(J)}function k(V){e.thinking=V;const J=v();return V!==void 0&&J!==void 0&&l(J,V),V}Qe(()=>v(),(V,J)=>{if(V===void 0||V===J)return;const he=b(V);he!==void 0&&(e.thinking=m(he))});function A(V){dt().setConfig({thinking:Are(V)}).catch(J=>n("setConfig",J))}async function $(V){try{const he=await dt().listSkills(V);f.value={...f.value,[V]:he}}catch{}}async function I(V){try{const he=await dt().listSkillsForWorkspace(V);h.value={...h.value,[V]:he}}catch{}}async function x(){try{const V=dt();u.value=await V.listModels();const J=b(v());J!==void 0&&(e.thinking=m(J))}catch(V){n("loadModels",V)}}async function L(){try{const V=dt();p.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function E(V){const J=e.activeSessionId,he=b(V),ne=e.thinking,ue=J?e.sessions.find(Ie=>Ie.id===J)?.model:void 0,de=v()!==(he?.id??V),Ce=Mre(he,ne,de,he===void 0?void 0:r(he.id));if(!J)return g.value=V,e.thinking=Ce,Ce!==ne&&Ce!==void 0&&A(Ce),!0;a(J,Ie=>({...Ie,model:V})),Ce!==ne&&(e.thinking=Ce);try{await dt().updateSession(J,{model:V,thinking:Ce!==ne?Ce:void 0})}catch(Ie){return a(J,le=>({...le,model:ue??le.model})),Ce!==ne&&(e.thinking=ne),n("setModel",Ie,{sessionId:J}),!1}return Ce!==ne&&Ce!==void 0&&A(Ce),await o(J),!0}function F(V){const J=new Set(d.value);J.has(V)?J.delete(V):J.add(V),d.value=Array.from(J),Ime(d.value)}async function S(V,J,he){const ne=he??e.activeSessionId;if(!ne)return;const ue=i.value==="idle"&&!e.inFlightBySession[ne],de=`msg_skill_opt_${Date.now().toString(36)}`,Ce=ue?ny(ne):void 0;if(ue){e.inFlightBySession={...e.inFlightBySession,[ne]:!0};const Ie={id:de,sessionId:ne,role:"user",content:[{type:"text",text:`/${V}${J?` ${J}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:J}}};c(ne,le=>[...le,Ie])}try{const Ie=e.sessions.find(ae=>ae.id===ne)?.model,le=(Ie&&Ie.length>0?Ie:e.defaultModel)??void 0;if(!await s({thinking:y(le)??e.thinking},ne))throw i4;await dt().activateSkill(ne,V,J)}catch(Ie){ue&&(e.inFlightBySession={...e.inFlightBySession,[ne]:!1},c(ne,le=>le.filter(z=>z.id!==de))),Ie!==i4&&n("activateSkill",Ie,{sessionId:ne})}finally{Ce!==void 0&&oy(ne,Ce)}}async function N(V){try{await dt().addProvider(V),await Promise.all([L(),x()])}catch(J){n("addProvider",J)}}async function D(V){try{await dt().deleteProvider(V),await Promise.all([L(),x()])}catch(J){n("deleteProvider",J)}}async function B(V){try{const J=await dt().refreshProvider(V);for(const he of J.failed)n("refreshProvider",new Error(he.reason),{message:he.provider});await Promise.all([L(),x()])}catch(J){n("refreshProvider",J)}}async function U(){try{const V=await dt().refreshAllProviders();for(const J of V.failed)n("refreshAllProviders",new Error(J.reason),{message:J.provider});await Promise.all([L(),x()])}catch(V){n("refreshAllProviders",V)}}async function H(){try{return await dt().startOAuthLogin()}catch{return null}}async function P(){try{return await dt().pollOAuthLogin()}catch(V){return console.warn("[kimi-web] pollOAuthLogin failed",V),null}}async function Z(){try{await dt().cancelOAuthLogin()}catch{}}function K(V){const J=k(V);s({thinking:J}),J!==void 0&&A(J)}return{models:u,starredModelIds:d,providers:p,draftModel:g,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:$,loadSkillsForWorkspace:I,loadModels:x,loadProviders:L,setModel:E,thinkingLevelForModelId:y,toggleStarModel:F,activateSkill:S,addProvider:N,deleteProvider:D,refreshProvider:B,refreshAllProviders:U,startOAuthLogin:H,pollOAuthLogin:P,cancelOAuthLogin:Z,setThinking:K}}const Z5="kimiWeb.compaction",$me=/^read[_-]?media(?:file)?$/i,Fme=/^data:([^;]+);base64,(.*)$/s,Ome=/^<(image|video|audio)\s+path="([^"]+)">$/,Rme=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Bme=/Mime type:\s*([^.\s]+)/i,Dme=/Size:\s*(\d+)\s*bytes/i,Pme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Hme="<system>Image compressed to fit model limits:",Wme=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function zme(e){return e.includes(Hme)?e.replace(Wme,""):e}function Ume(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function qme(e){const t=Rme.exec(e.trim());return t?{kind:t[1],path:Ume(t[2])}:null}const Q5=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,jme=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Vme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return Q5.test(o)?o:void 0}const Kme=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Gme(e){const t=Kme.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=jme.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&Q5.test(o)?o:void 0}}function Yme(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 Zme(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 Qme(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Xme(e,t){if(!$me.test(e))return;const n=Zme(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=Ome.exec(h);p&&(s=p[1],o=p[2]);const g=Bme.exec(h);g?.[1]&&(i=g[1]);const b=Dme.exec(h);b?.[1]&&(r=Number(b[1]));const v=Pme.exec(h);v?.[1]&&v[2]&&(l=`${v[1]}x${v[2]}`);continue}const f=Qme(d);f&&(a=f)}if(a===null)return;const c=Fme.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Yme(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Jme(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
306
|
+
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
307
|
+
`));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
|
|
308
|
+
`)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
|
|
309
|
+
`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function e1e(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 t1e(e,t){const n=e.split(`
|
|
310
|
+
`),o=t.split(`
|
|
311
|
+
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function n1e(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:t1e(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function o1e(e){const t=`<prompt>
|
|
312
|
+
`,n=`
|
|
313
|
+
</prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):s1e(e)}function s1e(e){const t=e.split(`
|
|
314
|
+
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
315
|
+
`):e}function i1e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function r1e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
316
|
+
`);return o1e(t)}function l1e(e,t){const n=e.metadata?.origin??{},o=r1e(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function a1e(e,t,n){const{text:o,cron:s}=l1e(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function c1e(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 u1e(e){return e.metadata?.origin?.kind==="compaction_summary"}function d1e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function f1e(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 h1e(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function p1e(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function X5(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let g=0;g<p.tools.length;g++){const b=p.tools[g];if(b.status!=="running")continue;const v={...b,status:"ok"};p.tools[g]=v;const m=p.blocks.find(y=>y.kind==="tool"&&y.tool.id===v.id);m&&m.kind==="tool"&&(m.tool=v)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
|
|
317
|
+
`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
|
|
318
|
+
`):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const g of p)if(g.type==="text"){if(g.text){h.textParts.push(g.text);const b=h.blocks.at(-1);b&&b.kind==="text"?b.text+=`
|
|
319
|
+
`+g.text:h.blocks.push({kind:"text",text:g.text})}}else if(g.type==="thinking"){if(g.thinking){h.thinkingParts.push(g.thinking);const b=h.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
|
|
320
|
+
`+g.thinking:h.blocks.push({kind:"thinking",thinking:g.thinking})}}else if(g.type==="toolUse"){const b=l.get(g.toolCallId),v={id:g.toolCallId,name:g.toolName,arg:typeof g.input=="string"?g.input:JSON.stringify(g.input),status:"running",output:g.outputLines,planPath:g.toolName==="ExitPlanMode"?s[g.toolCallId]?.path:void 0};h.tools.push(v),h.blocks.push({kind:"tool",tool:v}),b&&(h.approval=n1e(b),h.approvalId=b.approvalId)}else if(g.type==="toolResult"){const b=h.tools.findIndex(v=>v.id===g.toolCallId);if(b!==-1){const v=h.tools[b],m={...v,status:g.isError?"error":"ok",output:Jme(g.output),media:g.isError?void 0:Xme(v.name,g.output)};m.name==="ExitPlanMode"&&!m.planPath&&(m.planPath=f1e(m.output)),h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}}function d(h,p){for(const g of p){if(g.type!=="toolUse"||!g.outputLines?.length)continue;const b=h.tools.findIndex(k=>k.id===g.toolCallId);if(b===-1)continue;const v=h.tools[b];if(v.output!==void 0)continue;const m={...v,output:g.outputLines};h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,g=h.source;if(g.kind==="url")return{url:g.url,kind:p};if(g.kind==="base64")return{url:`data:${g.mediaType};base64,${g.data}`,kind:p};if(g.kind==="file"&&n)return{url:n(g.fileId),kind:p,fileId:g.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(u1e(h)){c();const m=h.metadata?.[Z5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(y=>y.type==="text").map(y=>y.text).join(`
|
|
321
|
+
`),compaction:{trigger:m?.trigger,tokensBefore:m?.tokensBefore,tokensAfter:m?.tokensAfter}});continue}if(h.role==="user"){const m=i1e(h);if(c(),m!==void 0){i.push(a1e(h,r++,m));continue}if(!c1e(h))continue;const y=h.metadata?.origin,k=y?.kind==="skill_activation"&&y?.trigger==="user-slash",A=y?.kind==="plugin_command"&&y?.trigger==="user-slash",$=[],I=[];for(const x of h.content){if(x.type==="text")if(k)$.push(y.skillArgs??"");else if(A)$.push(y.commandArgs??"");else{const E=qme(x.text);if(E&&(E.kind==="video"||E.kind==="image")&&n){const N=Vme(E.path);if(N){I.push({url:n(N),kind:E.kind,fileId:N});continue}}const F=Gme(x.text);if(F){I.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=zme(x.text);if(S!==x.text&&S.trim().length===0)continue;$.push(S)}const L=f(x);if(L){I.push({url:L.url,kind:L.kind,name:x.type==="file"?x.name:void 0,fileId:L.fileId});continue}x.type==="file"&&n&&I.push({kind:"file",url:n(x.fileId),fileId:x.fileId,name:x.name,mediaType:x.mediaType||void 0,size:x.size})}i.push({id:h.id,role:"user",no:r++,text:$.join(`
|
|
322
|
+
`),attachments:I.length>0?I:void 0,skillActivation:k?{name:y.skillName,args:y.skillArgs}:void 0,pluginCommand:A?{pluginId:y.pluginId,commandName:y.commandName,args:y.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;d1e(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const b=a;if(b===null)continue;const v=h1e(h.content);if(b.promptId!==void 0&&b.foldedSigs.some(m=>p1e(m,v))){d(b,h.content);continue}b.foldedSigs.push(v),u(b,h.content)}return c(!0),i}function m1e(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,thinkingLevelForModelId:r}=t,l=X({}),a=R(()=>{const E=e.activeSessionId;if(!E)return null;const F=l.value[E];return F?{parentId:E,agentId:F.agentId}:null}),c=R(()=>a.value?.parentId??null),u=R(()=>a.value!==null),d=R(()=>{const E=a.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),f=R(()=>{const E=a.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(F=>F.id===E.agentId&&F.status==="running"):!1}),h=R(()=>{const E=a.value;if(!E)return[];const F=e.sideChatMessagesByAgent[E.agentId]??[];return X5(F,[],S=>dt().getFileUrl(S),f.value)});function p(E,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:F(e.sideChatMessagesByAgent[E]??[])}}function g(E,F){p(E,S=>[...S,F])}function b(E){p(E,F=>{const S=[...F].reverse().findIndex(D=>D.role==="user");if(S===-1)return F;const N=F.length-1-S;return F.filter((D,B)=>B!==N)})}function v(E,F){p(E,S=>{const N=[...S];for(let D=N.length-1;D>=0;D-=1){const B=N[D];if(B.role==="user")return N[D]={...B,promptId:B.promptId??F},N}return S})}function m(E,F,S){S&&p(E,N=>{const D=N.at(-1);if(D?.role==="assistant"){const B=D.content[0],U=B?.type==="text"?B.text:"";return[...N.slice(0,-1),{...D,content:[{type:"text",text:`${U}${S}`}]}]}return[...N,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:S}],createdAt:new Date().toISOString()}]})}function y(E,F,S){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!S)return;const D=(e.sideChatMessagesByAgent[E]??[]).at(-1);(D?.role==="assistant"&&D.content[0]?.type==="text"?D.content[0].text:"").trim().length>0||m(E,F,S)}async function k(E){const F=e.activeSessionId;F&&await A(F,E)}async function A(E,F){if(!l.value[E]){let S;try{({agentId:S}=await dt().startBtw(E))}catch(N){n("openSideChat",N,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[S]:e.sideChatMessagesByAgent[S]??[]},l.value={...l.value,[E]:{agentId:S}},s(),i()?.markSideChannelAgent(S)}F&&F.trim()&&await $(E,F.trim())}async function $(E,F){const S=l.value[E],N=F.trim();if(!S||!N)return;const D=E,B=S.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!0};const U={id:o(),sessionId:D,role:"user",content:[{type:"text",text:N}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(B,U);try{const H=e.sessions.find(K=>K.id===D),P=(H?.model&&H.model.length>0?H.model:e.defaultModel)??void 0,Z=await dt().submitPrompt(D,{content:[{type:"text",text:N}],agentId:B,model:P,thinking:r(P)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[D]??!1,swarmMode:e.swarmModeBySession[D]??!1});v(B,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[D]:[...e.sideChatUserMessageIdsBySession[D]??[],Z.userMessageId]}}catch(H){n("sendSideChatPrompt",H,{sessionId:D}),b(B),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!1}}}function I(){const E=e.activeSessionId;if(!E)return;const{[E]:F,...S}=l.value;l.value=S}async function x(E){const F=a.value;F&&await $(F.parentId,E)}function L(E){if(!l.value[E])return;const{[E]:F,...S}=l.value;l.value=S}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:m,finishSideChatAgent:y,openSideChat:k,openSideChatOn:A,closeSideChat:I,sendSideChatPrompt:x,clearSideChatForSession:L}}const g1e="kimiWeb.optimisticUserMessage",r4="Sub Agent";function v1e(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function y1e(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function k1e(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function Sg(e){return e.role==="user"&&e.metadata?.[g1e]===!0}function b1e(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function x1e(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const w1e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function l4(e){let t="",n=0;for(const o of e.content)o.type==="text"?w1e.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function _1e(e,t){const n=l4(e),o=l4(t);return n.text===o.text&&n.media===o.media}function S1e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(Sg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Sg(s)&&x1e(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Sg(s)&&_1e(s,t))return o}return-1}function C1e(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}const A1e={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function M1e(e){const t=wn.global.t,n=[],o=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?A1e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function E1e(e,t,n){const o=y1e(e);switch(k1e(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[Z5]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!b1e(t.message)){const a=S1e(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=C1e(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===r4&&a.description!==r4?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,M1e(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${wn.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function T1e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function N1e(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||Ba(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:T1e(a.status)}]:[]})}}return[]}const I1e=["queued","working","suspended","completed","failed"];function J5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function L1e(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function $1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:J5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=L1e();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function F1e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of I1e)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function O1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:J5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const Cr=V5(),Ji=eme(),Wd=ame(),e8=Ft.permission,t8=Ft.activeWorkspace,l2=Ft.thinking,n8=Ft.planMode,o8=Ft.swarmMode,s8=Ft.goalMode,a4=40401,i8=Ft.onboarded,r8=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Xc(Ft.codeFont);Xc(Ft.theme);function R1e(){try{const e=ao(e8);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function B1e(e){try{So(e8,e)}catch{}}function l8(){const e=Yd(l2);if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&r8.test(o)&&(t[n]=o);return t}function D1e(){const e=ao(l2);return e&&r8.test(e)?e:void 0}const jp="*",tu=l8();if(Object.keys(tu).length===0){const e=D1e();e!==void 0&&(tu[jp]=e)}function P1e(e){return tu[e]??tu[jp]}function H1e(e,t){tu[e]=t;const n=l8(),o=tu[jp];o!==void 0&&(n[jp]=o),n[e]=t,lu(l2,n)}function Cg(e){const t=ao(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function a2(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);So(e,JSON.stringify(n))}catch{}}function a8(){a2(n8,we.planModeBySession)}function c8(){a2(o8,we.swarmModeBySession)}function u8(){a2(s8,we.goalModeBySession)}function W1e(){try{return ao(t8)}catch{return null}}const d8=Ft.hiddenWorkspaces;function z1e(){try{const e=ao(d8);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function U1e(e){try{So(d8,JSON.stringify(e))}catch{}}function q1e(e){try{So(t8,e)}catch{}}function j1e(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const we=Bo({...v1e(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:R1e(),thinking:void 0,planModeBySession:Cg(n8),swarmModeBySession:Cg(o8),goalModeBySession:Cg(s8),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Hy(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:W1e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:z1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Xm=Bo({planMode:!1,swarmMode:!1,goalMode:!1});function f8(e){we.sessions=e}function Jm(e,t){we.sessions=we.sessions.map(n=>n.id===e?t(n):n)}function V1e(e){we.sessions=[e,...we.sessions.filter(t=>t.id!==e.id)]}function K1e(e){we.sessions=[...we.sessions,e]}function G1e(e){we.sessions=we.sessions.filter(t=>t.id!==e)}function h8(){const e=we.activeSessionId;e&&we.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(we.unreadBySession={...we.unreadBySession,[e]:!1},Wy({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ft.unread&&(we.unreadBySession=Hy(),h8())});function sy(){if(xi===null||!xi.health().stale)return;ko("ws:stale-reconnect",{sessionId:we.activeSessionId,status:"stale"}),Er("ws: stale socket on focus, reconnecting",{activeSessionId:we.activeSessionId}),xi.reconnect();const e=we.activeSessionId;e&&Gp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(h8(),sy())});typeof window<"u"&&(window.addEventListener("focus",sy),window.addEventListener("online",sy));function c2(e){we.activeSessionId=e}function Y1e(e){we.messagesBySession=e}function Z1e(e,t){we.messagesBySession={...we.messagesBySession,[e]:t}}function p8(e,t){we.messagesBySession={...we.messagesBySession,[e]:t(we.messagesBySession[e]??[])}}function Q1e(e){const{[e]:t,...n}=we.messagesBySession;we.messagesBySession=n}function m8(e){xi?.unsubscribe(e),x0e(e),Vp.discard(({meta:t})=>t.sessionId===e),G1e(e),Q1e(e),delete we.approvalsBySession[e],delete we.questionsBySession[e],delete we.tasksBySession[e],delete we.goalBySession[e],delete we.gitStatusBySession[e],delete we.lastSeqBySession[e],delete we.compactionBySession[e],delete we.messagesLoadingMoreBySession[e],delete we.messagesHasMoreBySession[e],delete we.messagesLoadMoreErrorBySession[e],delete iy[e],Kp.delete(e),Dh.delete(e),M8.delete(e),Ame(e),delete we.queuedBySession[e],delete we.promptIdBySession[e],delete we.inFlightBySession[e],delete we.turnActiveBySession[e],delete we.planModeBySession[e],delete we.swarmModeBySession[e],delete we.goalModeBySession[e],a8(),c8(),u8()}const g8=X(null),v8=X([]),y8=X(!1),k8=X(!1),b8=X(null);async function sf(e){let t;try{t=await dt().getSessionStatus(e)}catch{return}Jm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),we.swarmModeBySession={...we.swarmModeBySession,[e]:t.swarmMode},we.planModeBySession={...we.planModeBySession,[e]:t.planMode}}async function X1e(e){const t=we.goalVersionBySession[e]??0;let n;try{n=await dt().getSessionGoal(e)}catch{return}if((we.goalVersionBySession[e]??0)!==t)return;const o={...we.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,we.goalBySession=o}function x8(e,t){const n=t??we.activeSessionId;return n?Promise.resolve(dt().updateSession(n,e)).then(()=>sf(n)).then(()=>!0).catch(o=>(rf("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const w8=Ft.conversationToc;function J1e(){try{const e=ao(w8);return e===null?!0:e==="true"}catch{return!0}}function e0e(e){try{So(w8,e?"true":"false")}catch{}}const _8=X(J1e());function t0e(e){_8.value=e,e0e(e)}function n0e(e){try{return ao(e)??""}catch{return""}}const S8=X(n0e(i8)==="1");function o0e(e){S8.value=e;try{So(i8,e?"1":"0")}catch{}}let xi=null,c4=0;function C8(){return c4+=1,`msg_opt_${Date.now().toString(36)}_${c4}`}function s0e(e,t,n){const o={sessions:we.sessions,activeSessionId:we.activeSessionId,messagesBySession:we.messagesBySession,approvalsBySession:we.approvalsBySession,planReviewByToolCallId:we.planReviewByToolCallId,questionsBySession:we.questionsBySession,tasksBySession:we.tasksBySession,goalBySession:we.goalBySession,goalVersionBySession:we.goalVersionBySession,lastSeqBySession:we.lastSeqBySession,turnActiveBySession:we.turnActiveBySession,compactionBySession:we.compactionBySession,config:we.config,warnings:we.warnings},s=E1e(o,e,{sessionId:t,seq:n});f8(s.sessions),c2(s.activeSessionId),Y1e(s.messagesBySession),we.approvalsBySession=s.approvalsBySession,we.planReviewByToolCallId=s.planReviewByToolCallId,we.questionsBySession=s.questionsBySession,we.tasksBySession=s.tasksBySession,we.goalBySession=s.goalBySession,we.goalVersionBySession=s.goalVersionBySession,we.lastSeqBySession=s.lastSeqBySession,we.turnActiveBySession=s.turnActiveBySession,we.compactionBySession=s.compactionBySession,we.config=s.config??null,we.warnings=s.warnings,e.type==="configChanged"&&(we.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Nn.loadModels(),Nn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(we.swarmModeBySession={...we.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(we.planModeBySession={...we.planModeBySession,[e.sessionId]:e.planMode}))}function i0e(e,t){const n=we.lastSeqBySession[t.sessionId]??0,o=we.turnActiveBySession[t.sessionId]??!1;s0e(e,t.sessionId,t.seq);const s=fs.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&fs.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?fs.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?fs.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&fs.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;we.promptIdBySession[i]!==e.message.promptId&&(we.promptIdBySession={...we.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===we.activeSessionId&&Cr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;Mge(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle",o)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&Age(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&we.promptIdBySession[e.sessionId]===e.promptId&&ut.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&Ege(e.sessionId,e.question),e.type==="approvalRequested"&&Tge(e.sessionId,e.approval)}const Vp=wpe(({appEvent:e,meta:t})=>i0e(e,t),({appEvent:e})=>ype(e),{coalesce:Spe});function A8(){if(xi!==null||typeof WebSocket>"u")return;ko("ws:connection",{status:"connecting"}),we.connection="connecting",xi=dt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ut.applyWorkspaceEvent(t);return}for(const o of _pe({appEvent:t,meta:n}))Vp(o)},onResync(t,n,o){ko("ws:resync",{sessionId:t,status:"required",seq:n}),Vp.flush(),Kp.add(t),Gp.request(t)},onError(t,n,o){ko("ws:error",{status:"failed",errorCode:t,fatal:o}),u2({severity:"error",title:wn.global.t("warnings.wsTitle"),message:n,details:[Qn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){ko("ws:connection",{status:t?"connected":"disconnected"}),we.connected=t,we.connection=t?"connected":"disconnected",t&&(h0e(),ut.refreshServerMeta())}})}const iy={},Kp=new Set,Dh=new Set,M8=new Set;function r0e(e){return vi(e)&&e.code===a4?!0:typeof e=="object"&&e!==null&&e.code===a4}function Qn(e,t){if(!(t==null||t===""))return{label:wn.global.t(`warnings.details.${e}`),value:E8(t)}}function E8(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 l0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function a0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function c0e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function u0e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function u4(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function d0e(e,t,n){const o=Ok(t),s=vi(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Qn("operation",e),Qn("sessionId",n??we.activeSessionId),Qn("connection",we.connection),Qn("timestamp",u0e(i??Date.now()))];return o?l.push(Qn("duration",u4(r)),Qn("request",`${t.method} ${t.path}`),Qn("endpoint",t.url),Qn("requestId",t.requestId),Qn("phase",t.phase),Qn("timeout",`${t.timeoutMs}ms`),Qn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Qn("contentType",t.contentType),Qn("responsePreview",t.bodyPreview),Qn("cause",t.cause)):s?l.push(Qn("duration",u4(r)),Qn("code",t.code),Qn("requestId",t.requestId),Qn("message",t.message),Qn("details",t.details)):l.push(Qn("errorName",l0e(t)),Qn("message",a0e(t)??E8(t)),Qn("stack",c0e(t))),l.filter(a=>a!==void 0)}function f0e(e,t,n={}){const o=Ok(t),s=vi(t),i=n.title??(o?wn.global.t("warnings.daemonNetworkTitle"):s?wn.global.t("warnings.daemonApiTitle"):wn.global.t("warnings.operationFailedTitle")),r=n.message??(o?wn.global.t("warnings.daemonNetworkMessage"):s?t.message:wn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:d0e(e,t,n.sessionId)}}function u2(e){we.warnings=[...we.warnings,e]}function h0e(){const e=wn.global.t("warnings.wsTitle"),t=we.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==we.warnings.length&&(we.warnings=t)}function rf(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=vi(t),s=Ok(t);ko("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),u2(f0e(e,t,n))}const p0e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function m0e(e){if(!vi(e))return;const t=p0e[e.code];return t?wn.global.t(t):void 0}async function g0e(e){if(m8(e),we.activeSessionId!==e)return;const t=we.sessions[0];t?await ut.selectSession(t.id,{urlMode:"replace"}):(c2(void 0),we.sessionLoading=!1,ut.writeSessionUrl(void 0,"replace"))}const d4=new Set;async function v0e(e){if(!d4.has(e)){d4.add(e);try{const t=await dt().getSessionWarnings(e),n=wn.global.t("warnings.noteLabel");for(const o of t)u2(`${n}: ${o.message}`)}catch{}}}async function d2(e){const t=ut.localTurnStartState(e);try{const o=await dt().getSessionSnapshot(e);if(!we.sessions.some(a=>a.id===e))return"ok";Vp.flush();const s=we.lastSeqBySession[e]??0,i=iy[e];if(!(Kp.has(e)||Yp.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Dh.delete(e)||(Dh.add(e),Gp.request(e)),"ok";if(!ut.isLocalTurnSnapshotCurrent(e,t))return ut.afterLocalTurnStartsSettle(e,()=>{Gp.request(e)}),"ok";const l=zv(o.session.usage);Jm(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),Z1e(e,ppe(we.messagesBySession[e]??[],o.messages)),we.tasksBySession={...we.tasksBySession,[e]:mpe(o.subagents,we.tasksBySession[e]??[])},we.messagesHasMoreBySession={...we.messagesHasMoreBySession,[e]:o.hasMoreMessages},we.approvalsBySession={...we.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(we.planReviewByToolCallId={...we.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}we.questionsBySession={...we.questionsBySession,[e]:o.pendingQuestions},we.lastSeqBySession={...we.lastSeqBySession,[e]:o.asOfSeq},iy[e]=o.epoch,Kp.delete(e),Dh.delete(e),ut.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...we.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],we.turnActiveBySession=a}return A8(),xi&&(xi.seedSnapshot(e,o),xi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),b0e(e)),Yp.delete(e),l&&sf(e),v0e(e),"ok"}catch(n){return r0e(n)?(await g0e(e),"not-found"):(rf("getSessionSnapshot",n,{title:wn.global.t("warnings.sessionSnapshotTitle"),message:wn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Gp=gpe(d2);function y0e(e){return Object.prototype.hasOwnProperty.call(we.messagesBySession,e)}const k0e=4,Ar=[],Yp=new Set;function b0e(e){const t=Ar.indexOf(e);for(t!==-1&&Ar.splice(t,1),Ar.unshift(e);Ar.length>k0e;){let n=-1;for(let s=Ar.length-1;s>=0;s--)if(Ar[s]!==we.activeSessionId){n=s;break}if(n===-1)break;const[o]=Ar.splice(n,1);if(o===void 0)break;xi?.unsubscribe(o),Yp.add(o)}}function x0e(e){const t=Ar.indexOf(e);t!==-1&&Ar.splice(t,1),Yp.delete(e)}async function w0e(e){return d2(e)}function f2(e,t){return(we.inFlightBySession[e]??!1)||(we.turnActiveBySession[e]??!1)||(t??we.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function h2(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return wn.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const _0e=3e4,zd=X(0);let Ag=null;function S0e(){Ag===null&&(Ag=setInterval(()=>{zd.value=(zd.value+1)%Number.MAX_SAFE_INTEGER},_0e),Ag.unref?.())}function C0e(e,t){const n=e.split(`
|
|
323
|
+
`),o=t.split(`
|
|
324
|
+
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function A0e(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:C0e(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function M0e(e){return{questionId:e.questionId,sessionId:e.sessionId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function E0e(e){const t=we.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function T0e(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=wn.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=wn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??E0e(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const N0e=R(()=>{const e=we.sessions.find(n=>n.id===we.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:we.workspaceName,branch:t}}),I0e=R(()=>(zd.value,we.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:h2(e.updatedAt),busy:f2(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),L0e=R(()=>we.activeSessionId??""),$0e=R(()=>{const e=we.activeSessionId;if(e)return Nn.skillsBySession.value[e]??[];const t=t1.value;return t?Nn.skillsByWorkspace.value[t]??[]:[]}),p2=R(()=>{const e=we.activeSessionId;return e?we.inFlightBySession[e]??!1:!1}),F0e=R(()=>ut.isStartingFirstPrompt()),fs=m1e(we,{pushOperationFailure:rf,nextOptimisticMsgId:C8,connectEventsIfNeeded:A8,getEventConn:()=>xi,thinkingLevelForModelId:e=>Nn.thinkingLevelForModelId(e)}),lf=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=fs.sideChatTargetBySession.value[e]?.agentId;return(we.tasksBySession[e]??[]).filter(n=>n.id!==t)}),T8=dme(we,lf),O0e=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=new Set(we.sideChatUserMessageIdsBySession[e]??[]),n=(we.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=we.approvalsBySession[e]??[];return X5(n,o,s=>dt().getFileUrl(s),e1.value,we.planReviewByToolCallId)}),e1=R(()=>{const e=we.activeSessionId;return e?(we.turnActiveBySession[e]??!1)||(we.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),R0e=R(()=>p2.value||e1.value),B0e=R(()=>(T8.taskClock.value,lf.value.map(T0e))),N8=R(()=>$1e(lf.value)),D0e=R(()=>O1e(lf.value)),kc=R(()=>{const e=we.activeSessionId;return e?we.goalBySession[e]??null:null}),P0e=R(()=>{const e=we.activeSessionId;return e?N1e(we.messagesBySession[e]??[]):[]}),H0e=R(()=>{const e=we.activeSessionId;return e?we.compactionBySession[e]??null:null}),W0e=R(()=>we.connection),z0e=R(()=>we.loading),U0e=R(()=>we.sessionLoading),q0e=R(()=>{const e=we.activeSessionId;return e?we.messagesLoadingMoreBySession[e]??!1:!1}),j0e=R(()=>{const e=we.activeSessionId;return e?we.messagesHasMoreBySession[e]??!1:!1}),V0e=R(()=>{const e=we.activeSessionId;return e?we.messagesLoadMoreErrorBySession[e]??!1:!1}),K0e=R(()=>we.serverVersion),G0e=R(()=>we.backend),Y0e=R(()=>we.dangerousBypassAuth);function Z0e(){we.dangerousBypassAuth=!1}const Q0e=R(()=>we.permission),X0e=R(()=>we.thinking),I8=R(()=>{const e=we.activeSessionId;return e?we.planModeBySession[e]??!1:Xm.planMode}),J0e=R(()=>{const e=we.activeSessionId;return e?we.swarmModeBySession[e]??!1:Xm.swarmMode}),ege=R(()=>{const e=we.activeSessionId;return e?we.goalModeBySession[e]??!1:Xm.goalMode}),tge=R(()=>{const e=F1e(N8.value);return{plan:I8.value,goal:kc.value&&kc.value.status!=="complete"?{status:kc.value.status,turnsUsed:kc.value.turnsUsed,elapsedMs:kc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),nge=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=dt();return(we.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),oge=R(()=>we.warnings),sge=R(()=>{const e=we.activeSessionId;return e?(we.questionsBySession[e]??[]).map(M0e):[]}),ige=R(()=>{const e=we.activeSessionId;return e?(we.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:A0e(t),agentName:t.agentName})):[]}),m2=R(()=>{const e=we.activeSessionId;return e?(we.approvalsBySession[e]??[]).length>0?"awaiting-approval":(we.questionsBySession[e]??[]).length>0?"awaiting-question":p2.value||e1.value?"running":"idle":"idle"}),Nn=Lme(we,{pushOperationFailure:rf,refreshSessionStatus:sf,persistSessionProfile:x8,activity:m2,loadThinkingForModel:P1e,saveThinkingToStorage:H1e,updateSession:Jm,updateSessionMessages:p8}),ry=R(()=>{const e=we.activeSessionId;if(!e)return null;const t=we.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),rge=R(()=>{const e=we.activeSessionId;return e?we.gitStatusBySession[e]?.pullRequest??null:null}),lge=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=we.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),age=R(()=>{const e=we.activeSessionId;if(!e)return null;const t=we.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),L8=R(()=>{const e=we.sessions.find(r=>r.id===we.activeSessionId),t=ry.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Nn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??we.defaultModel)??"—",s=Nn.models.value.find(r=>r.id===o)??Nn.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:we.permission,branch:t,cwd:e?.cwd??"",isGitRepo:ry.value!==null}}),cge=R(()=>v8.value),uge=R(()=>we.sessions.find(t=>t.id===we.activeSessionId)?.usage.totalCostUsd??0),dge=R(()=>we.authReady),fge=R(()=>we.defaultModel),hge=R(()=>we.managedProviderStatus),pge=R(()=>we.config),mge=R(()=>{const e=we.activeSessionId;if(!e)return{};const t=we.gitStatusBySession[e];return t?{...t.entries}:{}});function nu(e){const t=Fi(e.cwd);return we.workspaces.find(n=>Fi(n.root)===t)?.id??e.workspaceId??e.cwd}const g2=R(()=>hpe({workspaces:we.workspaces,sessions:we.sessions,hiddenWorkspaceRoots:we.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:we.sessionsHasMoreByWorkspace})),Zp=X(SI()),ou=X(CI()==="manual"?"manual":"recent");Qe(()=>[g2.value.map(e=>e.id).join("\0"),we.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=PI(n,Zp.value);o!==null&&(Zp.value=o,wA(o))});const Fa=R(()=>{const e=g2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:j1e(t.root,we.fsHome),sessionCount:t.sessionCount}));if(ou.value==="recent"){const t=new Map;for(const n of we.sessions){if(n.parentSessionId)continue;const o=nu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return zI(e,t)}return HI(e,Zp.value)}),t1=R(()=>{const e=we.activeWorkspaceId,t=Fa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Qe(t1,e=>{e&&(Object.prototype.hasOwnProperty.call(Nn.skillsByWorkspace.value,e)||Nn.loadSkillsForWorkspace(e))},{immediate:!0});const gge=R(()=>{const e=t1.value;return e?Fa.value.find(t=>t.id===e)??null:null}),vge=R(()=>{zd.value;const e=new Set(Fa.value.map(n=>n.id)),t=new Map(Fa.value.map(n=>[n.id,n.name]));return we.sessions.filter(n=>!n.parentSessionId&&e.has(nu(n))).map(n=>{const o=nu(n);return{id:n.id,title:n.title,time:h2(n.updatedAt),busy:f2(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),yge=R(()=>{zd.value;const e=new Map;for(const t of we.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=nu(t),o={id:t.id,title:t.title,time:h2(t.updatedAt),busy:f2(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Fa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:we.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:we.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:we.sessionsInitialCountByWorkspace[t.id]??ty}))});function kge(e){Zp.value=e,wA(e),ou.value!=="manual"&&(ou.value="manual",_A("manual"))}function bge(e){ou.value!==e&&(ou.value=e,_A(e))}const $8=R(()=>{const e={};for(const[t,n]of Object.entries(we.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(we.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),xge=R(()=>{const e={};for(const[t,n]of Object.entries(we.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(we.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),wge=R(()=>{const e={};for(const[t,n]of Object.entries(we.unreadBySession))n&&(e[t]=!0);return e}),_ge=R(()=>{const e={},t=$8.value;for(const n of we.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=nu(n);e[s]=(e[s]??0)+o}return e}),Sge=R(()=>we.recentRoots),Cge=R(()=>we.availableOpenInApps),ut=Tme(we,{taskPoller:T8,sideChat:fs,modelProvider:Nn,pushOperationFailure:rf,activity:m2,sessionsKnownEmpty:M8,setSessions:f8,updateSession:Jm,upsertSessionFront:V1e,appendSession:K1e,forgetSession:m8,setActiveSessionId:c2,updateSessionMessages:p8,nextOptimisticMsgId:C8,getEventConn:()=>xi,syncSessionFromSnapshot:d2,reopenSession:w0e,hasLoadedMessages:y0e,refreshSessionStatus:sf,refreshSessionGoal:X1e,persistSessionProfile:x8,mergedWorkspaces:g2,workspacesView:Fa,status:L8,workspaceIdForSession:nu,savePermissionToStorage:B1e,savePlanModeToStorage:a8,saveSwarmModeToStorage:c8,saveGoalModeToStorage:u8,draftModes:Xm,saveUnread:Wy,saveActiveWorkspaceToStorage:q1e,saveHiddenWorkspacesToStorage:U1e,goalErrorMessage:m0e,resetFastMoon:Cr.resetFastMoon,initialized:k8,connectIssue:b8,selectedDiffPath:g8,fileDiffLines:v8,fileDiffLoading:y8});function v2(e){return e===we.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function Age(e){if(we.turnActiveBySession[e]){const t={...we.turnActiveBySession};delete t[e],we.turnActiveBySession=t}we.inFlightBySession[e]&&(we.inFlightBySession={...we.inFlightBySession,[e]:!1})}function Mge(e,t,n){const o=we.promptIdBySession[e];ut.finishPromptLocal(e,{turnWasActive:n}),e===we.activeSessionId?(ut.loadGitStatus(e),sf(e)):t==="idle"&&(we.unreadBySession={...we.unreadBySession,[e]:!0},Wy({[e]:!0}));const s=(we.approvalsBySession[e]??[]).length>0,i=(we.questionsBySession[e]??[]).length>0;Upe(t,s,i)&&Ji.maybeNotifyCompletion(e,{isUserWatching:v2(e),sessionTitle:we.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{ut.selectSession(e)}}),t==="idle"&&Wd.maybePlayCompletionSound()}function Ege(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Ji.maybeNotifyQuestion({isUserWatching:v2(e),sessionTitle:we.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ut.selectSession(e)}}),Wd.maybePlayQuestionSound()}function Tge(e,t){Ji.maybeNotifyApproval({isUserWatching:v2(e),sessionTitle:we.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ut.selectSession(e)}}),Wd.maybePlayApprovalSound()}function y2(){return S0e(),{workspace:N0e,sessions:I0e,activeSessionId:L0e,workspacesView:Fa,workspaceSortMode:ou,visibleWorkspace:gge,activeWorkspaceId:t1,sessionsForView:vge,workspaceGroups:yge,attentionBySession:$8,pendingBySession:xge,attentionByWorkspace:_ge,unreadBySession:wge,recentRoots:Sge,turns:O0e,tasks:B0e,activeAppTasks:lf,todos:P0e,goal:kc,swarms:N8,swarmMembersByToolCallId:D0e,activationBadges:tge,compaction:H0e,status:L8,sessionCost:uge,fileDiff:cge,selectedDiffPath:g8,fileDiffLoading:y8,changes:lge,gitInfo:ry,gitDiffStats:age,activePullRequest:rge,changesByPath:mge,pendingApprovals:ige,availableOpenInApps:Cge,connection:W0e,loading:z0e,sessionLoading:U0e,loadingMoreMessages:q0e,hasMoreMessages:j0e,loadMoreMessagesError:V0e,serverVersion:K0e,backend:G0e,dangerousBypassAuth:Y0e,clearDangerousBypassAuth:Z0e,initialized:k8,connectIssue:b8,permission:Q0e,thinking:X0e,planMode:I8,swarmMode:J0e,goalMode:ege,queued:nge,warnings:oge,questions:sge,activity:m2,turnActive:e1,inFlight:p2,working:R0e,isStartingFirstPrompt:F0e,fastMoon:Cr.fastMoon,models:Nn.models,starredModelIds:Nn.starredModelIds,providers:Nn.providers,uiFontSize:Cr.uiFontSize,setUiFontSize:Cr.setUiFontSize,conversationToc:_8,setConversationToc:t0e,colorScheme:Cr.colorScheme,setColorScheme:Cr.setColorScheme,accent:Cr.accent,setAccent:Cr.setAccent,notifyOnComplete:Ji.notifyOnComplete,notifyOnQuestion:Ji.notifyOnQuestion,notifyOnApproval:Ji.notifyOnApproval,notifyPermission:Ji.notifyPermission,setNotifyOnComplete:Ji.setNotifyOnComplete,setNotifyOnQuestion:Ji.setNotifyOnQuestion,setNotifyOnApproval:Ji.setNotifyOnApproval,soundOnComplete:Wd.soundOnComplete,setSoundOnComplete:Wd.setSoundOnComplete,onboarded:S8,setOnboarded:o0e,load:ut.load,selectSession:ut.selectSession,clearActiveSession:ut.clearActiveSession,loadOlderMessages:ut.loadOlderMessages,loadWorkspaces:ut.loadWorkspaces,loadMoreSessions:ut.loadMoreSessions,loadAllSessions:ut.loadAllSessions,selectWorkspace:ut.selectWorkspace,openWorkspace:ut.openWorkspace,openWorkspaceDraft:ut.openWorkspaceDraft,startSessionAndSendPrompt:ut.startSessionAndSendPrompt,startSessionAndActivateSkill:ut.startSessionAndActivateSkill,startSessionAndOpenSideChat:ut.startSessionAndOpenSideChat,addWorkspaceByPath:ut.addWorkspaceByPath,browseFs:ut.browseFs,getFsHome:ut.getFsHome,sendPrompt:ut.sendPrompt,steerPrompt:ut.steerPrompt,sideChatVisible:fs.sideChatVisible,sideChatSessionId:fs.sideChatSessionId,sideChatTurns:fs.sideChatTurns,sideChatRunning:fs.sideChatRunning,sideChatSending:fs.sideChatSending,openSideChat:fs.openSideChat,closeSideChat:fs.closeSideChat,sendSideChatPrompt:fs.sendSideChatPrompt,uploadImage:ut.uploadImage,abortCurrentPrompt:ut.abortCurrentPrompt,respondApproval:ut.respondApproval,respondQuestion:ut.respondQuestion,dismissQuestion:ut.dismissQuestion,pendingQuestionActions:ut.pendingQuestionActions,pendingApprovalActions:ut.pendingApprovalActions,cancelTask:ut.cancelTask,setPermission:ut.setPermission,setThinking:Nn.setThinking,setPlanMode:ut.setPlanMode,togglePlanMode:ut.togglePlanMode,setSwarmMode:ut.setSwarmMode,toggleSwarmMode:ut.toggleSwarmMode,setGoalMode:ut.setGoalMode,toggleGoalMode:ut.toggleGoalMode,createGoal:ut.createGoal,controlGoal:ut.controlGoal,enqueue:ut.enqueue,dismissWarning:ut.dismissWarning,renameSession:ut.renameSession,renameWorkspace:ut.renameWorkspace,deleteWorkspace:ut.deleteWorkspace,reorderWorkspaces:kge,setWorkspaceSortMode:bge,archiveSession:ut.archiveSession,exportSession:ut.exportSession,restoreSession:ut.restoreSession,loadArchivedSessions:ut.loadArchivedSessions,compact:ut.compact,forkSession:ut.forkSession,undo:ut.undo,unqueue:ut.unqueue,reorderQueue:ut.reorderQueue,searchFiles:ut.searchFiles,loadGitStatus:ut.loadGitStatus,loadFileDiff:ut.loadFileDiff,clearFileDiff:ut.clearFileDiff,listDir:ut.listDir,readFileContent:ut.readFileContent,getFileDownloadUrl:ut.getFileDownloadUrl,openWorkspaceFile:ut.openWorkspaceFile,openInApp:ut.openInApp,revealWorkspaceFile:ut.revealWorkspaceFile,resolveImageUrl:ut.resolveImageUrl,loadModels:Nn.loadModels,loadProviders:Nn.loadProviders,skills:$0e,activateSkill:Nn.activateSkill,setModel:Nn.setModel,toggleStarModel:Nn.toggleStarModel,addProvider:Nn.addProvider,deleteProvider:Nn.deleteProvider,refreshProvider:Nn.refreshProvider,refreshAllProviders:Nn.refreshAllProviders,authReady:dge,defaultModel:fge,managedProviderStatus:hge,config:pge,updateConfig:ut.updateConfig,checkAuth:ut.checkAuth,startOAuthLogin:Nn.startOAuthLogin,pollOAuthLogin:Nn.pollOAuthLogin,cancelOAuthLogin:Nn.cancelOAuthLogin,logout:ut.logout}}const F8=Ze({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=AA.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&MA(s)}return(s,i)=>(w(),xe(gs,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),Nge=["aria-checked","aria-label","disabled"],Ige=Ze({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("button",{class:We(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,Nge))}}),yr=ct(Ige,[["__scopeId","data-v-dbe22dc4"]]),Lge=["aria-label"],$ge=["aria-selected","onClick"],Fge={class:"body"},Oge={class:"panel"},Rge={class:"sec"},Bge={class:"sec-title"},Dge={class:"row"},Pge={class:"rlabel"},Hge={class:"row"},Wge={class:"rlabel"},zge={class:"row"},Uge={class:"rlabel"},qge={class:"num-field"},jge=["value","aria-label"],Vge={class:"row"},Kge={class:"rlabel"},Gge={class:"row"},Yge={class:"rlabel"},Zge={class:"hint"},Qge={class:"sec"},Xge={class:"sec-title"},Jge={class:"row"},eve={class:"rlabel"},tve={key:0,class:"hint"},nve={class:"row"},ove={class:"rlabel"},sve={key:0,class:"hint"},ive={class:"row"},rve={class:"rlabel"},lve={key:0,class:"hint"},ave={class:"row"},cve={class:"rlabel"},uve={class:"panel"},dve={class:"sec"},fve={class:"sec-title"},hve={class:"row"},pve={class:"rlabel"},mve={key:0,class:"rvalue"},gve={class:"actions"},vve={class:"panel"},yve={class:"sec"},kve={class:"sec-head"},bve={class:"sec-title"},xve={key:0,class:"saving"},wve={class:"row"},_ve={class:"rlabel"},Sve={class:"hint"},Cve={key:0,class:"select-wrap"},Ave={key:0,value:"",disabled:""},Mve=["label"],Eve=["value"],Tve={key:1,class:"rvalue mono"},Nve={class:"row"},Ive={class:"rlabel"},Lve={class:"hint"},$ve={class:"row"},Fve={class:"rlabel"},Ove={class:"hint"},Rve={class:"row"},Bve={class:"rlabel"},Dve={class:"hint"},Pve={class:"row"},Hve={class:"rlabel"},Wve={class:"hint"},zve={key:1,class:"empty-config"},Uve={class:"panel"},qve={class:"sec"},jve={class:"sec-title"},Vve={class:"row"},Kve={class:"rlabel"},Gve={class:"rvalue mono"},Yve={class:"row"},Zve={class:"rlabel"},Qve={class:"rvalue mono"},Xve={class:"row"},Jve={class:"rlabel"},eye={class:"rvalue mono"},tye={key:0,class:"row"},nye={class:"rlabel"},oye={class:"hint"},sye={class:"hint"},iye={class:"row"},rye={class:"rlabel"},lye={key:0,class:"hint"},aye={class:"panel"},cye={class:"panel-head"},uye={class:"panel-title"},dye={class:"panel-desc"},fye={class:"archive-toolbar"},hye={class:"archive-search"},pye=["placeholder"],mye={value:"all"},gye=["value"],vye={key:0,class:"archive-empty"},yye={key:0,class:"archive-list"},kye={class:"archive-workspace"},bye={class:"path"},xye={class:"count"},wye={class:"setting-card"},_ye={class:"archive-meta"},Sye={class:"archive-name"},Cye={class:"archive-time"},Aye={key:1,class:"archive-empty"},Mye=100,Eye=Ze({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X("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=LI(),a=R(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=X(null);Kk(d);function f(ne){ne.key==="Escape"&&s("close")}cn(()=>document.addEventListener("keydown",f)),bn(()=>document.removeEventListener("keydown",f));function h(){g5()}const p=R(()=>{const ne=new Map;for(const ue of o.models??[])ne.set(ue.id,{id:ue.id,label:ue.displayName??ue.model??ue.id,provider:ue.provider});for(const[ue,de]of Object.entries(o.config?.models??{})){if(ne.has(ue))continue;const Ce=v(de);ne.set(ue,{id:ue,label:m(ue,de,Ce),provider:Ce??ue})}return Array.from(ne.values())}),g=R(()=>{const ne=new Map;for(const ue of p.value){const de=ne.get(ue.provider)??[];de.push(ue),ne.set(ue.provider,de)}for(const ue of ne.values())ue.sort((de,Ce)=>de.label.localeCompare(Ce.label));return Array.from(ne.entries()).toSorted(([ue],[de])=>ue.localeCompare(de)).map(([ue,de])=>({provider:ue,options:de}))}),b=R(()=>{const ne=o.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function v(ne){if(!ne||typeof ne!="object")return;const ue=ne;return typeof ue.provider=="string"?ue.provider:void 0}function m(ne,ue,de){if(!ue||typeof ue!="object")return ne;const Ce=ue,Ie=typeof Ce.model=="string"?Ce.model:void 0,le=de??v(ue);return Ie&&le?`${ne} (${le}/${Ie})`:Ie?`${ne} (${Ie})`:ne}function y(ne){return ne===!0}function k(ne){!ne||ne===o.config?.defaultModel||s("updateConfig",{defaultModel:ne})}function A(ne){ne!==b.value&&s("updateConfig",{defaultPermissionMode:ne})}function $(ne){const ue=o.config?.[ne];s("updateConfig",{[ne]:!y(ue)})}function I(){const ne=o.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function x(){s("updateConfig",{thinking:{enabled:!I()}})}function L(){const ne=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!ne})}function E(ne){i.value=ne}const F=y2(),S=X([]),N=X(!1),D=X(!1),B=X(""),U=X("all"),H=X("archived-desc");async function P(){if(!(N.value||D.value)){N.value=!0;try{const ne=[];let ue;for(;;){const de=await F.loadArchivedSessions({beforeId:ue,pageSize:Mye});if(ne.push(...de.items),!de.hasMore||de.items.length===0)break;const Ce=de.items.at(-1)?.id;if(Ce===void 0)break;ue=Ce}S.value=ne,D.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{N.value=!1}}}Qe(i,ne=>{ne==="archived"&&!D.value&&P()});const Z=R(()=>{const ne=new Set;for(const ue of S.value)ne.add(ue.cwd);return Array.from(ne).sort((ue,de)=>ue.localeCompare(de))}),K=R(()=>{const ne=B.value.trim().toLowerCase();let ue=S.value.filter(de=>de.archived===!0);return U.value!=="all"&&(ue=ue.filter(de=>de.cwd===U.value)),ne&&(ue=ue.filter(de=>de.title.toLowerCase().includes(ne))),ue=ue.slice(),H.value==="archived-desc"?ue.sort((de,Ce)=>Ce.updatedAt.localeCompare(de.updatedAt)):H.value==="created-desc"?ue.sort((de,Ce)=>Ce.createdAt.localeCompare(de.createdAt)):ue.sort((de,Ce)=>de.title.localeCompare(Ce.title,"zh")),ue}),V=R(()=>{const ne=new Map;for(const ue of K.value){const de=ne.get(ue.cwd)??[];de.push(ue),ne.set(ue.cwd,de)}return Array.from(ne.entries()).map(([ue,de])=>({cwd:ue,items:de}))});async function J(ne){await F.restoreSession(ne)&&(S.value=S.value.filter(de=>de.id!==ne))}function he(ne){const ue=new Date(ne);if(Number.isNaN(ue.getTime()))return ne;const de=Ce=>String(Ce).padStart(2,"0");return`${ue.getFullYear()}-${de(ue.getMonth()+1)}-${de(ue.getDate())} ${de(ue.getHours())}:${de(ue.getMinutes())}`}return(ne,ue)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:ue[19]||(ue[19]=de=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:d,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(w(),T(Pe,null,ot(r,de=>_("button",{key:de.id,type:"button",class:We(["tab",{on:i.value===de.id}]),role:"tab","aria-selected":i.value===de.id,onClick:Ce=>E(de.id)},O(C(n)(de.labelKey)),11,$ge)),64))],8,Lge),_("div",Fge,[$n(_("section",Oge,[_("section",Rge,[_("h3",Bge,O(C(n)("settings.appearance")),1),_("div",Dge,[_("span",Pge,O(C(n)("theme.colorSchemeLabel")),1),re(gs,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":ue[0]||(ue[0]=de=>s("setColorScheme",de))},null,8,["model-value","options"])]),_("div",Hge,[_("span",Wge,O(C(n)("theme.accentLabel")),1),re(gs,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":ue[1]||(ue[1]=de=>s("setAccent",de))},null,8,["model-value","options"])]),_("div",zge,[_("span",Uge,O(C(n)("settings.uiFontSize")),1),_("label",qge,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ue[2]||(ue[2]=de=>s("setUiFontSize",Number(de.target.value)))},null,40,jge),ue[20]||(ue[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",Vge,[_("span",Kge,O(C(n)("sidebar.language")),1),re(F8)]),_("div",Gge,[_("span",Yge,[Je(O(C(n)("settings.conversationToc"))+" ",1),_("span",Zge,O(C(n)("settings.conversationTocHint")),1)]),re(yr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":ue[3]||(ue[3]=de=>s("setConversationToc",de))},null,8,["model-value","label"])])]),_("section",Qge,[_("h3",Xge,O(C(n)("settings.notifications")),1),_("div",Jge,[_("span",eve,[Je(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",tve,O(C(n)("settings.notifyDenied")),1)):ce("",!0)]),re(yr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":ue[4]||(ue[4]=de=>s("setNotify",de))},null,8,["model-value","disabled","label"])]),_("div",nve,[_("span",ove,[Je(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",sve,O(C(n)("settings.notifyDenied")),1)):ce("",!0)]),re(yr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":ue[5]||(ue[5]=de=>s("setNotifyQuestion",de))},null,8,["model-value","disabled","label"])]),_("div",ive,[_("span",rve,[Je(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",lve,O(C(n)("settings.notifyDenied")),1)):ce("",!0)]),re(yr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":ue[6]||(ue[6]=de=>s("setNotifyApproval",de))},null,8,["model-value","disabled","label"])]),_("div",ave,[_("span",cve,O(C(n)("settings.soundOnComplete")),1),re(yr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":ue[7]||(ue[7]=de=>s("setSound",de))},null,8,["model-value","label"])])])],512),[[mi,i.value==="general"]]),$n(_("section",uve,[_("section",dve,[_("h3",fve,O(C(n)("settings.account")),1),_("div",hve,[_("span",pve,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),re(Xt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(w(),T("span",mve,O(e.accountModel),1)):ce("",!0)]),_:1},8,["text"])]),_("div",gve,[re(Rt,{variant:"secondary",size:"sm",onClick:ue[8]||(ue[8]=de=>{s("openOnboarding"),s("close")})},{default:Ee(()=>[Je(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),xe(Rt,{key:0,variant:"danger-soft",size:"sm",onClick:ue[9]||(ue[9]=de=>s("logout"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signOut")),1)]),_:1})):(w(),xe(Rt,{key:1,variant:"primary",size:"sm",onClick:ue[10]||(ue[10]=de=>s("login"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[mi,i.value==="account"]]),$n(_("section",vve,[_("section",yve,[_("div",kve,[_("h3",bve,O(C(n)("settings.agentDefaults")),1),e.configSaving?(w(),T("span",xve,O(C(n)("settings.saving")),1)):ce("",!0)]),e.config?(w(),T(Pe,{key:0},[_("div",wve,[_("span",_ve,[Je(O(C(n)("settings.defaultModel"))+" ",1),_("span",Sve,O(C(n)("settings.defaultModelHint")),1)]),g.value.length>0?(w(),T("div",Cve,[re(Qv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Ee(()=>[e.config.defaultModel?ce("",!0):(w(),T("option",Ave,O(C(n)("settings.noDefaultModel")),1)),(w(!0),T(Pe,null,ot(g.value,de=>(w(),T("optgroup",{key:de.provider,label:de.provider},[(w(!0),T(Pe,null,ot(de.options,Ce=>(w(),T("option",{key:Ce.id,value:Ce.id},O(Ce.label),9,Eve))),128))],8,Mve))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),T("span",Tve,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",Nve,[_("span",Ive,[Je(O(C(n)("settings.defaultPermission"))+" ",1),_("span",Lve,O(C(n)("settings.defaultPermissionHint")),1)]),re(gs,{"model-value":b.value,options:c.map(de=>({value:de,label:C(n)(u[de])})),"onUpdate:modelValue":ue[11]||(ue[11]=de=>A(de))},null,8,["model-value","options"])]),_("div",$ve,[_("span",Fve,[Je(O(C(n)("settings.defaultThinking"))+" ",1),_("span",Ove,O(C(n)("settings.defaultThinkingHint")),1)]),re(yr,{"model-value":I(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":ue[12]||(ue[12]=de=>x())},null,8,["model-value","disabled","label"])]),_("div",Rve,[_("span",Bve,[Je(O(C(n)("settings.defaultPlanMode"))+" ",1),_("span",Dve,O(C(n)("settings.defaultPlanModeHint")),1)]),re(yr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":ue[13]||(ue[13]=de=>$("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",Pve,[_("span",Hve,[Je(O(C(n)("settings.mergeSkills"))+" ",1),_("span",Wve,O(C(n)("settings.mergeSkillsHint")),1)]),re(yr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":ue[14]||(ue[14]=de=>$("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),T("div",zve,O(C(n)("settings.configUnavailable")),1))])],512),[[mi,i.value==="agent"]]),$n(_("section",Uve,[_("section",qve,[_("h3",jve,O(C(n)("settings.advanced")),1),_("div",Vve,[_("span",Kve,O(C(n)("sidebar.daemon")),1),_("span",Gve,O(C(l)),1)]),_("div",Yve,[_("span",Zve,O(C(n)("settings.backend")),1),_("span",Qve,O(a.value),1)]),_("div",Xve,[_("span",Jve,O(C(n)("settings.serverVersion")),1),_("span",eye,O(e.serverVersion||"-"),1)]),e.config?(w(),T("div",tye,[_("span",nye,[Je(O(C(n)("settings.telemetry"))+" ",1),_("span",oye,O(C(n)("settings.telemetryHint")),1),_("span",sye,O(C(n)("settings.telemetryRestartHint")),1)]),re(yr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":ue[15]||(ue[15]=de=>L())},null,8,["model-value","disabled","label"])])):ce("",!0),_("div",iye,[_("span",rye,[Je(O(C(n)("settings.exportLog"))+" ",1),C(Hi)()?ce("",!0):(w(),T("span",lye,O(C(n)("settings.logHint")),1))]),re(Rt,{variant:"secondary",size:"sm",onClick:h},{default:Ee(()=>[Je(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[mi,i.value==="advanced"]]),$n(_("section",aye,[_("div",cye,[ue[21]||(ue[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",uye,O(C(n)("settings.archivedTitle")),1),_("p",dye,O(C(n)("settings.archivedDesc")),1)]),_("div",fye,[_("label",hye,[ue[22]||(ue[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),$n(_("input",{"onUpdate:modelValue":ue[16]||(ue[16]=de=>B.value=de),placeholder:C(n)("settings.archivedSearch")},null,8,pye),[[_s,B.value]])]),re(Qv,{"model-value":U.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":ue[17]||(ue[17]=de=>U.value=de)},{default:Ee(()=>[_("option",mye,O(C(n)("settings.archivedAllWorkspaces")),1),(w(!0),T(Pe,null,ot(Z.value,de=>(w(),T("option",{key:de,value:de},O(de),9,gye))),128))]),_:1},8,["model-value","aria-label"]),re(gs,{size:"sm","model-value":H.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ue[18]||(ue[18]=de=>H.value=de)},null,8,["model-value","options"])]),N.value?(w(),T("div",vye,O(C(n)("settings.archivedLoadingAll")),1)):(w(),T(Pe,{key:1},[V.value.length>0?(w(),T("div",yye,[(w(!0),T(Pe,null,ot(V.value,de=>(w(),T("section",{key:de.cwd,class:"archive-card"},[_("div",kye,[ue[23]||(ue[23]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",bye,O(de.cwd),1),_("span",xye,O(C(n)("settings.archivedSessionsCount",{count:de.items.length})),1)]),_("div",wye,[(w(!0),T(Pe,null,ot(de.items,Ce=>(w(),T("div",{key:Ce.id,class:"archive-row"},[_("div",_ye,[_("div",Sye,O(Ce.title),1),_("div",Cye,O(C(n)("settings.archivedAt",{time:he(Ce.updatedAt)})),1)]),re(Rt,{variant:"secondary",size:"sm",onClick:Ie=>J(Ce.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(w(),T("div",Aye,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[mi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Tye=ct(Eye,[["__scopeId","data-v-2377814f"]]),Nye=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,O8=/^[A-Za-z]:[\\/]/,Iye=/^\/\/(?!\/)/;function Mg(e){return Nye.test(e.trim())}function Lye(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function $ye(e){return Iye.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function Fye(e){return O8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function Oye(e){return O8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function ly(e,t){let n=$ye(Lye(e.trim(),t));const o=Fye(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=Oye(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Rye(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Bye(e,t,n){if(n===null)return null;const{target:o}=ly(e,t);return o===n?n:null}const Dye={class:"aw"},Pye={key:0,class:"crumbbar"},Hye={class:"crumbs"},Wye={key:0,class:"crumb-sep"},zye=["onClick"],Uye=["placeholder"],qye={key:2,class:"folder-list"},jye={key:0,class:"fl-loading"},Vye={key:0,class:"fl-loading"},Kye={key:0,class:"fl-note"},Gye=["onClick"],Yye={class:"folder-name"},Zye={key:1,class:"fl-empty fl-error"},Qye={key:2,class:"fl-empty fl-error"},Xye=["onClick"],Jye={class:"folder-name search-rel"},eke={key:0,class:"fl-empty"},tke={key:1,class:"fl-loading"},nke=["onClick"],oke={class:"folder-name"},ske={key:0,class:"fl-empty"},ike={key:3,class:"degraded-hint"},rke={key:4,class:"add-error",role:"alert"},lke={class:"actions"},ake={class:"footer-hint"},cke=600,uke=6,f4=150,dke=Ze({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=X(!1),l=X(!1),a=X(""),c=X(null),u=X([]),d=X(""),f=X(!1),h=X([]),p=R(()=>d.value.trim().length>0);let g=0,b=null;const v=R(()=>Mg(d.value)),m=X("idle"),y=X(""),k=X("/"),A=X([]),$=X(""),I=X(null),x=X(null),L=R(()=>m.value!=="valid"?null:Bye(d.value,$.value,x.value));let E=0,F=null;function S(ue,de){const Ce=ue.toLowerCase(),Ie=de.toLowerCase();let le=0;for(let z=0;z<Ie.length&&le<Ce.length;z++)Ie[z]===Ce[le]&&le++;return le===Ce.length}async function N(ue){const de=a.value,Ce=ue.trim();if(!de||Ce===""){h.value=[],f.value=!1;return}const Ie=++g;f.value=!0;const le=[],z=[{path:de,depth:0}];let ae=0;for(;z.length>0&&ae<cke&&le.length<f4;){if(Ie!==g)return;const ie=z.shift();ae++;let q;try{q=await o.browseFs(ie.path)}catch{continue}if(Ie!==g)return;for(const ee of q.entries){if(!ee.isDir)continue;const ye=ee.path.startsWith(de)?ee.path.slice(de.length).replace(/^\/+/,""):ee.path;if(S(Ce,ye||ee.name)&&(le.push({path:ee.path,name:ee.name,rel:ye||ee.name}),le.length>=f4))break;ie.depth+1<uke&&z.push({path:ee.path,depth:ie.depth+1})}Ie===g&&(h.value=[...le])}Ie===g&&(f.value=!1)}Qe(d,ue=>{b&&clearTimeout(b),F&&clearTimeout(F),E++,m.value="idle",A.value=[],x.value=null;const de=ue.trim();if(de===""){g++,h.value=[],f.value=!1;return}if(Mg(de)){if(g++,h.value=[],f.value=!1,l.value)return;m.value="checking",F=setTimeout(()=>void D(de),150);return}b=setTimeout(()=>void N(ue),220)});async function D(ue){const de=++E;m.value="checking",x.value=null;const Ce=ly(ue,$.value),{target:Ie}=Ce;try{const z=await o.browseFs(Ie);if(de!==E)return;if(z.path){m.value="valid",A.value=[],x.value=Ie,a.value=z.path,c.value=z.parent,u.value=z.entries,l.value=!1;return}}catch{}if(de!==E)return;const le=Ce.base.toLowerCase();y.value=Ce.parent,k.value=Ce.separator;try{const z=await o.browseFs(Ce.parent);if(de!==E)return;if(z.path){A.value=z.entries.filter(ae=>ae.isDir&&ae.name.toLowerCase().startsWith(le)),m.value="not-found";return}}catch{}de===E&&(A.value=[],m.value="bad-parent")}function B(ue){d.value=Rye(y.value,ue,k.value),I.value?.focus()}const U=R(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),H=R(()=>l.value?n("workspace.degradedHint"):v.value&&m.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function P(ue){if(ue.key==="Escape"){d.value?d.value="":s("close");return}if(ue.key!=="Enter")return;const de=d.value.trim();if(Mg(de)){if(ue.preventDefault(),l.value){const{target:Ce}=ly(de,$.value);Ce&&s("add",Ce);return}m.value==="valid"?ne():m.value==="not-found"&&A.value[0]&&B(A.value[0].name)}}const Z=R(()=>{const ue=a.value;if(!ue)return[];const de=ue.split("/").filter(Boolean),Ce=[{label:"/",path:"/"}];let Ie="";for(const le of de)Ie+=`/${le}`,Ce.push({label:le,path:Ie});return Ce}),K=R(()=>!(a.value.length===0||v.value&&L.value===null));async function V(ue){r.value=!0;try{const de=await o.browseFs(ue);if(!de.path){l.value=!0;return}a.value=de.path,c.value=de.parent,u.value=de.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function J(ue){ue.isDir&&V(ue.path)}function he(){c.value&&V(c.value)}function ne(){K.value&&s("add",L.value??a.value)}return cn(async()=>{r.value=!0;try{const ue=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(ue.home&&($.value=ue.home),o.defaultPath&&(await V(o.defaultPath),!l.value))return;$.value?await V($.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),bn(()=>{b&&clearTimeout(b),F&&clearTimeout(F)}),(ue,de)=>(w(),xe(qr,{open:i.value,"onUpdate:open":de[2]||(de[2]=Ce=>i.value=Ce),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:de[3]||(de[3]=Ce=>s("close"))},{default:Ee(()=>[_("div",Dye,[l.value?ce("",!0):(w(),T("div",Pye,[re(Dn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:he},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",Hye,[(w(!0),T(Pe,null,ot(Z.value,(Ce,Ie)=>(w(),T(Pe,{key:Ce.path},[Ie>1?(w(),T("span",Wye,"/")):ce("",!0),_("button",{class:We(["crumb",{last:Ie===Z.value.length-1}]),onClick:le=>V(Ce.path)},O(Ce.label),11,zye)],64))),128))])])),!r.value||l.value?(w(),T("div",{key:1,class:We(["filterbar",{"has-error":m.value==="not-found"||m.value==="bad-parent"}])},[re(Ve,{class:"filter-icon",name:"search",size:"md"}),$n(_("input",{ref_key:"filterEl",ref:I,"onUpdate:modelValue":de[0]||(de[0]=Ce=>d.value=Ce),class:"filter-input",type:"text",placeholder:U.value,autocomplete:"off",spellcheck:"false",onKeydown:bt(P,["stop"])},null,40,Uye),[[_s,d.value]]),f.value||m.value==="checking"?(w(),xe(Ds,{key:0,size:"sm"})):ce("",!0)],2)):ce("",!0),l.value?(w(),T("div",ike,O(C(n)("workspace.degradedHint")),1)):(w(),T("div",qye,[r.value?(w(),T("div",jye,O(C(n)("workspace.browsing")),1)):v.value&&m.value!=="valid"?(w(),T(Pe,{key:1},[m.value==="checking"?(w(),T("div",Vye,O(C(n)("workspace.checkingPath")),1)):m.value==="not-found"?(w(),T(Pe,{key:1},[A.value.length>0?(w(),T("div",Kye,O(C(n)("workspace.pathPickHint")),1)):ce("",!0),(w(!0),T(Pe,null,ot(A.value,Ce=>(w(),T("button",{key:Ce.path,class:"folder-row",onClick:Ie=>B(Ce.name)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Yye,O(Ce.name),1)],8,Gye))),128)),A.value.length===0?(w(),T("div",Zye,O(C(n)("workspace.noPathMatch",{parent:y.value})),1)):ce("",!0)],64)):m.value==="bad-parent"?(w(),T("div",Qye,O(C(n)("workspace.badParent",{parent:y.value})),1)):ce("",!0)],64)):p.value&&!v.value?(w(),T(Pe,{key:2},[(w(!0),T(Pe,null,ot(h.value,Ce=>(w(),T("button",{key:Ce.path,class:"folder-row",onClick:Ie=>V(Ce.path)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Jye,O(Ce.rel),1)],8,Xye))),128)),!f.value&&h.value.length===0?(w(),T("div",eke,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),T("div",tke,O(C(n)("workspace.searching")),1)):ce("",!0)],64)):(w(),T(Pe,{key:3},[(w(!0),T(Pe,null,ot(u.value,Ce=>(w(),T("button",{key:Ce.path,class:"folder-row",onClick:Ie=>J(Ce)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",oke,O(Ce.name),1)],8,nke))),128)),u.value.length===0?(w(),T("div",ske,O(C(n)("workspace.noSubfolders")),1)):ce("",!0)],64))])),e.error?(w(),T("div",rke,O(e.error),1)):ce("",!0),_("div",lke,[re(Xt,{text:a.value},{default:Ee(()=>[l.value?ce("",!0):(w(),xe(Rt,{key:0,variant:"primary",disabled:!K.value,onClick:ne},{default:Ee(()=>[Je(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),re(Rt,{variant:"secondary",onClick:de[1]||(de[1]=Ce=>s("close"))},{default:Ee(()=>[Je(O(C(n)("workspace.cancel")),1)]),_:1})]),_("div",ake,O(H.value),1)])]),_:1},8,["open","title"]))}}),fke=ct(dke,[["__scopeId","data-v-07cbb13d"]]),hke={key:0,class:"confirm-dialog__message"},pke=Ze({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),mo(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(w(),xe(qr,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:i},{foot:Ee(()=>[re(Rt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ee(()=>[Je(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),re(Rt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ee(()=>[Je(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(w(),T("p",hke,O(e.message),1)):ce("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),mke=ct(pke,[["__scopeId","data-v-2e719024"]]),gke=Ze({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=nf();function i(){s()}return(r,l)=>(w(),xe(mke,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),vke={class:"rows"},yke={class:"row"},kke={class:"row"},bke={class:"row"},xke={class:"row"},wke={class:"row"},_ke={class:"row"},Ske={class:"ctx-text"},Cke={key:0,class:"bar"},Ake={class:"row"},Mke=Ze({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=R(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=R(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:ir(o.status.ctxUsed),max:ir(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=R(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=R(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=R(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=R(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=R(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,g)=>(w(),xe(qr,{open:i.value,"onUpdate:open":g[0]||(g[0]=b=>i.value=b),title:C(n)("status.statusPanelTitle"),onClose:g[1]||(g[1]=b=>s("close"))},{default:Ee(()=>[_("dl",vke,[_("div",yke,[_("dt",null,O(C(n)("status.statusModel")),1),_("dd",null,O(e.status.model),1)]),_("div",kke,[_("dt",null,O(C(n)("status.statusThinking")),1),_("dd",null,O(e.thinking),1)]),_("div",bke,[_("dt",null,O(C(n)("status.statusPermission")),1),_("dd",{style:Yt({color:c.value})},O(a(e.status.permission)),5)]),_("div",xke,[_("dt",null,O(C(n)("status.statusPlanMode")),1),_("dd",{class:We({"plan-on":e.planMode})},O(u.value),3)]),_("div",wke,[_("dt",null,O(C(n)("status.statusSwarmMode")),1),_("dd",{class:We({"swarm-on":e.swarmMode})},O(d.value),3)]),_("div",_ke,[_("dt",null,O(C(n)("status.statusContext")),1),_("dd",null,[_("span",Ske,O(l.value),1),e.status.ctxMax>0?(w(),T("span",Cke,[_("i",{style:Yt({width:r.value+"%"})},null,4)])):ce("",!0)])]),_("div",Ake,[_("dt",null,O(C(n)("status.statusCost")),1),_("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),Eke=ct(Mke,[["__scopeId","data-v-39844d89"]]),Tke={class:"ui-toast__icon","aria-hidden":"true"},Nke={class:"ui-toast__body"},Ike={class:"ui-toast__title"},Lke={key:0,class:"ui-toast__msg"},$ke=Ze({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-toast",`ui-toast--${e.variant}`])},[_("span",Tke,[Fn(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),xe(Ve,{key:0,name:"check"})):e.variant==="danger"?(w(),xe(Ve,{key:1,name:"close"})):e.variant==="warning"?(w(),xe(Ve,{key:2,name:"alert-triangle"})):(w(),xe(Ve,{key:3,name:"info"}))],!0)]),_("div",Nke,[_("div",Ike,O(e.title),1),e.message?(w(),T("div",Lke,O(e.message),1)):ce("",!0),Fn(t.$slots,"default",{},void 0,!0)]),re(Dn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Fke=ct($ke,[["__scopeId","data-v-adc6f346"]]),Oke={key:0,class:"actions"},Rke=["onClick"],Bke=["onClick"],Dke={key:1,class:"details"},Pke=Ze({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt();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(`${s("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 L=[x.title];x.message&&L.push(x.message);const E=x.details??[];if(E.length>0){L.push("",`${s("warnings.diagnostics")}:`);for(const F of E)L.push(`${F.label}: ${F.value}`)}return L.join(`
|
|
325
|
+
`)}let f=1;const h=X([]),p=new Map,g=new Map;function b(x){const L=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?L+5e3:L}function v(x,L){const E=p.get(x)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>I(x),L),E.deadline=Date.now()+L,p.set(x,E)}function m(x){const L=p.get(x);L&&L.handle!==null&&clearTimeout(L.handle),p.delete(x)}function y(x){const L=p.get(x);!L||L.handle===null||(clearTimeout(L.handle),L.handle=null,L.remaining=Math.max(0,L.deadline-Date.now()))}function k(x){if(h.value.find(F=>F.id===x)?.detailsOpen)return;const E=p.get(x);!E||E.handle!==null||v(x,E.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?y(x.id):k(x.id)}async function $(x){if(!await Go(d(x.warning)))return;x.copied=!0;const E=g.get(x.id);E&&clearTimeout(E),g.set(x.id,setTimeout(()=>{x.copied=!1,g.delete(x.id)},1400))}function I(x){m(x);const L=g.get(x);L&&clearTimeout(L),g.delete(x);const E=h.value.findIndex(F=>F.id===x);E!==-1&&(h.value=h.value.filter(F=>F.id!==x),o("dismiss",E))}return Qe(()=>n.warnings,x=>{const L=[...h.value];h.value=x.map(E=>{const F=u(E),S=L.findIndex(B=>B.key===F),N=S===-1?void 0:L.splice(S,1)[0];if(N)return N.warning=E,N;const D={id:f++,key:F,warning:E,detailsOpen:!1,copied:!1};return v(D.id,b(E)),D});for(const E of L){m(E.id);const F=g.get(E.id);F&&clearTimeout(F),g.delete(E.id)}},{immediate:!0,flush:"post"}),bn(()=>{p.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),p.clear(),g.forEach(x=>clearTimeout(x)),g.clear()}),(x,L)=>(w(),xe(iN,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(w(!0),T(Pe,null,ot(h.value,E=>(w(),xe(Fke,{key:E.id,variant:c(E.warning)?"danger":"warning",title:r(E.warning),message:l(E.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>I(E.id),onPointerenter:F=>y(E.id),onPointerleave:F=>k(E.id)},{default:Ee(()=>[a(E.warning)?.length?(w(),T("div",Oke,[_("button",{class:"link",type:"button",onClick:F=>A(E)},O(E.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Rke),_("button",{class:"link",type:"button",onClick:F=>$(E)},O(E.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,Bke)])):ce("",!0),E.detailsOpen&&a(E.warning)?.length?(w(),T("dl",Dke,[(w(!0),T(Pe,null,ot(a(E.warning),F=>(w(),T("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,O(F.label),1),_("dd",null,O(F.value),1)]))),128))])):ce("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Hke=ct(Pke,[["__scopeId","data-v-6cc72bd4"]]),Wke={class:"topbar"},zke={class:"wsq"},Uke=["aria-label"],qke={class:"tb-path"},jke={class:"ws"},Vke={class:"se"},Kke={class:"tb-sub"},Gke=Ze({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=R(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=R(()=>o.workspace?.name??n("workspace.noWorkspace")),l=R(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),T("div",Wke,[_("span",zke,O(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",qke,[_("span",jke,O(r.value),1),e.sessionTitle?(w(),T(Pe,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",Vke,O(e.sessionTitle),1)],64)):ce("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",Kke,[_("span",{class:We(["rd",{on:e.running}])},null,2),_("span",null,O(l.value),1),e.branch?(w(),T(Pe,{key:0},[Je(" · "+O(e.branch),1)],64)):ce("",!0),e.sessionCount>0?(w(),T(Pe,{key:1},[Je(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ce("",!0)])],8,Uke),re(Dn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ee(()=>[re(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Yke=ct(Gke,[["__scopeId","data-v-6b4b901f"]]),Zke={key:0,class:"sheet-root"},Qke=["aria-label"],Xke=["aria-label"],Jke={key:0,class:"sheet-head"},e2e={class:"sheet-title"},t2e={class:"sheet-body"},n2e=Ze({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Qe(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),bn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),xe(Il,{name:"sheet"},{default:Ee(()=>[e.modelValue?(w(),T("div",Zke,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Xke),e.title?(w(),T("div",Jke,[_("span",e2e,O(e.title),1)])):ce("",!0),_("div",t2e,[Fn(l.$slots,"default",{},void 0,!0)])],8,Qke)])):ce("",!0)]),_:3}))}}),R8=ct(n2e,[["__scopeId","data-v-745ee5a2"]]),o2e={class:"mlist"},s2e={key:0,class:"mempty"},i2e=["onClick"],r2e={class:"mgh-main"},l2e={class:"mgh-name"},a2e={class:"mgh-path"},c2e={key:2,class:"att"},u2e={key:0,class:"mempty small"},d2e=["onClick"],f2e={class:"m"},h2e={class:"s"},p2e={key:0,class:"att"},m2e=["disabled","onClick"],g2e=["onClick"],v2e=Ze({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=X(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,y.value=null,I.value=null}const h=X(new Set);function p(F){return h.value.has(F)}function g(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function b(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(N=>N.id===o.activeId)){const N=F.sessions.find(D=>D.id===o.activeId);if(N)return[...S,N]}return S}function v(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function m(F){return o.attentionByWorkspace[F]??0}const y=X(null);function k(F){y.value=y.value===F?null:F,I.value=null}function A(F){y.value=null;const N=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();N&&s("rename",F.id,N)}function $(F){y.value=null,s("archive",F)}const I=X(null);function x(F){I.value=I.value===F?null:F,y.value=null}function L(F){Go(F.root),I.value=null}function E(F){I.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(w(),xe(R8,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=N=>s("update:modelValue",N))},{default:Ee(()=>[_("button",{type:"button",class:"newrow",onClick:a},[re(Ve,{name:"message",size:"sm"}),Je(" "+O(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[re(Ve,{name:"folder",size:"sm"}),Je(" "+O(C(n)("sidebar.newWorkspace")),1)]),_("div",o2e,[e.groups.length===0?(w(),T("div",s2e,O(C(n)("workspace.noWorkspace")),1)):ce("",!0),(w(!0),T(Pe,null,ot(e.groups,N=>(w(),T("div",{key:N.workspace.id,class:"mgroup"},[_("div",{class:We(["mgh",{on:N.workspace.id===e.activeWorkspaceId}]),onClick:D=>f(N.workspace.id)},[d(N.workspace.id)?(w(),xe(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),xe(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",r2e,[_("span",l2e,O(N.workspace.name),1),re(Xt,{text:N.workspace.root},{default:Ee(()=>[_("span",a2e,O(N.workspace.shortPath),1)]),_:2},1032,["text"])]),d(N.workspace.id)&&m(N.workspace.id)>0?(w(),T("span",c2e,O(m(N.workspace.id)),1)):ce("",!0),re(Dn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(D=>x(N.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),re(Dn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(D=>l(N.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),I.value===N.workspace.id?(w(),xe(kl,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:D=>L(N.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:D=>E(N.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ce("",!0)],10,i2e),$n(_("div",null,[N.sessions.length===0?(w(),T("div",u2e,O(C(n)("sidebar.noSessions")),1)):ce("",!0),(w(!0),T(Pe,null,ot(b(N),D=>(w(),T("div",{key:D.id,class:We(["srow",{cur:D.id===e.activeId}]),onClick:B=>r(D.id)},[_("div",f2e,[_("div",{class:We(["t",{run:D.busy,aborted:!D.busy&&(e.attentionBySession[D.id]??0)===0&&(D.lastTurnReason==="cancelled"||D.lastTurnReason==="failed")}])},O(D.title),3),_("div",h2e,O(D.time),1)]),(e.attentionBySession[D.id]??0)>0?(w(),T("span",p2e,O(e.attentionBySession[D.id]),1)):ce("",!0),re(Dn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(B=>k(D.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===D.id?(w(),xe(kl,{key:1,class:"kmenu",onClick:S[1]||(S[1]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:B=>A(D)},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:B=>$(D.id)},{default:Ee(()=>[Je(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ce("",!0)],10,d2e))),128)),N.hasMore||N.loadingMore?(w(),T("button",{key:1,type:"button",class:"mshow-more",disabled:N.loadingMore,onClick:bt(D=>v(N.workspace.id),["stop"])},O(N.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,N.workspace.sessionCount-N.sessions.length)})),9,m2e)):ce("",!0),N.sessions.length>N.initialCount?(w(),T("button",{key:2,type:"button",class:"mshow-more",onClick:bt(D=>g(N.workspace.id),["stop"])},O(p(N.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:N.sessions.length-N.initialCount})),9,g2e)):ce("",!0)],512),[[mi,!d(N.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),y2e=ct(v2e,[["__scopeId","data-v-df277098"]]),k2e={class:"group-title"},b2e={class:"srow-main"},x2e={class:"srow-label"},w2e={class:"srow-sub"},_2e={class:"srow read-only"},S2e={class:"srow-main"},C2e={class:"srow-label"},A2e={key:0,class:"srow-sub"},M2e={class:"srow-main"},E2e={class:"srow-label"},T2e={class:"srow-sub"},N2e=["aria-checked"],I2e={class:"srow-main"},L2e={class:"srow-label"},$2e={class:"srow-sub"},F2e=["aria-checked"],O2e={class:"srow-main"},R2e={class:"srow-label"},B2e={class:"srow read-only"},D2e={class:"srow-main"},P2e={class:"srow-label"},H2e={class:"srow-sub"},W2e=["aria-label"],z2e={class:"group-title"},U2e={class:"srow-main"},q2e={class:"srow-label"},j2e={class:"srow-sub"},V2e={class:"srow read-only pref"},K2e={class:"srow-main"},G2e={class:"srow-label"},Y2e={class:"srow read-only pref"},Z2e={class:"srow-main"},Q2e={class:"srow-label"},X2e={class:"srow read-only pref"},J2e={class:"srow-main"},ebe={class:"srow-label"},tbe={class:"num-field"},nbe=["value","aria-label"],obe={class:"srow-main"},sbe={class:"srow-label"},ibe={class:"srow-sub"},rbe=["aria-checked"],lbe={class:"srow-main"},abe={class:"srow-label"},cbe={class:"srow-main"},ube={class:"srow-label"},dbe={key:2,class:"srow read-only"},fbe={class:"srow-main"},hbe={class:"srow-label"},pbe={class:"srow-val dim"},mbe={class:"arch-subhead"},gbe={class:"arch-count"},vbe={class:"arch-tools"},ybe={key:0,class:"arch-empty"},kbe={class:"arch-meta"},bbe={class:"arch-name"},xbe={class:"arch-time"},wbe={key:2,class:"arch-empty"},_be=100,Sbe=Ze({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(V){s("setColorScheme",V)}const r=["manual","auto","yolo"],l=R(()=>o.models?.find(V=>V.id===o.status?.modelId)),a=R(()=>Km(l.value)),c=R(()=>Ym(l.value)),u=R(()=>Hp(l.value,o.thinking)),d=R(()=>c.value.includes(u.value)?u.value:""),f=R(()=>c.value.map(V=>({value:V,label:Zv(V)}))),h=R(()=>o.planMode===!0),p=R(()=>o.swarmMode===!0),g=R(()=>{const V=o.status.permission;return V==="yolo"?"var(--color-danger)":V==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=R(()=>{const V=o.status.permission,J=n(V==="yolo"?"mobile.permYoloSub":V==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${V} · ${J}`}),v=R(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),m=R(()=>o.status.ctxMax>0?`${ir(o.status.ctxUsed)}/${ir(o.status.ctxMax)}`:n("status.statusNone"));function y(V){s("setThinking",jk(l.value,V))}function k(){const V=r.indexOf(o.status.permission),J=r[(V+1)%r.length];s("setPermission",J)}function A(){s("pickModel"),s("update:modelValue",!1)}function $(){s("login"),s("update:modelValue",!1)}function I(){s("logout"),s("update:modelValue",!1)}const x=y2(),L=X("main"),E=X([]),F=X(!1),S=X(!1),N=X(""),D=X("archived-desc");async function B(){if(!F.value){F.value=!0,S.value=!1;try{const V=[];let J;for(;;){const he=await x.loadArchivedSessions({beforeId:J,pageSize:_be});if(V.push(...he.items),!he.hasMore||he.items.length===0)break;const ne=he.items.at(-1)?.id;if(ne===void 0)break;J=ne}E.value=V,S.value=!0}catch(V){console.warn("loadAllArchived failed",V)}finally{F.value=!1}}}function U(){L.value="archived",N.value="",B()}function H(){L.value="main"}const P=R(()=>{const V=N.value.trim().toLowerCase();let J=E.value.filter(he=>he.archived===!0);return V&&(J=J.filter(he=>he.title.toLowerCase().includes(V))),J=J.slice(),D.value==="archived-desc"?J.sort((he,ne)=>ne.updatedAt.localeCompare(he.updatedAt)):D.value==="created-desc"?J.sort((he,ne)=>ne.createdAt.localeCompare(he.createdAt)):J.sort((he,ne)=>he.title.localeCompare(ne.title,"zh")),J});async function Z(V){await x.restoreSession(V)&&(E.value=E.value.filter(he=>he.id!==V))}function K(V){const J=new Date(V);if(Number.isNaN(J.getTime()))return V;const he=ne=>String(ne).padStart(2,"0");return`${J.getFullYear()}-${he(J.getMonth()+1)}-${he(J.getDate())} ${he(J.getHours())}:${he(J.getMinutes())}`}return Qe(()=>o.modelValue,V=>{V||(L.value="main")}),(V,J)=>(w(),xe(R8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":J[6]||(J[6]=he=>s("update:modelValue",he))},{default:Ee(()=>[L.value==="main"?(w(),T(Pe,{key:0},[_("div",k2e,O(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:A},[_("span",b2e,[_("span",x2e,O(C(n)("status.statusModel")),1),_("span",w2e,O(e.status.model),1)]),J[7]||(J[7]=_("span",{class:"chev"},"›",-1))]),_("div",_2e,[_("span",S2e,[_("span",C2e,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(w(),T("span",A2e,O(C(n)("status.modeNotSupported")),1)):ce("",!0)]),c.value.length>1?(w(),xe(gs,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(w(),T("span",{key:1,class:We(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(Zv)(u.value)),3))]),_("button",{type:"button",class:"srow",onClick:J[0]||(J[0]=he=>s("togglePlan"))},[_("span",M2e,[_("span",E2e,O(C(n)("status.statusPlanMode")),1),_("span",T2e,O(C(n)("mobile.planModeSub")),1)]),_("span",{class:We(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,N2e)]),_("button",{type:"button",class:"srow",onClick:J[1]||(J[1]=he=>s("toggleSwarm"))},[_("span",I2e,[_("span",L2e,O(C(n)("status.statusSwarmMode")),1),_("span",$2e,O(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:We(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,F2e)]),_("button",{type:"button",class:"srow",onClick:k},[_("span",O2e,[_("span",R2e,O(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Yt({color:g.value})},O(b.value),5)]),J[8]||(J[8]=_("span",{class:"chev"},"›",-1))]),_("div",B2e,[_("span",D2e,[_("span",P2e,O(C(n)("status.statusContext")),1),_("span",H2e,O(m.value),1)]),_("span",{class:"ctx-meter","aria-label":m.value},[_("i",{style:Yt({width:v.value+"%"})},null,4)],8,W2e)]),_("div",z2e,O(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:U},[_("span",U2e,[_("span",q2e,O(C(n)("mobile.archivedSessions")),1),_("span",j2e,O(C(n)("mobile.archivedSessionsSub")),1)]),J[9]||(J[9]=_("span",{class:"chev"},"›",-1))]),_("div",V2e,[_("span",K2e,[_("span",G2e,O(C(n)("theme.colorSchemeLabel")),1)]),re(gs,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",Y2e,[_("span",Z2e,[_("span",Q2e,O(C(n)("sidebar.language")),1)]),re(F8)]),_("div",X2e,[_("span",J2e,[_("span",ebe,O(C(n)("settings.uiFontSize")),1)]),_("label",tbe,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:J[2]||(J[2]=he=>s("setUiFontSize",Number(he.target.value)))},null,40,nbe),J[10]||(J[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:J[3]||(J[3]=he=>s("setConversationToc",!e.conversationToc))},[_("span",obe,[_("span",sbe,O(C(n)("settings.conversationToc")),1),_("span",ibe,O(C(n)("settings.conversationTocHint")),1)]),_("span",{class:We(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,rbe)]),e.authReady?(w(),T("button",{key:0,type:"button",class:"srow acct out",onClick:I},[_("span",lbe,[_("span",abe,O(C(n)("sidebar.signOut")),1)])])):(w(),T("button",{key:1,type:"button",class:"srow acct in",onClick:$},[_("span",cbe,[_("span",ube,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),T("div",dbe,[_("span",fbe,[_("span",hbe,O(C(n)("settings.serverVersion")),1)]),_("span",pbe,O(e.serverVersion),1)])):ce("",!0)],64)):(w(),T(Pe,{key:1},[_("div",mbe,[_("button",{type:"button",class:"arch-back",onClick:H},[J[11]||(J[11]=_("span",{class:"chev back"},"‹",-1)),Je(" "+O(C(n)("mobile.archivedBack")),1)]),_("span",gbe,O(C(n)("mobile.sessionCount",{n:P.value.length})),1)]),_("div",vbe,[re(Vc,{class:"arch-search-input","model-value":N.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":J[4]||(J[4]=he=>N.value=he)},null,8,["model-value","placeholder"]),re(gs,{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":J[5]||(J[5]=he=>D.value=he)},null,8,["model-value","options"])]),F.value?(w(),T("div",ybe,O(C(n)("settings.archivedLoadingAll")),1)):P.value.length>0?(w(!0),T(Pe,{key:1},ot(P.value,he=>(w(),T("div",{key:he.id,class:"arch-row"},[_("div",kbe,[_("div",bbe,O(he.title),1),_("div",xbe,O(C(n)("settings.archivedAt",{time:K(he.updatedAt)})),1)]),re(Rt,{variant:"secondary",size:"sm",onClick:ne=>Z(he.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(w(),T("div",wbe,O(E.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),Cbe=ct(Sbe,[["__scopeId","data-v-6bbce965"]]),Abe={class:"ob-brand"},Mbe={class:"ob-brand-text"},Ebe={class:"ob-title"},Tbe={class:"ob-sub"},Nbe={class:"ob-sec"},Ibe={class:"ob-label"},Lbe={class:"ob-sec"},$be={class:"ob-label"},Fbe={class:"ob-sec"},Obe={class:"ob-label"},Rbe=Ze({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=V5();function c(d){s.value!==d&&MA(d)}function u(){n("complete")}return(d,f)=>(w(),xe(qr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ee(()=>[_("div",Abe,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[_("defs",null,[_("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),_("div",Mbe,[_("div",Ebe,O(C(o)("onboarding.title")),1),_("div",Tbe,O(C(o)("onboarding.subtitle")),1)])])]),default:Ee(()=>[_("section",Nbe,[_("div",Ibe,O(C(o)("onboarding.languageLabel")),1),re(gs,{"model-value":C(s),options:C(AA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",Lbe,[_("div",$be,O(C(o)("theme.colorSchemeLabel")),1),re(gs,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),_("section",Fbe,[_("div",Obe,O(C(o)("theme.accentLabel")),1),re(gs,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),re(Rt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Je(O(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),Bbe=ct(Rbe,[["__scopeId","data-v-fbdd3eab"]]),Dbe=["aria-label"],Pbe={class:"gload-box"},Hbe={class:"gload-text"},Wbe={key:0,class:"gload-issue"},zbe={class:"gload-issue-detail"},Ube=Ze({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Tt();return(n,o)=>(w(),T("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",Pbe,[o[0]||(o[0]=Ey('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-0b6dec6a></path></svg>',1)),re(Ds,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",Hbe,O(C(t)("app.connecting")),1),e.issue?(w(),T("div",Wbe,[_("div",null,O(C(t)("app.connectRetrying")),1),_("div",zbe,O(e.issue),1)])):ce("",!0)])],8,Dbe))}}),qbe=ct(Ube,[["__scopeId","data-v-0b6dec6a"]]),jbe={class:"kap-root"},Vbe={class:"kap-head"},Kbe={class:"kap-count"},Gbe={class:"kap-head-actions"},Ybe={class:"kap-filters"},Zbe=["value"],Qbe={class:"kap-check"},Xbe={class:"kap-check"},Jbe={class:"kap-view-toggle",role:"group"},exe={key:0,class:"kap-empty"},txe=["onClick"],nxe={class:"kap-ts"},oxe={class:"kap-label"},sxe={key:0,class:"kap-detail"},ixe={class:"kap-detail-actions"},rxe=["onClick"],lxe={key:1,class:"kap-agg"},axe={class:"mono"},cxe={class:"mono"},uxe={class:"num"},dxe={class:"num"},fxe={key:0},hxe={class:"mono"},pxe={class:"num"},mxe={class:"num"},gxe={key:0},vxe=Ze({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=X("all"),s=X(""),i=X(""),r=X(!1),l=X("timeline"),a=R(()=>($k.value,[...Vte()])),c=R(()=>{const L=new Set;for(const E of a.value)E.sessionId&&L.add(E.sessionId);return[...L].sort()});function u(L){return L.kind==="rest:error"||L.code!==void 0&&L.code!==0||L.eventType==="error"||L.eventType==="parse-error"}const d=R(()=>{const L=s.value.trim().toLowerCase();return a.value.filter(E=>!(o.value!=="all"&&E.source!==o.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||L&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(L)))}),f=R(()=>{const L=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const F=E.kind==="ws:in"?"←":"→",S=`${F} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,N=L.get(S)??{key:S,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:F,count:0};N.count++,E.seq!==void 0&&(N.lastSeq=E.seq),L.set(S,N)}return[...L.values()].sort((E,F)=>F.count-E.count)}),h=R(()=>{const L=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const F=`${E.method??"?"} ${E.path??"?"}`,S=L.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(E)&&S.errors++,E.durationMs!==void 0&&(S.totalMs+=E.durationMs,S.timed++),L.set(F,S)}return[...L.entries()].map(([E,F])=>({key:E,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((E,F)=>F.count-E.count)}),p=X(null),g=X(!0),b=X(null),v=X(null);Qe(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await mt();const L=b.value;L&&(L.scrollTop=L.scrollHeight)});function m(L){p.value=p.value===L?null:L}function y(L){const E=new Date(L),F=(S,N=2)=>String(S).padStart(N,"0");return`${F(E.getHours())}:${F(E.getMinutes())}:${F(E.getSeconds())}.${F(E.getMilliseconds(),3)}`}function k(L){return JSON.stringify(L,null,2)}async function A(L){await Go(k(L))&&(v.value=L.id,setTimeout(()=>{v.value===L.id&&(v.value=null)},1500))}function $(){g5(d.value)}function I(L){return u(L)||L.source==="client"?"b-err":L.source==="rest"?"b-rest":L.kind==="ws:lifecycle"?"b-life":L.kind==="ws:out"?"b-out":"b-in"}function x(L){return L.source==="rest"?"REST":L.source==="client"?"APP":"WS"}return(L,E)=>(w(),T("section",jbe,[_("header",Vbe,[E[11]||(E[11]=_("strong",null,"KAP debug",-1)),_("span",Kbe,O(d.value.length)+"/"+O(a.value.length),1),_("div",Gbe,[_("button",{type:"button",class:We({on:C(Zu)}),onClick:E[0]||(E[0]=F=>Zu.value=!C(Zu))},O(C(Zu)?"resume":"pause"),3),_("button",{type:"button",onClick:E[1]||(E[1]=F=>C(Kte)())},"clear"),_("button",{type:"button",onClick:E[2]||(E[2]=F=>$())},"export jsonl"),re(Xt,{text:"Close window"},{default:Ee(()=>[_("button",{type:"button",onClick:E[3]||(E[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",Ybe,[$n(_("select",{"onUpdate:modelValue":E[4]||(E[4]=F=>o.value=F),"aria-label":"Source filter"},[...E[12]||(E[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[Vg,o.value]]),$n(_("select",{"onUpdate:modelValue":E[5]||(E[5]=F=>i.value=F),"aria-label":"Session filter"},[E[13]||(E[13]=_("option",{value:""},"all sessions",-1)),(w(!0),T(Pe,null,ot(c.value,F=>(w(),T("option",{key:F,value:F},O(F),9,Zbe))),128))],512),[[Vg,i.value]]),$n(_("input",{"onUpdate:modelValue":E[6]||(E[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[_s,s.value]]),_("label",Qbe,[$n(_("input",{"onUpdate:modelValue":E[7]||(E[7]=F=>r.value=F),type:"checkbox"},null,512),[[op,r.value]]),E[14]||(E[14]=Je(" errors",-1))]),_("label",Xbe,[$n(_("input",{"onUpdate:modelValue":E[8]||(E[8]=F=>g.value=F),type:"checkbox"},null,512),[[op,g.value]]),E[15]||(E[15]=Je(" follow",-1))]),_("div",Jbe,[_("button",{type:"button",class:We({on:l.value==="timeline"}),onClick:E[9]||(E[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:We({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),T("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(w(),T("div",exe," No trace entries yet. REST calls and WS frames will appear here. ")):ce("",!0),(w(!0),T(Pe,null,ot(d.value,F=>(w(),T("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:We(["kap-row",{expanded:p.value===F.id}]),onClick:S=>m(F.id)},[_("span",nxe,O(y(F.ts)),1),_("span",{class:We(["kap-badge",I(F)])},O(x(F)),3),_("span",oxe,O(F.label),1)],10,txe),p.value===F.id?(w(),T("div",sxe,[_("div",ixe,[_("button",{type:"button",onClick:S=>A(F)},O(v.value===F.id?"copied ✓":"copy json"),9,rxe)]),_("pre",null,O(k(F)),1)])):ce("",!0)]))),128))],512)):(w(),T("div",lxe,[E[20]||(E[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[E[17]||(E[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(w(!0),T(Pe,null,ot(f.value,F=>(w(),T("tr",{key:F.key},[_("td",null,O(F.dir),1),_("td",axe,O(F.eventType),1),_("td",cxe,O(F.sessionId),1),_("td",uxe,O(F.count),1),_("td",dxe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),T("tr",fxe,[...E[16]||(E[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ce("",!0)])]),E[21]||(E[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[E[19]||(E[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(w(!0),T(Pe,null,ot(h.value,F=>(w(),T("tr",{key:F.key},[_("td",hxe,O(F.key),1),_("td",pxe,O(F.count),1),_("td",{class:We(["num",{err:F.errors>0}])},O(F.errors),3),_("td",mxe,O(F.avgMs),1)]))),128)),h.value.length===0?(w(),T("tr",gxe,[...E[18]||(E[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ce("",!0)])])]))]))}}),yxe=ct(vxe,[["__scopeId","data-v-3cda6fe3"]]),kxe=Ze({__name:"DebugPanel",setup(e){const t=X(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=sp(yxe,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return cn(()=>{c()}),mo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),xe(Xt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),bxe=ct(kxe,[["__scopeId","data-v-21346738"]]);function xxe({client:e,authLogoRef:t}){const n=R(()=>e.authReady.value),o=R(()=>e.initialized.value&&!n.value),s="/login",i=X(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)}Qe(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return bn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function wxe({running:e,showAuthGate:t}){const{t:n}=Tt(),o=["◐","◓","◑","◒"],s=X(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}Qe(e,c=>{c?r():l()},{immediate:!0});const a=R(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});xT(()=>{typeof document<"u"&&(document.title=a.value)}),bn(()=>{l()})}const B8=X(typeof window>"u"?0:window.innerWidth);let mh=0,Qp=!1;function ay(){B8.value=window.innerWidth}function _xe(){Qp||typeof window>"u"||(window.addEventListener("resize",ay),Qp=!0,ay())}function Sxe(){!Qp||typeof window>"u"||(window.removeEventListener("resize",ay),Qp=!1)}function D8(e,t,n){return Math.max(t,e-n)}function cy(e,t,n){return Math.min(n,Math.max(t,e))}function P8(){return cn(()=>{mh+=1,_xe()}),mo(()=>{mh=Math.max(0,mh-1),mh===0&&Sxe()}),{viewportWidth:B8}}const Cxe="kimi-web.file-preview-width",bc=320;function Axe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=P8(),i=R(()=>Math.max(0,s.value-t.value)),r=R(()=>D8(i.value,bc,bc));function l(ie){return cy(Math.round(ie),bc,r.value)}function a(){return l(i.value/2)}const c=R(()=>a()),u=X(c.value),d=R(()=>cy(u.value,bc,r.value)),f=X(null),h=R(()=>{const ie=f.value;if(!ie)return null;const ee=e.turns.value.find(ye=>ye.id===ie.turnId)?.blocks?.[ie.blockIndex];return ee?.kind==="thinking"?ee.thinking:null}),p=R(()=>h.value!==null);function g(ie){const q=f.value;if(q&&q.turnId===ie.turnId&&q.blockIndex===ie.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ie}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const v=X(null),m=R(()=>{const ie=v.value;if(!ie)return null;const q=e.turns.value.find(ee=>ee.id===ie.turnId);return q?.role==="compaction"&&q.text?q.text:null}),y=R(()=>m.value!==null);function k(ie){if(v.value?.turnId===ie.turnId){v.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",v.value=ie}function A(){v.value=null,n.value==="compaction"&&(n.value=null)}const $=X(null);function I(ie){const q=e.activeAppTasks.value,ee=q.find(fe=>fe.id===ie)??q.find(fe=>fe.parentToolCallId===ie);if(ee)return ee.id;const ye=q.filter(fe=>fe.kind==="subagent"&&!fe.parentToolCallId);if(ye.length===1)return ye[0].id}const x=R(()=>{const ie=$.value;if(!ie)return null;const q=e.activeAppTasks.value.find(ee=>ee.id===ie.subagentId);return q?e1e(q):null}),L=R(()=>x.value!==null);function E(ie){const q=I(ie);if(q){if($.value?.subagentId===q){$.value=null,n.value==="agent"&&(n.value=null);return}$.value={subagentId:q},n.value="agent"}}function F(){$.value=null,n.value==="agent"&&(n.value=null)}const S=X(null),N=R(()=>{const ie=S.value;if(!ie)return null;const q=wH(e.turns.value,ie);return q?{id:ie,title:Da(q.name),path:xH(q.arg),lines:q.status==="error"?null:NA(q),output:q.output}:null}),D=R(()=>N.value!==null);function B(ie){if(n.value==="toolDiff"&&S.value===ie){U();return}n.value="toolDiff",S.value=ie}function U(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const H=X("list"),P=X(null);function Z(){if(n.value==="diff"){K();return}n.value="diff",H.value="list",P.value=null,e.loadGitStatus(e.activeSessionId.value)}function K(){n.value==="diff"&&(n.value=null),H.value="list",P.value=null,e.clearFileDiff()}async function V(ie){H.value="detail",P.value=ie,await e.loadFileDiff(ie)}async function J(ie){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,ie):await e.openSideChat(ie),n.value="btw"}function he(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ne(){n.value==="btw"&&(n.value=null)}const ue=R(()=>e.sideChatVisible.value),de=R(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||y.value)&&(n.value!=="agent"||L.value)&&(n.value!=="toolDiff"||D.value)&&(n.value!=="btw"||ue.value)),Ce=X(!1),Ie=X({});function le(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return v.value?{kind:"compaction",...v.value}:null;case"agent":return $.value?{kind:"agent",...$.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function z(ie){if(ie)switch(ie.kind){case"thinking":f.value={turnId:ie.turnId,blockIndex:ie.blockIndex},n.value="thinking";break;case"compaction":v.value={turnId:ie.turnId},n.value="compaction";break;case"agent":$.value={subagentId:ie.subagentId},n.value="agent";break;case"toolDiff":S.value=ie.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ae(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&y.value?(A(),!0):n.value==="agent"&&L.value?(F(),!0):n.value==="toolDiff"&&D.value?(U(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(K(),!0):n.value==="btw"?(he(),!0):!1}return Qe(e.activeSessionId,(ie,q)=>{if(q){const ee=le();ee?Ie.value[q]=ee:delete Ie.value[q]}o(),b(),A(),F(),U(),K(),ne(),ie&&z(Ie.value[ie])}),{PREVIEW_WIDTH_KEY:Cxe,PREVIEW_MIN:bc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:g,closeThinkingPanel:b,compactionPanelText:m,compactionPanelVisible:y,openCompactionPanel:k,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:L,openAgentPanel:E,closeAgentPanel:F,toolDiffTarget:N,toolDiffVisible:D,openToolDiff:B,closeToolDiff:U,detailDiffMode:H,detailDiffPath:P,openDiffDetail:Z,closeDiffDetail:K,selectDiffFile:V,btwVisible:ue,openSideChatTab:J,closeSideChat:he,hideSideChatPanel:ne,sidePanelVisible:de,panelDragging:Ce,closeOpenSidePanel:ae}}const Mxe=Ft.sidebarWidth,h4=Ft.sidebarCollapsed,p4=270,Eg=170,Exe=480,Txe=320;function Nxe(e={}){const{viewportWidth:t}=P8(),n=X(p4),o=X(!1),s=X(!1),i=R(()=>{const u=Txe+(D4(e.previewOpen)?bc:0);return Math.min(Exe,D8(t.value,Eg,u))}),r=R(()=>cy(n.value,Eg,i.value));function l(){try{o.value=ao(h4)==="true"}catch{o.value=!1}}function a(){try{So(h4,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:Mxe,SIDEBAR_DEFAULT:p4,SIDEBAR_MIN:Eg,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function Ixe({client:e,detailTarget:t}){const{t:n}=Tt(),o=X(null),s=X(null),i=X(!1),r=X(null),l=X(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=R(()=>{const I=l.value;return I?e.getFileDownloadUrl(I):null}),f=R(()=>o.value!==null);function h(I){return I.length>1?I.replace(/\/+$/,""):I}function p(I){const x=[];for(const L of I.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){x.pop();continue}x.push(L)}return x.join("/")}function g(I){const x=I.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=h(e.status.value.cwd);if(x.startsWith("/")){if(!L||x!==L&&!x.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===L?"":x.slice(L.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(x);return E?{path:E}:{error:n("filePreview.errors.emptyPath")}}async function b(I){const x=o.value;if(t.value==="file"&&x&&x.path===I.path&&x.line===I.line){k();return}const L=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=I,l.value=null;const E=g(I.path);if("error"in E){i.value=!1,r.value=E.error;return}l.value=E.path;try{const F=await e.readFileContent(E.path);if(L!==a)return;F?s.value={...F,path:F.path||E.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if(L!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function v(I){return/^data:([^;,]+)/i.exec(I)?.[1]}function m(I){if(I.kind!=="image")return;const x=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const L={path:I.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:I.mimeType??v(I.url)??"image/*",isBinary:!0,size:I.bytes??0};I.fileId?(i.value=!0,s.value=L,dt().getFileBlob(I.fileId).then(E=>{if(x===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(E),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{x===a&&(s.value&&(s.value={...s.value,sourceUrl:I.url}),i.value=!1)})):(i.value=!1,s.value={...L,sourceUrl:I.url})}function y(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function k(){y(),t.value==="file"&&(t.value=null)}Qe(t,(I,x)=>{x==="file"&&I!=="file"&&y()});function A(){const I=s.value?.path??o.value?.path;I&&e.openWorkspaceFile(I,o.value?.line)}function $(){const I=s.value?.path??o.value?.path;I&&e.revealWorkspaceFile(I)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:b,openMediaPreview:m,closeFilePreview:k,openPreviewInEditor:A,revealPreviewFile:$}}const Lxe=640,$xe=`(max-width: ${Lxe}px)`;function Fxe(){const e=X(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia($xe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),bn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),bn(()=>t.removeListener(n))),e}const Oxe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Rxe={class:"server-auth-card"},Bxe={class:"server-auth-body"},Dxe={class:"server-auth-foot"},Pxe=Ze({__name:"ServerAuthDialog",setup(e){const t=X(""),n=X(null),o=X(!1);cn(()=>{mt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,w5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(w(),T("div",Oxe,[_("div",Rxe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[Je(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"KIMI_CODE_PASSWORD"),Je("). ")])],-1)),_("div",Bxe,[re(Vc,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),_("div",Dxe,[re(Rt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ee(()=>[Je(O(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Hxe=ct(Pxe,[["__scopeId","data-v-6f624612"]]),Wxe=["aria-label"],zxe=Ze({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=PB;return(o,s)=>C(n)?(w(),T("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=_("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,O(C(t)("app.internalBuildBanner")),1)],8,Wxe)):ce("",!0)}}),Uxe=ct(zxe,[["__scopeId","data-v-166b3735"]]),qxe={class:"app-shell"},jxe={key:1,class:"auth-page"},Vxe={class:"auth-page-inner"},Kxe={class:"auth-page-copy"},Gxe=["aria-label","aria-hidden"],Yxe=Ze({__name:"App",setup(e){Dne();const t=X(!1);let n=null;const o=y2(),s=R(()=>!o.dangerousBypassAuth.value&&t.value);In("resolveImage",o.resolveImageUrl),In("resolveSwarmMembers",Fe=>o.swarmMembersByToolCallId.value.get(Fe)??[]);const{t:i}=Tt(),{confirm:r}=nf(),l=Hi(),a=Fxe(),c=X(!1),u=X(!1),d=R(()=>{const Fe=o.activeSessionId.value;return o.sessions.value.find(oe=>oe.id===Fe)?.title??""}),f=R(()=>o.visibleWorkspace.value?.sessionCount??0),h=R(()=>o.activity.value!=="idle"),p=X(null),{showAuthGate:g,blinkAuthLogo:b}=xxe({client:o,authLogoRef:p});wxe({running:h,showAuthGate:g});function v(Fe){const oe=o.models.value.find(He=>He.id===o.status.value.modelId),Te=Ym(oe),pe=Te.indexOf(Hp(oe,Fe)),_e=Te[(pe+1)%Te.length]??Te[0]??"off";return jk(oe,_e)}const m=R(()=>{const Fe=o.models.value.find(oe=>oe.id===o.status.value.modelId);return Hp(Fe,o.thinking.value)}),y=X(!o.onboarded.value);function k(){o.setOnboarded(!0),y.value=!1}function A(){y.value=!0}let $=0;function I(){const Fe=window.visualViewport,oe=document.documentElement.style;oe.setProperty("--app-height",`${Fe?.height??window.innerHeight}px`),oe.setProperty("--app-top",`${Fe?.offsetTop??0}px`)}function x(){$||($=requestAnimationFrame(()=>{$=0,I()}))}cn(()=>{n=Wne(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),ie(),I(),window.visualViewport?.addEventListener("resize",x),window.visualViewport?.addEventListener("scroll",x),window.addEventListener("resize",x),document.addEventListener("keydown",L,!0)}),bn(()=>{document.removeEventListener("keydown",L,!0),window.visualViewport?.removeEventListener("resize",x),window.visualViewport?.removeEventListener("scroll",x),window.removeEventListener("resize",x),$&&(cancelAnimationFrame($),$=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function L(Fe){Fe.key==="Escape"&&(Xe.value||os()&&(Fe.stopPropagation(),Fe.preventDefault()))}const E=X(null),F=X(!1);Qe(o.activeSessionId,()=>{F.value=!0,mt(()=>{F.value=!1})});const{previewTarget:S,previewFile:N,previewLoading:D,previewError:B,previewDownloadUrl:U,previewExternalActions:H,openFilePreview:P,openMediaPreview:Z,closeFilePreview:K,openPreviewInEditor:V,revealPreviewFile:J}=Ixe({client:o,detailTarget:E}),he=R(()=>E.value!==null),{SIDEBAR_WIDTH_KEY:ne,SIDEBAR_DEFAULT:ue,SIDEBAR_MIN:de,sidebarMax:Ce,sessionColWidth:Ie,sidebarCollapsed:le,sidebarDragging:z,sideWidth:ae,loadSidebarCollapsed:ie,toggleSidebarCollapse:q}=Nxe({previewOpen:he}),{PREVIEW_WIDTH_KEY:ee,PREVIEW_MIN:ye,previewDefaultWidth:fe,previewMax:ve,previewWidth:j,previewPanelWidth:te,thinkingPanelText:me,thinkingVisible:Ae,openThinkingPanel:$e,closeThinkingPanel:De,compactionPanelText:ge,compactionPanelVisible:Ne,openCompactionPanel:et,closeCompactionPanel:rt,agentPanelMember:St,openAgentPanel:gt,closeAgentPanel:It,toolDiffTarget:Ut,openToolDiff:ht,closeToolDiff:un,detailDiffMode:dn,detailDiffPath:ns,openDiffDetail:Wt,closeDiffDetail:Pn,selectDiffFile:co,btwVisible:it,openSideChatTab:Gn,closeSideChat:uo,sidePanelVisible:Yn,panelDragging:go,closeOpenSidePanel:os}=Axe({client:o,sideWidth:ae,detailTarget:E,closeFilePreview:K}),Un=X(null),to=X(!1),vn=X(!1),Zn=X(!1),xn=X(!1),Cn=X(!1),An=X(!1),Do=X(null),ze=X(null),Xe=R(()=>gc.value>0||to.value||vn.value||Zn.value||xn.value||Cn.value||An.value||y.value||c.value||u.value),kt=X(!1),Pt=X(!1),On=X(!1),sn=X(!1),Gt=X(!1);async function Hn(){kt.value=!0,Pt.value=!1,to.value=!0;try{await o.refreshAllProviders()}catch{Pt.value=!0}finally{kt.value=!1}}async function Mn(){On.value=!0,sn.value=!1,vn.value=!0;try{await o.loadProviders()}catch{sn.value=!0}finally{On.value=!1}}function Ct(){Zn.value=!0}async function Po(Fe){to.value=!1,await Ao(Fe)}async function Ao(Fe){await o.setModel(Fe)&&Fe!==o.defaultModel.value&&o.updateConfig({defaultModel:Fe})}async function ss(Fe){await o.addProvider(Fe)}async function En(Fe){await o.refreshProvider(Fe)}async function qn(Fe){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Fe)})}async function Ps(Fe){const oe=o.workspacesView.value.find(Te=>Te.id===Fe)?.name??Fe;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:oe}),variant:"danger",action:()=>o.deleteWorkspace(Fe)})}async function ti(Fe){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Fe)})}async function Io(Fe){Gt.value=!0;try{await o.updateConfig(Fe)&&await o.checkAuth()}finally{Gt.value=!1}}async function Ss(){return o.startOAuthLogin()}async function Wi(){return o.pollOAuthLogin()}async function Si(){return o.cancelOAuthLogin()}async function fo(){Zn.value=!1,await o.checkAuth(),await o.load()}async function ni(Fe){await o.undo(1),await mt(),Un.value?.loadComposerForEdit(Fe.text,Fe.attachments)}function Ci(Fe){if(Fe==="/compact"||Fe.startsWith("/compact ")){o.compact(Fe.slice(8).trim()||void 0);return}if(Fe==="/swarm"||Fe.startsWith("/swarm ")){const oe=Fe.slice(6).trim();oe==="on"?o.setSwarmMode(!0):oe==="off"?o.setSwarmMode(!1):oe?(o.setSwarmMode(!0),o.sendPrompt(oe)):o.toggleSwarmMode();return}if(Fe==="/goal"||Fe.startsWith("/goal ")){const oe=Fe.slice(5).trim();oe==="pause"||oe==="resume"||oe==="cancel"?o.controlGoal(oe):oe?o.createGoal(oe):o.toggleGoalMode();return}if(Fe==="/btw"||Fe.startsWith("/btw ")){const oe=Fe.slice(4).trim();!oe&&o.sideChatVisible.value?uo():Gn(oe||void 0);return}switch(Fe){case"/new":case"/clear":$o();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(v(o.thinking.value));break;case"/status":Cn.value=!0;break;case"/login":Ct();break;default:{const oe=Fe.indexOf(" "),Te=wre((oe===-1?Fe:Fe.slice(0,oe)).slice(1)),pe=oe===-1?void 0:Fe.slice(oe+1).trim()||void 0;if(!Te)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Te,pe):o.activateSkill(Te,pe);break}}}function ar(Fe){o.unqueue(Fe)}function no(Fe){o.unqueue(Fe)}function is(Fe){o.reorderQueue(Fe.from,Fe.to)}async function rs(Fe){const oe=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&oe){await o.startSessionAndSendPrompt(oe,Fe.text,Fe.attachments);return}if(!o.activeSessionId.value&&!oe){Do.value=Fe,xn.value=!0;return}o.sendPrompt(Fe.text,Fe.attachments)}async function Lo(Fe){if(ze.value=null,!await o.addWorkspaceByPath(Fe)){ze.value=i("workspace.addFailed");return}xn.value=!1;const Te=Do.value;Do.value=null;const pe=o.activeWorkspaceId.value;Te&&pe&&await o.startSessionAndSendPrompt(pe,Te.text,Te.attachments)}function Ai(){Do.value=null,ze.value=null,xn.value=!1}function Wn(){mt(()=>{Un.value?.focusComposer()})}function $o(){const Fe=o.activeWorkspaceId.value;Fe?o.openWorkspaceDraft(Fe):o.clearActiveSession(),Wn()}function oi(Fe){o.openWorkspaceDraft(Fe),Wn()}function Ue(Fe){Fe&&window.open(Fe,"_blank","noopener")}return(Fe,oe)=>(w(),T("div",qxe,[s.value?(w(),xe(Hxe,{key:0})):ce("",!0),C(g)?(w(),T("section",jxe,[_("div",Vxe,[(w(),T("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:oe[0]||(oe[0]=bt(()=>{},["prevent"])),onClick:oe[1]||(oe[1]=(...Te)=>C(b)&&C(b)(...Te))},[...oe[98]||(oe[98]=[Ey('<defs data-v-8cd3196b><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-8cd3196b><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-8cd3196b></rect><g class="ch-eyes" fill="#000" data-v-8cd3196b><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-8cd3196b></rect>',2)])],544)),_("div",Kxe,[_("h1",null,O(C(i)("app.authPageTitle")),1),_("p",null,O(C(i)("app.authPageMessage")),1)]),re(Rt,{class:"auth-page-btn",variant:"primary",onClick:Ct},{default:Ee(()=>[re(Ve,{name:"log-in",size:"md"}),_("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(w(),T("div",{key:2,class:We(["app",{mobile:C(a),"sidebar-collapsed":C(le)&&!C(a),"macos-desktop":C(Bc)}]),style:Yt({"--preview-w":C(te)+"px"})},[C(a)?(w(),xe(Yke,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:oe[19]||(oe[19]=Te=>c.value=!0),onOpenSettings:oe[20]||(oe[20]=Te=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),T(Pe,{key:0},[re(aD,{collapsed:C(le),dragging:C(z),"col-width":C(ae),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,backend:C(o).backend.value,onSelect:oe[2]||(oe[2]=Te=>C(o).selectSession(Te)),onCreate:$o,onCreateInWorkspace:oe[3]||(oe[3]=Te=>oi(Te)),onSelectWorkspace:oe[4]||(oe[4]=Te=>C(o).openWorkspace(Te)),onAddWorkspace:oe[5]||(oe[5]=Te=>xn.value=!0),onRename:oe[6]||(oe[6]=(Te,pe)=>C(o).renameSession(Te,pe)),onArchive:oe[7]||(oe[7]=Te=>qn(Te)),onFork:oe[8]||(oe[8]=Te=>C(o).forkSession(Te)),onExport:oe[9]||(oe[9]=Te=>C(o).exportSession(Te)),onRenameWorkspace:oe[10]||(oe[10]=(Te,pe)=>C(o).renameWorkspace(Te,pe)),onDeleteWorkspace:oe[11]||(oe[11]=Te=>Ps(Te)),onReorderWorkspaces:oe[12]||(oe[12]=Te=>C(o).reorderWorkspaces(Te)),onSetWorkspaceSortMode:oe[13]||(oe[13]=Te=>C(o).setWorkspaceSortMode(Te)),onLoadMoreSessions:oe[14]||(oe[14]=Te=>void C(o).loadMoreSessions(Te)),onLoadAllSessions:oe[15]||(oe[15]=Te=>void C(o).loadAllSessions()),onOpenSettings:oe[16]||(oe[16]=Te=>An.value=!0),onCollapse:C(q)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),$n(re(mw,{class:"side-handle","storage-key":C(ne),"default-width":C(ue),min:C(de),max:C(Ce),"onUpdate:width":oe[17]||(oe[17]=Te=>Ie.value=Te),"onUpdate:dragging":oe[18]||(oe[18]=Te=>z.value=Te)},null,8,["storage-key","default-width","min","max"]),[[mi,!C(le)]])],64)),re(Aue,{ref_key:"conversationPaneRef",ref:Un,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:oe[21]||(oe[21]=Te=>C(Wt)()),onSelectWorkspace:oe[22]||(oe[22]=Te=>oi(Te)),onAddWorkspace:oe[23]||(oe[23]=Te=>xn.value=!0),onOpenPr:Ue,onSubmit:oe[24]||(oe[24]=Te=>rs(Te)),onSteer:oe[25]||(oe[25]=Te=>C(o).steerPrompt(Te.text,Te.attachments)),onApproval:oe[26]||(oe[26]=(Te,pe)=>C(o).respondApproval(Te,pe)),onCancelTask:oe[27]||(oe[27]=Te=>C(o).cancelTask(Te)),onAnswer:oe[28]||(oe[28]=(Te,pe)=>C(o).respondQuestion(Te,pe)),onDismiss:oe[29]||(oe[29]=Te=>C(o).dismissQuestion(Te)),onCommand:Ci,onInterrupt:oe[30]||(oe[30]=Te=>C(o).abortCurrentPrompt()),onUnqueue:ar,onEditQueued:no,onReorderQueue:is,onSetPermission:oe[31]||(oe[31]=Te=>C(o).setPermission(Te)),onSetThinking:oe[32]||(oe[32]=Te=>C(o).setThinking(Te)),onTogglePlan:oe[33]||(oe[33]=Te=>C(o).togglePlanMode()),onToggleSwarm:oe[34]||(oe[34]=Te=>C(o).toggleSwarmMode()),onToggleGoal:oe[35]||(oe[35]=Te=>C(o).toggleGoalMode()),onCreateGoal:oe[36]||(oe[36]=Te=>C(o).createGoal(Te)),onControlGoal:oe[37]||(oe[37]=Te=>C(o).controlGoal(Te)),onRefreshGitStatus:oe[38]||(oe[38]=Te=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:oe[39]||(oe[39]=(Te,pe)=>C(o).renameSession(Te,pe)),onForkSession:oe[40]||(oe[40]=Te=>C(o).forkSession(Te)),onArchiveSession:oe[41]||(oe[41]=Te=>qn(Te)),onExportSession:oe[42]||(oe[42]=Te=>C(o).exportSession(Te)),onCompact:oe[43]||(oe[43]=Te=>C(o).compact()),onPickModel:oe[44]||(oe[44]=Te=>Hn()),onSelectModel:oe[45]||(oe[45]=Te=>Ao(Te)),onOpenFile:oe[46]||(oe[46]=Te=>C(P)(Te)),onOpenMedia:oe[47]||(oe[47]=Te=>C(Z)(Te)),onOpenThinking:oe[48]||(oe[48]=Te=>C($e)(Te)),onOpenCompaction:oe[49]||(oe[49]=Te=>C(et)(Te)),onOpenAgent:oe[50]||(oe[50]=Te=>C(gt)(Te)),onOpenToolDiff:oe[51]||(oe[51]=Te=>C(ht)(Te)),onEditMessage:ni},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(a)&&(C(Bc)||C(le))?(w(),xe(Dn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(le)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(q)},{default:Ee(()=>[re(Ve,{name:C(le)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ce("",!0),C(Yn)&&!C(a)?(w(),xe(mw,{key:3,class:"preview-handle","storage-key":C(ee),"default-width":C(fe),min:C(ye),max:C(ve),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":oe[52]||(oe[52]=Te=>j.value=Te),"onUpdate:dragging":oe[53]||(oe[53]=Te=>go.value=Te)},null,8,["storage-key","default-width","min","max","aria-label"])):ce("",!0),!C(a)||C(Yn)?(w(),T("aside",{key:4,class:We(["global-preview",{open:C(Yn),mobile:C(a),"no-anim":C(go)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Yn)},[E.value==="thinking"&&C(Ae)?(w(),xe(YC,{key:0,text:C(me)??"",onClose:C(De)},null,8,["text","onClose"])):E.value==="compaction"&&C(Ne)?(w(),xe(YC,{key:1,text:C(ge)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(rt)},null,8,["text","subtitle","onClose"])):E.value==="agent"&&C(St)?(w(),xe(Kde,{key:2,member:C(St),onClose:C(It)},null,8,["member","onClose"])):E.value==="btw"&&C(it)?(w(),xe(pfe,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:oe[54]||(oe[54]=Te=>C(o).sendSideChatPrompt(Te)),onClose:C(uo)},null,8,["turns","running","sending","onClose"])):E.value==="diff"?(w(),xe(zfe,{key:4,mode:C(dn),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(co),onBack:oe[55]||(oe[55]=Te=>{dn.value="list",ns.value=null,C(o).clearFileDiff()}),onClose:C(Pn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):E.value==="toolDiff"&&C(Ut)?(w(),xe(rfe,{key:5,target:C(Ut),onClose:C(un)},null,8,["target","onClose"])):E.value==="file"?(w(),xe(Ede,{key:6,file:C(N),loading:C(D),error:C(B),line:C(S)?.line,"download-url":C(U),closable:"","external-actions":C(H),"open-file":C(P),onClose:C(K),onOpenExternal:C(V),onReveal:C(J)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ce("",!0)],10,Gxe)):ce("",!0),re(Uxe,{class:"internal-build-fab"}),to.value?(w(),xe(lhe,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:kt.value,unavailable:Pt.value,onSelect:oe[56]||(oe[56]=Te=>Po(Te)),onToggleStar:oe[57]||(oe[57]=Te=>C(o).toggleStarModel(Te)),onClose:oe[58]||(oe[58]=Te=>to.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ce("",!0),An.value?(w(),xe(Tye,{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":Gt.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:oe[59]||(oe[59]=Te=>C(o).setColorScheme(Te)),onSetAccent:oe[60]||(oe[60]=Te=>C(o).setAccent(Te)),onSetUiFontSize:oe[61]||(oe[61]=Te=>C(o).setUiFontSize(Te)),onSetNotify:oe[62]||(oe[62]=Te=>C(o).setNotifyOnComplete(Te)),onSetNotifyQuestion:oe[63]||(oe[63]=Te=>C(o).setNotifyOnQuestion(Te)),onSetNotifyApproval:oe[64]||(oe[64]=Te=>C(o).setNotifyOnApproval(Te)),onSetSound:oe[65]||(oe[65]=Te=>C(o).setSoundOnComplete(Te)),onSetConversationToc:oe[66]||(oe[66]=Te=>C(o).setConversationToc(Te)),onUpdateConfig:oe[67]||(oe[67]=Te=>Io(Te)),onLogin:oe[68]||(oe[68]=()=>{An.value=!1,Ct()}),onLogout:C(o).logout,onOpenOnboarding:oe[69]||(oe[69]=()=>{An.value=!1,A()}),onOpenProviders:oe[70]||(oe[70]=()=>{An.value=!1,Mn()}),onClose:oe[71]||(oe[71]=Te=>An.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):ce("",!0),vn.value?(w(),xe(Lhe,{key:7,providers:C(o).providers.value,loading:On.value,unavailable:sn.value,onAdd:oe[72]||(oe[72]=Te=>ss(Te)),onRefresh:oe[73]||(oe[73]=Te=>En(Te)),onDelete:oe[74]||(oe[74]=Te=>ti(Te)),onOpenLogin:oe[75]||(oe[75]=()=>{vn.value=!1,Ct()}),onClose:oe[76]||(oe[76]=Te=>vn.value=!1)},null,8,["providers","loading","unavailable"])):ce("",!0),Cn.value?(w(),xe(Eke,{key:8,status:C(o).status.value,thinking:m.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:oe[77]||(oe[77]=Te=>Cn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ce("",!0),xn.value?(w(),xe(fke,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:ze.value,onAdd:oe[78]||(oe[78]=Te=>Lo(Te)),onClose:Ai},null,8,["browse-fs","get-fs-home","default-path","error"])):ce("",!0),re(Il,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?ce("",!0):(w(),xe(qbe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&y.value&&!C(g)?(w(),xe(Bbe,{key:10,onComplete:k,onSkip:k})):ce("",!0),re(Hke,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(w(),xe(bxe,{key:11})):ce("",!0),re(gke),C(a)?(w(),xe(y2e,{key:12,modelValue:c.value,"onUpdate:modelValue":oe[79]||(oe[79]=Te=>c.value=Te),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:oe[80]||(oe[80]=Te=>C(o).selectSession(Te)),onCreate:$o,onCreateInWorkspace:oe[81]||(oe[81]=Te=>oi(Te)),onAddWorkspace:oe[82]||(oe[82]=Te=>xn.value=!0),onRename:oe[83]||(oe[83]=(Te,pe)=>C(o).renameSession(Te,pe)),onArchive:oe[84]||(oe[84]=Te=>qn(Te)),onDeleteWorkspace:oe[85]||(oe[85]=Te=>Ps(Te)),onLoadMore:oe[86]||(oe[86]=Te=>void C(o).loadMoreSessions(Te))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ce("",!0),C(a)?(w(),xe(Cbe,{key:13,modelValue:u.value,"onUpdate:modelValue":oe[87]||(oe[87]=Te=>u.value=Te),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:oe[88]||(oe[88]=Te=>Hn()),onSetThinking:oe[89]||(oe[89]=Te=>C(o).setThinking(Te)),onTogglePlan:oe[90]||(oe[90]=Te=>C(o).togglePlanMode()),onToggleSwarm:oe[91]||(oe[91]=Te=>C(o).toggleSwarmMode()),onSetPermission:oe[92]||(oe[92]=Te=>C(o).setPermission(Te)),onSetColorScheme:oe[93]||(oe[93]=Te=>C(o).setColorScheme(Te)),onSetUiFontSize:oe[94]||(oe[94]=Te=>C(o).setUiFontSize(Te)),onSetConversationToc:oe[95]||(oe[95]=Te=>C(o).setConversationToc(Te)),onLogin:oe[96]||(oe[96]=()=>{u.value=!1,Ct()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ce("",!0)],6)),Zn.value?(w(),xe(cpe,{key:3,"on-start-o-auth-login":Ss,"on-poll-o-auth-login":Wi,"on-cancel-o-auth-login":Si,onSuccess:fo,onClose:oe[97]||(oe[97]=Te=>Zn.value=!1)})):ce("",!0)]))}}),Zxe=ct(Yxe,[["__scopeId","data-v-8cd3196b"]]);Jte();sp(Zxe).use(wn).mount("#app");export{DE as $,o3 as A,ET as B,bo as C,Ywe as D,x4 as E,Pe as F,Ey as G,Je as H,re as I,lT as J,bwe as K,Li as L,Ze as M,eN as N,Swe as O,Cwe as P,Ewe as Q,Hh as R,Oc as S,hm as T,Awe as U,Ny as V,_we as W,Qwe as X,Mwe as Y,qwe as Z,Xxe as _,Z4 as a,jo as a$,Yo as a0,fy as a1,rwe as a2,yy as a3,S9 as a4,mn as a5,iu as a6,fwe as a7,e_e as a8,gwe as a9,t3 as aA,PT as aB,jT as aC,cn as aD,qT as aE,UT as aF,hy as aG,zT as aH,bn as aI,by as aJ,fT as aK,w as aL,Q9 as aM,uwe as aN,In as aO,P4 as aP,cwe as aQ,jh as aR,Bo as aS,zh as aT,X as aU,Dwe as aV,gN as aW,ot as aX,Fn as aY,KT as aZ,xwe as a_,kwe as aa,ywe as ab,vwe as ac,Hwe as ad,t_e as ae,Kt as af,N9 as ag,dm as ah,_l as ai,Hr as aj,po as ak,Pwe as al,Ks as am,Nl as an,pt as ao,Iwe as ap,Lwe as aq,yn as ar,mt as as,O9 as at,We as au,Qxe as av,Yt as aw,DT as ax,WT as ay,mo as az,awe as b,EX as b$,Kwe as b0,xd as b1,Qh as b2,jwe as b3,Tl as b4,oT as b5,ewe as b6,Ra as b7,kT as b8,Vwe as b9,_s as bA,mi as bB,I9 as bC,zwe as bD,Qe as bE,xT as bF,hwe as bG,wT as bH,Fwe as bI,Ee as bJ,Twe as bK,$n as bL,nr as bM,Wwe as bN,bt as bO,dwe as bP,gn as bQ,ms as bR,d_e as bS,vJ as bT,zM as bU,h_e as bV,VQ as bW,xk as bX,f_e as bY,bv as bZ,k_e as b_,Jxe as ba,O as bb,gh as bc,wwe as bd,en as be,owe as bf,nwe as bg,D4 as bh,Bwe as bi,twe as bj,C as bk,Kd as bl,Jwe as bm,Zwe as bn,nN as bo,pwe as bp,Owe as bq,bT as br,Xwe as bs,Nwe as bt,mwe as bu,Y4 as bv,op as bw,dN as bx,z3 as by,Vg as bz,Uwe as c,MX as c0,yk as c1,AX as c2,a_e as c3,PQ as c4,l_e as c5,Ep as c6,s_e as c7,CX as c8,RM as c9,y_e as ca,i_e as cb,x_e as cc,Av as cd,Mc as ce,Sv as cf,w_e as cg,b_e as ch,u_e as ci,qs as cj,r_e as ck,c_e as cl,GQ as cm,v_e as cn,Cv as co,_v as cp,g_e as cq,o_e as cr,m_e as cs,p_e as ct,Ve as cu,n_e as cv,ct as cw,Rwe as d,Sl as e,swe as f,Il as g,iN as h,iwe as i,lwe as j,wi as k,qd as l,No as m,om as n,Wr as o,Gwe as p,R as q,sp as r,xe as s,ce as t,T as u,_ as v,m9 as w,$we as x,p9 as y,vN as z};
|