@moonshot-ai/kimi-code 0.22.2 → 0.23.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 +2472 -1258
- package/dist-web/assets/{CodeBlockNode-CaJnX8WY.js → CodeBlockNode-Bi8jIiGS.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-BRgPQSVb.js → CodeBlockShell.vue_vue_type_style_index_0_lang-B0EX64Fy.js} +1 -1
- package/dist-web/assets/DesignSystemView-CxzrbiS1.css +1 -0
- package/dist-web/assets/DesignSystemView-uZVLgoX6.js +12 -0
- package/dist-web/assets/{Tooltip-DZguFKhz.js → Tooltip-BvXZgTKH.js} +1 -1
- package/dist-web/assets/{arc-DtSq864Y.js → arc-Dq8eiFQP.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-DMQz4tYy.js → architectureDiagram-3BPJPVTR-b6nIVGZD.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-uiDJjfXs.js → blockDiagram-GPEHLZMM-B3B2WOkj.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-Dupe9n1b.js → c4Diagram-AAUBKEIU-BKyN3yLu.js} +1 -1
- package/dist-web/assets/channel-DYPbvBMu.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-CAvfdKCa.js → chunk-2J33WTMH-HN_s9nzs.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-Bqf9QeRR.js → chunk-4BX2VUAB-fxHwG6FR.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DMDy7rWA.js → chunk-55IACEB6-D-XDLZ_9.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-RW5JVWWF.js → chunk-727SXJPM-BdVZmbdu.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-C3cDBsoU.js → chunk-AQP2D5EJ-C0q5GUyy.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-P4JPvwBw.js → chunk-FMBD7UC4-BHvs9p4D.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-CrF954Ah.js → chunk-ND2GUHAM-BCuwZrYk.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-Vs9ezeZH.js → chunk-QZHKN3VN-sdMQprxY.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-7hR3h9FG.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-7hR3h9FG.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-COoPAHpC.js → cose-bilkent-S5V4N54A-DAKVyg0y.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-BBOPrdG4.js → dagre-BM42HDAG-fE0QBWG7.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-LRx2sTw8.js → diagram-2AECGRRQ-DhTfW7BA.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DsCaLaVB.js → diagram-5GNKFQAL-BFxW-PQU.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-C5eIL5L7.js → diagram-KO2AKTUF-D29F_M5j.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-DFMNWSuI.js → diagram-LMA3HP47-DVsX1Zqb.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-YtRDbT5E.js → diagram-OG6HWLK6-C1xkLsBo.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-DcGLpZq8.js → erDiagram-TEJ5UH35-RExHqUHF.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-iTJJ8EFf.js → flowDiagram-I6XJVG4X-Bb2CxfqX.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-DQgm6pxo.js → ganttDiagram-6RSMTGT7-CPgclO8f.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DhCBgkG8.js → gitGraphDiagram-PVQCEYII-CkbhTuQx.js} +1 -1
- package/dist-web/assets/index-BBqKjyg_.css +1 -0
- package/dist-web/assets/{index-DpLAujyX.js → index-C20P6k3r.js} +1 -1
- package/dist-web/assets/{index-CFiJLIKp.js → index-CvZ8g4D9.js} +2 -2
- package/dist-web/assets/index-SziNj6Ky.js +292 -0
- package/dist-web/assets/{index10-Cq9SfqzI.js → index10-C34WriXe.js} +1 -1
- package/dist-web/assets/{index11-BsI2TwS2.js → index11-DnWluvv0.js} +1 -1
- package/dist-web/assets/{index5-D0QCZ2WX.js → index5-DMfYcwho.js} +1 -1
- package/dist-web/assets/{index6-BCwMTbX-.js → index6-CM7_ALPI.js} +1 -1
- package/dist-web/assets/{index7-ngQ9Fglu.js → index7-DOz39QJX.js} +1 -1
- package/dist-web/assets/{index8-B8E09VXR.js → index8-DDNiq5_W.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-VG0FT9QF.js → infoDiagram-5YYISTIA-DhTeo1nz.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-57-3fzN_.js → ishikawaDiagram-YF4QCWOH-C6zNOyfV.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-_qj0ZBQM.js → journeyDiagram-JHISSGLW-GqHLo20m.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-cpqKXF62.js → kanban-definition-UN3LZRKU-COLCFNmp.js} +1 -1
- package/dist-web/assets/{linear-lEP30Zqf.js → linear-BNWcliWU.js} +1 -1
- package/dist-web/assets/{mermaid.core-COCaMagj.js → mermaid.core-Dvwdy-Wb.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-BTy9wxvg.js → mindmap-definition-RKZ34NQL-MmqWhMt1.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-B9qPVNTt.js → pieDiagram-4H26LBE5-D2HeVweL.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CIkg17kt.js → quadrantDiagram-W4KKPZXB-D0Gnhh0w.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-Cp6p0EDe.js → requirementDiagram-4Y6WPE33-DV_rvSe0.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-D4mtZQUj.js → sankeyDiagram-5OEKKPKP-CIOHPqwt.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CYHpIUE5.js → sequenceDiagram-3UESZ5HK-OMPW2dQZ.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-B1Vf-wla.js → stateDiagram-AJRCARHV-DGC2N7WX.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BWIlZ-Ms.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-Dau6vvwN.js → timeline-definition-PNZ67QCA-DVD8syC3.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-DTu2pySe.js → vennDiagram-CIIHVFJN-DjolQSRq.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-Bd0MpuGP.js → vue.runtime.esm-bundler-DOh9SYil.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-CRpR3kk0.js → wardley-L42UT6IY-4aEVZF_y.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-XbULEr5H.js → wardleyDiagram-YWT4CUSO-CMJ7T5Da.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-C34wLyKM.js → xychartDiagram-2RQKCTM6-SWdAUpzG.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +7 -7
- package/dist-web/assets/DesignSystemView-2XTmljim.js +0 -12
- package/dist-web/assets/DesignSystemView-BskvdBnn.css +0 -1
- package/dist-web/assets/channel-DzCUXF8u.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Dk9AsUOO.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Dk9AsUOO.js +0 -1
- package/dist-web/assets/index-CY9IR2gG.js +0 -279
- package/dist-web/assets/index-Cioxfv4p.css +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BdYtlYmX.js +0 -1
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-uZVLgoX6.js","assets/DesignSystemView-CxzrbiS1.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-Bi8jIiGS.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-B0EX64Fy.js","assets/index8-DDNiq5_W.js","assets/index11-DnWluvv0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
|
+
* @vue/shared v3.5.35
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
6
|
+
**/function Yp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Kt={},ja=[],ni=()=>{},SC=()=>!1,nd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Qp=e=>e.startsWith("onUpdate:"),vn=Object.assign,G1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},TE=Object.prototype.hasOwnProperty,ln=(e,t)=>TE.call(e,t),bt=Array.isArray,qa=e=>gc(e)==="[object Map]",Xl=e=>gc(e)==="[object Set]",ab=e=>gc(e)==="[object Date]",ME=e=>gc(e)==="[object RegExp]",Et=e=>typeof e=="function",Cn=e=>typeof e=="string",Do=e=>typeof e=="symbol",an=e=>e!==null&&typeof e=="object",Y1=e=>(an(e)||Et(e))&&Et(e.then)&&Et(e.catch),CC=Object.prototype.toString,gc=e=>CC.call(e),EE=e=>gc(e).slice(8,-1),Xp=e=>gc(e)==="[object Object]",Zp=e=>Cn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Bl=Yp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},IE=/-\w/g,ys=Jp(e=>e.replace(IE,t=>t.slice(1).toUpperCase())),$E=/\B([A-Z])/g,mo=Jp(e=>e.replace($E,"-$1").toLowerCase()),eh=Jp(e=>e.charAt(0).toUpperCase()+e.slice(1)),Cf=Jp(e=>e?`on${eh(e)}`:""),Is=(e,t)=>!Object.is(e,t),Va=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},xC=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},th=e=>{const t=parseFloat(e);return isNaN(t)?e:t},qf=e=>{const t=Cn(e)?Number(e):NaN;return isNaN(t)?e:t};let cb;const nh=()=>cb||(cb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),NE="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",LE=Yp(NE);function Qt(e){if(bt(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Cn(s)?DE(s):Qt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Cn(e)||an(e))return e}const OE=/;(?![^(]*\))/g,PE=/:([^]+)/,RE=/\/\*[^]*?\*\//g;function DE(e){const t={};return e.replace(RE,"").split(OE).forEach(n=>{if(n){const s=n.split(PE);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Re(e){let t="";if(Cn(e))t=e;else if(bt(e))for(let n=0;n<e.length;n++){const s=Re(e[n]);s&&(t+=s+" ")}else if(an(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function pme(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Cn(t)&&(e.class=Re(t)),n&&(e.style=Qt(n)),e}const BE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",FE=Yp(BE);function AC(e){return!!e||e===""}function HE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=or(e[s],t[s]);return n}function or(e,t){if(e===t)return!0;let n=ab(e),s=ab(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Do(e),s=Do(t),n||s)return e===t;if(n=bt(e),s=bt(t),n||s)return n&&s?HE(e,t):!1;if(n=an(e),s=an(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!or(e[r],t[r]))return!1}}return String(e)===String(t)}function sh(e,t){return e.findIndex(n=>or(n,t))}const TC=e=>!!(e&&e.__v_isRef===!0),O=e=>Cn(e)?e:e==null?"":bt(e)||an(e)&&(e.toString===CC||!Et(e.toString))?TC(e)?O(e.value):JSON.stringify(e,MC,2):String(e),MC=(e,t)=>TC(t)?MC(e,t.value):qa(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[jm(s,i)+" =>"]=o,n),{})}:Xl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>jm(n))}:Do(t)?jm(t):an(t)&&!bt(t)&&!Xp(t)?String(t):t,jm=(e,t="")=>{var n;return Do(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function WE(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 vs;class EC{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&&vs&&(vs.active?(this.parent=vs,this.index=(vs.scopes||(vs.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=vs;try{return vs=this,t()}finally{vs=n}}}on(){++this._on===1&&(this.prevScope=vs,vs=this)}off(){if(this._on>0&&--this._on===0){if(vs===this)vs=this.prevScope;else{let t=vs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function zE(e){return new EC(e)}function Q1(){return vs}function X1(e,t=!1){vs&&vs.cleanups.push(e)}let Dn;const qm=new WeakSet;class Vf{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,vs&&(vs.active?vs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qm.has(this)&&(qm.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$C(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ub(this),NC(this);const t=Dn,n=mi;Dn=this,mi=!0;try{return this.fn()}finally{LC(this),Dn=t,mi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)e0(t);this.deps=this.depsTail=void 0,ub(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qm.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){wv(this)&&this.run()}get dirty(){return wv(this)}}let IC=0,cu,uu;function $C(e,t=!1){if(e.flags|=8,t){e.next=uu,uu=e;return}e.next=cu,cu=e}function Z1(){IC++}function J1(){if(--IC>0)return;if(uu){let t=uu;for(uu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;cu;){let t=cu;for(cu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function NC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function LC(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),e0(s),UE(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function wv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(OC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function OC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Eu)||(e.globalVersion=Eu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!wv(e))))return;e.flags|=2;const t=e.dep,n=Dn,s=mi;Dn=e,mi=!0;try{NC(e);const o=e.fn(e._value);(t.version===0||Is(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Dn=n,mi=s,LC(e),e.flags&=-3}}function e0(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)e0(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function UE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function hme(e,t){e.effect instanceof Vf&&(e=e.effect.fn);const n=new Vf(e);t&&vn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function mme(e){e.effect.stop()}let mi=!0;const PC=[];function ir(){PC.push(mi),mi=!1}function rr(){const e=PC.pop();mi=e===void 0?!0:e}function ub(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Dn;Dn=void 0;try{t()}finally{Dn=n}}}let Eu=0;class jE{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 oh{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Dn||!mi||Dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Dn)n=this.activeLink=new jE(Dn,this),Dn.deps?(n.prevDep=Dn.depsTail,Dn.depsTail.nextDep=n,Dn.depsTail=n):Dn.deps=Dn.depsTail=n,RC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Dn.depsTail,n.nextDep=void 0,Dn.depsTail.nextDep=n,Dn.depsTail=n,Dn.deps===n&&(Dn.deps=s)}return n}trigger(t){this.version++,Eu++,this.notify(t)}notify(t){Z1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{J1()}}}function RC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)RC(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Kf=new WeakMap,Fl=Symbol(""),Sv=Symbol(""),Iu=Symbol("");function Ws(e,t,n){if(mi&&Dn){let s=Kf.get(e);s||Kf.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new oh),o.map=s,o.key=n),o.track()}}function Yi(e,t,n,s,o,i){const r=Kf.get(e);if(!r){Eu++;return}const l=a=>{a&&a.trigger()};if(Z1(),t==="clear")r.forEach(l);else{const a=bt(e),c=a&&Zp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===Iu||!Do(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Iu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Fl)),qa(e)&&l(r.get(Sv)));break;case"delete":a||(l(r.get(Fl)),qa(e)&&l(r.get(Sv)));break;case"set":qa(e)&&l(r.get(Fl));break}}J1()}function qE(e,t){const n=Kf.get(e);return n&&n.get(t)}function ba(e){const t=en(e);return t===e?t:(Ws(t,"iterate",Iu),$o(e)?t:t.map(gi))}function ih(e){return Ws(e=en(e),"iterate",Iu),e}function Ii(e,t){return lr(e)?ic(jr(e)?gi(t):t):gi(t)}const VE={__proto__:null,[Symbol.iterator](){return Vm(this,Symbol.iterator,e=>Ii(this,e))},concat(...e){return ba(this).concat(...e.map(t=>bt(t)?ba(t):t))},entries(){return Vm(this,"entries",e=>(e[1]=Ii(this,e[1]),e))},every(e,t){return Wi(this,"every",e,t,void 0,arguments)},filter(e,t){return Wi(this,"filter",e,t,n=>n.map(s=>Ii(this,s)),arguments)},find(e,t){return Wi(this,"find",e,t,n=>Ii(this,n),arguments)},findIndex(e,t){return Wi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Wi(this,"findLast",e,t,n=>Ii(this,n),arguments)},findLastIndex(e,t){return Wi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Wi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Km(this,"includes",e)},indexOf(...e){return Km(this,"indexOf",e)},join(e){return ba(this).join(e)},lastIndexOf(...e){return Km(this,"lastIndexOf",e)},map(e,t){return Wi(this,"map",e,t,void 0,arguments)},pop(){return jc(this,"pop")},push(...e){return jc(this,"push",e)},reduce(e,...t){return db(this,"reduce",e,t)},reduceRight(e,...t){return db(this,"reduceRight",e,t)},shift(){return jc(this,"shift")},some(e,t){return Wi(this,"some",e,t,void 0,arguments)},splice(...e){return jc(this,"splice",e)},toReversed(){return ba(this).toReversed()},toSorted(e){return ba(this).toSorted(e)},toSpliced(...e){return ba(this).toSpliced(...e)},unshift(...e){return jc(this,"unshift",e)},values(){return Vm(this,"values",e=>Ii(this,e))}};function Vm(e,t,n){const s=ih(e),o=s[t]();return s!==e&&!$o(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const KE=Array.prototype;function Wi(e,t,n,s,o,i){const r=ih(e),l=r!==e&&!$o(e),a=r[t];if(a!==KE[t]){const d=a.apply(e,i);return l?gi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Ii(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function db(e,t,n,s){const o=ih(e),i=o!==e&&!$o(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Ii(e,c)),n.call(this,c,Ii(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Ii(e,a):a}function Km(e,t,n){const s=en(e);Ws(s,"iterate",Iu);const o=s[t](...n);return(o===-1||o===!1)&&ah(n[0])?(n[0]=en(n[0]),s[t](...n)):o}function jc(e,t,n=[]){ir(),Z1();const s=en(e)[t].apply(e,n);return J1(),rr(),s}const GE=Yp("__proto__,__v_isRef,__isVue"),DC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Do));function YE(e){Do(e)||(e=String(e));const t=en(this);return Ws(t,"has",e),t.hasOwnProperty(e)}class BC{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?jC:UC:i?zC:WC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=bt(t);if(!o){let a;if(r&&(a=VE[n]))return a;if(n==="hasOwnProperty")return YE}const l=Reflect.get(t,n,ss(t)?t:s);if((Do(n)?DC.has(n):GE(n))||(o||Ws(t,"get",n),i))return l;if(ss(l)){const a=r&&Zp(n)?l:l.value;return o&&an(a)?Gf(a):a}return an(l)?o?Gf(l):Ls(l):l}}class FC extends BC{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=bt(t)&&Zp(n);if(!this._isShallow){const c=lr(i);if(!$o(s)&&!lr(s)&&(i=en(i),s=en(s)),!r&&ss(i)&&!ss(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:ln(t,n),a=Reflect.set(t,n,s,ss(t)?t:o);return t===en(o)&&(l?Is(s,i)&&Yi(t,"set",n,s):Yi(t,"add",n,s)),a}deleteProperty(t,n){const s=ln(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Yi(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Do(n)||!DC.has(n))&&Ws(t,"has",n),s}ownKeys(t){return Ws(t,"iterate",bt(t)?"length":Fl),Reflect.ownKeys(t)}}class HC extends BC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const QE=new FC,XE=new HC,ZE=new FC(!0),JE=new HC(!0),Cv=e=>e,zd=e=>Reflect.getPrototypeOf(e);function eI(e,t,n){return function(...s){const o=this.__v_raw,i=en(o),r=qa(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Cv:t?ic:gi;return!t&&Ws(i,"iterate",a?Sv:Fl),vn(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 Ud(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function tI(e,t){const n={get(o){const i=this.__v_raw,r=en(i),l=en(o);e||(Is(o,l)&&Ws(r,"get",o),Ws(r,"get",l));const{has:a}=zd(r),c=t?Cv:e?ic:gi;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&Ws(en(o),"iterate",Fl),o.size},has(o){const i=this.__v_raw,r=en(i),l=en(o);return e||(Is(o,l)&&Ws(r,"has",o),Ws(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=en(l),c=t?Cv:e?ic:gi;return!e&&Ws(a,"iterate",Fl),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return vn(n,e?{add:Ud("add"),set:Ud("set"),delete:Ud("delete"),clear:Ud("clear")}:{add(o){const i=en(this),r=zd(i),l=en(o),a=!t&&!$o(o)&&!lr(o)?l:o;return r.has.call(i,a)||Is(o,a)&&r.has.call(i,o)||Is(l,a)&&r.has.call(i,l)||(i.add(a),Yi(i,"add",a,a)),this},set(o,i){!t&&!$o(i)&&!lr(i)&&(i=en(i));const r=en(this),{has:l,get:a}=zd(r);let c=l.call(r,o);c||(o=en(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Is(i,u)&&Yi(r,"set",o,i):Yi(r,"add",o,i),this},delete(o){const i=en(this),{has:r,get:l}=zd(i);let a=r.call(i,o);a||(o=en(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Yi(i,"delete",o,void 0),c},clear(){const o=en(this),i=o.size!==0,r=o.clear();return i&&Yi(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=eI(o,e,t)}),n}function rh(e,t){const n=tI(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(ln(n,o)&&o in s?n:s,o,i)}const nI={get:rh(!1,!1)},sI={get:rh(!1,!0)},oI={get:rh(!0,!1)},iI={get:rh(!0,!0)},WC=new WeakMap,zC=new WeakMap,UC=new WeakMap,jC=new WeakMap;function rI(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ls(e){return lr(e)?e:lh(e,!1,QE,nI,WC)}function lI(e){return lh(e,!1,ZE,sI,zC)}function Gf(e){return lh(e,!0,XE,oI,UC)}function gme(e){return lh(e,!0,JE,iI,jC)}function lh(e,t,n,s,o){if(!an(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=rI(EE(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function jr(e){return lr(e)?jr(e.__v_raw):!!(e&&e.__v_isReactive)}function lr(e){return!!(e&&e.__v_isReadonly)}function $o(e){return!!(e&&e.__v_isShallow)}function ah(e){return e?!!e.__v_raw:!1}function en(e){const t=e&&e.__v_raw;return t?en(t):e}function Hr(e){return!ln(e,"__v_skip")&&Object.isExtensible(e)&&xC(e,"__v_skip",!0),e}const gi=e=>an(e)?Ls(e):e,ic=e=>an(e)?Gf(e):e;function ss(e){return e?e.__v_isRef===!0:!1}function J(e){return qC(e,!1)}function Zl(e){return qC(e,!0)}function qC(e,t){return ss(e)?e:new aI(e,t)}class aI{constructor(t,n){this.dep=new oh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:en(t),this._value=n?t:gi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||$o(t)||lr(t);t=s?t:en(t),Is(t,n)&&(this._rawValue=t,this._value=s?t:gi(t),this.dep.trigger())}}function vme(e){e.dep&&e.dep.trigger()}function C(e){return ss(e)?e.value:e}function VC(e){return Et(e)?e():C(e)}const cI={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return ss(o)&&!ss(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function KC(e){return jr(e)?e:new Proxy(e,cI)}class uI{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new oh,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function dI(e){return new uI(e)}function yme(e){const t=bt(e)?new Array(e.length):{};for(const n in e)t[n]=GC(e,n);return t}class fI{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Do(n)?n:String(n),this._raw=en(t);let o=!0,i=t;if(!bt(t)||Do(this._key)||!Zp(this._key))do o=!ah(i)||$o(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ss(this._raw[this._key])){const n=this._object[this._key];if(ss(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return qE(this._raw,this._key)}}class pI{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 kme(e,t,n){return ss(e)?e:Et(e)?new pI(e):an(e)&&arguments.length>1?GC(e,t,n):J(e)}function GC(e,t,n){return new fI(e,t,n)}class hI{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new oh(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Eu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Dn!==this)return $C(this,!0),!0}get value(){const t=this.dep.track();return OC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function mI(e,t,n=!1){let s,o;return Et(e)?s=e:(s=e.get,o=e.set),new hI(s,o,n)}const bme={GET:"get",HAS:"has",ITERATE:"iterate"},_me={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},jd={},Yf=new WeakMap;let Lr;function wme(){return Lr}function gI(e,t=!1,n=Lr){if(n){let s=Yf.get(n);s||Yf.set(n,s=[]),s.push(e)}}function vI(e,t,n=Kt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:$o(y)||o===!1||o===0?Qi(y,1):Qi(y);let u,d,f,h,p=!1,m=!1;if(ss(e)?(d=()=>e.value,p=$o(e)):jr(e)?(d=()=>c(e),p=!0):bt(e)?(m=!0,p=e.some(y=>jr(y)||$o(y)),d=()=>e.map(y=>{if(ss(y))return y.value;if(jr(y))return c(y);if(Et(y))return a?a(y,2):y()})):Et(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){ir();try{f()}finally{rr()}}const y=Lr;Lr=u;try{return a?a(e,3,[h]):e(h)}finally{Lr=y}}:d=ni,t&&o){const y=d,T=o===!0?1/0:o;d=()=>Qi(y(),T)}const _=Q1(),b=()=>{u.stop(),_&&_.active&&G1(_.effects,u)};if(i&&t){const y=t;t=(...T)=>{y(...T),b()}}let g=m?new Array(e.length).fill(jd):jd;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const T=u.run();if(o||p||(m?T.some((P,I)=>Is(P,g[I])):Is(T,g))){f&&f();const P=Lr;Lr=u;try{const I=[T,g===jd?void 0:m&&g[0]===jd?[]:g,h];g=T,a?a(t,3,I):t(...I)}finally{Lr=P}}}else u.run()};return l&&l(v),u=new Vf(d),u.scheduler=r?()=>r(v,!1):v,h=y=>gI(y,!1,u),f=u.onStop=()=>{const y=Yf.get(u);if(y){if(a)a(y,4);else for(const T of y)T();Yf.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function Qi(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--,ss(e))Qi(e.value,t,n);else if(bt(e))for(let s=0;s<e.length;s++)Qi(e[s],t,n);else if(Xl(e)||qa(e))e.forEach(s=>{Qi(s,t,n)});else if(Xp(e)){for(const s in e)Qi(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Qi(e[s],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 YC=[];function yI(e){YC.push(e)}function kI(){YC.pop()}function Sme(e,t){}const Cme={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"},bI={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 sd(e,t,n,s){try{return s?e(...s):e()}catch(o){vc(o,t,n)}}function oi(e,t,n,s){if(Et(e)){const o=sd(e,t,n,s);return o&&Y1(o)&&o.catch(i=>{vc(i,t,n)}),o}if(bt(e)){const o=[];for(let i=0;i<e.length;i++)o.push(oi(e[i],t,n,s));return o}}function vc(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Kt;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){ir(),sd(i,null,10,[e,a,c]),rr();return}}_I(e,n,o,s,r)}function _I(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Zs=[];let Ti=-1;const Ka=[];let Or=null,Ma=0;const QC=Promise.resolve();let Qf=null;function mt(e){const t=Qf||QC;return e?t.then(this?e.bind(this):e):t}function wI(e){let t=Ti+1,n=Zs.length;for(;t<n;){const s=t+n>>>1,o=Zs[s],i=$u(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function t0(e){if(!(e.flags&1)){const t=$u(e),n=Zs[Zs.length-1];!n||!(e.flags&2)&&t>=$u(n)?Zs.push(e):Zs.splice(wI(t),0,e),e.flags|=1,XC()}}function XC(){Qf||(Qf=QC.then(ZC))}function Xf(e){bt(e)?Ka.push(...e):Or&&e.id===-1?Or.splice(Ma+1,0,e):e.flags&1||(Ka.push(e),e.flags|=1),XC()}function fb(e,t,n=Ti+1){for(;n<Zs.length;n++){const s=Zs[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Zs.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Zf(e){if(Ka.length){const t=[...new Set(Ka)].sort((n,s)=>$u(n)-$u(s));if(Ka.length=0,Or){Or.push(...t);return}for(Or=t,Ma=0;Ma<Or.length;Ma++){const n=Or[Ma];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Or=null,Ma=0}}const $u=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ZC(e){try{for(Ti=0;Ti<Zs.length;Ti++){const t=Zs[Ti];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),sd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ti<Zs.length;Ti++){const t=Zs[Ti];t&&(t.flags&=-2)}Ti=-1,Zs.length=0,Zf(),Qf=null,(Zs.length||Ka.length)&&ZC()}}let Ea,qd=[];function JC(e,t){var n,s;Ea=e,Ea?(Ea.enabled=!0,qd.forEach(({event:o,args:i})=>Ea.emit(o,...i)),qd=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{JC(i,t)}),setTimeout(()=>{Ea||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,qd=[])},3e3)):qd=[]}let Os=null,ch=null;function Nu(e){const t=Os;return Os=e,ch=e&&e.type.__scopeId||null,t}function xme(e){ch=e}function Ame(){ch=null}const Tme=e=>be;function be(e,t=Os,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&sp(-1);const i=Nu(t);let r;try{r=e(...o)}finally{Nu(i),s._d&&sp(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function _n(e,t){if(Os===null)return e;const n=ld(Os),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Kt]=t[o];i&&(Et(i)&&(i={mounted:i,updated:i}),i.deep&&Qi(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Mi(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(ir(),oi(a,n,8,[e.el,l,e,t]),rr())}}function In(e,t){if($s){let n=$s.provides;const s=$s.parent&&$s.parent.provides;s===n&&(n=$s.provides=Object.create(s)),n[e]=t}}function jt(e,t,n=!1){const s=Ps();if(s||Hl){let o=Hl?Hl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Et(t)?t.call(s&&s.proxy):t}}function Mme(){return!!(Ps()||Hl)}const SI=Symbol.for("v-scx"),CI=()=>jt(SI);function xI(e,t){return od(e,null,t)}function Eme(e,t){return od(e,null,{flush:"post"})}function AI(e,t){return od(e,null,{flush:"sync"})}function Ve(e,t,n){return od(e,t,n)}function od(e,t,n=Kt){const{immediate:s,deep:o,flush:i,once:r}=n,l=vn({},n),a=t&&s||!t&&i!=="post";let c;if(Kl){if(i==="sync"){const h=CI();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=ni,h.resume=ni,h.pause=ni,h}}const u=$s;l.call=(h,p,m)=>oi(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{ls(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():t0(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=vI(e,t,l);return Kl&&(c?c.push(f):a&&f()),f}function TI(e,t,n){const s=this.proxy,o=Cn(e)?e.includes(".")?ex(s,e):()=>s[e]:e.bind(s,s);let i;Et(t)?i=t:(i=t.handler,n=t);const r=yc(this),l=od(o,i.bind(s),n);return r(),l}function ex(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const $r=new WeakMap,tx=Symbol("_vte"),nx=e=>e.__isTeleport,Il=e=>e&&(e.disabled||e.disabled===""),MI=e=>e&&(e.defer||e.defer===""),pb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,hb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,xv=(e,t)=>{const n=e&&e.to;return Cn(n)?t?t(n):null:n},EI={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:m,createComment:_,parentNode:b}}=c,g=Il(t.props);let{dynamicChildren:v}=t;const y=(I,k,M)=>{I.shapeFlag&16&&u(I.children,k,M,o,i,r,l,a)},T=(I=t)=>{const k=Il(I.props),M=I.target=xv(I.props,p),$=Av(M,I,m,h);M&&(r!=="svg"&&pb(M)?r="svg":r!=="mathml"&&hb(M)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(M),k||(y(I,M,$),tu(I,!1)))},P=I=>{const k=()=>{if($r.get(I)===k){if($r.delete(I),Il(I.props)){const M=b(I.el)||n;y(I,M,I.anchor),tu(I,!0)}T(I)}};$r.set(I,k),ls(k,i)};if(e==null){const I=t.el=m(""),k=t.anchor=m("");if(h(I,n,s),h(k,n,s),MI(t.props)||i&&i.pendingBranch){P(t);return}g&&(y(t,n,k),tu(t,!0)),T()}else{t.el=e.el;const I=t.anchor=e.anchor,k=$r.get(e);if(k){k.flags|=8,$r.delete(e),P(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,$=t.targetAnchor=e.targetAnchor,L=Il(e.props),S=L?n:M,E=L?I:$;if(r==="svg"||pb(M)?r="svg":(r==="mathml"||hb(M))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),f0(e,t,!0)):a||d(e,t,S,E,o,i,r,l,!1),g)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Vd(t,n,I,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=xv(t.props,p);D&&Vd(t,D,null,c,0)}else L&&Vd(t,M,$,c,1);tu(t,g)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!Il(f),p=$r.get(e);if(p&&(p.flags|=8,$r.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const _=l[m];s(_,t,n,h,!!_.dynamicChildren)}},move:Vd,hydrate:II};function Vd(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!$r.has(e)&&(!d||Il(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function II(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,b){let g=b;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(_,b){b.anchor=d(r(_),b,l(_),n,s,o,i)}const p=t.target=xv(t.props,a),m=Il(t.props);if(p){const _=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,_),t.targetAnchor||Av(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,_),t.targetAnchor||Av(p,t,u,c),d(_&&r(_),t,p,n,s,o,i))),tu(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const uh=EI;function tu(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Av(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[tx]=r,e&&(s(i,e,o),s(r,e,o)),r}const Xo=Symbol("_leaveCb"),qc=Symbol("_enterCb");function sx(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return yn(()=>{e.isMounted=!0}),fs(()=>{e.isUnmounting=!0}),e}const Vo=[Function,Array],ox={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Vo,onEnter:Vo,onAfterEnter:Vo,onEnterCancelled:Vo,onBeforeLeave:Vo,onLeave:Vo,onAfterLeave:Vo,onLeaveCancelled:Vo,onBeforeAppear:Vo,onAppear:Vo,onAfterAppear:Vo,onAppearCancelled:Vo},ix=e=>{const t=e.subTree;return t.component?ix(t.component):t},$I={name:"BaseTransition",props:ox,setup(e,{slots:t}){const n=Ps(),s=sx();return()=>{const o=t.default&&n0(t.default(),!0),i=o&&o.length?rx(o):n.subTree?le():void 0;if(!i)return;const r=en(e),{mode:l}=r;if(s.isLeaving)return Gm(i);const a=mb(i);if(!a)return Gm(i);let c=Lu(a,r,s,n,d=>c=d);a.type!==cs&&Yr(a,c);let u=n.subTree&&mb(n.subTree);if(u&&u.type!==cs&&!di(u,a)&&ix(n).type!==cs){let d=Lu(u,r,s,n);if(Yr(u,d),l==="out-in"&&a.type!==cs)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Gm(i);l==="in-out"&&a.type!==cs?d.delayLeave=(f,h,p)=>{const m=lx(s,u);m[String(u.key)]=u,f[Xo]=()=>{h(),f[Xo]=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 rx(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==cs){t=n;break}}return t}const NI=$I;function lx(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Lu(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:_,onAppear:b,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),T=lx(n,e),P=(M,$)=>{M&&oi(M,s,9,$)},I=(M,$)=>{const L=$[1];P(M,$),bt(M)?M.every(S=>S.length<=1)&&L():M.length<=1&&L()},k={mode:r,persisted:l,beforeEnter(M){let $=a;if(!n.isMounted)if(i)$=_||a;else return;M[Xo]&&M[Xo](!0);const L=T[y];L&&di(e,L)&&L.el[Xo]&&L.el[Xo](),P($,[M])},enter(M){if(T[y]===e)return;let $=c,L=u,S=d;if(!n.isMounted)if(i)$=b||c,L=g||u,S=v||d;else return;let E=!1;M[qc]=R=>{E||(E=!0,R?P(S,[M]):P(L,[M]),k.delayedLeave&&k.delayedLeave(),M[qc]=void 0)};const D=M[qc].bind(null,!1);$?I($,[M,D]):D()},leave(M,$){const L=String(e.key);if(M[qc]&&M[qc](!0),n.isUnmounting)return $();P(f,[M]);let S=!1;M[Xo]=D=>{S||(S=!0,$(),D?P(m,[M]):P(p,[M]),M[Xo]=void 0,T[L]===e&&delete T[L])};const E=M[Xo].bind(null,!1);T[L]=e,h?I(h,[M,E]):E()},clone(M){const $=Lu(M,t,n,s,o);return o&&o($),$}};return k}function Gm(e){if(id(e))return e=ar(e),e.children=null,e}function mb(e){if(!id(e))return nx(e.type)&&e.children?rx(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&&Et(n.default))return n.default()}}function Yr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Yr(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 n0(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Oe?(r.patchFlag&128&&o++,s=s.concat(n0(r.children,t,l))):(t||r.type!==cs)&&s.push(l!=null?ar(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function qe(e,t){return Et(e)?vn({name:e.name},t,{setup:e}):e}function Ime(){const e=Ps();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function s0(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function $me(e){const t=Ps(),n=Zl(null);if(t){const o=t.refs===Kt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function gb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jf=new WeakMap;function Ga(e,t,n,s,o=!1){if(bt(e)){e.forEach((m,_)=>Ga(m,t&&(bt(t)?t[_]:t),n,s,o));return}if(tr(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ga(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?ld(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Kt?l.refs={}:l.refs,d=l.setupState,f=en(d),h=d===Kt?SC:m=>gb(u,m)?!1:ln(f,m),p=(m,_)=>!(_&&gb(u,_));if(c!=null&&c!==a){if(vb(t),Cn(c))u[c]=null,h(c)&&(d[c]=null);else if(ss(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Et(a))sd(a,l,12,[r,u]);else{const m=Cn(a),_=ss(a);if(m||_){const b=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)bt(g)&&G1(g,i);else if(bt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):_&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{b(),Jf.delete(e)};g.id=-1,Jf.set(e,g),ls(g,n)}else vb(e),b()}}}function vb(e){const t=Jf.get(e);t&&(t.flags|=8,Jf.delete(e))}let yb=!1;const _a=()=>{yb||(console.error("Hydration completed but contains mismatches."),yb=!0)},LI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",OI=e=>e.namespaceURI.includes("MathML"),Kd=e=>{if(e.nodeType===1){if(LI(e))return"svg";if(OI(e))return"mathml"}},Da=e=>e.nodeType===8;function PI(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),Zf(),y._vnode=v;return}d(y.firstChild,v,null,null,null),Zf(),y._vnode=v},d=(v,y,T,P,I,k=!1)=>{k=k||!!y.dynamicChildren;const M=Da(v)&&v.data==="[",$=()=>m(v,y,T,P,I,M),{type:L,ref:S,shapeFlag:E,patchFlag:D}=y;let R=v.nodeType;y.el=v,D===-2&&(k=!1,y.dynamicChildren=null);let H=null;switch(L){case qr:R!==3?y.children===""?(a(y.el=o(""),r(v),v),H=v):H=$():(v.data!==y.children&&(_a(),v.data=y.children),H=i(v));break;case cs:g(v)?(H=i(v),b(y.el=v.content.firstChild,v,T)):R!==8||M?H=$():H=i(v);break;case Qa:if(M&&(v=i(v),R=v.nodeType),R===1||R===3){H=v;const U=!y.children.length;for(let G=0;G<y.staticCount;G++)U&&(y.children+=H.nodeType===1?H.outerHTML:H.data),G===y.staticCount-1&&(y.anchor=H),H=i(H);return M?i(H):H}else $();break;case Oe:M?H=p(v,y,T,P,I,k):H=$();break;default:if(E&1)(R!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?H=$():H=f(v,y,T,P,I,k);else if(E&6){y.slotScopeIds=I;const U=r(v);if(M?H=_(v):Da(v)&&v.data==="teleport start"?H=_(v,v.data,"teleport end"):H=i(v),t(y,U,null,T,P,Kd(U),k),tr(y)&&!y.type.__asyncResolved){let G;M?(G=ie(Oe),G.anchor=H?H.previousSibling:U.lastChild):G=v.nodeType===3?Ue(""):ie("div"),G.el=v,y.component.subTree=G}}else E&64?R!==8?H=$():H=y.type.hydrate(v,y,T,P,I,k,e,h):E&128&&(H=y.type.hydrate(v,y,T,P,Kd(r(v)),I,k,e,d))}return S!=null&&Ga(S,null,P,y),H},f=(v,y,T,P,I,k)=>{k=k||!!y.dynamicChildren;const{type:M,props:$,patchFlag:L,shapeFlag:S,dirs:E,transition:D}=y,R=M==="input"||M==="option";if(R||L!==-1){E&&Mi(y,null,T,"created");let H=!1;if(g(v)){H=Ax(null,D)&&T&&T.vnode.props&&T.vnode.props.appear;const G=v.content.firstChild;if(H){const Q=G.getAttribute("class");Q&&(G.$cls=Q),D.beforeEnter(G)}b(G,v,T),y.el=v=G}if(S&16&&!($&&($.innerHTML||$.textContent))){let G=h(v.firstChild,y,v,T,P,I,k);for(G&&!Gd(v,1)&&_a();G;){const Q=G;G=G.nextSibling,l(Q)}}else if(S&8){let G=y.children;G[0]===`
|
|
15
|
+
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(G=G.slice(1));const{textContent:Q}=v;Q!==G&&Q!==G.replace(/\r\n|\r/g,`
|
|
16
|
+
`)&&(Gd(v,0)||_a(),v.textContent=y.children)}if($){if(R||!k||L&48){const G=v.tagName.includes("-");for(const Q in $)(R&&(Q.endsWith("value")||Q==="indeterminate")||nd(Q)&&!Bl(Q)||Q[0]==="."||G&&!Bl(Q))&&s(v,Q,null,$[Q],void 0,T)}else if($.onClick)s(v,"onClick",null,$.onClick,void 0,T);else if(L&4&&jr($.style))for(const G in $.style)$.style[G]}let U;(U=$&&$.onVnodeBeforeMount)&&fo(U,T,y),E&&Mi(y,null,T,"beforeMount"),((U=$&&$.onVnodeMounted)||E||H)&&Ix(()=>{U&&fo(U,T,y),H&&D.enter(v),E&&Mi(y,null,T,"mounted")},P)}return v.nextSibling},h=(v,y,T,P,I,k,M)=>{M=M||!!y.dynamicChildren;const $=y.children,L=$.length;let S=!1;for(let E=0;E<L;E++){const D=M?$[E]:$[E]=ho($[E]),R=D.type===qr;v?(R&&!M&&E+1<L&&ho($[E+1]).type===qr&&(a(o(v.data.slice(D.children.length)),T,i(v)),v.data=D.children),v=d(v,D,P,I,k,M)):R&&!D.children?a(D.el=o(""),T):(S||(S=!0,Gd(T,1)||_a()),n(null,D,T,null,P,I,Kd(T),k))}return v},p=(v,y,T,P,I,k)=>{const{slotScopeIds:M}=y;M&&(I=I?I.concat(M):M);const $=r(v),L=h(i(v),y,$,T,P,I,k);return L&&Da(L)&&L.data==="]"?i(y.anchor=L):(_a(),a(y.anchor=c("]"),$,L),L)},m=(v,y,T,P,I,k)=>{if(Gd(v.parentElement,1)||_a(),y.el=null,k){const L=_(v);for(;;){const S=i(v);if(S&&S!==L)l(S);else break}}const M=i(v),$=r(v);return l(v),n(null,y,$,M,T,P,Kd($),I),T&&(T.vnode.el=y.el,ph(T,y.el)),M},_=(v,y="[",T="]")=>{let P=0;for(;v;)if(v=i(v),v&&Da(v)&&(v.data===y&&P++,v.data===T)){if(P===0)return i(v);P--}return v},b=(v,y,T)=>{const P=y.parentNode;P&&P.replaceChild(v,y);let I=T;for(;I;)I.vnode.el===y&&(I.vnode.el=I.subTree.el=v),I=I.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const kb="data-allow-mismatch",RI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Gd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(kb);)e=e.parentElement;const n=e&&e.getAttribute(kb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(RI[t])}}const DI=nh().requestIdleCallback||(e=>setTimeout(e,1)),BI=nh().cancelIdleCallback||(e=>clearTimeout(e)),Nme=(e=1e4)=>t=>{const n=DI(t,{timeout:e});return()=>BI(n)};function FI(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const Lme=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(FI(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Ome=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Pme=(e=[])=>(t,n)=>{Cn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function HI(e,t){if(Da(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Da(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const tr=e=>!!e.type.__asyncLoader;function fi(e){Et(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,b)=>{a(m,()=>_(f()),()=>b(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return qe({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,_){let b=!1;(m.bu||(m.bu=[])).push(()=>b=!0);const g=()=>{b||_()},v=i?()=>{const y=i(g,T=>HI(p,T));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=$s;if(s0(p),u)return()=>Yd(u,p);const m=v=>{c=null,vc(v,p,13,!s)};if(l&&p.suspense||Kl)return h().then(v=>()=>Yd(v,p)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const _=J(!1),b=J(),g=J(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!_.value&&!b.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),b.value=v}},r),h().then(()=>{_.value=!0,p.parent&&id(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),b.value=v}),()=>{if(_.value&&u)return Yd(u,p);if(b.value&&s)return ie(s,{error:b.value});if(n&&!g.value)return Yd(n,p)}}})}function Yd(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ie(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const id=e=>e.type.__isKeepAlive,WI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ps(),s=n.ctx;if(!s.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(g,v,y,T,P)=>{const I=g.component;c(g,v,y,0,l),a(I.vnode,g,v,y,I,l,T,g.slotScopeIds,P),ls(()=>{I.isDeactivated=!1,I.a&&Va(I.a);const k=g.props&&g.props.onVnodeMounted;k&&fo(k,I.parent,g)},l)},s.deactivate=g=>{const v=g.component;tp(v.m),tp(v.a),c(g,f,null,1,l),ls(()=>{v.da&&Va(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&fo(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){Ym(g),u(g,n,l,!0)}function p(g){o.forEach((v,y)=>{const T=Pv(tr(v)?v.type.__asyncResolved||{}:v.type);T&&!g(T)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!di(v,r))?h(v):r&&Ym(r),o.delete(g),i.delete(g)}Ve(()=>[e.include,e.exclude],([g,v])=>{g&&p(y=>nu(g,y)),v&&p(y=>!nu(v,y))},{flush:"post",deep:!0});let _=null;const b=()=>{_!=null&&(np(n.subTree.type)?ls(()=>{o.set(_,Qd(n.subTree))},n.subTree.suspense):o.set(_,Qd(n.subTree)))};return yn(b),o0(b),fs(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,T=Qd(v);if(g.type===T.type&&g.key===T.key){Ym(T);const P=T.component.da;P&&ls(P,y);return}h(g)})}),()=>{if(_=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Qr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=Qd(v);if(y.type===cs)return r=null,y;const T=y.type,P=Pv(tr(y)?y.type.__asyncResolved||{}:T),{include:I,exclude:k,max:M}=e;if(I&&(!P||!nu(I,P))||k&&P&&nu(k,P))return y.shapeFlag&=-257,r=y,v;const $=y.key==null?T:y.key,L=o.get($);return y.el&&(y=ar(y),v.shapeFlag&128&&(v.ssContent=y)),_=$,L?(y.el=L.el,y.component=L.component,y.transition&&Yr(y,y.transition),y.shapeFlag|=512,i.delete($),i.add($)):(i.add($),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,np(v.type)?v:y}}},Rme=WI;function nu(e,t){return bt(e)?e.some(n=>nu(n,t)):Cn(e)?e.split(",").includes(t):ME(e)?(e.lastIndex=0,e.test(t)):!1}function zI(e,t){ax(e,"a",t)}function UI(e,t){ax(e,"da",t)}function ax(e,t,n=$s){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(dh(t,s,n),n){let o=n.parent;for(;o&&o.parent;)id(o.parent.vnode)&&jI(s,t,n,o),o=o.parent}}function jI(e,t,n,s){const o=dh(t,e,s,!0);xn(()=>{G1(s[t],o)},n)}function Ym(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Qd(e){return e.shapeFlag&128?e.ssContent:e}function dh(e,t,n=$s,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{ir();const l=yc(n),a=oi(t,n,e,r);return l(),rr(),a});return s?o.unshift(i):o.push(i),i}}const ur=e=>(t,n=$s)=>{(!Kl||e==="sp")&&dh(e,(...s)=>t(...s),n)},qI=ur("bm"),yn=ur("m"),cx=ur("bu"),o0=ur("u"),fs=ur("bum"),xn=ur("um"),VI=ur("sp"),KI=ur("rtg"),GI=ur("rtc");function YI(e,t=$s){dh("ec",e,t)}const i0="components",QI="directives";function XI(e,t){return r0(i0,e,!0,t)||e}const ux=Symbol.for("v-ndc");function zs(e){return Cn(e)?r0(i0,e,!1)||e:e||ux}function Dme(e){return r0(QI,e)}function r0(e,t,n=!0,s=!1){const o=Os||$s;if(o){const i=o.type;if(e===i0){const l=Pv(i,!1);if(l&&(l===t||l===ys(t)||l===eh(ys(t))))return i}const r=bb(o[e]||i[e],t)||bb(o.appContext[e],t);return!r&&s?i:r}}function bb(e,t){return e&&(e[t]||e[ys(t)]||e[eh(ys(t))])}function tt(e,t,n,s){let o;const i=n&&n[s],r=bt(e);if(r||Cn(e)){const l=r&&jr(e);let a=!1,c=!1;l&&(a=!$o(e),c=lr(e),e=ih(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?ic(gi(e[u])):gi(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(an(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function l0(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(bt(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Nn(e,t,n={},s,o){if(Os.ce||Os.parent&&tr(Os.parent)&&Os.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ye(Oe,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&a0(i(n)),l=n.key||r&&r.key,a=ye(Oe,{key:(l&&!Do(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function a0(e){return e.some(t=>Qr(t)?!(t.type===cs||t.type===Oe&&!a0(t.children)):!0)?e:null}function Bme(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:Cf(s)]=e[s];return n}const Tv=e=>e?Px(e)?ld(e):Tv(e.parent):null,du=vn(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=>Tv(e.parent),$root:e=>Tv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>c0(e),$forceUpdate:e=>e.f||(e.f=()=>{t0(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>TI.bind(e)}),Qm=(e,t)=>e!==Kt&&!e.__isScriptSetup&&ln(e,t),Mv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Qm(s,t))return r[t]=1,s[t];if(o!==Kt&&ln(o,t))return r[t]=2,o[t];if(ln(i,t))return r[t]=3,i[t];if(n!==Kt&&ln(n,t))return r[t]=4,n[t];Ev&&(r[t]=0)}}const c=du[t];let u,d;if(c)return t==="$attrs"&&Ws(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Kt&&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:s,setupState:o,ctx:i}=e;return Qm(o,t)?(o[t]=n,!0):s!==Kt&&ln(s,t)?(s[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:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Kt&&l[0]!=="$"&&ln(e,l)||Qm(t,l)||ln(i,l)||ln(s,l)||ln(du,l)||ln(o.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)}},ZI=vn({},Mv,{get(e,t){if(t!==Symbol.unscopables)return Mv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!LE(t)}});function Fme(){return null}function Hme(){return null}function Wme(e){}function zme(e){}function Ume(){return null}function jme(){}function qme(e,t){return null}function Vme(){return dx().slots}function rd(){return dx().attrs}function dx(e){const t=Ps();return t.setupContext||(t.setupContext=Bx(t))}function Ou(e){return bt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Kme(e,t){const n=Ou(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?bt(o)||Et(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function Gme(e,t){return!e||!t?e||t:bt(e)&&bt(t)?e.concat(t):vn({},Ou(e),Ou(t))}function Yme(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Qme(e){const t=Ps(),n=Kl;let s=e();Ru(),n&&Xa(!1);const o=()=>{yc(t),n&&Xa(!0)},i=()=>{Ps()!==t&&t.scope.off(),Ru(),n&&Xa(!1)};return Y1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let Ev=!0;function JI(e){const t=c0(e),n=e.proxy,s=e.ctx;Ev=!1,t.beforeCreate&&_b(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:m,deactivated:_,beforeDestroy:b,beforeUnmount:g,destroyed:v,unmounted:y,render:T,renderTracked:P,renderTriggered:I,errorCaptured:k,serverPrefetch:M,expose:$,inheritAttrs:L,components:S,directives:E,filters:D}=t;if(c&&e$(c,s,null),r)for(const U in r){const G=r[U];Et(G)&&(s[U]=G.bind(n))}if(o){const U=o.call(n,n);an(U)&&(e.data=Ls(U))}if(Ev=!0,i)for(const U in i){const G=i[U],Q=Et(G)?G.bind(n,n):Et(G.get)?G.get.bind(n,n):ni,V=!Et(G)&&Et(G.set)?G.set.bind(n):ni,re=B({get:Q,set:V});Object.defineProperty(s,U,{enumerable:!0,configurable:!0,get:()=>re.value,set:pe=>re.value=pe})}if(l)for(const U in l)fx(l[U],s,n,U);if(a){const U=Et(a)?a.call(n):a;Reflect.ownKeys(U).forEach(G=>{In(G,U[G])})}u&&_b(u,e,"c");function H(U,G){bt(G)?G.forEach(Q=>U(Q.bind(n))):G&&U(G.bind(n))}if(H(qI,d),H(yn,f),H(cx,h),H(o0,p),H(zI,m),H(UI,_),H(YI,k),H(GI,P),H(KI,I),H(fs,g),H(xn,y),H(VI,M),bt($))if($.length){const U=e.exposed||(e.exposed={});$.forEach(G=>{Object.defineProperty(U,G,{get:()=>n[G],set:Q=>n[G]=Q,enumerable:!0})})}else e.exposed||(e.exposed={});T&&e.render===ni&&(e.render=T),L!=null&&(e.inheritAttrs=L),S&&(e.components=S),E&&(e.directives=E),M&&s0(e)}function e$(e,t,n=ni){bt(e)&&(e=Iv(e));for(const s in e){const o=e[s];let i;an(o)?"default"in o?i=jt(o.from||s,o.default,!0):i=jt(o.from||s):i=jt(o),ss(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function _b(e,t,n){oi(bt(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function fx(e,t,n,s){let o=s.includes(".")?ex(n,s):()=>n[s];if(Cn(e)){const i=t[e];Et(i)&&Ve(o,i)}else if(Et(e))Ve(o,e.bind(n));else if(an(e))if(bt(e))e.forEach(i=>fx(i,t,n,s));else{const i=Et(e.handler)?e.handler.bind(n):t[e.handler];Et(i)&&Ve(o,i,e)}}function c0(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>ep(a,c,r,!0)),ep(a,t,r)),an(t)&&i.set(t,a),a}function ep(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&ep(e,i,n,!0),o&&o.forEach(r=>ep(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=t$[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const t$={data:wb,props:Sb,emits:Sb,methods:su,computed:su,beforeCreate:Gs,created:Gs,beforeMount:Gs,mounted:Gs,beforeUpdate:Gs,updated:Gs,beforeDestroy:Gs,beforeUnmount:Gs,destroyed:Gs,unmounted:Gs,activated:Gs,deactivated:Gs,errorCaptured:Gs,serverPrefetch:Gs,components:su,directives:su,watch:s$,provide:wb,inject:n$};function wb(e,t){return t?e?function(){return vn(Et(e)?e.call(this,this):e,Et(t)?t.call(this,this):t)}:t:e}function n$(e,t){return su(Iv(e),Iv(t))}function Iv(e){if(bt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Gs(e,t){return e?[...new Set([].concat(e,t))]:t}function su(e,t){return e?vn(Object.create(null),e,t):t}function Sb(e,t){return e?bt(e)&&bt(t)?[...new Set([...e,...t])]:vn(Object.create(null),Ou(e),Ou(t??{})):t}function s$(e,t){if(!e)return t;if(!t)return e;const n=vn(Object.create(null),e);for(const s in t)n[s]=Gs(e[s],t[s]);return n}function px(){return{app:null,config:{isNativeTag:SC,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 o$=0;function i$(e,t){return function(s,o=null){Et(s)||(s=vn({},s)),o!=null&&!an(o)&&(o=null);const i=px(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:o$++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:P$,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Et(u.install)?(r.add(u),u.install(c,...d)):Et(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||ie(s,o);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,ld(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(oi(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=Hl;Hl=c;try{return u()}finally{Hl=d}}};return c}}let Hl=null;function Xme(e,t,n=Kt){const s=Ps(),o=ys(t),i=mo(t),r=hx(e,o),l=dI((a,c)=>{let u,d=Kt,f;return AI(()=>{const h=e[o];Is(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(!Is(p,u)&&!(d!==Kt&&Is(h,d)))return;const m=s.vnode.props;m&&(t in m||o in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${i}`in m)||(u=h,c()),s.emit(`update:${t}`,p),Is(h,p)&&Is(h,d)&&!Is(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Kt:l,done:!1}:{done:!0}}}},l}const hx=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ys(t)}Modifiers`]||e[`${mo(t)}Modifiers`];function r$(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Kt;let o=n;const i=t.startsWith("update:"),r=i&&hx(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Cn(u)?u.trim():u)),r.number&&(o=n.map(th)));let l,a=s[l=Cf(t)]||s[l=Cf(ys(t))];!a&&i&&(a=s[l=Cf(mo(t))]),a&&oi(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,oi(c,e,6,o)}}const l$=new WeakMap;function mx(e,t,n=!1){const s=n?l$:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!Et(e)){const a=c=>{const u=mx(c,t,!0);u&&(l=!0,vn(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)&&s.set(e,null),null):(bt(i)?i.forEach(a=>r[a]=null):vn(r,i),an(e)&&s.set(e,r),r)}function fh(e,t){return!e||!nd(t)?!1:(t=t.slice(2).replace(/Once$/,""),ln(e,t[0].toLowerCase()+t.slice(1))||ln(e,mo(t))||ln(e,t))}function xf(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:m}=e,_=Nu(e);let b,g;try{if(n.shapeFlag&4){const y=o||s,T=y;b=ho(c.call(T,y,u,d,h,f,p)),g=l}else{const y=t;b=ho(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:c$(l)}}catch(y){fu.length=0,vc(y,e,1),b=ie(cs)}let v=b;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:T}=v;y.length&&T&7&&(i&&y.some(Qp)&&(g=u$(g,i)),v=ar(v,g,!1,!0))}return n.dirs&&(v=ar(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Yr(v,n.transition),b=v,Nu(_),b}function a$(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Qr(o)){if(o.type!==cs||o.children==="v-if"){if(n)return;n=o}}else return}return n}const c$=e=>{let t;for(const n in e)(n==="class"||n==="style"||nd(n))&&((t||(t={}))[n]=e[n]);return t},u$=(e,t)=>{const n={};for(const s in e)(!Qp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function d$(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Cb(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(gx(r,s,f)&&!fh(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Cb(s,r,c):!0:!!r;return!1}function Cb(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(gx(t,e,i)&&!fh(n,i))return!0}return!1}function gx(e,t,n){const s=e[n],o=t[n];return n==="style"&&an(s)&&an(o)?!or(s,o):s!==o}function ph({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const vx={},yx=()=>Object.create(vx),kx=e=>Object.getPrototypeOf(e)===vx;function f$(e,t,n,s=!1){const o={},i=yx();e.propsDefaults=Object.create(null),bx(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:lI(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function p$(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=en(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(fh(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=ys(f);o[p]=$v(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{bx(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!ln(t,d)&&((u=mo(d))===d||!ln(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=$v(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!ln(t,d))&&(delete i[d],c=!0)}c&&Yi(e.attrs,"set","")}function bx(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Bl(a))continue;const c=t[a];let u;o&&ln(o,u=ys(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:fh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=en(n),c=l||Kt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=$v(o,a,d,c[d],e,!ln(c,d))}}return r}function $v(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=ln(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Et(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=yc(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===mo(n))&&(s=!0))}return s}const h$=new WeakMap;function _x(e,t,n=!1){const s=n?h$:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!Et(e)){const u=d=>{a=!0;const[f,h]=_x(d,t,!0);vn(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)&&s.set(e,ja),ja;if(bt(i))for(let u=0;u<i.length;u++){const d=ys(i[u]);xb(d)&&(r[d]=Kt)}else if(i)for(const u in i){const d=ys(u);if(xb(d)){const f=i[u],h=r[d]=bt(f)||Et(f)?{type:f}:vn({},f),p=h.type;let m=!1,_=!0;if(bt(p))for(let b=0;b<p.length;++b){const g=p[b],v=Et(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(_=!1)}else m=Et(p)&&p.name==="Boolean";h[0]=m,h[1]=_,(m||ln(h,"default"))&&l.push(d)}}const c=[r,l];return an(e)&&s.set(e,c),c}function xb(e){return e[0]!=="$"&&!Bl(e)}const u0=e=>e==="_"||e==="_ctx"||e==="$stable",d0=e=>bt(e)?e.map(ho):[ho(e)],m$=(e,t,n)=>{if(t._n)return t;const s=be((...o)=>d0(t(...o)),n);return s._c=!1,s},wx=(e,t,n)=>{const s=e._ctx;for(const o in e){if(u0(o))continue;const i=e[o];if(Et(i))t[o]=m$(o,i,s);else if(i!=null){const r=d0(i);t[o]=()=>r}}},Sx=(e,t)=>{const n=d0(t);e.slots.default=()=>n},Cx=(e,t,n)=>{for(const s in t)(n||!u0(s))&&(e[s]=t[s])},g$=(e,t,n)=>{const s=e.slots=yx();if(e.vnode.shapeFlag&32){const o=t._;o?(Cx(s,t,n),n&&xC(s,"_",o,!0)):wx(t,s)}else t&&Sx(e,t)},v$=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Kt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:Cx(o,t,n):(i=!t.$stable,wx(t,o)),r=t}else t&&(Sx(e,t),r={default:1});if(i)for(const l in o)!u0(l)&&r[l]==null&&delete o[l]},ls=Ix;function y$(e){return xx(e)}function k$(e){return xx(e,PI)}function xx(e,t){const n=nh();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=ni,insertStaticContent:p}=e,m=(W,Z,ue,ae=null,me=null,j=null,ee=void 0,fe=null,ke=!!Z.dynamicChildren)=>{if(W===Z)return;W&&!di(W,Z)&&(ae=je(W),pe(W,me,j,!0),W=null),Z.patchFlag===-2&&(ke=!1,Z.dynamicChildren=null);const{type:Ae,ref:Ie,shapeFlag:de}=Z;switch(Ae){case qr:_(W,Z,ue,ae);break;case cs:b(W,Z,ue,ae);break;case Qa:W==null&&g(Z,ue,ae,ee);break;case Oe:S(W,Z,ue,ae,me,j,ee,fe,ke);break;default:de&1?T(W,Z,ue,ae,me,j,ee,fe,ke):de&6?E(W,Z,ue,ae,me,j,ee,fe,ke):(de&64||de&128)&&Ae.process(W,Z,ue,ae,me,j,ee,fe,ke,z)}Ie!=null&&me?Ga(Ie,W&&W.ref,j,Z||W,!Z):Ie==null&&W&&W.ref!=null&&Ga(W.ref,null,j,W,!0)},_=(W,Z,ue,ae)=>{if(W==null)s(Z.el=l(Z.children),ue,ae);else{const me=Z.el=W.el;Z.children!==W.children&&c(me,Z.children)}},b=(W,Z,ue,ae)=>{W==null?s(Z.el=a(Z.children||""),ue,ae):Z.el=W.el},g=(W,Z,ue,ae)=>{[W.el,W.anchor]=p(W.children,Z,ue,ae,W.el,W.anchor)},v=({el:W,anchor:Z},ue,ae)=>{let me;for(;W&&W!==Z;)me=f(W),s(W,ue,ae),W=me;s(Z,ue,ae)},y=({el:W,anchor:Z})=>{let ue;for(;W&&W!==Z;)ue=f(W),o(W),W=ue;o(Z)},T=(W,Z,ue,ae,me,j,ee,fe,ke)=>{if(Z.type==="svg"?ee="svg":Z.type==="math"&&(ee="mathml"),W==null)P(Z,ue,ae,me,j,ee,fe,ke);else{const Ae=W.el&&W.el._isVueCE?W.el:null;try{Ae&&Ae._beginPatch(),M(W,Z,me,j,ee,fe,ke)}finally{Ae&&Ae._endPatch()}}},P=(W,Z,ue,ae,me,j,ee,fe)=>{let ke,Ae;const{props:Ie,shapeFlag:de,transition:Me,dirs:Ke}=W;if(ke=W.el=r(W.type,j,Ie&&Ie.is,Ie),de&8?u(ke,W.children):de&16&&k(W.children,ke,null,ae,me,Xm(W,j),ee,fe),Ke&&Mi(W,null,ae,"created"),I(ke,W,W.scopeId,ee,ae),Ie){for(const yt in Ie)yt!=="value"&&!Bl(yt)&&i(ke,yt,null,Ie[yt],j,ae);"value"in Ie&&i(ke,"value",null,Ie.value,j),(Ae=Ie.onVnodeBeforeMount)&&fo(Ae,ae,W)}Ke&&Mi(W,null,ae,"beforeMount");const lt=Ax(me,Me);lt&&Me.beforeEnter(ke),s(ke,Z,ue),((Ae=Ie&&Ie.onVnodeMounted)||lt||Ke)&&ls(()=>{try{Ae&&fo(Ae,ae,W),lt&&Me.enter(ke),Ke&&Mi(W,null,ae,"mounted")}finally{}},me)},I=(W,Z,ue,ae,me)=>{if(ue&&h(W,ue),ae)for(let j=0;j<ae.length;j++)h(W,ae[j]);if(me){let j=me.subTree;if(Z===j||np(j.type)&&(j.ssContent===Z||j.ssFallback===Z)){const ee=me.vnode;I(W,ee,ee.scopeId,ee.slotScopeIds,me.parent)}}},k=(W,Z,ue,ae,me,j,ee,fe,ke=0)=>{for(let Ae=ke;Ae<W.length;Ae++){const Ie=W[Ae]=fe?Gi(W[Ae]):ho(W[Ae]);m(null,Ie,Z,ue,ae,me,j,ee,fe)}},M=(W,Z,ue,ae,me,j,ee)=>{const fe=Z.el=W.el;let{patchFlag:ke,dynamicChildren:Ae,dirs:Ie}=Z;ke|=W.patchFlag&16;const de=W.props||Kt,Me=Z.props||Kt;let Ke;if(ue&&_l(ue,!1),(Ke=Me.onVnodeBeforeUpdate)&&fo(Ke,ue,Z,W),Ie&&Mi(Z,W,ue,"beforeUpdate"),ue&&_l(ue,!0),(de.innerHTML&&Me.innerHTML==null||de.textContent&&Me.textContent==null)&&u(fe,""),Ae?$(W.dynamicChildren,Ae,fe,ue,ae,Xm(Z,me),j):ee||G(W,Z,fe,null,ue,ae,Xm(Z,me),j,!1),ke>0){if(ke&16)L(fe,de,Me,ue,me);else if(ke&2&&de.class!==Me.class&&i(fe,"class",null,Me.class,me),ke&4&&i(fe,"style",de.style,Me.style,me),ke&8){const lt=Z.dynamicProps;for(let yt=0;yt<lt.length;yt++){const kt=lt[yt],Tt=de[kt],Pt=Me[kt];(Pt!==Tt||kt==="value")&&i(fe,kt,Tt,Pt,me,ue)}}ke&1&&W.children!==Z.children&&u(fe,Z.children)}else!ee&&Ae==null&&L(fe,de,Me,ue,me);((Ke=Me.onVnodeUpdated)||Ie)&&ls(()=>{Ke&&fo(Ke,ue,Z,W),Ie&&Mi(Z,W,ue,"updated")},ae)},$=(W,Z,ue,ae,me,j,ee)=>{for(let fe=0;fe<Z.length;fe++){const ke=W[fe],Ae=Z[fe],Ie=ke.el&&(ke.type===Oe||!di(ke,Ae)||ke.shapeFlag&198)?d(ke.el):ue;m(ke,Ae,Ie,null,ae,me,j,ee,!0)}},L=(W,Z,ue,ae,me)=>{if(Z!==ue){if(Z!==Kt)for(const j in Z)!Bl(j)&&!(j in ue)&&i(W,j,Z[j],null,me,ae);for(const j in ue){if(Bl(j))continue;const ee=ue[j],fe=Z[j];ee!==fe&&j!=="value"&&i(W,j,fe,ee,me,ae)}"value"in ue&&i(W,"value",Z.value,ue.value,me)}},S=(W,Z,ue,ae,me,j,ee,fe,ke)=>{const Ae=Z.el=W?W.el:l(""),Ie=Z.anchor=W?W.anchor:l("");let{patchFlag:de,dynamicChildren:Me,slotScopeIds:Ke}=Z;Ke&&(fe=fe?fe.concat(Ke):Ke),W==null?(s(Ae,ue,ae),s(Ie,ue,ae),k(Z.children||[],ue,Ie,me,j,ee,fe,ke)):de>0&&de&64&&Me&&W.dynamicChildren&&W.dynamicChildren.length===Me.length?($(W.dynamicChildren,Me,ue,me,j,ee,fe),(Z.key!=null||me&&Z===me.subTree)&&f0(W,Z,!0)):G(W,Z,ue,Ie,me,j,ee,fe,ke)},E=(W,Z,ue,ae,me,j,ee,fe,ke)=>{Z.slotScopeIds=fe,W==null?Z.shapeFlag&512?me.ctx.activate(Z,ue,ae,ee,ke):D(Z,ue,ae,me,j,ee,ke):R(W,Z,ke)},D=(W,Z,ue,ae,me,j,ee)=>{const fe=W.component=Ox(W,ae,me);if(id(W)&&(fe.ctx.renderer=z),Rx(fe,!1,ee),fe.asyncDep){if(me&&me.registerDep(fe,H,ee),!W.el){const ke=fe.subTree=ie(cs);b(null,ke,Z,ue),W.placeholder=ke.el}}else H(fe,W,Z,ue,me,j,ee)},R=(W,Z,ue)=>{const ae=Z.component=W.component;if(d$(W,Z,ue))if(ae.asyncDep&&!ae.asyncResolved){U(ae,Z,ue);return}else ae.next=Z,ae.update();else Z.el=W.el,ae.vnode=Z},H=(W,Z,ue,ae,me,j,ee)=>{const fe=()=>{if(W.isMounted){let{next:de,bu:Me,u:Ke,parent:lt,vnode:yt}=W;{const Vt=Tx(W);if(Vt){de&&(de.el=yt.el,U(W,de,ee)),Vt.asyncDep.then(()=>{ls(()=>{W.isUnmounted||Ae()},me)});return}}let kt=de,Tt;_l(W,!1),de?(de.el=yt.el,U(W,de,ee)):de=yt,Me&&Va(Me),(Tt=de.props&&de.props.onVnodeBeforeUpdate)&&fo(Tt,lt,de,yt),_l(W,!0);const Pt=xf(W),_t=W.subTree;W.subTree=Pt,m(_t,Pt,d(_t.el),je(_t),W,me,j),de.el=Pt.el,kt===null&&ph(W,Pt.el),Ke&&ls(Ke,me),(Tt=de.props&&de.props.onVnodeUpdated)&&ls(()=>fo(Tt,lt,de,yt),me)}else{let de;const{el:Me,props:Ke}=Z,{bm:lt,m:yt,parent:kt,root:Tt,type:Pt}=W,_t=tr(Z);if(_l(W,!1),lt&&Va(lt),!_t&&(de=Ke&&Ke.onVnodeBeforeMount)&&fo(de,kt,Z),_l(W,!0),Me&&oe){const Vt=()=>{W.subTree=xf(W),oe(Me,W.subTree,W,me,null)};_t&&Pt.__asyncHydrate?Pt.__asyncHydrate(Me,W,Vt):Vt()}else{Tt.ce&&Tt.ce._hasShadowRoot()&&Tt.ce._injectChildStyle(Pt,W.parent?W.parent.type:void 0);const Vt=W.subTree=xf(W);m(null,Vt,ue,ae,W,me,j),Z.el=Vt.el}if(yt&&ls(yt,me),!_t&&(de=Ke&&Ke.onVnodeMounted)){const Vt=Z;ls(()=>fo(de,kt,Vt),me)}(Z.shapeFlag&256||kt&&tr(kt.vnode)&&kt.vnode.shapeFlag&256)&&W.a&&ls(W.a,me),W.isMounted=!0,Z=ue=ae=null}};W.scope.on();const ke=W.effect=new Vf(fe);W.scope.off();const Ae=W.update=ke.run.bind(ke),Ie=W.job=ke.runIfDirty.bind(ke);Ie.i=W,Ie.id=W.uid,ke.scheduler=()=>t0(Ie),_l(W,!0),Ae()},U=(W,Z,ue)=>{Z.component=W;const ae=W.vnode.props;W.vnode=Z,W.next=null,p$(W,Z.props,ae,ue),v$(W,Z.children,ue),ir(),fb(W),rr()},G=(W,Z,ue,ae,me,j,ee,fe,ke=!1)=>{const Ae=W&&W.children,Ie=W?W.shapeFlag:0,de=Z.children,{patchFlag:Me,shapeFlag:Ke}=Z;if(Me>0){if(Me&128){V(Ae,de,ue,ae,me,j,ee,fe,ke);return}else if(Me&256){Q(Ae,de,ue,ae,me,j,ee,fe,ke);return}}Ke&8?(Ie&16&&Pe(Ae,me,j),de!==Ae&&u(ue,de)):Ie&16?Ke&16?V(Ae,de,ue,ae,me,j,ee,fe,ke):Pe(Ae,me,j,!0):(Ie&8&&u(ue,""),Ke&16&&k(de,ue,ae,me,j,ee,fe,ke))},Q=(W,Z,ue,ae,me,j,ee,fe,ke)=>{W=W||ja,Z=Z||ja;const Ae=W.length,Ie=Z.length,de=Math.min(Ae,Ie);let Me;for(Me=0;Me<de;Me++){const Ke=Z[Me]=ke?Gi(Z[Me]):ho(Z[Me]);m(W[Me],Ke,ue,null,me,j,ee,fe,ke)}Ae>Ie?Pe(W,me,j,!0,!1,de):k(Z,ue,ae,me,j,ee,fe,ke,de)},V=(W,Z,ue,ae,me,j,ee,fe,ke)=>{let Ae=0;const Ie=Z.length;let de=W.length-1,Me=Ie-1;for(;Ae<=de&&Ae<=Me;){const Ke=W[Ae],lt=Z[Ae]=ke?Gi(Z[Ae]):ho(Z[Ae]);if(di(Ke,lt))m(Ke,lt,ue,null,me,j,ee,fe,ke);else break;Ae++}for(;Ae<=de&&Ae<=Me;){const Ke=W[de],lt=Z[Me]=ke?Gi(Z[Me]):ho(Z[Me]);if(di(Ke,lt))m(Ke,lt,ue,null,me,j,ee,fe,ke);else break;de--,Me--}if(Ae>de){if(Ae<=Me){const Ke=Me+1,lt=Ke<Ie?Z[Ke].el:ae;for(;Ae<=Me;)m(null,Z[Ae]=ke?Gi(Z[Ae]):ho(Z[Ae]),ue,lt,me,j,ee,fe,ke),Ae++}}else if(Ae>Me)for(;Ae<=de;)pe(W[Ae],me,j,!0),Ae++;else{const Ke=Ae,lt=Ae,yt=new Map;for(Ae=lt;Ae<=Me;Ae++){const Rt=Z[Ae]=ke?Gi(Z[Ae]):ho(Z[Ae]);Rt.key!=null&&yt.set(Rt.key,Ae)}let kt,Tt=0;const Pt=Me-lt+1;let _t=!1,Vt=0;const cn=new Array(Pt);for(Ae=0;Ae<Pt;Ae++)cn[Ae]=0;for(Ae=Ke;Ae<=de;Ae++){const Rt=W[Ae];if(Tt>=Pt){pe(Rt,me,j,!0);continue}let tn;if(Rt.key!=null)tn=yt.get(Rt.key);else for(kt=lt;kt<=Me;kt++)if(cn[kt-lt]===0&&di(Rt,Z[kt])){tn=kt;break}tn===void 0?pe(Rt,me,j,!0):(cn[tn-lt]=Ae+1,tn>=Vt?Vt=tn:_t=!0,m(Rt,Z[tn],ue,null,me,j,ee,fe,ke),Tt++)}const is=_t?b$(cn):ja;for(kt=is.length-1,Ae=Pt-1;Ae>=0;Ae--){const Rt=lt+Ae,tn=Z[Rt],xs=Z[Rt+1],ot=Rt+1<Ie?xs.el||Mx(xs):ae;cn[Ae]===0?m(null,tn,ue,ot,me,j,ee,fe,ke):_t&&(kt<0||Ae!==is[kt]?re(tn,ue,ot,2):kt--)}}},re=(W,Z,ue,ae,me=null)=>{const{el:j,type:ee,transition:fe,children:ke,shapeFlag:Ae}=W;if(Ae&6){re(W.component.subTree,Z,ue,ae);return}if(Ae&128){W.suspense.move(Z,ue,ae);return}if(Ae&64){ee.move(W,Z,ue,z);return}if(ee===Oe){s(j,Z,ue);for(let de=0;de<ke.length;de++)re(ke[de],Z,ue,ae);s(W.anchor,Z,ue);return}if(ee===Qa){v(W,Z,ue);return}if(ae!==2&&Ae&1&&fe)if(ae===0)fe.persisted&&!j[Xo]?s(j,Z,ue):(fe.beforeEnter(j),s(j,Z,ue),ls(()=>fe.enter(j),me));else{const{leave:de,delayLeave:Me,afterLeave:Ke}=fe,lt=()=>{W.ctx.isUnmounted?o(j):s(j,Z,ue)},yt=()=>{const kt=j._isLeaving||!!j[Xo];j._isLeaving&&j[Xo](!0),fe.persisted&&!kt?lt():de(j,()=>{lt(),Ke&&Ke()})};Me?Me(j,lt,yt):yt()}else s(j,Z,ue)},pe=(W,Z,ue,ae=!1,me=!1)=>{const{type:j,props:ee,ref:fe,children:ke,dynamicChildren:Ae,shapeFlag:Ie,patchFlag:de,dirs:Me,cacheIndex:Ke,memo:lt}=W;if(de===-2&&(me=!1),fe!=null&&(ir(),Ga(fe,null,ue,W,!0),rr()),Ke!=null&&(Z.renderCache[Ke]=void 0),Ie&256){Z.ctx.deactivate(W);return}const yt=Ie&1&&Me,kt=!tr(W);let Tt;if(kt&&(Tt=ee&&ee.onVnodeBeforeUnmount)&&fo(Tt,Z,W),Ie&6)he(W.component,ue,ae);else{if(Ie&128){W.suspense.unmount(ue,ae);return}yt&&Mi(W,null,Z,"beforeUnmount"),Ie&64?W.type.remove(W,Z,ue,z,ae):Ae&&!Ae.hasOnce&&(j!==Oe||de>0&&de&64)?Pe(Ae,Z,ue,!1,!0):(j===Oe&&de&384||!me&&Ie&16)&&Pe(ke,Z,ue),ae&&ne(W)}const Pt=lt!=null&&Ke==null;(kt&&(Tt=ee&&ee.onVnodeUnmounted)||yt||Pt)&&ls(()=>{Tt&&fo(Tt,Z,W),yt&&Mi(W,null,Z,"unmounted"),Pt&&(W.el=null)},ue)},ne=W=>{const{type:Z,el:ue,anchor:ae,transition:me}=W;if(Z===Oe){X(ue,ae);return}if(Z===Qa){y(W);return}const j=()=>{o(ue),me&&!me.persisted&&me.afterLeave&&me.afterLeave()};if(W.shapeFlag&1&&me&&!me.persisted){const{leave:ee,delayLeave:fe}=me,ke=()=>ee(ue,j);fe?fe(W.el,j,ke):ke()}else j()},X=(W,Z)=>{let ue;for(;W!==Z;)ue=f(W),o(W),W=ue;o(Z)},he=(W,Z,ue)=>{const{bum:ae,scope:me,job:j,subTree:ee,um:fe,m:ke,a:Ae}=W;tp(ke),tp(Ae),ae&&Va(ae),me.stop(),j&&(j.flags|=8,pe(ee,W,Z,ue)),fe&&ls(fe,Z),ls(()=>{W.isUnmounted=!0},Z)},Pe=(W,Z,ue,ae=!1,me=!1,j=0)=>{for(let ee=j;ee<W.length;ee++)pe(W[ee],Z,ue,ae,me)},je=W=>{if(W.shapeFlag&6)return je(W.component.subTree);if(W.shapeFlag&128)return W.suspense.next();const Z=f(W.anchor||W.el),ue=Z&&Z[tx];return ue?f(ue):Z};let it=!1;const ce=(W,Z,ue)=>{let ae;W==null?Z._vnode&&(pe(Z._vnode,null,null,!0),ae=Z._vnode.component):m(Z._vnode||null,W,Z,null,null,null,ue),Z._vnode=W,it||(it=!0,fb(ae),Zf(),it=!1)},z={p:m,um:pe,m:re,r:ne,mt:D,mc:k,pc:G,pbc:$,n:je,o:e};let Y,oe;return t&&([Y,oe]=t(z)),{render:ce,hydrate:Y,createApp:i$(ce,Y)}}function Xm({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 _l({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ax(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function f0(e,t,n=!1){const s=e.children,o=t.children;if(bt(s)&&bt(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=Gi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&f0(r,l)),l.type===qr&&(l.patchFlag===-1&&(l=o[i]=Gi(l)),l.el=r.el),l.type===cs&&!l.el&&(l.el=r.el)}}function b$(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function Tx(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Tx(t)}function tp(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Mx(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Mx(t.subTree):null}const np=e=>e.__isSuspense;let Nv=0;const _$={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)w$(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}S$(e,t,n,s,o,r,l,a,c)}},hydrate:C$,normalize:x$},Zme=_$;function Pu(e,t){const n=e.props&&e.props[t];Et(n)&&n()}function w$(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=Ex(e,o,s,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,s,f,i,r),f.deps>0?(Pu(e,"onPending"),Pu(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Ya(f,e.ssFallback)):f.resolve(!1,!0)}function S$(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:_,isHydrating:b}=d;if(m)d.pendingBranch=f,di(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():_&&(b||(a(p,h,n,s,o,null,i,r,l),Ya(d,h)))):(d.pendingId=Nv++,b?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,s,o,null,i,r,l),Ya(d,h))):p&&di(p,f)?(a(p,f,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&di(p,f))a(p,f,n,s,o,d,i,r,l),Ya(d,f);else if(Pu(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Nv++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function Ex(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:m,remove:_}}=c;let b;const g=A$(e);g&&t&&t.pendingBranch&&(b=t.pendingId,t.deps++);const v=e.props?qf(e.props.timeout):void 0,y=i,T={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:Nv++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(P=!1,I=!1){const{vnode:k,activeBranch:M,pendingBranch:$,pendingId:L,effects:S,parentComponent:E,container:D,isInFallback:R}=T;let H=!1;if(T.isHydrating)T.isHydrating=!1;else if(!P){H=M&&$.transition&&$.transition.mode==="out-in";let Q=!1;H&&(M.transition.afterLeave=()=>{L===T.pendingId&&(f($,D,i===y&&!Q?p(M):i,0),Xf(S),R&&k.ssFallback&&(k.ssFallback.el=null))}),M&&!T.isFallbackMountPending&&(m(M.el)===D&&(i=p(M),Q=!0),h(M,E,T,!0),!H&&R&&k.ssFallback&&ls(()=>k.ssFallback.el=null,T)),H||f($,D,i,0)}T.isFallbackMountPending=!1,Ya(T,$),T.pendingBranch=null,T.isInFallback=!1;let U=T.parent,G=!1;for(;U;){if(U.pendingBranch){U.effects.push(...S),G=!0;break}U=U.parent}!G&&!H&&Xf(S),T.effects=[],g&&t&&t.pendingBranch&&b===t.pendingId&&(t.deps--,t.deps===0&&!I&&t.resolve()),Pu(k,"onResolve")},fallback(P){if(!T.pendingBranch)return;const{vnode:I,activeBranch:k,parentComponent:M,container:$,namespace:L}=T;Pu(I,"onFallback");const S=p(k),E=()=>{T.isFallbackMountPending=!1,T.isInFallback&&(d(null,P,$,S,M,null,L,l,a),Ya(T,P))},D=P.transition&&P.transition.mode==="out-in";D&&(T.isFallbackMountPending=!0,k.transition.afterLeave=E),T.isInFallback=!0,h(k,M,null,!0),D||E()},move(P,I,k){T.activeBranch&&f(T.activeBranch,P,I,k),T.container=P},next(){return T.activeBranch&&p(T.activeBranch)},registerDep(P,I,k){const M=!!T.pendingBranch;M&&T.deps++;const $=P.vnode.el;P.asyncDep.catch(L=>{vc(L,P,0)}).then(L=>{if(P.isUnmounted||T.isUnmounted||T.pendingId!==P.suspenseId)return;Ru(),P.asyncResolved=!0;const{vnode:S}=P;Lv(P,L,!1),$&&(S.el=$);const E=!$&&P.subTree.el;I(P,S,m($||P.subTree.el),$?null:p(P.subTree),T,r,k),E&&(S.placeholder=null,_(E)),ph(P,S.el),M&&--T.deps===0&&T.resolve()})},unmount(P,I){T.isUnmounted=!0,T.activeBranch&&h(T.activeBranch,n,P,I),T.pendingBranch&&h(T.pendingBranch,n,P,I)}};return T}function C$(e,t,n,s,o,i,r,l,a){const c=t.suspense=Ex(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function x$(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Ab(s?n.default:n),e.ssFallback=s?Ab(n.fallback):ie(cs)}function Ab(e){let t;if(Et(e)){const n=Vl&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=Us,$x())}return bt(e)&&(e=a$(e)),e=ho(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function Ix(e,t){t&&t.pendingBranch?bt(e)?t.effects.push(...e):t.effects.push(e):Xf(e)}function Ya(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,ph(s,o))}function A$(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Oe=Symbol.for("v-fgt"),qr=Symbol.for("v-txt"),cs=Symbol.for("v-cmt"),Qa=Symbol.for("v-stc"),fu=[];let Us=null;function w(e=!1){fu.push(Us=e?null:[])}function $x(){fu.pop(),Us=fu[fu.length-1]||null}let Vl=1;function sp(e,t=!1){Vl+=e,e<0&&Us&&t&&(Us.hasOnce=!0)}function Nx(e){return e.dynamicChildren=Vl>0?Us||ja:null,$x(),Vl>0&&Us&&Us.push(e),e}function N(e,t,n,s,o,i){return Nx(x(e,t,n,s,o,i,!0))}function ye(e,t,n,s,o){return Nx(ie(e,t,n,s,o,!0))}function Qr(e){return e?e.__v_isVNode===!0:!1}function di(e,t){return e.type===t.type&&e.key===t.key}function Jme(e){}const Lx=({key:e})=>e??null,Af=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Cn(e)||ss(e)||Et(e)?{i:Os,r:e,k:t,f:!!n}:e:null);function x(e,t=null,n=null,s=0,o=null,i=e===Oe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Lx(t),ref:t&&Af(t),scopeId:ch,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Os};return l?(h0(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Cn(n)?8:16),Vl>0&&!r&&Us&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Us.push(a),a}const ie=T$;function T$(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===ux)&&(e=cs),Qr(e)){const l=ar(e,t,!0);return n&&h0(l,n),Vl>0&&!i&&Us&&(l.shapeFlag&6?Us[Us.indexOf(e)]=l:Us.push(l)),l.patchFlag=-2,l}if(L$(e)&&(e=e.__vccOpts),t){t=M$(t);let{class:l,style:a}=t;l&&!Cn(l)&&(t.class=Re(l)),an(a)&&(ah(a)&&!bt(a)&&(a=vn({},a)),t.style=Qt(a))}const r=Cn(e)?1:np(e)?128:nx(e)?64:an(e)?4:Et(e)?2:0;return x(e,t,n,s,o,r,i,!0)}function M$(e){return e?ah(e)||kx(e)?vn({},e):e:null}function ar(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?mn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Lx(c),ref:t&&t.ref?n&&i?bt(i)?i.concat(Af(t)):[i,Af(t)]:Af(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Oe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ar(e.ssContent),ssFallback:e.ssFallback&&ar(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Yr(u,a.clone(u)),u}function Ue(e=" ",t=0){return ie(qr,null,e,t)}function p0(e,t){const n=ie(Qa,null,e);return n.staticCount=t,n}function le(e="",t=!1){return t?(w(),ye(cs,null,e)):ie(cs,null,e)}function ho(e){return e==null||typeof e=="boolean"?ie(cs):bt(e)?ie(Oe,null,e.slice()):Qr(e)?Gi(e):ie(qr,null,String(e))}function Gi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ar(e)}function h0(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(bt(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),h0(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!kx(t)?t._ctx=Os:o===3&&Os&&(Os.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Et(t)?(t={default:t,_ctx:Os},n=32):(t=String(t),s&64?(n=16,t=[Ue(t)]):n=8);e.children=t,e.shapeFlag|=n}function mn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Re([t.class,s.class]));else if(o==="style")t.style=Qt([t.style,s.style]);else if(nd(o)){const i=t[o],r=s[o];r&&i!==r&&!(bt(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Qp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function fo(e,t,n,s=null){oi(e,t,7,[n,s])}const E$=px();let I$=0;function Ox(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||E$,i={uid:I$++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new EC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:_x(s,o),emitsOptions:mx(s,o),emit:null,emitted:null,propsDefaults:Kt,inheritAttrs:s.inheritAttrs,ctx:Kt,data:Kt,props:Kt,attrs:Kt,slots:Kt,refs:Kt,setupState:Kt,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=r$.bind(null,i),e.ce&&e.ce(i),i}let $s=null;const Ps=()=>$s||Os;let op,Xa;{const e=nh(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};op=t("__VUE_INSTANCE_SETTERS__",n=>$s=n),Xa=t("__VUE_SSR_SETTERS__",n=>Kl=n)}const yc=e=>{const t=$s;return op(e),e.scope.on(),()=>{e.scope.off(),op(t)}},Ru=()=>{$s&&$s.scope.off(),op(null)};function Px(e){return e.vnode.shapeFlag&4}let Kl=!1;function Rx(e,t=!1,n=!1){t&&Xa(t);const{props:s,children:o}=e.vnode,i=Px(e);f$(e,s,i,t),g$(e,o,n||t);const r=i?$$(e,t):void 0;return t&&Xa(!1),r}function $$(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Mv);const{setup:s}=n;if(s){ir();const o=e.setupContext=s.length>1?Bx(e):null,i=yc(e),r=sd(s,e,0,[e.props,o]),l=Y1(r);if(rr(),i(),(l||e.sp)&&!tr(e)&&s0(e),l){if(r.then(Ru,Ru),t)return r.then(a=>{Lv(e,a,t)}).catch(a=>{vc(a,e,0)});e.asyncDep=r}else Lv(e,r,t)}else Dx(e,t)}function Lv(e,t,n){Et(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:an(t)&&(e.setupState=KC(t)),Dx(e,n)}let ip,Ov;function ege(e){ip=e,Ov=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,ZI))}}const tge=()=>!ip;function Dx(e,t,n){const s=e.type;if(!e.render){if(!t&&ip&&!s.render){const o=s.template||c0(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=vn(vn({isCustomElement:i,delimiters:l},r),a);s.render=ip(o,c)}}e.render=s.render||ni,Ov&&Ov(e)}{const o=yc(e);ir();try{JI(e)}finally{rr(),o()}}}const N$={get(e,t){return Ws(e,"get",""),e[t]}};function Bx(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,N$),slots:e.slots,emit:e.emit,expose:t}}function ld(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(KC(Hr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in du)return du[n](e)},has(t,n){return n in t||n in du}})):e.proxy}function Pv(e,t=!0){return Et(e)?e.displayName||e.name:e.name||t&&e.__name}function L$(e){return Et(e)&&"__vccOpts"in e}const B=(e,t)=>mI(e,t,Kl);function fn(e,t,n){try{sp(-1);const s=arguments.length;return s===2?an(t)&&!bt(t)?Qr(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Qr(n)&&(n=[n]),ie(e,t,n))}finally{sp(1)}}function nge(){}function sge(e,t,n,s){const o=n[s];if(o&&O$(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function O$(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Is(n[s],t[s]))return!1;return Vl>0&&Us&&Us.push(e),!0}const P$="3.5.35",oge=ni,ige=bI,rge=Ea,lge=JC,R$={createComponentInstance:Ox,setupComponent:Rx,renderComponentRoot:xf,setCurrentRenderingInstance:Nu,isVNode:Qr,normalizeVNode:ho,getComponentPublicInstance:ld,ensureValidVNode:a0,pushWarningContext:yI,popWarningContext:kI},age=R$,cge=null,uge=null,dge=null;/**
|
|
17
|
+
* @vue/runtime-dom v3.5.35
|
|
18
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
+
* @license MIT
|
|
20
|
+
**/let Rv;const Tb=typeof window<"u"&&window.trustedTypes;if(Tb)try{Rv=Tb.createPolicy("vue",{createHTML:e=>e})}catch{}const Fx=Rv?e=>Rv.createHTML(e):e=>e,D$="http://www.w3.org/2000/svg",B$="http://www.w3.org/1998/Math/MathML",ji=typeof document<"u"?document:null,Mb=ji&&ji.createElement("template"),F$={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?ji.createElementNS(D$,e):t==="mathml"?ji.createElementNS(B$,e):n?ji.createElement(e,{is:n}):ji.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>ji.createTextNode(e),createComment:e=>ji.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ji.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Mb.innerHTML=Fx(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Mb.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},wr="transition",Vc="animation",rc=Symbol("_vtc"),Hx={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},Wx=vn({},ox,Hx),H$=e=>(e.displayName="Transition",e.props=Wx,e),Xr=H$((e,{slots:t})=>fn(NI,zx(e),t)),wl=(e,t=[])=>{bt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Eb=e=>e?bt(e)?e.some(t=>t.length>1):e.length>1:!1;function zx(e){const t={};for(const S in e)S in Hx||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=W$(o),m=p&&p[0],_=p&&p[1],{onBeforeEnter:b,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:T,onBeforeAppear:P=b,onAppear:I=g,onAppearCancelled:k=v}=t,M=(S,E,D,R)=>{S._enterCancelled=R,Nr(S,E?u:l),Nr(S,E?c:r),D&&D()},$=(S,E)=>{S._isLeaving=!1,Nr(S,d),Nr(S,h),Nr(S,f),E&&E()},L=S=>(E,D)=>{const R=S?I:g,H=()=>M(E,S,D);wl(R,[E,H]),Ib(()=>{Nr(E,S?a:i),Ai(E,S?u:l),Eb(R)||$b(E,s,m,H)})};return vn(t,{onBeforeEnter(S){wl(b,[S]),Ai(S,i),Ai(S,r)},onBeforeAppear(S){wl(P,[S]),Ai(S,a),Ai(S,c)},onEnter:L(!1),onAppear:L(!0),onLeave(S,E){S._isLeaving=!0;const D=()=>$(S,E);Ai(S,d),S._enterCancelled?(Ai(S,f),Dv(S)):(Dv(S),Ai(S,f)),Ib(()=>{S._isLeaving&&(Nr(S,d),Ai(S,h),Eb(y)||$b(S,s,_,D))}),wl(y,[S,D])},onEnterCancelled(S){M(S,!1,void 0,!0),wl(v,[S])},onAppearCancelled(S){M(S,!0,void 0,!0),wl(k,[S])},onLeaveCancelled(S){$(S),wl(T,[S])}})}function W$(e){if(e==null)return null;if(an(e))return[Zm(e.enter),Zm(e.leave)];{const t=Zm(e);return[t,t]}}function Zm(e){return qf(e)}function Ai(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[rc]||(e[rc]=new Set)).add(t)}function Nr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[rc];n&&(n.delete(t),n.size||(e[rc]=void 0))}function Ib(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let z$=0;function $b(e,t,n,s){const o=e._endId=++z$,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=Ux(e,t);if(!r)return s();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 Ux(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${wr}Delay`),i=s(`${wr}Duration`),r=Nb(o,i),l=s(`${Vc}Delay`),a=s(`${Vc}Duration`),c=Nb(l,a);let u=null,d=0,f=0;t===wr?r>0&&(u=wr,d=r,f=i.length):t===Vc?c>0&&(u=Vc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?wr:Vc:null,f=u?u===wr?i.length:a.length:0);const h=u===wr&&/\b(?:transform|all)(?:,|$)/.test(s(`${wr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Nb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Lb(n)+Lb(e[s])))}function Lb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Dv(e){return(e?e.ownerDocument:document).body.offsetHeight}function U$(e,t,n){const s=e[rc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const rp=Symbol("_vod"),jx=Symbol("_vsh"),Eo={name:"show",beforeMount(e,{value:t},{transition:n}){e[rp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Kc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Kc(e,!0),s.enter(e)):s.leave(e,()=>{Kc(e,!1)}):Kc(e,t))},beforeUnmount(e,{value:t}){Kc(e,t)}};function Kc(e,t){e.style.display=t?e[rp]:"none",e[jx]=!t}function j$(){Eo.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const qx=Symbol("");function fge(e){const t=Ps();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>lp(i,o))},s=()=>{const o=e(t.proxy);t.ce?lp(t.ce,o):Bv(t.subTree,o),n(o)};cx(()=>{Xf(s)}),yn(()=>{Ve(s,ni,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),xn(()=>o.disconnect())})}function Bv(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Bv(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)lp(e.el,t);else if(e.type===Oe)e.children.forEach(n=>Bv(n,t));else if(e.type===Qa){let{el:n,anchor:s}=e;for(;n&&(lp(n,t),n!==s);)n=n.nextSibling}}function lp(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=WE(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[qx]=s}}const q$=/(?:^|;)\s*display\s*:/;function V$(e,t,n){const s=e.style,o=Cn(n);let i=!1;if(n&&!o){if(t)if(Cn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&ou(s,l,"")}else for(const r in t)n[r]==null&&ou(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?G$(e,r,!Cn(t)&&t?t[r]:void 0,l)||ou(s,r,l):ou(s,r,"")}}else if(o){if(t!==n){const r=s[qx];r&&(n+=";"+r),s.cssText=n,i=q$.test(n)}}else t&&e.removeAttribute("style");rp in e&&(e[rp]=i?s.display:"",e[jx]&&(s.display="none"))}const Ob=/\s*!important$/;function ou(e,t,n){if(bt(n))n.forEach(s=>ou(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=K$(e,t);Ob.test(n)?e.setProperty(mo(s),n.replace(Ob,""),"important"):e[s]=n}}const Pb=["Webkit","Moz","ms"],Jm={};function K$(e,t){const n=Jm[t];if(n)return n;let s=ys(t);if(s!=="filter"&&s in e)return Jm[t]=s;s=eh(s);for(let o=0;o<Pb.length;o++){const i=Pb[o]+s;if(i in e)return Jm[t]=i}return t}function G$(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Cn(s)&&n===s}const Rb="http://www.w3.org/1999/xlink";function Db(e,t,n,s,o,i=FE(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Rb,t.slice(6,t.length)):e.setAttributeNS(Rb,t,n):n==null||i&&!AC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Do(n)?String(n):n)}function Bb(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Fx(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=AC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function Xi(e,t,n,s){e.addEventListener(t,n,s)}function Y$(e,t,n,s){e.removeEventListener(t,n,s)}const Fb=Symbol("_vei");function Q$(e,t,n,s,o=null){const i=e[Fb]||(e[Fb]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=X$(t);if(s){const c=i[t]=e6(s,o);Xi(e,l,c,a)}else r&&(Y$(e,l,r,a),i[t]=void 0)}}const Hb=/(?:Once|Passive|Capture)$/;function X$(e){let t;if(Hb.test(e)){t={};let s;for(;s=e.match(Hb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):mo(e.slice(2)),t]}let eg=0;const Z$=Promise.resolve(),J$=()=>eg||(Z$.then(()=>eg=0),eg=Date.now());function e6(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(bt(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&oi(c,t,5,l)}}else oi(o,t,5,[s])};return n.value=e,n.attached=J$(),n}const Wb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,t6=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?U$(e,s,r):t==="style"?V$(e,n,s):nd(t)?Qp(t)||Q$(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):n6(e,t,s,r))?(Bb(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Db(e,t,s,r,i,t!=="value")):e._isVueCE&&(s6(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Cn(s)))?Bb(e,ys(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Db(e,t,s,r))};function n6(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Wb(t)&&Et(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Wb(t)&&Cn(n)?!1:t in e}function s6(e,t){const n=e._def.props;if(!n)return!1;const s=ys(t);return Array.isArray(n)?n.some(o=>ys(o)===s):Object.keys(n).some(o=>ys(o)===s)}const zb={};function o6(e,t,n){let s=qe(e,t);Xp(s)&&(s=vn({},s,t));class o extends m0{constructor(r){super(s,r,n)}}return o.def=s,o}const pge=((e,t)=>o6(e,t,_6)),i6=typeof HTMLElement<"u"?HTMLElement:class{};class m0 extends i6{constructor(t,n={},s=up){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==up?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(vn({},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 m0){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 s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!bt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=qf(this._props[a])),(l||(l=Object.create(null)))[ys(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)ln(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=bt(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(ys))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):zb;const o=ys(t);n&&this._numberProps&&this._numberProps[o]&&(s=qf(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===zb?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(mo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(mo(t),n+""):n||this.removeAttribute(mo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),b6(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,vn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Xp(r[0])?vn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),mo(i)!==i&&o(mo(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function r6(e){const t=Ps(),n=t&&t.ce;return n||null}function hge(){const e=r6();return e&&e.shadowRoot}function mge(e="$style"){{const t=Ps();if(!t)return Kt;const n=t.type.__cssModules;if(!n)return Kt;const s=n[e];return s||Kt}}const Vx=new WeakMap,Kx=new WeakMap,ap=Symbol("_moveCb"),Ub=Symbol("_enterCb"),l6=e=>(delete e.props.mode,e),a6=l6({name:"TransitionGroup",props:vn({},Wx,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ps(),s=sx();let o,i;return o0(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!p6(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(u6),o.forEach(d6);const l=o.filter(f6);Dv(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ai(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[ap]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[ap]=null,Nr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=en(e),l=zx(r);let a=r.tag||Oe;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),Yr(u,Lu(u,l,s,n)),Vx.set(u,Gx(u.el)))}i=t.default?n0(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Yr(u,Lu(u,l,s,n))}return ie(a,null,i)}}}),c6=a6;function u6(e){const t=e.el;t[ap]&&t[ap](),t[Ub]&&t[Ub]()}function d6(e){Kx.set(e,Gx(e.el))}function f6(e){const t=Vx.get(e),n=Kx.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function Gx(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function p6(e,t,n){const s=e.cloneNode(),o=e[rc];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=Ux(s);return i.removeChild(s),r}const Zr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return bt(t)?n=>Va(t,n):t};function h6(e){e.target.composing=!0}function jb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const si=Symbol("_assign");function qb(e,t,n){return t&&(e=e.trim()),n&&(e=th(e)),e}const lo={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[si]=Zr(o);const i=s||o.props&&o.props.type==="number";Xi(e,t?"change":"input",r=>{r.target.composing||e[si](qb(e.value,n,i))}),(n||i)&&Xi(e,"change",()=>{e.value=qb(e.value,n,i)}),t||(Xi(e,"compositionstart",h6),Xi(e,"compositionend",jb),Xi(e,"change",jb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[si]=Zr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?th(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},cp={deep:!0,created(e,t,n){e[si]=Zr(n),Xi(e,"change",()=>{const s=e._modelValue,o=lc(e),i=e.checked,r=e[si];if(bt(s)){const l=sh(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(Xl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(Qx(e,i))})},mounted:Vb,beforeUpdate(e,t,n){e[si]=Zr(n),Vb(e,t,n)}};function Vb(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(bt(t))o=sh(t,s.props.value)>-1;else if(Xl(t))o=t.has(s.props.value);else{if(t===n)return;o=or(t,Qx(e,!0))}e.checked!==o&&(e.checked=o)}const Yx={created(e,{value:t},n){e.checked=or(t,n.props.value),e[si]=Zr(n),Xi(e,"change",()=>{e[si](lc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[si]=Zr(s),t!==n&&(e.checked=or(t,s.props.value))}},Fv={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Xl(t);Xi(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?th(lc(r)):lc(r));e[si](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[si]=Zr(s)},mounted(e,{value:t}){Kb(e,t)},beforeUpdate(e,t,n){e[si]=Zr(n)},updated(e,{value:t}){e._assigning||Kb(e,t)}};function Kb(e,t){const n=e.multiple,s=bt(t);if(!(n&&!s&&!Xl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=lc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=sh(t,l)>-1}else r.selected=t.has(l);else if(or(lc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function lc(e){return"_value"in e?e._value:e.value}function Qx(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const m6={created(e,t,n){Xd(e,t,n,null,"created")},mounted(e,t,n){Xd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Xd(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Xd(e,t,n,s,"updated")}};function Xx(e,t){switch(e){case"SELECT":return Fv;case"TEXTAREA":return lo;default:switch(t){case"checkbox":return cp;case"radio":return Yx;default:return lo}}}function Xd(e,t,n,s,o){const r=Xx(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function g6(){lo.getSSRProps=({value:e})=>({value:e}),Yx.getSSRProps=({value:e},t)=>{if(t.props&&or(t.props.value,e))return{checked:!0}},cp.getSSRProps=({value:e},t)=>{if(bt(e)){if(t.props&&sh(e,t.props.value)>-1)return{checked:!0}}else if(Xl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},m6.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=Xx(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const v6=["ctrl","shift","alt","meta"],y6={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)=>v6.some(n=>e[`${n}Key`]&&!t.includes(n))},vt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=y6[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},k6={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},pi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=mo(o.key);if(t.some(r=>r===i||k6[r]===i))return e(o)}))},Zx=vn({patchProp:t6},F$);let pu,Gb=!1;function Jx(){return pu||(pu=y$(Zx))}function eA(){return pu=Gb?pu:k$(Zx),Gb=!0,pu}const b6=((...e)=>{Jx().render(...e)}),gge=((...e)=>{eA().hydrate(...e)}),up=((...e)=>{const t=Jx().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=nA(s);if(!o)return;const i=t._component;!Et(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,tA(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),_6=((...e)=>{const t=eA().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=nA(s);if(o)return n(o,!0,tA(o))},t});function tA(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function nA(e){return Cn(e)?document.querySelector(e):e}let Yb=!1;const vge=()=>{Yb||(Yb=!0,g6(),j$())};/*!
|
|
21
|
+
* shared v11.4.5
|
|
22
|
+
* (c) 2026 kazuya kawaguchi
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/function w6(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const dp=typeof window<"u",ol=(e,t=!1)=>t?Symbol.for(e):Symbol(e),S6=(e,t,n)=>C6({l:e,k:t,s:n}),C6=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ds=e=>typeof e=="number"&&isFinite(e),sA=e=>v0(e)==="[object Date]",ac=e=>v0(e)==="[object RegExp]",hh=e=>Yt(e)&&Object.keys(e).length===0,ps=Object.assign,x6=Object.create,Sn=(e=null)=>x6(e);let Qb;const Pl=()=>Qb||(Qb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Sn());function Xb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function A6(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const T6=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,M6=/^(?:href|src|action|formaction)$/i;function g0(e){return T6.test(e)}function E6(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.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(s,i),n+=g0(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function Zb(e,t){if(M6.test(e)&&g0(t))return"about:blank";const n=e.toLowerCase()==="style"?E6(t):t;return A6(n)}function I6(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${Zb(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${Zb(s,o)}'`),/\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,s,o)=>g0(o)?`${s}about:blank`:n),e}const $6=Object.prototype.hasOwnProperty;function ti(e,t){return $6.call(e,t)}const Jn=Array.isArray,Un=e=>typeof e=="function",ht=e=>typeof e=="string",sn=e=>typeof e=="boolean",on=e=>e!==null&&typeof e=="object",N6=e=>on(e)&&Un(e.then)&&Un(e.catch),oA=Object.prototype.toString,v0=e=>oA.call(e),Yt=e=>v0(e)==="[object Object]",L6=e=>e==null?"":Jn(e)||Yt(e)&&e.toString===oA?JSON.stringify(e,null,2):String(e);function y0(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Zd=e=>!on(e)||Jn(e);function Tf(e,t){if(Zd(e)||Zd(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(on(s[i])&&!on(o[i])&&(o[i]=Array.isArray(s[i])?[]:Sn()),Zd(o[i])||Zd(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
|
|
25
|
+
* message-compiler v11.4.5
|
|
26
|
+
* (c) 2026 kazuya kawaguchi
|
|
27
|
+
* Released under the MIT License.
|
|
28
|
+
*/function O6(e,t,n){return{line:e,column:t,offset:n}}function Hv(e,t,n){return{start:e,end:t}}const dn={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},P6=17;function mh(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function R6(e){throw e}const Ci=" ",D6="\r",Fs=`
|
|
29
|
+
`,B6="\u2028",F6="\u2029";function H6(e){const t=e;let n=0,s=1,o=1,i=0;const r=I=>t[I]===D6&&t[I+1]===Fs,l=I=>t[I]===Fs,a=I=>t[I]===F6,c=I=>t[I]===B6,u=I=>r(I)||l(I)||a(I)||c(I),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=I=>r(I)||a(I)||c(I)?Fs:t[I],_=()=>m(n),b=()=>m(n+i);function g(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,s=1,o=1,i=0}function T(I=0){i=I}function P(){const I=n+i;for(;I!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:_,currentPeek:b,next:g,peek:v,reset:y,resetPeek:T,skipToPeek:P}}const zi=void 0,W6=".",Jb="'",z6="tokenizer";function U6(e,t={}){const n=t.location!==!1,s=H6(e),o=()=>s.index(),i=()=>O6(s.line(),s.column(),s.index()),r=i(),l=o(),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,ee,fe,...ke){const Ae=c();if(ee.column+=fe,ee.offset+=fe,u){const Ie=n?Hv(Ae.startLoc,ee):null,de=mh(j,Ie,{domain:z6,args:ke});u(de)}}function f(j,ee,fe){j.endLoc=i(),j.currentType=ee;const ke={type:ee};return n&&(ke.loc=Hv(j.startLoc,j.endLoc)),fe!=null&&(ke.value=fe),ke}const h=j=>f(j,13);function p(j,ee){return j.currentChar()===ee?(j.next(),ee):(d(dn.EXPECTED_TOKEN,i(),0,ee),"")}function m(j){let ee="";for(;j.currentPeek()===Ci||j.currentPeek()===Fs;)ee+=j.currentPeek(),j.peek();return ee}function _(j){const ee=m(j);return j.skipToPeek(),ee}function b(j){if(j===zi)return!1;const ee=j.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee===95}function g(j){if(j===zi)return!1;const ee=j.charCodeAt(0);return ee>=48&&ee<=57}function v(j,ee){const{currentType:fe}=ee;if(fe!==2)return!1;m(j);const ke=b(j.currentPeek());return j.resetPeek(),ke}function y(j,ee){const{currentType:fe}=ee;if(fe!==2)return!1;m(j);const ke=j.currentPeek()==="-"?j.peek():j.currentPeek(),Ae=g(ke);return j.resetPeek(),Ae}function T(j,ee){const{currentType:fe}=ee;if(fe!==2)return!1;m(j);const ke=j.currentPeek()===Jb;return j.resetPeek(),ke}function P(j,ee){const{currentType:fe}=ee;if(fe!==7)return!1;m(j);const ke=j.currentPeek()===".";return j.resetPeek(),ke}function I(j,ee){const{currentType:fe}=ee;if(fe!==8)return!1;m(j);const ke=b(j.currentPeek());return j.resetPeek(),ke}function k(j,ee){const{currentType:fe}=ee;if(!(fe===7||fe===11))return!1;m(j);const ke=j.currentPeek()===":";return j.resetPeek(),ke}function M(j,ee){const{currentType:fe}=ee;if(fe!==9)return!1;const ke=()=>{const Ie=j.currentPeek();return Ie==="{"?b(j.peek()):Ie==="@"||Ie==="|"||Ie===":"||Ie==="."||Ie===Ci||!Ie?!1:Ie===Fs?(j.peek(),ke()):L(j,!1)},Ae=ke();return j.resetPeek(),Ae}function $(j){m(j);const ee=j.currentPeek()==="|";return j.resetPeek(),ee}function L(j,ee=!0){const fe=(Ae=!1,Ie="")=>{const de=j.currentPeek();return de==="{"||de==="@"||!de?Ae:de==="|"?!(Ie===Ci||Ie===Fs):de===Ci?(j.peek(),fe(!0,Ci)):de===Fs?(j.peek(),fe(!0,Fs)):!0},ke=fe();return ee&&j.resetPeek(),ke}function S(j,ee){const fe=j.currentChar();return fe===zi?zi:ee(fe)?(j.next(),fe):null}function E(j){const ee=j.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee>=48&&ee<=57||ee===95||ee===36}function D(j){return S(j,E)}function R(j){const ee=j.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee>=48&&ee<=57||ee===95||ee===36||ee===45}function H(j){return S(j,R)}function U(j){const ee=j.charCodeAt(0);return ee>=48&&ee<=57}function G(j){return S(j,U)}function Q(j){const ee=j.charCodeAt(0);return ee>=48&&ee<=57||ee>=65&&ee<=70||ee>=97&&ee<=102}function V(j){return S(j,Q)}function re(j){let ee="",fe="";for(;ee=G(j);)fe+=ee;return fe}function pe(j){let ee="";for(;;){const fe=j.currentChar();if(fe==="\\"){const ke=j.peek();ke==="{"||ke==="}"||ke==="@"||ke==="|"||ke==="\\"?(ee+=fe+ke,j.next(),j.next()):(j.resetPeek(),ee+=fe,j.next())}else{if(fe==="{"||fe==="}"||fe==="@"||fe==="|"||!fe)break;if(fe===Ci||fe===Fs)if(L(j))ee+=fe,j.next();else{if($(j))break;ee+=fe,j.next()}else ee+=fe,j.next()}}return ee}function ne(j){_(j);let ee="",fe="";for(;ee=H(j);)fe+=ee;const ke=j.currentChar();if(ke&&ke!=="}"&&ke!==zi&&ke!==Ci&&ke!==Fs&&ke!==" "){const Ae=z(j);return d(dn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,fe+Ae),fe+Ae}return j.currentChar()===zi&&d(dn.UNTERMINATED_CLOSING_BRACE,i(),0),fe}function X(j){_(j);let ee="";return j.currentChar()==="-"?(j.next(),ee+=`-${re(j)}`):ee+=re(j),j.currentChar()===zi&&d(dn.UNTERMINATED_CLOSING_BRACE,i(),0),ee}function he(j){return j!==Jb&&j!==Fs}function Pe(j){_(j),p(j,"'");let ee="",fe="";for(;ee=S(j,he);)ee==="\\"?fe+=je(j):fe+=ee;const ke=j.currentChar();return ke===Fs||ke===zi?(d(dn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ke===Fs&&(j.next(),p(j,"'")),fe):(p(j,"'"),fe)}function je(j){const ee=j.currentChar();switch(ee){case"\\":case"'":return j.next(),`\\${ee}`;case"u":return it(j,ee,4);case"U":return it(j,ee,6);default:return d(dn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,ee),""}}function it(j,ee,fe){p(j,ee);let ke="";for(let Ae=0;Ae<fe;Ae++){const Ie=V(j);if(!Ie){d(dn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${ee}${ke}${j.currentChar()}`);break}ke+=Ie}return`\\${ee}${ke}`}function ce(j){return j!=="{"&&j!=="}"&&j!==Ci&&j!==Fs}function z(j){_(j);let ee="",fe="";for(;ee=S(j,ce);)fe+=ee;return fe}function Y(j){let ee="",fe="";for(;ee=D(j);)fe+=ee;return fe}function oe(j){const ee=fe=>{const ke=j.currentChar();return ke==="{"||ke==="@"||ke==="|"||ke==="("||ke===")"||!ke||ke===Ci?fe:(fe+=ke,j.next(),ee(fe))};return ee("")}function W(j){_(j);const ee=p(j,"|");return _(j),ee}function Z(j,ee){let fe=null;switch(j.currentChar()){case"{":return ee.braceNest>=1&&d(dn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),fe=f(ee,2,"{"),_(j),ee.braceNest++,fe;case"}":return ee.braceNest>0&&ee.currentType===2&&d(dn.EMPTY_PLACEHOLDER,i(),0),j.next(),fe=f(ee,3,"}"),ee.braceNest--,ee.braceNest>0&&_(j),ee.inLinked&&ee.braceNest===0&&(ee.inLinked=!1),fe;case"@":return ee.braceNest>0&&d(dn.UNTERMINATED_CLOSING_BRACE,i(),0),fe=ue(j,ee)||h(ee),ee.braceNest=0,fe;default:{let Ae=!0,Ie=!0,de=!0;if($(j))return ee.braceNest>0&&d(dn.UNTERMINATED_CLOSING_BRACE,i(),0),fe=f(ee,1,W(j)),ee.braceNest=0,ee.inLinked=!1,fe;if(ee.braceNest>0&&(ee.currentType===4||ee.currentType===5||ee.currentType===6))return d(dn.UNTERMINATED_CLOSING_BRACE,i(),0),ee.braceNest=0,ae(j,ee);if(Ae=v(j,ee))return fe=f(ee,4,ne(j)),_(j),fe;if(Ie=y(j,ee))return fe=f(ee,5,X(j)),_(j),fe;if(de=T(j,ee))return fe=f(ee,6,Pe(j)),_(j),fe;if(!Ae&&!Ie&&!de)return fe=f(ee,12,z(j)),d(dn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,fe.value),_(j),fe;break}}return fe}function ue(j,ee){const{currentType:fe}=ee;let ke=null;const Ae=j.currentChar();switch((fe===7||fe===8||fe===11||fe===9)&&(Ae===Fs||Ae===Ci)&&d(dn.INVALID_LINKED_FORMAT,i(),0),Ae){case"@":return j.next(),ke=f(ee,7,"@"),ee.inLinked=!0,ke;case".":return _(j),j.next(),f(ee,8,".");case":":return _(j),j.next(),f(ee,9,":");default:return $(j)?(ke=f(ee,1,W(j)),ee.braceNest=0,ee.inLinked=!1,ke):P(j,ee)||k(j,ee)?(_(j),ue(j,ee)):I(j,ee)?(_(j),f(ee,11,Y(j))):M(j,ee)?(_(j),Ae==="{"?Z(j,ee)||ke:f(ee,10,oe(j))):(fe===7&&d(dn.INVALID_LINKED_FORMAT,i(),0),ee.braceNest=0,ee.inLinked=!1,ae(j,ee))}}function ae(j,ee){let fe={type:13};if(ee.braceNest>0)return Z(j,ee)||h(ee);if(ee.inLinked)return ue(j,ee)||h(ee);switch(j.currentChar()){case"{":return Z(j,ee)||h(ee);case"}":return d(dn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(ee,3,"}");case"@":return ue(j,ee)||h(ee);default:{if($(j))return fe=f(ee,1,W(j)),ee.braceNest=0,ee.inLinked=!1,fe;if(L(j))return f(ee,0,pe(j));break}}return fe}function me(){const{currentType:j,offset:ee,startLoc:fe,endLoc:ke}=a;return a.lastType=j,a.lastOffset=ee,a.lastStartLoc=fe,a.lastEndLoc=ke,a.offset=o(),a.startLoc=i(),s.currentChar()===zi?f(a,13):ae(s,a)}return{nextToken:me,currentOffset:o,currentPosition:i,context:c}}const j6="parser",q6=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,V6=/\\([\\@{}|])/g;function K6(e,t){return t}function G6(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function Y6(e={}){const t=e.location!==!1,{onError:n}=e;function s(b,g,v,y,...T){const P=b.currentPosition();if(P.offset+=y,P.column+=y,n){const I=t?Hv(v,P):null,k=mh(g,I,{domain:j6,args:T});n(k)}}function o(b,g,v){const y={type:b};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(b,g,v,y){t&&(b.end=g,b.loc&&(b.loc.end=v))}function r(b,g){const v=b.context(),y=o(3,v.offset,v.startLoc);return y.value=g.replace(V6,K6),i(y,b.currentOffset(),b.currentPosition()),y}function l(b,g){const v=b.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(5,y,T);return P.index=parseInt(g,10),b.nextToken(),i(P,b.currentOffset(),b.currentPosition()),P}function a(b,g){const v=b.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(4,y,T);return P.key=g,b.nextToken(),i(P,b.currentOffset(),b.currentPosition()),P}function c(b,g){const v=b.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(9,y,T);return P.value=g.replace(q6,G6),b.nextToken(),i(P,b.currentOffset(),b.currentPosition()),P}function u(b){const g=b.nextToken(),v=b.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(8,y,T);return g.type!==11?(s(b,dn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),P.value="",i(P,y,T),{nextConsumeToken:g,node:P}):(g.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,xi(g)),P.value=g.value||"",i(P,b.currentOffset(),b.currentPosition()),{node:P})}function d(b,g){const v=b.context(),y=o(7,v.offset,v.startLoc);return y.value=g,i(y,b.currentOffset(),b.currentPosition()),y}function f(b){const g=b.context(),v=o(6,g.offset,g.startLoc);let y=b.nextToken();if(y.type===8){const T=u(b);v.modifier=T.node,y=T.nextConsumeToken||b.nextToken()}switch(y.type!==9&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(y)),y=b.nextToken(),y.type===2&&(y=b.nextToken()),y.type){case 10:y.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(y)),v.key=d(b,y.value||"");break;case 4:y.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(y)),v.key=a(b,y.value||"");break;case 5:y.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(y)),v.key=l(b,y.value||"");break;case 6:y.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(y)),v.key=c(b,y.value||"");break;default:{s(b,dn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const T=b.context(),P=o(7,T.offset,T.startLoc);return P.value="",i(P,T.offset,T.startLoc),v.key=P,i(v,T.offset,T.startLoc),{nextConsumeToken:y,node:v}}}return i(v,b.currentOffset(),b.currentPosition()),{node:v}}function h(b){const g=b.context(),v=g.currentType===1?b.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,T=o(2,v,y);T.items=[];let P=null;do{const M=P||b.nextToken();switch(P=null,M.type){case 0:M.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(M)),T.items.push(r(b,M.value||""));break;case 5:M.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(M)),T.items.push(l(b,M.value||""));break;case 4:M.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(M)),T.items.push(a(b,M.value||""));break;case 6:M.value==null&&s(b,dn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,xi(M)),T.items.push(c(b,M.value||""));break;case 7:{const $=f(b);T.items.push($.node),P=$.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const I=g.currentType===1?g.lastOffset:b.currentOffset(),k=g.currentType===1?g.lastEndLoc:b.currentPosition();return i(T,I,k),T}function p(b,g,v,y){const T=b.context();let P=y.items.length===0;const I=o(1,g,v);I.cases=[],I.cases.push(y);do{const k=h(b);P||(P=k.items.length===0),I.cases.push(k)}while(T.currentType!==13);return P&&s(b,dn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(I,b.currentOffset(),b.currentPosition()),I}function m(b){const g=b.context(),{offset:v,startLoc:y}=g,T=h(b);return g.currentType===13?T:p(b,v,y,T)}function _(b){const g=U6(b,ps({},e)),v=g.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=b),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(b)),v.currentType!==13&&s(g,dn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,b[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:_}}function xi(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 Q6(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function e_(e,t){for(let n=0;n<e.length;n++)k0(e[n],t)}function k0(e,t){switch(e.type){case 1:e_(e.cases,t),t.helper("plural");break;case 2:e_(e.items,t);break;case 6:{k0(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 X6(e,t={}){const n=Q6(e);n.helper("normalize"),e.body&&k0(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function Z6(e){const t=e.body;return t.type===2?t_(t):t.cases.forEach(n=>t_(n)),e}function t_(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 s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=y0(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function Ia(e){switch(e.t=e.type,e.type){case 0:{const t=e;Ia(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Ia(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Ia(n[s]);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;Ia(t.key),t.k=t.key,delete t.key,t.modifier&&(Ia(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 J6(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,_){r.code+=m}function c(m,_=!0){const b=_?s:"";a(o?b+" ".repeat(m):b)}function u(m=!0){const _=++r.indentLevel;m&&c(_)}function d(m=!0){const _=--r.indentLevel;m&&c(_)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function eN(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),cc(e,t.key),t.modifier?(e.push(", "),cc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function tN(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(cc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function nN(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(cc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function sN(e,t){t.body?cc(e,t.body):e.push("null")}function cc(e,t){const{helper:n}=e;switch(t.type){case 0:sN(e,t);break;case 1:nN(e,t);break;case 2:tN(e,t);break;case 6:eN(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 oN=(e,t={})=>{const n=ht(t.mode)?t.mode:"normal",s=ht(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
+
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=J6(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${y0(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),cc(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 iN(e,t={}){const n=ps({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=Y6(n).parse(e);return s?(i&&Z6(l),o&&Ia(l),{ast:l,code:""}):(X6(l,n),oN(l,n))}/*!
|
|
31
|
+
* core-base v11.4.5
|
|
32
|
+
* (c) 2026 kazuya kawaguchi
|
|
33
|
+
* Released under the MIT License.
|
|
34
|
+
*/function rN(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Pl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Pl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function $i(e){return on(e)&&b0(e)===0&&(ti(e,"b")||ti(e,"body"))}const iA=["b","body"];function lN(e){return il(e,iA)}const rA=["c","cases"];function aN(e){return il(e,rA,[])}const lA=["s","static"];function cN(e){return il(e,lA)}const aA=["i","items"];function uN(e){return il(e,aA,[])}const cA=["t","type"];function b0(e){return il(e,cA)}const uA=["v","value"];function Jd(e,t){const n=il(e,uA);if(n!=null)return n;throw Du(t)}const dA=["m","modifier"];function dN(e){return il(e,dA)}const fA=["k","key"];function fN(e){const t=il(e,fA);if(t)return t;throw Du(6)}function il(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(ti(e,o)&&e[o]!=null)return e[o]}return n}const pA=[...iA,...rA,...lA,...aA,...fA,...dA,...uA,...cA];function Du(e){return new Error(`unhandled node type: ${e}`)}function tg(e){return n=>pN(n,e)}function pN(e,t){const n=lN(t);if(n==null)throw Du(0);if(b0(n)===1){const i=aN(n);return e.plural(i.reduce((r,l)=>[...r,n_(e,l)],[]))}else return n_(e,n)}function n_(e,t){const n=cN(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=uN(t).reduce((o,i)=>[...o,Wv(e,i)],[]);return e.normalize(s)}}function Wv(e,t){const n=b0(t);switch(n){case 3:return Jd(t,n);case 9:return Jd(t,n);case 4:{const s=t;if(ti(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(ti(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Du(n)}case 5:{const s=t;if(ti(s,"i")&&ds(s.i))return e.interpolate(e.list(s.i));if(ti(s,"index")&&ds(s.index))return e.interpolate(e.list(s.index));throw Du(n)}case 6:{const s=t,o=dN(s),i=fN(s);return e.linked(Wv(e,i),o?Wv(e,o):void 0,e.type)}case 7:return Jd(t,n);case 8:return Jd(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const hN=e=>e;let ef=Sn();function mN(e,t={}){let n=!1;const s=t.onError||R6;return t.onError=o=>{n=!0,s(o)},{...iN(e,t),detectError:n}}function gN(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&ht(e)){sn(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||hN)(e),o=ef[s];if(o)return o;const{ast:i,detectError:r}=mN(e,{...t,location:!1,jit:!0}),l=tg(i);return r?l:ef[s]=l}else{const n=e.cacheKey;if(n){const s=ef[n];return s||(ef[n]=tg(e))}else return tg(e)}}let Bu=null;function vN(e){Bu=e}function yN(e,t,n){Bu&&Bu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const kN=bN("function:translate");function bN(e){return t=>Bu&&Bu.emit(e,t)}const Zi={INVALID_ARGUMENT:P6,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},_N=24;function Ji(e){return mh(e,null,void 0)}function _0(e,t){return t.locale!=null?s_(t.locale):s_(e.locale)}let ng;function s_(e){if(ht(e))return e;if(Un(e)){if(e.resolvedOnce&&ng!=null)return ng;if(e.constructor.name==="Function"){const t=e();if(N6(t))throw Ji(Zi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ng=t}else throw Ji(Zi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ji(Zi.NOT_SUPPORT_LOCALE_TYPE)}function wN(e,t,n){return[...new Set([n,...Jn(t)?t:on(t)?Object.keys(t):ht(t)?[t]:[n]])]}function zv(e,t,n){const s=ht(n)?n:Fu,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Jn(r);)r=o_(i,r,t);const l=Jn(t)||!Yt(t)?t:t.default?t.default:null;r=ht(l)?[l]:l,Jn(r)&&o_(i,r,!1),o.__localeChainCache.set(s,i)}return i}function o_(e,t,n){let s=!0;for(let o=0;o<t.length&&sn(s);o++){const i=t[o];ht(i)&&(s=SN(e,t[o],n))}return s}function SN(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=CN(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function CN(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(Jn(n)||Yt(n))&&n[o]&&(s=n[o])}return s}const rl=[];rl[0]={w:[0],i:[3,0],"[":[4],o:[7]};rl[1]={w:[1],".":[2],"[":[4],o:[7]};rl[2]={w:[2],i:[3,0],0:[3,0]};rl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};rl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};rl[5]={"'":[4,0],o:8,l:[5,0]};rl[6]={'"':[4,0],o:8,l:[6,0]};const xN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function AN(e){return xN.test(e)}function TN(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 MN(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 EN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:AN(t)?TN(t):"*"+t}function IN(e){const t=[];let n=-1,s=0,o=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](),o++},f[3]=()=>{if(o>0)o--,s=4,f[0]();else{if(o=0,r===void 0||(r=EN(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(s===5&&p==="'"||s===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=MN(i),d=rl[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const i_=new Map;function $N(e,t){return on(e)?e[t]:null}function NN(e,t){if(!on(e))return null;let n=i_.get(t);if(n||(n=IN(t),n&&i_.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(pA.includes(r)&&$i(o)||!on(o)||!ti(o,r))return null;const l=o[r];if(l===void 0||Un(o))return null;o=l,i++}return o}const LN="11.4.5",gh=-1,Fu="en-US",fp="",r_=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function ON(){return{upper:(e,t)=>t==="text"&&ht(e)?e.toUpperCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&ht(e)?e.toLowerCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&ht(e)?r_(e):t==="vnode"&&on(e)&&"__v_isVNode"in e?r_(e.children):e}}let hA;function PN(e){hA=e}let mA;function RN(e){mA=e}let gA;function DN(e){gA=e}let vA=null;const BN=e=>{vA=e},FN=()=>vA;let yA=null;const l_=e=>{yA=e},HN=()=>yA;let a_=0;function WN(e={}){const t=Un(e.onWarn)?e.onWarn:w6,n=ht(e.version)?e.version:LN,s=ht(e.locale)||Un(e.locale)?e.locale:Fu,o=Un(s)?Fu:s,i=Jn(e.fallbackLocale)||Yt(e.fallbackLocale)||ht(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Yt(e.messages)?e.messages:sg(o),l=Yt(e.datetimeFormats)?e.datetimeFormats:sg(o),a=Yt(e.numberFormats)?e.numberFormats:sg(o),c=ps(Sn(),e.modifiers,ON()),u=e.pluralRules||Sn(),d=Un(e.missing)?e.missing:null,f=sn(e.missingWarn)||ac(e.missingWarn)?e.missingWarn:!0,h=sn(e.fallbackWarn)||ac(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,_=Un(e.postTranslation)?e.postTranslation:null,b=Yt(e.processor)?e.processor:null,g=sn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Un(e.messageCompiler)?e.messageCompiler:hA,T=Un(e.messageResolver)?e.messageResolver:mA||$N,P=Un(e.localeFallbacker)?e.localeFallbacker:gA||wN,I=on(e.fallbackContext)?e.fallbackContext:void 0,k=e,M=on(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,$=on(k.__numberFormatters)?k.__numberFormatters:new Map,L=on(k.__meta)?k.__meta:{};a_++;const S={version:n,cid:a_,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:_,processor:b,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:T,localeFallbacker:P,fallbackContext:I,onWarn:t,__meta:L};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=M,S.__numberFormatters=$,__INTLIFY_PROD_DEVTOOLS__&&yN(S,n,L),S}const sg=e=>({[e]:Sn()});function w0(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return ht(l)?l:t}else return t}function Gc(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function zN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function UN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(zN(e,t[s]))return!0;return!1}function c_(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!ht(t[0])&&!sA(t[0])&&!ds(t[0]))return fp;const[a,c,u,d]=Uv(...t),f=sn(u.missingWarn)?u.missingWarn:e.missingWarn;sn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=_0(e,u),m=r(e,o,p);if(!ht(a)||a===""){const P=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?P.formatToParts(c):P.format(c)}let _={},b,g=null;const v="datetime format";for(let P=0;P<m.length&&(b=m[P],_=n[b]||{},g=_[a],!Yt(g));P++)w0(e,a,b,f,v);if(!Yt(g)||!ht(b))return s?gh:a;let y=`${b}__${a}`;hh(d)||(y=`${y}__${JSON.stringify(d)}`);let T=l.get(y);return T||(T=new Intl.DateTimeFormat(b,ps({},g,d)),l.set(y,T)),h?T.formatToParts(c):T.format(c)}const kA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Uv(...e){const[t,n,s,o]=e,i=Sn();let r=Sn(),l;if(ht(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Ji(Zi.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 Ji(Zi.INVALID_ISO_DATE_ARGUMENT)}}else if(sA(t)){if(isNaN(t.getTime()))throw Ji(Zi.INVALID_DATE_ARGUMENT);l=t}else if(ds(t))l=t;else throw Ji(Zi.INVALID_ARGUMENT);return ht(n)?i.key=n:Yt(n)&&Object.keys(n).forEach(a=>{kA.includes(a)?r[a]=n[a]:i[a]=n[a]}),ht(s)?i.locale=s:Yt(s)&&(r=s),Yt(o)&&(r=o),[i.key||"",l,i,r]}function u_(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function d_(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ds(t[0]))return fp;const[a,c,u,d]=jv(...t),f=sn(u.missingWarn)?u.missingWarn:e.missingWarn;sn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=_0(e,u),m=r(e,o,p);if(!ht(a)||a===""){const P=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?P.formatToParts(c):P.format(c)}let _={},b,g=null;const v="number format";for(let P=0;P<m.length&&(b=m[P],_=n[b]||{},g=_[a],!Yt(g));P++)w0(e,a,b,f,v);if(!Yt(g)||!ht(b))return s?gh:a;let y=`${b}__${a}`;hh(d)||(y=`${y}__${JSON.stringify(d)}`);let T=l.get(y);return T||(T=new Intl.NumberFormat(b,ps({},g,d)),l.set(y,T)),h?T.formatToParts(c):T.format(c)}const bA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function jv(...e){const[t,n,s,o]=e,i=Sn();let r=Sn();if(!ds(t))throw Ji(Zi.INVALID_ARGUMENT);const l=t;return ht(n)?i.key=n:Yt(n)&&Object.keys(n).forEach(a=>{bA.includes(a)?r[a]=n[a]:i[a]=n[a]}),ht(s)?i.locale=s:Yt(s)&&(r=s),Yt(o)&&(r=o),[i.key||"",l,i,r]}function f_(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const jN=e=>e,qN=e=>"",VN="text",KN=e=>e.length===0?"":y0(e),GN=L6;function og(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function YN(e){const t=ds(e.pluralIndex)?e.pluralIndex:-1;return ds(e.named?.count)?e.named.count:ds(e.named?.n)?e.named.n:t}function QN(e={}){const t=e.locale,n=YN(e),s=ht(t)&&Un(e.pluralRules?.[t])?e.pluralRules[t]:og,o=s===og?void 0:og,i=b=>b[s(n,b.length,o)],r=e.list||[],l=b=>r[b],a=e.named||Sn();ds(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=b=>a[b];function u(b,g){const v=Un(e.messages)?e.messages(b,!!g):on(e.messages)?e.messages[b]:!1;return v||(e.parent?e.parent.message(b):qN)}const d=b=>e.modifiers?e.modifiers[b]:jN,f=Un(e.processor?.normalize)?e.processor.normalize:KN,h=Un(e.processor?.interpolate)?e.processor.interpolate:GN,p=ht(e.processor?.type)?e.processor.type:VN,_={list:l,named:c,plural:i,linked:(b,...g)=>{const[v,y]=g;let T="text",P="";g.length===1?on(v)?(P=v.modifier||P,T=v.type||T):ht(v)&&(P=v||P):g.length===2&&(ht(v)&&(P=v||P),ht(y)&&(T=y||T));const I=u(b,!0)(_),k=I===""||I===void 0?b:I,M=T==="vnode"&&Jn(k)&&P?k[0]:k;return P?d(P)(M,T):M},message:u,type:p,interpolate:h,normalize:f,values:ps(Sn(),r,a)};return _}const p_=()=>"",Zo=e=>Un(e);function h_(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=qv(...t),u=sn(c.missingWarn)?c.missingWarn:e.missingWarn,d=sn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=sn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=ht(c.default)||sn(c.default)?sn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(ht(p)||Un(p)),_=_0(e,c);f&&XN(c);let[b,g,v]=h?[a,_,l[_]||Sn()]:_A(e,a,_,r,d,u),y=b,T=a;if(!h&&!(ht(y)||$i(y)||Zo(y))&&m&&(y=p,T=y),!h&&(!(ht(y)||$i(y)||Zo(y))||!ht(g)))return o?gh:a;let P=!1;const I=()=>{P=!0},k=Zo(y)?y:wA(e,a,g,y,T,I);if(P)return y;const M=e5(e,g,v,c),$=QN(M),L=ZN(e,k,$);let S=s?s(L,a):L;if(f&&ht(S)&&(S=I6(S)),__INTLIFY_PROD_DEVTOOLS__){const E={timestamp:Date.now(),key:ht(a)?a:Zo(y)?y.key:"",locale:g||(Zo(y)?y.locale:""),format:ht(y)?y:Zo(y)?y.source:"",message:S};E.meta=ps({},e.__meta,FN()||{}),kN(E)}return S}function XN(e){Jn(e.list)?e.list=e.list.map(t=>ht(t)?Xb(t):t):on(e.named)&&Object.keys(e.named).forEach(t=>{ht(e.named[t])&&(e.named[t]=Xb(e.named[t]))})}function _A(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=Sn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||Sn(),(h=a(d,t))===null&&(h=d[t]),!(ht(h)||$i(h)||Zo(h)));m++)if(!UN(f,u)){const _=w0(e,t,f,i,p);_!==t&&(h=_)}return[h,f,d]}function wA(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Zo(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,JN(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function ZN(e,t,n){return t(n)}function qv(...e){const[t,n,s]=e,o=Sn();if(!ht(t)&&!ds(t)&&!Zo(t)&&!$i(t))throw Ji(Zi.INVALID_ARGUMENT);const i=ds(t)?String(t):(Zo(t),t);return ds(n)?o.plural=n:ht(n)?o.default=n:Yt(n)&&!hh(n)?o.named=n:Jn(n)&&(o.list=n),ds(s)?o.plural=s:ht(s)?o.default=s:Yt(s)&&ps(o,s),[i,o]}function JN(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>S6(t,n,r)}}function e5(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:o,pluralRules:i,messages:(h,p)=>{let m=r(n,h);if(m==null&&(u||p)){const[_,,b]=_A(u||e,h,t,l,a,c);m=_??r(b,h)}if(ht(m)||$i(m)){let _=!1;const g=wA(e,h,t,m,h,()=>{_=!0});return _?p_:g}else return Zo(m)?m:p_}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),ds(s.plural)&&(f.pluralIndex=s.plural),f}rN();/*!
|
|
35
|
+
* vue-i18n v11.4.5
|
|
36
|
+
* (c) 2026 kazuya kawaguchi
|
|
37
|
+
* Released under the MIT License.
|
|
38
|
+
*/const t5="11.4.5";function n5(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Pl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Pl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Pl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Pl().__INTLIFY_PROD_DEVTOOLS__=!1)}const to={UNEXPECTED_RETURN_TYPE:_N,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 go(e,...t){return mh(e,null,void 0)}const Vv=ol("__translateVNode"),Kv=ol("__datetimeParts"),Gv=ol("__numberParts"),SA=ol("__setPluralRules"),CA=ol("__injectWithOption"),Ba=ol("__dispose");function Hu(e){if(!on(e)||$i(e))return e;for(const t in e)if(ti(e,t))if(!t.includes("."))on(e[t])&&Hu(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=Sn()),!on(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||($i(o)?pA.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!$i(o)){const r=o[n[s]];on(r)&&Hu(r)}}return e}function S0(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Yt(n)?n:Jn(s)?Sn():{[e]:Sn()};if(Jn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Sn(),Tf(c,r[a])):Tf(c,r)}else ht(l)&&Tf(JSON.parse(l),r)}),o==null&&i)for(const l in r)ti(r,l)&&Hu(r[l]);return r}function xA(e){return e.type}function AA(e,t,n){let s=on(t.messages)?t.messages:Sn();"__i18nGlobal"in n&&(s=S0(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[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 m_(e){return ie(qr,null,e,0)}function Wu(){return Ps()}const g_="__INTLIFY_META__",v_=()=>[],s5=()=>!1;let y_=0;function k_(e){return((t,n,s,o)=>e(n,s,Wu()||void 0,o))}const o5=()=>{const e=Wu();let t=null;return e&&(t=xA(e)[g_])?{[g_]:t}:null};function pp(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=dp?J:Zl;let r=sn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:ht(e.locale)?e.locale:Fu),a=i(t&&r?t.fallbackLocale.value:ht(e.fallbackLocale)||Jn(e.fallbackLocale)||Yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(S0(l.value,e)),u=i(Yt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Yt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:sn(e.missingWarn)||ac(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:sn(e.fallbackWarn)||ac(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:sn(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,_=Un(e.missing)?e.missing:null,b=Un(e.missing)?k_(e.missing):null,g=Un(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:sn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const T=t?t.modifiers:Yt(e.modifiers)?e.modifiers:{};let P=e.pluralRules||t&&t.pluralRules,I;I=(()=>{s&&l_(null);const de={version:t5,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:T,pluralRules:P,missing:b===null?void 0:b,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};de.datetimeFormats=u.value,de.numberFormats=d.value,de.__datetimeFormatters=Yt(I)?I.__datetimeFormatters:void 0,de.__numberFormatters=Yt(I)?I.__numberFormatters:void 0;const Me=WN(de);return s&&l_(Me),Me})(),Gc(I,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const $=B({get:()=>l.value,set:de=>{I.locale=de,l.value=de}}),L=B({get:()=>a.value,set:de=>{I.fallbackLocale=de,a.value=de,Gc(I,l.value,de)}}),S=B(()=>c.value),E=B(()=>u.value),D=B(()=>d.value);function R(){return Un(g)?g:null}function H(de){g=de,I.postTranslation=de}function U(){return _}function G(de){de!==null&&(b=k_(de)),_=de,I.missing=b}const Q=(de,Me,Ke,lt,yt,kt)=>{M();let Tt;try{__INTLIFY_PROD_DEVTOOLS__,s||(I.fallbackContext=t?HN():void 0),Tt=de(I)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(I.fallbackContext=void 0)}if(Ke!=="translate exists"&&ds(Tt)&&Tt===gh||Ke==="translate exists"&&!Tt){const[Pt,_t]=Me();return t&&p?lt(t):yt(Pt)}else{if(kt(Tt))return Tt;throw go(to.UNEXPECTED_RETURN_TYPE)}};function V(...de){return Q(Me=>Reflect.apply(h_,null,[Me,...de]),()=>qv(...de),"translate",Me=>Reflect.apply(Me.t,Me,[...de]),Me=>Me,Me=>ht(Me))}function re(...de){const[Me,Ke,lt]=de;if(lt&&!on(lt))throw go(to.INVALID_ARGUMENT);return V(Me,Ke,ps({resolvedMessage:!0},lt||{}))}function pe(...de){return Q(Me=>Reflect.apply(c_,null,[Me,...de]),()=>Uv(...de),"datetime format",Me=>Reflect.apply(Me.d,Me,[...de]),()=>fp,Me=>ht(Me)||Jn(Me))}function ne(...de){return Q(Me=>Reflect.apply(d_,null,[Me,...de]),()=>jv(...de),"number format",Me=>Reflect.apply(Me.n,Me,[...de]),()=>fp,Me=>ht(Me)||Jn(Me))}function X(de){return de.map(Me=>ht(Me)||ds(Me)||sn(Me)?m_(String(Me)):Me)}const Pe={normalize:X,interpolate:de=>de,type:"vnode"};function je(...de){return Q(Me=>{let Ke;const lt=Me;try{lt.processor=Pe,Ke=Reflect.apply(h_,null,[lt,...de])}finally{lt.processor=null}return Ke},()=>qv(...de),"translate",Me=>Me[Vv](...de),Me=>[m_(Me)],Me=>Jn(Me))}function it(...de){return Q(Me=>Reflect.apply(d_,null,[Me,...de]),()=>jv(...de),"number format",Me=>Me[Gv](...de),v_,Me=>ht(Me)||Jn(Me))}function ce(...de){return Q(Me=>Reflect.apply(c_,null,[Me,...de]),()=>Uv(...de),"datetime format",Me=>Me[Kv](...de),v_,Me=>ht(Me)||Jn(Me))}function z(de){P=de,I.pluralRules=P}function Y(de,Me){return Q(()=>{if(!de)return!1;const Ke=ht(Me)?Me:l.value,lt=ht(Me)?[Ke]:zv(I,a.value,Ke);for(let yt=0;yt<lt.length;yt++){const kt=Z(lt[yt]);let Tt=I.messageResolver(kt,de);if(Tt===null&&(Tt=kt[de]),$i(Tt)||Zo(Tt)||ht(Tt))return!0}return!1},()=>[de],"translate exists",Ke=>Reflect.apply(Ke.te,Ke,[de,Me]),s5,Ke=>sn(Ke))}function oe(de){let Me=null;const Ke=zv(I,a.value,l.value);for(let lt=0;lt<Ke.length;lt++){const yt=c.value[Ke[lt]]||{},kt=I.messageResolver(yt,de);if(kt!=null){Me=kt;break}}return Me}function W(de){const Me=oe(de);return Me??(t?t.tm(de)||{}:{})}function Z(de){return c.value[de]||{}}function ue(de,Me){if(o){const Ke={[de]:Me};for(const lt in Ke)ti(Ke,lt)&&Hu(Ke[lt]);Me=Ke[de]}c.value[de]=Me,I.messages=c.value}function ae(de,Me){c.value[de]=c.value[de]||{};const Ke={[de]:Me};if(o)for(const lt in Ke)ti(Ke,lt)&&Hu(Ke[lt]);Me=Ke[de],Tf(Me,c.value[de]),I.messages=c.value}function me(de){return u.value[de]||{}}function j(de,Me){u.value[de]=Me,I.datetimeFormats=u.value,u_(I,de,Me)}function ee(de,Me){u.value[de]=ps(u.value[de]||{},Me),I.datetimeFormats=u.value,u_(I,de,Me)}function fe(de){return d.value[de]||{}}function ke(de,Me){d.value[de]=Me,I.numberFormats=d.value,f_(I,de,Me)}function Ae(de,Me){d.value[de]=ps(d.value[de]||{},Me),I.numberFormats=d.value,f_(I,de,Me)}y_++,t&&dp&&(Ve(t.locale,de=>{r&&(l.value=de,I.locale=de,Gc(I,l.value,a.value))}),Ve(t.fallbackLocale,de=>{r&&(a.value=de,I.fallbackLocale=de,Gc(I,l.value,a.value))}));const Ie={id:y_,locale:$,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(de){r=de,de&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Gc(I,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return T},get pluralRules(){return P||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(de){f=de,I.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(de){h=de,I.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(de){p=de},get fallbackFormat(){return m},set fallbackFormat(de){m=de,I.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(de){v=de,I.warnHtmlMessage=de},get escapeParameter(){return y},set escapeParameter(de){y=de,I.escapeParameter=de},t:V,getLocaleMessage:Z,setLocaleMessage:ue,mergeLocaleMessage:ae,getPostTranslationHandler:R,setPostTranslationHandler:H,getMissingHandler:U,setMissingHandler:G,[SA]:z};return Ie.datetimeFormats=E,Ie.numberFormats=D,Ie.rt=re,Ie.te=Y,Ie.tm=W,Ie.d=pe,Ie.n=ne,Ie.getDateTimeFormat=me,Ie.setDateTimeFormat=j,Ie.mergeDateTimeFormat=ee,Ie.getNumberFormat=fe,Ie.setNumberFormat=ke,Ie.mergeNumberFormat=Ae,Ie[CA]=n,Ie[Vv]=je,Ie[Kv]=ce,Ie[Gv]=it,Ie}function i5(e){const t=ht(e.locale)?e.locale:Fu,n=ht(e.fallbackLocale)||Jn(e.fallbackLocale)||Yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Un(e.missing)?e.missing:void 0,o=sn(e.silentTranslationWarn)||ac(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=sn(e.silentFallbackWarn)||ac(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=sn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Yt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Un(e.postTranslation)?e.postTranslation:void 0,d=ht(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=sn(e.sync)?e.sync:!0;let p=e.messages;if(Yt(e.sharedMessages)){const T=e.sharedMessages;p=Object.keys(T).reduce((I,k)=>{const M=I[k]||(I[k]={});return ps(M,T[k]),I},p||{})}const{__i18n:m,__root:_,__injectWithOption:b}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:y,datetimeFormats:g,numberFormats:v,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:_,__injectWithOption:b}}function Yv(e={}){const t=pp(i5(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},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(o){t.setMissingHandler(o)},get silentTranslationWarn(){return sn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=sn(o)?!o:o},get silentFallbackWarn(){return sn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=sn(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function r5(e,t,n){return{beforeCreate(){const s=Wu();if(!s)throw go(to.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=b_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Yv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=b_(e,o);else{this.$i18n=Yv({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&AA(t,o,o),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(s,this.$i18n)},mounted(){},unmounted(){const s=Wu();if(!s)throw go(to.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function b_(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[SA](t.pluralizationRules||e.pluralizationRules);const n=S0(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const C0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function l5({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Oe?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Sn())}function TA(){return Oe}const a5=qe({name:"i18n-t",props:ps({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ds(e)||!isNaN(e)}},C0),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||At({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Sn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=ht(e.plural)?+e.plural:e.plural);const u=l5(t,a);return o[Vv](e.keypath,u,c)},r=ps(Sn(),s),l=ht(e.tag)||on(e.tag)?e.tag:TA();return on(l)?fn(l,r,{default:i}):fn(l,r,i())}}}),__=a5;function c5(e){return Jn(e)&&!ht(e[0])}function MA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Sn();e.locale&&(c.locale=e.locale),ht(e.format)?c.key=e.format:on(e.format)&&(ht(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?ps(Sn(),h,{[p]:e.format[p]}):h,Sn()));const d=s(e.value,c,u);let f=[c.key];return Jn(d)?f=d.map((h,p)=>{const m=o[h.type],_=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return c5(_)&&(_[0].key=`${h.type}-${p}`),_}):ht(d)&&(f=[d]),f},l=ps(Sn(),i),a=ht(e.tag)||on(e.tag)?e.tag:TA();return on(a)?fn(a,l,{default:r}):fn(a,l,r())}}const u5=qe({name:"i18n-n",props:ps({value:{type:Number,required:!0},format:{type:[String,Object]}},C0),setup(e,t){const n=e.i18n||At({useScope:e.scope,__useComponent:!0});return MA(e,t,bA,(...s)=>n[Gv](...s))}}),w_=u5;function d5(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function f5(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw go(to.UNEXPECTED_ERROR);const c=d5(e,l.$),u=S_(a);return[Reflect.apply(c.t,c,[...C_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);dp&&(r.__i18nWatcher=Ve(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{dp&&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=S_(l);r.textContent=Reflect.apply(a.t,a,[...C_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function S_(e){if(ht(e))return{path:e};if(Yt(e)){if(!("path"in e))throw go(to.REQUIRED_VALUE,"path");return e}else throw go(to.INVALID_VALUE)}function C_(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return ht(n)&&(r.locale=n),ds(o)&&(r.plural=o),ds(i)&&(r.plural=i),[t,l,r]}function p5(e,t,...n){const s=Yt(n[0])?n[0]:{};(sn(s.globalInstall)?s.globalInstall:!0)&&([__.name,"I18nT"].forEach(i=>e.component(i,__)),[w_.name,"I18nN"].forEach(i=>e.component(i,w_)),[T_.name,"I18nD"].forEach(i=>e.component(i,T_))),e.directive("t",f5(t))}const h5=ol("global-vue-i18n");function m5(e={}){const t=__VUE_I18N_LEGACY_API__&&sn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=sn(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=g5(e,t),r=ol("");function l(d){return s.get(d)||null}function a(d,f){s.set(d,f)}function c(d){s.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),Yt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=S5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&p5(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(r5(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function At(e={}){const t=Wu();if(t==null)throw go(to.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw go(to.NOT_INSTALLED);const n=v5(t),s=k5(n),o=xA(t),i=y5(e,o);if(i==="global")return AA(s,e,o),s;if(i==="parent"){let a=x_(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw go(to.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=ps({},e),u=x_(n,t);c.__root=u||s;const d=pp(c);return a.__composerExtend&&(d[Ba]=a.__composerExtend(d)),Q1()&&X1(()=>{const h=d[Ba];h&&(h(),delete d[Ba])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=ps({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=pp(a),r.__composerExtend&&(l[Ba]=r.__composerExtend(l)),_5(r,t,l),r.__setInstance(t,l)}return l}function g5(e,t){const n=zE(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Yv(e)):n.run(()=>pp(e));if(s==null)throw go(to.UNEXPECTED_ERROR);return[n,s]}function v5(e){const t=jt(e.isCE?h5:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw go(e.isCE?to.NOT_INSTALLED_WITH_PROVIDE:to.UNEXPECTED_ERROR);return t}function y5(e,t){return hh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function k5(e){return e.mode==="composition"?e.global:e.global.__composer}function x_(e,t,n=!1){let s=null;const o=t.root;let i=b5(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[CA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function b5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function _5(e,t,n){yn(()=>{},t),xn(()=>{const s=n;e.__deleteInstance(t);const o=s[Ba];o&&(o(),delete s[Ba])},t)}const w5=["locale","fallbackLocale","availableLocales"],A_=["t","rt","d","n","tm","te"];function S5(e,t){const n=Object.create(null);return w5.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw go(to.UNEXPECTED_ERROR);const r=ss(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,A_.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw go(to.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,A_.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const C5=qe({name:"i18n-d",props:ps({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},C0),setup(e,t){const n=e.i18n||At({useScope:e.scope,__useComponent:!0});return MA(e,t,kA,(...s)=>n[Kv](...s))}}),T_=C5;n5();PN(gN);RN(NN);DN(zv);if(__INTLIFY_PROD_DEVTOOLS__){const e=Pl();e.__INTLIFY__=!0,vN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const x5="modulepreload",A5=function(e){return"/"+e},M_={},Js=function(t,n,s){let o=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");o=r(n.map(c=>{if(c=A5(c),c in M_)return;M_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":x5,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 o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},It={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",showWorkspacePaths:"kimi-web.show-workspace-paths",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",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 E_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function ts(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function os(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function uc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function ad(e){const t=ts(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function kc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function x0(){const e=ts(It.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function A0(e){const n={...x0()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];os(It.unread,JSON.stringify(n))}function T5(){const e=ad(It.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function ig(e){kc(It.collapsedWorkspaces,Array.from(e))}function M5(){return ad(It.showWorkspacePaths)===!0}function E5(e){kc(It.showWorkspacePaths,e)}function I5(){const e=ad(It.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function EA(e){kc(It.workspaceOrder,Array.from(e))}function tf(){const e=ad(It.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,s]of Object.entries(e))typeof s=="string"&&(t[n]=s);return t}function I_(e){kc(It.workspaceNameOverrides,e)}function $5(){return ts(It.workspaceSort)}function IA(e){os(It.workspaceSort,e)}const $_=It.clientId,N5="kimi-code-web",L5="web";function O5(){return{serverHttpUrl:R5(),clientId:H5(),clientName:N5,clientVersion:W5(),clientUiMode:L5}}function P5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function R5(e){const t=P5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function D5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function B5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return D5(e)}function hu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function F5(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 H5(){const e=ts($_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return os($_,t),t}function W5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function js(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 z5(e)}function z5(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 U5(e,t){if(e.length===0)return null;const n=new Set(e),s=t.filter(i=>n.has(i)),o=e.filter(i=>!t.includes(i));return o.length===0&&s.length===t.length?null:[...o,...s]}function j5(e,t){const n=new Map(t.map((s,o)=>[s,o]));return e.toSorted((s,o)=>(n.get(s.id)??-1)-(n.get(o.id)??-1))}function q5(e,t,n,s="before"){const o=e.indexOf(t),i=e.indexOf(n);if(o===-1||i===-1||o===i)return e;const r=[...e];r.splice(o,1);const l=o<i?i-1:i,a=s==="before"?l:l+1;return r.splice(a,0,t),r}function V5(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const K5={"&":"&","<":"<",">":">",'"':""","'":"'"};function N_(e){return e.replace(/[&<>"']/g,t=>K5[t]??t)}function G5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y5(e,t,n=40){const s=e.replace(/\s+/g," ").trim();if(s.length===0)return"";const o=t.trim();if(o.length===0)return L_(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return L_(s,n*2);const r=Math.max(0,i-n),l=Math.min(s.length,i+o.length+n),a=r>0,c=l<s.length;return`${a?"…":""}${s.slice(r,l)}${c?"…":""}`}function L_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function rg(e,t){const n=N_(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(G5(N_(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const $a=J(0),Q5=["type","disabled","aria-label"],X5=qe({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=J();return t({el:n}),(s,o)=>(w(),N("button",{ref_key:"el",ref:n,class:Re(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Nn(s.$slots,"default",{},void 0,!0)],10,Q5))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},wn=dt(X5,[["__scopeId","data-v-321e56e3"]]),Z5=Object.freeze({left:0,top:0,width:16,height:16}),$A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),NA=Object.freeze({...Z5,...$A}),yge=Object.freeze({...NA,body:"",hidden:!1}),J5=Object.freeze({width:null,height:null}),e8=Object.freeze({...J5,...$A}),t8=/(-?[0-9.]*[0-9]+[0-9.]*)/g,n8=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function O_(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const s=e.split(t8);if(s===null||!s.length)return e;const o=[];let i=s.shift(),r=n8.test(i);for(;;){if(r){const l=parseFloat(i);isNaN(l)?o.push(i):o.push(Math.ceil(l*t*n)/n)}else o.push(i);if(i=s.shift(),i===void 0)return o.join("");r=!r}}function s8(e,t="defs"){let n="";const s=e.indexOf("<"+t);for(;s>=0;){const o=e.indexOf(">",s),i=e.indexOf("</"+t);if(o===-1||i===-1)break;const r=e.indexOf(">",i);if(r===-1)break;n+=e.slice(o+1,i).trim(),e=e.slice(0,s).trim()+e.slice(r+1)}return{defs:n,content:e}}function o8(e,t){return e?"<defs>"+e+"</defs>"+t:t}function i8(e,t,n){const s=s8(e);return o8(s.defs,t+s.content+n)}const r8=e=>e==="unset"||e==="undefined"||e==="none";function l8(e,t){const n={...NA,...e},s={...e8,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,s].forEach(m=>{const _=[],b=m.hFlip,g=m.vFlip;let v=m.rotate;b?g?v+=2:(_.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),_.push("scale(-1 1)"),o.top=o.left=0):g&&(_.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),_.push("scale(1 -1)"),o.top=o.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=o.height/2+o.top,_.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:_.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,_.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),_.length&&(i=i8(i,'<g transform="'+_.join(" ")+'">',"</g>"))});const r=s.width,l=s.height,a=o.width,c=o.height;let u,d;r===null?(d=l===null?"1em":l==="auto"?c:l,u=O_(d,a/c)):(u=r==="auto"?a:r,d=l===null?O_(u,c/a):l==="auto"?c:l);const f={},h=(m,_)=>{r8(_)||(f[m]=_.toString())};h("width",u),h("height",d);const p=[o.left,o.top,a,c];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:i}}const LA={plus:{body:'<path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/>',width:24,height:24},"chat-new":{body:'<path fill="currentColor" d="M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"/>',width:24,height:24},close:{body:'<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"/>',width:24,height:24},check:{body:'<path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/>',width:24,height:24},search:{body:'<path fill="currentColor" d="m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"/>',width:24,height:24},copy:{body:'<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"/>',width:24,height:24},link:{body:'<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"/>',width:24,height:24},"external-link":{body:'<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"/>',width:24,height:24},download:{body:'<path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/>',width:24,height:24},undo:{body:'<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"/>',width:24,height:24},send:{body:'<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"/>',width:24,height:24},image:{body:'<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"/>',width:24,height:24},settings:{body:'<path fill="currentColor" d="M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},sliders:{body:'<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"/>',width:24,height:24},"log-in":{body:'<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"/>',width:24,height:24},"chevron-down":{body:'<path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/>',width:24,height:24},"chevron-right":{body:'<path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/>',width:24,height:24},"arrow-up":{body:'<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"/>',width:24,height:24},"arrow-down":{body:'<path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/>',width:24,height:24},"arrow-right":{body:'<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"/>',width:24,height:24},minus:{body:'<path fill="currentColor" d="M5 11v2h14v-2z"/>',width:24,height:24},"panel-collapse":{body:'<path fill="currentColor" d="m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"/>',width:24,height:24},"panel-expand":{body:'<path fill="currentColor" d="m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"/>',width:24,height:24},expand:{body:'<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"/>',width:24,height:24},collapse:{body:'<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"/>',width:24,height:24},list:{body:'<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"/>',width:24,height:24},sort:{body:'<path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/>',width:24,height:24},grip:{body:'<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"/>',width:24,height:24},folder:{body:'<path fill="currentColor" d="M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"/>',width:24,height:24},"folder-closed":{body:'<path fill="currentColor" d="M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 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"/>',width:24,height:24},"folder-plus":{body:'<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"/>',width:24,height:24},"folder-solid":{body:'<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"/>',width:24,height:24},file:{body:'<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"/>',width:24,height:24},"file-text":{body:'<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"/>',width:24,height:24},"file-plus":{body:'<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"/>',width:24,height:24},"file-off":{body:'<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"/>',width:24,height:24},"image-off":{body:'<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"/>',width:24,height:24},code:{body:'<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"/>',width:24,height:24},terminal:{body:'<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"/>',width:24,height:24},pencil:{body:'<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"/>',width:24,height:24},tool:{body:'<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"/>',width:24,height:24},glob:{body:'<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"/>',width:24,height:24},globe:{body:'<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"/>',width:24,height:24},"check-list":{body:'<path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},bolt:{body:'<path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/>',width:24,height:24},"git-pull-request":{body:'<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"/>',width:24,height:24},message:{body:'<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"/>',width:24,height:24},mail:{body:'<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"/>',width:24,height:24},user:{body:'<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"/>',width:24,height:24},info:{body:'<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"/>',width:24,height:24},"help-circle":{body:'<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"/>',width:24,height:24},"alert-triangle":{body:'<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"/>',width:24,height:24},clock:{body:'<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"/>',width:24,height:24},sparkles:{body:'<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"/>',width:24,height:24},play:{body:'<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"/>',width:24,height:24},stop:{body:'<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"/>',width:24,height:24},star:{body:'<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"/>',width:24,height:24},"star-outline":{body:'<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"/>',width:24,height:24},"dots-horizontal":{body:'<path fill="currentColor" d="M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"/>',width:24,height:24}},OA={sm:14,md:16,lg:20};function a8(e){return`0 0 ${e.width??24} ${e.height??24}`}const c8=Object.fromEntries(Object.entries(LA).map(([e,t])=>[e,{body:t.body,viewBox:a8(t),fill:!0}]));function u8(e){return c8[e]}function Na(e,t="md"){const n=OA[t],s=l8(LA[e],{width:n,height:n}),o=s.attributes.viewBox;return`<svg class="kw-icon" width="${n}" height="${n}" viewBox="${o}" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${s.body}</svg>`}const d8=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],f8=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Xe=qe({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=B(()=>u8(t.name)),s=B(()=>OA[t.size]),o=B(()=>n.value.viewBox??"0 0 16 16");return(i,r)=>n.value.fill?(w(),N("svg",{key:0,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"currentColor","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,d8)):(w(),N("svg",{key:1,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,f8))}}),p8={key:0,class:"ui-dialog__head"},h8={class:"ui-dialog__titles"},m8={key:0,class:"ui-dialog__title"},g8={key:1,class:"ui-dialog__desc"},v8={class:"ui-dialog__body"},y8={key:1,class:"ui-dialog__foot"},k8='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',b8=qe({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=J(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(k8)):[]}function a(u){if(!n.open)return;if(u.key==="Escape"&&n.closeOnEsc){u.preventDefault(),r();return}if(u.key!=="Tab")return;const d=l(),f=d[0],h=d[d.length-1];if(!f||!h){u.preventDefault(),o.value?.focus();return}const p=document.activeElement;u.shiftKey&&p===f?(u.preventDefault(),h.focus()):!u.shiftKey&&p===h&&(u.preventDefault(),f.focus())}function c(u){n.closeOnOverlay&&u.target===u.currentTarget&&r()}return Ve(()=>n.open,async u=>{u?($a.value+=1,i=document.activeElement,await mt(),(l()[0]??o.value)?.focus()):($a.value=Math.max(0,$a.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),fs(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&($a.value=Math.max(0,$a.value-1))}),(u,d)=>(w(),ye(uh,{to:"body"},[e.open?(w(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[x("div",{ref_key:"panel",ref:o,class:Re(["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||u.$slots.head?(w(),N("div",p8,[Nn(u.$slots,"head",{},()=>[x("div",h8,[e.title?(w(),N("div",m8,O(e.title),1)):le("",!0),e.description?(w(),N("div",g8,O(e.description),1)):le("",!0)])],!0),ie(wn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:be(()=>[ie(Xe,{name:"close",size:"md"})]),_:1})])):le("",!0),x("div",v8,[Nn(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),N("div",y8,[Nn(u.$slots,"foot",{},void 0,!0)])):le("",!0)],2)],32)):le("",!0)]))}}),dr=dt(b8,[["__scopeId","data-v-7904ff48"]]),_8={class:"sd-head"},w8=["placeholder","aria-label"],S8=["aria-selected","onClick","onMousemove"],C8={class:"sd-meta"},x8=["innerHTML"],A8={class:"sd-time"},T8=["innerHTML"],M8=["innerHTML"],E8={key:1,class:"sd-empty"},I8={class:"sd-hint"},$8=200,N8=qe({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=J(!0),r=J(""),l=J(null),a=J(null),c=B(()=>{const b=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",T=v.lastPrompt??"",P=v.workspaceName??"",I=b.length>0&&y.toLowerCase().includes(b),k=b.length>0&&T.toLowerCase().includes(b),M=b.length>0&&P.toLowerCase().includes(b);if(!(b.length>0&&!I&&!k&&!M)&&(g.push({session:v,inTitle:I,inWorkspace:M,snippetText:T?Y5(T,r.value):""}),g.length>=$8))break}return g}),u=J(0);Ve(r,()=>{u.value=0});function d(b){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,b))}async function f(){await mt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(b){u.value=d(u.value+b),f()}function p(b){o("select",b),o("close")}function m(){const b=c.value[u.value];b&&p(b.session.id)}function _(b){b.key==="ArrowDown"?(b.preventDefault(),h(1)):b.key==="ArrowUp"?(b.preventDefault(),h(-1)):b.key==="Enter"&&(b.preventDefault(),m())}return yn(()=>{l.value?.focus()}),(b,g)=>(w(),ye(dr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>o("close"))},{head:be(()=>[x("div",_8,[ie(Xe,{class:"sd-search-icon",name:"search",size:"md"}),_n(x("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:_},null,40,w8),[[lo,r.value]])])]),foot:be(()=>[x("span",I8,O(C(n)("sidebar.searchHint")),1)]),default:be(()=>[x("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),N(Oe,{key:0},tt(c.value,(v,y)=>(w(),N("button",{key:v.session.id,class:Re(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:T=>p(v.session.id),onMousemove:T=>u.value=y},[x("span",C8,[ie(Xe,{class:"sd-folder",name:"folder-closed",size:"sm"}),x("span",{class:"sd-ws",innerHTML:C(rg)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,x8),x("span",A8,O(v.session.time),1)]),x("span",{class:"sd-title",innerHTML:C(rg)(v.session.title,v.inTitle?r.value:"")},null,8,T8),v.snippetText?(w(),N("span",{key:0,class:"sd-snippet",innerHTML:C(rg)(v.snippetText,r.value)},null,8,M8)):le("",!0)],42,S8))),128)):(w(),N("div",E8,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),L8=dt(N8,[["__scopeId","data-v-a678f802"]]),O8=["aria-label"],P8=qe({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[x("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[x("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),x("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,O8))}}),ii=dt(P8,[["__scopeId","data-v-e5c5b17d"]]),R8={key:0,class:"ui-badge__dot","aria-hidden":"true"},D8=qe({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),N("span",R8)):le("",!0),Nn(t.$slots,"default",{},void 0,!0)],2))}}),Ns=dt(D8,[["__scopeId","data-v-5bc5cd6d"]]),zu=J(null);function PA(e){const t=zu.value;t&&(zu.value=null,t.resolve(e))}function B8(e){return zu.value&&PA(!1),new Promise(t=>{zu.value={...e,resolve:t}})}function ll(){return{current:zu,confirm:B8,settle:PA}}const F8=qe({__name:"Menu",setup(e,{expose:t}){const n=J();return t({el:n}),(s,o)=>(w(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Nn(s.$slots,"default",{},void 0,!0)],512))}}),Wl=dt(F8,[["__scopeId","data-v-60e6cd8d"]]),H8={key:0,class:"ui-menu-sep",role:"separator"},W8=["disabled"],z8=qe({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(w(),N("div",H8)):(w(),N("button",{key:1,class:Re(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Nn(t.$slots,"default",{},void 0,!0)],10,W8))}}),gn=dt(z8,[["__scopeId","data-v-eab8e277"]]),Sr=6,Cr=8,U8=150,j8=qe({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=J(),s=J(),o=J(!1),i=J(!1),r=J({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const _=a.getBoundingClientRect(),b=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let T=t.placement;T==="top"&&_.top-Sr-g<Cr?T="bottom":T==="bottom"&&_.bottom+Sr+g>y-Cr?T="top":T==="left"&&_.left-Sr-b<Cr?T="right":T==="right"&&_.right+Sr+b>v-Cr&&(T="left");let P=0,I=0;T==="top"?(P=_.top-Sr-g,I=_.left+_.width/2-b/2):T==="bottom"?(P=_.bottom+Sr,I=_.left+_.width/2-b/2):T==="left"?(P=_.top+_.height/2-g/2,I=_.left-Sr-b):(P=_.top+_.height/2-g/2,I=_.right+Sr),I=Math.min(Math.max(I,Cr),v-Cr-b),P=Math.min(Math.max(P,Cr),y-Cr-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(P)}px`,left:`${Math.round(I)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,mt(()=>{u(),i.value=!0})},U8))}function f(){window.clearTimeout(l),o.value=!1,i.value=!1}function h(){o.value&&f()}function p(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return yn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const _=m.firstElementChild??null;_!==a&&(f(),p(_??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),fs(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,_)=>(w(),N(Oe,null,[x("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Nn(m.$slots,"default",{},void 0,!0)],512),(w(),ye(uh,{to:"body"},[_n(x("div",{ref_key:"bubble",ref:s,class:Re(["ui-tip__bubble",{positioned:i.value}]),style:Qt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[Eo,o.value]])]))],64))}}),qt=dt(j8,[["__scopeId","data-v-4c261eb6"]]),q8={class:"row"},V8={class:"lead","aria-hidden":"true"},K8={key:1,class:"unread-dot"},G8={class:"left"},Y8=["onKeydown"],Q8={class:"act"},X8={class:"ts"},Z8={class:"menu-time"},J8=qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=At(),{confirm:o}=ll(),i=e,r=n;function l(S){const E=new Date(S);if(Number.isNaN(E.getTime()))return S;const D=R=>String(R).padStart(2,"0");return`${E.getFullYear()}-${D(E.getMonth()+1)}-${D(E.getDate())} ${D(E.getHours())}:${D(E.getMinutes())}`}const a=B(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=J(!1),u=J(null),d=J(null),f=J({});function h(S){const E=S.target;d.value?.el?.contains(E)||u.value?.el?.contains(E)||_()}function p(){const S=u.value?.el;if(!S)return;const E=d.value?.el,D=S.getBoundingClientRect(),R=4,H=8,U=E?.offsetHeight??0,G=E?.offsetWidth??0;let Q=D.bottom+R;Q+U>window.innerHeight-H&&(Q=Math.max(H,D.top-U-R));let V=D.right-G;V<H&&(V=H),f.value={top:`${Math.round(Q)}px`,left:`${Math.round(V)}px`}}async function m(S){if(S.stopPropagation(),c.value){_();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",_),await mt(),p()}function _(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",_)}xn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",_)});const b=J(!1),g=J(""),v=J(null);async function y(){_(),b.value=!0,g.value=i.session.title,await mt();try{v.value?.focus(),v.value?.select()}catch{}}function T(){const S=g.value.trim();S&&r("rename",i.session.id,S),b.value=!1}function P(){b.value=!1}const I=J(!1),k=J(!1);async function M(){const S=await js(i.session.id);I.value=S,k.value=!S,setTimeout(()=>{I.value=!1,k.value=!1,_()},1500)}function $(){_(),r("fork",i.session.id)}async function L(){_(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:_}),(S,E)=>(w(),N("div",{class:Re(["se",{on:e.active}]),onClick:E[4]||(E[4]=D=>r("select",e.session.id))},[x("div",q8,[x("span",V8,[e.session.busy?(w(),ye(ii,{key:0,size:"sm"})):e.unread?(w(),N("span",K8)):le("",!0)]),x("div",G8,[b.value?_n((w(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":E[0]||(E[0]=D=>g.value=D),class:"rename-input",onClick:E[1]||(E[1]=vt(()=>{},["stop"])),onKeydown:[pi(vt(T,["stop"]),["enter"]),pi(vt(P,["stop"]),["esc"])],onBlur:T},null,40,Y8)),[[lo,g.value]]):(w(),N("span",{key:1,class:"t",onDblclick:vt(y,["stop"])},O(e.session.title),33))]),ie(qt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:be(()=>[!b.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ye(Ns,{key:0,variant:"info",size:"sm"},{default:be(()=>[Ue(O(C(s)("workspace.awaitingAnswer")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(qt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:be(()=>[!b.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ye(Ns,{key:0,variant:"warning",size:"sm"},{default:be(()=>[Ue(O(C(s)("workspace.awaitingPermission")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(qt,{text:C(s)("workspace.abortedTitle")},{default:be(()=>[!b.value&&e.session.status==="aborted"?(w(),ye(Ns,{key:0,variant:"danger",size:"sm"},{default:be(()=>[Ue(O(C(s)("workspace.aborted")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),x("span",Q8,[x("span",X8,O(e.session.time),1),b.value?le("",!0):(w(),ye(wn,{key:0,ref_key:"kebabRef",ref:u,class:Re(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:E[2]||(E[2]=vt(D=>m(D),["stop"]))},{default:be(()=>[ie(Xe,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(w(),ye(uh,{to:"body"},[c.value?(w(),ye(Wl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Qt(f.value),onClick:E[3]||(E[3]=vt(()=>{},["stop"]))},{default:be(()=>[ie(gn,{danger:k.value,onClick:M},{default:be(()=>[Ue(O(k.value?C(s)("sidebar.copyFailed"):I.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(gn,{separator:""}),ie(gn,{onClick:y},{default:be(()=>[Ue(O(C(s)("sidebar.rename")),1)]),_:1}),ie(gn,{onClick:$},{default:be(()=>[Ue(O(C(s)("sidebar.fork")),1)]),_:1}),ie(gn,{danger:"",onClick:L},{default:be(()=>[Ue(O(C(s)("sidebar.archive")),1)]),_:1}),ie(gn,{separator:""}),x("div",Z8,O(a.value),1)]),_:1},8,["style"])):le("",!0)]))],2))}}),eL=dt(J8,[["__scopeId","data-v-08103df8"]]),tL={class:"gh-top"},nL={key:2,class:"gh-name"},sL={class:"gh-path"},oL=["inert"],iL=["disabled"],rL={class:"show-more-label"},lL={class:"show-more-label"},aL={key:2,class:"group-empty"},cL=qe({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=B({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=B(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const f=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!f.some(h=>h.id===s.activeId)){const h=s.group.sessions.find(p=>p.id===s.activeId);if(h)return[...f,h]}return f}),l=B(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(f){s.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(f,h)=>(w(),N("div",{class:Re(["group",{dragging:e.dragging}])},[x("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:h[7]||(h[7]=vt(p=>o("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>o("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>o("wsDragend"))},[x("div",tL,[e.isCollapsed(e.group.workspace.id)?(w(),ye(Xe,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ye(Xe,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),N("span",nL,O(e.group.workspace.name),1)):_n((w(),N("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=pi(p=>o("confirmRename"),["enter"])),h[2]||(h[2]=pi(p=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>o("cancelRename")),onClick:h[4]||(h[4]=vt(()=>{},["stop"]))},null,544)),[[lo,i.value]]),ie(wn,{class:Re(["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]=vt(p=>o("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:be(()=>[ie(Xe,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),ie(wn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=vt(p=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:be(()=>[ie(Xe,{name:"chat-new"})]),_:1},8,["label"])]),ie(qt,{text:e.group.workspace.root},{default:be(()=>[x("div",sL,O(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),x("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),N(Oe,null,tt(r.value,p=>(w(),ye(eL,{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]=m=>o("selectSession",m)),onRename:h[11]||(h[11]=(m,_)=>o("renameSession",m,_)),onArchive:h[12]||(h[12]=m=>o("archiveSession",m)),onFork:h[13]||(h[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[14]||(h[14]=vt(p=>o("loadMore",e.group.workspace.id),["stop"]))},[h[16]||(h[16]=x("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),x("span",rL,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,iL)):le("",!0),l.value?(w(),N("button",{key:1,class:"show-more",onClick:h[15]||(h[15]=vt(p=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=x("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),x("span",lL,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):le("",!0),e.group.sessions.length===0?(w(),N("div",aL,O(C(n)("sidebar.noSessions")),1)):le("",!0)],10,oL)],2))}}),uL=dt(cL,[["__scopeId","data-v-fd1b0444"]]),dL="kimi_desktop",fL="platform",P_="kimi-desktop",R_="kimi-desktop-platform";function pL(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(dL)?(sessionStorage.setItem(P_,"1"),e=!0):e=e||sessionStorage.getItem(P_)==="1";const s=n.get(fL);s?(sessionStorage.setItem(R_,s),t=s):t=sessionStorage.getItem(R_)}catch{}return{isDesktop:e,platform:t}}const Qv=pL(),hL=Qv.isDesktop,RA=Qv.isDesktop&&Qv.platform==="darwin",mL=["aria-label"],gL=qe({__name:"InternalBuildBanner",setup(e){const{t}=At(),n=hL;return(s,o)=>C(n)?(w(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=x("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"},[x("path",{d:"M8 2 14 13H2L8 2Z"}),x("path",{d:"M8 6v3.5"}),x("path",{d:"M8 11.5h.01"})],-1)),x("span",null,O(C(t)("app.internalBuildBanner")),1)],8,mL)):le("",!0)}}),vL=dt(gL,[["__scopeId","data-v-b5e70a09"]]),yL={class:"ch"},kL={class:"ch-brand"},bL={class:"ch-name"},_L={key:0,class:"ch-endpoint"},wL={class:"search-input"},SL={key:0,class:"empty"},CL={class:"side-section-label"},xL={class:"side-section-title"},AL={class:"side-section-actions"},TL=["onDragover","onDrop"],ML={class:"section-menu-check"},EL={class:"section-menu-check"},IL={class:"section-menu-check"},$L=1e3,NL=qe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=At(),{confirm:s}=ll(),o=!1,i="",r=e,l=t,a=J(!1),c=f()?"⌘K":"Ctrl K";function u(){l("loadAllSessions"),a.value=!0}function d(Ge){(Ge.metaKey||Ge.ctrlKey)&&Ge.key.toLowerCase()==="k"&&(Ge.preventDefault(),u())}yn(()=>window.addEventListener("keydown",d)),fs(()=>window.removeEventListener("keydown",d));function f(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Ge=navigator.userAgentData;return Ge?.platform==="macOS"||Ge?.platform==="iOS"}const h=J(!1);function p(Ge){h.value=Ge.target.scrollTop>0}const m=J(new Set(T5()));function _(Ge){return m.value.has(Ge)}function b(Ge){const Qe=new Set(m.value);Qe.has(Ge)?Qe.delete(Ge):Qe.add(Ge),m.value=Qe,ig(Qe)}function g(){const Ge=new Set(r.groups.map(Qe=>Qe.workspace.id));m.value=Ge,ig(Ge)}function v(){const Ge=new Set;m.value=Ge,ig(Ge)}const y=B(()=>r.groups.length>0&&r.groups.every(Ge=>m.value.has(Ge.workspace.id))),T=J(new Set);function P(Ge){return T.value.has(Ge)}function I(Ge){const Qe=new Set(T.value);Qe.has(Ge)?Qe.delete(Ge):Qe.add(Ge),T.value=Qe}function k(Ge){if(!T.value.has(Ge)){const Qe=new Set(T.value);Qe.add(Ge),T.value=Qe}l("loadMoreSessions",Ge)}const M=J(M5());function $(){M.value=!M.value,E5(M.value)}const L=J(null),S=J(null);function E(Ge){L.value=Ge}function D(){L.value=null,S.value=null}function R(Ge){const Qe=Ge.currentTarget.getBoundingClientRect();return Ge.clientY<Qe.top+Qe.height/2?"before":"after"}function H(Ge,Qe){L.value===null||L.value===Qe||(Ge.preventDefault(),Ge.dataTransfer&&(Ge.dataTransfer.dropEffect="move"),S.value={id:Qe,position:R(Ge)})}function U(Ge){const Qe=L.value,Dt=S.value?.id===Ge?S.value.position:"before";if(S.value=null,L.value=null,!Qe||Qe===Ge)return;const Xt=q5(r.groups.map(Zt=>Zt.workspace.id),Qe,Ge,Dt);l("reorderWorkspaces",Xt)}function G(Ge,Qe){Qe.target.closest(".gh-more, .gh-add")||b(Ge)}function Q(Ge){l("select",Ge)}const V=J(null),re=J(""),pe=J(null);function ne(){return pe}function X(Ge,Qe){V.value=Ge,re.value=Qe,mt().then(()=>pe.value?.focus())}function he(){const Ge=V.value,Qe=re.value.trim();Ge&&Qe&&l("renameWorkspace",Ge,Qe),V.value=null}function Pe(){V.value=null}function je(Ge){re.value=Ge}const it=J(!1),ce=J(null),z=J({}),Y=J(null);function oe(Ge){Y.value?.el&&!Y.value.el.contains(Ge.target)&&Z()}function W(Ge,Qe){Qe.preventDefault(),Qe.stopPropagation(),ce.value=Ge,z.value={top:`${Qe.clientY}px`,left:`${Qe.clientX}px`},it.value=!0,document.addEventListener("mousedown",oe,!0)}function Z(){it.value=!1,document.removeEventListener("mousedown",oe,!0),ce.value=null}function ue(){ce.value&&js(ce.value.root),Z()}function ae(){ce.value&&X(ce.value.id,ce.value.name),Z()}async function me(){const Ge=ce.value;Ge&&(Z(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id))}const j=J(null),ee=J(null),fe=J({}),ke=J(null);function Ae(Ge){const Qe=Ge.target;Qe.closest(".gh-more")||Qe.closest(".ws-menu")||de()}async function Ie(Ge,Qe){if(j.value===Ge.id){de();return}const Dt=Qe.currentTarget;ee.value=Ge,j.value=Ge.id,document.addEventListener("mousedown",Ae),window.addEventListener("resize",de),await mt();const Xt=ke.value?.el,Zt=Dt.getBoundingClientRect(),Jt=4,An=8,Mt=Xt?.offsetHeight??0,Yn=Xt?.offsetWidth??0;let Ht=Zt.bottom+Jt;Ht+Mt>window.innerHeight-An&&(Ht=Math.max(An,Zt.top-Mt-Jt));let ks=Zt.right-Yn;ks<An&&(ks=An),fe.value={top:`${Math.round(Ht)}px`,left:`${Math.round(ks)}px`}}function de(){j.value=null,ee.value=null,document.removeEventListener("mousedown",Ae),window.removeEventListener("resize",de)}function Me(Ge){js(Ge.root),de()}function Ke(Ge){X(Ge.id,Ge.name),de()}async function lt(Ge){de(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id)}const yt=J(!1),kt=J({}),Tt=J(null);function Pt(Ge){const Qe=Ge.target;Qe.closest(".side-section-kebab")||Qe.closest(".section-menu")||Vt()}async function _t(Ge){if(yt.value){Vt();return}const Qe=Ge.currentTarget;yt.value=!0,document.addEventListener("mousedown",Pt),window.addEventListener("resize",Vt),await mt();const Dt=Tt.value?.el,Xt=Qe.getBoundingClientRect(),Zt=4,Jt=8,An=Dt?.offsetHeight??0,Mt=Dt?.offsetWidth??0;let Yn=Xt.bottom+Zt;Yn+An>window.innerHeight-Jt&&(Yn=Math.max(Jt,Xt.top-An-Zt));let Ht=Xt.right-Mt;Ht<Jt&&(Ht=Jt),kt.value={top:`${Math.round(Yn)}px`,left:`${Math.round(Ht)}px`}}function Vt(){yt.value=!1,document.removeEventListener("mousedown",Pt),window.removeEventListener("resize",Vt)}function cn(Ge){l("setWorkspaceSortMode",Ge),Vt()}function is(){$(),Vt()}fs(()=>{document.removeEventListener("mousedown",oe,!0),document.removeEventListener("mousedown",Ae),document.removeEventListener("mousedown",Pt),window.removeEventListener("resize",de),window.removeEventListener("resize",Vt)});const Rt=J(null);let tn;function xs(){const Ge=Rt.value;Ge&&(Ge.classList.remove("blink-now"),Ge.getBoundingClientRect(),Ge.classList.add("blink-now"),clearTimeout(tn),tn=setTimeout(()=>Ge.classList.remove("blink-now"),300))}const ot=fi(()=>Js(()=>import("./DesignSystemView-uZVLgoX6.js"),__vite__mapDeps([0,1]))),Fn=J(!1);let kn,Gn=!1;function Hn(Ge){Gn=!1,clearTimeout(kn),Ge.currentTarget.setPointerCapture?.(Ge.pointerId),kn=setTimeout(()=>{Gn=!0,Fn.value=!0},$L)}function Ln(Ge){clearTimeout(kn);const Qe=Ge.currentTarget;Qe.hasPointerCapture?.(Ge.pointerId)&&Qe.releasePointerCapture(Ge.pointerId)}function rs(){if(Gn){Gn=!1;return}xs()}return fs(()=>{clearTimeout(kn)}),(Ge,Qe)=>(w(),N("aside",{class:Re(["side",{"macos-desktop":C(RA)}])},[x("div",{class:"col",style:Qt({width:e.colWidth+"px"})},[x("div",yL,[x("div",kL,[(w(),N("svg",{ref_key:"logoRef",ref:Rt,class:Re(["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:rs,onPointerdown:Hn,onPointerup:Ln,onPointercancel:Ln},[...Qe[21]||(Qe[21]=[p0('<defs data-v-23df25c5><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-23df25c5><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-23df25c5></rect><g class="ch-eyes" fill="#000" data-v-23df25c5><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-23df25c5></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-23df25c5></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-23df25c5></rect>',2)])],34)),x("span",bL,[Qe[22]||(Qe[22]=Ue("Kimi Code",-1)),C(o)?(w(),N("span",_L," · "+O(C(i)),1)):le("",!0)]),ie(vL)]),ie(wn,{size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Qe[0]||(Qe[0]=vt(Dt=>l("collapse"),["stop"]))},{default:be(()=>[ie(Xe,{name:"panel-collapse"})]),_:1},8,["label"]),ie(wn,{size:"sm",label:C(n)("settings.title"),onClick:Qe[1]||(Qe[1]=vt(Dt=>l("openSettings"),["stop"]))},{default:be(()=>[ie(Xe,{name:"settings"})]),_:1},8,["label"])]),x("button",{class:"search",type:"button",onClick:u},[ie(Xe,{class:"search-icon",name:"search"}),x("span",wL,O(C(n)("sidebar.searchShortcut",{shortcut:C(c)})),1)]),x("div",{class:Re(["btn-wrap",{"btn-wrap--scrolled":h.value}])},[x("button",{class:"btn-new-chat",type:"button",onClick:Qe[2]||(Qe[2]=vt(Dt=>l("create"),["stop"]))},[ie(Xe,{name:"chat-new"}),x("span",null,O(C(n)("sidebar.newChat")),1)]),le("",!0)],2),x("div",{class:"sessions",onScroll:p},[e.groups.length===0?(w(),N("div",SL,O(C(n)("workspace.noWorkspace")),1)):(w(),N(Oe,{key:1},[x("div",CL,[x("span",xL,O(C(n)("sidebar.workspaces")),1),x("div",AL,[ie(wn,{class:"side-section-toggle",size:"sm",label:y.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Qe[4]||(Qe[4]=vt(Dt=>y.value?v():g(),["stop"]))},{default:be(()=>[y.value?(w(),ye(Xe,{key:0,name:"expand"})):(w(),ye(Xe,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(wn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":yt.value,onClick:Qe[5]||(Qe[5]=vt(Dt=>_t(Dt),["stop"]))},{default:be(()=>[ie(Xe,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),N(Oe,null,tt(e.groups,Dt=>(w(),N("div",{key:Dt.workspace.id,class:Re(["ws-drop-target",{"drop-before":S.value?.id===Dt.workspace.id&&S.value.position==="before","drop-after":S.value?.id===Dt.workspace.id&&S.value.position==="after"}]),onDragover:Xt=>H(Xt,Dt.workspace.id),onDrop:Xt=>U(Dt.workspace.id)},[ie(uL,{group:Dt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":V.value,"rename-value":re.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":j.value,dragging:L.value===Dt.workspace.id,"is-collapsed":_,"is-expanded":P,"show-path":M.value,onGroupClick:G,onGroupContextmenu:W,onToggleWsMenu:Ie,onCreateInWorkspace:Qe[6]||(Qe[6]=Xt=>l("createInWorkspace",Xt)),onSelectSession:Q,onRenameSession:Qe[7]||(Qe[7]=(Xt,Zt)=>l("rename",Xt,Zt)),onArchiveSession:Qe[8]||(Qe[8]=Xt=>l("archive",Xt)),onForkSession:Qe[9]||(Qe[9]=Xt=>l("fork",Xt)),onLoadMore:k,onToggleExpand:I,onConfirmRename:he,onCancelRename:Pe,onUpdateRenameValue:je,onWsDragstart:E,onWsDragend:D},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","show-path"])],42,TL))),128))],64))],32)],4),it.value?(w(),ye(Wl,{key:0,ref_key:"ghMenuRef",ref:Y,class:"gh-menu",style:Qt(z.value),onClick:Qe[10]||(Qe[10]=vt(()=>{},["stop"]))},{default:be(()=>[ie(gn,{onClick:ue},{default:be(()=>[Ue(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(gn,{onClick:ae},{default:be(()=>[Ue(O(C(n)("sidebar.rename")),1)]),_:1}),ie(gn,{danger:"",onClick:me},{default:be(()=>[Ue(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),j.value!==null&&ee.value?(w(),ye(Wl,{key:1,ref_key:"wsMenuRef",ref:ke,class:"ws-menu",style:Qt(fe.value),onClick:Qe[14]||(Qe[14]=vt(()=>{},["stop"]))},{default:be(()=>[ie(gn,{onClick:Qe[11]||(Qe[11]=Dt=>Me(ee.value))},{default:be(()=>[Ue(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(gn,{separator:""}),ie(gn,{onClick:Qe[12]||(Qe[12]=Dt=>Ke(ee.value))},{default:be(()=>[Ue(O(C(n)("sidebar.rename")),1)]),_:1}),ie(gn,{separator:""}),ie(gn,{danger:"",onClick:Qe[13]||(Qe[13]=Dt=>lt(ee.value))},{default:be(()=>[Ue(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),yt.value?(w(),ye(Wl,{key:2,ref_key:"sectionMenuRef",ref:Tt,class:"section-menu",style:Qt(kt.value),onClick:Qe[18]||(Qe[18]=vt(()=>{},["stop"]))},{default:be(()=>[ie(gn,{onClick:Qe[15]||(Qe[15]=Dt=>cn("manual"))},{default:be(()=>[x("span",ML,[e.workspaceSortMode==="manual"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):le("",!0)]),Ue(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),ie(gn,{onClick:Qe[16]||(Qe[16]=Dt=>cn("recent"))},{default:be(()=>[x("span",EL,[e.workspaceSortMode==="recent"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):le("",!0)]),Ue(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1}),ie(gn,{separator:""}),ie(gn,{onClick:Qe[17]||(Qe[17]=Dt=>is())},{default:be(()=>[x("span",IL,[M.value?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):le("",!0)]),Ue(" "+O(C(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):le("",!0),a.value?(w(),ye(L8,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:Q,onClose:Qe[19]||(Qe[19]=Dt=>a.value=!1)},null,8,["sessions","active-id"])):le("",!0),(w(),ye(uh,{to:"body"},[Fn.value?(w(),ye(C(ot),{key:0,onClose:Qe[20]||(Qe[20]=Dt=>Fn.value=!1)})):le("",!0)]))],2))}}),LL=dt(NL,[["__scopeId","data-v-23df25c5"]]);function OL(e){try{const t=ts(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function PL(e,t){try{os(e,String(t))}catch{}}function RL(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(b){return Number.isFinite(b)?Math.min(VC(o),Math.max(s,Math.round(b))):n}const l=J(r(OL(t)??n)),a=J(!1);function c(b){const g=r(b);l.value=g,PL(t,g)}let u=0,d=0,f=null,h=-1;function p(b){if(!a.value)return;const g=b.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function _(b){b.preventDefault(),a.value=!0,u=b.clientX,d=r(l.value),f=b.currentTarget,h=b.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",m),f.addEventListener("pointercancel",m)}return fs(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const DL=["aria-label"],BL=qe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),{width:i,dragging:r,onPointerDown:l}=RL({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ve(i,a=>s("update:width",a)),Ve(r,a=>s("update:dragging",a)),(a,c)=>(w(),N("div",{class:Re(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[x("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,DL))}}),D_=dt(BL,[["__scopeId","data-v-ad762f1c"]]),FL={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},HL={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",internalBuildBanner:"Internal testing only"},WL={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",showWorkspacePaths:"Show workspace paths",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load more ({count})",showLess:"Show less",showAll:"Show all ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchShortcut:"Search sessions ({shortcut})",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},zL={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},UL={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",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"}},jL={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",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},qL={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},VL={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"},KL={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"},GL={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},YL={justNow:"just now"},QL={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"},XL={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},ZL={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"},JL={panelTitle:"Thinking",close:"Close"},eO={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"},tO={},nO={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"}},sO={searching:"Searching…",noMatch:"No matches"},oO={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},iO={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},rO={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"},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"},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)"}},lO={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},aO={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"},cO={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},uO={preview:"预览",confirm:"确认",cancel:"取消"},dO={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},fO={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",showWorkspacePaths:"显示工作区路径",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 ({count})",showLess:"收起",showAll:"展开 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 ({shortcut})",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},pO={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},hO={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",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:"收起"}},mO={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},gO={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},vO={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 后重试"},yO={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 关闭"},kO={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},bO={justNow:"刚刚"},_O={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:"拒绝并退出"},wO={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},SO={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:"展开"},CO={panelTitle:"思考过程",close:"关闭"},xO={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},AO={},TO={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:"无法读取这个文件"}},MO={searching:"搜索中…",noMatch:"无匹配"},EO={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},IO={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},$O={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},NO={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},LO={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},OO={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},PO={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"},RO={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},DO={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",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},BO={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},FO={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive"},HO={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},WO={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"},zO={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},UO={en:{common:FL,app:HL,sidebar:WL,workspace:zL,conversation:UL,status:jL,composer:qL,login:VL,providers:KL,model:GL,sessions:YL,approval:QL,question:XL,tasks:ZL,thinking:JL,diff:eO,fileTree:tO,filePreview:nO,mention:sO,warnings:oO,commands:iO,tools:rO,layout:lO,mobile:aO,theme:cO,onboarding:PO,settings:DO,header:FO,sideChat:WO},zh:{common:uO,app:dO,sidebar:fO,workspace:pO,conversation:hO,status:mO,composer:gO,login:vO,providers:yO,model:kO,sessions:bO,approval:_O,question:wO,tasks:SO,thinking:CO,diff:xO,fileTree:AO,filePreview:TO,mention:MO,warnings:EO,commands:IO,tools:$O,layout:NO,mobile:LO,theme:OO,onboarding:RO,settings:BO,header:HO,sideChat:zO}},DA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function jO(){const e=ts(It.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Bn=m5({legacy:!1,locale:jO(),fallbackLocale:"en",messages:UO});function BA(e){Bn.global.locale.value=e,os(It.locale,e)}const Za=Bn.global.t,qO={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"},VO={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function Jl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return VO[t]??t}function ea(e){const t=qO[Jl(e)];return t?Za(t):e}const KO={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"};function vh(e){const t=Jl(e);let n=KO[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Na(n,"sm")}const FA=80;function GO(e,t=FA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function YO(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function QO(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 rn(e){return typeof e=="string"&&e.length>0?e:void 0}function Sl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function XO(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 lg(e){return rn(e.path)??rn(e.file_path)??rn(e.filePath)??rn(e.filename)}const ZO=64;function Uu(e,t,n=!1){const s=(o,i=FA)=>n?o.trim():GO(o,i);try{const o=QO(t);if(!n&&YO(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Jl(e)){case"read":{const r=lg(o);if(!r)return i();const l=Sl(o.offset)??Sl(o.line_start)??Sl(o.start_line),a=Sl(o.limit)??Sl(o.length),c=Sl(o.line_end)??Sl(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=lg(o);return r?s(`${r} ${Za("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=lg(o);return r?s(r):i()}case"bash":{const r=rn(o.command)??rn(o.cmd)??rn(o.script);return r?s(r,ZO):i()}case"grep":case"search":{const r=rn(o.pattern)??rn(o.query)??rn(o.regex),l=rn(o.path)??rn(o.glob)??rn(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=rn(o.pattern)??rn(o.glob)??rn(o.query),l=rn(o.path)??rn(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):rn(o.path)?s(rn(o.path)):i()}case"ls":{const r=rn(o.path)??rn(o.dir)??rn(o.directory)??rn(o.cwd);return r?s(r):i()}case"web_fetch":{const r=rn(o.url)??rn(o.uri);return r?s(XO(r)):i()}case"todo":case"task":{const r=rn(o.description)??rn(o.title)??rn(o.prompt)??rn(o.name)??rn(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(Za("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function JO(e){try{switch(Jl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Za("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return Za("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Za("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const eP=qe({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=B(()=>n(t.status));return(o,i)=>(w(),N("span",{class:Re(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),ju=dt(eP,[["__scopeId","data-v-e36198e5"]]),tP=["innerHTML"],nP={class:"a"},sP={key:0,class:"p"},oP={class:"rt"},iP=["aria-label"],rP={key:0,class:"tm"},lP=["inert"],aP={class:"bb-pad"},cP=qe({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,s=jt("pinScroll",()=>{}),o=J(null);function i(){n("toggle");const r=o.value;r&&mt(()=>s(r))}return(r,l)=>(w(),N("div",{class:Re(["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"}])},[x("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(w(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,tP)):le("",!0),x("span",nP,O(e.name),1),ie(qt,{text:e.arg},{default:be(()=>[e.arg?(w(),N("span",sP,O(e.arg),1)):le("",!0)]),_:1},8,["text"]),x("span",oP,[x("span",{class:Re(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ye(Xe,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ye(ju,{key:2,status:"suspended"})):(w(),ye(ju,{key:3,status:"running"}))],10,iP),Nn(r.$slots,"trailing"),e.time?(w(),N("span",rP,O(e.time),1)):le("",!0)]),e.expandable?(w(),ye(Xe,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):le("",!0)],512),x("div",{class:Re(["bb",{open:e.open}]),inert:!e.open},[x("div",aP,[Nn(r.$slots,"default")])],10,lP)],2))}}),yh=dt(cP,[["__scopeId","data-v-8cb516d8"]]),uP={key:0,class:"at-type"},dP={key:1,class:"at-task"},fP={key:2,class:"bb-code"},pP=qe({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t;function i(b){if(!b)return{};try{const g=JSON.parse(b);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=B(()=>i(s.tool.arg)),l=B(()=>!!s.tool.output&&s.tool.output.length>0),a=B(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=J(s.tool.defaultExpanded===!0&&a.value),u=B(()=>s.tool.status),d=B(()=>ea(s.tool.name)),f=B(()=>vh(s.tool.name)),h=B(()=>r.value.description||r.value.subagentType||""),p=jt("resolveAgentTaskId"),m=B(()=>p?p(s.tool.id)!==void 0:!0);function _(){a.value&&(c.value=!c.value)}return Ve(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(b,g)=>(w(),ye(yh,{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:_},{trailing:be(()=>[m.value?(w(),N("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=vt(v=>o("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):le("",!0)]),default:be(()=>[r.value.subagentType?(w(),N("div",uP,O(r.value.subagentType),1)):le("",!0),r.value.prompt?(w(),N("div",dP,O(r.value.prompt),1)):le("",!0),l.value?(w(),N("div",fP,[(w(!0),N(Oe,null,tt(e.tool.output??[],(v,y)=>(w(),N("div",{key:y},O(v),1))),128))])):le("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),hP=dt(pP,[["__scopeId","data-v-14ef8750"]]);function mP(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const s=[];for(const o of n){if(!o||typeof o!="object")continue;const i=o,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];s.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return s}catch{return[]}}const nf={recognized:!1,answers:{},note:""};function gP(e){const t=e?.[0];if(!t)return nf;let n;try{n=JSON.parse(t)}catch{return nf}if(!n||typeof n!="object"||Array.isArray(n))return nf;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return nf;const o={};for(const[i,r]of Object.entries(s))typeof r=="string"?o[i]=r:r===!0&&(o[i]=!0);return{recognized:!0,answers:o,note:typeof n.note=="string"?n.note:""}}function vP(e,t,n){return e[t]??e[`q_${n}`]}const yP=/^opt_\d+_(\d+)$/;function kP(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const s=n.get(e);if(s!==void 0)return{selected:new Set([s]),otherText:"",indeterminate:!1};const o=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){o.add(a);continue}const c=yP.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const bP={key:0,class:"chip"},_P={key:0,class:"au-dismissed"},wP={key:1,class:"au-list"},SP={class:"au-q"},CP={key:0,class:"au-hdr"},xP={class:"au-qtext"},AP={class:"au-opts"},TP={class:"au-glyph"},MP={class:"au-label"},EP={key:0,class:"au-desc"},IP={key:0,class:"au-opt sel"},$P={class:"au-glyph"},NP={class:"au-label"},LP={key:1,class:"au-opt sel"},OP={class:"au-label"},PP={key:2,class:"au-raw"},RP=80,DP=qe({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=At();function s(I,k=RP){const M=I.trim();return M.length>k?M.slice(0,k-1)+"…":M}const o=B(()=>mP(t.tool.arg)),i=B(()=>gP(t.tool.output)),r=B(()=>i.value.recognized),l=B(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=B(()=>o.value.map((I,k)=>kP(vP(i.value.answers,I.question,k),I.options))),c=B(()=>Object.keys(i.value.answers).length);function u(I,k){return a.value[I]?.selected.has(k)??!1}function d(I){return a.value[I]?.otherText??""}function f(I){return a.value[I]?.indeterminate??!1}function h(I,k){return I?k?"■":"□":k?"●":"○"}const p=B(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const I=o.value[0]?.question??"",k=s(I);return o.value.length<=1?k:`${k} ${n("tools.ask.more",{count:o.value.length-1})}`}),m=B(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),_=B(()=>!!t.tool.output&&t.tool.output.length>0),b=B(()=>r.value&&(o.value.length>0||l.value)||_.value),g=J(t.tool.defaultExpanded===!0&&b.value),v=B(()=>t.tool.status),y=B(()=>ea(t.tool.name)),T=B(()=>vh(t.tool.name));function P(){b.value&&(g.value=!g.value)}return Ve(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&b.value&&(g.value=!0)}),(I,k)=>(w(),ye(yh,{status:v.value,icon:T.value,name:y.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:b.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:P},{trailing:be(()=>[m.value?(w(),N("span",bP,O(m.value),1)):le("",!0)]),default:be(()=>[l.value?(w(),N("div",_P,O(i.value.note),1)):r.value?(w(),N("div",wP,[(w(!0),N(Oe,null,tt(o.value,(M,$)=>(w(),N("div",{key:$,class:"au-block"},[x("div",SP,[M.header?(w(),N("span",CP,O(M.header),1)):le("",!0),x("span",xP,O(M.question),1)]),x("div",AP,[(w(!0),N(Oe,null,tt(M.options,(L,S)=>(w(),N("div",{key:S,class:Re(["au-opt",{sel:u($,S)}])},[x("span",TP,O(h(M.multiSelect,u($,S))),1),x("span",MP,O(L.label),1),L.description?(w(),N("span",EP,O(L.description),1)):le("",!0)],2))),128)),d($)?(w(),N("div",IP,[x("span",$P,O(h(M.multiSelect,!0)),1),x("span",NP,O(d($)),1)])):le("",!0),f($)?(w(),N("div",LP,[k[0]||(k[0]=x("span",{class:"au-glyph"},"●",-1)),x("span",OP,O(C(n)("tools.ask.answered")),1)])):le("",!0)])]))),128))])):(w(),N("div",PP,[(w(!0),N(Oe,null,tt(e.tool.output??[],(M,$)=>(w(),N("div",{key:$},O(M),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),BP=dt(DP,[["__scopeId","data-v-a9a0f259"]]),FP=1e6,B_=5e3;function F_(e){if(e==="")return[];const t=e.split(`
|
|
39
|
+
`);return t.at(-1)===""&&t.pop(),t}function HP(e,t){const n=F_(e),s=F_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>B_||i>B_||(o+1)*(i+1)>FP)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=o;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===s[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=o,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===s[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:s[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 WP(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}function HA(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 WA(e){const t=Jl(e.name);if(t!=="edit"&&t!=="write")return null;const n=HA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const s=typeof n.old_string=="string"?n.old_string:void 0,o=typeof n.new_string=="string"?n.new_string:void 0;return s===void 0||o===void 0?null:HP(s,o)}return null}function zP(e){const t=HA(e);return t&&typeof t.path=="string"?t.path:void 0}function UP(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const jP={key:0,class:"chip"},qP={key:0,class:"bb-summary"},VP={class:"bb-code"},KP={key:0,class:"bb-empty"},GP=qe({__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,s=t,o=B(()=>n.tool.status),i=B(()=>ea(n.tool.name)),r=B(()=>vh(n.tool.name)),l=B(()=>Uu(n.tool.name,n.tool.arg)),a=B(()=>Uu(n.tool.name,n.tool.arg,!0)),c=B(()=>WA(n.tool)),u=B(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:_,removed:b}=WP(m);if(_||b)return`+${_} −${b}`}return""}),d=B(()=>!!n.tool.output&&n.tool.output.length>0),f=J(!1),h=B(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,_)=>(w(),ye(yh,{status:o.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:be(()=>[u.value?(w(),N("span",jP,O(u.value),1)):le("",!0)]),default:be(()=>[a.value?(w(),N("div",qP,O(a.value),1)):le("",!0),x("div",VP,[d.value?le("",!0):(w(),N("div",KP,"Waiting for output…")),(w(!0),N(Oe,null,tt(e.tool.output??[],(b,g)=>(w(),N("div",{key:g},O(b),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),YP=dt(GP,[["__scopeId","data-v-69861679"]]),QP={key:0,class:"chip"},XP={key:0,class:"bb-summary"},ZP={class:"bb-code"},JP={key:0,class:"bb-empty"},eR=qe({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=B(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=B(()=>!!t.tool.output&&t.tool.output.length>0),o=B(()=>s.value||n.value),i=J(t.tool.defaultExpanded===!0&&o.value),r=B(()=>t.tool.status),l=B(()=>ea(t.tool.name)),a=B(()=>vh(t.tool.name)),c=B(()=>Uu(t.tool.name,t.tool.arg)),u=B(()=>Uu(t.tool.name,t.tool.arg,!0)),d=B(()=>JO({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){o.value&&(i.value=!i.value)}return Ve(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,p)=>(w(),ye(yh,{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:o.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:be(()=>[d.value?(w(),N("span",QP,O(d.value),1)):le("",!0)]),default:be(()=>[u.value?(w(),N("div",XP,O(u.value),1)):le("",!0),x("div",ZP,[s.value?le("",!0):(w(),N("div",JP,"Waiting for output…")),(w(!0),N(Oe,null,tt(e.tool.output??[],(m,_)=>(w(),N("div",{key:_},O(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),tR=dt(eR,[["__scopeId","data-v-f3c4ee38"]]),nR={class:"media-title"},sR=["src","alt"],oR=["src"],iR=["src"],rR=qe({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=B(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=B(()=>{const c=o.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=o.value;c?.kind==="image"&&s("openMedia",c)}return(c,u)=>o.value?(w(),N("div",{key:0,class:Re(["media-tool",{mob:e.mobile}])},[ie(qt,{text:o.value.path||l.value},{default:be(()=>[x("div",nR,O(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(w(),ye(qt,{key:0,text:o.value.path||l.value},{default:be(()=>[x("button",{type:"button",class:"media-image-button",onClick:a},[x("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,sR)])]),_:1},8,["text"])):o.value.kind==="video"?(w(),N("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,oR)):(w(),N("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,iR))],2)):le("",!0)}}),lR=dt(rR,[["__scopeId","data-v-bec13b73"]]),aR=/<summary>([\s\S]*?)<\/summary>/,cR=/<resume_hint>([\s\S]*?)<\/resume_hint>/,ag=/<subagent\b([^>]*)>|<\/subagent>/g,uR="</subagent>",H_=/(completed|failed|aborted):\s*(\d+)/g,W_=/([a-z_]+)="([^"]*)"/g;function dR(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function fR(e){const t={};W_.lastIndex=0;let n;for(;(n=W_.exec(e))!==null;)t[n[1]]=dR(n[2]);return t}function pR(e){const t={completed:0,failed:0,aborted:0};H_.lastIndex=0;let n;for(;(n=H_.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function hR(e,t){const n=fR(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function mR(e){const t=[],n=[];ag.lastIndex=0;let s;for(;(s=ag.exec(e))!==null;)if(s[0]===uR){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(hR(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:ag.lastIndex}):n.push(null);return t}function gR(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
|
|
40
|
+
`):e;if(!t.includes("<agent_swarm_result>"))return null;const n=aR.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=pR(n),r=cR.exec(t)?.[1]?.trim(),l=mR(t),a=s+o+i;return{summary:n,completed:s,failed:o,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function z_(e){return e?e.split(`
|
|
41
|
+
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function vR(e){return e.suspendedReason||z_(e.text)||z_(e.outputLines?.join(`
|
|
42
|
+
`))||e.summary||""}function yR(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
43
|
+
`):e.summary??""}function kR(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function U_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
44
|
+
`)[0]??"",phase:kR(e.outcome),body:e.body}}function bR(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function _R(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:vR(o),phase:o.phase,body:yR(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>bR(i,o))).map((o,i)=>U_(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>U_(o,i))}const wR=["aria-expanded"],SR={class:"title"},CR={key:0,class:"meta"},xR={key:1,class:"sum-txt"},AR={class:"rt"},TR={class:"status"},MR={key:0,class:"chip"},ER={key:1,class:"tm"},IR={class:"body"},$R={class:"overview"},NR={class:"overview-line"},LR={class:"big"},OR={key:0,class:"lbl"},PR={key:1,class:"lbl"},RR={key:2,class:"lbl"},DR={key:0,class:"seg","aria-hidden":"true"},BR={key:1,class:"legend"},FR=["aria-expanded","onClick"],HR={class:"mname"},WR={class:"mact"},zR={class:"mphase"},UR={key:1,class:"fallback-output"},jR={key:2,class:"waiting"},qR=qe({__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}=At(),n=e;function s($){if(!$)return{};try{const L=JSON.parse($),S=Array.isArray(L.items)?L.items:void 0;return{description:typeof L.description=="string"?L.description:void 0,itemCount:S?.length}}catch{return{}}}const o=jt("resolveSwarmMembers"),i=B(()=>s(n.tool.arg)),r=B(()=>ea(n.tool.name)),l=B(()=>i.value.description??""),a=B(()=>o?.(n.tool.id)??[]),c=B(()=>gR(n.tool.output)),u=B(()=>n.tool.status),d=B(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=B(()=>_R(a.value,c.value)),h=B(()=>{const $={completed:0,working:0,suspended:0,queued:0,failed:0};for(const L of f.value)$[L.phase]++;return $}),p=B(()=>f.value.length||i.value.itemCount||0),m=B(()=>h.value.completed+h.value.failed),_=B(()=>h.value.working+h.value.suspended+h.value.queued),b=[{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"}],g=B(()=>b.map(({phase:$,cls:L})=>({phase:$,count:h.value[$],cls:L})).filter($=>$.count>0)),v=J(!1);function y(){v.value=!v.value}const T=B(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
45
|
+
`).trim()),P=J(new Set);function I($){const L=new Set(P.value);L.has($)?L.delete($):L.add($),P.value=L}function k($){return P.value.has($)}function M($){return t(`tools.swarm.phase${$[0].toUpperCase()}${$.slice(1)}`)}return($,L)=>(w(),N("div",{class:Re(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[x("button",{class:"head",type:"button","aria-expanded":v.value,onClick:y},[ie(Xe,{class:"ic",name:"git-pull-request",size:"sm"}),x("span",SR,O(r.value),1),l.value?(w(),N("span",CR,"·")):le("",!0),l.value?(w(),N("span",xR,O(l.value),1)):le("",!0),x("span",AR,[x("span",TR,[d.value==="ok"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):d.value==="error"?(w(),ye(Xe,{key:1,name:"close",size:"sm"})):(w(),ye(ju,{key:2,status:"running"}))]),m.value>0||p.value>0?(w(),N("span",MR,O(m.value)+" / "+O(p.value),1)):le("",!0),e.tool.timing?(w(),N("span",ER,O(e.tool.timing),1)):le("",!0)]),ie(Xe,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,wR),_n(x("div",IR,[x("div",$R,[x("div",NR,[x("span",LR,O(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(w(),N("span",OR,O(C(t)("tools.swarm.runningSub",{count:_.value})),1)):c.value?(w(),N("span",PR,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(w(),N("span",RR,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(w(),N("div",DR,[(w(!0),N(Oe,null,tt(g.value,S=>(w(),N("span",{key:S.phase,class:Re(S.cls),style:Qt({flex:S.count})},null,6))),128))])):le("",!0),g.value.length>1?(w(),N("div",BR,[(w(!0),N(Oe,null,tt(g.value,S=>(w(),N("span",{key:S.phase},[x("i",{class:Re(["lg-dot",S.cls])},null,2),Ue(O(M(S.phase))+" "+O(S.count),1)]))),128))])):le("",!0)]),f.value.length>0?(w(!0),N(Oe,{key:0},tt(f.value,S=>(w(),N("div",{key:S.id,class:Re(["member",[`phase-${S.phase}`,{open:k(S.id)}]])},[x("button",{class:"member-head",type:"button","aria-expanded":k(S.id),onClick:E=>I(S.id)},[ie(ju,{class:"row-dot",status:S.phase},null,8,["status"]),ie(qt,{text:S.name},{default:be(()=>[x("span",HR,O(S.name),1)]),_:2},1032,["text"]),S.activity?(w(),ye(qt,{key:0,text:S.activity},{default:be(()=>[x("span",WR,O(S.activity),1)]),_:2},1032,["text"])):le("",!0),x("span",zR,O(M(S.phase)),1),ie(Xe,{class:"mcar",name:k(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,FR),_n(x("div",{class:"member-body"},O(S.body),513),[[Eo,k(S.id)]])],2))),128)):T.value?(w(),N("div",UR,O(T.value),1)):(w(),N("div",jR,O(C(t)("tools.swarm.waiting")),1))],512),[[Eo,v.value]])],2))}}),VR=dt(qR,[["__scopeId","data-v-3b95ba79"]]);function KR(e){if(e.media&&e.status==="ok")return lR;const t=Jl(e.name);return t==="edit"||t==="write"||t==="multi_edit"?YP:t==="task"?hP:t==="agentswarm"?VR:t==="askuserquestion"?BP:tR}const zA=qe({__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,s=t,o=B(()=>KR(n.tool));return(i,r)=>(w(),ye(zs(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:r[0]||(r[0]=l=>s("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>s("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>s("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>s("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel"]))}});function j_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function GR(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 kh(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 YR(e){return!(e.tool.status==="ok"&&e.tool.media)}function QR(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function XR(e){const t=kh(e),n=[];let s=[];const o=()=>{if(s.length===1){const[i]=s;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else s.length>1&&n.push({kind:"tool-stack",tools:s});s=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(YR(i)){s.push({tool:i.tool,sourceIndex:r});return}o(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}o(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"?n.push({kind:"text",text:i.text,sourceIndex:r}):i.kind==="cron"&&n.push({kind:"cron",text:i.text,cron:i.cron,sourceIndex:r})}),o(),n}function ZR(e){return kh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
46
|
+
|
|
47
|
+
`)}function JR(e){const t=[];for(const n of kh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
48
|
+
> ${n.thinking.split(`
|
|
49
|
+
`).join(`
|
|
50
|
+
> `)}`);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 s=n.tool.output.join(`
|
|
51
|
+
`);t.push(`\`\`\`
|
|
52
|
+
[${n.tool.name}]
|
|
53
|
+
${s}
|
|
54
|
+
\`\`\``)}return t.join(`
|
|
55
|
+
|
|
56
|
+
`)}function UA(e){return e.tool.id||`tool-${e.sourceIndex}`}function e7(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?UA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const t7=["aria-expanded"],n7={class:"tg-title"},s7={class:"tg-meta"},o7=["inert"],i7={class:"tool-group-body-inner"},r7=qe({__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,s=t,o=J(!0),i=B(()=>n.tools.length),r=B(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=At(),a=B(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){o.value=!o.value}const u=jt("pinScroll",()=>{}),d=J(null);function f(){c();const h=d.value;h&&mt(()=>u(h))}return(h,p)=>(w(),N("div",{class:Re(["tool-group",{open:o.value}])},[x("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":o.value,onClick:f},[ie(ju,{status:r.value},null,8,["status"]),ie(Xe,{class:"tg-ic",name:"list",size:"sm"}),x("span",n7,O(C(l)("tools.group.title",i.value)),1),x("span",s7,"· "+O(a.value),1),ie(Xe,{class:"tg-car",name:"chevron-right",size:"sm"})],8,t7),x("div",{class:Re(["tool-group-body",{open:o.value}]),inert:!o.value},[x("div",i7,[(w(!0),N(Oe,null,tt(e.tools,(m,_)=>(w(),ye(zA,{key:C(UA)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(QR)(_,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=b=>s("openMedia",b)),onOpenFile:p[1]||(p[1]=b=>s("openFile",b)),onOpenToolDiff:p[2]||(p[2]=b=>s("openToolDiff",b)),onOpenAgent:p[3]||(p[3]=b=>s("openAgent",b))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,o7)],2))}}),l7=dt(r7,[["__scopeId","data-v-37eb334f"]]);var a7=Object.create,T0=Object.defineProperty,c7=Object.getOwnPropertyDescriptor,jA=Object.getOwnPropertyNames,u7=Object.getPrototypeOf,d7=Object.prototype.hasOwnProperty,qA=(e,t)=>function(){return t||(0,e[jA(e)[0]])((t={exports:{}}).exports,t),t.exports},VA=e=>{let t={};for(var n in e)T0(t,n,{get:e[n],enumerable:!0});return t},f7=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=jA(t),i=0,r=o.length,l;i<r;i++)l=o[i],!d7.call(e,l)&&l!==n&&T0(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=c7(t,l))||s.enumerable});return e},KA=(e,t,n)=>(n=e!=null?a7(u7(e)):{},f7(T0(n,"default",{value:e,enumerable:!0}),e));function p7(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function h7(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function m7(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);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 g7(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
57
|
+
`:`<hr class="footnotes-sep">
|
|
58
|
+
`)+`<section class="footnotes">
|
|
59
|
+
<ol class="footnotes-list">
|
|
60
|
+
`}function v7(){return`</ol>
|
|
61
|
+
</section>
|
|
62
|
+
`}function y7(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function k7(){return`</li>
|
|
63
|
+
`}function b7(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function _7(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=m7,e.renderer.rules.footnote_block_open=g7,e.renderer.rules.footnote_block_close=v7,e.renderer.rules.footnote_open=y7,e.renderer.rules.footnote_close=k7,e.renderer.rules.footnote_anchor=b7,e.renderer.rules.footnote_caption=h7,e.renderer.rules.footnote_anchor_name=p7;function s(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 m=new l.Token("footnote_reference_open","",1);m.meta={label:p},m.level=l.level++,l.tokens.push(m);const _=l.bMarks[a],b=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let P=T;for(;h<f;){const k=l.src.charCodeAt(h);if(n(k))k===9?P+=4-P%4:P++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=P-T,l.bMarks[a]=y,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=v,l.blkIndent-=4,l.tShift[a]=b,l.sCount[a]=g,l.bMarks[a]=_;const I=new l.Token("footnote_reference_close","",-1);return I.level=--l.level,l.tokens.push(I),!0}function o(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 m=l.push("footnote_ref","",0);m.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 m=l.push("footnote_ref","",0);m.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,m=h.length;p<m;p++){const _=new l.Token("footnote_open","",1);if(_.meta={id:p,label:h[p].label},l.tokens.push(_),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const y=new l.Token("inline","",0);y.children=h[p].tokens,y.content=h[p].content,a.push(y);const T=new l.Token("paragraph_close","p",-1);T.block=!0,a.push(T)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let b;l.tokens[l.tokens.length-1].type==="paragraph_close"?b=l.tokens.pop():b=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:p,subId:v,label:h[p].label},l.tokens.push(y)}b&&l.tokens.push(b),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",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function w7(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function S7(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const C7=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function x7(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(C7,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function A7(e){e.inline.ruler.after("emphasis","sub",x7)}const T7=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function M7(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(T7,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function E7(e){e.inline.ruler.after("emphasis","sup",M7)}var I7=qA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),m.core.ruler.after("inline","github-task-lists",function(b){for(var g=b.tokens,v=0,y=2;y<g.length;y++)o(g,y)&&(i(g[y],v,_,b.Token),v+=1,n(g[y-2],"class",_.liClass),n(g[s(g,y-2)],"class",_.ulClass))})};function n(m,_,b){var g=m.attrIndex(_),v=[_,b];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,_){for(var b=m[_].level-1,g=_-1;g>=0;g--)if(m[g].level===b)return g;return-1}function o(m,_){return d(m[_])&&f(m[_-1])&&h(m[_-2])&&p(m[_])}function i(m,_,b,g){var v=b.idPrefix+_;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,b,g)),b.divWrap&&(m.children.unshift(c(b,g)),m.children.push(u(g)))}function r(m,_,b,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",_]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),b.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,_){var b=new _("label_open","label",1);return b.attrs=[["for",m]],b}function a(m){return new m("label_close","label",-1)}function c(m,_){var b=new _("checkbox_open","div",0);return b.attrs=[["class",m.divClass]],b}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),$7=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))),N7=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),cg;const L7=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]]),O7=(cg=String.fromCodePoint)!==null&&cg!==void 0?cg: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 P7(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=L7.get(e))!==null&&t!==void 0?t:e}var Cs;(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"})(Cs||(Cs={}));const R7=32;var Wr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Wr||(Wr={}));function Xv(e){return e>=Cs.ZERO&&e<=Cs.NINE}function D7(e){return e>=Cs.UPPER_A&&e<=Cs.UPPER_F||e>=Cs.LOWER_A&&e<=Cs.LOWER_F}function B7(e){return e>=Cs.UPPER_A&&e<=Cs.UPPER_Z||e>=Cs.LOWER_A&&e<=Cs.LOWER_Z||Xv(e)}function F7(e){return e===Cs.EQUALS||B7(e)}var Ss;(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"})(Ss||(Ss={}));var Br;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Br||(Br={}));var H7=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Ss.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Br.Strict}startEntity(e){this.decodeMode=e,this.state=Ss.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Ss.EntityStart:return e.charCodeAt(t)===Cs.NUM?(this.state=Ss.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ss.NamedEntity,this.stateNamedEntity(e,t));case Ss.NumericStart:return this.stateNumericStart(e,t);case Ss.NumericDecimal:return this.stateNumericDecimal(e,t);case Ss.NumericHex:return this.stateNumericHex(e,t);case Ss.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|R7)===Cs.LOWER_X?(this.state=Ss.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ss.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Xv(s)||D7(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Xv(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,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===Cs.SEMI)this.consumed+=1;else if(this.decodeMode===Br.Strict)return 0;return this.emitCodePoint(P7(this.result),this.consumed),this.errors&&(e!==Cs.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&Wr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=W7(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Br.Attribute&&(o===0||F7(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&Wr.VALUE_LENGTH)>>14,o!==0){if(i===Cs.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Br.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&Wr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~Wr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Ss.NamedEntity:return this.result!==0&&(this.decodeMode!==Br.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ss.NumericDecimal:return this.emitNumericEntity(0,2);case Ss.NumericHex:return this.emitNumericEntity(0,3);case Ss.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ss.EntityStart:return 0}}};function GA(e){let t="";const n=new H7(e,s=>t+=O7(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function W7(e,t,n,s){const o=(t&Wr.BRANCH_LENGTH)>>7,i=t&Wr.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const z7=GA($7);GA(N7);function M0(e,t=Br.Legacy){return z7(e,t)}var U7=KA(I7());const q_={};function j7(e){let t=q_[e];if(t)return t;t=q_[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function bh(e,t){typeof t!="string"&&(t=bh.defaultChars);const n=j7(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.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?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.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?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}bh.defaultChars=";/?:@&=+$,#";bh.componentChars="";var Zv=bh;const V_={};function q7(e){let t=V_[e];if(t)return t;t=V_[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):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 _h(e,t,n){typeof t!="string"&&(n=t,t=_h.defaultChars),typeof n>"u"&&(n=!0);const s=q7(t);let o="";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))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[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){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}_h.defaultChars=";/?:@&=+$,-_.!~*'()#";_h.componentChars="-_.!~*'()";var YA=_h;function E0(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 hp(){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 V7=/^([a-z0-9.+-]+:)/i,K7=/:[0-9]*$/,G7=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Y7=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
64
|
+
`," "]),Q7=["'"].concat(Y7),K_=["%","/","?",";","#"].concat(Q7),G_=["/","?","#"],X7=255,Y_=/^[+a-z0-9A-Z_-]{0,63}$/,Z7=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Q_={javascript:!0,"javascript:":!0},X_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function J7(e,t){if(e&&e instanceof hp)return e;const n=new hp;return n.parse(e,t),n}hp.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=G7.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=V7.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&Q_[r])&&(i=i.substr(2),this.slashes=!0)),!Q_[r]&&(o||r&&!X_[r])){let c=-1;for(let p=0;p<G_.length;p++)s=i.indexOf(G_[p]),s!==-1&&(c===-1||s<c)&&(c=s);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<K_.length;p++)s=i.indexOf(K_[p]),s!==-1&&(c===-1||s<c)&&(c=s);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 m=0,_=p.length;m<_;m++){const b=p[m];if(b&&!b.match(Y_)){let g="";for(let v=0,y=b.length;v<y;v++)b.charCodeAt(v)>127?g+="x":g+=b[v];if(!g.match(Y_)){const v=p.slice(0,m),y=p.slice(m+1),T=b.match(Z7);T&&(v.push(T[1]),y.unshift(T[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>X7&&(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),X_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};hp.prototype.parseHost=function(e){let t=K7.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 I0=J7,QA=VA({decode:()=>Zv,encode:()=>YA,format:()=>E0,parse:()=>I0}),XA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ZA=/[\0-\x1F\x7F-\x9F]/,eD=/[\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]/,JA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,tD=/[\$\+<->\^`\|~\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]/,eT=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,nD=VA({Any:()=>XA,Cc:()=>ZA,Cf:()=>eD,P:()=>JA,S:()=>tD,Z:()=>eT}),sD=Object.defineProperty,tT=e=>{let t={};for(var n in e)sD(t,n,{get:e[n],enumerable:!0});return t},us=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,s=t.length;n<s;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),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}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}`}},oD=tT({arrayReplaceAt:()=>dD,assign:()=>cD,countLines:()=>Zn,escapeHtml:()=>bD,escapeRE:()=>wD,fromCodePoint:()=>Vu,has:()=>aD,isMdAsciiPunct:()=>vp,isPunctChar:()=>gp,isPunctCode:()=>Jv,isSpace:()=>uD,isString:()=>rD,isValidEntityCode:()=>Sh,isWhiteSpace:()=>qu,lib:()=>SD,mdurl:()=>QA,normalizeReference:()=>wh,ucmicro:()=>mp,unescapeAll:()=>Ku,unescapeMd:()=>mD});const mp=nD;function iD(e){return Object.prototype.toString.call(e)}function rD(e){return iD(e)==="[object String]"}const lD=Object.prototype.hasOwnProperty;function aD(e,t){return lD.call(e,t)}function cD(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function uD(e){return e===9||e===32}function qu(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 gp(e){return mp.P.test(e)||mp.S.test(e)}const Z_=new Map;function Jv(e){if(vp(e))return!0;const t=Z_.get(e);if(t!==void 0)return t;const n=gp(String.fromCharCode(e));return Z_.set(e,n),n}function vp(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 wh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function dD(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Sh(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 Vu(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 nT=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,fD=new RegExp(`${nT.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),pD=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function hD(e,t){if(t.charCodeAt(0)===35&&pD.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Sh(s)?Vu(s):e}const n=M0(e);return n!==e?n:e}function mD(e){return e.includes("\\")?e.replace(nT,"$1"):e}function Ku(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(fD,(t,n,s)=>n||hD(t,s))}const gD=/[&<>"]/,vD=/[&<>"]/g,yD={"&":"&","<":"<",">":">",'"':"""};function kD(e){return yD[e]}function bD(e){return gD.test(e)?e.replace(vD,kD):e}const _D=/[.?*+^$[\]\\(){}|-]/g;function wD(e){return e.replace(_D,"\\$&")}const SD={mdurl:QA,ucmicro:mp};function Zn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
65
|
+
`,n+1))!==-1;)t++;return t}const CD=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,xD=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,AD=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,$0=["references","footnotes","abbreviations","abbr","abbrs"],N0=Symbol.for("markdown-it-ts.global-state"),L0=Object.prototype.hasOwnProperty;function J_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function hi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Vr(e){if(Array.isArray(e))return e.map(t=>Vr(t));if(hi(e)){const t={};for(const n of Object.keys(e))t[n]=Vr(e[n]);return t}return e}function yp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):hi(e)?Object.keys(e):[]}function e1(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(!e1(e[n],t[n]))return!1;return!0}if(hi(e)||hi(t)){if(!hi(e)||!hi(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!L0.call(t,o)||!e1(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function sT(e,t){if(Array.isArray(e))return e[Number(t)];if(hi(e))return e[t]}function TD(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Vr(t[n]);return e}if(hi(e)&&hi(t)){for(const n of Object.keys(e))L0.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Vr(t[n]);return e}return Vr(t)}function MD(e,t,n){const s=n.ownedKeys??[],o=e[t];if(hi(o)||Array.isArray(o)){const i=new Set(yp(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=Vr(sT(n.value,r)):delete o[r];!n.existed&&yp(o).length===0&&delete e[t];return}n.existed?e[t]=Vr(n.value):delete e[t]}function O0(e){const t=e[N0];return J_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&J_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function ED(e,t){Object.defineProperty(e,N0,{value:t,enumerable:!1,configurable:!0,writable:!0})}function po(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:CD.test(e)?"footnote-definition":xD.test(e)?"abbreviation-definition":AD.test(e)?"reference-definition":null}function cd(e){return O0(e)?.reason??null}function Ja(e,t,n){if(cd(e)&&cr(e),!t)return n();P0(e,t);try{const s=n();return R0(e),s}catch(s){throw cr(e),s}}function P0(e,t){try{cr(e);const n={};for(const s of $0)n[s]=L0.call(e,s)?{existed:!0,value:Vr(e[s])}:{existed:!1};ED(e,{reason:t,snapshot:n})}catch{}}function R0(e){const t=O0(e);if(t)for(const n of $0){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!hi(o)&&!Array.isArray(o))continue;const i=new Set(yp(s.existed?s.value:void 0));s.ownedKeys=yp(o).filter(r=>i.has(r)?!e1(o[r],sT(s.value,r)):!0)}}function cr(e){const t=O0(e);if(t){for(const n of $0){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){MD(e,n,s);continue}s.existed?e[n]=TD(e[n],s.value):delete e[n]}delete e[N0]}}const t1=Symbol.for("markdown-it-ts.diagnostics");function Ch(e,t){if(e)try{const n=e[t1];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[t1]=s,s}catch{return}}function qi(e){return Ch(e,!1)}function ID(e){if(e)try{const t=e[t1];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function Ys(e){ID(e)}function as(e,t){const n=Ch(e,!0);n&&(n.strategy=t)}function ug(e,t){const n=Ch(e,!0);n&&(n.chunk=t)}function oT(e,t){const n=Ch(e,!0);n&&(n.unbounded=t)}function $D(e){const t={};e=e||{},t.src_Any=XA.source,t.src_Cc=ZA.source,t.src_Z=eT.source,t.src_P=JA.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 n1(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function xh(e){return Object.prototype.toString.call(e)}function ND(e){return xh(e)==="[object String]"}function LD(e){return xh(e)==="[object Object]"}function OD(e){return xh(e)==="[object RegExp]"}function ew(e){return xh(e)==="[object Function]"}function PD(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const iT={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function RD(e){return Object.keys(e||{}).reduce(function(t,n){return t||iT.hasOwnProperty(n)},!1)}const DD={"http:":{validate:function(e,t,n){const s=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(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=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(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=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(s)?s.match(n.re.mailto)[0].length:0}}},BD="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]",FD="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function HD(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function tw(){return function(e,t){t.normalize(e)}}function kp(e){const t=e.re=$D(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(BD),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(s(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(s(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(s(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];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,LD(a)){OD(a.validate)?c.validate=HD(a.validate):ew(a.validate)?c.validate=a.validate:i(l,a),ew(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=tw();return}if(ND(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:tw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(PD).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 rT(e,t,n,s){const o=e.slice(n,s);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=s,this.raw=o,this.text=o,this.url=o}function Bo(e,t){if(!(this instanceof Bo))return new Bo(e,t);t||RD(e)&&(t=e,e={}),this.__opts__=n1({},iT,t),this.__schemas__=n1({},DD,e),this.__compiled__={},this.__tlds__=FD,this.__tlds_replaced__=!1,this.re={},kp(this)}Bo.prototype.add=function(t,n){return this.__schemas__[t]=n,kp(this),this};Bo.prototype.set=function(t){return this.__opts__=n1(this.__opts__,t),this};Bo.prototype.test=function(t){if(!t.length)return!1;let n,s;if(this.re.schema_test.test(t)){for(s=this.re.schema_search,s.lastIndex=0;(n=s.exec(t))!==null;)if(this.testSchemaAt(t,n[2],s.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)};Bo.prototype.pretest=function(t){return this.re.pretest.test(t)};Bo.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};Bo.prototype.match=function(t){const n=[],s=[],o=[],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&&s.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;)o.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=[s[u[0]],i[u[1]],o[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 rT(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};Bo.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);if(!s)return null;const o=new rT(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};Bo.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),kp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,kp(this),this)};Bo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Bo.prototype.onCompile=function(){};var lT=Bo,WD=qA({"../../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"},m=35,_=Math.floor,b=String.fromCharCode;function g(R){throw new RangeError(p[R])}function v(R,H){const U=[];let G=R.length;for(;G--;)U[G]=H(R[G]);return U}function y(R,H){const U=R.split("@");let G="";U.length>1&&(G=U[0]+"@",R=U[1]),R=R.replace(h,".");const Q=v(R.split("."),H).join(".");return G+Q}function T(R){const H=[];let U=0;const G=R.length;for(;U<G;){const Q=R.charCodeAt(U++);if(Q>=55296&&Q<=56319&&U<G){const V=R.charCodeAt(U++);(V&64512)==56320?H.push(((Q&1023)<<10)+(V&1023)+65536):(H.push(Q),U--)}else H.push(Q)}return H}const P=R=>String.fromCodePoint(...R),I=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},k=function(R,H){return R+22+75*(R<26)-((H!=0)<<5)},M=function(R,H,U){let G=0;for(R=U?_(R/700):R>>1,R+=_(R/H);R>m*26>>1;G+=36)R=_(R/m);return _(G+(m+1)*R/(R+38))},$=function(R){const H=[],U=R.length;let G=0,Q=128,V=72,re=R.lastIndexOf("-");re<0&&(re=0);for(let pe=0;pe<re;++pe)R.charCodeAt(pe)>=128&&g("not-basic"),H.push(R.charCodeAt(pe));for(let pe=re>0?re+1:0;pe<U;){const ne=G;for(let he=1,Pe=36;;Pe+=36){pe>=U&&g("invalid-input");const je=I(R.charCodeAt(pe++));je>=36&&g("invalid-input"),je>_((2147483647-G)/he)&&g("overflow"),G+=je*he;const it=Pe<=V?1:Pe>=V+26?26:Pe-V;if(je<it)break;const ce=36-it;he>_(2147483647/ce)&&g("overflow"),he*=ce}const X=H.length+1;V=M(G-ne,X,ne==0),_(G/X)>2147483647-Q&&g("overflow"),Q+=_(G/X),G%=X,H.splice(G++,0,Q)}return String.fromCodePoint(...H)},L=function(R){const H=[];R=T(R);const U=R.length;let G=128,Q=0,V=72;for(const ne of R)ne<128&&H.push(b(ne));const re=H.length;let pe=re;for(re&&H.push("-");pe<U;){let ne=2147483647;for(const he of R)he>=G&&he<ne&&(ne=he);const X=pe+1;ne-G>_((2147483647-Q)/X)&&g("overflow"),Q+=(ne-G)*X,G=ne;for(const he of R)if(he<G&&++Q>2147483647&&g("overflow"),he===G){let Pe=Q;for(let je=36;;je+=36){const it=je<=V?1:je>=V+26?26:je-V;if(Pe<it)break;const ce=Pe-it,z=36-it;H.push(b(k(it+ce%z,0))),Pe=_(ce/z)}H.push(b(k(Pe,0))),V=M(Q,X,pe===re),Q=0,++pe}++Q,++G}return H.join("")},D={version:"2.3.1",ucs2:{decode:T,encode:P},decode:$,encode:L,toASCII:function(R){return y(R,function(H){return f.test(H)?"xn--"+L(H):H})},toUnicode:function(R){return y(R,function(H){return d.test(H)?$(H.slice(4).toLowerCase()):H})}};t.exports=D})}),aT=KA(WD());function D0(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=Ku(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=Ku(e.slice(t,o)),i.pos=o,i.ok=!0),i}var cT=D0;const Mf=-2;function zD(e,t,n,s){let o=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(o--,o===0)return i;if(s){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return Mf}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return Mf;if(r===91){o++,i++;continue}i++}return-1}function B0(e,t,n){let s=1,o=!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=zD(l,t,a,n);if(f!==Mf)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let h=-1;return o&&(h=e.pos),e.pos=c,h}var bp=B0;function F0(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.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(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=Ku(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Ku(e.slice(t,i)),r}var uT=F0;function Ah(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 H0(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function UD(e,t,n){const s=Ah(e,t),o=[t,n];s<0?H0(e,o):e.attrs[s]=o}function jD(e,t){const n=Ah(e,t);return n>=0?e.attrs[n][1]:null}function qD(e,t,n){const s=Ah(e,t);s<0?H0(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var VD=tT({attrGet:()=>jD,attrIndex:()=>Ah,attrJoin:()=>qD,attrPush:()=>H0,attrSet:()=>UD,parseLinkDestination:()=>D0,parseLinkLabel:()=>B0,parseLinkTitle:()=>F0});function KD(e){return e.includes("\r")||e.includes("\0")}function dT(e){return typeof e=="string"?e:e.toString()}function GD(e){if(e.inlineMode){const t=new us("inline","",0);t.content=dT(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 YD=/^([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])?)*)$/,QD=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function XD(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(QD.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(YD.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 ZD=XD;function JD(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,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(s,c);f.includes(`
|
|
66
|
+
`)&&(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 e9=JD;function nw(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=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=s-i[s]-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,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function t9(e){const t=e.tokens_meta,n=e.tokens_meta.length;nw(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&nw(t[s].delimiters)}var n9=t9;function s9(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function sw(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.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[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function o9(e){const t=e.tokens_meta,n=e.tokens_meta.length;sw(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&sw(e,t[s].delimiters)}const ow={tokenize:s9,postProcess:o9};function fT(e){return M0(e)}function W0(e){return e>=48&&e<=57}function i9(e){const t=e|32;return W0(e)||t>=97&&t<=102}function pT(e){const t=e|32;return t>=97&&t<=122}function r9(e){return pT(e)||W0(e)}function l9(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?i9(l):W0(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function a9(e,t,n){let s=t+1;if(s>=n||!pT(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&r9(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return fT(o)!==o?o:null}function c9(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=l9(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=Sh(i)?Vu(i):Vu(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=a9(e.src,n,s);if(o){const i=fT(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var u9=c9;const hT=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),s1=new Array(128),mT=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);s1[e]=`\\${t}`,mT[e]=hT[e]?t:s1[e]}function iw(e,t,n){e.pending&&e.pushPending();const s=new us("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function d9(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(iw(e,mT[i],s1[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return iw(e,i<256&&hT[i]?r:l,l),e.pos=n+1,!0}var f9=d9;function p9(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var h9=p9;const gT=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,vT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",m9=new RegExp(`^(?:${gT}|${vT}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),g9=new RegExp(`^(?:${gT}|${vT})`);function yT(e){return e===32||e===9||e===10||e===12||e===13}function v9(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||yT(t)}function y9(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(!yT(n))return!1}return!1}function k9(e){const t=e|32;return t>=97&&t<=122}function b9(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!k9(i))return!1;const r=o.slice(s).match(m9);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,v9(l)&&e.linkLevel++,y9(l)&&e.linkLevel--}return e.pos+=l.length,!0}var _9=b9;function w9(e,t){let n,s,o,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=bp(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=cT(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=uT(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=bp(e,i),i>=0?o=e.src.slice(c,i++):i=p+1):i=p+1,o||(o=e.src.slice(h,p)),r=e.env.references[wh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(h,p);const m=[];e.md.inline.parse(s,e.md,e.env,m);const _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=m,_.content=s,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var S9=w9;function C9(e,t){let n,s,o,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=bp(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(o=cT(e.src,p,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?p=o.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(o=uT(e.src,p,e.posMax),p<d&&a!==p&&o.ok)for(l=o.str,p=o.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=bp(e,p),p>=0?s=e.src.slice(a,p++):p=h+1):p=h+1,s||(s=e.src.slice(f,h)),i=e.env.references[wh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const m=e.push("link_open","a",1),_=[["href",r]];m.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var x9=C9;function kT(e){const t=e|32;return t>=97&&t<=122}function A9(e){return e>=48&&e<=57}function T9(e){return kT(e)||A9(e)||e===43||e===45||e===46}function M9(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&T9(e.charCodeAt(t));)t--;return t++,t>=e.length||!kT(e.charCodeAt(t))?null:e.slice(t)}function E9(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function I9(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=M9(e.pending);if(!o)return!1;const i=E9(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.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,-o.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-o.length,!0}function $9(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-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<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var N9=$9;function L9(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);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:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function rw(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;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==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.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 O9(e){const t=e.delimiters;rw(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&rw(e,n[s].delimiters)}const lw={tokenize:L9,postProcess:O9};function aw(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 P9(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||aw(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!aw(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var R9=P9;function z0(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function D9(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function B9(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 bT(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,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:z0(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function ec(e,t,n,s,o,i){const r=bT(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=B9(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=z0()}function F9(e){const t=bT(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=D9(o.samples)}return t.completedAt=z0(),t}var cw=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<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(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<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(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,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 s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},_T=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,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.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 us("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 us(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 s=new us(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=qu(l),u=qu(a),d=Jv(l),f=Jv(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}}};_T.prototype.Token=us;const H9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function wT(e){return!H9.test(e)}var W9=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new cw,this.ruler2=new cw,this.ruler.push("text",R9),this.ruler.push("linkify",I9),this.ruler.push("newline",N9),this.ruler.push("escape",f9),this.ruler.push("backticks",e9),this.ruler.push("strikethrough",lw.tokenize),this.ruler.push("emphasis",ow.tokenize),this.ruler.push("link",x9),this.ruler.push("image",S9),this.ruler.push("autolink",ZD),this.ruler.push("html_inline",_9),this.ruler.push("entity",u9),this.ruler2.push("balance_pairs",n9),this.ruler2.push("strikethrough",lw.postProcess),this.ruler2.push("emphasis",ow.postProcess),this.ruler2.push("fragments_join",h9),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[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<s;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(ec(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<s;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++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){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>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){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=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ec(e.env,"inline",o[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>=s)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,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&wT(e)){const a=new us("text","",0);a.content=e,s.push(a);return}const o=new _T(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!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(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ec(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}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 z9(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&wT(i.content)){const r=new us("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const U9=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,j9=/[0-9a-z]/i;function q9(e){return/^<a[>\s]/i.test(e)}function V9(e){return/^<\/a\s*>/i.test(e)}function K9(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!U9.test(s)||!j9.test(o))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 G9(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(q9(l.content)&&i>0&&i--,V9(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=>K9(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&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let _=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const b=p.index;if(b>f){const T=new us("text","",0);T.content=a.slice(f,b),T.level=d,u.push(T)}const g=new us("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new us("text","",0);v.content=_,v.level=d,u.push(v);const y=new us("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new us("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const Y9=/\r\n?|\n/g,Q9=/\0/g;function X9(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(Y9,`
|
|
67
|
+
`)),s&&(o=o.replace(Q9,"�")),e.src=o}const ST=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Z9=/\((?:c|tm|r)\)/i,J9=/\((c|tm|r)\)/gi,eB={c:"©",r:"®",tm:"™"};function tB(e,t){return eB[t.toLowerCase()]}function nB(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(J9,tB)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function sB(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&ST.test(s.content)&&(s.content=s.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–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function oB(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 s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");Z9.test(s)&&nB(n.children||[]),ST.test(s)&&sB(n.children||[])}}var iB=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(s=>s.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(s=>s.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 s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,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 rB=/['"]/,uw=/['"]/g,dw="’";function sf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function lB(e,t){let n;const s=[],o=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=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.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 m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let _=32;if(c<u)_=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){_=e[n].content.charCodeAt(0);break}const b=vp(m)||gp(String.fromCharCode(m)),g=vp(_)||gp(String.fromCharCode(_)),v=qu(m),y=qu(_);if(y?f=!1:g&&(v||b||(f=!1)),v?h=!1:b&&(y||g||(h=!1)),_===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=b,h=g),!f&&!h){p&&(r.content=sf(r.content,d.index,dw));continue}if(h)for(n=s.length-1;n>=0;n--){let T=s[n];if(s[n].level<l)break;if(T.single===p&&s[n].level===l){T=s[n];let P,I;p?(P=o[2]||"‘",I=o[3]||"’"):(P=o[0]||"“",I=o[1]||"”"),r.content=sf(r.content,d.index,I),e[T.token].content=sf(e[T.token].content,T.pos,P),c+=I.length-1,T.token===i&&(c+=P.length-1),a=r.content,u=a.length,s.length=n;continue e}}f?s.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=sf(r.content,d.index,dw))}}}function aB(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 s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!rB.test(s)||!n.children||lB(n.children,e)}}function cB(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.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 uB=/^(?:vbscript|javascript|file|data):/,dB=/^data:image\/(?:gif|png|jpeg|webp);/,CT=["http:","https:","mailto:"];function xT(e){const t=e.trim().toLowerCase();return uB.test(t)?dB.test(t):!0}function AT(e){const t=I0(e,!0);if(t.hostname&&(!t.protocol||CT.includes(t.protocol)))try{t.hostname=aT.default.toASCII(t.hostname)}catch{}return YA(E0(t))}function TT(e){const t=I0(e,!0);if(t.hostname&&(!t.protocol||CT.includes(t.protocol)))try{t.hostname=aT.default.toUnicode(t.hostname)}catch{}return Zv(E0(t),`${Zv.defaultChars}%`)}function fB(e){switch(e){case 9:case 32:return!0}return!1}function pB(e,t,n,s){const o=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||o.charCodeAt(u)!==62)return!1;if(s)return!0;const h=[],p=[],m=[],_=[],b=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const M=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!M){let L=a[y]+1,S,E;o.charCodeAt(u)===32?(u++,L++,E=!1,S=!0):o.charCodeAt(u)===9?(S=!0,(c[y]+L)%4===3?(u++,L++,E=!1):E=!0):S=!1;let D=L;for(h.push(i[y]),i[y]=u;u<d;){const R=o.charCodeAt(u);if(fB(R))R===9?D+=4-(D+c[y]+(E?1:0))%4:D++;else break;u++}v=u>=d,p.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=D-L,_.push(l[y]),l[y]=u-i[y];continue}if(v)break;let $=!1;for(let L=0,S=b.length;L<S;L++)if(b[L](e,y,n,!0)){$=!0;break}if($){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),p.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),p.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]=-1}const T=e.blkIndent;e.blkIndent=0;const P=e.push("blockquote_open","blockquote",1);P.markup=">";const I=[t,0];P.map=I,e.md.block.tokenize(e,t,y);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=f,e.parentType=g,I[1]=e.line;for(let M=0;M<_.length;M++)i[M+t]=h[M],l[M+t]=_[M],a[M+t]=m[M],c[M+t]=p[M];return e.blkIndent=T,!0}function hB(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
68
|
+
`,i.map=[t,e.line],!0}function mB(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<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 fw=["","h1","h2","h3","h4","h5","h6"],pw=["","#","##","###","####","#####","######"];function hw(e){switch(e){case 9:case 32:return!0}return!1}function gB(e,t,n,s){const o=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=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!hw(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&hw(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",fw[d],1);h.markup=pw[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=o.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const m=e.push("heading_close",fw[d],-1);return m.markup=pw[d],!0}function vB(e){switch(e){case 9:case 32:return!0}return!1}function yB(e,t,n,s){const o=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<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!vB(c))return!1;c===r&&l++}if(l<3)return!1;if(s)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 wa=[[/^<(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(`${g9.source}\\s*$`),/^$/,!1]];function kB(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<wa.length&&!wa[l][0].test(r);l++);if(l===wa.length)return!1;if(s)return wa[l][2];let a=t+1;if(!wa[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),wa[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 mw(e){switch(e){case 9:case 32:return!0}return!1}const mu={Pipe:1,ParagraphTerminator:2};function bB(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 MT=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,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=o.length;u<d;u++){const f=o.charCodeAt(u);if(f===124&&(c|=mu.Pipe|mu.ParagraphTerminator),!a)if(mw(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,bB(f)&&(c|=mu.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(o.length),this.eMarks.push(o.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 o=new us(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new us(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=s?this.eMarks[u]+1:this.eMarks[u];let p=0;const m=this.src,_=this.bsCount,b=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+_[u])%4:p++;else if(f-d<b[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const o=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,m;for(d+1<t||s?m=l[d]+1:m=l[d];p<m&&f<n;){const _=i.charCodeAt(p);if(mw(_))_===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?o[u]=new Array(f-n+1).join(" ")+i.slice(p,m):o[u]=i.slice(p,m)}return o.join("")}};MT.prototype.Token=us;function _B(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function ET(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function IT(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&mu.ParagraphTerminator)===0||s>=o)return!1;const i=n.charCodeAt(s);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:_B(n,s,o)}const gw=["","h1","h2"];function wB(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=ET(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 y=i[p]+r[p],T=l[p];if(y>=T)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(y),h===45||h===61)){let I=y+1,k=I;for(;I<T&&o.charCodeAt(I)===h;)I++;for(k=I;I<T;){const M=o.charCodeAt(I);if(M!==9&&M!==32)break;I++}if(I>=T){f=h===61?1:2;break}if(k-y>1)continue}if(a[p]<0||u&&!IT(e,p,o,y,T))continue;let P=!1;for(let I=0,k=s.length;I<k;I++)if(s[I](e,p,n,!0)){P=!0;break}if(P)break}if(!f)return!1;let m;if(p===t+1){const y=i[t]+r[t];let T=l[t];for(;T>y;){const P=o.charCodeAt(T-1);if(P!==9&&P!==32)break;T--}m=o.slice(y,T)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const _=h===61?"=":"-",b=e.push("heading_open",gw[f],1);b.markup=_,b.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",gw[f],-1);return v.markup=_,e.parentType=d,!0}function $T(e){switch(e){case 9:case 32:return!0}return!1}function vw(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!$T(i.charCodeAt(l))?-1:l}function yw(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[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),!$T(c))?-1:a}function SB(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const CB=["0","1","2","3","4","5","6","7","8","9"];function xB(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function AB(e,t,n,s){let o,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;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,m=e.tShift,_=e.eMarks,b=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=_[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(f=yw(e,l),f<0||(u=!0,r=v,d=SB(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=vw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=_[l])return!1;if(s)return!0;const T=h.charCodeAt(f-1),P=String.fromCharCode(T);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=P;let k=!1;const M=e.tokens.length-1,$=e.md.block.ruler.getRulesForState(e,"list"),L=e.parentType;for(e.parentType="list";l<n;){i=f,o=_[l];const S=b[l]+f-(p[l]+m[l]);let E=S;for(;i<o;){const X=h.charCodeAt(i);if(X===9)E+=4-(E+g[l])%4;else if(X===32)E++;else break;i++}const D=i;let R;D>=o?R=1:R=E-S,R>4&&(R=1);const H=S+R,U=e.push("list_item_open","li",1);U.markup=P;const G=[l,0];U.map=G,u&&(U.info=f-r-1===1?CB[h.charCodeAt(r)-48]:h.slice(r,f-1));const Q=e.tight,V=e.tShift[l],re=e.sCount[l],pe=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=H,e.tight=!0,e.tShift[l]=D-p[l],e.sCount[l]=E,D>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||k)&&(a=!1),k=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=pe,e.tShift[l]=V,e.sCount[l]=re,e.tight=Q,e.push("list_item_close","li",-1).markup=P,l=e.line,G[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let ne=!1;for(let X=0,he=$.length;X<he;X++)if($[X](e,l,n,!0)){ne=!0;break}if(ne)break;if(u){if(f=yw(e,l),f<0)break;r=p[l]+m[l]}else if(f=vw(e,l),f<0)break;if(T!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=P:e.push("bullet_list_close","ul",-1).markup=P,I[1]=l,e.line=l,e.parentType=L,a&&xB(e,M),!0}function kw(e){return e===9||e===32}function TB(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=ET(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(o==="list"&&c[f]>=u){const v=r[f]+l[f],y=a[f];if(v<y){const T=i.charCodeAt(v);if(T===42||T===45||T===43){if(v+1>=y||kw(i.charCodeAt(v+1)))break}else if(T>=48&&T<=57&&v+1<y){let P=v+1;for(;;){if(P>=y){P=-1;break}const I=i.charCodeAt(P++);if(I>=48&&I<=57){if(P-v>=10){P=-1;break}continue}if((I===41||I===46)&&(P>=y||kw(i.charCodeAt(P))))break;P=-1;break}if(P>=0)break}}}const _=r[f]+l[f],b=a[f];if(d&&!IT(e,f,i,_,b))continue;let g=!1;for(let v=0,y=s.length;v<y;v++)if(s[v](e,f,n,!0)){g=!0;break}if(g)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 m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function of(e){switch(e){case 9:case 32:return!0}return!1}function MB(e,t,n,s){let o=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(o)!==91)return!1;function a(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let T=!1;if(e.sCount[v]-e.blkIndent>3&&(T=!0),e.sCount[v]<0&&(T=!0),!T){const k=e.parentType;e.parentType="reference";let M=!1;for(let $=0,L=l.length;$<L;$++)if(l[$](e,v,y,!0)){M=!0;break}if(e.parentType=k,M)return null}const P=e.bMarks[v]+e.tShift[v],I=e.eMarks[v];return e.src.slice(P,I+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const v=c.charCodeAt(o);if(v===91)return!1;if(v===93){u=o;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(o++,o<i&&c.charCodeAt(o)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!of(v))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;o=d.pos;const h=o,p=r,m=o;for(;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!of(v))break}let _=e.md.helpers.parseLinkTitle(c,o,i);for(;_.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,_=e.md.helpers.parseLinkTitle(c,o,i,_)}let b;for(o<i&&m!==o&&_.ok?(b=_.str,o=_.pos):(b="",o=h,r=p);o<i&&of(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&b)for(b="",o=h,r=p;o<i&&of(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=wh(c.slice(1,u));return g?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:b,href:f}),e.line=r),!0):!1}function dg(e){switch(e){case 9:case 32:return!0}return!1}const EB=65536;function fg(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function IB(e,t){if(e.lineFlags)return(e.lineFlags[t]&mu.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function bw(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function $B(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!dg(l)||r===45&&dg(l)||!IB(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!dg(y))return!1;i++}let a=fg(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const T=c[y].trim();if(!T){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(T))return!1;T.charCodeAt(T.length-1)===58?u.push(T.charCodeAt(0)===58?"center":"right"):T.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=fg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=bw(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(s)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),m=[t,0];p.map=m;const _=e.push("thead_open","thead",1);_.map=[t,t+1];const b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let y=0;y<c.length;y++){const T=e.push("th_open","th",1);u[y]&&(T.attrs=[["style",`text-align:${u[y]}`]]);const P=e.push("inline","",0);P.content=c[y].trim(),P.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let P=0,I=h.length;P<I;P++)if(h[P](e,o,n,!0)){y=!0;break}if(y||(a=fg(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=bw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>EB))break;if(o===t+2){const P=e.push("tbody_open","tbody",1);P.map=g=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let P=0;P<d;P++){const I=e.push("td_open","td",1);u[P]&&(I.attrs=[["style",`text-align:${u[P]}`]]);const k=e.push("inline","",0);k.content=c[P]?c[P].trim():"",k.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=o),e.push("table_close","table",-1),m[1]=o,e.parentType=f,e.line=o,!0}var NB=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,s){const o=this._rules.findIndex(r=>r.name===e);if(o<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(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<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(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.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:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ec(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};const rf=[["table",$B,["paragraph","reference"]],["code",hB],["fence",mB,["paragraph","reference","blockquote","list"]],["blockquote",pB,["paragraph","reference","blockquote","list"]],["hr",yB,["paragraph","reference","blockquote","list"]],["list",AB,["paragraph","reference","blockquote"]],["reference",MB],["html_block",kB,["paragraph","reference","blockquote"]],["heading",gB,["paragraph","reference","blockquote"]],["lheading",wB],["paragraph",TB]];var LB=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new NB;for(let e=0;e<rf.length;e++)this.ruler.push(rf[e][0],rf[e][1],{alt:(rf[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.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 m=0;m<o;m++)if(p=s[m](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 m=0;m<o;m++){const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ec(e.env,"block",f[m].name,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,s){if(!e||e.length===0)return;const o=new MT(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},NT=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}};NT.prototype.Token=us;const _w=[["normalize",X9],["block",GD],["inline",z9],["linkify",G9],["replacements",oB],["smartquotes",aB],["text_join",cB]],OB={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},PB={parseLinkLabel:B0,parseLinkDestination:D0,parseLinkTitle:F0};function RB(){return{...OB}}function DB(){return{...PB}}var BB=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new LB,this.inline=new W9,this.ruler=new iB;for(let e=0;e<_w.length;e++){const[t,n]=_w[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:RB(),helpers:DB(),normalizeLink:AT,normalizeLinkText:TT,validateLink:xT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new lT),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 NT(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 s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ec(e.env,"core",t[n].name,o-s,!0,!1)}F9(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&KD(e))return this.parse(dT(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}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 FB=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function _p(e){return!FB.test(e)}function iu(e,t){const n=e.indexOf(`
|
|
69
|
+
`,t);return n===-1?e.length:n}function Ef(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9)return!1}return!0}function ww(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function pg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function HB(e){if(e.length>3)return _p(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 WB=["","h1","h2","h3","h4","h5","h6"],zB=["","#","##","###","####","#####","######"],Sw=0,hg=1,mg=2;function Io(e,t,n,s){const o=new us(e,t,n);return o.level=s,o.block=!0,o}function LT(e,t,n){const s=Io("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new us("text","",0);return o.content=e,s.children=[o],s}function UB(e,t,n,s,o){let i=0,r=n;for(;r<s&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=s||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<s&&t.charCodeAt(l)===32;)l++;let a=s;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(!_p(u))return!1;const d=WB[i],f=zB[i],h=Io("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(LT(u,o,1));const p=Io("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function jB(e,t,n){const s=Io("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(LT(t,n,1)),e.push(Io("paragraph_close","p",-1,0))}function qB(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function gg(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function VB(e,t){const n=Io("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function KB(e,t,n){const s=Io("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=Io("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=Io("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new us("text","",0);r.content=t,i.children=[r],e.push(i);const l=Io("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Io("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function GB(e){const t=Io("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function YB(e,t,n,s){if(!ww(e,t,n))return null;const o=e.slice(t+3,n);if(o.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=s+1;for(;l<e.length;){const c=iu(e,l);if(ww(e,l,c)&&Ef(e,l+3,c)){const u=Io("fence","code",0,0);return u.map=[s,a+1],u.markup="```",u.info=o,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 QB(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?Sw:mg,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=iu(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(!Ef(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!UB(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=gg(e,h),l+=1+r-h;continue}if(c===45){if(!pg(e,r,a))return null;const h=l;let p=r,m=l,_=null,b=null;for(;p<e.length;){const y=iu(e,p);if(!pg(e,p,y))break;const T=p+2,P=y===T+1?e[T]:e.slice(T,y);if(!HB(P))return null;_===null&&(_=VB(t,h)),b=KB(t,P,m),p=y<e.length?y+1:y,m++}if(_===null||b===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=iu(e,g);if(!Ef(e,g,y)){if(pg(e,g,y))return null;break}g=y<e.length?y+1:y,v++}_.map[1]=v,b.map[1]=v,GB(t),r=g,l=v;continue}if(c===96){const h=YB(e,r,a,l);if(!h)return null;t.push(h.token),r=gg(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=qB(e,r,a);let d;if(n===mg?d=_p(u):n===hg&&u===s?d=o:(d=_p(u),n===Sw?(i&&(n=u===s?hg:mg),s=u,o=d,i=!0):n===hg&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!Ef(e,f,iu(e,f)))return null;jB(t,u,l),r=gg(e,f),l+=1+r-f}return t}const XB=/[&<>"]/,Cw=/[&<>"]/g,ZB=/&/g,JB=/[<>"]/g,eF={"&":"&","<":"<",">":">",'"':"""};function vg(e){return eF[e]||e}function $n(e){if(e.length===0)return"";if(e.length<32)return XB.test(e)?e.replace(Cw,vg):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(ZB,"&"):t?e.replace(Cw,vg):e.replace(JB,vg)}const tF=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),nF=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function OT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(tF,(t,n,s)=>{if(n)return n;if(nF.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return Sh(i)?Vu(i):"�"}const o=M0(t);return o!==t?o:t})}const sF=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,oF=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,iF=/"/g;function Fa(e,t){const n=e.indexOf(`
|
|
70
|
+
`,t);return n===-1?e.length:n}function wp(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9)return!1}return!0}function lf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function rF(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!wp(e,t,Fa(e,t))}function xw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function lF(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function U0(e){return oF.test(e)?sF.test(e)?null:e.replace(iF,"""):e}function aF(e,t,n){let s=0,o=t;for(;o<n&&e.charCodeAt(o)===35&&s<6;)o++,s++;if(s===0||o>=n||e.charCodeAt(o)!==32)return null;let i=o+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=U0(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
|
|
71
|
+
`}function Aw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function cF(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
72
|
+
`;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>
|
|
73
|
+
`}function uF(e,t,n){const s=t+2;if(n===s+1)return cF(e,s);const o=U0(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
|
|
74
|
+
`}function dF(e,t,n){for(;t<n;){const o=e.charCodeAt(t);if(o!==32&&o!==9)break;t++}for(;n>t;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let s=n;for(let o=t;o<n;o++){const i=e.charCodeAt(o);if(i===96)return null;if(i===32||i===9){s=o;break}}return e.slice(t,s)}function fF(e,t,n,s){if(!xw(e,t,n))return null;const o=dF(e,t+3,n);if(o===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=Fa(e,l);if(xw(e,l,a)&&wp(e,l+3,a)){const c=e.slice(i,r);let u;return o===s.lang?u=s.open:(u=o?`<pre><code class="language-${$n(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${$n(c)}</code></pre>
|
|
75
|
+
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function Tw(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const s=e.length>=25e4,o=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=Fa(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!wp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=aF(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=lf(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=Fa(e,m);if(!Aw(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const _=e.slice(t,m);let b;if(_===r)b=l;else{let v=t;for(b=`<ul>
|
|
76
|
+
`;v<m;){const y=Fa(e,v),T=uF(e,v,y);if(T===null)return null;b+=T,v=y<e.length?y+1:y}b+=`</ul>
|
|
77
|
+
`,r=_,l=b}let g=lf(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=Fa(e,g);if(!wp(e,g,v)){if(Aw(e,g,v))return null;break}g=v<e.length?v+1:v}s?o.push(b):n+=b,t=g;continue}if(d===96){const m=fF(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=lf(e,m.nextPos);continue}const f=lF(e,t,u);let h;if(f===a)h=c;else{const m=U0(f);if(m===null)return null;h=`<p>${m}</p>
|
|
78
|
+
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&rF(e,p))return null;s?o.push(h):n+=h,t=lf(e,p)}return s?o.join(""):n}const pF={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Sp(e,t,n={},s){Ys(n);const o={...pF,...s||{}},i=po(t);if(o.fallbackOnGlobalState!==!1&&i)return ug(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Ja(n,i,()=>e.core.parse(t,n,e).tokens);let r=If(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=vF(r,o.maxChunks)),$f(t,r))return ug(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Ja(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return ug(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Ja(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&&mF(f,l),gF(a,f),l+=u.lineCount}return a})}function If(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(s.push({start:r,end:f,lineCount:l}),r=f,o=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
79
|
+
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=yF(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const y=e.charCodeAt(g);if(y===32||y===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let y=g;for(;y<h&&e[y]===v;)y++;const T=y-g;T>=3&&(u?u.marker===v&&T>=u.length&&(u=null):u={marker:v,length:T})}}const _=p-f;o+=_,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=_);const b=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(b)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),s}function $f(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!hF(e,t[o].end))return!0;return!1}function hF(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 s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function mF(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function gF(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function vF(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+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}),s+=l}return n}function yF(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const PT=4e6,RT=8e4,kF=1e4,bF=200,_F=1e4,wF=200;function DT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function SF(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function xr(e){return e.length===0?0:Zn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function CF(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function xF(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
80
|
+
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){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<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function AF(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 CF(e,n+1,e.length-1)?!xF(e,t):!1}function TF(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??_F:e.options.fullChunkSizeChars??kF),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??wF:e.options.fullChunkSizeLines??bF);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="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 ud=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=xr(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=If(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if($f(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,xr(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!AF(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,xr(this.pending)),null;const n=If(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,xr(this.pending)),null;const s=$f(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:xr(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=If(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=$f(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:xr(this.pending)}]:n;this.commitRanges(s,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:xr(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+xr(this.pending);return TF(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(cd(e)&&cr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=po(t);n&&(P0(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&SF(r,a),this.options.retainTokens!==!1&&DT(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&R0(t),n}catch(s){throw this.markedGlobalStateReason&&(cr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){oT(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 MF(e,t,n={},s={}){Ys(n);const o=new ud(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function EF(e,t,n={},s={}){Ys(n);const o=new ud(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function IF(e,t,n,s={},o={}){Ys(s);const i=new ud(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function $F(e,t,n,s={},o={}){Ys(s);const i=new ud(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function BT(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??PT,o=e.options.autoUnboundedThresholdLines??RT;return t>=s||n>=o}function FT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??PT))return"yes";const s=e.options.autoUnboundedThresholdLines??RT;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function gu(e,t,n={},s={}){Ys(n);const o=po(t);if(cd(n)&&cr(n),s.fallbackOnGlobalState!==!1&&o)return oT(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:Zn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Ja(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new ud(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){DT(i,l)}});if(o&&P0(n,o),r.feed(t),r.flushForce(n),o&&(R0(n),s.fallbackOnGlobalState===!1)){const l=qi(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const tc=(e,t,n)=>e<t?t:e>n?n:e;function HT(e){return e.experimental?{...e,...e.experimental}:e}const Mw=[{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"}],Ew=[{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 WT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function NF(e,t=Math.max(0,e/40|0),n={}){const s=HT(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<Mw.length;l++){const a=Mw[l];if(e<=a.max){if(a.strategy!=="adaptive")return WT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:tc(Math.ceil(e/i),8e3,64e3),maxChunkLines:tc(Math.ceil(t/i),150,700),maxChunks:tc(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function Iw(e,t=Math.max(0,e/40|0),n={}){const s=HT(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<Ew.length;l++){const a=Ew[l];if(e<=a.max){if(a.strategy!=="adaptive")return WT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:tc(Math.ceil(e/i),8e3,64e3),maxChunkLines:tc(Math.ceil(t/i),150,700),maxChunks:tc(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var LF={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"]}}},OF={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},PF={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 Th(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Nf(e,t){if(Th(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const $w=e=>Th(e)?e:Promise.resolve(e);function vu(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 $n(e)}}function Jr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${vu(t[0])}="${$n(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${vu(o[0])}="${$n(o[1])}"`}return n}function zT(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function yu(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
81
|
+
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${$n(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
82
|
+
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Jr(r)}>${t}</code></pre>
|
|
83
|
+
`}return`<pre><code${Jr(e.attrs)}>${t}</code></pre>
|
|
84
|
+
`}function Cp(e){return!e.attrs||e.attrs.length===0?`<code>${$n(e.content)}</code>`:`<code${Jr(e.attrs)}>${$n(e.content)}</code>`}function o1(e){const t=$n(e.content);return e.attrs?`<pre${Jr(e.attrs)}><code>${t}</code></pre>
|
|
85
|
+
`:`<pre><code>${t}</code></pre>
|
|
86
|
+
`}function RF(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="${$n(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${$n(n[0][1])}">`}return null}function Nw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${vu(t[0][0])}="${$n(t[0][1])}">`:t.length===2?`<a ${vu(t[0][0])}="${$n(t[0][1])}" ${vu(t[1][0])}="${$n(t[1][1])}">`:`<a${Jr(t)}>`}function DF(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 Lw(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 xp(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+Jr(n);return s===0&&t&&(i+=" /"),`${i}>`}const BF={langPrefix:"language-",xhtmlOut:!1,breaks:!1},af=Object.prototype.hasOwnProperty,En={code_inline(e,t){return Cp(e[t])},code_block(e,t){return o1(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?OT(i.info).trim():"",{langName:l,langAttrs:a}=zT(r),c=n.highlight,u=$n(i.content);if(!c)return yu(i,u,r,l,n);const d=c(i.content,l,a);return Th(d)?d.then(f=>yu(i,f||u,r,l,n)):yu(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),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]],xp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
87
|
+
`:`<br>
|
|
88
|
+
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
89
|
+
`:`<br>
|
|
90
|
+
`:`
|
|
91
|
+
`},text(e,t){return $n(e[t].content)},text_special(e,t){return $n(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Ow(e,t,n){const s=e.info?OT(e.info).trim():"",{langName:o,langAttrs:i}=zT(s),r=t.highlight,l=$n(e.content);if(!r)return yu(e,l,s,o,t);const a=r(e.content,o,i);if(Th(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return yu(e,a||l,s,o,t)}function cf(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===En.text)return l.content.length===0?"":$n(l.content);break;case"text_special":if(o.text_special===En.text_special)return l.content.length===0?"":$n(l.content);break;case"softbreak":if(o.softbreak===En.softbreak)return r;break;case"hardbreak":if(o.hardbreak===En.hardbreak)return i;break;case"html_inline":if(o.html_inline===En.html_inline)return l.content;break;case"code_inline":if(o.code_inline===En.code_inline)return Cp(l);break}const a=o[l.type];if(!a)return xp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Nf(c,l.type)}var FF=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...En}}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 s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,_="";for(let b=0;b<e.length;b++){const g=e[b],v=g.type,y=b>0&&e[b-1].hidden?`
|
|
92
|
+
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&b+3<e.length){const I=e[b+1],k=e[b+2],M=e[b+3];if(I.type==="paragraph_open"&&I.hidden&&k.type==="inline"&&M.type==="paragraph_close"&&M.hidden){_+=`${y}<li>${this.renderInlineTokens(k.children||[],s,o)}`,b+=3;continue}}if(b+2<e.length){const I=e[b+1],k=e[b+2];if(I.type==="inline"&&k.nesting===-1&&k.tag===g.tag&&!k.hidden){const M=RF(g,y);if(M!==null){_+=`${M+this.renderInlineTokens(I.children||[],s,o)}</${g.tag}>
|
|
93
|
+
`,b+=2;continue}}}if(v==="inline"){const I=g.children||[];if(I.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
|
|
94
|
+
`:`<br>
|
|
95
|
+
`,p=s.breaks?h:`
|
|
96
|
+
`,m=!0);const k=I[0];switch(k.type){case"text":if(l===En.text){_+=$n(k.content);continue}break;case"text_special":if(a===En.text_special){_+=$n(k.content);continue}break;case"softbreak":if(c===En.softbreak){_+=p;continue}break;case"hardbreak":if(u===En.hardbreak){_+=h;continue}break;case"html_inline":if(d===En.html_inline){_+=k.content;continue}break;case"code_inline":if(f===En.code_inline){_+=Cp(k);continue}break}}_+=this.renderInlineTokens(I,s,o);continue}const T=i[v];if(!T){const I=g.attrs;if(!g.hidden){if(!I||I.length===0)switch(v){case"hr":_+=r?`<hr />
|
|
97
|
+
`:`<hr>
|
|
98
|
+
`;continue;case"heading_open":_+=`<${g.tag}>`;continue;case"heading_close":_+=`</${g.tag}>
|
|
99
|
+
`;continue;case"paragraph_open":_+=`${y}<p>`;continue;case"paragraph_close":_+=`</p>
|
|
100
|
+
`;continue;case"list_item_open":{const k=e[b+1];_+=y+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
|
|
101
|
+
`);continue}case"list_item_close":_+=`</li>
|
|
102
|
+
`;continue;case"bullet_list_open":_+=`${y}<ul>
|
|
103
|
+
`;continue;case"bullet_list_close":_+=`</ul>
|
|
104
|
+
`;continue;case"blockquote_open":_+=y+(e[b+1]&&e[b+1].nesting===-1&&e[b+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
105
|
+
`);continue;case"blockquote_close":_+=`</blockquote>
|
|
106
|
+
`;continue;case"ordered_list_open":_+=`${y}<ol>
|
|
107
|
+
`;continue;case"ordered_list_close":_+=`</ol>
|
|
108
|
+
`;continue;case"table_open":_+=`${y}<table>
|
|
109
|
+
`;continue;case"table_close":_+=`</table>
|
|
110
|
+
`;continue;case"thead_open":_+=`${y}<thead>
|
|
111
|
+
`;continue;case"thead_close":_+=`</thead>
|
|
112
|
+
`;continue;case"tbody_open":_+=`${y}<tbody>
|
|
113
|
+
`;continue;case"tbody_close":_+=`</tbody>
|
|
114
|
+
`;continue;case"tr_open":_+=`${y}<tr>
|
|
115
|
+
`;continue;case"tr_close":_+=`</tr>
|
|
116
|
+
`;continue;case"td_open":_+=`${y}<td>`;continue;case"td_close":_+=`</td>
|
|
117
|
+
`;continue;case"th_open":_+=`${y}<th>`;continue;case"th_close":_+=`</th>
|
|
118
|
+
`;continue}else if(I.length===1){const k=I[0];if(v==="ordered_list_open"&&k[0]==="start"){_+=`${y}<ol start="${$n(k[1])}">
|
|
119
|
+
`;continue}if(v==="td_open"&&k[0]==="style"){_+=`${y}<td style="${$n(k[1])}">`;continue}if(v==="th_open"&&k[0]==="style"){_+=`${y}<th style="${$n(k[1])}">`;continue}}}_+=this.renderToken(e,b,s);continue}if(v==="code_block"&&T===En.code_block){_+=o1(g);continue}if(v==="fence"&&T===En.fence){_+=Ow(g,s);continue}if(v==="html_block"&&T===En.html_block){_+=g.content;continue}const P=T(e,b,s,o,this);typeof P=="string"?_+=P:_+=Nf(P,g.type)}return _}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=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||[],s,o);continue}const c=i[a.type];c?r+=await $w(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return Jr(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(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=o&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
120
|
+
`:"",u=a?`>
|
|
121
|
+
`:">";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+Jr(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 s=()=>(n||(n={...t}),n);if(af.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),af.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(af.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(af.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...BF,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===En.code_block)return o1(t);if(i==="html_block"&&o.html_block===En.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):xp(t,r.xhtmlOut===!0);if(i==="fence"&&a===En.fence)return Ow(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Nf(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,f=s.em_open,h=s.em_close,p=s.strong_open,m=s.strong_close,_=t.xhtmlOut===!0,b=_?`<br />
|
|
122
|
+
`:`<br>
|
|
123
|
+
`,g=t.breaks?b:`
|
|
124
|
+
`;if(e.length===1)return cf(e,t,n,this,s,b,g);let v="";for(let y=0;y<e.length;y++){const T=e[y];if(T.type==="link_open"&&!u&&!d&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="link_close"&&DF(k)){const M=`${Nw(T)+cf([k],t,n,this,s,b,g)}</a>`;if(r===En.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=M+g,y+=3;continue}v+=M,y+=2;continue}}if(T.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${Nw(T)}</a>`,y+=1;continue}if(T.type==="em_open"&&!f&&!h&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="em_close"&&Lw(k)){v+=`<em>${cf([k],t,n,this,s,b,g)}</em>`,y+=2;continue}}if(T.type==="strong_open"&&!p&&!m&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="strong_close"&&Lw(k)){v+=`<strong>${cf([k],t,n,this,s,b,g)}</strong>`,y+=2;continue}}switch(T.type){case"text":if(o===En.text){const k=T.content.length===0?"":$n(T.content);if(a===En.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=k+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=k;continue}break;case"text_special":if(i===En.text_special){T.content.length!==0&&(v+=$n(T.content));continue}break;case"softbreak":if(r===En.softbreak){v+=g;continue}break;case"hardbreak":if(l===En.hardbreak){v+=b;continue}break;case"html_inline":if(a===En.html_inline){for(v+=T.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===En.code_inline){v+=Cp(T);continue}break}const P=s[T.type];if(!P){v+=T.block?this.renderToken(e,y,t):xp(T,_);continue}const I=P(e,y,t,n,this);typeof I=="string"?v+=I:v+=Nf(I,T.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await $w(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
125
|
+
`;break}}return s}},HF=FF;const WF=[],yg=4096;function zF(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
|
|
126
|
+
`,n);s===-1&&(s=t);const o=s<t;let i=n,r=0;for(;i<s;){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<s){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<s&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<s){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===s&&o)return!0}break}case 62:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 96:case 126:{let a=i;for(;a<s&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<s;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<s&&e.charCodeAt(a)===46){const c=a+1;if(c<s){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===s&&o)return!0}}break}}if(s===t)break;n=s+1}return!1}function UF(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 jF(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(!UT(e[n],t[n]))return!1;return!0}function UT(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,s=t.map;return!!n!=!!s||n&&s&&(n[0]!==s[0]||n[1]!==s[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||!UF(e.attrs,t.attrs)||!jF(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function Pw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var qF=class{core;cache=null;stats=Pw();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=Pw(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Ys(s??o?.env),!o||s&&s!==o.env){const E=s??{},D=!!n.__explicitStreamChunkFallbackSetting,R=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,H=!!n.options?.streamChunkedFallback,U=!D&&R,G=H||U,Q=n.options?.streamChunkAdaptive!==!1,V=n.options?.streamChunkTargetChunks??8,re=n.options?.streamChunkSizeChars,pe=n.options?.streamChunkSizeLines,ne=n.options?.streamChunkMaxChunks,X=!!n.__explicitStreamChunkConfig,he=n.options?.autoTuneChunks!==!1,Pe=n.options?.streamChunkFenceAware??!0,je=n.options?.streamLargeCachePolicy??"retain",it=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,ce=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let z,Y=!1;if(je==="skip"&&(Y=e.length>=it,!Y&&ce!==void 0&&(z=Zn(e),Y=z>=ce)),Y){const W=this.parseFullDocument(e,E,n,z,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",as(E,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!qi(E)?.unbounded}),W.tokens}else if(G){const W=(fe,ke,Ae)=>fe<ke?ke:fe>Ae?Ae:fe;z===void 0&&(z=Zn(e));const Z=he&&!X?Iw(e.length,z,n.options):null,ue=Z?.maxChunkChars??(Q?W(Math.ceil(e.length/V),8e3,64e3):re??1e4),ae=Z?.maxChunkLines??(Q?W(Math.ceil(z/V),150,700):pe??200),me=Z?.maxChunks??(Q?W(Math.ceil(e.length/64e3),V,32):ne),j=e.length>0&&e.charCodeAt(e.length-1)===10,ee=U&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Z?.strategy!=="plain";if((H||ee)&&(e.length>=ue*2||z>=ae*2)&&j){const fe=Sp(n,e,E,{maxChunkChars:ue,maxChunkLines:ae,fenceAware:Z?.fenceAware??Pe,maxChunks:me});return this.cache={src:e,tokens:fe,env:E,lineCount:z,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,z),this.recordChunkedParseResult(E,H?"explicit-initial-large-doc":"default-initial-large-doc"),fe}}const oe=this.parseFullDocument(e,E,n,z);return z=oe.lineCount,this.cache={src:e,tokens:oe.tokens,env:E,lineCount:z,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",as(E,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!qi(E)?.unbounded}),oe.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",as(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const i=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=po(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):po(e),a=r||l;if(a){const E=s??o.env;cr(E);const D=po(e),R=this.parseFullDocument(e,E,n),H=R.tokens,U=R.lineCount;return this.cache={src:e,tokens:H,env:E,lineCount:U,lastSegment:void 0,globalStateReason:D},this.updateCacheLineCount(this.cache,U),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",as(E,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!qi(E)?.unbounded}),H}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<c&&e.length<c*1.5&&!e.startsWith(o.src)){const E=s??o.env,D=this.parseFullDocument(e,E,n),R=D.tokens,H=D.lineCount;return this.cache={src:e,tokens:R,env:E,lineCount:H,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",as(E,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!qi(E)?.unbounded}),R}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const E=o.lineCount??Zn(o.src);let D=3;u.length>5e3?D=8:u.length>1e3?D=6:u.length>200&&(D=4),D=Math.min(D,E);let R=null;const H=n.options?.streamContextParseStrategy??"chars",U=n.options?.streamContextParseMinChars??200,G=n.options?.streamContextParseMinLines??2;let Q;const V=()=>(Q===void 0&&(Q=Zn(u)),Q),re=this.canDirectlyParseAppend(o),pe=re&&this.shouldUseUnboundedAppend(e,o,u);let ne=!1;if(!re)switch(H){case"lines":ne=V()>=G;break;case"constructs":if(u.length>=U){ne=!0;break}if(zF(u)){ne=!0;break}ne=V()>=G;break;case"chars":default:ne=u.length>=U}if(D>0&&ne){const Pe=this.getTailLines(o.src,D)+u;try{const je=this.core.parse(Pe,o.env,n).tokens,it=je.findIndex(ce=>ce.map&&typeof ce.map[1]=="number"&&ce.map[1]>D);if(it!==-1){const ce=je.slice(it),z=E-D;z!==0&&this.shiftTokenLines(ce,z),R={tokens:ce}}}catch{R=null}}else R=null;if(!R){const Pe=E;if(pe)R={tokens:gu(n,u,o.env,{mode:"stream"})},Pe>0&&this.shiftTokenLines(R.tokens,Pe);else{const je=this.core.parse(u,o.env,n);Pe>0&&this.shiftTokenLines(je.tokens,Pe),R=je}}let X=0;if(o.tokens.length>0&&R.tokens.length>0){const Pe=o.tokens[o.tokens.length-1],je=R.tokens[0];try{Pe.type==="inline"&&je.type==="inline"&&(je.children&&je.children.length>0&&(Pe.children||(Pe.children=[]),this.appendTokens(Pe.children,je.children)),Pe.content=(Pe.content||"")+(je.content||""),X=1)}catch{X=0}}const he=o.tokens.length;if(R.tokens.length>X){const Pe=o.tokens,je=R.tokens,it=Math.min(Pe.length,je.length-X);let ce=0;for(let z=it;z>0;z--){let Y=!0;for(let oe=0;oe<z;oe++){const W=Pe[Pe.length-z+oe],Z=je[X+oe];if(!UT(W,Z)){Y=!1;break}}if(Y){ce=z;break}}ce>0&&(X+=ce),je.length>X&&this.appendTokens(o.tokens,je,X)}if(o.src=e,o.globalStateReason=null,o.lineCount=E+(Q??V()),o.tokens.length>he){const Pe=this.getLastSegment(o.tokens,e,he,o.tokens.length,e.length-u.length,E);Pe?o.lastSegment=Pe:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,pe&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",as(o.env,{area:"stream",path:pe?"stream-unbounded-append":"stream-append",reason:pe?"large-delta":"safe-append",unbounded:pe}),o.tokens}const d=s??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",as(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,_=!h&&!u&&p,b=m||_,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,P=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,k=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let $=u&&o.lineCount!==void 0?o.lineCount+Zn(u):void 0;if(b){$===void 0&&($=Zn(e));const E=(V,re,pe)=>V<re?re:V>pe?pe:V,D=k&&!I?Iw(e.length,$,n.options):null,R=D?.maxChunkChars??(g?E(Math.ceil(e.length/v),8e3,64e3):y??1e4),H=D?.maxChunkLines??(g?E(Math.ceil($/v),150,700):T??200),U=D?.maxChunks??(g?E(Math.ceil(e.length/64e3),v,32):P),G=e.length>0&&e.charCodeAt(e.length-1)===10,Q=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&D?.strategy!=="plain";if((m||Q)&&(e.length>=R*2||$>=H*2)&&G){const V=Sp(n,e,d,{maxChunkChars:R,maxChunkLines:H,fenceAware:D?.fenceAware??M,maxChunks:U});return this.cache={src:e,tokens:V,env:d,lineCount:$,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,$),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),V}}const L=this.parseFullDocument(e,d,n,$),S=L.tokens;return $=L.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:$,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,$),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",as(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!qi(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=qi(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",as(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!qi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",as(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=po(e);cd(t)&&cr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?FT(n,e.length,s):"no";if(r==="yes"){const a=gu(n,e,t);return as(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?Zn(e):0)}}let l=s;if(r==="need-lines"&&(l=Zn(e),BT(n,e.length,l))){const a=gu(n,e,t);return as(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Zn(e):0),{tokens:Ja(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:Zn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
127
|
+
`))return null;const s=n??t.slice(e.length);if(!s)return null;const o=s.length;if(s.charCodeAt(o-1)!==10)return null;let i=0,r=-1;for(let a=0;a<o&&!(s.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?s:s.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
128
|
+
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(s)?null:s}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.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,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=o.lineStart+Zn(l),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
129
|
+
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.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===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??WF}getStats(){return{...this.stats}}appendTokens(e,t,n=0,s=t.length){for(let o=n;o<s;o++)e.push(t[o])}updateCacheLineCount(e,t){e.lineCount=t??Zn(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(-yg))+t,s=po(n);return e.globalStateCarry=n.length>yg?n.slice(n.length-yg):n,s&&(e.globalStateReason=s),s}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,s=e.length,o,i){if(s<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=s-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:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,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:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}}return null}getLineStartOffset(e,t,n,s){if(n!==void 0&&s!==void 0&&t>=s)return this.getLineStartOffsetFrom(e,n,t-s);if(t<=0)return 0;let o=t,i=-1;for(;o>0;){if(i=e.indexOf(`
|
|
130
|
+
`,i+1),i===-1)return e.length;o--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let s=n,o=t-1;for(;s>0;){if(o=e.indexOf(`
|
|
131
|
+
`,o+1),o===-1)return e.length;s--}return o+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,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.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,s).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??Zn(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.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,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+Zn(i);t.lineCount=m;const _=this.getDocLineCount(e,m);return r.map&&(r.map[1]=_),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.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(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).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,o.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 m=o.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const _=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,b=t.lineCount??Zn(t.src);t.tokens.splice(_,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=b+Zn(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const y=t.tokens[h.tbodyOpenIndex];y?.map&&(y.map[1]=v)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
132
|
+
`);if(t<0)return null;const n=e.indexOf(`
|
|
133
|
+
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)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,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+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=o)}}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 s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e,t=Zn(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 s=0;s<e.length;s++){const o=e[s];if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children){n??=[];for(let i=o.children.length-1;i>=0;i--)n.push(o.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 Rw={default:OF,zero:PF,commonmark:LF};function VF(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function KF(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 Dw(e){return e.experimental?{...e,...e.experimental}:e}function Yo(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 Bw(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(Yo(t,o)||Yo(e,o))return!0}return!1}function Fw(e,t,n){return Yo(t,n)||Yo(e,n)}function Hw(e,t){const n=qi(e)?.chunk;if(n?.fallback){as(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}as(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function GF(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},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=Rw[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=Dw(n),typeof n.quotes=="string"){const k=n.quotes;k.length>=4?n.quotes=[k[0],k[1],k[2],k[3]]:n.quotes=["“","”","‘","’"]}let r=Bw(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Bw(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Fw(i?.options,o,"fullChunkedFallback"),c=Fw(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new BB;let p=null;const m=()=>(p||(p=new HF(n)),p);let _=null;const b=()=>(_||(_=new qF(h)),_);let g=null;const v=()=>(g||(g=new lT),g),y=k=>!u&&!!d&&!KF(k,d),T=(k,M)=>s==="default"&&!u&&p===null&&f!==null&&k.parse===f&&y(k)&&!k.stream.enabled&&M<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.xhtmlOut===!1&&k.options.breaks===!1&&k.options.langPrefix==="language-"&&k.options.linkify===!1&&k.options.typographer===!1&&k.options.highlight===null,P=(k,M)=>s==="default"&&!u&&y(k)&&!k.stream.enabled&&!k.options.fullChunkedFallback&&M<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.linkify===!1&&k.options.typographer===!1,I={core:h,block:h.block,inline:h.inline,get linkify(){const k=v();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=m();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(k){const M=Dw(k);return this.options={...this.options,...M},(Yo(k,"fullChunkSizeChars")||Yo(k,"fullChunkSizeLines")||Yo(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Yo(k,"streamChunkSizeChars")||Yo(k,"streamChunkSizeLines")||Yo(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Yo(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Yo(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,_&&(_.reset(),_.resetStats())),this},configure(k){const M=typeof k=="string"?Rw[k]:k;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const $=M.components;$.core?.rules&&this.core.ruler.enableOnly($.core.rules),$.block?.rules&&this.block.ruler.enableOnly($.block.rules),$.inline?.rules&&this.inline.ruler.enableOnly($.inline.rules),$.inline2?.rules&&this.inline.ruler2.enableOnly($.inline2.rules)}return this},enable(k,M){const $=Array.isArray(k)?k:[k],L=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const E of L){if(!E)continue;const D=E.enable($,!0);for(let R=0;R<D.length;R++)S.add(D[R])}if(!M){const E=$.filter(D=>!S.has(D));if(E.length)throw new Error(`Rules manager: invalid rule name ${E.join(", ")}`)}return this},disable(k,M){const $=Array.isArray(k)?k:[k],L=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const E of L){if(!E)continue;const D=E.disable($,!0);for(let R=0;R<D.length;R++)S.add(D[R])}if(!M){const E=$.filter(D=>!S.has(D));if(E.length)throw new Error(`Rules manager: invalid rule name ${E.join(", ")}`)}return this},use(k,...M){const $=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!$)throw new TypeError("MarkdownIt.use: plugin must be a function");const L=[this,...M],S=k;return u=!0,$.apply(S,L),this},render(k,M){if(T(this,k.length)){M!==void 0&&Ys(M);const S=Tw(k);if(S!==null)return M!==void 0&&as(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const $=M??{},L=this.parse(k,$);return m().render(L,this.options,$)},async renderAsync(k,M){if(T(this,k.length)){M!==void 0&&Ys(M);const S=Tw(k);if(S!==null)return M!==void 0&&as(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const $=M??{},L=this.parse(k,$);return m().renderAsync(L,this.options,$)},renderIterable(k,M={}){const $=this.parseIterable(k,M);return m().render($,this.options,M)},async renderAsyncIterable(k,M={}){const $=await this.parseAsyncIterable(k,M);return m().renderAsync($,this.options,M)},renderInline(k,M={}){const $=this.parseInline(k,M);return m().render($,this.options,M)},validateLink:xT,normalizeLink:AT,normalizeLinkText:TT,utils:oD,helpers:{...VD},parse(k,M){if(typeof k!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&Ys(M),P(this,k.length)){const E=QB(k);if(E!==null)return M!==void 0&&as(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),E}const $=M??{};let L;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const E=FT(this,k.length);if(E==="yes"){const D=gu(this,k,$);return as(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),D}E==="need-lines"&&(L=Zn(k))}if(!this.stream.enabled){const E=k.length,D=this.options.autoTuneChunks!==!1,R=r,H=!a&&y(this),U=!!this.options.fullChunkedFallback,G=H&&E>=2e5;let Q;(U||G||L!==void 0)&&(Q=L??Zn(k));const V=(U||G)&&D&&!R?NF(E,Q,this.options):null;if(U||G){const re=Q??0;if(U?E>=(this.options.fullChunkThresholdChars??2e4)||re>=(this.options.fullChunkThresholdLines??400):G){if(V&&V.strategy!=="plain"){const pe=Sp(this,k,$,{maxChunkChars:V.maxChunkChars,maxChunkLines:V.maxChunkLines,fenceAware:V.fenceAware,maxChunks:V.maxChunks});return M&&Hw(M,U?"explicit-full-chunk":"default-large-string"),pe}if(U){const pe=(Y,oe,W)=>Y<oe?oe:Y>W?W:Y,ne=this.options.fullChunkAdaptive!==!1,X=this.options.fullChunkTargetChunks??8,he=pe(Math.ceil(E/X),8e3,64e3),Pe=pe(Math.ceil(re/X),150,700),je=ne?he:this.options.fullChunkSizeChars??1e4,it=ne?Pe:this.options.fullChunkSizeLines??200,ce=ne?pe(Math.ceil(E/64e3),X,32):this.options.fullChunkMaxChunks,z=Sp(this,k,$,{maxChunkChars:je,maxChunkLines:it,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ce});return M&&Hw(M,"explicit-full-chunk"),z}}}if(L!==void 0&&y(this)&&BT(this,E,Q??L)){const re=gu(this,k,$);return as(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),re}}const S=po(k);return as(M,{area:"parse",path:"plain",reason:"default-plain"}),Ja($,S,()=>h.parse(k,$,this).tokens)},parseIterable(k,M={}){return Ys(M),MF(this,k,M)},parseAsyncIterable(k,M={}){return Ys(M),EF(this,k,M)},parseIterableToSink(k,M,$={}){return Ys($),IF(this,k,M,$)},parseAsyncIterableToSink(k,M,$={}){return Ys($),$F(this,k,M,$)},parseInline(k,M={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Ys(M),cd(M)&&cr(M);const $=h.createState(k,M,this);return $.inlineMode=!0,h.process($),$.tokens}};if(I.stream={enabled:!!n.stream,parse(k,M){return I.stream.enabled?b().parse(k,M,I):I.parse(k,M??{})},reset(){b().reset()},peek(){return _?_.peek():[]},stats(){return _?_.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){_&&_.resetStats()}},i?.components){const k=i.components;k.core?.rules&&I.core.ruler.enableOnly(k.core.rules),k.block?.rules&&I.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&I.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&I.inline.ruler2.enableOnly(k.inline2.rules)}return d=VF(I),f=I.parse,I}var YF=GF;const jT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],QF=["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"],qT=["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"],XF=["svg","g","path"],ZF=["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"],JF=["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"],eH=["action","data","href","src","srcset","poster","xlink:href","formaction"],tH=["script"],nH=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],ta=new Set(jT),sH=new Set(qT),Gu=new Set([...jT,...QF,...qT,...XF]),VT=new Set([...Gu,...ZF]),oH=new Set(JF),iH=new Set(eH),dd=new Set(tH),KT=new Set(nH);function GT(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const rH={amp:"&",bsol:"\\",colon:":",newline:`
|
|
134
|
+
`,sol:"/",tab:" "};function YT(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return rH[String(o??"").toLowerCase()]??t})}const uf=new Set(["http","https","mailto","tel"]),lH=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Cl=new Set(["http","https"]);function QT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function aH(e,t,n){if(!ku(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function ku(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function cH(e,t){return t==="href"||t==="xlink:href"?ku(e,t)?uf:Cl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Cl:(ku(e,t),uf)}function zl(e,t={}){const n=GT(YT(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=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 s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=QT(n);return i?i==="file"?!aH(n,s,o):ku(s,o)?lH.has(i):!cH(s,o).has(i):!1}function uH(e){const t=YT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=QT(GT(t).toLowerCase());return n==="http"||n==="https"}function dH(e,t={}){const n=String(e??"").trim();return n?zl(n,t)?"":n:""}function Ww(e){return dH(e,{tagName:"img",attrName:"src"})}function fH(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,_){return f[h].nesting===1&&f[h].attrJoin("class",t),_.renderToken(f,h,p,m,_)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(f,h,p,m){let _,b=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);const y=Math.floor((_-g)/a);if(y<i)return!1;_-=(_-g)%a;const T=f.src.slice(g,_),P=f.src.slice(_,v);if(!c(P,T))return!1;if(m)return!0;let I=h;for(;I++,!(I>=p||(g=f.bMarks[I]+f.tShift[I],v=f.eMarks[I],g<v&&f.sCount[I]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[I]-f.blkIndent>=4)){for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);if(!(Math.floor((_-g)/a)<y)&&(_-=(_-g)%a,_=f.skipSpaces(_),!(_<v))){b=!0;break}}const k=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=I;const $=f.push("container_"+t+"_open","div",1);$.markup=T,$.block=!0,$.info=P,$.map=[h,I],f.md.block.tokenize(f,h+1,I);const L=f.push("container_"+t+"_close","div",-1);return L.markup=f.src.slice(g,_),L.block=!0,f.parentType=k,f.lineMax=M,f.line=I+(b?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 pH(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 s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let _=0;_<a.length;_++){const b=a[_];if(b==="\\"){_++;continue}if(!u&&b==="'"){c=!c;continue}if(!c&&b==='"'){u=!u;continue}if(!c&&!u&&b===":"){d=_;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 m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[p]=m}return l}function hH(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(fH,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
135
|
+
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{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("{"),m=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,m?.startsWith("{")){let T=0,P=-1;for(let I=0;I<m.length;I++)if(m[I]==="{"?T++:m[I]==="}"&&T--,T===0){P=I+1;break}P>0&&(h=m.slice(0,P))}h||(f=d||void 0)}if(o)return!0;const _=!!i.env.__markstreamFinal;let b=n+1,g=!1;for(;b<=s;){const T=i.bMarks[b]+i.tShift[b],P=i.eMarks[b];if(i.src.slice(T,P).trim()===":::"){g=!0;break}b++}g||(b=s);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!_},f&&v.attrSet("data-args",f),h)try{const T=JSON.parse(h);for(const[P,I]of Object.entries(T)){const k=I!=null&&typeof I=="object";v.attrSet(`data-${P}`,k?JSON.stringify(I):String(I))}}catch{const T=pH(h);if(T)for(const[P,I]of Object.entries(T)){const k=I!=null&&typeof I=="object";v.attrSet(`data-${P}`,k?JSON.stringify(I):String(I))}else v.attrSet("data-attrs",h)}const y=[];for(let T=n+1;T<b;T++){const P=i.bMarks[T]+i.tShift[T],I=i.eMarks[T];y.push(i.src.slice(P,I))}if(y.some(T=>T.trim().length>0)){let T=y.join(`
|
|
136
|
+
`);T.endsWith(`
|
|
137
|
+
`)||(T+=`
|
|
138
|
+
`),T.endsWith(`
|
|
139
|
+
|
|
140
|
+
`)||(T+=`
|
|
141
|
+
`);const P=i.tokens[i.tokens.length-1];P&&(P.raw=T);const I=[];i.md.block.parse(T,i.md,i.env,I),i.tokens.push(...I)}return g&&i.push("vmr_container_close","div",-1),i.line=g?b+1:b,!0},{alt:["paragraph","reference","blockquote","list"]})}function No(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function Mh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const mH=/^[a-z][a-z0-9_-]*$/;function zw(e){return mH.test(String(e??"").trim().toLowerCase())}function ri(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return zw(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 s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":zw(o)?o:""}function bc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=ri(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function gH(...e){const t=new Set,n=[];for(const s of e)for(const o of bc(s))t.has(o)||(t.add(o),n.push(o));return n}function vH(e){const t=bc(e);return{key:t.join(","),tags:t}}function XT(e){return ri(e)}function yH(e,t){const n=String(e??""),s=ri(t);if(!s)return!1;const o=No(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function ZT(e,t){const n=ri(t);return!!n&&!Gu.has(n)&&!yH(e,n)}function kH(e,t){const n=String(e??""),s=ri(t);if(!s)return n;const o=No(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const JT=ta,bH=Gu,eM=new Set(sH);eM.delete("details");const _H=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,wH=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,i1=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,SH=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Ap(e){return(e.match(i1)?.[1]??"").toLowerCase()}function j0(e){return/^\s*<\s*\//.test(e)}function q0(e,t){return JT.has(t)||/\/\s*>\s*$/.test(e)}function CH(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=Ap(i);if(r===t){if(j0(i)){if(n===0)return s;n--;continue}q0(i,r)||n++}}return-1}function xH(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=Ap(o);if(i===t){if(j0(o)){n>0&&n--;continue}q0(o,i)||n++}}return n}function Uw(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${No(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function AH(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${No(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function Tp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function TH(e){const t=e;return t.meta||(t.meta={}),t.meta}function kg(e,t,n){const s=TH(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function MH(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${No(h)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!s.length))for(const p of s)p.raw+=h,p.inner+=h},l=()=>{!s.length||!o||(r(`
|
|
142
|
+
`),o=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<s.length;m++)s[m].raw+=h,m<s.length-1&&(s[m].inner+=h);const p=s.pop();kg(p.token,p.raw,p.inner)},u=h=>{const p=s[s.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${No(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const _=m??(h.type==="html_inline"?Ap(p):"");if(!(_&&t.has(_))){r(p);return}const b=j0(p),g=!b&&q0(p,_);if(b){if(!s.length||s[s.length-1].tag!==_){r(p);return}c(p);return}if(r(p),g){kg(h,p,"");return}s.push({tag:_,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)?o=!1:l(),!s.length&&!i(p)){o=!1;continue}let m=0,_=!0;for(const b of h.children){const g=Tp(b),v=b.type==="html_inline"?Ap(g):"",y=v&&t.has(v);let T=g;if(_&&p&&g&&(s.length||y)){const P=p.indexOf(g,m);if(P!==-1)a(p.slice(m,P)),T=p.slice(P,P+g.length),m=P+g.length;else{if(s.length&&!y)continue;_=!1}}f(b,T,v)}_&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=Tp(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
|
|
143
|
+
`:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)kg(h.token,h.raw,h.inner)}function EH(e){return/^\s*<\s*[!?]/.test(e)}function IH(e){const t=new Set(bH);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function jw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function $H(e,t){let n=null;for(const i of e.matchAll(_H)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();jw(l,t)&&Vn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(wH)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();jw(l,t)&&Vn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function NH(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function LH(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(NH(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(i1);if(!h){i("<",c),u=d+1;continue}const p=Vn(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),_=(h[1]??"").toLowerCase();t.has(_)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=$H(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=Tp(a),o=s.buffer;const c=Vn(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=Tp(a),u=(c.match(i1)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Vn(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.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:o??void 0}}const OH=["a","span","strong","em","b","i","u"];function PH(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=ri(f);h&&n.add(h)}const s=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=ri(String(v??""));y&&p.add(y)}const _=IH(Array.from(p)),b=new Set(OH);for(const v of p)b.add(v);return{autoCloseInlineTagSet:b,commonHtmlTags:_,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!_.has(v)||eM.has(v)}},o=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 m=p.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const _={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[_]},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:m}=s(f);for(const _ of h){const b=_;if(b.type!=="inline"||!Array.isArray(b.children))continue;const g=String(b.content??""),v=b.children.length?b.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=LH(v,p);if(b.children=y.children,y.pendingBuffer){const T=g.lastIndexOf(y.pendingBuffer);if(T!==-1){const P=g.slice(0,T);b.content=P,typeof b.raw=="string"&&(b.raw=P)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}MH(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:_}=s(f),b=[];for(let g=0;g<h.length;g++){const v=h[g];if(b.length>0){const[T,P]=b[b.length-1];if(g!==P){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const I=String(v.content??v.raw??"");if(I){const k=h[P],M=`${String(k.content||"")}
|
|
144
|
+
${I}`,$=Vn(M),L=$===-1?null:Uw(M,T,$+1);if(L){const S=M.slice(0,L.end),E=M.slice(L.end);k.content=S,k.loading=!1,h.splice(g,1),b.pop();const D=d(k,E)?[]:c(E,u(h,g,"paragraph"));D.length&&h.splice(g,0,...D),g--;continue}k.content=M,k.loading!==!1&&(k.loading=!0)}h.splice(g,1),g--;continue}}const y=o(v);if(y){if(EH(y))continue;const T=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),P=/^\s*<\s*\//.test(y);if(!T||!_(T))continue;if(i(v,y),!P)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(y)&&AH(y,T)>0&&b.push([T,g]);else if(b.length>0&&T&&b[b.length-1][0]===T){const[,I]=b[b.length-1],k=h[I];k.content=`${String(k.content||"")}
|
|
145
|
+
${y}`,k.loading=!1,b.pop(),h.splice(g,1),g--}continue}else if(b.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const T=v.content||"",P=new RegExp(`<\\s*\\/\\s*${b[b.length-1][0]}\\s*>`,"i").test(T);if(T){const[,I]=b[b.length-1],k=h[I];k.content=`${k.content||""}
|
|
146
|
+
${T}`,k.loading!==!1&&(k.loading=!P)}P&&b.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=I=>{let k=g.get(I);return k||(k=new RegExp(`<\\s*${I}\\b`,"i"),g.set(I,k)),k},T=I=>{let k=v.get(I);return k||(k=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),v.set(I,k)),k},P=[];for(let I=0;I<h.length;I++){const k=h[I],M=String(k.content??"");if(P.length>0){const L=P[P.length-1],S=h[L.index],E=k.type==="html_block"?T(L.tag).exec(M):null;if(E){const H=E.index+E[0].length,U=M.slice(0,H),G=M.slice(H);S.content=`${String(S.content??"")}
|
|
147
|
+
${U}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${L.tag}>`,raw:`</${L.tag}>`}),P.pop();const Q=d(S,G)?[]:c(G,u(h,I,"paragraph"));Q.length?h.splice(I,1,...Q):(h.splice(I,1),I--);continue}if(k.type!=="inline")continue;const D=Array.isArray(k.children)?k.children:[],R=CH(D,L.tag);if(R!==-1){const H=D.slice(0,R+1),U=D.slice(R+1),G=H.map(Q=>String(Q?.content??Q?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
148
|
+
${G}`,Array.isArray(S.children)&&S.children.push(...H),U.length){const Q=U.map(V=>String(V.content??V.raw??"")).join("");if(Q.trim()){const V=Q.replace(/^\s+/,"");if(d(S,Q))h.splice(I,1),I--;else if(V.startsWith("<"))h.splice(I,1,{type:"html_block",content:V});else{const re=c(Q,u(h,I,"paragraph"));h.splice(I,1,...re)}}else h.splice(I,1),I--}else h.splice(I,1),I--;P.pop();continue}S.content=`${String(S.content??"")}
|
|
149
|
+
${M}`,Array.isArray(S.children)&&S.children.push(...D),h.splice(I,1),I--;continue}if(k.type!=="inline")continue;const $=Array.isArray(k.children)?k.children:[];for(const L of m)if(($.length?xH($,L):y(L).test(M)&&!T(L).test(M)?1:0)>0){P.push({tag:L,index:I});break}}}{let g=0;for(let v=0;v<h.length;v++){const y=h[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const k=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(k.startsWith("!")||k.startsWith("?")){v.loading=!1;continue}if(m.has(k)){const R=String(v.content??""),H=Vn(R),U=H===-1?null:Uw(R,k,H+1);v.loading=U?!1:v.loading!==void 0?v.loading:!0;const G=U?.start??-1,Q=U?U.end-U.start:0;if(G!==-1){const V=R.slice(0,G+Q);let re="";H!==-1&&H<G&&(re=R.slice(H+1,G)),v.children=[{type:k,content:re,raw:V,attrs:[],tag:k,loading:!1}],v.content=V,v.raw=V;const pe=c(R.slice(G+Q)||"","text");pe.length&&h.splice(g+1,0,...pe)}else v.children=[{type:k,content:"",raw:R,attrs:[],tag:k,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(k))continue;v.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let $;for(;($=M.exec(v.content||""))!==null;)$[1],$[2]||$[3]||$[4];const L=String(v.content??""),S=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(L),E=S?S.index:-1,D=S?S[0].length:0;if(E!==-1){const R=L.slice(0,E+D),H=(L.slice(E+D)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:R,tag:k,loading:!1}],v.content=R,v.raw=R,H&&h.splice(g+1,0,H.startsWith("<")?{type:"html_block",content:H}:{type:"text",content:H,raw:H})}else v.children=[{type:"html_block",content:v.content,tag:k,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const k=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=v.children[1],$=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&$===k)continue;p.has(k)?(v.children[0].loading=!0,v.children[0].tag=k,v.children.push({type:"html_inline",tag:k,loading:!0,content:`</${k}>`})):v.children=[{type:"html_block",loading:!0,tag:k,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const k=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(k))continue;v.children=[{type:"html_block",loading:!1,tag:k,content:v.children.map(M=>M.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),T=v,P=T.children[0];if(P?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(T.children.length=0);continue}const I=String(P.content??y).match(SH)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(y)||JT.has(I)){T.children=[{type:"html_inline",content:y}];continue}T.children.length=0}}})}function RH(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 DH(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];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&&!RH(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,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}),o+=2}}})}const tM=/\.([a-z0-9]{1,15})$/i,BH=/[_()[\]{}<>]/u,FH=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,HH=/[?#@]/u,WH=/[\\/]/u,zH=/^[\p{L}\p{N}./\\-]+$/u,UH=/^[A-Za-z0-9-]{1,63}$/u,jH=/^xn--[a-z0-9-]{2,59}$/i,qH=/^(?:[A-Z]{1,6}|\d{1,8})$/u,VH=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,KH=/文件名\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,GH=/文件名\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,YH=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,QH=new Set(["ai","md","py","rs","sh","zip"]),nM=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),XH=new Set([...nM,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),ZH=new Set(["com","dev","io","page","site"]),JH=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),eW=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 Yu(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function bg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Yu(n)?n:void 0}function qw(e,t){if(!Yu(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 Vw(e){const t=fd(e);return Yu(t)?t:void 0}function tW(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Kw(e,t){if(!Yu(t))return;const n=String(e??"").trim().split(/\s+/u).map(tW).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>Mp(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>Mp(o,{marketTicker:!0}))&&(s.marketTicker=!0),Yu(s)?s:void 0}function al(e,t=!1){let n;return{options(s){return t||s==null?qw(e,n):qw(e,bg(Vw(s),Kw(s,n)))},remember(s){const o=Vw(s);n=t?bg(n,o):bg(o,Kw(s,n))},reset(){n=void 0}}}function Gw(e){return UH.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function nW(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Gw(n)||jH.test(n)?t.every(Gw):!1}function sM(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function sW(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function oW(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oM(e,t,n){const s=sW(t);return sM(e)&&oW(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function fd(e){const t=String(e??"");return{explicitFilename:KH.test(t),filename:GH.test(t),marketTicker:YH.test(t)}}function iW(e){return nW(e.split(/[\\/]/)[0]??"")}function rW(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function lW(e){if(BH.test(e)||!zH.test(e))return!0;if(WH.test(e))return!iW(e);const t=e.replace(tM,"");return sM(t)?!0:t.split(".").filter(Boolean).some(rW)}function aW(e,t,n){if(!(n?XH:nM).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?VH:qH).test(s)}function Mp(e,t={}){if(!e||FH.test(e)||HH.test(e))return!1;const n=e.match(tM);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return aW(e,s,t.marketTicker===!0)?!0:eW.has(s)?!QH.has(s)||t.filename?!0:lW(e):!!(t.explicitFilename&&ZH.has(s)||t.filename&&JH.has(s))}const Yw=["!"];function uo(e){return{type:"text",content:e,raw:e}}function xl(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 Al(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 Ar(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function cW(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(uo(t))}}function Qw(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function uW(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function dW(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function fW(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function pW(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=hW(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function hW(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=fd(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=fW(e,s,i),l=uW(o);if(o.markup==="linkify"&&r&&!oM(r,l,t)&&Mp(r,n)){e.splice(s,i-s+1,uo(r));continue}const a=Qw(l,Yw);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Qw(u.content,Yw);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let b=c+1;b<i;b++){const g=e[b];g?.type==="text"&&typeof g.content=="string"&&(p+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let _=l;if(a!==-1)_=l.slice(0,a);else if(p){const b=encodeURI(p);if(b&&l.endsWith(b))_=l.slice(0,l.length-b.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(_=l.slice(0,v))}}_!==l&&dW(o,_),p&&e.splice(i+1,0,uo(p));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+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(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(uo(r));const c=i[1],u=l[1].length;xl(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Ar(c,d,!e[s+4]?.content?.startsWith(")"))),Al(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(uo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(uo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(h+=e[s+4]?.content||"",e[s+4].content=""),xl(a,f),a.push(Ar(c,h,!e[s+4]?.content?.startsWith(")"))),Al(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(uo(p)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Ar(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(uo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(Ar(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(uo(u)),e.splice(s-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(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-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[s-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;xl(f,p)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let p=s+1;p<e.length;p++){const m=d?d[1].length:e[s-3].markup.length,_=e[p];if(m===1&&_.type==="em_close")break;if(m===2&&_.type==="strong_close")break;if(m===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const 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;Al(f,p)}e.splice(s-u,c,...f),s-=f.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(uo(l)),xl(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(Ar(a,c,u)),Al(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(uo(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(uo(r)),xl(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(Ar(l,a,c)),Al(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(uo(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(uo(r)),xl(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const f=e[s+2].attrs?.find(h=>h[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(f||c)+e[s+5].content,e[s+5].content=""):c=f||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const f=(e[s+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[s+2]?.content?.slice(0,f)||"",e[s+2].content="")}i.push(Ar(a,c,d)),Al(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];xl(a,2),a.push(Ar(r,l,!1)),Al(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;cW(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function mW(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=gW(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function gW(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 vW(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=yW(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function yW(e){let t=0;const n=new Set,s=new Set;let o=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 m=e[p];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const b=e[_];h==="__"&&(m?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.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"){o++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const b=e[_];h==="_"&&(m?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.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,s.add(o))}else f==="em_close"&&(s.has(o)&&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),o--,o<0&&(o=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=kW(l),l}function kW(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.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(s),t.push(o),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(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=bW(e,n+6);if(u){t.push(s),t.push(o),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(s)}return t}function bW(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function _W(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=TW(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function Xw(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function Zw(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function Jw(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 iM(e,t){if(!e.startsWith("|")||e.includes(`
|
|
150
|
+
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function _g(e){return iM(e)!==null}function rM(e){return/^:?-+:?$/.test(e.trim())}function wW(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(rM)}function SW(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function CW(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(rM)&&SW(n)}function xW(e){return e==="|"||e==="|:"}function AW(e){const t=iM(e);return t!==null&&t.every(n=>!n.includes(":"))}function TW(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
151
|
+
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
152
|
+
`),d=!t&&!r.includes(`
|
|
153
|
+
`)&&/\r?\n$/.test(n)&&_g(r);if(!t&&(r.includes(`
|
|
154
|
+
`)&&u.length===0&&_g(a)&&CW(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Jw(p)),h=[...Xw(),...f,...Zw()];s.splice(o-1,3,...h)}else if(r.includes(`
|
|
155
|
+
`)&&u.length===0&&_g(a)&&wW(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Jw(p)),h=[...Xw(),...f,...Zw()];s.splice(o-1,3,...h)}else r.includes(`
|
|
156
|
+
`)&&u.length===0&&AW(a)&&xW(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function MW(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-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=s;let l=0,a=t;for(;a<o;){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 EW=MW;const IW=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Ep=IW.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),$W=/\\[a-z]+/i,lM="(?:\\\\|\\u0008)",NW=new RegExp(String.raw`${lM}(?:${Ep})\s*\{[^}]+\}`,"i"),LW=new RegExp(String.raw`(?:${lM})?(?:${Ep})\s*\{`,"i"),OW=/\\(?:text|frac|left|right|times)/,PW=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,RW=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,DW=/[A-Z]+\s*\([^)]+\)/i,BW=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,FW=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,HW=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,WW={"\b":"\\b","\v":"\\v","\f":"\\f"};function zW(e){let t="";for(const n of e)t+=WW[n]??n;return t}function Ha(e){if(!e)return!1;const t=zW(e),n=t.trim();if(HW.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=$W.test(t),o=NW.test(t),i=LW.test(t),r=OW.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=PW.test(t)&&!RW.test(t),c=DW.test(t),u=BW.test(n),d=FW.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||f||h}const aM="__markstreamMathPluginApplied",r1=80,cM=2e4,e2=cM+4096;function uM(e){return!!e[aM]}function UW(e){e[aM]=!0}const dM=["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"],jW=["cdot","mathbf{","partial","mu_{"],fM=dM.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pM="[ \r\b\f\v]",qW=new RegExp(`([^\\\\])(${jW.map(e=>e).join("|")})+`,"g"),VW=/span\{([^}]+)\}/,KW=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,GW=/(^|[^\\])\\\r?\n/g,YW=/(^|[^\\])\\$/g,QW=new RegExp(`(${pM})|(${fM})\\b`,"g"),t2=new Map,n2=new Map;function XW(e){if(!e)return QW;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=t2.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${pM})|(${o})\\b`,"g");return t2.set(n,i),i}function ZW(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=n2.get(s);if(o)return o;const i=e?[Ep,fM].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Ep].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return n2.set(s,r),r}const s2={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function o2(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function i2(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function Tr(e,t){const n=t?.commands??dM,s=t?.escapeExclamation??!0,o=t?.commands==null,i=XW(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&s2[u]!==void 0)return`\\${s2[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});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=ZW(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(VW,"span\\{$1\\}").replace(KW,"\\operatorname{span}\\{$1\\}"),l=l.replace(GW,`$1\\\\
|
|
157
|
+
`),l=l.replace(YW,"$1\\\\"),l=l.replace(qW,"$1\\$2"),l}function r2(e){const t=e.trim();return!(!Ha(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 hM(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,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===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function Ip(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function JW(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+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([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function pd(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function l1(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(pd(e,s)){n=s+1;continue}return s}return-1}function wg(e,t){let n=t;for(;n<e.length;){const s=l1(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function ru(e,t,n=0){let s=Math.max(0,n);for(;s<e.length;){const o=e.indexOf(t,s);if(o===-1)return-1;if(!pd(e,o))return o;s=o+Math.max(1,t.length)}return-1}function l2(e,t,n=0,s=e.length,o=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,s));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Ip(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}pd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function V0(e,t,n){const s=Xu(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!Xu(s.slice(0,o)).trim()||pd(s,o))return-1;const i=hM(s);if(Ip(i,o))return-1;const r=l2(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>l2(s,n,0,o,i))return-1;return o}function Qu(e){return e===" "||e===" "}function Xu(e){let t=e.length;for(;t>0&&Qu(e[t-1]);)t--;return e.slice(0,t)}function a2(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
158
|
+
`&&t++;return t}function c2(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function ez(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(o===t){n++;continue}if(!Qu(o))return!1}return n>=3}function tz(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let s=0;for(;t[n]==="-";)s++,n++;return s<3?!1:(t[n]===":"&&n++,n===t.length)}function nz(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(tz)}function sz(e){let t=0;if(!c2(e[t]))return!1;for(;c2(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Qu(e[t+1])}function mM(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&&Qu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Qu(t[1])||sz(t)||ez(t)||nz(t))}function u2(e,t){return e?t?`${e}
|
|
159
|
+
${t}`:e:t}function a1(e){const t=String(e??"").trim();return t?Ha(t):!1}function d2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function gM(e){if(e.length<=e2)return{source:e,lineOffset:0};let t=e.length-e2;const n=e.indexOf(`
|
|
160
|
+
`,t);return n===-1?{source:"",lineOffset:a2(e)}:(t=n+1,{source:e.slice(t),lineOffset:a2(e.slice(0,t))})}function vM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=gM(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-r1-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=Xu(s[r]);if(l&&!mM(l)){for(const[a,c]of i)if(V0(l,a,c)!==-1)return!0}}return!1}function oz(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=gM(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-r1-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=Xu(o[l]);for(const[c,u]of r){const d=V0(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>r1){h=!0;break}const m=o[p],_=ru(m,u);if(_!==-1){const b=u2(f,m.slice(0,_));if(!a1(b)){h=!0;break}const g=m.slice(_+u.length),v=g.trim()?`suffix:${d2(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,_,d2(b),v].join(":")}if(mM(m)){h=!0;break}if(f=u2(f,m),f.length>cM){h=!0;break}}if(!h&&a1(f))return["pending",c,s+l,d].join(":")}}return null}function Sg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function iz(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function Cg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function rz(e,t){UW(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)},s=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,v)=>{let y=v;for(;y<g.length&&(g[y]===" "||g[y]===" ");)y++;if(y===v||!(g[y]===`
|
|
161
|
+
`||g[y]==="\r"&&g[y+1]===`
|
|
162
|
+
`))return v;const T=g.slice(v,y),P=a.push("text","",0);return P.content=T,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,y=a.src[g];if(v>=3&&(!y||/\s/.test(y))){const T=a.push("text","",0);return T.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let m=p,_=p;const b=p;for(const[g,v]of f){const y=a.src,T=hM(y),P=JW(y,u);let I=!1;g==="$$"&&m!==b&&(m=b);let k=-1,M=-1,$=0;const L=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const R=a.push("text_special","",0);R.content=S==="\\)"?")":"(",R.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let R=0;for(;R<S.length;){const H=l1(S,R);if(H===-1){const Pe=S.slice(R);if(Pe){const je=a.push("text","",0);je.content=Pe,a.pos=a.pos+Pe.length,m=a.pos}break}if(H>0&&S[H-1]==="$"||H+1<S.length&&S[H+1]==="$"){const Pe=S.slice(R,H+1);if(Pe){const je=a.push("text","",0);je.content=Pe,a.pos=a.pos+Pe.length,m=a.pos}R=H+1;continue}const U=S.slice(R,H);if(U){const Pe=a.push("text","",0);Pe.content=U,a.pos=a.pos+U.length,m=a.pos}const G=wg(S,H+1);if(G===-1){const Pe=S.slice(H),je=a.push("text","",0);je.content=Pe,a.pos=a.pos+Pe.length,m=a.pos;break}const Q=S.slice(H+1,G),V=Q.includes("`"),re=!Q||!Q.trim(),pe=S[G+1],ne=Sg(Q,pe),X=Cg(Q);if(!V&&!re&&!ne&&!X){const Pe=a.push("math_inline","math",0);Pe.content=Tr(Q,t),Pe.markup="$",Pe.raw=`$${Q}$`,Pe.loading=!1,a.pos=a.pos+(G-H+1),m=a.pos,R=G+1;continue}const he=a.push("text","",0);he.content="$",a.pos=a.pos+1,m=a.pos,R=H+1}return}const E=S.indexOf("![");if(E!==-1){if(E>0){const U=S.slice(0,E),G=a.push("text","",0);G.content=U,a.pos=a.pos+U.length,m=a.pos}const R=S.slice(E).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,U,G]=R,Q=G.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),V=Q?Q[1]:G,re=Q&&Q[2]?Q[2]:null,pe=a.push("image","img",0);pe.attrs=[["src",V],["alt",U]],re&&pe.attrs.push(["title",re]),pe.content=U,pe.children=[{type:"text",content:U,tag:""}],a.pos=a.pos+R[0].length,m=a.pos;const ne=S.slice(E+R[0].length);ne&&L(ne);return}const H=a.push("text","",0);H.content=S,a.pos=a.pos+S.length,m=a.pos;return}const D=a.push("text","",0);D.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=y.length);){const S=y.indexOf(g,m);if(S===-1)break;if(pd(y,S)){m=S+Math.max(1,g.length);continue}const E=Ip(T,S);if(E){m=E[1];continue}const D=Ip(P,S);if(D){m=D[1];continue}if(S===k&&m===M){if($++,$>2){m=S+Math.max(1,g.length);continue}}else $=0,k=S,M=m;if(g==="("&&S>0){let ne=S-1;for(;ne>=0&&y[ne]===" ";)ne--;if(ne>=0&&y[ne]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&y[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<y.length-1&&y[S+1]==="$"){m=S+2;continue}const R=g==="$"?wg(y,S+g.length):EW(y,S+g.length,g,v);if(R===-1){const ne=y.slice(S+g.length);if(ne.includes(g)){m=y.indexOf(g,S+g.length);continue}if(R===-1){const X=g==="$"&&iz(ne);if(u&&!c&&!X&&Ha(ne)&&!ne.includes("`")){if(m=S+g.length,I=!0,!l){a.pending="";const he=_?y.slice(_,m):y.slice(0,m),Pe=o2(he)%2===1;if(_)L(y.slice(_,m));else{let je=y.slice(0,m);je.endsWith(g)&&(je=je.slice(0,je.length-g.length)),L(je)}if(Pe){const je=i2(he)?.marker??"**",it=a.push("strong_open","",0);it.markup=je;const ce=a.push("math_inline","math",0);ce.content=Tr(ne,t),ce.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ce.raw=`${g}${ne}${v}`,ce.loading=!0,it.content=ne,a.push("strong_close","",0)}else{const je=a.push("math_inline","math",0);je.content=Tr(ne,t),je.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",je.raw=`${g}${ne}${v}`,je.loading=!0}a.pos=y.length}m=y.length,_=m}break}}const H=y.slice(S+g.length,R),U=H.includes("`"),G=!H||!H.trim(),Q=g==="$",V=y[R+v.length],re=Q&&Sg(H,V),pe=Q&&Cg(H);if(c?U||G||re||pe:U||G||re||pe||!Q&&!Ha(H)){m=R+v.length;const ne=y.slice(a.pos,m);a.pending||(L(ne),_=m);continue}if(I=!0,!l){const ne=y.slice(a.pos-(a.pending??"").length,S);let X=y.slice(0,m)?y.slice(_,S):ne;const he=o2(X)%2===1;S!==a.pos&&he&&(X=a.pending+y.slice(a.pos,S));const Pe=he?i2(X):null,je=Pe?.marker??"**";if(a.pending!==X)if(a.pending="",he)if(Pe){const it=X.slice(Pe.index+je.length);L(X.slice(0,Pe.index));const ce=a.push("strong_open","",0);ce.markup=je;const z=a.push("text","",0);z.content=it,a.push("strong_close","",0)}else L(X);else L(X);if(he){const it=a.push("strong_open","",0);it.markup=je;const ce=a.push("math_inline","math",0);ce.content=Tr(H,t),ce.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ce.raw=`${g}${H}${v}`,ce.loading=!1;const z=y.slice(R+v.length).startsWith(je);return z&&a.push("strong_close","",0),a.pos=d(y,R+v.length),m=a.pos,_=m,z||a.push("strong_close","",0),!0}else{const it=a.push("math_inline","math",0);it.content=Tr(H,t),it.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",it.raw=`${g}${H}${v}`,it.loading=!1}}return m=d(y,R+v.length),_=m,a.pos=m,!0}if(I){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const E=l1(y,S);if(E===-1)break;if(E+1<y.length&&y[E+1]==="$"){S=E+2;continue}if(E>0&&y[E-1]==="$"){S=E+1;continue}const D=wg(y,E+1);if(D===-1)break;const R=y.slice(E+1,D),H=R.includes("`"),U=!R||!R.trim(),G=y[D+1],Q=Sg(R,G),V=Cg(R);if(!H&&!U&&!Q&&!V){const re=y.slice(m,E);re&&L(re);const pe=a.push("math_inline","math",0);pe.content=Tr(R,t),pe.markup="$",pe.raw=`$${R}$`,pe.loading=!1,m=D+1,S=D+1}else L("$"),S=E+1}S<y.length&&L(y.slice(S))}else m<y.length&&L(y.slice(m));a.pos=y.length}return!0}}return!1},o=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),_=!1,b="",g="",v=!1,y="",T=!1;for(const[re,pe]of h)if(m.startsWith(re))if(re.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){_=!0,b=re,g=pe;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){_=!0,b=re,g=pe;break}continue}else{const ne=u.tokens[u.tokens.length-1];if(ne&&ne.type==="list_item_open"&&ne.mark==="-"&&m.slice(re.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const X=m.indexOf("]");if(m.slice(X).trim()!=="]")continue;const he=m.slice(re.length,X);if(re==="["?r2(he):Ha(he)){_=!0,b=re,g=pe;break}continue}}else{_=!0,b=re,g=pe;break}else if((re==="$$"||re==="\\[")&&m.endsWith(re)&&l+1<a){const ne=V0(m,re,pe);if(ne===-1)continue;y=Xu(m.slice(0,ne)),T=!0;const X=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(X,u.eMarks[l+1]).trim(),v=!0,_=!0,b=re,g=pe;break}if(!_)return!1;if(c&&!T)return!0;const P=m.indexOf(b),I=P+b.length,k=!f&&b==="["?m.indexOf("\\]",I):-1,M=k>=0?"\\]":g,$=k>=0?k:ru(m,g,I);if(!v&&$>b.length){const re=m.slice(P+b.length,$),pe=u.push("math_block","math",0);pe.content=Tr(re),pe.markup=b==="$$"?"$$":b==="["?"[]":"\\[\\]",pe.map=[l,l+1],pe.raw=`${b}${re}${M}`,pe.block=!0,pe.loading=!1,u.line=l+1;const ne=m.slice($+M.length);return ne.trim()&&n(u,ne,l),!0}let L=l,S="",E=!1,D="",R=l;const H=v?m:m===b?"":m.slice(b.length),U=!f&&b==="\\["?"]":"",G=ru(H,g);if(G!==-1){const re=G;S=H.slice(0,re),D=H.slice(re+g.length),R=v?l+1:l,E=!0,L=R}else for(H&&!v&&(S=H),L=l+1;L<a;L++){const re=u.bMarks[L]+u.tShift[L],pe=u.eMarks[L],ne=u.src.slice(re,pe),X=ne.trim();if(!f&&b==="["&&X==="\\]"){g="\\]",E=!0;break}if(U&&ne.trim()===U){g=U,E=!0;break}if(X===g){E=!0;break}else if(!f&&b==="["&&ne.includes("\\]")){E=!0;const he=ne.indexOf("\\]");g="\\]";const Pe=ne.slice(0,he);Pe&&(S+=(S?`
|
|
163
|
+
`:"")+Pe),D=ne.slice(he+g.length),R=L;break}else if(ru(ne,g)!==-1){E=!0;const he=ru(ne,g),Pe=ne.slice(0,he);Pe&&(S+=(S?`
|
|
164
|
+
`:"")+Pe),D=ne.slice(he+g.length),R=L;break}S+=(S?`
|
|
165
|
+
`:"")+ne}if((!d||f)&&!E)return!1;const Q=/^\s*!\[/.test(S);if(!(T?!Q&&a1(S):b==="$$"?!Q:b==="["?r2(S):Ha(S)))return!1;if(c)return!0;y&&n(u,y,l);const V=u.push("math_block","math",0);return V.content=Tr(S),V.markup=b==="$$"?"$$":b==="["?"[]":"\\[\\]",V.raw=`${b}${S}${S.startsWith(`
|
|
166
|
+
`)?`
|
|
167
|
+
`:""}${g}`,V.map=[l,L+1],V.block=!0,V.loading=!E,u.line=L+1,D.trim()&&n(u,D,R),!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:o(r,l,a,c)};e.inline.ruler.before("escape","math",s),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function lz(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function az(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new YF({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!zl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&rz(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&hH(i),e.enableFixIndentedCodeBlock!==!1&&DH(i),pW(i),vW(i),mW(i),_W(i),lz(i),PH(i,{customHtmlTags:e.customHtmlTags}),i}function Ul(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>Ul(n))),t}function cz(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function uz(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function dz(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function df(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...Kn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const f2=/\r?\n[ \t]*`+\s*$/,yM=["diff ","index ","--- ","+++ ","@@ "],fz=/\r?\n/;function pz(e){const t=String(e??"");return t?yM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function p2(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function hz(e,t){const n=[],s=[],o=[],i=[],r=e.split(fz),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!yM.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);o.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(p.startsWith("+")){const m=p.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{p2(n,s,o,i);const m=a&&p.startsWith(" ")?p.slice(1):p;n.push(m),s.push(m)}},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&&pz(p)||c(p)}(t||o.length>0||i.length>0)&&p2(n,s,o,i);const d=n.join(`
|
|
168
|
+
`),f=s.join(`
|
|
169
|
+
`);return{original:t&&l&&d?`${d}
|
|
170
|
+
`:d,updated:t&&l&&f?`${f}
|
|
171
|
+
`:f}}function K0(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!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(f2.test(a)&&(a=a.replace(f2,"")),r){const{original:c,updated:u}=hz(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function mz(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function gz(){return{type:"hardbreak",raw:`\\
|
|
172
|
+
`}}function vz(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Kn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let xg=null;const Ag=new WeakMap;function h2(){return xg||(xg={customTagSet:null,allowedTagSet:$h()}),xg}function kM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function bM(e){return/^<\s*\//.test(e)}function _M(e,t){return/\/\s*>\s*$/.test(t)||ta.has(e)}function yz(e){if(!e||e.length===0)return h2();const t=Ag.get(e);if(t)return t;const n=e.map(ri).filter(Boolean);if(!n.length){const o=h2();return Ag.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:$h({customHtmlTags:e})};return Ag.set(e,s),s}function wM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function kz(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function $p(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function bz(e,t,n){const s=e.slice();return $p(s,"href")||s.push(["href",t]),n!=null&&!$p(s,"title")&&s.push(["title",n]),s}function c1(e){return e.map(wM).join("")}function Lf(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:Lf(s.children)});continue}t.push(s)}return t}function _z(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=kM(r),a=bM(r),c=_M(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function Tg(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?_z(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:c1(s),innerTokens:o,nextIndex:i}}function wz(e,t,n,s,o,i,r){const l=String(e.content??""),a=kM(l),{customTagSet:c,allowedTagSet:u}=yz(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Tg(t,n,a).closed){const T=wM(e);return[{type:"text",content:T,raw:T},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=bM(l),f=_M(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const T=Tg(t,n,a),P=Mh(l),I=T.innerTokens,k=String($p(P,"href")??""),M=$p(P,"title"),$=M==null?null:String(M),L=bz(P,k,$),S=Lf(I.length?s(I,o,i,r):[]),E=I.length?c1(I):k||"";return!S.length&&E&&S.push({type:"text",content:E,raw:E}),[{type:"link",href:k,title:$,text:E,attrs:L,children:S,loading:!T.closed,raw:T.html||l},T.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=Tg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Lf(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=Lf(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,_=!h.closed,b=!1;if(!h.closed){const T=`</${a}>`;m.toLowerCase().includes(T.toLowerCase())||(m+=T),b=!0,_=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const T=y[1],P=y[2]||y[3]||y[4]||"";g.push([T,P])}if(c?.has(a)){const T=kz(e);return[{type:a,tag:a,attrs:g,content:T?T.inner:h.innerTokens.length?c1(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:T?.raw??m,loading:e.loading||_,autoClosed:b},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:_,autoClosed:b},h.nextIndex]}function SM(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=>SM(t)).join(""):String(e.content??"")}function Sz(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>SM(t)).join("")}function m2(e,t=!1){let n=e.attrs??[],s=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,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=Sz(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.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:o,alt:l,title:c,raw:u,loading:t}}function Cz(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function xz(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Kn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function Az(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function Np(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function Tz(e,t,n){const s=e.slice();return Np(s,"href")||s.push(["href",t]),n!=null&&!Np(s,"title")&&s.push(["title",n]),s}function ff(e,t,n){const s=e[t],o=Az(s.attrs),i=String(Np(o,"href")??""),r=Np(o,"title"),l=r==null?null:String(r),a=Tz(o,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(_=>_.type==="strong_open")){const _=String(h.content??""),b=String(h.raw??_),g=Ul(h);g.content=_.slice(0,-2),g.raw=b.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=Kn(f,void 0,void 0,n),m=p.map(_=>{const b=_;return"content"in _?String(b.content??""):String(b.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function g2(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 Mz(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function v2(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Kn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const Ez=/\\([\\()[\]`$|*_\-!])/g;function Iz(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(Ez,"$1")===t))return n}function Yc(e,t,n,s){const o=[];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={...s,__insideStrong:!0};return o.push(...Kn(l,Iz(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function $z(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...Kn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function Nz(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Kn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function Lz(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const Oz=/[^~]*~{2,}[^~]+/,Pz=/\*\*/,Rz=/[[_*^~]/,Dz=/\\([\\()[\]`$|*_\-!])/g,G0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),Bz=/\s/u,Fz=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,Hz=/\p{P}/u,Wz=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,zz=/:\/\//;function Uz(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 CM(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&G0.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function el(e){return!!e&&Bz.test(e)}function tl(e){return!!e&&(Fz.test(e)||Hz.test(e))}function jz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||el(s)?!1:!(tl(s)&&n&&!el(n)&&!tl(n))}function qz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||el(n)?!1:!(tl(n)&&s&&!el(s)&&!tl(s))}function Vz(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?CM(e,s):t.indexOf("*",s);if(i===-1)break;if(qz(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function Kz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||el(s)?!1:!(tl(s)&&n&&!el(n)&&!tl(n))}function Gz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||el(n)?!1:!(tl(n)&&s&&!el(s)&&!tl(s))}function Yz(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(Gz(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function Qz(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&G0.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function Xz(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&G0.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function Zz(e,t,n){const s=Xz(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const Jz=/[\p{L}\p{N}]/u,eU=/^[\p{L}\p{N}]+$/u;function u1(e){return e?Jz.test(e):!1}function xM(e){return e?eU.test(e):!1}function bu(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:u1(s)&&u1(o)}}function tU(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=bu(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!xM(e.slice(s.end,o.start)))return o.end}return-1}function nU(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function sU(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=bu(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function oU(e){return e?Wz.test(e)||zz.test(e):!1}function iU(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Kn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=fd(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function m(z,Y){const oe=e.length===1?t:String(Y.content??""),W=[],Z=tU(z);if(Z!==-1){T(z.slice(0,Z),z.slice(0,Z));const ae=z.slice(Z);return ae&&($({type:"text",content:ae,raw:ae}),u--),u++,!0}if(Oz.test(z)){const ae=z.indexOf("~~");ae!==-1&&W.push({type:"strikethrough",index:ae})}if(Pz.test(z)){const ae=z.indexOf("**");ae!==-1&&W.push({type:"strong",index:ae})}if(/[^*]*\*[^*]+/.test(z)){const ae=oe?CM(oe,0):z.indexOf("*");if(oe&&ae===-1)return!1;ae!==-1&&W.push({type:"emphasis",index:ae})}W.sort((ae,me)=>ae.index!==me.index?ae.index-me.index:ae.type===me.type?0:ae.type==="strong"?-1:me.type==="strong"?1:0);const ue=W[0];if(!ue)return!1;if(ue.type==="strikethrough"){const ae=ue.index,me=ae>-1?z.slice(0,ae):"";if(me&&T(me,me),ae===-1)return u++,!0;const j=z.indexOf("~~",ae+2),ee=j===-1?z.slice(ae+2):z.slice(ae+2,j),fe=j===-1?"":z.slice(j+2),{node:ke}=v2([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ee,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),y(ke),fe&&($({type:"text",content:fe,raw:fe}),u--),u++,!0}if(ue.type==="strong"){const ae=ue.index,me=ae>-1?z.slice(0,ae):"";if(me&&T(me,me),ae===-1)return u++,!0;if(t&&ae===0){let Ie=!1,de=0;for(;de<z.length&&z[de]==="*";)de++;if(t.startsWith("\\*")&&(Ie=!0),Ie){let Me=0,Ke=0;for(;Ke<t.length&&Me<de;)if(t[Ke]==="\\"&&Ke+1<t.length&&t[Ke+1]==="*")Me+=1,Ke+=2;else{if(t[Ke]==="*")break;Ke++}if(Me>=2)return T(z,z),u++,!0}}if(t&&(z.match(/\*/g)||[]).length>Uz(t))return T(z.slice(me.length),z.slice(me.length)),u++,!0;const j=bu(z,ae);if(j.len>=3){const Ie=sU(z,ae+j.len);if(Ie!==-1){const de=z.slice(ae+j.len,Ie);if(nU(de)){const{node:Me}=Yc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:de,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,s);p(),y(Me);const Ke=z.slice(Ie+3);return Ke&&($({type:"text",content:Ke,raw:Ke}),u--),u++,!0}}}if(!Kz(z,ae)){const Ie=z.slice(ae,ae+j.len);T(Ie,Ie);const de=z.slice(ae+j.len);return de&&($({type:"text",content:de,raw:de}),u--),u++,!0}const ee=Yz(z,ae+2);let fe="",ke="";if(ee.index!==-1){fe=z.slice(ae+2,ee.index),ke=z.slice(ee.index+2);const Ie=ee.index,de=bu(z,Ie);if(j.intraword&&de.intraword&&!xM(fe)||!fe&&j.len>=4&&j.intraword)return T(z.slice(me.length),z.slice(me.length)),u++,!0}else{if(d||ee.sawInvalidClose||j.intraword)return T(z.slice(me.length),z.slice(me.length)),u++,!0;fe=z.slice(ae+2),ke=""}if(!fe&&/^\*+$/.test(ke))return T(z,z),u++,!0;const{node:Ae}=Yc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:fe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),y(Ae),ke&&($({type:"text",content:ke,raw:ke}),u--),u++,!0}if(ue.type==="emphasis"){let ae=ue.index;ae===-1&&(ae=0);const me=z.slice(0,ae);if(me&&T(me,me),!jz(z,ae)){T(z[ae],z[ae]);const Ie=z.slice(ae+1);return Ie&&($({type:"text",content:Ie,raw:Ie}),u--),u++,!0}const j=bu(z,ae),ee=Vz(oe,z,ae+1),fe=ee.index,ke=e[u+1];if(s?.final&&ke?.type==="em_open"&&fe!==-1&&z.slice(ae+1,fe).trim()!==z.slice(ae+1,fe)||fe===-1&&(ee.sawInvalidClose||s?.final||j.intraword||!u1(z[ae+1])))return T(z.slice(ae),z.slice(ae)),u++,!0;const{node:Ae}=df([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:fe>-1?z.slice(ae+1,fe):z.slice(ae+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),y(Ae),fe!==-1&&fe<z.length-1){const Ie=z.slice(fe+1);Ie&&($({type:"text",content:Ie,raw:Ie}),u--)}return u++,!0}return!1}function _(z,Y){if(!z.includes("`"))return!1;const W=(ke=>{for(let Ae=0;Ae<ke.length;Ae++){if(ke[Ae]!=="`")continue;let Ie=0;for(let de=Ae-1;de>=0&&ke[de]==="\\";de--)Ie++;if(Ie%2===0)return Ae}return-1})(z);if(W===-1)return!1;let Z=1;for(let ke=W+1;ke<z.length&&z[ke]==="`";ke++)Z++;const ue="`".repeat(Z),ae=W+Z,me=z.indexOf(ue,ae);if(me===-1){if(Z===1){const Ae=z.slice(0,W),Ie=z.slice(W+1);return Ae&&(m(Ae,Y)?u--:T(Ae,Ae)),g({type:"inline_code",code:Ie,raw:String(Ie)}),u++,!0}let ke=z;for(let Ae=u+1;Ae<e.length;Ae++)ke+=String((e[Ae].content??"")+(e[Ae].markup??""));return u=e.length-1,T(ke,ke),u++,!0}p();const j=z.slice(0,W),ee=z.slice(W+Z,me),fe=z.slice(me+Z);return j&&(m(j,Y)?u--:T(j,j)),g({type:"inline_code",code:ee,raw:String(ee??"")}),fe&&($({type:"text",content:fe,raw:fe}),u--),u++,!0}function b(z){const Y=l?.__markdownIt;if(!Y||e.length<=1||!e.some(ue=>ue?.type==="math_inline")||!Rz.test(z))return null;const oe=Y.parseInline(z,{__markstreamFinal:!!s?.final});if(!Array.isArray(oe)||oe.length===0)return null;const W=(oe.find(ue=>ue?.type==="inline")?.children??[]).filter(ue=>!(ue?.type==="text"&&String(ue.content??"")===""));if(!W.length||!W.some(ue=>ue?.type!=="text")||W.length===1&&W[0]?.type==="text"&&String(W[0].content??"")===z)return null;const Z=Kn(W,z,n,s);return Z.length?Z:null}function g(z){p(),a.push(z)}function v(z){p();const Y=Ul(z);a.push(Y)}function y(z){g(z)}function T(z,Y){c?(c.content+=z,c.raw+=Y??z):(c={type:"text",content:String(z??""),raw:String(Y??z??"")},a.push(c))}function P(z,Y){if(!z)return;const oe=Kn([{...Y,type:"text",content:z,raw:z}],z,n,s);if(oe.length===1&&oe[0]?.type==="text"){const W=oe[0];T(String(W.content??""),String(W.raw??W.content??""));return}for(const W of oe)y(W)}function I(z,Y){return String(z.markup??"").startsWith(Y)}function k(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 M(z,Y){let oe=z;const W=String(Y.content??"");return oe.endsWith("\\")&&!I(Y,"\\\\")&&!W.endsWith("\\\\")&&(oe=oe.slice(0,-1)),oe.endsWith("(")&&!I(Y,"\\(")&&!W.endsWith("\\(")&&(oe=oe.slice(0,-1)),/\*+$/.test(oe)&&!I(Y,"\\*")&&!W.endsWith("\\*")&&(oe=oe.replace(/\*+$/,"")),oe}for(;u<e.length;){const z=e[u];$(z)}function $(z){switch(z.type){case"text":S(z);break;case"softbreak":c?(c.content+=`
|
|
173
|
+
`,c.raw+=`
|
|
174
|
+
`):(c={type:"text",content:`
|
|
175
|
+
`,raw:`
|
|
176
|
+
`},a.push(c)),u++;break;case"code_inline":y(Cz(z)),u++;break;case"html_inline":{const[Y,oe]=wz(z,e,u,Kn,t,n,s);y(Y),u=oe;break}case"link_open":E(z);break;case"image":ne(z)||(p(),y(m2(z)),u++);break;case"strong_open":{p();const{node:Y,nextIndex:oe}=Yc(e,u,z.content,s);y(Y),u=oe;break}case"em_open":{p();const{node:Y,nextIndex:oe}=df(e,u,s);y(Y),u=oe;break}case"s_open":{p();const{node:Y,nextIndex:oe}=v2(e,u,s);y(Y),u=oe;break}case"mark_open":{p();const{node:Y,nextIndex:oe}=vz(e,u,s);y(Y),u=oe;break}case"ins_open":{p();const{node:Y,nextIndex:oe}=xz(e,u,s);y(Y),u=oe;break}case"sub_open":{p();const{node:Y,nextIndex:oe}=$z(e,u,s);y(Y),u=oe;break}case"sup_open":{p();const{node:Y,nextIndex:oe}=Nz(e,u,s);y(Y),u=oe;break}case"sub":p(),y({type:"subscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`~${String(z.content??"")}~`}),u++;break;case"sup":p(),y({type:"superscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`^${String(z.content??"")}^`}),u++;break;case"emoji":{p();const Y=e[u-1];Y?.type==="text"&&/\|:-+/.test(String(Y.content??""))?T("",""):y(dz(z)),u++;break}case"checkbox":p(),y(cz(z)),u++;break;case"checkbox_input":p(),y(uz(z)),u++;break;case"footnote_ref":p(),y(mz(z)),u++;break;case"footnote_anchor":{p();const Y=z.meta??{};g({type:"footnote_anchor",id:String(Y.label??z.content??""),raw:String(z.content??"")}),u++;break}case"hardbreak":p(),y(gz()),u++;break;case"fence":p(),y(K0(e[u])),u++;break;case"math_inline":p(),!z.content&&z.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(g2({...z,content:e[u+1].content})),u+=2):y(g2(z)),u++;break;case"reference":R(z);break;case"text_special":T(String(z.content??""),String(z.content??"")),u++;break;default:{const Y=z;if(z.type==="link"&&Y.href!=null&&s?.validateLink&&!s.validateLink(String(Y.href))){p();const oe=String(Y.text??"");T(oe,oe),u++}else X(z)||U(z)||Q(z)||H(z)||v(z),u++;break}}}function L(z,Y,oe,W){const Z=Lz({...Y,content:z});if(c){c.content+=M(Z.content,Y),c.raw+=Z.raw;return}const ue=oe?.tag==="br"&&e[u-2]?.content==="[";W||(Z.content=M(Z.content,Y)),c=Z,c.center=ue,a.push(c)}function S(z){const Y=String(z.content??""),oe=e.length===1&&Y.includes("\\")&&typeof t=="string"?String(t):"";let W=oe?Qz(oe):Y.replace(Dz,"$1");if(z.content==="<"||W==="1"&&e[u-1]?.tag==="br"){u++;return}const Z=W.indexOf("$");Z!==-1&&Z===W.lastIndexOf("$")&&W.endsWith("$")&&(W=W.slice(0,-1)),W.endsWith("undefined")&&!t?.endsWith("undefined")&&(W=W.slice(0,-9));let ue=a.length,ae="";for(let fe=a.length-1;fe>=0;fe--){const ke=a[fe];if(ke.type!=="text")break;ue=fe,ae=String(ke.content??"")+ae}ue<a.length&&(W.startsWith(ae)?(c=null,a.length=ue):c=a[a.length-1]);const me=e[u+1];if((W==="`"||W==="|"||W==="$")&&!I(z,`\\${W}`)||/^\*+$/.test(W)&&!I(z,"\\*")){u++;return}if(!me&&/[^\]]\s*\(\s*$/.test(W)&&(W=W.replace(/\(\s*$/,"")),!W){u++;return}if(pe(W)||he(W))return;if(!(W.includes("*")||W.includes("_")||W.includes("~")||W.includes("`")||W.includes("[")||W.includes("!")||W.includes("$")||W.includes("|")||W.includes("("))){L(W,z,e[u-1],me),u++;return}if(ce(W))return;const j=e[u-1];if(W==="["&&!me?.markup?.includes("*")&&!I(z,"\\[")||W==="]"&&!j?.markup?.includes("*")&&!I(z,"\\]")){u++;return}if(_(Y,z)||it(W)||(e[u+1]?.type!=="link_open"||k(W))&&je(W,z))return;const ee=b(Y);if(ee){p();for(const fe of ee)y(fe);u++;return}m(W,z)||(L(W,z,j,me),u++)}function E(z){if(D(z))return;if(Pe()){const{node:me,nextIndex:j}=ff(e,u,s),ee=String(me.text||me.href||"");T(ee,ee),u=j;return}p();const{node:Y,nextIndex:oe}=ff(e,u,s);u=oe;const W=Y.text||Y.href||"";if(z.markup==="linkify"&&!oM(W,Y.href,t)&&Mp(W,l?.__linkifyDemotionContext)){T(W,W);return}const Z=Y.children.length===1&&Y.children[0]?.type==="text";if(Y.loading&&t&&Y.text===Y.href&&Z){const me=iU(t,Y.href);me&&(Y.text=me,Y.children=[{type:"text",content:me,raw:me}],Y.raw=`[${me}](${Y.href}${Y.title?` "${Y.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(Y.href)){T(Y.text,Y.text);return}const ue=z.attrs?.find(([me])=>me==="href")?.[1],ae=String(ue??"");if(t&&ae){const me=t.indexOf("](");if(me!==-1){const j=t.indexOf(")",me+2);j===-1?Y.loading=!0:Y.loading&&t.slice(me+2,j).includes(ae)&&(Y.loading=!1)}}H(Y)||g(Y)}function D(z){if(z.markup!=="linkify")return!1;const{node:Y,nextIndex:oe}=ff(e,u,s);return G(Y,oe)?(u=oe,!0):!1}function R(z){p(),y(Mz(z)),u++}function H(z){if(z.type!=="link")return!1;const Y=a[a.length-1];if(!Y||Y.type!=="text")return!1;const oe=String(Y.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!oe)return!1;const W=z,Z=String(W.href??""),ue=String(W.text??""),ae=String(oe[2]??""),me=Z.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Z||!(ue===Z||ue===me||oU(ue)))return!1;const j=String(oe[1]??"");return j?(Y.content=j,Y.raw=j):a.pop(),g({...z,text:ae,children:[{type:"text",content:ae,raw:ae}],raw:`[${ae}](${Z}${W.title?` "${W.title}"`:""})`}),!0}function U(z){if(z.type!=="link")return!1;const Y=z,oe=String(Y.href??"");return oe?G({href:oe,title:Y.title==null||Y.title===""?null:String(Y.title),loading:!!Y.loading},u+1):!1}function G(z,Y){const oe=a[a.length-1];if(oe?.type!=="image"||oe.src||!oe.loading||!String(oe.raw??"").endsWith("]("))return!1;const W=e[Y],Z=String(W?.content??"");if(W?.type!=="text"||!Z.startsWith(")"))return!1;a.pop(),c=null;const ue=String(oe.alt??"");g({type:"image",src:z.href,alt:ue,title:z.title,raw:``,loading:!!z.loading});const ae=Z.slice(1),me=Ul(W);return me.content=ae,me.raw=ae,h()[Y]=me,!0}function Q(z){if(z.type!=="link")return!1;const Y=a[a.length-1],oe=e[u-1];if(!Y||Y.type!=="text"||oe?.type!=="text")return!1;const W=String(Y.content??""),Z=String(oe.content??"");if(!W.endsWith("!")||!Z.endsWith("!")||I(oe,"\\!"))return!1;const ue=W.slice(0,-1);ue?(Y.content=ue,Y.raw=ue,c=Y):(a.pop(),c=null);const ae=z,me=String(ae.text??ae.children?.map(fe=>String(fe?.content??fe?.raw??"")).join("")??""),j=String(ae.href??""),ee=ae.title==null||ae.title===""?null:String(ae.title);return g({type:"image",src:j,alt:me,title:ee,raw:``,loading:!!ae.loading}),!0}function V(z,Y="",oe=null){const W=String(z.alt??z.raw??"");return{type:"link",href:Y,title:oe,text:W,children:[z],raw:`[${W}](${Y}${oe?` "${oe}"`:""})`,loading:!0}}function re(z){const Y=z.startsWith(";return{type:"image",src:"",alt:W===-1?oe.replace(/\]$/,""):oe.slice(0,W),title:null,raw:Y,loading:!0}}function pe(z){const Y=z.indexOf("[![");if(Y===-1||typeof t=="string"&&e.length===1&&Zz(t,Y,"["))return!1;const oe=z.slice(0,Y);return oe&&T(oe,oe),g(V(re(z.slice(Y+1)))),u++,!0}function ne(z){if(s?.final)return!1;const Y=e[u-1];if(Y?.type!=="text"||!String(Y.content??"").endsWith("[")||I(Y,"\\["))return!1;const oe=a[a.length-1];if(oe?.type==="text"&&oe.content.endsWith("[")){const W=oe.content.slice(0,-1);W?(oe.content=W,oe.raw=W,c=oe):(a.pop(),c=null)}return g(V(m2(z))),u++,!0}function X(z){if(z.type!=="link")return!1;const Y=z,oe=String(Y.raw??""),W=String(Y.text??"");if(!oe.startsWith("[![")&&!W.startsWith("!["))return!1;const Z=Y.title==null||Y.title===""?null:String(Y.title);return g(V({type:"image",src:String(Y.href??""),alt:W.replace(/^!\[/,"").replace(/\]$/,""),title:Z,raw:oe.startsWith("[)return!1;const Y=e[u-2];if(Y?.type==="text"&&String(Y.content??"").endsWith("[")&&I(Y,"\\["))return!1;const oe=a[a.length-1];if(oe?.type!=="image"&&oe?.type!=="link")return!1;const W=oe,Z=oe?.type==="link"&&Array.isArray(W.children)&&W.children.length===1&&W.children[0]?.type==="image"?a.pop():null,ue=Z?Z.children[0]:a.pop();if(!ue||ue.type!=="image")return!1;const ae=e[u+1];let me=String(Z?.href??""),j=Z?.title==null?null:String(Z.title),ee=!0;if(ae?.type==="link_open"){const{node:ke,nextIndex:Ae}=ff(e,u+1,s);me=ke.href,j=ke.title,ee=!0,u=Ae}else{if(me=z.slice(2),me.includes('"')){const ke=me.split('"');me=String(ke[0]??"").trim(),j=ke[1]==null?null:String(ke[1]).trim()}u++}const fe=V(ue,me,j);return fe.loading=ee,g(fe),!0}function Pe(){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 je(z,Y){const oe=z.indexOf("[");if(oe===-1)return!1;let W=z.slice(0,oe);const Z=z.indexOf("](",oe);if(Z!==-1){const ue=e[u+2];let ae=z.slice(oe+1,Z);if(ae.includes("[")){const Ie=ae.indexOf("[");W+=z.slice(0,oe+Ie+1);const de=oe+Ie+1;ae=z.slice(de+1,Z)}const me=e[u+1];if(z.endsWith("](")&&me?.type==="link_open"&&ue){const Ie=e[u+4];let de=4,Me=!0;if(Ie?.type==="text"){const lt=String(Ie.content??"");if(lt.startsWith(")")){Me=!1;const yt=lt.slice(1);if(yt){const kt=Ul(Ie);kt.content=yt,kt.raw=yt,h()[u+4]=kt}else de++}else lt==="."&&de++}P(W,Y);const Ke=String(ue.content??"");return s?.validateLink&&!s.validateLink(Ke)?T(ae,ae):g({type:"link",href:Ke,title:null,text:ae,children:[{type:"text",content:ae,raw:ae}],loading:Me}),u+=de,!0}const j=z.indexOf(")",Z),ee=j!==-1?z.slice(Z+2,j):"",fe=j===-1;let ke=W.match(/\*+$/);if(ke&&(W=W.replace(/\*+$/,"")),P(W,Y),ke||(ke=ae.match(/^\*+/)),!d&&ke){const Ie=ke[0].length;ae=ae.replace(/^\*+/,"").replace(/\*+$/,"");const de=[];if(Ie===1?de.push({type:"em_open",tag:"em",nesting:1}):Ie===2?de.push({type:"strong_open",tag:"strong",nesting:1}):Ie===3&&(de.push({type:"strong_open",tag:"strong",nesting:1}),de.push({type:"em_open",tag:"em",nesting:1})),de.push({type:"link",href:ee,title:null,text:ae,children:[{type:"text",content:ae,raw:ae}],loading:fe}),Ie===1){de.push({type:"em_close",tag:"em",nesting:-1});const{node:Me}=df(de,0,s);y(Me)}else if(Ie===2){de.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Me}=Yc(de,0,void 0,s);y(Me)}else if(Ie===3){de.push({type:"em_close",tag:"em",nesting:-1}),de.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Me}=Yc(de,0,void 0,s);y(Me)}else{const{node:Me}=df(de,0,s);y(Me)}}else s?.validateLink&&!s.validateLink(ee)?T(ae,ae):g({type:"link",href:ee,title:null,text:ae,children:[{type:"text",content:ae,raw:ae}],loading:fe});const Ae=j!==-1?z.slice(j+1):"";return Ae&&($({type:"text",content:Ae,raw:Ae}),u--),u++,!0}return!1}function it(z){const Y=z.indexOf("![");if(Y===-1)return!1;const oe=z.slice(0,Y);return oe&&!c?c={type:"text",content:oe,raw:oe}:oe&&c&&(c.content+=oe),c&&(a.push(c),c=null),g(re(z.slice(Y))),u++,!0}function ce(z){if(!(z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Y=z.slice(1).match(/[^\s\]]/);if(Y===null)return u++,!0;if(Y&&/x/i.test(Y[0])){const oe=Y[0]==="x"||Y[0]==="X";return g({type:"checkbox_input",checked:oe,raw:oe?"[x]":"[ ]"}),u++,!0}return!1}return a}function rU(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function lU(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 s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function aU(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function _c(e,t,n){const s=e[t],o=[],i=al(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=aU(c)?Ul(c):c,d=e[a-1];u!==c&&(lU(u),rU(u));const f=String(u.content??"");l.push({type:"paragraph",children:Kn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=wc(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]=_c(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Q0(e,a,i.options(),Y0);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
177
|
+
`)},r+1]}function cU(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=al(s,!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:Kn(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]=_c(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=wc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Eh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
178
|
+
${r.map(c=>c.raw).join(`
|
|
179
|
+
`)}
|
|
180
|
+
:::`},a+1]}const uU=new Set(["warning","info","note","tip","danger","caution"]);function dU(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 s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return uU.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function fU(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const f=d.slice(o.length).trim();f&&(i=f)}}else{const d=dU(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=al(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_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 m=f.length-1;m>=0;m--){const _=f[m];if(_.type==="text"&&/:+/.test(_.content)){h=m;break}}const p={type:"paragraph",children:Kn((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]=_c(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=wc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Eh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
181
|
+
${l.map(d=>d.raw).join(`
|
|
182
|
+
`)}
|
|
183
|
+
:::`},c+1]}const pU=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function hU(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=pU.exec(String(s.info??""));return o?cU(e,t,o,n):null}const Y0={parseContainer:(e,t,n)=>fU(e,t,n),matchAdmonition:hU};function wc(e,t,n){const s=[],o=al(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:Kn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=_c(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=wc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=Q0(e,i,o.options(),Y0);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
184
|
+
`)},i+1]}function mU(e){if(e.info?.startsWith("diff"))return K0(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function gU(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=al(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=Kn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+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:Kn(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&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
185
|
+
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
186
|
+
`)},o+1]}function vU(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=al(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:Kn(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:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
187
|
+
`)}`},l+1]}function yU(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.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(s.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:Kn(a.children||[],c,void 0,n),raw:c}}function kU(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\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=Vn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=Vn(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 AM(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 s=Vn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=ta.has(n),l=Mh(o),a=(s===-1?-1:kU(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
188
|
+
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function bU(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 _U(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function TM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function MM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return TM(n)?n:void 0}function wU(e,t,n){const s=MM(fd(t),n);if(!TM(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function SU(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+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??""),m=_U(e[c].attrs),_=a.length,b=!f&&!r,g=b?o?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Kn(h.children||[],p,void 0,wU(n,g,b?u:void 0)),raw:p,align:m}),b&&(u=MM(u,fd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
189
|
+
`)},s+1]}function CU(){return{type:"thematic_break",raw:"---"}}let Mg=null;const Eg=new WeakMap;function y2(){return Mg||(Mg={allowedTagSet:$h(),customTagSet:null}),Mg}function xU(e){if(!e||e.length===0)return y2();const t=Eg.get(e);if(t)return t;const n=e.map(ri).filter(Boolean);if(!n.length){const o=y2();return Eg.set(e,o),o}const s={allowedTagSet:$h({customHtmlTags:e}),customTagSet:new Set(n)};return Eg.set(e,s),s}function AU(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[h,p]of o)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=al(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:Kn(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]=_c(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=wc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Eh(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+=`
|
|
190
|
+
`,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
|
|
191
|
+
`),f+=`
|
|
192
|
+
`),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 TU(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function MU(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function EU(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${No(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${No(s)}(?=\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=Vn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=Vn(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 IU(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Vn(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 m=e.slice(p);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const _=m+1;return{raw:e.slice(r,_),end:_}}d=m+1;continue}if(f(p)){const m=Vn(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function d1(e){return Number.isFinite(e)&&e>0?e:0}function $U(e,t){const n=d1(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
193
|
+
`&&(s++,s===n))return o+1;return e.length}function Eh(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[yU(e,t,n),t+3];case"code_block":return[mU(s),t+1];case"fence":return[K0(s),t+1];case"math_block":return[bU(s),t+1];case"html_block":{const o=AM(s),i=o.tag?xU(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?$U(l,Number(s.map?.[0]??0)):0,u=IU(l,r,Math.max(d1(a),d1(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Vn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),m=f===-1?null:EU(d,r,f+1),_=m?.start??-1;let b="";f!==-1&&(_!==-1&&f<_?b=d.slice(f+1,_):b=d.slice(f+1)),_===-1&&(b=MU(b,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(h))!==null;){const P=y[1];if(!P||P.toLowerCase()===r)continue;const I=y[2]||y[3]||y[4]||"";g.push([P,I])}const T=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:TU(b),raw:String(u?.raw??o.raw??d),loading:T,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=SU(e,t,n);return[o,i]}case"dl_open":{const[o,i]=gU(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=vU(e,t,n);return[o,i]}case"hr":return[CU(),t+1]}return null}function Q0(e,t,n,s){const o=Eh(e,t,n);if(o)return o;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(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return AU(e,t,n)}return null}function NU(){return{type:"hardbreak",raw:`\\
|
|
194
|
+
`}}function LU(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:Kn(s.children||[],o,void 0,n),raw:o}}const k2=new WeakMap,Ih=new WeakMap,OU=["$$","\\["];function dc(){return typeof performance<"u"?performance.now():Date.now()}function X0(e,t,n){e&&(e[t]=(e[t]??0)+n)}function EM(e){return e.__timing}function Ig(e,t,n){return t&&X0(t,"parseMarkdownToStructureTotalMs",dc()-n),e}function b2(e,t,n){if(!n)return M2(e,t);const s=dc(),o=M2(e,t);return X0(n,"processTokensMs",dc()-s),o}function PU(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=bc(t);return n.length?new Set(n):null}function RU(e,t){const n=e;let s=k2.get(n);s||(s=new Map,k2.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function DU(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function pf(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=$l(o.value,n))}}function $l(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push($l(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set($l(l,t),$l(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add($l(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),pf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),pf(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),pf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!DU(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),pf(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=$l(i[r],t);return o}function IM(e,t=!0){if(!t)return Ul(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>IM(a,t)):t&&r&&typeof r=="object"&&(l=$l(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function _2(e,t=!0){return e.map(n=>IM(n,t))}function $M(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function BU(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function FU(e){Ih.delete(e)}function HU(e,t,n){Ih.set(e,{source:t,key:n,pendingCandidate:n===null&&vM(t)})}function WU(e){return e.endsWith("$")||e.endsWith("\\")}function zU(e){const t=Math.max(e.lastIndexOf(`
|
|
195
|
+
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return OU.some(s=>n.endsWith(s))}function UU(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||zU(e)&&/[\r\n]/.test(t)):!1}function jU(e,t){if(!uM(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=Ih.get(s);if(o?.source===t)return;if(o&&t.startsWith(o.source)){const l=t.slice(o.source.length);if(o.key===null&&o.pendingCandidate===!1&&!UU(o.source,l)&&!WU(t)){o.source=t;return}}const i=oz(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),HU(e,t,i)}function qU(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function VU(e,t){const n=e?.map,s=t?.map;return n===s?!0:!Array.isArray(n)||!Array.isArray(s)?!1:n.length===s.length&&n.every((o,i)=>o===s[i])}function $g(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&&VU(e,t)}function w2(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function KU(e){for(let t=0;t+5<e.length;t++)if(w2(e,t)&&w2(e,t+3)&&$g(e[t],e[t+3])&&$g(e[t+1],e[t+4])&&$g(e[t+2],e[t+5]))return!0;return!1}function GU(e,t,n){return uM(e)&&vM(t)&&KU(n)}function YU(e){const t=Ih.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function S2(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!$M(e,s)||(jU(e,t),YU(e)))return e.parse(t,n);const o=e.stream.parse(t,RU(e,n));if(GU(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!qU(s))return o;const i=EM(s);if(!i)return _2(o,!0);const r=dc(),l=_2(o,!0);return X0(i,"tokenCloneMs",dc()-r),l}function $h(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Gu;const n=new Set(Gu);for(const s of bc(t))s&&n.add(s);return n}function QU(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 C2(e){return{type:"paragraph",children:e,raw:e.map(QU).join("")}}function x2(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=PU(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const f=s.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push(C2(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(C2(c)),a}function XU(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function _u(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function ZU(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*${No(t)}\s*>\s*$`,"i").test(n)}function Z0(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${No(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Vn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(ta.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${No(s)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${No(s)}(?=\s|>)`,"i").test(m)};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 m=Vn(e.slice(p));if(m===-1)return null;u--;const _=p+m+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(f(p)){const m=Vn(e.slice(p));if(m===-1)return null;const _=e.slice(p,p+m+1);/\/\s*>$/.test(_)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function JU(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
196
|
+
`){n++;continue}return-1}return s===t.length?n:-1}function ej(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
197
|
+
</${t}>`}function A2(e){return e.replace(/\r\n/g,`
|
|
198
|
+
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function tj(e,t,n){return n?e.includes(n,t)?!0:A2(e.slice(Math.max(0,t))).includes(A2(n)):!1}function nj(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
199
|
+
`&&n++,n):e[n]===`
|
|
200
|
+
`?n+1:t}function T2(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 sj(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function J0(e,t){const n=new RegExp(String.raw`<\s*\/\s*${No(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function NM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const oj=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),ij=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function rj(e){return/\n\s*\n/.test(e)||ij.test(e)}function lj(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>oj.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!rj(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function aj(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||KT.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Vn(l);if(a===-1)return o;const c=J0(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=wu(u,t,NM(n,s));return lj(u,d)?{...o,children:d}:o})}function wu(e,t,n){return e.trim()?OM(e,t,{...n,__disableStreamParse:!0}):[]}function cj(e,t,n){const s=wu(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function uj(e,t,n){const s=AM({content:e}),o=Vn(e),i=J0(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=cj(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function dj(e,t,n){const s=Vn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=Z0(o,"summary",0);if(!i)return wu(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...wu(r,t,n),uj(i.raw,t,n),...wu(l,t,n)]}function LM(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=_u(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!T2(c)){r.push(c);continue}const f=String(c.raw??_u(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,m=-1;for(let Q=a+1;Q<e.length;Q++){const V=e[Q];if(T2(V)){p++;continue}if(sj(V)&&(p--,p===0)){m=Q;break}}const _=Z0(t,"details",h),b=m===-1&&_?.closed===!0,g=b?(()=>{const Q=J0(f,"details");return Q!==-1?f.slice(0,Q):f})():f,[v]=LM(b?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),y=dj(g,n,NM(s,o)),T=m===-1?"</details>":String(e[m].raw??_u(e[m])??"</details>"),P=b||m!==-1&&_?.closed===!0,I=T.replace(/[\t\r\n ]+$/,""),k=P?(()=>{const Q=(_?.raw??"").lastIndexOf(I);return Q===-1?t.length:h+Q})():t.length,M=Vn(f),$=b&&M!==-1?h+M+1:h+f.length,L=t.slice($,k===-1?t.length:k),S=n.parse(L,{__markstreamFinal:o}),E=n.renderer.render(S,n.options,{__markstreamFinal:o}),D=k+I.length,R=P?Math.max(k+T.length,nj(t,D)):t.length,H=P?t.slice(k,R):T,U=P?t.slice(h,R):t.slice(h),G=b&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:Mh(f.slice(0,M+1)),raw:U,content:`${G}${E}${H}`,children:[...y,...v],loading:!o&&!P}),l=P?R:t.length,m===-1&&!b)break;m!==-1&&(a=m)}return[r,l]}function fj(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=_u(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=Z0(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=ej(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,_=Vn(u.raw),b=_===-1?"":u.raw.slice(0,_+1),g=b?Mh(b):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let v=JU(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&ZU(s[y],c)){s.splice(y,1);continue}const T=_u(s[y]);if(!T)break;const P=u.raw.indexOf(T,v);if(P===-1){if(tj(n,u.end,T))break;s.splice(y,1);continue}v=P+T.length,s.splice(y,1)}}return s}function pj(e){const t=l=>l===" "||l===" "||l===`
|
|
201
|
+
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const _=m.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=m=>{const _=m.charCodeAt(0);return _>=48&&_<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",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 m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let T=v;for(;T<g.length&&g[T]===y;)T++;const P=T-v;return P<3?null:{markerChar:y,markerLen:P,rest:g.slice(T)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let y=!1;for(;v<g.length&&g[v]===">";)for(y=!0,v++;v<g.length&&f(g[v]);)v++;return y?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const y=p(g);return y==null?null:h(y)};let _=0;const b=l.split(/\r?\n/);for(const g of b){const v=_,y=_+g.length;if(a<v)break;const T=m(g);if(T){const P=T.markerChar,I=T.markerLen;c?P===u&&I>=d&&/^\s*$/.test(T.rest)&&(c=!1,u="",d=0):(c=!0,u=P,d=I)}if(a<=y)break;_=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
202
|
+
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
203
|
+
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function hj(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 s=p=>p===" "||p===" ",o=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let m=0;for(let _=0;_<p.length;_++){const b=p[_];if(b===" "){if(m++,m>=4)return!0;continue}if(b===" ")return!0;break}return!1},r=p=>{let m=!1,_=!1;for(let b=0;b<p.length;b++){const g=p[b];if(g==="\\"){b++;continue}if(!_&&g==="'"){m=!m;continue}if(!m&&g==='"'){_=!_;continue}if(!m&&!_&&g===">")return b}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const _=p[m];if(_!=="`"&&_!=="~")return null;let b=m;for(;b<p.length&&p[b]===_;)b++;const g=b-m;return g<3?null:{markerChar:_,markerLen:g,rest:p.slice(b)}},a=(p,m)=>{if(i(p))return-1;const _=p.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let b=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){s(v)||(b=!0),g++;continue}const y=r(p.slice(g));if(y===-1){b=!0,g++;continue}const T=p.slice(g,g+y+1);let P=1;for(;P<T.length&&s(T[P]);)P++;if(P>=T.length){b=!0,g++;continue}const I=T[P];if(I==="!"||I==="?"){b=!0,g+=y+1;continue}if(I==="/"){b=!0,g+=y+1;continue}const k=P;for(;P<T.length&&o(T[P]);)P++;if(P===k){b=!0,g++;continue}const M=T.slice(k,P).toLowerCase(),$=T[P];if($&&$!==" "&&$!==" "&&$!==">"&&$!=="/"){b=!0,g++;continue}const L=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),S=/\/\s*>$/.test(T),E=L.test(p.slice(g+y+1)),D=L.test(e.slice(m+g+y+1)),R=/[\r\n]/.test(e.slice(m+g+y+1));if(b&&n.has(M)&&!S&&!E&&(D||R))return g;b=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
204
|
+
`,h),m=p!==-1,_=m&&p>h&&e[p-1]==="\r",b=m?_?p-1:p:e.length,g=e.slice(h,b),v=m?_?`\r
|
|
205
|
+
`:`
|
|
206
|
+
`:"",y=l(g);let T=g;if(!c&&!y){const P=a(g,h);if(P!==-1){const I=v||`
|
|
207
|
+
`;T=`${g.slice(0,P).replace(/[ \t]+$/,"")}${I}${I}${g.slice(P).replace(/^[ \t]+/,"")}`}}f+=T,f+=v,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),h=m?p+1:e.length}return f}function mj(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=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&&s(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const m=d[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){f=!f;continue}if(!f&&m==='"'){h=!h;continue}if(!f&&!h&&m===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let _=m+1;for(;_<d.length&&s(d[_]);)_++;if(_>=d.length||d[_]!=="/"){m=d.indexOf("<",m+1);continue}for(_++;_<d.length&&s(d[_]);)_++;if(_+p.length>d.length){m=d.indexOf("<",m+1);continue}let b=!0;for(let v=0;v<p.length;v++){const y=d[_+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==p[v]){b=!1;break}}if(!b){m=d.indexOf("<",m+1);continue}let g=_+p.length;if(g<d.length&&o(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&s(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&o(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const m=r(d.slice(f));if(m===-1)return d;const _=f+m;if(l(d,_+1,p))return d;const b=i(d.slice(_+1));return b?`${d.slice(0,_+1)}
|
|
208
|
+
${b}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
209
|
+
`,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
|
|
210
|
+
`:`
|
|
211
|
+
`,u=d+1}return c}function gj(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{let h=0,p=!1,m=0;for(;h<f.length;){for(;h<f.length&&s(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&s(f[h]);)h++;m=h}return p?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let h=0;for(;h<f.length&&s(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<f.length&&f[m]===p;)m++;const _=m-h;return _<3?null:{markerChar:p,markerLen:_,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
212
|
+
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,_=e.slice(d,m),b=h?p?`\r
|
|
213
|
+
`:`
|
|
214
|
+
`:"",g=o(_),v=g?.prefix??"",y=g?.content??_,T=i(y);T&&(l?T.markerChar===a&&T.markerLen>=c&&/^\s*$/.test(T.rest)&&(l=!1,a="",c=0):(l=!0,a=T.markerChar,c=T.markerLen));let P=y;if(!l&&P.includes("</"))for(const I of r)P=P.replace(I,(k,M,$,L)=>{if(L.replace(/^[\t ]+/,"").startsWith("|"))return k;const S=L.slice(0,$).replace(/^[\t ]+/,"");if(S.length>0){const E=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",D=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!E||!D||E!==D)return k}return`${M}
|
|
215
|
+
|
|
216
|
+
`});if(v){const I=v+P.split(`
|
|
217
|
+
`).join(`
|
|
218
|
+
${v}`);u+=I}else u+=P;u+=b,d=h?f+1:e.length}return u}function vj(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const s=S=>S===" "||S===" ",o=S=>{if(!S)return!1;if(S[0]===" ")return!0;let E=0;for(let D=0;D<S.length;D++){const R=S[D];if(R===" "){if(E++,E>=4)return!0;continue}if(R===" ")return!0;break}return!1},i=S=>{const E=S.charCodeAt(0);return E>=65&&E<=90||E>=97&&E<=122||E>=48&&E<=57||S==="_"||S==="-"||S===":"},r=S=>{let E=0;for(;E<S.length&&s(S[E]);)E++;return S.slice(E)},l=S=>{let E=0,D=!1,R=0;for(;E<S.length;){for(;E<S.length&&s(S[E]);)E++;if(E>=S.length||S[E]!==">")break;for(D=!0,E++;E<S.length&&s(S[E]);)E++;R=E}if(!D)return null;const H=S.slice(0,R);return{prefix:H,key:H.replace(/[ \t]+$/,""),content:S.slice(R)}},a=S=>r(S).startsWith("<"),c=S=>{for(let E=0;E<S.length;E++){const D=S[E];if(D!==" "&&D!==" ")return!1}return!0},u=S=>{if(o(S))return"";const E=r(S);if(!E.startsWith("<"))return"";let D=1;for(;D<E.length&&s(E[D]);)D++;if(D>=E.length||E[D]==="/"||E[D]==="!"||E[D]==="?")return"";const R=D;for(;D<E.length&&i(E[D]);)D++;if(D===R)return"";const H=E.slice(R,D).toLowerCase();if(!n.has(H))return"";const U=E[D];return U&&U!==" "&&U!==" "&&U!==">"&&U!=="/"?"":H},d=S=>{if(o(S))return null;const E=r(S);if(!E.startsWith("<"))return null;let D=1;for(;D<E.length&&s(E[D]);)D++;if(D>=E.length)return null;const R=E[D]==="/";if(R)for(D++;D<E.length&&s(E[D]);)D++;const H=E[D];if(!H||H==="!"||H==="?")return null;const U=D;for(;D<E.length&&i(E[D]);)D++;if(D===U)return null;const G=E.slice(U,D).toLowerCase();if(!n.has(G))return null;const Q=E[D];if(Q&&Q!==" "&&Q!==" "&&Q!==">"&&Q!=="/")return null;if(R)return{type:"close",name:G};if(/\/\s*>\s*$/.test(E))return{type:"open",name:G,complete:!0};const V=E.indexOf(">",D);if(V!==-1){const re=E.slice(V+1);if(new RegExp(`<\\s*\\/\\s*${G}\\s*>`,"i").test(re))return{type:"open",name:G,complete:!0}}return{type:"open",name:G,complete:!1}},f=S=>{if(o(S))return null;const E=r(S).replace(/[ \t]+$/,"");if(!E.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(E))return null;const D=E.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(D?.[1])return D[1].toLowerCase();const R=E.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const H=R[1].toLowerCase();return H===R[2].toLowerCase()?H:null};let h=!1,p="",m=0;const _=S=>{let E=0;for(;E<S.length&&s(S[E]);)E++;const D=S[E];if(D!=="`"&&D!=="~")return null;let R=E;for(;R<S.length&&S[R]===D;)R++;const H=R-E;return H<3?null:{markerChar:D,markerLen:H,rest:S.slice(R)}},b=S=>_(S),g=S=>{const E=r(S);return E?o(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(E):!1},v=(S,E,D)=>{let R=S,H=0;for(;R<e.length;){const U=e.indexOf(`
|
|
219
|
+
`,R),G=U!==-1,Q=G&&U>R&&e[U-1]==="\r",V=G?Q?U-1:U:e.length,re=e.slice(R,V),pe=l(re),ne=pe?.key??"";if(H>0&&E&&ne!==E)break;const X=pe?.content??re,he=d(X);if(he?.name===D){if(he.type==="open")he.complete||H++;else if(H>0&&(H--,H===0))return!1}else if(H>0&&(c(X)||g(X)))return!0;if(G)R=U+1;else break}return!1};let y="",T=0,P=!0,I=!1,k=!1,M=`
|
|
220
|
+
`;const $=[];let L="";for(;T<e.length;){const S=e.indexOf(`
|
|
221
|
+
`,T),E=S!==-1,D=E&&S>T&&e[S-1]==="\r",R=E?D?S-1:S:e.length,H=e.slice(T,R),U=E?D?`\r
|
|
222
|
+
`:`
|
|
223
|
+
`:"",G=l(H),Q=G?.key??"",V=G?.content??H,re=b(V);re&&(h?re.markerChar===p&&re.markerLen>=m&&/^\s*$/.test(re.rest)&&(h=!1,p="",m=0):(h=!0,p=re.markerChar,m=re.markerLen));const pe=$.length>0;if(!h&&!pe){const X=u(V),he=!!X&&!P&&I&&k&&v(T,Q,X);X&&!P&&(!I||he)&&(Q&&L&&Q===L?y+=`${Q}${M}`:Q||(y+=M))}if(y+=H,y+=U,U&&(M=U),!h){const X=d(V);if(X){if(X.type==="open")X.complete||$.push(X.name);else for(let he=$.length-1;he>=0;he--)if($[he]===X.name){$.length=he;break}}}const ne=c(V);P=ne,I=!ne&&a(V),k=!ne&&!!f(V),L=Q,T=E?S+1:e.length}return y}function OM(e,t,n={}){const s=EM(n),o=s?dc():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(BU(t,n)&&(t.stream.reset(),FU(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,_=>_.startsWith(`
|
|
224
|
+
`)?`
|
|
225
|
+
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,_=>_.startsWith(`
|
|
226
|
+
`)?`
|
|
227
|
+
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,_=>_.startsWith(`
|
|
228
|
+
`)?`
|
|
229
|
+
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
230
|
+
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,_=>_.startsWith(`
|
|
231
|
+
`)?`
|
|
232
|
+
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(_,b,g)=>`${b}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,_=>_.startsWith(`
|
|
233
|
+
`)?`
|
|
234
|
+
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
235
|
+
`))),n.customHtmlTags?.length&&r.includes("<")){const _=bc(n.customHtmlTags);if(_.length&&(r=hj(r,_),r=mj(r,_),r=vj(r,_),r=gj(r,_),r.includes("</")))for(const b of _){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${b}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=pj(r));const l=XU(r);if(l){const _=n.preTransformTokens,b=n.postTransformTokens;if($M(t,n)||typeof _=="function"||typeof b=="function"){const g=S2(t,r,{__markstreamFinal:i},n),v=typeof _=="function"&&_(g)||g;typeof b=="function"&&b(v)}return Ig(l,s,o)}const a=S2(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Ig([],s,o);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 m=b2(d,p,s);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const b=_[0],g=b?.type;b&&typeof g=="string"?m=b2(_,void 0,s):m=_}}if(m=fj(m,i,r),m=LM(m,r,t,n,i)[0],m=aj(m,t,n,i),i){const _=new WeakSet,b=g=>{if(!g||typeof g!="object"||_.has(g))return;if(_.add(g),Array.isArray(g)){for(const y of g)b(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))b(y)};b(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Ig(m,s,o)}function M2(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=al(t);let o=0;for(;o<e.length;){const i=Q0(e,o,s.options(),Y0);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=LU(e,o,s.options(l)),c=x2(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=_c(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=wc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(NU()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=Kn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=x2(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const yj=new Set([...dd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),kj=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"]),E2=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function I2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function bj(e){return typeof e=="string"?e:e==null?"":String(e)}function PM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Fr(e){return bj(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function RM(e){return Fr(e).replace(/`/g,"`")}function Nh(e){return String(e??"").trim().toLowerCase()}function ey(e,t="safe"){const n=Nh(e);return n?t==="escape"?!0:t==="trusted"?dd.has(n):!kj.has(n):!1}function DM(e,t="safe"){const n=Nh(e);return n?t==="escape"?!0:t==="trusted"?dd.has(n):yj.has(n):!1}function $2(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${RM(s)}"`).join("")}function _j(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||zl(o,{tagName:t,attrName:"srcset"})})}function BM(e,t,n,s){return oH.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?_j(t,s):!!(iH.has(e)&&t&&zl(t,{tagName:s,attrName:e}))}function Nl(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function FM(e,t,n,s=!1){if(t!=="safe"||Nh(n)!=="a")return e;const o=Nl(e,"href");if(s&&(!o||!e[o])){const a=Nl(e,"target"),c=Nl(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Nl(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Nl(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 N2(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!PM(r)||BM(l,i,t,n)||(s[r]=i)}return FM(s,t,n,!!Nl(e,"href"))}function HM(e,t){const n=e.toLowerCase();return VT.has(n)?!1:I2(t,n)||I2(t,e)}function ty(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!PM(r)||BM(l,i,t,n)||(s[r]=i)}return FM(s,t,n,!!Nl(e,"href"))}function Lp(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function f1(e,t="safe",n){const s=ty(Lp(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function wj(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function Sj(e){const t={};for(const[n,s]of Object.entries(e))t[n]=wj(s,n);return t}function L2(e){return e.trim().length>0}function Cj(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);L2(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);L2(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||ta.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function xj(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const f=e.indexOf("]]>",s);if(f!==-1){t.push({type:"text",content:e.slice(s,f+3)}),n=f+3;continue}break}if(e.startsWith("!",s+1)){const f=e.indexOf(">",s);if(f!==-1){n=f+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||ta.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function Aj(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Fr(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${Fr(s)}`:` ${Fr(s)}="${RM(o)}"`).join("");return e.type==="self_closing"?`<${Fr(t)}${n} />`:`<${Fr(t)}${n}>`}function Tj(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;E2.lastIndex=0;let n;for(;(n=E2.exec(e))!==null;)if(HM(n[1],t))return!0;return!1}function nc(e,t="safe"){if(!e)return"";if(t==="escape")return Fr(e);const n=xj(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(Fr(r.content??""));continue}const l=Nh(r.tagName);if(!l)continue;if(DM(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"&&ey(l,t)){o.push(Aj(r));continue}if(r.type==="self_closing"){o.push(`<${l}${$2(N2(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${$2(N2(r.attrs??{},t,l))}>`),ta.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const Mj=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],O2="http://www.w3.org/2000/svg",Ej=new Set(["script","style","iframe","object","embed","link","meta"]),Ij=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"]),$j=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Nj=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Lj=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Oj(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Pj(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Rj(e){const t=e.nodeName.toLowerCase();return t==="use"?Oj(e):t==="image"?Pj(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Lj.has(t)}function Dj(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 Bj(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?zl(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?zl(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":zl(i,{tagName:s,attrName:o})?"":i:""}function Fj(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function WM(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function zM(e){const t=WM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=Fj(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function P2(e){const t=WM(e);return Mj.some(n=>n.test(t))||zM(t)}function Hj(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 hf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function UM(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!Ej.has(s)){if(s==="br"){t.push(`
|
|
236
|
+
`);return}for(const o of Array.from(n.childNodes))UM(o,t)}}function Wj(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];UM(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=hf(t.getAttribute("width")),i=hf(t.getAttribute("height")),r=hf(t.getAttribute("x")),l=hf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(O2,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,f]of s.entries()){const h=e.ownerDocument.createElementNS(O2,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function zj(e){Wj(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!Ij.has(s)){n.remove();continue}if(s==="style"&&P2(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&P2(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if($j.has(r)&&i.value){const l=Bj(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(Nj.has(r)&&i.value&&zM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=Dj(i.value);l!==i.value&&n.setAttribute(i.name,l)}}Hj(n)}}function kge(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 zj(n),Uj(n)?null:n}catch{return null}}function Uj(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){Rj(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const R2=[];function Ng(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function jj(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function qj(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function D2(e=`editor-${Date.now()}`,t={}){const n=az(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;o=h=>f[h]??s[h]??h}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...m]=h;typeof p=="function"&&n.use(p,...m)}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(R2.length)for(const f of R2)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(A7),n.use(E7),n.use(S7);const i=U7,r=i.default??i;n.use(r),n.use(w7),n.use(_7),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,_=p.split(/\r?\n/);for(const b of h.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const g=b.map[0],v=b.map[1],y=b.markup,T=y[0],P=y.length,I=_[Math.max(0,v-1)]??"";let k=0;for(;k<I.length&&(I[k]===" "||I[k]===" ");)k++;let M=0;for(;k+M<I.length&&I[k+M]===T;)M++;let $=k+M;for(;$<I.length&&(I[$]===" "||I[$]===" ");)$++;const L=m?!0:v>g+1&&M>=P&&$===I.length,S=b;S.meta=S.meta??{},S.meta.unclosed=!L,S.meta.closed=!!L}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const _=p.src[m-1],b=p.src[m+1];if(/\d/.test(_)&&/\d/.test(b)){if(!h){const g=p.push("text","",0);g.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],m=String(p.info??"").trim(),_=String(p.content??""),b=btoa(unescape(encodeURIComponent(_))),g=jj(m),v=Ng(g),y=qj(`editor-${e}-${h}-${g}`),T=Ng(o("common.copy"));return`<div class="code-block" data-code="${b}" data-lang="${v}" id="${y}">
|
|
237
|
+
<div class="code-header">
|
|
238
|
+
<span class="code-lang">${Ng(g.toUpperCase())}</span>
|
|
239
|
+
<button class="copy-button" data-code="${b}">${T}</button>
|
|
240
|
+
</div>
|
|
241
|
+
<div class="code-editor"></div>
|
|
242
|
+
</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 m=a.exec(p.src.slice(p.pos));if(!m)return!1;const _=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const b=p.src.slice(p.pos+m[0].length);if(b.startsWith("](")||b.startsWith("(")||u(b))return!1;if(!h){const g=m[1],v=p.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return p.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const m=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function Vj({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 jM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Vj({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const B2=new WeakMap;function Kj(e){let t=B2.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},B2.set(e,t)),t}function F2(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function ny(e){return!!(e.themes?.length||e.langs?.length)}function qM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function Gj(e,t){return!t?.length||e.registeredAllLangs?!0:qM(e.registeredLangs,t)}function Lg(e,t){return ny(t)&&qM(e.registeredThemes,t.themes)&&Gj(e,t.langs)}function Yj(e,t){if(!ny(t))return t;const n=F2(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:F2(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const Qj={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 Xj(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function VM(e){const t=Xj(e);return Qj[t]??t}function KM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>VM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function GM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function Zj(e){return GM(e)?.join("\0")??""}function YM(e,t){const n=GM(e),s=KM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Op(e,t){return`${Zj(e)}\0\0${KM(t)?.join("\0")??""}`}function bge(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=YM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Op(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function _ge(e,t={},n){if(!e)return"ready";const s=YM(t.themes,t.langs),o=Op(s.themes,s.langs),i=n&&n===o?n:o,r=Kj(e);if(r.completed.has(i))return"ready";if(Lg(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Lg(r,s))return r.completed.add(i),"ready";const c=Yj(r,s),u=Op(c.themes,c.langs);return r.completed.has(u)||Lg(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(ny(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 Sa(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function H2(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Jj=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=W2();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=W2();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,m=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=sq(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const b=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=nq(this.source.slice(this.visible.length),b,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Sa(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Sa(s,1e3,1)),this.normalizedTargetLatencyMs=Sa(o,900,1),this.normalizedCatchUpLatencyMs=Sa(i,350,1),this.normalizedCatchUpThreshold=H2(r,600),this.normalizedStartDelayMs=H2(a,80),this.maxCommitFps=Math.trunc(Sa(l,30,1)),this.maxCharsPerCommit=Math.trunc(Sa(c,80,1)),this.flushOnFinish=u,this.segmenter=tq(),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 eq(e={},t){const n=new Jj(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 tq(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function nq(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function W2(){return typeof performance<"u"?performance.now():Date.now()}function sq(e,t,n){return Math.min(n,Math.max(t,e))}var oq=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const p1=Symbol.for("markstream-vue:node-lifecycle"),z2='<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>',U2='<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>',iq={id:"material",core:{"":U2,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:U2,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:z2,csharp:z2,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:()=>Js(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},h1=new Map;let j2="material";const Wa=new Map,q2=new Map;let m1=null;function rq(e){h1.set(e.id,e)}function lq(e){return oq(this,null,function*(){var t,n,s;if(Wa.has(e.id))return(t=Wa.get(e.id))!=null?t:null;let o=q2.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Wa.set(e.id,i),m1?.(),i)).catch(()=>(Wa.set(e.id,null),null)),q2.set(e.id,o)),o})}const aq=Zl(0);m1=()=>{aq.value++},rq(iq);const cq={"":"",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 sy(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=cq[n])!=null?t:n}function wge(e){const t=sy(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Sge(e){return(function(s){const o=h1.get(j2);if(!o)return;const i=o.core[s];if(i)return i;const r=Wa.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Wa.has(o.id)&&lq(o)})(sy(e))||((n=(t=h1.get(j2))==null?void 0:t.fallback)!=null?n:"");var t,n}const Cge={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 QM=!1;function xge(){return QM}function Age(){QM=!0}var Lh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Mo=null,Of=!1,Oh=iy;function Ph(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function oy(){try{const e=globalThis;return Ph(e?.katex)}catch{return null}}function iy(){return Lh(null,null,function*(){const e=oy();if(e)return e;const t=yield Js(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Js(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Ph(t)})}function uq(e){Oh=e,Mo=null,Of=!1}function dq(e){uq(iy)}function XM(){return typeof Oh=="function"}function Tge(){var e;const t=Oh;if(!t||t===iy)return null;if(Mo)return Mo;const n=oy();if(n)return Mo=n,Mo;try{const s=t();return s&&typeof s?.then!="function"?(Mo=(e=Ph(s))!=null?e:s,Mo):null}catch{return null}}function ry(){return Lh(this,null,function*(){var e;const t=oy();if(t)return Mo=t,Mo;if(Mo)return Mo;if(Of)return null;const n=Oh;if(!n)return Of=!0,null;try{const s=yield n();if(s)return Mo=(e=Ph(s))!=null?e:s,Mo}catch{}return Of=!0,null})}function ZM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let zr=null,Pr=null;const Jo=new Map,er=new Map;let Pp=5;const Rl=new Set;function Zu(){if(Jo.size<Pp&&Rl.size){const e=Array.from(Rl);Rl.clear();for(const t of e)try{t()}catch{}}}function fq(e){zr=e,Pr=null,zr.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=Jo.get(n);if(i)if(Jo.delete(n),clearTimeout(i.timeoutId),Zu(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(er.set(a,s),er.size>200){const c=er.keys().next().value;er.delete(c)}}i.resolve(s)}},zr.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of Jo.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));Jo.clear(),Zu()}}function pq(){var e;zr&&((e=zr.terminate)==null||e.call(zr)),zr=null,Pr=null}function hq(e,t=!0,n=2e3,s){return Lh(this,null,function*(){performance.now();const o=ZM(e);if(!XM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Pr)return Promise.reject(Pr);const i=`${t?"d":"i"}:${o}`,r=er.get(i);if(r)return Promise.resolve(r);const l=zr||(Pr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Pr.name="WorkerInitError",Pr.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Pr);if(Jo.size>=Pp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Jo.size,a.max=Pp,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{Jo.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Zu()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),Jo.has(u)&&Jo.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Zu()},{once:!0});const f=a,h=c;Jo.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function Mge(e,t=!0,n){const s=`${t?"d":"i"}:${ZM(e)}`;if(er.set(s,n),er.size>200){const o=er.keys().next().value;er.delete(o)}}const mq="WORKER_BUSY";function gq(e=2e3,t){return Jo.size<Pp?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Rl.delete(r),n())};if(Rl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Rl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>Zu()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Rl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Qc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Ege(e){return Lh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!XM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:Qc.timeout,c=(i=s.waitTimeout)!=null?i:Qc.waitTimeout,u=(r=s.backoffMs)!=null?r:Qc.backoffMs,d=(l=s.maxRetries)!=null?l:Qc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Qc.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield hq(t,n,a,h)}catch(m){if(m?.code!==mq||p>=f)throw m;if(p++,yield gq(c,h).catch(()=>{}),h?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*p)))}}})}function za(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function vq(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function g1(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=vq(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function v1(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 JM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function y1(e,t=360,n=500){return JM(e,t,n)}function k1(e,t=360,n=500){return JM(e,t,n)}var yq=Object.defineProperty,kq=Object.defineProperties,bq=Object.getOwnPropertyDescriptors,V2=Object.getOwnPropertySymbols,_q=Object.prototype.hasOwnProperty,wq=Object.prototype.propertyIsEnumerable,K2=(e,t,n)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e3=(e,t)=>{for(var n in t||(t={}))_q.call(t,n)&&K2(e,n,t[n]);if(V2)for(var n of V2(t))wq.call(t,n)&&K2(e,n,t[n]);return e},ly=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const ay=()=>Js(()=>import("./mermaid.core-Dvwdy-Wb.js").then(e=>e.bn),[]);let Ui=null,cy=ay;function Sq(e){cy=e,Ui=null}function Cq(e){Sq(ay)}function xq(){return typeof cy=="function"}function G2(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=e3({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},kq(n,bq(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function Y2(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=e3({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function Ige(){return ly(this,null,function*(){if(Ui)return Ui;const e=(function(){try{const s=globalThis;return G2(s?.mermaid)}catch{return null}})();if(e)return Ui=e,Y2(Ui),Ui;const t=cy;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===ay?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(Ui=G2(n),Y2(Ui),Ui):null})}let Xs=null,Rr=null;const Es=new Map;let Q2=5,X2=!1;const Aq="WORKER_BUSY",Tq="MERMAID_DISABLED";function Mq(e){Xs=e,Rr=null;const t=e;Xs.onmessage=n=>{if(Xs!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Es.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Xs.onerror=n=>{var s,o;if(Xs===t)if(Es.size!==0){try{X2?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Es.entries())r.reject(new Error(`Worker error: ${n.message}`));Es.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Xs.onmessageerror=n=>{var s,o;if(Xs===t)if(Es.size!==0){try{X2?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Es.entries())r.reject(new Error("Worker messageerror"));Es.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function Eq(){var e;if(Xs)try{for(const[t,n]of Es.entries())n.reject(new Error("Worker cleared"));Es.clear(),(e=Xs.terminate)==null||e.call(Xs)}catch{}Xs=null,Rr=null}function t3(e,t,n=1400){if(!xq()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=Tq,Promise.reject(o)}if(Rr)return Promise.reject(Rr);const s=Xs||(Rr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Rr.name="WorkerInitError",Rr.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Rr);if(Es.size>=Q2){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=Aq,o.inFlight=Es.size,o.max=Q2,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Es.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Es.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Es.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=Es.get(r);f&&f.reject(d)},n)})}function $ge(e,t,n=1400){return ly(this,null,function*(){try{return yield t3("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Nge(e,t,n=1400){return ly(this,null,function*(){try{return yield t3("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Lge(){if(Xs)try{for(const[e,t]of Es.entries())t.reject(new Error("Worker terminated"));Es.clear(),Xs.terminate()}finally{Xs=null}}var Iq=Object.defineProperty,$q=Object.defineProperties,Nq=Object.getOwnPropertyDescriptors,Z2=Object.getOwnPropertySymbols,Lq=Object.prototype.hasOwnProperty,Oq=Object.prototype.propertyIsEnumerable,J2=(e,t,n)=>t in e?Iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))Lq.call(t,n)&&J2(e,n,t[n]);if(Z2)for(var n of Z2(t))Oq.call(t,n)&&J2(e,n,t[n]);return e},Lt=(e,t)=>$q(e,Nq(t)),qn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Pq="__global__",Og="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",b1=(()=>{const e=globalThis;if(e[Og])return e[Og];const t={scopedCustomComponents:{},revision:Zl(0)};return e[Og]=t,t})(),eS=b1.revision,Rq=Symbol("markstreamCustomComponents"),Dq=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 hd(e){return Dq.has(String(e).trim().toLowerCase())}function Bq(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Pg(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([ri(n),ri(Bq(n))]))!o||hd(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function hs(e){const t=jt(Rq,null);return B(()=>{var n;return eS.value,(function(s,o={}){return eS.value,rt(rt(rt({},Pg(b1.scopedCustomComponents[Pq]||{})),Pg(o)),Pg((function(i){return i&&b1.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const Fq=["aria-label"],Hq={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"},Wq={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"},pn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Lo=pn(qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),N("svg",Wq,[...n[1]||(n[1]=[x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),x("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(),N("svg",Hq,[...n[0]||(n[0]=[x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,Fq))}),[["__scopeId","data-v-be21ab83"]]);Lo.install=e=>{e.component(Lo.__name,Lo)};const zq={class:"emoji-node"},vo=pn(qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",zq,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);vo.install=e=>{e.component(vo.__name,vo)};const Uq=["id"],jq=["title"],Oo=pn(qe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(w(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[x("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,jq)],8,Uq))}}),[["__scopeId","data-v-c1463a29"]]);Oo.install=e=>{e.component(Oo.__name,Oo)};const n3=(()=>{try{return!1}catch{}return!1})();function Rg(e){n3&&console.warn(e)}function tS(e,t="safe",n){return ty(e,t,n)}function s3(e){return Sj(e)}function Dg(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function uy(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=f1((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Dg(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Dg(r.value)]):Object.entries(o).map(([r,l])=>[r,Dg(l)]):null,t,n);var o;if(!s)return;const i=s3(Lp(s));return Object.keys(i).length>0?i:void 0}function nS(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Xc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Bg(e,t,n,s,o,i,r=!1){const l=(function(d,f){return HM(d,f)})(e,s);if(dd.has(e.toLowerCase())||!l&&DM(e,i))return null;if(!l&&ey(e,i))return r?[nS(e,t,!0)]:[nS(e,t),...n,`</${e}>`];const a=ty(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=s3(a);return fn(d,Lt(rt({},f),{key:u}),n.length>0?n:void 0)}return fn(e,Lt(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function o3(e,t){return Tj(e,t)}function Rp(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=Bg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Xc(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(),m=Bg(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Xc(c[c.length-1].children,m):Xc(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&Rg(`Auto-closing unclosed tag: <${p.tagName}>`)}else Rg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Bg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Xc(c[c.length-1].children,f):Xc(u,f),Rg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(Cj(e),t,n)}catch(o){return s=o,n3&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const qq=["innerHTML"],Po=pn(qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),s=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=hs(()=>t.customId),i=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:nc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Rp(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!o3(l,o.value))return{mode:"html",content:nc(l,s.value)};const a=Rp(l,o.value,s.value);return a===null?{mode:"html",content:nc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),N("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ie(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),N("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(w(),N("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,qq))}}),[["__scopeId","data-v-d17f12b0"]]);Po.install=e=>{e.component(Po.__name,Po)};const Vq={class:"inline-code"},Kq={key:0},qs=pn(qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=rd(),s=jt("markstreamFade",void 0),o=jt("markstreamTextStreamState",void 0),i=jt("markstreamStreamVersion",void 0),r=B(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=B(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=B(()=>!l.value),u=B(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=J(t.node.code),f=J("");let h=i?.value;const p=J(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}Ve([()=>t.node.code,u,l,()=>i?.value],([g,v,y,T])=>{const P=String(g??""),I=u.value,k=T!==h;h=T;const M=jM({nextContent:P,persistedContent:I?o?.get(I):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=M.settledContent,f.value=M.streamedDelta,M.appended&&(p.value+=1),I&&o?.set(I,P)},{immediate:!0}),Ve(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const b=B(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),N("code",Vq,[c.value?(w(),N(Oe,{key:0},[Ue(O(a.value),1)],64)):(w(),N(Oe,{key:1},[d.value?(w(),N("span",Kq,O(d.value),1)):le("",!0),f.value?(w(),N("span",{key:1,class:Re(["inline-code-stream-delta",[b.value]]),onAnimationend:_},O(f.value),35)):le("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);qs.install=e=>{e.component(qs.__name,qs)};const _1=J(!1),sS=J(""),oS=J("top"),Su=J(null),Cu=J(null),w1=J(null),S1=J(null),iS=J(null);let Pf=null,Rf=null,C1=0;function i3(){Pf&&(clearTimeout(Pf),Pf=null),Rf&&(clearTimeout(Rf),Rf=null)}let mf=!1,gf=null,rS=!1;function Gq(e,t,n="top",s=!1,o,i){if(!e)return;const r=++C1;i3();const l=()=>qn(null,null,function*(){var a,c;if(yield(function(){return qn(this,null,function*(){if(!mf&&!rS&&typeof document<"u"){gf!=null||(gf=qn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([Js(()=>import("./vue.runtime.esm-bundler-DOh9SYil.js"),[]),Js(()=>import("./Tooltip-BvXZgTKH.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:_1.value,"anchor-el":Su.value,content:sS.value,placement:oS.value,id:Cu.value,originX:w1.value,originY:S1.value,isDark:(p=iS.value)!=null?p:void 0})}}).mount(h),mf=!0}));try{yield gf}catch(u){mf=!1,gf=null,rS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),mf&&r===C1){Cu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Su.value=e,sS.value=t,oS.value=n,w1.value=(a=o?.x)!=null?a:null,S1.value=(c=o?.y)!=null?c:null,iS.value=typeof i=="boolean"?i:null,_1.value=!0;try{e.setAttribute("aria-describedby",Cu.value)}catch{}}});s?l():Pf=setTimeout(l,80)}function Yq(e=!1){C1+=1,i3();const t=()=>{if(Su.value&&Cu.value)try{Su.value.removeAttribute("aria-describedby")}catch{}_1.value=!1,Su.value=null,Cu.value=null,w1.value=null,S1.value=null};e?t():Rf=setTimeout(t,120)}const x1={"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..."},A1=e=>{var t;return(t=x1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function lS(e){return{t(t){if(e.te&&x1[t]&&!e.te(t))return A1(t);const n=e.t(t);return n===t&&x1[t]?A1(t):n}}}function Qq(){const e=(function(){var t,n;try{const s=Ps(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return lS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return lS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:A1}}function Xq(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const Zq=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Jq={key:1,class:"image-placeholder"},eV={key:1,class:"image-node__raw-text"},tV={key:0,class:"image-shimmer-overlay"},nV={key:1,class:"image-node__raw-text"},sV={key:2,class:"image-error"},Kr=pn(qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=J(!1),i=J(!1),r=J(""),l=J("primary"),a=J(null),c=rd(),u=jt(p1,null);let d="",f=null;const h=B(()=>Ww(n.node.src)),p=B(()=>Ww(n.fallbackSrc)),m=B(()=>r.value),_=B(()=>!n.lazy),b=B(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=B(()=>l.value==="failed"),v=B(()=>!_.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=B(()=>Xq(n,c));function T(D=y.value){D&&a.value&&u?.reportHeight(D,a.value.offsetHeight)}function P(D=y.value){D&&mt(()=>{T(D)})}function I(){f&&(clearTimeout(f),f=null)}function k(){const D=y.value;D&&d!==D&&(d&&u?.markSettled(d),I(),d=D,u?.markPending(D),typeof window<"u"&&(f=window.setTimeout(()=>{d===D&&(P(D),M())},8e3)))}function M(){return qn(this,null,function*(){const D=d;D&&(I(),d="",yield mt(),T(D),u?.markSettled(D))})}function $(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,o.value=!1,i.value=!1,void P();l.value="failed",i.value=!0,s("error",r.value),P()}function L(){o.value=!0,i.value=!1,s("load",m.value),P()}function S(D){D.preventDefault(),o.value&&!i.value&&s("click",[D,m.value])}const{t:E}=Qq();return Ve([h,p,()=>n.node.loading],()=>(o.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}),Ve([b,o,i,m,()=>n.lazy],([D,R,H,U,G])=>D&&U&&!H?R?(M(),void P()):G?(k(),void P()):void(R||H||k()):(M(),void P()),{flush:"post",immediate:!0}),fs(()=>{(function(){const D=d;D&&(I(),d="",u?.markSettled(D))})()}),(D,R)=>{var H,U,G,Q,V;return w(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[b.value?(w(),N("img",{key:0,src:m.value,alt:String((U=(H=n.node.alt)!=null?H:n.node.title)!=null?U:""),title:String((Q=(G=n.node.title)!=null?G:n.node.alt)!=null?Q:""),class:Re(["image-node__img",{"is-loading":!_.value&&!o.value,"is-loaded":_.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(V=n.node.alt)!=null?V:C(E)("image.preview"),onError:$,onLoad:L,onClick:S},null,42,Zq)):le("",!0),e.node.loading&&!i.value?(w(),N("span",Jq,[n.usePlaceholder?Nn(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[0]||(R[0]=x("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",eV,O(e.node.raw),1))])):le("",!0),ie(Xr,{name:"shimmer-fade"},{default:be(()=>[v.value&&!e.node.loading?(w(),N("span",tV,[n.usePlaceholder?Nn(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[1]||(R[1]=x("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",nV,O(e.node.raw),1))])):le("",!0)]),_:3}),g.value?(w(),N("span",sV,[Nn(D.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[2]||(R[2]=x("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[x("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)),x("span",null,O(C(E)("image.loadError")),1)],!0)])):le("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Kr.install=e=>{e.component(Kr.__name,Kr)};const oV={key:2},Ni=qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=hs(()=>t.customId),s=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamNestedRendererProps",void 0),i=B(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=B(()=>{var p,m;const _=(p=o?.value)!=null?p:{};return Lt(rt({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=fi({loader:()=>Promise.resolve().then(()=>vy),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!hd(String(t.node.type)))),u=B(()=>c.value?uy(t.node,i.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=B(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(w(),ye(zs(a.value),mn({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:be(()=>[d.value?(w(),ye(C(l),mn({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(),ye(C(l),mn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ye(zs(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(),N("span",oV,O(h.value),1)):le("",!0)}}),iV=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],rV={key:0,translate:"no",class:"markstream-pre__diff-code"},lV={class:"markstream-pre__diff-number","aria-hidden":"true"},aV={class:"markstream-pre__diff-content"},cV={class:"markstream-pre__diff-content-inner"},uV={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},dV=["textContent"],To=qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=B(()=>{var S,E,D;const R=String((E=(S=t.node)==null?void 0:S.language)!=null?E:"");return String((D=String(R).split(/\s+/g)[0])!=null?D:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=B(()=>`language-${n.value}`),o=B(()=>{var S,E,D,R,H;return((S=t.node)==null?void 0:S.diff)===!0?String((D=(E=t.node)==null?void 0:E.code)!=null?D:""):(function(U,G){const Q=String(U??"");return G?Q:Q.replace(/\r\n$|\n$|\r$/,"")})((R=t.node)==null?void 0:R.code,((H=t.node)==null?void 0:H.loading)===!0)}),i=B(()=>o.value.split(/\r\n|\n|\r/)),r=B(()=>Array.from({length:Math.max(1,i.value.length)},(S,E)=>E+1)),l=B(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=B(()=>l.value&&t.diffInline===!0),c=B(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const E=`${Math.ceil(S)}px`;return{height:E,minHeight:E,maxHeight:E,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,E="context",D={}){const R=u(S);return{code:S,kind:R&&E!=="hunk"&&!D.preserveBlankKind?"context":E,empty:R}}function f(S){const E=String(S??"");return E?E.split(/\r\n|\n|\r/):[]}function h(S,E){return!u(S[E])||E<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function _(S,E){const D=f(S),R=f(E),H=(function(pe,ne){const X=pe.length,he=ne.length;if((X+1)*(he+1)>15e5)return null;const Pe=he+1,je=new Uint32Array((X+1)*(he+1));for(let Y=1;Y<=X;Y++)for(let oe=1;oe<=he;oe++){const W=Y*Pe+oe;if(pe[Y-1]===ne[oe-1])je[W]=je[(Y-1)*Pe+(oe-1)]+1;else{const Z=je[(Y-1)*Pe+oe],ue=je[Y*Pe+(oe-1)];je[W]=Z>=ue?Z:ue}}const it=[];let ce=X,z=he;for(;ce>0&&z>0;)pe[ce-1]===ne[z-1]?(it.push({originalIndex:ce-1,modifiedIndex:z-1}),ce--,z--):je[(ce-1)*Pe+z]>=je[ce*Pe+(z-1)]?ce--:z--;return it.reverse(),it})(D,R);if(H){const pe=[];let ne=0,X=0;for(const he of H){for(;ne<he.originalIndex;)pe.push(Lt(rt({},d(D[ne],"removed",{preserveBlankKind:h(D,ne)})),{key:`inline-removed-source-${ne}`,number:""})),ne++;for(;X<he.modifiedIndex;)pe.push(Lt(rt({},d(R[X],"added",{preserveBlankKind:h(R,X)})),{key:`inline-added-source-${X}`,number:X+1})),X++;pe.push(Lt(rt({},d(R[he.modifiedIndex])),{key:`inline-context-source-${he.originalIndex}-${he.modifiedIndex}`,number:he.modifiedIndex+1})),ne=he.originalIndex+1,X=he.modifiedIndex+1}for(;ne<D.length;)pe.push(Lt(rt({},d(D[ne],"removed",{preserveBlankKind:h(D,ne)})),{key:`inline-removed-source-${ne}`,number:""})),ne++;for(;X<R.length;)pe.push(Lt(rt({},d(R[X],"added",{preserveBlankKind:h(R,X)})),{key:`inline-added-source-${X}`,number:X+1})),X++;return pe}const U=[];let G=0,Q=D.length-1,V=R.length-1;for(;G<=Q&&G<=V&&D[G]===R[G];)U.push(Lt(rt({},d(R[G])),{key:`inline-prefix-${G}`,number:G+1})),G++;const re=[];for(;Q>=G&&V>=G&&D[Q]===R[V];)re.unshift(Lt(rt({},d(R[V])),{key:`inline-suffix-${V}`,number:V+1})),Q--,V--;for(let pe=G;pe<=Q;pe++)U.push(Lt(rt({},d(D[pe],"removed",{preserveBlankKind:h(D,pe)})),{key:`inline-removed-source-${pe}`,number:""}));for(let pe=G;pe<=V;pe++)U.push(Lt(rt({},d(R[pe],"added",{preserveBlankKind:h(R,pe)})),{key:`inline-added-source-${pe}`,number:pe+1}));return U.concat(re)}const b=B(()=>{var S,E,D,R;const H=(function(V){const re=V.some(ne=>p(ne)),pe=V.some(ne=>m(ne));return re&&pe||(function(){var ne,X,he,Pe;if(n.value==="diff")return!0;const je=(Pe=(he=String((X=(ne=t.node)==null?void 0:ne.raw)!=null?X:"").split(/\r?\n/,1)[0])==null?void 0:he.trim())!=null?Pe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(je)})()&&(re||pe)})(i.value),U=(function(){var V,re;return((V=t.node)==null?void 0:V.originalCode)!=null||((re=t.node)==null?void 0:re.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:H?(function(V){const re=[];let pe=1;for(const[ne,X]of V.entries())if(X.startsWith("@@"))re.push(Lt(rt({},d(X,"hunk")),{key:`inline-hunk-${ne}`,number:""}));else if(p(X))re.push(Lt(rt({},d(X.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ne}`,number:""}));else if(m(X))re.push(Lt(rt({},d(X.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${ne}`,number:pe++}));else{const he=X.startsWith(" ")?X.slice(1):X;re.push(Lt(rt({},d(he)),{key:`inline-context-${ne}`,number:pe})),pe++}return re})(i.value):_((S=t.node)==null?void 0:S.originalCode,(E=t.node)==null?void 0:E.updatedCode)}];if(!H&&U){const V=f((D=t.node)==null?void 0:D.originalCode),re=f((R=t.node)==null?void 0:R.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:V.map((pe,ne)=>{const X=re[ne]===pe?"context":"removed";return Lt(rt({},d(pe,X,{preserveBlankKind:h(V,ne)})),{key:`original-${ne}`,number:ne+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:re.map((pe,ne)=>{const X=V[ne]===pe?"context":"added";return Lt(rt({},d(pe,X,{preserveBlankKind:h(re,ne)})),{key:`modified-${ne}`,number:ne+1})})}]}const G=[],Q=[];for(const V of i.value)if(V.startsWith("@@"))G.push(d(V,"hunk")),Q.push(d(V,"hunk"));else if(V.startsWith("-")&&!V.startsWith("---"))G.push(d(V.slice(1),"removed",{preserveBlankKind:!0}));else if(V.startsWith("+")&&!V.startsWith("+++"))Q.push(d(V.slice(1),"added",{preserveBlankKind:!0}));else{const re=V.startsWith(" ")?V.slice(1):V;G.push(d(re)),Q.push(d(re))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:G.map((V,re)=>Lt(rt({},V),{key:`original-${re}`,number:re+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((V,re)=>Lt(rt({},V),{key:`modified-${re}`,number:re+1}))}]}),g=B(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=J(null),y=J([]);let T=null,P=null;function I(S){const E=Number.parseFloat(String(S??""));return Number.isFinite(E)&&E>0?E:0}function k(S,E){var D;if(!S)return E;const R=S.querySelector(".markstream-pre__diff-content"),H=R?.getBoundingClientRect(),U=(D=H?.height)!=null?D:0;return Math.max(E,Math.ceil(U))}function M(){typeof window<"u"&&(T!=null&&window.cancelAnimationFrame(T),T=window.requestAnimationFrame(()=>{(function(){var S,E;T=null;const D=v.value;if(!D||!l.value)return void(y.value.length&&(y.value=[]));const R=(function(pe){const ne=window.getComputedStyle(pe),X=I(ne.getPropertyValue("--markstream-pre-diff-line-height"));if(X>0)return X;const he=I(ne.lineHeight);return he>0?he:18})(D),H=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),U=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),G=Math.max(H.length,U.length),Q=[];for(let pe=0;pe<G;pe++){const ne=k((S=H[pe])!=null?S:null,R),X=k((E=U[pe])!=null?E:null,R),he=Math.max(R,ne,X);Q.push({rowHeight:he,originalHeight:ne,modifiedHeight:X})}var V,re;V=y.value,re=Q,V.length===re.length&&V.every((pe,ne)=>{const X=re[ne];return X&&Math.abs(pe.rowHeight-X.rowHeight)<=.5&&Math.abs(pe.originalHeight-X.originalHeight)<=.5&&Math.abs(pe.modifiedHeight-X.modifiedHeight)<=.5})||(y.value=Q)})()}))}function $(S){P?.disconnect(),P=null,S&&l.value&&typeof ResizeObserver<"u"&&(P=new ResizeObserver(()=>{M()}),P.observe(S))}function L(S,E){const D=y.value[S];if(!D)return;const R=E==="original"?D.originalHeight:D.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(D.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(R)}px`}}return Ve(v,S=>{$(S),mt(()=>M())},{flush:"post"}),Ve([l,b],()=>{$(v.value),mt(()=>M())},{flush:"post",immediate:!0}),fs(()=>{T!=null&&(window.cancelAnimationFrame(T),T=null),P?.disconnect(),P=null}),(S,E)=>(w(),N("pre",{ref_key:"preRef",ref:v,style:Qt(c.value),class:Re([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),N("code",rV,[(w(!0),N(Oe,null,tt(b.value,D=>(w(),N("span",{key:D.key,class:Re(["markstream-pre__diff-pane",D.className])},[(w(!0),N(Oe,null,tt(D.lines,(R,H)=>(w(),N("span",{key:R.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${R.kind}`,{"markstream-pre__diff-line--empty":R.empty}]]),style:Qt(L(H,D.key))},[E[0]||(E[0]=x("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),x("span",lV,O(R.number),1),x("span",aV,[x("span",cV,O(R.code),1)])],6))),128))],2))),128))])):(w(),N(Oe,{key:1},[t.showLineNumbers?(w(),N("span",uV,[(w(!0),N(Oe,null,tt(r.value,D=>(w(),N("span",{key:D,class:"markstream-pre__line-number"},O(D),1))),128))])):le("",!0),x("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,dV)],64))],14,iV))}});To.install=e=>{e.component(To.__name,To)};const Fg=Zl(!1);let aS=null;const fV={key:0},es=pn(qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(aS||(aS=ry().then(b=>{Fg.value=!!b}).catch(()=>{Fg.value=!1})),Gf(Fg)),s=rd(),o=jt("markstreamFade",void 0),i=jt("markstreamTextStreamState",void 0),r=jt("markstreamStreamVersion",void 0),l=B(()=>{const b=s.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),a=B(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=B(()=>{var b;const g=(b=s["index-key"])!=null?b:s.indexKey;return g==null||g===""?"":String(g)}),u=J(t.node.content),d=J("");let f=r?.value;const h=J(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Ve([()=>t.node.content,c,a,()=>r?.value],([b,g,v,y])=>{const T=String(b??""),P=c.value,I=y!==f;f=y;const k=jM({nextContent:T,persistedContent:P?i?.get(P):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:I});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),P&&i?.set(P,T)},{immediate:!0}),Ve(a,b=>{var g;b||(g=p(),u.value=g,d.value="")});const _=B(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(b,g)=>(w(),N("span",{class:Re([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),N("span",fV,O(u.value),1)):le("",!0),d.value?(w(),N("span",{key:1,class:Re(["text-node-stream-delta",[_.value]]),onAnimationend:m},O(d.value),35)):le("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);es.install=e=>{e.component(es.__name,es)};const r3=qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return fn(To,Lt(rt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Hg=fi({loader:()=>qn(null,null,function*(){try{return(yield Js(()=>import("./CodeBlockNode-Bi8jIiGS.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),To}}),loadingComponent:r3,delay:0,suspensible:!1}),vi=fi(()=>qn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return fn(es,Lt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield ry())return(yield Js(()=>import("./index6-CM7_ALPI.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return fn(es,Lt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),l3=fi(()=>qn(null,null,function*(){try{if(yield ry())return(yield Js(()=>import("./index5-DMfYcwho.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return fn(es,Lt(rt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),no=pn(qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);no.install=e=>{e.component(no.__name,no)};const pV={class:"superscript-node"},yo=pn(qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>rt({text:es,inline_code:qs,link:io,html_inline:Po,strong:so,emphasis:ro,footnote_reference:Oo,strikethrough:oo,highlight:Ro,insert:bo,subscript:ko,emoji:vo,math_inline:vi,reference:no},n.value));return(o,i)=>(w(),N("sup",pV,[(w(!0),N(Oe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Ni),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);yo.install=e=>{e.component(yo.__name,yo)};const hV={class:"subscript-node"},ko=pn(qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>rt({text:es,inline_code:qs,link:io,html_inline:Po,strong:so,emphasis:ro,footnote_reference:Oo,strikethrough:oo,highlight:Ro,insert:bo,superscript:yo,emoji:vo,math_inline:vi,reference:no},n.value));return(o,i)=>(w(),N("sub",hV,[(w(!0),N(Oe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Ni),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);ko.install=e=>{e.component(ko.__name,ko)};const mV={class:"strong-node"},so=pn(qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>rt({text:es,inline_code:qs,link:io,html_inline:Po,emphasis:ro,strikethrough:oo,highlight:Ro,insert:bo,subscript:ko,superscript:yo,emoji:vo,footnote_reference:Oo,math_inline:vi,reference:no},n.value));return(o,i)=>(w(),N("strong",mV,[(w(!0),N(Oe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Ni),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);so.install=e=>{e.component(so.__name,so)};const gV={class:"strikethrough-node"},oo=pn(qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>rt({text:es,inline_code:qs,link:io,html_inline:Po,strong:so,emphasis:ro,highlight:Ro,insert:bo,subscript:ko,superscript:yo,emoji:vo,footnote_reference:Oo,math_inline:vi,reference:no},n.value));return(o,i)=>(w(),N("del",gV,[(w(!0),N(Oe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Ni),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);oo.install=e=>{e.component(oo.__name,oo)};const vV=["href","title","aria-label","aria-hidden","target","rel"],yV=["aria-hidden"],kV={class:"link-text-wrapper relative inline-flex"},bV={class:"leading-[normal] link-text"},io=pn(qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=jt("markstreamShowTooltips",void 0),s=B(()=>{const b=n?.value;return typeof b=="boolean"?b:t.showTooltip}),o=B(()=>{var b,g,v,y,T;const P=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(b=t.animationOpacity)!=null?b:.35,k=Math.max(.12,Math.min(.5*I,I)),M={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":P,"--underline-opacity":String(I),"--underline-rest-opacity":String(k),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=hs(()=>t.customId),r=B(()=>rt({text:es,strong:so,strikethrough:oo,emphasis:ro,image:Kr,html_inline:Po,inline_code:qs},i.value)),l=rd(),a=B(()=>{var b,g;const v=(b=t.node)==null?void 0:b.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const T of v)Array.isArray(T)&&T[0]&&(y[String(T[0])]=String((g=T[1])!=null?g:""));else for(const[T,P]of Object.entries(v))T&&P!=null&&P!==!1&&(y[T]=P===!0?"":String(P));return tS(y,"safe","a")}),c=B(()=>rt(rt({},l),a.value)),u=B(()=>{var b,g;return tS({href:String((g=(b=t.node)==null?void 0:b.href)!=null?g:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const b=c.value.target;return(typeof b=="string"?b.trim():String(b??"").trim())||(uH(u.value)?"_blank":void 0)}),f=B(()=>{var b;return String((b=d.value)!=null?b:"").trim().toLowerCase()==="_blank"}),h=B(()=>{if(!u.value)return;const b=c.value.rel,g=new Set((typeof b=="string"?b:String(b??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=B(()=>{const b=rt({},c.value);return delete b.title,delete b.href,delete b.target,delete b.rel,b});function m(){s.value&&Yq()}const _=B(()=>{var b,g;const v=(b=t.node)==null?void 0:b.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(b,g)=>{var v,y;return e.node.loading?(w(),N("span",mn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[x("span",kV,[x("span",bV,[ie(C(es),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=x("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,yV)):(w(),N("a",mn({key:0,class:"link-node",href:u.value,title:s.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=T=>(function(P){var I,k,M,$;if(!s.value)return;const L=P,S=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,E=((I=t.node)==null?void 0:I.title)||((k=u.value)!=null&&k.includes("xn--")&&(($=(M=t.node)==null?void 0:M.text)!=null&&$.includes("://"))?t.node.text:u.value)||"";Gq(P.currentTarget,E,"top",!1,S)})(T)),onMouseleave:m}),[(w(!0),N(Oe,null,tt(e.node.children,(T,P)=>(w(),ye(C(Ni),{key:`${e.indexKey||"emphasis"}-${P}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${P}`},null,8,["components","node","custom-id","index-key"]))),128))],16,vV))}}}),[["__scopeId","data-v-367e6ca4"]]);io.install=e=>{e.component(io.__name,io)};const _V={class:"insert-node"},bo=pn(qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>rt({text:es,inline_code:qs,link:io,html_inline:Po,strong:so,emphasis:ro,strikethrough:oo,highlight:Ro,subscript:ko,superscript:yo,emoji:vo,footnote_reference:Oo,math_inline:vi,reference:no},n.value));return(o,i)=>(w(),N("ins",_V,[(w(!0),N(Oe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Ni),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);bo.install=e=>{e.component(bo.__name,bo)};const wV={class:"highlight-node"},Ro=pn(qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>rt({text:es,inline_code:qs,link:io,html_inline:Po,strong:so,emphasis:ro,strikethrough:oo,insert:bo,subscript:ko,superscript:yo,emoji:vo,footnote_reference:Oo,math_inline:vi,reference:no},n.value));return(o,i)=>(w(),N("mark",wV,[(w(!0),N(Oe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Ni),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Ro.install=e=>{e.component(Ro.__name,Ro)};const SV={class:"emphasis-node"},ro=pn(qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>rt({text:es,inline_code:qs,link:io,html_inline:Po,strong:so,strikethrough:oo,highlight:Ro,insert:bo,subscript:ko,superscript:yo,emoji:vo,footnote_reference:Oo,math_inline:vi,reference:no},n.value));return(o,i)=>(w(),N("em",SV,[(w(!0),N(Oe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Ni),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);ro.install=e=>{e.component(ro.__name,ro)};const CV={class:"hard-break"},Gr=pn(qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("br",CV))}),[["__scopeId","data-v-50c58f70"]]);Gr.install=e=>{e.component(Gr.__name,Gr)};const Ju=qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Hr({checkbox:Lo,checkbox_input:Lo,emoji:vo,emphasis:ro,hardbreak:Gr,highlight:Ro,inline_code:qs,insert:bo,link:io,reference:no,strikethrough:oo,strong:so,subscript:ko,superscript:yo,text:es}),s=hs(()=>t.customId),o=B(()=>{const i=s.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(w(!0),N(Oe,null,tt(e.nodes,(l,a)=>(w(),ye(C(Ni),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function T1(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(T1)}function Dp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(T1))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(T1)?o:null}function fc(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const xV=["cite"],AV={key:0,dir:"auto",class:"paragraph-node"},TV=["custom-id"],Df=pn(qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=hs(()=>t.customId),s=B(()=>!!n.value.paragraph),o=B(()=>!!n.value.text),i=B(()=>Dp(t.node.children,!s.value)),r=B(()=>t.fade!==!1||o.value?null:fc(i.value));return In("markstreamShowTooltips",B(()=>t.showTooltips)),In("markstreamFade",B(()=>t.fade)),(l,a)=>(w(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),N("p",AV,[r.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,TV)):(w(),ye(C(Ju),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ye(C(_o),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,xV))}}),[["__scopeId","data-v-abfecebc"]]);Df.install=e=>{e.component(Df.__name,Df)};const MV={class:"definition-list"},EV={class:"definition-term"},IV={class:"definition-desc"},Bf=pn(qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),N("dl",MV,[(w(!0),N(Oe,null,tt(t.node.items,(o,i)=>(w(),N(Oe,{key:i},[x("dt",EV,[ie(C(_o),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),x("dd",IV,[ie(C(_o),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Bf.install=e=>{e.component(Bf.__name,Bf)};const $V=["href","title"],xu=pn(qe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(w(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,$V))}}),[["__scopeId","data-v-e1eb37b6"]]);xu.install=e=>{e.component(xu.__name,xu)};const NV=["id"],LV={class:"flex-1"},Ff=qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[x("div",LV,[ie(C(_o),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,NV))}});Ff.install=e=>{e.component(Ff.__name,Ff)};const OV=["custom-id"],M1=pn(qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=hs(()=>t.customId),s=jt("markstreamFade",void 0),o=B(()=>s?.value!==!1||n.value.text?null:fc(t.node.children)),i=B(()=>rt({text:es,inline_code:qs,link:io,image:Kr,strong:so,emphasis:ro,strikethrough:oo,highlight:Ro,insert:bo,subscript:ko,superscript:yo,emoji:vo,checkbox:Lo,checkbox_input:Lo,footnote_reference:Oo,hardbreak:Gr,math_inline:vi,reference:no},n.value));return(r,l)=>(w(),ye(zs(`h${e.node.level}`),mn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:be(()=>[o.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,OV)):(w(!0),N(Oe,{key:1},tt(e.node.children,(a,c)=>(w(),ye(C(Ni),{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"]]),Bp=M1;Bp.install=e=>{e.component(M1.__name,M1)};const PV={key:0,dir:"auto",class:"paragraph-node"},RV=["custom-id"],DV={dir:"auto",class:"paragraph-node"},BV=["custom-id"],sc=pn(qe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var h;return(h=t.node)!=null?h:t.item}),s=hs(()=>t.customId),o=B(()=>!!s.value.paragraph),i=B(()=>!!s.value.text),r=B(()=>{var h;return Dp((h=n.value)==null?void 0:h.children,!o.value)}),l=B(()=>{var h;if(o.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=p.slice(1);if(!_.every(g=>g?.type==="list"))return null;const b=Dp([m]);return b?{paragraphChildren:b,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=B(()=>a()?fc(r.value):null),u=B(()=>{var h;return a()?fc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return In("markstreamShowTooltips",B(()=>t.showTooltips)),In("markstreamFade",B(()=>t.fade)),(h,p)=>{var m,_;return w(),N("li",mn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),N("p",PV,[c.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,RV)):(w(),ye(C(Ju),{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(),N(Oe,{key:1},[x("p",DV,[u.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,BV)):(w(),ye(C(Ju),{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),N(Oe,null,tt(l.value.nestedLists,(b,g)=>(w(),ye(C(_o),{key:g,nodes:[b],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),ye(C(_o),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=b=>h.$emit("copy",b))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);sc.install=e=>{e.component(sc.__name,sc)};const oc=pn(qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=hs(()=>e.customId),n=B(()=>t.value.list_item||sc);return(s,o)=>(w(),ye(zs(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:be(()=>[(w(!0),N(Oe,null,tt(e.node.items,(i,r)=>{var l;return w(),ye(zs(n.value),mn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);oc.install=e=>{e.component(oc.__name,oc)};const a3=Symbol("ViewportPriority");function FV(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?J(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function 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 m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&_())},{timeout:1200}))}Ve(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const b=(g,v)=>{const y=J(!1);let T,P=!1;const I=new Promise($=>{T=()=>{P||(P=!0,$())}}),k=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!o||!i.value)return y.value=!0,T(),{isVisible:y,whenVisible:I,destroy:k};const M=(function($,L){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(R,H){var U,G,Q;return{root:(U=e?.(R??null))!=null?U:null,rootMargin:(G=H?.rootMargin)!=null?G:"300px",threshold:(Q=H?.threshold)!=null?Q:0}})($,L);if(a&&(D=S,(E=c)&&E.root===D.root&&E.rootMargin===D.rootMargin&&E.threshold===D.threshold))return a;var E,D;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(R=>{for(const H of R)(H.isIntersecting||H.intersectionRatio>0)&&m(H.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const R of u.keys())a.observe(R);return a})(g,v);return M?(u.set(g,{resolve:T,visible:y}),M.observe(g),d.add(g),_(),{isVisible:y,whenVisible:I,destroy:k}):(y.value=!0,T(),{isVisible:y,whenVisible:I,destroy:k})};return In(a3,b),b}function HV(){var e,t;const n=jt(a3,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=s.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=J(!1);let p,m=!1;const _=new Promise(v=>{p=()=>{m||(m=!0,v())}}),b=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(f,{resolve:p,visible:h}),g.observe(f),i.add(f),d(),{isVisible:h,whenVisible:_,destroy:b}):(h.value=!0,p(),{isVisible:h,whenVisible:_,destroy:b})}}const WV={key:2,class:"html-block-node__raw"},zV=["innerHTML"],UV={key:1,class:"html-block-node__placeholder"},Au=pn(qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),s=jt("markstreamNestedRendererProps",void 0),o=B(()=>{var P,I;return(I=(P=t.htmlPolicy)!=null?P:n?.value)!=null?I:"safe"}),i=B(()=>{var P,I;const k=(P=s?.value)!=null?P:{};return Lt(rt({},k),{customId:(I=t.customId)!=null?I:k.customId,htmlPolicy:o.value})}),r=fi({loader:()=>Promise.resolve().then(()=>vy),suspensible:!1}),l=B(()=>{const P=f1(t.node.attrs,o.value);if(!P)return;const I=Lp(P);return Object.keys(I).length>0?I:void 0}),a=B(()=>{const P=String(t.node.tag||"").trim(),I=f1(t.node.attrs,o.value,P);if(!I)return;const k=Lp(I);return Object.keys(k).length>0?k:void 0}),c=hs(()=>t.customId),u=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=J(null),f=J(typeof window>"u"),h=J(t.node.content),p=B(()=>Array.isArray(t.node.children)?t.node.children:[]),m=B(()=>String(t.node.tag||"div")),_=B(()=>{const P=m.value.trim().toLowerCase();return KT.has(P)||ey(P,o.value)}),b=B(()=>p.value.length>0&&!!t.node.tag&&!_.value),g=B(()=>{var P,I,k;if(b.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(P=h.value)!=null?P:""};const M=(I=h.value)!=null?I:t.node.content;if(!M)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:nc(M,o.value)};if(t.node.loading){const L=Rp(M,c.value,o.value);return L===null?{mode:"text",content:(k=t.node.raw)!=null?k:M}:{mode:"dynamic",nodes:L}}if(!o3(M,c.value))return{mode:"html",content:nc(M,o.value)};const $=Rp(M,c.value,o.value);return $===null?{mode:"html",content:nc(M,o.value)}:{mode:"dynamic",nodes:$}}),v=HV(),y=J(null),T=!!t.node.loading;return typeof window<"u"?(Ve(d,P=>{var I,k;if((k=(I=y.value)==null?void 0:I.destroy)==null||k.call(I),y.value=null,!T)return f.value=!0,void(h.value=t.node.content);if(!P)return void(f.value=!1);const M=v(P,{rootMargin:"400px"});y.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ve(()=>t.node.content,P=>{T&&!f.value||(h.value=P)})):f.value=!0,fs(()=>{var P,I;(I=(P=y.value)==null?void 0:P.destroy)==null||I.call(P),y.value=null}),(P,I)=>(w(),ye(zs(b.value?m.value:"div"),mn({ref_key:"htmlRef",ref:d,class:"html-block-node"},b.value?a.value:void 0),{default:be(()=>[f.value?(w(),N(Oe,{key:0},[g.value.mode==="structured"?(w(),ye(C(r),mn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(w(),ye(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),N("pre",WV,O(g.value.content),1)):(w(),N("div",mn({key:3},l.value,{innerHTML:g.value.content}),null,16,zV))],64)):(w(),N("div",UV,[Nn(P.$slots,"placeholder",{node:e.node},()=>[I[0]||(I[0]=x("span",{class:"html-block-node__placeholder-bar"},null,-1)),I[1]||(I[1]=x("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),I[2]||(I[2]=x("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Au.install=e=>{e.component(Au.__name,Au)};const jV={dir:"auto",class:"paragraph-node"},qV=["custom-id"],jl=pn(qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=hs(()=>t.customId),s=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamFade",void 0),i=jt("markstreamParseOptions",void 0),r=jt("markstreamCustomMarkdownIt",void 0),l=jt("markstreamNestedRendererProps",void 0),a=B(()=>{var k;return(k=s?.value)!=null?k:"safe"}),c=B(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=B(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=B(()=>{var k,M;return(M=t.customHtmlTags)!=null?M:(k=l?.value)==null?void 0:k.customHtmlTags}),f=B(()=>{var k,M;const $=(k=l?.value)!=null?k:{};return Lt(rt({},$),{customId:(M=t.customId)!=null?M:$.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=fi({loader:()=>Promise.resolve().then(()=>vy),suspensible:!1});function p(k){var M;return k.type==="text"&&String((M=k.content)!=null?M:"").trim()===""}const m=B(()=>t.node.children.filter(k=>!p(k))),_=B(()=>m.value.length>0&&m.value.every(k=>k.type==="image"||(function(M){var $;const L=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(E=>!p(E)):[]})(M);return L.length===1&&(($=L[0])==null?void 0:$.type)==="image"})(k))),b=B(()=>new Set(bc(d.value))),g=B(()=>{if(!_.value||m.value.length<=1)return t.node.children;const k=[];for(let M=0;M<t.node.children.length;M++){const $=t.node.children[M];if(!p($)){k.push($);continue}const L=k.length>0,S=t.node.children.slice(M+1).some(E=>!p(E));L&&S&&k.push(Lt(rt({},$),{content:" ",raw:" "}))}return k}),v=B(()=>o?.value===!1&&!n.value.text),y=B(()=>v.value?fc(g.value):null);function T(k,M){return{node:k,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const P=B(()=>rt({inline_code:qs,image:Kr,link:io,hardbreak:Gr,emphasis:ro,strong:so,strikethrough:oo,highlight:Ro,insert:bo,subscript:ko,superscript:yo,html_inline:Po,html_block:Au,emoji:vo,checkbox:Lo,math_inline:vi,checkbox_input:Lo,reference:no,footnote_anchor:xu,footnote_reference:Oo,text:es},n.value)),I=B(()=>g.value.map((k,M)=>{var $;const L=(function(S){var E,D,R,H;if(S.type==="html_block"||S.type==="html_inline"){const U=String((E=S.tag)!=null?E:"").trim().toLowerCase()||XT(S.content);if(U&&!b.value.has(U)&&ZT((D=S.content)!=null?D:S.raw,U)){const G=String((H=(R=S.content)!=null?R:S.raw)!=null?H:"");return{child:{type:"text",content:G,raw:G},component:es,isCustomComponent:!1}}}return{child:S,component:P.value[S.type],isCustomComponent:!!(n.value[S.type]&&!hd(String(S.type)))}})(k);return Lt(rt({},L),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:L.isCustomComponent?uy(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String(($=L.child.content)!=null?$:""),originalChild:k})}));return(k,M)=>(w(),N("p",jV,[y.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(y.value),9,qV)):(w(!0),N(Oe,{key:1},tt(I.value,$=>{return w(),N(Oe,{key:$.key},[_.value&&p($.originalChild)?(w(),N(Oe,{key:0},[Ue(O((L=$.originalChild,String((S=L.content)!=null?S:""))),1)],64)):$.isCustomComponent?(w(),ye(zs($.component),mn({key:1,ref_for:!0},$.customAttrs,{node:$.child,loading:$.child.loading,"index-key":$.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:be(()=>[$.hasSlotChildren?(w(),ye(C(h),mn({key:0,ref_for:!0},f.value,{nodes:$.child.children,"index-key":$.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):$.slotContent?(w(),ye(C(h),mn({key:1,ref_for:!0},f.value,{content:$.slotContent,final:!$.child.loading,"index-key":`${$.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),ye(zs($.component),mn({key:2,ref_for:!0},T($.child,$.index)),null,16))],64);var L,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);jl.install=e=>{e.component(jl.__name,jl)};const VV={class:"table-node-wrapper"},KV=["aria-busy"],GV={key:0},YV=["custom-id"],QV=["aria-label","onPointerdown"],XV=["custom-id"],ZV={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Tu=pn(qe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var b;return(b=t.node.loading)!=null&&b}),s=B(()=>{var b;return(b=t.node.rows)!=null?b:[]}),o=J(null),i=J([]);let r=null;const l=B(()=>t.node.header.cells.length),a=B(()=>i.value.some(b=>Number.isFinite(b)&&b>0)),c=B(()=>a.value?i.value.map(b=>b>0?{width:`${b}px`}:void 0):[]);In("markstreamShowTooltips",B(()=>t.showTooltips)),In("markstreamFade",B(()=>t.fade));const u=hs(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),h=new WeakMap;function p(b){const g=t.fade===!1&&!d.value,v=!f.value,y=h.get(b);if(y?.children===b.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const T=Dp(b.children,v,!0),P={simpleChildren:T,plainText:T&&g?fc(T):null};return h.set(b,{children:b.children,textFastPath:g,paragraphFastPath:v,info:P}),P}function m(b){if(!r)return;b.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+b.clientX-r.startX))),T=[...r.widths];T[r.index]=y,T[r.index+1]=g-y,i.value=T}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return Ve(l,()=>{_(),i.value=[]}),fs(_),(b,g)=>(w(),N("div",VV,[x("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),N("colgroup",GV,[(w(!0),N(Oe,null,tt(e.node.header.cells,(v,y)=>(w(),N("col",{key:y,style:Qt(c.value[y])},null,4))),128))])):le("",!0),x("thead",null,[x("tr",null,[(w(!0),N(Oe,null,tt(e.node.header.cells,(v,y)=>(w(),N("th",{key:y,dir:"auto",class:Re([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(v).plainText),9,YV)):p(v).simpleChildren?(w(),ye(C(Ju),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(w(),ye(C(_o),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=T=>b.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(w(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:T=>(function(P,I){if(I.button!==0)return;const k=(function(){var L;const S=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(S??[],E=>Math.round(E.getBoundingClientRect().width))})(),M=k[P],$=k[P+1];M&&$&&(I.preventDefault(),r={index:P,startX:I.clientX,startWidth:M,nextStartWidth:$,widths:k},i.value=k,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,T)},null,40,QV)):le("",!0)],2))),128))])]),x("tbody",null,[(w(!0),N(Oe,null,tt(s.value,(v,y)=>(w(),N("tr",{key:y},[(w(!0),N(Oe,null,tt(v.cells,(T,P)=>(w(),N("td",{key:P,class:Re([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(T).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(T).plainText),9,XV)):p(T).simpleChildren?(w(),ye(C(Ju),{key:1,nodes:p(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${P}`},null,8,["nodes","custom-id","index-key"])):(w(),ye(C(_o),{key:2,nodes:T.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=I=>b.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,KV),ie(Xr,{name:"table-node-fade"},{default:be(()=>[n.value?(w(),N("div",ZV,[Nn(b.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=x("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=x("span",{class:"sr-only"},"Loading",-1))],!0)])):le("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Tu.install=e=>{e.component(Tu.__name,Tu)};const JV={class:"hr-node"},Hf=pn({},[["render",function(e,t){return w(),N("hr",JV)}],["__scopeId","data-v-39b2349c"]]);Hf.install=e=>{e.component(Hf.__name,Hf)};const eK={class:"unknown-node"},E1=qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),N("div",eK,O(e.node.raw),1))}),Wf=pn(qe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=B(()=>`vmr-container vmr-container-${t.node.name}`),s=hs(()=>t.customId),o=B(()=>rt({text:es,paragraph:jl,heading:Bp,inline_code:qs,link:io,image:Kr,strong:so,emphasis:ro,strikethrough:oo,insert:bo,subscript:ko,superscript:yo,checkbox:Lo,checkbox_input:Lo,hardbreak:Gr,math_inline:vi,reference:no,list:oc,math_block:l3,table:Tu},s.value));return(i,r)=>(w(),N("div",mn({class:n.value},e.node.attrs),[(w(!0),N(Oe,null,tt(e.node.children,(l,a)=>{return w(),ye(zs((c=l.type,o.value[c]||E1)),{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"]]);Wf.install=e=>{e.component(Wf.__name,Wf)};const tK=["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"],cS=[[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 nK(e){if(e<=255)return tK[e];let t=0,n=cS.length-1;for(;t<=n;){const s=t+n>>1,o=cS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const sK=/[ \t\n\r\f]+/g,oK=/[\t\n\r\f]| {2,}|^ | $/;let Wg=null;const iK=new RegExp("\\p{Script=Arabic}","u"),Rh=new RegExp("\\p{M}","u"),c3=new RegExp("\\p{Nd}","u");function uS(e){return iK.test(e)}function dS(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 nr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(dS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(dS(n))return!0}}return!1}const rK=new Set([" "," ","","\uFEFF"]);function lK(e){return nr(e)}function I1(e){return!(function(t){const n=Fp(t);return n!==null&&(dy.has(n)||Gl.has(n))})(e)&&!(function(t){const n=Fp(t);return n!==null&&rK.has(n)})(e)}const dy=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Dh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),fy=new Set(["'","’"]),Gl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),aK=new Set([":",".","،","؛"]),cK=new Set(["၏"]),uK=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function dK(e){if(py(e))return!0;let t=!1;for(const n of e)if(Gl.has(n))t=!0;else if(!t||!Rh.test(n))return!1;return t}function fK(e){for(const t of e)if(!dy.has(t)&&!Gl.has(t))return!1;return e.length>0}function pK(e){if(py(e))return!0;for(const t of e)if(!Dh.has(t)&&!fy.has(t)&&!Rh.test(t))return!1;return e.length>0}function py(e){let t=!1;for(const n of e)if(n!=="\\"&&!Rh.test(n)){if(!(Dh.has(n)||Gl.has(n)||fy.has(n)))return!1;t=!0}return t}function u3(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Fp(e){if(e.length===0)return null;const t=u3(e,e.length);return e.slice(t)}function hK(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Rh.test(s))n--;else{if(!Dh.has(s)&&!fy.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function mK(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function fS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function pS(e,t){return e&&t!==null&&aK.has(t)}function gK(e){const t=Fp(e);return t!==null&&cK.has(t)}function vK(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 $1(e){let t=e.length;for(;t>0;){const n=u3(e,t),s=e.slice(n,t);if(uK.has(s))return!0;if(!Gl.has(s))return!1;t=n}return!1}function yK(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
243
|
+
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const kK=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Qo(e){return e.length===1?e[0]:e.join("")}function bK(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Qo(n)}function _K(e,t,n,s){if(!kK.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=yK(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:Qo(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:Qo(r),isWordLike:a,kind:i,start:l}),o}function zg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const wK=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function SK(e,t){const n=e.texts[t];return!!n.startsWith("www.")||wK.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function CK(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const xK=new Set([":","-","/","×",",",".","+","–","—"]),hS=/^[A-Za-z0-9_]+[,:;]*$/,mS=/[,:;]+$/;function gS(e){for(const t of e)if(c3.test(t))return!0;return!1}function zf(e){if(e.length===0)return!1;for(const t of e)if(!c3.test(t)&&!xK.has(t))return!1;return!0}function vS(e,t,n){var s,o,i;const r=(Wg===null&&(Wg=new Intl.Segmenter(void 0,{granularity:"word"})),Wg);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],_=[],b=[],g=[],v=[];for(const k of r.segment(e))for(const M of _K(k.segment,(s=k.isWordLike)!=null&&s,k.index,n)){let $=function(){h[G]!==null&&(c[G]=[fS(a,h,p,G)],h[G]=null),c[G].push(M.text),u[G]=u[G]||M.isWordLike,m[G]=m[G]||E,_[G]=_[G]||D,b[G]=H,g[G]=U,v[G]=pS(_[G],R)};const L=M.kind==="text",S=mK(M.text,M.isWordLike,M.kind),E=nr(M.text),D=uS(M.text),R=Fp(M.text),H=$1(M.text),U=gK(M.text),G=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[G]==="text"&&E&&m[G]&&b[G]||L&&l>0&&d[G]==="text"&&fK(M.text)&&m[G]||L&&l>0&&d[G]==="text"&&g[G]?$():L&&l>0&&d[G]==="text"&&M.isWordLike&&D&&v[G]?($(),u[G]=!0):S!==null&&l>0&&d[G]==="text"&&h[G]===S?p[G]=((o=p[G])!=null?o:1)+1:L&&!M.isWordLike&&l>0&&d[G]==="text"&&(dK(M.text)||M.text==="-"&&u[G])?$():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,f[l]=M.start,h[l]=S,p[l]=S===null?0:1,m[l]=E,_[l]=D,b[l]=H,g[l]=U,v[l]=pS(D,R),l++)}for(let k=0;k<l;k++)h[k]===null?a[k]=Qo(c[k]):a[k]=fS(a,h,p,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&py(a[k])&&d[k-1]==="text"&&(a[k-1]+=a[k],u[k-1]=u[k-1]||u[k],a[k]="");const y=Array.from({length:l},()=>null);let T=-1;for(let k=l-1;k>=0;k--){const M=a[k];if(M.length!==0){if(d[k]==="text"&&!u[k]&&pK(M)&&T>=0&&d[T]==="text"){const $=(i=y[T])!=null?i:[];$.push(M),y[T]=$,f[T]=f[k],a[k]="";continue}T=k}}for(let k=0;k<l;k++){const M=y[k];M!=null&&(a[k]=bK(M,a[k]))}let P=0;for(let k=0;k<l;k++){const M=a[k];M.length!==0&&(P!==k&&(a[P]=M,u[P]=u[k],d[P]=d[k],f[P]=f[k]),P++)}a.length=P,u.length=P,d.length=P,f.length=P;const I=(function(k){const M=k.texts.slice(),$=k.isWordLike.slice(),L=k.kinds.slice(),S=k.starts.slice();for(let E=0;E<M.length-1;E++){if(L[E]!=="text"||L[E+1]!=="text"||!nr(M[E])||!nr(M[E+1]))continue;const D=hK(M[E]);D!==null&&(M[E]=D.head,M[E+1]=D.tail+M[E+1],S[E+1]=S[E]+D.head.length)}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:S}})((function(k){const M=[],$=[],L=[],S=[];for(let E=0;E<k.len;E++){const D=k.texts[E],R=k.kinds[E],H=k.isWordLike[E];if(R==="text"&&H&&hS.test(D)){const U=[D];let G=mS.test(D),Q=E+1;for(;G&&Q<k.len&&k.kinds[Q]==="text"&&k.isWordLike[Q]&&hS.test(k.texts[Q]);){const V=k.texts[Q];U.push(V),G=mS.test(V),Q++}M.push(Qo(U)),$.push(!0),L.push("text"),S.push(k.starts[E]),E=Q-1;continue}M.push(D),$.push(H),L.push(R),S.push(k.starts[E])}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:S}})((function(k){const M=[],$=[],L=[],S=[];for(let E=0;E<k.len;E++){const D=k.texts[E];if(k.kinds[E]==="text"&&D.includes("-")){const R=D.split("-");let H=R.length>1;for(let U=0;U<R.length;U++){const G=R[U];if(!H)break;G.length!==0&&gS(G)&&zf(G)||(H=!1)}if(H){let U=0;for(let G=0;G<R.length;G++){const Q=R[G],V=G<R.length-1?`${Q}-`:Q;M.push(V),$.push(!0),L.push("text"),S.push(k.starts[E]+U),U+=V.length}continue}}M.push(D),$.push(k.isWordLike[E]),L.push(k.kinds[E]),S.push(k.starts[E])}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:S}})((function(k){const M=[],$=[],L=[],S=[];for(let E=0;E<k.len;E++){const D=k.texts[E],R=k.kinds[E];if(R==="text"&&zf(D)&&gS(D)){const H=[D];let U=E+1;for(;U<k.len&&k.kinds[U]==="text"&&zf(k.texts[U]);)H.push(k.texts[U]),U++;M.push(Qo(H)),$.push(!0),L.push("text"),S.push(k.starts[E]),E=U-1;continue}M.push(D),$.push(k.isWordLike[E]),L.push(R),S.push(k.starts[E])}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:S}})((function(k){const M=[],$=[],L=[],S=[];for(let E=0;E<k.len;E++){const D=k.texts[E];if(M.push(D),$.push(k.isWordLike[E]),L.push(k.kinds[E]),S.push(k.starts[E]),!CK(D))continue;const R=E+1;if(R>=k.len||zg(k.kinds[R]))continue;const H=[],U=k.starts[R];let G=R;for(;G<k.len&&!zg(k.kinds[G]);)H.push(k.texts[G]),G++;H.length>0&&(M.push(Qo(H)),$.push(!0),L.push("text"),S.push(U),E=G-1)}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:S}})((function(k){const M=k.texts.slice(),$=k.isWordLike.slice(),L=k.kinds.slice(),S=k.starts.slice();for(let D=0;D<k.len;D++){if(L[D]!=="text"||!SK(k,D))continue;const R=[M[D]];let H=D+1;for(;H<k.len&&!zg(L[H]);){R.push(M[H]),$[D]=!0;const U=M[H].includes("?");if(L[H]="text",M[H]="",H++,U)break}M[D]=Qo(R)}let E=0;for(let D=0;D<M.length;D++){const R=M[D];R.length!==0&&(E!==D&&(M[E]=R,$[E]=$[D],L[E]=L[D],S[E]=S[D]),E++)}return M.length=E,$.length=E,L.length=E,S.length=E,{len:E,texts:M,isWordLike:$,kinds:L,starts:S}})((function(k){const M=[],$=[],L=[],S=[];let E=0;for(;E<k.len;){const D=[k.texts[E]];let R=k.isWordLike[E],H=k.kinds[E],U=k.starts[E];if(H==="glue"){const G=[D[0]],Q=U;for(E++;E<k.len&&k.kinds[E]==="glue";)G.push(k.texts[E]),E++;const V=Qo(G);if(!(E<k.len&&k.kinds[E]==="text")){M.push(V),$.push(!1),L.push("glue"),S.push(Q);continue}D[0]=V,D.push(k.texts[E]),R=k.isWordLike[E],H="text",U=Q,E++}else E++;if(H==="text")for(;E<k.len&&k.kinds[E]==="glue";){const G=[];for(;E<k.len&&k.kinds[E]==="glue";)G.push(k.texts[E]),E++;const Q=Qo(G);E<k.len&&k.kinds[E]==="text"?(D.push(Q,k.texts[E]),R=R||k.isWordLike[E],E++):D.push(Q)}M.push(Qo(D)),$.push(R),L.push(H),S.push(U)}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:S}})({len:P,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let k=0;k<I.len-1;k++){const M=vK(I.texts[k]);M!==null&&(I.kinds[k]!=="space"&&I.kinds[k]!=="preserved-space"||I.kinds[k+1]!=="text"||!uS(I.texts[k+1])||(I.texts[k]=M.space,I.isWordLike[k]=!1,I.kinds[k]=I.kinds[k]==="preserved-space"?"preserved-space":"space",I.texts[k+1]=M.marks+I.texts[k+1],I.starts[k+1]=I.starts[k]+M.space.length))}return I}function AK(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Ca=null;const yS=new Map;let xa=null;const TK=new RegExp("\\p{Emoji_Presentation}","u"),MK=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Ug=null;const kS=new Map;function N1(){if(Ca!==null)return Ca;if(typeof OffscreenCanvas<"u")return Ca=new OffscreenCanvas(1,1).getContext("2d"),Ca;if(typeof document<"u")return Ca=document.createElement("canvas").getContext("2d"),Ca;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Mr(e,t){let n=t.get(e);return n===void 0&&(n={width:N1().measureText(e).width,containsCJK:nr(e)},t.set(e,n)),n}function Bh(){if(xa!==null)return xa;if(typeof navigator>"u")return xa={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},xa;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 xa={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},xa}function d3(){return Ug===null&&(Ug=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ug}function EK(e){return TK.test(e)||e.includes("️")}function Tl(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=d3();for(const a of l.segment(i))EK(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function IK(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 $K(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function bS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Bh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(y=u,T=d,P=a){l++,a=0,c=!1,f=-1,h=0}function m(y,T){c=!0,u=y+1,d=0,a=T}function _(y,T,P){c=!0,u=y,d=T+1,a=P}function b(y,T){c?(a+=T,u=y+1,d=0):m(y,T)}function g(y,T){const P=i[y];for(let I=T;I<P.length;I++){const k=P[I];c?a+k>r?(p(),_(y,I,k)):(a+=k,u=y,d=I+1):_(y,I,k)}c&&u===y&&d===P.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=IK(e,v),!(v>=s.length)));){const y=s[v],T=o[v],P=T==="space"||T==="preserved-space"||T==="tab"||T==="zero-width-break"||T==="soft-hyphen";if(c)if(a+y>r){if(P){b(v,y),p(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(y>t&&i[v]!==null){p(),g(v,0),v++;continue}p()}else b(v,y),P&&(f=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),P&&(f=v+1,h=a-y),v++}return c&&p(),l}let jg=null;function NK(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,h){s=[d],o=f,i=h,r=$1(d),l=Dh.has(d)}function u(d,f){s.push(d),i=i||f;const h=$1(d);r=d.length===1&&Gl.has(d)&&r||h,l=!1}for(const d of(jg===null&&(jg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),jg).segment(e)){const f=d.segment,h=nr(f);s.length!==0?l||dy.has(f)||Gl.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 LK(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=nr(e[0].text),i=I1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=nr(a.text),u=I1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function OK(e,t,n,s){const o=Bh(),{cache:i,emojiCorrection:r}=(function(I,k){N1().font=I;const M=(function(S){let E=yS.get(S);return E||(E=new Map,yS.set(S,E)),E})(I),$=(function(S){const E=S.match(/(\d+(?:\.\d+)?)\s*px/);return E?parseFloat(E[1]):16})(I),L=k?(function(S,E){let D=kS.get(S);if(D!==void 0)return D;const R=N1();R.font=S;const H=R.measureText("😀").width;if(D=0,H>E+.5&&typeof document<"u"&&document.body!==null){const U=document.createElement("span");U.style.font=S,U.style.display="inline-block",U.style.visibility="hidden",U.style.position="absolute",U.textContent="😀",document.body.appendChild(U);const G=U.getBoundingClientRect().width;document.body.removeChild(U),H-G>.5&&(D=H-G)}return kS.set(S,D),D})(I,$):0;return{cache:M,fontSize:$,emojiCorrection:L}})(t,(l=e.normalized,MK.test(l)));var l;const a=Tl("-",Mr("-",i),r),c=8*Tl(" ",Mr(" ",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 m=null,_=[],b=n?[]:null,g=Array.from({length:e.len});function v(I,k,M,$,L,S,E){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(p=!1),u.push(k),d.push(M),f.push($),h.push(L),_.push(E),b!==null&&b.push(I)}function y(I,k,M,$,L){const S=Mr(I,i),E=Tl(I,S,r),D=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:E,R=k==="space"||k==="zero-width-break"?0:E;if(L&&$&&I.length>1){let H="sum-graphemes";zf(I)?H="pair-context":o.preferPrefixWidthsForBreakableRuns&&(H="segment-prefixes");const U=(function(G,Q,V,re,pe){if(Q.breakableFitAdvances!==void 0)return Q.breakableFitAdvances;const ne=d3(),X=[];for(const it of ne.segment(G))X.push(it.segment);if(X.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(pe==="sum-graphemes"){const it=[];for(const ce of X){const z=Mr(ce,V);it.push(Tl(ce,z,re))}return Q.breakableFitAdvances=it,Q.breakableFitAdvances}if(pe==="pair-context"||X.length>96){const it=[];let ce=null,z=0;for(const Y of X){const oe=Tl(Y,Mr(Y,V),re);if(ce===null)it.push(oe);else{const W=ce+Y,Z=Mr(W,V);it.push(Tl(W,Z,re)-z)}ce=Y,z=oe}return Q.breakableFitAdvances=it,Q.breakableFitAdvances}const he=[];let Pe="",je=0;for(const it of X){Pe+=it;const ce=Tl(Pe,Mr(Pe,V),re);he.push(ce-je),je=ce}return Q.breakableFitAdvances=he,Q.breakableFitAdvances})(I,S,i,r,H);return void v(I,E,D,R,k,M,U)}v(I,E,D,R,k,M,null)}for(let I=0;I<e.len;I++){g[I]=u.length;const k=e.texts[I],M=e.isWordLike[I],$=e.kinds[I],L=e.starts[I];if($==="soft-hyphen"){v(k,0,a,a,$,L,null);continue}if($==="hard-break"){v(k,0,0,0,$,L,null);continue}if($==="tab"){v(k,0,0,0,$,L,null);continue}const S=Mr(k,i);if($==="text"&&S.containsCJK){const E=NK(k,o),D=s==="keep-all"?LK(E):E;for(let R=0;R<D.length;R++){const H=D[R];y(H.text,"text",L+H.start,M,s==="keep-all"||!nr(H.text))}continue}y(k,$,L,M,!0)}const T=(function(I,k,M){const $=[];for(let L=0;L<I.length;L++){const S=I[L],E=S.startSegmentIndex<k.length?k[S.startSegmentIndex]:M,D=S.endSegmentIndex<k.length?k[S.endSegmentIndex]:M,R=S.consumedEndSegmentIndex<k.length?k[S.consumedEndSegmentIndex]:M;$.push({startSegmentIndex:E,endSegmentIndex:D,consumedEndSegmentIndex:R})}return $})(e.chunks,g,u.length),P=m===null?null:(function(I,k){const M=(function(L){const S=L.length;if(S===0)return null;const E=new Array(S);let D=!1;for(let V=0;V<S;){const re=L.charCodeAt(V);let pe=re,ne=1;if(re>=55296&&re<=56319&&V+1<S){const he=L.charCodeAt(V+1);he>=56320&&he<=57343&&(pe=he-56320+(re-55296<<10)+65536,ne=2)}const X=nK(pe);X!=="R"&&X!=="AL"&&X!=="AN"||(D=!0);for(let he=0;he<ne;he++)E[V+he]=X;V+=ne}if(!D)return null;let R=0;for(let V=0;V<S;V++){const re=E[V];if(re==="L"){R=0;break}if(re==="R"||re==="AL"){R=1;break}}const H=new Int8Array(S);for(let V=0;V<S;V++)H[V]=R;const U=1&R?"R":"L",G=U;let Q=G;for(let V=0;V<S;V++)E[V]==="NSM"?E[V]=Q:Q=E[V];Q=G;for(let V=0;V<S;V++){const re=E[V];re==="EN"?E[V]=Q==="AL"?"AN":"EN":re!=="R"&&re!=="L"&&re!=="AL"||(Q=re)}for(let V=0;V<S;V++)E[V]==="AL"&&(E[V]="R");for(let V=1;V<S-1;V++)E[V]==="ES"&&E[V-1]==="EN"&&E[V+1]==="EN"&&(E[V]="EN"),E[V]!=="CS"||E[V-1]!=="EN"&&E[V-1]!=="AN"||E[V+1]!==E[V-1]||(E[V]=E[V-1]);for(let V=0;V<S;V++){if(E[V]!=="EN")continue;let re;for(re=V-1;re>=0&&E[re]==="ET";re--)E[re]="EN";for(re=V+1;re<S&&E[re]==="ET";re++)E[re]="EN"}for(let V=0;V<S;V++){const re=E[V];re!=="WS"&&re!=="ES"&&re!=="ET"&&re!=="CS"||(E[V]="ON")}Q=G;for(let V=0;V<S;V++){const re=E[V];re==="EN"?E[V]=Q==="L"?"L":"EN":re!=="R"&&re!=="L"||(Q=re)}for(let V=0;V<S;V++){if(E[V]!=="ON")continue;let re=V+1;for(;re<S&&E[re]==="ON";)re++;const pe=(V>0?E[V-1]:G)!=="L"?"R":"L";if(pe===((re<S?E[re]:G)!=="L"?"R":"L"))for(let ne=V;ne<re;ne++)E[ne]=pe;V=re-1}for(let V=0;V<S;V++)E[V]==="ON"&&(E[V]=U);for(let V=0;V<S;V++){const re=E[V];1&H[V]?re!=="L"&&re!=="AN"&&re!=="EN"||H[V]++:re==="R"?H[V]++:re!=="AN"&&re!=="EN"||(H[V]+=2)}return H})(I);if(M===null)return null;const $=new Int8Array(k.length);for(let L=0;L<k.length;L++)$[L]=M[k[L]];return $})(e.normalized,m);return b!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:P,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:T,segments:b}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:P,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:T}}function PK(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return OK((function(c,u,d="normal",f="normal"){const h=(function(_){const b=_??"normal";return b==="pre-wrap"?{mode:b,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:b,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
|
|
244
|
+
`).replace(/[\r\f]/g,`
|
|
245
|
+
`):_.replace(/\r\n/g,`
|
|
246
|
+
`)})(c):(function(_){if(!oK.test(_))return _;let b=_.replace(sK," ");return b.charCodeAt(0)===32&&(b=b.slice(1)),b.length>0&&b.charCodeAt(b.length-1)===32&&(b=b.slice(0,-1)),b})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const b=[],g=[],v=[],y=[];let T=null,P=!1,I=0,k=!1,M=!1;function $(){T!==null&&(b.push(Qo(T)),g.push(P),v.push("text"),y.push(I),T=null)}for(let L=0;L<_.len;L++){const S=_.texts[L],E=_.kinds[L],D=_.isWordLike[L],R=_.starts[L];if(E==="text"){const H=lK(S),U=I1(S);if(T!==null&&k&&M){T.push(S),P=P||D,k=k||H,M=U;continue}$(),T=[S],P=D,I=R,k=H,M=U;continue}$(),b.push(S),g.push(D),v.push(E),y.push(R)}return $(),{len:b.length,texts:b,isWordLike:g,kinds:v,starts:y}})(vS(p,u,h)):vS(p,u,h);return rt({normalized:p,chunks:AK(m,h)},m)})(s,Bh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const qg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",gs=(()=>{const e=globalThis;if(e[qg])return e[qg];const t={configs:{},controllers:{},revision:Zl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[qg]=t,t})();let Zc=null;const _S=gs.revision;function wS(e){var t;return e&&(t=gs.configs[e])!=null?t:null}function SS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function RK(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Vg(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!RK(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
247
|
+
`)}return o.length>0?o:null}function Kg(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Zc!=null)return Zc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Zc=!!((i=r.getContext)!=null&&i.call(r,"2d")),Zc}catch{return Zc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=gs.blockEstimateCache.get(r);if(l)return gs.blockEstimateCache.delete(r),gs.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(h,p,m){const _=`${m}\0${p}\0${h}`,b=gs.preparedCache.get(_);if(b)return gs.preparedCache.delete(_),gs.preparedCache.set(_,b),b.prepared;const g=PK(h,p,{whiteSpace:m});for(gs.preparedCache.set(_,{prepared:g});gs.preparedCache.size>240;){const v=gs.preparedCache.keys().next().value;if(!v)break;gs.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const _=(function(b,g){return b.simpleLineWalkFastPath?bS(b,g):(function(v,y){if(v.simpleLineWalkFastPath)return bS(v,y);const{widths:T,lineEndFitAdvances:P,lineEndPaintAdvances:I,kinds:k,breakableFitAdvances:M,discretionaryHyphenWidth:$,tabStopAdvance:L,chunks:S}=v;if(T.length===0||S.length===0)return 0;const E=Bh(),D=E.lineFitEpsilon,R=y+D;let H=0,U=0,G=!1,Q=0,V=0,re=-1,pe=0,ne=0,X=null;function he(){re=-1,pe=0,ne=0,X=null}function Pe(Z=Q,ue=V,ae=U){H++,U=0,G=!1,he()}function je(Z,ue){G=!0,Q=Z+1,V=0,U=ue}function it(Z,ue,ae){G=!0,Q=Z,V=ue+1,U=ae}function ce(Z,ue){G?(U+=ue,Q=Z+1,V=0):je(Z,ue)}function z(Z,ue,ae,me){if(!ue)return;const j=Z==="tab"?0:P[ae],ee=Z==="tab"?me:I[ae];re=ae+1,pe=U-me+j,ne=U-me+ee,X=Z}function Y(Z,ue){const ae=M[Z];for(let me=ue;me<ae.length;me++){const j=ae[me];G?U+j>R?(Pe(),it(Z,me,j)):(U+=j,Q=Z,V=me+1):it(Z,me,j)}G&&Q===Z&&V===ae.length&&(Q=Z+1,V=0)}function oe(Z){if(X!=="soft-hyphen")return!1;const ue=M[Z];if(ue==null)return!1;const{fitCount:ae,fittedWidth:me}=(function(j,ee,fe,ke,Ae){let Ie=0,de=ee;for(;Ie<j.length;){const Me=de+j[Ie];if((Ie+1<j.length?Me+Ae:Me)>fe+ke)break;de=Me,Ie++}return{fitCount:Ie,fittedWidth:de}})(ue,U,y,D,$);return ae!==0&&(U=me,Q=Z,V=ae,he(),ae===ue.length?(Q=Z+1,V=0,!0):(Pe(Z,ae,me+$),Y(Z,ae),!0))}function W(Z){H++,he()}for(let Z=0;Z<S.length;Z++){const ue=S[Z];if(ue.startSegmentIndex===ue.endSegmentIndex){W();continue}G=!1,U=0,ue.startSegmentIndex,Q=ue.startSegmentIndex,V=0,he();let ae=ue.startSegmentIndex;for(;ae<ue.endSegmentIndex;){const me=k[ae],j=me==="space"||me==="preserved-space"||me==="tab"||me==="zero-width-break"||me==="soft-hyphen",ee=me==="tab"?$K(U,L):T[ae];if(me!=="soft-hyphen")if(G){if(U+ee>R){const fe=U+(me==="tab"?0:P[ae]),ke=U+(me==="tab"?ee:I[ae]);if(X==="soft-hyphen"&&E.preferEarlySoftHyphenBreak&&pe<=R){Pe(re,0,ne);continue}if(X==="soft-hyphen"&&oe(ae)){ae++;continue}if(j&&fe<=R){ce(ae,ee),Pe(ae+1,0,ke),ae++;continue}if(re>=0&&pe<=R){if(Q>re||Q===re&&V>0){Pe();continue}const Ae=re;Pe(Ae,0,ne),ae=Ae;continue}if(ee>y&&M[ae]!==null){Pe(),Y(ae,0),ae++;continue}Pe();continue}ce(ae,ee),z(me,j,ae,ee),ae++}else ee>y&&M[ae]!==null?Y(ae,0):je(ae,ee),z(me,j,ae,ee),ae++;else G&&(Q=ae+1,V=0,re=ae+1,pe=U+$,ne=U+$,X=me),ae++}if(G){const me=re===ue.consumedEndSegmentIndex?ne:U;Pe(ue.consumedEndSegmentIndex,0,me)}}return H})(b,g)})(h,p);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(gs.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});gs.blockEstimateCache.size>4e3;){const h=gs.blockEstimateCache.keys().next().value;if(!h)break;gs.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function f3(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Vg(e.children);return i&&n.paragraph?Kg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Vg(e.children),l=n.headings[i];return r&&l?Kg(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=Vg((o=i[0])==null?void 0:o.children);return r?Kg(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=f3(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 vf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function DK(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(vf(String((d=u.originalCode)!=null?d:"")),vf(String((f=u.updatedCode)!=null?f:"")),vf(String((h=u.code)!=null?h:""))):vf((function(p,m){const _=String(p??"");return m?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const m=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*m)})(u,r),f=(function(h,p){var m,_;if(!p)return 0;const b=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((_=h?.padding)==null?void 0:_.bottom)=="number"?h.padding.bottom:22;return Math.max(0,b)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else s==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(o?40:0)),contentHeight:c,rendererKind:s}}function BK(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Gg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=SS(s.lineHeight,1.5*SS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:BK(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const FK=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function CS(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))FK.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const HK=!1;function Oge(){return HK}function xS(e,t,n,s){var o;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=s.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const p3=Symbol("MarkstreamMathBlockMinHeightCache");function Pge(){return jt(p3,null)}const WK=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],zK=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],UK=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),h3=["raw","content","code","originalCode","updatedCode"],AS=new WeakMap,TS=new WeakMap;let jK=1;function ci(){return typeof performance<"u"?performance.now():Date.now()}function MS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ei(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=AS.get(t);return n||(n=jK++,AS.set(t,n)),String(n)}function ES(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:ei(t),customMarkdownIt:ei(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:ei(e.validateLink),preTransformTokens:ei(e.preTransformTokens),postTransformTokens:ei(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function IS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
248
|
+
`,t-1)+1;return e.slice(n,t).trim()}function $S(e){const t=m3(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function m3(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function g3(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 hy(e){const t=String(e??"");return`${t.length}:${g3(t)}`}function L1(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?hy(r):`${r.length}:${g3(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ei(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${ei(s)}`;const i=ei(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>L1(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}:${L1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Hp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function v3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Hp(s)?nl(s,t,n+1):v3(s,t,n+1)).join(",")}`:Hp(e)?nl(e,t,n):L1(e,t,n)}function qK(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!h3.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${hy(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${ei(o)}`:UK.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${v3(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${ei(o)}`:""}).filter(Boolean).join(";")}function VK(e){return h3.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${hy(n)}`:""}).filter(Boolean).join(";")}function nl(e,t=new WeakMap,n=0){const s=TS.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${ei(o)}`;const r=ei(o);t.set(o,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=>nl(p,c,u+1)).join("|"):"";return[a.type,VK(d),qK(d,c,u),f.length,h].join(":")})(e,t,n);return TS.set(o,l),l}function y3(e,t){return nl(e)===nl(t)}function my(e,t,n){const s=ci(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ci()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function NS(e,t,n){return my(t,n,()=>nl(e))}function k3(e,t,n){return NS(e,n,"stabilizeSignatureMs")===NS(t,n,"stabilizeSignatureMs")}function Yg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function LS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function KK(e,t){return e.length===t.length&&e===t}function gy(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=s[d],h=o[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"||!KK(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Hp(d)||!Hp(f))return null;const h=gy(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function GK(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=gy(e,t);return n??y3(e,t)}function YK(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return my(n,"stabilizeSignatureMs",()=>{s=gy(e,t)}),s??k3(e,t,n)}function QK(e,t){const n={};for(const s of WK){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function XK(e,t){var n;const s=D2(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),r=J(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=ci();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),p=ci()}Ve([t.renderContent,t.effectiveFinal,i],([M,$,L])=>{r.value!==M&&(!L||$||(function(S,E){if(!S&&E||E.length<=80||E.length<S.length||!E.startsWith(S))return!0;const D=E.slice(S.length);return!!D&&(!!$S(IS(E))||!(!D.includes(`
|
|
249
|
+
|
|
250
|
+
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(D))||D.endsWith(`
|
|
251
|
+
`)&&!(function(R){const H=IS(R);if($S(H))return!1;const U=m3(H);return U.length>=2&&U.some(G=>G.trim())})(E))})(r.value,M)?_():(function(){if(h+=1,l)return;const S=Math.max(0,(function(E){const D=E.parseCoalesceMs;return typeof D=="number"&&Number.isFinite(D)&&D>=0?D:80})(e)-(ci()-p));S<=0?_():l=setTimeout(_,S)})())},{flush:"sync",immediate:!0}),X1(m);const b=B(()=>{var M,$,L,S;return gH(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(S=(L=($=t.customComponentsMap)==null?void 0:$.value)!=null?L:{},Object.entries(S).map(([E,D])=>{const R=ri(E);return D==null||!R||hd(R)||VT.has(R)||dd.has(R)?"":R}).filter(Boolean)))}),g=B(()=>{const{key:M,tags:$}=vH(b.value);if(!M)return s;const L=o.get(M);if(L)return L;const S=D2(t.instanceMsgId,{customHtmlTags:$});return o.set(M,S),S}),v=B(()=>{const M=g.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=B(()=>{var M,$;const L=(M=e.parseOptions)!=null?M:{},S=t.effectiveFinal.value,E=b.value,D=S!=null,R=E.length>0;return D||R||L.streamParse==null?rt(rt(Lt(rt({},L),{streamParse:($=L.streamParse)==null||$}),D?{final:S}:{}),R?{customHtmlTags:E}:{}):L}),T=B(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),P=B(()=>ES(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),I=B(()=>ES(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ve([P,I],([M,$],[L,S])=>{L&&(M===L&&$===S||(_(),$!==S&&(a=[],d="")))},{flush:"sync"});const k=B(()=>{var M,$,L,S,E,D,R,H;if((M=e.nodes)!=null&&M.length)return a=[],d="",Hr(e.nodes.slice());const U=r.value;if(!U)return a=[],d="",[];const G=t.debugPerformanceEnabled.value,Q=G?ci():0,V=v.value,re=P.value,pe=I.value;c&&re!==c&&(function(ue){var ae,me;(me=(ae=ue.stream)==null?void 0:ae.reset)==null||me.call(ae)})(V),u&&pe!==u&&(a=[],d="");const ne=a.length>0&&U.startsWith(d)&&pe===u,X=G?MS(V):null,he=G?{}:void 0,Pe=he?Lt(rt({},y.value),{__timing:he}):y.value,je=OM(U,V,Pe),it=G?ci():0,ce=G?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let z,Y=G?Yg(je.length):void 0,oe=0,W=0;if(ne){const ue=G?ci():0;if(ce){const ae=(function(me,j,ee){if(!j.length)return{nodes:me,metrics:Yg(me.length)};const fe=(function(Ie,de,Me){const Ke=Math.min(Ie.length,de.length);for(let lt=0;lt<Ke;lt++)if(!YK(de[lt],Ie[lt],Me))return lt;return Ie.length===de.length?-1:Ke})(me,j,ee);if(fe<0)return{nodes:j,metrics:{reusedNodeCount:me.length,dirtyStartIndex:fe,stablePrefixNodeCount:me.length,dirtyTailNodeCount:0}};const ke=me.slice();let Ae=fe;for(let Ie=0;Ie<fe;Ie++)ke[Ie]=j[Ie];for(let Ie=fe;Ie<me.length;Ie++){const de=j[Ie],Me=me[Ie];de&&k3(de,Me,ee)&&(ke[Ie]=de,Ae+=1)}return{nodes:ke,metrics:{reusedNodeCount:Ae,dirtyStartIndex:fe,stablePrefixNodeCount:fe,dirtyTailNodeCount:LS(fe,me,j)}}})(je,a,ce);z=ae.nodes,Y=ae.metrics}else{const ae=(function(me,j){if(!j.length)return{nodes:me,metrics:Yg(me.length)};const ee=(function(Ae,Ie){const de=Math.min(Ae.length,Ie.length);for(let Me=0;Me<de;Me++)if(!GK(Ie[Me],Ae[Me]))return Me;return Ae.length===Ie.length?-1:de})(me,j);if(ee<0)return{nodes:j,metrics:{reusedNodeCount:me.length,dirtyStartIndex:ee,stablePrefixNodeCount:me.length,dirtyTailNodeCount:0}};const fe=me.slice();let ke=ee;for(let Ae=0;Ae<ee;Ae++)fe[Ae]=j[Ae];for(let Ae=ee;Ae<me.length;Ae++){const Ie=j[Ae],de=me[Ae];Ie&&y3(Ie,de)&&(fe[Ae]=Ie,ke+=1)}return{nodes:fe,metrics:{reusedNodeCount:ke,dirtyStartIndex:ee,stablePrefixNodeCount:ee,dirtyTailNodeCount:LS(ee,me,j)}}})(je,a);z=ae.nodes,Y=ae.metrics}oe=G?ci()-ue:0,W=Y?.dirtyStartIndex==null||Y.dirtyStartIndex<0?z.length:Y.dirtyStartIndex}else z=je;ce?(function(ue,ae,me=0){for(let j=Math.max(0,me);j<ue.length;j++)my(ae,"primeSignatureMs",()=>nl(ue[j]))})(z,ce,W):(function(ue,ae=0){for(let me=Math.max(0,ae);me<ue.length;me++)nl(ue[me])})(z,W);const Z=G?ci()-it:0;if(f+=1,d=U,c=re,u=pe,a=z,G){const ue=MS(V),ae=typeof ue?.total=="number"&&ue.total>(($=X?.total)!=null?$:0);t.logPerf(ae?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(ci()-Q),nodes:z.length,contentLength:U.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:Z,signatureMs:(L=ce?.signatureMs)!=null?L:0,stabilizeSignatureMs:(S=ce?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(E=ce?.primeSignatureMs)!=null?E:0,signatureCallCount:(D=ce?.signatureCallCount)!=null?D:0,stabilizeSignatureCallCount:(R=ce?.stabilizeSignatureCallCount)!=null?R:0,primeSignatureCallCount:(H=ce?.primeSignatureCallCount)!=null?H:0,stabilizeMs:oe},Y??{}),he?Object.fromEntries(zK.map(me=>{var j;return[me,(j=he[me])!=null?j:0]})):{}),ue?{streamMode:ue.lastMode,streamDelta:QK(ue,X),streamStats:ue}:{}))}return Hr(z)});return{effectiveCustomHtmlTags:b,effectiveCustomHtmlTagsSet:T,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:k}}function ZK(e){const{isClient:t}=e,n=J(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((m=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!m)return;var p,m;const _=n.value,b=_.has(f);if(h){if(b)return;const v=new Set(_);return v.add(f),void(n.value=v)}if(!b)return;const g=new Set(_);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f<c||(h(),o.delete(f));for(const[f,h]of s.entries())f<c||(h.destroy(),s.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function JK(e={}){const t=J(""),n=J(""),s=J(!1),o=eq(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=B(()=>Math.max(0,t.value.length-n.value.length)),a=B(()=>l.value===0),c=B(()=>s.value&&a.value);return Q1()&&X1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const OS=/auto|scroll|overlay/i;function eG(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return OS.test(t)||OS.test(n)}function tG(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 nG=qe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,s;return k1((s=za(e.estimatedPreviewHeightPx))!=null?s:v1(String((n=e.node.code)!=null?n:"")))});return()=>fn("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?fn("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)"}},[fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[fn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),fn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),fn("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},()=>fn("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,fn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[fn("div",{class:"absolute inset-0"},[fn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),sG=qe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,s;return y1((s=za(e.estimatedPreviewHeightPx))!=null?s:g1(String((n=e.node.code)!=null?n:"")))});return()=>fn("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?fn("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)"}},[fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[fn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),fn("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},()=>fn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[fn("span",{class:"action-icon block"})])))]):null,fn("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)"}},[fn("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"}})])])}}),oG=["data-custom-id"],iG={class:"m-0 p-0"},rG=["data-probe"],lG=["data-node-index","data-node-type"],b3=pn(qe(Lt(rt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Ps(),r=jt("markstreamNestedRendererProps",void 0);function l(A){var F,q;const K=s[A];return(function(te){const ge=i?.vnode.props;return!!ge&&(Object.prototype.hasOwnProperty.call(ge,te)||Object.prototype.hasOwnProperty.call(ge,String(te).replace(/[A-Z]/g,we=>`-${we.toLowerCase()}`)))})(A)?K:(q=(F=r?.value)==null?void 0:F[A])!=null?q:K}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=B(()=>{return(A=l("mode"))==="chat"||A==="minimal"||A==="docs"?A:"docs";var A}),u=B(()=>{const A=l("renderCodeBlocksAsPre"),F=l("codeRenderer");return A===!0?"pre":F==="pre"||F==="shiki"||F==="monaco"?F:A===!1||c.value==="docs"?"monaco":"pre"}),d=B(()=>a[c.value]),f=B(()=>{var A;return(A=l("showTooltips"))!=null?A:d.value.showTooltips}),h=B(()=>{var A;return(A=l("fade"))!=null?A:d.value.fade}),p=B(()=>{var A;return(A=l("batchRendering"))!=null?A:d.value.batchRendering}),m=B(()=>{var A;return(A=l("initialRenderBatchSize"))!=null?A:d.value.initialRenderBatchSize}),_=B(()=>{var A;return(A=l("renderBatchSize"))!=null?A:d.value.renderBatchSize}),b=B(()=>{var A;return(A=l("renderBatchDelay"))!=null?A:d.value.renderBatchDelay}),g=B(()=>{var A;return(A=l("renderBatchBudgetMs"))!=null?A:d.value.renderBatchBudgetMs}),v=B(()=>{var A;return(A=l("renderBatchIdleTimeoutMs"))!=null?A:d.value.renderBatchIdleTimeoutMs}),y=B(()=>{var A;return(A=l("deferNodesUntilVisible"))!=null?A:d.value.deferNodesUntilVisible}),T=B(()=>{var A;return(A=l("maxLiveNodes"))!=null?A:d.value.maxLiveNodes}),P=B(()=>{var A;return(A=l("liveNodeBuffer"))!=null?A:d.value.liveNodeBuffer}),I=B(()=>{var A;return(A=l("nodeVirtual"))!=null?A:d.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return b.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return T.value},get liveNodeBuffer(){return P.value},get nodeVirtual(){return I.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function M(A){o("height-change",A)}function $(A){o("virtual-state-change",A)}function L(A){o("anchor-change",A)}const S=J(),E=J(null),D=J(null),R=J(null),H=Ls({1:null,2:null,3:null,4:null,5:null,6:null}),U=J(!1),G=new Map,Q=J(0),V=J(0),re=J({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function pe(){var A,F;if(((A=s.virtualScroll)==null?void 0:A.enabled)!==!0)return null;const q=(F=s.virtualScroll)==null?void 0:F.scrollRoot;return ne(typeof q=="function"?q():q)}function ne(A){return A?typeof HTMLElement<"u"&&A instanceof HTMLElement?A:typeof A=="object"&&"value"in A?ne(A.value):typeof A=="object"&&"$el"in A?ne(A.$el):null:null}const{isClient:X,renderAsFragment:he,debugPerformanceEnabled:Pe,resolvedShowTooltips:je,resolvedHtmlPolicy:it,inheritedSmoothStreaming:ce,ownsTypewriterCursor:z}=(function(A){const F=typeof window<"u",q=rd(),K=jt("markstreamHtmlPolicy",void 0),te=jt("markstreamTypewriterCursor",void 0),ge=jt("markstreamSmoothStreaming",void 0),we=B(()=>A.renderAsFragment===!0),Ce=B(()=>!!(A.debugPerformance&&F&&typeof console<"u")),De=B(()=>{var Fe;if(typeof A.showTooltips=="boolean")return A.showTooltips;const Ne=(Fe=q.showTooltips)!=null?Fe:q["show-tooltips"];return Ne===""||Ne===!0||Ne==="true"||Ne!==!1&&Ne!=="false"&&void 0}),$e=B(()=>{var Fe,Ne;return(Ne=(Fe=A.htmlPolicy)!=null?Fe:K?.value)!=null?Ne:"safe"}),We=B(()=>te?.value!==!0);return{isClient:F,renderAsFragment:we,debugPerformanceEnabled:Ce,resolvedShowTooltips:De,resolvedHtmlPolicy:$e,inheritedSmoothStreaming:ge,inheritedTypewriterCursor:te,ownsTypewriterCursor:We}})(k),{resolveViewportRoot:Y,resolveScrollContainer:oe,isReverseFlexScrollRoot:W,getNormalizedScrollTop:Z,getOffsetTopWithinRoot:ue}=(function(A,F){function q(){var Ce,De;return(De=(Ce=F.scrollRoot)==null?void 0:Ce.call(F))!=null?De:null}function K(Ce){if(typeof window>"u")return null;const De=q();if(De)return De;const $e=Ce??A.value;if(!$e)return null;const We=$e.ownerDocument||document,Fe=We.scrollingElement||We.documentElement;let Ne=$e;for(;Ne&&Ne!==We.body&&Ne!==Fe;){if(eG(window.getComputedStyle(Ne))&&tG(Ne))return Ne;Ne=Ne.parentElement}return null}function te(Ce){if(!F.isClient)return!1;try{const De=window.getComputedStyle(Ce);return!!(De.display||"").toLowerCase().includes("flex")&&(De.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ge(Ce,De,$e){var We,Fe;if($e)return we(De);const Ne=Ce.scrollTop;if(!te(Ce))return Ne;const He=Ne<0?-Ne:Ne;return Math.max(0,((We=Ce.scrollHeight)!=null?We:0)-((Fe=Ce.clientHeight)!=null?Fe:0))-He}function we(Ce){var De,$e,We,Fe,Ne;const He=Number((De=Ce.scrollingElement)==null?void 0:De.scrollTop),Ze=Number((We=($e=Ce.documentElement)==null?void 0:$e.scrollTop)!=null?We:0),Je=Number((Ne=(Fe=Ce.body)==null?void 0:Fe.scrollTop)!=null?Ne:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Ze)?Ze:0,Number.isFinite(Je)?Je:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(Ce){var De,$e,We,Fe;const Ne=q();if(Ne)return Ne;const He=K((De=Ce??A.value)!=null?De:null);if(He)return He;const Ze=(Fe=(We=Ce?.ownerDocument)!=null?We:($e=A.value)==null?void 0:$e.ownerDocument)!=null?Fe:typeof document<"u"?document:null;return Ze?.scrollingElement||Ze?.documentElement||null},isReverseFlexScrollRoot:te,getNormalizedScrollTop:ge,getOffsetTopWithinRoot:function(Ce,De){const $e=De.ownerDocument||Ce.ownerDocument||document;if((function(He,Ze){return He===Ze.documentElement||He===Ze.body||He===Ze.scrollingElement})(De,$e))return Ce.getBoundingClientRect().top+we($e);const We=De.getBoundingClientRect(),Fe=Ce.getBoundingClientRect(),Ne=ge(De,$e,!1);return Fe.top-We.top+Ne}}})(S,{isClient:X,scrollRoot:pe});In("markstreamShowTooltips",je),In("markstreamHtmlPolicy",it),In("markstreamTypewriter",B(()=>k.typewriter!==!1)),In("markstreamFade",B(()=>k.fade!==!1)),In("markstreamTypewriterCursor",B(()=>!0)),In("markstreamTextStreamState",G),In("markstreamStreamVersion",Q),In("markstreamParseOptions",B(()=>k.parseOptions)),In("markstreamCustomMarkdownIt",B(()=>k.customMarkdownIt));const{smoothStreamingEnabled:ae,renderContent:me,effectiveFinal:j}=(function(A,F){const q=JK(A.smoothStreamingOptions),K=B(()=>{var $e,We,Fe;return A.smoothStreaming!==!1&&!(($e=A.nodes)!=null&&$e.length)&&(A.smoothStreaming===!0||!((We=F.inheritedSmoothStreaming)!=null&&We.value))&&(A.smoothStreaming===!0||A.typewriter===!0||((Fe=A.maxLiveNodes)!=null?Fe:0)<=0)}),te=J(!F.isClient||A.smoothStreaming===!0);yn(()=>{te.value=!0});const ge=B(()=>te.value&&K.value),we=B(()=>{var $e;return ge.value?q.visible.value:($e=A.content)!=null?$e:""}),Ce=B(()=>{var $e,We;const Fe=($e=A.parseOptions)!=null?$e:{};return(We=A.final)!=null?We:Fe.final}),De=B(()=>{const $e=Ce.value;return ge.value&&$e!=null?!!$e&&q.caughtUp.value:$e});return Ve([()=>A.content,()=>A.nodes,ge,Ce],([$e,We,Fe,Ne])=>{if(We?.length)return void q.reset("");const He=$e??"";if(!Fe)return q.reset(He),void(Ne&&q.finish({flush:!0}));const Ze=q.source.value;He?He===Ze||(He.startsWith(Ze)?q.enqueue(He.slice(Ze.length)):q.reset(He)):q.reset(""),Ne&&q.finish()},{immediate:!0}),{smoothStream:q,smoothStreamingEligible:K,smoothStreamingEnabled:ge,renderContent:we,requestedFinal:Ce,effectiveFinal:De}})(k,{isClient:X,inheritedSmoothStreaming:ce});In("markstreamSmoothStreaming",ae);const ee=J(!1);let fe="",ke=!1,Ae=null;function Ie(){X&&Ae!=null&&(window.clearTimeout(Ae),Ae=null)}function de(){ee.value=!1,Ie()}function Me(A,F){if(!Pe.value)return;const q=(function(){if(!Pe.value)return null;const K=Tt(Ke),te=Tt(lt),ge=Math.max(kt,te);if(K<=0&&ge<=0)return null;const we={total:K,maxPerFrame:ge,byLabel:(Ce=Ke,Object.fromEntries(Array.from(Ce.entries()).sort((De,$e)=>$e[1]-De[1]||De[0].localeCompare($e[0]))))};var Ce;return Ke.clear(),lt.clear(),kt=0,we})();console.info(`[markstream-vue][perf] ${A}`,q?Lt(rt({},F),{layoutReads:q}):F)}Ve([me,()=>s.nodes,j],([A,F,q])=>{const K=A??"";return F?.length||q===!0?(de(),fe=K,void(ke=!0)):ke?(fe&&K.length>fe.length&&K.startsWith(fe)?(ee.value=!0,X&&(Ie(),Ae=window.setTimeout(()=>{var te;Ae=null,j.value===!0||(te=s.nodes)!=null&&te.length||(ha(),ee.value=!1,Ri())},1200))):(K.length<fe.length||!K.startsWith(fe))&&de(),void(fe=K)):(fe=K,void(ke=!0))},{flush:"sync",immediate:!0});const Ke=new Map,lt=new Map;let yt=!1,kt=0;function Tt(A){let F=0;for(const q of A.values())F+=q;return F}function Pt(){kt=Math.max(kt,Tt(lt)),lt.clear(),yt=!1}function _t(A,F){return(function(q){var K,te;Pe.value&&(Ke.set(q,((K=Ke.get(q))!=null?K:0)+1),lt.set(q,((te=lt.get(q))!=null?te:0)+1),yt||(yt=!0,X&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Pt):typeof queueMicrotask!="function"?setTimeout(Pt,0):queueMicrotask(Pt)))})(A),F()}const Vt=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,cn=(function(A){const F=new Map;return{scope:A,cache:F,clear:()=>F.clear()}})(Vt),is=B(()=>`${Vt}:${Q.value}`);In(p3,cn);const Rt=hs(()=>k.customId),{effectiveCustomHtmlTagsSet:tn,mergedParseOptions:xs,parsedNodes:ot}=XK(k,{instanceMsgId:Vt,renderContent:me,effectiveFinal:j,smoothStreamingEnabled:ae,debugPerformanceEnabled:Pe,customComponentsMap:Rt,logPerf:Me});Ve(ot,()=>{cn.clear(),Q.value+=1},{immediate:!0});const Fn=B(()=>({customId:k.customId,customHtmlTags:xs.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:it.value,viewportPriority:k.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:k.codeBlockDarkTheme,codeBlockLightTheme:k.codeBlockLightTheme,codeBlockMonacoOptions:k.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:k.codeBlockMinWidth,codeBlockMaxWidth:k.codeBlockMaxWidth,codeBlockProps:k.codeBlockProps,mermaidProps:k.mermaidProps,d2Props:k.d2Props,infographicProps:k.infographicProps,showTooltips:je.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));In("markstreamNestedRendererProps",Fn);const kn=B(()=>ot.value),Gn=B(()=>ot.value.length),Hn=J(null),Ln=J(null),rs=J(null),Ge=J(null),Qe=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),Dt=!Qe&&k.customId?wS(k.customId):null,Xt=B(()=>Dt?(_S.value,wS(k.customId)):null),Zt=B(()=>{var A;return!!(X&&!he.value&&k.customId&&!Qe&&((A=Xt.value)!=null&&A.enabled))}),Jt=B(()=>{var A;return!!(!he.value&&((A=s.virtualScroll)!=null&&A.enabled))}),An=J(!1);yn(()=>{An.value=!0});const Mt=B(()=>!!(X&&Jt.value));In("markstreamHostScrollManaged",Mt);const Yn=B(()=>!!(An.value&&Mt.value)),Ht=B(()=>Zt.value||Mt.value),ks=B(()=>Zt.value||Yn.value),bs=B(()=>{var A;return Ht.value&&((A=Xt.value)==null?void 0:A.textEstimation)!==!1}),Fo=B(()=>{var A;return Ht.value&&((A=Xt.value)==null?void 0:A.codeBlockEstimation)!==!1});function Rs(){const A=V.value||_t("getMeasuredContainerWidth.clientWidth",()=>{var F;return((F=S.value)==null?void 0:F.clientWidth)||0});return Number.isFinite(A)&&A>0?A:0}const wo=B(()=>{const A=Rs();return A>0?Math.max(1,Math.round(A)):640}),ao=B(()=>{var A;return Math.max(1,(A=k.maxLiveNodes)!=null?A:320)}),Nt=B(()=>{var A;return!he.value&&k.nodeVirtual!==!1&&!(((A=k.maxLiveNodes)!=null?A:0)<=0)&&(k.nodeVirtual===!0?ot.value.length>0:ot.value.length>ao.value)}),Ho=B(()=>Nt.value||Zt.value||Mt.value),Wo=B(()=>k.viewportPriority!==!1&&!U.value),Ye=FV(A=>{var F;return Y((F=A??S.value)!=null?F:null)},Wo),{requestFrame:et,cancelFrame:st,hasIdleCallback:Bt,isTestEnv:zo}=(function(A){const F=A.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,q=A.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=A.isClient&&typeof window.requestIdleCallback=="function",te=(function(){var ge;if(typeof globalThis>"u"||!("process"in globalThis))return;const we=(ge=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ge.value;return we?.env})();return{requestFrame:F,cancelFrame:q,hasIdleCallback:K,isTestEnv:te?.NODE_ENV==="test"}})({isClient:X}),{resolvedBatchSize:Li,resolvedInitialBatch:Ee,batchingEnabled:xe,incrementalRenderingActive:Be,renderedCount:$t,previousRenderContext:zt,adaptiveBatchSize:ns,previousBatchConfig:Qn}=(function(A,F){var q;const K=B(()=>{var Fe;const Ne=Math.trunc((Fe=A.renderBatchSize)!=null?Fe:80);return Number.isFinite(Ne)?Math.max(0,Ne):0}),te=B(()=>{var Fe;const Ne=Math.trunc((Fe=A.initialRenderBatchSize)!=null?Fe:K.value);return Number.isFinite(Ne)?Math.max(0,Ne):K.value}),ge=B(()=>!F.renderAsFragment.value&&A.batchRendering!==!1&&K.value>0&&F.isClient&&!F.isTestEnv),we=J(0),Ce=J({key:A.indexKey,total:0}),De=J(Math.max(1,K.value||1)),$e=B(()=>{var Fe;return ge.value&&((Fe=A.maxLiveNodes)!=null?Fe:0)<=0}),We=J({batchSize:K.value,initial:te.value,delay:(q=A.renderBatchDelay)!=null?q:16,enabled:$e.value});return{resolvedBatchSize:K,resolvedInitialBatch:te,batchingEnabled:ge,incrementalRenderingActive:$e,renderedCount:we,previousRenderContext:Ce,adaptiveBatchSize:De,previousBatchConfig:We}})(k,{isClient:X,isTestEnv:zo,renderAsFragment:he}),Wn=new Map,ft=new Map,ve=new WeakMap;let Le=null;const On=new WeakMap,As=new Map,sa=J(0),Sc=B(()=>(sa.value,Array.from(Wn.entries()).sort((A,F)=>A[0]-F[0]))),se=J(null),_e=J(null);let Te=null,ze=0,nt=null;const{activeRestoreAnchor:at,getRelativeScrollTopWithinContainer:Ut,setRelativeScrollTopWithinContainer:bn,resolveAnchorOffset:Gt,clearRestoreReconcile:Vs,scheduleRestoreReconcile:Ds,captureRestoreAnchor:hn,restoreAnchor:_s,getAnchorDrift:Xn}=(function(A){const{isClient:F,containerRef:q,parsedNodeCount:K,requestFrame:te,cancelFrame:ge,resolveScrollContainer:we,getNormalizedScrollTop:Ce,getOffsetTopWithinRoot:De,isReverseFlexScrollRoot:$e,estimateIndexForOffset:We,estimateHeightRange:Fe,getFallbackNodeHeight:Ne,clamp:He}=A,Ze=J(null);let Je=null,wt=[];function ct(){const xt=we(),Wt=q.value;if(!xt||!Wt)return null;const Ft=xt.ownerDocument||Wt.ownerDocument||document;if(xt===Ft.documentElement||xt===Ft.body||xt===Ft.scrollingElement){const un=Wt.getBoundingClientRect();return Math.max(0,-un.top)}return Math.max(0,Ce(xt,Ft,!1)-De(Wt,xt))}function ut(xt){var Wt;const Ft=we(),un=q.value;if(!Ft||!un)return;const Ao=Math.max(0,xt),Ks=Ft.ownerDocument||un.ownerDocument||document,li=Ks.defaultView||(typeof window<"u"?window:null);if(Ft===Ks.documentElement||Ft===Ks.body||Ft===Ks.scrollingElement){const yr=Ce(Ft,Ks,!0)+un.getBoundingClientRect().top;return void((Wt=li?.scrollTo)==null||Wt.call(li,0,Math.max(0,yr+Ao)))}xS(Ft,Ks,De(un,Ft)+Ao,{isReverseFlexScrollRoot:yr=>{var kr;return(kr=$e?.(yr))!=null&&kr},getNormalizedScrollTop:Ce})}function Ct(xt){const Wt=K.value,Ft=He(xt.nodeIndex,0,Math.max(0,Wt-1));return Fe(0,Ft)+Math.max(0,xt.offsetWithinNodePx)}function St(){if(Je!=null&&(ge?.(Je),Je=null),F)for(const xt of wt)window.clearTimeout(xt);wt=[]}function nn(xt){const Wt=Ct(xt),Ft=ct();Ft!=null&&Math.abs(Ft-Wt)<=.5||ut(Wt)}return{activeRestoreAnchor:Ze,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:ut,resolveAnchorOffset:Ct,clearRestoreReconcile:St,applyRestoreAnchor:nn,scheduleRestoreReconcile:function(){Ze.value&&F&&Je==null&&(Je=te?te(()=>{Je=null,Ze.value&&nn(Ze.value)}):null,Je==null&&Ze.value&&nn(Ze.value))},captureRestoreAnchor:function(){const xt=ct(),Wt=K.value;if(xt==null||Wt<=0)return null;const Ft=He(We(xt+1),0,Wt-1),un=Fe(0,Ft),Ao=Ne(Ft);return{nodeIndex:Ft,offsetWithinNodePx:He(xt-un,0,Math.max(0,Ao-1))}},restoreAnchor:function(xt){const Wt=K.value;if(Ze.value={nodeIndex:He(xt.nodeIndex,0,Math.max(0,Wt-1)),offsetWithinNodePx:Math.max(0,xt.offsetWithinNodePx)},St(),nn(Ze.value),F)for(const Ft of[0,120,280,480])wt.push(window.setTimeout(()=>{Ze.value&&nn(Ze.value)},Ft))},getAnchorDrift:function(xt){const Wt=ct();return Wt==null?null:Wt-Ct(xt)}}})({isClient:X,containerRef:S,parsedNodeCount:Gn,requestFrame:et,cancelFrame:st,resolveScrollContainer:()=>se.value||oe(),getNormalizedScrollTop:Z,getOffsetTopWithinRoot:ue,isReverseFlexScrollRoot:W,estimateIndexForOffset:$m,estimateHeightRange:vr,getFallbackNodeHeight:Td,clamp:Ms}),{nodeHeights:Tn,heightStats:Mn,heightTreeSize:Uo,heightSumTree:fr,heightKnownTree:Cc,averageNodeHeight:ki,resetHeightMeasurements:B4,pruneHeightMeasurements:F4,rebuildHeightTrees:yd,recordNodeHeight:H4,removeNodeHeights:W4,exportHeightCache:z4,importHeightCache:U4,fenwickRangeSum:kd}=(function(A={}){const F=Ls({}),q=Ls({total:0,count:0}),K=J(0),te=J([]),ge=J([]);function we(){for(const Ne of Object.keys(F))delete F[Number(Ne)];q.total=0,q.count=0,K.value=0,te.value=[],ge.value=[]}function Ce(Ne,He,Ze){for(let Je=He+1;Je<Ne.length;Je+=Je&-Je)Ne[Je]+=Ze}function De(Ne,He){let Ze=0;for(let Je=He+1;Je>0;Je-=Je&-Je)Ze+=Ne[Je];return Ze}function $e(Ne){K.value=Ne;const He=new Array(Ne+1).fill(0),Ze=new Array(Ne+1).fill(0);for(const[Je,wt]of Object.entries(F)){const ct=Number(Je),ut=Number(wt);!Number.isFinite(ct)||ct<0||ct>=Ne||!Number.isFinite(ut)||ut<=0||(Ce(He,ct,ut),Ce(Ze,ct,1))}te.value=He,ge.value=Ze}function We(Ne){if(!Number.isInteger(Ne)||Ne<0)return!1;const He=F[Ne];if(!Number.isFinite(He)||He<=0)return!1;if(delete F[Ne],q.total=Math.max(0,q.total-He),q.count=Math.max(0,q.count-1),K.value>Ne){const Ze=te.value,Je=ge.value;Ze.length&&Je.length&&(Ce(Ze,Ne,-He),Ce(Je,Ne,-1))}return!0}const Fe=B(()=>q.count>0?Math.max(12,q.total/q.count):32);return{nodeHeights:F,heightStats:q,heightTreeSize:K,heightSumTree:te,heightKnownTree:ge,averageNodeHeight:Fe,resetHeightMeasurements:we,pruneHeightMeasurements:function(Ne){if(Ne<=0)return void we();let He=0,Ze=0;for(const[Je,wt]of Object.entries(F)){const ct=Number(Je),ut=Number(wt);!Number.isFinite(ct)||ct<0||ct>=Ne||!Number.isFinite(ut)||ut<=0?delete F[ct]:(He+=ut,Ze++)}q.total=He,q.count=Ze},rebuildHeightTrees:$e,recordNodeHeight:function(Ne,He,Ze={}){(function(Je,wt,ct={}){var ut;if(!Number.isFinite(wt)||wt<=0)return!1;const Ct=F[Je];if(Ct&&(ct.allowShrink===!1&&wt<Ct||Math.abs(wt-Ct)<=1))return!1;if(F[Je]=wt,Ct?q.total+=wt-Ct:(q.total+=wt,q.count++),K.value>Je){const St=te.value,nn=ge.value;if(St.length&&nn.length)if(Ct){const xt=wt-Ct;xt!==0&&Ce(St,Je,xt)}else Ce(St,Je,wt),Ce(nn,Je,1)}ct.notify!==!1&&((ut=A.onHeightRecorded)==null||ut.call(A))})(Ne,He,Lt(rt({},Ze),{notify:!0}))},removeNodeHeight:function(Ne,He={}){var Ze;const Je=We(Ne);return Je&&He.notify!==!1&&((Ze=A.onHeightRecorded)==null||Ze.call(A)),Je},removeNodeHeights:function(Ne,He={}){var Ze;let Je=0;for(const wt of Ne)We(Number(wt))&&Je++;return Je>0&&He.notify!==!1&&((Ze=A.onHeightRecorded)==null||Ze.call(A)),Je},exportHeightCache:function(){return Object.entries(F).map(([Ne,He])=>({index:Number(Ne),height:Number(He)})).filter(Ne=>Number.isFinite(Ne.index)&&Ne.index>=0&&Number.isFinite(Ne.height)&&Ne.height>0).sort((Ne,He)=>Ne.index-He.index)},importHeightCache:function(Ne,He={}){var Ze;if(!Array.isArray(Ne))return;const Je=K.value;let wt=!1;if(He.mode!=="merge"){const ct=Object.keys(F);if(ct.length>0){for(const ut of ct)delete F[Number(ut)];wt=!0}}for(const ct of Ne){const ut=Number(ct.index),Ct=Number(ct.height);if(!Number.isInteger(ut)||ut<0||Je>0&&ut>=Je||!Number.isFinite(Ct)||Ct<=0)continue;const St=F[ut];St&&Math.abs(St-Ct)<=1||(F[ut]=Ct,wt=!0)}wt&&((function(){let ct=0,ut=0;const Ct=K.value;for(const[St,nn]of Object.entries(F)){const xt=Number(St),Wt=Number(nn);!Number.isFinite(xt)||xt<0||Ct>0&&xt>=Ct||!Number.isFinite(Wt)||Wt<=0?delete F[xt]:(ct+=Wt,ut++)}q.total=ct,q.count=ut})(),Je>0&&$e(Je),(Ze=A.onHeightRecorded)==null||Ze.call(A))},fenwickRangeSum:function(Ne,He,Ze){if(Ze<=He)return 0;const Je=De(Ne,Ze-1);return He<=0?Je:Je-De(Ne,He-1)}}})({onHeightRecorded:()=>{qo(),Mt.value&&Hc(),at.value&&Ds(),_e.value&&da(),Pn("node-resize")}});function bd(){B4(),As.clear()}function zy(A){!Number.isInteger(A)||A<0||A>=ot.value.length||As.set(A,Ec(A))}function Uy(A,F,q={}){const K=Tn[A];H4(A,F,q);const te=Tn[A];te&&te>0?zy(A):K&&As.delete(A)}function jy(A,F){const q=_t("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,te;return(te=(K=Wn.get(A))==null?void 0:K.offsetHeight)!=null?te:0});return q>0?q:_t("getNodeLayoutHeight.content.offsetHeight",()=>F.offsetHeight)}function qy(A,F={}){U4(A,F),wm()}const pr=B(()=>{var A;return!he.value&&k.deferNodesUntilVisible!==!1&&!(((A=k.maxLiveNodes)!=null?A:0)<=0)&&!Nt.value&&!(ot.value.length>900)&&Wo.value}),Vy=B(()=>!!Ye&&(pr.value||Nt.value)),Ky=B(()=>Nt.value||Mt.value),{liveNodeBufferResolved:xc,focusIndex:jo,liveRange:Ts,updateLiveRange:ul}=(function(A,F){const{parsedNodeCount:q,virtualizationEnabled:K,maxLiveNodesResolved:te,clamp:ge}=F,we=B(()=>{var $e;return Math.max(0,($e=A.liveNodeBuffer)!=null?$e:60)}),Ce=J(0),De=Ls({start:0,end:0});return{liveNodeBufferResolved:we,focusIndex:Ce,liveRange:De,updateLiveRange:function(){const $e=q.value;if(!K.value||$e===0)return De.start=0,void(De.end=$e);const We=Math.min(te.value,$e),Fe=we.value,Ne=ge(Ce.value-Fe,0,Math.max(0,$e-We));De.start=Ne,De.end=Math.min($e,Ne+We)}}})(k,{parsedNodeCount:Gn,virtualizationEnabled:Nt,maxLiveNodesResolved:ao,clamp:Ms}),bi=new Map,dl=new Map,hr=new Map,_d=[],Oi=new Map,mr=new Set,Gy=J(0);let Yh=!1;const Yy=B(()=>(Gy.value,mr.size)),So=new Map,_i=new Map,Qy=J(0),Qh=B(()=>{Qy.value;let A=0;for(const F of So.values())A+=Math.max(0,F);return A});let Co=null,Xh=!0,Xy=[0],Zy="";function qo(){Xh=!0}const wd=B(()=>{if(!Nt.value)return ot.value.length;const A=xc.value,F=Math.max(Ts.end+A,Ee.value),q=Math.min(ot.value.length,F);return Math.max($t.value,q)});function Sd(){Yh||(Yh=!0,queueMicrotask(()=>{Yh=!1,Gy.value+=1}))}function Jy(A,F,q="node-resize"){if(!X||typeof window>"u")return null;const K=window.setTimeout(()=>{mr.delete(K)&&Sd();try{F()}finally{Pn(q)}},Math.max(0,A));return mr.add(K),Sd(),K}function Cd(A){X&&A!=null&&(mr.delete(A)&&Sd(),window.clearTimeout(A))}function ek(){if(X&&typeof window<"u")for(const A of mr)window.clearTimeout(A);mr.size&&(mr.clear(),Sd()),_d.length=0,hr.clear()}function j4(A){var F,q;return(q=(F=Ge.value)==null?void 0:F[A])!=null?q:null}const{cancelScheduledFocusSync:Zh,scheduleFocusSync:wi}=(function(A){const{isClient:F,containerRef:q,virtualizationEnabled:K,requestFrame:te,cancelFrame:ge,syncFocusToScroll:we}=A;let Ce=null;function De(){var We,Fe,Ne;return(Ne=(Fe=(We=q.value)==null?void 0:We.ownerDocument)==null?void 0:Fe.defaultView)!=null?Ne:typeof window<"u"?window:null}function $e(){if(!Ce)return;const We=De();Ce.viaTimeout?We?We.clearTimeout(Ce.id):clearTimeout(Ce.id):ge?.(Ce.id),Ce=null}return{cancelScheduledFocusSync:$e,scheduleFocusSync:function(We={}){if(!K.value)return;if(!F)return void we(!0);if(We.immediate)return $e(),void we(!0);if(Ce)return;const Fe=()=>{Ce=null,we()};if(te)return void(Ce={id:te(Fe),viaTimeout:!1});const Ne=De();Ce={id:Ne?Ne.setTimeout(Fe,16):setTimeout(Fe,16),viaTimeout:!0}}}})({isClient:X,containerRef:S,virtualizationEnabled:Nt,requestFrame:et,cancelFrame:st,syncFocusToScroll:function(A=!1){var F;if(!Nt.value)return;const q=se.value||oe();if(!q)return;const K=q.ownerDocument||((F=S.value)==null?void 0:F.ownerDocument)||document,te=K?.defaultView||(typeof window<"u"?window:null),ge=q===K?.documentElement||q===K?.body,we=ot.value.length;if(!ge&&we>0&&W(q)){const Ze=_t("syncFocusToScroll.clientHeight",()=>q.clientHeight||0),Je=_t("syncFocusToScroll.scrollTop",()=>q.scrollTop),wt=Je<0?-Je:Je,ct=(function(Ct){var St,nn;const xt=ot.value;if(!xt.length)return 0;if(Ct<=0)return Math.max(0,xt.length-1);if(Ht.value){const Ft=(St=sm()[xt.length])!=null?St:0;return ak(Math.max(0,Ft-Ct))}if(Uo.value===xt.length){const Ft=vr(0,xt.length);return $m(Math.max(0,Ft-Ct))}let Wt=Ct;for(let Ft=xt.length-1;Ft>=0;Ft--){const un=(nn=Tn[Ft])!=null?nn:ki.value;if(Wt<=un)return Ft;Wt-=un}return 0})(Math.max(0,wt)+.5*Math.max(0,Ze)),ut=Ms(ct,0,Math.max(0,we-1));return void((A||Math.abs(ut-jo.value)>1)&&(jo.value=ut,ul()))}const Ce=ge?null:_t("syncFocusToScroll.root.getBoundingClientRect",()=>q.getBoundingClientRect()),De=ge?0:Ce.top,$e=ge?_t("syncFocusToScroll.viewport.clientHeight",()=>{var Ze,Je;return(Je=(Ze=te?.innerHeight)!=null?Ze:q.clientHeight)!=null?Je:0}):Ce.bottom,We=Sc.value;let Fe=null,Ne=null;for(const[Ze,Je]of We){if(!Je)continue;const wt=_t("syncFocusToScroll.slot.getBoundingClientRect",()=>Je.getBoundingClientRect());wt.bottom<=De||wt.top>=$e||(Fe==null&&(Fe=Ze),Ne=Ze)}if(Fe==null||Ne==null){const Ze=S.value;if(!Ze)return;const Je=ge?{top:0}:_t("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>q.getBoundingClientRect()),wt=_t("syncFocusToScroll.fallback.scrollTop",()=>Z(q,K,ge)),ct=ge?(()=>{const St=_t("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ze.getBoundingClientRect()),nn=(ge?0:Je.top)-St.top;return Math.max(0,nn)})():(()=>{const St=ue(Ze,q);return Math.max(0,wt-St)})(),ut=ge?_t("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var St,nn,xt,Wt;return(Wt=(xt=(nn=te?.innerHeight)!=null?nn:(St=K?.documentElement)==null?void 0:St.clientHeight)!=null?xt:q.clientHeight)!=null?Wt:0}):_t("syncFocusToScroll.fallback.root.clientHeight",()=>q.clientHeight),Ct=$m(ct+.5*Math.max(0,ut));return jo.value=Ms(Ct,0,Math.max(0,ot.value.length-1)),void ul()}const He=Math.round((Fe+Ne)/2);!A&&Math.abs(He-jo.value)<=1||(jo.value=Ms(He,0,Math.max(0,ot.value.length-1)),ul())}}),{visibleNodeIndices:Jh,nodeVisibilityHandles:oa,nodeVisibilityWatchStops:xd,nodeVisibilityFallbackTimers:tk,clearVisibilityFallback:Ad,markNodeVisible:gr,cleanupNodeVisibility:q4,destroyNodeVisibilityState:em}=ZK({isClient:X,shouldTrackVisibleNodeIndices:()=>pr.value,shouldCleanupNodeVisibility:()=>Nt.value,onNodeMarkedVisible:A=>{Nt.value?wi():jo.value=Ms(A,0,Math.max(0,ot.value.length-1))},onNodeVisibilityCleaned:A=>{Wn.delete(A)&&Ik()}}),{cleanupScrollListener:nk,setupScrollListener:V4}=(function(A){const{isClient:F,virtualizationEnabled:q,listenerEnabled:K,scrollRootElement:te,resolveScrollContainer:ge,scheduleFocusSync:we,onScroll:Ce}=A;let De=null,$e=null;function We(){De&&(De(),De=null),$e=null,te.value=null}function Fe(Ne){const He=A.getScrollTop?A.getScrollTop(Ne):Ne.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:We,setupScrollListener:function(){if(!F)return;if(!((Ne=K?.value)!=null?Ne:q.value))return void We();var Ne;const He=ge();if(!He)return void We();if(te.value===He&&De)return;We(),$e=Fe(He);const Ze=()=>{if(Ce?.(),q.value){const Je=(function(wt){const ct=Fe(wt),ut=$e;$e=ct;const Ct=Math.max(480,.75*(wt.clientHeight||0));return ut==null?ct>Ct?{immediate:!0}:void 0:Math.abs(ct-ut)>Ct?{immediate:!0}:void 0})(He);Je?we(Je):we()}};He.addEventListener("scroll",Ze,{passive:!0}),te.value=He,De=()=>{He.removeEventListener("scroll",Ze)}}}})({isClient:X,virtualizationEnabled:Nt,listenerEnabled:Ky,scrollRootElement:se,resolveScrollContainer:oe,scheduleFocusSync:wi,onScroll:function(){const A=_e.value;if(!A)return;const F=Mc();if(!F||(function(K){if(Oc()>=ze)return nt=null,!1;const te=nt;if(te==null)return!0;const ge=Math.abs(K.scrollTop-te)<=2;return ge||(nt=null),ge})(F))return;const q=vk(F);q!=null?(q<-32||Math.abs(Math.max(0,q)-Math.max(0,A.distanceFromBottomPx))>32)&&ua("restore"):ua("restore")},getScrollTop:A=>{var F;const q=A.ownerDocument||((F=S.value)==null?void 0:F.ownerDocument)||document,K=A===q.documentElement||A===q.body||A===q.scrollingElement;return _t("scrollListener.getScrollTop",()=>Z(A,q,K))}});function Ms(A,F,q){return Math.min(Math.max(A,F),q)}function tm(A){return A?.firstElementChild}function sk(A,F){var q;return A?(q=A.matches)!=null&&q.call(A,F)?A:A.querySelector(F):null}function ok(){if(!Ht.value)return void(V.value=0);const A=_t("updateExperimentContainerWidth.clientWidth",()=>{var F,q;return(q=(F=S.value)==null?void 0:F.clientWidth)!=null?q:0});V.value=A>0?A:0}let Ac=null;function nm(){Ac?.disconnect(),Ac=null}const ik=fi({loader:()=>qn(null,null,function*(){return(yield Js(()=>import("./index8-DDNiq5_W.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:r3,delay:0,suspensible:!1});function rk(A){return A===ik}const lk=B(()=>u.value==="pre"?To:u.value==="shiki"?ik:Hg),fl=B(()=>{const A=ot.value;if(!A.length||!Ht.value)return A.map(()=>null);const F=V.value||_t("estimatedNodeHeights.clientWidth",()=>{var q;return((q=S.value)==null?void 0:q.clientWidth)||0});return!Number.isFinite(F)||F<=0?A.map(()=>null):A.map((q,K)=>{const te=Tn[K],ge=typeof te=="number"&&te>0;if(bs.value&&!ge){const Ce=f3(q,F,re.value);if(Ce)return Ce}if(Fo.value&&q.type==="code_block"){const Ce=(function(De){if(De.type!=="code_block")return null;const $e=Uk(De,Od(De));return rk($e)?"markdown":$e===To?"pre":$e===lk.value||$e===Hg?"monaco":null})(q);if(Ce==="monaco"||Ce==="markdown"||Ce==="pre")return DK(q,{rendererKind:Ce,monacoOptions:k.codeBlockMonacoOptions,showHeader:((we=k.codeBlockProps)==null?void 0:we.showHeader)!==!1})}var we;return null})});function Td(A){var F;const q=Tn[A];if(Number.isFinite(q)&&q>0)return q;const K=(F=fl.value[A])==null?void 0:F.height;return Number.isFinite(K)&&K>0?K:Math.max(ki.value,(function(te){var ge,we,Ce,De,$e,We,Fe,Ne,He,Ze,Je,wt,ct;const ut=ot.value[te];if(!ut||typeof ut!="object")return 32;const Ct=String((ge=ut.type)!=null?ge:""),St=Rs()||640;switch(Ct){case"heading":return 44;case"paragraph":return ia(String((Ce=(we=ut.raw)!=null?we:ut.content)!=null?Ce:""),St,34);case"list":{const nn=Array.isArray(ut.items)?ut.items.length:1;return Math.max(48,30*nn+12)}case"list_item":return ia(String(($e=(De=ut.raw)!=null?De:ut.content)!=null?$e:""),St,34);case"blockquote":return ia(String((Fe=(We=ut.raw)!=null?We:ut.content)!=null?Fe:""),St,56);case"table":{const nn=Array.isArray(ut.rows)?ut.rows.length:Array.isArray(ut.children)?ut.children.length:3;return Math.max(120,38*nn+48)}case"code_block":return ia(String((He=(Ne=ut.code)!=null?Ne:ut.raw)!=null?He:""),St,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ia(String((Je=(Ze=ut.raw)!=null?Ze:ut.content)!=null?Je:""),St,96);case"thematic_break":return 24;default:return ia(String((ct=(wt=ut.raw)!=null?wt:ut.content)!=null?ct:""),St,40)}})(A))}function ia(A,F,q,K=22){const te=String(A??"");if(!te)return q;const ge=Math.max(18,Math.floor(Math.max(320,F)/8)),we=te.split(/\r?\n/).length,Ce=Math.ceil(te.length/ge),De=Math.max(1,we,Ce);return Math.max(q,Math.ceil(De*K+12))}function Tc(A){const F=Number(A);return!Number.isFinite(F)||F<=0?-1:Math.round(F/32)}function sm(){var A,F;const q=ot.value.length,K=Tc(V.value||_t("getFallbackHeightPrefix.clientWidth",()=>{var Ce;return((Ce=S.value)==null?void 0:Ce.clientWidth)||0})),te=((A=s.virtualScroll)==null?void 0:A.measurementKey)==null?"":String(s.virtualScroll.measurementKey),ge=[q,Mn.count,Math.round(Mn.total),Math.round(100*ki.value),te,K,Ht.value?1:0,_S.value,Q.value].join(":");if(!Xh&&Zy===ge)return Xy;const we=new Array(q+1);we[0]=0;for(let Ce=0;Ce<q;Ce++)we[Ce+1]=we[Ce]+(Ht.value?Td(Ce):(F=Tn[Ce])!=null?F:ki.value);return Xy=we,Zy=ge,Xh=!1,we}function ak(A){var F,q;const K=ot.value.length;if(K<=0||A<=0)return 0;const te=sm();if(A>=((F=te[K])!=null?F:0))return K-1;let ge=0,we=K-1,Ce=K-1;for(;ge<=we;){const De=ge+we>>1;((q=te[De+1])!=null?q:0)>=A?(Ce=De,we=De-1):ge=De+1}return Ce}function vr(A,F){var q,K;if(A>=F)return 0;if(Ht.value)return(function(we,Ce){var De,$e;const We=ot.value.length,Fe=Ms(Math.trunc(we),0,We),Ne=Ms(Math.trunc(Ce),Fe,We);if(Fe>=Ne)return 0;const He=sm();return((De=He[Ne])!=null?De:0)-(($e=He[Fe])!=null?$e:0)})(A,F);if(Uo.value!==ot.value.length){let we=0;for(let Ce=A;Ce<F;Ce++)we+=(q=Tn[Ce])!=null?q:ki.value;return we}const te=fr.value,ge=Cc.value;if(!te.length||!ge.length){let we=0;for(let Ce=A;Ce<F;Ce++)we+=(K=Tn[Ce])!=null?K:ki.value;return we}return kd(te,A,F)+(F-A-kd(ge,A,F))*ki.value}Ve(()=>ot.value.length,A=>{qo(),A<=0?bd():(A<Uo.value&&F4(A),A!==Uo.value&&yd(A))},{immediate:!0});const K4=B(()=>{if(!Nt.value)return ot.value.map((K,te)=>({node:K,index:te}));const A=ot.value.length,F=Ms(Ts.start,0,A),q=Ms(Ts.end,F,A);return ot.value.slice(F,q).map((K,te)=>({node:K,index:F+te}))}),om=B(()=>Nt.value?vr(0,Math.min(Ts.start,ot.value.length)):0),im=B(()=>{if(!Nt.value)return 0;const A=ot.value.length;return vr(Math.min(Ts.end,A),A)});function ck(){if(!Ht.value)return 0;let A=0;const F=fl.value;for(let q=0;q<F.length;q++){if(!F[q])continue;const K=Tn[q];Number.isFinite(K)&&K>0||A++}return A}function uk(){const A=ot.value.length;return{totalNodes:A,measuredCount:Mn.count,estimatedCount:ck(),averageNodeHeight:ki.value,topSpacerHeight:om.value,bottomSpacerHeight:im.value,estimatedTotalHeight:vr(0,A),width:pl()}}function G4(){const A=ot.value,F=uk();return Lt(rt({},F),{probe:{paragraphReady:!!re.value.paragraph,listItemReady:!!re.value.listItem,listWrapperOverhead:re.value.listWrapperOverhead,headingReadyLevels:Object.entries(re.value.headings).filter(([,q])=>!!q).map(([q])=>Number(q))},nodes:A.map((q,K)=>{var te,ge,we,Ce,De,$e,We,Fe,Ne;return{index:K,type:q.type,estimateKind:(ge=(te=fl.value[K])==null?void 0:te.kind)!=null?ge:null,rendererKind:(Ce=(we=fl.value[K])==null?void 0:we.rendererKind)!=null?Ce:null,estimatedHeight:($e=(De=fl.value[K])==null?void 0:De.height)!=null?$e:null,estimatedContentHeight:(Fe=(We=fl.value[K])==null?void 0:We.contentHeight)!=null?Fe:null,measuredHeight:(Ne=Tn[K])!=null?Ne:null}})})}function rm(){return s.indexKey!=null?String(s.indexKey):Jt.value?`virtual-${zn()}`:"markdown-renderer"}function dk(A){const F=String(A),q=`${rm()}-`;if(!F.startsWith(q))return null;const K=F.slice(q.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const te=Number(K[1]);return!Number.isInteger(te)||te<0||te>=ot.value.length?null:te}function zn(){var A,F,q;const K=(A=s.virtualScroll)==null?void 0:A.sessionKey;return String(K!=null&&K!==""?K:(q=(F=s.indexKey)!=null?F:k.customId)!=null?q:Vt)}function ms(){var A;const F=(A=s.virtualScroll)==null?void 0:A.threadKey;return F==null||F===""?void 0:String(F)}function lm(A){var F;return(A??"")===((F=ms())!=null?F:"")}function Y4(){var A;const F=(A=s.virtualScroll)==null?void 0:A.measurementKey;return F==null?"":String(F)}function Q4(){var A,F;const q=u.value,K=q==="monaco"?k.codeBlockMonacoOptions:void 0,te=k.codeBlockProps,ge=q==="shiki";return[k.isDark?"dark":"light",q==="monaco"?"code-rich":q==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",ws(k.codeBlockMinWidth),ws(k.codeBlockMaxWidth),...ge?[Op((A=te?.themes)!=null?A:k.themes,(F=te?.langs)!=null?F:k.langs)]:[],ws(K?.fontSize),ws(K?.lineHeight),ws(K?.fontFamily),ws(K?.tabSize),ws(K?.MAX_HEIGHT),ws(K?.wordWrap),ws(K?.wrappingIndent),ws(K?.padding),ws(te?.showHeader),ws(te?.showCopyButton),ws(te?.showExpandButton),ws(te?.showPreviewButton),ws(te?.showCollapseButton),ws(te?.showFontSizeButtons)].join("\0")}function Pi(){return[Y4(),Q4()].join("\0")}function pl(){return Rs()}const Md=B(()=>Tc(pl())),xo=B(()=>[Pi(),Md.value].join("\0")),X4=B(()=>{var A;return Jt.value?["virtual",(A=ms())!=null?A:"",zn(),xo.value].join("\0"):s.indexKey});function ra(){Qy.value+=1}function am(A){return!(!A||!Number.isInteger(A.index)||A.index<0||A.index>=ot.value.length||A.sessionKey!==zn()||A.threadKey!==ms()||A.layoutEpochKey!==xo.value)}function fk(A){const F=String(A),q=_i.get(F);return q?am(q)?q.index:null:dk(F)}function pk(A="async-node"){(So.size||_i.size)&&(So.clear(),_i.clear(),ra(),Pn(A))}const la=jt(p1,null),cm={reportHeight(A,F){if(!Mt.value)return;const q=fk(A);if(q==null)return;const K=bi.get(q);if(!K)return;const te=Number(F),ge=jy(q,K);Uy(q,Number.isFinite(te)&&te>0?Math.max(te,ge||0):ge)},markPending(A){if(!Mt.value)return;const F=dk(A);F!=null&&(function(q,K){var te;const ge=_i.get(q);if(ge&&am(ge))return So.set(q,Math.max(0,(te=So.get(q))!=null?te:0)+1),ra(),void Pn("async-node");So.set(q,1),_i.set(q,(function(we){return{index:we,sessionKey:zn(),threadKey:ms(),layoutEpochKey:xo.value}})(K)),ra(),Pn("async-node")})(String(A),F)},markSettled(A){if(!Mt.value)return;const F=String(A),q=fk(A);(q!=null||(function(K){return So.has(String(K))})(F))&&(function(K){var te;const ge=(te=So.get(K))!=null?te:0;return!(ge<=0||(ge<=1?(So.delete(K),_i.delete(K)):So.set(K,ge-1),ra(),ge===1&&Pn("async-node"),0))})(F)&&q!=null&&Ri()}};function Z4(){let A=0;for(const F of bi.values())A+=_t("getVisibleDomHeight.offsetHeight",()=>{var q;return(q=F?.offsetHeight)!=null?q:0});return Math.ceil(Math.max(0,A))}In(p1,{reportHeight(A,F){cm.reportHeight(A,F),la?.reportHeight(A,F)},markPending(A){cm.markPending(A),la?.markPending(A)},markSettled(A){cm.markSettled(A),la?.markSettled(A)}});let um,dm=null,aa=null;function Ed(A){return A!==!1&&A!=null&&A!==""}function hk(){return Nt.value?(function(){if(!Nt.value)return!0;const A=ot.value.length,F=Ms(Ts.start,0,A),q=Ms(Ts.end,F,A);if(F>=q)return!0;for(let K=F;K<q;K++)if(!Wn.has(K)||Nm(K)&&!bi.has(K))return!1;return!0})():$t.value>=wd.value}function fm(){return j.value===!0&&!ee.value&&Qh.value===0&&mr.size===0&&Oi.size===0&&Co==null&&hk()}function mk(){var A,F;if(((A=s.virtualScroll)==null?void 0:A.settleMode)!=="manual"||dm===zn()&&um===ms())return!0;const q=(F=s.virtualScroll)==null?void 0:F.settledToken;return!!Ed(q)&&aa===Wc(q)}function pm(){return fm()&&mk()}function J4(A,F){return F.totalNodes<=0?A==="final"?"final":"estimate":F.measuredCount>=F.totalNodes?A==="final"?"final":"measured":F.measuredCount>0||F.estimatedCount>0?"mixed":"estimate"}function hl(A="manual",F){const q=uk(),K=(function(te){return te||(j.value!==!0?ot.value.length>0?"streaming":"estimating":!hk()||Oi.size>0||Co!=null?"measuring":pm()?"settled":"settling")})(F);return{sessionKey:zn(),threadKey:ms(),phase:K,nodeCount:q.totalNodes,liveRange:{start:Ts.start,end:Ts.end},renderedCount:$t.value,measuredCount:q.measuredCount,estimatedCount:q.estimatedCount,averageNodeHeight:q.averageNodeHeight,topSpacerHeight:q.topSpacerHeight,bottomSpacerHeight:q.bottomSpacerHeight,visibleDomHeight:Z4(),totalHeight:gk(),width:q.width,final:j.value===!0,stable:pm(),confidence:J4(K,q),reason:A}}function Mc(){const A=se.value||oe(),F=S.value;if(!A||!F)return null;const q=A.ownerDocument||F.ownerDocument||document,K=A===q.documentElement||A===q.body||A===q.scrollingElement,te=_t("getScrollBox.scrollTop",()=>Z(A,q,K)),ge=_t("getScrollBox.scrollHeight",()=>{var Ce,De,$e,We,Fe;return K?Math.max((De=(Ce=q.documentElement)==null?void 0:Ce.scrollHeight)!=null?De:0,(We=($e=q.body)==null?void 0:$e.scrollHeight)!=null?We:0,(Fe=A.scrollHeight)!=null?Fe:0):A.scrollHeight}),we=_t("getScrollBox.clientHeight",()=>{var Ce;return K?((Ce=q.documentElement)==null?void 0:Ce.clientHeight)||A.clientHeight||0:A.clientHeight});return{root:A,doc:q,isViewportRoot:K,scrollTop:te,scrollHeight:ge,clientHeight:we}}function gk(){const A=ot.value.length,F=Math.max(0,vr(0,A)),q=_t("getRendererLogicalHeight.offsetHeight",()=>{var te,ge;return(ge=(te=S.value)==null?void 0:te.offsetHeight)!=null?ge:0}),K=Math.max(0,q>0?q:_t("getRendererLogicalHeight.scrollHeight",()=>{var te,ge;return(ge=(te=S.value)==null?void 0:te.scrollHeight)!=null?ge:0}));return A<=0?Math.ceil(q):Nt.value?F>0?Math.max(1,Math.ceil(F),(function(){let te=om.value+im.value;for(const ge of Wn.values())ge&&(te+=Math.max(0,_t("getVirtualizedDomLogicalHeight.offsetHeight",()=>ge.offsetHeight||0)));return Math.ceil(Math.max(0,te))})(),(function(te,ge){return te<=0||ge<=0?0:ge<=te+Math.max(512,.05*te)?Math.ceil(ge):0})(F,K)):Math.max(1,Math.ceil(K)):Mt.value?F>0||Mn.count>0||ck()>0?(Be.value&&$t.value,Math.max(1,Math.ceil(K),Math.ceil(F))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(F))}function vk(A){const F=S.value;if(!F)return null;const q=_t("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>F.getBoundingClientRect());return(function(te){return te.isViewportRoot?te.clientHeight:_t("getViewportBottomInRoot.getBoundingClientRect",()=>te.root.getBoundingClientRect().bottom)})(A)-q.bottom}function eE(A={}){const F=A.requireViewport!==!1,q=(function(ge=64){const we=Mc(),Ce=S.value;if(!we||!Ce)return!1;const De=(function(We){if(We.isViewportRoot)return{top:0,bottom:We.clientHeight};const Fe=_t("getVirtualViewportRect.getBoundingClientRect",()=>We.root.getBoundingClientRect());return{top:Fe.top,bottom:Fe.bottom}})(we),$e=_t("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ce.getBoundingClientRect());return $e.bottom>=De.top-ge&&$e.top<=De.bottom+ge})();if(F&&!q)return null;const K=(function(){const ge=Mc(),we=S.value;if(!ge||!we||Math.max(0,ge.scrollHeight-ge.scrollTop-ge.clientHeight)>64)return null;const Ce=vk(ge);return Ce==null?null:Ce>=-8&&Ce<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ce)}:null})();if(K)return{anchor:K,captured:!0};const te=hn();if(te)return{anchor:{type:"node",nodeIndex:te.nodeIndex,offsetWithinNodePx:te.offsetWithinNodePx},captured:q};if(A.allowFallback===!0){const ge=(function(){const we=ot.value.length;return we<=0?null:{type:"node",nodeIndex:Ms(jo.value,0,Math.max(0,we-1)),offsetWithinNodePx:0}})();return ge?{anchor:ge,captured:!1}:null}return null}function hm(A){let F=2166136261;for(let q=0;q<A.length;q++)F^=A.charCodeAt(q),F=Math.imul(F,16777619);return(F>>>0).toString(36)}function tE(A,F){let q=A;for(let K=0;K<F.length;K++)q^=F.charCodeAt(K),q=Math.imul(q,16777619);return q^=31,q=Math.imul(q,16777619),q}const nE=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Id(A,F=new WeakSet,q=0){if(A==null||typeof A=="number"||typeof A=="boolean")return String(A);if(typeof A=="string")return`s:${(function(K){const te=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${hm(te)}`})(A)}`;if(typeof A=="function")return"fn";if(typeof A!="object")return typeof A;if(F.has(A))return"cycle";if(q>=6)return"max-depth";F.add(A);try{if(Array.isArray(A)){if(A.length<=160){const $e=[];for(let We=0;We<A.length;We++)$e.push(Id(A[We],F,q+1));return`a:${A.length}:${$e.join(",")}`}const ge=[],we=[],Ce=Math.max(0,A.length-32);let De=2166136261;for(let $e=0;$e<A.length;$e++){const We=Id(A[$e],F,q+1);De=tE(De,We),$e<32&&ge.push(We),$e>=Ce&&we.push(We)}return[`a:${A.length}`,`h=${ge.join(",")}`,`t=${we.join(",")}`,`all=${(De>>>0).toString(36)}`].join(":")}const K=A,te=Object.keys(K).filter(ge=>{const we=K[ge];return ge!=="parent"&&ge!=="el"&&ge!=="component"&&(we==null||typeof we=="string"||typeof we=="number"||typeof we=="boolean"||nE.has(ge))}).sort();return`o:${te.length}:${te.map(ge=>`${ge}=${Id(K[ge],F,q+1)}`).join(";")}`}finally{F.delete(A)}}let yk=-1,mm="";function Ec(A){const F=ot.value[A];return F?hm(Id(F)):""}function gm(){const A=Q.value;if(yk===A)return mm;let F=2166136261;for(let q=0;q<ot.value.length;q++){const K=Ec(q);for(let te=0;te<K.length;te++)F^=K.charCodeAt(te),F=Math.imul(F,16777619)}return mm=(F>>>0).toString(36),yk=A,mm}function ca(A,F={}){var q;const K=F.includeHeightCache===!0,te=(q=F.includeContentHash)!=null?q:K,ge=K?(function(Ce){const De=(function(){var Je,wt;const ct=Number((wt=(Je=s.virtualScroll)==null?void 0:Je.heightCacheLimit)!=null?wt:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(De)||Ce.length<=De)return Ce;const $e=new Map,We=Je=>{!Je||$e.size>=De||$e.set(Je.index,Je)},Fe=ot.value.length,Ne=Ms(Ts.start-2*xc.value,0,Fe),He=Ms(Ts.end+2*xc.value,Ne,Fe);for(const Je of Ce)Je.index>=Ne&&Je.index<He&&We(Je);const Ze=Math.max(1,Math.ceil(Ce.length/De));for(let Je=0;Je<Ce.length&&$e.size<De;Je+=Ze)We(Ce[Je]);for(let Je=Ce.length-1;Je>=0&&$e.size<De;Je-=Ze)We(Ce[Je]);return Array.from($e.values()).sort((Je,wt)=>Je.index-wt.index).slice(0,De)})(z4().map(Ce=>{var De;const $e=ot.value[Ce.index];return $e?Lt(rt({},Ce),{nodeType:String((De=$e.type)!=null?De:""),signature:Ec(Ce.index)}):null}).filter(Ce=>!!Ce)):[],we=eE({allowFallback:F.allowAnchorFallback===!0,requireViewport:F.requireViewport});return we||ge.length||F.includeEmptyState===!0?Lt(rt({sessionKey:A.sessionKey,threadKey:A.threadKey},we?{anchor:we.anchor,anchorCaptured:we.captured}:{anchorCaptured:!1}),{metrics:A,width:A.width,contentHash:te?gm():void 0,measurementKey:Pi()||void 0,heightCache:ge.length?ge:void 0}):null}function vm(A){var F,q;const K=Mc();if(!K)return;const te=(function(Ce){const De=S.value;if(!De)return null;const $e=ue(De,Ce.root),We=ot.value.length,Fe=_t("getRendererBottomOffsetWithinRoot.offsetHeight",()=>De.offsetHeight||0),Ne=Math.max(0,Fe>0?Fe:We>0?_t("getRendererBottomOffsetWithinRoot.scrollHeight",()=>De.scrollHeight||0):0),He=gk();return $e+Math.max(Ne,He)})(K);if(te==null)return;const ge=Math.max(0,A.distanceFromBottomPx),we=Math.max(0,te-K.clientHeight-ge);(function(Ce){ze=Oc()+120,nt=Ce})(we),K.isViewportRoot?(q=(F=K.doc.defaultView)==null?void 0:F.scrollTo)==null||q.call(F,0,we):xS(K.root,K.doc,we,{isReverseFlexScrollRoot:W,getNormalizedScrollTop:Z})}const ym=[];function kk(){if(X)for(Te!=null&&(st?.(Te),Te=null);ym.length;){const A=ym.pop();A!=null&&window.clearTimeout(A)}}function ua(A){const F=!!_e.value;_e.value=null,ze=0,nt=null,kk(),F&&A&&Pn(A)}function da(){if(!_e.value||!X||Te!=null)return;const A=()=>{Te=null;const F=_e.value;F&&vm(F)};Te=et?et(A):null,Te==null&&A()}function bk(A,F={}){const q=ot.value.length;return q<=0?[]:A.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=q)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(F.requireSignature&&!K.signature)&&!(F.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(te){var ge;const we=ot.value[te.index];return!(!we||te.nodeType&&te.nodeType!==String((ge=we.type)!=null?ge:"")||te.signature&&te.signature!==Ec(te.index))})(K))}function _k(A){const F=Tc(pl()),q=Tc(A);return F!==-1&&q!==-1&&F===q}function km(A){var F;const q=Number(A?.width);if(Number.isFinite(q)&&q>0)return q;const K=Number((F=A?.metrics)==null?void 0:F.width);return Number.isFinite(K)&&K>0?K:null}function wk(A){var F;return A.sessionKey===zn()&&!!lm(A.threadKey)&&((F=A.measurementKey)!=null?F:"")===Pi()&&!!_k(km(A))&&!!(function(q){const K=q.heightCache;return!!K?.length&&(Sk(q)?K.some(te=>!!(te.nodeType||te.signature)):K.some(te=>!!te.signature))})(A)}function Sk(A){return!!(A.contentHash&&A.contentHash===gm())}function sE(A){return!Sk(A)}let ml=null,gl=null,$d=null,Ic=null,$c=null;function bm(A){var F;const q=A.map(te=>{var ge,we;return[te.index,Math.round(10*te.height),(ge=te.nodeType)!=null?ge:"",(we=te.signature)!=null?we:""].join("")}).join(""),K=Tc(pl());return[(F=ms())!=null?F:"",zn(),Pi(),ot.value.length,K,A.length,hm(q)].join(":")}function Ck(A=(F=>(F=s.virtualScroll)==null?void 0:F.heightCache)()){if(!Mt.value||!A?.length||ot.value.length<=0||!_k((F=s.virtualScroll)==null?void 0:F.heightCacheWidth))return!1;var F;const q=bk(A,{requireSignature:!0});if(!q.length)return!1;const K=bm(q);return K===ml?(gl="standalone",!0):(qy(q,{mode:"merge"}),qo(),ml=K,gl="standalone",Rc(),Pn("restore"),!0)}function _m(A,F={}){var q,K,te;if(!Mt.value||!A||A.sessionKey!==zn()||!lm(A.threadKey)||ot.value.length<=0)return!1;const ge=!!((q=A.heightCache)!=null&&q.length)&&!Nd(),we=!A.anchor||A.anchorCaptured===!1&&F.allowUncapturedAnchor!==!0?null:A.anchor,Ce=F.restoreAnchor===!0&&!!we&&!Nd()&&Number(km(A))>0;let De=!1;if((K=A.heightCache)!=null&&K.length&&wk(A)){const We=bk(A.heightCache,{requireCompatibilityMetadata:!A.contentHash,requireSignature:sE(A)});We.length&&(qy(We,{mode:"merge"}),qo(),ml=bm(We),gl="restore",Rc(),De=!0)}if(ge||Ce)return!1;if(!F.restoreAnchor||!we)return De&&Pn("restore"),!0;const $e=(function(We,Fe){var Ne;const He=We.anchor,Ze=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[(Ne=ms())!=null?Ne:"",zn(),Pi(),Md.value,Fe,Ze].join(":")})(A,(te=F.restoreToken)!=null?te:"imperative");return $d===$e?(De&&Pn("restore"),!0):($d=$e,(function(We){const Fe=()=>{if(We.type==="node")return ua(),void _s({nodeIndex:We.nodeIndex,offsetWithinNodePx:We.offsetWithinNodePx});if(Vs(),at.value=null,_e.value=We,kk(),vm(We),X)for(const Ne of[0,120,280,480])ym.push(window.setTimeout(()=>{const He=_e.value;He&&vm(He)},Ne))};(function(Ne){if(!Nt.value)return!1;const He=ot.value.length;return!(He<=0||(jo.value=Ne.type==="node"?Ms(Ne.nodeIndex,0,He-1):He-1,ul(),0))})(We)?mt(Fe):Fe()})(we),Pn("restore"),!0)}function Nd(){const A=pl();return Number.isFinite(A)&&A>0}function xk(A){var F;return A.sessionKey===zn()&&!!lm(A.threadKey)&&(ot.value.length<=0||!(!((F=A.heightCache)!=null&&F.length)||Nd())||!(!(A.anchor&&Number(km(A))>0)||Nd()))}function wm(){As.clear();for(const A of Object.keys(Tn)){const F=Number(A);Number.isInteger(F)&&F>=0&&F<ot.value.length&&zy(F)}}function Nc(){Co!=null&&(st?.(Co),Co=null),Lm()}function Ak(){return!X||zo?Promise.resolve():new Promise(A=>{let F=!1,q=null;const K=()=>{F||(F=!0,q!=null&&window.clearTimeout(q),A())};if(et)return et(K),void(q=window.setTimeout(K,50));q=window.setTimeout(K,0)})}function Sm(A,F=ms(),q=xo.value){return zn()===A&&ms()===F&&xo.value===q}function Cm(){return qn(this,arguments,function*(A={}){var F,q,K,te,ge;const we=zn(),Ce=ms(),De=xo.value,$e=(F=A.frames)!=null?F:2,We=(q=A.timeoutMs)!=null?q:120,Fe=(K=A.reason)!=null?K:"manual",Ne=A.expectedSettledTokenKey,He=A.flushPendingTimers===!0,Ze=hl(Fe),Je=()=>Lt(rt({},Ze),{phase:Ze.final?"settling":Ze.phase,stable:!1,confidence:Ze.confidence==="final"?"mixed":Ze.confidence,reason:Fe}),wt=()=>Sm(we,Ce,De)&&(Ne==null||Pc()===Ne);for(let St=0;St<$e;St++){if(yield mt(),!wt()||(yield Ak(),!wt()))return Je();Ri(),Nc()}if(yield(function(St){return!X||St<=0?Promise.resolve():new Promise(nn=>window.setTimeout(nn,St))})(We),!wt()||(He&&ek(),Ri(),Nc(),!wt()))return Je();const ct=fm();ct&&(dm=we,um=Ce,((te=s.virtualScroll)==null?void 0:te.settleMode)==="manual"&&Ne!=null&&Ed((ge=s.virtualScroll)==null?void 0:ge.settledToken)&&Pc()===Ne&&(aa=Wc(s.virtualScroll.settledToken)));const ut=wt()&&ct&&mk(),Ct=hl(Fe,ut?"final":void 0);return Em(Ct,!0),Ct})}let xm="content",vl=null,yl=null,Am=0,Lc=null,fa=null,Tm=null,Mm=null;function Oc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Tk(A){var F,q;const K=Lc;if(!K)return!0;const te=(q=(F=s.virtualScroll)==null?void 0:F.heightDiffThresholdPx)!=null?q:1;return Math.abs(A.totalHeight-K.totalHeight)>te||A.sessionKey!==K.sessionKey||A.phase!==K.phase||A.stable!==K.stable||A.final!==K.final||A.threadKey!==K.threadKey||A.nodeCount!==K.nodeCount||A.measuredCount!==K.measuredCount||A.width!==K.width}function ws(A){if(A==null)return"";if(typeof A=="string"||typeof A=="number"||typeof A=="boolean")return String(A);try{return JSON.stringify(A)}catch{return String(A)}}function Pc(A=(F=>(F=s.virtualScroll)==null?void 0:F.settledToken)()){return ws(A)}function Mk(A,F){var q,K;return[A,F.sessionKey,(q=F.threadKey)!=null?q:"",Pi(),gm(),ws((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(F.totalHeight),Math.round(F.width)].join("\0")}function Rc(){Tm=null,Mm=null,fa=null}function oE(A){const F=A.heightCache;return F?.length?bm(F):""}function Dc(A){var F,q,K;const te=A.metrics,ge=A.anchor?(we=A.anchor).type==="bottom"?`bottom:${Math.round(we.distanceFromBottomPx)}`:`node:${we.nodeIndex}:${Math.round(we.offsetWithinNodePx)}`:"none";var we;return[A.sessionKey,(F=A.threadKey)!=null?F:"",(q=A.measurementKey)!=null?q:Pi(),(K=A.contentHash)!=null?K:"",oE(A),ge,A.anchorCaptured?1:0,te.liveRange.start,te.liveRange.end,te.renderedCount,te.nodeCount,Math.round(te.totalHeight),Math.round(te.width),te.phase,te.stable?1:0].join("\0")}function Em(A,F=!1){if(!Mt.value||(function(we=!1){return!we&&Jt.value&&!Yn.value})(F))return;const q=F||Tk(A),K=(function(we,Ce=!1){return Ce||we.stable||we.phase==="final"?{state:ca(we,{includeHeightCache:!0})}:{state:ca(we)}})(A,F),te=K.state,ge=!!(te&&(q||(function(we,Ce=!1){return!!Ce||Dc(we)!==fa})(te,F)));if(q&&(M(A),Lc=A,Am=Oc()),te&&ge&&($(te),te.anchor&&L(te.anchor),fa=Dc(te)),A.stable){const we=Mk("settled",A);if(we!==Tm){Tm=we;const Ce=ca(A,{includeHeightCache:!0});Ce&&($(Ce),fa=Dc(Ce)),(function(De){o("render-settled",De)})(A)}}if(A.phase==="final"){const we=Mk("final",A);if(we!==Mm){Mm=we;const Ce=ca(A,{includeHeightCache:!0});Ce&&($(Ce),fa=Dc(Ce)),(function(De){o("render-final",De)})(A)}}}function Im(){vl!=null&&(st?.(vl),vl=null),yl!=null&&X&&(window.clearTimeout(yl),yl=null)}function Ek(){vl=null,yl=null,(function(A){if(Oi.size>0||Co!=null)return!0;switch(A){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(xm)&&(Ri(),Nc()),Em(hl(xm))}function Pn(A){var F,q;if(!Mt.value||(xm=A,vl!=null||yl!=null))return;const K=Math.max(0,(q=(F=s.virtualScroll)==null?void 0:F.emitIntervalMs)!=null?q:32),te=Math.max(0,K-(Oc()-Am)),ge=()=>{yl=null,vl=et?et(Ek):null,vl==null&&Ek()};X&&te>0?yl=window.setTimeout(ge,te):ge()}function $m(A){var F;if(A<=0)return 0;const q=ot.value;if(Ht.value)return ak(A);if(Uo.value===q.length&&fr.value.length&&Cc.value.length){const te=ki.value,ge=fr.value,we=Cc.value,Ce=Fe=>Fe<=0?0:kd(ge,0,Fe)+(Fe-kd(we,0,Fe))*te;let De=0,$e=q.length-1,We=q.length-1;for(;De<=$e;){const Fe=De+$e>>1;Ce(Fe+1)>=A?(We=Fe,$e=Fe-1):De=Fe+1}return We}let K=A;for(let te=0;te<q.length;te++){const ge=(F=Tn[te])!=null?F:ki.value;if(K<=ge)return te;K-=ge}return Math.max(0,q.length-1)}function Ik(){sa.value+=1}function Nm(A){return!(Be.value&&A>=$t.value)&&(!pr.value||A<Ee.value||Jh.value.has(A))}function pa(A){const F=xd.get(A);F&&(F(),xd.delete(A));const q=oa.get(A);q&&(q.destroy(),oa.delete(A)),Ad(A)}function $k(A,F){let q=!1;if(F){const ge=Wn.get(A);Wn.set(A,F),ge!==F&&(q=!0)}else Wn.delete(A)&&(q=!0);if(q&&Ik(),F||Ad(A),!Vy.value||!Ye||!Nt.value&&pr.value&&!U.value&&oa.size>=640&&(U.value||(U.value=!0,em()),!Vy.value||!Ye))return pa(A),void(F&&gr(A,!0));if(A<Ee.value&&!Nt.value||Jh.value.has(A))return pa(A),void gr(A,!0);if(!F)return void pa(A);pa(A);const K=Ye(F,{rootMargin:"400px"});if(!K)return;oa.set(A,K),gr(A,K.isVisible.value),pr.value&&(function(ge){if(!X||!pr.value)return;Ad(ge);const we=ge%17*23,Ce=window.setTimeout(()=>{if(tk.delete(ge),!pr.value||Jh.value.has(ge))return;const De=Wn.get(ge);if(!De)return;const $e=oe(De),We=De.ownerDocument||document,Fe=We.defaultView||window,Ne=!$e||$e===We.documentElement||$e===We.body,He=!Ne&&$e?_t("nodeVisibilityFallback.root.getBoundingClientRect",()=>$e.getBoundingClientRect()):null,Ze=Ne?0:He.top,Je=Ne?_t("nodeVisibilityFallback.clientHeight",()=>{var ct,ut;return(ut=(ct=Fe.innerHeight)!=null?ct:$e?.clientHeight)!=null?ut:0}):He.bottom,wt=_t("nodeVisibilityFallback.node.getBoundingClientRect",()=>De.getBoundingClientRect());wt.bottom>=Ze-500&&wt.top<=Je+500&&gr(ge,!0)},1800+we);tk.set(ge,Ce)})(A);let te=null;te=Ve(()=>K.isVisible.value,ge=>{if(ge){Ad(A),gr(A,!0),te?.(),xd.delete(A),oa.get(A)===K&&oa.delete(A);try{K.destroy()}catch{}}},{immediate:!0}),xd.set(A,te),Nt.value&&wi()}function Lm(){Co=null;for(const[A,F]of Oi)Oi.delete(A),bi.get(A)===F.el&&dl.get(A)===F.version&&Uy(A,F.height,{allowShrink:F.allowShrink})}function ha(){Co!=null&&(st?.(Co),Co=null),Oi.clear()}function Ld(A,F){(function(q,K,te){var ge;if(!Number.isFinite(te)||te<=0||bi.get(q)!==K)return;const we=dl.get(q);if(we==null)return;const Ce=ot.value[q],De=ee.value&&j.value!==!0&&!((ge=s.nodes)!=null&&ge.length)&&q>=ot.value.length-2,$e=!(Ce?.loading===!0||De),We=Oi.get(q),Fe=We?We.allowShrink&&$e:$e,Ne=We&&!Fe?Math.max(We.height,te):te;Oi.set(q,{height:Ne,allowShrink:Fe,version:we,el:K}),Co==null&&(Co=et?et(Lm):null,Co==null&&Lm())})(A,F,jy(A,F))}function Ri(){for(const[A,F]of bi)F&&Ld(A,F)}function Nk(){Le?.disconnect(),Le=null,ft.clear()}function Om(){for(;_d.length;)Cd(_d.pop())}Ve(Yn,A=>{A&&Pn("content")},{flush:"post"}),t({getVirtualMetrics:hl,captureVirtualState:function(A={}){var F;return ca(hl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:A.allowFallbackAnchor===!0,requireViewport:A.requireViewport===!0,includeEmptyState:(F=A.includeEmptyState)==null||F})},restoreVirtualState:function(A,F={}){const q=F.restoreAnchor===!0,K=F.restoreToken==null?"imperative":String(F.restoreToken);Ic=A,$c={restoreAnchor:q,restoreToken:K,allowUncapturedAnchor:F.allowUncapturedAnchor===!0},!_m(A,{restoreAnchor:q,restoreToken:K,allowUncapturedAnchor:F.allowUncapturedAnchor===!0})&&xk(A)||(Ic=null,$c=null)},forceMeasure:function(A="manual"){return qn(this,null,function*(){yield mt(),yield Ak(),Ri(),Nc(),yield mt();const F=hl(A);return Em(F,!0),F})},settle:Cm,scrollToNode:function(A,F="start"){ua(),Vs();const q=ot.value.length;if(q<=0)return;const K=Ms(A,0,q-1),te=()=>{var ge;const we=Gt({nodeIndex:K,offsetWithinNodePx:0}),Ce=Td(K),De=Mc(),$e=(ge=De?.clientHeight)!=null?ge:0,We=Ut();let Fe=we;if(F==="center")Fe=we-$e/2+Ce/2;else if(F==="end")Fe=we-$e+Ce;else if(F==="nearest"&&We!=null){if(we>=We&&we+Ce<=We+$e)return;Fe=we<We?we:we-$e+Ce}bn(Math.max(0,Fe)),wi({immediate:!0}),Nt.value&&(jo.value=K,ul())};if(Nt.value)return jo.value=K,ul(),void mt(te);te()}}),Ve(()=>Ho.value,A=>{if(!A){Nk();for(const F of hr.values())for(const q of F)Cd(q);hr.clear(),dl.clear(),Om(),ha()}},{immediate:!0}),Ve(j,A=>{A&&(function(){if(X&&j.value&&bi.size){Om();for(const F of[80,240,640]){const q=Jy(F,()=>{for(const[K,te]of bi)te&&Ld(K,te)},"final");q!=null&&_d.push(q)}}})(),Pn(A?"final":"content")}),Ve([()=>ot.value.length,()=>$t.value],()=>{_e.value&&da(),Pn("content")},{flush:"post",immediate:!0}),Ve([()=>Ts.start,()=>Ts.end],()=>{Pn("batch")},{flush:"post"});const{cleanupBatchScheduler:iE}=(function(A){const{props:F,isClient:q,isTestEnv:K,parsedNodesIdentity:te,parsedNodeCount:ge,desiredRenderedCount:we,datasetKey:Ce,batchingEnabled:De,incrementalRenderingActive:$e,resolvedBatchSize:We,resolvedInitialBatch:Fe,renderedCount:Ne,adaptiveBatchSize:He,previousRenderContext:Ze,previousBatchConfig:Je,requestFrame:wt,cancelFrame:ct,hasIdleCallback:ut,cleanupNodeVisibility:Ct,onDatasetKeyChanged:St,onDatasetChanged:nn}=A;let xt=null,Wt=null,Ft=!1,un=null,Ao=null,Ks=0,li=!1,yr=!1;const kr=new Set,bl=new Set;function Qk(){if(q){xt!=null&&(ct?.(xt),xt=null),Wt!=null&&(window.clearTimeout(Wt),Wt=null),Ao!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Ao),Ao=null),Ks+=1;for(const Bs of kr)ct?.(Bs);kr.clear();for(const Bs of bl)window.clearTimeout(Bs);bl.clear(),Ft=!1,un=null,li=!1,yr=!1}}function Hd(){return typeof performance<"u"?performance.now():Date.now()}function Xk(Bs){(function(Di){var br;if(!$e.value)return;const Bi=Math.max(2,(br=F.renderBatchBudgetMs)!=null?br:6),Fi=Math.max(1,We.value||1),ai=Math.max(1,Math.floor(Fi/4));Di>1.2*Bi?He.value=Math.max(ai,Math.floor(.7*He.value)):Di<.5*Bi&&He.value<Fi&&(He.value=Math.min(Fi,Math.ceil(1.2*He.value)))})(Bs),li=!1;const co=yr||Ne.value<we.value;yr=!1,co&&eb()}function Zk(Bs,co={}){var Di,br;if(!$e.value)return;const Bi=we.value;if(Ne.value>=Bi)return;const Fi=Math.max(1,Bs),ai=()=>{const va=Hd();let ya=0;xt=null,Wt=null,Ao=null,Ft=!1;const ka=un??Fi;un=null;const zm=Hd();Ne.value=Math.min(Bi,Ne.value+ka),Ct(Ne.value),ya=Hd()-zm,(function(Um,tb){if(!q)return void Xk(tb);li=!0;const nb=++Ks;mt().then(()=>{var sb;if(nb!==Ks)return;const xE=Hd(),AE=Math.max(tb,xE-Um),ob=()=>{nb===Ks&&Xk(AE)};if(wt){let rb=!1,Hi=null;const lb=()=>{rb||(rb=!0,ob())},Wd=wt(()=>{kr.delete(Wd),Hi!=null&&(window.clearTimeout(Hi),bl.delete(Hi),Hi=null),lb()});return kr.add(Wd),Hi=window.setTimeout(()=>{Hi!=null&&bl.delete(Hi),Hi=null,ct?.(Wd),kr.delete(Wd),lb()},Math.max(32,(sb=F.renderBatchIdleTimeoutMs)!=null?sb:120)),void bl.add(Hi)}const ib=window.setTimeout(()=>{bl.delete(ib),ob()},0);bl.add(ib)})})(va,ya)};if(!q||co.immediate)return void ai();const _r=Math.max(0,(Di=F.renderBatchDelay)!=null?Di:16);if(un=un!=null?Math.max(un,Fi):Fi,!Ft){if(Ft=!0,!K&&ut&&window.requestIdleCallback){const va=Math.max(0,(br=F.renderBatchIdleTimeoutMs)!=null?br:120);return void(Ao=window.requestIdleCallback(()=>ai(),{timeout:va}))}wt&&!K?xt=wt(()=>{_r!==0?Wt=window.setTimeout(()=>ai(),_r):ai()}):Wt=window.setTimeout(()=>ai(),_r)}}function Jk(Bs,co={}){li?yr=!0:Bs==null?eb():Zk(Bs,co)}function eb(){$e.value&&Zk(De.value?Math.max(1,Math.round(He.value)):Math.max(1,We.value))}return Ve([te,ge,Ce,$e,We,Fe,()=>F.renderBatchDelay],()=>{var Bs;const co=ge.value,Di=Ze.value,br=Ce.value,Bi=!Object.is(br,Di.key),Fi=co!==Di.total,ai=Bi||Fi;Ze.value={key:br,total:co};const _r=Je.value,va=(Bs=F.renderBatchDelay)!=null?Bs:16,ya=_r.batchSize!==We.value||_r.initial!==Fe.value||_r.delay!==va||_r.enabled!==$e.value;Je.value={batchSize:We.value,initial:Fe.value,delay:va,enabled:$e.value},Bi&&St(co),(ai||ya||!$e.value)&&Qk(),(ai||ya)&&(He.value=Math.max(1,We.value||1)),ai&&nn();const ka=we.value;if(!co)return Ne.value=0,void Ct(0);if(!$e.value)return Ne.value=ka,void Ct(Ne.value);const zm=Bi||Di.total===0;Ne.value=zm||ya?Math.min(ka,Fe.value):Math.min(Ne.value,ka);const Um=Math.max(1,Fe.value||We.value||co);Ne.value<ka?Jk(Um,{immediate:!q}):Ct(Ne.value)},{immediate:!0}),Ve(we,(Bs,co)=>{$e.value&&(typeof co=="number"&&Bs<=co||Bs>Ne.value&&Jk())}),{cleanupBatchScheduler:Qk}})({props:k,isClient:X,isTestEnv:zo,parsedNodesIdentity:kn,parsedNodeCount:Gn,desiredRenderedCount:wd,datasetKey:X4,batchingEnabled:xe,incrementalRenderingActive:Be,resolvedBatchSize:Li,resolvedInitialBatch:Ee,renderedCount:$t,adaptiveBatchSize:ns,previousRenderContext:zt,previousBatchConfig:Qn,requestFrame:et,cancelFrame:st,hasIdleCallback:Bt,cleanupNodeVisibility:q4,onDatasetKeyChanged:A=>{ha(),bd(),qo(),Rc(),A>0&&yd(A)},onDatasetChanged:()=>{Nt.value&&wi({immediate:!0})}});Ve([Ky,Nt,()=>S.value,()=>pe()],([A,F])=>{if(!A)return nk(),void Zh();V4(),F?wi({immediate:!0}):Zh()},{flush:"post",immediate:!0}),Ve([()=>ot.value.length,()=>Nt.value],A=>qn(null,[A],function*([F,q]){q&&F&&X&&(yield mt(),wi({immediate:!0}))}),{flush:"post"}),Ve(Ht,A=>{A&&(function(){var F;if(Hn.value&&Ln.value&&rs.value&&((F=Ge.value)!=null&&F[1]))return;const q=Hr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Hr({type:"list_item",children:[q],raw:"- Probe paragraph text"}),te=Hr({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});Hn.value=q,Ln.value=K,rs.value=te;const ge={1:null,2:null,3:null,4:null,5:null,6:null};for(let we=1;we<=6;we++)ge[we]=Hr({type:"heading",level:we,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(we)} Probe heading`});Ge.value=ge})()},{immediate:!0}),Ve([()=>S.value,Ht],()=>{if(!Ht.value)return nm(),void(V.value=0);ok(),nm(),Ht.value&&S.value&&typeof ResizeObserver<"u"&&(Ac=new ResizeObserver(()=>{ok(),at.value&&Ds(),_e.value&&da(),Pn("resize")}),Ac.observe(S.value))},{immediate:!0}),Ve([Ht,wo,xo],()=>qn(null,null,function*(){if(!Ht.value)return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void qo();yield mt(),(function(){if(!Ht.value||typeof window>"u")return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void qo();const A={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},F=sk(tm(E.value),".paragraph-node");A.paragraph=Gg(E.value,F,"pre-wrap");const q=tm(D.value),K=q?.querySelector(".paragraph-node");A.listItem=Gg(D.value,K,"pre-wrap");const te=_t("readSimpleTextProbeProfile.list.offsetHeight",()=>{var we,Ce;return(Ce=(we=R.value)==null?void 0:we.offsetHeight)!=null?Ce:0}),ge=_t("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var we,Ce;return(Ce=(we=D.value)==null?void 0:we.offsetHeight)!=null?Ce:0});A.listWrapperOverhead=Math.max(0,te-ge);for(let we=1;we<=6;we++){const Ce=sk(tm(H[we]),`h${we}`);A.headings[we]=Gg(H[we],Ce,"pre-wrap")}re.value=A,qo()})()}),{flush:"post",immediate:!0}),Ve(()=>ot.value.length,()=>{Nt.value&&wi({immediate:!0})}),Ve([Ht,V],()=>{qo(),Nt.value&&wi({immediate:!0}),at.value&&Ds(),_e.value&&da(),Pn("resize")},{immediate:!1}),Ve(()=>pr.value,A=>{if(A)for(const[F,q]of Wn)$k(F,q);else{em();for(const[F,q]of Wn)q&&gr(F,!0)}},{immediate:!1}),Ve([()=>k.viewportPriority,()=>ot.value.length],([A,F])=>{A!==!1?U.value&&F<=200&&(U.value=!1):U.value=!1}),Ve(()=>$t.value,()=>{Nt.value&&wi({immediate:!0})}),Ve([jo,ao,xc,()=>ot.value.length,Nt],()=>{ul()},{immediate:!0});let Bc=null,Fc=!1,ma=null;function Hc(){Bc=null,dm=null,um=void 0,aa=null,Rc()}function Pm(){ha(),bd(),qo(),As.clear();const A=ot.value.length;A>0&&yd(A),wm()}function Rm(){Im(),ek(),Lc=null,ml=null,gl=null,$d=null,Ic=null,$c=null,Fc=!1,Hc(),pk("restore"),Vs(),ua()}function Wc(A){var F;return[(F=ms())!=null?F:"",zn(),Pi(),Md.value,Pc(A),ot.value.length,Math.round(vr(0,ot.value.length)),Math.round(pl()),Mn.count,Math.round(Mn.total)].join(":")}function Lk(){return qn(this,null,function*(){var A,F,q,K;const te=(A=s.virtualScroll)==null?void 0:A.settledToken,ge=Pc(te),we=zn(),Ce=ms(),De=xo.value;if(Mt.value&&((F=s.virtualScroll)==null?void 0:F.settleMode)==="manual"&&Ed(te))if(fm()){if(Wc(te)!==aa&&!Fc){Fc=!0;try{const $e=yield Cm({reason:"manual",expectedSettledTokenKey:ge}),We=Pc()===ge;Sm(we,Ce,De)&&$e.sessionKey===we&&$e.threadKey===Ce&&We&&$e.stable&&$e.phase==="final"&&(aa=Wc((q=s.virtualScroll)==null?void 0:q.settledToken))}finally{Fc=!1,yield mt();const $e=(K=s.virtualScroll)==null?void 0:K.settledToken,We=Ed($e)?Wc($e):"";Sm(we,Ce,De)&&We&&aa!==We&&Lk()}}}else Pn("manual")})}Ve(Mt,(A,F)=>{if(A!==F){if(!A)return Rm(),void Im();Rm(),Pm(),ma=xo.value,Pn("content")}},{flush:"post"}),Ve([Mt,xo],([A,F])=>{A?ma!=null?ma!==F&&(ma=F,(function(q="resize"){ha(),bd(),qo(),As.clear();const K=ot.value.length;K>0&&yd(K),wm(),ml=null,gl=null,$d=null,Lc=null,Fc=!1,Hc(),Ck(),mt(()=>{Ri(),at.value&&Ds(),_e.value&&da(),Pn(q)})})("resize")):ma=F:ma=null},{flush:"post",immediate:!0}),Ve([Mt,()=>zn(),()=>ms()],([A])=>{A&&(Rm(),Pm(),pk("content"),Pn("content"))}),Ve([Mt,()=>zn(),()=>ms(),xo,()=>ot.value.length],([A])=>{A&&(function(F="async-node"){let q=!1;for(const[K,te]of Array.from(_i.entries()))am(te)||(_i.delete(K),So.delete(K),q=!0);q&&(ra(),Pn(F))})("async-node")},{flush:"post"}),Ve([Mt,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.sessionKey},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>s.indexKey,()=>Q.value],([A])=>{A&&(Rc(),(function(F="content"){if(!Mt.value)return;const q=[],K=ot.value.length;for(const te of Array.from(As.keys())){if(te>=K){q.push(te);continue}const ge=Ec(te),we=As.get(te);we!=null&&we!==ge&&q.push(te),As.set(te,ge)}for(const te of Array.from(As.keys()))te>=K&&As.delete(te);q.length&&((function(te,ge={}){const we=Array.from(te,Number);W4(we,ge)>0&&(function(De){for(const $e of De)As.delete($e)})(we)})(q,{notify:!1}),qo(),Hc(),at.value&&Ds(),_e.value&&da(),Pn(F))})("content"))},{flush:"post",immediate:!0}),Ve([Mt,()=>ot.value.length,()=>zn(),()=>ms()],([A,F,q,K],[te,ge,we,Ce])=>{A&&te&&q===we&&K===Ce&&F!==ge&&Hc()},{flush:"post"}),Ve([Mt,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.heightCache},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.heightCacheWidth},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>ot.value.length,()=>zn(),V],()=>{Ck()},{flush:"post",immediate:!0}),Ve([Mt,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreAnchor},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>ot.value.length,()=>zn(),V],A=>qn(null,[A],function*([F,q]){if(!F||!q)return;yield mt();const K=(function(){var te;const ge=(te=s.virtualScroll)==null?void 0:te.restoreAnchor;return ge==null||ge===!1?null:ge===!0?"true":String(ge)})();_m(q,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ve([Mt,V,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey}],([A])=>{var F;if(!A)return;const q=(F=s.virtualScroll)==null?void 0:F.restoreState;q&&ml&&gl==="restore"&&(wk(q)||(Pm(),ml=null,gl=null,Pn("resize")))},{flush:"post"}),Ve([Mt,()=>ot.value.length,()=>zn(),V],A=>qn(null,[A],function*([F]){var q;const K=Ic,te=$c;F&&K&&(yield mt(),!_m(K,{restoreAnchor:te?.restoreAnchor===!0,restoreToken:(q=te?.restoreToken)!=null?q:"imperative",allowUncapturedAnchor:te?.allowUncapturedAnchor===!0})&&xk(K)||(Ic=null,$c=null))}),{flush:"post",immediate:!0}),Ve([Mt,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>zn(),()=>ms(),xo,Qh,Yy,()=>$t.value,wd,()=>Mn.count,()=>Mn.total],([A,F,q])=>{if(!A||F!==!0||q==="manual"||!pm())return;const K=(function(){var te;const ge=ot.value.length;return[(te=ms())!=null?te:"",zn(),Pi(),Md.value,ge,Math.round(vr(0,ge)),Math.round(pl()),Mn.count,Math.round(Mn.total)].join(":")})();Bc!==K&&(Bc=K,Cm({reason:"final"}).then(te=>{te.stable||Bc!==K||(Bc=null)}))},{flush:"post",immediate:!0}),Ve([Mt,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settledToken},()=>zn(),()=>ms(),xo,Qh,Yy,()=>$t.value,wd,()=>ot.value.length,()=>Mn.count,()=>Mn.total],()=>{Lk()},{flush:"post",immediate:!0}),Ve([()=>ot.value.length,Nt,ao,xc,()=>Ts.start,()=>Ts.end],([A,F,q,K,te,ge])=>{Pe.value&&Me("virtualization",{nodes:A,virtualization:F,maxLiveNodes:q,buffer:K,focusIndex:jo.value,scroll:F?(()=>{const we=se.value||oe();return we?{reverse:W(we),scrollTop:Math.round(we.scrollTop),scrollTopAbs:Math.round(Math.abs(we.scrollTop)),scrollHeight:Math.round(we.scrollHeight),clientHeight:Math.round(we.clientHeight)}:null})():null,liveRange:{start:te,end:ge},rendered:$t.value})}),Ve([()=>k.customId],([A],F,q)=>{if(!A||Qe)return;const K=(function(te,ge){return te?(gs.controllers[te]=ge,()=>{gs.controllers[te]===ge&&delete gs.controllers[te]}):()=>{}})(A,{captureRestoreAnchor:hn,restoreAnchor:_s,getAnchorDrift:Xn,getReport:G4});q(()=>{K()})},{immediate:!0}),fs(()=>{(function(){if(Mt.value)try{Ri(),Nc();const A=hl("manual");Tk(A)&&(M(A),Lc=A,Am=Oc());const F=ca(A,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});F&&($(F),F.anchor&&L(F.anchor),fa=Dc(F))}catch{}})(),iE(),em(),Ie(),Nk();for(const A of hr.values())for(const F of A)Cd(F);hr.clear(),dl.clear(),As.clear(),Om(),ha(),nm(),Vs(),ua(),Im(),nk(),Zh()});const rE=fi({loader:()=>qn(null,null,function*(){try{return(yield Js(()=>import("./index11-DnWluvv0.js"),__vite__mapDeps([8,5]))).default}catch(A){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',A),To}}),loadingComponent:sG,delay:0}),lE=fi({loader:()=>qn(null,null,function*(){try{return(yield Js(()=>import("./index10-C34WriXe.js"),[])).default}catch(A){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',A),To}}),loadingComponent:nG,delay:0}),aE=fi(()=>qn(null,null,function*(){try{return(yield Js(()=>import("./index7-DOz39QJX.js"),[])).default}catch(A){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',A),To}})),Ok={text:es,paragraph:jl,heading:Bp,code_block:Hg,list:oc,list_item:sc,blockquote:Df,table:Tu,definition_list:Bf,footnote:Ff,footnote_reference:Oo,footnote_anchor:xu,admonition:Uf,vmr_container:Wf,hardbreak:Gr,link:io,image:Kr,thematic_break:Hf,math_inline:vi,math_block:l3,strong:so,emphasis:ro,strikethrough:oo,highlight:Ro,insert:bo,subscript:ko,superscript:yo,emoji:vo,checkbox:Lo,checkbox_input:Lo,inline_code:qs,html_inline:Po,reference:no,html_block:Au},cE=B(()=>rm()),Pk=B(()=>CS(k.codeBlockProps)),uE=B(()=>CS(k.codeBlockProps,{omit:["langs"]})),Rk=B(()=>rt(rt({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,monacoOptions:k.codeBlockMonacoOptions,themes:k.themes,langs:u.value==="shiki"?k.langs:void 0,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof je.value=="boolean"?{showTooltips:je.value}:{}),uE.value)),Dk=B(()=>rt(Lt(rt({},Rk.value),{langs:k.langs}),Pk.value));function Bk(A){return typeof A=="boolean"?A:void 0}const dE=B(()=>{const A=k.codeBlockProps||{},F={},q=Bk(A.showLineNumbers);q!==void 0&&(F.showLineNumbers=q);const K=Bk(A.diffInline);K!==void 0&&(F.diffInline=K);const te=(function(ge){const we=Number(ge);return Number.isFinite(we)&&we>0?we:void 0})(A.reservedHeightPx);return te!==void 0&&(F.reservedHeightPx=te),F}),fE=B(()=>rt(rt({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof je.value=="boolean"?{showTooltips:je.value}:{}),Pk.value)),pE=B(()=>rt({},k.mermaidProps||{})),Fk=B(()=>rt({},k.d2Props||{})),hE=B(()=>rt({},k.infographicProps||{})),zc=B(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:xs.value.customHtmlTags})),mE=B(()=>rt(rt({},zc.value),typeof je.value=="boolean"?{showTooltip:je.value}:{})),gE=B(()=>rt(rt({},zc.value),typeof je.value=="boolean"?{showTooltips:je.value}:{})),vE=B(()=>rt(rt({},zc.value),typeof je.value=="boolean"?{showTooltips:je.value}:{})),yE=B(()=>rt(rt({},zc.value),typeof je.value=="boolean"?{showTooltips:je.value}:{}));function kE(A){return Array.isArray(A.children)&&A.children.length>0}const Dm=B(()=>K4.value.map(A=>{var F,q,K,te,ge,we,Ce,De;let $e=(function(ct){var ut,Ct,St,nn,xt,Wt,Ft;if(ct.type!=="code_block")return ct;const un=ct,Ao=[String((ut=un.language)!=null?ut:""),String((Ct=un.loading)!=null?Ct:""),String((St=un.diff)!=null?St:""),String((nn=un.code)!=null?nn:""),String((xt=un.originalCode)!=null?xt:""),String((Wt=un.updatedCode)!=null?Wt:""),String((Ft=un.raw)!=null?Ft:"")].join("\0"),Ks=On.get(un);if(Ks&&Ks.signature===Ao)return Ks.node;const li=rt({},un);return On.set(un,{signature:Ao,node:li}),li})(A.node);const We=Od($e);let Fe=Uk($e,We);if(($e.type==="html_block"||$e.type==="html_inline")&&Fe===Ok[$e.type]){const ct=$e,ut=String((F=ct.tag)!=null?F:"").trim().toLowerCase()||XT(ct.content);if(ut){const Ct=Rt.value[ut];if(tn.value.has(ut)&&Ct)Fe=Ct,$e=Lt(rt({},ct),{type:ut,tag:ut,content:kH(ct.content,ut)});else if(ZT((q=ct.content)!=null?q:ct.raw,ut)){const St=String((te=(K=ct.content)!=null?K:ct.raw)!=null?te:"");$e.type==="html_inline"?(Fe=es,$e={type:"text",content:St,raw:St}):(Fe=jl,$e={type:"paragraph",children:[{type:"text",content:St,raw:St}],raw:St})}}}const Ne=$e.type==="code_block"&&u.value==="pre"&&Fe===To&&!Bm(Rt.value,We);let He=rt({},(function(ct,ut,Ct){const St=ut??Od(ct);if(ct.type==="code_block"){const nn=St?Bm(Rt.value,St):void 0;if(Ct&&u.value==="pre"&&!nn&&Ct===To)return dE.value;if(Ct&&St&&Ct===nn)return St==="mermaid"?Wk(ct):St==="infographic"?zk(ct):St==="d2"||St==="d2lang"?Fk.value:Dk.value;if(Ct&&Ct===Rt.value.code_block)return Dk.value;if(rk(Ct))return fE.value}return St==="mermaid"?Wk(ct):St==="infographic"?zk(ct):St==="d2"||St==="d2lang"?Fk.value:ct.type==="link"?mE.value:ct.type==="list"?gE.value:ct.type==="blockquote"?vE.value:ct.type==="table"?yE.value:ct.type==="code_block"?Rk.value:zc.value})($e,We,Fe));const Ze=fl.value[A.index];$e.type==="code_block"&&Ze?.kind==="code-block"&&(He=Lt(rt({},He),Ne?{reservedHeightPx:(ge=Ze.height)!=null?ge:Ze.contentHeight}:{estimatedHeightPx:Ze.height,estimatedContentHeightPx:Ze.contentHeight})),Ne||$e.type!=="code_block"||We!=="mermaid"||za(He.estimatedPreviewHeightPx)!=null||(He=Lt(rt({},He),{estimatedPreviewHeightPx:y1(g1(String((we=$e.code)!=null?we:"")))})),Ne||$e.type!=="code_block"||We!=="infographic"||za(He.estimatedPreviewHeightPx)!=null||(He=Lt(rt({},He),{estimatedPreviewHeightPx:k1(v1(String((Ce=$e.code)!=null?Ce:"")))})),$e.type==="math_block"&&(He=Lt(rt({},He),{cacheScope:is.value}));const Je=(function(ct,ut){const Ct=String(ct.type);return!hd(Ct)&&Rt.value[Ct]===ut})($e,Fe),wt=Je?uy($e,it.value):void 0;return Lt(rt({},A),{node:$e,component:Fe,bindings:He,customBindings:rt(rt({},wt??{}),He),rendersCustomNode:Je,hasSlotChildren:kE($e),slotContent:String((De=$e.content)!=null?De:""),isCodeBlock:$e.type==="code_block",indexKey:`${cE.value}-${A.index}`})}));function Od(A){var F;return A?.type==="code_block"?String((F=A.language)!=null?F:"").trim().toLowerCase():""}function Bm(A,F){const q=F.trim().toLowerCase();if(q)for(const K of[q,sy(q),VM(q)]){const te=K&&A[K];if(te)return te}}function Hk(A,F,q,K){var te,ge;const we=rt({},A.value);return za(we.estimatedPreviewHeightPx)==null&&(we.estimatedPreviewHeightPx=K(q(String((te=F?.code)!=null?te:"")),void 0,we.maxHeight==="none"?null:(ge=za(we.maxHeight))!=null?ge:void 0)),we}function Wk(A){return Hk(pE,A,g1,y1)}function zk(A){return Hk(hE,A,v1,k1)}function Uk(A,F){if(!A)return E1;const q=Rt.value,K=q[String(A.type)];if(A.type==="code_block"){const te=F??Od(A),ge=te?Bm(q,te):void 0;return ge||(u.value==="pre"?q.code_block||To:te==="mermaid"?q.mermaid||rE:te==="infographic"?q.infographic||lE:te==="d2"||te==="d2lang"?q.d2||aE:K||q.code_block||lk.value)}return K||Ok[String(A.type)]||E1}function Fm(A){o("click",A)}function bE(A){var F;(F=A.target)!=null&&F.closest("[data-node-index]")&&o("mouseover",A)}function _E(A){var F;(F=A.target)!=null&&F.closest("[data-node-index]")&&o("mouseout",A)}function jk(A){o("mouseover",A)}function qk(A){o("mouseout",A)}const kl=J(null),Si=J(!1);let Uc,ga=null,Hm=0,Pd=0,Rd=0;const Vk=["code_block","admonition","table","math_block","html_block","image","thematic_break"],wE=new Set(Vk),Kk=[".typewriter-cursor",".height-estimation-probes",...Vk.map(A=>`[data-node-type="${A}"]`),"script","style"].join(",");function Gk(A){if(!A||typeof A!="object")return!1;const F=A.type;return typeof F=="string"&&wE.has(F)}function Dd(A){var F,q;if(!A||typeof A!="object")return 0;const K=A,te=(q=(F=K.raw)!=null?F:K.content)!=null?q:K.code;if(typeof te=="string")return te.length;const ge=K.children;if(Array.isArray(ge))return ge.reduce((Ce,De)=>Ce+Dd(De),0);const we=K.items;return Array.isArray(we)?we.reduce((Ce,De)=>Ce+Dd(De),0):0}function Bd(){Uc&&(clearTimeout(Uc),Uc=void 0)}function Yk(){Hm+=1,ga!=null&&(st?.(ga),ga=null)}function Fd(){Yk(),kl.value&&(kl.value.style.visibility="hidden")}function SE(A){var F;if(A.nodeType!==Node.TEXT_NODE||!((F=A.textContent)!=null?F:"").trim())return!1;const q=A.parentElement;return!!q&&!q.closest(Kk)}function CE(A){let F=A.lastChild;for(;F;){if(SE(F))return F;if(F.nodeType===Node.ELEMENT_NODE){const q=F;if(!q.matches(Kk)&&q.lastChild){F=q.lastChild;continue}}for(;F&&F!==A&&!F.previousSibling;)F=F.parentNode;if(!F||F===A)break;F=F.previousSibling}return null}function Wm(){if(!X||!Si.value||ga!=null)return;const A=Hm,F=()=>{ga=null,A===Hm&&(function(){var q,K;if(!(X&&Si.value&&S.value&&kl.value))return;const te=S.value,ge=kl.value;ge.style.visibility="hidden";const we=(function(){const Fe=Dm.value;for(let Ne=Fe.length-1;Ne>=0;Ne--){const He=Fe[Ne];if(!He||Gk(He.node)||!Nm(He.index))continue;const Ze=Wn.get(He.index);if(!Ze)continue;const Je=CE(Ze);if(Je)return Je}return null})();if(!we)return;let Ce=0,De=0,$e=20,We=!1;if(we?.textContent){const Fe=we.textContent.length,Ne=document.createRange();Ne.setStart(we,Math.max(0,Fe-1)),Ne.setEnd(we,Fe);const He=typeof Ne.getClientRects=="function"?Ne.getClientRects():void 0,Ze=(K=He?.[He.length-1])!=null?K:(q=we.parentElement)==null?void 0:q.getBoundingClientRect();if(Ze){const Je=_t("typewriterCursor.root.getBoundingClientRect",()=>te.getBoundingClientRect());Ce=Ze.right-Je.left+te.scrollLeft,De=Ze.top-Je.top+te.scrollTop,$e=Ze.height||$e,We=!0}Ne.detach()}We&&(ge.style.transform=`translate(${Math.max(0,Ce)}px, ${Math.max(0,De)}px)`,ge.style.height=`${$e}px`,ge.style.visibility="visible")})()};et?ga=et(F):F()}return Ve([me,()=>s.content,()=>s.nodes,()=>k.typewriter,j],()=>qn(null,null,function*(){var A,F;if(!X||he.value||!z.value)return;if(j.value)return Si.value=!1,Bd(),void Fd();if((A=s.nodes)!=null&&A.length)return Si.value=!1,Bd(),Fd(),Pd=((F=s.content)!=null?F:"").length,void(Rd=me.value.length);const q=(function(){var Ce,De;return(Ce=s.nodes)!=null&&Ce.length?s.nodes.reduce(($e,We)=>$e+Dd(We),0):((De=s.content)!=null?De:"").length})(),K=(function(){var Ce;return(Ce=s.nodes)!=null&&Ce.length?s.nodes.reduce((De,$e)=>De+Dd($e),0):me.value.length})(),te=!Gk(ot.value[ot.value.length-1]),ge=q>Pd,we=K>Rd;if(k.typewriter===!1||!te||!ge&&!we)return k.typewriter!==!1&&te||(Si.value=!1,Fd()),Pd=q,void(Rd=K);Pd=q,Rd=K,Si.value=!0,kl.value&&(kl.value.style.visibility="hidden"),Bd(),yield mt(),Wm(),Uc=setTimeout(()=>{Uc=void 0,Si.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(Si,A=>qn(null,null,function*(){A?(yield mt(),Wm()):Fd()}),{flush:"post"}),Ve([()=>$t.value,()=>Ts.start,()=>Ts.end],()=>qn(null,null,function*(){X&&!he.value&&z.value&&Si.value&&(yield mt(),Wm())}),{flush:"post"}),fs(()=>{Bd(),Yk(),cn.clear()}),(A,F)=>{const q=XI("NodeRenderer",!0);return C(he)?(w(!0),N(Oe,{key:0},tt(Dm.value,K=>(w(),N(Oe,{key:K.index},[K.rendersCustomNode?(w(),ye(zs(K.component),mn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:Fm,onMouseover:jk,onMouseout:qk,onCopy:F[0]||(F[0]=te=>o("copy",te)),onHandleArtifactClick:F[1]||(F[1]=te=>o("handleArtifactClick",te))}),{default:be(()=>[K.hasSlotChildren?(w(),ye(q,mn({key:0,ref_for:!0},Fn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ye(q,mn({key:1,ref_for:!0},Fn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(zs(K.component),mn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:Fm,onMouseover:jk,onMouseout:qk,onCopy:F[2]||(F[2]=te=>o("copy",te)),onHandleArtifactClick:F[3]||(F[3]=te=>o("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),N("div",{key:1,ref_key:"containerRef",ref:S,class:Re(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:Nt.value},{"virtual-scroll-coordinated":Yn.value}]]),"data-custom-id":k.customId,onClick:Fm,onMouseover:bE,onMouseout:_E},[ks.value||Nt.value?(w(),N(Oe,{key:0},[ks.value?(w(),N("div",{key:0,class:"height-estimation-probes",style:Qt({width:`${wo.value}px`}),"aria-hidden":"true"},[x("div",{ref_key:"paragraphProbeWrapperRef",ref:E,class:"node-content","data-probe":"paragraph"},[ie(C(jl),{node:Hn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),x("div",{ref_key:"listItemProbeWrapperRef",ref:D,class:"node-content","data-probe":"list-item"},[x("ul",iG,[ie(C(sc),{node:Ln.value,"index-key":"probe-list-item"},null,8,["node"])])],512),x("div",{ref_key:"listProbeWrapperRef",ref:R,class:"node-content","data-probe":"list"},[ie(C(oc),{node:rs.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),N(Oe,null,tt(6,K=>x("div",{key:`probe-heading-${K}`,ref_for:!0,ref:te=>(function(ge,we){ge<1||ge>6||(H[ge]=we)})(K,te),class:"node-content","data-probe":`heading-${K}`},[ie(C(Bp),{node:j4(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,rG)),64))],4)):le("",!0),Nt.value?(w(),N("div",{key:1,class:"node-spacer",style:Qt({height:`${om.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],64)):le("",!0),(w(!0),N(Oe,null,tt(Dm.value,K=>(w(),N("div",{key:K.index,ref_for:!0,ref:te=>$k(K.index,te),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Nm(K.index)?(w(),N("div",{key:0,ref_for:!0,ref:te=>(function(ge,we){var Ce;we||(function(Fe){const Ne=`${rm()}-${Fe}`;let He=!1;for(const Ze of Array.from(So.keys())){const Je=_i.get(Ze);(Je?.index===Fe||Ze===Ne||Ze.startsWith(`${Ne}-`))&&(So.delete(Ze),_i.delete(Ze),He=!0)}He&&(ra(),Pn("async-node"))})(ge),Oi.delete(ge),(function(Fe){var Ne;const He=((Ne=dl.get(Fe))!=null?Ne:0)+1;dl.set(Fe,He)})(ge);const De=hr.get(ge);if(De){for(const Fe of De)Cd(Fe);hr.delete(ge)}if((function(Fe){const Ne=ft.get(Fe);Ne&&(Le?.unobserve(Ne),ve.delete(Ne),ft.delete(Fe))})(ge),!we||!Ho.value)return bi.delete(ge),void dl.delete(ge);bi.set(ge,we);const $e=()=>{Ld(ge,we)};queueMicrotask($e);const We=(Le||typeof ResizeObserver>"u"||(Le=new ResizeObserver(Fe=>{if(Fe.length)for(const Ne of Fe){const He=ve.get(Ne.target),Ze=ft.get(He??-1);He!=null&&Ze&&Ld(He,Ze)}else Ri()})),Le);if(We&&(ft.set(ge,we),ve.set(we,ge),We.observe(we)),typeof window<"u"){const Fe=((Ce=ot.value[ge])==null?void 0:Ce.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(Fe.length){const Ne=Fe.map(He=>Jy(He,$e,"node-resize")).filter(He=>He!=null);Ne.length&&hr.set(ge,Ne)}}})(K.index,te),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ye(zs(K.component),mn({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:F[8]||(F[8]=te=>o("copy",te)),onHandleArtifactClick:F[9]||(F[9]=te=>o("handleArtifactClick",te))}),{default:be(()=>[K.hasSlotChildren?(w(),ye(q,mn({key:0,ref_for:!0},Fn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ye(q,mn({key:1,ref_for:!0},Fn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(zs(K.component),mn({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:F[10]||(F[10]=te=>o("copy",te)),onHandleArtifactClick:F[11]||(F[11]=te=>o("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(Xr,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:be(()=>[K.rendersCustomNode?(w(),ye(zs(K.component),mn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:F[4]||(F[4]=te=>o("copy",te)),onHandleArtifactClick:F[5]||(F[5]=te=>o("handleArtifactClick",te))}),{default:be(()=>[K.hasSlotChildren?(w(),ye(q,mn({key:0,ref_for:!0},Fn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ye(q,mn({key:1,ref_for:!0},Fn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(zs(K.component),mn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:F[6]||(F[6]=te=>o("copy",te)),onHandleArtifactClick:F[7]||(F[7]=te=>o("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),N("div",{key:1,class:"node-placeholder",style:Qt({height:`${Td(K.index)}px`})},null,4))],8,lG))),128)),Si.value?(w(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:kl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):le("",!0),Nt.value?(w(),N("div",{key:2,class:"node-spacer",style:Qt({height:`${im.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],42,oG))}}})),[["__scopeId","data-v-2e8e6e17"]]),_o=b3;_o.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",_o.__name,_o.name].filter(n=>!!n));for(const n of t)e.component(n,b3)};const vy=Object.freeze(Object.defineProperty({__proto__:null,default:_o},Symbol.toStringTag,{value:"Module"})),aG={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"},cG={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"},uG={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"},dG={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"},fG={class:"admonition-title"},pG=["aria-expanded","aria-controls"],hG=["id"],Uf=pn(qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=B(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=J(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),N("div",{class:Re(["admonition",[`admonition-${s.node.kind}`]])},[x("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(w(),N("svg",aG,[...u[1]||(u[1]=[x("circle",{cx:"12",cy:"12",r:"10"},null,-1),x("path",{d:"M12 16v-4"},null,-1),x("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(w(),N("svg",cG,[...u[2]||(u[2]=[x("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),x("path",{d:"M9 18h6"},null,-1),x("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(w(),N("svg",uG,[...u[3]||(u[3]=[x("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),x("path",{d:"M12 9v4"},null,-1),x("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(w(),N("svg",dG,[...u[4]||(u[4]=[x("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),x("path",{d:"M12 8v4"},null,-1),x("path",{d:"M12 16h.01"},null,-1)])])):le("",!0),x("span",fG,O(i.value),1),s.node.collapsible?(w(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),N("svg",{style:Qt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[x("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,pG)):le("",!0)]),_n(x("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(_o),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,hG),[[Eo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Uf.install=e=>{e.component(Uf.__name,Uf)};const _3=()=>Js(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let yf=null,mG=_3;function Rge(){return qn(this,null,function*(){if(yf)return yf;const e=mG;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===_3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(yf=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),yf):null})}function Dge(){return!1}function Bge(){return qn(this,null,function*(){return null})}const kf=J(!1);let PS=!1;function Qg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function gG(){return!PS&&typeof window<"u"&&typeof document<"u"&&(PS=!0,kf.value=Qg(),new MutationObserver(()=>{kf.value=Qg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{kf.value=Qg()})),kf}const w3=["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"],vG=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),O1=[...w3].sort((e,t)=>t.length-e.length).join("|"),Xg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${O1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${O1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),S3=/[),.;!?,。;!?)]+$/;function yG(e){const t=e.toLowerCase();return w3.some(n=>t.endsWith(`.${n}`))}function kG(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${O1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function bG(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(S3,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=vG.has(i),a=yG(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function _G(e,t={}){const n=[];Xg.lastIndex=0;let s;for(;(s=Xg.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(S3,""),u=a.length-c.length;a=c;const d=bG(a,t);if(!d)continue;const f=s.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(Xg.lastIndex-=u)}return n}const wG=12e4,SG=6e4,CG=32,xG=3e4,RS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function AG(e){let t=0,n=0,s=0;RS.lastIndex=0;let o;for(;(o=RS.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=wG||n>=SG||t>=CG||s>=xG?"pre":"shiki",codeFenceCount:t,codeChars:n}}function TG(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function MG(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const EG={key:1,class:"diff-wrap"},IG={class:"diff-bar"},$G=["aria-label","onClick"],NG={class:"diff-pre"},LG={key:0,class:"diff-sign"},OG={class:"diff-text"},PG="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",DS="github-light",BS="github-dark",RG=qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){dq(),Cq(),pq(),Eq(),fq(new TG),Mq(new MG);function t(D){return D.inline.ruler.disable("math"),D}const{t:n}=At(),s=jt("resolveImage"),o=J(null),i=e,r=B(()=>!i.streaming),l=B(()=>kG(i.text??"")),a=B(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:AG(i.text??"")),c=gG(),u=B(()=>!i.streaming),d=Ls(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(D){return!/^(https?:|data:|blob:)/i.test(D)}function _(D){if(!s)return;const R=[];for(const H of[h,p]){H.lastIndex=0;let U;for(;(U=H.exec(D))!==null;)R.push(U[2]??"")}for(const H of R)!H||!m(H)||d.has(H)||f.has(H)||(f.add(H),s(H).then(U=>{d.set(H,U!==H?U:"")}).catch(()=>{d.set(H,"")}).finally(()=>{f.delete(H)}))}function b(D){if(!s)return D;const R=H=>{if(!m(H))return null;const U=d.get(H);return U===void 0?PG:U===""?null:U};return D.replace(h,(H,U,G,Q)=>{const V=R(G);return V===null?H:`${U}${V}${Q}`}).replace(p,(H,U,G,Q)=>{const V=R(G);return V===null?H:`${U}${V}${Q}`})}Ve(()=>i.text,D=>_(D??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const D=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),R=[];let H=D.nextNode();for(;H;){const U=H,G=U.parentElement;G&&!G.closest("a, pre, .md-file-link, svg")&&U.data.trim().length>0&&R.push(U),H=D.nextNode()}for(const U of R){const G=_G(U.data,{aliases:l.value});if(G.length===0||!U.parentNode)continue;const Q=document.createDocumentFragment();let V=0;for(const re of G){re.start>V&&Q.append(document.createTextNode(U.data.slice(V,re.start)));const pe=document.createElement("button");pe.type="button",pe.className="md-file-link",pe.textContent=re.text,pe.title=re.line?`${re.path}:${re.line}`:re.path,pe.addEventListener("click",ne=>{ne.preventDefault(),ne.stopPropagation(),i.openFile?.({path:re.path,line:re.line})}),Q.append(pe),V=re.end}V<U.data.length&&Q.append(document.createTextNode(U.data.slice(V))),U.parentNode.replaceChild(Q,U)}}function v(D){return!(!D||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(D))}function y(D){let R=D.length;for(const H of["#","?"]){const U=D.indexOf(H);U!==-1&&U<R&&(R=U)}return D.slice(0,R)}function T(){if(!o.value||!i.openFile||i.streaming)return;const D=o.value.querySelectorAll("a[href]");for(const R of D){if(R.dataset.mdLinkHandled==="true"||R.closest("svg"))continue;const H=R.getAttribute("href")??"";v(H)&&(R.dataset.mdLinkHandled="true",R.addEventListener("click",U=>{U.preventDefault(),U.stopPropagation(),i.openFile?.({path:y(H)})}))}}function P(){mt().then(()=>{g(),T()})}Ve(()=>i.text,P),Ve(()=>i.streaming,P);let I=null;yn(()=>{P(),o.value&&(I=new MutationObserver(P),I.observe(o.value,{childList:!0,subtree:!0}))}),xn(()=>{I?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},M=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,$=B(()=>{const D=b(i.text??""),R=[];let H=0;M.lastIndex=0;let U;for(;(U=M.exec(D))!==null;){const Q=U[1]??"",V=D.slice(H,U.index)+(Q||"");V.trim()&&R.push({kind:"md",text:V}),R.push({kind:"diff",code:U[2]??""}),H=M.lastIndex}const G=D.slice(H);return(G.trim()||R.length===0)&&R.push({kind:"md",text:G}),R});function L(D){return D.split(`
|
|
252
|
+
`).map(R=>R.startsWith("@@")?{type:"hunk",sign:"",text:R}:/^\+(?!\+\+)/.test(R)?{type:"add",sign:"+",text:R.slice(1)}:/^-(?!--)/.test(R)?{type:"del",sign:"-",text:R.slice(1)}:R.startsWith(" ")?{type:"ctx",sign:"",text:R.slice(1)}:{type:"ctx",sign:"",text:R})}const S=J(null);function E(D,R){js(D).then(H=>{H&&(S.value=R,setTimeout(()=>{S.value=null},1400))})}return(D,R)=>(w(),N("div",{ref_key:"mdRef",ref:o,class:"md"},[(w(!0),N(Oe,null,tt($.value,(H,U)=>(w(),N(Oe,{key:U},[H.kind==="md"?(w(),ye(C(_o),{key:0,content:H.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":DS,"code-block-dark-theme":BS,themes:[DS,BS],"code-block-props":k,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(w(),N("div",EG,[x("div",IG,[R[0]||(R[0]=x("span",{class:"diff-lang"},"diff",-1)),ie(qt,{text:C(n)("filePreview.copyCode")},{default:be(()=>[x("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:G=>E(H.code,U)},[ie(Xe,{name:S.value===U?"check":"copy",size:"sm"},null,8,["name"])],8,$G)]),_:2},1032,["text"])]),x("pre",NG,[x("code",null,[(w(!0),N(Oe,null,tt(L(H.code),(G,Q)=>(w(),N("span",{key:Q,class:Re(["diff-line",`diff-${G.type}`])},[G.type!=="hunk"?(w(),N("span",LG,O(G.sign),1)):le("",!0),x("span",OG,O(G.text),1)],2))),128))])])]))],64))),128))],512))}}),Fh=dt(RG,[["__scopeId","data-v-6678a5da"]]),DG={class:"tc-anim"},BG={class:"prev-anim"},FG={class:"prev"},HG=qe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=B(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=B(()=>n.foldable&&o.value.length>1),r=B(()=>n.streaming||!i.value),l=B(()=>o.value.pop()??""),a=J(null);return yn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ve(()=>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(),N("div",{class:Re(["think",{mob:e.mobile}])},[i.value?(w(),N("div",{key:0,class:Re(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[x("div",DG,[x("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),x("div",BG,[x("span",FG,O(l.value),1)])],2)):(w(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),WG=dt(HG,[["__scopeId","data-v-5f6e61ba"]]),zG={class:"activity-notice",role:"status"},UG={"aria-hidden":"true"},jG={class:"an-label"},qG=qe({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),N("div",zG,[x("span",UG,[ie(ii,{size:"sm"})]),x("span",jG,O(e.label),1)]))}}),VG=dt(qG,[["__scopeId","data-v-0d497074"]]);function KG(e){return e.length===1?`0${e}`:e}function GG(e,t){return`${String(Number(e))}:${KG(t)}`}const FS=e=>/^\d+$/.test(e);function YG(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[s,o,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(s==="*"&&o==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(s);if(u&&o==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(s==="0"&&o==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(o);if(s==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(FS(s)&&FS(o)&&c){const f=GG(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}function QG(e,t=120){const n=e.split(`
|
|
253
|
+
`)[0]??"",s=e.includes(`
|
|
254
|
+
`)||e.length>t;return{text:n.length>t?`${n.slice(0,t).trimEnd()}…`:n,hasMore:s}}const XG=["data-turn-id"],ZG={class:"cn-head"},JG={class:"cn-icon","aria-hidden":"true"},eY={class:"cn-title"},tY={key:0,class:"cn-badge"},nY=["title"],sY={key:0,class:"cn-status"},oY={key:1,class:"cn-prompt"},iY=qe({__name:"CronNotice",props:{text:{},cron:{},turnId:{}},setup(e){const t=e,{t:n}=At(),s=B(()=>t.cron),o=B(()=>s.value?.missedCount!==void 0),i=B(()=>s.value?.stale===!0||o.value),r=B(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),l=B(()=>{const p=s.value?.cron;return p?YG(p,n):""}),a=B(()=>{const p=s.value;if(!p)return"";const m=[];return p.recurring===!1&&m.push(n("conversation.cron.oneShot")),typeof p.coalescedCount=="number"&&p.coalescedCount>1&&m.push(n("conversation.cron.coalesced",{n:p.coalescedCount})),p.missedCount!==void 0&&m.push(n("conversation.cron.missedCount",{n:p.missedCount})),p.stale===!0&&m.push(n("conversation.cron.finalDelivery")),m.join(" · ")}),c=J(!1),u=B(()=>t.text??""),d=B(()=>QG(u.value)),f=B(()=>d.value.hasMore),h=B(()=>c.value?u.value:d.value.text);return(p,m)=>(w(),N("div",{class:Re(["cron-notice",{"is-warning":i.value,"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[x("div",ZG,[x("span",JG,[ie(Xe,{name:"clock",size:"sm"})]),x("span",eY,O(r.value),1),l.value?(w(),N("span",tY,O(l.value),1)):le("",!0),s.value?.jobId?(w(),N("span",{key:1,class:"cn-job",title:C(n)("conversation.cron.job",{id:s.value.jobId})},O(s.value.jobId),9,nY)):le("",!0)]),a.value?(w(),N("div",sY,O(a.value),1)):le("",!0),u.value?(w(),N("div",oY,O(h.value),1)):le("",!0),u.value&&f.value?(w(),N("button",{key:2,type:"button",class:"cn-toggle",onClick:m[0]||(m[0]=_=>c.value=!c.value)},O(c.value?C(n)("conversation.cron.collapse"):C(n)("conversation.cron.expand")),1)):le("",!0)],10,XG))}}),HS=dt(iY,[["__scopeId","data-v-5cb848c1"]]);function C3(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 P1(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function rY(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function ui(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:P1(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:C3(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 Mu(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function WS(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 yy(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:WS(e.source)};case"video":return{type:"video",source:WS(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 R1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(yy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function lY(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 aY(e){return{content:e.content.map(lY),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 cY(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function x3(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 uY(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function dY(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(uY),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function A3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(dY),createdAt:e.created_at}}function fY(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 pY(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=fY(s);return{answers:t,method:e.method,note:e.note}}function D1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function zS(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 Er(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Aa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ko(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function hY(e){if(!e||typeof e!="object")return null;const t=e,n=Er(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:Er(t,"goalId")??Er(t,"goal_id")??"goal",objective:Er(t,"objective")??"",completionCriterion:Er(t,"completionCriterion")??Er(t,"completion_criterion"),status:n,turnsUsed:Aa(t,"turnsUsed")??Aa(t,"turns_used")??0,tokensUsed:Aa(t,"tokensUsed")??Aa(t,"tokens_used")??0,wallClockMs:Aa(t,"wallClockMs")??Aa(t,"wall_clock_ms")??0,terminalReason:Er(t,"terminalReason")??Er(t,"terminal_reason"),budget:{tokenBudget:Ko(o,"tokenBudget")??Ko(o,"token_budget"),remainingTokens:Ko(o,"remainingTokens")??Ko(o,"remaining_tokens"),turnBudget:Ko(o,"turnBudget")??Ko(o,"turn_budget"),remainingTurns:Ko(o,"remainingTurns")??Ko(o,"remaining_turns"),wallClockBudgetMs:Ko(o,"wallClockBudgetMs")??Ko(o,"wall_clock_budget_ms"),remainingWallClockMs:Ko(o,"remainingWallClockMs")??Ko(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function mY(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ui(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ui(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:Mu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Mu(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:P1(t.payload.status),previousStatus:P1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:C3(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=hY(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:R1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(yy),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:x3(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:A3(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:D1(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:B1(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 gY(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 US(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 B1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function vY(e){return e.session_id}function yY(e){return e.seq}const kY="main",bY=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function Vi(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 _Y(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 jS(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function Qs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function El(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Go(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function wY(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=Qs(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=Qs(t,"goalId")??Qs(t,"goal_id")??"goal",r=Qs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:Qs(t,"completionCriterion")??Qs(t,"completion_criterion"),status:o,turnsUsed:El(t,"turnsUsed")??El(t,"turns_used")??0,tokensUsed:El(t,"tokensUsed")??El(t,"tokens_used")??0,wallClockMs:El(t,"wallClockMs")??El(t,"wall_clock_ms")??0,terminalReason:Qs(t,"terminalReason")??Qs(t,"terminal_reason"),budget:{tokenBudget:Go(s,"tokenBudget")??Go(s,"token_budget"),remainingTokens:Go(s,"remainingTokens")??Go(s,"remaining_tokens"),turnBudget:Go(s,"turnBudget")??Go(s,"turn_budget"),remainingTurns:Go(s,"remainingTurns")??Go(s,"remaining_turns"),wallClockBudgetMs:Go(s,"wallClockBudgetMs")??Go(s,"wall_clock_budget_ms"),remainingWallClockMs:Go(s,"remainingWallClockMs")??Go(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Ua(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function SY(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=Qs(t,"name")??Qs(t,"toolName")??"tool",s=ea(CY(n)),o=xY(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=Qs(n,"text");if(o)return Zg(o);const i=Qs(n,"message");if(i)return Zg(i)}const s=Qs(t,"message");if(s)return Zg(s)}return null}function CY(e){return e.replace(/_\d+$/,"")}const qS=2e3;function Zg(e){return e.length>qS?`${e.slice(0,qS)}…`:e}function xY(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Uu(e,n)}function AY(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=Qs(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Ua(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=SY(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Ua(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 Jc(e){return{...e,content:e.content.map(t=>({...t}))}}function VS(e,t,n){const s={id:Vi("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function TY(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function MY(e){return Array.isArray(e)?e.map(t=>yy(t)):[]}function KS(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function EY(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function IY(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function GS(e,t){e.messages.find(n=>n.id===t)}function $Y(e,t,n,s,o,i){const r={id:Vi("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Jg(e,t){return e.messages.find(n=>n.id===t)}function YS(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 NY(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=jS(),e.set(u,d)),d}function s(u){e.set(u,jS())}function o(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){s(u);const f=n(u),h=d.promptId??Vi("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=VS(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 m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:h},{type:"messageCreated",message:Jc(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),m=d,_=[],b=m?.agentId;if(typeof b=="string"&&b!==kY){const g=t.has(b);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:b,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:b,reason:m?.reason}];if(bY.has(u))return AY(p,f,b,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=MY(m?.content);if(y.length===0)break;p.currentPromptId=g;const T=TY(p,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:Jc(T)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??Vi("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Vi("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=VS(p,f,v);p.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:Jc(y)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const y=a(p.turnThinkLen,h?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const T=KS(p,g,"thinking",v);if(T<0)break;p.turnThinkLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:T,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const y=a(p.turnTextLen,h?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const T=KS(p,g,"text",v);if(T<0)break;p.turnTextLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:T,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,y=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!y)break;const T=m?.toolCallId,P=m?.name??m?.toolName??"",I=m?.args??m?.input??{};EY(p,g,T,P,I);const k=Jg(p,g);k&&k.content.length-1,p.toolStartTimes.set(T,Date.now()),k&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:k.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=IY(m??{});g&&v&&_.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Vi("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=m?.toolCallId,T=m?.output,P=m?.isError??!1;p.toolStartTimes.get(y)??Date.now(),p.toolStartTimes.delete(y);const I=$Y(p,f,y,T,P,v);_.push({type:"messageCreated",message:Jc(I)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=_Y(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){GS(p,g);const y=Jg(p,g);y&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(T=>({...T})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(p.model=m.model),m?.contextTokens!==void 0&&(p.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(p.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:YS(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",y=El(m??{},"durationMs");if(g){GS(p,g);const I=Jg(p,g);I&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:I.content.map(k=>({...k})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}p.turnCount++;const T=YS(p);_.push({type:"sessionUsageUpdated",sessionId:f,usage:T});const P=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:f,status:P,previousStatus:"running"}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{p.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Vi("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};p.subagentMeta.set(v.id,v),_.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Ua(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Ua(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Ua(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Ua(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):Vi("task_"),T=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Bn.global.t("tasks.defaultDescription"),P=typeof g.command=="string"?g.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:T,command:P,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:P!==void 0?`$ ${P}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=wY(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=Qs(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:Vi("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(y),_.push({type:"messageCreated",message:Jc(y)})}break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const LY=new Set(["server_hello","ack","ping","resync_required","error","pong"]),QS=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated","cron.fired"]),OY=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"]),PY=new Set(["assistant.delta","thinking.delta"]);function RY(e,t){if(LY.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return PY.has(s)?DY(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?OY.has(s)?{route:"protocol"}:QS.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:QS.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function DY(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 jf 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 La 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 sl(e){return e instanceof jf||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function T3(e){return e instanceof La||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const XS=1e3,ev=16384,tv=500,nv=50,BY=6,FY=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,HY=/^[A-Za-z0-9+/=_-]{200,}$/;let sv=null;function yi(){if(sv!==null)return sv;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=ts(It.debug)==="1"),sv=e,e}const Ur=[];let WY=1;const ky=J(0),lu=Zl(!1);function zY(){return Ur}function UY(){Ur.length=0,ky.value++}function cl(e){lu.value||(Ur.push({id:WY++,ts:Date.now(),...e}),Ur.length>XS&&Ur.splice(0,Ur.length-XS),ky.value++)}function F1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return HY.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>tv?`${o.slice(0,tv)}… [+${o.length-tv} chars]`:o}if(n!=="object")return String(e);if(t>=BY)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,nv).map(i=>F1(i,t+1));return e.length>nv&&o.push(`[+${e.length-nv} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=FY.test(o)?"[redacted]":F1(i,t+1);return s}function na(e){if(e===void 0)return;const t=F1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>ev)return{_truncated:`detail JSON was ${n.length} chars; first ${ev} kept`,preview:n.slice(0,ev)}}catch{return"[unserializable detail]"}return t}function ov(e){yi()&&cl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:na(e.body)}})}function bf(e){if(!yi())return;const t=e.code!==0;cl({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:na(e.data)}})}function eu(e){yi()&&cl({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 Ta(e,t){yi()&&cl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:na(t)})}function jY(e){if(!yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;cl({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:na(e)})}function qY(e){if(!yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);cl({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:na(t.payload)})}const VY={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function iv(e,t,n){yi()&&cl({source:"client",kind:`client:${e}`,label:`${VY[e]} ${t}`,detail:na(n)})}function Dr(e,t){yi()&&cl({source:"client",kind:"client:event",label:`· ${e}`,detail:na(t)})}let ZS=!1;function KY(){if(!(ZS||!yi())){ZS=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{iv("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;iv("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{iv(e,n.map(GY).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function GY(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 M3(e=Ur){if(typeof document>"u")return;const t=new Blob([YY(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function YY(e=Ur){return e.map(t=>JSON.stringify(t)).join(`
|
|
255
|
+
`)}const by="kimi-web.server-credential",QY="token";let ed;const H1=new Set;function XY(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(QY);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function ZY(){try{return globalThis.sessionStorage?.getItem(by)??void 0}catch{return}}function JY(){const e=XY();return e?(I3(e),!0):(ed=ZY(),ed!==void 0)}function E3(){return ed}function I3(e){ed=e;try{globalThis.sessionStorage?.setItem(by,e)}catch{}}function eQ(){ed=void 0;try{globalThis.sessionStorage?.removeItem(by)}catch{}}function tQ(e){return H1.add(e),()=>{H1.delete(e)}}function nQ(){eQ();for(const e of H1)try{e()}catch{}}const Oa=3e4,$3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",JS=500,sQ=40101;function rv(){try{return AbortSignal.timeout(Oa)}catch{return}}function oQ(e,t){let n="",s=e;for(let o=0;o<t;o++)n=$3[s%32]+n,s=Math.floor(s/32);return n}function iQ(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=>$3[n%32]).join("")}function lv(){return`${oQ(Date.now(),10)}${iQ(16)}`}function rQ(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function eC(e){try{const t=await e.text();return t?t.length>JS?`${t.slice(0,JS)}...`:t:void 0}catch{return}}class lQ{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=hu(this.origin,t),s=lv(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();ov({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:rv()})}catch(a){throw eu({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new La({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:Oa,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return bf({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),bf({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new jf({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??s,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=hu(this.origin,t),o=lv(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();ov({method:"POST",path:t,url:s,requestId:o,body:rQ(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:rv()})}catch(u){throw eu({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new La({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:Oa,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw eu({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new La({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:Oa,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await eC(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(bf({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new jf({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=hu(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,_]of Object.entries(o))_!==void 0&&h.set(m,String(_));const p=h.toString();p&&(r=`${r}?${p}`)}const l=lv(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();ov({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:rv()})}catch(h){throw eu({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new La({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Oa,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw eu({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new La({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Oa,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await eC(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(bf({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 jf({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=E3();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===sQ)&&nQ()}}const aQ="kimi-code.bearer.";class cQ{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Ta("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=E3(),n=t!==void 0?[`${aQ}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{Ta("open")},s.onmessage=o=>{try{const i=JSON.parse(String(o.data));qY(i),this.handleFrame(i)}catch(i){Ta("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{Ta("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{Ta("close",o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Ta("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=_f(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(_f(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(_f(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=_f(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=RY(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),jY(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function _f(e,t){return`${e}\0${t}`}function av(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 tC(e){return e==="auto_compact"||e==="manual_compact"}class uQ{http;config;constructor(t){this.config=t,this.http=new lQ(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?rY(t.status):void 0,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(ui),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return ui(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ui(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return ui(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return ui(n)}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(R1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:ui(n.session),messages:n.messages.items.map(R1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(x3),pendingQuestions:n.pending_questions.map(A3)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,aY(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return ui(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return ui(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ui)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,cY(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,pY(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(D1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return D1(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(av)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return av(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return av(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(zS)])):void 0;return{items:o.items.map(zS),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return hu(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Mu)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Mu(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const s=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Mu(s)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(gY)}async listProviders(){return(await this.http.get("/providers")).items.map(US)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return US(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return cv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return cv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return cv(t)}async getConfig(){const t=await this.http.get("/config");return B1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return B1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return hu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=F5(this.config.serverHttpUrl,this.config.clientId),s=NY(),o=new cQ(n,this.config.clientId,{onWireEvent:i=>{const r=vY(i),l=yY(i),a=mY(i);a.type==="historyCompacted"&&!tC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!tC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}function cv(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 nC;function pt(){return nC??=new uQ(O5()),nC}const dQ=["src","controls","muted"],fQ=["src","alt"],uv=qe({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=J(t.fileId?"":t.url),s=J(null),o=J(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(o.value)try{const f=await pt().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 Ve(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),yn(()=>{typeof IntersectionObserver=="function"&&s.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(s.value)):o.value=!0}),fs(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(w(),N("video",{key:0,ref_key:"mediaEl",ref:s,class:Re(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,dQ)):(w(),N("img",{key:1,ref_key:"mediaEl",ref:s,class:Re(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,fQ))}}),pQ=["aria-label"],hQ=120,mQ=60,gQ=qe({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*hQ}ms`,"--moon-frame-fast-delay":`${s*mQ}ms`}}return(s,o)=>(w(),N("span",{class:Re(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),N(Oe,null,tt(t,(i,r)=>x("span",{key:i,class:"ui-moon__frame",style:Qt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,pQ))}}),N3=dt(gQ,[["__scopeId","data-v-a6b7ec07"]]);function vQ(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const yQ={class:"chat"},kQ={key:0,class:"chat-loading"},bQ={class:"chat-loading-text"},_Q={key:1,class:"chat-empty"},wQ={key:1,class:"top-sentinel-text"},SQ={key:0,class:"u-turn"},CQ=["data-turn-id"],xQ={key:0,class:"u-imgs"},AQ=["aria-label","onClick"],TQ={key:1,class:"skill-act"},MQ={class:"skill-act-head"},EQ={key:0,class:"skill-act-args"},IQ={key:2,class:"skill-act"},$Q={class:"skill-act-head"},NQ={key:0,class:"skill-act-args"},LQ={key:3,class:"u-text"},OQ={key:0,class:"u-meta"},PQ=["aria-label","onClick"],RQ=["aria-label","onClick"],DQ=["onClick"],BQ=["data-turn-id"],FQ=["onClick"],HQ={class:"cd-view"},WQ={key:1,class:"cd-label"},zQ=["data-turn-id"],UQ={key:1,class:"msg"},jQ={key:0,class:"a-msg-ft"},qQ={key:0,class:"a-duration"},VQ=["aria-label","onClick"],KQ={key:4,class:"sending-placeholder"},GQ={key:5,class:"q-stack"},YQ={class:"q-head"},QQ={class:"q-title"},XQ={class:"q-hint"},ZQ=["onDragover","onDrop"],JQ={class:"u-bub q-bub"},eX=["title","onDragstart"],tX=["title","onClick"],nX={key:0,class:"u-text q-text"},sX={key:1,class:"q-text q-text-placeholder"},oX={key:0,class:"q-imgs"},iX={key:1,class:"q-tag q-tag-next"},rX={key:2,class:"q-tag q-tag-idx"},lX=["aria-label","onClick"],aX=2500,cX=qe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:s}=At(),{confirm:o}=ll();xn(()=>{X!==null&&(clearTimeout(X),X=null),U!==null&&(clearTimeout(U),U=null),M!==null&&(clearTimeout(M),M=null)});const i=e,r=J(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(ce=>{ce[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))}yn(a),xn(()=>{l?.disconnect(),l=null}),Ve(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{mt().then(a)});const c=B(()=>{if(!i.running||i.turns.length===0)return null;const ce=i.turns.at(-1);return ce.role==="assistant"?ce.id:null}),u=B(()=>i.sending||i.running),d=n,f=J(null),h=J(null);function p(ce){return(ce.attachments?.length??0)>0}function m(ce){d("editQueued",ce)}function _(ce,z){if(f.value=ce,!z.dataTransfer)return;z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",String(ce));const Y=z.currentTarget?.closest(".q-turn");Y&&z.dataTransfer.setDragImage(Y,24,24)}function b(ce,z){if(f.value===null)return;z.preventDefault(),z.dataTransfer&&(z.dataTransfer.dropEffect="move");const Y=z.currentTarget.getBoundingClientRect(),oe=z.clientY<Y.top+Y.height/2?"before":"after";h.value={index:ce,position:oe}}function g(ce,z){z.preventDefault();const Y=f.value,oe=h.value?.position??"before";if(f.value=null,h.value=null,Y===null)return;let W=oe==="before"?ce:ce+1;Y<W&&(W-=1),Y!==W&&d("reorderQueue",{from:Y,to:W})}function v(){f.value=null,h.value=null}const y=B(()=>{for(let ce=i.turns.length-1;ce>=0;ce--)if(i.turns[ce].role==="user")return i.turns[ce].id;return null});function T(ce){return ce.role==="user"&&ce.id===y.value&&!i.running&&!i.sending&&!ce.skillActivation&&!ce.pluginCommand}function P(ce){const z=ce.compaction,Y=z?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof z?.tokensBefore=="number"&&typeof z?.tokensAfter=="number"?Y+s("conversation.compactedTokens",{before:j_(z.tokensBefore),after:j_(z.tokensAfter)}):Y}const I=J(null),k=J(null);let M=null;const $=J(new Set);function L(ce){return $.value.has(ce)}function S(ce){const z=new Set($.value);z.has(ce)?z.delete(ce):z.add(ce),$.value=z}function E(ce,z){if(L(z)){const Y=new Date(ce);if(Number.isNaN(Y.getTime()))return ce;const oe=W=>String(W).padStart(2,"0");return`${Y.getFullYear()}-${oe(Y.getMonth()+1)}-${oe(Y.getDate())} ${oe(Y.getHours())}:${oe(Y.getMinutes())}`}return vQ(ce,s("conversation.yesterday"))}async function D(ce){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&R(ce)}function R(ce){k.value===null&&(k.value=ce.id,d("editMessage",{text:ce.text,images:ce.images}),M=setTimeout(()=>{M=null,k.value=null},aX))}Ve(()=>i.turns,ce=>{k.value!==null&&(ce.some(z=>z.id===k.value)||(k.value=null,M!==null&&(clearTimeout(M),M=null)))},{flush:"post"});const H=J(!1);let U=null;function G(){if(i.turns.length===0)return;const ce=[];for(const Y of i.turns){if(Y.role==="compaction"||Y.role==="cron")continue;const oe=Y.role==="user"?"User":"Assistant",W=JR(Y);W.trim()&&ce.push(`**${oe}**
|
|
256
|
+
|
|
257
|
+
${W}`)}const z=ce.join(`
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
`);js(z).then(Y=>{Y&&(H.value=!0,d("copyConversationCopied"),U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,H.value=!1},2e3))}).catch(()=>{})}function Q(ce){const z=[];for(let Y=ce;Y>=0;Y--){const oe=i.turns[Y];if(!oe||oe.role!=="assistant")break;z.unshift(oe)}return z}function V(ce){return Q(ce).map(z=>ZR(z)).filter(Boolean).join(`
|
|
262
|
+
|
|
263
|
+
`)}function re(){for(let ce=i.turns.length-1;ce>=0;ce-=1)if(i.turns[ce]?.role==="assistant")return V(ce);return""}function pe(){const ce=re();ce.trim()&&js(ce).then(z=>{z&&(H.value=!0,d("copyConversationCopied"),U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,H.value=!1},2e3))}).catch(()=>{})}t({copyConversation:G,copyFinalSummary:pe});function ne(ce){const z=i.turns[ce];if(!z||z.role!=="assistant")return!1;const Y=i.turns[ce+1];return!Y||Y.role!=="assistant"}let X=null;function he(ce){const z=i.turns[ce];if(!z)return;const Y=V(ce);Y.trim()&&js(Y).then(oe=>{oe&&(I.value=z.id,X!==null&&clearTimeout(X),X=setTimeout(()=>{X=null,I.value=null},1400))}).catch(()=>{})}function Pe(ce){const z=ce.text;z.trim()&&js(z).then(Y=>{Y&&(I.value=ce.id,X!==null&&clearTimeout(X),X=setTimeout(()=>{X=null,I.value=null},1400))}).catch(()=>{})}function je(ce){return{kind:"image",url:ce.url,path:ce.alt,fileId:ce.fileId}}function it(ce,z){return ce.id!==c.value?!1:z.sourceIndex===kh(ce).length-1}return(ce,z)=>(w(),N("div",yQ,[e.sessionLoading?(w(),N("div",kQ,[ie(ii,{size:"sm"}),x("span",bQ,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),N("div",_Q)):le("",!0),e.hasMoreMessages||e.loadingMore?(w(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Re(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),N("span",wQ,[ie(ii,{size:"sm"}),Ue(" "+O(C(s)("conversation.loadingOlder")),1)])):(w(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:z[0]||(z[0]=Y=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):le("",!0),(w(!0),N(Oe,null,tt(e.turns,(Y,oe)=>(w(),N(Oe,{key:Y.id},[Y.role==="user"?(w(),N("div",SQ,[x("div",{class:Re(["u-bub turn-anchor",{undoing:k.value===Y.id}]),"data-turn-id":Y.id},[Y.images&&Y.images.length>0?(w(),N("div",xQ,[(w(!0),N(Oe,null,tt(Y.images,(W,Z)=>(w(),N(Oe,{key:Z},[W.kind==="video"?(w(),ye(uv,{key:0,url:W.url,kind:"video","file-id":W.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(w(),N("button",{key:1,type:"button",class:"u-img-btn","aria-label":C(s)("filePreview.enlargeImage"),onClick:ue=>d("openMedia",je(W))},[ie(uv,{url:W.url,kind:"image",alt:W.alt,"file-id":W.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,AQ))],64))),128))])):le("",!0),Y.skillActivation?(w(),N("div",TQ,[x("div",MQ,[z[9]||(z[9]=x("span",{class:"skill-act-arrow"},"▶",-1)),x("span",null,O(C(s)("conversation.activatedSkill",{name:Y.skillActivation.name})),1)]),Y.skillActivation.args?(w(),N("div",EQ,O(Y.skillActivation.args),1)):le("",!0)])):Y.pluginCommand?(w(),N("div",IQ,[x("div",$Q,[z[10]||(z[10]=x("span",{class:"skill-act-arrow"},"▶",-1)),x("span",null,"/"+O(Y.pluginCommand.pluginId)+":"+O(Y.pluginCommand.commandName),1)]),Y.pluginCommand.args?(w(),N("div",NQ,O(Y.pluginCommand.args),1)):le("",!0)])):(w(),N("div",LQ,O(Y.text),1))],10,CQ),Y.createdAt||T(Y)?(w(),N("div",OQ,[T(Y)?(w(),N("div",{key:0,class:Re(["u-edit-wrap",{undoing:k.value===Y.id}])},[x("button",{type:"button",class:"u-edit","aria-label":C(s)("conversation.undoTooltip"),onClick:W=>D(Y)},[ie(Xe,{name:"undo",size:"sm"})],8,PQ)],2)):le("",!0),Y.text.trim().length>0?(w(),N("button",{key:1,type:"button",class:"u-copy","aria-label":C(s)("filePreview.copy"),onClick:vt(W=>Pe(Y),["stop"])},[I.value!==Y.id?(w(),ye(Xe,{key:0,name:"copy",size:"sm"})):(w(),ye(Xe,{key:1,name:"check",size:"sm"}))],8,RQ)):le("",!0),Y.createdAt?(w(),N("button",{key:2,type:"button",class:"u-time",onClick:vt(W=>S(Y.id),["stop"])},O(E(Y.createdAt,Y.id)),9,DQ)):le("",!0)])):le("",!0)])):Y.role==="compaction"?(w(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":Y.id,role:"separator"},[z[11]||(z[11]=x("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Y.text?(w(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:W=>d("openCompaction",{turnId:Y.id})},[x("span",null,O(P(Y)),1),x("span",HQ,O(C(s)("conversation.viewSummary")),1)],8,FQ)):(w(),N("span",WQ,O(P(Y)),1)),z[12]||(z[12]=x("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,BQ)):Y.role==="cron"?(w(),ye(HS,{key:2,text:Y.text,cron:Y.cron,"turn-id":Y.id},null,8,["text","cron","turn-id"])):(w(),N("div",{key:3,class:"a-msg turn-anchor","data-turn-id":Y.id},[(w(!0),N(Oe,null,tt(C(XR)(Y),(W,Z)=>(w(),N(Oe,{key:C(e7)(W,Z)},[W.kind==="thinking"?(w(),ye(WG,{key:0,text:W.thinking,mobile:"",streaming:it(Y,W),onOpen:ue=>d("openThinking",{turnId:Y.id,blockIndex:W.sourceIndex})},null,8,["text","streaming","onOpen"])):W.kind==="text"&&W.text?(w(),N("div",UQ,[ie(Fh,{text:W.text,streaming:it(Y,W),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])])):W.kind==="tool-stack"?(w(),ye(l7,{key:2,tools:W.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:z[1]||(z[1]=ue=>d("openMedia",ue)),onOpenFile:z[2]||(z[2]=ue=>d("openFile",ue)),onOpenToolDiff:z[3]||(z[3]=ue=>d("openToolDiff",ue)),onOpenAgent:z[4]||(z[4]=ue=>d("openAgent",ue))},null,8,["tools","tool-diff-panel"])):W.kind==="tool"?(w(),ye(zA,{key:3,tool:W.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:z[5]||(z[5]=ue=>d("openMedia",ue)),onOpenFile:z[6]||(z[6]=ue=>d("openFile",ue)),onOpenToolDiff:z[7]||(z[7]=ue=>d("openToolDiff",ue)),onOpenAgent:z[8]||(z[8]=ue=>d("openAgent",ue))},null,8,["tool","tool-diff-panel"])):W.kind==="cron"?(w(),ye(HS,{key:4,text:W.text,cron:W.cron},null,8,["text","cron"])):le("",!0)],64))),128)),Y.id!==c.value&&ne(oe)&&(V(oe).trim().length>0||Y.durationMs!==void 0)?(w(),N("div",jQ,[ie(qt,{text:`${Y.durationMs} ms`},{default:be(()=>[Y.durationMs!==void 0?(w(),N("span",qQ,O(C(GR)(Y.durationMs)),1)):le("",!0)]),_:2},1032,["text"]),V(oe).trim().length>0?(w(),N("button",{key:0,class:"a-cpbtn","aria-label":C(s)("filePreview.copy"),onClick:W=>he(oe)},[I.value!==Y.id?(w(),ye(Xe,{key:0,name:"copy",size:"sm"})):(w(),ye(Xe,{key:1,name:"check",size:"sm"}))],8,VQ)):le("",!0)])):le("",!0)],8,zQ))],64))),128)),e.compaction?(w(),ye(VG,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):le("",!0),u.value?(w(),N("div",KQ,[ie(N3,{fast:e.fastMoon},null,8,["fast"])])):le("",!0),e.queued.length>0?(w(),N("div",GQ,[x("div",YQ,[x("span",QQ,[ie(Xe,{name:"mail",size:"sm"}),Ue(" "+O(C(s)("composer.queueLabel"))+" · ",1),x("b",null,O(e.queued.length),1)]),x("span",XQ,O(C(s)("composer.queueAutoDrain")),1)]),(w(!0),N(Oe,null,tt(e.queued,(Y,oe)=>(w(),N("div",{key:oe,class:Re(["u-turn q-turn",{"q-dragging":f.value===oe,"drop-before":h.value?.index===oe&&h.value.position==="before","drop-after":h.value?.index===oe&&h.value.position==="after"}]),onDragover:W=>b(oe,W),onDrop:W=>g(oe,W)},[x("div",JQ,[x("span",{class:"q-grip",title:C(s)("composer.queueDragTitle"),draggable:"true",onDragstart:W=>_(oe,W),onDragend:v},[ie(Xe,{name:"grip",size:"sm"})],40,eX),x("button",{type:"button",class:"q-body",title:C(s)("composer.editQueued"),onClick:W=>m(oe)},[Y.text?(w(),N("span",nX,O(Y.text),1)):(w(),N("span",sX,[ie(Xe,{name:"image",size:"sm"}),Ue(" "+O(C(s)("composer.queuedImageOnly",{n:Y.attachments?.length??0})),1)]))],8,tX),p(Y)?(w(),N("div",oX,[(w(!0),N(Oe,null,tt(Y.attachments,(W,Z)=>(w(),ye(uv,{key:Z,url:W.url,kind:W.kind,"file-id":W.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):le("",!0),oe===0?(w(),N("span",iX,O(C(s)("composer.queueNext")),1)):(w(),N("span",rX,"#"+O(oe+1),1)),x("button",{type:"button",class:"q-rm","aria-label":C(s)("composer.remove"),onClick:vt(W=>d("unqueue",oe),["stop"])},[ie(Xe,{name:"close",size:"sm"})],8,lX)])],42,ZQ))),128))])):le("",!0)]))}}),L3=dt(cX,[["__scopeId","data-v-d3e18be3"]]),uX={class:"ch-id"},dX={key:0,class:"ch-ws"},fX={key:1,class:"ch-sep"},pX=["onKeydown"],hX={class:"ch-ses"},mX={key:0,class:"ch-pill ch-sync-pill"},gX={key:0,class:"ch-ahead"},vX={key:1,class:"ch-behind"},yX={key:1,class:"ch-pill ch-diff-pill"},kX={key:0,class:"ch-add"},bX={key:1,class:"ch-del"},_X=qe({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=At(),{confirm:s}=ll(),o=e,i=t,r=B(()=>o.ahead??0),l=B(()=>o.behind??0),a=B(()=>o.gitDiffStats?.totalAdditions??0),c=B(()=>o.gitDiffStats?.totalDeletions??0),u=B(()=>a.value>0||c.value>0),d=J(!1),f=J(null),h=J(null),p=J({});function m(R){const H=R.target;h.value?.el?.contains(H)||f.value?.el?.contains(H)||g()}function _(){g()}async function b(R){if(R.stopPropagation(),d.value){g();return}d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",_),await mt();const H=f.value?.el,U=h.value?.el;if(!H||!U)return;const G=H.getBoundingClientRect(),Q=4,V=8,re=U.offsetWidth,pe=U.offsetHeight;let ne=G.bottom+Q;ne+pe>window.innerHeight-V&&(ne=Math.max(V,G.top-pe-Q));let X=G.left;X+re>window.innerWidth-V&&(X=Math.max(V,G.right-re)),p.value={top:`${Math.round(ne)}px`,left:`${Math.round(X)}px`}}function g(){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",_)}xn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",_)});function v(){i("copyAll"),g()}function y(){i("copyFinalSummary"),g()}const T=J(!1);function P(){o.sessionId&&js(o.sessionId).then(R=>{R&&(T.value=!0,setTimeout(()=>{T.value=!1},1200))})}const I=J(!1),k=J(""),M=J(null);async function $(){if(g(),!!o.sessionId){I.value=!0,k.value=o.sessionTitle??"",await mt();try{M.value?.focus(),M.value?.select()}catch{}}}function L(){const R=k.value.trim();R&&o.sessionId&&R!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,R),I.value=!1}function S(){I.value=!1}function E(){o.sessionId&&(g(),i("forkSession",o.sessionId))}async function D(){o.sessionId&&(g(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(R,H)=>(w(),N("header",{class:Re(["chat-header",{"macos-desktop":C(RA)}])},[x("div",uX,[e.workspaceName?(w(),N("span",dX,O(e.workspaceName),1)):le("",!0),e.workspaceName&&e.sessionTitle?(w(),N("span",fX,"/")):le("",!0),I.value?_n((w(),N("input",{key:2,ref_key:"renameInputRef",ref:M,"onUpdate:modelValue":H[0]||(H[0]=U=>k.value=U),class:"ch-rename",type:"text",onKeydown:[pi(vt(L,["stop"]),["enter"]),pi(vt(S,["stop"]),["esc"])],onBlur:L,onClick:H[1]||(H[1]=vt(()=>{},["stop"]))},null,40,pX)),[[lo,k.value]]):e.sessionTitle?(w(),ye(qt,{key:3,text:e.sessionTitle},{default:be(()=>[x("span",hX,O(e.sessionTitle),1)]),_:1},8,["text"])):le("",!0)]),ie(wn,{ref_key:"kebabRef",ref:f,class:Re(["ch-act-more",{open:d.value}]),label:C(n)("header.options"),"aria-expanded":d.value,"aria-haspopup":"menu",onClick:H[2]||(H[2]=vt(U=>b(U),["stop"]))},{default:be(()=>[ie(Xe,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),d.value?(w(),ye(Wl,{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Qt(p.value),onClick:H[3]||(H[3]=vt(()=>{},["stop"]))},{default:be(()=>[ie(gn,{onClick:v},{default:be(()=>[Ue(O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ie(gn,{onClick:y},{default:be(()=>[Ue(O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),N(Oe,{key:0},[ie(gn,{separator:""}),ie(gn,{onClick:P},{default:be(()=>[Ue(O(T.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ie(gn,{onClick:$},{default:be(()=>[Ue(O(C(n)("header.renameSession")),1)]),_:1}),ie(gn,{onClick:E},{default:be(()=>[Ue(O(C(n)("header.forkSession")),1)]),_:1}),ie(gn,{danger:"",onClick:D},{default:be(()=>[Ue(O(C(n)("header.archiveSession")),1)]),_:1})],64)):le("",!0)]),_:1},8,["style"])):le("",!0),H[6]||(H[6]=x("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),N("button",{key:1,type:"button",class:"ch-git",onClick:H[4]||(H[4]=U=>i("openChanges"))},[x("span",{class:Re(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),r.value>0||l.value>0?(w(),N("span",mX,[r.value>0?(w(),N("span",gX,"↑"+O(r.value),1)):le("",!0),l.value>0?(w(),N("span",vX,"↓"+O(l.value),1)):le("",!0)])):le("",!0),u.value?(w(),N("span",yX,[a.value>0?(w(),N("span",kX,"+"+O(a.value),1)):le("",!0),c.value>0?(w(),N("span",bX,"-"+O(c.value),1)):le("",!0)])):le("",!0)])):le("",!0),e.pr?(w(),N("button",{key:2,type:"button",class:Re(["ch-pill ch-pr",`pr-${e.pr.state}`]),onClick:H[5]||(H[5]=U=>e.pr&&i("openPr",e.pr.url))},[ie(Xe,{name:"git-pull-request",size:"sm"}),x("span",null,"PR #"+O(e.pr.number)+" · "+O(e.pr.state),1)],2)):le("",!0)],2))}}),wX=dt(_X,[["__scopeId","data-v-39760f19"]]),SX={key:0,class:"slash-menu",role:"listbox"},CX=["aria-selected","onMouseenter","onMousedown"],xX={class:"slash-name"},AX={class:"slash-desc"},TX=qe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=J([]);return Ve(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),N("div",SX,[(w(!0),N(Oe,null,tt(e.items,(a,c)=>(w(),N("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Re(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:vt(u=>o("select",a),["prevent"])},[x("span",xX,O(a.name),1),x("span",AX,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,CX))),128))])):le("",!0)}}),MX=dt(TX,[["__scopeId","data-v-f60b70d9"]]),EX={class:"mention-menu",role:"listbox"},IX={key:0,class:"mention-state dim"},$X={key:1,class:"mention-state dim"},NX=["aria-selected","onMouseenter","onMousedown"],LX=["innerHTML"],OX={class:"mention-name"},PX={class:"mention-path"},RX=qe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),i=Na("folder","sm"),r=Na("code","sm"),l=Na("file-text","sm"),a=Na("image","sm"),c=Na("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 m=p.path;if(m.endsWith("/"))return i;const _=p.name||m.split("/").pop()||m,b=_.lastIndexOf("."),g=b>0?_.slice(b+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(w(),N("div",EX,[n.loading?(w(),N("div",IX,O(C(o)("mention.searching")),1)):n.items.length===0?(w(),N("div",$X,O(C(o)("mention.noMatch")),1)):(w(!0),N(Oe,{key:2},tt(n.items,(_,b)=>(w(),N("div",{key:_.path,class:Re(["mention-item",{active:b===n.activeIndex}]),role:"option","aria-selected":b===n.activeIndex,onMouseenter:g=>s("hover",b),onMousedown:vt(g=>s("select",_),["prevent"])},[x("span",{class:"mention-icon",innerHTML:h(_),"aria-hidden":"true"},null,8,LX),x("span",OX,O(_.name),1),x("span",PX,O(_.path),1)],42,NX))),128))]))}}),DX=dt(RX,[["__scopeId","data-v-f4d6b958"]]),O3=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function BX(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}function P3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...O3,...t]}function FX(e,t=O3){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function md(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 _y(e){return e?.supportEfforts??[]}function HX(e){return e[Math.floor(e.length/2)]}function W1(e){if(md(e)==="unsupported")return"off";const t=_y(e);return t.length>0?e?.defaultEffort??HX(t):"on"}function wy(e){const t=_y(e),n=md(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function z1(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function WX(e){return e!=="off"}function pc(e,t){if(e===void 0)return t;const n=md(e);if(n==="unsupported")return"off";if(t==="off")return n==="always-on"?W1(e):"off";const s=_y(e);return s.length>0?s.includes(t)?t:W1(e):"on"}function Sy(e,t){return t==="off"?"off":t==="on"?W1(e):t}const Wp=100;function zX(e){const t=ad(It.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const s=n.length>Wp?n.slice(-Wp):n,o={[e]:s};return kc(It.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function UX(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=J(zX(o())),r=B(()=>i.value[o()??""]??[]);let l=-1,a="";function c(b){const g=o();if(l=-1,!g)return;const v=b.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const T=[...y,v],P=T.length>Wp?T.slice(-Wp):T;i.value={...i.value,[g]:P},kc(It.inputHistory,i.value)}function u(){const b=n.value;return b?(b.selectionStart??0)===0:!1}function d(b){t.value=b,mt(()=>{const g=n.value;if(!g)return;s();const v=b.length;g.setSelectionRange(v,v)})}function f(){const b=r.value;if(b.length!==0){if(l===-1)a=t.value,l=b.length-1;else if(l>0)l-=1;else return;d(b[l])}}function h(){if(l===-1)return;const b=r.value;l<b.length-1?(l+=1,d(b[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function _(){return r.value.length>0}return Ve(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:_}}function jX(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=J(!1),c=J([]),u=J(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=FX(h,P3(o())),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 m=t.value.length;p.setSelectionRange(m,m),p.focus(),s()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function qX(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=J(!1),r=J([]),l=J(0),a=J(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const _=h.slice(m,p);return _.startsWith("@")?{token:_.slice(1),start:m,end:p}:null}function d(){const h=u(),p=o();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,mt(()=>{const _=n.value;if(!_)return;const b=p.start+h.path.length;_.setSelectionRange(b,b),_.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function VX(e){const{sessionId:t}=e;function n(c){return ts(E_(c))??""}function s(c,u){const d=E_(c);u?os(d,u):uc(d)}const o=J(n(t())),i=J(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ve(o,c=>{mt(r),s(t(),c)}),Ve(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),mt(r))});function l(c){o.value=c,mt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){s(t(),"")}return{text:o,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function KX(e){const{uploadImage:t,sessionId:n}=e,s=J({}),o=B(()=>s.value[n()??""]??[]),i=J(null),r=J(null),l=J(!1);let a=0;function c(){return`att_${++a}`}function u(L,S){s.value={...s.value,[L]:S}}function d(L){try{URL.revokeObjectURL(L.previewUrl)}catch{}}function f(L){return L.startsWith("image/")?"image":L.startsWith("video/")?"video":null}async function h(L){const S=t();if(!S)return;const E=n()??"",D=L.map(R=>({file:R,kind:f(R.type)})).filter(R=>R.kind!==null);if(D.length!==0)for(const{file:R,kind:H}of D){const U=c(),G=URL.createObjectURL(R),Q={localId:U,name:R.name,kind:H,previewUrl:G,uploading:!0};u(E,[...s.value[E]??[],Q]),S(R,R.name).then(V=>{const re=s.value[E]??[];u(E,re.map(pe=>pe.localId===U?{...pe,uploading:!1,fileId:V?.fileId,error:V===null}:pe))}).catch(()=>{const V=s.value[E]??[];u(E,V.map(re=>re.localId===U?{...re,uploading:!1,error:!0}:re))})}}function p(L){const S=n()??"",E=s.value[S]??[],D=E.find(R=>R.localId===L);i.value?.localId===L&&(i.value=null),D&&d(D),u(S,E.filter(R=>R.localId!==L))}function m(L){i.value=L}function _(){i.value=null}function b(){r.value?.click()}function g(L){const S=L.target,E=Array.from(S.files??[]);h(E),S.value=""}function v(L){if(!t())return;const S=L.clipboardData;if(!S)return;const E=[],D=new Set,R=(H,U)=>{const G=`${H.size}:${H.type}:${U}`;if(D.has(G))return;D.add(G);const Q=H.type.split("/")[1]??"png",V=U.includes(".")?U:`paste-${Date.now()}.${Q}`;E.push(H instanceof File?H:new File([H],V,{type:H.type}))};for(const H of Array.from(S.items))if(H.kind==="file"&&f(H.type)){const U=H.getAsFile();U&&R(U,U.name||`paste-${Date.now()}.${H.type.split("/")[1]??"png"}`)}for(const H of Array.from(S.files))f(H.type)&&R(H,H.name);E.length!==0&&(L.preventDefault(),h(E))}function y(L){!t()||!Array.from(L.dataTransfer?.items??[]).some(E=>E.kind==="file")||(L.preventDefault(),l.value=!0)}function T(){l.value=!1}function P(L){if(l.value=!1,!t())return;L.preventDefault();const S=Array.from(L.dataTransfer?.files??[]);h(S)}function I(){const L=n()??"";for(const S of s.value[L]??[])d(S);u(L,[])}function k(L,S,E){const D=s.value[L]??[];D.some(R=>R.localId===S)&&u(L,D.map(R=>R.localId===S?{...R,...E}:R))}function M(L){return fetch(L).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function $(L){const S=n()??"";for(const E of s.value[S]??[])d(E);u(S,[]);for(const E of L){const D=c(),R=/^data:/i.test(E.url),H=/^blob:/i.test(E.url),U=E.name??E.kind;if(E.fileId){const G={localId:D,name:U,kind:E.kind,previewUrl:E.url,uploading:!1,fileId:E.fileId};u(S,[...s.value[S]??[],G]),!R&&!H&&pt().getFileBlob(E.fileId).then(Q=>{const V=URL.createObjectURL(Q);if(!(s.value[S]??[]).some(pe=>pe.localId===D)){URL.revokeObjectURL(V);return}k(S,D,{previewUrl:V})}).catch(()=>{})}else{const G=t();if(!G)continue;const Q={localId:D,name:U,kind:E.kind,previewUrl:E.url,uploading:!0};u(S,[...s.value[S]??[],Q]),M(E.url).then(V=>{const re=U.includes(".")?U:`${U}.${V.type.split("/")[1]??"bin"}`;return G(V,re)}).then(V=>{if(V===null){const re=s.value[S]??[];u(S,re.filter(pe=>pe.localId!==D));return}k(S,D,{uploading:!1,fileId:V.fileId})}).catch(()=>{const V=s.value[S]??[];u(S,V.filter(re=>re.localId!==D))})}}}return Ve(n,()=>{i.value=null}),yn(()=>{document.addEventListener("paste",v)}),xn(()=>{document.removeEventListener("paste",v);for(const L of Object.values(s.value))for(const S of L)d(S);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:_,openFilePicker:b,handleFileInputChange:g,handleDragOver:y,handleDragLeave:T,handleDrop:P,clearAfterSubmit:I,loadAttachments:$}}const GX={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},YX=["stroke-dasharray","stroke-dashoffset"],dv=7,QX=qe({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*dv;return(s,o)=>(w(),N("svg",GX,[x("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:dv,fill:"none","stroke-width":"2.5"}),x("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:dv,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,YX)]))}}),XX=dt(QX,[["__scopeId","data-v-a364f1f1"]]),ZX={key:0,class:"att-strip"},JX=["onClick"],eZ=["src"],tZ=["src","alt"],nZ={key:2,class:"att-video-badge","aria-hidden":"true"},sZ={class:"att-name"},oZ={class:"att-err-icon"},iZ=["onClick"],rZ={class:"att-lightbox-card"},lZ=["src"],aZ=["src","alt"],cZ={class:"att-lightbox-name"},uZ={class:"composer-card"},dZ={class:"cin-wrap"},fZ={class:"input-row"},pZ=["placeholder"],hZ=["aria-label"],mZ={class:"toolbar-left"},gZ=["onKeydown"],vZ=["onClick"],yZ={class:"pd-check"},kZ={class:"pd-info"},bZ={class:"pd-desc"},_Z={class:"mode-label"},wZ={key:0,class:"mode-tag"},SZ={key:1,class:"mode-tag"},CZ={key:2,class:"mode-tag"},xZ={class:"mode-row-name"},AZ={class:"mode-row-name"},TZ={class:"mode-row-name"},MZ={key:0,class:"mode-row-actions"},EZ={class:"toolbar-right"},IZ=["aria-label"],$Z={class:"ctx-num"},NZ=["onKeydown"],LZ={key:0,class:"think-suffix"},OZ=["aria-label"],PZ=["aria-label"],RZ={key:0,class:"md-section"},DZ=["onClick"],BZ={class:"md-check"},FZ={class:"md-name"},HZ={class:"md-provider"},WZ={key:1,class:"md-divider"},zZ={key:2,class:"md-section"},UZ=["onClick"],jZ={class:"md-check"},qZ={class:"md-name"},VZ={key:3,class:"md-divider"},KZ={class:"md-name"},GZ={key:0,class:"md-note"},YZ=["aria-label"],QZ=["disabled","onClick"],XZ={class:"md-name"},sC=36,ZZ=qe({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=B(()=>s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=At(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=VX({sessionId:()=>s.sessionId}),f=J(!1);function h(){f.value=!f.value,mt(()=>{c(),b(),a.value?.focus()})}function p(){f.value&&(f.value=!1,mt(c))}function m(Ye){if(typeof getComputedStyle>"u")return sC;const et=Number.parseFloat(getComputedStyle(Ye).minHeight);return Number.isFinite(et)&&et>0?et:sC}const _=J(!1);function b(){const Ye=a.value;_.value=!!Ye&&Ye.scrollHeight>m(Ye)}Ve(l,()=>{mt(b)}),Ve(()=>s.sessionId,()=>{f.value=!1});const g=UX({text:l,textareaRef:a,autosize:c,sessionId:()=>s.sessionId}),{open:v,items:y,active:T,update:P,select:I}=jX({text:l,textareaRef:a,autosize:c,skills:()=>s.skills,emitCommand:Ye=>i("command",Ye),historyPush:Ye=>g.push(Ye),clearDraft:d}),{open:k,items:M,active:$,loading:L,update:S,select:E}=qX({text:l,textareaRef:a,autosize:c,searchFiles:()=>s.searchFiles});function D(){g.resetBrowsing(),P(),S()}const{attachments:R,previewAttachment:H,fileInputRef:U,isDragOver:G,removeAttachment:Q,openAttachmentPreview:V,closeAttachmentPreview:re,openFilePicker:pe,handleFileInputChange:ne,handleDragOver:X,handleDragLeave:he,handleDrop:Pe,clearAfterSubmit:je,loadAttachments:it}=KX({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});yn(()=>{l.value&&mt(()=>{c(),b()})}),xn(()=>{document.removeEventListener("mousedown",Mt),ue()});function ce(){a.value?.focus({preventScroll:!0})}function z(Ye){it(Ye)}t({loadForEdit:u,loadAttachmentsForEdit:z,focus:ce});function Y(){const Ye=l.value.trim();if(R.value.some(Bt=>Bt.uploading))return;const et=R.value.filter(Bt=>!Bt.uploading&&!Bt.error&&Bt.fileId);if(!Ye&&et.length===0)return;if(g.push(Ye),Ye){const Bt=BX(Ye),zo=Bt?P3(s.skills).some(Li=>Li.name===Bt.cmd):!1;if(Bt&&zo){l.value="",d(),v.value=!1,p(),i("command",Bt.arg?`${Bt.cmd} ${Bt.arg}`:Bt.cmd);return}}const st={text:Ye,attachments:et.map(Bt=>({fileId:Bt.fileId,kind:Bt.kind}))};H.value=null,je(),l.value="",d(),v.value=!1,k.value=!1,p(),i("submit",st)}function oe(){if(!s.running||R.value.some(Bt=>Bt.uploading))return;const Ye=l.value.trim(),et=R.value.filter(Bt=>!Bt.uploading&&!Bt.error&&Bt.fileId);if(!Ye&&et.length===0&&s.queued.length===0)return;const st={text:Ye,attachments:et.map(Bt=>({fileId:Bt.fileId,kind:Bt.kind}))};je(),g.push(Ye),l.value="",d(),v.value=!1,k.value=!1,p(),i("steer",st)}let W=!1,Z=null;function ue(){Z!==null&&(clearTimeout(Z),Z=null)}function ae(){ue(),W=!0}function me(){ue(),Z=setTimeout(()=>{Z=null,W=!1},0)}function j(Ye){return W||Ye.isComposing||Ye.keyCode===229}function ee(Ye){if(!j(Ye)){if(Ye.key==="Escape"){if(Ae.value){Ye.preventDefault(),Ke();return}if(Ie.value){Ye.preventDefault(),yt();return}}if(v.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),T.value=(T.value+1)%y.value.length;return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),T.value=(T.value-1+y.value.length)%y.value.length;return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const et=y.value[T.value];et&&I(et);return}if(Ye.key==="Escape"){Ye.preventDefault(),v.value=!1;return}}if(k.value&&!L.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),$.value=($.value+1)%Math.max(1,M.value.length);return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),$.value=($.value-1+Math.max(1,M.value.length))%Math.max(1,M.value.length);return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const et=M.value[$.value];et&&E(et);return}if(Ye.key==="Escape"){Ye.preventDefault(),k.value=!1;return}}if(Ye.key==="s"&&(Ye.ctrlKey||Ye.metaKey)&&!Ye.shiftKey&&!Ye.altKey){s.running&&(Ye.preventDefault(),oe());return}if(!f.value&&!v.value&&!k.value&&!Ye.shiftKey&&!Ye.altKey&&!Ye.metaKey&&!Ye.ctrlKey){const et=g.isBrowsing();if(Ye.key==="ArrowUp"&&g.hasHistory()&&(et||g.caretAtTextStart())){Ye.preventDefault(),g.recallOlder();return}if(Ye.key==="ArrowDown"&&et){Ye.preventDefault(),g.recallNewer();return}}if(Ye.key==="Enter"&&!Ye.shiftKey){if(f.value&&!(Ye.metaKey||Ye.ctrlKey))return;Ye.preventDefault(),Y()}}}const fe=B(()=>r("composer.send")),ke=B(()=>!!s.uploadImage),Ae=J(!1),Ie=J(!1),de=J(null);function Me(){Ae.value=!Ae.value,Ae.value?(Ie.value=!1,An(),document.addEventListener("click",kt,!0)):document.removeEventListener("click",kt,!0)}function Ke(){Ae.value=!1,Ie.value||document.removeEventListener("click",kt,!0)}function lt(){Ie.value=!Ie.value,Ie.value?(Ae.value=!1,An(),document.addEventListener("click",kt,!0)):document.removeEventListener("click",kt,!0)}function yt(){Ie.value=!1,Ae.value||document.removeEventListener("click",kt,!0)}function kt(Ye){de.value&&!de.value.contains(Ye.target)&&(Ke(),yt())}xn(()=>{document.removeEventListener("click",kt,!0)});const Tt=Ye=>`${Math.round(Ye/1e3)}k`,Pt=B(()=>{const Ye=s.status?.ctxMax??0;return Ye<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Ye*100)))}),_t=B(()=>{const Ye=(s.status?.ctxUsed??0).toLocaleString(),et=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ye,max:et,pct:Pt.value})}),Vt=B(()=>Pt.value>=80),cn=B(()=>{const Ye=s.status?.modelId??s.status?.model??"";return s.models?.find(et=>et.id===Ye||et.model===Ye||et.displayName===s.status?.model)}),is=B(()=>md(cn.value)),Rt=B(()=>wy(cn.value)),tn=B(()=>pc(cn.value,s.thinking??"off")),xs=B(()=>{const Ye=Rt.value,et=tn.value;return Ye.includes(et)?et:Ye.includes("on")?"on":Ye[0]??"off"}),ot=B(()=>is.value==="always-on"?!0:is.value==="unsupported"?!1:WX(tn.value)),Fn=B(()=>is.value==="unsupported"||Rt.value.length<=1),kn=B(()=>{if(!ot.value)return"";const Ye=(cn.value?.supportEfforts?.length??0)>0,et=tn.value;return Ye&&et!=="on"?r("composer.thinkingSuffixEffort",{level:et}):r("composer.thinkingSuffix")});function Gn(Ye){Fn.value||i("setThinking",Sy(cn.value,Ye))}const Hn=B(()=>s.planMode===!0),Ln=B(()=>s.swarmMode===!0),rs=B(()=>s.activationBadges?.goal!==null),Ge=B(()=>rs.value||s.goalMode===!0),Qe=J(!1),Dt=J(null),Xt=J(null),Zt=J({}),Jt=B(()=>Hn.value||Ln.value||Ge.value);function An(){Qe.value=!1,document.removeEventListener("mousedown",Mt)}function Mt(Ye){const et=Ye.target;Dt.value?.contains(et)||Xt.value?.contains(et)||An()}function Yn(){if(Qe.value){An();return}Ke(),yt();const Ye=Dt.value?.getBoundingClientRect();Ye&&(Zt.value={left:`${Math.round(Ye.left)}px`,bottom:`${Math.round(window.innerHeight-Ye.top+8)}px`}),Qe.value=!0,setTimeout(()=>document.addEventListener("mousedown",Mt),0)}const Ht=[{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"}];function ks(Ye){i("setPermission",Ye),yt()}const bs=B(()=>Ht.find(Ye=>Ye.mode===s.status?.permission)),Fo=B(()=>bs.value?r(bs.value.labelKey):""),Rs=B(()=>cn.value?.provider??""),wo=B(()=>!Rs.value||!s.models?.length?[]:s.models.filter(Ye=>Ye.provider===Rs.value)),ao=B(()=>new Set(s.starredIds??[]));function Nt(Ye){return ao.value.has(Ye)}const Ho=B(()=>s.models?.length?s.models.filter(Ye=>Nt(Ye.id)&&Ye.provider!==Rs.value):[]);function Wo(Ye){i("selectModel",Ye),Ke()}return(Ye,et)=>(w(),N("div",{class:Re(["composer",{"drag-over":C(G),expanded:f.value}]),onDragover:et[17]||(et[17]=(...st)=>C(X)&&C(X)(...st)),onDragleave:et[18]||(et[18]=(...st)=>C(he)&&C(he)(...st)),onDrop:et[19]||(et[19]=(...st)=>C(Pe)&&C(Pe)(...st))},[C(R).length>0?(w(),N("div",ZX,[(w(!0),N(Oe,null,tt(C(R),st=>(w(),N("div",{key:st.localId,class:Re(["att-chip",{"att-error":st.error}])},[ie(qt,{text:C(r)("composer.previewAttachment",{name:st.name})},{default:be(()=>[x("button",{type:"button",class:"att-preview",onClick:Bt=>C(V)(st)},[st.kind==="video"?(w(),N("video",{key:0,class:"att-thumb",src:st.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,eZ)):(w(),N("img",{key:1,class:"att-thumb",src:st.previewUrl,alt:st.name},null,8,tZ)),st.kind==="video"?(w(),N("span",nZ,[ie(Xe,{name:"play",size:"sm"})])):le("",!0)],8,JX)]),_:2},1032,["text"]),x("span",sZ,O(st.name),1),st.uploading?(w(),ye(ii,{key:0,size:"sm",label:C(r)("composer.uploading")},null,8,["label"])):st.error?(w(),ye(qt,{key:1,text:C(r)("composer.uploadFailed")},{default:be(()=>[x("span",oZ,[ie(Xe,{name:"info",size:"sm"})])]),_:1},8,["text"])):le("",!0),ie(qt,{text:C(r)("composer.removeNamed",{name:st.name})},{default:be(()=>[x("button",{class:"att-rm",onClick:Bt=>C(Q)(st.localId)},[ie(Xe,{name:"close",size:"sm"})],8,iZ)]),_:2},1032,["text"])],2))),128))])):le("",!0),C(H)?(w(),N("div",{key:1,class:"att-lightbox",onClick:et[1]||(et[1]=vt((...st)=>C(re)&&C(re)(...st),["self"]))},[x("div",rZ,[ie(qt,{text:C(r)("model.close")},{default:be(()=>[x("button",{type:"button",class:"att-lightbox-close",onClick:et[0]||(et[0]=(...st)=>C(re)&&C(re)(...st))},"✕")]),_:1},8,["text"]),C(H).kind==="video"?(w(),N("video",{key:0,class:"att-lightbox-media",src:C(H).previewUrl,controls:"",playsinline:""},null,8,lZ)):(w(),N("img",{key:1,class:"att-lightbox-media",src:C(H).previewUrl,alt:C(H).name},null,8,aZ)),x("div",cZ,O(C(H).name),1)])])):le("",!0),x("div",uZ,[x("div",dZ,[C(v)?(w(),ye(MX,{key:0,items:C(y),"active-index":C(T),onSelect:C(I),onHover:et[2]||(et[2]=st=>T.value=st)},null,8,["items","active-index","onSelect"])):le("",!0),C(k)?(w(),ye(DX,{key:1,items:C(M),"active-index":C($),loading:C(L),onSelect:C(E),onHover:et[3]||(et[3]=st=>$.value=st)},null,8,["items","active-index","loading","onSelect"])):le("",!0),x("div",fZ,[_n(x("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":et[4]||(et[4]=st=>ss(l)?l.value=st:null),class:"ph",placeholder:o.value,rows:"1",onKeydown:ee,onCompositionstart:ae,onCompositionend:me,onInput:D},null,40,pZ),[[lo,C(l)]]),f.value||_.value?(w(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:h},[f.value?(w(),ye(Xe,{key:0,name:"collapse",size:"sm"})):(w(),ye(Xe,{key:1,name:"expand",size:"sm"}))],8,hZ)):le("",!0)])]),ke.value?(w(),N("input",{key:0,ref_key:"fileInputRef",ref:U,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:et[5]||(et[5]=(...st)=>C(ne)&&C(ne)(...st))},null,544)):le("",!0),x("div",{ref_key:"toolbarRef",ref:de,class:"toolbar"},[x("div",mZ,[ke.value?(w(),ye(wn,{key:0,size:"md",label:C(r)("composer.attachImage"),onClick:C(pe)},{default:be(()=>[ie(Xe,{name:"image"})]),_:1},8,["label","onClick"])):le("",!0),e.status?(w(),N("span",{key:1,class:Re(["perm-pill",["perm-"+e.status.permission,{open:Ie.value}]]),role:"button",tabindex:"0",onClick:vt(lt,["stop"]),onKeydown:[pi(lt,["enter"]),pi(vt(lt,["prevent"]),["space"])]},O(Fo.value),43,gZ)):le("",!0),Ie.value&&e.status?(w(),N("div",{key:2,class:"perm-dropdown",role:"menu",onClick:et[6]||(et[6]=vt(()=>{},["stop"]))},[(w(),N(Oe,null,tt(Ht,st=>x("button",{key:st.mode,class:Re(["pd-row",{"is-current":st.mode===e.status.permission}]),role:"menuitem",onClick:Bt=>ks(st.mode)},[x("span",yZ,[st.mode===e.status.permission?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):le("",!0)]),x("span",kZ,[x("span",{class:"pd-name",style:Qt({color:st.color})},O(C(r)(st.labelKey)),5),x("span",bZ,O(C(r)(st.descKey)),1)])],10,vZ)),64))])):le("",!0),e.status?(w(),N("div",{key:3,ref_key:"modesRef",ref:Dt,class:"modes"},[x("button",{type:"button",class:Re(["mode-pill",{on:Jt.value,open:Qe.value}]),onClick:vt(Yn,["stop"])},[x("span",_Z,O(C(r)("status.modesLabel")),1),Hn.value?(w(),N("span",wZ,O(C(r)("status.planLabel")),1)):le("",!0),Ln.value?(w(),N("span",SZ,O(C(r)("status.swarmLabel")),1)):le("",!0),Ge.value?(w(),N("span",CZ,O(C(r)("status.goalLabel")),1)):le("",!0)],2),Qe.value?(w(),N("div",{key:0,ref_key:"modesMenuRef",ref:Xt,class:"modes-menu",style:Qt(Zt.value)},[x("button",{type:"button",class:Re(["mode-row",{on:Hn.value}]),onClick:et[7]||(et[7]=st=>i("togglePlan"))},[x("span",xZ,O(C(r)("status.planLabel")),1),x("span",{class:Re(["mode-switch",{on:Hn.value}])},[...et[20]||(et[20]=[x("span",{class:"mode-knob"},null,-1)])],2)],2),x("button",{type:"button",class:Re(["mode-row",{on:Ln.value}]),onClick:et[8]||(et[8]=st=>i("toggleSwarm"))},[x("span",AZ,O(C(r)("status.swarmLabel")),1),x("span",{class:Re(["mode-switch",{on:Ln.value}])},[...et[21]||(et[21]=[x("span",{class:"mode-knob"},null,-1)])],2)],2),x("div",{class:Re(["mode-row mode-row-goal",{on:rs.value||s.goalMode}])},[x("button",{type:"button",class:"mode-row-main",onClick:et[9]||(et[9]=st=>rs.value?i("controlGoal","cancel"):i("toggleGoal"))},[x("span",TZ,O(C(r)("status.goalLabel")),1),rs.value?le("",!0):(w(),N("span",{key:0,class:Re(["mode-switch",{on:s.goalMode}])},[...et[22]||(et[22]=[x("span",{class:"mode-knob"},null,-1)])],2))]),rs.value?(w(),N("div",MZ,[x("button",{type:"button",class:"mode-row-action",onClick:et[10]||(et[10]=st=>i("controlGoal","pause"))},O(C(r)("status.goalPause")),1),x("button",{type:"button",class:"mode-row-action",onClick:et[11]||(et[11]=st=>i("controlGoal","resume"))},O(C(r)("status.goalResume")),1)])):le("",!0)],2)],4)):le("",!0)],512)):le("",!0)]),x("div",EZ,[Vt.value?(w(),N("button",{key:0,class:"compact-chip",onClick:et[12]||(et[12]=vt(st=>i("compact"),["stop"]))},"/compact")):le("",!0),ie(qt,{text:_t.value},{default:be(()=>[e.status&&!e.hideContext?(w(),N("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":_t.value},[ie(XX,{pct:Pt.value},null,8,["pct"]),x("span",$Z,O(Tt(e.status.ctxUsed))+"/"+O(Tt(e.status.ctxMax)),1)],8,IZ)):le("",!0)]),_:1},8,["text"]),e.status?(w(),N("span",{key:1,class:Re(["model-pill",{open:Ae.value}]),role:"button",tabindex:"0",onClick:vt(Me,["stop"]),onKeydown:[pi(Me,["enter"]),pi(vt(Me,["prevent"]),["space"])]},[x("b",null,O(e.status.model),1),kn.value?(w(),N("span",LZ,O(kn.value),1)):le("",!0),ie(Xe,{class:"cv",name:"chevron-down",size:"sm"})],42,NZ)):le("",!0),e.running?(w(),ye(qt,{key:2,text:C(r)("composer.interruptTitle")},{default:be(()=>[x("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:et[13]||(et[13]=st=>i("interrupt"))},[ie(Xe,{name:"stop",size:"sm"})],8,OZ)]),_:1},8,["text"])):le("",!0),x("button",{class:"send","aria-label":fe.value,onClick:et[14]||(et[14]=st=>Y())},[ie(Xe,{name:"send",size:"sm"})],8,PZ)]),Ae.value&&e.status?(w(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:et[16]||(et[16]=vt(()=>{},["stop"]))},[Ho.value.length>0?(w(),N("div",RZ,O(C(r)("status.starredModels")),1)):le("",!0),(w(!0),N(Oe,null,tt(Ho.value,st=>(w(),N("button",{key:st.id,class:Re(["md-row",{"is-current":st.id===e.status.modelId}]),role:"menuitem",onClick:Bt=>Wo(st.id)},[x("span",BZ,[st.id===e.status.model||st.model===e.status.model||st.displayName===e.status.model?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):le("",!0)]),x("span",FZ,O(st.displayName??st.model),1),x("span",HZ,O(st.provider),1),ie(Xe,{class:"md-star",name:"star",size:"sm"})],10,DZ))),128)),Ho.value.length>0?(w(),N("div",WZ)):le("",!0),wo.value.length>0?(w(),N("div",zZ,O(Rs.value),1)):le("",!0),(w(!0),N(Oe,null,tt(wo.value,st=>(w(),N("button",{key:st.id,class:Re(["md-row",{"is-current":st.id===e.status.modelId}]),role:"menuitem",onClick:Bt=>Wo(st.id)},[x("span",jZ,[st.id===e.status.model||st.model===e.status.model||st.displayName===e.status.model?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):le("",!0)]),x("span",qZ,O(st.displayName??st.model),1),Nt(st.id)?(w(),ye(Xe,{key:0,class:"md-star",name:"star",size:"sm"})):le("",!0)],10,UZ))),128)),wo.value.length>0?(w(),N("div",VZ)):le("",!0),x("div",{class:Re(["md-thinking",{"is-readonly":Fn.value}])},[x("span",KZ,O(C(r)("status.thinkingLabel")),1),is.value==="unsupported"?(w(),N("span",GZ,O(C(r)("status.modeNotSupported")),1)):(w(),N("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(w(!0),N(Oe,null,tt(Rt.value,st=>(w(),N("button",{key:st,type:"button",class:Re(["effort-seg",{"is-active":st===xs.value}]),disabled:Fn.value,onClick:Bt=>Gn(st)},O(C(z1)(st)),11,QZ))),128))],8,YZ))],2),et[23]||(et[23]=x("div",{class:"md-divider"},null,-1)),x("button",{class:"md-row md-row-more",role:"menuitem",onClick:et[15]||(et[15]=st=>{Ke(),i("pickModel")})},[x("span",XZ,O(C(r)("status.moreModels")),1)])])):le("",!0)],512)])],34))}}),R3=dt(ZZ,[["__scopeId","data-v-62d29906"]]),JZ={key:0,class:"ui-card__head"},eJ={class:"ui-card__body"},tJ={key:1,class:"ui-card__foot"},nJ=qe({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),N("div",JZ,[Nn(t.$slots,"head",{},void 0,!0)])):le("",!0),x("div",eJ,[Nn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),N("div",tJ,[Nn(t.$slots,"foot",{},void 0,!0)])):le("",!0)],2))}}),Cy=dt(nJ,[["__scopeId","data-v-9c9f9a9a"]]),sJ=["type","disabled"],oJ={class:"ui-button__content"},iJ=qe({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),N("button",{class:Re(["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(),ye(ii,{key:0,size:"sm",class:"ui-button__spinner"})):le("",!0),x("span",oJ,[Nn(t.$slots,"default",{},void 0,!0)])],10,sJ))}}),Ot=dt(iJ,[["__scopeId","data-v-e58393a8"]]),rJ={class:"goal-progress","aria-hidden":"true"},lJ={class:"goal-full"},aJ={key:0,class:"goal-criterion"},cJ={class:"goal-stats"},uJ={class:"goal-actions"},dJ=qe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),i=J(!1);Ve(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=B(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(w(),ye(Cy,{class:Re(["goal-strip",{expanded:i.value}])},l0({head:be(()=>[x("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[4]||(c[4]=x("span",{class:"goal-kicker"},"Goal",-1)),x("span",{class:Re(["goal-objective",{"expanded-hidden":i.value}])},O(e.goal.objective),3),ie(Ns,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:be(()=>[Ue(O(e.goal.status),1)]),_:1},8,["variant"]),x("span",rJ,[x("span",{class:"goal-progress-fill",style:Qt({width:`${r.value}%`})},null,4)]),ie(Xe,{class:Re(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:be(()=>[x("div",lJ,O(e.goal.objective),1),e.goal.completionCriterion?(w(),N("div",aJ,[c[5]||(c[5]=x("span",null,"Done when",-1)),x("p",null,O(e.goal.completionCriterion),1)])):le("",!0),x("div",cJ,[ie(Ns,{variant:"neutral",size:"sm"},{default:be(()=>[Ue(O(e.goal.turnsUsed)+" turns",1)]),_:1}),ie(Ns,{variant:"neutral",size:"sm"},{default:be(()=>[Ue(O(e.goal.tokensUsed.toLocaleString())+" tokens",1)]),_:1}),ie(Ns,{variant:"neutral",size:"sm"},{default:be(()=>[Ue(O(l(e.goal.wallClockMs)),1)]),_:1}),e.goal.budget.tokenBudget!==null?(w(),ye(Ns,{key:0,variant:"neutral",size:"sm"},{default:be(()=>[Ue(O(r.value)+"% token budget",1)]),_:1})):le("",!0)])]),key:"0"}:void 0,i.value?{name:"foot",fn:be(()=>[x("div",uJ,[e.goal.status!=="paused"?(w(),ye(Ot,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:c[1]||(c[1]=vt(u=>s("controlGoal","pause"),["stop"]))},{default:be(()=>[Ue(O(C(o)("status.goalPause")),1)]),_:1})):le("",!0),e.goal.status==="paused"?(w(),ye(Ot,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:c[2]||(c[2]=vt(u=>s("controlGoal","resume"),["stop"]))},{default:be(()=>[Ue(O(C(o)("status.goalResume")),1)]),_:1})):le("",!0),ie(Ot,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:c[3]||(c[3]=vt(u=>s("controlGoal","cancel"),["stop"]))},{default:be(()=>[Ue(O(C(o)("status.goalCancel")),1)]),_:1})])]),key:"1"}:void 0]),1032,["class"]))}}),fJ=dt(dJ,[["__scopeId","data-v-eaeefe1e"]]),pJ={class:"qh"},hJ={class:"qtitle"},mJ={key:0,class:"qstep"},gJ={key:1,class:"qmin-peek"},vJ={class:"qbody"},yJ=["aria-label"],kJ=["aria-selected","aria-label","onClick"],bJ={class:"qstep-num"},_J={key:1,class:"qheader-chip"},wJ={class:"qtext"},SJ={class:"qopts"},CJ=["onClick"],xJ={class:"qopt-key"},AJ={class:"qopt-glyph"},TJ={key:0,class:"chk"},MJ={key:1,class:"rad"},EJ={class:"qopt-text"},IJ={class:"qopt-label"},$J={key:0,class:"qopt-desc"},NJ={class:"qopt-glyph"},LJ={key:0,class:"chk"},OJ={key:1,class:"rad"},PJ={class:"qopt-label"},RJ=["placeholder"],DJ={class:"qfoot"},BJ=qe({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=At(),o=t,i=J(0),r=J(!1),l=B(()=>n.question.questions[i.value]),a=B(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(H){H>=0&&H<a.value&&(i.value=H)}function f(H){const U=p.value[H];return U?U.kind==="multi"?U.optionIds.length>0:U.kind==="multiWithOther"?U.optionIds.length>0||U.otherText.trim().length>0:U.kind==="other"?U.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=J({});function m(H){return H.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${H.label} ${H.description??""}`.toLowerCase())}function _(){const H={...p.value};let U=!1;for(const G of n.question.questions){if(H[G.id])continue;const Q=G.options.filter(m);Q.length!==0&&(H[G.id]=G.multiSelect?{kind:"multi",optionIds:Q.map(V=>V.id)}:{kind:"single",optionId:Q[0].id},U=!0)}U&&(p.value=H)}Ve(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Ve(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function b(H,U){const G=p.value[H];if(G&&G.kind==="single"&&G.optionId===U){const Q={...p.value};delete Q[H],p.value=Q}else p.value={...p.value,[H]:{kind:"single",optionId:U}}}function g(H,U){const G=p.value[H],Q=G&&(G.kind==="multi"||G.kind==="multiWithOther")?G.kind==="multi"?[...G.optionIds]:[...G.optionIds]:[],V=Q.indexOf(U);V>=0?Q.splice(V,1):Q.push(U);const re=p.value[H],pe=re&&re.kind==="multiWithOther"?re.otherText:"";pe?p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:Q,otherText:pe}}:p.value={...p.value,[H]:{kind:"multi",optionIds:Q}}}const v=J({}),y=J(null);function T(H){const U=n.question.questions.find(Q=>Q.id===H),G=v.value[H]??"";if(U.multiSelect){const Q=p.value[H],V=Q&&(Q.kind==="multi"||Q.kind==="multiWithOther")?Q.kind==="multi"?[...Q.optionIds]:[...Q.optionIds]:[];p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:V,otherText:G}}}else p.value={...p.value,[H]:{kind:"other",text:G}}}function P(H){T(H),mt(()=>y.value?.focus())}function I(H,U){const G=p.value[H];return G?G.kind==="single"?G.optionId===U:G.kind==="multi"||G.kind==="multiWithOther"?G.optionIds.includes(U):!1:!1}function k(H){const U=p.value[H];return!!(U&&(U.kind==="other"||U.kind==="multiWithOther"))}function M(){return n.question.questions.every(H=>f(H.id))}const $=B(()=>n.busyKind==="answer"),L=B(()=>n.busyKind==="dismiss"),S=B(()=>!!n.busyKind);function E(){if(S.value||!M())return;const H={answers:p.value,method:"click"};o("answer",n.question.questionId,H)}function D(){S.value||o("dismiss",n.question.questionId)}function R(H){const U=(document.activeElement?.tagName??"").toLowerCase(),G=U==="input"||U==="textarea";if(S.value)return;if(H.key==="Enter"){if(H.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():M()&&E();return}if(G)return;if(H.key==="Escape"){H.preventDefault(),D();return}if(r.value)return;const Q=parseInt(H.key,10);if(!isNaN(Q)&&Q>=1&&Q<=9){H.preventDefault();const V=l.value,re=Q-1,pe=V.options[re];pe&&(V.multiSelect?g(V.id,pe.id):b(V.id,pe.id))}}return yn(()=>document.addEventListener("keydown",R)),xn(()=>document.removeEventListener("keydown",R)),(H,U)=>(w(),ye(Cy,{class:Re(["qcard",{minimized:r.value}])},l0({head:be(()=>[x("div",pJ,[U[5]||(U[5]=x("span",{class:"qh-ic"},"?",-1)),x("span",hJ,O(C(s)("question.title")),1),a.value>1&&!r.value?(w(),N("span",mJ,O(C(s)("question.step",{current:i.value+1,total:a.value})),1)):le("",!0),r.value?(w(),N("span",gJ,O(l.value.question),1)):le("",!0),ie(wn,{class:"qmin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:U[0]||(U[0]=G=>r.value=!r.value)},{default:be(()=>[r.value?(w(),ye(Xe,{key:0,name:"chevron-down",size:"md"})):(w(),ye(Xe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:be(()=>[x("div",vJ,[a.value>1?(w(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(s)("question.step",{current:i.value+1,total:a.value})},[(w(!0),N(Oe,null,tt(n.question.questions,(G,Q)=>(w(),N("button",{key:G.id,type:"button",class:Re(["qstep-dot",{active:Q===i.value,answered:f(G.id)}]),"aria-selected":Q===i.value,"aria-label":C(s)("question.step",{current:Q+1,total:a.value}),onClick:V=>d(Q)},[x("span",bJ,O(Q+1),1)],10,kJ))),128))],8,yJ)):le("",!0),l.value.header?(w(),N("div",_J,[ie(Ns,{variant:"neutral",size:"sm"},{default:be(()=>[Ue(O(l.value.header),1)]),_:1})])):le("",!0),x("div",wJ,O(l.value.question),1),l.value.body?(w(),ye(Fh,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):le("",!0),x("div",SJ,[(w(!0),N(Oe,null,tt(l.value.options,(G,Q)=>(w(),N("label",{key:G.id,class:Re(["qopt",{selected:I(l.value.id,G.id)}]),onClick:vt(V=>l.value.multiSelect?g(l.value.id,G.id):b(l.value.id,G.id),["prevent"])},[x("span",xJ,O(Q+1),1),x("span",AJ,[l.value.multiSelect?(w(),N("span",TJ,O(I(l.value.id,G.id)?"■":"□"),1)):(w(),N("span",MJ,O(I(l.value.id,G.id)?"●":"○"),1))]),x("span",EJ,[x("span",IJ,O(G.label),1),G.description?(w(),N("span",$J,O(G.description),1)):le("",!0)])],10,CJ))),128)),l.value.allowOther?(w(),N("label",{key:0,class:Re(["qopt",{selected:k(l.value.id)}]),onClick:U[4]||(U[4]=vt(G=>P(l.value.id),["prevent"]))},[U[6]||(U[6]=x("span",{class:"qopt-key"},null,-1)),x("span",NJ,[l.value.multiSelect?(w(),N("span",LJ,O(k(l.value.id)?"■":"□"),1)):(w(),N("span",OJ,O(k(l.value.id)?"●":"○"),1))]),x("span",PJ,O(l.value.otherLabel??C(s)("question.otherDefault")),1),_n(x("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":U[1]||(U[1]=G=>v.value[l.value.id]=G),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:U[2]||(U[2]=G=>T(l.value.id)),onFocus:U[3]||(U[3]=G=>T(l.value.id))},null,40,RJ),[[lo,v.value[l.value.id]]])],2)):le("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:be(()=>[x("div",DJ,[i.value<a.value-1?(w(),ye(Ot,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:be(()=>[Ue(O(C(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),ye(Ot,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!M(),loading:$.value,onClick:E},{default:be(()=>[Ue(O(C(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),ye(Ot,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:be(()=>[Ue(O(C(s)("question.back")),1)]),_:1},8,["disabled"])):le("",!0),ie(Ot,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:L.value,disabled:S.value,onClick:D},{default:be(()=>[Ue(O(C(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),FJ=dt(BJ,[["__scopeId","data-v-08fbd85e"]]),HJ={class:"ah"},WJ={class:"akind"},zJ={class:"apath"},UJ={class:"ah-path"},jJ={key:1,class:"diff"},qJ={class:"dg"},VJ={class:"dc"},KJ={key:2,class:"body-shell"},GJ={class:"shell-cmd"},YJ={key:0,class:"shell-cwd"},QJ={key:1,class:"shell-danger"},XJ={key:3,class:"body-file"},ZJ={class:"file-bar"},JJ={class:"file-lang"},eee={class:"file-content"},tee={class:"file-ln"},nee={class:"file-text"},see={key:4,class:"body-chip"},oee={class:"chip-label"},iee={class:"chip-value"},ree={key:0,class:"chip-detail"},lee={key:5,class:"body-chip"},aee={key:0,class:"chip-label"},cee={class:"chip-value"},uee={key:6,class:"body-chip"},dee={class:"chip-label"},fee={class:"chip-value"},pee={key:0,class:"chip-detail"},hee={key:7,class:"body-chip"},mee={class:"chip-label"},gee={class:"chip-value"},vee={key:0,class:"chip-detail"},yee={key:8,class:"body-todo"},kee={class:"todo-glyph"},bee={key:9,class:"body-plan"},_ee={key:10,class:"body-generic"},wee={class:"gen-text"},See={key:11,class:"feedback-wrap"},Cee=["placeholder"],xee={class:"feedback-hint"},Aee={key:0,class:"plan-actions"},Tee={class:"k"},Mee={key:0,class:"k"},Eee={key:0,class:"k"},Iee={key:1,class:"abtn"},$ee=qe({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),i=B(()=>{const $=n.block;return $.kind!=="plan_review"?null:{plan:$.plan,path:$.path,options:$.options??[]}}),r=J(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const $=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${$}`)}const c=J(!1),u=J(""),d=J(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const $=u.value.trim();i.value?b("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:$||void 0}):b("feedback",{decision:"rejected",feedback:$||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m($){$.key==="Enter"&&!$.shiftKey?($.preventDefault(),h()):$.key==="Escape"&&($.preventDefault(),p())}const _=J(null);Ve(()=>n.busy,$=>{$||(_.value=null)});function b($,L){n.busy||(_.value=$,s("decide",L))}function g(){b("approve",{decision:"approved"})}function v(){b("approveSession",{decision:"approved",scope:"session"})}function y(){b("reject",{decision:"rejected"})}function T(){b("approvePlan",{decision:"approved"})}function P($){b(`option:${$}`,{decision:"approved",selectedLabel:$})}function I(){n.busy||f()}function k(){b("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function M($){const L=(document.activeElement?.tagName??"").toLowerCase();if(L==="input"||L==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){$.key==="1"?($.preventDefault(),T()):$.key==="2"?($.preventDefault(),I()):$.key==="3"&&($.preventDefault(),k());return}$.key==="1"&&S.options[0]?($.preventDefault(),P(S.options[0].label)):$.key==="2"&&S.options[1]?($.preventDefault(),P(S.options[1].label)):$.key==="3"&&S.options[2]&&($.preventDefault(),P(S.options[2].label));return}$.key==="1"?($.preventDefault(),g()):$.key==="2"?($.preventDefault(),v()):$.key==="3"?($.preventDefault(),y()):$.key==="4"&&($.preventDefault(),f())}return yn(()=>document.addEventListener("keydown",M)),xn(()=>document.removeEventListener("keydown",M)),($,L)=>(w(),ye(Cy,{class:Re(["appr",{minimized:r.value}])},l0({head:be(()=>[x("div",HJ,[L[2]||(L[2]=x("span",{class:"ah-ic"},"!",-1)),x("span",WJ,O(a()),1),x("span",zJ,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),N(Oe,{key:0},[Ue(O(e.block.path),1)],64)):e.block.kind==="shell"?(w(),N(Oe,{key:1},[Ue(O(e.block.command),1)],64)):e.block.kind==="url"?(w(),N(Oe,{key:2},[Ue(O(e.block.url),1)],64)):e.block.kind==="search"?(w(),N(Oe,{key:3},[Ue(O(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),N(Oe,{key:4},[Ue(O(e.block.name),1)],64)):e.block.kind==="generic"?(w(),N(Oe,{key:5},[Ue(O(e.block.summary),1)],64)):le("",!0)]),e.agentName&&!r.value?(w(),ye(Ns,{key:0,variant:"neutral",size:"sm"},{default:be(()=>[Ue(O(C(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):le("",!0),r.value?le("",!0):(w(),ye(Ns,{key:1,variant:"warning",size:"sm",class:"aw"},{default:be(()=>[Ue(O(C(o)("approval.required")),1)]),_:1})),ie(wn,{class:"amin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:L[0]||(L[0]=S=>r.value=!r.value)},{default:be(()=>[r.value?(w(),ye(Xe,{key:0,name:"chevron-down",size:"md"})):(w(),ye(Xe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:be(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),ye(qt,{key:0,text:e.block.path},{default:be(()=>[x("div",UJ,O(e.block.path),1)]),_:1},8,["text"])):le("",!0),e.block.kind==="diff"?(w(),N("div",jJ,[(w(!0),N(Oe,null,tt(e.block.diff,(S,E)=>(w(),N("div",{key:E,class:Re(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[x("span",qJ,O(S.gutter),1),x("span",VJ,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),N("div",KJ,[x("div",GJ,[L[3]||(L[3]=x("span",{class:"shell-dollar"},"$",-1)),Ue(" "+O(e.block.command),1)]),e.block.cwd?(w(),N("div",YJ,"cwd: "+O(e.block.cwd),1)):le("",!0),e.block.danger?(w(),N("div",QJ,O(C(o)("approval.danger",{detail:e.block.danger})),1)):le("",!0)])):e.block.kind==="file"?(w(),N("div",XJ,[x("div",ZJ,[x("span",JJ,O(e.block.language??""),1)]),x("div",eee,[(w(!0),N(Oe,null,tt(e.block.content.split(`
|
|
264
|
+
`),(S,E)=>(w(),N("div",{key:E,class:"file-line"},[x("span",tee,O(E+1),1),x("span",nee,O(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),N("div",see,[x("span",oee,O(e.block.op),1),x("span",iee,O(e.block.path),1),e.block.detail?(w(),N("span",ree,O(e.block.detail),1)):le("",!0)])):e.block.kind==="url"?(w(),N("div",lee,[e.block.method?(w(),N("span",aee,O(e.block.method),1)):le("",!0),x("span",cee,O(e.block.url),1)])):e.block.kind==="search"?(w(),N("div",uee,[x("span",dee,O(C(o)("approval.searchQueryLabel")),1),x("span",fee,O(e.block.query),1),e.block.scope?(w(),N("span",pee,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):le("",!0)])):e.block.kind==="invocation"?(w(),N("div",hee,[x("span",mee,O(e.block.kind2),1),x("span",gee,O(e.block.name),1),e.block.description?(w(),N("span",vee,O(e.block.description),1)):le("",!0)])):e.block.kind==="todo"?(w(),N("div",yee,[(w(!0),N(Oe,null,tt(e.block.items,(S,E)=>(w(),N("div",{key:E,class:"todo-item"},[x("span",kee,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),x("span",{class:Re(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),N("div",bee,[ie(Fh,{text:e.block.plan},null,8,["text"])])):(w(),N("div",_ee,[x("span",wee,O(e.block.summary),1)])),c.value?(w(),N("div",See,[_n(x("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":L[1]||(L[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,Cee),[[lo,u.value]]),x("div",xee,O(C(o)("approval.feedbackHint")),1)])):le("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:be(()=>[i.value?(w(),N("div",Aee,[i.value.options.length>0?(w(!0),N(Oe,{key:0},tt(i.value.options,(S,E)=>(w(),ye(qt,{key:E,text:S.description},{default:be(()=>[ie(Ot,{class:"kbtn",size:"sm",variant:"primary",loading:_.value===`option:${S.label}`,disabled:e.busy,onClick:D=>P(S.label)},{default:be(()=>[Ue(O(S.label),1),x("span",Tee,"["+O(E+1)+"]",1)]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),ye(Ot,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approvePlan",disabled:e.busy,onClick:T},{default:be(()=>[Ue(O(C(o)("approval.approvePlan")),1),L[4]||(L[4]=x("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"])),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:I},{default:be(()=>[Ue(O(C(o)("approval.revise")),1),i.value.options.length===0?(w(),N("span",Mee,"[2]")):le("",!0)]),_:1},8,["disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"danger-soft",loading:_.value==="rejectAndExit",disabled:e.busy,onClick:k},{default:be(()=>[Ue(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),N("span",Eee,"[3]")):le("",!0)]),_:1},8,["loading","disabled"])])):(w(),N("div",Iee,[ie(Ot,{class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approve",disabled:e.busy,onClick:g},{default:be(()=>[Ue(O(C(o)("approval.approve")),1),L[5]||(L[5]=x("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="approveSession",disabled:e.busy,onClick:v},{default:be(()=>[Ue(O(C(o)("approval.approveSession")),1),L[6]||(L[6]=x("span",{class:"k"},"[2]",-1))]),_:1},8,["loading","disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="reject",disabled:e.busy,onClick:y},{default:be(()=>[Ue(O(C(o)("approval.reject")),1),L[7]||(L[7]=x("span",{class:"k"},"[3]",-1))]),_:1},8,["loading","disabled"]),ie(Ot,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:be(()=>[Ue(O(C(o)("approval.feedback")),1),L[8]||(L[8]=x("span",{class:"k"},"[4]",-1))]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),Nee=dt($ee,[["__scopeId","data-v-4c0c7bdb"]]),Lee=qe({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(w(),N("span",{class:Re(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),D3=dt(Lee,[["__scopeId","data-v-f595d935"]]),Oee={class:"taskspane"},Pee={class:"tp-head"},Ree={class:"tp-title"},Dee={class:"tp-count"},Bee={class:"tp-list"},Fee={key:0,class:"tp-empty"},Hee=["role","onClick"],Wee={class:"tp-name"},zee={class:"tp-time"},Uee=["onClick"],jee={key:0,class:"tp-detail"},qee={key:0,class:"tp-codebox"},Vee=["onClick"],Kee={class:"tp-pre"},Gee={class:"tp-cmd"},Yee={key:1,class:"tp-codebox"},Qee=["onClick"],Xee={class:"tp-pre"},Zee=qe({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=At(),o=Ls(new Set),i=Ls(new Set),r=Ls(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)&&(o.has(p.id)?o.delete(p.id):o.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,m,_){await js(p)&&(_.add(m),setTimeout(()=>_.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
|
|
265
|
+
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(w(),N("div",Oee,[x("div",Pee,[x("span",Ree,O(C(s)("tasks.tag")),1),x("span",Dee,O(e.tasks.length),1)]),x("div",Bee,[e.tasks.length===0?(w(),N("div",Fee,O(C(s)("tasks.emptyTasks")),1)):(w(!0),N(Oe,{key:1},tt(e.tasks,_=>(w(),N("div",{key:_.id,class:Re(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:c(_)}])},[x("div",{class:"tp-main",role:c(_)?"button":void 0,onClick:b=>a(_)},[ie(D3,{status:u(_.state)},null,8,["status"]),x("span",Wee,O(_.name),1),ie(Ns,{variant:"neutral",size:"sm"},{default:be(()=>[Ue(O(_.kind),1)]),_:2},1024),x("span",zee,O(_.timing),1),_.state==="run"?(w(),N("button",{key:0,class:"tp-stop",onClick:vt(b=>n("cancel",_.id),["stop"])},O(C(s)("tasks.stop")),9,Uee)):le("",!0),_.kind==="subagent"?(w(),ye(Xe,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(_)?(w(),ye(Xe,{key:2,class:Re(["tp-chevron",{open:o.has(_.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):le("",!0)],8,Hee),o.has(_.id)&&l(_)?(w(),N("div",jee,[_.meta?(w(),N("div",qee,[x("button",{class:Re(["tp-copy",{copied:i.has(_.id)}]),onClick:vt(b=>f(_),["stop"])},O(i.has(_.id)?"已复制":"复制"),11,Vee),x("pre",Kee,[x("code",null,[x("span",Gee,O(_.meta),1)])])])):le("",!0),_.output&&_.output.length>0?(w(),N("div",Yee,[x("button",{class:Re(["tp-copy",{copied:r.has(_.id)}]),onClick:vt(b=>h(_),["stop"])},O(r.has(_.id)?"已复制":"复制"),11,Qee),x("pre",Xee,[x("code",null,[m[0]||(m[0]=Ue(`
|
|
266
|
+
`,-1)),(w(!0),N(Oe,null,tt(_.output,(b,g)=>(w(),N("span",{key:g,class:"tp-line"},O(b),1))),128)),m[1]||(m[1]=Ue(`
|
|
267
|
+
`,-1))])])])):le("",!0)])):le("",!0)],2))),128))])]))}}),oC=dt(Zee,[["__scopeId","data-v-28fd5fc0"]]),Jee={class:"todo-card"},ete={key:0,class:"tc-empty"},tte={class:"tc-name"},nte=qe({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=At();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(w(),N("div",Jee,[t.todos.length===0?(w(),N("div",ete,[i[0]||(i[0]=x("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"},[x("path",{d:"M9 11l2 2 4-4"}),x("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),x("span",null,O(C(n)("tasks.emptyTodo")),1)])):le("",!0),(w(!0),N(Oe,null,tt(t.todos,(r,l)=>(w(),N("div",{key:l,class:Re(["tc-row",`s-${r.status}`])},[ie(D3,{status:s(r.status)},null,8,["status"]),x("span",tte,O(r.title),1)],2))),128))]))}}),ste=dt(nte,[["__scopeId","data-v-01c65735"]]),ote=["disabled","aria-pressed"],ite=qe({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(w(),N("button",{key:0,class:Re(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Nn(t.$slots,"default",{},void 0,!0)],10,ote)):(w(),N("span",{key:1,class:Re(["ui-pill",{"is-active":e.active}])},[Nn(t.$slots,"default",{},void 0,!0)],2))}}),fv=dt(ite,[["__scopeId","data-v-317ace1a"]]),rte={class:"dock-work-head"},lte={key:0,class:"dock-work-tab static"},ate={key:1,class:"dock-work-tab static"},cte={key:2,class:"dock-work-tab static"},ute={class:"dock-work-body"},dte={class:"dw-count"},fte={class:"dw-count"},pte={class:"dw-count"},hte=qe({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=At(),r=J(null),l=J(null),a=J(null);function c(h){return r.value?(r.value.loadForEdit(h),!0):!1}function u(h){r.value?.loadAttachmentsForEdit(h)}function d(){r.value?.focus()}function f(h){if(!s.dockPanel)return;const p=h.target;p&&(l.value?.contains(p)||a.value?.contains(p)||o("close-dock-panel"))}return Ve(()=>s.dockPanel,h=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),h&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),xn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(h,p)=>(w(),N("div",{class:Re(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:p[28]||(p[28]=vt(()=>{},["stop"]))},[ie(Xr,{name:"dock-panel"},{default:be(()=>[e.dockPanel?(w(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:p[3]||(p[3]=vt(()=>{},["stop"]))},[x("div",rte,[e.dockPanel==="bash"?(w(),N("span",lte,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),N("span",ate,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),N("span",cte,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):le("",!0)]),x("div",ute,[e.dockPanel==="bash"?(w(),ye(oC,{key:0,tasks:e.bashTasks,onCancel:p[0]||(p[0]=m=>o("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),ye(oC,{key:1,tasks:e.subagentTasks,onCancel:p[1]||(p[1]=m=>o("cancelTask",m)),onOpen:p[2]||(p[2]=m=>o("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),ye(ste,{key:2,todos:e.todos??[]},null,8,["todos"])):le("",!0)])],512)):le("",!0)]),_:1}),e.goal?(w(),ye(fJ,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:p[4]||(p[4]=m=>o("controlGoal",m))},null,8,["goal","force-expanded"])):le("",!0),e.hasDockWork?(w(),N("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),ye(fv,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:p[5]||(p[5]=m=>o("toggle-dock-panel","bash"))},{default:be(()=>[ie(Xe,{name:"clock",size:"md"}),x("span",null,O(C(i)("tasks.dockBash")),1),x("span",dte,[p[29]||(p[29]=Ue("(",-1)),x("b",null,O(e.bashTasks.length),1),p[30]||(p[30]=Ue(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),e.subagentTasks.length>0?(w(),ye(fv,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:p[6]||(p[6]=m=>o("toggle-dock-panel","subagent"))},{default:be(()=>[ie(Xe,{name:"sparkles",size:"md"}),x("span",null,O(C(i)("tasks.dockSubagent")),1),x("span",fte,[p[31]||(p[31]=Ue("(",-1)),x("b",null,O(e.subagentTasks.length),1),p[32]||(p[32]=Ue(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),(e.todos?.length??0)>0?(w(),ye(fv,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:p[7]||(p[7]=m=>o("toggle-dock-panel","todos"))},{default:be(()=>[ie(Xe,{name:"check-list",size:"md"}),x("span",null,O(C(i)("tasks.dockTodos")),1),x("span",pte,[p[33]||(p[33]=Ue("(",-1)),x("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),p[34]||(p[34]=Ue(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0)],512)):le("",!0),e.pendingQuestion?(w(),ye(FJ,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:p[8]||(p[8]=(m,_)=>o("answer",m,_)),onDismiss:p[9]||(p[9]=m=>o("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),ye(Nee,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:p[10]||(p[10]=m=>o("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(w(),ye(R3,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:p[11]||(p[11]=m=>o("submit",m)),onSteer:p[12]||(p[12]=m=>o("steer",m)),onCommand:p[13]||(p[13]=m=>o("command",m)),onInterrupt:p[14]||(p[14]=m=>o("interrupt")),onSetPermission:p[15]||(p[15]=m=>o("setPermission",m)),onSetThinking:p[16]||(p[16]=m=>o("setThinking",m)),onTogglePlan:p[17]||(p[17]=m=>o("togglePlan")),onToggleSwarm:p[18]||(p[18]=m=>o("toggleSwarm")),onToggleGoal:p[19]||(p[19]=m=>o("toggleGoal")),onOpenBtw:p[20]||(p[20]=m=>o("openBtw")),onCreateGoal:p[21]||(p[21]=m=>o("createGoal",m)),onControlGoal:p[22]||(p[22]=m=>o("controlGoal",m)),onFocusGoal:p[23]||(p[23]=m=>o("focusGoal")),onFocusSwarm:p[24]||(p[24]=m=>o("focusSwarm")),onCompact:p[25]||(p[25]=m=>o("compact")),onPickModel:p[26]||(p[26]=m=>o("pickModel")),onSelectModel:p[27]||(p[27]=m=>o("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),mte=dt(hte,[["__scopeId","data-v-1223755a"]]),gte=["aria-label","aria-hidden"],vte={class:"toc-scroll"},yte=["onClick"],kte={class:"toc-label"},bte=240,_te=qe({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),i=J(null),r=J(!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>=bte}const c=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ve(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}),fs(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),N("nav",{key:0,ref_key:"navRef",ref:i,class:Re(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":C(o)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[x("div",vte,[(w(!0),N(Oe,null,tt(e.items,f=>(w(),N("button",{key:f.id,type:"button",class:Re(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=x("span",{class:"toc-bar"},null,-1)),x("span",kte,O(f.title),1)],10,yte))),128))])],10,gte)):le("",!0)}}),wte=dt(_te,[["__scopeId","data-v-0a2a2a96"]]),Ste=5;function Cte(e,t,n,s=Ste){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const xte={class:"chat-layout"},Ate={class:"empty-hint"},Tte={class:"empty-hint-title"},Mte={class:"empty-hint-text"},Ete={key:0,class:"ws-pick"},Ite={class:"ws-pick-name"},$te={key:1,class:"ws-pick-menu"},Nte=["onClick"],Lte={class:"ws-pick-item-name"},Ote={class:"ws-pick-item-path"},Pte=["aria-label"],Rte={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Dte={class:"abort-toast-text"},pv=80,iC=1e3,Bte=420,Fte=3e3,Hte=qe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=J(!1),r=J(!1),l=B(()=>s.workspaces?.find(xe=>xe.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=B(()=>(s.workspaces?.length??0)>0),c=B(()=>Cte(s.workspaces??[],s.activeWorkspaceId,r.value)),u=B(()=>(s.workspaces?.length??0)-c.value.length);Ve(i,Ee=>{Ee||(r.value=!1)});function d(Ee){i.value=!1,Ee!==s.activeWorkspaceId&&o("selectWorkspace",Ee)}const{t:f}=At();uc(It.contentAlign);const h=J(null),p=J(null),m=J(null),_=J(!1),b=J(0);let g=null;function v(Ee,xe){const Be=m.value??p.value;return!Be||Be.loadForEdit(Ee)===!1?!1:(Be.loadAttachmentsForEdit(xe??[]),!0)}function y(){_.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,_.value=!1},2e3)}function T(){b.value++}const P=B(()=>s.tasks.filter(Ee=>Ee.kind!=="subagent")),I=B(()=>s.tasks.filter(Ee=>Ee.kind==="subagent"&&Ee.runInBackground)),k=B(()=>P.value.filter(Ee=>Ee.state==="run").length),M=B(()=>I.value.filter(Ee=>Ee.state==="run").length);function $(Ee){const xe=s.tasks,Be=xe.find(zt=>zt.id===Ee)??xe.find(zt=>zt.parentToolCallId===Ee);if(Be)return Be.id;const $t=xe.filter(zt=>zt.kind==="subagent"&&!zt.parentToolCallId);if($t.length===1)return $t[0].id}In("resolveAgentTaskId",$),In("pinScroll",xs);const L=B(()=>(s.todos??[]).filter(Ee=>Ee.status==="done").length),S=B(()=>P.value.length>0||I.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),E=J(null),D=B(()=>s.gitInfo?s.changes?.length??0:0);function R(Ee){E.value=E.value===Ee?null:Ee}function H(){E.value=null}Ve(S,Ee=>{Ee||H()});function U(Ee){if(Ee.role==="compaction")return f("conversation.compactedPlain");if(Ee.role==="user"){if(Ee.skillActivation)return`/${Ee.skillActivation.name}`;if(Ee.pluginCommand)return`/${Ee.pluginCommand.pluginId}:${Ee.pluginCommand.commandName}`;const Be=Ee.text.trim().replaceAll(/\s+/g," ");return Be.length>0?Be:"user"}const xe=(Ee.text||Ee.thinking||"").trim().replaceAll(/\s+/g," ");return xe.length>0?xe:(Ee.tools?.length??0)>0?`${Ee.tools.length} tools`:"kimi"}const G=B(()=>s.turns.filter(Ee=>Ee.role==="user").map((Ee,xe)=>({id:Ee.id,role:Ee.role,no:xe+1,title:U(Ee)}))),Q=J(null);function V(){const Ee=he.value;if(!Ee)return;const xe=Ee.querySelectorAll(".turn-anchor[data-turn-id]");if(xe.length===0)return;const Be=G.value;if(Be.length===0)return;const $t=new Set(Be.map(Wn=>Wn.id));if(ae()<=pv){Q.value=Be[Be.length-1].id;return}const zt=Ee.getBoundingClientRect(),ns=zt.height/2;let Qn=null;xe.forEach(Wn=>{const ft=Wn.dataset.turnId;if(!ft||!$t.has(ft))return;Wn.getBoundingClientRect().top-zt.top<=ns&&(Qn=ft)}),Q.value=Qn??Be[0].id}const re=B(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),pe=B(()=>{const Ee=re.value;if(Ee)return s.pendingQuestionActions?.[Ee.questionId]}),ne=B(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),X=B(()=>{const Ee=ne.value;return Ee?!!s.pendingApprovalActions?.[Ee.approvalId]:!1}),he=J(null),Pe=J(null),je=J(0),it=J(0),ce=B(()=>({"--panes-scrollbar-width":`${je.value}px`}));function z(Ee){return Ee instanceof HTMLElement?Ee:Ee&&"$el"in Ee&&Ee.$el instanceof HTMLElement?Ee.$el:null}function Y(){const Ee=he.value;je.value=Ee?Math.max(0,Ee.offsetWidth-Ee.clientWidth):0,it.value=Pe.value?.offsetHeight??0}function oe(Ee){const xe=z(Ee);he.value=xe,xe&&Nt()}function W(Ee){const xe=z(Ee);Pe.value=xe??null,Ee&&"loadForEdit"in Ee&&typeof Ee.loadForEdit=="function"&&"focus"in Ee&&typeof Ee.focus=="function"?m.value={loadForEdit:Ee.loadForEdit.bind(Ee),loadAttachmentsForEdit:"loadAttachmentsForEdit"in Ee&&typeof Ee.loadAttachmentsForEdit=="function"?Ee.loadAttachmentsForEdit.bind(Ee):()=>{},focus:Ee.focus.bind(Ee)}:m.value=null,ao()}const Z=J(!0),ue=J(!1);function ae(){const Ee=he.value;return Ee?Ee.scrollHeight-Ee.scrollTop-Ee.clientHeight:0}let me=0,j=0,ee=0,fe=0,ke=0,Ae=0;function Ie(){return Date.now()<j}function de(){const Ee=he.value;if(!Ee)return;const xe=Ee.scrollTop;if(tn()){me=xe;return}if(performance.now()-ee<100){me=xe;return}const Be=ae();if(Ie()){Z.value=!0,ue.value=!1,me=xe;return}xe<me-1&&Be>1?(Z.value=!1,ue.value=!0):Be<=pv&&xe>me+1&&(Z.value=!0,ue.value=!1),me=xe,V()}function Me(Ee=!1){const xe=he.value;Z.value=!0,ue.value=!1,xe&&(!Ee&&performance.now()<fe||(Ee&&typeof xe.scrollTo=="function"?(ee=performance.now(),fe=performance.now()+Bte,xe.scrollTo({top:xe.scrollHeight,behavior:"smooth"})):xe.scrollTop=xe.scrollHeight,me=xe.scrollTop))}function Ke(Ee,xe){const Be=Ee.querySelectorAll(".turn-anchor");for(const $t of Be)if($t.offsetTop>=xe){const zt=$t.dataset.turnId;if(zt)return{id:zt,top:$t.offsetTop}}return null}async function lt(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Ee=s.sessionId,xe=he.value,Be=xe?.scrollTop??0,$t=xe?.scrollHeight??0,zt=xe?Ke(xe,Be):null;Fo.value=!0;try{await s.loadOlderMessages(Ee),await mt()}finally{Fo.value=!1}if(s.sessionId!==Ee)return;const ns=he.value;if(!ns)return;let Qn=0;if(zt){const Wn=ns.querySelector(`.turn-anchor[data-turn-id="${yt(zt.id)}"]`);Wn&&(Qn=Wn.offsetTop-zt.top)}Qn===0&&(Qn=ns.scrollHeight-$t),ns.scrollTop=Be+Qn}function yt(Ee){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ee):Ee.replaceAll(/["\\]/g,"\\$&")}function kt(Ee){const xe=he.value;if(!xe)return;const Be=xe.querySelector(`.turn-anchor[data-turn-id="${yt(Ee)}"]`);Be&&(Z.value=!1,ue.value=ae()>pv,Be.scrollIntoView({behavior:"smooth",block:"center"}))}function Tt(){const Ee=he.value;if(!Ee)return"none";const xe=Ee.firstElementChild,Be=xe instanceof HTMLElement?xe.offsetHeight:0,$t=Pe.value?.offsetHeight??0;return`${Ee.scrollHeight}:${Ee.clientHeight}:${Be}:${$t}`}function Pt(Ee){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ee):setTimeout(Ee,16)}function _t(Ee){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ee):clearTimeout(Ee)}let Vt=0,cn=0,is=null,Rt=0;function tn(){return performance.now()<Vt}function xs(Ee,xe=260){const Be=he.value;if(!Be||(is=Ee,Rt=Ee.getBoundingClientRect().top,Vt=performance.now()+xe,cn))return;const $t=()=>{if(cn=0,performance.now()>=Vt||!is){is=null;return}const zt=is.getBoundingClientRect().top-Rt;zt&&(Be.scrollTop+=zt),cn=Pt($t)};cn=Pt($t)}function ot(Ee=36){if(!Z.value&&!Ie())return;const xe=++Ae;let Be="",$t=0,zt=0;ke&&(_t(ke),ke=0);const ns=()=>{if(ke=0,xe!==Ae||!Z.value&&!Ie())return;Me(!1);const Qn=Tt();$t=Qn===Be?$t+1:0,Be=Qn,zt++,$t<3&&zt<Ee&&(ke=Pt(ns))};ke=Pt(ns)}function Fn(Ee,xe){return Ee!==void 0&&Ee.length>0&&xe.length>=Ee.length&&Ee.firstId!==xe.firstId&&Ee.lastId===xe.lastId&&Ee.lastTextLen===xe.lastTextLen&&Ee.lastThinkingLen===xe.lastThinkingLen&&Ee.lastToolsLen===xe.lastToolsLen&&Ee.approvalIds===xe.approvalIds}const kn=B(()=>{const Ee=(s.approvals??[]).map(ns=>ns.approvalId).join(","),xe=s.turns,Be=xe.at(-1),$t=Be?.thinking?.length??0,zt=Be?.tools?.reduce((ns,Qn)=>ns+Qn.name.length+(Qn.arg?.length??0)+(Qn.output?.join("").length??0),0)??0;return{length:xe.length,firstId:xe[0]?.id??"",lastId:Be?.id??"",lastTextLen:Be?.text.length??0,lastThinkingLen:$t,lastToolsLen:zt,approvalIds:Ee}});Ve(kn,async(Ee,xe)=>{if(Fo.value&&Fn(xe,Ee)){V();return}await mt(),Z.value||Ie()?Me(Ee.length<xe.length):ue.value=!0,V()}),Ve(Pe,()=>{ao()}),Ve(()=>s.mobile,async()=>{await mt(),Y()});const Gn=new Map;Ve(()=>s.fileReloadKey,async(Ee,xe)=>{const Be=he.value;xe&&Be&&Gn.set(String(xe),{top:Be.scrollTop,following:Z.value}),await mt();const $t=he.value,zt=Ee?Gn.get(String(Ee)):void 0;zt&&$t?(Z.value=zt.following,$t.scrollTop=zt.top,me=zt.top,zt.following&&ot()):(Z.value=!0,me=0,Me(!1),ot()),V()}),Ve(()=>s.sessionLoading,async(Ee,xe)=>{Ee||!xe||(Z.value=!0,await mt(),ot(),V())}),Ve(()=>s.running,async(Ee,xe)=>{Ee||!xe||!Z.value&&!Ie()||(await mt(),ot(48),V())});function Hn(){Z.value=!0,ue.value=!1,j=Date.now()+iC,mt(()=>{Me(!0),ot(16)})}function Ln(Ee){Hn(),o("submit",Ee)}function rs(Ee){Z.value=!0,ue.value=!1,j=Date.now()+iC,o("editMessage",Ee)}function Ge(Ee){const xe=s.queued?.[Ee],Be=xe?.text??"";v(Be,xe?.attachments)&&o("editQueued",Ee)}function Qe(Ee){o("reorderQueue",Ee)}function Dt(Ee,xe){Hn(),o("answer",Ee,xe)}function Xt(Ee,xe){!Ee||!xe||o("approval",Ee,xe)}let Zt=null,Jt=null,An=null,Mt=null,Yn=0,Ht=0,ks=0,bs=!1;const Fo=J(!1);function Rs(Ee){if(Fo.value||(bs=bs||Ee,ks))return;ks=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Be=>setTimeout(Be,16))(()=>{ks=0;const Be=bs;bs=!1,!tn()&&(Z.value||Ie()?Me(!1):Be&&(ue.value=!0))})}function wo(){if(!Jt)return;const Ee=he.value?.firstElementChild??null;Ee!==An&&(An&&Jt.unobserve(An),An=Ee,Ee&&Jt.observe(Ee))}function ao(){if(!Jt)return;const Ee=Pe.value;Ee!==Mt&&(Mt&&Jt.unobserve(Mt),Mt=Ee,Ee&&Jt.observe(Ee))}function Nt(){const Ee=he.value;Y(),Zt&&(Zt.disconnect(),Ee&&Zt.observe(Ee,{childList:!0,subtree:!0,characterData:!0})),Jt&&(Jt.disconnect(),An=null,Mt=null,Ee&&Jt.observe(Ee),wo(),ao()),Yn=Ee?.scrollHeight??0,Ht=Ee?.clientHeight??0}function Ho(){wo(),Rs(!0)}function Wo(){typeof document>"u"||document.visibilityState==="visible"&&Z.value&&ot()}const Ye=J(!1);let et=null;function st(){Ye.value=!0,et!==null&&clearTimeout(et),et=setTimeout(()=>{Ye.value=!1},Fte)}function Bt(){st(),o("interrupt")}function zo(Ee){Ee.key==="Escape"&&(s.running||s.sending)&&(Ee.preventDefault(),Bt())}yn(()=>{mt(()=>{typeof MutationObserver=="function"&&(Zt=new MutationObserver(Ho)),typeof ResizeObserver=="function"&&(Jt=new ResizeObserver(()=>{Y();const Ee=he.value;if(!Ee)return;const{scrollHeight:xe,clientHeight:Be}=Ee,$t=xe>Yn+1,zt=Be<Ht-1;Yn=xe,Ht=Be,!tn()&&($t||zt)&&Rs(!1)})),Nt(),ot(48),V(),typeof document<"u"&&(document.addEventListener("visibilitychange",Wo),document.addEventListener("keydown",zo))})}),xn(()=>{Zt&&Zt.disconnect(),Jt&&Jt.disconnect(),ks&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(ks),ke&&_t(ke),cn&&_t(cn),et!==null&&clearTimeout(et),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Wo),document.removeEventListener("keydown",zo))});function Li(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:Li}),(Ee,xe)=>(w(),N("section",{class:Re(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),ye(wX,{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:_.value,onOpenChanges:xe[0]||(xe[0]=Be=>o("openChanges")),onCopyAll:xe[1]||(xe[1]=Be=>h.value?.copyConversation()),onCopyFinalSummary:xe[2]||(xe[2]=Be=>h.value?.copyFinalSummary()),onOpenPr:xe[3]||(xe[3]=Be=>e.pr&&o("openPr",e.pr.url)),onRenameSession:xe[4]||(xe[4]=(Be,$t)=>o("renameSession",Be,$t)),onForkSession:xe[5]||(xe[5]=Be=>o("forkSession",Be)),onArchiveSession:xe[6]||(xe[6]=Be=>o("archiveSession",Be))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):le("",!0),e.conversationToc?(w(),ye(wte,{key:1,items:G.value,"active-turn-id":Q.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:kt},null,8,["items","active-turn-id","mobile","session-loading"])):le("",!0),x("div",xte,[x("div",{ref:oe,class:"panes chat-scroll",onScrollPassive:de},[x("div",{class:Re(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),N(Oe,{key:0},[xe[54]||(xe[54]=x("div",{class:"empty-spacer"},null,-1)),x("div",Ate,[x("span",Tte,O(C(f)("composer.emptyConversationTitle")),1),x("span",Mte,O(C(f)("composer.emptyConversation")),1),a.value?(w(),N("div",Ete,[ie(qt,{text:C(f)("conversation.switchWorkspace")},{default:be(()=>[x("button",{type:"button",class:"ws-pick-btn",onClick:xe[7]||(xe[7]=vt(Be=>i.value=!i.value,["stop"]))},[ie(Xe,{name:"folder",size:"sm"}),x("span",Ite,O(l.value),1),ie(Xe,{class:Re(["ws-pick-chev",{open:i.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),i.value?(w(),N("div",{key:0,class:"ws-pick-backdrop",onClick:xe[8]||(xe[8]=Be=>i.value=!1)})):le("",!0),i.value?(w(),N("div",$te,[(w(!0),N(Oe,null,tt(c.value,Be=>(w(),N("button",{key:Be.id,type:"button",class:Re(["ws-pick-item",{on:Be.id===e.activeWorkspaceId}]),onClick:vt($t=>d(Be.id),["stop"])},[x("span",Lte,O(Be.name),1),x("span",Ote,O(Be.shortPath),1)],10,Nte))),128)),u.value>0?(w(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:xe[9]||(xe[9]=vt(Be=>r.value=!r.value,["stop"]))},[x("span",null,O(C(f)("conversation.moreWorkspaces",{count:u.value})),1)])):le("",!0),xe[53]||(xe[53]=x("div",{class:"ws-pick-divider"},null,-1)),x("button",{type:"button",class:"ws-pick-action",onClick:xe[10]||(xe[10]=vt(Be=>{i.value=!1,o("addWorkspace")},["stop"]))},[ie(Xe,{name:"plus",size:"sm"}),x("span",null,O(C(f)("conversation.addWorkspace")),1)])])):le("",!0)])):(w(),N("button",{key:1,type:"button",class:"empty-add-workspace",onClick:xe[11]||(xe[11]=Be=>o("addWorkspace"))},[ie(Xe,{name:"folder-plus",size:"sm"}),x("span",null,O(C(f)("conversation.addWorkspace")),1)]))]),ie(R3,{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,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Ln,onSteer:xe[12]||(xe[12]=Be=>o("steer",Be)),onCommand:xe[13]||(xe[13]=Be=>o("command",Be)),onInterrupt:Bt,onUnqueue:xe[14]||(xe[14]=Be=>o("unqueue",Be)),onEditQueued:xe[15]||(xe[15]=Be=>o("editQueued",Be)),onSetPermission:xe[16]||(xe[16]=Be=>o("setPermission",Be)),onSetThinking:xe[17]||(xe[17]=Be=>o("setThinking",Be)),onTogglePlan:xe[18]||(xe[18]=Be=>o("togglePlan")),onToggleSwarm:xe[19]||(xe[19]=Be=>o("toggleSwarm")),onToggleGoal:xe[20]||(xe[20]=Be=>o("toggleGoal")),onOpenBtw:xe[21]||(xe[21]=Be=>o("command","/btw")),onCreateGoal:xe[22]||(xe[22]=Be=>o("createGoal",Be)),onControlGoal:xe[23]||(xe[23]=Be=>o("controlGoal",Be)),onFocusGoal:T,onCompact:xe[24]||(xe[24]=Be=>o("compact")),onPickModel:xe[25]||(xe[25]=Be=>o("pickModel")),onSelectModel:xe[26]||(xe[26]=Be=>o("selectModel",Be))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),xe[55]||(xe[55]=x("div",{class:"empty-spacer"},null,-1))],64)):(w(),ye(L3,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":Z.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:xe[27]||(xe[27]=Be=>o("openFile",Be)),onOpenMedia:xe[28]||(xe[28]=Be=>o("openMedia",Be)),onCopyConversationCopied:y,onOpenThinking:xe[29]||(xe[29]=Be=>o("openThinking",Be)),onOpenCompaction:xe[30]||(xe[30]=Be=>o("openCompaction",Be)),onOpenAgent:xe[31]||(xe[31]=Be=>o("openAgent",Be)),onOpenToolDiff:xe[32]||(xe[32]=Be=>o("openToolDiff",Be)),onEditMessage:rs,onLoadOlderMessages:lt,onUnqueue:xe[33]||(xe[33]=Be=>o("unqueue",Be)),onEditQueued:Ge,onReorderQueue:Qe},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],32),e.turns.length===0&&!e.sessionLoading?le("",!0):(w(),ye(mte,{key:0,ref:W,style:Qt(ce.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":b.value,"dock-panel":E.value,"bash-tasks":P.value,"subagent-tasks":I.value,"bash-running":k.value,"subagent-running":M.value,"todo-done-count":L.value,"has-dock-work":S.value,todos:e.todos,"pending-question":re.value,"question-busy-kind":pe.value,"pending-approval":ne.value,"approval-busy":X.value,mobile:e.mobile,onToggleDockPanel:xe[34]||(xe[34]=Be=>R(Be)),onCloseDockPanel:xe[35]||(xe[35]=Be=>H()),onOpenAgent:xe[36]||(xe[36]=Be=>o("openAgent",Be)),onAnswer:Dt,onDismiss:xe[37]||(xe[37]=Be=>o("dismiss",Be)),onApproval:Xt,onCancelTask:xe[38]||(xe[38]=Be=>o("cancelTask",Be)),onControlGoal:xe[39]||(xe[39]=Be=>o("controlGoal",Be)),onSubmit:Ln,onSteer:xe[40]||(xe[40]=Be=>o("steer",Be)),onCommand:xe[41]||(xe[41]=Be=>o("command",Be)),onInterrupt:Bt,onSetPermission:xe[42]||(xe[42]=Be=>o("setPermission",Be)),onSetThinking:xe[43]||(xe[43]=Be=>o("setThinking",Be)),onTogglePlan:xe[44]||(xe[44]=Be=>o("togglePlan")),onToggleSwarm:xe[45]||(xe[45]=Be=>o("toggleSwarm")),onToggleGoal:xe[46]||(xe[46]=Be=>o("toggleGoal")),onOpenBtw:xe[47]||(xe[47]=Be=>o("command","/btw")),onCreateGoal:xe[48]||(xe[48]=Be=>o("createGoal",Be)),onFocusGoal:T,onCompact:xe[49]||(xe[49]=Be=>o("compact")),onPickModel:xe[50]||(xe[50]=Be=>o("pickModel")),onSelectModel:xe[51]||(xe[51]=Be=>o("selectModel",Be))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ie(Xr,{name:"pill"},{default:be(()=>[ue.value?(w(),N("button",{key:0,class:"newmsg-pill",style:Qt({bottom:`${it.value+12}px`}),"aria-label":C(f)("conversation.jumpToLatestAria"),onClick:xe[52]||(xe[52]=Be=>Me(!0))},[ie(Xe,{class:"pill-chevron",name:"chevron-down",size:"md"}),Ue(" "+O(C(f)("conversation.newMessages")),1)],12,Pte)):le("",!0)]),_:1}),ie(Xr,{name:"abort-toast"},{default:be(()=>[Ye.value?(w(),N("div",Rte,[x("span",Dte,O(C(f)("conversation.manuallyAborted")),1)])):le("",!0)]),_:1})],2))}}),Wte=dt(Hte,[["__scopeId","data-v-f702e00f"]]),zte=["aria-selected","onClick"],Ute=qe({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(w(),N("div",{class:Re(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),N(Oe,null,tt(e.options,i=>(w(),N("button",{key:i.value,class:Re(["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,zte))),128))],2))}}),eo=dt(Ute,[["__scopeId","data-v-d1aaccd7"]]),jte={class:"ui-panel-header__title"},qte={key:0,class:"ui-panel-header__sub"},Vte=qe({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-panel-header",{wrap:e.wrap}])},[x("span",jte,O(e.title),1),ie(qt,{text:e.subtitle},{default:be(()=>[e.subtitle?(w(),N("span",qte,O(e.subtitle),1)):le("",!0)]),_:1},8,["text"]),Nn(t.$slots,"default",{},void 0,!0),e.closable?(w(),ye(wn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:be(()=>[ie(Xe,{name:"close",size:"sm"})]),_:1},8,["label"])):le("",!0)],2))}}),Yl=dt(Vte,[["__scopeId","data-v-c47879ad"]]),Kte={key:0,class:"fp-empty fp-error"},Gte={key:1,class:"fp-empty"},Yte={key:2,class:"fp-loading"},Qte={class:"fp-path"},Xte={class:"fp-meta"},Zte={key:0,class:"fp-lines"},Jte={class:"fp-size"},ene={key:3,class:"fp-search"},tne=["placeholder"],nne={key:0,class:"fp-search-count"},sne=["href","aria-label"],one={key:1,class:"fp-code"},ine={class:"fp-line-table"},rne=["data-line"],lne={class:"fp-gutter"},ane=["innerHTML"],cne={key:1,class:"fp-body fp-code"},une={class:"fp-line-table"},dne=["data-line"],fne={class:"fp-gutter"},pne=["innerHTML"],hne={key:2,class:"fp-body"},mne=["srcdoc","title"],gne={key:1,class:"fp-code"},vne={class:"fp-line-table"},yne=["data-line"],kne={class:"fp-gutter"},bne=["innerHTML"],_ne={key:3,class:"fp-body fp-pdf-wrap"},wne=["src","title"],Sne={key:1,class:"fp-binary-card"},Cne={class:"fp-binary-label"},xne={key:4,class:"fp-body fp-table-wrap"},Ane={class:"fp-table"},Tne=["data-line"],Mne={key:5,class:"fp-body fp-image-wrap"},Ene=["src","alt"],Ine={key:1,class:"fp-binary-card"},$ne={class:"fp-binary-icon"},Nne={class:"fp-binary-label"},Lne={key:6,class:"fp-body fp-code"},One={class:"fp-line-table"},Pne=["data-line"],Rne={class:"fp-gutter"},Dne=["innerHTML"],Bne={key:7,class:"fp-body fp-binary-wrap"},Fne={class:"fp-binary-card"},Hne={class:"fp-binary-icon"},Wne={class:"fp-binary-label"},zne=qe({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=At();function s(ce,z){const Y=z?z.split("/").filter(Boolean):[];for(const oe of ce.split("/"))oe===""||oe==="."||(oe===".."?Y.pop():Y.push(oe));return Y.join("/")}const o=jt("resolveImage",async ce=>ce),i=B(()=>{const ce=c.file?.path??"",z=ce.lastIndexOf("/");return z>0?ce.slice(0,z):""});function r(ce){if(/^(https?:|data:|blob:)/i.test(ce)||ce.startsWith("/"))return ce;const z=i.value;return z?s(ce,z):ce}async function l(ce){const z=r(ce);return o?o(z):z}In("resolveImage",l);function a(ce){let z=ce.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(z)||z.startsWith("/"))return ce;for(const oe of["#","?"]){const W=z.indexOf(oe);W!==-1&&(z=z.slice(0,W))}const Y=i.value;return{...ce,path:s(z,Y)}}const c=e,u=t;function d(ce){c.openFile?.(a(ce))}const f=J(null),h=B(()=>{const ce=c.file;if(!ce)return"binary";const z=ce.mime??"",Y=ce.languageId??"",oe=ce.path.toLowerCase();return z==="text/markdown"||Y==="markdown"||Y==="md"||oe.endsWith(".mdx")?"markdown":z==="application/json"||Y==="json"?"json":z==="text/html"||Y==="html"||oe.endsWith(".html")||oe.endsWith(".htm")?"html":z==="application/pdf"||oe.endsWith(".pdf")?"pdf":z==="text/csv"||Y==="csv"||oe.endsWith(".csv")?"csv":z.startsWith("image/")?"image":ce.isBinary?"binary":z.startsWith("text/")||Y!==""?"text":"binary"});function p(ce){const z=atob(ce),Y=Uint8Array.from(z,oe=>oe.charCodeAt(0));return new TextDecoder().decode(Y)}const m=B(()=>{const ce=c.file;if(!ce)return"";if(ce.encoding==="base64")try{return p(ce.content)}catch{return ce.content}return ce.content}),_=B(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),b=B(()=>c.file?(h.value==="json"?_.value:m.value).split(`
|
|
268
|
+
`):[]),g=B(()=>c.file?h.value==="json"?_.value:m.value:""),v=J(""),y=J(0),T=B(()=>{const ce=v.value.trim().toLowerCase();if(!ce)return[];const z=[];return b.value.forEach((Y,oe)=>{Y.toLowerCase().includes(ce)&&z.push(oe+1)}),z});Ve(v,()=>{y.value=0});function P(ce,z=!1){ce&&mt(()=>{const Y=f.value?.querySelector(".fp-body"),oe=Y?.querySelector(`[data-line="${ce}"]`);if(!Y||!oe)return;z&&(Y.scrollTop=0);const W=Y.getBoundingClientRect(),Z=oe.getBoundingClientRect(),ue=Z.top-W.top+Y.scrollTop;Y.scrollTop=ue-Y.clientHeight/2+Z.height/2})}Ve(()=>[c.file?.path,c.line],()=>P(c.line,!0),{immediate:!0});function I(ce){const z=T.value;z.length!==0&&(y.value=(y.value+ce+z.length)%z.length,P(z[y.value]))}function k(ce){const z=T.value;return{target:c.line===ce,hit:z.includes(ce),active:z[y.value]===ce}}function M(ce){return ce<1024?`${ce} B`:ce<1024*1024?`${(ce/1024).toFixed(1)} KB`:`${(ce/(1024*1024)).toFixed(1)} MB`}const $=J(!1),L=J(!1);function S(){c.file&&js(g.value).then(ce=>{ce&&($.value=!0,setTimeout(()=>{$.value=!1},1400))})}function E(){c.file&&js(c.file.path).then(ce=>{ce&&(L.value=!0,setTimeout(()=>{L.value=!1},1400))})}const D=J("preview"),R=J("preview"),H=J("fit");function U(ce){D.value=ce}function G(ce){R.value=ce}function Q(ce){H.value=ce}Ve(h,ce=>{D.value=ce==="html"?"preview":"source",R.value="preview",H.value="fit"});const V=B(()=>{const ce=c.file;return!ce||h.value!=="image"?null:ce.sourceUrl?ce.sourceUrl:ce.encoding==="base64"?`data:${ce.mime};base64,${ce.content}`:ce.mime==="image/svg+xml"?`data:${ce.mime};charset=utf-8,${encodeURIComponent(ce.content)}`:null}),re=B(()=>{const ce=c.file;return!ce||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ce.encoding==="base64"?`data:${ce.mime};base64,${ce.content}`:null}),pe=B(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function ne(ce){const z=[];let Y="",oe=!1;for(let W=0;W<ce.length;W++){const Z=ce[W];Z==='"'&&ce[W+1]==='"'?(Y+='"',W++):Z==='"'?oe=!oe:Z===","&&!oe?(z.push(Y),Y=""):Y+=Z}return z.push(Y),z}const X=B(()=>b.value.slice(0,200).map(ne));function he(ce){return ce.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Pe(){const ce=c.file;if(!ce)return"";const z=ce.languageId?.toLowerCase();return z||(ce.path.split(".").pop()?.toLowerCase()??"")}function je(ce){const z=Pe();let Y=he(ce);return h.value==="json"||z==="json"||z==="jsonc"?(Y=Y.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Y=Y.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Y=Y.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Y=Y.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Y):h.value==="html"||z==="html"||z==="xml"||z==="svg"?(Y=Y.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Y=Y.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Y=Y.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Y):(Y=Y.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>'),Y=Y.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Y=Y.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Y)}function it(ce,z=55){return!ce||ce.length<=z?ce:"…"+ce.slice(ce.length-z+1)}return(ce,z)=>(w(),N("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),N("div",Kte,[x("span",null,O(e.error),1),e.closable?(w(),ye(Ot,{key:0,variant:"secondary",size:"sm",onClick:z[0]||(z[0]=Y=>u("close"))},{default:be(()=>[Ue(O(C(n)("filePreview.close")),1)]),_:1})):le("",!0)])):!e.file&&!e.loading?(w(),N("div",Gte,O(C(n)("filePreview.empty")),1)):e.loading?(w(),N("div",Yte,[z[7]||(z[7]=x("span",{class:"spinner"},null,-1)),x("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(w(),N(Oe,{key:3},[ie(Yl,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:z[6]||(z[6]=Y=>u("close"))},{default:be(()=>[ie(qt,{text:e.file.path},{default:be(()=>[x("span",Qte,O(it(e.file.path)),1)]),_:1},8,["text"]),x("span",Xte,[e.file.lineCount?(w(),N("span",Zte,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):le("",!0),x("span",Jte,O(M(e.file.size)),1)]),h.value==="html"?(w(),ye(eo,{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":U},null,8,["model-value","options"])):le("",!0),h.value==="markdown"?(w(),ye(eo,{key:1,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":G},null,8,["model-value","options"])):le("",!0),h.value==="image"?(w(),ye(eo,{key:2,"model-value":H.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Q},null,8,["model-value","options"])):le("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),N("div",ene,[_n(x("input",{"onUpdate:modelValue":z[1]||(z[1]=Y=>v.value=Y),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,tne),[[lo,v.value]]),v.value.trim()?(w(),N("span",nne,O(T.value.length),1)):le("",!0),ie(wn,{size:"sm",disabled:T.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:z[2]||(z[2]=Y=>I(-1))},{default:be(()=>[ie(Xe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(wn,{size:"sm",disabled:T.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:z[3]||(z[3]=Y=>I(1))},{default:be(()=>[ie(Xe,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):le("",!0),ie(wn,{size:"sm",class:Re({copied:L.value}),label:L.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:E},{default:be(()=>[L.value?(w(),ye(Xe,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ye(Xe,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),ye(wn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:z[4]||(z[4]=Y=>u("openExternal"))},{default:be(()=>[ie(Xe,{name:"external-link",size:"md"})]),_:1},8,["label"])):le("",!0),e.externalActions?(w(),ye(wn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:z[5]||(z[5]=Y=>u("reveal"))},{default:be(()=>[ie(Xe,{name:"folder",size:"md"})]),_:1},8,["label"])):le("",!0),e.downloadUrl?(w(),N("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ie(Xe,{name:"download",size:"md"})],8,sne)):le("",!0),!e.file.isBinary&&h.value!=="image"?(w(),ye(wn,{key:7,size:"sm",class:Re({copied:$.value}),label:$.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:be(()=>[$.value?(w(),ye(Xe,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ye(Xe,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):le("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),N("div",{key:0,class:Re(["fp-body",{"fp-markdown":R.value==="preview"}])},[R.value==="preview"?(w(),ye(Fh,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),N("div",one,[x("div",ine,[(w(!0),N(Oe,null,tt(b.value,(Y,oe)=>(w(),N("div",{key:oe,class:Re(["fp-line-row",k(oe+1)]),"data-line":oe+1},[x("span",lne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Y)},null,8,ane)],10,rne))),128))])]))],2)):h.value==="json"?(w(),N("div",cne,[x("div",une,[(w(!0),N(Oe,null,tt(b.value,(Y,oe)=>(w(),N("div",{key:oe,class:Re(["fp-line-row",k(oe+1)]),"data-line":oe+1},[x("span",fne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Y)},null,8,pne)],10,dne))),128))])])):h.value==="html"?(w(),N("div",hne,[D.value==="preview"?(w(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:pe.value,title:e.file.path},null,8,mne)):(w(),N("div",gne,[x("div",vne,[(w(!0),N(Oe,null,tt(b.value,(Y,oe)=>(w(),N("div",{key:oe,class:Re(["fp-line-row",k(oe+1)]),"data-line":oe+1},[x("span",kne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Y)},null,8,bne)],10,yne))),128))])]))])):h.value==="pdf"?(w(),N("div",_ne,[re.value?(w(),N("iframe",{key:0,class:"fp-pdf-frame",src:re.value,title:e.file.path},null,8,wne)):(w(),N("div",Sne,[x("span",Cne,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),N("div",xne,[x("table",Ane,[x("tbody",null,[(w(!0),N(Oe,null,tt(X.value,(Y,oe)=>(w(),N("tr",{key:oe,class:Re(k(oe+1)),"data-line":oe+1},[x("th",null,O(oe+1),1),(w(!0),N(Oe,null,tt(Y,(W,Z)=>(w(),N("td",{key:Z},O(W),1))),128))],10,Tne))),128))])])])):h.value==="image"?(w(),N("div",Mne,[V.value?(w(),N("img",{key:0,src:V.value,alt:e.file.path,class:Re(["fp-image",{actual:H.value==="actual"}])},null,10,Ene)):(w(),N("div",Ine,[x("span",$ne,[ie(Xe,{name:"image-off",size:"lg"})]),x("span",Nne,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(w(),N("div",Lne,[x("div",One,[(w(!0),N(Oe,null,tt(b.value,(Y,oe)=>(w(),N("div",{key:oe,class:Re(["fp-line-row",k(oe+1)]),"data-line":oe+1},[x("span",Rne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Y)},null,8,Dne)],10,Pne))),128))])])):(w(),N("div",Bne,[x("div",Fne,[x("span",Hne,[ie(Xe,{name:"file-off",size:"lg"})]),x("span",Wne,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):le("",!0)],512))}}),Une=dt(zne,[["__scopeId","data-v-62bfaf2d"]]),jne={class:"tp"},qne=qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),i=J(null);return Ve(()=>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(),N("div",jne,[ie(Yl,{title:C(o)("common.preview"),subtitle:e.subtitle??C(o)("thinking.panelTitle"),"close-label":C(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),x("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),rC=dt(qne,[["__scopeId","data-v-6af94b37"]]),Vne={class:"ap"},Kne={key:0,class:"ap-type"},Gne={key:1,class:"ap-reason"},Yne={key:2,class:"ap-field"},Qne={class:"ap-field-body"},Xne={key:3,class:"ap-field"},Zne={class:"ap-field-body ap-live"},Jne={key:4,class:"ap-field"},ese={class:"ap-field-body ap-progress"},tse={key:0,class:"ap-call"},nse={key:1,class:"ap-output"},sse=["onClick"],ose={key:5,class:"ap-field"},ise={class:"ap-field-body"},rse=8,lC=5,aC=2,lse=qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),i=B(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=B(()=>(n.member.text??"").trimEnd());function l(m){const _=[];let b=null,g=0;for(const v of m)v.startsWith("Calling ")?(b={key:`g${g++}`,call:v,output:[]},_.push(b)):b?b.output.push(v):(b={key:`g${g++}`,call:"",output:[v]},_.push(b));return _}const a=B(()=>l(i.value)),c=J(new Set);function u(m){return c.value.has(m)}function d(m){const _=new Set(c.value);_.has(m)?_.delete(m):_.add(m),c.value=_}function f(m){return m.output.length-lC-aC}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=J(null);return Ve(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||mt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,_)=>(w(),N("div",Vne,[ie(Yl,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:_[0]||(_[0]=b=>s("close"))},{default:be(()=>[ie(Ns,{variant:"neutral",size:"sm",class:"ap-phase"},{default:be(()=>[Ue(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),x("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),N("div",Kne,O(e.member.subagentType),1)):le("",!0),e.member.suspendedReason?(w(),N("div",Gne,O(e.member.suspendedReason),1)):le("",!0),e.member.prompt?(w(),N("div",Yne,[_[1]||(_[1]=x("span",{class:"ap-field-label"},"Task",-1)),x("div",Qne,O(e.member.prompt),1)])):le("",!0),r.value?(w(),N("div",Xne,[_[2]||(_[2]=x("span",{class:"ap-field-label"},"Output",-1)),x("div",Zne,O(r.value),1)])):le("",!0),a.value.length>0?(w(),N("div",Jne,[_[4]||(_[4]=x("span",{class:"ap-field-label"},"Progress",-1)),x("div",ese,[(w(!0),N(Oe,null,tt(a.value,b=>(w(),N("div",{key:b.key,class:"ap-group"},[b.call?(w(),N("div",tse,[_[3]||(_[3]=x("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Ue(" "+O(b.call),1)])):le("",!0),b.output.length>0?(w(),N("div",nse,[b.output.length<=rse||u(b.key)?(w(!0),N(Oe,{key:0},tt(b.output,(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},O(g),1))),128)):(w(),N(Oe,{key:1},[(w(!0),N(Oe,null,tt(b.output.slice(0,lC),(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},O(g),1))),128)),x("button",{type:"button",class:"ap-fold",onClick:g=>d(b.key)}," … ("+O(f(b))+" more) ",9,sse),(w(!0),N(Oe,null,tt(b.output.slice(-aC),(g,v)=>(w(),N("div",{key:"t"+v,class:"ap-out-line"},O(g),1))),128))],64))])):le("",!0)]))),128))])])):le("",!0),e.member.summary?(w(),N("div",ose,[_[5]||(_[5]=x("span",{class:"ap-field-label"},"Result",-1)),x("div",ise,O(e.member.summary),1)])):le("",!0)],512)]))}}),ase=dt(lse,[["__scopeId","data-v-715bd93e"]]),cse={class:"diff-lines"},use={key:0,class:"hunk-text"},dse={class:"dl-gutter old"},fse={class:"dl-gutter new"},pse={class:"dl-sign"},hse={class:"dl-text"},mse=qe({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(w(),N("div",cse,[(w(!0),N(Oe,null,tt(e.lines,(r,l)=>(w(),N("div",{key:l,class:Re(["dl",s(r)])},[r.type==="hunk"?(w(),N("span",use,O(r.text),1)):(w(),N(Oe,{key:1},[x("span",dse,O(t(r)),1),x("span",fse,O(n(r)),1),x("span",pse,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),x("span",hse,O(r.text),1)],64))],2))),128))]))}}),B3=dt(mse,[["__scopeId","data-v-2f6bc1cc"]]),gse={class:"tdp"},vse={class:"tdp-body"},yse={key:1,class:"tdp-output"},kse={key:2,class:"tdp-empty"},bse=qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=At();return(o,i)=>(w(),N("div",gse,[ie(Yl,{title:e.target.title,subtitle:e.target.path,"close-label":C(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),x("div",vse,[e.target.lines&&e.target.lines.length>0?(w(),ye(B3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),N("div",yse,[(w(!0),N(Oe,null,tt(e.target.output,(r,l)=>(w(),N("div",{key:l},O(r),1))),128))])):(w(),N("div",kse,O(C(s)("diff.noDiff")),1))])]))}}),_se=dt(bse,[["__scopeId","data-v-76f2fbca"]]),wse={class:"sc"},Sse={key:0,class:"sc-empty"},Cse={key:2,class:"sc-loading","aria-hidden":"true"},xse={class:"sc-composer"},Ase=["placeholder"],Tse=["disabled"],Mse=qe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At(),i=B(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=B(()=>n.title?.trim()||o("sideChat.title")),l=B(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=J(""),c=J(null),u=J(null);function d(){const b=a.value.trim();b&&(s("send",b),a.value="",mt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const b=u.value;b&&(b.scrollTop=b.scrollHeight)}const h=B(()=>{const b=n.turns;if(b.length===0)return"0";const g=b.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((T,P)=>T+P.name.length+(P.arg?.length??0)+(P.output?.join("").length??0),0)??0;return`${b.length}:${g.text.length}:${v}:${y}`});Ve(h,async()=>{!n.running&&!n.sending||(await mt(),f())});const p=B(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(b){b.key==="Enter"&&!b.shiftKey&&!b.isComposing&&(b.preventDefault(),d())}function _(){const b=c.value;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,160)}px`)}return(b,g)=>(w(),N("div",wse,[ie(Yl,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),x("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),N("div",Sse,O(C(o)("sideChat.empty")),1)):(w(),ye(L3,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(w(),N("div",Cse,[ie(N3)])):le("",!0)],512),x("div",xse,[_n(x("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,Ase),[[lo,a.value]]),ie(qt,{text:C(o)("sideChat.send")},{default:be(()=>[x("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(Xe,{name:"arrow-right",size:"sm"})],8,Tse)]),_:1},8,["text"])])]))}}),Ese=dt(Mse,[["__scopeId","data-v-9ee5df02"]]),Ise={class:"changes-pane"},$se={class:"dv-path"},Nse={class:"diff-head"},Lse={class:"back-label"},Ose={key:0,class:"empty-state"},Pse={key:1,class:"dv-lines-wrap"},Rse={key:2,class:"empty-state"},Dse={class:"dv-change-count"},Bse={class:"ch-head"},Fse={class:"br-label"},Hse={class:"br-name"},Wse={key:0,class:"sync-info"},zse={key:0,class:"ahead"},Use={key:0,class:"behind"},jse={key:1,class:"empty-head"},qse={key:0,class:"ch-list"},Vse=["onClick"],Kse={class:"fpath"},Gse={key:1,class:"ch-list ch-tree"},Yse={class:"tree-list"},Qse=["onClick"],Xse={class:"tree-name"},Zse=["onClick"],Jse={class:"tree-name"},eoe={key:2,class:"empty-state"},toe={key:3,class:"empty-state"},noe=qe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t;function i(L){const S=L.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(L){return r[i(L)]??"?"}function a(L,S=60){return L.length<=S?L:"…"+L.slice(L.length-S+1)}const c=B(()=>s.gitInfo!==null),u=B(()=>s.changes.length>0),d=B(()=>(s.selectedDiffPath??null)!==null),f=B(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=B(()=>s.fileDiff??[]),p=B(()=>s.fileDiffLoading===!0);function m(L){o("open",L)}function _(){o("back")}function b(){o("close")}const g=J("list");function v(L){g.value=L}function y(L){const S={children:[]},E=[...L].sort((D,R)=>D.path.localeCompare(R.path));for(const D of E){const R=D.path.split("/");let H=S;for(let U=0;U<R.length;U++){const G=R[U],Q=U===R.length-1,V=R.slice(0,U+1).join("/");let re=H.children.find(pe=>pe.name===G&&pe.kind===(Q?"file":"folder"));re||(re={name:G,path:V,kind:Q?"file":"folder",status:Q?D.status:void 0,children:[]},H.children.push(re)),H=re}}return S.children}const T=B(()=>y(s.changes)),P=J(new Set);function I(L){return!P.value.has(L)}const k=B(()=>{const L=[];function S(E,D){for(const R of E)L.push({node:R,depth:D}),R.kind==="folder"&&I(R.path)&&S(R.children,D+1)}return S(T.value,0),L});function M(L){const S=new Set(P.value);S.has(L.path)?S.delete(L.path):S.add(L.path),P.value=S}function $(L){return`${16+L*16}px`}return(L,S)=>(w(),N("div",Ise,[f.value?(w(),N(Oe,{key:0},[ie(Yl,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:b},{default:be(()=>[ie(qt,{text:e.selectedDiffPath??""},{default:be(()=>[x("span",$se,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),x("div",Nse,[e.hideBack?le("",!0):(w(),ye(Ot,{key:0,variant:"ghost",size:"sm",onClick:_},{default:be(()=>[S[0]||(S[0]=x("span",{"aria-hidden":"true"},"←",-1)),x("span",Lse,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(w(),N("div",Ose,O(C(n)("diff.loading")),1)):h.value.length>0?(w(),N("div",Pse,[ie(B3,{lines:h.value},null,8,["lines"])])):(w(),N("div",Rse,O(C(n)("diff.noDiff")),1))],64)):(w(),N(Oe,{key:1},[ie(Yl,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:b},{default:be(()=>[x("span",Dse,O(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(eo,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),x("div",Bse,[c.value?(w(),N(Oe,{key:0},[x("span",Fse,O(C(n)("diff.branch")),1),x("span",Hse,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),N("span",Wse,[ie(qt,{text:C(n)("diff.aheadTitle")},{default:be(()=>[e.gitInfo.ahead>0?(w(),N("span",zse,"↑"+O(e.gitInfo.ahead),1)):le("",!0)]),_:1},8,["text"]),ie(qt,{text:C(n)("diff.behindTitle")},{default:be(()=>[e.gitInfo.behind>0?(w(),N("span",Use,"↓"+O(e.gitInfo.behind),1)):le("",!0)]),_:1},8,["text"])])):le("",!0)],64)):(w(),N("span",jse,O(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(w(),N("div",qse,[(w(!0),N(Oe,null,tt(e.changes,E=>(w(),ye(qt,{key:E.path,text:E.path},{default:be(()=>[x("button",{type:"button",class:"ch-row",onClick:D=>m(E.path)},[x("span",{class:Re(["badge",i(E.status)])},O(l(E.status)),3),x("span",Kse,O(a(E.path)),1)],8,Vse)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(w(),N("div",Gse,[x("ul",Yse,[(w(!0),N(Oe,null,tt(k.value,({node:E,depth:D})=>(w(),N("li",{key:E.path,class:"tree-node"},[E.kind==="folder"?(w(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:Qt({paddingLeft:$(D)}),onClick:R=>M(E)},[ie(Xe,{class:"tree-icon",name:"folder-solid",size:"sm"}),x("span",Xse,O(E.name),1)],12,Qse)):(w(),ye(qt,{key:1,text:E.path},{default:be(()=>[x("button",{type:"button",class:"tree-row tree-file",style:Qt({paddingLeft:$(D)}),onClick:R=>m(E.path)},[x("span",{class:Re(["badge",i(E.status)])},O(l(E.status)),3),x("span",Jse,O(E.name),1)],12,Zse)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),N("div",eoe,O(C(n)("diff.clean")),1)):(w(),N("div",toe,O(C(n)("diff.empty")),1))],64))]))}}),soe=dt(noe,[["__scopeId","data-v-7778610a"]]);function xy(e,t){let n=null;yn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,mt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),fs(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const ooe=["type","value","placeholder","disabled","readonly"],ioe=qe({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const s=n,o=J();function i(a){s("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,c)=>(w(),N("input",{ref_key:"el",ref:o,class:Re(["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,ooe))}}),ql=dt(ioe,[["__scopeId","data-v-340f0da2"]]),roe={class:"search-wrap"},loe={key:0,class:"tab-strip"},aoe={key:1,class:"state-row"},coe={key:2,class:"state-row unavail"},uoe={key:3,class:"model-list"},doe=["aria-selected","onClick","onMouseenter"],foe={class:"check"},poe={class:"model-main"},hoe={class:"model-name"},moe={class:"model-id"},goe={key:0,class:"caps"},voe={class:"model-provider"},yoe={class:"model-ctx"},koe={key:0,class:"empty"},boe={class:"footer-hint"},_oe=qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=B(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=J(""),a=J(null),c=J(null),u=J("all");xy(c,a);const d=B(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const T of s.models)v.has(T.provider)||(v.add(T.provider),y.push({id:T.provider,label:T.provider}));return y}),f=B(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(T=>{if(u.value!=="all"&&T.provider!==u.value)return!1;const P=(T.displayName??T.model).toLowerCase().includes(v),I=T.provider.toLowerCase().includes(v),k=T.id.toLowerCase().includes(v);return!v||P||I||k});return u.value!=="all"?y:y.sort((T,P)=>{const I=r(T.id)?1:0;return(r(P.id)?1:0)-I})}),h=B(()=>f.value),p=J(0);Ve([l,u],()=>{p.value=0}),Ve(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ve(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const y=h.value[p.value];y&&o("select",y.id)}}yn(()=>{document.addEventListener("keydown",m)}),xn(()=>{document.removeEventListener("keydown",m)});function _(v){o("select",v)}function b(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(w(),ye(dr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=T=>o("close"))},{default:be(()=>[x("div",{ref_key:"dialogRef",ref:c,class:"mp"},[x("div",roe,[ie(ql,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=T=>l.value=T),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),N("div",loe,[(w(!0),N(Oe,null,tt(d.value,T=>(w(),ye(Ot,{key:T.id,variant:T.id===u.value?"secondary":"ghost",size:"sm",onClick:P=>g(T.id)},{default:be(()=>[Ue(O(T.label),1)]),_:2},1032,["variant","onClick"]))),128))])):le("",!0),e.loading?(w(),N("div",aoe,[ie(ii,{size:"sm"}),x("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(w(),N("div",coe,[ie(Xe,{name:"alert-triangle",size:"lg"}),x("span",null,O(C(n)("model.unavailable")),1)])):(w(),N("div",uoe,[(w(!0),N(Oe,null,tt(h.value,T=>(w(),N("div",{key:T.id,class:Re(["model-row",{"is-current":T.id===e.current,"is-selected":b(T)===p.value}]),role:"option","aria-selected":T.id===e.current,onClick:P=>_(T.id),onMouseenter:P=>p.value=b(T)},[x("span",foe,[T.id===e.current?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):le("",!0)]),x("span",poe,[x("span",hoe,O(T.displayName??T.model),1),x("span",moe,O(T.id),1),T.capabilities&&T.capabilities.length>0?(w(),N("span",goe,[(w(!0),N(Oe,null,tt(T.capabilities,P=>(w(),ye(Ns,{key:P,variant:"info",size:"sm"},{default:be(()=>[Ue(O(P),1)]),_:2},1024))),128))])):le("",!0)]),x("span",voe,O(T.provider),1),x("span",yoe,O(C(n)("model.contextSuffix",{size:Math.round(T.maxContextSize/1e3)})),1),ie(wn,{size:"sm",label:r(T.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:vt(P=>o("toggle-star",T.id),["stop"])},{default:be(()=>[r(T.id)?(w(),ye(Xe,{key:0,name:"star",size:"md"})):(w(),ye(Xe,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,doe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),N("div",koe,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):le("",!0)])),x("div",boe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),woe=dt(_oe,[["__scopeId","data-v-e93073d7"]]),Soe={key:0,class:"ui-field__label"},Coe={key:1,class:"ui-field__error"},xoe={key:2,class:"ui-field__hint"},Aoe=qe({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),N("label",Soe,O(e.label),1)):le("",!0),Nn(t.$slots,"default",{},void 0,!0),e.error?(w(),N("span",Coe,O(e.error),1)):e.hint?(w(),N("span",xoe,O(e.hint),1)):le("",!0)],2))}}),au=dt(Aoe,[["__scopeId","data-v-49bce958"]]),Toe=["value","disabled"],Moe=qe({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(w(),N("select",{class:Re(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[Nn(o.$slots,"default",{},void 0,!0)],42,Toe))}}),U1=dt(Moe,[["__scopeId","data-v-92a040fd"]]),Eoe={class:"prov-list"},Ioe={key:0,class:"state-row"},$oe={key:1,class:"state-row unavail"},Noe={key:2,class:"empty"},Loe={class:"prov-info"},Ooe={class:"prov-type"},Poe={key:0,class:"prov-url"},Roe={class:"prov-meta"},Doe={key:0},Boe={class:"prov-actions"},Foe={key:0,class:"add-section"},Hoe={key:0,class:"add-btns"},Woe={key:1,class:"add-form"},zoe=["value"],Uoe={key:0,class:"add-error"},joe={class:"form-btns"},qoe={class:"footer-hint"},Voe=qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=At(),{confirm:s}=ll(),o=J(null);xy(o);const i=t;async function r(b){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",b)}const l=J(!1),a=Ls({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=J(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function h(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function p(b){if(b.key==="Escape"){if(l.value){f();return}i("close")}}yn(()=>document.addEventListener("keydown",p)),xn(()=>document.removeEventListener("keydown",p));function m(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function _(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,g)=>(w(),ye(dr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:be(()=>[x("div",{ref_key:"dialogRef",ref:o,class:"pm"},[x("div",Eoe,[e.loading?(w(),N("div",Ioe,[ie(ii,{size:"sm"}),x("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(w(),N("div",$oe,[ie(Xe,{name:"alert-triangle",size:"md"}),x("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),N("div",Noe,O(C(n)("providers.empty")),1)):(w(!0),N(Oe,{key:3},tt(e.providers,v=>(w(),N("div",{key:v.id,class:"prov-row"},[ie(qt,{text:_(v.status)},{default:be(()=>[x("span",{class:Re(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Qt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),x("div",Loe,[x("span",Ooe,O(v.type),1),v.baseUrl?(w(),N("span",Poe,O(v.baseUrl),1)):le("",!0),x("span",Roe,[ie(Ns,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:be(()=>[Ue(O(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(w(),N("span",Doe," · "+O(C(n)("providers.modelCount",{count:v.models.length})),1)):le("",!0)])]),x("div",Boe,[ie(qt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:be(()=>[ie(Ot,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:be(()=>[Ue(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(qt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:be(()=>[ie(Ot,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:be(()=>[Ue(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?le("",!0):(w(),N("div",Foe,[l.value?(w(),N("div",Woe,[ie(au,{label:C(n)("providers.fieldType")},{default:be(()=>[ie(U1,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:be(()=>[(w(),N(Oe,null,tt(u,v=>x("option",{key:v,value:v},O(v),9,zoe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(au,{label:C(n)("providers.fieldApiKey")},{default:be(()=>[ie(ql,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ie(au,{label:C(n)("providers.fieldBaseUrl")},{default:be(()=>[ie(ql,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(au,{label:C(n)("providers.fieldDefaultModel")},{default:be(()=>[ie(ql,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(w(),N("div",Uoe,O(c.value),1)):le("",!0),x("div",joe,[ie(Ot,{variant:"primary",size:"sm",onClick:h},{default:be(()=>[Ue(O(C(n)("providers.add")),1)]),_:1}),ie(Ot,{variant:"secondary",size:"sm",onClick:f},{default:be(()=>[Ue(O(C(n)("common.cancel")),1)]),_:1})])])):(w(),N("div",Hoe,[ie(Ot,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:be(()=>[ie(Xe,{name:"user",size:"sm"}),Ue(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),ie(Ot,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:be(()=>[ie(Xe,{name:"user",size:"sm"}),Ue(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Ot,{variant:"primary",size:"sm",onClick:d},{default:be(()=>[ie(Xe,{name:"plus",size:"sm"}),Ue(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),x("div",qoe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Koe=dt(Voe,[["__scopeId","data-v-fb6f1365"]]),Goe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Yoe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Qoe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},hv=qe({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),N("svg",Goe,[...n[0]||(n[0]=[x("circle",{cx:"18",cy:"18",r:"15"},null,-1),x("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),N("svg",Yoe,[...n[1]||(n[1]=[x("circle",{cx:"14",cy:"14",r:"12"},null,-1),x("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),x("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),N("svg",Qoe,[...n[2]||(n[2]=[x("path",{d:"M14 3 L26 24 H2 Z"},null,-1),x("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),x("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Xoe={key:0,class:"center-body"},Zoe={class:"center-text"},Joe={key:1,class:"nb"},eie={class:"nb-lead"},tie=["href"],nie={class:"nb-or"},sie={class:"nb-fallback"},oie={class:"nb-fb-text"},iie=["href"],rie={class:"nb-code-row"},lie={class:"nb-code"},aie={class:"nb-status"},cie={class:"nb-status-text"},uie={class:"nb-countdown"},die={key:2,class:"center-body"},fie={class:"center-text success-text"},pie={class:"center-hint"},hie={class:"center-body"},mie={class:"center-text err-text"},gie={class:"center-hint"},vie={class:"actions"},yie={class:"center-body"},kie={class:"center-text warn-text"},bie={class:"center-hint"},_ie={class:"actions"},wie=qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=At(),s=J(!0),o=t,i=e,r=J("starting"),l=J(null),a=J(0),c=J(!1);let u=null,d=null;yn(async()=>{await f()}),xn(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",h(),p(y.interval)}function h(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function p(y){u&&clearTimeout(u),u=setTimeout(async()=>{const T=await i.onPollOAuthLogin();T?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):T?.status==="expired"||T?.status==="cancelled"?(m(),r.value="expired"):p(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function b(){!l.value||!await js(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(y){const T=Math.floor(y/60),P=y%60;return`${T}:${String(P).padStart(2,"0")}`}return(y,T)=>(w(),ye(dr,{open:s.value,"onUpdate:open":T[0]||(T[0]=P=>s.value=P),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:be(()=>[r.value==="starting"?(w(),N("div",Xoe,[ie(ii,{size:"md"}),x("span",Zoe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(w(),N("div",Joe,[x("div",eie,O(C(n)("login.lead")),1),x("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Ue(O(C(n)("login.authorizeInBrowser"))+" ",1),ie(Xe,{name:"external-link",size:"sm"})],8,tie),x("div",nie,O(C(n)("login.orDivider")),1),x("div",sie,[x("div",oie,[Ue(O(C(n)("login.fallbackPrefix")),1),x("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,iie),Ue(O(C(n)("login.fallbackSuffix")),1)]),x("div",rie,[x("span",lie,O(l.value.userCode),1),ie(Ot,{class:Re(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:b},{default:be(()=>[c.value?(w(),N(Oe,{key:0},[ie(Xe,{name:"check",size:"sm"}),Ue(" "+O(C(n)("login.copied")),1)],64)):(w(),N(Oe,{key:1},[ie(Xe,{name:"copy",size:"sm"}),Ue(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),x("div",aie,[ie(ii,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),x("span",cie,O(C(n)("login.waitingAutoClose")),1),x("span",uie,O(v(a.value)),1)])])):r.value==="success"?(w(),N("div",die,[ie(hv,{kind:"success"}),x("span",fie,O(C(n)("login.success")),1),x("span",pie,O(C(n)("login.successHint")),1)])):r.value==="expired"?(w(),N(Oe,{key:3},[x("div",hie,[ie(hv,{kind:"expired"}),x("span",mie,O(C(n)("login.expiredTitle")),1),x("span",gie,O(C(n)("login.expiredHint")),1)]),x("div",vie,[ie(Ot,{variant:"primary",onClick:_},{default:be(()=>[Ue(O(C(n)("login.retry")),1)]),_:1}),ie(Ot,{variant:"secondary",onClick:g},{default:be(()=>[Ue(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),N(Oe,{key:4},[x("div",yie,[ie(hv,{kind:"error"}),x("span",kie,O(C(n)("login.errorTitle")),1),x("span",bie,O(C(n)("login.errorHint")),1)]),x("div",_ie,[ie(Ot,{variant:"primary",onClick:_},{default:be(()=>[Ue(O(C(n)("login.retry")),1)]),_:1}),ie(Ot,{variant:"secondary",onClick:g},{default:be(()=>[Ue(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):le("",!0)]),_:1},8,["open","title"]))}}),Sie=dt(wie,[["__scopeId","data-v-b228800e"]]);function Cie(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function xie(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Aie(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),a=new Map;for(const h of t)l.has(h.root)||a.has(h.root)||a.set(h.root,{...h});for(const h of n){const p=h.cwd;p&&(l.has(p)||a.has(p)||a.set(p,{id:h.workspaceId??p,root:p,name:Cie(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=xie(t,h);c.set(p,(c.get(p)??0)+1)}const u=[...new Set(t.filter(h=>!l.has(h.root)).map(h=>h.root))],d=[...a.keys()].filter(h=>!u.includes(h));d.sort((h,p)=>h.localeCompare(p));const f=[];for(const h of[...u,...d]){const p=a.get(h),m=c.get(p.id)??c.get(p.root)??0,_=r[p.id]===!1?m:Math.max(p.sessionCount,m);let b=p.branch;!b&&i&&o===p.root&&(b=i),f.push({...p,sessionCount:_,branch:b})}return f}function Tie(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const s=e.filter(o=>{const i=Date.parse(o.createdAt);return!Number.isNaN(i)&&i<n});return s.length>0?[...s,...t]:t}function Mie(e){const t=new Map,n=new Set;function s(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&s(i)});return t.set(i,l),l}function o(i){if(t.has(i)){n.add(i);return}s(i)}return{run:s,request:o}}const Eie=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Iie(e){return Eie.has(e.type)}function $ie(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Nie(e,t,n=$ie){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}const F3=["blue","mono"],H3=["light","dark","system"],W3=14,Lie=12,Oie=20;function Pie(){const e=ts(It.accent);return e&&F3.includes(e)?e:"blue"}function Rie(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Die(){const e=ts(It.colorScheme);return e&&H3.includes(e)?e:"system"}function Bie(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function Ay(e){return Number.isFinite(e)?Math.min(Oie,Math.max(Lie,Math.round(e))):W3}function Fie(){const e=ts(It.uiFontSize);return e===null?W3:Ay(Number(e))}function Hie(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Ay(e)}px`)}const Ty=J(Die()),My=J(Pie()),Ey=J(Fie());Ve(Ty,Bie,{immediate:!0});Ve(My,Rie,{immediate:!0});Ve(Ey,Hie,{immediate:!0});function Wie(e){H3.includes(e)&&(Ty.value=e,os(It.colorScheme,e))}function zie(e){F3.includes(e)&&(My.value=e,os(It.accent,e))}function Uie(e){const t=Ay(e);Ey.value=t,os(It.uiFontSize,String(t))}const jie=600,qie=250,Hh=250,Vie=1e3,Kie=160,zp=J(!1);let Ll=[],Dl=null,Up=-Hh;function Gie(){Ll=[],Up=-Hh,zp.value=!1,Dl!==null&&(clearTimeout(Dl),Dl=null)}function Yie(){zp.value=!0,Dl!==null&&clearTimeout(Dl),Dl=setTimeout(()=>{Dl=null,Ll=[],Up=-Hh,zp.value=!1},Vie)}function Qie(e){if(e<=0)return;const t=Date.now();Ll.push({time:t,chars:e});const n=t-jie;if(Ll=Ll.filter(l=>l.time>=n),t-Up<Hh)return;Up=t;const s=Ll[0]?.time??t,o=Math.max(t-s,qie);Ll.reduce((l,a)=>l+a.chars,0)/o*1e3>=Kie&&Yie()}function z3(){return{colorScheme:Ty,accent:My,uiFontSize:Ey,fastMoon:zp,setColorScheme:Wie,setAccent:zie,setUiFontSize:Uie,resetFastMoon:Gie,recordMoonDelta:Qie}}function U3(e,t){const n=ts(e);return n===null?t:n==="1"}const Iy=J(U3(It.notifyOnComplete,!0)),$y=J(U3(It.notifyOnQuestion,!1)),Ny=J(typeof Notification<"u"?Notification.permission:"denied"),Xie="/favicon.ico";async function j3(e,t,n){if(!n){e.value=!1,os(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}Ny.value=s,s==="granted"&&(e.value=!0,os(t,"1"))}function Zie(e){return j3(Iy,It.notifyOnComplete,e)}function Jie(e){return j3($y,It.notifyOnQuestion,e)}function q3(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function ere(e){return{title:Bn.global.t("settings.notifyTitle"),body:q3(e,Bn.global.t("settings.notifyFallback"))}}function tre(e,t){return{title:Bn.global.t("settings.notifyQuestionTitle"),body:q3(t,e,Bn.global.t("settings.notifyQuestionFallback"))}}function V3(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{Ny.value=i,i==="granted"&&cC(t,n,s)});return}cC(t,n,s)}}function cC(e,t,n){if(!e.isActiveAndVisible)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:Xie});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function nre(e,t){V3(Iy.value,t,ere(t.sessionTitle),`kimi-complete-${e}`)}function sre(e,t){V3($y.value,t,tre(t.sessionTitle,t.questionPreview),`kimi-question-${e}`)}function ore(){return{notifyOnComplete:Iy,notifyOnQuestion:$y,notifyPermission:Ny,setNotifyOnComplete:Zie,setNotifyOnQuestion:Jie,maybeNotifyCompletion:nre,maybeNotifyQuestion:sre}}function ire(){return ts(It.soundOnComplete)==="1"}const gd=J(ire());function rre(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let mv=null;function K3(){const e=rre();if(!e)return null;if(mv===null)try{mv=new e}catch{return null}return mv}function G3(){if(!gd.value)return;const e=K3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Dr("sound: audio context resumed",{state:e.state})},t=>{Dr("sound: audio context resume rejected",{error:String(t)})})}let uC=!1;function lre(){if(uC||typeof window>"u")return;uC=!0;const e=()=>{G3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}lre();function are(e){gd.value=e,os(It.soundOnComplete,e?"1":"0"),e&&G3()}function dC(e,t,n,s,o){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(o,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+s),i.start(l),i.stop(l+s+.02)}function Y3(){const e=K3();if(e===null){Dr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Dr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Dr("sound: context resumed for next time",{state:e.state})},t=>{Dr("sound: resume rejected",{error:String(t)})});return}try{dC(e,880,0,.16,.18),dC(e,1320,.1,.22,.16),Dr("sound: chime scheduled",{state:e.state})}catch(t){Dr("sound: failed to play",{error:String(t)})}}function cre(){gd.value&&Y3()}function ure(){gd.value&&Y3()}function dre(){return{soundOnComplete:gd,setSoundOnComplete:are,maybePlayCompletionSound:cre,maybePlayQuestionSound:ure}}function fC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const fre=1e3,pre=4096,pC=32*1024;function hre(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await pt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:fC(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]??[],m=pt(),_=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!o.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:pC});y.outputPreview!==void 0&&_.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),_.size===0)return;const b=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:b.map(g=>{const v=_.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=pt();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const y=v.status==="running",T=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!T)&&!(T&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const P=await h.getTask(f,v.id,{withOutput:!0,outputBytes:y?pre:pC});P.outputPreview!==void 0&&m.set(v.id,{preview:P.outputPreview,bytes:P.outputBytes})}catch{}finally{T&&o.add(v.id)}}));const _=e.tasksBySession[f]??[],b=new Map(_.map(v=>[v.id,v])),g=p.map(v=>{const y=b.get(v.id),T=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:T?.preview??y?.outputPreview,outputBytes:T?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:fC(g,_)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},fre))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=J(0);let d=null;return Ve(()=>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}),Ve(()=>{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,m)=>{let _;h&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:i}}const Q3=It.starredModels;function mre(){try{const e=ts(Q3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function gre(e){try{os(Q3,JSON.stringify(e))}catch{}}function vre(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=J([]),d=J(mre()),f=J({}),h=J({}),p=J([]),m=J(null);function _(Q){if(!(Q==null||Q.length===0))return u.value.find(V=>V.id===Q||V.model===Q)}function b(){const Q=e.activeSessionId?e.sessions.find(V=>V.id===e.activeSessionId):void 0;return _(Q?.model??m.value??e.defaultModel)}function g(Q){const V=pc(b(),Q);return e.thinking=V,l(V),V}async function v(Q){try{const re=await pt().listSkills(Q);f.value={...f.value,[Q]:re}}catch{}}async function y(Q){try{const re=await pt().listSkillsForWorkspace(Q);h.value={...h.value,[Q]:re}}catch{}}async function T(){try{const Q=pt();u.value=await Q.listModels(),g(e.thinking)}catch(Q){n("loadModels",Q)}}async function P(){try{const Q=await pt().refreshOAuthProviderModels();for(const V of Q.failed)n("refreshOAuthProviderModels",new Error(V.reason),{message:V.provider})}catch{}}async function I(){try{const Q=pt();p.value=await Q.listProviders()}catch(Q){n("loadProviders",Q)}}async function k(Q){const V=e.activeSessionId,re=pc(_(Q),e.thinking),pe=e.thinking;if(!V){m.value=Q,g(re);return}const ne=e.sessions.find(X=>X.id===V)?.model;a(V,X=>({...X,model:Q})),re!==pe&&(e.thinking=re,l(re));try{await pt().updateSession(V,{model:Q,thinking:re!==pe?re:void 0})}catch(X){a(V,he=>({...he,model:ne??he.model})),re!==pe&&(e.thinking=pe,l(pe)),n("setModel",X,{sessionId:V});return}await s(V)}function M(Q){const V=new Set(d.value);V.has(Q)?V.delete(Q):V.add(Q),d.value=Array.from(V),gre(d.value)}async function $(Q,V){const re=e.activeSessionId;if(!re)return;const pe=i.value==="idle"&&!r.has(re),ne=`msg_skill_opt_${Date.now().toString(36)}`;if(pe){r.add(re),e.sendingBySession={...e.sendingBySession,[re]:!0};const X={id:ne,sessionId:re,role:"user",content:[{type:"text",text:`/${Q}${V?` ${V}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:Q,skillArgs:V}}};c(re,he=>[...he,X])}try{await pt().activateSkill(re,Q,V)}catch(X){pe&&(r.delete(re),e.sendingBySession={...e.sendingBySession,[re]:!1},c(re,he=>he.filter(Pe=>Pe.id!==ne))),n("activateSkill",X,{sessionId:re})}}async function L(Q){try{await pt().addProvider(Q),await Promise.all([I(),T()])}catch(V){n("addProvider",V)}}async function S(Q){try{await pt().deleteProvider(Q),await Promise.all([I(),T()])}catch(V){n("deleteProvider",V)}}async function E(Q){try{const V=await pt().refreshProvider(Q);for(const re of V.failed)n("refreshProvider",new Error(re.reason),{message:re.provider});await Promise.all([I(),T()])}catch(V){n("refreshProvider",V)}}async function D(){try{const Q=await pt().refreshAllProviders();for(const V of Q.failed)n("refreshAllProviders",new Error(V.reason),{message:V.provider});await Promise.all([I(),T()])}catch(Q){n("refreshAllProviders",Q)}}async function R(){try{return await pt().startOAuthLogin()}catch{return null}}async function H(){try{return await pt().pollOAuthLogin()}catch{return null}}async function U(){try{await pt().cancelOAuthLogin()}catch{}}function G(Q){const V=g(Q);o({thinking:V})}return{models:u,starredModelIds:d,providers:p,draftModel:m,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:v,loadSkillsForWorkspace:y,loadModels:T,refreshOAuthProviderModels:P,loadProviders:I,setModel:k,toggleStarModel:M,activateSkill:$,addProvider:L,deleteProvider:S,refreshProvider:E,refreshAllProviders:D,startOAuthLogin:R,pollOAuthLogin:H,cancelOAuthLogin:U,setThinking:G}}const X3="kimiWeb.compaction",yre=/^read[_-]?media(?:file)?$/i,kre=/^data:([^;]+);base64,(.*)$/s,bre=/^<(image|video|audio)\s+path="([^"]+)">$/,_re=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,wre=/Mime type:\s*([^.\s]+)/i,Sre=/Size:\s*(\d+)\s*bytes/i,Cre=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function xre(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Are(e){const t=_re.exec(e.trim());return t?{kind:t[1],path:xre(t[2])}:null}const Tre=/^f_[A-Za-z0-9]{10,}$/;function Mre(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return Tre.test(s)?s:void 0}function Ere(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 Ire(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 $re(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Nre(e,t){if(!yre.test(e))return;const n=Ire(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=bre.exec(h);p&&(o=p[1],s=p[2]);const m=wre.exec(h);m?.[1]&&(i=m[1]);const _=Sre.exec(h);_?.[1]&&(r=Number(_[1]));const b=Cre.exec(h);b?.[1]&&b[2]&&(l=`${b[1]}x${b[2]}`);continue}const f=$re(d);f&&(a=f)}if(a===null)return;const c=kre.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Ere(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Lre(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
269
|
+
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
270
|
+
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
271
|
+
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
272
|
+
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Ore(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 Pre(e,t){const n=e.split(`
|
|
273
|
+
`),s=t.split(`
|
|
274
|
+
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Rre(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Pre(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const s=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Dre(e){const t=`<prompt>
|
|
275
|
+
`,n=`
|
|
276
|
+
</prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):Bre(e)}function Bre(e){const t=e.split(`
|
|
277
|
+
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
278
|
+
`):e}function Fre(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Hre(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
279
|
+
`);return Dre(t)}function Z3(e,t){const n=e.metadata?.origin??{},s=Hre(e);return t==="cron_missed"?{text:s,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:s,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Wre(e,t,n){const{text:s,cron:o}=Z3(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function zre(e,t){const{text:n,cron:s}=Z3(e,t);return{kind:"cron",text:n,cron:s}}function Ure(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 jre(e){return e.metadata?.origin?.kind==="compaction_summary"}function qre(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Vre(e){return e.tools.some(t=>t.status==="running")}function Kre(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 J3(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);let a=null;function c(f=!1){if(!a)return;const h=a;if(a=null,!f||!s)for(let p=0;p<h.tools.length;p++){const m=h.tools[p];if(m.status!=="running")continue;const _={...m,status:"ok"};h.tools[p]=_;const b=h.blocks.find(g=>g.kind==="tool"&&g.tool.id===_.id);b&&b.kind==="tool"&&(b.tool=_)}i.push({id:h.id,role:"assistant",no:r++,text:h.textParts.join(`
|
|
280
|
+
`),thinking:h.thinkingParts.length>0?h.thinkingParts.join(`
|
|
281
|
+
`):void 0,tools:h.tools.length>0?h.tools:void 0,blocks:h.blocks.length>0?h.blocks:void 0,approval:h.approval,approvalId:h.approvalId,durationMs:h.durationMs})}function u(f,h){for(const p of h)if(p.type==="text"){if(p.text){f.textParts.push(p.text);const m=f.blocks.at(-1);m&&m.kind==="text"?m.text+=`
|
|
282
|
+
`+p.text:f.blocks.push({kind:"text",text:p.text})}}else if(p.type==="thinking"){if(p.thinking){f.thinkingParts.push(p.thinking);const m=f.blocks.at(-1);m&&m.kind==="thinking"?m.thinking+=`
|
|
283
|
+
`+p.thinking:f.blocks.push({kind:"thinking",thinking:p.thinking})}}else if(p.type==="toolUse"){const m=l.get(p.toolCallId),_={id:p.toolCallId,name:p.toolName,arg:typeof p.input=="string"?p.input:JSON.stringify(p.input),status:"running",output:p.outputLines,planPath:p.toolName==="ExitPlanMode"?o[p.toolCallId]?.path:void 0};f.tools.push(_),f.blocks.push({kind:"tool",tool:_}),m&&(f.approval=Rre(m),f.approvalId=m.approvalId)}else if(p.type==="toolResult"){const m=f.tools.findIndex(_=>_.id===p.toolCallId);if(m!==-1){const _=f.tools[m],b={..._,status:p.isError?"error":"ok",output:Lre(p.output),media:p.isError?void 0:Nre(_.name,p.output)};b.name==="ExitPlanMode"&&!b.planPath&&(b.planPath=Kre(b.output)),f.tools[m]=b;const g=f.blocks.find(v=>v.kind==="tool"&&v.tool.id===p.toolCallId);g&&g.kind==="tool"&&(g.tool=b)}}}function d(f){if(f.type==="image"||f.type==="video"){const h=f.type,p=f.source;if(p.kind==="url")return{url:p.url,kind:h};if(p.kind==="base64")return{url:`data:${p.mediaType};base64,${p.data}`,kind:h};if(p.kind==="file"&&n)return{url:n(p.fileId),kind:h,fileId:p.fileId}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image",fileId:f.fileId};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video",fileId:f.fileId}}}for(const f of e){if(f.role==="system")continue;if(jre(f)){c();const b=f.metadata?.[X3];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(g=>g.type==="text").map(g=>g.text).join(`
|
|
284
|
+
`),compaction:{trigger:b?.trigger,tokensBefore:b?.tokensBefore,tokensAfter:b?.tokensAfter}});continue}if(f.role==="user"){const b=Fre(f);if(b!==void 0&&a!==null&&Vre(a)){a.blocks.push(zre(f,b));continue}if(c(),b!==void 0){i.push(Wre(f,r++,b));continue}if(!Ure(f))continue;const g=f.metadata?.origin,v=g?.kind==="skill_activation"&&g?.trigger==="user-slash",y=g?.kind==="plugin_command"&&g?.trigger==="user-slash",T=[],P=[];for(const I of f.content){if(I.type==="text")if(v)T.push(g.skillArgs??"");else if(y)T.push(g.commandArgs??"");else{const M=Are(I.text);if(M&&(M.kind==="video"||M.kind==="image")&&n){const $=Mre(M.path);if($){P.push({url:n($),kind:M.kind,alt:$,fileId:$});continue}}T.push(I.text)}const k=d(I);k&&P.push({url:k.url,kind:k.kind,alt:I.type==="file"?I.name:void 0,fileId:k.fileId})}i.push({id:f.id,role:"user",no:r++,text:T.join(`
|
|
285
|
+
`),images:P.length>0?P:void 0,skillActivation:v?{name:g.skillName,args:g.skillArgs}:void 0,pluginCommand:y?{pluginId:g.pluginId,commandName:g.commandName,args:g.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){a&&u(a,f.content);continue}const h=f.promptId;qre(a,h)?a!==null&&a.promptId===void 0&&h!==void 0&&(a.promptId=h):(c(),a={id:f.id,promptId:h,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const m=a;if(m===null)continue;const _=JSON.stringify(f.content);m.promptId!==void 0&&m.seenSigs.has(_)||(m.seenSigs.add(_),u(m,f.content))}return c(!0),i}function Gre(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=J({}),l=B(()=>{const I=e.activeSessionId;if(!I)return null;const k=r.value[I];return k?{parentId:I,agentId:k.agentId}:null}),a=B(()=>l.value?.parentId??null),c=B(()=>l.value!==null),u=B(()=>{const I=l.value;return I?!!e.sideChatSendingByAgent[I.agentId]:!1}),d=B(()=>{const I=l.value;return I?e.sideChatSendingByAgent[I.agentId]?!0:(e.tasksBySession[I.parentId]??[]).some(k=>k.id===I.agentId&&k.status==="running"):!1}),f=B(()=>{const I=l.value;if(!I)return[];const k=e.sideChatMessagesByAgent[I.agentId]??[];return J3(k,[],M=>pt().getFileUrl(M),d.value)});function h(I,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[I]:k(e.sideChatMessagesByAgent[I]??[])}}function p(I,k){h(I,M=>[...M,k])}function m(I){h(I,k=>{const M=[...k].reverse().findIndex(L=>L.role==="user");if(M===-1)return k;const $=k.length-1-M;return k.filter((L,S)=>S!==$)})}function _(I,k){h(I,M=>{const $=[...M];for(let L=$.length-1;L>=0;L-=1){const S=$[L];if(S.role==="user")return $[L]={...S,promptId:S.promptId??k},$}return M})}function b(I,k,M){M&&h(I,$=>{const L=$.at(-1);if(L?.role==="assistant"){const S=L.content[0],E=S?.type==="text"?S.text:"";return[...$.slice(0,-1),{...L,content:[{type:"text",text:`${E}${M}`}]}]}return[...$,{id:s(),sessionId:k,role:"assistant",content:[{type:"text",text:M}],createdAt:new Date().toISOString()}]})}function g(I,k,M){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[I]:!1},!M)return;const L=(e.sideChatMessagesByAgent[I]??[]).at(-1);(L?.role==="assistant"&&L.content[0]?.type==="text"?L.content[0].text:"").trim().length>0||b(I,k,M)}async function v(I){const k=e.activeSessionId;if(k){if(!r.value[k]){let M;try{({agentId:M}=await pt().startBtw(k))}catch($){n("openSideChat",$,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:e.sideChatMessagesByAgent[M]??[]},r.value={...r.value,[k]:{agentId:M}},o(),i()?.markSideChannelAgent(M)}I&&I.trim()&&await T(I.trim())}}function y(){const I=e.activeSessionId;if(!I)return;const{[I]:k,...M}=r.value;r.value=M}async function T(I){const k=l.value,M=I.trim();if(!k||!M)return;const $=k.parentId,L=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[L]:!0};const S={id:s(),sessionId:$,role:"user",content:[{type:"text",text:M}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(L,S);try{const E=await pt().submitPrompt($,{content:[{type:"text",text:M}],agentId:L});_(L,E.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[$]:[...e.sideChatUserMessageIdsBySession[$]??[],E.userMessageId]}}catch(E){n("sendSideChatPrompt",E,{sessionId:$}),m(L),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[L]:!1}}}function P(I){if(!r.value[I])return;const{[I]:k,...M}=r.value;r.value=M}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:b,finishSideChatAgent:g,openSideChat:v,closeSideChat:y,sendSideChatPrompt:T,clearSideChatForSession:P}}function Yre(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 Qre(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
286
|
+
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Yre(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const j1="/sessions/";function hC(e){const{pathname:t}=e;if(!t.startsWith(j1))return;const n=t.slice(j1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Xre(e){return e===void 0||e.length===0?"/":`${j1}${encodeURIComponent(e)}`}const Zre=50,q1=5,Jre=40402,ele=40410,tle=40902;function gv(e){return sl(e)&&e.code===tle}const nle=40904;function sle(e){return sl(e)&&e.code===nle}const Ml=Ls({}),wf=Ls({}),vv=Ls({});function ole(e,t){const{t:n}=Bn.global,{confirm:s}=ll(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:h,appendSession:p,forgetSession:m,setActiveSessionId:_,updateSessionMessages:b,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:T,hasLoadedMessages:P,refreshSessionStatus:I,persistSessionProfile:k,mergedWorkspaces:M,workspacesView:$,status:L,workspaceIdForSession:S,savePermissionToStorage:E,savePlanModeToStorage:D,saveSwarmModeToStorage:R,saveGoalModeToStorage:H,draftModes:U,saveUnread:G,saveActiveWorkspaceToStorage:Q,saveHiddenWorkspacesToStorage:V,goalErrorMessage:re,resetFastMoon:pe,initialized:ne,selectedDiffPath:X,fileDiffLines:he,fileDiffLoading:Pe}=t;async function je(se){if(e.messagesLoadingMoreBySession[se])return;const _e=e.messagesBySession[se];if(!_e||_e.length===0)return;const Te=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!1};try{const ze=await pt().listMessages(se,{beforeId:Te,pageSize:Zre}),nt=[...ze.items].reverse();b(se,at=>[...nt,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[se]:ze.hasMore}}catch(ze){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!0},l("loadOlderMessages",ze,{sessionId:se})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!1}}}function it(se){o.loadTasksForSession(se),Y(se),I(se),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,se)||r.loadSkillsForSession(se)}async function ce(se){const _e=e.activeSessionId;if(_e){X.value=se,he.value=[],Pe.value=!0;try{const ze=await pt().getFileDiff(_e,se);if(X.value!==se)return;he.value=Qre(ze.diff)}catch(Te){X.value===se&&(he.value=[]),console.warn("[loadFileDiff] diff unavailable for",se,Te)}finally{X.value===se&&(Pe.value=!1)}}}function z(){X.value=null,he.value=[],Pe.value=!1}async function Y(se){try{const Te=await pt().getGitStatus(se);e.gitStatusBySession={...e.gitStatusBySession,[se]:Te}}catch{}}async function oe(){try{const _e=await pt().getAuth();e.authReady=_e.ready,e.defaultModel=_e.defaultModel,e.managedProviderStatus=_e.managedProvider?.status??null}catch{}}async function W(){try{const se=pt();e.config=await se.getConfig()}catch{}}async function Z(se){try{const Te=await pt().setConfig(se);return e.config=Te,e.defaultModel=Te.defaultModel??null,!0}catch(_e){return l("setConfig",_e),!1}}const ue=100,ae=30,me=720*60*1e3;async function j(){const se=pt(),_e=[];let Te;for(;;){const ze=await se.listSessions({pageSize:ue,beforeId:Te,excludeEmpty:!0});if(_e.push(...ze.items),!ze.hasMore||ze.items.length===0)break;Te=ze.items[ze.items.length-1].id}return _e}async function ee(se){const _e=pt(),Te=[],ze=Date.now(),nt=Gt=>ze-new Date(Gt.updatedAt).getTime();let at,Ut=!1,bn=!0;for(;;){let Gt;try{Gt=await _e.listSessions({workspaceId:se,pageSize:q1,beforeId:at,excludeEmpty:!0})}catch(hn){if(bn)throw hn;break}if(Ut=Gt.hasMore,Gt.items.length===0)break;const Vs=Gt.items[Gt.items.length-1],Ds=nt(Vs)>=me;if(!bn&&Ds){const hn=Gt.items.findIndex(Xn=>nt(Xn)>=me),_s=hn>=0?hn+1:Gt.items.length;Te.push(...Gt.items.slice(0,_s)),Ut=Gt.hasMore||_s<Gt.items.length;break}if(Te.push(...Gt.items),bn=!1,!Gt.hasMore||Ds)break;at=Vs.id}return{workspaceId:se,page:{items:Te,hasMore:Ut}}}async function fe(){const se=e.workspaces;if(se.length===0){const Ut=await j().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Ut}const _e=await Promise.all(se.map(Ut=>ee(Ut.id).catch(()=>({workspaceId:Ut.id,page:{items:[],hasMore:!1}})))),Te=[],ze={},nt={},at={};for(const{workspaceId:Ut,page:bn}of _e)Te.push(...bn.items),ze[Ut]=bn.hasMore,nt[Ut]=bn.items.length>0?bn.items[bn.items.length-1].id:void 0,at[Ut]=Math.max(bn.items.length,q1);return e.sessionsHasMoreByWorkspace=ze,e.sessionsCursorByWorkspace=nt,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Te.sort((Ut,bn)=>new Date(bn.updatedAt).getTime()-new Date(Ut.updatedAt).getTime()),Te}async function ke(se){if(e.sessionsLoadingMoreByWorkspace[se]||e.sessionsHasMoreByWorkspace[se]===!1)return;const _e=e.sessionsCursorByWorkspace[se];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!0};try{const Te=await pt().listSessions({workspaceId:se,pageSize:ae,beforeId:_e,excludeEmpty:!0}),ze=new Set(e.sessions.map(at=>at.id)),nt=Te.items.filter(at=>!ze.has(at.id));nt.length>0&&d([...e.sessions,...nt]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:Te.items.length>0?Te.items[Te.items.length-1].id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[se]:Te.hasMore}}catch(Te){l("loadMoreSessions",Te)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!1}}}}async function Ae(){if(e.sessionsFullyLoaded)return;const se=await j().catch(()=>null);if(se===null)return;d(se),e.sessionsFullyLoaded=!0;const _e={};for(const Te of e.workspaces)_e[Te.id]=!1;e.sessionsHasMoreByWorkspace=_e}async function Ie(){e.loading=!0;try{const se=pt();await Promise.all([se.getHealth().catch(()=>null),se.getMeta().then(Ut=>{e.serverVersion=Ut.serverVersion,e.availableOpenInApps=Ut.openInApps,e.dangerousBypassAuth=Ut.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),await oe(),await W(),await de();const _e=await fe();d(_e);const Te=_e[0],ze=e.activeWorkspaceId;!(ze!==null&&M.value.some(Ut=>Ut.id===ze))&&Te&&Ke(S(Te)),Fn();const at=typeof window<"u"?hC(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(bn=>bn.id===at)||await tn(at))&&await kn(at,{urlMode:"replace"}),!e.activeSessionId&&_e.length>0&&await kn(_e[0].id,{urlMode:"replace"})}catch(se){l("load",se)}finally{e.loading=!1,ne.value=!0}}async function de(){try{const se=pt(),[_e,Te]=await Promise.all([se.listWorkspaces().catch(()=>[]),se.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Me(_e),e.fsHome=Te.home||null,e.recentRoots=Te.recentRoots}catch{}}function Me(se){const _e=tf();return Object.keys(_e).length===0?se:se.map(Te=>{const ze=_e[Te.root];return ze!==void 0?{...Te,name:ze}:Te})}function Ke(se){e.activeWorkspaceId=se,Q(se)}function lt(se){Ke(se);const _e=e.sessions.filter(Te=>S(Te)===se);if(_e.length>0){const Te=_e[0];Te&&Te.id!==e.activeSessionId&&kn(Te.id)}else _(void 0),Rt(void 0,"push")}function yt(se){const _e=tf()[se.root],Te=_e!==void 0?{...se,name:_e}:se;e.hiddenWorkspaceRoots.includes(Te.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Te.root),V(e.hiddenWorkspaceRoots));const ze=e.workspaces.findIndex(at=>at.id===Te.id||at.root===Te.root);if(ze===-1){e.workspaces=[Te,...e.workspaces];return}const nt=[...e.workspaces];nt[ze]=Te,e.workspaces=nt}function kt(se){if(se.type==="workspaceCreated"||se.type==="workspaceUpdated"){yt(se.workspace);return}const _e=e.workspaces.find(ze=>ze.id===se.workspaceId)?.root??se.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],V(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(ze=>ze.id!==se.workspaceId&&ze.root!==_e),e.activeWorkspaceId===se.workspaceId||e.activeWorkspaceId===_e){const ze=$.value[0]?.id??null;if(e.activeWorkspaceId=ze,ze)Q(ze);else try{uc(It.activeWorkspace)}catch{}_(void 0),e.sessionLoading=!1,z(),Rt(void 0,"replace")}}function Tt(){_(void 0),Rt(void 0,"push")}function Pt(se){Ke(se),Tt(),z()}async function _t(se,_e,Te){const ze=M.value.find(nt=>nt.id===se);if(ze)try{const nt=pt();let at,Ut=ze.root;try{const hn=await nt.addWorkspace({root:ze.root});at=hn.id,Ut=hn.root,yt(hn)}catch{}const bn=r.draftModel.value??void 0,Gt=await nt.createSession({workspaceId:at,cwd:Ut,model:bn});r.draftModel.value=null;const Vs=bn!==void 0&&(!Gt.model||Gt.model.length===0)?{...Gt,model:bn}:Gt;h(Vs),Ke(Gt.workspaceId??at??se),await kn(Gt.id);const Ds=Gt.id;U.planMode&&(e.planModeBySession={...e.planModeBySession,[Ds]:!0},D()),U.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Ds]:!0},R()),U.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Ds]:!0},H()),U.planMode=!1,U.swarmMode=!1,U.goalMode=!1,await Hn(Gt.id,_e,Te)}catch(nt){l("startSessionAndSendPrompt",nt)}}async function Vt(se){const _e=se.trim();if(!_e)return!1;const Te=pt();try{const ze=await Te.addWorkspace({root:_e});return yt(ze),Pt(ze.id),!0}catch{return!1}}async function cn(se){try{return await pt().browseFs(se)}catch{return{path:"",parent:null,entries:[]}}}async function is(){try{return await pt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Rt(se,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const Te=Xre(se);if(window.location.pathname!==Te)try{_e==="push"?window.history.pushState(null,"",Te):window.history.replaceState(null,"",Te)}catch{}}async function tn(se){try{const _e=await pt().getSession(se);return e.sessions.some(Te=>Te.id===_e.id)||p(_e),!0}catch{return!1}}function xs(){const se=hC(window.location);if(se===void 0){_(void 0);return}if(se!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===se)){kn(se,{urlMode:"none"});return}(async()=>{if(await tn(se)){await kn(se,{urlMode:"none"});return}const _e=e.sessions[0];_e?await kn(_e.id,{urlMode:"replace"}):(_(void 0),Rt(void 0,"replace"))})()}}let ot=!1;function Fn(){ot||typeof window>"u"||(ot=!0,window.addEventListener("popstate",xs))}async function kn(se,_e){const Te=P(se),ze=!Te&&u.has(se);u.delete(se);try{Rt(se,_e?.urlMode??"push"),e.sessionLoading=!Te&&!ze,_(se),pe(),e.unreadBySession[se]&&(e.unreadBySession={...e.unreadBySession,[se]:!1},G({[se]:!1})),z();const nt=e.sessions.find(at=>at.id===se);if(nt){const at=S(nt);e.activeWorkspaceId!==at&&Ke(at)}if(Te){if(await T(se)==="not-found")return}else if(await y(se)==="not-found")return;it(se)}catch(nt){l("selectSession",nt,{sessionId:se})}finally{e.activeSessionId===se&&(e.sessionLoading=!1)}}function Gn(se){const _e=se===void 0?void 0:r.models.value.find(Te=>Te.model===se||Te.id===se||Te.displayName===se);return pc(_e,e.thinking)}async function Hn(se,_e,Te){c.add(se),e.sendingBySession={...e.sendingBySession,[se]:!0};const ze=g();try{const nt=pt(),at=[];_e&&at.push({type:"text",text:_e});for(const Xn of Te??[])Xn.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:Xn.fileId}}):at.push({type:"image",source:{kind:"file",fileId:Xn.fileId}});if(at.length===0)return c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},!1;const Ut={id:ze,sessionId:se,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(se,Xn=>[...Xn,Ut]);const bn=e.sessions.find(Xn=>Xn.id===se),Gt=(bn?.model&&bn.model.length>0?bn.model:e.defaultModel)??void 0,Vs=e.planModeBySession[se]??!1,Ds=e.swarmModeBySession[se]??!1,hn=e.goalModeBySession[se]??!1;if(hn&&_e)try{await nt.updateSession(se,{goalObjective:_e.trim()})}catch(Xn){return l("createGoal",Xn,{sessionId:se}),c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},b(se,Tn=>Tn.some(Mn=>Mn.id===ze)?Tn.filter(Mn=>Mn.id!==ze):Tn),!1}const _s=await nt.submitPrompt(se,{content:at,model:Gt,thinking:Gn(Gt),permissionMode:e.permission,planMode:Vs,swarmMode:Ds});return hn&&(e.goalModeBySession={...e.goalModeBySession,[se]:!1},H()),e.promptIdBySession={...e.promptIdBySession,[se]:_s.promptId},b(se,Xn=>{const Tn=Xn.findIndex(Uo=>Uo.id===ze);if(Tn===-1)return Xn;const Mn=[...Xn];return Mn[Tn]={...Mn[Tn],promptId:Mn[Tn].promptId??_s.promptId},Mn}),v()?.bindNextPromptId(se,_s.promptId),!0}catch(nt){return c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},b(se,at=>at.some(Ut=>Ut.id===ze)?at.filter(Ut=>Ut.id!==ze):at),l("sendPrompt",nt,{sessionId:se}),!1}}async function Ln(se,_e){const Te=e.activeSessionId;if(Te){if(a.value!=="idle"||c.has(Te)){Qe(se,_e);return}await Hn(Te,se,_e)}}async function rs(se,_e){const Te=e.activeSessionId;if(!Te)return;const ze=e.queuedBySession[Te]??[],nt=[],at=[];for(const hn of ze){const _s=hn.text.trim();_s&&nt.push(_s),hn.attachments?.length&&at.push(...hn.attachments)}const Ut=se.trim();if(Ut&&nt.push(Ut),_e?.length&&at.push(..._e),nt.length===0&&at.length===0)return;ze.length>0&&(e.queuedBySession={...e.queuedBySession,[Te]:[]});const bn=nt.join(`
|
|
287
|
+
|
|
288
|
+
`);if(a.value==="idle"&&!c.has(Te)){await Hn(Te,bn,at);return}const Gt=[];bn&&Gt.push({type:"text",text:bn});for(const hn of at)hn.kind==="video"?Gt.push({type:"video",source:{kind:"file",fileId:hn.fileId}}):Gt.push({type:"image",source:{kind:"file",fileId:hn.fileId}});const Vs=g(),Ds={id:Vs,sessionId:Te,role:"user",content:Gt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Te,hn=>[...hn,Ds]);try{const hn=pt(),_s=e.sessions.find(Mn=>Mn.id===Te),Xn=(_s?.model&&_s.model.length>0?_s.model:e.defaultModel)??void 0,Tn=await hn.submitPrompt(Te,{content:Gt,model:Xn,thinking:Gn(Xn),permissionMode:e.permission,planMode:e.planModeBySession[Te]??!1,swarmMode:e.swarmModeBySession[Te]??!1});if(b(Te,Mn=>{const Uo=Mn.findIndex(Cc=>Cc.id===Vs);if(Uo===-1)return Mn;const fr=[...Mn];return fr[Uo]={...fr[Uo],promptId:fr[Uo].promptId??Tn.promptId},fr}),Tn.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Te]:Tn.promptId},v()?.bindNextPromptId(Te,Tn.promptId);return}try{await hn.steerPrompts(Te,[Tn.promptId])}catch{}}catch(hn){b(Te,_s=>_s.filter(Xn=>Xn.id!==Vs)),l("steer",hn,{sessionId:Te})}}async function Ge(se,_e){try{const ze=await pt().uploadFile({file:se,name:_e});return{fileId:ze.id,name:ze.name,mediaType:ze.mediaType}}catch(Te){return l("uploadImage",Te),null}}function Qe(se,_e){const Te=e.activeSessionId;if(!Te)return;const ze=e.queuedBySession[Te]??[];e.queuedBySession={...e.queuedBySession,[Te]:[...ze,{text:se,attachments:_e}]}}async function Dt(){const se=e.activeSessionId;if(!se)return;const _e=e.sessions.find(nt=>nt.id===se);let Te=e.promptIdBySession[se];if(Te===void 0){const nt=_e?.currentPromptId;nt?.startsWith("prompt_")&&(Te=nt)}const ze=pt();if(Te!==void 0)try{if((await ze.abortPrompt(se,Te)).aborted)return;const at={...e.promptIdBySession};delete at[se],e.promptIdBySession=at}catch(nt){if(sl(nt)&&nt.code===Jre){const at={...e.promptIdBySession};delete at[se],e.promptIdBySession=at}else{l("abortCurrentPrompt",nt,{sessionId:se});return}}try{await ze.abortSession(se)}catch(nt){l("abortCurrentPrompt",nt,{sessionId:se})}}function Xt(se,_e){const Te=e.approvalsBySession[se]??[];e.approvalsBySession={...e.approvalsBySession,[se]:Te.filter(ze=>ze.approvalId!==_e)}}function Zt(se,_e){const Te=e.questionsBySession[se]??[];e.questionsBySession={...e.questionsBySession,[se]:Te.filter(ze=>ze.questionId!==_e)}}async function Jt(se,_e){const Te=e.activeSessionId;if(Te&&!wf[se]){wf[se]=!0;try{const ze=pt(),nt={decision:_e.decision,scope:_e.scope,feedback:_e.feedback,selectedLabel:_e.selectedLabel};await ze.respondApproval(Te,se,nt),Xt(Te,se)}catch(ze){gv(ze)?Xt(Te,se):l("respondApproval",ze,{sessionId:Te})}finally{delete wf[se]}}}async function An(se,_e){const Te=e.activeSessionId;if(Te&&!Ml[se]){Ml[se]="answer";try{await pt().respondQuestion(Te,se,_e),Zt(Te,se)}catch(ze){gv(ze)?Zt(Te,se):l("respondQuestion",ze,{sessionId:Te})}finally{delete Ml[se]}}}async function Mt(se){const _e=e.activeSessionId;if(_e&&!Ml[se]){Ml[se]="dismiss";try{await pt().dismissQuestion(_e,se),Zt(_e,se)}catch(Te){gv(Te)?Zt(_e,se):l("dismissQuestion",Te,{sessionId:_e})}finally{delete Ml[se]}}}async function Yn(se){const _e=e.activeSessionId;if(_e&&!vv[se]){vv[se]=!0;try{await pt().cancelTask(_e,se);const ze=e.tasksBySession[_e]??[];e.tasksBySession={...e.tasksBySession,[_e]:ze.map(nt=>nt.id===se?{...nt,status:"cancelled"}:nt)}}catch(Te){sle(Te)||l("cancelTask",Te,{sessionId:_e})}finally{delete vv[se]}}}function Ht(se){const _e=e.activeSessionId;_e?(e.planModeBySession={...e.planModeBySession,[_e]:se},D(),k({planMode:se})):U.planMode=se}function ks(){const se=e.activeSessionId,_e=se?e.planModeBySession[se]??!1:U.planMode;Ht(!_e)}function bs(se){const _e=e.activeSessionId;_e?(e.swarmModeBySession={...e.swarmModeBySession,[_e]:se},R(),k({swarmMode:se})):U.swarmMode=se}async function Fo(){const se=e.activeSessionId,Te=!(se?e.swarmModeBySession[se]??!1:U.swarmMode);Te&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||bs(Te)}function Rs(se){const _e=e.activeSessionId;_e?(e.goalModeBySession={...e.goalModeBySession,[_e]:se},H()):U.goalMode=se}function wo(){const se=e.activeSessionId,_e=se?e.goalModeBySession[se]??!1:U.goalMode;Rs(!_e)}async function ao(se){const _e=se.trim();if(!_e||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:_e}),variant:"primary"}))return;const Te=e.activeSessionId;if(Te){try{await pt().updateSession(Te,{goalObjective:_e})}catch(ze){l("createGoal",ze,{sessionId:Te,message:re(ze)});return}await Ln(_e)}}function Nt(se){const _e=e.activeSessionId;_e&&Promise.resolve(pt().updateSession(_e,{goalControl:se})).catch(Te=>{l("controlGoal",Te,{sessionId:_e,message:re(Te)})})}function Ho(se){e.permission=se,E(se),k({permissionMode:se})}function Wo(se){const _e=[...e.warnings];_e.splice(se,1),e.warnings=_e}async function Ye(se,_e){try{await pt().updateSession(se,{title:_e}),f(se,ze=>({...ze,title:_e}))}catch(Te){l("renameSession",Te,{sessionId:se})}}async function et(se,_e){const Te=e.workspaces.find(nt=>nt.id===se)?.root,ze=()=>{e.workspaces=e.workspaces.map(nt=>nt.id===se?{...nt,name:_e}:nt)};try{if(await pt().updateWorkspace(se,{name:_e}),Te!==void 0){const nt=tf();Te in nt&&(delete nt[Te],I_(nt))}ze()}catch(nt){if(Te!==void 0&&sl(nt)&&nt.code===ele){I_({...tf(),[Te]:_e}),ze();return}l("renameWorkspace",nt)}}async function st(se){const _e=e.workspaces.find(at=>at.id===se)?.root??M.value.find(at=>at.id===se)?.root??se,Te=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,ze=e.activeWorkspaceId===se||e.activeWorkspaceId===_e,nt=!!(Te&&(Te.cwd===_e||Te.workspaceId===se||S(Te)===se));_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],V(e.hiddenWorkspaceRoots));try{await pt().deleteWorkspace(se)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==se&&at.root!==_e),ze||nt){const at=$.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Q(at);else try{uc(It.activeWorkspace)}catch{}}(ze||nt)&&(_(void 0),e.sessionLoading=!1,z(),Rt(void 0,"replace"))}async function Bt(se){try{await pt().archiveSession(se),m(se),i.clearSideChatForSession(se);const{[se]:Te,...ze}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=ze,e.activeSessionId===se){const nt=e.sessions[0];nt?await kn(nt.id,{urlMode:"replace"}):(_(void 0),Rt(void 0,"replace"))}}catch(_e){l("archiveSession",_e,{sessionId:se})}}async function zo(se){try{const _e=await pt().restoreSession(se);return h(_e),!0}catch(_e){return l("restoreSession",_e,{sessionId:se}),!1}}function Li(se){return pt().listSessions({archivedOnly:!0,beforeId:se?.beforeId,pageSize:se?.pageSize??50})}async function Ee(){try{await pt().logout(),await oe(),await Ie()}catch(se){l("logout",se)}}function xe(se){const _e=e.activeSessionId;_e&&pt().compactSession(_e,se).catch(Te=>{l("compact",Te,{sessionId:_e})})}async function Be(se){const _e=se??e.activeSessionId;if(_e)try{const Te=await pt().forkSession(_e);h(Te),await kn(Te.id)}catch(Te){l("fork",Te,{sessionId:_e})}}async function $t(se=1){const _e=e.activeSessionId;if(!_e)return null;const Te=(()=>{const ze=e.messagesBySession[_e]??[];for(let nt=ze.length-1;nt>=0;nt--){const at=ze[nt];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Ut=>Ut.type==="text").map(Ut=>Ut.text).join(`
|
|
289
|
+
`)}return null})();try{return await pt().undoSession(_e,se),await y(_e),Te}catch(ze){return l("undo",ze,{sessionId:_e}),null}}function zt(se){const _e=e.activeSessionId;if(!_e)return;const Te=e.queuedBySession[_e]??[];if(se<0||se>=Te.length)return;const ze=[...Te];ze.splice(se,1),e.queuedBySession={...e.queuedBySession,[_e]:ze}}function ns(se,_e){const Te=e.activeSessionId;if(!Te)return;const ze=e.queuedBySession[Te]??[];if(se===_e||se<0||se>=ze.length||_e<0||_e>=ze.length)return;const nt=[...ze],[at]=nt.splice(se,1);at!==void 0&&(nt.splice(_e,0,at),e.queuedBySession={...e.queuedBySession,[Te]:nt})}async function Qn(se){const _e=e.activeSessionId;if(!_e)return[];try{return(await pt().listDirectory(_e,{path:se,includeGitStatus:!0})).items}catch{return[]}}async function Wn(se){const _e=e.activeSessionId;if(!_e)return null;try{const ze=await pt().readFile(_e,{path:se});return{path:ze.path,content:ze.content,encoding:ze.encoding,mime:ze.mime,languageId:ze.languageId,isBinary:ze.isBinary,size:ze.size,lineCount:ze.lineCount}}catch{return null}}const ft=10485760;function ve(se){const _e=e.activeSessionId;return _e?pt().getFileDownloadUrl(_e,se):null}async function Le(se,_e){const Te=e.activeSessionId;if(!Te)return!1;try{return await pt().openFile(Te,{path:se,line:_e}),!0}catch(ze){return l("openFile",ze,{sessionId:Te}),!1}}async function On(se){const _e=e.activeSessionId;if(!_e)return;const Te=L.value.cwd||".";try{await pt().openInApp(_e,se,Te)}catch(ze){l("openInApp",ze,{sessionId:_e})}}async function As(se){const _e=e.activeSessionId;if(!_e)return!1;try{return await pt().revealFile(_e,{path:se}),!0}catch(Te){return l("revealFile",Te,{sessionId:_e}),!1}}async function sa(se){if(/^(https?:|data:|blob:)/i.test(se))return se;const _e=e.activeSessionId;if(!_e)return se;let Te=se;if(Te.startsWith("/")){const ze=e.sessions.find(nt=>nt.id===_e)?.cwd;if(ze&&(Te===ze||Te.startsWith(ze.endsWith("/")?ze:`${ze}/`))){if(Te=Te.slice(ze.length).replace(/^\//,""),!Te)return se}else return se}try{const nt=await pt().readFile(_e,{path:Te,length:ft});return!nt.isBinary||nt.encoding!=="base64"||nt.truncated?se:`data:${nt.mime};base64,${nt.content}`}catch{return se}}async function Sc(se){const _e=e.activeSessionId;if(!_e)return[];try{return(await pt().searchFiles(_e,{query:se,limit:20})).items.map(nt=>({path:nt.path,name:nt.name}))}catch{return[]}}return{loadFileDiff:ce,clearFileDiff:z,loadGitStatus:Y,checkAuth:oe,loadConfig:W,updateConfig:Z,listAllSessionsGlobal:j,load:Ie,loadWorkspaces:de,loadMoreSessions:ke,loadAllSessions:Ae,selectWorkspace:Ke,openWorkspace:lt,upsertWorkspacePreserveOrder:yt,applyWorkspaceEvent:kt,clearActiveSession:Tt,openWorkspaceDraft:Pt,startSessionAndSendPrompt:_t,addWorkspaceByPath:Vt,browseFs:cn,getFsHome:is,writeSessionUrl:Rt,fetchSessionIntoList:tn,onSessionRoutePopState:xs,bindSessionRoute:Fn,selectSession:kn,submitPromptInternal:Hn,sendPrompt:Ln,steerPrompt:rs,uploadImage:Ge,enqueue:Qe,unqueue:zt,reorderQueue:ns,abortCurrentPrompt:Dt,respondApproval:Jt,respondQuestion:An,dismissQuestion:Mt,pendingQuestionActions:Ml,pendingApprovalActions:wf,cancelTask:Yn,setPlanMode:Ht,togglePlanMode:ks,setSwarmMode:bs,toggleSwarmMode:Fo,setGoalMode:Rs,toggleGoalMode:wo,createGoal:ao,controlGoal:Nt,setPermission:Ho,dismissWarning:Wo,renameSession:Ye,renameWorkspace:et,deleteWorkspace:st,archiveSession:Bt,restoreSession:zo,loadArchivedSessions:Li,logout:Ee,compact:xe,forkSession:Be,undo:$t,listDir:Qn,readFileContent:Wn,getFileDownloadUrl:ve,openWorkspaceFile:Le,openInApp:On,revealWorkspaceFile:As,resolveImageUrl:sa,searchFiles:Sc,loadOlderMessages:je,refreshSessionSidecars:it}}const ile="kimiWeb.optimisticUserMessage";function rle(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function lle(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function ale(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function yv(e){return e.role==="user"&&e.metadata?.[ile]===!0}function cle(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function ule(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const dle=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function mC(e){let t="",n=0;for(const s of e.content)s.type==="text"?dle.test(s.text.trim())?n+=1:t+=s.text:(s.type==="image"||s.type==="video"||s.type==="file")&&(n+=1);return{text:t,media:n}}function fle(e,t){const n=mC(e),s=mC(t);return n.text===s.text&&n.media===s.media}function ple(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(yv(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(yv(o)&&ule(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(yv(o)&&fle(o,t))return s}return-1}function hle(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function mle(e,t,n){const s=lle(e);switch(ale(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[X3]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!cle(t.message)){const a=ple(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=hle(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?Bn.global.t("warnings.errorLabel"):Bn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function gle(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function vle(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||Jl(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:gle(a.status)}]:[]})}}return[]}const yle=["queued","working","suspended","completed","failed"];function e4(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function kle(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function ble(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:e4(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=kle();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function _le(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of yle)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function wle(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const s=t.get(n.parentToolCallId)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:e4(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,s)}for(const[n,s]of t)t.set(n,s.toSorted((o,i)=>o.swarmIndex-i.swarmIndex||o.id.localeCompare(i.id)));return t}const Ei=z3(),Ol=ore(),jp=dre(),t4=It.permission,n4=It.activeWorkspace,s4=It.thinking,o4=It.planMode,i4=It.swarmMode,r4=It.goalMode,gC=40401,l4=It.onboarded,Sle=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;uc(It.codeFont);uc(It.theme);function Cle(){try{const e=ts(t4);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function xle(e){try{os(t4,e)}catch{}}function Ale(){try{const e=ts(s4);if(e&&Sle.test(e))return e}catch{}return"high"}function Tle(e){try{os(s4,e)}catch{}}function kv(e){const t=ts(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const s={};for(const[o,i]of Object.entries(n))i===!0&&(s[o]=!0);return s}catch{return{}}}function Ly(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);os(e,JSON.stringify(n))}catch{}}function a4(){Ly(o4,Se.planModeBySession)}function c4(){Ly(i4,Se.swarmModeBySession)}function u4(){Ly(r4,Se.goalModeBySession)}function Mle(){try{return ts(n4)}catch{return null}}const d4=It.hiddenWorkspaces;function Ele(){try{const e=ts(d4);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Ile(e){try{os(d4,JSON.stringify(e))}catch{}}function $le(e){try{os(n4,e)}catch{}}function Nle(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Se=Ls({...rle(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:Cle(),thinking:Ale(),planModeBySession:kv(o4),swarmModeBySession:kv(i4),goalModeBySession:kv(r4),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:x0(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Mle(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Ele(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Wh=Ls({planMode:!1,swarmMode:!1,goalMode:!1});function f4(e){Se.sessions=e}function zh(e,t){Se.sessions=Se.sessions.map(n=>n.id===e?t(n):n)}function Lle(e){Se.sessions=[e,...Se.sessions.filter(t=>t.id!==e.id)]}function Ole(e){Se.sessions=[...Se.sessions,e]}function Ple(e){Se.sessions=Se.sessions.filter(t=>t.id!==e)}function p4(){const e=Se.activeSessionId;e&&Se.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Se.unreadBySession={...Se.unreadBySession,[e]:!1},A0({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===It.unread&&(Se.unreadBySession=x0(),p4())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&p4()});function Oy(e){Se.activeSessionId=e}function Rle(e){Se.messagesBySession=e}function Dle(e,t){Se.messagesBySession={...Se.messagesBySession,[e]:t}}function h4(e,t){Se.messagesBySession={...Se.messagesBySession,[e]:t(Se.messagesBySession[e]??[])}}function Ble(e){const{[e]:t,...n}=Se.messagesBySession;Se.messagesBySession=n}function m4(e){sr?.unsubscribe(e),lae(e),qp.flush(),Ple(e),Ble(e),delete Se.approvalsBySession[e],delete Se.questionsBySession[e],delete Se.tasksBySession[e],delete Se.goalBySession[e],delete Se.gitStatusBySession[e],delete Se.lastSeqBySession[e],delete Se.compactionBySession[e],delete Se.messagesLoadingMoreBySession[e],delete Se.messagesHasMoreBySession[e],delete Se.messagesLoadMoreErrorBySession[e],delete Py[e],A4.delete(e),jh.delete(e),delete Se.queuedBySession[e],delete Se.promptIdBySession[e],delete Se.sendingBySession[e],delete Se.planModeBySession[e],delete Se.swarmModeBySession[e],delete Se.goalModeBySession[e],a4(),c4(),u4()}const g4=J(null),v4=J([]),y4=J(!1),k4=J(!1);async function Uh(e){let t;try{t=await pt().getSessionStatus(e)}catch{return}zh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Se.swarmModeBySession={...Se.swarmModeBySession,[e]:t.swarmMode},Se.planModeBySession={...Se.planModeBySession,[e]:t.planMode}}function b4(e){const t=Se.activeSessionId;t&&Promise.resolve(pt().updateSession(t,e)).then(()=>Uh(t)).catch(()=>{})}const _4=It.conversationToc;function Fle(){try{const e=ts(_4);return e===null?!0:e==="true"}catch{return!0}}function Hle(e){try{os(_4,e?"true":"false")}catch{}}const w4=J(Fle());function Wle(e){w4.value=e,Hle(e)}function zle(e){try{return ts(e)??""}catch{return""}}const S4=J(zle(l4)==="1");function Ule(e){S4.value=e;try{os(l4,e?"1":"0")}catch{}}let sr=null,vC=0;function C4(){return vC+=1,`msg_opt_${Date.now().toString(36)}_${vC}`}const jh=new Set;function jle(e,t,n){const s={sessions:Se.sessions,activeSessionId:Se.activeSessionId,messagesBySession:Se.messagesBySession,approvalsBySession:Se.approvalsBySession,planReviewByToolCallId:Se.planReviewByToolCallId,questionsBySession:Se.questionsBySession,tasksBySession:Se.tasksBySession,goalBySession:Se.goalBySession,lastSeqBySession:Se.lastSeqBySession,compactionBySession:Se.compactionBySession,config:Se.config,warnings:Se.warnings},o=mle(s,e,{sessionId:t,seq:n});f4(o.sessions),Oy(o.activeSessionId),Rle(o.messagesBySession),Se.approvalsBySession=o.approvalsBySession,Se.planReviewByToolCallId=o.planReviewByToolCallId,Se.questionsBySession=o.questionsBySession,Se.tasksBySession=o.tasksBySession,Se.goalBySession=o.goalBySession,Se.lastSeqBySession=o.lastSeqBySession,Se.compactionBySession=o.compactionBySession,Se.config=o.config??null,Se.warnings=o.warnings,e.type==="configChanged"&&(Se.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Rn.loadModels(),Rn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Se.swarmModeBySession={...Se.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Se.planModeBySession={...Se.planModeBySession,[e.sessionId]:e.planMode}))}function qle(e,t){jle(e,t.sessionId,t.seq);const n=Hs.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&Hs.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?Hs.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?Hs.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&Hs.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;Se.promptIdBySession[s]!==e.message.promptId&&(Se.promptIdBySession={...Se.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Se.activeSessionId&&Ei.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&uce(e.sessionId,e.status),e.type==="questionRequested"&&dce(e.sessionId,e.question)}const qp=Nie(({appEvent:e,meta:t})=>qle(e,t),({appEvent:e})=>Iie(e));function x4(){if(sr!==null||typeof WebSocket>"u")return;Se.connection="connecting",sr=pt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){gt.applyWorkspaceEvent(t);return}qp({appEvent:t,meta:n})},onResync(t,n,s){qp.flush(),s!==void 0&&(Py[t]=s),sae.request(t)},onError(t,n,s){Ry({severity:"error",title:Bn.global.t("warnings.wsTitle"),message:n,details:[jn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Se.connected=t,Se.connection=t?"connected":"disconnected"}})}const Py={},A4=new Set;function Vle(e){return sl(e)&&e.code===gC?!0:typeof e=="object"&&e!==null&&e.code===gC}function jn(e,t){if(!(t==null||t===""))return{label:Bn.global.t(`warnings.details.${e}`),value:T4(t)}}function T4(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 Kle(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Gle(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Yle(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Qle(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function yC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function Xle(e,t,n){const s=T3(t),o=sl(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[jn("operation",e),jn("sessionId",n??Se.activeSessionId),jn("connection",Se.connection),jn("timestamp",Qle(i??Date.now()))];return s?l.push(jn("duration",yC(r)),jn("request",`${t.method} ${t.path}`),jn("endpoint",t.url),jn("requestId",t.requestId),jn("phase",t.phase),jn("timeout",`${t.timeoutMs}ms`),jn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),jn("contentType",t.contentType),jn("responsePreview",t.bodyPreview),jn("cause",t.cause)):o?l.push(jn("duration",yC(r)),jn("code",t.code),jn("requestId",t.requestId),jn("message",t.message),jn("details",t.details)):l.push(jn("errorName",Kle(t)),jn("message",Gle(t)??T4(t)),jn("stack",Yle(t))),l.filter(a=>a!==void 0)}function Zle(e,t,n={}){const s=T3(t),o=sl(t),i=n.title??(s?Bn.global.t("warnings.daemonNetworkTitle"):o?Bn.global.t("warnings.daemonApiTitle"):Bn.global.t("warnings.operationFailedTitle")),r=n.message??(s?Bn.global.t("warnings.daemonNetworkMessage"):o?t.message:Bn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Xle(e,t,n.sessionId)}}function Ry(e){Se.warnings=[...Se.warnings,e]}function qh(e,t,n){Ry(Zle(e,t,n))}const Jle={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function eae(e){if(!sl(e))return;const t=Jle[e.code];return t?Bn.global.t(t):void 0}async function tae(e){if(m4(e),Se.activeSessionId!==e)return;const t=Se.sessions[0];t?await gt.selectSession(t.id,{urlMode:"replace"}):(Oy(void 0),Se.sessionLoading=!1,gt.writeSessionUrl(void 0,"replace"))}const kC=new Set;async function nae(e){if(!kC.has(e)){kC.add(e);try{const t=await pt().getSessionWarnings(e),n=Bn.global.t("warnings.noteLabel");for(const s of t)Ry(`${n}: ${s.message}`)}catch{}}}async function Dy(e){try{const n=await pt().getSessionSnapshot(e);qp.flush(),zh(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),Dle(e,Tie(Se.messagesBySession[e]??[],n.messages)),Se.messagesHasMoreBySession={...Se.messagesHasMoreBySession,[e]:n.hasMoreMessages},Se.approvalsBySession={...Se.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(Se.planReviewByToolCallId={...Se.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return Se.questionsBySession={...Se.questionsBySession,[e]:n.pendingQuestions},Se.lastSeqBySession={...Se.lastSeqBySession,[e]:n.asOfSeq},Py[e]=n.epoch,x4(),sr&&(sr.seedSnapshot(e,n),sr.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),rae(e)),By.delete(e),nae(e),"ok"}catch(t){return Vle(t)?(await tae(e),"not-found"):(qh("getSessionSnapshot",t,{title:Bn.global.t("warnings.sessionSnapshotTitle"),message:Bn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const sae=Mie(Dy);function oae(e){return Object.prototype.hasOwnProperty.call(Se.messagesBySession,e)}const iae=4,Ki=[],By=new Set;function rae(e){const t=Ki.indexOf(e);for(t!==-1&&Ki.splice(t,1),Ki.unshift(e);Ki.length>iae;){let n=-1;for(let o=Ki.length-1;o>=0;o--)if(Ki[o]!==Se.activeSessionId){n=o;break}if(n===-1)break;const[s]=Ki.splice(n,1);if(s===void 0)break;sr?.unsubscribe(s),By.add(s)}}function lae(e){const t=Ki.indexOf(e);t!==-1&&Ki.splice(t,1),By.delete(e)}async function aae(e){return Dy(e)}function Vh(e){const t=Se.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Hs.sideChatTargetBySession.value[e]?.agentId,o=(Se.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Se.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Fy(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return Bn.global.t("sessions.justNow");if(i<1)return`${Math.round(o/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=o/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}m`:`${Math.round(r/365)}y`}catch{return e}}const cae=3e4,td=J(0);let bv=null;function uae(){bv===null&&(bv=setInterval(()=>{td.value=(td.value+1)%Number.MAX_SAFE_INTEGER},cae),bv.unref?.())}function dae(e,t){const n=e.split(`
|
|
290
|
+
`),s=t.split(`
|
|
291
|
+
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function fae(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:dae(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const s=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function pae(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 hae(e){const t=Se.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function mae(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=Bn.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=Bn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??hae(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const gae=B(()=>{const e=Se.sessions.find(n=>n.id===Se.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Se.workspaceName,branch:t}}),vae=B(()=>(td.value,Se.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Fy(e.updatedAt,e.status),status:e.status,busy:Vh(e.id)})))),yae=B(()=>Se.activeSessionId??""),kae=B(()=>{const e=Se.activeSessionId;if(e)return Rn.skillsBySession.value[e]??[];const t=Gh.value;return t?Rn.skillsByWorkspace.value[t]??[]:[]}),bae=B(()=>{const e=Se.activeSessionId;return e?Se.sendingBySession[e]??!1:!1}),Hs=Gre(Se,{pushOperationFailure:qh,nextOptimisticMsgId:C4,connectEventsIfNeeded:x4,getEventConn:()=>sr}),vd=B(()=>{const e=Se.activeSessionId;if(!e)return[];const t=Hs.sideChatTargetBySession.value[e]?.agentId;return(Se.tasksBySession[e]??[]).filter(n=>n.id!==t)}),M4=hre(Se,vd),_ae=B(()=>{const e=Se.activeSessionId;if(!e)return[];const t=new Set(Se.sideChatUserMessageIdsBySession[e]??[]),n=(Se.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Se.approvalsBySession[e]??[];return J3(n,s,o=>pt().getFileUrl(o),Kh.value!=="idle",Se.planReviewByToolCallId)}),wae=B(()=>(M4.taskClock.value,vd.value.map(mae))),E4=B(()=>ble(vd.value)),Sae=B(()=>wle(vd.value)),Pa=B(()=>{const e=Se.activeSessionId;return e?Se.goalBySession[e]??null:null}),Cae=B(()=>{const e=Se.activeSessionId;return e?vle(Se.messagesBySession[e]??[]):[]}),xae=B(()=>{const e=Se.activeSessionId;return e?Se.compactionBySession[e]??null:null}),Aae=B(()=>Se.connection),Tae=B(()=>Se.loading),Mae=B(()=>Se.sessionLoading),Eae=B(()=>{const e=Se.activeSessionId;return e?Se.messagesLoadingMoreBySession[e]??!1:!1}),Iae=B(()=>{const e=Se.activeSessionId;return e?Se.messagesHasMoreBySession[e]??!1:!1}),$ae=B(()=>{const e=Se.activeSessionId;return e?Se.messagesLoadMoreErrorBySession[e]??!1:!1}),Nae=B(()=>Se.serverVersion),Lae=B(()=>Se.dangerousBypassAuth);function Oae(){Se.dangerousBypassAuth=!1}const Pae=B(()=>Se.permission),Rae=B(()=>Se.thinking),I4=B(()=>{const e=Se.activeSessionId;return e?Se.planModeBySession[e]??!1:Wh.planMode}),Dae=B(()=>{const e=Se.activeSessionId;return e?Se.swarmModeBySession[e]??!1:Wh.swarmMode}),Bae=B(()=>{const e=Se.activeSessionId;return e?Se.goalModeBySession[e]??!1:Wh.goalMode}),Fae=B(()=>{const e=_le(E4.value);return{plan:I4.value,goal:Pa.value&&Pa.value.status!=="complete"?{status:Pa.value.status,turnsUsed:Pa.value.turnsUsed,elapsedMs:Pa.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Hae=B(()=>{const e=Se.activeSessionId;if(!e)return[];const t=pt();return(Se.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(s=>({fileId:s.fileId,kind:s.kind,url:t.getFileUrl(s.fileId)}))}))}),Wae=B(()=>Se.warnings),zae=B(()=>{const e=Se.activeSessionId;return e?(Se.questionsBySession[e]??[]).map(pae):[]}),Uae=B(()=>{const e=Se.activeSessionId;return e?(Se.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:fae(t),agentName:t.agentName})):[]}),Kh=B(()=>{const e=Se.activeSessionId;return e?(Se.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Se.questionsBySession[e]??[]).length>0?"awaiting-question":Vh(e)?"running":"idle":"idle"}),Rn=vre(Se,{pushOperationFailure:qh,refreshSessionStatus:Uh,persistSessionProfile:b4,activity:Kh,inFlightPromptSessions:jh,saveThinkingToStorage:Tle,updateSession:zh,updateSessionMessages:h4}),Vp=B(()=>{const e=Se.activeSessionId;if(!e)return null;const t=Se.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),jae=B(()=>{const e=Se.activeSessionId;return e?Se.gitStatusBySession[e]?.pullRequest??null:null}),qae=B(()=>{const e=Se.activeSessionId;if(!e)return[];const t=Se.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),Vae=B(()=>{const e=Se.activeSessionId;if(!e)return null;const t=Se.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),$4=B(()=>{const e=Se.sessions.find(r=>r.id===Se.activeSessionId),t=Vp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Rn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Se.defaultModel)??"—",o=Rn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Se.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Vp.value!==null}}),Kae=B(()=>v4.value),Gae=B(()=>Se.sessions.find(t=>t.id===Se.activeSessionId)?.usage.totalCostUsd??0),Yae=B(()=>Se.authReady),Qae=B(()=>Se.defaultModel),Xae=B(()=>Se.managedProviderStatus),Zae=B(()=>Se.config),Jae=B(()=>{const e=Se.activeSessionId;if(!e)return{};const t=Se.gitStatusBySession[e];return t?{...t.entries}:{}});function hc(e){return Se.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const Hy=B(()=>Aie({workspaces:Se.workspaces,sessions:Se.sessions,hiddenWorkspaceRoots:Se.hiddenWorkspaceRoots,activeRoot:Se.sessions.find(e=>e.id===Se.activeSessionId)?.cwd,activeBranch:Vp.value?.branch??null,sessionsHasMoreByWorkspace:Se.sessionsHasMoreByWorkspace})),Kp=J(I5()),mc=J($5()==="manual"?"manual":"recent");Ve(()=>[Hy.value.map(e=>e.id).join("\0"),Se.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=U5(n,Kp.value);s!==null&&(Kp.value=s,EA(s))});const Ql=B(()=>{const e=Hy.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Nle(t.root,Se.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(mc.value==="recent"){const t=new Map;for(const n of Se.sessions){if(n.parentSessionId)continue;const s=hc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return V5(e,t)}return j5(e,Kp.value)}),Gh=B(()=>{const e=Se.activeWorkspaceId,t=Ql.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ve(Gh,e=>{e&&(Object.prototype.hasOwnProperty.call(Rn.skillsByWorkspace.value,e)||Rn.loadSkillsForWorkspace(e))},{immediate:!0});const ece=B(()=>{const e=Gh.value;return e?Ql.value.find(t=>t.id===e)??null:null}),tce=B(()=>{td.value;const e=new Set(Ql.value.map(n=>n.id)),t=new Map(Ql.value.map(n=>[n.id,n.name]));return Se.sessions.filter(n=>!n.parentSessionId&&e.has(hc(n))).map(n=>{const s=hc(n);return{id:n.id,title:n.title,time:Fy(n.updatedAt,n.status),status:n.status,busy:Vh(n.id),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),nce=B(()=>{td.value;const e=new Map;for(const t of Se.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=hc(t),s={id:t.id,title:t.title,time:Fy(t.updatedAt,t.status),status:t.status,busy:Vh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Ql.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Se.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Se.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Se.sessionsInitialCountByWorkspace[t.id]??q1}))});function sce(e){Kp.value=e,EA(e),mc.value!=="manual"&&(mc.value="manual",IA("manual"))}function oce(e){mc.value!==e&&(mc.value=e,IA(e))}const N4=B(()=>{const e={};for(const[t,n]of Object.entries(Se.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Se.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),ice=B(()=>{const e={};for(const[t,n]of Object.entries(Se.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Se.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),rce=B(()=>{const e={};for(const[t,n]of Object.entries(Se.unreadBySession))n&&(e[t]=!0);return e}),lce=B(()=>{const e={},t=N4.value;for(const n of Se.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=hc(n);e[o]=(e[o]??0)+s}return e}),ace=B(()=>Se.recentRoots),cce=B(()=>Se.availableOpenInApps),gt=ole(Se,{taskPoller:M4,sideChat:Hs,modelProvider:Rn,pushOperationFailure:qh,activity:Kh,inFlightPromptSessions:jh,sessionsKnownEmpty:A4,setSessions:f4,updateSession:zh,upsertSessionFront:Lle,appendSession:Ole,forgetSession:m4,setActiveSessionId:Oy,updateSessionMessages:h4,nextOptimisticMsgId:C4,getEventConn:()=>sr,syncSessionFromSnapshot:Dy,reopenSession:aae,hasLoadedMessages:oae,refreshSessionStatus:Uh,persistSessionProfile:b4,mergedWorkspaces:Hy,workspacesView:Ql,status:$4,workspaceIdForSession:hc,savePermissionToStorage:xle,savePlanModeToStorage:a4,saveSwarmModeToStorage:c4,saveGoalModeToStorage:u4,draftModes:Wh,saveUnread:A0,saveActiveWorkspaceToStorage:$le,saveHiddenWorkspacesToStorage:Ile,goalErrorMessage:eae,resetFastMoon:Ei.resetFastMoon,initialized:k4,selectedDiffPath:g4,fileDiffLines:v4,fileDiffLoading:y4});function uce(e,t){if(jh.delete(e),Se.sendingBySession={...Se.sendingBySession,[e]:!1},Se.promptIdBySession[e]!==void 0){const i={...Se.promptIdBySession};delete i[e],Se.promptIdBySession=i}e===Se.activeSessionId?(Ei.resetFastMoon(),gt.loadGitStatus(e),Uh(e)):t==="idle"&&(Se.unreadBySession={...Se.unreadBySession,[e]:!0},A0({[e]:!0})),Ol.maybeNotifyCompletion(e,{isActiveAndVisible:e===Se.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Se.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{gt.selectSession(e)}}),t==="idle"&&jp.maybePlayCompletionSound();const n=Se.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;Se.queuedBySession={...Se.queuedBySession,[e]:o},s!==void 0&>.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=Se.queuedBySession[e]??[];Se.queuedBySession={...Se.queuedBySession,[e]:[s,...r]}}})}function dce(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Ol.maybeNotifyQuestion(e,{isActiveAndVisible:e===Se.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Se.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{gt.selectSession(e)}}),jp.maybePlayQuestionSound()}function Wy(){return uae(),{workspace:gae,sessions:vae,activeSessionId:yae,workspacesView:Ql,workspaceSortMode:mc,visibleWorkspace:ece,activeWorkspaceId:Gh,sessionsForView:tce,workspaceGroups:nce,attentionBySession:N4,pendingBySession:ice,attentionByWorkspace:lce,unreadBySession:rce,recentRoots:ace,turns:_ae,tasks:wae,activeAppTasks:vd,todos:Cae,goal:Pa,swarms:E4,swarmMembersByToolCallId:Sae,activationBadges:Fae,compaction:xae,status:$4,sessionCost:Gae,fileDiff:Kae,selectedDiffPath:g4,fileDiffLoading:y4,changes:qae,gitInfo:Vp,gitDiffStats:Vae,activePullRequest:jae,changesByPath:Jae,pendingApprovals:Uae,availableOpenInApps:cce,connection:Aae,loading:Tae,sessionLoading:Mae,loadingMoreMessages:Eae,hasMoreMessages:Iae,loadMoreMessagesError:$ae,serverVersion:Nae,dangerousBypassAuth:Lae,clearDangerousBypassAuth:Oae,initialized:k4,permission:Pae,thinking:Rae,planMode:I4,swarmMode:Dae,goalMode:Bae,queued:Hae,warnings:Wae,questions:zae,activity:Kh,isSending:bae,fastMoon:Ei.fastMoon,models:Rn.models,starredModelIds:Rn.starredModelIds,providers:Rn.providers,uiFontSize:Ei.uiFontSize,setUiFontSize:Ei.setUiFontSize,conversationToc:w4,setConversationToc:Wle,colorScheme:Ei.colorScheme,setColorScheme:Ei.setColorScheme,accent:Ei.accent,setAccent:Ei.setAccent,notifyOnComplete:Ol.notifyOnComplete,notifyOnQuestion:Ol.notifyOnQuestion,notifyPermission:Ol.notifyPermission,setNotifyOnComplete:Ol.setNotifyOnComplete,setNotifyOnQuestion:Ol.setNotifyOnQuestion,soundOnComplete:jp.soundOnComplete,setSoundOnComplete:jp.setSoundOnComplete,onboarded:S4,setOnboarded:Ule,load:gt.load,selectSession:gt.selectSession,clearActiveSession:gt.clearActiveSession,loadOlderMessages:gt.loadOlderMessages,loadWorkspaces:gt.loadWorkspaces,loadMoreSessions:gt.loadMoreSessions,loadAllSessions:gt.loadAllSessions,selectWorkspace:gt.selectWorkspace,openWorkspace:gt.openWorkspace,openWorkspaceDraft:gt.openWorkspaceDraft,startSessionAndSendPrompt:gt.startSessionAndSendPrompt,addWorkspaceByPath:gt.addWorkspaceByPath,browseFs:gt.browseFs,getFsHome:gt.getFsHome,sendPrompt:gt.sendPrompt,steerPrompt:gt.steerPrompt,sideChatVisible:Hs.sideChatVisible,sideChatSessionId:Hs.sideChatSessionId,sideChatTurns:Hs.sideChatTurns,sideChatRunning:Hs.sideChatRunning,sideChatSending:Hs.sideChatSending,openSideChat:Hs.openSideChat,closeSideChat:Hs.closeSideChat,sendSideChatPrompt:Hs.sendSideChatPrompt,uploadImage:gt.uploadImage,abortCurrentPrompt:gt.abortCurrentPrompt,respondApproval:gt.respondApproval,respondQuestion:gt.respondQuestion,dismissQuestion:gt.dismissQuestion,pendingQuestionActions:gt.pendingQuestionActions,pendingApprovalActions:gt.pendingApprovalActions,cancelTask:gt.cancelTask,setPermission:gt.setPermission,setThinking:Rn.setThinking,setPlanMode:gt.setPlanMode,togglePlanMode:gt.togglePlanMode,setSwarmMode:gt.setSwarmMode,toggleSwarmMode:gt.toggleSwarmMode,setGoalMode:gt.setGoalMode,toggleGoalMode:gt.toggleGoalMode,createGoal:gt.createGoal,controlGoal:gt.controlGoal,enqueue:gt.enqueue,dismissWarning:gt.dismissWarning,renameSession:gt.renameSession,renameWorkspace:gt.renameWorkspace,deleteWorkspace:gt.deleteWorkspace,reorderWorkspaces:sce,setWorkspaceSortMode:oce,archiveSession:gt.archiveSession,restoreSession:gt.restoreSession,loadArchivedSessions:gt.loadArchivedSessions,compact:gt.compact,forkSession:gt.forkSession,undo:gt.undo,unqueue:gt.unqueue,reorderQueue:gt.reorderQueue,searchFiles:gt.searchFiles,loadGitStatus:gt.loadGitStatus,loadFileDiff:gt.loadFileDiff,clearFileDiff:gt.clearFileDiff,listDir:gt.listDir,readFileContent:gt.readFileContent,getFileDownloadUrl:gt.getFileDownloadUrl,openWorkspaceFile:gt.openWorkspaceFile,openInApp:gt.openInApp,revealWorkspaceFile:gt.revealWorkspaceFile,resolveImageUrl:gt.resolveImageUrl,refreshOAuthProviderModels:Rn.refreshOAuthProviderModels,loadModels:Rn.loadModels,loadProviders:Rn.loadProviders,skills:kae,activateSkill:Rn.activateSkill,setModel:Rn.setModel,toggleStarModel:Rn.toggleStarModel,addProvider:Rn.addProvider,deleteProvider:Rn.deleteProvider,refreshProvider:Rn.refreshProvider,refreshAllProviders:Rn.refreshAllProviders,authReady:Yae,defaultModel:Qae,managedProviderStatus:Xae,config:Zae,updateConfig:gt.updateConfig,checkAuth:gt.checkAuth,startOAuthLogin:Rn.startOAuthLogin,pollOAuthLogin:Rn.pollOAuthLogin,cancelOAuthLogin:Rn.cancelOAuthLogin,logout:gt.logout}}const L4=qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=At(),n=DA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&BA(o)}return(o,i)=>(w(),ye(eo,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),fce=["aria-checked","aria-label","disabled"],pce=qe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(w(),N("button",{class:Re(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[x("span",{class:"ui-switch__thumb"},null,-1)])],10,fce))}}),Ir=dt(pce,[["__scopeId","data-v-dbe22dc4"]]),hce=["aria-label"],mce=["aria-selected","onClick"],gce={class:"body"},vce={class:"panel"},yce={class:"sec"},kce={class:"sec-title"},bce={class:"row"},_ce={class:"rlabel"},wce={class:"row"},Sce={class:"rlabel"},Cce={class:"row"},xce={class:"rlabel"},Ace={class:"num-field"},Tce=["value","aria-label"],Mce={class:"row"},Ece={class:"rlabel"},Ice={class:"row"},$ce={class:"rlabel"},Nce={class:"hint"},Lce={class:"sec"},Oce={class:"sec-title"},Pce={class:"row"},Rce={class:"rlabel"},Dce={key:0,class:"hint"},Bce={class:"row"},Fce={class:"rlabel"},Hce={key:0,class:"hint"},Wce={class:"row"},zce={class:"rlabel"},Uce={class:"panel"},jce={class:"sec"},qce={class:"sec-title"},Vce={class:"row"},Kce={class:"rlabel"},Gce={key:0,class:"rvalue"},Yce={class:"actions"},Qce={class:"panel"},Xce={class:"sec"},Zce={class:"sec-head"},Jce={class:"sec-title"},eue={key:0,class:"saving"},tue={class:"row"},nue={class:"rlabel"},sue={class:"hint"},oue={key:0,class:"select-wrap"},iue={key:0,value:"",disabled:""},rue=["label"],lue=["value"],aue={key:1,class:"rvalue mono"},cue={class:"row"},uue={class:"rlabel"},due={class:"hint"},fue={class:"row"},pue={class:"rlabel"},hue={class:"hint"},mue={class:"row"},gue={class:"rlabel"},vue={class:"hint"},yue={class:"row"},kue={class:"rlabel"},bue={class:"hint"},_ue={key:1,class:"empty-config"},wue={class:"panel"},Sue={class:"sec"},Cue={class:"sec-title"},xue={class:"row"},Aue={class:"rlabel"},Tue={class:"rvalue mono"},Mue={class:"row"},Eue={class:"rlabel"},Iue={class:"rvalue mono"},$ue={key:0,class:"row"},Nue={class:"rlabel"},Lue={class:"hint"},Oue={class:"hint"},Pue={class:"row"},Rue={class:"rlabel"},Due={key:0,class:"hint"},Bue={class:"panel"},Fue={class:"panel-head"},Hue={class:"panel-title"},Wue={class:"panel-desc"},zue={class:"archive-toolbar"},Uue={class:"archive-search"},jue=["placeholder"],que={value:"all"},Vue=["value"],Kue={key:0,class:"archive-empty"},Gue={key:0,class:"archive-list"},Yue={class:"archive-workspace"},Que={class:"path"},Xue={class:"count"},Zue={class:"setting-card"},Jue={class:"archive-meta"},ede={class:"archive-name"},tde={class:"archive-time"},nde={key:1,class:"archive-empty"},sde=100,ode=qe({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=J("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=B5(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=J(null);xy(u);function d(ne){ne.key==="Escape"&&o("close")}yn(()=>document.addEventListener("keydown",d)),xn(()=>document.removeEventListener("keydown",d));function f(){M3()}const h=B(()=>{const ne=new Map;for(const X of s.models??[])ne.set(X.id,{id:X.id,label:X.displayName??X.model??X.id,provider:X.provider});for(const[X,he]of Object.entries(s.config?.models??{})){if(ne.has(X))continue;const Pe=_(he);ne.set(X,{id:X,label:b(X,he,Pe),provider:Pe??X})}return Array.from(ne.values())}),p=B(()=>{const ne=new Map;for(const X of h.value){const he=ne.get(X.provider)??[];he.push(X),ne.set(X.provider,he)}for(const X of ne.values())X.sort((he,Pe)=>he.label.localeCompare(Pe.label));return Array.from(ne.entries()).toSorted(([X],[he])=>X.localeCompare(he)).map(([X,he])=>({provider:X,options:he}))}),m=B(()=>{const ne=s.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function _(ne){if(!ne||typeof ne!="object")return;const X=ne;return typeof X.provider=="string"?X.provider:void 0}function b(ne,X,he){if(!X||typeof X!="object")return ne;const Pe=X,je=typeof Pe.model=="string"?Pe.model:void 0,it=he??_(X);return je&&it?`${ne} (${it}/${je})`:je?`${ne} (${je})`:ne}function g(ne){return ne===!0}function v(ne){!ne||ne===s.config?.defaultModel||o("updateConfig",{defaultModel:ne})}function y(ne){ne!==m.value&&o("updateConfig",{defaultPermissionMode:ne})}function T(ne){const X=s.config?.[ne];o("updateConfig",{[ne]:!g(X)})}function P(){const ne=s.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function I(){o("updateConfig",{thinking:{enabled:!P()}})}function k(){const ne=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!ne})}function M(ne){i.value=ne}const $=Wy(),L=J([]),S=J(!1),E=J(!1),D=J(""),R=J("all"),H=J("archived-desc");async function U(){if(!(S.value||E.value)){S.value=!0;try{const ne=[];let X;for(;;){const he=await $.loadArchivedSessions({beforeId:X,pageSize:sde});if(ne.push(...he.items),!he.hasMore||he.items.length===0)break;const Pe=he.items.at(-1)?.id;if(Pe===void 0)break;X=Pe}L.value=ne,E.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{S.value=!1}}}Ve(i,ne=>{ne==="archived"&&!E.value&&U()});const G=B(()=>{const ne=new Set;for(const X of L.value)ne.add(X.cwd);return Array.from(ne).sort((X,he)=>X.localeCompare(he))}),Q=B(()=>{const ne=D.value.trim().toLowerCase();let X=L.value.filter(he=>he.archived===!0);return R.value!=="all"&&(X=X.filter(he=>he.cwd===R.value)),ne&&(X=X.filter(he=>he.title.toLowerCase().includes(ne))),X=X.slice(),H.value==="archived-desc"?X.sort((he,Pe)=>Pe.updatedAt.localeCompare(he.updatedAt)):H.value==="created-desc"?X.sort((he,Pe)=>Pe.createdAt.localeCompare(he.createdAt)):X.sort((he,Pe)=>he.title.localeCompare(Pe.title,"zh")),X}),V=B(()=>{const ne=new Map;for(const X of Q.value){const he=ne.get(X.cwd)??[];he.push(X),ne.set(X.cwd,he)}return Array.from(ne.entries()).map(([X,he])=>({cwd:X,items:he}))});async function re(ne){await $.restoreSession(ne)&&(L.value=L.value.filter(he=>he.id!==ne))}function pe(ne){const X=new Date(ne);if(Number.isNaN(X.getTime()))return ne;const he=Pe=>String(Pe).padStart(2,"0");return`${X.getFullYear()}-${he(X.getMonth()+1)}-${he(X.getDate())} ${he(X.getHours())}:${he(X.getMinutes())}`}return(ne,X)=>(w(),ye(dr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:X[18]||(X[18]=he=>o("close"))},{default:be(()=>[x("div",{ref_key:"dialogRef",ref:u,class:"sd"},[x("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(w(),N(Oe,null,tt(r,he=>x("button",{key:he.id,type:"button",class:Re(["tab",{on:i.value===he.id}]),role:"tab","aria-selected":i.value===he.id,onClick:Pe=>M(he.id)},O(C(n)(he.labelKey)),11,mce)),64))],8,hce),x("div",gce,[_n(x("section",vce,[x("section",yce,[x("h3",kce,O(C(n)("settings.appearance")),1),x("div",bce,[x("span",_ce,O(C(n)("theme.colorSchemeLabel")),1),ie(eo,{"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":X[0]||(X[0]=he=>o("setColorScheme",he))},null,8,["model-value","options"])]),x("div",wce,[x("span",Sce,O(C(n)("theme.accentLabel")),1),ie(eo,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":X[1]||(X[1]=he=>o("setAccent",he))},null,8,["model-value","options"])]),x("div",Cce,[x("span",xce,O(C(n)("settings.uiFontSize")),1),x("label",Ace,[x("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:X[2]||(X[2]=he=>o("setUiFontSize",Number(he.target.value)))},null,40,Tce),X[19]||(X[19]=x("span",{class:"num-unit"},"px",-1))])]),x("div",Mce,[x("span",Ece,O(C(n)("sidebar.language")),1),ie(L4)]),x("div",Ice,[x("span",$ce,[Ue(O(C(n)("settings.conversationToc"))+" ",1),x("span",Nce,O(C(n)("settings.conversationTocHint")),1)]),ie(Ir,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":X[3]||(X[3]=he=>o("setConversationToc",he))},null,8,["model-value","label"])])]),x("section",Lce,[x("h3",Oce,O(C(n)("settings.notifications")),1),x("div",Pce,[x("span",Rce,[Ue(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",Dce,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(Ir,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":X[4]||(X[4]=he=>o("setNotify",he))},null,8,["model-value","disabled","label"])]),x("div",Bce,[x("span",Fce,[Ue(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",Hce,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(Ir,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":X[5]||(X[5]=he=>o("setNotifyQuestion",he))},null,8,["model-value","disabled","label"])]),x("div",Wce,[x("span",zce,O(C(n)("settings.soundOnComplete")),1),ie(Ir,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":X[6]||(X[6]=he=>o("setSound",he))},null,8,["model-value","label"])])])],512),[[Eo,i.value==="general"]]),_n(x("section",Uce,[x("section",jce,[x("h3",qce,O(C(n)("settings.account")),1),x("div",Vce,[x("span",Kce,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(qt,{text:e.accountModel},{default:be(()=>[e.authReady&&e.accountModel?(w(),N("span",Gce,O(e.accountModel),1)):le("",!0)]),_:1},8,["text"])]),x("div",Yce,[ie(Ot,{variant:"secondary",size:"sm",onClick:X[7]||(X[7]=he=>{o("openOnboarding"),o("close")})},{default:be(()=>[Ue(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),ye(Ot,{key:0,variant:"danger-soft",size:"sm",onClick:X[8]||(X[8]=he=>o("logout"))},{default:be(()=>[Ue(O(C(n)("sidebar.signOut")),1)]),_:1})):(w(),ye(Ot,{key:1,variant:"primary",size:"sm",onClick:X[9]||(X[9]=he=>o("login"))},{default:be(()=>[Ue(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[Eo,i.value==="account"]]),_n(x("section",Qce,[x("section",Xce,[x("div",Zce,[x("h3",Jce,O(C(n)("settings.agentDefaults")),1),e.configSaving?(w(),N("span",eue,O(C(n)("settings.saving")),1)):le("",!0)]),e.config?(w(),N(Oe,{key:0},[x("div",tue,[x("span",nue,[Ue(O(C(n)("settings.defaultModel"))+" ",1),x("span",sue,O(C(n)("settings.defaultModelHint")),1)]),p.value.length>0?(w(),N("div",oue,[ie(U1,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:be(()=>[e.config.defaultModel?le("",!0):(w(),N("option",iue,O(C(n)("settings.noDefaultModel")),1)),(w(!0),N(Oe,null,tt(p.value,he=>(w(),N("optgroup",{key:he.provider,label:he.provider},[(w(!0),N(Oe,null,tt(he.options,Pe=>(w(),N("option",{key:Pe.id,value:Pe.id},O(Pe.label),9,lue))),128))],8,rue))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),N("span",aue,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),x("div",cue,[x("span",uue,[Ue(O(C(n)("settings.defaultPermission"))+" ",1),x("span",due,O(C(n)("settings.defaultPermissionHint")),1)]),ie(eo,{"model-value":m.value,options:a.map(he=>({value:he,label:C(n)(c[he])})),"onUpdate:modelValue":X[10]||(X[10]=he=>y(he))},null,8,["model-value","options"])]),x("div",fue,[x("span",pue,[Ue(O(C(n)("settings.defaultThinking"))+" ",1),x("span",hue,O(C(n)("settings.defaultThinkingHint")),1)]),ie(Ir,{"model-value":P(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":X[11]||(X[11]=he=>I())},null,8,["model-value","disabled","label"])]),x("div",mue,[x("span",gue,[Ue(O(C(n)("settings.defaultPlanMode"))+" ",1),x("span",vue,O(C(n)("settings.defaultPlanModeHint")),1)]),ie(Ir,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":X[12]||(X[12]=he=>T("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),x("div",yue,[x("span",kue,[Ue(O(C(n)("settings.mergeSkills"))+" ",1),x("span",bue,O(C(n)("settings.mergeSkillsHint")),1)]),ie(Ir,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":X[13]||(X[13]=he=>T("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),N("div",_ue,O(C(n)("settings.configUnavailable")),1))])],512),[[Eo,i.value==="agent"]]),_n(x("section",wue,[x("section",Sue,[x("h3",Cue,O(C(n)("settings.advanced")),1),x("div",xue,[x("span",Aue,O(C(n)("sidebar.daemon")),1),x("span",Tue,O(C(l)),1)]),x("div",Mue,[x("span",Eue,O(C(n)("settings.serverVersion")),1),x("span",Iue,O(e.serverVersion||"-"),1)]),e.config?(w(),N("div",$ue,[x("span",Nue,[Ue(O(C(n)("settings.telemetry"))+" ",1),x("span",Lue,O(C(n)("settings.telemetryHint")),1),x("span",Oue,O(C(n)("settings.telemetryRestartHint")),1)]),ie(Ir,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":X[14]||(X[14]=he=>k())},null,8,["model-value","disabled","label"])])):le("",!0),x("div",Pue,[x("span",Rue,[Ue(O(C(n)("settings.exportLog"))+" ",1),C(yi)()?le("",!0):(w(),N("span",Due,O(C(n)("settings.logHint")),1))]),ie(Ot,{variant:"secondary",size:"sm",onClick:f},{default:be(()=>[Ue(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[Eo,i.value==="advanced"]]),_n(x("section",Bue,[x("div",Fue,[X[20]||(X[20]=x("div",{class:"panel-kicker"},"Archived sessions",-1)),x("h4",Hue,O(C(n)("settings.archivedTitle")),1),x("p",Wue,O(C(n)("settings.archivedDesc")),1)]),x("div",zue,[x("label",Uue,[X[21]||(X[21]=x("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[x("circle",{cx:"11",cy:"11",r:"7"}),x("path",{d:"m21 21-4.3-4.3"})],-1)),_n(x("input",{"onUpdate:modelValue":X[15]||(X[15]=he=>D.value=he),placeholder:C(n)("settings.archivedSearch")},null,8,jue),[[lo,D.value]])]),ie(U1,{"model-value":R.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":X[16]||(X[16]=he=>R.value=he)},{default:be(()=>[x("option",que,O(C(n)("settings.archivedAllWorkspaces")),1),(w(!0),N(Oe,null,tt(G.value,he=>(w(),N("option",{key:he,value:he},O(he),9,Vue))),128))]),_:1},8,["model-value","aria-label"]),ie(eo,{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":X[17]||(X[17]=he=>H.value=he)},null,8,["model-value","options"])]),S.value?(w(),N("div",Kue,O(C(n)("settings.archivedLoadingAll")),1)):(w(),N(Oe,{key:1},[V.value.length>0?(w(),N("div",Gue,[(w(!0),N(Oe,null,tt(V.value,he=>(w(),N("section",{key:he.cwd,class:"archive-card"},[x("div",Yue,[X[22]||(X[22]=x("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[x("path",{d:"M3 7h6l2 2h10v9H3z"}),x("path",{d:"M3 7V5h6l2 2"})],-1)),x("span",Que,O(he.cwd),1),x("span",Xue,O(C(n)("settings.archivedSessionsCount",{count:he.items.length})),1)]),x("div",Zue,[(w(!0),N(Oe,null,tt(he.items,Pe=>(w(),N("div",{key:Pe.id,class:"archive-row"},[x("div",Jue,[x("div",ede,O(Pe.title),1),x("div",tde,O(C(n)("settings.archivedAt",{time:pe(Pe.updatedAt)})),1)]),ie(Ot,{variant:"secondary",size:"sm",onClick:je=>re(Pe.id)},{default:be(()=>[Ue(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(w(),N("div",nde,O(L.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[Eo,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),ide=dt(ode,[["__scopeId","data-v-47260198"]]),rde={class:"aw"},lde={class:"crumbbar"},ade={class:"crumbs"},cde={key:0,class:"crumb-sep"},ude=["onClick"],dde={key:0,class:"filterbar"},fde=["placeholder"],pde={class:"folder-list"},hde={key:0,class:"fl-loading"},mde=["onClick"],gde={class:"folder-name search-rel"},vde={key:0,class:"git-branch"},yde={key:0,class:"fl-empty"},kde={key:1,class:"fl-loading"},bde=["onClick"],_de={class:"folder-name"},wde={key:0,class:"git-branch"},Sde={key:0,class:"fl-empty"},Cde={class:"paste-row"},xde={class:"paste-input-wrap"},Ade={key:1,class:"add-error",role:"alert"},Tde={class:"actions"},Mde={class:"footer-hint"},Ede=600,Ide=6,bC=150,$de=qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=J(!0),r=J(!1),l=J(!1),a=J(""),c=J(null),u=J([]),d=J(""),f=J(!1),h=J([]),p=B(()=>d.value.trim().length>0);let m=0,_=null;function b(E,D){const R=E.toLowerCase(),H=D.toLowerCase();let U=0;for(let G=0;G<H.length&&U<R.length;G++)H[G]===R[U]&&U++;return U===R.length}async function g(E){const D=a.value,R=E.trim();if(!D||R===""){h.value=[],f.value=!1;return}const H=++m;f.value=!0;const U=[],G=[{path:D,depth:0}];let Q=0;for(;G.length>0&&Q<Ede&&U.length<bC;){if(H!==m)return;const V=G.shift();Q++;let re;try{re=await s.browseFs(V.path)}catch{continue}if(H!==m)return;for(const pe of re.entries){if(!pe.isDir)continue;const ne=pe.path.startsWith(D)?pe.path.slice(D.length).replace(/^\/+/,""):pe.path;if(b(R,ne||pe.name)&&(U.push({path:pe.path,name:pe.name,rel:ne||pe.name,isGitRepo:pe.isGitRepo,branch:pe.branch}),U.length>=bC))break;V.depth+1<Ide&&G.push({path:pe.path,depth:V.depth+1})}H===m&&(h.value=[...U])}H===m&&(f.value=!1)}Ve(d,E=>{if(_&&clearTimeout(_),E.trim()===""){m++,h.value=[],f.value=!1;return}_=setTimeout(()=>void g(E),220)});const v=J(!1),y=J(""),T=B(()=>y.value.trim()),P=B(()=>{const E=a.value;if(!E)return[];const D=E.split("/").filter(Boolean),R=[{label:"/",path:"/"}];let H="";for(const U of D)H+=`/${U}`,R.push({label:U,path:H});return R}),I=B(()=>a.value.length>0);async function k(E){r.value=!0;try{const D=await s.browseFs(E);if(!D.path){l.value=!0;return}a.value=D.path,c.value=D.parent,u.value=D.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function M(E){E.isDir&&k(E.path)}function $(){c.value&&k(c.value)}function L(){I.value&&o("add",a.value)}function S(){T.value.length!==0&&o("add",T.value)}return yn(async()=>{r.value=!0;try{if(s.defaultPath&&(await k(s.defaultPath),!l.value))return;const E=await s.getFsHome();E.home?await k(E.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),xn(()=>{_&&clearTimeout(_)}),(E,D)=>(w(),ye(dr,{open:i.value,"onUpdate:open":D[5]||(D[5]=R=>i.value=R),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:D[6]||(D[6]=R=>o("close"))},{default:be(()=>[x("div",rde,[l.value?le("",!0):(w(),N(Oe,{key:0},[x("div",lde,[ie(wn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:$},{default:be(()=>[ie(Xe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),x("div",ade,[(w(!0),N(Oe,null,tt(P.value,(R,H)=>(w(),N(Oe,{key:R.path},[H>1?(w(),N("span",cde,"/")):le("",!0),x("button",{class:Re(["crumb",{last:H===P.value.length-1}]),onClick:U=>k(R.path)},O(R.label),11,ude)],64))),128))])]),r.value?le("",!0):(w(),N("div",dde,[ie(Xe,{class:"filter-icon",name:"search",size:"md"}),_n(x("input",{"onUpdate:modelValue":D[0]||(D[0]=R=>d.value=R),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:D[1]||(D[1]=vt(()=>{},["stop"]))},null,40,fde),[[lo,d.value]]),f.value?(w(),ye(ii,{key:0,size:"sm"})):le("",!0)])),x("div",pde,[r.value?(w(),N("div",hde,O(C(n)("workspace.browsing")),1)):p.value?(w(),N(Oe,{key:1},[(w(!0),N(Oe,null,tt(h.value,R=>(w(),N("button",{key:R.path,class:"folder-row",onClick:H=>k(R.path)},[ie(Xe,{class:"dir-icon",name:"folder-closed",size:"sm"}),x("span",gde,O(R.rel),1),R.isGitRepo?(w(),ye(Ns,{key:0,variant:"info",size:"sm"},{default:be(()=>[Ue(O(C(n)("workspace.gitTag")),1),R.branch?(w(),N("span",vde,O(R.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,mde))),128)),!f.value&&h.value.length===0?(w(),N("div",yde,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),N("div",kde,O(C(n)("workspace.searching")),1)):le("",!0)],64)):(w(),N(Oe,{key:2},[(w(!0),N(Oe,null,tt(u.value,R=>(w(),N("button",{key:R.path,class:"folder-row",onClick:H=>M(R)},[ie(Xe,{class:"dir-icon",name:"folder-closed",size:"sm"}),x("span",_de,O(R.name),1),R.isGitRepo?(w(),ye(Ns,{key:0,variant:"info",size:"sm"},{default:be(()=>[Ue(O(C(n)("workspace.gitTag")),1),R.branch?(w(),N("span",wde,O(R.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,bde))),128)),u.value.length===0?(w(),N("div",Sde,O(C(n)("workspace.noSubfolders")),1)):le("",!0)],64))])],64)),x("div",{class:Re(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(w(),ye(Ot,{key:0,variant:"ghost",size:"sm",onClick:D[2]||(D[2]=R=>v.value=!0)},{default:be(()=>[Ue(O(C(n)("workspace.pasteToggle")),1)]),_:1})):(w(),ye(au,{key:1,label:C(n)("workspace.pathLabel")},{default:be(()=>[x("div",Cde,[x("div",xde,[ie(ql,{modelValue:y.value,"onUpdate:modelValue":D[3]||(D[3]=R=>y.value=R),placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:pi(vt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),ie(wn,{disabled:T.value.length===0,label:C(n)("workspace.add"),onClick:S},{default:be(()=>[ie(Xe,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(w(),N("div",Ade,O(e.error),1)):le("",!0),x("div",Tde,[ie(qt,{text:a.value},{default:be(()=>[l.value?le("",!0):(w(),ye(Ot,{key:0,variant:"primary",disabled:!I.value,onClick:L},{default:be(()=>[Ue(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Ot,{variant:"secondary",onClick:D[4]||(D[4]=R=>o("close"))},{default:be(()=>[Ue(O(C(n)("workspace.cancel")),1)]),_:1})]),x("div",Mde,O(C(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),Nde=dt($de,[["__scopeId","data-v-ad529757"]]),Lde={key:0,class:"confirm-dialog__message"},Ode=qe({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=t,{t:s}=At();function o(){n("update:open",!1),n("cancel")}return(i,r)=>(w(),ye(dr,{open:e.open,title:e.title,height:"auto","onUpdate:open":r[1]||(r[1]=l=>n("update:open",l)),onClose:o},{foot:be(()=>[ie(Ot,{variant:"secondary",disabled:e.loading,onClick:o},{default:be(()=>[Ue(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Ot,{variant:e.variant,loading:e.loading,onClick:r[0]||(r[0]=l=>n("confirm"))},{default:be(()=>[Ue(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:be(()=>[e.message?(w(),N("p",Lde,O(e.message),1)):le("",!0)]),_:1},8,["open","title"]))}}),Pde=dt(Ode,[["__scopeId","data-v-a9df9b9a"]]),Rde=qe({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=ll();return(s,o)=>(w(),ye(Pde,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,onConfirm:o[0]||(o[0]=i=>C(n)(!0)),onCancel:o[1]||(o[1]=i=>C(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),Dde={class:"rows"},Bde={class:"row"},Fde={class:"row"},Hde={class:"row"},Wde={class:"row"},zde={class:"row"},Ude={class:"row"},jde={class:"ctx-text"},qde={key:0,class:"bar"},Vde={class:"row"},Kde=qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=J(!0),r=B(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=B(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=B(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=B(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=B(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=B(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(w(),ye(dr,{open:i.value,"onUpdate:open":m[0]||(m[0]=_=>i.value=_),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=_=>o("close"))},{default:be(()=>[x("dl",Dde,[x("div",Bde,[x("dt",null,O(C(n)("status.statusModel")),1),x("dd",null,O(e.status.model),1)]),x("div",Fde,[x("dt",null,O(C(n)("status.statusThinking")),1),x("dd",null,O(e.thinking),1)]),x("div",Hde,[x("dt",null,O(C(n)("status.statusPermission")),1),x("dd",{style:Qt({color:c.value})},O(a(e.status.permission)),5)]),x("div",Wde,[x("dt",null,O(C(n)("status.statusPlanMode")),1),x("dd",{class:Re({"plan-on":e.planMode})},O(u.value),3)]),x("div",zde,[x("dt",null,O(C(n)("status.statusSwarmMode")),1),x("dd",{class:Re({"swarm-on":e.swarmMode})},O(d.value),3)]),x("div",Ude,[x("dt",null,O(C(n)("status.statusContext")),1),x("dd",null,[x("span",jde,O(l.value),1),e.status.ctxMax>0?(w(),N("span",qde,[x("i",{style:Qt({width:r.value+"%"})},null,4)])):le("",!0)])]),x("div",Vde,[x("dt",null,O(C(n)("status.statusCost")),1),x("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),Gde=dt(Kde,[["__scopeId","data-v-59dd31f3"]]),Yde={class:"ui-toast__icon","aria-hidden":"true"},Qde={class:"ui-toast__body"},Xde={class:"ui-toast__title"},Zde={key:0,class:"ui-toast__msg"},Jde=qe({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-toast",`ui-toast--${e.variant}`])},[x("span",Yde,[Nn(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),ye(Xe,{key:0,name:"check"})):e.variant==="danger"?(w(),ye(Xe,{key:1,name:"close"})):e.variant==="warning"?(w(),ye(Xe,{key:2,name:"alert-triangle"})):(w(),ye(Xe,{key:3,name:"info"}))],!0)]),x("div",Qde,[x("div",Xde,O(e.title),1),e.message?(w(),N("div",Zde,O(e.message),1)):le("",!0),Nn(t.$slots,"default",{},void 0,!0)]),ie(wn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:be(()=>[ie(Xe,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),efe=dt(Jde,[["__scopeId","data-v-adc6f346"]]),tfe={key:0,class:"actions"},nfe=["onClick"],sfe=["onClick"],ofe={key:1,class:"details"},ife=qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=At();function i(k){return typeof k=="object"&&k!==null}function r(k){return i(k)?k.title:k}function l(k){return i(k)?k.message??"":""}function a(k){return i(k)?k.details:void 0}function c(k){return i(k)?k.severity==="error":k.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(k)}function u(k){return i(k)?`notice:${k.severity}:${k.title}:${k.message??""}:${JSON.stringify(k.details??[])}`:`text:${k}`}function d(k){if(!i(k))return k;const M=[k.title];k.message&&M.push(k.message);const $=k.details??[];if($.length>0){M.push("",`${o("warnings.diagnostics")}:`);for(const L of $)M.push(`${L.label}: ${L.value}`)}return M.join(`
|
|
292
|
+
`)}let f=1;const h=J([]),p=new Map,m=new Map;function _(k){const M=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function b(k,M){const $=p.get(k)??{handle:null,deadline:0,remaining:0};$.handle=setTimeout(()=>I(k),M),$.deadline=Date.now()+M,p.set(k,$)}function g(k){const M=p.get(k);M&&M.handle!==null&&clearTimeout(M.handle),p.delete(k)}function v(k){const M=p.get(k);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function y(k){if(h.value.find(L=>L.id===k)?.detailsOpen)return;const $=p.get(k);!$||$.handle!==null||b(k,$.remaining)}function T(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?v(k.id):y(k.id)}async function P(k){if(!await js(d(k.warning)))return;k.copied=!0;const $=m.get(k.id);$&&clearTimeout($),m.set(k.id,setTimeout(()=>{k.copied=!1,m.delete(k.id)},1400))}function I(k){g(k);const M=m.get(k);M&&clearTimeout(M),m.delete(k);const $=h.value.findIndex(L=>L.id===k);$!==-1&&(h.value=h.value.filter(L=>L.id!==k),s("dismiss",$))}return Ve(()=>n.warnings,k=>{const M=[...h.value];h.value=k.map($=>{const L=u($),S=M.findIndex(R=>R.key===L),E=S===-1?void 0:M.splice(S,1)[0];if(E)return E.warning=$,E;const D={id:f++,key:L,warning:$,detailsOpen:!1,copied:!1};return b(D.id,_($)),D});for(const $ of M){g($.id);const L=m.get($.id);L&&clearTimeout(L),m.delete($.id)}},{immediate:!0,flush:"post"}),xn(()=>{p.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),p.clear(),m.forEach(k=>clearTimeout(k)),m.clear()}),(k,M)=>(w(),ye(c6,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:be(()=>[(w(!0),N(Oe,null,tt(h.value,$=>(w(),ye(efe,{key:$.id,variant:c($.warning)?"danger":"warning",title:r($.warning),message:l($.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:L=>I($.id),onPointerenter:L=>v($.id),onPointerleave:L=>y($.id)},{default:be(()=>[a($.warning)?.length?(w(),N("div",tfe,[x("button",{class:"link",type:"button",onClick:L=>T($)},O($.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,nfe),x("button",{class:"link",type:"button",onClick:L=>P($)},O($.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,sfe)])):le("",!0),$.detailsOpen&&a($.warning)?.length?(w(),N("dl",ofe,[(w(!0),N(Oe,null,tt(a($.warning),L=>(w(),N("div",{key:`${L.label}:${L.value}`,class:"detail-row"},[x("dt",null,O(L.label),1),x("dd",null,O(L.value),1)]))),128))])):le("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),rfe=dt(ife,[["__scopeId","data-v-92efeff8"]]),lfe={class:"topbar"},afe={class:"wsq"},cfe=["aria-label"],ufe={class:"tb-path"},dfe={class:"ws"},ffe={class:"se"},pfe={class:"tb-sub"},hfe=qe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t,i=B(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=B(()=>s.workspace?.name??n("workspace.noWorkspace")),l=B(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),N("div",lfe,[x("span",afe,O(i.value),1),x("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[x("span",ufe,[x("span",dfe,O(r.value),1),e.sessionTitle?(w(),N(Oe,{key:0},[c[2]||(c[2]=x("span",{class:"sl"},"/",-1)),x("span",ffe,O(e.sessionTitle),1)],64)):le("",!0),c[3]||(c[3]=x("span",{class:"cv"},"⌄",-1))]),x("span",pfe,[x("span",{class:Re(["rd",{on:e.running}])},null,2),x("span",null,O(l.value),1),e.branch?(w(),N(Oe,{key:0},[Ue(" · "+O(e.branch),1)],64)):le("",!0),e.sessionCount>0?(w(),N(Oe,{key:1},[Ue(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):le("",!0)])],8,cfe),ie(wn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:be(()=>[ie(Xe,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),mfe=dt(hfe,[["__scopeId","data-v-59a11935"]]),gfe={key:0,class:"sheet-root"},vfe=["aria-label"],yfe=["aria-label"],kfe={key:0,class:"sheet-head"},bfe={class:"sheet-title"},_fe={class:"sheet-body"},wfe=qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ve(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),xn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),ye(Xr,{name:"sheet"},{default:be(()=>[e.modelValue?(w(),N("div",gfe,[x("div",{class:"sheet-scrim",onClick:i}),x("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[x("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,yfe),e.title?(w(),N("div",kfe,[x("span",bfe,O(e.title),1)])):le("",!0),x("div",_fe,[Nn(l.$slots,"default",{},void 0,!0)])],8,vfe)])):le("",!0)]),_:3}))}}),O4=dt(wfe,[["__scopeId","data-v-4441dd70"]]),Sfe={class:"mlist"},Cfe={key:0,class:"mempty"},xfe=["onClick"],Afe={class:"mgh-main"},Tfe={class:"mgh-name"},Mfe={class:"mgh-path"},Efe={key:2,class:"att"},Ife={key:0,class:"mempty small"},$fe=["onClick"],Nfe={class:"m"},Lfe={class:"s"},Ofe={key:0,class:"att"},Pfe=["disabled","onClick"],Rfe=["onClick"],Dfe=qe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=At(),{confirm:s}=ll(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=J(new Set);function f(S){return d.value.has(S)}function h(S){const E=new Set(d.value);E.has(S)?E.delete(S):E.add(S),d.value=E,y.value=null,k.value=null}const p=J(new Set);function m(S){return p.value.has(S)}function _(S){const E=new Set(p.value);E.has(S)?E.delete(S):E.add(S),p.value=E}function b(S){if(m(S.workspace.id))return S.sessions;const E=S.sessions.slice(0,S.initialCount);if(o.activeId&&!E.some(D=>D.id===o.activeId)){const D=S.sessions.find(R=>R.id===o.activeId);if(D)return[...E,D]}return E}function g(S){if(!p.value.has(S)){const E=new Set(p.value);E.add(S),p.value=E}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=J(null);function T(S){y.value=y.value===S?null:S,k.value=null}function P(S){y.value=null;const D=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();D&&i("rename",S.id,D)}async function I(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const k=J(null);function M(S){k.value=k.value===S?null:S,y.value=null}function $(S){js(S.root),k.value=null}async function L(S){k.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,E)=>(w(),ye(O4,{"model-value":e.modelValue,"onUpdate:modelValue":E[2]||(E[2]=D=>i("update:modelValue",D))},{default:be(()=>[x("button",{type:"button",class:"newrow",onClick:c},[ie(Xe,{name:"message",size:"sm"}),Ue(" "+O(C(n)("sidebar.newChat")),1)]),x("button",{type:"button",class:"newrow secondary",onClick:u},[ie(Xe,{name:"folder",size:"sm"}),Ue(" "+O(C(n)("sidebar.newWorkspace")),1)]),x("div",Sfe,[e.groups.length===0?(w(),N("div",Cfe,O(C(n)("workspace.noWorkspace")),1)):le("",!0),(w(!0),N(Oe,null,tt(e.groups,D=>(w(),N("div",{key:D.workspace.id,class:"mgroup"},[x("div",{class:Re(["mgh",{on:D.workspace.id===e.activeWorkspaceId}]),onClick:R=>h(D.workspace.id)},[f(D.workspace.id)?(w(),ye(Xe,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),ye(Xe,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),x("div",Afe,[x("span",Tfe,O(D.workspace.name),1),ie(qt,{text:D.workspace.root},{default:be(()=>[x("span",Mfe,O(D.workspace.branch||D.workspace.shortPath),1)]),_:2},1032,["text"])]),f(D.workspace.id)&&v(D.workspace.id)>0?(w(),N("span",Efe,O(v(D.workspace.id)),1)):le("",!0),ie(wn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:vt(R=>M(D.workspace.id),["stop"])},{default:be(()=>[ie(Xe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(wn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:vt(R=>a(D.workspace.id),["stop"])},{default:be(()=>[ie(Xe,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),k.value===D.workspace.id?(w(),ye(Wl,{key:3,class:"kmenu wsmenu",onClick:E[0]||(E[0]=vt(()=>{},["stop"]))},{default:be(()=>[ie(gn,{size:"lg",onClick:R=>$(D.workspace)},{default:be(()=>[Ue(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(gn,{size:"lg",danger:"",onClick:R=>L(D.workspace)},{default:be(()=>[Ue(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,xfe),_n(x("div",null,[D.sessions.length===0?(w(),N("div",Ife,O(C(n)("sidebar.noSessions")),1)):le("",!0),(w(!0),N(Oe,null,tt(b(D),R=>(w(),N("div",{key:R.id,class:Re(["srow",{cur:R.id===e.activeId}]),onClick:H=>l(R.id)},[x("div",Nfe,[x("div",{class:Re(["t",{run:R.busy,aborted:R.status==="aborted"}])},O(R.title),3),x("div",Lfe,O(R.time),1)]),(e.attentionBySession[R.id]??0)>0?(w(),N("span",Ofe,O(e.attentionBySession[R.id]),1)):le("",!0),ie(wn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:vt(H=>T(R.id),["stop"])},{default:be(()=>[ie(Xe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===R.id?(w(),ye(Wl,{key:1,class:"kmenu",onClick:E[1]||(E[1]=vt(()=>{},["stop"]))},{default:be(()=>[ie(gn,{size:"lg",onClick:H=>P(R)},{default:be(()=>[Ue(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(gn,{size:"lg",danger:"",onClick:H=>I(R.id)},{default:be(()=>[Ue(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,$fe))),128)),D.hasMore||D.loadingMore?(w(),N("button",{key:1,type:"button",class:"mshow-more",disabled:D.loadingMore,onClick:vt(R=>g(D.workspace.id),["stop"])},O(D.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,D.workspace.sessionCount-D.sessions.length)})),9,Pfe)):le("",!0),D.sessions.length>D.initialCount?(w(),N("button",{key:2,type:"button",class:"mshow-more",onClick:vt(R=>_(D.workspace.id),["stop"])},O(m(D.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:D.sessions.length-D.initialCount})),9,Rfe)):le("",!0)],512),[[Eo,!f(D.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Bfe=dt(Dfe,[["__scopeId","data-v-58db7de1"]]),Ffe={class:"group-title"},Hfe={class:"srow-main"},Wfe={class:"srow-label"},zfe={class:"srow-sub"},Ufe={class:"srow read-only"},jfe={class:"srow-main"},qfe={class:"srow-label"},Vfe={key:0,class:"srow-sub"},Kfe={class:"srow-main"},Gfe={class:"srow-label"},Yfe={class:"srow-sub"},Qfe=["aria-checked"],Xfe={class:"srow-main"},Zfe={class:"srow-label"},Jfe={class:"srow-sub"},epe=["aria-checked"],tpe={class:"srow-main"},npe={class:"srow-label"},spe={class:"srow read-only"},ope={class:"srow-main"},ipe={class:"srow-label"},rpe={class:"srow-sub"},lpe=["aria-label"],ape={class:"group-title"},cpe={class:"srow-main"},upe={class:"srow-label"},dpe={class:"srow-sub"},fpe={class:"srow read-only pref"},ppe={class:"srow-main"},hpe={class:"srow-label"},mpe={class:"srow read-only pref"},gpe={class:"srow-main"},vpe={class:"srow-label"},ype={class:"srow read-only pref"},kpe={class:"srow-main"},bpe={class:"srow-label"},_pe={class:"num-field"},wpe=["value","aria-label"],Spe={class:"srow-main"},Cpe={class:"srow-label"},xpe={class:"srow-sub"},Ape=["aria-checked"],Tpe={class:"srow-main"},Mpe={class:"srow-label"},Epe={class:"srow-main"},Ipe={class:"srow-label"},$pe={key:2,class:"srow read-only"},Npe={class:"srow-main"},Lpe={class:"srow-label"},Ope={class:"srow-val dim"},Ppe={class:"arch-subhead"},Rpe={class:"arch-count"},Dpe={class:"arch-tools"},Bpe={key:0,class:"arch-empty"},Fpe={class:"arch-meta"},Hpe={class:"arch-name"},Wpe={class:"arch-time"},zpe={key:2,class:"arch-empty"},Upe=100,jpe=qe({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=At(),s=e,o=t;function i(pe){o("setColorScheme",pe)}const r=["manual","auto","yolo"],l=B(()=>{const pe=s.status?.modelId??s.status?.model??"";return s.models?.find(ne=>ne.id===pe||ne.model===pe||ne.displayName===s.status?.model)}),a=B(()=>md(l.value)),c=B(()=>wy(l.value)),u=B(()=>pc(l.value,s.thinking??"off")),d=B(()=>{const pe=c.value,ne=u.value;return pe.includes(ne)?ne:pe.includes("on")?"on":pe[0]??"off"}),f=B(()=>c.value.map(pe=>({value:pe,label:z1(pe)}))),h=B(()=>s.planMode===!0),p=B(()=>s.swarmMode===!0),m=B(()=>{const pe=s.status.permission;return pe==="yolo"?"var(--color-danger)":pe==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),_=B(()=>{const pe=s.status.permission,ne=n(pe==="yolo"?"mobile.permYoloSub":pe==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${pe} · ${ne}`}),b=pe=>`${Math.round(pe/1e3)}k`,g=B(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),v=B(()=>s.status.ctxMax>0?`${b(s.status.ctxUsed)}/${b(s.status.ctxMax)}`:n("status.statusNone"));function y(pe){o("setThinking",Sy(l.value,pe))}function T(){const pe=r.indexOf(s.status.permission),ne=r[(pe+1)%r.length];o("setPermission",ne)}function P(){o("pickModel"),o("update:modelValue",!1)}function I(){o("login"),o("update:modelValue",!1)}function k(){o("logout"),o("update:modelValue",!1)}const M=Wy(),$=J("main"),L=J([]),S=J(!1),E=J(!1),D=J(""),R=J("archived-desc");async function H(){if(!S.value){S.value=!0,E.value=!1;try{const pe=[];let ne;for(;;){const X=await M.loadArchivedSessions({beforeId:ne,pageSize:Upe});if(pe.push(...X.items),!X.hasMore||X.items.length===0)break;const he=X.items.at(-1)?.id;if(he===void 0)break;ne=he}L.value=pe,E.value=!0}catch(pe){console.warn("loadAllArchived failed",pe)}finally{S.value=!1}}}function U(){$.value="archived",D.value="",H()}function G(){$.value="main"}const Q=B(()=>{const pe=D.value.trim().toLowerCase();let ne=L.value.filter(X=>X.archived===!0);return pe&&(ne=ne.filter(X=>X.title.toLowerCase().includes(pe))),ne=ne.slice(),R.value==="archived-desc"?ne.sort((X,he)=>he.updatedAt.localeCompare(X.updatedAt)):R.value==="created-desc"?ne.sort((X,he)=>he.createdAt.localeCompare(X.createdAt)):ne.sort((X,he)=>X.title.localeCompare(he.title,"zh")),ne});async function V(pe){await M.restoreSession(pe)&&(L.value=L.value.filter(X=>X.id!==pe))}function re(pe){const ne=new Date(pe);if(Number.isNaN(ne.getTime()))return pe;const X=he=>String(he).padStart(2,"0");return`${ne.getFullYear()}-${X(ne.getMonth()+1)}-${X(ne.getDate())} ${X(ne.getHours())}:${X(ne.getMinutes())}`}return Ve(()=>s.modelValue,pe=>{pe||($.value="main")}),(pe,ne)=>(w(),ye(O4,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":ne[6]||(ne[6]=X=>o("update:modelValue",X))},{default:be(()=>[$.value==="main"?(w(),N(Oe,{key:0},[x("div",Ffe,O(C(n)("mobile.groupSession")),1),x("button",{type:"button",class:"srow",onClick:P},[x("span",Hfe,[x("span",Wfe,O(C(n)("status.statusModel")),1),x("span",zfe,O(e.status.model),1)]),ne[7]||(ne[7]=x("span",{class:"chev"},"›",-1))]),x("div",Ufe,[x("span",jfe,[x("span",qfe,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(w(),N("span",Vfe,O(C(n)("status.modeNotSupported")),1)):le("",!0)]),c.value.length>1?(w(),ye(eo,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(w(),N("span",{key:1,class:Re(["srow-val",{dim:d.value==="off"}])},O(d.value==="off"?C(n)("status.planOff"):C(z1)(d.value)),3))]),x("button",{type:"button",class:"srow",onClick:ne[0]||(ne[0]=X=>o("togglePlan"))},[x("span",Kfe,[x("span",Gfe,O(C(n)("status.statusPlanMode")),1),x("span",Yfe,O(C(n)("mobile.planModeSub")),1)]),x("span",{class:Re(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,Qfe)]),x("button",{type:"button",class:"srow",onClick:ne[1]||(ne[1]=X=>o("toggleSwarm"))},[x("span",Xfe,[x("span",Zfe,O(C(n)("status.statusSwarmMode")),1),x("span",Jfe,O(C(n)("mobile.swarmModeSub")),1)]),x("span",{class:Re(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,epe)]),x("button",{type:"button",class:"srow",onClick:T},[x("span",tpe,[x("span",npe,O(C(n)("status.statusPermission")),1),x("span",{class:"srow-sub",style:Qt({color:m.value})},O(_.value),5)]),ne[8]||(ne[8]=x("span",{class:"chev"},"›",-1))]),x("div",spe,[x("span",ope,[x("span",ipe,O(C(n)("status.statusContext")),1),x("span",rpe,O(v.value),1)]),x("span",{class:"ctx-meter","aria-label":v.value},[x("i",{style:Qt({width:g.value+"%"})},null,4)],8,lpe)]),x("div",ape,O(C(n)("mobile.groupApp")),1),x("button",{type:"button",class:"srow",onClick:U},[x("span",cpe,[x("span",upe,O(C(n)("mobile.archivedSessions")),1),x("span",dpe,O(C(n)("mobile.archivedSessionsSub")),1)]),ne[9]||(ne[9]=x("span",{class:"chev"},"›",-1))]),x("div",fpe,[x("span",ppe,[x("span",hpe,O(C(n)("theme.colorSchemeLabel")),1)]),ie(eo,{"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"])]),x("div",mpe,[x("span",gpe,[x("span",vpe,O(C(n)("sidebar.language")),1)]),ie(L4)]),x("div",ype,[x("span",kpe,[x("span",bpe,O(C(n)("settings.uiFontSize")),1)]),x("label",_pe,[x("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ne[2]||(ne[2]=X=>o("setUiFontSize",Number(X.target.value)))},null,40,wpe),ne[10]||(ne[10]=x("span",{class:"num-unit"},"px",-1))])]),x("button",{type:"button",class:"srow",onClick:ne[3]||(ne[3]=X=>o("setConversationToc",!e.conversationToc))},[x("span",Spe,[x("span",Cpe,O(C(n)("settings.conversationToc")),1),x("span",xpe,O(C(n)("settings.conversationTocHint")),1)]),x("span",{class:Re(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Ape)]),e.authReady?(w(),N("button",{key:0,type:"button",class:"srow acct out",onClick:k},[x("span",Tpe,[x("span",Mpe,O(C(n)("sidebar.signOut")),1)])])):(w(),N("button",{key:1,type:"button",class:"srow acct in",onClick:I},[x("span",Epe,[x("span",Ipe,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),N("div",$pe,[x("span",Npe,[x("span",Lpe,O(C(n)("settings.serverVersion")),1)]),x("span",Ope,O(e.serverVersion),1)])):le("",!0)],64)):(w(),N(Oe,{key:1},[x("div",Ppe,[x("button",{type:"button",class:"arch-back",onClick:G},[ne[11]||(ne[11]=x("span",{class:"chev back"},"‹",-1)),Ue(" "+O(C(n)("mobile.archivedBack")),1)]),x("span",Rpe,O(C(n)("mobile.sessionCount",{n:Q.value.length})),1)]),x("div",Dpe,[ie(ql,{class:"arch-search-input","model-value":D.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":ne[4]||(ne[4]=X=>D.value=X)},null,8,["model-value","placeholder"]),ie(eo,{size:"sm","model-value":R.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":ne[5]||(ne[5]=X=>R.value=X)},null,8,["model-value","options"])]),S.value?(w(),N("div",Bpe,O(C(n)("settings.archivedLoadingAll")),1)):Q.value.length>0?(w(!0),N(Oe,{key:1},tt(Q.value,X=>(w(),N("div",{key:X.id,class:"arch-row"},[x("div",Fpe,[x("div",Hpe,O(X.title),1),x("div",Wpe,O(C(n)("settings.archivedAt",{time:re(X.updatedAt)})),1)]),ie(Ot,{variant:"secondary",size:"sm",onClick:he=>V(X.id)},{default:be(()=>[Ue(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(w(),N("div",zpe,O(L.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),qpe=dt(jpe,[["__scopeId","data-v-eeaf31bb"]]),Vpe={class:"ob-brand"},Kpe={class:"ob-brand-text"},Gpe={class:"ob-title"},Ype={class:"ob-sub"},Qpe={class:"ob-sec"},Xpe={class:"ob-label"},Zpe={class:"ob-sec"},Jpe={class:"ob-label"},ehe={class:"ob-sec"},the={class:"ob-label"},nhe=qe({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=At(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=z3();function c(d){o.value!==d&&BA(d)}function u(){n("complete")}return(d,f)=>(w(),ye(dr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:be(()=>[x("div",Vpe,[f[4]||(f[4]=x("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[x("defs",null,[x("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[x("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),x("g",{class:"ob-eyes",fill:"#000"},[x("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),x("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),x("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),x("div",Kpe,[x("div",Gpe,O(C(s)("onboarding.title")),1),x("div",Ype,O(C(s)("onboarding.subtitle")),1)])])]),default:be(()=>[x("section",Qpe,[x("div",Xpe,O(C(s)("onboarding.languageLabel")),1),ie(eo,{"model-value":C(o),options:C(DA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),x("section",Zpe,[x("div",Jpe,O(C(s)("theme.colorSchemeLabel")),1),ie(eo,{"model-value":C(i),options:[{value:"light",label:C(s)("theme.light")},{value:"dark",label:C(s)("theme.dark")},{value:"system",label:C(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),x("section",ehe,[x("div",the,O(C(s)("theme.accentLabel")),1),ie(eo,{"model-value":C(r),options:[{value:"blue",label:C(s)("theme.accentBlue")},{value:"mono",label:C(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),ie(Ot,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:be(()=>[Ue(O(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),she=dt(nhe,[["__scopeId","data-v-fbdd3eab"]]),ohe=["aria-label"],ihe={class:"gload-box"},rhe={class:"gload-text"},lhe=qe({__name:"GlobalLoading",setup(e){const{t}=At();return(n,s)=>(w(),N("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[x("div",ihe,[s[0]||(s[0]=p0('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-8d6a5c44></path></svg>',1)),ie(ii,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),x("div",rhe,O(C(t)("app.connecting")),1)])],8,ohe))}}),ahe=dt(lhe,[["__scopeId","data-v-8d6a5c44"]]),che={class:"kap-root"},uhe={class:"kap-head"},dhe={class:"kap-count"},fhe={class:"kap-head-actions"},phe={class:"kap-filters"},hhe=["value"],mhe={class:"kap-check"},ghe={class:"kap-check"},vhe={class:"kap-view-toggle",role:"group"},yhe={key:0,class:"kap-empty"},khe=["onClick"],bhe={class:"kap-ts"},_he={class:"kap-label"},whe={key:0,class:"kap-detail"},She={class:"kap-detail-actions"},Che=["onClick"],xhe={key:1,class:"kap-agg"},Ahe={class:"mono"},The={class:"mono"},Mhe={class:"num"},Ehe={class:"num"},Ihe={key:0},$he={class:"mono"},Nhe={class:"num"},Lhe={class:"num"},Ohe={key:0},Phe=qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=J("all"),o=J(""),i=J(""),r=J(!1),l=J("timeline"),a=B(()=>(ky.value,[...zY()])),c=B(()=>{const M=new Set;for(const $ of a.value)$.sessionId&&M.add($.sessionId);return[...M].sort()});function u(M){return M.kind==="rest:error"||M.code!==void 0&&M.code!==0||M.eventType==="error"||M.eventType==="parse-error"}const d=B(()=>{const M=o.value.trim().toLowerCase();return a.value.filter($=>!(s.value!=="all"&&$.source!==s.value||i.value&&$.sessionId!==i.value||r.value&&!u($)||M&&!`${$.label} ${$.kind} ${$.eventType??""} ${$.sessionId??""} ${$.requestId??""}`.toLowerCase().includes(M)))}),f=B(()=>{const M=new Map;for(const $ of d.value){if($.kind!=="ws:in"&&$.kind!=="ws:out")continue;const L=$.kind==="ws:in"?"←":"→",S=`${L} ${$.eventType??"?"} @ ${$.sessionId??"-"}`,E=M.get(S)??{key:S,sessionId:$.sessionId??"-",eventType:$.eventType??"?",dir:L,count:0};E.count++,$.seq!==void 0&&(E.lastSeq=$.seq),M.set(S,E)}return[...M.values()].sort(($,L)=>L.count-$.count)}),h=B(()=>{const M=new Map;for(const $ of d.value){if($.source!=="rest"||$.kind==="rest:request")continue;const L=`${$.method??"?"} ${$.path??"?"}`,S=M.get(L)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u($)&&S.errors++,$.durationMs!==void 0&&(S.totalMs+=$.durationMs,S.timed++),M.set(L,S)}return[...M.entries()].map(([$,L])=>({key:$,count:L.count,errors:L.errors,avgMs:L.timed>0?Math.round(L.totalMs/L.timed):0})).sort(($,L)=>L.count-$.count)}),p=J(null),m=J(!0),_=J(null),b=J(null);Ve(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await mt();const M=_.value;M&&(M.scrollTop=M.scrollHeight)});function g(M){p.value=p.value===M?null:M}function v(M){const $=new Date(M),L=(S,E=2)=>String(S).padStart(E,"0");return`${L($.getHours())}:${L($.getMinutes())}:${L($.getSeconds())}.${L($.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function T(M){await js(y(M))&&(b.value=M.id,setTimeout(()=>{b.value===M.id&&(b.value=null)},1500))}function P(){M3(d.value)}function I(M){return u(M)||M.source==="client"?"b-err":M.source==="rest"?"b-rest":M.kind==="ws:lifecycle"?"b-life":M.kind==="ws:out"?"b-out":"b-in"}function k(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,$)=>(w(),N("section",che,[x("header",uhe,[$[11]||($[11]=x("strong",null,"KAP debug",-1)),x("span",dhe,O(d.value.length)+"/"+O(a.value.length),1),x("div",fhe,[x("button",{type:"button",class:Re({on:C(lu)}),onClick:$[0]||($[0]=L=>lu.value=!C(lu))},O(C(lu)?"resume":"pause"),3),x("button",{type:"button",onClick:$[1]||($[1]=L=>C(UY)())},"clear"),x("button",{type:"button",onClick:$[2]||($[2]=L=>P())},"export jsonl"),ie(qt,{text:"Close window"},{default:be(()=>[x("button",{type:"button",onClick:$[3]||($[3]=L=>n("close"))},"✕")]),_:1})])]),x("div",phe,[_n(x("select",{"onUpdate:modelValue":$[4]||($[4]=L=>s.value=L),"aria-label":"Source filter"},[...$[12]||($[12]=[x("option",{value:"all"},"rest + ws + app",-1),x("option",{value:"rest"},"rest",-1),x("option",{value:"ws"},"ws",-1),x("option",{value:"client"},"app errors",-1)])],512),[[Fv,s.value]]),_n(x("select",{"onUpdate:modelValue":$[5]||($[5]=L=>i.value=L),"aria-label":"Session filter"},[$[13]||($[13]=x("option",{value:""},"all sessions",-1)),(w(!0),N(Oe,null,tt(c.value,L=>(w(),N("option",{key:L,value:L},O(L),9,hhe))),128))],512),[[Fv,i.value]]),_n(x("input",{"onUpdate:modelValue":$[6]||($[6]=L=>o.value=L),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[lo,o.value]]),x("label",mhe,[_n(x("input",{"onUpdate:modelValue":$[7]||($[7]=L=>r.value=L),type:"checkbox"},null,512),[[cp,r.value]]),$[14]||($[14]=Ue(" errors",-1))]),x("label",ghe,[_n(x("input",{"onUpdate:modelValue":$[8]||($[8]=L=>m.value=L),type:"checkbox"},null,512),[[cp,m.value]]),$[15]||($[15]=Ue(" follow",-1))]),x("div",vhe,[x("button",{type:"button",class:Re({on:l.value==="timeline"}),onClick:$[9]||($[9]=L=>l.value="timeline")},"timeline",2),x("button",{type:"button",class:Re({on:l.value==="aggregate"}),onClick:$[10]||($[10]=L=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),N("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(w(),N("div",yhe," No trace entries yet. REST calls and WS frames will appear here. ")):le("",!0),(w(!0),N(Oe,null,tt(d.value,L=>(w(),N("div",{key:L.id,class:"kap-row-wrap"},[x("button",{type:"button",class:Re(["kap-row",{expanded:p.value===L.id}]),onClick:S=>g(L.id)},[x("span",bhe,O(v(L.ts)),1),x("span",{class:Re(["kap-badge",I(L)])},O(k(L)),3),x("span",_he,O(L.label),1)],10,khe),p.value===L.id?(w(),N("div",whe,[x("div",She,[x("button",{type:"button",onClick:S=>T(L)},O(b.value===L.id?"copied ✓":"copy json"),9,Che)]),x("pre",null,O(y(L)),1)])):le("",!0)]))),128))],512)):(w(),N("div",xhe,[$[20]||($[20]=x("h4",null,"WS frames by session / type",-1)),x("table",null,[$[17]||($[17]=x("thead",null,[x("tr",null,[x("th",null,"dir"),x("th",null,"type"),x("th",null,"session"),x("th",null,"count"),x("th",null,"last seq")])],-1)),x("tbody",null,[(w(!0),N(Oe,null,tt(f.value,L=>(w(),N("tr",{key:L.key},[x("td",null,O(L.dir),1),x("td",Ahe,O(L.eventType),1),x("td",The,O(L.sessionId),1),x("td",Mhe,O(L.count),1),x("td",Ehe,O(L.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),N("tr",Ihe,[...$[16]||($[16]=[x("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):le("",!0)])]),$[21]||($[21]=x("h4",null,"REST by endpoint",-1)),x("table",null,[$[19]||($[19]=x("thead",null,[x("tr",null,[x("th",null,"endpoint"),x("th",null,"count"),x("th",null,"errors"),x("th",null,"avg ms")])],-1)),x("tbody",null,[(w(!0),N(Oe,null,tt(h.value,L=>(w(),N("tr",{key:L.key},[x("td",$he,O(L.key),1),x("td",Nhe,O(L.count),1),x("td",{class:Re(["num",{err:L.errors>0}])},O(L.errors),3),x("td",Lhe,O(L.avgMs),1)]))),128)),h.value.length===0?(w(),N("tr",Ohe,[...$[18]||($[18]=[x("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):le("",!0)])])]))]))}}),Rhe=dt(Phe,[["__scopeId","data-v-3cda6fe3"]]),Dhe=qe({__name:"DebugPanel",setup(e){const t=J(!1);let n=null,s=null,o=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const 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(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=up(Rhe,{onClose:()=>u.close()});f.mount(d),s=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return yn(()=>{c()}),fs(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),ye(qt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:be(()=>[x("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),Bhe=dt(Dhe,[["__scopeId","data-v-21346738"]]);function Fhe({client:e,authLogoRef:t}){const n=B(()=>e.authReady.value),s=B(()=>e.initialized.value&&!n.value),o="/login",i=J(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)}Ve(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return xn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function Hhe({running:e,showAuthGate:t}){const{t:n}=At(),s=["◐","◓","◑","◒"],o=J(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ve(e,c=>{c?r():l()},{immediate:!0});const a=B(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});xI(()=>{typeof document<"u"&&(document.title=a.value)}),xn(()=>{l()})}const P4=J(typeof window>"u"?0:window.innerWidth);let Sf=0,Gp=!1;function V1(){P4.value=window.innerWidth}function Whe(){Gp||typeof window>"u"||(window.addEventListener("resize",V1),Gp=!0,V1())}function zhe(){!Gp||typeof window>"u"||(window.removeEventListener("resize",V1),Gp=!1)}function R4(e,t,n){return Math.max(t,e-n)}function K1(e,t,n){return Math.min(n,Math.max(t,e))}function D4(){return yn(()=>{Sf+=1,Whe()}),fs(()=>{Sf=Math.max(0,Sf-1),Sf===0&&zhe()}),{viewportWidth:P4}}const Uhe="kimi-web.file-preview-width",Ra=320;function jhe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=D4(),i=B(()=>Math.max(0,o.value-t.value)),r=B(()=>R4(i.value,Ra,Ra));function l(oe){return K1(Math.round(oe),Ra,r.value)}function a(){return l(i.value/2)}const c=B(()=>a()),u=J(c.value),d=B(()=>K1(u.value,Ra,r.value)),f=J(null),h=B(()=>{const oe=f.value;if(!oe)return null;const Z=e.turns.value.find(ue=>ue.id===oe.turnId)?.blocks?.[oe.blockIndex];return Z?.kind==="thinking"?Z.thinking:null}),p=B(()=>h.value!==null);function m(oe){const W=f.value;if(W&&W.turnId===oe.turnId&&W.blockIndex===oe.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=oe}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const b=J(null),g=B(()=>{const oe=b.value;if(!oe)return null;const W=e.turns.value.find(Z=>Z.id===oe.turnId);return W?.role==="compaction"&&W.text?W.text:null}),v=B(()=>g.value!==null);function y(oe){if(b.value?.turnId===oe.turnId){b.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",b.value=oe}function T(){b.value=null,n.value==="compaction"&&(n.value=null)}const P=J(null);function I(oe){const W=e.activeAppTasks.value,Z=W.find(ae=>ae.id===oe)??W.find(ae=>ae.parentToolCallId===oe);if(Z)return Z.id;const ue=W.filter(ae=>ae.kind==="subagent"&&!ae.parentToolCallId);if(ue.length===1)return ue[0].id}const k=B(()=>{const oe=P.value;if(!oe)return null;const W=e.activeAppTasks.value.find(Z=>Z.id===oe.subagentId);return W?Ore(W):null}),M=B(()=>k.value!==null);function $(oe){const W=I(oe);if(W){if(P.value?.subagentId===W){P.value=null,n.value==="agent"&&(n.value=null);return}P.value={subagentId:W},n.value="agent"}}function L(){P.value=null,n.value==="agent"&&(n.value=null)}const S=J(null),E=B(()=>{const oe=S.value;if(!oe)return null;const W=UP(e.turns.value,oe);return W?{id:oe,title:ea(W.name),path:zP(W.arg),lines:W.status==="error"?null:WA(W),output:W.output}:null}),D=B(()=>E.value!==null);function R(oe){if(n.value==="toolDiff"&&S.value===oe){H();return}n.value="toolDiff",S.value=oe}function H(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const U=J("list"),G=J(null);function Q(){if(n.value==="diff"){V();return}n.value="diff",U.value="list",G.value=null,e.loadGitStatus(e.activeSessionId.value)}function V(){n.value==="diff"&&(n.value=null),U.value="list",G.value=null,e.clearFileDiff()}async function re(oe){U.value="detail",G.value=oe,await e.loadFileDiff(oe)}async function pe(oe){await e.openSideChat(oe),n.value="btw"}function ne(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function X(){n.value==="btw"&&(n.value=null)}const he=B(()=>e.sideChatVisible.value),Pe=B(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||M.value)&&(n.value!=="toolDiff"||D.value)&&(n.value!=="btw"||he.value)),je=J(!1),it=J({});function ce(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return b.value?{kind:"compaction",...b.value}:null;case"agent":return P.value?{kind:"agent",...P.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function z(oe){if(oe)switch(oe.kind){case"thinking":f.value={turnId:oe.turnId,blockIndex:oe.blockIndex},n.value="thinking";break;case"compaction":b.value={turnId:oe.turnId},n.value="compaction";break;case"agent":P.value={subagentId:oe.subagentId},n.value="agent";break;case"toolDiff":S.value=oe.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Y(){return n.value==="thinking"&&p.value?(_(),!0):n.value==="compaction"&&v.value?(T(),!0):n.value==="agent"&&M.value?(L(),!0):n.value==="toolDiff"&&D.value?(H(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(V(),!0):n.value==="btw"?(ne(),!0):!1}return Ve(e.activeSessionId,(oe,W)=>{if(W){const Z=ce();Z?it.value[W]=Z:delete it.value[W]}s(),_(),T(),L(),H(),V(),X(),oe&&z(it.value[oe])}),{PREVIEW_WIDTH_KEY:Uhe,PREVIEW_MIN:Ra,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:T,agentPanelMember:k,agentPanelVisible:M,openAgentPanel:$,closeAgentPanel:L,toolDiffTarget:E,toolDiffVisible:D,openToolDiff:R,closeToolDiff:H,detailDiffMode:U,detailDiffPath:G,openDiffDetail:Q,closeDiffDetail:V,selectDiffFile:re,btwVisible:he,openSideChatTab:pe,closeSideChat:ne,hideSideChatPanel:X,sidePanelVisible:Pe,panelDragging:je,closeOpenSidePanel:Y}}const qhe=It.sidebarWidth,_C=It.sidebarCollapsed,wC=270,_v=170,Vhe=36,Khe=320;function Ghe(e={}){const{viewportWidth:t}=D4(),n=J(wC),s=J(!1),o=B(()=>{const c=Khe+(VC(e.previewOpen)?Ra:0);return R4(t.value,_v,c)}),i=B(()=>s.value?Vhe:K1(n.value,_v,o.value));function r(){try{s.value=ts(_C)==="true"}catch{s.value=!1}}function l(){try{os(_C,String(s.value))}catch{}}function a(){s.value=!s.value,l()}return{SIDEBAR_WIDTH_KEY:qhe,SIDEBAR_DEFAULT:wC,SIDEBAR_MIN:_v,sidebarMax:o,sessionColWidth:n,sidebarCollapsed:s,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function Yhe({client:e,detailTarget:t}){const{t:n}=At(),s=J(null),o=J(null),i=J(!1),r=J(null),l=J(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=B(()=>{const I=l.value;return I?e.getFileDownloadUrl(I):null}),f=B(()=>s.value!==null);function h(I){return I.length>1?I.replace(/\/+$/,""):I}function p(I){const k=[];for(const M of I.split(/[\\/]+/))if(!(!M||M===".")){if(M===".."){k.pop();continue}k.push(M)}return k.join("/")}function m(I){const k=I.trim();if(!k)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(k))return{error:n("filePreview.errors.unsupportedPath")};if(k.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const M=h(e.status.value.cwd);if(k.startsWith("/")){if(!M||k!==M&&!k.startsWith(`${M}/`))return{error:n("filePreview.errors.outsideWorkspace")};const L=k===M?"":k.slice(M.length+1);if(L.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(L);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const $=p(k);return $?{path:$}:{error:n("filePreview.errors.emptyPath")}}async function _(I){const k=s.value;if(t.value==="file"&&k&&k.path===I.path&&k.line===I.line){y();return}const M=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=I,l.value=null;const $=m(I.path);if("error"in $){i.value=!1,r.value=$.error;return}l.value=$.path;try{const L=await e.readFileContent($.path);if(M!==a)return;L?o.value={...L,path:L.path||$.path}:o.value={path:$.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(L){if(M!==a)return;r.value=L instanceof Error?L.message:n("filePreview.errors.loadFailed")}finally{M===a&&(i.value=!1)}}function b(I){return/^data:([^;,]+)/i.exec(I)?.[1]}function g(I){if(I.kind!=="image")return;const k=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const M={path:I.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:I.mimeType??b(I.url)??"image/*",isBinary:!0,size:I.bytes??0};I.fileId?(i.value=!0,o.value=M,pt().getFileBlob(I.fileId).then($=>{if(k===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL($),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{k===a&&(o.value&&(o.value={...o.value,sourceUrl:I.url}),i.value=!1)})):(i.value=!1,o.value={...M,sourceUrl:I.url})}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ve(t,(I,k)=>{k==="file"&&I!=="file"&&v()});function T(){const I=o.value?.path??s.value?.path;I&&e.openWorkspaceFile(I,s.value?.line)}function P(){const I=o.value?.path??s.value?.path;I&&e.revealWorkspaceFile(I)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:_,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:T,revealPreviewFile:P}}const Qhe=640,Xhe=`(max-width: ${Qhe}px)`;function Zhe(){const e=J(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Xhe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),xn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),xn(()=>t.removeListener(n))),e}const Jhe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},eme={class:"server-auth-card"},tme={class:"server-auth-body"},nme={class:"server-auth-foot"},sme=qe({__name:"ServerAuthDialog",setup(e){const t=J(""),n=J(null),s=J(!1);yn(()=>{mt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,I3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(w(),N("div",Jhe,[x("div",eme,[l[1]||(l[1]=x("div",{class:"server-auth-head"},[x("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),x("p",{class:"server-auth-hint"},[Ue(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),x("code",null,"KIMI_CODE_PASSWORD"),Ue("). ")])],-1)),x("div",tme,[ie(ql,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:s.value,onKeydown:i},null,8,["modelValue","disabled"])]),x("div",nme,[ie(Ot,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:be(()=>[Ue(O(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),ome=dt(sme,[["__scopeId","data-v-82150ea4"]]),ime={class:"app-shell"},rme={key:1,class:"auth-page"},lme={class:"auth-page-inner"},ame={class:"auth-page-copy"},cme={key:0,class:"sidebar-rail"},ume=["aria-label","aria-hidden"],dme=qe({__name:"App",setup(e){const t=JY(),n=J(!t);let s=null;const o=Wy(),i=B(()=>!o.dangerousBypassAuth.value&&n.value);In("resolveImage",o.resolveImageUrl),In("resolveSwarmMembers",ft=>o.swarmMembersByToolCallId.value.get(ft)??[]);const{t:r}=At(),l=yi(),a=Zhe(),c=J(!1),u=J(!1),d=B(()=>{const ft=o.activeSessionId.value;return o.sessions.value.find(ve=>ve.id===ft)?.title??""}),f=B(()=>o.visibleWorkspace.value?.sessionCount??0),h=B(()=>o.activity.value!=="idle"),p=J(null),{showAuthGate:m,blinkAuthLogo:_}=Fhe({client:o,authLogoRef:p});Hhe({running:h,showAuthGate:m});function b(ft){const ve=o.status.value.modelId??o.status.value.model??"",Le=o.models.value.find(se=>se.id===ve||se.model===ve||se.displayName===o.status.value.model),On=wy(Le),As=pc(Le,ft),sa=On.indexOf(As),Sc=On[(sa+1)%On.length]??On[0]??"off";return Sy(Le,Sc)}const g=J(!o.onboarded.value);function v(){o.setOnboarded(!0),g.value=!1}function y(){g.value=!0}yn(()=>{o.load(),je(),document.addEventListener("keydown",T,!0),s=tQ(()=>{n.value=!0,o.clearDangerousBypassAuth()})}),xn(()=>{document.removeEventListener("keydown",T,!0),s!==null&&(s(),s=null)});function T(ft){ft.key==="Escape"&&(Xt.value||ot()&&(ft.stopPropagation(),ft.preventDefault()))}const P=J(null),I=J(!1);Ve(o.activeSessionId,()=>{I.value=!0,mt(()=>{I.value=!1})});const{previewTarget:k,previewFile:M,previewLoading:$,previewError:L,previewDownloadUrl:S,previewExternalActions:E,openFilePreview:D,openMediaPreview:R,closeFilePreview:H,openPreviewInEditor:U,revealPreviewFile:G}=Yhe({client:o,detailTarget:P}),Q=B(()=>P.value!==null),{SIDEBAR_WIDTH_KEY:V,SIDEBAR_DEFAULT:re,SIDEBAR_MIN:pe,sidebarMax:ne,sessionColWidth:X,sidebarCollapsed:he,sideWidth:Pe,loadSidebarCollapsed:je,toggleSidebarCollapse:it}=Ghe({previewOpen:Q}),{PREVIEW_WIDTH_KEY:ce,PREVIEW_MIN:z,previewDefaultWidth:Y,previewMax:oe,previewWidth:W,previewPanelWidth:Z,thinkingPanelText:ue,thinkingVisible:ae,openThinkingPanel:me,closeThinkingPanel:j,compactionPanelText:ee,compactionPanelVisible:fe,openCompactionPanel:ke,closeCompactionPanel:Ae,agentPanelMember:Ie,openAgentPanel:de,closeAgentPanel:Me,toolDiffTarget:Ke,openToolDiff:lt,closeToolDiff:yt,detailDiffMode:kt,detailDiffPath:Tt,openDiffDetail:Pt,closeDiffDetail:_t,selectDiffFile:Vt,btwVisible:cn,openSideChatTab:is,closeSideChat:Rt,sidePanelVisible:tn,panelDragging:xs,closeOpenSidePanel:ot}=jhe({client:o,sideWidth:Pe,detailTarget:P,closeFilePreview:H}),Fn=J(null),kn=J(!1),Gn=J(!1),Hn=J(!1),Ln=J(!1),rs=J(!1),Ge=J(!1),Qe=J(null),Dt=J(null),Xt=B(()=>$a.value>0||kn.value||Gn.value||Hn.value||Ln.value||rs.value||Ge.value||g.value||c.value||u.value),Zt=J(!1),Jt=J(!1),An=J(!1),Mt=J(!1),Yn=J(!1);async function Ht(){Zt.value=!0,Jt.value=!1,kn.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{Jt.value=!0}finally{Zt.value=!1}}async function ks(){An.value=!0,Mt.value=!1,Gn.value=!0;try{await o.loadProviders()}catch{Mt.value=!0}finally{An.value=!1}}function bs(){Hn.value=!0}async function Fo(ft){kn.value=!1,await o.setModel(ft)}async function Rs(ft){await o.addProvider(ft)}async function wo(ft){await o.deleteProvider(ft)}async function ao(ft){await o.refreshProvider(ft)}async function Nt(ft){Yn.value=!0;try{await o.updateConfig(ft)&&await o.checkAuth()}finally{Yn.value=!1}}async function Ho(){return o.startOAuthLogin()}async function Wo(){return o.pollOAuthLogin()}async function Ye(){return o.cancelOAuthLogin()}async function et(){Hn.value=!1,await o.checkAuth(),await o.load()}async function st(ft){await o.undo(1),await mt(),Fn.value?.loadComposerForEdit(ft.text,ft.images)}function Bt(ft){if(ft==="/compact"||ft.startsWith("/compact ")){o.compact(ft.slice(8).trim()||void 0);return}if(ft==="/swarm"||ft.startsWith("/swarm ")){const ve=ft.slice(6).trim();ve==="on"?o.setSwarmMode(!0):ve==="off"?o.setSwarmMode(!1):ve?(o.setSwarmMode(!0),o.sendPrompt(ve)):o.toggleSwarmMode();return}if(ft==="/goal"||ft.startsWith("/goal ")){const ve=ft.slice(5).trim();ve==="pause"||ve==="resume"||ve==="cancel"?o.controlGoal(ve):ve?o.createGoal(ve):o.toggleGoalMode();return}if(ft==="/btw"||ft.startsWith("/btw ")){const ve=ft.slice(4).trim();!ve&&o.sideChatVisible.value?Rt():is(ve||void 0);return}switch(ft){case"/new":case"/clear":ns();break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const ve=o.permission.value,Le=ve==="manual"?"auto":ve==="auto"?"yolo":"manual";o.setPermission(Le);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(b(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":rs.value=!0;break;case"/model":Ht();break;case"/provider":break;case"/login":bs();break;default:{const ve=ft.indexOf(" "),Le=(ve===-1?ft:ft.slice(0,ve)).slice(1),On=ve===-1?void 0:ft.slice(ve+1).trim()||void 0;Le&&o.activateSkill(Le,On);break}}}function zo(ft){o.unqueue(ft)}function Li(ft){o.unqueue(ft)}function Ee(ft){o.reorderQueue(ft.from,ft.to)}async function xe(ft){const ve=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&ve){await o.startSessionAndSendPrompt(ve,ft.text,ft.attachments);return}if(!o.activeSessionId.value&&!ve){Qe.value=ft,Ln.value=!0;return}o.sendPrompt(ft.text,ft.attachments)}async function Be(ft){if(Dt.value=null,!await o.addWorkspaceByPath(ft)){Dt.value=r("workspace.addFailed");return}Ln.value=!1;const Le=Qe.value;Qe.value=null;const On=o.activeWorkspaceId.value;Le&&On&&await o.startSessionAndSendPrompt(On,Le.text,Le.attachments)}function $t(){Qe.value=null,Dt.value=null,Ln.value=!1}function zt(){mt(()=>{Fn.value?.focusComposer()})}function ns(){const ft=o.activeWorkspaceId.value;ft?o.openWorkspaceDraft(ft):o.clearActiveSession(),zt()}function Qn(ft){o.openWorkspaceDraft(ft),zt()}function Wn(ft){ft&&window.open(ft,"_blank","noopener")}return(ft,ve)=>(w(),N("div",ime,[i.value?(w(),ye(ome,{key:0})):le("",!0),C(m)?(w(),N("section",rme,[x("div",lme,[(w(),N("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:ve[0]||(ve[0]=vt(()=>{},["prevent"])),onClick:ve[1]||(ve[1]=(...Le)=>C(_)&&C(_)(...Le))},[...ve[94]||(ve[94]=[p0('<defs data-v-5261b12a><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-5261b12a><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-5261b12a></rect><g class="ch-eyes" fill="#000" data-v-5261b12a><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-5261b12a></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-5261b12a></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-5261b12a></rect>',2)])],544)),x("div",ame,[x("h1",null,O(C(r)("app.authPageTitle")),1),x("p",null,O(C(r)("app.authPageMessage")),1)]),ie(Ot,{class:"auth-page-btn",variant:"primary",onClick:bs},{default:be(()=>[ie(Xe,{name:"log-in",size:"md"}),x("span",null,O(C(r)("app.authPageLogin")),1)]),_:1})])])):(w(),N("div",{key:2,class:Re(["app",{mobile:C(a),"sidebar-collapsed":C(he)&&!C(a)}]),style:Qt({"--side-w":C(Pe)+"px","--preview-w":C(Z)+"px"})},[C(a)?(w(),ye(mfe,{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:ve[17]||(ve[17]=Le=>c.value=!0),onOpenSettings:ve[18]||(ve[18]=Le=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),N(Oe,{key:0},[_n(ie(LL,{"col-width":C(Pe),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,onSelect:ve[2]||(ve[2]=Le=>C(o).selectSession(Le)),onCreate:ns,onCreateInWorkspace:ve[3]||(ve[3]=Le=>Qn(Le)),onSelectWorkspace:ve[4]||(ve[4]=Le=>C(o).openWorkspace(Le)),onAddWorkspace:ve[5]||(ve[5]=Le=>Ln.value=!0),onRename:ve[6]||(ve[6]=(Le,On)=>C(o).renameSession(Le,On)),onArchive:ve[7]||(ve[7]=Le=>C(o).archiveSession(Le)),onFork:ve[8]||(ve[8]=Le=>C(o).forkSession(Le)),onRenameWorkspace:ve[9]||(ve[9]=(Le,On)=>C(o).renameWorkspace(Le,On)),onDeleteWorkspace:ve[10]||(ve[10]=Le=>C(o).deleteWorkspace(Le)),onReorderWorkspaces:ve[11]||(ve[11]=Le=>C(o).reorderWorkspaces(Le)),onSetWorkspaceSortMode:ve[12]||(ve[12]=Le=>C(o).setWorkspaceSortMode(Le)),onLoadMoreSessions:ve[13]||(ve[13]=Le=>void C(o).loadMoreSessions(Le)),onLoadAllSessions:ve[14]||(ve[14]=Le=>void C(o).loadAllSessions()),onOpenSettings:ve[15]||(ve[15]=Le=>Ge.value=!0),onCollapse:C(it)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),[[Eo,!C(he)]]),_n(ie(D_,{"storage-key":C(V),"default-width":C(re),min:C(pe),max:C(ne),"onUpdate:width":ve[16]||(ve[16]=Le=>X.value=Le)},null,8,["storage-key","default-width","min","max"]),[[Eo,!C(he)]]),C(he)?(w(),N("div",cme,[ie(wn,{size:"sm",label:C(r)("sidebar.expandSidebar"),onClick:C(it)},{default:be(()=>[ie(Xe,{name:"panel-expand",size:"sm"})]),_:1},8,["label","onClick"])])):le("",!0)],64)),ie(Wte,{ref_key:"conversationPaneRef",ref:Fn,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,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,sending:C(o).isSending.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:ve[19]||(ve[19]=Le=>C(Pt)()),onSelectWorkspace:ve[20]||(ve[20]=Le=>Qn(Le)),onAddWorkspace:ve[21]||(ve[21]=Le=>Ln.value=!0),onOpenPr:Wn,onSubmit:ve[22]||(ve[22]=Le=>xe(Le)),onSteer:ve[23]||(ve[23]=Le=>C(o).steerPrompt(Le.text,Le.attachments)),onApproval:ve[24]||(ve[24]=(Le,On)=>C(o).respondApproval(Le,On)),onCancelTask:ve[25]||(ve[25]=Le=>C(o).cancelTask(Le)),onAnswer:ve[26]||(ve[26]=(Le,On)=>C(o).respondQuestion(Le,On)),onDismiss:ve[27]||(ve[27]=Le=>C(o).dismissQuestion(Le)),onCommand:Bt,onInterrupt:ve[28]||(ve[28]=Le=>C(o).abortCurrentPrompt()),onUnqueue:zo,onEditQueued:Li,onReorderQueue:Ee,onSetPermission:ve[29]||(ve[29]=Le=>C(o).setPermission(Le)),onSetThinking:ve[30]||(ve[30]=Le=>C(o).setThinking(Le)),onTogglePlan:ve[31]||(ve[31]=Le=>C(o).togglePlanMode()),onToggleSwarm:ve[32]||(ve[32]=Le=>C(o).toggleSwarmMode()),onToggleGoal:ve[33]||(ve[33]=Le=>C(o).toggleGoalMode()),onCreateGoal:ve[34]||(ve[34]=Le=>C(o).createGoal(Le)),onControlGoal:ve[35]||(ve[35]=Le=>C(o).controlGoal(Le)),onRefreshGitStatus:ve[36]||(ve[36]=Le=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:ve[37]||(ve[37]=(Le,On)=>C(o).renameSession(Le,On)),onForkSession:ve[38]||(ve[38]=Le=>C(o).forkSession(Le)),onArchiveSession:ve[39]||(ve[39]=Le=>C(o).archiveSession(Le)),onCompact:ve[40]||(ve[40]=Le=>C(o).compact()),onPickModel:ve[41]||(ve[41]=Le=>Ht()),onSelectModel:ve[42]||(ve[42]=Le=>C(o).setModel(Le)),onOpenFile:ve[43]||(ve[43]=Le=>C(D)(Le)),onOpenMedia:ve[44]||(ve[44]=Le=>C(R)(Le)),onOpenThinking:ve[45]||(ve[45]=Le=>C(me)(Le)),onOpenCompaction:ve[46]||(ve[46]=Le=>C(ke)(Le)),onOpenAgent:ve[47]||(ve[47]=Le=>C(de)(Le)),onOpenToolDiff:ve[48]||(ve[48]=Le=>C(lt)(Le)),onEditMessage:st},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","queued","search-files","upload-image","sending","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(tn)&&!C(a)?(w(),ye(D_,{key:2,"storage-key":C(ce),"default-width":C(Y),min:C(z),max:C(oe),reverse:"","aria-label":C(r)("layout.resizePreviewAria"),"onUpdate:width":ve[49]||(ve[49]=Le=>W.value=Le),"onUpdate:dragging":ve[50]||(ve[50]=Le=>xs.value=Le)},null,8,["storage-key","default-width","min","max","aria-label"])):le("",!0),!C(a)||C(tn)?(w(),N("aside",{key:3,class:Re(["global-preview",{open:C(tn),mobile:C(a),"no-anim":C(xs)||I.value}]),role:"complementary","aria-label":C(r)("layout.detailPanelAria"),"aria-hidden":!C(tn)},[P.value==="thinking"&&C(ae)?(w(),ye(rC,{key:0,text:C(ue)??"",onClose:C(j)},null,8,["text","onClose"])):P.value==="compaction"&&C(fe)?(w(),ye(rC,{key:1,text:C(ee)??"",subtitle:C(r)("conversation.summaryTitle"),onClose:C(Ae)},null,8,["text","subtitle","onClose"])):P.value==="agent"&&C(Ie)?(w(),ye(ase,{key:2,member:C(Ie),onClose:C(Me)},null,8,["member","onClose"])):P.value==="btw"&&C(cn)?(w(),ye(Ese,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:ve[51]||(ve[51]=Le=>C(o).sendSideChatPrompt(Le)),onClose:C(Rt)},null,8,["turns","running","sending","onClose"])):P.value==="diff"?(w(),ye(soe,{key:4,mode:C(kt),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(Vt),onBack:ve[52]||(ve[52]=Le=>{kt.value="list",Tt.value=null,C(o).clearFileDiff()}),onClose:C(_t)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):P.value==="toolDiff"&&C(Ke)?(w(),ye(_se,{key:5,target:C(Ke),onClose:C(yt)},null,8,["target","onClose"])):P.value==="file"?(w(),ye(Une,{key:6,file:C(M),loading:C($),error:C(L),line:C(k)?.line,"download-url":C(S),closable:"","external-actions":C(E),"open-file":C(D),onClose:C(H),onOpenExternal:C(U),onReveal:C(G)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):le("",!0)],10,ume)):le("",!0),kn.value?(w(),ye(woe,{key:4,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:Zt.value,unavailable:Jt.value,onSelect:ve[53]||(ve[53]=Le=>Fo(Le)),onToggleStar:ve[54]||(ve[54]=Le=>C(o).toggleStarModel(Le)),onClose:ve[55]||(ve[55]=Le=>kn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):le("",!0),Ge.value?(w(),ye(ide,{key:5,"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-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":Yn.value,"server-version":C(o).serverVersion.value,onSetColorScheme:ve[56]||(ve[56]=Le=>C(o).setColorScheme(Le)),onSetAccent:ve[57]||(ve[57]=Le=>C(o).setAccent(Le)),onSetUiFontSize:ve[58]||(ve[58]=Le=>C(o).setUiFontSize(Le)),onSetNotify:ve[59]||(ve[59]=Le=>C(o).setNotifyOnComplete(Le)),onSetNotifyQuestion:ve[60]||(ve[60]=Le=>C(o).setNotifyOnQuestion(Le)),onSetSound:ve[61]||(ve[61]=Le=>C(o).setSoundOnComplete(Le)),onSetConversationToc:ve[62]||(ve[62]=Le=>C(o).setConversationToc(Le)),onUpdateConfig:ve[63]||(ve[63]=Le=>Nt(Le)),onLogin:ve[64]||(ve[64]=()=>{Ge.value=!1,bs()}),onLogout:C(o).logout,onOpenOnboarding:ve[65]||(ve[65]=()=>{Ge.value=!1,y()}),onOpenProviders:ve[66]||(ve[66]=()=>{Ge.value=!1,ks()}),onClose:ve[67]||(ve[67]=Le=>Ge.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):le("",!0),Gn.value?(w(),ye(Koe,{key:6,providers:C(o).providers.value,loading:An.value,unavailable:Mt.value,onAdd:ve[68]||(ve[68]=Le=>Rs(Le)),onRefresh:ve[69]||(ve[69]=Le=>ao(Le)),onDelete:ve[70]||(ve[70]=Le=>wo(Le)),onOpenLogin:ve[71]||(ve[71]=()=>{Gn.value=!1,bs()}),onClose:ve[72]||(ve[72]=Le=>Gn.value=!1)},null,8,["providers","loading","unavailable"])):le("",!0),rs.value?(w(),ye(Gde,{key:7,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:ve[73]||(ve[73]=Le=>rs.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):le("",!0),Ln.value?(w(),ye(Nde,{key:8,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:Dt.value,onAdd:ve[74]||(ve[74]=Le=>Be(Le)),onClose:$t},null,8,["browse-fs","get-fs-home","default-path","error"])):le("",!0),ie(Xr,{name:"gload-fade"},{default:be(()=>[C(o).initialized.value?le("",!0):(w(),ye(ahe,{key:0}))]),_:1}),g.value&&!C(m)?(w(),ye(she,{key:9,onComplete:v,onSkip:v})):le("",!0),ie(rfe,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(w(),ye(Bhe,{key:10})):le("",!0),ie(Rde),C(a)?(w(),ye(Bfe,{key:11,modelValue:c.value,"onUpdate:modelValue":ve[75]||(ve[75]=Le=>c.value=Le),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:ve[76]||(ve[76]=Le=>C(o).selectSession(Le)),onCreate:ns,onCreateInWorkspace:ve[77]||(ve[77]=Le=>Qn(Le)),onAddWorkspace:ve[78]||(ve[78]=Le=>Ln.value=!0),onRename:ve[79]||(ve[79]=(Le,On)=>C(o).renameSession(Le,On)),onArchive:ve[80]||(ve[80]=Le=>C(o).archiveSession(Le)),onDeleteWorkspace:ve[81]||(ve[81]=Le=>C(o).deleteWorkspace(Le)),onLoadMore:ve[82]||(ve[82]=Le=>void C(o).loadMoreSessions(Le))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):le("",!0),C(a)?(w(),ye(qpe,{key:12,modelValue:u.value,"onUpdate:modelValue":ve[83]||(ve[83]=Le=>u.value=Le),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:ve[84]||(ve[84]=Le=>Ht()),onSetThinking:ve[85]||(ve[85]=Le=>C(o).setThinking(Le)),onTogglePlan:ve[86]||(ve[86]=Le=>C(o).togglePlanMode()),onToggleSwarm:ve[87]||(ve[87]=Le=>C(o).toggleSwarmMode()),onSetPermission:ve[88]||(ve[88]=Le=>C(o).setPermission(Le)),onSetColorScheme:ve[89]||(ve[89]=Le=>C(o).setColorScheme(Le)),onSetUiFontSize:ve[90]||(ve[90]=Le=>C(o).setUiFontSize(Le)),onSetConversationToc:ve[91]||(ve[91]=Le=>C(o).setConversationToc(Le)),onLogin:ve[92]||(ve[92]=()=>{u.value=!1,bs()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):le("",!0)],6)),Hn.value?(w(),ye(Sie,{key:3,"on-start-o-auth-login":Ho,"on-poll-o-auth-login":Wo,"on-cancel-o-auth-login":Ye,onSuccess:et,onClose:ve[93]||(ve[93]=Le=>Hn.value=!1)})):le("",!0)]))}}),fme=dt(dme,[["__scopeId","data-v-5261b12a"]]);KY();up(fme).use(Bn).mount("#app");export{zE as $,l0 as A,NI as B,cs as C,dge as D,EC as E,Oe as F,p0 as G,Ue as H,ie as I,dI as J,Rme as K,fi as L,qe as M,o6 as N,Hme as O,Wme as P,jme as Q,Vf as R,Qa as S,uh as T,zme as U,m0 as V,Fme as W,pge as X,Ume as Y,rge as Z,hme as _,ox as a,zs as a$,Ps as a0,Q1 as a1,wme as a2,n0 as a3,M$ as a4,fn as a5,vc as a6,Mme as a7,gge as a8,Nme as a9,cx as aA,UI as aB,YI as aC,yn as aD,GI as aE,KI as aF,X1 as aG,VI as aH,xn as aI,o0 as aJ,gI as aK,w as aL,t6 as aM,Ame as aN,In as aO,KC as aP,xme as aQ,Xf as aR,Ls as aS,Gf as aT,J as aU,ege as aV,b6 as aW,tt as aX,Nn as aY,XI as aZ,Dme as a_,Pme as aa,Ome as ab,Lme as ac,nge as ad,vge as ae,jt as af,O$ as ag,ah,jr as ai,lr as aj,ss as ak,tge as al,$o as am,Qr as an,Hr as ao,Kme as ap,Gme as aq,mn as ar,mt as as,F$ as at,Re as au,pme as av,Qt as aw,zI as ax,qI as ay,fs as az,Cme as b,Xq as b$,cge as b0,Lu as b1,sp as b2,lge as b3,Yr as b4,lI as b5,gme as b6,Zl as b7,SI as b8,age as b9,lo as bA,Eo as bB,P$ as bC,oge as bD,Ve as bE,xI as bF,Eme as bG,AI as bH,Qme as bI,be as bJ,qme as bK,_n as bL,pi as bM,sge as bN,vt as bO,Tme as bP,pn as bQ,Js as bR,Tge as bS,HV as bT,ZM as bU,Ege as bV,mq as bW,ry as bX,Mge as bY,p1 as bZ,Pge as b_,mme as ba,O as bb,Cf as bc,Bme as bd,en as be,kme as bf,yme as bg,VC as bh,Jme as bi,vme as bj,C as bk,rd as bl,mge as bm,fge as bn,r6 as bo,Ime as bp,Xme as bq,CI as br,hge as bs,Vme as bt,$me as bu,sx as bv,cp as bw,m6 as bx,Yx as by,Fv as bz,ige as c,Qq as c0,sy as c1,Yq as c2,Cge as c3,aq as c4,Sge as c5,Op as c6,bge as c7,Gq as c8,VM as c9,Oge as ca,_ge as cb,Dge as cc,k1 as cd,za as ce,v1 as cf,Bge as cg,Rge as ch,Age as ci,To as cj,wge as ck,xge as cl,vq as cm,Lge as cn,y1 as co,g1 as cp,Nge as cq,kge as cr,$ge as cs,Ige as ct,dt as cu,yge as cv,$A as cw,l8 as cx,Zme as d,qr as e,bme as f,Xr as g,c6 as h,_me as i,Sme as j,oi as k,sd as l,ys as m,eh as n,ar as o,uge as p,B as q,up as r,ye as s,le as t,N as u,x as v,k$ as w,Yme as x,y$ as y,_6 as z};
|