@moonshot-ai/kimi-code 0.22.1 → 0.22.3

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.
Files changed (73) hide show
  1. package/dist/main.mjs +60695 -60035
  2. package/dist-web/assets/{CodeBlockNode-BeQAAdW3.js → CodeBlockNode--K4eRmNh.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-D-VEP4Fn.js → CodeBlockShell.vue_vue_type_style_index_0_lang-8z4SytTj.js} +1 -1
  4. package/dist-web/assets/DesignSystemView-BskvdBnn.css +1 -0
  5. package/dist-web/assets/DesignSystemView-gstQZ6Dp.js +12 -0
  6. package/dist-web/assets/{Tooltip-ChsJyhEI.js → Tooltip-sFOhW5c-.js} +1 -1
  7. package/dist-web/assets/arc-b1f-JaXG.js +1 -0
  8. package/dist-web/assets/{architectureDiagram-3BPJPVTR-iQ9G25kx.js → architectureDiagram-3BPJPVTR-DRV073hL.js} +1 -1
  9. package/dist-web/assets/{blockDiagram-GPEHLZMM-CuzX8waX.js → blockDiagram-GPEHLZMM-BG0TxS08.js} +1 -1
  10. package/dist-web/assets/{c4Diagram-AAUBKEIU-lWe0pssH.js → c4Diagram-AAUBKEIU-CsocakY-.js} +1 -1
  11. package/dist-web/assets/channel-Cwe7TdNc.js +1 -0
  12. package/dist-web/assets/{chunk-2J33WTMH-BcD2luAP.js → chunk-2J33WTMH-D7mBRhm2.js} +1 -1
  13. package/dist-web/assets/{chunk-4BX2VUAB-ZTdMsiUw.js → chunk-4BX2VUAB-BMOSnPC4.js} +1 -1
  14. package/dist-web/assets/{chunk-55IACEB6-JOHB87lb.js → chunk-55IACEB6-DH7ZU8ec.js} +1 -1
  15. package/dist-web/assets/{chunk-727SXJPM-BKcvO8HJ.js → chunk-727SXJPM-CaYu9Tne.js} +1 -1
  16. package/dist-web/assets/{chunk-AQP2D5EJ-pRCfr-UT.js → chunk-AQP2D5EJ-Dd2oKOPL.js} +1 -1
  17. package/dist-web/assets/{chunk-FMBD7UC4-Dwc_LTGi.js → chunk-FMBD7UC4-JdHZqUnV.js} +1 -1
  18. package/dist-web/assets/{chunk-ND2GUHAM-BXa5VPW8.js → chunk-ND2GUHAM-DBm1Ahcp.js} +1 -1
  19. package/dist-web/assets/{chunk-QZHKN3VN-DImyhT7B.js → chunk-QZHKN3VN-DmqufK50.js} +1 -1
  20. package/dist-web/assets/classDiagram-4FO5ZUOK-CQ4_AXuT.js +1 -0
  21. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CQ4_AXuT.js +1 -0
  22. package/dist-web/assets/{cose-bilkent-S5V4N54A-CmvBDyEQ.js → cose-bilkent-S5V4N54A-HNWFCNh9.js} +1 -1
  23. package/dist-web/assets/{dagre-BM42HDAG-BLlVemY_.js → dagre-BM42HDAG-Dv6WU7Ym.js} +1 -1
  24. package/dist-web/assets/{diagram-2AECGRRQ-S_ZOnEGh.js → diagram-2AECGRRQ-DlQ3gFah.js} +1 -1
  25. package/dist-web/assets/{diagram-5GNKFQAL-VWugledA.js → diagram-5GNKFQAL-DdXhz5jN.js} +1 -1
  26. package/dist-web/assets/{diagram-KO2AKTUF-BqrJi52N.js → diagram-KO2AKTUF-CbAHWTiw.js} +1 -1
  27. package/dist-web/assets/{diagram-LMA3HP47-BRwG6VJ2.js → diagram-LMA3HP47-DhASU77a.js} +1 -1
  28. package/dist-web/assets/{diagram-OG6HWLK6-B4h3lC_6.js → diagram-OG6HWLK6-vyegCtBh.js} +1 -1
  29. package/dist-web/assets/{erDiagram-TEJ5UH35-CoynqafK.js → erDiagram-TEJ5UH35-u41T2VU1.js} +1 -1
  30. package/dist-web/assets/{flowDiagram-I6XJVG4X-mSrbhP6V.js → flowDiagram-I6XJVG4X-BlZR3M4a.js} +1 -1
  31. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DB1PpBk0.js → ganttDiagram-6RSMTGT7-CBIULxGb.js} +1 -1
  32. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DAFYaHhJ.js → gitGraphDiagram-PVQCEYII-C6SGJJUo.js} +1 -1
  33. package/dist-web/assets/{index-DlpeCxLp.js → index-BNJo44oI.js} +1 -1
  34. package/dist-web/assets/index-CK7yaL8y.js +279 -0
  35. package/dist-web/assets/index-D0u_059j.css +1 -0
  36. package/dist-web/assets/{index-C8mys0NG.js → index-D3WSVtYV.js} +2 -2
  37. package/dist-web/assets/{index10-DRCxutuy.js → index10-CizaPNSY.js} +1 -1
  38. package/dist-web/assets/{index11-tnZiF2AO.js → index11-C3vBSelg.js} +1 -1
  39. package/dist-web/assets/{index5-D2oq_xzS.js → index5-DCmdgd-c.js} +1 -1
  40. package/dist-web/assets/{index6-1drcChs1.js → index6-DeBB3wcO.js} +1 -1
  41. package/dist-web/assets/{index7-aHTOwsn3.js → index7-D0RS__NS.js} +1 -1
  42. package/dist-web/assets/{index8-Dirigide.js → index8-ByeMRBS0.js} +2 -2
  43. package/dist-web/assets/{infoDiagram-5YYISTIA-Baaxoh0q.js → infoDiagram-5YYISTIA-BEQeL8qo.js} +1 -1
  44. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-B8gKWcN0.js → ishikawaDiagram-YF4QCWOH-BGEkrGOU.js} +1 -1
  45. package/dist-web/assets/{journeyDiagram-JHISSGLW-BFLRc4vu.js → journeyDiagram-JHISSGLW-DAEyZppi.js} +1 -1
  46. package/dist-web/assets/{kanban-definition-UN3LZRKU-DMx7OMEF.js → kanban-definition-UN3LZRKU-6nYYByea.js} +1 -1
  47. package/dist-web/assets/{linear-BEozvq1i.js → linear-RPDuZEc_.js} +1 -1
  48. package/dist-web/assets/{mermaid.core-WmeW05Ym.js → mermaid.core-CmwZMEVS.js} +5 -5
  49. package/dist-web/assets/{mindmap-definition-RKZ34NQL-4lvrad5M.js → mindmap-definition-RKZ34NQL-MLtqKWd1.js} +1 -1
  50. package/dist-web/assets/{pieDiagram-4H26LBE5-CMLLNBXh.js → pieDiagram-4H26LBE5-Bfifo7At.js} +2 -2
  51. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CqO6IFQw.js → quadrantDiagram-W4KKPZXB-DZRwxAP7.js} +1 -1
  52. package/dist-web/assets/{requirementDiagram-4Y6WPE33-BSLBSfd0.js → requirementDiagram-4Y6WPE33-lazNkbiM.js} +1 -1
  53. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-Wkno3RO7.js → sankeyDiagram-5OEKKPKP-D4yxPAzq.js} +1 -1
  54. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BGHwV3az.js → sequenceDiagram-3UESZ5HK-D7Cjzr6g.js} +1 -1
  55. package/dist-web/assets/stateDiagram-AJRCARHV-0z8M0BXQ.js +1 -0
  56. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-lF1PY-XM.js +1 -0
  57. package/dist-web/assets/{timeline-definition-PNZ67QCA-CUeXNWjD.js → timeline-definition-PNZ67QCA-Cfxia7fX.js} +1 -1
  58. package/dist-web/assets/{vennDiagram-CIIHVFJN-xk-ZH7as.js → vennDiagram-CIIHVFJN-CBtQvJlD.js} +1 -1
  59. package/dist-web/assets/{vue.runtime.esm-bundler-Cka7aKLe.js → vue.runtime.esm-bundler-BJW6XsQa.js} +1 -1
  60. package/dist-web/assets/{wardley-L42UT6IY-DgiOtIwh.js → wardley-L42UT6IY-lhlQsxcl.js} +1 -1
  61. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-BAVBFC-Y.js → wardleyDiagram-YWT4CUSO-CNRYkXLH.js} +1 -1
  62. package/dist-web/assets/{xychartDiagram-2RQKCTM6-C3IYtAxp.js → xychartDiagram-2RQKCTM6-mUzDW-MM.js} +1 -1
  63. package/dist-web/index.html +2 -2
  64. package/package.json +5 -5
  65. package/dist-web/assets/arc-DrGcGe6d.js +0 -1
  66. package/dist-web/assets/channel-BbUnBXY4.js +0 -1
  67. package/dist-web/assets/classDiagram-4FO5ZUOK-C-JqfdmA.js +0 -1
  68. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-C-JqfdmA.js +0 -1
  69. package/dist-web/assets/index-BQvC0kGr.css +0 -1
  70. package/dist-web/assets/index-DZSqyBof.js +0 -279
  71. package/dist-web/assets/stateDiagram-AJRCARHV-CCyVLSRK.js +0 -1
  72. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BiqQXX0_.js +0 -1
  73. package/dist-web/design-system.html +0 -2360
@@ -1,279 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-BeQAAdW3.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-D-VEP4Fn.js","assets/index8-Dirigide.js","assets/index11-tnZiF2AO.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 zp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ut={},Da=[],Go=()=>{},rC=()=>!1,Yu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Up=e=>e.startsWith("onUpdate:"),gn=Object.assign,P1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},dE=Object.prototype.hasOwnProperty,on=(e,t)=>dE.call(e,t),kt=Array.isArray,Ba=e=>cc(e)==="[object Map]",Gl=e=>cc(e)==="[object Set]",Vk=e=>cc(e)==="[object Date]",fE=e=>cc(e)==="[object RegExp]",Mt=e=>typeof e=="function",kn=e=>typeof e=="string",Io=e=>typeof e=="symbol",rn=e=>e!==null&&typeof e=="object",R1=e=>(rn(e)||Mt(e))&&Mt(e.then)&&Mt(e.catch),lC=Object.prototype.toString,cc=e=>lC.call(e),pE=e=>cc(e).slice(8,-1),qp=e=>cc(e)==="[object Object]",jp=e=>kn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Rl=zp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hE=/-\w/g,hs=Vp(e=>e.replace(hE,t=>t.slice(1).toUpperCase())),mE=/\B([A-Z])/g,ro=Vp(e=>e.replace(mE,"-$1").toLowerCase()),Kp=Vp(e=>e.charAt(0).toUpperCase()+e.slice(1)),yf=Vp(e=>e?`on${Kp(e)}`:""),Ms=(e,t)=>!Object.is(e,t),Fa=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},aC=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Gp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Bf=e=>{const t=kn(e)?Number(e):NaN;return isNaN(t)?e:t};let Kk;const Yp=()=>Kk||(Kk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),gE="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",vE=zp(gE);function Yt(e){if(kt(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=kn(s)?_E(s):Yt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(kn(e)||rn(e))return e}const yE=/;(?![^(]*\))/g,kE=/:([^]+)/,bE=/\/\*[^]*?\*\//g;function _E(e){const t={};return e.replace(bE,"").split(yE).forEach(n=>{if(n){const s=n.split(kE);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function De(e){let t="";if(kn(e))t=e;else if(kt(e))for(let n=0;n<e.length;n++){const s=De(e[n]);s&&(t+=s+" ")}else if(rn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Hfe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!kn(t)&&(e.class=De(t)),n&&(e.style=Yt(n)),e}const wE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",SE=zp(wE);function cC(e){return!!e||e===""}function CE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ji(e[s],t[s]);return n}function Ji(e,t){if(e===t)return!0;let n=Vk(e),s=Vk(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Io(e),s=Io(t),n||s)return e===t;if(n=kt(e),s=kt(t),n||s)return n&&s?CE(e,t):!1;if(n=rn(e),s=rn(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Ji(e[r],t[r]))return!1}}return String(e)===String(t)}function Xp(e,t){return e.findIndex(n=>Ji(n,t))}const uC=e=>!!(e&&e.__v_isRef===!0),R=e=>kn(e)?e:e==null?"":kt(e)||rn(e)&&(e.toString===lC||!Mt(e.toString))?uC(e)?R(e.value):JSON.stringify(e,dC,2):String(e),dC=(e,t)=>uC(t)?dC(e,t.value):Ba(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[Bm(s,i)+" =>"]=o,n),{})}:Gl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Bm(n))}:Io(t)?Bm(t):rn(t)&&!kt(t)&&!qp(t)?String(t):t,Bm=(e,t="")=>{var n;return Io(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function xE(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 ps;class fC{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ps&&(ps.active?(this.parent=ps,this.index=(ps.scopes||(ps.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=ps;try{return ps=this,t()}finally{ps=n}}}on(){++this._on===1&&(this.prevScope=ps,ps=this)}off(){if(this._on>0&&--this._on===0){if(ps===this)ps=this.prevScope;else{let t=ps;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 AE(e){return new fC(e)}function D1(){return ps}function B1(e,t=!1){ps&&ps.cleanups.push(e)}let En;const Fm=new WeakSet;class Ff{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,ps&&(ps.active?ps.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fm.has(this)&&(Fm.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||hC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Gk(this),mC(this);const t=En,n=ci;En=this,ci=!0;try{return this.fn()}finally{gC(this),En=t,ci=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)W1(t);this.deps=this.depsTail=void 0,Gk(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fm.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){dv(this)&&this.run()}get dirty(){return dv(this)}}let pC=0,nu,su;function hC(e,t=!1){if(e.flags|=8,t){e.next=su,su=e;return}e.next=nu,nu=e}function F1(){pC++}function H1(){if(--pC>0)return;if(su){let t=su;for(su=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;nu;){let t=nu;for(nu=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 mC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function gC(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),W1(s),TE(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function dv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(vC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function vC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===_u)||(e.globalVersion=_u,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!dv(e))))return;e.flags|=2;const t=e.dep,n=En,s=ci;En=e,ci=!0;try{mC(e);const o=e.fn(e._value);(t.version===0||Ms(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{En=n,ci=s,gC(e),e.flags&=-3}}function W1(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)W1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function TE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Wfe(e,t){e.effect instanceof Ff&&(e=e.effect.fn);const n=new Ff(e);t&&gn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function zfe(e){e.effect.stop()}let ci=!0;const yC=[];function er(){yC.push(ci),ci=!1}function tr(){const e=yC.pop();ci=e===void 0?!0:e}function Gk(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=En;En=void 0;try{t()}finally{En=n}}}let _u=0;class ME{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qp{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(!En||!ci||En===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==En)n=this.activeLink=new ME(En,this),En.deps?(n.prevDep=En.depsTail,En.depsTail.nextDep=n,En.depsTail=n):En.deps=En.depsTail=n,kC(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=En.depsTail,n.nextDep=void 0,En.depsTail.nextDep=n,En.depsTail=n,En.deps===n&&(En.deps=s)}return n}trigger(t){this.version++,_u++,this.notify(t)}notify(t){F1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{H1()}}}function kC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)kC(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hf=new WeakMap,Dl=Symbol(""),fv=Symbol(""),wu=Symbol("");function Ds(e,t,n){if(ci&&En){let s=Hf.get(e);s||Hf.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Qp),o.map=s,o.key=n),o.track()}}function ji(e,t,n,s,o,i){const r=Hf.get(e);if(!r){_u++;return}const l=a=>{a&&a.trigger()};if(F1(),t==="clear")r.forEach(l);else{const a=kt(e),c=a&&jp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===wu||!Io(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(wu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Dl)),Ba(e)&&l(r.get(fv)));break;case"delete":a||(l(r.get(Dl)),Ba(e)&&l(r.get(fv)));break;case"set":Ba(e)&&l(r.get(Dl));break}}H1()}function EE(e,t){const n=Hf.get(e);return n&&n.get(t)}function ma(e){const t=Gt(e);return t===e?t:(Ds(t,"iterate",wu),Co(e)?t:t.map(di))}function Zp(e){return Ds(e=Gt(e),"iterate",wu),e}function Ti(e,t){return nr(e)?Ja(Hr(e)?di(t):t):di(t)}const IE={__proto__:null,[Symbol.iterator](){return Hm(this,Symbol.iterator,e=>Ti(this,e))},concat(...e){return ma(this).concat(...e.map(t=>kt(t)?ma(t):t))},entries(){return Hm(this,"entries",e=>(e[1]=Ti(this,e[1]),e))},every(e,t){return Bi(this,"every",e,t,void 0,arguments)},filter(e,t){return Bi(this,"filter",e,t,n=>n.map(s=>Ti(this,s)),arguments)},find(e,t){return Bi(this,"find",e,t,n=>Ti(this,n),arguments)},findIndex(e,t){return Bi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Bi(this,"findLast",e,t,n=>Ti(this,n),arguments)},findLastIndex(e,t){return Bi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Bi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Wm(this,"includes",e)},indexOf(...e){return Wm(this,"indexOf",e)},join(e){return ma(this).join(e)},lastIndexOf(...e){return Wm(this,"lastIndexOf",e)},map(e,t){return Bi(this,"map",e,t,void 0,arguments)},pop(){return Dc(this,"pop")},push(...e){return Dc(this,"push",e)},reduce(e,...t){return Yk(this,"reduce",e,t)},reduceRight(e,...t){return Yk(this,"reduceRight",e,t)},shift(){return Dc(this,"shift")},some(e,t){return Bi(this,"some",e,t,void 0,arguments)},splice(...e){return Dc(this,"splice",e)},toReversed(){return ma(this).toReversed()},toSorted(e){return ma(this).toSorted(e)},toSpliced(...e){return ma(this).toSpliced(...e)},unshift(...e){return Dc(this,"unshift",e)},values(){return Hm(this,"values",e=>Ti(this,e))}};function Hm(e,t,n){const s=Zp(e),o=s[t]();return s!==e&&!Co(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const $E=Array.prototype;function Bi(e,t,n,s,o,i){const r=Zp(e),l=r!==e&&!Co(e),a=r[t];if(a!==$E[t]){const d=a.apply(e,i);return l?di(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Ti(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 Yk(e,t,n,s){const o=Zp(e),i=o!==e&&!Co(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Ti(e,c)),n.call(this,c,Ti(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?Ti(e,a):a}function Wm(e,t,n){const s=Gt(e);Ds(s,"iterate",wu);const o=s[t](...n);return(o===-1||o===!1)&&th(n[0])?(n[0]=Gt(n[0]),s[t](...n)):o}function Dc(e,t,n=[]){er(),F1();const s=Gt(e)[t].apply(e,n);return H1(),tr(),s}const NE=zp("__proto__,__v_isRef,__isVue"),bC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Io));function LE(e){Io(e)||(e=String(e));const t=Gt(this);return Ds(t,"has",e),t.hasOwnProperty(e)}class _C{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?TC:AC:i?xC:CC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=kt(t);if(!o){let a;if(r&&(a=IE[n]))return a;if(n==="hasOwnProperty")return LE}const l=Reflect.get(t,n,Jn(t)?t:s);if((Io(n)?bC.has(n):NE(n))||(o||Ds(t,"get",n),i))return l;if(Jn(l)){const a=r&&jp(n)?l:l.value;return o&&rn(a)?Wf(a):a}return rn(l)?o?Wf(l):$s(l):l}}class wC extends _C{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=kt(t)&&jp(n);if(!this._isShallow){const c=nr(i);if(!Co(s)&&!nr(s)&&(i=Gt(i),s=Gt(s)),!r&&Jn(i)&&!Jn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:on(t,n),a=Reflect.set(t,n,s,Jn(t)?t:o);return t===Gt(o)&&(l?Ms(s,i)&&ji(t,"set",n,s):ji(t,"add",n,s)),a}deleteProperty(t,n){const s=on(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&ji(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Io(n)||!bC.has(n))&&Ds(t,"has",n),s}ownKeys(t){return Ds(t,"iterate",kt(t)?"length":Dl),Reflect.ownKeys(t)}}class SC extends _C{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const OE=new wC,PE=new SC,RE=new wC(!0),DE=new SC(!0),pv=e=>e,Rd=e=>Reflect.getPrototypeOf(e);function BE(e,t,n){return function(...s){const o=this.__v_raw,i=Gt(o),r=Ba(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?pv:t?Ja:di;return!t&&Ds(i,"iterate",a?fv:Dl),gn(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 Dd(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function FE(e,t){const n={get(o){const i=this.__v_raw,r=Gt(i),l=Gt(o);e||(Ms(o,l)&&Ds(r,"get",o),Ds(r,"get",l));const{has:a}=Rd(r),c=t?pv:e?Ja:di;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&&Ds(Gt(o),"iterate",Dl),o.size},has(o){const i=this.__v_raw,r=Gt(i),l=Gt(o);return e||(Ms(o,l)&&Ds(r,"has",o),Ds(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=Gt(l),c=t?pv:e?Ja:di;return!e&&Ds(a,"iterate",Dl),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return gn(n,e?{add:Dd("add"),set:Dd("set"),delete:Dd("delete"),clear:Dd("clear")}:{add(o){const i=Gt(this),r=Rd(i),l=Gt(o),a=!t&&!Co(o)&&!nr(o)?l:o;return r.has.call(i,a)||Ms(o,a)&&r.has.call(i,o)||Ms(l,a)&&r.has.call(i,l)||(i.add(a),ji(i,"add",a,a)),this},set(o,i){!t&&!Co(i)&&!nr(i)&&(i=Gt(i));const r=Gt(this),{has:l,get:a}=Rd(r);let c=l.call(r,o);c||(o=Gt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Ms(i,u)&&ji(r,"set",o,i):ji(r,"add",o,i),this},delete(o){const i=Gt(this),{has:r,get:l}=Rd(i);let a=r.call(i,o);a||(o=Gt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&ji(i,"delete",o,void 0),c},clear(){const o=Gt(this),i=o.size!==0,r=o.clear();return i&&ji(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=BE(o,e,t)}),n}function Jp(e,t){const n=FE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(on(n,o)&&o in s?n:s,o,i)}const HE={get:Jp(!1,!1)},WE={get:Jp(!1,!0)},zE={get:Jp(!0,!1)},UE={get:Jp(!0,!0)},CC=new WeakMap,xC=new WeakMap,AC=new WeakMap,TC=new WeakMap;function qE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function $s(e){return nr(e)?e:eh(e,!1,OE,HE,CC)}function jE(e){return eh(e,!1,RE,WE,xC)}function Wf(e){return eh(e,!0,PE,zE,AC)}function Ufe(e){return eh(e,!0,DE,UE,TC)}function eh(e,t,n,s,o){if(!rn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=qE(pE(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function Hr(e){return nr(e)?Hr(e.__v_raw):!!(e&&e.__v_isReactive)}function nr(e){return!!(e&&e.__v_isReadonly)}function Co(e){return!!(e&&e.__v_isShallow)}function th(e){return e?!!e.__v_raw:!1}function Gt(e){const t=e&&e.__v_raw;return t?Gt(t):e}function Rr(e){return!on(e,"__v_skip")&&Object.isExtensible(e)&&aC(e,"__v_skip",!0),e}const di=e=>rn(e)?$s(e):e,Ja=e=>rn(e)?Wf(e):e;function Jn(e){return e?e.__v_isRef===!0:!1}function Z(e){return MC(e,!1)}function Yl(e){return MC(e,!0)}function MC(e,t){return Jn(e)?e:new VE(e,t)}class VE{constructor(t,n){this.dep=new Qp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Gt(t),this._value=n?t:di(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Co(t)||nr(t);t=s?t:Gt(t),Ms(t,n)&&(this._rawValue=t,this._value=s?t:di(t),this.dep.trigger())}}function qfe(e){e.dep&&e.dep.trigger()}function A(e){return Jn(e)?e.value:e}function EC(e){return Mt(e)?e():A(e)}const KE={get:(e,t,n)=>t==="__v_raw"?e:A(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Jn(o)&&!Jn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function IC(e){return Hr(e)?e:new Proxy(e,KE)}class GE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Qp,{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 YE(e){return new GE(e)}function jfe(e){const t=kt(e)?new Array(e.length):{};for(const n in e)t[n]=$C(e,n);return t}class XE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Io(n)?n:String(n),this._raw=Gt(t);let o=!0,i=t;if(!kt(t)||Io(this._key)||!jp(this._key))do o=!th(i)||Co(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=A(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Jn(this._raw[this._key])){const n=this._object[this._key];if(Jn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return EE(this._raw,this._key)}}class QE{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 Vfe(e,t,n){return Jn(e)?e:Mt(e)?new QE(e):rn(e)&&arguments.length>1?$C(e,t,n):Z(e)}function $C(e,t,n){return new XE(e,t,n)}class ZE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_u-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&En!==this)return hC(this,!0),!0}get value(){const t=this.dep.track();return vC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function JE(e,t,n=!1){let s,o;return Mt(e)?s=e:(s=e.get,o=e.set),new ZE(s,o,n)}const Kfe={GET:"get",HAS:"has",ITERATE:"iterate"},Gfe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Bd={},zf=new WeakMap;let Mr;function Yfe(){return Mr}function eI(e,t=!1,n=Mr){if(n){let s=zf.get(n);s||zf.set(n,s=[]),s.push(e)}}function tI(e,t,n=Ut){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Co(y)||o===!1||o===0?Vi(y,1):Vi(y);let u,d,f,h,p=!1,m=!1;if(Jn(e)?(d=()=>e.value,p=Co(e)):Hr(e)?(d=()=>c(e),p=!0):kt(e)?(m=!0,p=e.some(y=>Hr(y)||Co(y)),d=()=>e.map(y=>{if(Jn(y))return y.value;if(Hr(y))return c(y);if(Mt(y))return a?a(y,2):y()})):Mt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){er();try{f()}finally{tr()}}const y=Mr;Mr=u;try{return a?a(e,3,[h]):e(h)}finally{Mr=y}}:d=Go,t&&o){const y=d,C=o===!0?1/0:o;d=()=>Vi(y(),C)}const b=D1(),_=()=>{u.stop(),b&&b.active&&P1(b.effects,u)};if(i&&t){const y=t;t=(...C)=>{y(...C),_()}}let g=m?new Array(e.length).fill(Bd):Bd;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const C=u.run();if(o||p||(m?C.some((L,$)=>Ms(L,g[$])):Ms(C,g))){f&&f();const L=Mr;Mr=u;try{const $=[C,g===Bd?void 0:m&&g[0]===Bd?[]:g,h];g=C,a?a(t,3,$):t(...$)}finally{Mr=L}}}else u.run()};return l&&l(v),u=new Ff(d),u.scheduler=r?()=>r(v,!1):v,h=y=>eI(y,!1,u),f=u.onStop=()=>{const y=zf.get(u);if(y){if(a)a(y,4);else for(const C of y)C();zf.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Vi(e,t=1/0,n){if(t<=0||!rn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Jn(e))Vi(e.value,t,n);else if(kt(e))for(let s=0;s<e.length;s++)Vi(e[s],t,n);else if(Gl(e)||Ba(e))e.forEach(s=>{Vi(s,t,n)});else if(qp(e)){for(const s in e)Vi(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Vi(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 NC=[];function nI(e){NC.push(e)}function sI(){NC.pop()}function Xfe(e,t){}const Qfe={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"},oI={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 Xu(e,t,n,s){try{return s?e(...s):e()}catch(o){uc(o,t,n)}}function Qo(e,t,n,s){if(Mt(e)){const o=Xu(e,t,n,s);return o&&R1(o)&&o.catch(i=>{uc(i,t,n)}),o}if(kt(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Qo(e[i],t,n,s));return o}}function uc(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Ut;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){er(),Xu(i,null,10,[e,a,c]),tr();return}}iI(e,n,o,s,r)}function iI(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Vs=[];let Si=-1;const Ha=[];let Er=null,Sa=0;const LC=Promise.resolve();let Uf=null;function gt(e){const t=Uf||LC;return e?t.then(this?e.bind(this):e):t}function rI(e){let t=Si+1,n=Vs.length;for(;t<n;){const s=t+n>>>1,o=Vs[s],i=Su(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function z1(e){if(!(e.flags&1)){const t=Su(e),n=Vs[Vs.length-1];!n||!(e.flags&2)&&t>=Su(n)?Vs.push(e):Vs.splice(rI(t),0,e),e.flags|=1,OC()}}function OC(){Uf||(Uf=LC.then(PC))}function qf(e){kt(e)?Ha.push(...e):Er&&e.id===-1?Er.splice(Sa+1,0,e):e.flags&1||(Ha.push(e),e.flags|=1),OC()}function Xk(e,t,n=Si+1){for(;n<Vs.length;n++){const s=Vs[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Vs.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function jf(e){if(Ha.length){const t=[...new Set(Ha)].sort((n,s)=>Su(n)-Su(s));if(Ha.length=0,Er){Er.push(...t);return}for(Er=t,Sa=0;Sa<Er.length;Sa++){const n=Er[Sa];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Er=null,Sa=0}}const Su=e=>e.id==null?e.flags&2?-1:1/0:e.id;function PC(e){try{for(Si=0;Si<Vs.length;Si++){const t=Vs[Si];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Xu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Si<Vs.length;Si++){const t=Vs[Si];t&&(t.flags&=-2)}Si=-1,Vs.length=0,jf(),Uf=null,(Vs.length||Ha.length)&&PC()}}let Ca,Fd=[];function RC(e,t){var n,s;Ca=e,Ca?(Ca.enabled=!0,Fd.forEach(({event:o,args:i})=>Ca.emit(o,...i)),Fd=[]):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=>{RC(i,t)}),setTimeout(()=>{Ca||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Fd=[])},3e3)):Fd=[]}let Ns=null,nh=null;function Cu(e){const t=Ns;return Ns=e,nh=e&&e.type.__scopeId||null,t}function Zfe(e){nh=e}function Jfe(){nh=null}const epe=e=>ke;function ke(e,t=Ns,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Xf(-1);const i=Cu(t);let r;try{r=e(...o)}finally{Cu(i),s._d&&Xf(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function In(e,t){if(Ns===null)return e;const n=ed(Ns),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Ut]=t[o];i&&(Mt(i)&&(i={mounted:i,updated:i}),i.deep&&Vi(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function xi(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&&(er(),Qo(a,n,8,[e.el,l,e,t]),tr())}}function On(e,t){if(Es){let n=Es.provides;const s=Es.parent&&Es.parent.provides;s===n&&(n=Es.provides=Object.create(s)),n[e]=t}}function qt(e,t,n=!1){const s=Ls();if(s||Bl){let o=Bl?Bl._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&&Mt(t)?t.call(s&&s.proxy):t}}function tpe(){return!!(Ls()||Bl)}const lI=Symbol.for("v-scx"),aI=()=>qt(lI);function cI(e,t){return Qu(e,null,t)}function npe(e,t){return Qu(e,null,{flush:"post"})}function uI(e,t){return Qu(e,null,{flush:"sync"})}function Ye(e,t,n){return Qu(e,t,n)}function Qu(e,t,n=Ut){const{immediate:s,deep:o,flush:i,once:r}=n,l=gn({},n),a=t&&s||!t&&i!=="post";let c;if(ql){if(i==="sync"){const h=aI();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Go,h.resume=Go,h.pause=Go,h}}const u=Es;l.call=(h,p,m)=>Qo(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{ss(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():z1(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=tI(e,t,l);return ql&&(c?c.push(f):a&&f()),f}function dI(e,t,n){const s=this.proxy,o=kn(e)?e.includes(".")?DC(s,e):()=>s[e]:e.bind(s,s);let i;Mt(t)?i=t:(i=t.handler,n=t);const r=dc(this),l=Qu(o,i.bind(s),n);return r(),l}function DC(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 Ar=new WeakMap,BC=Symbol("_vte"),FC=e=>e.__isTeleport,Ml=e=>e&&(e.disabled||e.disabled===""),fI=e=>e&&(e.defer||e.defer===""),Qk=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Zk=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,hv=(e,t)=>{const n=e&&e.to;return kn(n)?t?t(n):null:n},pI={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:b,parentNode:_}}=c,g=Ml(t.props);let{dynamicChildren:v}=t;const y=($,k,M)=>{$.shapeFlag&16&&u($.children,k,M,o,i,r,l,a)},C=($=t)=>{const k=Ml($.props),M=$.target=hv($.props,p),E=mv(M,$,m,h);M&&(r!=="svg"&&Qk(M)?r="svg":r!=="mathml"&&Zk(M)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(M),k||(y($,M,E),Vc($,!1)))},L=$=>{const k=()=>{if(Ar.get($)===k){if(Ar.delete($),Ml($.props)){const M=_($.el)||n;y($,M,$.anchor),Vc($,!0)}C($)}};Ar.set($,k),ss(k,i)};if(e==null){const $=t.el=m(""),k=t.anchor=m("");if(h($,n,s),h(k,n,s),fI(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,k),Vc(t,!0)),C()}else{t.el=e.el;const $=t.anchor=e.anchor,k=Ar.get(e);if(k){k.flags|=8,Ar.delete(e),L(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,E=t.targetAnchor=e.targetAnchor,O=Ml(e.props),S=O?n:M,I=O?$:E;if(r==="svg"||Qk(M)?r="svg":(r==="mathml"||Zk(M))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),J1(e,t,!0)):a||d(e,t,S,I,o,i,r,l,!1),g)O?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Hd(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=hv(t.props,p);P&&Hd(t,P,null,c,0)}else O&&Hd(t,M,E,c,1);Vc(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||!Ml(f),p=Ar.get(e);if(p&&(p.flags|=8,Ar.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const b=l[m];s(b,t,n,h,!!b.dynamicChildren)}},move:Hd,hydrate:hI};function Hd(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),!Ar.has(e)&&(!d||Ml(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function hI(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,_){let g=_;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,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(b,_){_.anchor=d(r(b),_,l(b),n,s,o,i)}const p=t.target=hv(t.props,a),m=Ml(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,b),t.targetAnchor||mv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||mv(p,t,u,c),d(b&&r(b),t,p,n,s,o,i))),Vc(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const sh=pI;function Vc(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 mv(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[BC]=r,e&&(s(i,e,o),s(r,e,o)),r}const zo=Symbol("_leaveCb"),Bc=Symbol("_enterCb");function HC(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return bn(()=>{e.isMounted=!0}),ms(()=>{e.isUnmounting=!0}),e}const Do=[Function,Array],WC={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Do,onEnter:Do,onAfterEnter:Do,onEnterCancelled:Do,onBeforeLeave:Do,onLeave:Do,onAfterLeave:Do,onLeaveCancelled:Do,onBeforeAppear:Do,onAppear:Do,onAfterAppear:Do,onAppearCancelled:Do},zC=e=>{const t=e.subTree;return t.component?zC(t.component):t},mI={name:"BaseTransition",props:WC,setup(e,{slots:t}){const n=Ls(),s=HC();return()=>{const o=t.default&&U1(t.default(),!0),i=o&&o.length?UC(o):n.subTree?ie():void 0;if(!i)return;const r=Gt(e),{mode:l}=r;if(s.isLeaving)return zm(i);const a=Jk(i);if(!a)return zm(i);let c=xu(a,r,s,n,d=>c=d);a.type!==is&&jr(a,c);let u=n.subTree&&Jk(n.subTree);if(u&&u.type!==is&&!ri(u,a)&&zC(n).type!==is){let d=xu(u,r,s,n);if(jr(u,d),l==="out-in"&&a.type!==is)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},zm(i);l==="in-out"&&a.type!==is?d.delayLeave=(f,h,p)=>{const m=qC(s,u);m[String(u.key)]=u,f[zo]=()=>{h(),f[zo]=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 UC(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==is){t=n;break}}return t}const gI=mI;function qC(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 xu(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:b,onAppear:_,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),C=qC(n,e),L=(M,E)=>{M&&Qo(M,s,9,E)},$=(M,E)=>{const O=E[1];L(M,E),kt(M)?M.every(S=>S.length<=1)&&O():M.length<=1&&O()},k={mode:r,persisted:l,beforeEnter(M){let E=a;if(!n.isMounted)if(i)E=b||a;else return;M[zo]&&M[zo](!0);const O=C[y];O&&ri(e,O)&&O.el[zo]&&O.el[zo](),L(E,[M])},enter(M){if(C[y]===e)return;let E=c,O=u,S=d;if(!n.isMounted)if(i)E=_||c,O=g||u,S=v||d;else return;let I=!1;M[Bc]=D=>{I||(I=!0,D?L(S,[M]):L(O,[M]),k.delayedLeave&&k.delayedLeave(),M[Bc]=void 0)};const P=M[Bc].bind(null,!1);E?$(E,[M,P]):P()},leave(M,E){const O=String(e.key);if(M[Bc]&&M[Bc](!0),n.isUnmounting)return E();L(f,[M]);let S=!1;M[zo]=P=>{S||(S=!0,E(),P?L(m,[M]):L(p,[M]),M[zo]=void 0,C[O]===e&&delete C[O])};const I=M[zo].bind(null,!1);C[O]=e,h?$(h,[M,I]):I()},clone(M){const E=xu(M,t,n,s,o);return o&&o(E),E}};return k}function zm(e){if(Zu(e))return e=sr(e),e.children=null,e}function Jk(e){if(!Zu(e))return FC(e.type)&&e.children?UC(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&&Mt(n.default))return n.default()}}function jr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,jr(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 U1(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(U1(r.children,t,l))):(t||r.type!==is)&&s.push(l!=null?sr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ve(e,t){return Mt(e)?gn({name:e.name},t,{setup:e}):e}function spe(){const e=Ls();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function q1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ope(e){const t=Ls(),n=Yl(null);if(t){const o=t.refs===Ut?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function eb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vf=new WeakMap;function Wa(e,t,n,s,o=!1){if(kt(e)){e.forEach((m,b)=>Wa(m,t&&(kt(t)?t[b]:t),n,s,o));return}if(Qi(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Wa(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?ed(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Ut?l.refs={}:l.refs,d=l.setupState,f=Gt(d),h=d===Ut?rC:m=>eb(u,m)?!1:on(f,m),p=(m,b)=>!(b&&eb(u,b));if(c!=null&&c!==a){if(tb(t),kn(c))u[c]=null,h(c)&&(d[c]=null);else if(Jn(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Mt(a))Xu(a,l,12,[r,u]);else{const m=kn(a),b=Jn(a);if(m||b){const _=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)kt(g)&&P1(g,i);else if(kt(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)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{_(),Vf.delete(e)};g.id=-1,Vf.set(e,g),ss(g,n)}else tb(e),_()}}}function tb(e){const t=Vf.get(e);t&&(t.flags|=8,Vf.delete(e))}let nb=!1;const ga=()=>{nb||(console.error("Hydration completed but contains mismatches."),nb=!0)},vI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",yI=e=>e.namespaceURI.includes("MathML"),Wd=e=>{if(e.nodeType===1){if(vI(e))return"svg";if(yI(e))return"mathml"}},Ia=e=>e.nodeType===8;function kI(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),jf(),y._vnode=v;return}d(y.firstChild,v,null,null,null),jf(),y._vnode=v},d=(v,y,C,L,$,k=!1)=>{k=k||!!y.dynamicChildren;const M=Ia(v)&&v.data==="[",E=()=>m(v,y,C,L,$,M),{type:O,ref:S,shapeFlag:I,patchFlag:P}=y;let D=v.nodeType;y.el=v,P===-2&&(k=!1,y.dynamicChildren=null);let H=null;switch(O){case Wr:D!==3?y.children===""?(a(y.el=o(""),r(v),v),H=v):H=E():(v.data!==y.children&&(ga(),v.data=y.children),H=i(v));break;case is:g(v)?(H=i(v),_(y.el=v.content.firstChild,v,C)):D!==8||M?H=E():H=i(v);break;case Ua:if(M&&(v=i(v),D=v.nodeType),D===1||D===3){H=v;const z=!y.children.length;for(let U=0;U<y.staticCount;U++)z&&(y.children+=H.nodeType===1?H.outerHTML:H.data),U===y.staticCount-1&&(y.anchor=H),H=i(H);return M?i(H):H}else E();break;case Oe:M?H=p(v,y,C,L,$,k):H=E();break;default:if(I&1)(D!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?H=E():H=f(v,y,C,L,$,k);else if(I&6){y.slotScopeIds=$;const z=r(v);if(M?H=b(v):Ia(v)&&v.data==="teleport start"?H=b(v,v.data,"teleport end"):H=i(v),t(y,z,null,C,L,Wd(z),k),Qi(y)&&!y.type.__asyncResolved){let U;M?(U=oe(Oe),U.anchor=H?H.previousSibling:z.lastChild):U=v.nodeType===3?je(""):oe("div"),U.el=v,y.component.subTree=U}}else I&64?D!==8?H=E():H=y.type.hydrate(v,y,C,L,$,k,e,h):I&128&&(H=y.type.hydrate(v,y,C,L,Wd(r(v)),$,k,e,d))}return S!=null&&Wa(S,null,L,y),H},f=(v,y,C,L,$,k)=>{k=k||!!y.dynamicChildren;const{type:M,props:E,patchFlag:O,shapeFlag:S,dirs:I,transition:P}=y,D=M==="input"||M==="option";if(D||O!==-1){I&&xi(y,null,C,"created");let H=!1;if(g(v)){H=cx(null,P)&&C&&C.vnode.props&&C.vnode.props.appear;const U=v.content.firstChild;if(H){const Q=U.getAttribute("class");Q&&(U.$cls=Q),P.beforeEnter(U)}_(U,v,C),y.el=v=U}if(S&16&&!(E&&(E.innerHTML||E.textContent))){let U=h(v.firstChild,y,v,C,L,$,k);for(U&&!zd(v,1)&&ga();U;){const Q=U;U=U.nextSibling,l(Q)}}else if(S&8){let U=y.children;U[0]===`
15
- `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:Q}=v;Q!==U&&Q!==U.replace(/\r\n|\r/g,`
16
- `)&&(zd(v,0)||ga(),v.textContent=y.children)}if(E){if(D||!k||O&48){const U=v.tagName.includes("-");for(const Q in E)(D&&(Q.endsWith("value")||Q==="indeterminate")||Yu(Q)&&!Rl(Q)||Q[0]==="."||U&&!Rl(Q))&&s(v,Q,null,E[Q],void 0,C)}else if(E.onClick)s(v,"onClick",null,E.onClick,void 0,C);else if(O&4&&Hr(E.style))for(const U in E.style)E.style[U]}let z;(z=E&&E.onVnodeBeforeMount)&&no(z,C,y),I&&xi(y,null,C,"beforeMount"),((z=E&&E.onVnodeMounted)||I||H)&&px(()=>{z&&no(z,C,y),H&&P.enter(v),I&&xi(y,null,C,"mounted")},L)}return v.nextSibling},h=(v,y,C,L,$,k,M)=>{M=M||!!y.dynamicChildren;const E=y.children,O=E.length;let S=!1;for(let I=0;I<O;I++){const P=M?E[I]:E[I]=io(E[I]),D=P.type===Wr;v?(D&&!M&&I+1<O&&io(E[I+1]).type===Wr&&(a(o(v.data.slice(P.children.length)),C,i(v)),v.data=P.children),v=d(v,P,L,$,k,M)):D&&!P.children?a(P.el=o(""),C):(S||(S=!0,zd(C,1)||ga()),n(null,P,C,null,L,$,Wd(C),k))}return v},p=(v,y,C,L,$,k)=>{const{slotScopeIds:M}=y;M&&($=$?$.concat(M):M);const E=r(v),O=h(i(v),y,E,C,L,$,k);return O&&Ia(O)&&O.data==="]"?i(y.anchor=O):(ga(),a(y.anchor=c("]"),E,O),O)},m=(v,y,C,L,$,k)=>{if(zd(v.parentElement,1)||ga(),y.el=null,k){const O=b(v);for(;;){const S=i(v);if(S&&S!==O)l(S);else break}}const M=i(v),E=r(v);return l(v),n(null,y,E,M,C,L,Wd(E),$),C&&(C.vnode.el=y.el,rh(C,y.el)),M},b=(v,y="[",C="]")=>{let L=0;for(;v;)if(v=i(v),v&&Ia(v)&&(v.data===y&&L++,v.data===C)){if(L===0)return i(v);L--}return v},_=(v,y,C)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=C;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const sb="data-allow-mismatch",bI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function zd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(sb);)e=e.parentElement;const n=e&&e.getAttribute(sb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(bI[t])}}const _I=Yp().requestIdleCallback||(e=>setTimeout(e,1)),wI=Yp().cancelIdleCallback||(e=>clearTimeout(e)),ipe=(e=1e4)=>t=>{const n=_I(t,{timeout:e});return()=>wI(n)};function SI(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 rpe=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(SI(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},lpe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},ape=(e=[])=>(t,n)=>{kn(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 CI(e,t){if(Ia(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Ia(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Qi=e=>!!e.type.__asyncLoader;function Mi(e){Mt(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,()=>b(f()),()=>_(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 Ve({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,b){let _=!1;(m.bu||(m.bu=[])).push(()=>_=!0);const g=()=>{_||b()},v=i?()=>{const y=i(g,C=>CI(p,C));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Es;if(q1(p),u)return()=>Ud(u,p);const m=v=>{c=null,uc(v,p,13,!s)};if(l&&p.suspense||ql)return h().then(v=>()=>Ud(v,p)).catch(v=>(m(v),()=>s?oe(s,{error:v}):null));const b=Z(!1),_=Z(),g=Z(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!b.value&&!_.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),_.value=v}},r),h().then(()=>{b.value=!0,p.parent&&Zu(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),_.value=v}),()=>{if(b.value&&u)return Ud(u,p);if(_.value&&s)return oe(s,{error:_.value});if(n&&!g.value)return Ud(n,p)}}})}function Ud(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=oe(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Zu=e=>e.type.__isKeepAlive,xI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ls(),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,C,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,C,g.slotScopeIds,L),ss(()=>{$.isDeactivated=!1,$.a&&Fa($.a);const k=g.props&&g.props.onVnodeMounted;k&&no(k,$.parent,g)},l)},s.deactivate=g=>{const v=g.component;Gf(v.m),Gf(v.a),c(g,f,null,1,l),ss(()=>{v.da&&Fa(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&no(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){Um(g),u(g,n,l,!0)}function p(g){o.forEach((v,y)=>{const C=Cv(Qi(v)?v.type.__asyncResolved||{}:v.type);C&&!g(C)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!ri(v,r))?h(v):r&&Um(r),o.delete(g),i.delete(g)}Ye(()=>[e.include,e.exclude],([g,v])=>{g&&p(y=>Kc(g,y)),v&&p(y=>!Kc(v,y))},{flush:"post",deep:!0});let b=null;const _=()=>{b!=null&&(Yf(n.subTree.type)?ss(()=>{o.set(b,qd(n.subTree))},n.subTree.suspense):o.set(b,qd(n.subTree)))};return bn(_),j1(_),ms(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,C=qd(v);if(g.type===C.type&&g.key===C.key){Um(C);const L=C.component.da;L&&ss(L,y);return}h(g)})}),()=>{if(b=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Vr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=qd(v);if(y.type===is)return r=null,y;const C=y.type,L=Cv(Qi(y)?y.type.__asyncResolved||{}:C),{include:$,exclude:k,max:M}=e;if($&&(!L||!Kc($,L))||k&&L&&Kc(k,L))return y.shapeFlag&=-257,r=y,v;const E=y.key==null?C:y.key,O=o.get(E);return y.el&&(y=sr(y),v.shapeFlag&128&&(v.ssContent=y)),b=E,O?(y.el=O.el,y.component=O.component,y.transition&&jr(y,y.transition),y.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,Yf(v.type)?v:y}}},cpe=xI;function Kc(e,t){return kt(e)?e.some(n=>Kc(n,t)):kn(e)?e.split(",").includes(t):fE(e)?(e.lastIndex=0,e.test(t)):!1}function AI(e,t){jC(e,"a",t)}function TI(e,t){jC(e,"da",t)}function jC(e,t,n=Es){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(oh(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Zu(o.parent.vnode)&&MI(s,t,n,o),o=o.parent}}function MI(e,t,n,s){const o=oh(t,e,s,!0);_n(()=>{P1(s[t],o)},n)}function Um(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function qd(e){return e.shapeFlag&128?e.ssContent:e}function oh(e,t,n=Es,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{er();const l=dc(n),a=Qo(t,n,e,r);return l(),tr(),a});return s?o.unshift(i):o.push(i),i}}const ir=e=>(t,n=Es)=>{(!ql||e==="sp")&&oh(e,(...s)=>t(...s),n)},EI=ir("bm"),bn=ir("m"),VC=ir("bu"),j1=ir("u"),ms=ir("bum"),_n=ir("um"),II=ir("sp"),$I=ir("rtg"),NI=ir("rtc");function LI(e,t=Es){oh("ec",e,t)}const V1="components",OI="directives";function PI(e,t){return K1(V1,e,!0,t)||e}const KC=Symbol.for("v-ndc");function Bs(e){return kn(e)?K1(V1,e,!1)||e:e||KC}function upe(e){return K1(OI,e)}function K1(e,t,n=!0,s=!1){const o=Ns||Es;if(o){const i=o.type;if(e===V1){const l=Cv(i,!1);if(l&&(l===t||l===hs(t)||l===Kp(hs(t))))return i}const r=ob(o[e]||i[e],t)||ob(o.appContext[e],t);return!r&&s?i:r}}function ob(e,t){return e&&(e[t]||e[hs(t)]||e[Kp(hs(t))])}function ot(e,t,n,s){let o;const i=n&&n[s],r=kt(e);if(r||kn(e)){const l=r&&Hr(e);let a=!1,c=!1;l&&(a=!Co(e),c=nr(e),e=Zp(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?Ja(di(e[u])):di(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(rn(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function G1(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(kt(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 xn(e,t,n={},s,o){if(Ns.ce||Ns.parent&&Qi(Ns.parent)&&Ns.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ge(Oe,null,[oe("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&Y1(i(n)),l=n.key||r&&r.key,a=ge(Oe,{key:(l&&!Io(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 Y1(e){return e.some(t=>Vr(t)?!(t.type===is||t.type===Oe&&!Y1(t.children)):!0)?e:null}function dpe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:yf(s)]=e[s];return n}const gv=e=>e?yx(e)?ed(e):gv(e.parent):null,ou=gn(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=>gv(e.parent),$root:e=>gv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>X1(e),$forceUpdate:e=>e.f||(e.f=()=>{z1(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>dI.bind(e)}),qm=(e,t)=>e!==Ut&&!e.__isScriptSetup&&on(e,t),vv={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!==Ut&&on(o,t))return r[t]=2,o[t];if(on(i,t))return r[t]=3,i[t];if(n!==Ut&&on(n,t))return r[t]=4,n[t];yv&&(r[t]=0)}}const c=ou[t];let u,d;if(c)return t==="$attrs"&&Ds(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Ut&&on(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,on(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return qm(o,t)?(o[t]=n,!0):s!==Ut&&on(s,t)?(s[t]=n,!0):on(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Ut&&l[0]!=="$"&&on(e,l)||qm(t,l)||on(i,l)||on(s,l)||on(ou,l)||on(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:on(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},RI=gn({},vv,{get(e,t){if(t!==Symbol.unscopables)return vv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!vE(t)}});function fpe(){return null}function ppe(){return null}function hpe(e){}function mpe(e){}function gpe(){return null}function vpe(){}function ype(e,t){return null}function kpe(){return GC().slots}function Ju(){return GC().attrs}function GC(e){const t=Ls();return t.setupContext||(t.setupContext=_x(t))}function Au(e){return kt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function bpe(e,t){const n=Au(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?kt(o)||Mt(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 _pe(e,t){return!e||!t?e||t:kt(e)&&kt(t)?e.concat(t):gn({},Au(e),Au(t))}function wpe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Spe(e){const t=Ls(),n=ql;let s=e();Mu(),n&&qa(!1);const o=()=>{dc(t),n&&qa(!0)},i=()=>{Ls()!==t&&t.scope.off(),Mu(),n&&qa(!1)};return R1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let yv=!0;function DI(e){const t=X1(e),n=e.proxy,s=e.ctx;yv=!1,t.beforeCreate&&ib(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:b,beforeDestroy:_,beforeUnmount:g,destroyed:v,unmounted:y,render:C,renderTracked:L,renderTriggered:$,errorCaptured:k,serverPrefetch:M,expose:E,inheritAttrs:O,components:S,directives:I,filters:P}=t;if(c&&BI(c,s,null),r)for(const z in r){const U=r[z];Mt(U)&&(s[z]=U.bind(n))}if(o){const z=o.call(n,n);rn(z)&&(e.data=$s(z))}if(yv=!0,i)for(const z in i){const U=i[z],Q=Mt(U)?U.bind(n,n):Mt(U.get)?U.get.bind(n,n):Go,X=!Mt(U)&&Mt(U.set)?U.set.bind(n):Go,ue=W({get:Q,set:X});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>ue.value,set:me=>ue.value=me})}if(l)for(const z in l)YC(l[z],s,n,z);if(a){const z=Mt(a)?a.call(n):a;Reflect.ownKeys(z).forEach(U=>{On(U,z[U])})}u&&ib(u,e,"c");function H(z,U){kt(U)?U.forEach(Q=>z(Q.bind(n))):U&&z(U.bind(n))}if(H(EI,d),H(bn,f),H(VC,h),H(j1,p),H(AI,m),H(TI,b),H(LI,k),H(NI,L),H($I,$),H(ms,g),H(_n,y),H(II,M),kt(E))if(E.length){const z=e.exposed||(e.exposed={});E.forEach(U=>{Object.defineProperty(z,U,{get:()=>n[U],set:Q=>n[U]=Q,enumerable:!0})})}else e.exposed||(e.exposed={});C&&e.render===Go&&(e.render=C),O!=null&&(e.inheritAttrs=O),S&&(e.components=S),I&&(e.directives=I),M&&q1(e)}function BI(e,t,n=Go){kt(e)&&(e=kv(e));for(const s in e){const o=e[s];let i;rn(o)?"default"in o?i=qt(o.from||s,o.default,!0):i=qt(o.from||s):i=qt(o),Jn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function ib(e,t,n){Qo(kt(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function YC(e,t,n,s){let o=s.includes(".")?DC(n,s):()=>n[s];if(kn(e)){const i=t[e];Mt(i)&&Ye(o,i)}else if(Mt(e))Ye(o,e.bind(n));else if(rn(e))if(kt(e))e.forEach(i=>YC(i,t,n,s));else{const i=Mt(e.handler)?e.handler.bind(n):t[e.handler];Mt(i)&&Ye(o,i,e)}}function X1(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=>Kf(a,c,r,!0)),Kf(a,t,r)),rn(t)&&i.set(t,a),a}function Kf(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Kf(e,i,n,!0),o&&o.forEach(r=>Kf(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=FI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const FI={data:rb,props:lb,emits:lb,methods:Gc,computed:Gc,beforeCreate:Us,created:Us,beforeMount:Us,mounted:Us,beforeUpdate:Us,updated:Us,beforeDestroy:Us,beforeUnmount:Us,destroyed:Us,unmounted:Us,activated:Us,deactivated:Us,errorCaptured:Us,serverPrefetch:Us,components:Gc,directives:Gc,watch:WI,provide:rb,inject:HI};function rb(e,t){return t?e?function(){return gn(Mt(e)?e.call(this,this):e,Mt(t)?t.call(this,this):t)}:t:e}function HI(e,t){return Gc(kv(e),kv(t))}function kv(e){if(kt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Us(e,t){return e?[...new Set([].concat(e,t))]:t}function Gc(e,t){return e?gn(Object.create(null),e,t):t}function lb(e,t){return e?kt(e)&&kt(t)?[...new Set([...e,...t])]:gn(Object.create(null),Au(e),Au(t??{})):t}function WI(e,t){if(!e)return t;if(!t)return e;const n=gn(Object.create(null),e);for(const s in t)n[s]=Us(e[s],t[s]);return n}function XC(){return{app:null,config:{isNativeTag:rC,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let zI=0;function UI(e,t){return function(s,o=null){Mt(s)||(s=gn({},s)),o!=null&&!rn(o)&&(o=null);const i=XC(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:zI++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:k$,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Mt(u.install)?(r.add(u),u.install(c,...d)):Mt(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||oe(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,ed(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Qo(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=Bl;Bl=c;try{return u()}finally{Bl=d}}};return c}}let Bl=null;function Cpe(e,t,n=Ut){const s=Ls(),o=hs(t),i=ro(t),r=QC(e,o),l=YE((a,c)=>{let u,d=Ut,f;return uI(()=>{const h=e[o];Ms(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(!Ms(p,u)&&!(d!==Ut&&Ms(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),Ms(h,p)&&Ms(h,d)&&!Ms(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Ut:l,done:!1}:{done:!0}}}},l}const QC=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${hs(t)}Modifiers`]||e[`${ro(t)}Modifiers`];function qI(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Ut;let o=n;const i=t.startsWith("update:"),r=i&&QC(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>kn(u)?u.trim():u)),r.number&&(o=n.map(Gp)));let l,a=s[l=yf(t)]||s[l=yf(hs(t))];!a&&i&&(a=s[l=yf(ro(t))]),a&&Qo(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,Qo(c,e,6,o)}}const jI=new WeakMap;function ZC(e,t,n=!1){const s=n?jI:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!Mt(e)){const a=c=>{const u=ZC(c,t,!0);u&&(l=!0,gn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(rn(e)&&s.set(e,null),null):(kt(i)?i.forEach(a=>r[a]=null):gn(r,i),rn(e)&&s.set(e,r),r)}function ih(e,t){return!e||!Yu(t)?!1:(t=t.slice(2).replace(/Once$/,""),on(e,t[0].toLowerCase()+t.slice(1))||on(e,ro(t))||on(e,t))}function kf(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,b=Cu(e);let _,g;try{if(n.shapeFlag&4){const y=o||s,C=y;_=io(c.call(C,y,u,d,h,f,p)),g=l}else{const y=t;_=io(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:KI(l)}}catch(y){iu.length=0,uc(y,e,1),_=oe(is)}let v=_;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:C}=v;y.length&&C&7&&(i&&y.some(Up)&&(g=GI(g,i)),v=sr(v,g,!1,!0))}return n.dirs&&(v=sr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&jr(v,n.transition),_=v,Cu(b),_}function VI(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Vr(o)){if(o.type!==is||o.children==="v-if"){if(n)return;n=o}}else return}return n}const KI=e=>{let t;for(const n in e)(n==="class"||n==="style"||Yu(n))&&((t||(t={}))[n]=e[n]);return t},GI=(e,t)=>{const n={};for(const s in e)(!Up(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function YI(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?ab(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(JC(r,s,f)&&!ih(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?ab(s,r,c):!0:!!r;return!1}function ab(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(JC(t,e,i)&&!ih(n,i))return!0}return!1}function JC(e,t,n){const s=e[n],o=t[n];return n==="style"&&rn(s)&&rn(o)?!Ji(s,o):s!==o}function rh({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 ex={},tx=()=>Object.create(ex),nx=e=>Object.getPrototypeOf(e)===ex;function XI(e,t,n,s=!1){const o={},i=tx();e.propsDefaults=Object.create(null),sx(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:jE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function QI(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Gt(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(ih(e.emitsOptions,f))continue;const h=t[f];if(a)if(on(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=hs(f);o[p]=bv(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{sx(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!on(t,d)&&((u=ro(d))===d||!on(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=bv(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!on(t,d))&&(delete i[d],c=!0)}c&&ji(e.attrs,"set","")}function sx(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Rl(a))continue;const c=t[a];let u;o&&on(o,u=hs(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:ih(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Gt(n),c=l||Ut;for(let u=0;u<i.length;u++){const d=i[u];n[d]=bv(o,a,d,c[d],e,!on(c,d))}}return r}function bv(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=on(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Mt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=dc(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===ro(n))&&(s=!0))}return s}const ZI=new WeakMap;function ox(e,t,n=!1){const s=n?ZI:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!Mt(e)){const u=d=>{a=!0;const[f,h]=ox(d,t,!0);gn(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 rn(e)&&s.set(e,Da),Da;if(kt(i))for(let u=0;u<i.length;u++){const d=hs(i[u]);cb(d)&&(r[d]=Ut)}else if(i)for(const u in i){const d=hs(u);if(cb(d)){const f=i[u],h=r[d]=kt(f)||Mt(f)?{type:f}:gn({},f),p=h.type;let m=!1,b=!0;if(kt(p))for(let _=0;_<p.length;++_){const g=p[_],v=Mt(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(b=!1)}else m=Mt(p)&&p.name==="Boolean";h[0]=m,h[1]=b,(m||on(h,"default"))&&l.push(d)}}const c=[r,l];return rn(e)&&s.set(e,c),c}function cb(e){return e[0]!=="$"&&!Rl(e)}const Q1=e=>e==="_"||e==="_ctx"||e==="$stable",Z1=e=>kt(e)?e.map(io):[io(e)],JI=(e,t,n)=>{if(t._n)return t;const s=ke((...o)=>Z1(t(...o)),n);return s._c=!1,s},ix=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Q1(o))continue;const i=e[o];if(Mt(i))t[o]=JI(o,i,s);else if(i!=null){const r=Z1(i);t[o]=()=>r}}},rx=(e,t)=>{const n=Z1(t);e.slots.default=()=>n},lx=(e,t,n)=>{for(const s in t)(n||!Q1(s))&&(e[s]=t[s])},e$=(e,t,n)=>{const s=e.slots=tx();if(e.vnode.shapeFlag&32){const o=t._;o?(lx(s,t,n),n&&aC(s,"_",o,!0)):ix(t,s)}else t&&rx(e,t)},t$=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Ut;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:lx(o,t,n):(i=!t.$stable,ix(t,o)),r=t}else t&&(rx(e,t),r={default:1});if(i)for(const l in o)!Q1(l)&&r[l]==null&&delete o[l]},ss=px;function n$(e){return ax(e)}function s$(e){return ax(e,kI)}function ax(e,t){const n=Yp();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Go,insertStaticContent:p}=e,m=(q,Y,de,ne=null,ce=null,j=null,G=void 0,re=null,he=!!Y.dynamicChildren)=>{if(q===Y)return;q&&!ri(q,Y)&&(ne=Fe(q),me(q,ce,j,!0),q=null),Y.patchFlag===-2&&(he=!1,Y.dynamicChildren=null);const{type:Ce,ref:Ee,shapeFlag:ae}=Y;switch(Ce){case Wr:b(q,Y,de,ne);break;case is:_(q,Y,de,ne);break;case Ua:q==null&&g(Y,de,ne,G);break;case Oe:S(q,Y,de,ne,ce,j,G,re,he);break;default:ae&1?C(q,Y,de,ne,ce,j,G,re,he):ae&6?I(q,Y,de,ne,ce,j,G,re,he):(ae&64||ae&128)&&Ce.process(q,Y,de,ne,ce,j,G,re,he,F)}Ee!=null&&ce?Wa(Ee,q&&q.ref,j,Y||q,!Y):Ee==null&&q&&q.ref!=null&&Wa(q.ref,null,j,q,!0)},b=(q,Y,de,ne)=>{if(q==null)s(Y.el=l(Y.children),de,ne);else{const ce=Y.el=q.el;Y.children!==q.children&&c(ce,Y.children)}},_=(q,Y,de,ne)=>{q==null?s(Y.el=a(Y.children||""),de,ne):Y.el=q.el},g=(q,Y,de,ne)=>{[q.el,q.anchor]=p(q.children,Y,de,ne,q.el,q.anchor)},v=({el:q,anchor:Y},de,ne)=>{let ce;for(;q&&q!==Y;)ce=f(q),s(q,de,ne),q=ce;s(Y,de,ne)},y=({el:q,anchor:Y})=>{let de;for(;q&&q!==Y;)de=f(q),o(q),q=de;o(Y)},C=(q,Y,de,ne,ce,j,G,re,he)=>{if(Y.type==="svg"?G="svg":Y.type==="math"&&(G="mathml"),q==null)L(Y,de,ne,ce,j,G,re,he);else{const Ce=q.el&&q.el._isVueCE?q.el:null;try{Ce&&Ce._beginPatch(),M(q,Y,ce,j,G,re,he)}finally{Ce&&Ce._endPatch()}}},L=(q,Y,de,ne,ce,j,G,re)=>{let he,Ce;const{props:Ee,shapeFlag:ae,transition:xe,dirs:Ke}=q;if(he=q.el=r(q.type,j,Ee&&Ee.is,Ee),ae&8?u(he,q.children):ae&16&&k(q.children,he,null,ne,ce,jm(q,j),G,re),Ke&&xi(q,null,ne,"created"),$(he,q,q.scopeId,G,ne),Ee){for(const _t in Ee)_t!=="value"&&!Rl(_t)&&i(he,_t,null,Ee[_t],j,ne);"value"in Ee&&i(he,"value",null,Ee.value,j),(Ce=Ee.onVnodeBeforeMount)&&no(Ce,ne,q)}Ke&&xi(q,null,ne,"beforeMount");const st=cx(ce,xe);st&&xe.beforeEnter(he),s(he,Y,de),((Ce=Ee&&Ee.onVnodeMounted)||st||Ke)&&ss(()=>{try{Ce&&no(Ce,ne,q),st&&xe.enter(he),Ke&&xi(q,null,ne,"mounted")}finally{}},ce)},$=(q,Y,de,ne,ce)=>{if(de&&h(q,de),ne)for(let j=0;j<ne.length;j++)h(q,ne[j]);if(ce){let j=ce.subTree;if(Y===j||Yf(j.type)&&(j.ssContent===Y||j.ssFallback===Y)){const G=ce.vnode;$(q,G,G.scopeId,G.slotScopeIds,ce.parent)}}},k=(q,Y,de,ne,ce,j,G,re,he=0)=>{for(let Ce=he;Ce<q.length;Ce++){const Ee=q[Ce]=re?qi(q[Ce]):io(q[Ce]);m(null,Ee,Y,de,ne,ce,j,G,re)}},M=(q,Y,de,ne,ce,j,G)=>{const re=Y.el=q.el;let{patchFlag:he,dynamicChildren:Ce,dirs:Ee}=Y;he|=q.patchFlag&16;const ae=q.props||Ut,xe=Y.props||Ut;let Ke;if(de&&kl(de,!1),(Ke=xe.onVnodeBeforeUpdate)&&no(Ke,de,Y,q),Ee&&xi(Y,q,de,"beforeUpdate"),de&&kl(de,!0),(ae.innerHTML&&xe.innerHTML==null||ae.textContent&&xe.textContent==null)&&u(re,""),Ce?E(q.dynamicChildren,Ce,re,de,ne,jm(Y,ce),j):G||U(q,Y,re,null,de,ne,jm(Y,ce),j,!1),he>0){if(he&16)O(re,ae,xe,de,ce);else if(he&2&&ae.class!==xe.class&&i(re,"class",null,xe.class,ce),he&4&&i(re,"style",ae.style,xe.style,ce),he&8){const st=Y.dynamicProps;for(let _t=0;_t<st.length;_t++){const wt=st[_t],Et=ae[wt],Ot=xe[wt];(Ot!==Et||wt==="value")&&i(re,wt,Et,Ot,ce,de)}}he&1&&q.children!==Y.children&&u(re,Y.children)}else!G&&Ce==null&&O(re,ae,xe,de,ce);((Ke=xe.onVnodeUpdated)||Ee)&&ss(()=>{Ke&&no(Ke,de,Y,q),Ee&&xi(Y,q,de,"updated")},ne)},E=(q,Y,de,ne,ce,j,G)=>{for(let re=0;re<Y.length;re++){const he=q[re],Ce=Y[re],Ee=he.el&&(he.type===Oe||!ri(he,Ce)||he.shapeFlag&198)?d(he.el):de;m(he,Ce,Ee,null,ne,ce,j,G,!0)}},O=(q,Y,de,ne,ce)=>{if(Y!==de){if(Y!==Ut)for(const j in Y)!Rl(j)&&!(j in de)&&i(q,j,Y[j],null,ce,ne);for(const j in de){if(Rl(j))continue;const G=de[j],re=Y[j];G!==re&&j!=="value"&&i(q,j,re,G,ce,ne)}"value"in de&&i(q,"value",Y.value,de.value,ce)}},S=(q,Y,de,ne,ce,j,G,re,he)=>{const Ce=Y.el=q?q.el:l(""),Ee=Y.anchor=q?q.anchor:l("");let{patchFlag:ae,dynamicChildren:xe,slotScopeIds:Ke}=Y;Ke&&(re=re?re.concat(Ke):Ke),q==null?(s(Ce,de,ne),s(Ee,de,ne),k(Y.children||[],de,Ee,ce,j,G,re,he)):ae>0&&ae&64&&xe&&q.dynamicChildren&&q.dynamicChildren.length===xe.length?(E(q.dynamicChildren,xe,de,ce,j,G,re),(Y.key!=null||ce&&Y===ce.subTree)&&J1(q,Y,!0)):U(q,Y,de,Ee,ce,j,G,re,he)},I=(q,Y,de,ne,ce,j,G,re,he)=>{Y.slotScopeIds=re,q==null?Y.shapeFlag&512?ce.ctx.activate(Y,de,ne,G,he):P(Y,de,ne,ce,j,G,he):D(q,Y,he)},P=(q,Y,de,ne,ce,j,G)=>{const re=q.component=vx(q,ne,ce);if(Zu(q)&&(re.ctx.renderer=F),kx(re,!1,G),re.asyncDep){if(ce&&ce.registerDep(re,H,G),!q.el){const he=re.subTree=oe(is);_(null,he,Y,de),q.placeholder=he.el}}else H(re,q,Y,de,ce,j,G)},D=(q,Y,de)=>{const ne=Y.component=q.component;if(YI(q,Y,de))if(ne.asyncDep&&!ne.asyncResolved){z(ne,Y,de);return}else ne.next=Y,ne.update();else Y.el=q.el,ne.vnode=Y},H=(q,Y,de,ne,ce,j,G)=>{const re=()=>{if(q.isMounted){let{next:ae,bu:xe,u:Ke,parent:st,vnode:_t}=q;{const Kt=ux(q);if(Kt){ae&&(ae.el=_t.el,z(q,ae,G)),Kt.asyncDep.then(()=>{ss(()=>{q.isUnmounted||Ce()},ce)});return}}let wt=ae,Et;kl(q,!1),ae?(ae.el=_t.el,z(q,ae,G)):ae=_t,xe&&Fa(xe),(Et=ae.props&&ae.props.onVnodeBeforeUpdate)&&no(Et,st,ae,_t),kl(q,!0);const Ot=kf(q),bt=q.subTree;q.subTree=Ot,m(bt,Ot,d(bt.el),Fe(bt),q,ce,j),ae.el=Ot.el,wt===null&&rh(q,Ot.el),Ke&&ss(Ke,ce),(Et=ae.props&&ae.props.onVnodeUpdated)&&ss(()=>no(Et,st,ae,_t),ce)}else{let ae;const{el:xe,props:Ke}=Y,{bm:st,m:_t,parent:wt,root:Et,type:Ot}=q,bt=Qi(Y);if(kl(q,!1),st&&Fa(st),!bt&&(ae=Ke&&Ke.onVnodeBeforeMount)&&no(ae,wt,Y),kl(q,!0),xe&&ee){const Kt=()=>{q.subTree=kf(q),ee(xe,q.subTree,q,ce,null)};bt&&Ot.__asyncHydrate?Ot.__asyncHydrate(xe,q,Kt):Kt()}else{Et.ce&&Et.ce._hasShadowRoot()&&Et.ce._injectChildStyle(Ot,q.parent?q.parent.type:void 0);const Kt=q.subTree=kf(q);m(null,Kt,de,ne,q,ce,j),Y.el=Kt.el}if(_t&&ss(_t,ce),!bt&&(ae=Ke&&Ke.onVnodeMounted)){const Kt=Y;ss(()=>no(ae,wt,Kt),ce)}(Y.shapeFlag&256||wt&&Qi(wt.vnode)&&wt.vnode.shapeFlag&256)&&q.a&&ss(q.a,ce),q.isMounted=!0,Y=de=ne=null}};q.scope.on();const he=q.effect=new Ff(re);q.scope.off();const Ce=q.update=he.run.bind(he),Ee=q.job=he.runIfDirty.bind(he);Ee.i=q,Ee.id=q.uid,he.scheduler=()=>z1(Ee),kl(q,!0),Ce()},z=(q,Y,de)=>{Y.component=q;const ne=q.vnode.props;q.vnode=Y,q.next=null,QI(q,Y.props,ne,de),t$(q,Y.children,de),er(),Xk(q),tr()},U=(q,Y,de,ne,ce,j,G,re,he=!1)=>{const Ce=q&&q.children,Ee=q?q.shapeFlag:0,ae=Y.children,{patchFlag:xe,shapeFlag:Ke}=Y;if(xe>0){if(xe&128){X(Ce,ae,de,ne,ce,j,G,re,he);return}else if(xe&256){Q(Ce,ae,de,ne,ce,j,G,re,he);return}}Ke&8?(Ee&16&&qe(Ce,ce,j),ae!==Ce&&u(de,ae)):Ee&16?Ke&16?X(Ce,ae,de,ne,ce,j,G,re,he):qe(Ce,ce,j,!0):(Ee&8&&u(de,""),Ke&16&&k(ae,de,ne,ce,j,G,re,he))},Q=(q,Y,de,ne,ce,j,G,re,he)=>{q=q||Da,Y=Y||Da;const Ce=q.length,Ee=Y.length,ae=Math.min(Ce,Ee);let xe;for(xe=0;xe<ae;xe++){const Ke=Y[xe]=he?qi(Y[xe]):io(Y[xe]);m(q[xe],Ke,de,null,ce,j,G,re,he)}Ce>Ee?qe(q,ce,j,!0,!1,ae):k(Y,de,ne,ce,j,G,re,he,ae)},X=(q,Y,de,ne,ce,j,G,re,he)=>{let Ce=0;const Ee=Y.length;let ae=q.length-1,xe=Ee-1;for(;Ce<=ae&&Ce<=xe;){const Ke=q[Ce],st=Y[Ce]=he?qi(Y[Ce]):io(Y[Ce]);if(ri(Ke,st))m(Ke,st,de,null,ce,j,G,re,he);else break;Ce++}for(;Ce<=ae&&Ce<=xe;){const Ke=q[ae],st=Y[xe]=he?qi(Y[xe]):io(Y[xe]);if(ri(Ke,st))m(Ke,st,de,null,ce,j,G,re,he);else break;ae--,xe--}if(Ce>ae){if(Ce<=xe){const Ke=xe+1,st=Ke<Ee?Y[Ke].el:ne;for(;Ce<=xe;)m(null,Y[Ce]=he?qi(Y[Ce]):io(Y[Ce]),de,st,ce,j,G,re,he),Ce++}}else if(Ce>xe)for(;Ce<=ae;)me(q[Ce],ce,j,!0),Ce++;else{const Ke=Ce,st=Ce,_t=new Map;for(Ce=st;Ce<=xe;Ce++){const Rt=Y[Ce]=he?qi(Y[Ce]):io(Y[Ce]);Rt.key!=null&&_t.set(Rt.key,Ce)}let wt,Et=0;const Ot=xe-st+1;let bt=!1,Kt=0;const Fn=new Array(Ot);for(Ce=0;Ce<Ot;Ce++)Fn[Ce]=0;for(Ce=Ke;Ce<=ae;Ce++){const Rt=q[Ce];if(Et>=Ot){me(Rt,ce,j,!0);continue}let nn;if(Rt.key!=null)nn=_t.get(Rt.key);else for(wt=st;wt<=xe;wt++)if(Fn[wt-st]===0&&ri(Rt,Y[wt])){nn=wt;break}nn===void 0?me(Rt,ce,j,!0):(Fn[nn-st]=Ce+1,nn>=Kt?Kt=nn:bt=!0,m(Rt,Y[nn],de,null,ce,j,G,re,he),Et++)}const $n=bt?o$(Fn):Da;for(wt=$n.length-1,Ce=Ot-1;Ce>=0;Ce--){const Rt=st+Ce,nn=Y[Rt],Hn=Y[Rt+1],nt=Rt+1<Ee?Hn.el||dx(Hn):ne;Fn[Ce]===0?m(null,nn,de,nt,ce,j,G,re,he):bt&&(wt<0||Ce!==$n[wt]?ue(nn,de,nt,2):wt--)}}},ue=(q,Y,de,ne,ce=null)=>{const{el:j,type:G,transition:re,children:he,shapeFlag:Ce}=q;if(Ce&6){ue(q.component.subTree,Y,de,ne);return}if(Ce&128){q.suspense.move(Y,de,ne);return}if(Ce&64){G.move(q,Y,de,F);return}if(G===Oe){s(j,Y,de);for(let ae=0;ae<he.length;ae++)ue(he[ae],Y,de,ne);s(q.anchor,Y,de);return}if(G===Ua){v(q,Y,de);return}if(ne!==2&&Ce&1&&re)if(ne===0)re.persisted&&!j[zo]?s(j,Y,de):(re.beforeEnter(j),s(j,Y,de),ss(()=>re.enter(j),ce));else{const{leave:ae,delayLeave:xe,afterLeave:Ke}=re,st=()=>{q.ctx.isUnmounted?o(j):s(j,Y,de)},_t=()=>{const wt=j._isLeaving||!!j[zo];j._isLeaving&&j[zo](!0),re.persisted&&!wt?st():ae(j,()=>{st(),Ke&&Ke()})};xe?xe(j,st,_t):_t()}else s(j,Y,de)},me=(q,Y,de,ne=!1,ce=!1)=>{const{type:j,props:G,ref:re,children:he,dynamicChildren:Ce,shapeFlag:Ee,patchFlag:ae,dirs:xe,cacheIndex:Ke,memo:st}=q;if(ae===-2&&(ce=!1),re!=null&&(er(),Wa(re,null,de,q,!0),tr()),Ke!=null&&(Y.renderCache[Ke]=void 0),Ee&256){Y.ctx.deactivate(q);return}const _t=Ee&1&&xe,wt=!Qi(q);let Et;if(wt&&(Et=G&&G.onVnodeBeforeUnmount)&&no(Et,Y,q),Ee&6)ze(q.component,de,ne);else{if(Ee&128){q.suspense.unmount(de,ne);return}_t&&xi(q,null,Y,"beforeUnmount"),Ee&64?q.type.remove(q,Y,de,F,ne):Ce&&!Ce.hasOnce&&(j!==Oe||ae>0&&ae&64)?qe(Ce,Y,de,!1,!0):(j===Oe&&ae&384||!ce&&Ee&16)&&qe(he,Y,de),ne&&Ae(q)}const Ot=st!=null&&Ke==null;(wt&&(Et=G&&G.onVnodeUnmounted)||_t||Ot)&&ss(()=>{Et&&no(Et,Y,q),_t&&xi(q,null,Y,"unmounted"),Ot&&(q.el=null)},de)},Ae=q=>{const{type:Y,el:de,anchor:ne,transition:ce}=q;if(Y===Oe){be(de,ne);return}if(Y===Ua){y(q);return}const j=()=>{o(de),ce&&!ce.persisted&&ce.afterLeave&&ce.afterLeave()};if(q.shapeFlag&1&&ce&&!ce.persisted){const{leave:G,delayLeave:re}=ce,he=()=>G(de,j);re?re(q.el,j,he):he()}else j()},be=(q,Y)=>{let de;for(;q!==Y;)de=f(q),o(q),q=de;o(Y)},ze=(q,Y,de)=>{const{bum:ne,scope:ce,job:j,subTree:G,um:re,m:he,a:Ce}=q;Gf(he),Gf(Ce),ne&&Fa(ne),ce.stop(),j&&(j.flags|=8,me(G,q,Y,de)),re&&ss(re,Y),ss(()=>{q.isUnmounted=!0},Y)},qe=(q,Y,de,ne=!1,ce=!1,j=0)=>{for(let G=j;G<q.length;G++)me(q[G],Y,de,ne,ce)},Fe=q=>{if(q.shapeFlag&6)return Fe(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const Y=f(q.anchor||q.el),de=Y&&Y[BC];return de?f(de):Y};let Le=!1;const le=(q,Y,de)=>{let ne;q==null?Y._vnode&&(me(Y._vnode,null,null,!0),ne=Y._vnode.component):m(Y._vnode||null,q,Y,null,null,null,de),Y._vnode=q,Le||(Le=!0,Xk(ne),jf(),Le=!1)},F={p:m,um:me,m:ue,r:Ae,mt:P,mc:k,pc:U,pbc:E,n:Fe,o:e};let te,ee;return t&&([te,ee]=t(F)),{render:le,hydrate:te,createApp:UI(le,te)}}function jm({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 kl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function cx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function J1(e,t,n=!1){const s=e.children,o=t.children;if(kt(s)&&kt(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]=qi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&J1(r,l)),l.type===Wr&&(l.patchFlag===-1&&(l=o[i]=qi(l)),l.el=r.el),l.type===is&&!l.el&&(l.el=r.el)}}function o$(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 ux(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ux(t)}function Gf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function dx(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?dx(t.subTree):null}const Yf=e=>e.__isSuspense;let _v=0;const i$={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)r$(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}l$(e,t,n,s,o,r,l,a,c)}},hydrate:a$,normalize:c$},xpe=i$;function Tu(e,t){const n=e.props&&e.props[t];Mt(n)&&n()}function r$(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=fx(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?(Tu(e,"onPending"),Tu(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),za(f,e.ssFallback)):f.resolve(!1,!0)}function l$(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:b,isHydrating:_}=d;if(m)d.pendingBranch=f,ri(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),za(d,h)))):(d.pendingId=_v++,_?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(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),za(d,h))):p&&ri(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&&ri(p,f))a(p,f,n,s,o,d,i,r,l),za(d,f);else if(Tu(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=_v++,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 fx(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:b}}=c;let _;const g=u$(e);g&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const v=e.props?Bf(e.props.timeout):void 0,y=i,C={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:_v++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:k,activeBranch:M,pendingBranch:E,pendingId:O,effects:S,parentComponent:I,container:P,isInFallback:D}=C;let H=!1;if(C.isHydrating)C.isHydrating=!1;else if(!L){H=M&&E.transition&&E.transition.mode==="out-in";let Q=!1;H&&(M.transition.afterLeave=()=>{O===C.pendingId&&(f(E,P,i===y&&!Q?p(M):i,0),qf(S),D&&k.ssFallback&&(k.ssFallback.el=null))}),M&&!C.isFallbackMountPending&&(m(M.el)===P&&(i=p(M),Q=!0),h(M,I,C,!0),!H&&D&&k.ssFallback&&ss(()=>k.ssFallback.el=null,C)),H||f(E,P,i,0)}C.isFallbackMountPending=!1,za(C,E),C.pendingBranch=null,C.isInFallback=!1;let z=C.parent,U=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),U=!0;break}z=z.parent}!U&&!H&&qf(S),C.effects=[],g&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),Tu(k,"onResolve")},fallback(L){if(!C.pendingBranch)return;const{vnode:$,activeBranch:k,parentComponent:M,container:E,namespace:O}=C;Tu($,"onFallback");const S=p(k),I=()=>{C.isFallbackMountPending=!1,C.isInFallback&&(d(null,L,E,S,M,null,O,l,a),za(C,L))},P=L.transition&&L.transition.mode==="out-in";P&&(C.isFallbackMountPending=!0,k.transition.afterLeave=I),C.isInFallback=!0,h(k,M,null,!0),P||I()},move(L,$,k){C.activeBranch&&f(C.activeBranch,L,$,k),C.container=L},next(){return C.activeBranch&&p(C.activeBranch)},registerDep(L,$,k){const M=!!C.pendingBranch;M&&C.deps++;const E=L.vnode.el;L.asyncDep.catch(O=>{uc(O,L,0)}).then(O=>{if(L.isUnmounted||C.isUnmounted||C.pendingId!==L.suspenseId)return;Mu(),L.asyncResolved=!0;const{vnode:S}=L;wv(L,O,!1),E&&(S.el=E);const I=!E&&L.subTree.el;$(L,S,m(E||L.subTree.el),E?null:p(L.subTree),C,r,k),I&&(S.placeholder=null,b(I)),rh(L,S.el),M&&--C.deps===0&&C.resolve()})},unmount(L,$){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,L,$),C.pendingBranch&&h(C.pendingBranch,n,L,$)}};return C}function a$(e,t,n,s,o,i,r,l,a){const c=t.suspense=fx(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 c$(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=ub(s?n.default:n),e.ssFallback=s?ub(n.fallback):oe(is)}function ub(e){let t;if(Mt(e)){const n=Ul&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=Fs,hx())}return kt(e)&&(e=VI(e)),e=io(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function px(e,t){t&&t.pendingBranch?kt(e)?t.effects.push(...e):t.effects.push(e):qf(e)}function za(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,rh(s,o))}function u$(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Oe=Symbol.for("v-fgt"),Wr=Symbol.for("v-txt"),is=Symbol.for("v-cmt"),Ua=Symbol.for("v-stc"),iu=[];let Fs=null;function w(e=!1){iu.push(Fs=e?null:[])}function hx(){iu.pop(),Fs=iu[iu.length-1]||null}let Ul=1;function Xf(e,t=!1){Ul+=e,e<0&&Fs&&t&&(Fs.hasOnce=!0)}function mx(e){return e.dynamicChildren=Ul>0?Fs||Da:null,hx(),Ul>0&&Fs&&Fs.push(e),e}function N(e,t,n,s,o,i){return mx(T(e,t,n,s,o,i,!0))}function ge(e,t,n,s,o){return mx(oe(e,t,n,s,o,!0))}function Vr(e){return e?e.__v_isVNode===!0:!1}function ri(e,t){return e.type===t.type&&e.key===t.key}function Ape(e){}const gx=({key:e})=>e??null,bf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?kn(e)||Jn(e)||Mt(e)?{i:Ns,r:e,k:t,f:!!n}:e:null);function T(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&&gx(t),ref:t&&bf(t),scopeId:nh,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:Ns};return l?(t0(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=kn(n)?8:16),Ul>0&&!r&&Fs&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Fs.push(a),a}const oe=d$;function d$(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===KC)&&(e=is),Vr(e)){const l=sr(e,t,!0);return n&&t0(l,n),Ul>0&&!i&&Fs&&(l.shapeFlag&6?Fs[Fs.indexOf(e)]=l:Fs.push(l)),l.patchFlag=-2,l}if(v$(e)&&(e=e.__vccOpts),t){t=f$(t);let{class:l,style:a}=t;l&&!kn(l)&&(t.class=De(l)),rn(a)&&(th(a)&&!kt(a)&&(a=gn({},a)),t.style=Yt(a))}const r=kn(e)?1:Yf(e)?128:FC(e)?64:rn(e)?4:Mt(e)?2:0;return T(e,t,n,s,o,r,i,!0)}function f$(e){return e?th(e)||nx(e)?gn({},e):e:null}function sr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?pn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&gx(c),ref:t&&t.ref?n&&i?kt(i)?i.concat(bf(t)):[i,bf(t)]:bf(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&&sr(e.ssContent),ssFallback:e.ssFallback&&sr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&jr(u,a.clone(u)),u}function je(e=" ",t=0){return oe(Wr,null,e,t)}function e0(e,t){const n=oe(Ua,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(w(),ge(is,null,e)):oe(is,null,e)}function io(e){return e==null||typeof e=="boolean"?oe(is):kt(e)?oe(Oe,null,e.slice()):Vr(e)?qi(e):oe(Wr,null,String(e))}function qi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:sr(e)}function t0(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(kt(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),t0(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!nx(t)?t._ctx=Ns:o===3&&Ns&&(Ns.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Mt(t)?(t={default:t,_ctx:Ns},n=32):(t=String(t),s&64?(n=16,t=[je(t)]):n=8);e.children=t,e.shapeFlag|=n}function pn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=De([t.class,s.class]));else if(o==="style")t.style=Yt([t.style,s.style]);else if(Yu(o)){const i=t[o],r=s[o];r&&i!==r&&!(kt(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Up(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function no(e,t,n,s=null){Qo(e,t,7,[n,s])}const p$=XC();let h$=0;function vx(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||p$,i={uid:h$++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new fC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ox(s,o),emitsOptions:ZC(s,o),emit:null,emitted:null,propsDefaults:Ut,inheritAttrs:s.inheritAttrs,ctx:Ut,data:Ut,props:Ut,attrs:Ut,slots:Ut,refs:Ut,setupState:Ut,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=qI.bind(null,i),e.ce&&e.ce(i),i}let Es=null;const Ls=()=>Es||Ns;let Qf,qa;{const e=Yp(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};Qf=t("__VUE_INSTANCE_SETTERS__",n=>Es=n),qa=t("__VUE_SSR_SETTERS__",n=>ql=n)}const dc=e=>{const t=Es;return Qf(e),e.scope.on(),()=>{e.scope.off(),Qf(t)}},Mu=()=>{Es&&Es.scope.off(),Qf(null)};function yx(e){return e.vnode.shapeFlag&4}let ql=!1;function kx(e,t=!1,n=!1){t&&qa(t);const{props:s,children:o}=e.vnode,i=yx(e);XI(e,s,i,t),e$(e,o,n||t);const r=i?m$(e,t):void 0;return t&&qa(!1),r}function m$(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vv);const{setup:s}=n;if(s){er();const o=e.setupContext=s.length>1?_x(e):null,i=dc(e),r=Xu(s,e,0,[e.props,o]),l=R1(r);if(tr(),i(),(l||e.sp)&&!Qi(e)&&q1(e),l){if(r.then(Mu,Mu),t)return r.then(a=>{wv(e,a,t)}).catch(a=>{uc(a,e,0)});e.asyncDep=r}else wv(e,r,t)}else bx(e,t)}function wv(e,t,n){Mt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:rn(t)&&(e.setupState=IC(t)),bx(e,n)}let Zf,Sv;function Tpe(e){Zf=e,Sv=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,RI))}}const Mpe=()=>!Zf;function bx(e,t,n){const s=e.type;if(!e.render){if(!t&&Zf&&!s.render){const o=s.template||X1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=gn(gn({isCustomElement:i,delimiters:l},r),a);s.render=Zf(o,c)}}e.render=s.render||Go,Sv&&Sv(e)}{const o=dc(e);er();try{DI(e)}finally{tr(),o()}}}const g$={get(e,t){return Ds(e,"get",""),e[t]}};function _x(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,g$),slots:e.slots,emit:e.emit,expose:t}}function ed(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(IC(Rr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ou)return ou[n](e)},has(t,n){return n in t||n in ou}})):e.proxy}function Cv(e,t=!0){return Mt(e)?e.displayName||e.name:e.name||t&&e.__name}function v$(e){return Mt(e)&&"__vccOpts"in e}const W=(e,t)=>JE(e,t,ql);function un(e,t,n){try{Xf(-1);const s=arguments.length;return s===2?rn(t)&&!kt(t)?Vr(t)?oe(e,null,[t]):oe(e,t):oe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Vr(n)&&(n=[n]),oe(e,t,n))}finally{Xf(1)}}function Epe(){}function Ipe(e,t,n,s){const o=n[s];if(o&&y$(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function y$(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Ms(n[s],t[s]))return!1;return Ul>0&&Fs&&Fs.push(e),!0}const k$="3.5.35",$pe=Go,Npe=oI,Lpe=Ca,Ope=RC,b$={createComponentInstance:vx,setupComponent:kx,renderComponentRoot:kf,setCurrentRenderingInstance:Cu,isVNode:Vr,normalizeVNode:io,getComponentPublicInstance:ed,ensureValidVNode:Y1,pushWarningContext:nI,popWarningContext:sI},Ppe=b$,Rpe=null,Dpe=null,Bpe=null;/**
17
- * @vue/runtime-dom v3.5.35
18
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
- * @license MIT
20
- **/let xv;const db=typeof window<"u"&&window.trustedTypes;if(db)try{xv=db.createPolicy("vue",{createHTML:e=>e})}catch{}const wx=xv?e=>xv.createHTML(e):e=>e,_$="http://www.w3.org/2000/svg",w$="http://www.w3.org/1998/Math/MathML",Wi=typeof document<"u"?document:null,fb=Wi&&Wi.createElement("template"),S$={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"?Wi.createElementNS(_$,e):t==="mathml"?Wi.createElementNS(w$,e):n?Wi.createElement(e,{is:n}):Wi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Wi.createTextNode(e),createComment:e=>Wi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Wi.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{fb.innerHTML=wx(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=fb.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]}},vr="transition",Fc="animation",ec=Symbol("_vtc"),Sx={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},Cx=gn({},WC,Sx),C$=e=>(e.displayName="Transition",e.props=Cx,e),Kr=C$((e,{slots:t})=>un(gI,xx(e),t)),bl=(e,t=[])=>{kt(e)?e.forEach(n=>n(...t)):e&&e(...t)},pb=e=>e?kt(e)?e.some(t=>t.length>1):e.length>1:!1;function xx(e){const t={};for(const S in e)S in Sx||(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=x$(o),m=p&&p[0],b=p&&p[1],{onBeforeEnter:_,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:C,onBeforeAppear:L=_,onAppear:$=g,onAppearCancelled:k=v}=t,M=(S,I,P,D)=>{S._enterCancelled=D,Tr(S,I?u:l),Tr(S,I?c:r),P&&P()},E=(S,I)=>{S._isLeaving=!1,Tr(S,d),Tr(S,h),Tr(S,f),I&&I()},O=S=>(I,P)=>{const D=S?$:g,H=()=>M(I,S,P);bl(D,[I,H]),hb(()=>{Tr(I,S?a:i),wi(I,S?u:l),pb(D)||mb(I,s,m,H)})};return gn(t,{onBeforeEnter(S){bl(_,[S]),wi(S,i),wi(S,r)},onBeforeAppear(S){bl(L,[S]),wi(S,a),wi(S,c)},onEnter:O(!1),onAppear:O(!0),onLeave(S,I){S._isLeaving=!0;const P=()=>E(S,I);wi(S,d),S._enterCancelled?(wi(S,f),Av(S)):(Av(S),wi(S,f)),hb(()=>{S._isLeaving&&(Tr(S,d),wi(S,h),pb(y)||mb(S,s,b,P))}),bl(y,[S,P])},onEnterCancelled(S){M(S,!1,void 0,!0),bl(v,[S])},onAppearCancelled(S){M(S,!0,void 0,!0),bl(k,[S])},onLeaveCancelled(S){E(S),bl(C,[S])}})}function x$(e){if(e==null)return null;if(rn(e))return[Vm(e.enter),Vm(e.leave)];{const t=Vm(e);return[t,t]}}function Vm(e){return Bf(e)}function wi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ec]||(e[ec]=new Set)).add(t)}function Tr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ec];n&&(n.delete(t),n.size||(e[ec]=void 0))}function hb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let A$=0;function mb(e,t,n,s){const o=e._endId=++A$,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=Ax(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 Ax(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${vr}Delay`),i=s(`${vr}Duration`),r=gb(o,i),l=s(`${Fc}Delay`),a=s(`${Fc}Duration`),c=gb(l,a);let u=null,d=0,f=0;t===vr?r>0&&(u=vr,d=r,f=i.length):t===Fc?c>0&&(u=Fc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?vr:Fc:null,f=u?u===vr?i.length:a.length:0);const h=u===vr&&/\b(?:transform|all)(?:,|$)/.test(s(`${vr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function gb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>vb(n)+vb(e[s])))}function vb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Av(e){return(e?e.ownerDocument:document).body.offsetHeight}function T$(e,t,n){const s=e[ec];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jf=Symbol("_vod"),Tx=Symbol("_vsh"),Vo={name:"show",beforeMount(e,{value:t},{transition:n}){e[Jf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Hc(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),Hc(e,!0),s.enter(e)):s.leave(e,()=>{Hc(e,!1)}):Hc(e,t))},beforeUnmount(e,{value:t}){Hc(e,t)}};function Hc(e,t){e.style.display=t?e[Jf]:"none",e[Tx]=!t}function M$(){Vo.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Mx=Symbol("");function Fpe(e){const t=Ls();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ep(i,o))},s=()=>{const o=e(t.proxy);t.ce?ep(t.ce,o):Tv(t.subTree,o),n(o)};VC(()=>{qf(s)}),bn(()=>{Ye(s,Go,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),_n(()=>o.disconnect())})}function Tv(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Tv(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ep(e.el,t);else if(e.type===Oe)e.children.forEach(n=>Tv(n,t));else if(e.type===Ua){let{el:n,anchor:s}=e;for(;n&&(ep(n,t),n!==s);)n=n.nextSibling}}function ep(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=xE(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[Mx]=s}}const E$=/(?:^|;)\s*display\s*:/;function I$(e,t,n){const s=e.style,o=kn(n);let i=!1;if(n&&!o){if(t)if(kn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Yc(s,l,"")}else for(const r in t)n[r]==null&&Yc(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?N$(e,r,!kn(t)&&t?t[r]:void 0,l)||Yc(s,r,l):Yc(s,r,"")}}else if(o){if(t!==n){const r=s[Mx];r&&(n+=";"+r),s.cssText=n,i=E$.test(n)}}else t&&e.removeAttribute("style");Jf in e&&(e[Jf]=i?s.display:"",e[Tx]&&(s.display="none"))}const yb=/\s*!important$/;function Yc(e,t,n){if(kt(n))n.forEach(s=>Yc(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=$$(e,t);yb.test(n)?e.setProperty(ro(s),n.replace(yb,""),"important"):e[s]=n}}const kb=["Webkit","Moz","ms"],Km={};function $$(e,t){const n=Km[t];if(n)return n;let s=hs(t);if(s!=="filter"&&s in e)return Km[t]=s;s=Kp(s);for(let o=0;o<kb.length;o++){const i=kb[o]+s;if(i in e)return Km[t]=i}return t}function N$(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&kn(s)&&n===s}const bb="http://www.w3.org/1999/xlink";function _b(e,t,n,s,o,i=SE(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(bb,t.slice(6,t.length)):e.setAttributeNS(bb,t,n):n==null||i&&!cC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Io(n)?String(n):n)}function wb(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?wx(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=cC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function Ki(e,t,n,s){e.addEventListener(t,n,s)}function L$(e,t,n,s){e.removeEventListener(t,n,s)}const Sb=Symbol("_vei");function O$(e,t,n,s,o=null){const i=e[Sb]||(e[Sb]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=P$(t);if(s){const c=i[t]=B$(s,o);Ki(e,l,c,a)}else r&&(L$(e,l,r,a),i[t]=void 0)}}const Cb=/(?:Once|Passive|Capture)$/;function P$(e){let t;if(Cb.test(e)){t={};let s;for(;s=e.match(Cb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ro(e.slice(2)),t]}let Gm=0;const R$=Promise.resolve(),D$=()=>Gm||(R$.then(()=>Gm=0),Gm=Date.now());function B$(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(kt(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&&Qo(c,t,5,l)}}else Qo(o,t,5,[s])};return n.value=e,n.attached=D$(),n}const xb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,F$=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?T$(e,s,r):t==="style"?I$(e,n,s):Yu(t)?Up(t)||O$(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):H$(e,t,s,r))?(wb(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_b(e,t,s,r,i,t!=="value")):e._isVueCE&&(W$(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!kn(s)))?wb(e,hs(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),_b(e,t,s,r))};function H$(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&xb(t)&&Mt(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 xb(t)&&kn(n)?!1:t in e}function W$(e,t){const n=e._def.props;if(!n)return!1;const s=hs(t);return Array.isArray(n)?n.some(o=>hs(o)===s):Object.keys(n).some(o=>hs(o)===s)}const Ab={};function z$(e,t,n){let s=Ve(e,t);qp(s)&&(s=gn({},s,t));class o extends n0{constructor(r){super(s,r,n)}}return o.def=s,o}const Hpe=((e,t)=>z$(e,t,i6)),U$=typeof HTMLElement<"u"?HTMLElement:class{};class n0 extends U${constructor(t,n={},s=sp){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!==sp?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(gn({},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 n0){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let 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&&!kt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Bf(this._props[a])),(l||(l=Object.create(null)))[hs(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)on(this,s)||Object.defineProperty(this,s,{get:()=>A(n[s])})}_resolveProps(t){const{props:n}=t,s=kt(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(hs))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):Ab;const o=hs(t);n&&this._numberProps&&this._numberProps[o]&&(s=Bf(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===Ab?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(ro(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(ro(t),n+""):n||this.removeAttribute(ro(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),o6(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=oe(this._def,gn(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,qp(r[0])?gn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),ro(i)!==i&&o(ro(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 q$(e){const t=Ls(),n=t&&t.ce;return n||null}function Wpe(){const e=q$();return e&&e.shadowRoot}function zpe(e="$style"){{const t=Ls();if(!t)return Ut;const n=t.type.__cssModules;if(!n)return Ut;const s=n[e];return s||Ut}}const Ex=new WeakMap,Ix=new WeakMap,tp=Symbol("_moveCb"),Tb=Symbol("_enterCb"),j$=e=>(delete e.props.mode,e),V$=j$({name:"TransitionGroup",props:gn({},Cx,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ls(),s=HC();let o,i;return j1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!Q$(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(G$),o.forEach(Y$);const l=o.filter(X$);Av(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;wi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[tp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[tp]=null,Tr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Gt(e),l=xx(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),jr(u,xu(u,l,s,n)),Ex.set(u,$x(u.el)))}i=t.default?U1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&jr(u,xu(u,l,s,n))}return oe(a,null,i)}}}),K$=V$;function G$(e){const t=e.el;t[tp]&&t[tp](),t[Tb]&&t[Tb]()}function Y$(e){Ix.set(e,$x(e.el))}function X$(e){const t=Ex.get(e),n=Ix.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 $x(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Q$(e,t,n){const s=e.cloneNode(),o=e[ec];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}=Ax(s);return i.removeChild(s),r}const Gr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return kt(t)?n=>Fa(t,n):t};function Z$(e){e.target.composing=!0}function Mb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Yo=Symbol("_assign");function Eb(e,t,n){return t&&(e=e.trim()),n&&(e=Gp(e)),e}const mo={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[Yo]=Gr(o);const i=s||o.props&&o.props.type==="number";Ki(e,t?"change":"input",r=>{r.target.composing||e[Yo](Eb(e.value,n,i))}),(n||i)&&Ki(e,"change",()=>{e.value=Eb(e.value,n,i)}),t||(Ki(e,"compositionstart",Z$),Ki(e,"compositionend",Mb),Ki(e,"change",Mb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[Yo]=Gr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Gp(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)}},np={deep:!0,created(e,t,n){e[Yo]=Gr(n),Ki(e,"change",()=>{const s=e._modelValue,o=tc(e),i=e.checked,r=e[Yo];if(kt(s)){const l=Xp(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(Gl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(Lx(e,i))})},mounted:Ib,beforeUpdate(e,t,n){e[Yo]=Gr(n),Ib(e,t,n)}};function Ib(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(kt(t))o=Xp(t,s.props.value)>-1;else if(Gl(t))o=t.has(s.props.value);else{if(t===n)return;o=Ji(t,Lx(e,!0))}e.checked!==o&&(e.checked=o)}const Nx={created(e,{value:t},n){e.checked=Ji(t,n.props.value),e[Yo]=Gr(n),Ki(e,"change",()=>{e[Yo](tc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Yo]=Gr(s),t!==n&&(e.checked=Ji(t,s.props.value))}},Mv={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Gl(t);Ki(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Gp(tc(r)):tc(r));e[Yo](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[Yo]=Gr(s)},mounted(e,{value:t}){$b(e,t)},beforeUpdate(e,t,n){e[Yo]=Gr(n)},updated(e,{value:t}){e._assigning||$b(e,t)}};function $b(e,t){const n=e.multiple,s=kt(t);if(!(n&&!s&&!Gl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=tc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Xp(t,l)>-1}else r.selected=t.has(l);else if(Ji(tc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function tc(e){return"_value"in e?e._value:e.value}function Lx(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const J$={created(e,t,n){jd(e,t,n,null,"created")},mounted(e,t,n){jd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){jd(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){jd(e,t,n,s,"updated")}};function Ox(e,t){switch(e){case"SELECT":return Mv;case"TEXTAREA":return mo;default:switch(t){case"checkbox":return np;case"radio":return Nx;default:return mo}}}function jd(e,t,n,s,o){const r=Ox(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function e6(){mo.getSSRProps=({value:e})=>({value:e}),Nx.getSSRProps=({value:e},t)=>{if(t.props&&Ji(t.props.value,e))return{checked:!0}},np.getSSRProps=({value:e},t)=>{if(kt(e)){if(t.props&&Xp(e,t.props.value)>-1)return{checked:!0}}else if(Gl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},J$.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=Ox(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const t6=["ctrl","shift","alt","meta"],n6={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)=>t6.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=n6[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},s6={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},li=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=ro(o.key);if(t.some(r=>r===i||s6[r]===i))return e(o)}))},Px=gn({patchProp:F$},S$);let ru,Nb=!1;function Rx(){return ru||(ru=n$(Px))}function Dx(){return ru=Nb?ru:s$(Px),Nb=!0,ru}const o6=((...e)=>{Rx().render(...e)}),Upe=((...e)=>{Dx().hydrate(...e)}),sp=((...e)=>{const t=Rx().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Fx(s);if(!o)return;const i=t._component;!Mt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,Bx(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),i6=((...e)=>{const t=Dx().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Fx(s);if(o)return n(o,!0,Bx(o))},t});function Bx(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Fx(e){return kn(e)?document.querySelector(e):e}let Lb=!1;const qpe=()=>{Lb||(Lb=!0,e6(),M$())};/*!
21
- * shared v11.4.5
22
- * (c) 2026 kazuya kawaguchi
23
- * Released under the MIT License.
24
- */function r6(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const op=typeof window<"u",el=(e,t=!1)=>t?Symbol.for(e):Symbol(e),l6=(e,t,n)=>a6({l:e,k:t,s:n}),a6=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ls=e=>typeof e=="number"&&isFinite(e),Hx=e=>o0(e)==="[object Date]",nc=e=>o0(e)==="[object RegExp]",lh=e=>Vt(e)&&Object.keys(e).length===0,as=Object.assign,c6=Object.create,yn=(e=null)=>c6(e);let Ob;const Ll=()=>Ob||(Ob=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:yn());function Pb(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function u6(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const d6=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,f6=/^(?:href|src|action|formaction)$/i;function s0(e){return d6.test(e)}function p6(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+=s0(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function Rb(e,t){if(f6.test(e)&&s0(t))return"about:blank";const n=e.toLowerCase()==="style"?p6(t):t;return u6(n)}function h6(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${Rb(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${Rb(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>s0(o)?`${s}about:blank`:n),e}const m6=Object.prototype.hasOwnProperty;function Ko(e,t){return m6.call(e,t)}const Xn=Array.isArray,Bn=e=>typeof e=="function",ht=e=>typeof e=="string",en=e=>typeof e=="boolean",tn=e=>e!==null&&typeof e=="object",g6=e=>tn(e)&&Bn(e.then)&&Bn(e.catch),Wx=Object.prototype.toString,o0=e=>Wx.call(e),Vt=e=>o0(e)==="[object Object]",v6=e=>e==null?"":Xn(e)||Vt(e)&&e.toString===Wx?JSON.stringify(e,null,2):String(e);function i0(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Vd=e=>!tn(e)||Xn(e);function _f(e,t){if(Vd(e)||Vd(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__"&&(tn(s[i])&&!tn(o[i])&&(o[i]=Array.isArray(s[i])?[]:yn()),Vd(o[i])||Vd(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 y6(e,t,n){return{line:e,column:t,offset:n}}function Ev(e,t,n){return{start:e,end:t}}const cn={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},k6=17;function ah(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 b6(e){throw e}const bi=" ",_6="\r",Ps=`
29
- `,w6="\u2028",S6="\u2029";function C6(e){const t=e;let n=0,s=1,o=1,i=0;const r=$=>t[$]===_6&&t[$+1]===Ps,l=$=>t[$]===Ps,a=$=>t[$]===S6,c=$=>t[$]===w6,u=$=>r($)||l($)||a($)||c($),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=$=>r($)||a($)||c($)?Ps:t[$],b=()=>m(n),_=()=>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 C($=0){i=$}function L(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:b,currentPeek:_,next:g,peek:v,reset:y,resetPeek:C,skipToPeek:L}}const Fi=void 0,x6=".",Db="'",A6="tokenizer";function T6(e,t={}){const n=t.location!==!1,s=C6(e),o=()=>s.index(),i=()=>y6(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,G,re,...he){const Ce=c();if(G.column+=re,G.offset+=re,u){const Ee=n?Ev(Ce.startLoc,G):null,ae=ah(j,Ee,{domain:A6,args:he});u(ae)}}function f(j,G,re){j.endLoc=i(),j.currentType=G;const he={type:G};return n&&(he.loc=Ev(j.startLoc,j.endLoc)),re!=null&&(he.value=re),he}const h=j=>f(j,13);function p(j,G){return j.currentChar()===G?(j.next(),G):(d(cn.EXPECTED_TOKEN,i(),0,G),"")}function m(j){let G="";for(;j.currentPeek()===bi||j.currentPeek()===Ps;)G+=j.currentPeek(),j.peek();return G}function b(j){const G=m(j);return j.skipToPeek(),G}function _(j){if(j===Fi)return!1;const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G===95}function g(j){if(j===Fi)return!1;const G=j.charCodeAt(0);return G>=48&&G<=57}function v(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const he=_(j.currentPeek());return j.resetPeek(),he}function y(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const he=j.currentPeek()==="-"?j.peek():j.currentPeek(),Ce=g(he);return j.resetPeek(),Ce}function C(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const he=j.currentPeek()===Db;return j.resetPeek(),he}function L(j,G){const{currentType:re}=G;if(re!==7)return!1;m(j);const he=j.currentPeek()===".";return j.resetPeek(),he}function $(j,G){const{currentType:re}=G;if(re!==8)return!1;m(j);const he=_(j.currentPeek());return j.resetPeek(),he}function k(j,G){const{currentType:re}=G;if(!(re===7||re===11))return!1;m(j);const he=j.currentPeek()===":";return j.resetPeek(),he}function M(j,G){const{currentType:re}=G;if(re!==9)return!1;const he=()=>{const Ee=j.currentPeek();return Ee==="{"?_(j.peek()):Ee==="@"||Ee==="|"||Ee===":"||Ee==="."||Ee===bi||!Ee?!1:Ee===Ps?(j.peek(),he()):O(j,!1)},Ce=he();return j.resetPeek(),Ce}function E(j){m(j);const G=j.currentPeek()==="|";return j.resetPeek(),G}function O(j,G=!0){const re=(Ce=!1,Ee="")=>{const ae=j.currentPeek();return ae==="{"||ae==="@"||!ae?Ce:ae==="|"?!(Ee===bi||Ee===Ps):ae===bi?(j.peek(),re(!0,bi)):ae===Ps?(j.peek(),re(!0,Ps)):!0},he=re();return G&&j.resetPeek(),he}function S(j,G){const re=j.currentChar();return re===Fi?Fi:G(re)?(j.next(),re):null}function I(j){const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G>=48&&G<=57||G===95||G===36}function P(j){return S(j,I)}function D(j){const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G>=48&&G<=57||G===95||G===36||G===45}function H(j){return S(j,D)}function z(j){const G=j.charCodeAt(0);return G>=48&&G<=57}function U(j){return S(j,z)}function Q(j){const G=j.charCodeAt(0);return G>=48&&G<=57||G>=65&&G<=70||G>=97&&G<=102}function X(j){return S(j,Q)}function ue(j){let G="",re="";for(;G=U(j);)re+=G;return re}function me(j){let G="";for(;;){const re=j.currentChar();if(re==="\\"){const he=j.peek();he==="{"||he==="}"||he==="@"||he==="|"||he==="\\"?(G+=re+he,j.next(),j.next()):(j.resetPeek(),G+=re,j.next())}else{if(re==="{"||re==="}"||re==="@"||re==="|"||!re)break;if(re===bi||re===Ps)if(O(j))G+=re,j.next();else{if(E(j))break;G+=re,j.next()}else G+=re,j.next()}}return G}function Ae(j){b(j);let G="",re="";for(;G=H(j);)re+=G;const he=j.currentChar();if(he&&he!=="}"&&he!==Fi&&he!==bi&&he!==Ps&&he!==" "){const Ce=F(j);return d(cn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re+Ce),re+Ce}return j.currentChar()===Fi&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),re}function be(j){b(j);let G="";return j.currentChar()==="-"?(j.next(),G+=`-${ue(j)}`):G+=ue(j),j.currentChar()===Fi&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),G}function ze(j){return j!==Db&&j!==Ps}function qe(j){b(j),p(j,"'");let G="",re="";for(;G=S(j,ze);)G==="\\"?re+=Fe(j):re+=G;const he=j.currentChar();return he===Ps||he===Fi?(d(cn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),he===Ps&&(j.next(),p(j,"'")),re):(p(j,"'"),re)}function Fe(j){const G=j.currentChar();switch(G){case"\\":case"'":return j.next(),`\\${G}`;case"u":return Le(j,G,4);case"U":return Le(j,G,6);default:return d(cn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,G),""}}function Le(j,G,re){p(j,G);let he="";for(let Ce=0;Ce<re;Ce++){const Ee=X(j);if(!Ee){d(cn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${G}${he}${j.currentChar()}`);break}he+=Ee}return`\\${G}${he}`}function le(j){return j!=="{"&&j!=="}"&&j!==bi&&j!==Ps}function F(j){b(j);let G="",re="";for(;G=S(j,le);)re+=G;return re}function te(j){let G="",re="";for(;G=P(j);)re+=G;return re}function ee(j){const G=re=>{const he=j.currentChar();return he==="{"||he==="@"||he==="|"||he==="("||he===")"||!he||he===bi?re:(re+=he,j.next(),G(re))};return G("")}function q(j){b(j);const G=p(j,"|");return b(j),G}function Y(j,G){let re=null;switch(j.currentChar()){case"{":return G.braceNest>=1&&d(cn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),re=f(G,2,"{"),b(j),G.braceNest++,re;case"}":return G.braceNest>0&&G.currentType===2&&d(cn.EMPTY_PLACEHOLDER,i(),0),j.next(),re=f(G,3,"}"),G.braceNest--,G.braceNest>0&&b(j),G.inLinked&&G.braceNest===0&&(G.inLinked=!1),re;case"@":return G.braceNest>0&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),re=de(j,G)||h(G),G.braceNest=0,re;default:{let Ce=!0,Ee=!0,ae=!0;if(E(j))return G.braceNest>0&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),re=f(G,1,q(j)),G.braceNest=0,G.inLinked=!1,re;if(G.braceNest>0&&(G.currentType===4||G.currentType===5||G.currentType===6))return d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),G.braceNest=0,ne(j,G);if(Ce=v(j,G))return re=f(G,4,Ae(j)),b(j),re;if(Ee=y(j,G))return re=f(G,5,be(j)),b(j),re;if(ae=C(j,G))return re=f(G,6,qe(j)),b(j),re;if(!Ce&&!Ee&&!ae)return re=f(G,12,F(j)),d(cn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re.value),b(j),re;break}}return re}function de(j,G){const{currentType:re}=G;let he=null;const Ce=j.currentChar();switch((re===7||re===8||re===11||re===9)&&(Ce===Ps||Ce===bi)&&d(cn.INVALID_LINKED_FORMAT,i(),0),Ce){case"@":return j.next(),he=f(G,7,"@"),G.inLinked=!0,he;case".":return b(j),j.next(),f(G,8,".");case":":return b(j),j.next(),f(G,9,":");default:return E(j)?(he=f(G,1,q(j)),G.braceNest=0,G.inLinked=!1,he):L(j,G)||k(j,G)?(b(j),de(j,G)):$(j,G)?(b(j),f(G,11,te(j))):M(j,G)?(b(j),Ce==="{"?Y(j,G)||he:f(G,10,ee(j))):(re===7&&d(cn.INVALID_LINKED_FORMAT,i(),0),G.braceNest=0,G.inLinked=!1,ne(j,G))}}function ne(j,G){let re={type:13};if(G.braceNest>0)return Y(j,G)||h(G);if(G.inLinked)return de(j,G)||h(G);switch(j.currentChar()){case"{":return Y(j,G)||h(G);case"}":return d(cn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(G,3,"}");case"@":return de(j,G)||h(G);default:{if(E(j))return re=f(G,1,q(j)),G.braceNest=0,G.inLinked=!1,re;if(O(j))return f(G,0,me(j));break}}return re}function ce(){const{currentType:j,offset:G,startLoc:re,endLoc:he}=a;return a.lastType=j,a.lastOffset=G,a.lastStartLoc=re,a.lastEndLoc=he,a.offset=o(),a.startLoc=i(),s.currentChar()===Fi?f(a,13):ne(s,a)}return{nextToken:ce,currentOffset:o,currentPosition:i,context:c}}const M6="parser",E6=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,I6=/\\([\\@{}|])/g;function $6(e,t){return t}function N6(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 L6(e={}){const t=e.location!==!1,{onError:n}=e;function s(_,g,v,y,...C){const L=_.currentPosition();if(L.offset+=y,L.column+=y,n){const $=t?Ev(v,L):null,k=ah(g,$,{domain:M6,args:C});n(k)}}function o(_,g,v){const y={type:_};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(_,g,v,y){t&&(_.end=g,_.loc&&(_.loc.end=v))}function r(_,g){const v=_.context(),y=o(3,v.offset,v.startLoc);return y.value=g.replace(I6,$6),i(y,_.currentOffset(),_.currentPosition()),y}function l(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(5,y,C);return L.index=parseInt(g,10),_.nextToken(),i(L,_.currentOffset(),_.currentPosition()),L}function a(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(4,y,C);return L.key=g,_.nextToken(),i(L,_.currentOffset(),_.currentPosition()),L}function c(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(9,y,C);return L.value=g.replace(E6,N6),_.nextToken(),i(L,_.currentOffset(),_.currentPosition()),L}function u(_){const g=_.nextToken(),v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(8,y,C);return g.type!==11?(s(_,cn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),L.value="",i(L,y,C),{nextConsumeToken:g,node:L}):(g.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,_i(g)),L.value=g.value||"",i(L,_.currentOffset(),_.currentPosition()),{node:L})}function d(_,g){const v=_.context(),y=o(7,v.offset,v.startLoc);return y.value=g,i(y,_.currentOffset(),_.currentPosition()),y}function f(_){const g=_.context(),v=o(6,g.offset,g.startLoc);let y=_.nextToken();if(y.type===8){const C=u(_);v.modifier=C.node,y=C.nextConsumeToken||_.nextToken()}switch(y.type!==9&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),y=_.nextToken(),y.type===2&&(y=_.nextToken()),y.type){case 10:y.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=d(_,y.value||"");break;case 4:y.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=a(_,y.value||"");break;case 5:y.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=l(_,y.value||"");break;case 6:y.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=c(_,y.value||"");break;default:{s(_,cn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const C=_.context(),L=o(7,C.offset,C.startLoc);return L.value="",i(L,C.offset,C.startLoc),v.key=L,i(v,C.offset,C.startLoc),{nextConsumeToken:y,node:v}}}return i(v,_.currentOffset(),_.currentPosition()),{node:v}}function h(_){const g=_.context(),v=g.currentType===1?_.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,C=o(2,v,y);C.items=[];let L=null;do{const M=L||_.nextToken();switch(L=null,M.type){case 0:M.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(r(_,M.value||""));break;case 5:M.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(l(_,M.value||""));break;case 4:M.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(a(_,M.value||""));break;case 6:M.value==null&&s(_,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(c(_,M.value||""));break;case 7:{const E=f(_);C.items.push(E.node),L=E.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:_.currentOffset(),k=g.currentType===1?g.lastEndLoc:_.currentPosition();return i(C,$,k),C}function p(_,g,v,y){const C=_.context();let L=y.items.length===0;const $=o(1,g,v);$.cases=[],$.cases.push(y);do{const k=h(_);L||(L=k.items.length===0),$.cases.push(k)}while(C.currentType!==13);return L&&s(_,cn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i($,_.currentOffset(),_.currentPosition()),$}function m(_){const g=_.context(),{offset:v,startLoc:y}=g,C=h(_);return g.currentType===13?C:p(_,v,y,C)}function b(_){const g=T6(_,as({},e)),v=g.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=_),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(_)),v.currentType!==13&&s(g,cn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,_[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:b}}function _i(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 O6(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Bb(e,t){for(let n=0;n<e.length;n++)r0(e[n],t)}function r0(e,t){switch(e.type){case 1:Bb(e.cases,t),t.helper("plural");break;case 2:Bb(e.items,t);break;case 6:{r0(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 P6(e,t={}){const n=O6(e);n.helper("normalize"),e.body&&r0(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function R6(e){const t=e.body;return t.type===2?Fb(t):t.cases.forEach(n=>Fb(n)),e}function Fb(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=i0(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 xa(e){switch(e.t=e.type,e.type){case 0:{const t=e;xa(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++)xa(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++)xa(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;xa(t.key),t.k=t.key,delete t.key,t.modifier&&(xa(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 D6(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,b){r.code+=m}function c(m,b=!0){const _=b?s:"";a(o?_+" ".repeat(m):_)}function u(m=!0){const b=++r.indentLevel;m&&c(b)}function d(m=!0){const b=--r.indentLevel;m&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function B6(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),sc(e,t.key),t.modifier?(e.push(", "),sc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function F6(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&&(sc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function H6(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&&(sc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function W6(e,t){t.body?sc(e,t.body):e.push("null")}function sc(e,t){const{helper:n}=e;switch(t.type){case 0:W6(e,t);break;case 1:H6(e,t);break;case 2:F6(e,t);break;case 6:B6(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 z6=(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=D6(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${i0(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),sc(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 U6(e,t={}){const n=as({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=L6(n).parse(e);return s?(i&&R6(l),o&&xa(l),{ast:l,code:""}):(P6(l,n),z6(l,n))}/*!
31
- * core-base v11.4.5
32
- * (c) 2026 kazuya kawaguchi
33
- * Released under the MIT License.
34
- */function q6(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ll().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ll().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ei(e){return tn(e)&&l0(e)===0&&(Ko(e,"b")||Ko(e,"body"))}const zx=["b","body"];function j6(e){return tl(e,zx)}const Ux=["c","cases"];function V6(e){return tl(e,Ux,[])}const qx=["s","static"];function K6(e){return tl(e,qx)}const jx=["i","items"];function G6(e){return tl(e,jx,[])}const Vx=["t","type"];function l0(e){return tl(e,Vx)}const Kx=["v","value"];function Kd(e,t){const n=tl(e,Kx);if(n!=null)return n;throw Eu(t)}const Gx=["m","modifier"];function Y6(e){return tl(e,Gx)}const Yx=["k","key"];function X6(e){const t=tl(e,Yx);if(t)return t;throw Eu(6)}function tl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(Ko(e,o)&&e[o]!=null)return e[o]}return n}const Xx=[...zx,...Ux,...qx,...jx,...Yx,...Gx,...Kx,...Vx];function Eu(e){return new Error(`unhandled node type: ${e}`)}function Ym(e){return n=>Q6(n,e)}function Q6(e,t){const n=j6(t);if(n==null)throw Eu(0);if(l0(n)===1){const i=V6(n);return e.plural(i.reduce((r,l)=>[...r,Hb(e,l)],[]))}else return Hb(e,n)}function Hb(e,t){const n=K6(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=G6(t).reduce((o,i)=>[...o,Iv(e,i)],[]);return e.normalize(s)}}function Iv(e,t){const n=l0(t);switch(n){case 3:return Kd(t,n);case 9:return Kd(t,n);case 4:{const s=t;if(Ko(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(Ko(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Eu(n)}case 5:{const s=t;if(Ko(s,"i")&&ls(s.i))return e.interpolate(e.list(s.i));if(Ko(s,"index")&&ls(s.index))return e.interpolate(e.list(s.index));throw Eu(n)}case 6:{const s=t,o=Y6(s),i=X6(s);return e.linked(Iv(e,i),o?Iv(e,o):void 0,e.type)}case 7:return Kd(t,n);case 8:return Kd(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Z6=e=>e;let Gd=yn();function J6(e,t={}){let n=!1;const s=t.onError||b6;return t.onError=o=>{n=!0,s(o)},{...U6(e,t),detectError:n}}function eN(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&ht(e)){en(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||Z6)(e),o=Gd[s];if(o)return o;const{ast:i,detectError:r}=J6(e,{...t,location:!1,jit:!0}),l=Ym(i);return r?l:Gd[s]=l}else{const n=e.cacheKey;if(n){const s=Gd[n];return s||(Gd[n]=Ym(e))}else return Ym(e)}}let Iu=null;function tN(e){Iu=e}function nN(e,t,n){Iu&&Iu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const sN=oN("function:translate");function oN(e){return t=>Iu&&Iu.emit(e,t)}const Gi={INVALID_ARGUMENT:k6,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},iN=24;function Yi(e){return ah(e,null,void 0)}function a0(e,t){return t.locale!=null?Wb(t.locale):Wb(e.locale)}let Xm;function Wb(e){if(ht(e))return e;if(Bn(e)){if(e.resolvedOnce&&Xm!=null)return Xm;if(e.constructor.name==="Function"){const t=e();if(g6(t))throw Yi(Gi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Xm=t}else throw Yi(Gi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Yi(Gi.NOT_SUPPORT_LOCALE_TYPE)}function rN(e,t,n){return[...new Set([n,...Xn(t)?t:tn(t)?Object.keys(t):ht(t)?[t]:[n]])]}function $v(e,t,n){const s=ht(n)?n:$u,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Xn(r);)r=zb(i,r,t);const l=Xn(t)||!Vt(t)?t:t.default?t.default:null;r=ht(l)?[l]:l,Xn(r)&&zb(i,r,!1),o.__localeChainCache.set(s,i)}return i}function zb(e,t,n){let s=!0;for(let o=0;o<t.length&&en(s);o++){const i=t[o];ht(i)&&(s=lN(e,t[o],n))}return s}function lN(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=aN(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function aN(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),(Xn(n)||Vt(n))&&n[o]&&(s=n[o])}return s}const nl=[];nl[0]={w:[0],i:[3,0],"[":[4],o:[7]};nl[1]={w:[1],".":[2],"[":[4],o:[7]};nl[2]={w:[2],i:[3,0],0:[3,0]};nl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};nl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};nl[5]={"'":[4,0],o:8,l:[5,0]};nl[6]={'"':[4,0],o:8,l:[6,0]};const cN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function uN(e){return cN.test(e)}function dN(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 fN(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 pN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:uN(t)?dN(t):"*"+t}function hN(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=pN(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=fN(i),d=nl[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 Ub=new Map;function mN(e,t){return tn(e)?e[t]:null}function gN(e,t){if(!tn(e))return null;let n=Ub.get(t);if(n||(n=hN(t),n&&Ub.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(Xx.includes(r)&&Ei(o)||!tn(o)||!Ko(o,r))return null;const l=o[r];if(l===void 0||Bn(o))return null;o=l,i++}return o}const vN="11.4.5",ch=-1,$u="en-US",ip="",qb=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function yN(){return{upper:(e,t)=>t==="text"&&ht(e)?e.toUpperCase():t==="vnode"&&tn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&ht(e)?e.toLowerCase():t==="vnode"&&tn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&ht(e)?qb(e):t==="vnode"&&tn(e)&&"__v_isVNode"in e?qb(e.children):e}}let Qx;function kN(e){Qx=e}let Zx;function bN(e){Zx=e}let Jx;function _N(e){Jx=e}let eA=null;const wN=e=>{eA=e},SN=()=>eA;let tA=null;const jb=e=>{tA=e},CN=()=>tA;let Vb=0;function xN(e={}){const t=Bn(e.onWarn)?e.onWarn:r6,n=ht(e.version)?e.version:vN,s=ht(e.locale)||Bn(e.locale)?e.locale:$u,o=Bn(s)?$u:s,i=Xn(e.fallbackLocale)||Vt(e.fallbackLocale)||ht(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Vt(e.messages)?e.messages:Qm(o),l=Vt(e.datetimeFormats)?e.datetimeFormats:Qm(o),a=Vt(e.numberFormats)?e.numberFormats:Qm(o),c=as(yn(),e.modifiers,yN()),u=e.pluralRules||yn(),d=Bn(e.missing)?e.missing:null,f=en(e.missingWarn)||nc(e.missingWarn)?e.missingWarn:!0,h=en(e.fallbackWarn)||nc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,b=Bn(e.postTranslation)?e.postTranslation:null,_=Vt(e.processor)?e.processor:null,g=en(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Bn(e.messageCompiler)?e.messageCompiler:Qx,C=Bn(e.messageResolver)?e.messageResolver:Zx||mN,L=Bn(e.localeFallbacker)?e.localeFallbacker:Jx||rN,$=tn(e.fallbackContext)?e.fallbackContext:void 0,k=e,M=tn(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,E=tn(k.__numberFormatters)?k.__numberFormatters:new Map,O=tn(k.__meta)?k.__meta:{};Vb++;const S={version:n,cid:Vb,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:b,processor:_,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:C,localeFallbacker:L,fallbackContext:$,onWarn:t,__meta:O};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=M,S.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&nN(S,n,O),S}const Qm=e=>({[e]:yn()});function c0(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 Wc(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function AN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function TN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(AN(e,t[s]))return!0;return!1}function Kb(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!ht(t[0])&&!Hx(t[0])&&!ls(t[0]))return ip;const[a,c,u,d]=Nv(...t),f=en(u.missingWarn)?u.missingWarn:e.missingWarn;en(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=a0(e,u),m=r(e,o,p);if(!ht(a)||a===""){const L=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let b={},_,g=null;const v="datetime format";for(let L=0;L<m.length&&(_=m[L],b=n[_]||{},g=b[a],!Vt(g));L++)c0(e,a,_,f,v);if(!Vt(g)||!ht(_))return s?ch:a;let y=`${_}__${a}`;lh(d)||(y=`${y}__${JSON.stringify(d)}`);let C=l.get(y);return C||(C=new Intl.DateTimeFormat(_,as({},g,d)),l.set(y,C)),h?C.formatToParts(c):C.format(c)}const nA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Nv(...e){const[t,n,s,o]=e,i=yn();let r=yn(),l;if(ht(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Yi(Gi.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 Yi(Gi.INVALID_ISO_DATE_ARGUMENT)}}else if(Hx(t)){if(isNaN(t.getTime()))throw Yi(Gi.INVALID_DATE_ARGUMENT);l=t}else if(ls(t))l=t;else throw Yi(Gi.INVALID_ARGUMENT);return ht(n)?i.key=n:Vt(n)&&Object.keys(n).forEach(a=>{nA.includes(a)?r[a]=n[a]:i[a]=n[a]}),ht(s)?i.locale=s:Vt(s)&&(r=s),Vt(o)&&(r=o),[i.key||"",l,i,r]}function Gb(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Yb(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ls(t[0]))return ip;const[a,c,u,d]=Lv(...t),f=en(u.missingWarn)?u.missingWarn:e.missingWarn;en(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=a0(e,u),m=r(e,o,p);if(!ht(a)||a===""){const L=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let b={},_,g=null;const v="number format";for(let L=0;L<m.length&&(_=m[L],b=n[_]||{},g=b[a],!Vt(g));L++)c0(e,a,_,f,v);if(!Vt(g)||!ht(_))return s?ch:a;let y=`${_}__${a}`;lh(d)||(y=`${y}__${JSON.stringify(d)}`);let C=l.get(y);return C||(C=new Intl.NumberFormat(_,as({},g,d)),l.set(y,C)),h?C.formatToParts(c):C.format(c)}const sA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Lv(...e){const[t,n,s,o]=e,i=yn();let r=yn();if(!ls(t))throw Yi(Gi.INVALID_ARGUMENT);const l=t;return ht(n)?i.key=n:Vt(n)&&Object.keys(n).forEach(a=>{sA.includes(a)?r[a]=n[a]:i[a]=n[a]}),ht(s)?i.locale=s:Vt(s)&&(r=s),Vt(o)&&(r=o),[i.key||"",l,i,r]}function Xb(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const MN=e=>e,EN=e=>"",IN="text",$N=e=>e.length===0?"":i0(e),NN=v6;function Zm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function LN(e){const t=ls(e.pluralIndex)?e.pluralIndex:-1;return ls(e.named?.count)?e.named.count:ls(e.named?.n)?e.named.n:t}function ON(e={}){const t=e.locale,n=LN(e),s=ht(t)&&Bn(e.pluralRules?.[t])?e.pluralRules[t]:Zm,o=s===Zm?void 0:Zm,i=_=>_[s(n,_.length,o)],r=e.list||[],l=_=>r[_],a=e.named||yn();ls(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=_=>a[_];function u(_,g){const v=Bn(e.messages)?e.messages(_,!!g):tn(e.messages)?e.messages[_]:!1;return v||(e.parent?e.parent.message(_):EN)}const d=_=>e.modifiers?e.modifiers[_]:MN,f=Bn(e.processor?.normalize)?e.processor.normalize:$N,h=Bn(e.processor?.interpolate)?e.processor.interpolate:NN,p=ht(e.processor?.type)?e.processor.type:IN,b={list:l,named:c,plural:i,linked:(_,...g)=>{const[v,y]=g;let C="text",L="";g.length===1?tn(v)?(L=v.modifier||L,C=v.type||C):ht(v)&&(L=v||L):g.length===2&&(ht(v)&&(L=v||L),ht(y)&&(C=y||C));const $=u(_,!0)(b),k=$===""||$===void 0?_:$,M=C==="vnode"&&Xn(k)&&L?k[0]:k;return L?d(L)(M,C):M},message:u,type:p,interpolate:h,normalize:f,values:as(yn(),r,a)};return b}const Qb=()=>"",Uo=e=>Bn(e);function Zb(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Ov(...t),u=en(c.missingWarn)?c.missingWarn:e.missingWarn,d=en(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=en(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=ht(c.default)||en(c.default)?en(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(ht(p)||Bn(p)),b=a0(e,c);f&&PN(c);let[_,g,v]=h?[a,b,l[b]||yn()]:oA(e,a,b,r,d,u),y=_,C=a;if(!h&&!(ht(y)||Ei(y)||Uo(y))&&m&&(y=p,C=y),!h&&(!(ht(y)||Ei(y)||Uo(y))||!ht(g)))return o?ch:a;let L=!1;const $=()=>{L=!0},k=Uo(y)?y:iA(e,a,g,y,C,$);if(L)return y;const M=BN(e,g,v,c),E=ON(M),O=RN(e,k,E);let S=s?s(O,a):O;if(f&&ht(S)&&(S=h6(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:ht(a)?a:Uo(y)?y.key:"",locale:g||(Uo(y)?y.locale:""),format:ht(y)?y:Uo(y)?y.source:"",message:S};I.meta=as({},e.__meta,SN()||{}),sN(I)}return S}function PN(e){Xn(e.list)?e.list=e.list.map(t=>ht(t)?Pb(t):t):tn(e.named)&&Object.keys(e.named).forEach(t=>{ht(e.named[t])&&(e.named[t]=Pb(e.named[t]))})}function oA(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=yn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||yn(),(h=a(d,t))===null&&(h=d[t]),!(ht(h)||Ei(h)||Uo(h)));m++)if(!TN(f,u)){const b=c0(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function iA(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Uo(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,DN(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function RN(e,t,n){return t(n)}function Ov(...e){const[t,n,s]=e,o=yn();if(!ht(t)&&!ls(t)&&!Uo(t)&&!Ei(t))throw Yi(Gi.INVALID_ARGUMENT);const i=ls(t)?String(t):(Uo(t),t);return ls(n)?o.plural=n:ht(n)?o.default=n:Vt(n)&&!lh(n)?o.named=n:Xn(n)&&(o.list=n),ls(s)?o.plural=s:ht(s)?o.default=s:Vt(s)&&as(o,s),[i,o]}function DN(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>l6(t,n,r)}}function BN(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,,_]=oA(u||e,h,t,l,a,c);m=b??r(_,h)}if(ht(m)||Ei(m)){let b=!1;const g=iA(e,h,t,m,h,()=>{b=!0});return b?Qb:g}else return Uo(m)?m:Qb}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),ls(s.plural)&&(f.pluralIndex=s.plural),f}q6();/*!
35
- * vue-i18n v11.4.5
36
- * (c) 2026 kazuya kawaguchi
37
- * Released under the MIT License.
38
- */const FN="11.4.5";function HN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ll().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ll().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ll().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ll().__INTLIFY_PROD_DEVTOOLS__=!1)}const Ks={UNEXPECTED_RETURN_TYPE:iN,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 ao(e,...t){return ah(e,null,void 0)}const Pv=el("__translateVNode"),Rv=el("__datetimeParts"),Dv=el("__numberParts"),rA=el("__setPluralRules"),lA=el("__injectWithOption"),$a=el("__dispose");function Nu(e){if(!tn(e)||Ei(e))return e;for(const t in e)if(Ko(e,t))if(!t.includes("."))tn(e[t])&&Nu(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]]=yn()),!tn(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Ei(o)?Xx.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Ei(o)){const r=o[n[s]];tn(r)&&Nu(r)}}return e}function u0(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Vt(n)?n:Xn(s)?yn():{[e]:yn()};if(Xn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||yn(),_f(c,r[a])):_f(c,r)}else ht(l)&&_f(JSON.parse(l),r)}),o==null&&i)for(const l in r)Ko(r,l)&&Nu(r[l]);return r}function aA(e){return e.type}function cA(e,t,n){let s=tn(t.messages)?t.messages:yn();"__i18nGlobal"in n&&(s=u0(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(tn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(tn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Jb(e){return oe(Wr,null,e,0)}function Lu(){return Ls()}const e_="__INTLIFY_META__",t_=()=>[],WN=()=>!1;let n_=0;function s_(e){return((t,n,s,o)=>e(n,s,Lu()||void 0,o))}const zN=()=>{const e=Lu();let t=null;return e&&(t=aA(e)[e_])?{[e_]:t}:null};function rp(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=op?Z:Yl;let r=en(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:ht(e.locale)?e.locale:$u),a=i(t&&r?t.fallbackLocale.value:ht(e.fallbackLocale)||Xn(e.fallbackLocale)||Vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(u0(l.value,e)),u=i(Vt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Vt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:en(e.missingWarn)||nc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:en(e.fallbackWarn)||nc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:en(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,b=Bn(e.missing)?e.missing:null,_=Bn(e.missing)?s_(e.missing):null,g=Bn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:en(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const C=t?t.modifiers:Vt(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&jb(null);const ae={version:FN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:C,pluralRules:L,missing:_===null?void 0:_,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"}};ae.datetimeFormats=u.value,ae.numberFormats=d.value,ae.__datetimeFormatters=Vt($)?$.__datetimeFormatters:void 0,ae.__numberFormatters=Vt($)?$.__numberFormatters:void 0;const xe=xN(ae);return s&&jb(xe),xe})(),Wc($,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const E=W({get:()=>l.value,set:ae=>{$.locale=ae,l.value=ae}}),O=W({get:()=>a.value,set:ae=>{$.fallbackLocale=ae,a.value=ae,Wc($,l.value,ae)}}),S=W(()=>c.value),I=W(()=>u.value),P=W(()=>d.value);function D(){return Bn(g)?g:null}function H(ae){g=ae,$.postTranslation=ae}function z(){return b}function U(ae){ae!==null&&(_=s_(ae)),b=ae,$.missing=_}const Q=(ae,xe,Ke,st,_t,wt)=>{M();let Et;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?CN():void 0),Et=ae($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Ke!=="translate exists"&&ls(Et)&&Et===ch||Ke==="translate exists"&&!Et){const[Ot,bt]=xe();return t&&p?st(t):_t(Ot)}else{if(wt(Et))return Et;throw ao(Ks.UNEXPECTED_RETURN_TYPE)}};function X(...ae){return Q(xe=>Reflect.apply(Zb,null,[xe,...ae]),()=>Ov(...ae),"translate",xe=>Reflect.apply(xe.t,xe,[...ae]),xe=>xe,xe=>ht(xe))}function ue(...ae){const[xe,Ke,st]=ae;if(st&&!tn(st))throw ao(Ks.INVALID_ARGUMENT);return X(xe,Ke,as({resolvedMessage:!0},st||{}))}function me(...ae){return Q(xe=>Reflect.apply(Kb,null,[xe,...ae]),()=>Nv(...ae),"datetime format",xe=>Reflect.apply(xe.d,xe,[...ae]),()=>ip,xe=>ht(xe)||Xn(xe))}function Ae(...ae){return Q(xe=>Reflect.apply(Yb,null,[xe,...ae]),()=>Lv(...ae),"number format",xe=>Reflect.apply(xe.n,xe,[...ae]),()=>ip,xe=>ht(xe)||Xn(xe))}function be(ae){return ae.map(xe=>ht(xe)||ls(xe)||en(xe)?Jb(String(xe)):xe)}const qe={normalize:be,interpolate:ae=>ae,type:"vnode"};function Fe(...ae){return Q(xe=>{let Ke;const st=xe;try{st.processor=qe,Ke=Reflect.apply(Zb,null,[st,...ae])}finally{st.processor=null}return Ke},()=>Ov(...ae),"translate",xe=>xe[Pv](...ae),xe=>[Jb(xe)],xe=>Xn(xe))}function Le(...ae){return Q(xe=>Reflect.apply(Yb,null,[xe,...ae]),()=>Lv(...ae),"number format",xe=>xe[Dv](...ae),t_,xe=>ht(xe)||Xn(xe))}function le(...ae){return Q(xe=>Reflect.apply(Kb,null,[xe,...ae]),()=>Nv(...ae),"datetime format",xe=>xe[Rv](...ae),t_,xe=>ht(xe)||Xn(xe))}function F(ae){L=ae,$.pluralRules=L}function te(ae,xe){return Q(()=>{if(!ae)return!1;const Ke=ht(xe)?xe:l.value,st=ht(xe)?[Ke]:$v($,a.value,Ke);for(let _t=0;_t<st.length;_t++){const wt=Y(st[_t]);let Et=$.messageResolver(wt,ae);if(Et===null&&(Et=wt[ae]),Ei(Et)||Uo(Et)||ht(Et))return!0}return!1},()=>[ae],"translate exists",Ke=>Reflect.apply(Ke.te,Ke,[ae,xe]),WN,Ke=>en(Ke))}function ee(ae){let xe=null;const Ke=$v($,a.value,l.value);for(let st=0;st<Ke.length;st++){const _t=c.value[Ke[st]]||{},wt=$.messageResolver(_t,ae);if(wt!=null){xe=wt;break}}return xe}function q(ae){const xe=ee(ae);return xe??(t?t.tm(ae)||{}:{})}function Y(ae){return c.value[ae]||{}}function de(ae,xe){if(o){const Ke={[ae]:xe};for(const st in Ke)Ko(Ke,st)&&Nu(Ke[st]);xe=Ke[ae]}c.value[ae]=xe,$.messages=c.value}function ne(ae,xe){c.value[ae]=c.value[ae]||{};const Ke={[ae]:xe};if(o)for(const st in Ke)Ko(Ke,st)&&Nu(Ke[st]);xe=Ke[ae],_f(xe,c.value[ae]),$.messages=c.value}function ce(ae){return u.value[ae]||{}}function j(ae,xe){u.value[ae]=xe,$.datetimeFormats=u.value,Gb($,ae,xe)}function G(ae,xe){u.value[ae]=as(u.value[ae]||{},xe),$.datetimeFormats=u.value,Gb($,ae,xe)}function re(ae){return d.value[ae]||{}}function he(ae,xe){d.value[ae]=xe,$.numberFormats=d.value,Xb($,ae,xe)}function Ce(ae,xe){d.value[ae]=as(d.value[ae]||{},xe),$.numberFormats=d.value,Xb($,ae,xe)}n_++,t&&op&&(Ye(t.locale,ae=>{r&&(l.value=ae,$.locale=ae,Wc($,l.value,a.value))}),Ye(t.fallbackLocale,ae=>{r&&(a.value=ae,$.fallbackLocale=ae,Wc($,l.value,a.value))}));const Ee={id:n_,locale:E,fallbackLocale:O,get inheritLocale(){return r},set inheritLocale(ae){r=ae,ae&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Wc($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return C},get pluralRules(){return L||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(ae){f=ae,$.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ae){h=ae,$.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ae){p=ae},get fallbackFormat(){return m},set fallbackFormat(ae){m=ae,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ae){v=ae,$.warnHtmlMessage=ae},get escapeParameter(){return y},set escapeParameter(ae){y=ae,$.escapeParameter=ae},t:X,getLocaleMessage:Y,setLocaleMessage:de,mergeLocaleMessage:ne,getPostTranslationHandler:D,setPostTranslationHandler:H,getMissingHandler:z,setMissingHandler:U,[rA]:F};return Ee.datetimeFormats=I,Ee.numberFormats=P,Ee.rt=ue,Ee.te=te,Ee.tm=q,Ee.d=me,Ee.n=Ae,Ee.getDateTimeFormat=ce,Ee.setDateTimeFormat=j,Ee.mergeDateTimeFormat=G,Ee.getNumberFormat=re,Ee.setNumberFormat=he,Ee.mergeNumberFormat=Ce,Ee[lA]=n,Ee[Pv]=Fe,Ee[Rv]=le,Ee[Dv]=Le,Ee}function UN(e){const t=ht(e.locale)?e.locale:$u,n=ht(e.fallbackLocale)||Xn(e.fallbackLocale)||Vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Bn(e.missing)?e.missing:void 0,o=en(e.silentTranslationWarn)||nc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=en(e.silentFallbackWarn)||nc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=en(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Vt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Bn(e.postTranslation)?e.postTranslation:void 0,d=ht(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=en(e.sync)?e.sync:!0;let p=e.messages;if(Vt(e.sharedMessages)){const C=e.sharedMessages;p=Object.keys(C).reduce(($,k)=>{const M=$[k]||($[k]={});return as(M,C[k]),$},p||{})}const{__i18n:m,__root:b,__injectWithOption:_}=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:b,__injectWithOption:_}}function Bv(e={}){const t=rp(UN(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 en(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=en(o)?!o:o},get silentFallbackWarn(){return en(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=en(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 qN(e,t,n){return{beforeCreate(){const s=Lu();if(!s)throw ao(Ks.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=o_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Bv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=o_(e,o);else{this.$i18n=Bv({__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&&cA(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=Lu();if(!s)throw ao(Ks.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 o_(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[rA](t.pluralizationRules||e.pluralizationRules);const n=u0(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 d0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function jN({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},yn())}function uA(){return Oe}const VN=Ve({name:"i18n-t",props:as({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ls(e)||!isNaN(e)}},d0),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=yn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=ht(e.plural)?+e.plural:e.plural);const u=jN(t,a);return o[Pv](e.keypath,u,c)},r=as(yn(),s),l=ht(e.tag)||tn(e.tag)?e.tag:uA();return tn(l)?un(l,r,{default:i}):un(l,r,i())}}}),i_=VN;function KN(e){return Xn(e)&&!ht(e[0])}function dA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=yn();e.locale&&(c.locale=e.locale),ht(e.format)?c.key=e.format:tn(e.format)&&(ht(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?as(yn(),h,{[p]:e.format[p]}):h,yn()));const d=s(e.value,c,u);let f=[c.key];return Xn(d)?f=d.map((h,p)=>{const m=o[h.type],b=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return KN(b)&&(b[0].key=`${h.type}-${p}`),b}):ht(d)&&(f=[d]),f},l=as(yn(),i),a=ht(e.tag)||tn(e.tag)?e.tag:uA();return tn(a)?un(a,l,{default:r}):un(a,l,r())}}const GN=Ve({name:"i18n-n",props:as({value:{type:Number,required:!0},format:{type:[String,Object]}},d0),setup(e,t){const n=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return dA(e,t,sA,(...s)=>n[Dv](...s))}}),r_=GN;function YN(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 XN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw ao(Ks.UNEXPECTED_ERROR);const c=YN(e,l.$),u=l_(a);return[Reflect.apply(c.t,c,[...a_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);op&&(r.__i18nWatcher=Ye(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{op&&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=l_(l);r.textContent=Reflect.apply(a.t,a,[...a_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function l_(e){if(ht(e))return{path:e};if(Vt(e)){if(!("path"in e))throw ao(Ks.REQUIRED_VALUE,"path");return e}else throw ao(Ks.INVALID_VALUE)}function a_(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return ht(n)&&(r.locale=n),ls(o)&&(r.plural=o),ls(i)&&(r.plural=i),[t,l,r]}function QN(e,t,...n){const s=Vt(n[0])?n[0]:{};(en(s.globalInstall)?s.globalInstall:!0)&&([i_.name,"I18nT"].forEach(i=>e.component(i,i_)),[r_.name,"I18nN"].forEach(i=>e.component(i,r_)),[d_.name,"I18nD"].forEach(i=>e.component(i,d_))),e.directive("t",XN(t))}const ZN=el("global-vue-i18n");function JN(e={}){const t=__VUE_I18N_LEGACY_API__&&en(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=en(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=e5(e,t),r=el("");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),Vt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=l5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&QN(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(qN(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 Nt(e={}){const t=Lu();if(t==null)throw ao(Ks.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw ao(Ks.NOT_INSTALLED);const n=t5(t),s=s5(n),o=aA(t),i=n5(e,o);if(i==="global")return cA(s,e,o),s;if(i==="parent"){let a=c_(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw ao(Ks.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=as({},e),u=c_(n,t);c.__root=u||s;const d=rp(c);return a.__composerExtend&&(d[$a]=a.__composerExtend(d)),D1()&&B1(()=>{const h=d[$a];h&&(h(),delete d[$a])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=as({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=rp(a),r.__composerExtend&&(l[$a]=r.__composerExtend(l)),i5(r,t,l),r.__setInstance(t,l)}return l}function e5(e,t){const n=AE(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Bv(e)):n.run(()=>rp(e));if(s==null)throw ao(Ks.UNEXPECTED_ERROR);return[n,s]}function t5(e){const t=qt(e.isCE?ZN:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw ao(e.isCE?Ks.NOT_INSTALLED_WITH_PROVIDE:Ks.UNEXPECTED_ERROR);return t}function n5(e,t){return lh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function s5(e){return e.mode==="composition"?e.global:e.global.__composer}function c_(e,t,n=!1){let s=null;const o=t.root;let i=o5(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[lA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function o5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function i5(e,t,n){bn(()=>{},t),_n(()=>{const s=n;e.__deleteInstance(t);const o=s[$a];o&&(o(),delete s[$a])},t)}const r5=["locale","fallbackLocale","availableLocales"],u_=["t","rt","d","n","tm","te"];function l5(e,t){const n=Object.create(null);return r5.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw ao(Ks.UNEXPECTED_ERROR);const r=Jn(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,u_.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw ao(Ks.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,u_.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const a5=Ve({name:"i18n-d",props:as({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},d0),setup(e,t){const n=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return dA(e,t,nA,(...s)=>n[Rv](...s))}}),d_=a5;HN();kN(eN);bN(gN);_N($v);if(__INTLIFY_PROD_DEVTOOLS__){const e=Ll();e.__INTLIFY__=!0,tN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const $t={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",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 f_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function Zn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function es(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function oc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function td(e){const t=Zn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function fc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function f0(){const e=Zn($t.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 p0(e){const n={...f0()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];es($t.unread,JSON.stringify(n))}function c5(){const e=td($t.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Jm(e){fc($t.collapsedWorkspaces,Array.from(e))}function u5(){return td($t.showWorkspacePaths)===!0}function d5(e){fc($t.showWorkspacePaths,e)}function f5(){const e=td($t.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function fA(e){fc($t.workspaceOrder,Array.from(e))}function Yd(){const e=td($t.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 p_(e){fc($t.workspaceNameOverrides,e)}function p5(){return Zn($t.workspaceSort)}function pA(e){es($t.workspaceSort,e)}const h_=$t.clientId,h5="kimi-code-web",m5="web";function g5(){return{serverHttpUrl:y5(),clientId:w5(),clientName:h5,clientVersion:S5(),clientUiMode:m5}}function v5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function y5(e){const t=v5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function k5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function b5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return k5(e)}function lp(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function _5(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 w5(){const e=Zn(h_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return es(h_,t),t}function S5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function Hs(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 C5(e)}function C5(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 x5(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 A5(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 T5(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 M5(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const E5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function m_(e){return e.replace(/[&<>"']/g,t=>E5[t]??t)}function I5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $5(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 g_(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return g_(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 g_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function eg(e,t){const n=m_(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(I5(m_(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const Aa=Z(0),N5=["type","disabled","aria-label"],L5=Ve({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Z();return t({el:n}),(s,o)=>(w(),N("button",{ref_key:"el",ref:n,class:De(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[xn(s.$slots,"default",{},void 0,!0)],10,N5))}}),ft=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},mn=ft(L5,[["__scopeId","data-v-321e56e3"]]),O5=Object.freeze({left:0,top:0,width:16,height:16}),hA=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),mA=Object.freeze({...O5,...hA}),jpe=Object.freeze({...mA,body:"",hidden:!1}),P5=Object.freeze({width:null,height:null}),R5=Object.freeze({...P5,...hA}),D5=/(-?[0-9.]*[0-9]+[0-9.]*)/g,B5=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function v_(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(D5);if(s===null||!s.length)return e;const o=[];let i=s.shift(),r=B5.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 F5(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 H5(e,t){return e?"<defs>"+e+"</defs>"+t:t}function W5(e,t,n){const s=F5(e);return H5(s.defs,t+s.content+n)}const z5=e=>e==="unset"||e==="undefined"||e==="none";function U5(e,t){const n={...mA,...e},s={...R5,...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;_?g?v+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):g&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.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,b.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,b.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)),b.length&&(i=W5(i,'<g transform="'+b.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=v_(d,a/c)):(u=r==="auto"?a:r,d=l===null?v_(u,c/a):l==="auto"?c:l);const f={},h=(m,b)=>{z5(b)||(f[m]=b.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 gA={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},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}},vA={sm:14,md:16,lg:20};function q5(e){return`0 0 ${e.width??24} ${e.height??24}`}const j5=Object.fromEntries(Object.entries(gA).map(([e,t])=>[e,{body:t.body,viewBox:q5(t),fill:!0}]));function V5(e){return j5[e]}function Ta(e,t="md"){const n=vA[t],s=U5(gA[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 K5=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],G5=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Je=Ve({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=W(()=>V5(t.name)),s=W(()=>vA[t.size]),o=W(()=>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,K5)):(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,G5))}}),Y5={key:0,class:"ui-dialog__head"},X5={class:"ui-dialog__titles"},Q5={key:0,class:"ui-dialog__title"},Z5={key:1,class:"ui-dialog__desc"},J5={class:"ui-dialog__body"},e8={key:1,class:"ui-dialog__foot"},t8='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',n8=Ve({__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=Z(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(t8)):[]}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 Ye(()=>n.open,async u=>{u?(Aa.value+=1,i=document.activeElement,await gt(),(l()[0]??o.value)?.focus()):(Aa.value=Math.max(0,Aa.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),ms(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&(Aa.value=Math.max(0,Aa.value-1))}),(u,d)=>(w(),ge(sh,{to:"body"},[e.open?(w(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[T("div",{ref_key:"panel",ref:o,class:De(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||u.$slots.head?(w(),N("div",Y5,[xn(u.$slots,"head",{},()=>[T("div",X5,[e.title?(w(),N("div",Q5,R(e.title),1)):ie("",!0),e.description?(w(),N("div",Z5,R(e.description),1)):ie("",!0)])],!0),oe(mn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:ke(()=>[oe(Je,{name:"close",size:"md"})]),_:1})])):ie("",!0),T("div",J5,[xn(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),N("div",e8,[xn(u.$slots,"foot",{},void 0,!0)])):ie("",!0)],2)],32)):ie("",!0)]))}}),rr=ft(n8,[["__scopeId","data-v-7904ff48"]]),s8={class:"sd-head"},o8=["placeholder","aria-label"],i8=["aria-selected","onClick","onMousemove"],r8={class:"sd-meta"},l8=["innerHTML"],a8={class:"sd-time"},c8=["innerHTML"],u8=["innerHTML"],d8={key:1,class:"sd-empty"},f8={class:"sd-hint"},p8=200,h8=Ve({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=Z(!0),r=Z(""),l=Z(null),a=Z(null),c=W(()=>{const _=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",C=v.lastPrompt??"",L=v.workspaceName??"",$=_.length>0&&y.toLowerCase().includes(_),k=_.length>0&&C.toLowerCase().includes(_),M=_.length>0&&L.toLowerCase().includes(_);if(!(_.length>0&&!$&&!k&&!M)&&(g.push({session:v,inTitle:$,inWorkspace:M,snippetText:C?$5(C,r.value):""}),g.length>=p8))break}return g}),u=Z(0);Ye(r,()=>{u.value=0});function d(_){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,_))}async function f(){await gt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(_){u.value=d(u.value+_),f()}function p(_){o("select",_),o("close")}function m(){const _=c.value[u.value];_&&p(_.session.id)}function b(_){_.key==="ArrowDown"?(_.preventDefault(),h(1)):_.key==="ArrowUp"?(_.preventDefault(),h(-1)):_.key==="Enter"&&(_.preventDefault(),m())}return bn(()=>{l.value?.focus()}),(_,g)=>(w(),ge(rr,{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:ke(()=>[T("div",s8,[oe(Je,{class:"sd-search-icon",name:"search",size:"md"}),In(T("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:A(n)("sidebar.searchPlaceholder"),"aria-label":A(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,o8),[[mo,r.value]])])]),foot:ke(()=>[T("span",f8,R(A(n)("sidebar.searchHint")),1)]),default:ke(()=>[T("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),N(Oe,{key:0},ot(c.value,(v,y)=>(w(),N("button",{key:v.session.id,class:De(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:C=>p(v.session.id),onMousemove:C=>u.value=y},[T("span",r8,[oe(Je,{class:"sd-folder",name:"folder-closed",size:"sm"}),T("span",{class:"sd-ws",innerHTML:A(eg)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,l8),T("span",a8,R(v.session.time),1)]),T("span",{class:"sd-title",innerHTML:A(eg)(v.session.title,v.inTitle?r.value:"")},null,8,c8),v.snippetText?(w(),N("span",{key:0,class:"sd-snippet",innerHTML:A(eg)(v.snippetText,r.value)},null,8,u8)):ie("",!0)],42,i8))),128)):(w(),N("div",d8,R(A(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),m8=ft(h8,[["__scopeId","data-v-a678f802"]]),g8=["aria-label"],v8=Ve({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),N("span",{class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[T("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[T("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),T("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,g8))}}),Zo=ft(v8,[["__scopeId","data-v-e5c5b17d"]]),y8={key:0,class:"ui-badge__dot","aria-hidden":"true"},k8=Ve({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),N("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),N("span",y8)):ie("",!0),xn(t.$slots,"default",{},void 0,!0)],2))}}),Is=ft(k8,[["__scopeId","data-v-5bc5cd6d"]]),Ou=Z(null);function yA(e){const t=Ou.value;t&&(Ou.value=null,t.resolve(e))}function b8(e){return Ou.value&&yA(!1),new Promise(t=>{Ou.value={...e,resolve:t}})}function sl(){return{current:Ou,confirm:b8,settle:yA}}const _8=Ve({__name:"Menu",setup(e,{expose:t}){const n=Z();return t({el:n}),(s,o)=>(w(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[xn(s.$slots,"default",{},void 0,!0)],512))}}),Fl=ft(_8,[["__scopeId","data-v-60e6cd8d"]]),w8={key:0,class:"ui-menu-sep",role:"separator"},S8=["disabled"],C8=Ve({__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",w8)):(w(),N("button",{key:1,class:De(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[xn(t.$slots,"default",{},void 0,!0)],10,S8))}}),hn=ft(C8,[["__scopeId","data-v-eab8e277"]]),yr=6,kr=8,x8=150,A8=Ve({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Z(),s=Z(),o=Z(!1),i=Z(!1),r=Z({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const b=a.getBoundingClientRect(),_=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let C=t.placement;C==="top"&&b.top-yr-g<kr?C="bottom":C==="bottom"&&b.bottom+yr+g>y-kr?C="top":C==="left"&&b.left-yr-_<kr?C="right":C==="right"&&b.right+yr+_>v-kr&&(C="left");let L=0,$=0;C==="top"?(L=b.top-yr-g,$=b.left+b.width/2-_/2):C==="bottom"?(L=b.bottom+yr,$=b.left+b.width/2-_/2):C==="left"?(L=b.top+b.height/2-g/2,$=b.left-yr-_):(L=b.top+b.height/2-g/2,$=b.right+yr),$=Math.min(Math.max($,kr),v-kr-_),L=Math.min(Math.max(L,kr),y-kr-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,gt(()=>{u(),i.value=!0})},x8))}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 bn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const b=m.firstElementChild??null;b!==a&&(f(),p(b??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ms(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,b)=>(w(),N(Oe,null,[T("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[xn(m.$slots,"default",{},void 0,!0)],512),(w(),ge(sh,{to:"body"},[In(T("div",{ref_key:"bubble",ref:s,class:De(["ui-tip__bubble",{positioned:i.value}]),style:Yt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[Vo,o.value]])]))],64))}}),Wt=ft(A8,[["__scopeId","data-v-4c261eb6"]]),T8={class:"row"},M8={class:"lead","aria-hidden":"true"},E8={key:1,class:"unread-dot"},I8={class:"left"},$8=["onKeydown"],N8={class:"act"},L8={class:"ts"},O8={class:"menu-time"},P8=Ve({__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}=Nt(),{confirm:o}=sl(),i=e,r=n;function l(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const P=D=>String(D).padStart(2,"0");return`${I.getFullYear()}-${P(I.getMonth()+1)}-${P(I.getDate())} ${P(I.getHours())}:${P(I.getMinutes())}`}const a=W(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Z(!1),u=Z(null),d=Z(null),f=Z({});function h(S){const I=S.target;d.value?.el?.contains(I)||u.value?.el?.contains(I)||b()}function p(){const S=u.value?.el;if(!S)return;const I=d.value?.el,P=S.getBoundingClientRect(),D=4,H=8,z=I?.offsetHeight??0,U=I?.offsetWidth??0;let Q=P.bottom+D;Q+z>window.innerHeight-H&&(Q=Math.max(H,P.top-z-D));let X=P.right-U;X<H&&(X=H),f.value={top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`}}async function m(S){if(S.stopPropagation(),c.value){b();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",b),await gt(),p()}function b(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)}_n(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)});const _=Z(!1),g=Z(""),v=Z(null);async function y(){b(),_.value=!0,g.value=i.session.title,await gt();try{v.value?.focus(),v.value?.select()}catch{}}function C(){const S=g.value.trim();S&&r("rename",i.session.id,S),_.value=!1}function L(){_.value=!1}const $=Z(!1),k=Z(!1);async function M(){const S=await Hs(i.session.id);$.value=S,k.value=!S,setTimeout(()=>{$.value=!1,k.value=!1,b()},1500)}function E(){b(),r("fork",i.session.id)}async function O(){b(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:b}),(S,I)=>(w(),N("div",{class:De(["se",{on:e.active}]),onClick:I[4]||(I[4]=P=>r("select",e.session.id))},[T("div",T8,[T("span",M8,[e.session.busy?(w(),ge(Zo,{key:0,size:"sm"})):e.unread?(w(),N("span",E8)):ie("",!0)]),T("div",I8,[_.value?In((w(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":I[0]||(I[0]=P=>g.value=P),class:"rename-input",onClick:I[1]||(I[1]=vt(()=>{},["stop"])),onKeydown:[li(vt(C,["stop"]),["enter"]),li(vt(L,["stop"]),["esc"])],onBlur:C},null,40,$8)),[[mo,g.value]]):(w(),N("span",{key:1,class:"t",onDblclick:vt(y,["stop"])},R(e.session.title),33))]),oe(Wt,{text:A(s)("workspace.awaitingAnswerTitle")},{default:ke(()=>[!_.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ge(Is,{key:0,variant:"info",size:"sm"},{default:ke(()=>[je(R(A(s)("workspace.awaitingAnswer")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),oe(Wt,{text:A(s)("workspace.awaitingPermissionTitle")},{default:ke(()=>[!_.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ge(Is,{key:0,variant:"warning",size:"sm"},{default:ke(()=>[je(R(A(s)("workspace.awaitingPermission")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),oe(Wt,{text:A(s)("workspace.abortedTitle")},{default:ke(()=>[!_.value&&e.session.status==="aborted"?(w(),ge(Is,{key:0,variant:"danger",size:"sm"},{default:ke(()=>[je(R(A(s)("workspace.aborted")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),T("span",N8,[T("span",L8,R(e.session.time),1),_.value?ie("",!0):(w(),ge(mn,{key:0,ref_key:"kebabRef",ref:u,class:De(["kebab",{open:c.value}]),size:"sm",label:A(s)("sidebar.options"),onClick:I[2]||(I[2]=vt(P=>m(P),["stop"]))},{default:ke(()=>[oe(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(w(),ge(sh,{to:"body"},[c.value?(w(),ge(Fl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Yt(f.value),onClick:I[3]||(I[3]=vt(()=>{},["stop"]))},{default:ke(()=>[oe(hn,{danger:k.value,onClick:M},{default:ke(()=>[je(R(k.value?A(s)("sidebar.copyFailed"):$.value?A(s)("sidebar.copied"):A(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),oe(hn,{separator:""}),oe(hn,{onClick:y},{default:ke(()=>[je(R(A(s)("sidebar.rename")),1)]),_:1}),oe(hn,{onClick:E},{default:ke(()=>[je(R(A(s)("sidebar.fork")),1)]),_:1}),oe(hn,{danger:"",onClick:O},{default:ke(()=>[je(R(A(s)("sidebar.archive")),1)]),_:1}),oe(hn,{separator:""}),T("div",O8,R(a.value),1)]),_:1},8,["style"])):ie("",!0)]))],2))}}),R8=ft(P8,[["__scopeId","data-v-be68e943"]]),D8={class:"gh-top"},B8={key:2,class:"gh-name"},F8={class:"gh-path"},H8=["inert"],W8=["disabled"],z8={class:"show-more-label"},U8={class:"show-more-label"},q8={key:2,class:"group-empty"},j8=Ve({__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}=Nt(),s=e,o=t,i=W({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=W(()=>{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=W(()=>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:De(["group",{dragging:e.dragging}])},[T("div",{class:De(["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"))},[T("div",D8,[e.isCollapsed(e.group.workspace.id)?(w(),ge(Je,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ge(Je,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),N("span",B8,R(e.group.workspace.name),1)):In((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]=li(p=>o("confirmRename"),["enter"])),h[2]||(h[2]=li(p=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>o("cancelRename")),onClick:h[4]||(h[4]=vt(()=>{},["stop"]))},null,544)),[[mo,i.value]]),oe(mn,{class:De(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:A(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:ke(()=>[oe(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),oe(mn,{class:"gh-add",size:"sm",label:A(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=vt(p=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:ke(()=>[oe(Je,{name:"chat-new"})]),_:1},8,["label"])]),oe(Wt,{text:e.group.workspace.root},{default:ke(()=>[T("div",F8,R(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),T("div",{class:De(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),N(Oe,null,ot(r.value,p=>(w(),ge(R8,{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,b)=>o("renameSession",m,b)),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]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",z8,R(e.group.loadingMore?A(n)("sidebar.loadingMore"):A(n)("sidebar.showMore",{count:a()})),1)],8,W8)):ie("",!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]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",U8,R(e.isExpanded(e.group.workspace.id)?A(n)("sidebar.showLess"):A(n)("sidebar.showAll",{count:c()})),1)])):ie("",!0),e.group.sessions.length===0?(w(),N("div",q8,R(A(n)("sidebar.noSessions")),1)):ie("",!0)],10,H8)],2))}}),V8=ft(j8,[["__scopeId","data-v-81fdc08d"]]),K8="kimi_desktop",G8="platform",y_="kimi-desktop",k_="kimi-desktop-platform";function Y8(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(K8)?(sessionStorage.setItem(y_,"1"),e=!0):e=e||sessionStorage.getItem(y_)==="1";const s=n.get(G8);s?(sessionStorage.setItem(k_,s),t=s):t=sessionStorage.getItem(k_)}catch{}return{isDesktop:e,platform:t}}const Fv=Y8(),X8=Fv.isDesktop,kA=Fv.isDesktop&&Fv.platform==="darwin",Q8=["aria-label"],Z8=Ve({__name:"InternalBuildBanner",setup(e){const{t}=Nt(),n=X8;return(s,o)=>A(n)?(w(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":A(t)("app.internalBuildBanner")},[o[0]||(o[0]=T("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"},[T("path",{d:"M8 2 14 13H2L8 2Z"}),T("path",{d:"M8 6v3.5"}),T("path",{d:"M8 11.5h.01"})],-1)),T("span",null,R(A(t)("app.internalBuildBanner")),1)],8,Q8)):ie("",!0)}}),J8=ft(Z8,[["__scopeId","data-v-b5e70a09"]]),eL={class:"ch"},tL={class:"ch-brand"},nL={class:"ch-name"},sL={key:0,class:"ch-endpoint"},oL={class:"search-input"},iL={key:0,class:"empty"},rL={class:"side-section-label"},lL={class:"side-section-title"},aL={class:"side-section-actions"},cL=["onDragover","onDrop"],uL={class:"section-menu-check"},dL={class:"section-menu-check"},fL={class:"section-menu-check"},pL={class:"ds-egg-frame"},hL={class:"ds-egg-head"},mL=1e3,gL=Ve({__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}=Nt(),{confirm:s}=sl(),o=!1,i="",r=e,l=t,a=Z(!1);function c(){l("loadAllSessions"),a.value=!0}function u(Xe){(Xe.metaKey||Xe.ctrlKey)&&Xe.key.toLowerCase()==="k"&&(Xe.preventDefault(),c())}bn(()=>window.addEventListener("keydown",u)),ms(()=>window.removeEventListener("keydown",u));const d=Z(!1);function f(Xe){d.value=Xe.target.scrollTop>0}const h=Z(new Set(c5()));function p(Xe){return h.value.has(Xe)}function m(Xe){const Ge=new Set(h.value);Ge.has(Xe)?Ge.delete(Xe):Ge.add(Xe),h.value=Ge,Jm(Ge)}function b(){const Xe=new Set(r.groups.map(Ge=>Ge.workspace.id));h.value=Xe,Jm(Xe)}function _(){const Xe=new Set;h.value=Xe,Jm(Xe)}const g=W(()=>r.groups.length>0&&r.groups.every(Xe=>h.value.has(Xe.workspace.id))),v=Z(new Set);function y(Xe){return v.value.has(Xe)}function C(Xe){const Ge=new Set(v.value);Ge.has(Xe)?Ge.delete(Xe):Ge.add(Xe),v.value=Ge}function L(Xe){if(!v.value.has(Xe)){const Ge=new Set(v.value);Ge.add(Xe),v.value=Ge}l("loadMoreSessions",Xe)}const $=Z(u5());function k(){$.value=!$.value,d5($.value)}const M=Z(null),E=Z(null);function O(Xe){M.value=Xe}function S(){M.value=null,E.value=null}function I(Xe){const Ge=Xe.currentTarget.getBoundingClientRect();return Xe.clientY<Ge.top+Ge.height/2?"before":"after"}function P(Xe,Ge){M.value===null||M.value===Ge||(Xe.preventDefault(),Xe.dataTransfer&&(Xe.dataTransfer.dropEffect="move"),E.value={id:Ge,position:I(Xe)})}function D(Xe){const Ge=M.value,At=E.value?.id===Xe?E.value.position:"before";if(E.value=null,M.value=null,!Ge||Ge===Xe)return;const jt=T5(r.groups.map(Xt=>Xt.workspace.id),Ge,Xe,At);l("reorderWorkspaces",jt)}function H(Xe,Ge){Ge.target.closest(".gh-more, .gh-add")||m(Xe)}function z(Xe){l("select",Xe)}const U=Z(null),Q=Z(""),X=Z(null);function ue(){return X}function me(Xe,Ge){U.value=Xe,Q.value=Ge,gt().then(()=>X.value?.focus())}function Ae(){const Xe=U.value,Ge=Q.value.trim();Xe&&Ge&&l("renameWorkspace",Xe,Ge),U.value=null}function be(){U.value=null}function ze(Xe){Q.value=Xe}const qe=Z(!1),Fe=Z(null),Le=Z({}),le=Z(null);function F(Xe){le.value?.el&&!le.value.el.contains(Xe.target)&&ee()}function te(Xe,Ge){Ge.preventDefault(),Ge.stopPropagation(),Fe.value=Xe,Le.value={top:`${Ge.clientY}px`,left:`${Ge.clientX}px`},qe.value=!0,document.addEventListener("mousedown",F,!0)}function ee(){qe.value=!1,document.removeEventListener("mousedown",F,!0),Fe.value=null}function q(){Fe.value&&Hs(Fe.value.root),ee()}function Y(){Fe.value&&me(Fe.value.id,Fe.value.name),ee()}async function de(){const Xe=Fe.value;Xe&&(ee(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id))}const ne=Z(null),ce=Z(null),j=Z({}),G=Z(null);function re(Xe){const Ge=Xe.target;Ge.closest(".gh-more")||Ge.closest(".ws-menu")||Ce()}async function he(Xe,Ge){if(ne.value===Xe.id){Ce();return}const At=Ge.currentTarget;ce.value=Xe,ne.value=Xe.id,document.addEventListener("mousedown",re),window.addEventListener("resize",Ce),await gt();const jt=G.value?.el,Xt=At.getBoundingClientRect(),Nn=4,An=8,ts=jt?.offsetHeight??0,It=jt?.offsetWidth??0;let Tn=Xt.bottom+Nn;Tn+ts>window.innerHeight-An&&(Tn=Math.max(An,Xt.top-ts-Nn));let Qt=Xt.right-It;Qt<An&&(Qt=An),j.value={top:`${Math.round(Tn)}px`,left:`${Math.round(Qt)}px`}}function Ce(){ne.value=null,ce.value=null,document.removeEventListener("mousedown",re),window.removeEventListener("resize",Ce)}function Ee(Xe){Hs(Xe.root),Ce()}function ae(Xe){me(Xe.id,Xe.name),Ce()}async function xe(Xe){Ce(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id)}const Ke=Z(!1),st=Z({}),_t=Z(null);function wt(Xe){const Ge=Xe.target;Ge.closest(".side-section-kebab")||Ge.closest(".section-menu")||Ot()}async function Et(Xe){if(Ke.value){Ot();return}const Ge=Xe.currentTarget;Ke.value=!0,document.addEventListener("mousedown",wt),window.addEventListener("resize",Ot),await gt();const At=_t.value?.el,jt=Ge.getBoundingClientRect(),Xt=4,Nn=8,An=At?.offsetHeight??0,ts=At?.offsetWidth??0;let It=jt.bottom+Xt;It+An>window.innerHeight-Nn&&(It=Math.max(Nn,jt.top-An-Xt));let Tn=jt.right-ts;Tn<Nn&&(Tn=Nn),st.value={top:`${Math.round(It)}px`,left:`${Math.round(Tn)}px`}}function Ot(){Ke.value=!1,document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Ot)}function bt(Xe){l("setWorkspaceSortMode",Xe),Ot()}function Kt(){k(),Ot()}ms(()=>{document.removeEventListener("mousedown",F,!0),document.removeEventListener("mousedown",re),document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Ce),window.removeEventListener("resize",Ot)});const Fn=Z(null);let $n;function Rt(){const Xe=Fn.value;Xe&&(Xe.classList.remove("blink-now"),Xe.getBoundingClientRect(),Xe.classList.add("blink-now"),clearTimeout($n),$n=setTimeout(()=>Xe.classList.remove("blink-now"),300))}const nn=Z(!1);let Hn,nt=!1;function Pn(Xe){nt=!1,clearTimeout(Hn),Xe.currentTarget.setPointerCapture?.(Xe.pointerId),Hn=setTimeout(()=>{nt=!0,nn.value=!0},mL)}function fn(Xe){clearTimeout(Hn);const Ge=Xe.currentTarget;Ge.hasPointerCapture?.(Xe.pointerId)&&Ge.releasePointerCapture(Xe.pointerId)}function Gn(){if(nt){nt=!1;return}Rt()}function Rn(){nn.value=!1}function gs(Xe){Xe.key==="Escape"&&nn.value&&Rn()}return typeof window<"u"&&window.addEventListener("keydown",gs),ms(()=>{clearTimeout(Hn),typeof window<"u"&&window.removeEventListener("keydown",gs)}),(Xe,Ge)=>(w(),N("aside",{class:De(["side",{"macos-desktop":A(kA)}])},[T("div",{class:"col",style:Yt({width:e.colWidth+"px"})},[T("div",eL,[T("div",tL,[(w(),N("svg",{ref_key:"logoRef",ref:Fn,class:De(["ch-logo",{"is-dev":A(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Gn,onPointerdown:Pn,onPointerup:fn,onPointercancel:fn},[...Ge[20]||(Ge[20]=[e0('<defs data-v-35bad6e4><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-35bad6e4><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-35bad6e4></rect><g class="ch-eyes" fill="#000" data-v-35bad6e4><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-35bad6e4></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-35bad6e4></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-35bad6e4></rect>',2)])],34)),T("span",nL,[Ge[21]||(Ge[21]=je("Kimi Code",-1)),A(o)?(w(),N("span",sL," · "+R(A(i)),1)):ie("",!0)]),oe(J8)]),oe(mn,{size:"sm",label:A(n)("sidebar.collapseSidebar"),onClick:Ge[0]||(Ge[0]=vt(At=>l("collapse"),["stop"]))},{default:ke(()=>[oe(Je,{name:"panel-collapse"})]),_:1},8,["label"]),oe(mn,{size:"sm",label:A(n)("settings.title"),onClick:Ge[1]||(Ge[1]=vt(At=>l("openSettings"),["stop"]))},{default:ke(()=>[oe(Je,{name:"settings"})]),_:1},8,["label"])]),T("button",{class:"search",type:"button",onClick:c},[oe(Je,{class:"search-icon",name:"search"}),T("span",oL,R(A(n)("sidebar.searchShortcut")),1)]),T("div",{class:De(["btn-wrap",{"btn-wrap--scrolled":d.value}])},[T("button",{class:"btn-new-chat",type:"button",onClick:Ge[2]||(Ge[2]=vt(At=>l("create"),["stop"]))},[oe(Je,{name:"chat-new"}),T("span",null,R(A(n)("sidebar.newChat")),1)]),ie("",!0)],2),T("div",{class:"sessions",onScroll:f},[e.groups.length===0?(w(),N("div",iL,R(A(n)("workspace.noWorkspace")),1)):(w(),N(Oe,{key:1},[T("div",rL,[T("span",lL,R(A(n)("sidebar.workspaces")),1),T("div",aL,[oe(mn,{class:"side-section-toggle",size:"sm",label:g.value?A(n)("sidebar.expandAll"):A(n)("sidebar.collapseAll"),onClick:Ge[4]||(Ge[4]=vt(At=>g.value?_():b(),["stop"]))},{default:ke(()=>[g.value?(w(),ge(Je,{key:0,name:"expand"})):(w(),ge(Je,{key:1,name:"collapse"}))]),_:1},8,["label"]),oe(mn,{class:"side-section-toggle side-section-kebab",size:"sm",label:A(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ke.value,onClick:Ge[5]||(Ge[5]=vt(At=>Et(At),["stop"]))},{default:ke(()=>[oe(Je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),N(Oe,null,ot(e.groups,At=>(w(),N("div",{key:At.workspace.id,class:De(["ws-drop-target",{"drop-before":E.value?.id===At.workspace.id&&E.value.position==="before","drop-after":E.value?.id===At.workspace.id&&E.value.position==="after"}]),onDragover:jt=>P(jt,At.workspace.id),onDrop:jt=>D(At.workspace.id)},[oe(V8,{group:At,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":U.value,"rename-value":Q.value,"rename-input-ref":ue(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ne.value,dragging:M.value===At.workspace.id,"is-collapsed":p,"is-expanded":y,"show-path":$.value,onGroupClick:H,onGroupContextmenu:te,onToggleWsMenu:he,onCreateInWorkspace:Ge[6]||(Ge[6]=jt=>l("createInWorkspace",jt)),onSelectSession:z,onRenameSession:Ge[7]||(Ge[7]=(jt,Xt)=>l("rename",jt,Xt)),onArchiveSession:Ge[8]||(Ge[8]=jt=>l("archive",jt)),onForkSession:Ge[9]||(Ge[9]=jt=>l("fork",jt)),onLoadMore:L,onToggleExpand:C,onConfirmRename:Ae,onCancelRename:be,onUpdateRenameValue:ze,onWsDragstart:O,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","show-path"])],42,cL))),128))],64))],32)],4),qe.value?(w(),ge(Fl,{key:0,ref_key:"ghMenuRef",ref:le,class:"gh-menu",style:Yt(Le.value),onClick:Ge[10]||(Ge[10]=vt(()=>{},["stop"]))},{default:ke(()=>[oe(hn,{onClick:q},{default:ke(()=>[je(R(A(n)("sidebar.copyPath")),1)]),_:1}),oe(hn,{onClick:Y},{default:ke(()=>[je(R(A(n)("sidebar.rename")),1)]),_:1}),oe(hn,{danger:"",onClick:de},{default:ke(()=>[je(R(A(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),ne.value!==null&&ce.value?(w(),ge(Fl,{key:1,ref_key:"wsMenuRef",ref:G,class:"ws-menu",style:Yt(j.value),onClick:Ge[14]||(Ge[14]=vt(()=>{},["stop"]))},{default:ke(()=>[oe(hn,{onClick:Ge[11]||(Ge[11]=At=>Ee(ce.value))},{default:ke(()=>[je(R(A(n)("sidebar.copyPath")),1)]),_:1}),oe(hn,{separator:""}),oe(hn,{onClick:Ge[12]||(Ge[12]=At=>ae(ce.value))},{default:ke(()=>[je(R(A(n)("sidebar.rename")),1)]),_:1}),oe(hn,{separator:""}),oe(hn,{danger:"",onClick:Ge[13]||(Ge[13]=At=>xe(ce.value))},{default:ke(()=>[je(R(A(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),Ke.value?(w(),ge(Fl,{key:2,ref_key:"sectionMenuRef",ref:_t,class:"section-menu",style:Yt(st.value),onClick:Ge[18]||(Ge[18]=vt(()=>{},["stop"]))},{default:ke(()=>[oe(hn,{onClick:Ge[15]||(Ge[15]=At=>bt("manual"))},{default:ke(()=>[T("span",uL,[e.workspaceSortMode==="manual"?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+R(A(n)("sidebar.sortManual")),1)]),_:1}),oe(hn,{onClick:Ge[16]||(Ge[16]=At=>bt("recent"))},{default:ke(()=>[T("span",dL,[e.workspaceSortMode==="recent"?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+R(A(n)("sidebar.sortRecent")),1)]),_:1}),oe(hn,{separator:""}),oe(hn,{onClick:Ge[17]||(Ge[17]=At=>Kt())},{default:ke(()=>[T("span",fL,[$.value?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+R(A(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),a.value?(w(),ge(m8,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:z,onClose:Ge[19]||(Ge[19]=At=>a.value=!1)},null,8,["sessions","active-id"])):ie("",!0),(w(),ge(sh,{to:"body"},[nn.value?(w(),N("div",{key:0,class:"ds-egg",onMousedown:vt(Rn,["self"])},[T("div",pL,[T("div",hL,[Ge[22]||(Ge[22]=T("span",{class:"ds-egg-title"},"Design system",-1)),oe(mn,{size:"sm",label:A(n)("diff.close"),onClick:Rn},{default:ke(()=>[oe(Je,{name:"close",size:"md"})]),_:1},8,["label"])]),Ge[23]||(Ge[23]=T("iframe",{class:"ds-egg-iframe",src:"/design-system.html",title:"Design system"},null,-1))])],32)):ie("",!0)]))],2))}}),vL=ft(gL,[["__scopeId","data-v-35bad6e4"]]);function yL(e){try{const t=Zn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function kL(e,t){try{es(e,String(t))}catch{}}function bL(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(EC(o),Math.max(s,Math.round(_))):n}const l=Z(r(yL(t)??n)),a=Z(!1);function c(_){const g=r(_);l.value=g,kL(t,g)}let u=0,d=0,f=null,h=-1;function p(_){if(!a.value)return;const g=_.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(_){_.preventDefault(),a.value=!0,u=_.clientX,d=r(l.value),f=_.currentTarget,h=_.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 ms(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const _L=["aria-label"],wL=Ve({__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}=Nt(),{width:i,dragging:r,onPointerDown:l}=bL({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ye(i,a=>s("update:width",a)),Ye(r,a=>s("update:dragging",a)),(a,c)=>(w(),N("div",{class:De(["rh",{dragging:A(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??A(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>A(l)&&A(l)(...u))},[...c[1]||(c[1]=[T("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,_L))}}),b_=ft(wL,[["__scopeId","data-v-ad762f1c"]]),SL={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},CL={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"},xL={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 session?",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 (⌘K)",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},AL={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"},TL={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…"},ML={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"},EL={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"},IL={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"},$L={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"},NL={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"},LL={justNow:"just now"},OL={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"},PL={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},RL={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"},DL={panelTitle:"Thinking",close:"Close"},BL={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"},FL={},HL={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},WL={searching:"Searching…",noMatch:"No matches"},zL={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."}},UL={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"}},qL={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task"},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"}},jL={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},VL={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"},KL={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},GL={preview:"预览",confirm:"确认",cancel:"取消"},YL={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},XL={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:"搜索会话 (⌘K)",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},QL={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:"此会话在完成前被中断"},ZL={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:"正在加载更早的消息…"},JL={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:"进行中"},eO={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"},tO={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 后重试"},nO={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 关闭"},sO={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},oO={justNow:"刚刚"},iO={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:"拒绝并退出"},rO={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},lO={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:"展开"},aO={panelTitle:"思考过程",close:"关闭"},cO={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},uO={},dO={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},fO={searching:"搜索中…",noMatch:"无匹配"},pO={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:"目标描述太长了,请精简后重试。"}},hO={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:"撤销上一条消息"}},mO={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"}},gO={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},vO={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式"},yO={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},kO={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"},bO={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},_O={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",notifyQuestionBody:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",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"},wO={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",notifyQuestionBody:"有提问等待你回答",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:"在右侧显示可点击跳转的对话目录"},SO={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"},CO={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},xO={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"},AO={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},TO={en:{common:SL,app:CL,sidebar:xL,workspace:AL,conversation:TL,status:ML,composer:EL,login:IL,providers:$L,model:NL,sessions:LL,approval:OL,question:PL,tasks:RL,thinking:DL,diff:BL,fileTree:FL,filePreview:HL,mention:WL,warnings:zL,commands:UL,tools:qL,layout:jL,mobile:VL,theme:KL,onboarding:kO,settings:_O,header:SO,sideChat:xO},zh:{common:GL,app:YL,sidebar:XL,workspace:QL,conversation:ZL,status:JL,composer:eO,login:tO,providers:nO,model:sO,sessions:oO,approval:iO,question:rO,tasks:lO,thinking:aO,diff:cO,fileTree:uO,filePreview:dO,mention:fO,warnings:pO,commands:hO,tools:mO,layout:gO,mobile:vO,theme:yO,onboarding:bO,settings:wO,header:CO,sideChat:AO}},bA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function MO(){const e=Zn($t.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const jn=JN({legacy:!1,locale:MO(),fallbackLocale:"en",messages:TO});function _A(e){jn.global.locale.value=e,es($t.locale,e)}const ja=jn.global.t,EO={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"},IO={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 Xl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return IO[t]??t}function nd(e){const t=EO[Xl(e)];return t?ja(t):e}const $O={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"};function h0(e){const t=Xl(e);let n=$O[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n?Ta(n,"sm"):""}const wA=80;function NO(e,t=wA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function LO(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function OO(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 sn(e){return typeof e=="string"&&e.length>0?e:void 0}function _l(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function PO(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 tg(e){return sn(e.path)??sn(e.file_path)??sn(e.filePath)??sn(e.filename)}const RO=64;function Pu(e,t,n=!1){const s=(o,i=wA)=>n?o.trim():NO(o,i);try{const o=OO(t);if(!n&&LO(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Xl(e)){case"read":{const r=tg(o);if(!r)return i();const l=_l(o.offset)??_l(o.line_start)??_l(o.start_line),a=_l(o.limit)??_l(o.length),c=_l(o.line_end)??_l(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=tg(o);return r?s(`${r} ${ja("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=tg(o);return r?s(r):i()}case"bash":{const r=sn(o.command)??sn(o.cmd)??sn(o.script);return r?s(r,RO):i()}case"grep":case"search":{const r=sn(o.pattern)??sn(o.query)??sn(o.regex),l=sn(o.path)??sn(o.glob)??sn(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=sn(o.pattern)??sn(o.glob)??sn(o.query),l=sn(o.path)??sn(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):sn(o.path)?s(sn(o.path)):i()}case"ls":{const r=sn(o.path)??sn(o.dir)??sn(o.directory)??sn(o.cwd);return r?s(r):i()}case"web_fetch":{const r=sn(o.url)??sn(o.uri);return r?s(PO(r)):i()}case"todo":case"task":{const r=sn(o.description)??sn(o.title)??sn(o.prompt)??sn(o.name)??sn(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(ja("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function DO(e){try{switch(Xl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ja("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 ja("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ja("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const BO=Ve({__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=W(()=>n(t.status));return(o,i)=>(w(),N("span",{class:De(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),Ru=ft(BO,[["__scopeId","data-v-e36198e5"]]),FO=["innerHTML"],HO={class:"a"},WO={key:0,class:"p"},zO={class:"rt"},UO=["aria-label"],qO={key:0,class:"tm"},jO=["inert"],VO={class:"bb-pad"},KO=Ve({__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){return(t,n)=>(w(),N("div",{class:De(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[T("div",{class:"bh",onClick:n[0]||(n[0]=s=>t.$emit("toggle"))},[e.icon?(w(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,FO)):ie("",!0),T("span",HO,R(e.name),1),oe(Wt,{text:e.arg},{default:ke(()=>[e.arg?(w(),N("span",WO,R(e.arg),1)):ie("",!0)]),_:1},8,["text"]),T("span",zO,[T("span",{class:De(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ge(Je,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ge(Je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ge(Ru,{key:2,status:"suspended"})):(w(),ge(Ru,{key:3,status:"running"}))],10,UO),xn(t.$slots,"trailing"),e.time?(w(),N("span",qO,R(e.time),1)):ie("",!0)]),e.expandable?(w(),ge(Je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ie("",!0)]),T("div",{class:De(["bb",{open:e.open}]),inert:!e.open},[T("div",VO,[xn(t.$slots,"default")])],10,jO)],2))}}),m0=ft(KO,[["__scopeId","data-v-92e82f68"]]),GO={key:0,class:"at-type"},YO={key:1,class:"at-task"},XO={key:2,class:"bb-code"},QO=Ve({__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}=Nt(),s=e,o=t;function i(_){if(!_)return{};try{const g=JSON.parse(_);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=W(()=>i(s.tool.arg)),l=W(()=>!!s.tool.output&&s.tool.output.length>0),a=W(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Z(s.tool.defaultExpanded===!0&&a.value),u=W(()=>s.tool.status),d=W(()=>nd(s.tool.name)),f=W(()=>h0(s.tool.name)),h=W(()=>r.value.description||r.value.subagentType||""),p=qt("resolveAgentTaskId"),m=W(()=>p?p(s.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Ye(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(_,g)=>(w(),ge(m0,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:ke(()=>[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"]))},R(A(n)("tasks.openDetail")),1)):ie("",!0)]),default:ke(()=>[r.value.subagentType?(w(),N("div",GO,R(r.value.subagentType),1)):ie("",!0),r.value.prompt?(w(),N("div",YO,R(r.value.prompt),1)):ie("",!0),l.value?(w(),N("div",XO,[(w(!0),N(Oe,null,ot(e.tool.output??[],(v,y)=>(w(),N("div",{key:y},R(v),1))),128))])):ie("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),ZO=ft(QO,[["__scopeId","data-v-14ef8750"]]),JO=1e6,__=5e3;function w_(e){if(e==="")return[];const t=e.split(`
39
- `);return t.at(-1)===""&&t.pop(),t}function eP(e,t){const n=w_(e),s=w_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>__||i>__||(o+1)*(i+1)>JO)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 tP(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 SA(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 CA(e){const t=Xl(e.name);if(t!=="edit"&&t!=="write")return null;const n=SA(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:eP(s,o)}return null}function nP(e){const t=SA(e);return t&&typeof t.path=="string"?t.path:void 0}function sP(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const oP={key:0,class:"chip"},iP={key:0,class:"bb-summary"},rP={class:"bb-code"},lP={key:0,class:"bb-empty"},aP=Ve({__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=W(()=>n.tool.status),i=W(()=>nd(n.tool.name)),r=W(()=>h0(n.tool.name)),l=W(()=>Pu(n.tool.name,n.tool.arg)),a=W(()=>Pu(n.tool.name,n.tool.arg,!0)),c=W(()=>CA(n.tool)),u=W(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:b,removed:_}=tP(m);if(b||_)return`+${b} −${_}`}return""}),d=W(()=>!!n.tool.output&&n.tool.output.length>0),f=Z(!1),h=W(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,b)=>(w(),ge(m0,{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:ke(()=>[u.value?(w(),N("span",oP,R(u.value),1)):ie("",!0)]),default:ke(()=>[a.value?(w(),N("div",iP,R(a.value),1)):ie("",!0),T("div",rP,[d.value?ie("",!0):(w(),N("div",lP,"Waiting for output…")),(w(!0),N(Oe,null,ot(e.tool.output??[],(_,g)=>(w(),N("div",{key:g},R(_),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),cP=ft(aP,[["__scopeId","data-v-69861679"]]),uP={key:0,class:"chip"},dP={key:0,class:"bb-summary"},fP={class:"bb-code"},pP={key:0,class:"bb-empty"},hP=Ve({__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=W(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=W(()=>!!t.tool.output&&t.tool.output.length>0),o=W(()=>s.value||n.value),i=Z(t.tool.defaultExpanded===!0&&o.value),r=W(()=>t.tool.status),l=W(()=>nd(t.tool.name)),a=W(()=>h0(t.tool.name)),c=W(()=>Pu(t.tool.name,t.tool.arg)),u=W(()=>Pu(t.tool.name,t.tool.arg,!0)),d=W(()=>DO({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 Ye(()=>[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(),ge(m0,{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:ke(()=>[d.value?(w(),N("span",uP,R(d.value),1)):ie("",!0)]),default:ke(()=>[u.value?(w(),N("div",dP,R(u.value),1)):ie("",!0),T("div",fP,[s.value?ie("",!0):(w(),N("div",pP,"Waiting for output…")),(w(!0),N(Oe,null,ot(e.tool.output??[],(m,b)=>(w(),N("div",{key:b},R(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),mP=ft(hP,[["__scopeId","data-v-f3c4ee38"]]),gP={class:"media-title"},vP=["src","alt"],yP=["src"],kP=["src"],bP=Ve({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=W(()=>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=W(()=>{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:De(["media-tool",{mob:e.mobile}])},[oe(Wt,{text:o.value.path||l.value},{default:ke(()=>[T("div",gP,R(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(w(),ge(Wt,{key:0,text:o.value.path||l.value},{default:ke(()=>[T("button",{type:"button",class:"media-image-button",onClick:a},[T("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,vP)])]),_:1},8,["text"])):o.value.kind==="video"?(w(),N("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,yP)):(w(),N("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,kP))],2)):ie("",!0)}}),_P=ft(bP,[["__scopeId","data-v-bec13b73"]]);function wP(e){if(e.media&&e.status==="ok")return _P;const t=Xl(e.name);return t==="edit"||t==="write"||t==="multi_edit"?cP:t==="task"?ZO:mP}const xA=Ve({__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=W(()=>wP(n.tool));return(i,r)=>(w(),ge(Bs(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 S_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function SP(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 uh(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 CP(e){return!(e.tool.status==="ok"&&e.tool.media)}function xP(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function AP(e){const t=uh(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(CP(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})}),o(),n}function TP(e){return uh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
40
-
41
- `)}function MP(e){const t=[];for(const n of uh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
42
- > ${n.thinking.split(`
43
- `).join(`
44
- > `)}`);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(`
45
- `);t.push(`\`\`\`
46
- [${n.tool.name}]
47
- ${s}
48
- \`\`\``)}return t.join(`
49
-
50
- `)}function AA(e){return e.tool.id||`tool-${e.sourceIndex}`}function EP(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?AA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const IP=["aria-expanded"],$P={class:"tg-title"},NP={class:"tg-meta"},LP={class:"tool-group-body"},OP=Ve({__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=Z(!0),i=W(()=>n.tools.length),r=W(()=>n.tools.some(u=>u.tool.status==="running")?"running":n.tools.some(u=>u.tool.status==="error")?"error":"done"),{t:l}=Nt(),a=W(()=>{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}return(u,d)=>(w(),N("div",{class:De(["tool-group",{open:o.value}])},[T("button",{class:"tool-group-head",type:"button","aria-expanded":o.value,onClick:c},[oe(Ru,{status:r.value},null,8,["status"]),oe(Je,{class:"tg-ic",name:"list",size:"sm"}),T("span",$P,R(A(l)("tools.group.title",i.value)),1),T("span",NP,"· "+R(a.value),1),oe(Je,{class:"tg-car",name:"chevron-right",size:"sm"})],8,IP),In(T("div",LP,[(w(!0),N(Oe,null,ot(e.tools,(f,h)=>(w(),ge(xA,{key:A(AA)(f),tool:f.tool,mobile:e.mobile,"stack-position":A(xP)(h,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:d[0]||(d[0]=p=>s("openMedia",p)),onOpenFile:d[1]||(d[1]=p=>s("openFile",p)),onOpenToolDiff:d[2]||(d[2]=p=>s("openToolDiff",p)),onOpenAgent:d[3]||(d[3]=p=>s("openAgent",p))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))],512),[[Vo,o.value]])],2))}}),PP=ft(OP,[["__scopeId","data-v-79e21bc7"]]);var RP=Object.create,g0=Object.defineProperty,DP=Object.getOwnPropertyDescriptor,TA=Object.getOwnPropertyNames,BP=Object.getPrototypeOf,FP=Object.prototype.hasOwnProperty,MA=(e,t)=>function(){return t||(0,e[TA(e)[0]])((t={exports:{}}).exports,t),t.exports},EA=e=>{let t={};for(var n in e)g0(t,n,{get:e[n],enumerable:!0});return t},HP=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=TA(t),i=0,r=o.length,l;i<r;i++)l=o[i],!FP.call(e,l)&&l!==n&&g0(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=DP(t,l))||s.enumerable});return e},IA=(e,t,n)=>(n=e!=null?RP(BP(e)):{},HP(g0(n,"default",{value:e,enumerable:!0}),e));function WP(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 zP(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function UP(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 qP(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
51
- `:`<hr class="footnotes-sep">
52
- `)+`<section class="footnotes">
53
- <ol class="footnotes-list">
54
- `}function jP(){return`</ol>
55
- </section>
56
- `}function VP(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 KP(){return`</li>
57
- `}function GP(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 YP(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=UP,e.renderer.rules.footnote_block_open=qP,e.renderer.rules.footnote_block_close=jP,e.renderer.rules.footnote_open=VP,e.renderer.rules.footnote_close=KP,e.renderer.rules.footnote_anchor=GP,e.renderer.rules.footnote_caption=zP,e.renderer.rules.footnote_anchor_name=WP;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 b=l.bMarks[a],_=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,C=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=C;for(;h<f;){const k=l.src.charCodeAt(h);if(n(k))k===9?L+=4-L%4:L++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=L-C,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]=_,l.sCount[a]=g,l.bMarks[a]=b;const $=new l.Token("footnote_reference_close","",-1);return $.level=--l.level,l.tokens.push($),!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 b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const 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 C=new l.Token("paragraph_close","p",-1);C.block=!0,a.push(C)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let _;l.tokens[l.tokens.length-1].type==="paragraph_close"?_=l.tokens.pop():_=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)}_&&l.tokens.push(_),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 XP(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 QP(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 ZP=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function JP(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(ZP,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function eR(e){e.inline.ruler.after("emphasis","sub",JP)}const tR=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function nR(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(tR,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function sR(e){e.inline.ruler.after("emphasis","sup",nR)}var oR=MA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),m.core.ruler.after("inline","github-task-lists",function(_){for(var g=_.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",b.liClass),n(g[s(g,y-2)],"class",b.ulClass))})};function n(m,b,_){var g=m.attrIndex(b),v=[b,_];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,b){for(var _=m[b].level-1,g=b-1;g>=0;g--)if(m[g].level===_)return g;return-1}function o(m,b){return d(m[b])&&f(m[b-1])&&h(m[b-2])&&p(m[b])}function i(m,b,_,g){var v=_.idPrefix+b;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,_,g)),_.divWrap&&(m.children.unshift(c(_,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",b]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),_.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,b){var _=new b("label_open","label",1);return _.attrs=[["for",m]],_}function a(m){return new m("label_close","label",-1)}function c(m,b){var _=new b("checkbox_open","div",0);return _.attrs=[["class",m.divClass]],_}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)}})}),iR=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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))),rR=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),ng;const lR=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]]),aR=(ng=String.fromCodePoint)!==null&&ng!==void 0?ng: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 cR(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=lR.get(e))!==null&&t!==void 0?t:e}var bs;(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"})(bs||(bs={}));const uR=32;var Dr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Dr||(Dr={}));function Hv(e){return e>=bs.ZERO&&e<=bs.NINE}function dR(e){return e>=bs.UPPER_A&&e<=bs.UPPER_F||e>=bs.LOWER_A&&e<=bs.LOWER_F}function fR(e){return e>=bs.UPPER_A&&e<=bs.UPPER_Z||e>=bs.LOWER_A&&e<=bs.LOWER_Z||Hv(e)}function pR(e){return e===bs.EQUALS||fR(e)}var ks;(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"})(ks||(ks={}));var Or;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Or||(Or={}));var hR=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ks.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Or.Strict}startEntity(e){this.decodeMode=e,this.state=ks.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ks.EntityStart:return e.charCodeAt(t)===bs.NUM?(this.state=ks.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ks.NamedEntity,this.stateNamedEntity(e,t));case ks.NumericStart:return this.stateNumericStart(e,t);case ks.NumericDecimal:return this.stateNumericDecimal(e,t);case ks.NumericHex:return this.stateNumericHex(e,t);case ks.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|uR)===bs.LOWER_X?(this.state=ks.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ks.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(Hv(s)||dR(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(Hv(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===bs.SEMI)this.consumed+=1;else if(this.decodeMode===Or.Strict)return 0;return this.emitCodePoint(cR(this.result),this.consumed),this.errors&&(e!==bs.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&Dr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=mR(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Or.Attribute&&(o===0||pR(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&Dr.VALUE_LENGTH)>>14,o!==0){if(i===bs.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Or.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]&Dr.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]&~Dr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case ks.NamedEntity:return this.result!==0&&(this.decodeMode!==Or.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ks.NumericDecimal:return this.emitNumericEntity(0,2);case ks.NumericHex:return this.emitNumericEntity(0,3);case ks.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ks.EntityStart:return 0}}};function $A(e){let t="";const n=new hR(e,s=>t+=aR(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 mR(e,t,n,s){const o=(t&Dr.BRANCH_LENGTH)>>7,i=t&Dr.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 gR=$A(iR);$A(rR);function v0(e,t=Or.Legacy){return gR(e,t)}var vR=IA(oR());const C_={};function yR(e){let t=C_[e];if(t)return t;t=C_[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 dh(e,t){typeof t!="string"&&(t=dh.defaultChars);const n=yR(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})}dh.defaultChars=";/?:@&=+$,#";dh.componentChars="";var Wv=dh;const x_={};function kR(e){let t=x_[e];if(t)return t;t=x_[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 fh(e,t,n){typeof t!="string"&&(n=t,t=fh.defaultChars),typeof n>"u"&&(n=!0);const s=kR(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}fh.defaultChars=";/?:@&=+$,-_.!~*'()#";fh.componentChars="-_.!~*'()";var NA=fh;function y0(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function ap(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const bR=/^([a-z0-9.+-]+:)/i,_R=/:[0-9]*$/,wR=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,SR=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
58
- `," "]),CR=["'"].concat(SR),A_=["%","/","?",";","#"].concat(CR),T_=["/","?","#"],xR=255,M_=/^[+a-z0-9A-Z_-]{0,63}$/,AR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E_={javascript:!0,"javascript:":!0},I_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function TR(e,t){if(e&&e instanceof ap)return e;const n=new ap;return n.parse(e,t),n}ap.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=wR.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=bR.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&&E_[r])&&(i=i.substr(2),this.slashes=!0)),!E_[r]&&(o||r&&!I_[r])){let c=-1;for(let p=0;p<T_.length;p++)s=i.indexOf(T_[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<A_.length;p++)s=i.indexOf(A_[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,b=p.length;m<b;m++){const _=p[m];if(_&&!_.match(M_)){let g="";for(let v=0,y=_.length;v<y;v++)_.charCodeAt(v)>127?g+="x":g+=_[v];if(!g.match(M_)){const v=p.slice(0,m),y=p.slice(m+1),C=_.match(AR);C&&(v.push(C[1]),y.unshift(C[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>xR&&(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),I_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ap.prototype.parseHost=function(e){let t=_R.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 k0=TR,LA=EA({decode:()=>Wv,encode:()=>NA,format:()=>y0,parse:()=>k0}),OA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PA=/[\0-\x1F\x7F-\x9F]/,MR=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,RA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ER=/[\$\+<->\^`\|~\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]/,DA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,IR=EA({Any:()=>OA,Cc:()=>PA,Cf:()=>MR,P:()=>RA,S:()=>ER,Z:()=>DA}),$R=Object.defineProperty,BA=e=>{let t={};for(var n in e)$R(t,n,{get:e[n],enumerable:!0});return t},rs=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}`}},NR=BA({arrayReplaceAt:()=>FR,assign:()=>DR,countLines:()=>Yn,escapeHtml:()=>GR,escapeRE:()=>XR,fromCodePoint:()=>Bu,has:()=>RR,isMdAsciiPunct:()=>dp,isPunctChar:()=>up,isPunctCode:()=>zv,isSpace:()=>BR,isString:()=>OR,isValidEntityCode:()=>hh,isWhiteSpace:()=>Du,lib:()=>QR,mdurl:()=>LA,normalizeReference:()=>ph,ucmicro:()=>cp,unescapeAll:()=>Fu,unescapeMd:()=>UR});const cp=IR;function LR(e){return Object.prototype.toString.call(e)}function OR(e){return LR(e)==="[object String]"}const PR=Object.prototype.hasOwnProperty;function RR(e,t){return PR.call(e,t)}function DR(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 BR(e){return e===9||e===32}function Du(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function up(e){return cp.P.test(e)||cp.S.test(e)}const $_=new Map;function zv(e){if(dp(e))return!0;const t=$_.get(e);if(t!==void 0)return t;const n=up(String.fromCharCode(e));return $_.set(e,n),n}function dp(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ph(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function FR(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function hh(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 Bu(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 FA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,HR=new RegExp(`${FA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),WR=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function zR(e,t){if(t.charCodeAt(0)===35&&WR.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return hh(s)?Bu(s):e}const n=v0(e);return n!==e?n:e}function UR(e){return e.includes("\\")?e.replace(FA,"$1"):e}function Fu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(HR,(t,n,s)=>n||zR(t,s))}const qR=/[&<>"]/,jR=/[&<>"]/g,VR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function KR(e){return VR[e]}function GR(e){return qR.test(e)?e.replace(jR,KR):e}const YR=/[.?*+^$[\]\\(){}|-]/g;function XR(e){return e.replace(YR,"\\$&")}const QR={mdurl:LA,ucmicro:cp};function Yn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
59
- `,n+1))!==-1;)t++;return t}const ZR=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,JR=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,e7=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,b0=["references","footnotes","abbreviations","abbr","abbrs"],_0=Symbol.for("markdown-it-ts.global-state"),w0=Object.prototype.hasOwnProperty;function N_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function ai(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function zr(e){if(Array.isArray(e))return e.map(t=>zr(t));if(ai(e)){const t={};for(const n of Object.keys(e))t[n]=zr(e[n]);return t}return e}function fp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):ai(e)?Object.keys(e):[]}function Uv(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(!Uv(e[n],t[n]))return!1;return!0}if(ai(e)||ai(t)){if(!ai(e)||!ai(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(!w0.call(t,o)||!Uv(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function HA(e,t){if(Array.isArray(e))return e[Number(t)];if(ai(e))return e[t]}function t7(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=zr(t[n]);return e}if(ai(e)&&ai(t)){for(const n of Object.keys(e))w0.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=zr(t[n]);return e}return zr(t)}function n7(e,t,n){const s=n.ownedKeys??[],o=e[t];if(ai(o)||Array.isArray(o)){const i=new Set(fp(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=zr(HA(n.value,r)):delete o[r];!n.existed&&fp(o).length===0&&delete e[t];return}n.existed?e[t]=zr(n.value):delete e[t]}function S0(e){const t=e[_0];return N_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&N_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function s7(e,t){Object.defineProperty(e,_0,{value:t,enumerable:!1,configurable:!0,writable:!0})}function so(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:ZR.test(e)?"footnote-definition":JR.test(e)?"abbreviation-definition":e7.test(e)?"reference-definition":null}function sd(e){return S0(e)?.reason??null}function Va(e,t,n){if(sd(e)&&or(e),!t)return n();C0(e,t);try{const s=n();return x0(e),s}catch(s){throw or(e),s}}function C0(e,t){try{or(e);const n={};for(const s of b0)n[s]=w0.call(e,s)?{existed:!0,value:zr(e[s])}:{existed:!1};s7(e,{reason:t,snapshot:n})}catch{}}function x0(e){const t=S0(e);if(t)for(const n of b0){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!ai(o)&&!Array.isArray(o))continue;const i=new Set(fp(s.existed?s.value:void 0));s.ownedKeys=fp(o).filter(r=>i.has(r)?!Uv(o[r],HA(s.value,r)):!0)}}function or(e){const t=S0(e);if(t){for(const n of b0){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){n7(e,n,s);continue}s.existed?e[n]=t7(e[n],s.value):delete e[n]}delete e[_0]}}const qv=Symbol.for("markdown-it-ts.diagnostics");function mh(e,t){if(e)try{const n=e[qv];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[qv]=s,s}catch{return}}function zi(e){return mh(e,!1)}function o7(e){if(e)try{const t=e[qv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function qs(e){o7(e)}function os(e,t){const n=mh(e,!0);n&&(n.strategy=t)}function sg(e,t){const n=mh(e,!0);n&&(n.chunk=t)}function WA(e,t){const n=mh(e,!0);n&&(n.unbounded=t)}function i7(e){const t={};e=e||{},t.src_Any=OA.source,t.src_Cc=PA.source,t.src_Z=DA.source,t.src_P=RA.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function jv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function gh(e){return Object.prototype.toString.call(e)}function r7(e){return gh(e)==="[object String]"}function l7(e){return gh(e)==="[object Object]"}function a7(e){return gh(e)==="[object RegExp]"}function L_(e){return gh(e)==="[object Function]"}function c7(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const zA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function u7(e){return Object.keys(e||{}).reduce(function(t,n){return t||zA.hasOwnProperty(n)},!1)}const d7={"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}}},f7="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]",p7="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function h7(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function O_(){return function(e,t){t.normalize(e)}}function pp(e){const t=e.re=i7(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(f7),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,l7(a)){a7(a.validate)?c.validate=h7(a.validate):L_(a.validate)?c.validate=a.validate:i(l,a),L_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=O_();return}if(r7(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:O_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(c7).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function UA(e,t,n,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 $o(e,t){if(!(this instanceof $o))return new $o(e,t);t||u7(e)&&(t=e,e={}),this.__opts__=jv({},zA,t),this.__schemas__=jv({},d7,e),this.__compiled__={},this.__tlds__=p7,this.__tlds_replaced__=!1,this.re={},pp(this)}$o.prototype.add=function(t,n){return this.__schemas__[t]=n,pp(this),this};$o.prototype.set=function(t){return this.__opts__=jv(this.__opts__,t),this};$o.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)};$o.prototype.pretest=function(t){return this.re.pretest.test(t)};$o.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};$o.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 UA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};$o.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 UA(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};$o.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(),pp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,pp(this),this)};$o.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};$o.prototype.onCompile=function(){};var qA=$o,m7=MA({"../../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,b=Math.floor,_=String.fromCharCode;function g(D){throw new RangeError(p[D])}function v(D,H){const z=[];let U=D.length;for(;U--;)z[U]=H(D[U]);return z}function y(D,H){const z=D.split("@");let U="";z.length>1&&(U=z[0]+"@",D=z[1]),D=D.replace(h,".");const Q=v(D.split("."),H).join(".");return U+Q}function C(D){const H=[];let z=0;const U=D.length;for(;z<U;){const Q=D.charCodeAt(z++);if(Q>=55296&&Q<=56319&&z<U){const X=D.charCodeAt(z++);(X&64512)==56320?H.push(((Q&1023)<<10)+(X&1023)+65536):(H.push(Q),z--)}else H.push(Q)}return H}const L=D=>String.fromCodePoint(...D),$=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},k=function(D,H){return D+22+75*(D<26)-((H!=0)<<5)},M=function(D,H,z){let U=0;for(D=z?b(D/700):D>>1,D+=b(D/H);D>m*26>>1;U+=36)D=b(D/m);return b(U+(m+1)*D/(D+38))},E=function(D){const H=[],z=D.length;let U=0,Q=128,X=72,ue=D.lastIndexOf("-");ue<0&&(ue=0);for(let me=0;me<ue;++me)D.charCodeAt(me)>=128&&g("not-basic"),H.push(D.charCodeAt(me));for(let me=ue>0?ue+1:0;me<z;){const Ae=U;for(let ze=1,qe=36;;qe+=36){me>=z&&g("invalid-input");const Fe=$(D.charCodeAt(me++));Fe>=36&&g("invalid-input"),Fe>b((2147483647-U)/ze)&&g("overflow"),U+=Fe*ze;const Le=qe<=X?1:qe>=X+26?26:qe-X;if(Fe<Le)break;const le=36-Le;ze>b(2147483647/le)&&g("overflow"),ze*=le}const be=H.length+1;X=M(U-Ae,be,Ae==0),b(U/be)>2147483647-Q&&g("overflow"),Q+=b(U/be),U%=be,H.splice(U++,0,Q)}return String.fromCodePoint(...H)},O=function(D){const H=[];D=C(D);const z=D.length;let U=128,Q=0,X=72;for(const Ae of D)Ae<128&&H.push(_(Ae));const ue=H.length;let me=ue;for(ue&&H.push("-");me<z;){let Ae=2147483647;for(const ze of D)ze>=U&&ze<Ae&&(Ae=ze);const be=me+1;Ae-U>b((2147483647-Q)/be)&&g("overflow"),Q+=(Ae-U)*be,U=Ae;for(const ze of D)if(ze<U&&++Q>2147483647&&g("overflow"),ze===U){let qe=Q;for(let Fe=36;;Fe+=36){const Le=Fe<=X?1:Fe>=X+26?26:Fe-X;if(qe<Le)break;const le=qe-Le,F=36-Le;H.push(_(k(Le+le%F,0))),qe=b(le/F)}H.push(_(k(qe,0))),X=M(Q,be,me===ue),Q=0,++me}++Q,++U}return H.join("")},P={version:"2.3.1",ucs2:{decode:C,encode:L},decode:E,encode:O,toASCII:function(D){return y(D,function(H){return f.test(H)?"xn--"+O(H):H})},toUnicode:function(D){return y(D,function(H){return d.test(H)?E(H.slice(4).toLowerCase()):H})}};t.exports=P})}),jA=IA(m7());function A0(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=Fu(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=Fu(e.slice(t,o)),i.pos=o,i.ok=!0),i}var VA=A0;const wf=-2;function g7(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 wf}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return wf;if(r===91){o++,i++;continue}i++}return-1}function T0(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=g7(l,t,a,n);if(f!==wf)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 hp=T0;function M0(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+=Fu(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+=Fu(e.slice(t,i)),r}var KA=M0;function vh(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 E0(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function v7(e,t,n){const s=vh(e,t),o=[t,n];s<0?E0(e,o):e.attrs[s]=o}function y7(e,t){const n=vh(e,t);return n>=0?e.attrs[n][1]:null}function k7(e,t,n){const s=vh(e,t);s<0?E0(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var b7=BA({attrGet:()=>y7,attrIndex:()=>vh,attrJoin:()=>k7,attrPush:()=>E0,attrSet:()=>v7,parseLinkDestination:()=>A0,parseLinkLabel:()=>T0,parseLinkTitle:()=>M0});function _7(e){return e.includes("\r")||e.includes("\0")}function GA(e){return typeof e=="string"?e:e.toString()}function w7(e){if(e.inlineMode){const t=new rs("inline","",0);t.content=GA(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const S7=/^([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])?)*)$/,C7=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function x7(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(C7.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(S7.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 A7=x7;function T7(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(`
60
- `)&&(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 M7=T7;function P_(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 E7(e){const t=e.tokens_meta,n=e.tokens_meta.length;P_(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&P_(t[s].delimiters)}var I7=E7;function $7(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 R_(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 N7(e){const t=e.tokens_meta,n=e.tokens_meta.length;R_(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&R_(e,t[s].delimiters)}const D_={tokenize:$7,postProcess:N7};function YA(e){return v0(e)}function I0(e){return e>=48&&e<=57}function L7(e){const t=e|32;return I0(e)||t>=97&&t<=102}function XA(e){const t=e|32;return t>=97&&t<=122}function O7(e){return XA(e)||I0(e)}function P7(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?L7(l):I0(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function R7(e,t,n){let s=t+1;if(s>=n||!XA(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&O7(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 YA(o)!==o?o:null}function D7(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=P7(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=hh(i)?Bu(i):Bu(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=R7(e.src,n,s);if(o){const i=YA(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 B7=D7;const QA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Vv=new Array(128),ZA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Vv[e]=`\\${t}`,ZA[e]=QA[e]?t:Vv[e]}function B_(e,t,n){e.pending&&e.pushPending();const s=new rs("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 F7(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):(B_(e,ZA[i],Vv[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 B_(e,i<256&&QA[i]?r:l,l),e.pos=n+1,!0}var H7=F7;function W7(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 z7=W7;const JA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,eT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",U7=new RegExp(`^(?:${JA}|${eT}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),q7=new RegExp(`^(?:${JA}|${eT})`);function tT(e){return e===32||e===9||e===10||e===12||e===13}function j7(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||tT(t)}function V7(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(!tT(n))return!1}return!1}function K7(e){const t=e|32;return t>=97&&t<=122}function G7(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&&!K7(i))return!1;const r=o.slice(s).match(U7);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,j7(l)&&e.linkLevel++,V7(l)&&e.linkLevel--}return e.pos+=l.length,!0}var Y7=G7;function X7(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=hp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=VA(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=KA(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=hp(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[ph(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 b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=m,b.content=s,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var Q7=X7;function Z7(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=hp(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=VA(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=KA(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=hp(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[ph(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),b=[["href",r]];m.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var J7=Z7;function nT(e){const t=e|32;return t>=97&&t<=122}function eD(e){return e>=48&&e<=57}function tD(e){return nT(e)||eD(e)||e===43||e===45||e===46}function nD(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&tD(e.charCodeAt(t));)t--;return t++,t>=e.length||!nT(e.charCodeAt(t))?null:e.slice(t)}function sD(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 oD(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=nD(e.pending);if(!o)return!1;const i=sD(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 iD(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 rD=iD;function lD(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 F_(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 aD(e){const t=e.delimiters;F_(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&F_(e,n[s].delimiters)}const H_={tokenize:lD,postProcess:aD};function W_(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 cD(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||W_(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!W_(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var uD=cD;function $0(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function dD(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 fD(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 sT(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:$0(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function Ka(e,t,n,s,o,i){const r=sT(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=fD(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=$0()}function pD(e){const t=sT(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=dD(o.samples)}return t.completedAt=$0(),t}var z_=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}},oT=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 rs("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 rs(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 rs(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=Du(l),u=Du(a),d=zv(l),f=zv(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}}};oT.prototype.Token=rs;const hD=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function iT(e){return!hD.test(e)}var mD=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new z_,this.ruler2=new z_,this.ruler.push("text",uD),this.ruler.push("linkify",oD),this.ruler.push("newline",rD),this.ruler.push("escape",H7),this.ruler.push("backticks",M7),this.ruler.push("strikethrough",H_.tokenize),this.ruler.push("emphasis",D_.tokenize),this.ruler.push("link",J7),this.ruler.push("image",Q7),this.ruler.push("autolink",A7),this.ruler.push("html_inline",Y7),this.ruler.push("entity",B7),this.ruler2.push("balance_pairs",I7),this.ruler2.push("strikethrough",H_.postProcess),this.ruler2.push("emphasis",D_.postProcess),this.ruler2.push("fragments_join",z7),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(Ka(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(Ka(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()&&iT(e)){const a=new rs("text","",0);a.content=e,s.push(a);return}const o=new oT(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();Ka(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 gD(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&&iT(i.content)){const r=new rs("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const vD=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,yD=/[0-9a-z]/i;function kD(e){return/^<a[>\s]/i.test(e)}function bD(e){return/^<\/a\s*>/i.test(e)}function _D(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(!vD.test(s)||!yD.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 wD(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"&&(kD(l.content)&&i>0&&i--,bD(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=>_D(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 b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const _=p.index;if(_>f){const C=new rs("text","",0);C.content=a.slice(f,_),C.level=d,u.push(C)}const g=new rs("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new rs("text","",0);v.content=b,v.level=d,u.push(v);const y=new rs("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 rs("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const SD=/\r\n?|\n/g,CD=/\0/g;function xD(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(SD,`
61
- `)),s&&(o=o.replace(CD,"�")),e.src=o}const rT=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,AD=/\((?:c|tm|r)\)/i,TD=/\((c|tm|r)\)/gi,MD={c:"©",r:"®",tm:"™"};function ED(e,t){return MD[t.toLowerCase()]}function ID(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(TD,ED)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function $D(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&rT.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 ND(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(""):"");AD.test(s)&&ID(n.children||[]),rT.test(s)&&$D(n.children||[])}}var LD=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 OD=/['"]/,U_=/['"]/g,q_="’";function Xd(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function PD(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;){U_.lastIndex=c;const d=U_.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 b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const _=dp(m)||up(String.fromCharCode(m)),g=dp(b)||up(String.fromCharCode(b)),v=Du(m),y=Du(b);if(y?f=!1:g&&(v||_||(f=!1)),v?h=!1:_&&(y||g||(h=!1)),b===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=_,h=g),!f&&!h){p&&(r.content=Xd(r.content,d.index,q_));continue}if(h)for(n=s.length-1;n>=0;n--){let C=s[n];if(s[n].level<l)break;if(C.single===p&&s[n].level===l){C=s[n];let L,$;p?(L=o[2]||"‘",$=o[3]||"’"):(L=o[0]||"“",$=o[1]||"”"),r.content=Xd(r.content,d.index,$),e[C.token].content=Xd(e[C.token].content,C.pos,L),c+=$.length-1,C.token===i&&(c+=L.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=Xd(r.content,d.index,q_))}}}function RD(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("");!OD.test(s)||!n.children||PD(n.children,e)}}function DD(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 BD=/^(?:vbscript|javascript|file|data):/,FD=/^data:image\/(?:gif|png|jpeg|webp);/,lT=["http:","https:","mailto:"];function aT(e){const t=e.trim().toLowerCase();return BD.test(t)?FD.test(t):!0}function cT(e){const t=k0(e,!0);if(t.hostname&&(!t.protocol||lT.includes(t.protocol)))try{t.hostname=jA.default.toASCII(t.hostname)}catch{}return NA(y0(t))}function uT(e){const t=k0(e,!0);if(t.hostname&&(!t.protocol||lT.includes(t.protocol)))try{t.hostname=jA.default.toUnicode(t.hostname)}catch{}return Wv(y0(t),`${Wv.defaultChars}%`)}function HD(e){switch(e){case 9:case 32:return!0}return!1}function WD(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 O=a[y]+1,S,I;o.charCodeAt(u)===32?(u++,O++,I=!1,S=!0):o.charCodeAt(u)===9?(S=!0,(c[y]+O)%4===3?(u++,O++,I=!1):I=!0):S=!1;let P=O;for(h.push(i[y]),i[y]=u;u<d;){const D=o.charCodeAt(u);if(HD(D))D===9?P+=4-(P+c[y]+(I?1:0))%4:P++;else break;u++}v=u>=d,p.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=P-O,b.push(l[y]),l[y]=u-i[y];continue}if(v)break;let E=!1;for(let O=0,S=_.length;O<S;O++)if(_[O](e,y,n,!0)){E=!0;break}if(E){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),p.push(c[y]),b.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),p.push(c[y]),b.push(l[y]),m.push(a[y]),a[y]=-1}const C=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const $=[t,0];L.map=$,e.md.block.tokenize(e,t,y);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=f,e.parentType=g,$[1]=e.line;for(let M=0;M<b.length;M++)i[M+t]=h[M],l[M+t]=b[M],a[M+t]=m[M],c[M+t]=p[M];return e.blkIndent=C,!0}function zD(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)}
62
- `,i.map=[t,e.line],!0}function UD(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 j_=["","h1","h2","h3","h4","h5","h6"],V_=["","#","##","###","####","#####","######"];function K_(e){switch(e){case 9:case 32:return!0}return!1}function qD(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&&!K_(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&K_(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",j_[d],1);h.markup=V_[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",j_[d],-1);return m.markup=V_[d],!0}function jD(e){switch(e){case 9:case 32:return!0}return!1}function VD(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&&!jD(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 va=[[/^<(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(`${q7.source}\\s*$`),/^$/,!1]];function KD(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<va.length&&!va[l][0].test(r);l++);if(l===va.length)return!1;if(s)return va[l][2];let a=t+1;if(!va[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),va[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 G_(e){switch(e){case 9:case 32:return!0}return!1}const lu={Pipe:1,ParagraphTerminator:2};function GD(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 dT=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|=lu.Pipe|lu.ParagraphTerminator),!a)if(G_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,GD(f)&&(c|=lu.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 rs(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new rs(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,b=this.bsCount,_=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+b[u])%4:p++;else if(f-d<_[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 b=i.charCodeAt(p);if(G_(b))b===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("")}};dT.prototype.Token=rs;function YD(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function fT(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function pT(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&lu.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:YD(n,s,o)}const Y_=["","h1","h2"];function XD(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=fT(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],C=l[p];if(y>=C)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(y),h===45||h===61)){let $=y+1,k=$;for(;$<C&&o.charCodeAt($)===h;)$++;for(k=$;$<C;){const M=o.charCodeAt($);if(M!==9&&M!==32)break;$++}if($>=C){f=h===61?1:2;break}if(k-y>1)continue}if(a[p]<0||u&&!pT(e,p,o,y,C))continue;let L=!1;for(let $=0,k=s.length;$<k;$++)if(s[$](e,p,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(p===t+1){const y=i[t]+r[t];let C=l[t];for(;C>y;){const L=o.charCodeAt(C-1);if(L!==9&&L!==32)break;C--}m=o.slice(y,C)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",_=e.push("heading_open",Y_[f],1);_.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",Y_[f],-1);return v.markup=b,e.parentType=d,!0}function hT(e){switch(e){case 9:case 32:return!0}return!1}function X_(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&&!hT(i.charCodeAt(l))?-1:l}function Q_(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),!hT(c))?-1:a}function QD(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 ZD=["0","1","2","3","4","5","6","7","8","9"];function JD(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 e9(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,b=e.eMarks,_=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=b[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(f=Q_(e,l),f<0||(u=!0,r=v,d=QD(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=X_(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(s)return!0;const C=h.charCodeAt(f-1),L=String.fromCharCode(C);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=L;let k=!1;const M=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),O=e.parentType;for(e.parentType="list";l<n;){i=f,o=b[l];const S=_[l]+f-(p[l]+m[l]);let I=S;for(;i<o;){const be=h.charCodeAt(i);if(be===9)I+=4-(I+g[l])%4;else if(be===32)I++;else break;i++}const P=i;let D;P>=o?D=1:D=I-S,D>4&&(D=1);const H=S+D,z=e.push("list_item_open","li",1);z.markup=L;const U=[l,0];z.map=U,u&&(z.info=f-r-1===1?ZD[h.charCodeAt(r)-48]:h.slice(r,f-1));const Q=e.tight,X=e.tShift[l],ue=e.sCount[l],me=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=H,e.tight=!0,e.tShift[l]=P-p[l],e.sCount[l]=I,P>=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=me,e.tShift[l]=X,e.sCount[l]=ue,e.tight=Q,e.push("list_item_close","li",-1).markup=L,l=e.line,U[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let Ae=!1;for(let be=0,ze=E.length;be<ze;be++)if(E[be](e,l,n,!0)){Ae=!0;break}if(Ae)break;if(u){if(f=Q_(e,l),f<0)break;r=p[l]+m[l]}else if(f=X_(e,l),f<0)break;if(C!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=L:e.push("bullet_list_close","ul",-1).markup=L,$[1]=l,e.line=l,e.parentType=O,a&&JD(e,M),!0}function Z_(e){return e===9||e===32}function t9(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=fT(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 C=i.charCodeAt(v);if(C===42||C===45||C===43){if(v+1>=y||Z_(i.charCodeAt(v+1)))break}else if(C>=48&&C<=57&&v+1<y){let L=v+1;for(;;){if(L>=y){L=-1;break}const $=i.charCodeAt(L++);if($>=48&&$<=57){if(L-v>=10){L=-1;break}continue}if(($===41||$===46)&&(L>=y||Z_(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const b=r[f]+l[f],_=a[f];if(d&&!pT(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 Qd(e){switch(e){case 9:case 32:return!0}return!1}function n9(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 C=!1;if(e.sCount[v]-e.blkIndent>3&&(C=!0),e.sCount[v]<0&&(C=!0),!C){const k=e.parentType;e.parentType="reference";let M=!1;for(let E=0,O=l.length;E<O;E++)if(l[E](e,v,y,!0)){M=!0;break}if(e.parentType=k,M)return null}const L=e.bMarks[v]+e.tShift[v],$=e.eMarks[v];return e.src.slice(L,$+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(!Qd(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(!Qd(v))break}let b=e.md.helpers.parseLinkTitle(c,o,i);for(;b.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,o,i,b)}let _;for(o<i&&m!==o&&b.ok?(_=b.str,o=b.pos):(_="",o=h,r=p);o<i&&Qd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&_)for(_="",o=h,r=p;o<i&&Qd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=ph(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:_,href:f}),e.line=r),!0):!1}function og(e){switch(e){case 9:case 32:return!0}return!1}const s9=65536;function ig(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function o9(e,t){if(e.lineFlags)return(e.lineFlags[t]&lu.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 J_(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 i9(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&&!og(l)||r===45&&og(l)||!o9(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!og(y))return!1;i++}let a=ig(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const C=c[y].trim();if(!C){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?u.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=ig(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=J_(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 b=e.push("thead_open","thead",1);b.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let y=0;y<c.length;y++){const C=e.push("th_open","th",1);u[y]&&(C.attrs=[["style",`text-align:${u[y]}`]]);const L=e.push("inline","",0);L.content=c[y].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let L=0,$=h.length;L<$;L++)if(h[L](e,o,n,!0)){y=!0;break}if(y||(a=ig(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=J_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>s9))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const C=e.push("tr_open","tr",1);C.map=[o,o+1];for(let L=0;L<d;L++){const $=e.push("td_open","td",1);u[L]&&($.attrs=[["style",`text-align:${u[L]}`]]);const k=e.push("inline","",0);k.content=c[L]?c[L].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 r9=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 Ka(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 Zd=[["table",i9,["paragraph","reference"]],["code",zD],["fence",UD,["paragraph","reference","blockquote","list"]],["blockquote",WD,["paragraph","reference","blockquote","list"]],["hr",VD,["paragraph","reference","blockquote","list"]],["list",e9,["paragraph","reference","blockquote"]],["reference",n9],["html_block",KD,["paragraph","reference","blockquote"]],["heading",qD,["paragraph","reference","blockquote"]],["lheading",XD],["paragraph",t9]];var l9=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new r9;for(let e=0;e<Zd.length;e++)this.ruler.push(Zd[e][0],Zd[e][1],{alt:(Zd[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 b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Ka(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 dT(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}},mT=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}};mT.prototype.Token=rs;const ew=[["normalize",xD],["block",w7],["inline",gD],["linkify",wD],["replacements",ND],["smartquotes",RD],["text_join",DD]],a9={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},c9={parseLinkLabel:T0,parseLinkDestination:A0,parseLinkTitle:M0};function u9(){return{...a9}}function d9(){return{...c9}}var f9=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new l9,this.inline=new mD,this.ruler=new LD;for(let e=0;e<ew.length;e++){const[t,n]=ew[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:u9(),helpers:d9(),normalizeLink:cT,normalizeLinkText:uT,validateLink:aT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new qA),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new mT(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();Ka(e.env,"core",t[n].name,o-s,!0,!1)}pD(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&_7(e))return this.parse(GA(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 p9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function mp(e){return!p9.test(e)}function Xc(e,t){const n=e.indexOf(`
63
- `,t);return n===-1?e.length:n}function Sf(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 tw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function rg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function h9(e){if(e.length>3)return mp(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const m9=["","h1","h2","h3","h4","h5","h6"],g9=["","#","##","###","####","#####","######"],nw=0,lg=1,ag=2;function So(e,t,n,s){const o=new rs(e,t,n);return o.level=s,o.block=!0,o}function gT(e,t,n){const s=So("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new rs("text","",0);return o.content=e,s.children=[o],s}function v9(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(!mp(u))return!1;const d=m9[i],f=g9[i],h=So("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(gT(u,o,1));const p=So("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function y9(e,t,n){const s=So("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(gT(t,n,1)),e.push(So("paragraph_close","p",-1,0))}function k9(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function cg(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function b9(e,t){const n=So("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function _9(e,t,n){const s=So("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=So("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=So("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new rs("text","",0);r.content=t,i.children=[r],e.push(i);const l=So("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=So("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function w9(e){const t=So("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function S9(e,t,n,s){if(!tw(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=Xc(e,l);if(tw(e,l,c)&&Sf(e,l+3,c)){const u=So("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 C9(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?nw:ag,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Xc(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(!Sf(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!v9(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=cg(e,h),l+=1+r-h;continue}if(c===45){if(!rg(e,r,a))return null;const h=l;let p=r,m=l,b=null,_=null;for(;p<e.length;){const y=Xc(e,p);if(!rg(e,p,y))break;const C=p+2,L=y===C+1?e[C]:e.slice(C,y);if(!h9(L))return null;b===null&&(b=b9(t,h)),_=_9(t,L,m),p=y<e.length?y+1:y,m++}if(b===null||_===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=Xc(e,g);if(!Sf(e,g,y)){if(rg(e,g,y))return null;break}g=y<e.length?y+1:y,v++}b.map[1]=v,_.map[1]=v,w9(t),r=g,l=v;continue}if(c===96){const h=S9(e,r,a,l);if(!h)return null;t.push(h.token),r=cg(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=k9(e,r,a);let d;if(n===ag?d=mp(u):n===lg&&u===s?d=o:(d=mp(u),n===nw?(i&&(n=u===s?lg:ag),s=u,o=d,i=!0):n===lg&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!Sf(e,f,Xc(e,f)))return null;y9(t,u,l),r=cg(e,f),l+=1+r-f}return t}const x9=/[&<>"]/,sw=/[&<>"]/g,A9=/&/g,T9=/[<>"]/g,M9={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function ug(e){return M9[e]||e}function Cn(e){if(e.length===0)return"";if(e.length<32)return x9.test(e)?e.replace(sw,ug):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(A9,"&amp;"):t?e.replace(sw,ug):e.replace(T9,ug)}const E9=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),I9=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function vT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(E9,(t,n,s)=>{if(n)return n;if(I9.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return hh(i)?Bu(i):"�"}const o=v0(t);return o!==t?o:t})}const $9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,N9=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,L9=/"/g;function Na(e,t){const n=e.indexOf(`
64
- `,t);return n===-1?e.length:n}function gp(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 Jd(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function O9(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!gp(e,t,Na(e,t))}function ow(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function P9(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function N0(e){return N9.test(e)?$9.test(e)?null:e.replace(L9,"&quot;"):e}function R9(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=N0(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
65
- `}function iw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function D9(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
66
- `;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>
67
- `}function B9(e,t,n){const s=t+2;if(n===s+1)return D9(e,s);const o=N0(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
68
- `}function F9(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 H9(e,t,n,s){if(!ow(e,t,n))return null;const o=F9(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=Na(e,l);if(ow(e,l,a)&&gp(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-${Cn(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${Cn(c)}</code></pre>
69
- `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function rw(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=Na(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!gp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=R9(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=Jd(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=Na(e,m);if(!iw(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const b=e.slice(t,m);let _;if(b===r)_=l;else{let v=t;for(_=`<ul>
70
- `;v<m;){const y=Na(e,v),C=B9(e,v,y);if(C===null)return null;_+=C,v=y<e.length?y+1:y}_+=`</ul>
71
- `,r=b,l=_}let g=Jd(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=Na(e,g);if(!gp(e,g,v)){if(iw(e,g,v))return null;break}g=v<e.length?v+1:v}s?o.push(_):n+=_,t=g;continue}if(d===96){const m=H9(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=Jd(e,m.nextPos);continue}const f=P9(e,t,u);let h;if(f===a)h=c;else{const m=N0(f);if(m===null)return null;h=`<p>${m}</p>
72
- `,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&O9(e,p))return null;s?o.push(h):n+=h,t=Jd(e,p)}return s?o.join(""):n}const W9={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function vp(e,t,n={},s){qs(n);const o={...W9,...s||{}},i=so(t);if(o.fallbackOnGlobalState!==!1&&i)return sg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Va(n,i,()=>e.core.parse(t,n,e).tokens);let r=Cf(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=j9(r,o.maxChunks)),xf(t,r))return sg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Va(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return sg(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Va(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&&U9(f,l),q9(a,f),l+=u.lineCount}return a})}function Cf(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(`
73
- `,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=V9(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 C=y-g;C>=3&&(u?u.marker===v&&C>=u.length&&(u=null):u={marker:v,length:C})}}const b=p-f;o+=b,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=b);const _=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(_)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 xf(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!z9(e,t[o].end))return!0;return!1}function z9(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 U9(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 q9(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function j9(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 V9(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 yT=4e6,kT=8e4,K9=1e4,G9=200,Y9=1e4,X9=200;function bT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Q9(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 br(e){return e.length===0?0:Yn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Z9(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 J9(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
74
- `,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 eB(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 Z9(e,n+1,e.length-1)?!J9(e,t):!1}function tB(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??Y9:e.options.fullChunkSizeChars??K9),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??X9:e.options.fullChunkSizeLines??G9);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 od=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=br(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=Cf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(xf(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,br(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!eB(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,br(this.pending)),null;const n=Cf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,br(this.pending)),null;const s=xf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:br(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=Cf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=xf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:br(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:br(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+br(this.pending);return tB(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(sd(e)&&or(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=so(t);n&&(C0(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&&Q9(r,a),this.options.retainTokens!==!1&&bT(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&&x0(t),n}catch(s){throw this.markedGlobalStateReason&&(or(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){WA(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function nB(e,t,n={},s={}){qs(n);const o=new od(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function sB(e,t,n={},s={}){qs(n);const o=new od(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function oB(e,t,n,s={},o={}){qs(s);const i=new od(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 iB(e,t,n,s={},o={}){qs(s);const i=new od(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 _T(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??yT,o=e.options.autoUnboundedThresholdLines??kT;return t>=s||n>=o}function wT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??yT))return"yes";const s=e.options.autoUnboundedThresholdLines??kT;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function au(e,t,n={},s={}){qs(n);const o=so(t);if(sd(n)&&or(n),s.fallbackOnGlobalState!==!1&&o)return WA(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:Yn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Va(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new od(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){bT(i,l)}});if(o&&C0(n,o),r.feed(t),r.flushForce(n),o&&(x0(n),s.fallbackOnGlobalState===!1)){const l=zi(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const Ga=(e,t,n)=>e<t?t:e>n?n:e;function ST(e){return e.experimental?{...e,...e.experimental}:e}const lw=[{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"}],aw=[{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 CT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function rB(e,t=Math.max(0,e/40|0),n={}){const s=ST(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<lw.length;l++){const a=lw[l];if(e<=a.max){if(a.strategy!=="adaptive")return CT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ga(Math.ceil(t/i),150,700),maxChunks:Ga(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function cw(e,t=Math.max(0,e/40|0),n={}){const s=ST(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<aw.length;l++){const a=aw[l];if(e<=a.max){if(a.strategy!=="adaptive")return CT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ga(Math.ceil(t/i),150,700),maxChunks:Ga(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var lB={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"]}}},aB={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},cB={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 yh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Af(e,t){if(yh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const uw=e=>yh(e)?e:Promise.resolve(e);function cu(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 Cn(e)}}function Yr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${cu(t[0])}="${Cn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${cu(o[0])}="${Cn(o[1])}"`}return n}function xT(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 uu(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
75
- `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Cn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
76
- `;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${Yr(r)}>${t}</code></pre>
77
- `}return`<pre><code${Yr(e.attrs)}>${t}</code></pre>
78
- `}function yp(e){return!e.attrs||e.attrs.length===0?`<code>${Cn(e.content)}</code>`:`<code${Yr(e.attrs)}>${Cn(e.content)}</code>`}function Kv(e){const t=Cn(e.content);return e.attrs?`<pre${Yr(e.attrs)}><code>${t}</code></pre>
79
- `:`<pre><code>${t}</code></pre>
80
- `}function uB(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="${Cn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Cn(n[0][1])}">`}return null}function dw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${cu(t[0][0])}="${Cn(t[0][1])}">`:t.length===2?`<a ${cu(t[0][0])}="${Cn(t[0][1])}" ${cu(t[1][0])}="${Cn(t[1][1])}">`:`<a${Yr(t)}>`}function dB(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 fw(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function kp(e,t){if(e.hidden)return"";const n=e.attrs,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+Yr(n);return s===0&&t&&(i+=" /"),`${i}>`}const fB={langPrefix:"language-",xhtmlOut:!1,breaks:!1},ef=Object.prototype.hasOwnProperty,Sn={code_inline(e,t){return yp(e[t])},code_block(e,t){return Kv(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?vT(i.info).trim():"",{langName:l,langAttrs:a}=xT(r),c=n.highlight,u=Cn(i.content);if(!c)return uu(i,u,r,l,n);const d=c(i.content,l,a);return yh(d)?d.then(f=>uu(i,f||u,r,l,n)):uu(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]],kp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
81
- `:`<br>
82
- `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
83
- `:`<br>
84
- `:`
85
- `},text(e,t){return Cn(e[t].content)},text_special(e,t){return Cn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function pw(e,t,n){const s=e.info?vT(e.info).trim():"",{langName:o,langAttrs:i}=xT(s),r=t.highlight,l=Cn(e.content);if(!r)return uu(e,l,s,o,t);const a=r(e.content,o,i);if(yh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return uu(e,a||l,s,o,t)}function tf(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===Sn.text)return l.content.length===0?"":Cn(l.content);break;case"text_special":if(o.text_special===Sn.text_special)return l.content.length===0?"":Cn(l.content);break;case"softbreak":if(o.softbreak===Sn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===Sn.hardbreak)return i;break;case"html_inline":if(o.html_inline===Sn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===Sn.code_inline)return yp(l);break}const a=o[l.type];if(!a)return kp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Af(c,l.type)}var pB=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Sn}}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,b="";for(let _=0;_<e.length;_++){const g=e[_],v=g.type,y=_>0&&e[_-1].hidden?`
86
- `:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&_+3<e.length){const $=e[_+1],k=e[_+2],M=e[_+3];if($.type==="paragraph_open"&&$.hidden&&k.type==="inline"&&M.type==="paragraph_close"&&M.hidden){b+=`${y}<li>${this.renderInlineTokens(k.children||[],s,o)}`,_+=3;continue}}if(_+2<e.length){const $=e[_+1],k=e[_+2];if($.type==="inline"&&k.nesting===-1&&k.tag===g.tag&&!k.hidden){const M=uB(g,y);if(M!==null){b+=`${M+this.renderInlineTokens($.children||[],s,o)}</${g.tag}>
87
- `,_+=2;continue}}}if(v==="inline"){const $=g.children||[];if($.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 />
88
- `:`<br>
89
- `,p=s.breaks?h:`
90
- `,m=!0);const k=$[0];switch(k.type){case"text":if(l===Sn.text){b+=Cn(k.content);continue}break;case"text_special":if(a===Sn.text_special){b+=Cn(k.content);continue}break;case"softbreak":if(c===Sn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Sn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Sn.html_inline){b+=k.content;continue}break;case"code_inline":if(f===Sn.code_inline){b+=yp(k);continue}break}}b+=this.renderInlineTokens($,s,o);continue}const C=i[v];if(!C){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(v){case"hr":b+=r?`<hr />
91
- `:`<hr>
92
- `;continue;case"heading_open":b+=`<${g.tag}>`;continue;case"heading_close":b+=`</${g.tag}>
93
- `;continue;case"paragraph_open":b+=`${y}<p>`;continue;case"paragraph_close":b+=`</p>
94
- `;continue;case"list_item_open":{const k=e[_+1];b+=y+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
95
- `);continue}case"list_item_close":b+=`</li>
96
- `;continue;case"bullet_list_open":b+=`${y}<ul>
97
- `;continue;case"bullet_list_close":b+=`</ul>
98
- `;continue;case"blockquote_open":b+=y+(e[_+1]&&e[_+1].nesting===-1&&e[_+1].tag==="blockquote"?"<blockquote>":`<blockquote>
99
- `);continue;case"blockquote_close":b+=`</blockquote>
100
- `;continue;case"ordered_list_open":b+=`${y}<ol>
101
- `;continue;case"ordered_list_close":b+=`</ol>
102
- `;continue;case"table_open":b+=`${y}<table>
103
- `;continue;case"table_close":b+=`</table>
104
- `;continue;case"thead_open":b+=`${y}<thead>
105
- `;continue;case"thead_close":b+=`</thead>
106
- `;continue;case"tbody_open":b+=`${y}<tbody>
107
- `;continue;case"tbody_close":b+=`</tbody>
108
- `;continue;case"tr_open":b+=`${y}<tr>
109
- `;continue;case"tr_close":b+=`</tr>
110
- `;continue;case"td_open":b+=`${y}<td>`;continue;case"td_close":b+=`</td>
111
- `;continue;case"th_open":b+=`${y}<th>`;continue;case"th_close":b+=`</th>
112
- `;continue}else if($.length===1){const k=$[0];if(v==="ordered_list_open"&&k[0]==="start"){b+=`${y}<ol start="${Cn(k[1])}">
113
- `;continue}if(v==="td_open"&&k[0]==="style"){b+=`${y}<td style="${Cn(k[1])}">`;continue}if(v==="th_open"&&k[0]==="style"){b+=`${y}<th style="${Cn(k[1])}">`;continue}}}b+=this.renderToken(e,_,s);continue}if(v==="code_block"&&C===Sn.code_block){b+=Kv(g);continue}if(v==="fence"&&C===Sn.fence){b+=pw(g,s);continue}if(v==="html_block"&&C===Sn.html_block){b+=g.content;continue}const L=C(e,_,s,o,this);typeof L=="string"?b+=L:b+=Af(L,g.type)}return b}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 uw(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 Yr(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?`
114
- `:"",u=a?`>
115
- `:">";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+Yr(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(ef.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),ef.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(ef.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(ef.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...fB,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===Sn.code_block)return Kv(t);if(i==="html_block"&&o.html_block===Sn.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):kp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Sn.fence)return pw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Af(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,b=t.xhtmlOut===!0,_=b?`<br />
116
- `:`<br>
117
- `,g=t.breaks?_:`
118
- `;if(e.length===1)return tf(e,t,n,this,s,_,g);let v="";for(let y=0;y<e.length;y++){const C=e[y];if(C.type==="link_open"&&!u&&!d&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="link_close"&&dB(k)){const M=`${dw(C)+tf([k],t,n,this,s,_,g)}</a>`;if(r===Sn.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=M+g,y+=3;continue}v+=M,y+=2;continue}}if(C.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${dw(C)}</a>`,y+=1;continue}if(C.type==="em_open"&&!f&&!h&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="em_close"&&fw(k)){v+=`<em>${tf([k],t,n,this,s,_,g)}</em>`,y+=2;continue}}if(C.type==="strong_open"&&!p&&!m&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="strong_close"&&fw(k)){v+=`<strong>${tf([k],t,n,this,s,_,g)}</strong>`,y+=2;continue}}switch(C.type){case"text":if(o===Sn.text){const k=C.content.length===0?"":Cn(C.content);if(a===Sn.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===Sn.text_special){C.content.length!==0&&(v+=Cn(C.content));continue}break;case"softbreak":if(r===Sn.softbreak){v+=g;continue}break;case"hardbreak":if(l===Sn.hardbreak){v+=_;continue}break;case"html_inline":if(a===Sn.html_inline){for(v+=C.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===Sn.code_inline){v+=yp(C);continue}break}const L=s[C.type];if(!L){v+=C.block?this.renderToken(e,y,t):kp(C,b);continue}const $=L(e,y,t,n,this);typeof $=="string"?v+=$:v+=Af($,C.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 uw(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+=`
119
- `;break}}return s}},hB=pB;const mB=[],dg=4096;function gB(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
120
- `,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 vB(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 yB(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(!AT(e[n],t[n]))return!1;return!0}function AT(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||!vB(e.attrs,t.attrs)||!yB(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function hw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var kB=class{core;cache=null;stats=hw();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=hw(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(qs(s??o?.env),!o||s&&s!==o.env){const I=s??{},P=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,H=!!n.options?.streamChunkedFallback,z=!P&&D,U=H||z,Q=n.options?.streamChunkAdaptive!==!1,X=n.options?.streamChunkTargetChunks??8,ue=n.options?.streamChunkSizeChars,me=n.options?.streamChunkSizeLines,Ae=n.options?.streamChunkMaxChunks,be=!!n.__explicitStreamChunkConfig,ze=n.options?.autoTuneChunks!==!1,qe=n.options?.streamChunkFenceAware??!0,Fe=n.options?.streamLargeCachePolicy??"retain",Le=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,le=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let F,te=!1;if(Fe==="skip"&&(te=e.length>=Le,!te&&le!==void 0&&(F=Yn(e),te=F>=le)),te){const q=this.parseFullDocument(e,I,n,F,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!zi(I)?.unbounded}),q.tokens}else if(U){const q=(re,he,Ce)=>re<he?he:re>Ce?Ce:re;F===void 0&&(F=Yn(e));const Y=ze&&!be?cw(e.length,F,n.options):null,de=Y?.maxChunkChars??(Q?q(Math.ceil(e.length/X),8e3,64e3):ue??1e4),ne=Y?.maxChunkLines??(Q?q(Math.ceil(F/X),150,700):me??200),ce=Y?.maxChunks??(Q?q(Math.ceil(e.length/64e3),X,32):Ae),j=e.length>0&&e.charCodeAt(e.length-1)===10,G=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Y?.strategy!=="plain";if((H||G)&&(e.length>=de*2||F>=ne*2)&&j){const re=vp(n,e,I,{maxChunkChars:de,maxChunkLines:ne,fenceAware:Y?.fenceAware??qe,maxChunks:ce});return this.cache={src:e,tokens:re,env:I,lineCount:F,lastSegment:void 0,globalStateReason:so(e)},this.updateCacheLineCount(this.cache,F),this.recordChunkedParseResult(I,H?"explicit-initial-large-doc":"default-initial-large-doc"),re}}const ee=this.parseFullDocument(e,I,n,F);return F=ee.lineCount,this.cache={src:e,tokens:ee.tokens,env:I,lineCount:F,lastSegment:void 0,globalStateReason:so(e)},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!zi(I)?.unbounded}),ee.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",os(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=so(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):so(e),a=r||l;if(a){const I=s??o.env;or(I);const P=so(e),D=this.parseFullDocument(e,I,n),H=D.tokens,z=D.lineCount;return this.cache={src:e,tokens:H,env:I,lineCount:z,lastSegment:void 0,globalStateReason:P},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!zi(I)?.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 I=s??o.env,P=this.parseFullDocument(e,I,n),D=P.tokens,H=P.lineCount;return this.cache={src:e,tokens:D,env:I,lineCount:H,lastSegment:void 0,globalStateReason:so(e)},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!zi(I)?.unbounded}),D}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const I=o.lineCount??Yn(o.src);let P=3;u.length>5e3?P=8:u.length>1e3?P=6:u.length>200&&(P=4),P=Math.min(P,I);let D=null;const H=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let Q;const X=()=>(Q===void 0&&(Q=Yn(u)),Q),ue=this.canDirectlyParseAppend(o),me=ue&&this.shouldUseUnboundedAppend(e,o,u);let Ae=!1;if(!ue)switch(H){case"lines":Ae=X()>=U;break;case"constructs":if(u.length>=z){Ae=!0;break}if(gB(u)){Ae=!0;break}Ae=X()>=U;break;case"chars":default:Ae=u.length>=z}if(P>0&&Ae){const qe=this.getTailLines(o.src,P)+u;try{const Fe=this.core.parse(qe,o.env,n).tokens,Le=Fe.findIndex(le=>le.map&&typeof le.map[1]=="number"&&le.map[1]>P);if(Le!==-1){const le=Fe.slice(Le),F=I-P;F!==0&&this.shiftTokenLines(le,F),D={tokens:le}}}catch{D=null}}else D=null;if(!D){const qe=I;if(me)D={tokens:au(n,u,o.env,{mode:"stream"})},qe>0&&this.shiftTokenLines(D.tokens,qe);else{const Fe=this.core.parse(u,o.env,n);qe>0&&this.shiftTokenLines(Fe.tokens,qe),D=Fe}}let be=0;if(o.tokens.length>0&&D.tokens.length>0){const qe=o.tokens[o.tokens.length-1],Fe=D.tokens[0];try{qe.type==="inline"&&Fe.type==="inline"&&(Fe.children&&Fe.children.length>0&&(qe.children||(qe.children=[]),this.appendTokens(qe.children,Fe.children)),qe.content=(qe.content||"")+(Fe.content||""),be=1)}catch{be=0}}const ze=o.tokens.length;if(D.tokens.length>be){const qe=o.tokens,Fe=D.tokens,Le=Math.min(qe.length,Fe.length-be);let le=0;for(let F=Le;F>0;F--){let te=!0;for(let ee=0;ee<F;ee++){const q=qe[qe.length-F+ee],Y=Fe[be+ee];if(!AT(q,Y)){te=!1;break}}if(te){le=F;break}}le>0&&(be+=le),Fe.length>be&&this.appendTokens(o.tokens,Fe,be)}if(o.src=e,o.globalStateReason=null,o.lineCount=I+(Q??X()),o.tokens.length>ze){const qe=this.getLastSegment(o.tokens,e,ze,o.tokens.length,e.length-u.length,I);qe?o.lastSegment=qe:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,me&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",os(o.env,{area:"stream",path:me?"stream-unbounded-append":"stream-append",reason:me?"large-delta":"safe-append",unbounded:me}),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",os(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,b=!h&&!u&&p,_=m||b,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,C=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,k=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let E=u&&o.lineCount!==void 0?o.lineCount+Yn(u):void 0;if(_){E===void 0&&(E=Yn(e));const I=(X,ue,me)=>X<ue?ue:X>me?me:X,P=k&&!$?cw(e.length,E,n.options):null,D=P?.maxChunkChars??(g?I(Math.ceil(e.length/v),8e3,64e3):y??1e4),H=P?.maxChunkLines??(g?I(Math.ceil(E/v),150,700):C??200),z=P?.maxChunks??(g?I(Math.ceil(e.length/64e3),v,32):L),U=e.length>0&&e.charCodeAt(e.length-1)===10,Q=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&P?.strategy!=="plain";if((m||Q)&&(e.length>=D*2||E>=H*2)&&U){const X=vp(n,e,d,{maxChunkChars:D,maxChunkLines:H,fenceAware:P?.fenceAware??M,maxChunks:z});return this.cache={src:e,tokens:X,env:d,lineCount:E,lastSegment:void 0,globalStateReason:so(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),X}}const O=this.parseFullDocument(e,d,n,E),S=O.tokens;return E=O.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:E,lastSegment:void 0,globalStateReason:so(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!zi(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=zi(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",os(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!zi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",os(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=so(e);sd(t)&&or(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?wT(n,e.length,s):"no";if(r==="yes"){const a=au(n,e,t);return os(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?Yn(e):0)}}let l=s;if(r==="need-lines"&&(l=Yn(e),_T(n,e.length,l))){const a=au(n,e,t);return os(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Yn(e):0),{tokens:Va(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:Yn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
121
- `))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(`
122
- `);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+Yn(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(`
123
- `,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??mB}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??Yn(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(-dg))+t,s=so(n);return e.globalStateCarry=n.length>dg?n.slice(n.length-dg):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(`
124
- `,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(`
125
- `,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??Yn(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+Yn(i);t.lineCount=m;const b=this.getDocLineCount(e,m);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:b,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 b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,_=t.lineCount??Yn(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=_+Yn(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(`
126
- `);if(t<0)return null;const n=e.indexOf(`
127
- `,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=Yn(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 mw={default:aB,zero:cB,commonmark:lB};function bB(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function _B(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 gw(e){return e.experimental?{...e,...e.experimental}:e}function Ho(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 vw(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(Ho(t,o)||Ho(e,o))return!0}return!1}function yw(e,t,n){return Ho(t,n)||Ho(e,n)}function kw(e,t){const n=zi(e)?.chunk;if(n?.fallback){os(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}os(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function wB(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=mw[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=gw(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=vw(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=vw(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=yw(i?.options,o,"fullChunkedFallback"),c=yw(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new f9;let p=null;const m=()=>(p||(p=new hB(n)),p);let b=null;const _=()=>(b||(b=new kB(h)),b);let g=null;const v=()=>(g||(g=new qA),g),y=k=>!u&&!!d&&!_B(k,d),C=(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,L=(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,$={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=gw(k);return this.options={...this.options,...M},(Ho(k,"fullChunkSizeChars")||Ho(k,"fullChunkSizeLines")||Ho(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Ho(k,"streamChunkSizeChars")||Ho(k,"streamChunkSizeLines")||Ho(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Ho(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Ho(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,b&&(b.reset(),b.resetStats())),this},configure(k){const M=typeof k=="string"?mw[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 E=M.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(k,M){const E=Array.isArray(k)?k:[k],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of O){if(!I)continue;const P=I.enable(E,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!M){const I=E.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(k,M){const E=Array.isArray(k)?k:[k],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of O){if(!I)continue;const P=I.disable(E,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!M){const I=E.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(k,...M){const E=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const O=[this,...M],S=k;return u=!0,E.apply(S,O),this},render(k,M){if(C(this,k.length)){M!==void 0&&qs(M);const S=rw(k);if(S!==null)return M!==void 0&&os(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=M??{},O=this.parse(k,E);return m().render(O,this.options,E)},async renderAsync(k,M){if(C(this,k.length)){M!==void 0&&qs(M);const S=rw(k);if(S!==null)return M!==void 0&&os(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=M??{},O=this.parse(k,E);return m().renderAsync(O,this.options,E)},renderIterable(k,M={}){const E=this.parseIterable(k,M);return m().render(E,this.options,M)},async renderAsyncIterable(k,M={}){const E=await this.parseAsyncIterable(k,M);return m().renderAsync(E,this.options,M)},renderInline(k,M={}){const E=this.parseInline(k,M);return m().render(E,this.options,M)},validateLink:aT,normalizeLink:cT,normalizeLinkText:uT,utils:NR,helpers:{...b7},parse(k,M){if(typeof k!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&qs(M),L(this,k.length)){const I=C9(k);if(I!==null)return M!==void 0&&os(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const E=M??{};let O;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=wT(this,k.length);if(I==="yes"){const P=au(this,k,E);return os(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),P}I==="need-lines"&&(O=Yn(k))}if(!this.stream.enabled){const I=k.length,P=this.options.autoTuneChunks!==!1,D=r,H=!a&&y(this),z=!!this.options.fullChunkedFallback,U=H&&I>=2e5;let Q;(z||U||O!==void 0)&&(Q=O??Yn(k));const X=(z||U)&&P&&!D?rB(I,Q,this.options):null;if(z||U){const ue=Q??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||ue>=(this.options.fullChunkThresholdLines??400):U){if(X&&X.strategy!=="plain"){const me=vp(this,k,E,{maxChunkChars:X.maxChunkChars,maxChunkLines:X.maxChunkLines,fenceAware:X.fenceAware,maxChunks:X.maxChunks});return M&&kw(M,z?"explicit-full-chunk":"default-large-string"),me}if(z){const me=(te,ee,q)=>te<ee?ee:te>q?q:te,Ae=this.options.fullChunkAdaptive!==!1,be=this.options.fullChunkTargetChunks??8,ze=me(Math.ceil(I/be),8e3,64e3),qe=me(Math.ceil(ue/be),150,700),Fe=Ae?ze:this.options.fullChunkSizeChars??1e4,Le=Ae?qe:this.options.fullChunkSizeLines??200,le=Ae?me(Math.ceil(I/64e3),be,32):this.options.fullChunkMaxChunks,F=vp(this,k,E,{maxChunkChars:Fe,maxChunkLines:Le,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:le});return M&&kw(M,"explicit-full-chunk"),F}}}if(O!==void 0&&y(this)&&_T(this,I,Q??O)){const ue=au(this,k,E);return os(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),ue}}const S=so(k);return os(M,{area:"parse",path:"plain",reason:"default-plain"}),Va(E,S,()=>h.parse(k,E,this).tokens)},parseIterable(k,M={}){return qs(M),nB(this,k,M)},parseAsyncIterable(k,M={}){return qs(M),sB(this,k,M)},parseIterableToSink(k,M,E={}){return qs(E),oB(this,k,M,E)},parseAsyncIterableToSink(k,M,E={}){return qs(E),iB(this,k,M,E)},parseInline(k,M={}){if(typeof k!="string")throw new TypeError("Input data should be a String");qs(M),sd(M)&&or(M);const E=h.createState(k,M,this);return E.inlineMode=!0,h.process(E),E.tokens}};if($.stream={enabled:!!n.stream,parse(k,M){return $.stream.enabled?_().parse(k,M,$):$.parse(k,M??{})},reset(){_().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const k=i.components;k.core?.rules&&$.core.ruler.enableOnly(k.core.rules),k.block?.rules&&$.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&$.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&$.inline.ruler2.enableOnly(k.inline2.rules)}return d=bB($),f=$.parse,$}var SB=wB;const TT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],CB=["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"],MT=["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"],xB=["svg","g","path"],AB=["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"],TB=["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"],MB=["action","data","href","src","srcset","poster","xlink:href","formaction"],EB=["script"],IB=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Ql=new Set(TT),$B=new Set(MT),Hu=new Set([...TT,...CB,...MT,...xB]),ET=new Set([...Hu,...AB]),NB=new Set(TB),LB=new Set(MB),id=new Set(EB),IT=new Set(IB);function $T(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 OB={amp:"&",bsol:"\\",colon:":",newline:`
128
- `,sol:"/",tab:" "};function NT(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 OB[String(o??"").toLowerCase()]??t})}const nf=new Set(["http","https","mailto","tel"]),PB=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),wl=new Set(["http","https"]);function LT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function RB(e,t,n){if(!du(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function du(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function DB(e,t){return t==="href"||t==="xlink:href"?du(e,t)?nf:wl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?wl:(du(e,t),nf)}function Hl(e,t={}){const n=$T(NT(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=LT(n);return i?i==="file"?!RB(n,s,o):du(s,o)?PB.has(i):!DB(s,o).has(i):!1}function BB(e){const t=NT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=LT($T(t).toLowerCase());return n==="http"||n==="https"}function FB(e,t={}){const n=String(e??"").trim();return n?Hl(n,t)?"":n:""}function bw(e){return FB(e,{tagName:"img",attrName:"src"})}function HB(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,m,b)}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(b=g+1;b<=v&&r[(b-g)%a]===f.src[b];b++);const y=Math.floor((b-g)/a);if(y<i)return!1;b-=(b-g)%a;const C=f.src.slice(g,b),L=f.src.slice(b,v);if(!c(L,C))return!1;if(m)return!0;let $=h;for(;$++,!($>=p||(g=f.bMarks[$]+f.tShift[$],v=f.eMarks[$],g<v&&f.sCount[$]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[$]-f.blkIndent>=4)){for(b=g+1;b<=v&&r[(b-g)%a]===f.src[b];b++);if(!(Math.floor((b-g)/a)<y)&&(b-=(b-g)%a,b=f.skipSpaces(b),!(b<v))){_=!0;break}}const k=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=$;const E=f.push("container_"+t+"_open","div",1);E.markup=C,E.block=!0,E.info=L,E.map=[h,$],f.md.block.tokenize(f,h+1,$);const O=f.push("container_"+t+"_close","div",-1);return O.markup=f.src.slice(g,b),O.block=!0,f.parentType=k,f.lineMax=M,f.line=$+(_?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 WB(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 b=0;b<a.length;b++){const _=a[b];if(_==="\\"){b++;continue}if(!u&&_==="'"){c=!c;continue}if(!c&&_==='"'){u=!u;continue}if(!c&&!u&&_===":"){d=b;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let 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 zB(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(HB,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
129
- `}})}),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 C=0,L=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?C++:m[$]==="}"&&C--,C===0){L=$+1;break}L>0&&(h=m.slice(0,L))}h||(f=d||void 0)}if(o)return!0;const b=!!i.env.__markstreamFinal;let _=n+1,g=!1;for(;_<=s;){const C=i.bMarks[_]+i.tShift[_],L=i.eMarks[_];if(i.src.slice(C,L).trim()===":::"){g=!0;break}_++}g||(_=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&&!b},f&&v.attrSet("data-args",f),h)try{const C=JSON.parse(h);for(const[L,$]of Object.entries(C)){const k=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,k?JSON.stringify($):String($))}}catch{const C=WB(h);if(C)for(const[L,$]of Object.entries(C)){const k=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,k?JSON.stringify($):String($))}else v.attrSet("data-attrs",h)}const y=[];for(let C=n+1;C<_;C++){const L=i.bMarks[C]+i.tShift[C],$=i.eMarks[C];y.push(i.src.slice(L,$))}if(y.some(C=>C.trim().length>0)){let C=y.join(`
130
- `);C.endsWith(`
131
- `)||(C+=`
132
- `),C.endsWith(`
133
-
134
- `)||(C+=`
135
- `);const L=i.tokens[i.tokens.length-1];L&&(L.raw=C);const $=[];i.md.block.parse(C,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?_+1:_,!0},{alt:["paragraph","reference","blockquote","list"]})}function xo(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 kh(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 UB=/^[a-z][a-z0-9_-]*$/;function _w(e){return UB.test(String(e??"").trim().toLowerCase())}function Jo(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return _w(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)?"":_w(o)?o:""}function pc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Jo(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function qB(...e){const t=new Set,n=[];for(const s of e)for(const o of pc(s))t.has(o)||(t.add(o),n.push(o));return n}function jB(e){const t=pc(e);return{key:t.join(","),tags:t}}function OT(e){return Jo(e)}function VB(e,t){const n=String(e??""),s=Jo(t);if(!s)return!1;const o=xo(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 PT(e,t){const n=Jo(t);return!!n&&!Hu.has(n)&&!VB(e,n)}function KB(e,t){const n=String(e??""),s=Jo(t);if(!s)return n;const o=xo(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 RT=Ql,GB=Hu,DT=new Set($B);DT.delete("details");const YB=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,XB=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Gv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,QB=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function bp(e){return(e.match(Gv)?.[1]??"").toLowerCase()}function L0(e){return/^\s*<\s*\//.test(e)}function O0(e,t){return RT.has(t)||/\/\s*>\s*$/.test(e)}function ZB(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=bp(i);if(r===t){if(L0(i)){if(n===0)return s;n--;continue}O0(i,r)||n++}}return-1}function JB(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=bp(o);if(i===t){if(L0(o)){n>0&&n--;continue}O0(o,i)||n++}}return n}function ww(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${xo(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 eF(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${xo(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 _p(e){const t=e;return String(t.raw??t.content??t.markup??"")}function tF(e){const t=e;return t.meta||(t.meta={}),t.meta}function fg(e,t,n){const s=tF(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function nF(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${xo(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(`
136
- `),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();fg(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*${xo(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const b=m??(h.type==="html_inline"?bp(p):"");if(!(b&&t.has(b))){r(p);return}const _=L0(p),g=!_&&O0(p,b);if(_){if(!s.length||s[s.length-1].tag!==b){r(p);return}c(p);return}if(r(p),g){fg(h,p,"");return}s.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?o=!1:l(),!s.length&&!i(p)){o=!1;continue}let m=0,b=!0;for(const _ of h.children){const g=_p(_),v=_.type==="html_inline"?bp(g):"",y=v&&t.has(v);let C=g;if(b&&p&&g&&(s.length||y)){const L=p.indexOf(g,m);if(L!==-1)a(p.slice(m,L)),C=p.slice(L,L+g.length),m=L+g.length;else{if(s.length&&!y)continue;b=!1}}f(_,C,v)}b&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=_p(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
137
- `:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)fg(h.token,h.raw,h.inner)}function sF(e){return/^\s*<\s*[!?]/.test(e)}function oF(e){const t=new Set(GB);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 Sw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function iF(e,t){let n=null;for(const i of e.matchAll(YB)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Sw(l,t)&&Vn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(XB)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Sw(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 rF(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function lF(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(rF(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(Gv);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),b=(h[1]??"").toLowerCase();t.has(b)?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=iF(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+=_p(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=_p(a),u=(c.match(Gv)?.[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 aF=["a","span","strong","em","b","i","u"];function cF(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Jo(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=Jo(String(v??""));y&&p.add(y)}const b=oF(Array.from(p)),_=new Set(aF);for(const v of p)_.add(v);return{autoCloseInlineTagSet:_,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!b.has(v)||DT.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 b={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:m}=s(f);for(const b of h){const _=b;if(_.type!=="inline"||!Array.isArray(_.children))continue;const g=String(_.content??""),v=_.children.length?_.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=lF(v,p);if(_.children=y.children,y.pendingBuffer){const C=g.lastIndexOf(y.pendingBuffer);if(C!==-1){const L=g.slice(0,C);_.content=L,typeof _.raw=="string"&&(_.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}nF(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:b}=s(f),_=[];for(let g=0;g<h.length;g++){const v=h[g];if(_.length>0){const[C,L]=_[_.length-1];if(g!==L){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const $=String(v.content??v.raw??"");if($){const k=h[L],M=`${String(k.content||"")}
138
- ${$}`,E=Vn(M),O=E===-1?null:ww(M,C,E+1);if(O){const S=M.slice(0,O.end),I=M.slice(O.end);k.content=S,k.loading=!1,h.splice(g,1),_.pop();const P=d(k,I)?[]:c(I,u(h,g,"paragraph"));P.length&&h.splice(g,0,...P),g--;continue}k.content=M,k.loading!==!1&&(k.loading=!0)}h.splice(g,1),g--;continue}}const y=o(v);if(y){if(sF(y))continue;const C=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!C||!b(C))continue;if(i(v,y),!L)C&&!new RegExp(`^\\s*<\\s*${C}\\b[^>]*\\/\\s*>`,"i").test(y)&&eF(y,C)>0&&_.push([C,g]);else if(_.length>0&&C&&_[_.length-1][0]===C){const[,$]=_[_.length-1],k=h[$];k.content=`${String(k.content||"")}
139
- ${y}`,k.loading=!1,_.pop(),h.splice(g,1),g--}continue}else if(_.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const C=v.content||"",L=new RegExp(`<\\s*\\/\\s*${_[_.length-1][0]}\\s*>`,"i").test(C);if(C){const[,$]=_[_.length-1],k=h[$];k.content=`${k.content||""}
140
- ${C}`,k.loading!==!1&&(k.loading=!L)}L&&_.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=$=>{let k=g.get($);return k||(k=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,k)),k},C=$=>{let k=v.get($);return k||(k=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),v.set($,k)),k},L=[];for(let $=0;$<h.length;$++){const k=h[$],M=String(k.content??"");if(L.length>0){const O=L[L.length-1],S=h[O.index],I=k.type==="html_block"?C(O.tag).exec(M):null;if(I){const H=I.index+I[0].length,z=M.slice(0,H),U=M.slice(H);S.content=`${String(S.content??"")}
141
- ${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${O.tag}>`,raw:`</${O.tag}>`}),L.pop();const Q=d(S,U)?[]:c(U,u(h,$,"paragraph"));Q.length?h.splice($,1,...Q):(h.splice($,1),$--);continue}if(k.type!=="inline")continue;const P=Array.isArray(k.children)?k.children:[],D=ZB(P,O.tag);if(D!==-1){const H=P.slice(0,D+1),z=P.slice(D+1),U=H.map(Q=>String(Q?.content??Q?.raw??"")).join("");if(S.content=`${String(S.content??"")}
142
- ${U}`,Array.isArray(S.children)&&S.children.push(...H),z.length){const Q=z.map(X=>String(X.content??X.raw??"")).join("");if(Q.trim()){const X=Q.replace(/^\s+/,"");if(d(S,Q))h.splice($,1),$--;else if(X.startsWith("<"))h.splice($,1,{type:"html_block",content:X});else{const ue=c(Q,u(h,$,"paragraph"));h.splice($,1,...ue)}}else h.splice($,1),$--}else h.splice($,1),$--;L.pop();continue}S.content=`${String(S.content??"")}
143
- ${M}`,Array.isArray(S.children)&&S.children.push(...P),h.splice($,1),$--;continue}if(k.type!=="inline")continue;const E=Array.isArray(k.children)?k.children:[];for(const O of m)if((E.length?JB(E,O):y(O).test(M)&&!C(O).test(M)?1:0)>0){L.push({tag:O,index:$});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 D=String(v.content??""),H=Vn(D),z=H===-1?null:ww(D,k,H+1);v.loading=z?!1:v.loading!==void 0?v.loading:!0;const U=z?.start??-1,Q=z?z.end-z.start:0;if(U!==-1){const X=D.slice(0,U+Q);let ue="";H!==-1&&H<U&&(ue=D.slice(H+1,U)),v.children=[{type:k,content:ue,raw:X,attrs:[],tag:k,loading:!1}],v.content=X,v.raw=X;const me=c(D.slice(U+Q)||"","text");me.length&&h.splice(g+1,0,...me)}else v.children=[{type:k,content:"",raw:D,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 E;for(;(E=M.exec(v.content||""))!==null;)E[1],E[2]||E[3]||E[4];const O=String(v.content??""),S=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(O),I=S?S.index:-1,P=S?S[0].length:0;if(I!==-1){const D=O.slice(0,I+P),H=(O.slice(I+P)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:D,tag:k,loading:!1}],v.content=D,v.raw=D,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],E=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&E===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),C=v,L=C.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(C.children.length=0);continue}const $=String(L.content??y).match(QB)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(y)||RT.has($)){C.children=[{type:"html_inline",content:y}];continue}C.children.length=0}}})}function uF(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 dF(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&&!uF(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 BT=/\.([a-z0-9]{1,15})$/i,fF=/[_()[\]{}<>]/u,pF=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,hF=/[?#@]/u,mF=/[\\/]/u,gF=/^[\p{L}\p{N}./\\-]+$/u,vF=/^[A-Za-z0-9-]{1,63}$/u,yF=/^xn--[a-z0-9-]{2,59}$/i,kF=/^(?:[A-Z]{1,6}|\d{1,8})$/u,bF=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,_F=/文件名\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,wF=/文件名\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,SF=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,CF=new Set(["ai","md","py","rs","sh","zip"]),FT=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),xF=new Set([...FT,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),AF=new Set(["com","dev","io","page","site"]),TF=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),MF=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 Wu(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function pg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Wu(n)?n:void 0}function Cw(e,t){if(!Wu(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 xw(e){const t=rd(e);return Wu(t)?t:void 0}function EF(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Aw(e,t){if(!Wu(t))return;const n=String(e??"").trim().split(/\s+/u).map(EF).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>wp(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>wp(o,{marketTicker:!0}))&&(s.marketTicker=!0),Wu(s)?s:void 0}function ol(e,t=!1){let n;return{options(s){return t||s==null?Cw(e,n):Cw(e,pg(xw(s),Aw(s,n)))},remember(s){const o=xw(s);n=t?pg(n,o):pg(o,Aw(s,n))},reset(){n=void 0}}}function Tw(e){return vF.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function IF(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Tw(n)||yF.test(n)?t.every(Tw):!1}function HT(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function $F(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function NF(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function WT(e,t,n){const s=$F(t);return HT(e)&&NF(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function rd(e){const t=String(e??"");return{explicitFilename:_F.test(t),filename:wF.test(t),marketTicker:SF.test(t)}}function LF(e){return IF(e.split(/[\\/]/)[0]??"")}function OF(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function PF(e){if(fF.test(e)||!gF.test(e))return!0;if(mF.test(e))return!LF(e);const t=e.replace(BT,"");return HT(t)?!0:t.split(".").filter(Boolean).some(OF)}function RF(e,t,n){if(!(n?xF:FT).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?bF:kF).test(s)}function wp(e,t={}){if(!e||pF.test(e)||hF.test(e))return!1;const n=e.match(BT);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return RF(e,s,t.marketTicker===!0)?!0:MF.has(s)?!CF.has(s)||t.filename?!0:PF(e):!!(t.explicitFilename&&AF.has(s)||t.filename&&TF.has(s))}const Mw=["!"];function to(e){return{type:"text",content:e,raw:e}}function Sl(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 Cl(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 _r(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 DF(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(to(t))}}function Ew(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 BF(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function FF(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 HF(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 WF(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=zF(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function zF(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=rd(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=HF(e,s,i),l=BF(o);if(o.markup==="linkify"&&r&&!WT(r,l,t)&&wp(r,n)){e.splice(s,i-s+1,to(r));continue}const a=Ew(l,Mw);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Ew(u.content,Mw);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let _=c+1;_<i;_++){const g=e[_];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 b=l;if(a!==-1)b=l.slice(0,a);else if(p){const _=encodeURI(p);if(_&&l.endsWith(_))b=l.slice(0,l.length-_.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(b=l.slice(0,v))}}b!==l&&FF(o,b),p&&e.splice(i+1,0,to(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(to(r));const c=i[1],u=l[1].length;Sl(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(_r(c,d,!e[s+4]?.content?.startsWith(")"))),Cl(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(to(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(to(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=""),Sl(a,f),a.push(_r(c,h,!e[s+4]?.content?.startsWith(")"))),Cl(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(to(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(_r(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(to(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(_r(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(to(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;Sl(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,b=e[p];if(m===1&&b.type==="em_close")break;if(m===2&&b.type==="strong_close")break;if(m===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;Cl(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(to(l)),Sl(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(_r(a,c,u)),Cl(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(to(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(to(r)),Sl(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(_r(l,a,c)),Cl(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(to(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(to(r)),Sl(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(_r(a,c,d)),Cl(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=[];Sl(a,2),a.push(_r(r,l,!1)),Cl(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;DF(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function UF(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=qF(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function qF(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 jF(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=VF(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function VF(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 b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const _=e[b];h==="__"&&(m?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.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 b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const _=e[b];h==="_"&&(m?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.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=KF(l),l}function KF(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=GF(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 GF(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 YF(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=tH(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 Iw(){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 $w(){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 Nw(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 zT(e,t){if(!e.startsWith("|")||e.includes(`
144
- `)||!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 hg(e){return zT(e)!==null}function UT(e){return/^:?-+:?$/.test(e.trim())}function XF(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(UT)}function QF(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function ZF(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(UT)&&QF(n)}function JF(e){return e==="|"||e==="|:"}function eH(e){const t=zT(e);return t!==null&&t.every(n=>!n.includes(":"))}function tH(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(`
145
- `)[0]??"",[a="",c="",...u]=r.split(`
146
- `),d=!t&&!r.includes(`
147
- `)&&/\r?\n$/.test(n)&&hg(r);if(!t&&(r.includes(`
148
- `)&&u.length===0&&hg(a)&&ZF(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Nw(p)),h=[...Iw(),...f,...$w()];s.splice(o-1,3,...h)}else if(r.includes(`
149
- `)&&u.length===0&&hg(a)&&XF(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Nw(p)),h=[...Iw(),...f,...$w()];s.splice(o-1,3,...h)}else r.includes(`
150
- `)&&u.length===0&&eH(a)&&JF(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function nH(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 sH=nH;const oH=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Sp=oH.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),iH=/\\[a-z]+/i,qT="(?:\\\\|\\u0008)",rH=new RegExp(String.raw`${qT}(?:${Sp})\s*\{[^}]+\}`,"i"),lH=new RegExp(String.raw`(?:${qT})?(?:${Sp})\s*\{`,"i"),aH=/\\(?:text|frac|left|right|times)/,cH=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,uH=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,dH=/[A-Z]+\s*\([^)]+\)/i,fH=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,pH=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,hH=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,mH={"\b":"\\b","\v":"\\v","\f":"\\f"};function gH(e){let t="";for(const n of e)t+=mH[n]??n;return t}function La(e){if(!e)return!1;const t=gH(e),n=t.trim();if(hH.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=iH.test(t),o=rH.test(t),i=lH.test(t),r=aH.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=cH.test(t)&&!uH.test(t),c=dH.test(t),u=fH.test(n),d=pH.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 jT="__markstreamMathPluginApplied",Yv=80,VT=2e4,Lw=VT+4096;function KT(e){return!!e[jT]}function vH(e){e[jT]=!0}const GT=["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"],yH=["cdot","mathbf{","partial","mu_{"],YT=GT.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),XT="[ \r\b\f\v]",kH=new RegExp(`([^\\\\])(${yH.map(e=>e).join("|")})+`,"g"),bH=/span\{([^}]+)\}/,_H=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,wH=/(^|[^\\])\\\r?\n/g,SH=/(^|[^\\])\\$/g,CH=new RegExp(`(${XT})|(${YT})\\b`,"g"),Ow=new Map,Pw=new Map;function xH(e){if(!e)return CH;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=Ow.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${XT})|(${o})\\b`,"g");return Ow.set(n,i),i}function AH(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=Pw.get(s);if(o)return o;const i=e?[Sp,YT].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Sp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Pw.set(s,r),r}const Rw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Dw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Bw(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 wr(e,t){const n=t?.commands??GT,s=t?.escapeExclamation??!0,o=t?.commands==null,i=xH(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&Rw[u]!==void 0)return`\\${Rw[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=AH(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(bH,"span\\{$1\\}").replace(_H,"\\operatorname{span}\\{$1\\}"),l=l.replace(wH,`$1\\\\
151
- `),l=l.replace(SH,"$1\\\\"),l=l.replace(kH,"$1\\$2"),l}function Fw(e){const t=e.trim();return!(!La(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function QT(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const 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 Cp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function TH(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 ld(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Xv(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(ld(e,s)){n=s+1;continue}return s}return-1}function mg(e,t){let n=t;for(;n<e.length;){const s=Xv(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 Qc(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(!ld(e,o))return o;s=o+Math.max(1,t.length)}return-1}function Hw(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=Cp(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}ld(e,a)||i++,r=a+Math.max(1,t.length)}return i}function P0(e,t,n){const s=Uu(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!Uu(s.slice(0,o)).trim()||ld(s,o))return-1;const i=QT(s);if(Cp(i,o))return-1;const r=Hw(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Hw(s,n,0,o,i))return-1;return o}function zu(e){return e===" "||e===" "}function Uu(e){let t=e.length;for(;t>0&&zu(e[t-1]);)t--;return e.slice(0,t)}function Ww(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
152
- `&&t++;return t}function zw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function MH(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(!zu(o))return!1}return n>=3}function EH(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 IH(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(EH)}function $H(e){let t=0;if(!zw(e[t]))return!1;for(;zw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:zu(e[t+1])}function ZT(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&&zu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&zu(t[1])||$H(t)||MH(t)||IH(t))}function Uw(e,t){return e?t?`${e}
153
- ${t}`:e:t}function Qv(e){const t=String(e??"").trim();return t?La(t):!1}function qw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function JT(e){if(e.length<=Lw)return{source:e,lineOffset:0};let t=e.length-Lw;const n=e.indexOf(`
154
- `,t);return n===-1?{source:"",lineOffset:Ww(e)}:(t=n+1,{source:e.slice(t),lineOffset:Ww(e.slice(0,t))})}function eM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=JT(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-Yv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=Uu(s[r]);if(l&&!ZT(l)){for(const[a,c]of i)if(P0(l,a,c)!==-1)return!0}}return!1}function NH(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=JT(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-Yv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=Uu(o[l]);for(const[c,u]of r){const d=P0(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>Yv){h=!0;break}const m=o[p],b=Qc(m,u);if(b!==-1){const _=Uw(f,m.slice(0,b));if(!Qv(_)){h=!0;break}const g=m.slice(b+u.length),v=g.trim()?`suffix:${qw(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,b,qw(_),v].join(":")}if(ZT(m)){h=!0;break}if(f=Uw(f,m),f.length>VT){h=!0;break}}if(!h&&Qv(f))return["pending",c,s+l,d].join(":")}}return null}function gg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function LH(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 vg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function OH(e,t){vH(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]===`
155
- `||g[y]==="\r"&&g[y+1]===`
156
- `))return v;const C=g.slice(v,y),L=a.push("text","",0);return L.content=C,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 C=a.push("text","",0);return C.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,b=p;const _=p;for(const[g,v]of f){const y=a.src,C=QT(y),L=TH(y,u);let $=!1;g==="$$"&&m!==_&&(m=_);let k=-1,M=-1,E=0;const O=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let D=0;for(;D<S.length;){const H=Xv(S,D);if(H===-1){const qe=S.slice(D);if(qe){const Fe=a.push("text","",0);Fe.content=qe,a.pos=a.pos+qe.length,m=a.pos}break}if(H>0&&S[H-1]==="$"||H+1<S.length&&S[H+1]==="$"){const qe=S.slice(D,H+1);if(qe){const Fe=a.push("text","",0);Fe.content=qe,a.pos=a.pos+qe.length,m=a.pos}D=H+1;continue}const z=S.slice(D,H);if(z){const qe=a.push("text","",0);qe.content=z,a.pos=a.pos+z.length,m=a.pos}const U=mg(S,H+1);if(U===-1){const qe=S.slice(H),Fe=a.push("text","",0);Fe.content=qe,a.pos=a.pos+qe.length,m=a.pos;break}const Q=S.slice(H+1,U),X=Q.includes("`"),ue=!Q||!Q.trim(),me=S[U+1],Ae=gg(Q,me),be=vg(Q);if(!X&&!ue&&!Ae&&!be){const qe=a.push("math_inline","math",0);qe.content=wr(Q,t),qe.markup="$",qe.raw=`$${Q}$`,qe.loading=!1,a.pos=a.pos+(U-H+1),m=a.pos,D=U+1;continue}const ze=a.push("text","",0);ze.content="$",a.pos=a.pos+1,m=a.pos,D=H+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),U=a.push("text","",0);U.content=z,a.pos=a.pos+z.length,m=a.pos}const D=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,z,U]=D,Q=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),X=Q?Q[1]:U,ue=Q&&Q[2]?Q[2]:null,me=a.push("image","img",0);me.attrs=[["src",X],["alt",z]],ue&&me.attrs.push(["title",ue]),me.content=z,me.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+D[0].length,m=a.pos;const Ae=S.slice(I+D[0].length);Ae&&O(Ae);return}const H=a.push("text","",0);H.content=S,a.pos=a.pos+S.length,m=a.pos;return}const P=a.push("text","",0);P.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(ld(y,S)){m=S+Math.max(1,g.length);continue}const I=Cp(C,S);if(I){m=I[1];continue}const P=Cp(L,S);if(P){m=P[1];continue}if(S===k&&m===M){if(E++,E>2){m=S+Math.max(1,g.length);continue}}else E=0,k=S,M=m;if(g==="("&&S>0){let Ae=S-1;for(;Ae>=0&&y[Ae]===" ";)Ae--;if(Ae>=0&&y[Ae]==="]"){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 D=g==="$"?mg(y,S+g.length):sH(y,S+g.length,g,v);if(D===-1){const Ae=y.slice(S+g.length);if(Ae.includes(g)){m=y.indexOf(g,S+g.length);continue}if(D===-1){const be=g==="$"&&LH(Ae);if(u&&!c&&!be&&La(Ae)&&!Ae.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const ze=b?y.slice(b,m):y.slice(0,m),qe=Dw(ze)%2===1;if(b)O(y.slice(b,m));else{let Fe=y.slice(0,m);Fe.endsWith(g)&&(Fe=Fe.slice(0,Fe.length-g.length)),O(Fe)}if(qe){const Fe=Bw(ze)?.marker??"**",Le=a.push("strong_open","",0);Le.markup=Fe;const le=a.push("math_inline","math",0);le.content=wr(Ae,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${Ae}${v}`,le.loading=!0,Le.content=Ae,a.push("strong_close","",0)}else{const Fe=a.push("math_inline","math",0);Fe.content=wr(Ae,t),Fe.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Fe.raw=`${g}${Ae}${v}`,Fe.loading=!0}a.pos=y.length}m=y.length,b=m}break}}const H=y.slice(S+g.length,D),z=H.includes("`"),U=!H||!H.trim(),Q=g==="$",X=y[D+v.length],ue=Q&&gg(H,X),me=Q&&vg(H);if(c?z||U||ue||me:z||U||ue||me||!Q&&!La(H)){m=D+v.length;const Ae=y.slice(a.pos,m);a.pending||(O(Ae),b=m);continue}if($=!0,!l){const Ae=y.slice(a.pos-(a.pending??"").length,S);let be=y.slice(0,m)?y.slice(b,S):Ae;const ze=Dw(be)%2===1;S!==a.pos&&ze&&(be=a.pending+y.slice(a.pos,S));const qe=ze?Bw(be):null,Fe=qe?.marker??"**";if(a.pending!==be)if(a.pending="",ze)if(qe){const Le=be.slice(qe.index+Fe.length);O(be.slice(0,qe.index));const le=a.push("strong_open","",0);le.markup=Fe;const F=a.push("text","",0);F.content=Le,a.push("strong_close","",0)}else O(be);else O(be);if(ze){const Le=a.push("strong_open","",0);Le.markup=Fe;const le=a.push("math_inline","math",0);le.content=wr(H,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${H}${v}`,le.loading=!1;const F=y.slice(D+v.length).startsWith(Fe);return F&&a.push("strong_close","",0),a.pos=d(y,D+v.length),m=a.pos,b=m,F||a.push("strong_close","",0),!0}else{const Le=a.push("math_inline","math",0);Le.content=wr(H,t),Le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Le.raw=`${g}${H}${v}`,Le.loading=!1}}return m=d(y,D+v.length),b=m,a.pos=m,!0}if($){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const I=Xv(y,S);if(I===-1)break;if(I+1<y.length&&y[I+1]==="$"){S=I+2;continue}if(I>0&&y[I-1]==="$"){S=I+1;continue}const P=mg(y,I+1);if(P===-1)break;const D=y.slice(I+1,P),H=D.includes("`"),z=!D||!D.trim(),U=y[P+1],Q=gg(D,U),X=vg(D);if(!H&&!z&&!Q&&!X){const ue=y.slice(m,I);ue&&O(ue);const me=a.push("math_inline","math",0);me.content=wr(D,t),me.markup="$",me.raw=`$${D}$`,me.loading=!1,m=P+1,S=P+1}else O("$"),S=I+1}S<y.length&&O(y.slice(S))}else m<y.length&&O(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(),b=!1,_="",g="",v=!1,y="",C=!1;for(const[ue,me]of h)if(m.startsWith(ue))if(ue.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){b=!0,_=ue,g=me;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){b=!0,_=ue,g=me;break}continue}else{const Ae=u.tokens[u.tokens.length-1];if(Ae&&Ae.type==="list_item_open"&&Ae.mark==="-"&&m.slice(ue.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const be=m.indexOf("]");if(m.slice(be).trim()!=="]")continue;const ze=m.slice(ue.length,be);if(ue==="["?Fw(ze):La(ze)){b=!0,_=ue,g=me;break}continue}}else{b=!0,_=ue,g=me;break}else if((ue==="$$"||ue==="\\[")&&m.endsWith(ue)&&l+1<a){const Ae=P0(m,ue,me);if(Ae===-1)continue;y=Uu(m.slice(0,Ae)),C=!0;const be=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(be,u.eMarks[l+1]).trim(),v=!0,b=!0,_=ue,g=me;break}if(!b)return!1;if(c&&!C)return!0;const L=m.indexOf(_),$=L+_.length,k=!f&&_==="["?m.indexOf("\\]",$):-1,M=k>=0?"\\]":g,E=k>=0?k:Qc(m,g,$);if(!v&&E>_.length){const ue=m.slice(L+_.length,E),me=u.push("math_block","math",0);me.content=wr(ue),me.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",me.map=[l,l+1],me.raw=`${_}${ue}${M}`,me.block=!0,me.loading=!1,u.line=l+1;const Ae=m.slice(E+M.length);return Ae.trim()&&n(u,Ae,l),!0}let O=l,S="",I=!1,P="",D=l;const H=v?m:m===_?"":m.slice(_.length),z=!f&&_==="\\["?"]":"",U=Qc(H,g);if(U!==-1){const ue=U;S=H.slice(0,ue),P=H.slice(ue+g.length),D=v?l+1:l,I=!0,O=D}else for(H&&!v&&(S=H),O=l+1;O<a;O++){const ue=u.bMarks[O]+u.tShift[O],me=u.eMarks[O],Ae=u.src.slice(ue,me),be=Ae.trim();if(!f&&_==="["&&be==="\\]"){g="\\]",I=!0;break}if(z&&Ae.trim()===z){g=z,I=!0;break}if(be===g){I=!0;break}else if(!f&&_==="["&&Ae.includes("\\]")){I=!0;const ze=Ae.indexOf("\\]");g="\\]";const qe=Ae.slice(0,ze);qe&&(S+=(S?`
157
- `:"")+qe),P=Ae.slice(ze+g.length),D=O;break}else if(Qc(Ae,g)!==-1){I=!0;const ze=Qc(Ae,g),qe=Ae.slice(0,ze);qe&&(S+=(S?`
158
- `:"")+qe),P=Ae.slice(ze+g.length),D=O;break}S+=(S?`
159
- `:"")+Ae}if((!d||f)&&!I)return!1;const Q=/^\s*!\[/.test(S);if(!(C?!Q&&Qv(S):_==="$$"?!Q:_==="["?Fw(S):La(S)))return!1;if(c)return!0;y&&n(u,y,l);const X=u.push("math_block","math",0);return X.content=wr(S),X.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",X.raw=`${_}${S}${S.startsWith(`
160
- `)?`
161
- `:""}${g}`,X.map=[l,O+1],X.block=!0,X.loading=!I,u.line=O+1,P.trim()&&n(u,P,D),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1: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 PH(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 RH(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 SB({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!Hl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&OH(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&zB(i),e.enableFixIndentedCodeBlock!==!1&&dF(i),WF(i),jF(i),UF(i),YF(i),PH(i),cF(i,{customHtmlTags:e.customHtmlTags}),i}function Wl(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=>Wl(n))),t}function DH(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function BH(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 FH(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function sf(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 jw=/\r?\n[ \t]*`+\s*$/,tM=["diff ","index ","--- ","+++ ","@@ "],HH=/\r?\n/;function WH(e){const t=String(e??"");return t?tM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Vw(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function zH(e,t){const n=[],s=[],o=[],i=[],r=e.split(HH),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!tM.some(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{Vw(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&&WH(p)||c(p)}(t||o.length>0||i.length>0)&&Vw(n,s,o,i);const d=n.join(`
162
- `),f=s.join(`
163
- `);return{original:t&&l&&d?`${d}
164
- `:d,updated:t&&l&&f?`${f}
165
- `:f}}function R0(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(jw.test(a)&&(a=a.replace(jw,"")),r){const{original:c,updated:u}=zH(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 UH(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function qH(){return{type:"hardbreak",raw:`\\
166
- `}}function jH(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 yg=null;const kg=new WeakMap;function Kw(){return yg||(yg={customTagSet:null,allowedTagSet:wh()}),yg}function nM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function sM(e){return/^<\s*\//.test(e)}function oM(e,t){return/\/\s*>\s*$/.test(t)||Ql.has(e)}function VH(e){if(!e||e.length===0)return Kw();const t=kg.get(e);if(t)return t;const n=e.map(Jo).filter(Boolean);if(!n.length){const o=Kw();return kg.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:wh({customHtmlTags:e})};return kg.set(e,s),s}function iM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function KH(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function xp(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 GH(e,t,n){const s=e.slice();return xp(s,"href")||s.push(["href",t]),n!=null&&!xp(s,"title")&&s.push(["title",n]),s}function Zv(e){return e.map(iM).join("")}function Tf(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:Tf(s.children)});continue}t.push(s)}return t}function YH(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=nM(r),a=sM(r),c=oM(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function bg(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?YH(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:Zv(s),innerTokens:o,nextIndex:i}}function XH(e,t,n,s,o,i,r){const l=String(e.content??""),a=nM(l),{customTagSet:c,allowedTagSet:u}=VH(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!bg(t,n,a).closed){const C=iM(e);return[{type:"text",content:C,raw:C},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=sM(l),f=oM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const C=bg(t,n,a),L=kh(l),$=C.innerTokens,k=String(xp(L,"href")??""),M=xp(L,"title"),E=M==null?null:String(M),O=GH(L,k,E),S=Tf($.length?s($,o,i,r):[]),I=$.length?Zv($):k||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:k,title:E,text:I,attrs:O,children:S,loading:!C.closed,raw:C.html||l},C.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=bg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Tf(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=Tf(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,b=!h.closed,_=!1;if(!h.closed){const C=`</${a}>`;m.toLowerCase().includes(C.toLowerCase())||(m+=C),_=!0,b=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const C=y[1],L=y[2]||y[3]||y[4]||"";g.push([C,L])}if(c?.has(a)){const C=KH(e);return[{type:a,tag:a,attrs:g,content:C?C.inner:h.innerTokens.length?Zv(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:C?.raw??m,loading:e.loading||b,autoClosed:_},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:b,autoClosed:_},h.nextIndex]}function rM(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>rM(t)).join(""):String(e.content??"")}function QH(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>rM(t)).join("")}function Gw(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=QH(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 ZH(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function JH(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 eW(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 Ap(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 tW(e,t,n){const s=e.slice();return Ap(s,"href")||s.push(["href",t]),n!=null&&!Ap(s,"title")&&s.push(["title",n]),s}function of(e,t,n){const s=e[t],o=eW(s.attrs),i=String(Ap(o,"href")??""),r=Ap(o,"title"),l=r==null?null:String(r),a=tW(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(b=>b.type==="strong_open")){const b=String(h.content??""),_=String(h.raw??b),g=Wl(h);g.content=b.slice(0,-2),g.raw=_.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=Kn(f,void 0,void 0,n),m=p.map(b=>{const _=b;return"content"in b?String(_.content??""):String(_.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 Yw(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 nW(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Xw(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 sW=/\\([\\()[\]`$|*_\-!])/g;function oW(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(sW,"$1")===t))return n}function zc(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,oW(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function iW(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 rW(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 lW(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const aW=/[^~]*~{2,}[^~]+/,cW=/\*\*/,uW=/[[_*^~]/,dW=/\\([\\()[\]`$|*_\-!])/g,D0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),fW=/\s/u,pW=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,hW=/\p{P}/u,mW=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,gW=/:\/\//;function vW(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function lM(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&D0.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Xr(e){return!!e&&fW.test(e)}function Qr(e){return!!e&&(pW.test(e)||hW.test(e))}function yW(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||Xr(s)?!1:!(Qr(s)&&n&&!Xr(n)&&!Qr(n))}function kW(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||Xr(n)?!1:!(Qr(n)&&s&&!Xr(s)&&!Qr(s))}function bW(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?lM(e,s):t.indexOf("*",s);if(i===-1)break;if(kW(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function _W(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||Xr(s)?!1:!(Qr(s)&&n&&!Xr(n)&&!Qr(n))}function wW(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||Xr(n)?!1:!(Qr(n)&&s&&!Xr(s)&&!Qr(s))}function SW(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(wW(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function CW(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&&D0.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function xW(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&D0.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function AW(e,t,n){const s=xW(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 TW=/[\p{L}\p{N}]/u,MW=/^[\p{L}\p{N}]+$/u;function Jv(e){return e?TW.test(e):!1}function aM(e){return e?MW.test(e):!1}function fu(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:Jv(s)&&Jv(o)}}function EW(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=fu(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(!aM(e.slice(s.end,o.start)))return o.end}return-1}function IW(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function $W(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=fu(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function NW(e){return e?mW.test(e)||gW.test(e):!1}function LW(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=rd(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(F,te){const ee=e.length===1?t:String(te.content??""),q=[],Y=EW(F);if(Y!==-1){C(F.slice(0,Y),F.slice(0,Y));const ne=F.slice(Y);return ne&&(E({type:"text",content:ne,raw:ne}),u--),u++,!0}if(aW.test(F)){const ne=F.indexOf("~~");ne!==-1&&q.push({type:"strikethrough",index:ne})}if(cW.test(F)){const ne=F.indexOf("**");ne!==-1&&q.push({type:"strong",index:ne})}if(/[^*]*\*[^*]+/.test(F)){const ne=ee?lM(ee,0):F.indexOf("*");if(ee&&ne===-1)return!1;ne!==-1&&q.push({type:"emphasis",index:ne})}q.sort((ne,ce)=>ne.index!==ce.index?ne.index-ce.index:ne.type===ce.type?0:ne.type==="strong"?-1:ce.type==="strong"?1:0);const de=q[0];if(!de)return!1;if(de.type==="strikethrough"){const ne=de.index,ce=ne>-1?F.slice(0,ne):"";if(ce&&C(ce,ce),ne===-1)return u++,!0;const j=F.indexOf("~~",ne+2),G=j===-1?F.slice(ne+2):F.slice(ne+2,j),re=j===-1?"":F.slice(j+2),{node:he}=Xw([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:G,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),y(he),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}if(de.type==="strong"){const ne=de.index,ce=ne>-1?F.slice(0,ne):"";if(ce&&C(ce,ce),ne===-1)return u++,!0;if(t&&ne===0){let Ee=!1,ae=0;for(;ae<F.length&&F[ae]==="*";)ae++;if(t.startsWith("\\*")&&(Ee=!0),Ee){let xe=0,Ke=0;for(;Ke<t.length&&xe<ae;)if(t[Ke]==="\\"&&Ke+1<t.length&&t[Ke+1]==="*")xe+=1,Ke+=2;else{if(t[Ke]==="*")break;Ke++}if(xe>=2)return C(F,F),u++,!0}}if(t&&(F.match(/\*/g)||[]).length>vW(t))return C(F.slice(ce.length),F.slice(ce.length)),u++,!0;const j=fu(F,ne);if(j.len>=3){const Ee=$W(F,ne+j.len);if(Ee!==-1){const ae=F.slice(ne+j.len,Ee);if(IW(ae)){const{node:xe}=zc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae,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(xe);const Ke=F.slice(Ee+3);return Ke&&(E({type:"text",content:Ke,raw:Ke}),u--),u++,!0}}}if(!_W(F,ne)){const Ee=F.slice(ne,ne+j.len);C(Ee,Ee);const ae=F.slice(ne+j.len);return ae&&(E({type:"text",content:ae,raw:ae}),u--),u++,!0}const G=SW(F,ne+2);let re="",he="";if(G.index!==-1){re=F.slice(ne+2,G.index),he=F.slice(G.index+2);const Ee=G.index,ae=fu(F,Ee);if(j.intraword&&ae.intraword&&!aM(re)||!re&&j.len>=4&&j.intraword)return C(F.slice(ce.length),F.slice(ce.length)),u++,!0}else{if(d||G.sawInvalidClose||j.intraword)return C(F.slice(ce.length),F.slice(ce.length)),u++,!0;re=F.slice(ne+2),he=""}if(!re&&/^\*+$/.test(he))return C(F,F),u++,!0;const{node:Ce}=zc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:re,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),y(Ce),he&&(E({type:"text",content:he,raw:he}),u--),u++,!0}if(de.type==="emphasis"){let ne=de.index;ne===-1&&(ne=0);const ce=F.slice(0,ne);if(ce&&C(ce,ce),!yW(F,ne)){C(F[ne],F[ne]);const Ee=F.slice(ne+1);return Ee&&(E({type:"text",content:Ee,raw:Ee}),u--),u++,!0}const j=fu(F,ne),G=bW(ee,F,ne+1),re=G.index,he=e[u+1];if(s?.final&&he?.type==="em_open"&&re!==-1&&F.slice(ne+1,re).trim()!==F.slice(ne+1,re)||re===-1&&(G.sawInvalidClose||s?.final||j.intraword||!Jv(F[ne+1])))return C(F.slice(ne),F.slice(ne)),u++,!0;const{node:Ce}=sf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re>-1?F.slice(ne+1,re):F.slice(ne+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),y(Ce),re!==-1&&re<F.length-1){const Ee=F.slice(re+1);Ee&&(E({type:"text",content:Ee,raw:Ee}),u--)}return u++,!0}return!1}function b(F,te){if(!F.includes("`"))return!1;const q=(he=>{for(let Ce=0;Ce<he.length;Ce++){if(he[Ce]!=="`")continue;let Ee=0;for(let ae=Ce-1;ae>=0&&he[ae]==="\\";ae--)Ee++;if(Ee%2===0)return Ce}return-1})(F);if(q===-1)return!1;let Y=1;for(let he=q+1;he<F.length&&F[he]==="`";he++)Y++;const de="`".repeat(Y),ne=q+Y,ce=F.indexOf(de,ne);if(ce===-1){if(Y===1){const Ce=F.slice(0,q),Ee=F.slice(q+1);return Ce&&(m(Ce,te)?u--:C(Ce,Ce)),g({type:"inline_code",code:Ee,raw:String(Ee)}),u++,!0}let he=F;for(let Ce=u+1;Ce<e.length;Ce++)he+=String((e[Ce].content??"")+(e[Ce].markup??""));return u=e.length-1,C(he,he),u++,!0}p();const j=F.slice(0,q),G=F.slice(q+Y,ce),re=F.slice(ce+Y);return j&&(m(j,te)?u--:C(j,j)),g({type:"inline_code",code:G,raw:String(G??"")}),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}function _(F){const te=l?.__markdownIt;if(!te||e.length<=1||!e.some(de=>de?.type==="math_inline")||!uW.test(F))return null;const ee=te.parseInline(F,{__markstreamFinal:!!s?.final});if(!Array.isArray(ee)||ee.length===0)return null;const q=(ee.find(de=>de?.type==="inline")?.children??[]).filter(de=>!(de?.type==="text"&&String(de.content??"")===""));if(!q.length||!q.some(de=>de?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===F)return null;const Y=Kn(q,F,n,s);return Y.length?Y:null}function g(F){p(),a.push(F)}function v(F){p();const te=Wl(F);a.push(te)}function y(F){g(F)}function C(F,te){c?(c.content+=F,c.raw+=te??F):(c={type:"text",content:String(F??""),raw:String(te??F??"")},a.push(c))}function L(F,te){if(!F)return;const ee=Kn([{...te,type:"text",content:F,raw:F}],F,n,s);if(ee.length===1&&ee[0]?.type==="text"){const q=ee[0];C(String(q.content??""),String(q.raw??q.content??""));return}for(const q of ee)y(q)}function $(F,te){return String(F.markup??"").startsWith(te)}function k(F){return F.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(F,te){let ee=F;const q=String(te.content??"");return ee.endsWith("\\")&&!$(te,"\\\\")&&!q.endsWith("\\\\")&&(ee=ee.slice(0,-1)),ee.endsWith("(")&&!$(te,"\\(")&&!q.endsWith("\\(")&&(ee=ee.slice(0,-1)),/\*+$/.test(ee)&&!$(te,"\\*")&&!q.endsWith("\\*")&&(ee=ee.replace(/\*+$/,"")),ee}for(;u<e.length;){const F=e[u];E(F)}function E(F){switch(F.type){case"text":S(F);break;case"softbreak":c?(c.content+=`
167
- `,c.raw+=`
168
- `):(c={type:"text",content:`
169
- `,raw:`
170
- `},a.push(c)),u++;break;case"code_inline":y(ZH(F)),u++;break;case"html_inline":{const[te,ee]=XH(F,e,u,Kn,t,n,s);y(te),u=ee;break}case"link_open":I(F);break;case"image":Ae(F)||(p(),y(Gw(F)),u++);break;case"strong_open":{p();const{node:te,nextIndex:ee}=zc(e,u,F.content,s);y(te),u=ee;break}case"em_open":{p();const{node:te,nextIndex:ee}=sf(e,u,s);y(te),u=ee;break}case"s_open":{p();const{node:te,nextIndex:ee}=Xw(e,u,s);y(te),u=ee;break}case"mark_open":{p();const{node:te,nextIndex:ee}=jH(e,u,s);y(te),u=ee;break}case"ins_open":{p();const{node:te,nextIndex:ee}=JH(e,u,s);y(te),u=ee;break}case"sub_open":{p();const{node:te,nextIndex:ee}=iW(e,u,s);y(te),u=ee;break}case"sup_open":{p();const{node:te,nextIndex:ee}=rW(e,u,s);y(te),u=ee;break}case"sub":p(),y({type:"subscript",children:[{type:"text",content:String(F.content??""),raw:String(F.content??"")}],raw:`~${String(F.content??"")}~`}),u++;break;case"sup":p(),y({type:"superscript",children:[{type:"text",content:String(F.content??""),raw:String(F.content??"")}],raw:`^${String(F.content??"")}^`}),u++;break;case"emoji":{p();const te=e[u-1];te?.type==="text"&&/\|:-+/.test(String(te.content??""))?C("",""):y(FH(F)),u++;break}case"checkbox":p(),y(DH(F)),u++;break;case"checkbox_input":p(),y(BH(F)),u++;break;case"footnote_ref":p(),y(UH(F)),u++;break;case"footnote_anchor":{p();const te=F.meta??{};g({type:"footnote_anchor",id:String(te.label??F.content??""),raw:String(F.content??"")}),u++;break}case"hardbreak":p(),y(qH()),u++;break;case"fence":p(),y(R0(e[u])),u++;break;case"math_inline":p(),!F.content&&F.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Yw({...F,content:e[u+1].content})),u+=2):y(Yw(F)),u++;break;case"reference":D(F);break;case"text_special":C(String(F.content??""),String(F.content??"")),u++;break;default:{const te=F;if(F.type==="link"&&te.href!=null&&s?.validateLink&&!s.validateLink(String(te.href))){p();const ee=String(te.text??"");C(ee,ee),u++}else be(F)||z(F)||Q(F)||H(F)||v(F),u++;break}}}function O(F,te,ee,q){const Y=lW({...te,content:F});if(c){c.content+=M(Y.content,te),c.raw+=Y.raw;return}const de=ee?.tag==="br"&&e[u-2]?.content==="[";q||(Y.content=M(Y.content,te)),c=Y,c.center=de,a.push(c)}function S(F){const te=String(F.content??""),ee=e.length===1&&te.includes("\\")&&typeof t=="string"?String(t):"";let q=ee?CW(ee):te.replace(dW,"$1");if(F.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const Y=q.indexOf("$");Y!==-1&&Y===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let de=a.length,ne="";for(let re=a.length-1;re>=0;re--){const he=a[re];if(he.type!=="text")break;de=re,ne=String(he.content??"")+ne}de<a.length&&(q.startsWith(ne)?(c=null,a.length=de):c=a[a.length-1]);const ce=e[u+1];if((q==="`"||q==="|"||q==="$")&&!$(F,`\\${q}`)||/^\*+$/.test(q)&&!$(F,"\\*")){u++;return}if(!ce&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(me(q)||ze(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){O(q,F,e[u-1],ce),u++;return}if(le(q))return;const j=e[u-1];if(q==="["&&!ce?.markup?.includes("*")&&!$(F,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!$(F,"\\]")){u++;return}if(b(te,F)||Le(q)||(e[u+1]?.type!=="link_open"||k(q))&&Fe(q,F))return;const G=_(te);if(G){p();for(const re of G)y(re);u++;return}m(q,F)||(O(q,F,j,ce),u++)}function I(F){if(P(F))return;if(qe()){const{node:ce,nextIndex:j}=of(e,u,s),G=String(ce.text||ce.href||"");C(G,G),u=j;return}p();const{node:te,nextIndex:ee}=of(e,u,s);u=ee;const q=te.text||te.href||"";if(F.markup==="linkify"&&!WT(q,te.href,t)&&wp(q,l?.__linkifyDemotionContext)){C(q,q);return}const Y=te.children.length===1&&te.children[0]?.type==="text";if(te.loading&&t&&te.text===te.href&&Y){const ce=LW(t,te.href);ce&&(te.text=ce,te.children=[{type:"text",content:ce,raw:ce}],te.raw=`[${ce}](${te.href}${te.title?` "${te.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(te.href)){C(te.text,te.text);return}const de=F.attrs?.find(([ce])=>ce==="href")?.[1],ne=String(de??"");if(t&&ne){const ce=t.indexOf("](");if(ce!==-1){const j=t.indexOf(")",ce+2);j===-1?te.loading=!0:te.loading&&t.slice(ce+2,j).includes(ne)&&(te.loading=!1)}}H(te)||g(te)}function P(F){if(F.markup!=="linkify")return!1;const{node:te,nextIndex:ee}=of(e,u,s);return U(te,ee)?(u=ee,!0):!1}function D(F){p(),y(nW(F)),u++}function H(F){if(F.type!=="link")return!1;const te=a[a.length-1];if(!te||te.type!=="text")return!1;const ee=String(te.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ee)return!1;const q=F,Y=String(q.href??""),de=String(q.text??""),ne=String(ee[2]??""),ce=Y.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Y||!(de===Y||de===ce||NW(de)))return!1;const j=String(ee[1]??"");return j?(te.content=j,te.raw=j):a.pop(),g({...F,text:ne,children:[{type:"text",content:ne,raw:ne}],raw:`[${ne}](${Y}${q.title?` "${q.title}"`:""})`}),!0}function z(F){if(F.type!=="link")return!1;const te=F,ee=String(te.href??"");return ee?U({href:ee,title:te.title==null||te.title===""?null:String(te.title),loading:!!te.loading},u+1):!1}function U(F,te){const ee=a[a.length-1];if(ee?.type!=="image"||ee.src||!ee.loading||!String(ee.raw??"").endsWith("]("))return!1;const q=e[te],Y=String(q?.content??"");if(q?.type!=="text"||!Y.startsWith(")"))return!1;a.pop(),c=null;const de=String(ee.alt??"");g({type:"image",src:F.href,alt:de,title:F.title,raw:`![${de}](${F.href}${F.title?` "${F.title}"`:""})`,loading:!!F.loading});const ne=Y.slice(1),ce=Wl(q);return ce.content=ne,ce.raw=ne,h()[te]=ce,!0}function Q(F){if(F.type!=="link")return!1;const te=a[a.length-1],ee=e[u-1];if(!te||te.type!=="text"||ee?.type!=="text")return!1;const q=String(te.content??""),Y=String(ee.content??"");if(!q.endsWith("!")||!Y.endsWith("!")||$(ee,"\\!"))return!1;const de=q.slice(0,-1);de?(te.content=de,te.raw=de,c=te):(a.pop(),c=null);const ne=F,ce=String(ne.text??ne.children?.map(re=>String(re?.content??re?.raw??"")).join("")??""),j=String(ne.href??""),G=ne.title==null||ne.title===""?null:String(ne.title);return g({type:"image",src:j,alt:ce,title:G,raw:`![${ce}](${j}${G?` "${G}"`:""})`,loading:!!ne.loading}),!0}function X(F,te="",ee=null){const q=String(F.alt??F.raw??"");return{type:"link",href:te,title:ee,text:q,children:[F],raw:`[${q}](${te}${ee?` "${ee}"`:""})`,loading:!0}}function ue(F){const te=F.startsWith("![")?F:`![${F}`,ee=te.slice(2),q=ee.indexOf("](");return{type:"image",src:"",alt:q===-1?ee.replace(/\]$/,""):ee.slice(0,q),title:null,raw:te,loading:!0}}function me(F){const te=F.indexOf("[![");if(te===-1||typeof t=="string"&&e.length===1&&AW(t,te,"["))return!1;const ee=F.slice(0,te);return ee&&C(ee,ee),g(X(ue(F.slice(te+1)))),u++,!0}function Ae(F){if(s?.final)return!1;const te=e[u-1];if(te?.type!=="text"||!String(te.content??"").endsWith("[")||$(te,"\\["))return!1;const ee=a[a.length-1];if(ee?.type==="text"&&ee.content.endsWith("[")){const q=ee.content.slice(0,-1);q?(ee.content=q,ee.raw=q,c=ee):(a.pop(),c=null)}return g(X(Gw(F))),u++,!0}function be(F){if(F.type!=="link")return!1;const te=F,ee=String(te.raw??""),q=String(te.text??"");if(!ee.startsWith("[![")&&!q.startsWith("!["))return!1;const Y=te.title==null||te.title===""?null:String(te.title);return g(X({type:"image",src:String(te.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:Y,raw:ee.startsWith("[![")?ee.slice(1):ee,loading:!0})),!0}function ze(F){if(!F.startsWith("]("))return!1;const te=e[u-2];if(te?.type==="text"&&String(te.content??"").endsWith("[")&&$(te,"\\["))return!1;const ee=a[a.length-1];if(ee?.type!=="image"&&ee?.type!=="link")return!1;const q=ee,Y=ee?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,de=Y?Y.children[0]:a.pop();if(!de||de.type!=="image")return!1;const ne=e[u+1];let ce=String(Y?.href??""),j=Y?.title==null?null:String(Y.title),G=!0;if(ne?.type==="link_open"){const{node:he,nextIndex:Ce}=of(e,u+1,s);ce=he.href,j=he.title,G=!0,u=Ce}else{if(ce=F.slice(2),ce.includes('"')){const he=ce.split('"');ce=String(he[0]??"").trim(),j=he[1]==null?null:String(he[1]).trim()}u++}const re=X(de,ce,j);return re.loading=G,g(re),!0}function qe(){const F=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&F?.type==="text"&&String(F.content??"").endsWith("[")&&$(F,"\\[")}function Fe(F,te){const ee=F.indexOf("[");if(ee===-1)return!1;let q=F.slice(0,ee);const Y=F.indexOf("](",ee);if(Y!==-1){const de=e[u+2];let ne=F.slice(ee+1,Y);if(ne.includes("[")){const Ee=ne.indexOf("[");q+=F.slice(0,ee+Ee+1);const ae=ee+Ee+1;ne=F.slice(ae+1,Y)}const ce=e[u+1];if(F.endsWith("](")&&ce?.type==="link_open"&&de){const Ee=e[u+4];let ae=4,xe=!0;if(Ee?.type==="text"){const st=String(Ee.content??"");if(st.startsWith(")")){xe=!1;const _t=st.slice(1);if(_t){const wt=Wl(Ee);wt.content=_t,wt.raw=_t,h()[u+4]=wt}else ae++}else st==="."&&ae++}L(q,te);const Ke=String(de.content??"");return s?.validateLink&&!s.validateLink(Ke)?C(ne,ne):g({type:"link",href:Ke,title:null,text:ne,children:[{type:"text",content:ne,raw:ne}],loading:xe}),u+=ae,!0}const j=F.indexOf(")",Y),G=j!==-1?F.slice(Y+2,j):"",re=j===-1;let he=q.match(/\*+$/);if(he&&(q=q.replace(/\*+$/,"")),L(q,te),he||(he=ne.match(/^\*+/)),!d&&he){const Ee=he[0].length;ne=ne.replace(/^\*+/,"").replace(/\*+$/,"");const ae=[];if(Ee===1?ae.push({type:"em_open",tag:"em",nesting:1}):Ee===2?ae.push({type:"strong_open",tag:"strong",nesting:1}):Ee===3&&(ae.push({type:"strong_open",tag:"strong",nesting:1}),ae.push({type:"em_open",tag:"em",nesting:1})),ae.push({type:"link",href:G,title:null,text:ne,children:[{type:"text",content:ne,raw:ne}],loading:re}),Ee===1){ae.push({type:"em_close",tag:"em",nesting:-1});const{node:xe}=sf(ae,0,s);y(xe)}else if(Ee===2){ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:xe}=zc(ae,0,void 0,s);y(xe)}else if(Ee===3){ae.push({type:"em_close",tag:"em",nesting:-1}),ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:xe}=zc(ae,0,void 0,s);y(xe)}else{const{node:xe}=sf(ae,0,s);y(xe)}}else s?.validateLink&&!s.validateLink(G)?C(ne,ne):g({type:"link",href:G,title:null,text:ne,children:[{type:"text",content:ne,raw:ne}],loading:re});const Ce=j!==-1?F.slice(j+1):"";return Ce&&(E({type:"text",content:Ce,raw:Ce}),u--),u++,!0}return!1}function Le(F){const te=F.indexOf("![");if(te===-1)return!1;const ee=F.slice(0,te);return ee&&!c?c={type:"text",content:ee,raw:ee}:ee&&c&&(c.content+=ee),c&&(a.push(c),c=null),g(ue(F.slice(te))),u++,!0}function le(F){if(!(F?.startsWith("[")&&n?.type==="list_item_open"))return!1;const te=F.slice(1).match(/[^\s\]]/);if(te===null)return u++,!0;if(te&&/x/i.test(te[0])){const ee=te[0]==="x"||te[0]==="X";return g({type:"checkbox_input",checked:ee,raw:ee?"[x]":"[ ]"}),u++,!0}return!1}return a}function OW(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 PW(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 RW(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function hc(e,t,n){const s=e[t],o=[],i=ol(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=RW(c)?Wl(c):c,d=e[a-1];u!==c&&(PW(u),OW(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]=mc(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]=hc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=F0(e,a,i.options(),B0);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(`
171
- `)},r+1]}function DW(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=ol(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]=hc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=mc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=bh(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}
172
- ${r.map(c=>c.raw).join(`
173
- `)}
174
- :::`},a+1]}const BW=new Set(["warning","info","note","tip","danger","caution"]);function FW(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 BW.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function HW(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=FW(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=ol(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 b=f[m];if(b.type==="text"&&/:+/.test(b.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]=hc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=mc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=bh(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}
175
- ${l.map(d=>d.raw).join(`
176
- `)}
177
- :::`},c+1]}const WW=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function zW(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=WW.exec(String(s.info??""));return o?DW(e,t,o,n):null}const B0={parseContainer:(e,t,n)=>HW(e,t,n),matchAdmonition:zW};function mc(e,t,n){const s=[],o=ol(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]=hc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=mc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=F0(e,i,o.options(),B0);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(`
178
- `)},i+1]}function UW(e){if(e.info?.startsWith("diff"))return R0(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 qW(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=ol(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(`
179
- `)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
180
- `)},o+1]}function jW(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=ol(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(`
181
- `)}`},l+1]}function VW(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 KW(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 cM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=Vn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=Ql.has(n),l=kh(o),a=(s===-1?-1:KW(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
182
- </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function GW(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 YW(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 uM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function dM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return uM(n)?n:void 0}function XW(e,t,n){const s=dM(rd(t),n);if(!uM(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 QW(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=YW(e[c].attrs),b=a.length,_=!f&&!r,g=_?o?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Kn(h.children||[],p,void 0,XW(n,g,_?u:void 0)),raw:p,align:m}),_&&(u=dM(u,rd(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(`
183
- `)},s+1]}function ZW(){return{type:"thematic_break",raw:"---"}}let _g=null;const wg=new WeakMap;function Qw(){return _g||(_g={allowedTagSet:wh(),customTagSet:null}),_g}function JW(e){if(!e||e.length===0)return Qw();const t=wg.get(e);if(t)return t;const n=e.map(Jo).filter(Boolean);if(!n.length){const o=Qw();return wg.set(e,o),o}const s={allowedTagSet:wh({customHtmlTags:e}),customTagSet:new Set(n)};return wg.set(e,s),s}function ez(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=ol(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]=hc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=mc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=bh(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+=`
184
- `,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
185
- `),f+=`
186
- `),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 tz(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function nz(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function sz(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${xo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${xo(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 oz(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 b=m+1;return{raw:e.slice(r,b),end:b}}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 e1(e){return Number.isFinite(e)&&e>0?e:0}function iz(e,t){const n=e1(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
187
- `&&(s++,s===n))return o+1;return e.length}function bh(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[VW(e,t,n),t+3];case"code_block":return[UW(s),t+1];case"fence":return[R0(s),t+1];case"math_block":return[GW(s),t+1];case"html_block":{const o=cM(s),i=o.tag?JW(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)?iz(l,Number(s.map?.[0]??0)):0,u=oz(l,r,Math.max(e1(a),e1(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:sz(d,r,f+1),b=m?.start??-1;let _="";f!==-1&&(b!==-1&&f<b?_=d.slice(f+1,b):_=d.slice(f+1)),b===-1&&(_=nz(_,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(h))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const $=y[2]||y[3]||y[4]||"";g.push([L,$])}const C=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:tz(_),raw:String(u?.raw??o.raw??d),loading:C,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=QW(e,t,n);return[o,i]}case"dl_open":{const[o,i]=qW(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=jW(e,t,n);return[o,i]}case"hr":return[ZW(),t+1]}return null}function F0(e,t,n,s){const o=bh(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 ez(e,t,n)}return null}function rz(){return{type:"hardbreak",raw:`\\
188
- `}}function lz(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 Zw=new WeakMap,_h=new WeakMap,az=["$$","\\["];function ic(){return typeof performance<"u"?performance.now():Date.now()}function H0(e,t,n){e&&(e[t]=(e[t]??0)+n)}function fM(e){return e.__timing}function Sg(e,t,n){return t&&H0(t,"parseMarkdownToStructureTotalMs",ic()-n),e}function Jw(e,t,n){if(!n)return l2(e,t);const s=ic(),o=l2(e,t);return H0(n,"processTokensMs",ic()-s),o}function cz(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=pc(t);return n.length?new Set(n):null}function uz(e,t){const n=e;let s=Zw.get(n);s||(s=new Map,Zw.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 dz(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function rf(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]=El(o.value,n))}}function El(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(El(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(El(l,t),El(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(El(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),rf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),rf(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),rf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!dz(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),rf(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=El(i[r],t);return o}function pM(e,t=!0){if(!t)return Wl(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=>pM(a,t)):t&&r&&typeof r=="object"&&(l=El(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function e2(e,t=!0){return e.map(n=>pM(n,t))}function hM(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 fz(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 pz(e){_h.delete(e)}function hz(e,t,n){_h.set(e,{source:t,key:n,pendingCandidate:n===null&&eM(t)})}function mz(e){return e.endsWith("$")||e.endsWith("\\")}function gz(e){const t=Math.max(e.lastIndexOf(`
189
- `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return az.some(s=>n.endsWith(s))}function vz(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||gz(e)&&/[\r\n]/.test(t)):!1}function yz(e,t){if(!KT(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=_h.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&&!vz(o.source,l)&&!mz(t)){o.source=t;return}}const i=NH(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),hz(e,t,i)}function kz(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function bz(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 Cg(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&&bz(e,t)}function t2(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function _z(e){for(let t=0;t+5<e.length;t++)if(t2(e,t)&&t2(e,t+3)&&Cg(e[t],e[t+3])&&Cg(e[t+1],e[t+4])&&Cg(e[t+2],e[t+5]))return!0;return!1}function wz(e,t,n){return KT(e)&&eM(t)&&_z(n)}function Sz(e){const t=_h.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function n2(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!hM(e,s)||(yz(e,t),Sz(e)))return e.parse(t,n);const o=e.stream.parse(t,uz(e,n));if(wz(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!kz(s))return o;const i=fM(s);if(!i)return e2(o,!0);const r=ic(),l=e2(o,!0);return H0(i,"tokenCloneMs",ic()-r),l}function wh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Hu;const n=new Set(Hu);for(const s of pc(t))s&&n.add(s);return n}function Cz(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 s2(e){return{type:"paragraph",children:e,raw:e.map(Cz).join("")}}function o2(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=cz(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(s2(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(s2(c)),a}function xz(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 pu(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function Az(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*${xo(t)}\s*>\s*$`,"i").test(n)}function W0(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${xo(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(Ql.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*${xo(s)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${xo(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 b=p+m+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const m=Vn(e.slice(p));if(m===-1)return null;const b=e.slice(p,p+m+1);/\/\s*>$/.test(b)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function Tz(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]===`
190
- `){n++;continue}return-1}return s===t.length?n:-1}function Mz(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
191
- </${t}>`}function i2(e){return e.replace(/\r\n/g,`
192
- `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function Ez(e,t,n){return n?e.includes(n,t)?!0:i2(e.slice(Math.max(0,t))).includes(i2(n)):!1}function Iz(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
193
- `&&n++,n):e[n]===`
194
- `?n+1:t}function r2(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 $z(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function z0(e,t){const n=new RegExp(String.raw`<\s*\/\s*${xo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function mM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const Nz=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),Lz=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function Oz(e){return/\n\s*\n/.test(e)||Lz.test(e)}function Pz(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>Nz.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(!Oz(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function Rz(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"||IT.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=z0(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=hu(u,t,mM(n,s));return Pz(u,d)?{...o,children:d}:o})}function hu(e,t,n){return e.trim()?vM(e,t,{...n,__disableStreamParse:!0}):[]}function Dz(e,t,n){const s=hu(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function Bz(e,t,n){const s=cM({content:e}),o=Vn(e),i=z0(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=Dz(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function Fz(e,t,n){const s=Vn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=W0(o,"summary",0);if(!i)return hu(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...hu(r,t,n),Bz(i.raw,t,n),...hu(l,t,n)]}function gM(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=pu(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!r2(c)){r.push(c);continue}const f=String(c.raw??pu(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 X=e[Q];if(r2(X)){p++;continue}if($z(X)&&(p--,p===0)){m=Q;break}}const b=W0(t,"details",h),_=m===-1&&b?.closed===!0,g=_?(()=>{const Q=z0(f,"details");return Q!==-1?f.slice(0,Q):f})():f,[v]=gM(_?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),y=Fz(g,n,mM(s,o)),C=m===-1?"</details>":String(e[m].raw??pu(e[m])??"</details>"),L=_||m!==-1&&b?.closed===!0,$=C.replace(/[\t\r\n ]+$/,""),k=L?(()=>{const Q=(b?.raw??"").lastIndexOf($);return Q===-1?t.length:h+Q})():t.length,M=Vn(f),E=_&&M!==-1?h+M+1:h+f.length,O=t.slice(E,k===-1?t.length:k),S=n.parse(O,{__markstreamFinal:o}),I=n.renderer.render(S,n.options,{__markstreamFinal:o}),P=k+$.length,D=L?Math.max(k+C.length,Iz(t,P)):t.length,H=L?t.slice(k,D):C,z=L?t.slice(h,D):t.slice(h),U=_&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:kh(f.slice(0,M+1)),raw:z,content:`${U}${I}${H}`,children:[...y,...v],loading:!o&&!L}),l=L?D:t.length,m===-1&&!_)break;m!==-1&&(a=m)}return[r,l]}function Hz(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=pu(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=W0(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=Mz(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,b=Vn(u.raw),_=b===-1?"":u.raw.slice(0,b+1),g=_?kh(_):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let v=Tz(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&Az(s[y],c)){s.splice(y,1);continue}const C=pu(s[y]);if(!C)break;const L=u.raw.indexOf(C,v);if(L===-1){if(Ez(n,u.end,C))break;s.splice(y,1);continue}v=L+C.length,s.splice(y,1)}}return s}function Wz(e){const t=l=>l===" "||l===" "||l===`
195
- `||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 b=m.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=m=>{const b=m.charCodeAt(0);return b>=48&&b<=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 b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")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 C=v;for(;C<g.length&&g[C]===y;)C++;const L=C-v;return L<3?null:{markerChar:y,markerLen:L,rest:g.slice(C)}},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 b=0;const _=l.split(/\r?\n/);for(const g of _){const v=b,y=b+g.length;if(a<v)break;const C=m(g);if(C){const L=C.markerChar,$=C.markerLen;c?L===u&&$>=d&&/^\s*$/.test(C.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=$)}if(a<=y)break;b=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===`
196
- `||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]===`
197
- `||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function zz(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 b=0;b<p.length;b++){const _=p[b];if(_===" "){if(m++,m>=4)return!0;continue}if(_===" ")return!0;break}return!1},r=p=>{let m=!1,b=!1;for(let _=0;_<p.length;_++){const g=p[_];if(g==="\\"){_++;continue}if(!b&&g==="'"){m=!m;continue}if(!m&&g==='"'){b=!b;continue}if(!m&&!b&&g===">")return _}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const b=p[m];if(b!=="`"&&b!=="~")return null;let _=m;for(;_<p.length&&p[_]===b;)_++;const g=_-m;return g<3?null:{markerChar:b,markerLen:g,rest:p.slice(_)}},a=(p,m)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let _=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){s(v)||(_=!0),g++;continue}const y=r(p.slice(g));if(y===-1){_=!0,g++;continue}const C=p.slice(g,g+y+1);let L=1;for(;L<C.length&&s(C[L]);)L++;if(L>=C.length){_=!0,g++;continue}const $=C[L];if($==="!"||$==="?"){_=!0,g+=y+1;continue}if($==="/"){_=!0,g+=y+1;continue}const k=L;for(;L<C.length&&o(C[L]);)L++;if(L===k){_=!0,g++;continue}const M=C.slice(k,L).toLowerCase(),E=C[L];if(E&&E!==" "&&E!==" "&&E!==">"&&E!=="/"){_=!0,g++;continue}const O=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),S=/\/\s*>$/.test(C),I=O.test(p.slice(g+y+1)),P=O.test(e.slice(m+g+y+1)),D=/[\r\n]/.test(e.slice(m+g+y+1));if(_&&n.has(M)&&!S&&!I&&(P||D))return g;_=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
198
- `,h),m=p!==-1,b=m&&p>h&&e[p-1]==="\r",_=m?b?p-1:p:e.length,g=e.slice(h,_),v=m?b?`\r
199
- `:`
200
- `:"",y=l(g);let C=g;if(!c&&!y){const L=a(g,h);if(L!==-1){const $=v||`
201
- `;C=`${g.slice(0,L).replace(/[ \t]+$/,"")}${$}${$}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=C,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 Uz(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 b=m+1;for(;b<d.length&&s(d[b]);)b++;if(b>=d.length||d[b]!=="/"){m=d.indexOf("<",m+1);continue}for(b++;b<d.length&&s(d[b]);)b++;if(b+p.length>d.length){m=d.indexOf("<",m+1);continue}let _=!0;for(let v=0;v<p.length;v++){const y=d[b+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==p[v]){_=!1;break}}if(!_){m=d.indexOf("<",m+1);continue}let g=b+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 b=f+m;if(l(d,b+1,p))return d;const _=i(d.slice(b+1));return _?`${d.slice(0,b+1)}
202
- ${_}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
203
- `,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
204
- `:`
205
- `,u=d+1}return c}function qz(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 b=m-h;return b<3?null:{markerChar:p,markerLen:b,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(`
206
- `,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,b=e.slice(d,m),_=h?p?`\r
207
- `:`
208
- `:"",g=o(b),v=g?.prefix??"",y=g?.content??b,C=i(y);C&&(l?C.markerChar===a&&C.markerLen>=c&&/^\s*$/.test(C.rest)&&(l=!1,a="",c=0):(l=!0,a=C.markerChar,c=C.markerLen));let L=y;if(!l&&L.includes("</"))for(const $ of r)L=L.replace($,(k,M,E,O)=>{if(O.replace(/^[\t ]+/,"").startsWith("|"))return k;const S=O.slice(0,E).replace(/^[\t ]+/,"");if(S.length>0){const I=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!P||I!==P)return k}return`${M}
209
-
210
- `});if(v){const $=v+L.split(`
211
- `).join(`
212
- ${v}`);u+=$}else u+=L;u+=_,d=h?f+1:e.length}return u}function jz(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 I=0;for(let P=0;P<S.length;P++){const D=S[P];if(D===" "){if(I++,I>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,P=!1,D=0;for(;I<S.length;){for(;I<S.length&&s(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(P=!0,I++;I<S.length&&s(S[I]);)I++;D=I}if(!P)return null;const H=S.slice(0,D);return{prefix:H,key:H.replace(/[ \t]+$/,""),content:S.slice(D)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const P=S[I];if(P!==" "&&P!==" ")return!1}return!0},u=S=>{if(o(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let P=1;for(;P<I.length&&s(I[P]);)P++;if(P>=I.length||I[P]==="/"||I[P]==="!"||I[P]==="?")return"";const D=P;for(;P<I.length&&i(I[P]);)P++;if(P===D)return"";const H=I.slice(D,P).toLowerCase();if(!n.has(H))return"";const z=I[P];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":H},d=S=>{if(o(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let P=1;for(;P<I.length&&s(I[P]);)P++;if(P>=I.length)return null;const D=I[P]==="/";if(D)for(P++;P<I.length&&s(I[P]);)P++;const H=I[P];if(!H||H==="!"||H==="?")return null;const z=P;for(;P<I.length&&i(I[P]);)P++;if(P===z)return null;const U=I.slice(z,P).toLowerCase();if(!n.has(U))return null;const Q=I[P];if(Q&&Q!==" "&&Q!==" "&&Q!==">"&&Q!=="/")return null;if(D)return{type:"close",name:U};if(/\/\s*>\s*$/.test(I))return{type:"open",name:U,complete:!0};const X=I.indexOf(">",P);if(X!==-1){const ue=I.slice(X+1);if(new RegExp(`<\\s*\\/\\s*${U}\\s*>`,"i").test(ue))return{type:"open",name:U,complete:!0}}return{type:"open",name:U,complete:!1}},f=S=>{if(o(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const P=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const D=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const H=D[1].toLowerCase();return H===D[2].toLowerCase()?H:null};let h=!1,p="",m=0;const b=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;const P=S[I];if(P!=="`"&&P!=="~")return null;let D=I;for(;D<S.length&&S[D]===P;)D++;const H=D-I;return H<3?null:{markerChar:P,markerLen:H,rest:S.slice(D)}},_=S=>b(S),g=S=>{const I=r(S);return I?o(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},v=(S,I,P)=>{let D=S,H=0;for(;D<e.length;){const z=e.indexOf(`
213
- `,D),U=z!==-1,Q=U&&z>D&&e[z-1]==="\r",X=U?Q?z-1:z:e.length,ue=e.slice(D,X),me=l(ue),Ae=me?.key??"";if(H>0&&I&&Ae!==I)break;const be=me?.content??ue,ze=d(be);if(ze?.name===P){if(ze.type==="open")ze.complete||H++;else if(H>0&&(H--,H===0))return!1}else if(H>0&&(c(be)||g(be)))return!0;if(U)D=z+1;else break}return!1};let y="",C=0,L=!0,$=!1,k=!1,M=`
214
- `;const E=[];let O="";for(;C<e.length;){const S=e.indexOf(`
215
- `,C),I=S!==-1,P=I&&S>C&&e[S-1]==="\r",D=I?P?S-1:S:e.length,H=e.slice(C,D),z=I?P?`\r
216
- `:`
217
- `:"",U=l(H),Q=U?.key??"",X=U?.content??H,ue=_(X);ue&&(h?ue.markerChar===p&&ue.markerLen>=m&&/^\s*$/.test(ue.rest)&&(h=!1,p="",m=0):(h=!0,p=ue.markerChar,m=ue.markerLen));const me=E.length>0;if(!h&&!me){const be=u(X),ze=!!be&&!L&&$&&k&&v(C,Q,be);be&&!L&&(!$||ze)&&(Q&&O&&Q===O?y+=`${Q}${M}`:Q||(y+=M))}if(y+=H,y+=z,z&&(M=z),!h){const be=d(X);if(be){if(be.type==="open")be.complete||E.push(be.name);else for(let ze=E.length-1;ze>=0;ze--)if(E[ze]===be.name){E.length=ze;break}}}const Ae=c(X);L=Ae,$=!Ae&&a(X),k=!Ae&&!!f(X),O=Q,C=I?S+1:e.length}return y}function vM(e,t,n={}){const s=fM(n),o=s?ic():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(fz(t,n)&&(t.stream.reset(),pz(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
218
- `)?`
219
- `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
220
- `)?`
221
- `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
222
- `)?`
223
- `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
224
- `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
225
- `)?`
226
- `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,_,g)=>`${_}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
227
- `)?`
228
- `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
229
- `))),n.customHtmlTags?.length&&r.includes("<")){const b=pc(n.customHtmlTags);if(b.length&&(r=zz(r,b),r=Uz(r,b),r=jz(r,b),r=qz(r,b),r.includes("</")))for(const _ of b){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${_}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=Wz(r));const l=xz(r);if(l){const b=n.preTransformTokens,_=n.postTransformTokens;if(hM(t,n)||typeof b=="function"||typeof _=="function"){const g=n2(t,r,{__markstreamFinal:i},n),v=typeof b=="function"&&b(g)||g;typeof _=="function"&&_(v)}return Sg(l,s,o)}const a=n2(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Sg([],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=Jw(d,p,s);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const _=b[0],g=_?.type;_&&typeof g=="string"?m=Jw(b,void 0,s):m=b}}if(m=Hz(m,i,r),m=gM(m,r,t,n,i)[0],m=Rz(m,t,n,i),i){const b=new WeakSet,_=g=>{if(!g||typeof g!="object"||b.has(g))return;if(b.add(g),Array.isArray(g)){for(const y of g)_(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))_(y)};_(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Sg(m,s,o)}function l2(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=ol(t);let o=0;for(;o<e.length;){const i=F0(e,o,s.options(),B0);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=lz(e,o,s.options(l)),c=o2(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]=hc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=mc(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(rz()),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=o2(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const Vz=new Set([...id,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),Kz=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"]),a2=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function c2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Gz(e){return typeof e=="string"?e:e==null?"":String(e)}function yM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Pr(e){return Gz(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function kM(e){return Pr(e).replace(/`/g,"&#96;")}function Sh(e){return String(e??"").trim().toLowerCase()}function U0(e,t="safe"){const n=Sh(e);return n?t==="escape"?!0:t==="trusted"?id.has(n):!Kz.has(n):!1}function bM(e,t="safe"){const n=Sh(e);return n?t==="escape"?!0:t==="trusted"?id.has(n):Vz.has(n):!1}function u2(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${kM(s)}"`).join("")}function Yz(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||Hl(o,{tagName:t,attrName:"srcset"})})}function _M(e,t,n,s){return NB.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?Yz(t,s):!!(LB.has(e)&&t&&Hl(t,{tagName:s,attrName:e}))}function Il(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function wM(e,t,n,s=!1){if(t!=="safe"||Sh(n)!=="a")return e;const o=Il(e,"href");if(s&&(!o||!e[o])){const a=Il(e,"target"),c=Il(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Il(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Il(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 d2(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!yM(r)||_M(l,i,t,n)||(s[r]=i)}return wM(s,t,n,!!Il(e,"href"))}function SM(e,t){const n=e.toLowerCase();return ET.has(n)?!1:c2(t,n)||c2(t,e)}function q0(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!yM(r)||_M(l,i,t,n)||(s[r]=i)}return wM(s,t,n,!!Il(e,"href"))}function Tp(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 t1(e,t="safe",n){const s=q0(Tp(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function Xz(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 Qz(e){const t={};for(const[n,s]of Object.entries(e))t[n]=Xz(s,n);return t}function f2(e){return e.trim().length>0}function Zz(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);f2(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);f2(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||Ql.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function Jz(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||Ql.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function eU(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${Pr(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${Pr(s)}`:` ${Pr(s)}="${kM(o)}"`).join("");return e.type==="self_closing"?`&lt;${Pr(t)}${n} /&gt;`:`&lt;${Pr(t)}${n}&gt;`}function tU(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;a2.lastIndex=0;let n;for(;(n=a2.exec(e))!==null;)if(SM(n[1],t))return!0;return!1}function Ya(e,t="safe"){if(!e)return"";if(t==="escape")return Pr(e);const n=Jz(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(Pr(r.content??""));continue}const l=Sh(r.tagName);if(!l)continue;if(bM(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&U0(l,t)){o.push(eU(r));continue}if(r.type==="self_closing"){o.push(`<${l}${u2(d2(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${u2(d2(r.attrs??{},t,l))}>`),Ql.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 nU=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],p2="http://www.w3.org/2000/svg",sU=new Set(["script","style","iframe","object","embed","link","meta"]),oU=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"]),iU=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),rU=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),lU=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function aU(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function cU(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function uU(e){const t=e.nodeName.toLowerCase();return t==="use"?aU(e):t==="image"?cU(e):t==="text"||t==="tspan"?!!e.textContent?.trim():lU.has(t)}function dU(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 fU(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")?Hl(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?Hl(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":Hl(i,{tagName:s,attrName:o})?"":i:""}function pU(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 CM(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 xM(e){const t=CM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=pU(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function h2(e){const t=CM(e);return nU.some(n=>n.test(t))||xM(t)}function hU(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 lf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function AM(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(!sU.has(s)){if(s==="br"){t.push(`
230
- `);return}for(const o of Array.from(n.childNodes))AM(o,t)}}function mU(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];AM(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=lf(t.getAttribute("width")),i=lf(t.getAttribute("height")),r=lf(t.getAttribute("x")),l=lf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(p2,"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(p2,"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 gU(e){mU(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!oU.has(s)){n.remove();continue}if(s==="style"&&h2(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&&h2(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(iU.has(r)&&i.value){const l=fU(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(rU.has(r)&&i.value&&xM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=dU(i.value);l!==i.value&&n.setAttribute(i.name,l)}}hU(n)}}function Vpe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return gU(n),vU(n)?null:n}catch{return null}}function vU(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){uU(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 m2=[];function xg(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function yU(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function kU(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function g2(e=`editor-${Date.now()}`,t={}){const n=RH(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(m2.length)for(const f of m2)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(eR),n.use(sR),n.use(QP);const i=vR,r=i.default??i;n.use(r),n.use(XP),n.use(YP),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const _ of h.tokens){if(_.type!=="fence"||!_.map||!_.markup)continue;const g=_.map[0],v=_.map[1],y=_.markup,C=y[0],L=y.length,$=b[Math.max(0,v-1)]??"";let k=0;for(;k<$.length&&($[k]===" "||$[k]===" ");)k++;let M=0;for(;k+M<$.length&&$[k+M]===C;)M++;let E=k+M;for(;E<$.length&&($[E]===" "||$[E]===" ");)E++;const O=m?!0:v>g+1&&M>=L&&E===$.length,S=_;S.meta=S.meta??{},S.meta.unclosed=!O,S.meta.closed=!!O}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const b=p.src[m-1],_=p.src[m+1];if(/\d/.test(b)&&/\d/.test(_)){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(),b=String(p.content??""),_=btoa(unescape(encodeURIComponent(b))),g=yU(m),v=xg(g),y=kU(`editor-${e}-${h}-${g}`),C=xg(o("common.copy"));return`<div class="code-block" data-code="${_}" data-lang="${v}" id="${y}">
231
- <div class="code-header">
232
- <span class="code-lang">${xg(g.toUpperCase())}</span>
233
- <button class="copy-button" data-code="${_}">${C}</button>
234
- </div>
235
- <div class="code-editor"></div>
236
- </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 b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const _=p.src.slice(p.pos+m[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))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}const bU="modulepreload",_U=function(e){return"/"+e},v2={},lo=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=_U(c),c in v2)return;v2[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":bU,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)})};function wU({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 TM({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}:wU({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const y2=new WeakMap;function SU(e){let t=y2.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},y2.set(e,t)),t}function k2(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 j0(e){return!!(e.themes?.length||e.langs?.length)}function MM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function CU(e,t){return!t?.length||e.registeredAllLangs?!0:MM(e.registeredLangs,t)}function Ag(e,t){return j0(t)&&MM(e.registeredThemes,t.themes)&&CU(e,t.langs)}function xU(e,t){if(!j0(t))return t;const n=k2(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:k2(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const AU={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 TU(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function EM(e){const t=TU(e);return AU[t]??t}function IM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>EM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function $M(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 MU(e){return $M(e)?.join("\0")??""}function NM(e,t){const n=$M(e),s=IM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Mp(e,t){return`${MU(e)}\0\0${IM(t)?.join("\0")??""}`}function Kpe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=NM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Mp(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Gpe(e,t={},n){if(!e)return"ready";const s=NM(t.themes,t.langs),o=Mp(s.themes,s.langs),i=n&&n===o?n:o,r=SU(e);if(r.completed.has(i))return"ready";if(Ag(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)||Ag(r,s))return r.completed.add(i),"ready";const c=xU(r,s),u=Mp(c.themes,c.langs);return r.completed.has(u)||Ag(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(j0(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 ya(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function b2(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var EU=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=_2();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=_2();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,b=LU(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=NU(this.source.slice(this.visible.length),_,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=ya(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ya(s,1e3,1)),this.normalizedTargetLatencyMs=ya(o,900,1),this.normalizedCatchUpLatencyMs=ya(i,350,1),this.normalizedCatchUpThreshold=b2(r,600),this.normalizedStartDelayMs=b2(a,80),this.maxCommitFps=Math.trunc(ya(l,30,1)),this.maxCharsPerCommit=Math.trunc(ya(c,80,1)),this.flushOnFinish=u,this.segmenter=$U(),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 IU(e={},t){const n=new EU(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 $U(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function NU(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 _2(){return typeof performance<"u"?performance.now():Date.now()}function LU(e,t,n){return Math.min(n,Math.max(t,e))}var OU=(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 n1=Symbol.for("markstream-vue:node-lifecycle"),w2='<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>',S2='<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>',PU={id:"material",core:{"":S2,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:S2,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:w2,csharp:w2,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:()=>lo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},s1=new Map;let C2="material";const Oa=new Map,x2=new Map;let o1=null;function RU(e){s1.set(e.id,e)}function DU(e){return OU(this,null,function*(){var t,n,s;if(Oa.has(e.id))return(t=Oa.get(e.id))!=null?t:null;let o=x2.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Oa.set(e.id,i),o1?.(),i)).catch(()=>(Oa.set(e.id,null),null)),x2.set(e.id,o)),o})}const BU=Yl(0);o1=()=>{BU.value++},RU(PU);const FU={"":"",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 V0(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=FU[n])!=null?t:n}function Ype(e){const t=V0(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Xpe(e){return(function(s){const o=s1.get(C2);if(!o)return;const i=o.core[s];if(i)return i;const r=Oa.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Oa.has(o.id)&&DU(o)})(V0(e))||((n=(t=s1.get(C2))==null?void 0:t.fallback)!=null?n:"");var t,n}const Qpe={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let LM=!1;function Zpe(){return LM}function Jpe(){LM=!0}var Ch=(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 wo=null,Mf=!1,xh=G0;function Ah(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function K0(){try{const e=globalThis;return Ah(e?.katex)}catch{return null}}function G0(){return Ch(null,null,function*(){const e=K0();if(e)return e;const t=yield lo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield lo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Ah(t)})}function HU(e){xh=e,wo=null,Mf=!1}function WU(e){HU(G0)}function OM(){return typeof xh=="function"}function ehe(){var e;const t=xh;if(!t||t===G0)return null;if(wo)return wo;const n=K0();if(n)return wo=n,wo;try{const s=t();return s&&typeof s?.then!="function"?(wo=(e=Ah(s))!=null?e:s,wo):null}catch{return null}}function Y0(){return Ch(this,null,function*(){var e;const t=K0();if(t)return wo=t,wo;if(wo)return wo;if(Mf)return null;const n=xh;if(!n)return Mf=!0,null;try{const s=yield n();if(s)return wo=(e=Ah(s))!=null?e:s,wo}catch{}return Mf=!0,null})}function PM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Br=null,Ir=null;const qo=new Map,Xi=new Map;let Ep=5;const Ol=new Set;function qu(){if(qo.size<Ep&&Ol.size){const e=Array.from(Ol);Ol.clear();for(const t of e)try{t()}catch{}}}function zU(e){Br=e,Ir=null,Br.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=qo.get(n);if(i)if(qo.delete(n),clearTimeout(i.timeoutId),qu(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Xi.set(a,s),Xi.size>200){const c=Xi.keys().next().value;Xi.delete(c)}}i.resolve(s)}},Br.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of qo.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));qo.clear(),qu()}}function UU(){var e;Br&&((e=Br.terminate)==null||e.call(Br)),Br=null,Ir=null}function qU(e,t=!0,n=2e3,s){return Ch(this,null,function*(){performance.now();const o=PM(e);if(!OM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Ir)return Promise.reject(Ir);const i=`${t?"d":"i"}:${o}`,r=Xi.get(i);if(r)return Promise.resolve(r);const l=Br||(Ir=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ir.name="WorkerInitError",Ir.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Ir);if(qo.size>=Ep){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=qo.size,a.max=Ep,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(()=>{qo.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),qu()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),qo.has(u)&&qo.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),qu()},{once:!0});const f=a,h=c;qo.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function the(e,t=!0,n){const s=`${t?"d":"i"}:${PM(e)}`;if(Xi.set(s,n),Xi.size>200){const o=Xi.keys().next().value;Xi.delete(o)}}const jU="WORKER_BUSY";function VU(e=2e3,t){return qo.size<Ep?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Ol.delete(r),n())};if(Ol.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Ol.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>qu()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Ol.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Uc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function nhe(e){return Ch(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!OM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:Uc.timeout,c=(i=s.waitTimeout)!=null?i:Uc.waitTimeout,u=(r=s.backoffMs)!=null?r:Uc.backoffMs,d=(l=s.maxRetries)!=null?l:Uc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Uc.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield qU(t,n,a,h)}catch(m){if(m?.code!==jU||p>=f)throw m;if(p++,yield VU(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function Pa(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function KU(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 i1(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=KU(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 r1(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function RM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function l1(e,t=360,n=500){return RM(e,t,n)}function a1(e,t=360,n=500){return RM(e,t,n)}var GU=Object.defineProperty,YU=Object.defineProperties,XU=Object.getOwnPropertyDescriptors,A2=Object.getOwnPropertySymbols,QU=Object.prototype.hasOwnProperty,ZU=Object.prototype.propertyIsEnumerable,T2=(e,t,n)=>t in e?GU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DM=(e,t)=>{for(var n in t||(t={}))QU.call(t,n)&&T2(e,n,t[n]);if(A2)for(var n of A2(t))ZU.call(t,n)&&T2(e,n,t[n]);return e},X0=(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 Q0=()=>lo(()=>import("./mermaid.core-WmeW05Ym.js").then(e=>e.bn),[]);let Hi=null,Z0=Q0;function JU(e){Z0=e,Hi=null}function eq(e){JU(Q0)}function tq(){return typeof Z0=="function"}function M2(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=DM({},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},YU(n,XU(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function E2(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=DM({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 she(){return X0(this,null,function*(){if(Hi)return Hi;const e=(function(){try{const s=globalThis;return M2(s?.mermaid)}catch{return null}})();if(e)return Hi=e,E2(Hi),Hi;const t=Z0;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===Q0?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(Hi=M2(n),E2(Hi),Hi):null})}let js=null,$r=null;const Ts=new Map;let I2=5,$2=!1;const nq="WORKER_BUSY",sq="MERMAID_DISABLED";function oq(e){js=e,$r=null;const t=e;js.onmessage=n=>{if(js!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Ts.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},js.onerror=n=>{var s,o;if(js===t)if(Ts.size!==0){try{$2?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 Ts.entries())r.reject(new Error(`Worker error: ${n.message}`));Ts.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},js.onmessageerror=n=>{var s,o;if(js===t)if(Ts.size!==0){try{$2?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Ts.entries())r.reject(new Error("Worker messageerror"));Ts.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function iq(){var e;if(js)try{for(const[t,n]of Ts.entries())n.reject(new Error("Worker cleared"));Ts.clear(),(e=js.terminate)==null||e.call(js)}catch{}js=null,$r=null}function BM(e,t,n=1400){if(!tq()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=sq,Promise.reject(o)}if($r)return Promise.reject($r);const s=js||($r=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),$r.name="WorkerInitError",$r.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject($r);if(Ts.size>=I2){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=nq,o.inFlight=Ts.size,o.max=I2,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),Ts.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Ts.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Ts.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=Ts.get(r);f&&f.reject(d)},n)})}function ohe(e,t,n=1400){return X0(this,null,function*(){try{return yield BM("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function ihe(e,t,n=1400){return X0(this,null,function*(){try{return yield BM("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function rhe(){if(js)try{for(const[e,t]of Ts.entries())t.reject(new Error("Worker terminated"));Ts.clear(),js.terminate()}finally{js=null}}var rq=Object.defineProperty,lq=Object.defineProperties,aq=Object.getOwnPropertyDescriptors,N2=Object.getOwnPropertySymbols,cq=Object.prototype.hasOwnProperty,uq=Object.prototype.propertyIsEnumerable,L2=(e,t,n)=>t in e?rq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))cq.call(t,n)&&L2(e,n,t[n]);if(N2)for(var n of N2(t))uq.call(t,n)&&L2(e,n,t[n]);return e},Lt=(e,t)=>lq(e,aq(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 dq="__global__",Tg="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",c1=(()=>{const e=globalThis;if(e[Tg])return e[Tg];const t={scopedCustomComponents:{},revision:Yl(0)};return e[Tg]=t,t})(),O2=c1.revision,fq=Symbol("markstreamCustomComponents"),pq=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 ad(e){return pq.has(String(e).trim().toLowerCase())}function hq(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Mg(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Jo(n),Jo(hq(n))]))!o||ad(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function cs(e){const t=qt(fq,null);return W(()=>{var n;return O2.value,(function(s,o={}){return O2.value,rt(rt(rt({},Mg(c1.scopedCustomComponents[dq]||{})),Mg(o)),Mg((function(i){return i&&c1.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const mq=["aria-label"],gq={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"},vq={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"},dn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Ao=dn(Ve({__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",vq,[...n[1]||(n[1]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),T("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",gq,[...n[0]||(n[0]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,mq))}),[["__scopeId","data-v-be21ab83"]]);Ao.install=e=>{e.component(Ao.__name,Ao)};const yq={class:"emoji-node"},co=dn(Ve({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",yq,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);co.install=e=>{e.component(co.__name,co)};const kq=["id"],bq=["title"],To=dn(Ve({__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},[T("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,bq)],8,kq))}}),[["__scopeId","data-v-c1463a29"]]);To.install=e=>{e.component(To.__name,To)};const FM=(()=>{try{return!1}catch{}return!1})();function Eg(e){FM&&console.warn(e)}function P2(e,t="safe",n){return q0(e,t,n)}function HM(e){return Qz(e)}function Ig(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function J0(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=t1((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Ig(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Ig(r.value)]):Object.entries(o).map(([r,l])=>[r,Ig(l)]):null,t,n);var o;if(!s)return;const i=HM(Tp(s));return Object.keys(i).length>0?i:void 0}function R2(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 qc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function $g(e,t,n,s,o,i,r=!1){const l=(function(d,f){return SM(d,f)})(e,s);if(id.has(e.toLowerCase())||!l&&bM(e,i))return null;if(!l&&U0(e,i))return r?[R2(e,t,!0)]:[R2(e,t),...n,`</${e}>`];const a=q0(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=HM(a);return un(d,Lt(rt({},f),{key:u}),n.length>0?n:void 0)}return un(e,Lt(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function WM(e,t){return tU(e,t)}function Ip(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=$g(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);qc(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=$g(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?qc(c[c.length-1].children,m):qc(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&Eg(`Auto-closing unclosed tag: <${p.tagName}>`)}else Eg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=$g(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?qc(c[c.length-1].children,f):qc(u,f),Eg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(Zz(e),t,n)}catch(o){return s=o,FM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const _q=["innerHTML"],Mo=dn(Ve({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=qt("markstreamHtmlPolicy",void 0),s=W(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=cs(()=>t.customId),i=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=W(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Ya(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Ip(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!WM(l,o.value))return{mode:"html",content:Ya(l,s.value)};const a=Ip(l,o.value,s.value);return a===null?{mode:"html",content:Ya(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),N("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[oe(A(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),N("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(w(),N("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,_q))}}),[["__scopeId","data-v-d17f12b0"]]);Mo.install=e=>{e.component(Mo.__name,Mo)};const wq={class:"inline-code"},Sq={key:0},Ws=dn(Ve({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Ju(),s=qt("markstreamFade",void 0),o=qt("markstreamTextStreamState",void 0),i=qt("markstreamStreamVersion",void 0),r=W(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=W(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=W(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=W(()=>!l.value),u=W(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Z(t.node.code),f=Z("");let h=i?.value;const p=Z(0);function m(){return d.value+f.value}function b(){f.value&&(d.value=m(),f.value="")}Ye([()=>t.node.code,u,l,()=>i?.value],([g,v,y,C])=>{const L=String(g??""),$=u.value,k=C!==h;h=C;const M=TM({nextContent:L,persistedContent:$?o?.get($):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),$&&o?.set($,L)},{immediate:!0}),Ye(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const _=W(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),N("code",wq,[c.value?(w(),N(Oe,{key:0},[je(R(a.value),1)],64)):(w(),N(Oe,{key:1},[d.value?(w(),N("span",Sq,R(d.value),1)):ie("",!0),f.value?(w(),N("span",{key:1,class:De(["inline-code-stream-delta",[_.value]]),onAnimationend:b},R(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);Ws.install=e=>{e.component(Ws.__name,Ws)};const u1=Z(!1),D2=Z(""),B2=Z("top"),mu=Z(null),gu=Z(null),d1=Z(null),f1=Z(null),F2=Z(null);let Ef=null,If=null,p1=0;function zM(){Ef&&(clearTimeout(Ef),Ef=null),If&&(clearTimeout(If),If=null)}let af=!1,cf=null,H2=!1;function Cq(e,t,n="top",s=!1,o,i){if(!e)return;const r=++p1;zM();const l=()=>qn(null,null,function*(){var a,c;if(yield(function(){return qn(this,null,function*(){if(!af&&!H2&&typeof document<"u"){cf!=null||(cf=qn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([lo(()=>import("./vue.runtime.esm-bundler-Cka7aKLe.js"),[]),lo(()=>import("./Tooltip-ChsJyhEI.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:u1.value,"anchor-el":mu.value,content:D2.value,placement:B2.value,id:gu.value,originX:d1.value,originY:f1.value,isDark:(p=F2.value)!=null?p:void 0})}}).mount(h),af=!0}));try{yield cf}catch(u){af=!1,cf=null,H2=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),af&&r===p1){gu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,mu.value=e,D2.value=t,B2.value=n,d1.value=(a=o?.x)!=null?a:null,f1.value=(c=o?.y)!=null?c:null,F2.value=typeof i=="boolean"?i:null,u1.value=!0;try{e.setAttribute("aria-describedby",gu.value)}catch{}}});s?l():Ef=setTimeout(l,80)}function xq(e=!1){p1+=1,zM();const t=()=>{if(mu.value&&gu.value)try{mu.value.removeAttribute("aria-describedby")}catch{}u1.value=!1,mu.value=null,gu.value=null,d1.value=null,f1.value=null};e?t():If=setTimeout(t,120)}const h1={"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..."},m1=e=>{var t;return(t=h1[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 W2(e){return{t(t){if(e.te&&h1[t]&&!e.te(t))return m1(t);const n=e.t(t);return n===t&&h1[t]?m1(t):n}}}function Aq(){const e=(function(){var t,n;try{const s=Ls(),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 W2(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return W2({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:m1}}function Tq(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 Mq=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Eq={key:1,class:"image-placeholder"},Iq={key:1,class:"image-node__raw-text"},$q={key:0,class:"image-shimmer-overlay"},Nq={key:1,class:"image-node__raw-text"},Lq={key:2,class:"image-error"},Ur=dn(Ve({__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=Z(!1),i=Z(!1),r=Z(""),l=Z("primary"),a=Z(null),c=Ju(),u=qt(n1,null);let d="",f=null;const h=W(()=>bw(n.node.src)),p=W(()=>bw(n.fallbackSrc)),m=W(()=>r.value),b=W(()=>!n.lazy),_=W(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=W(()=>l.value==="failed"),v=W(()=>!b.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=W(()=>Tq(n,c));function C(P=y.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function L(P=y.value){P&&gt(()=>{C(P)})}function $(){f&&(clearTimeout(f),f=null)}function k(){const P=y.value;P&&d!==P&&(d&&u?.markSettled(d),$(),d=P,u?.markPending(P),typeof window<"u"&&(f=window.setTimeout(()=>{d===P&&(L(P),M())},8e3)))}function M(){return qn(this,null,function*(){const P=d;P&&($(),d="",yield gt(),C(P),u?.markSettled(P))})}function E(){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 L();l.value="failed",i.value=!0,s("error",r.value),L()}function O(){o.value=!0,i.value=!1,s("load",m.value),L()}function S(P){P.preventDefault(),o.value&&!i.value&&s("click",[P,m.value])}const{t:I}=Aq();return Ye([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}),Ye([_,o,i,m,()=>n.lazy],([P,D,H,z,U])=>P&&z&&!H?D?(M(),void L()):U?(k(),void L()):void(D||H||k()):(M(),void L()),{flush:"post",immediate:!0}),ms(()=>{(function(){const P=d;P&&($(),d="",u?.markSettled(P))})()}),(P,D)=>{var H,z,U,Q,X;return w(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(w(),N("img",{key:0,src:m.value,alt:String((z=(H=n.node.alt)!=null?H:n.node.title)!=null?z:""),title:String((Q=(U=n.node.title)!=null?U:n.node.alt)!=null?Q:""),class:De(["image-node__img",{"is-loading":!b.value&&!o.value,"is-loaded":b.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:A(I)("image.preview"),onError:E,onLoad:O,onClick:S},null,42,Mq)):ie("",!0),e.node.loading&&!i.value?(w(),N("span",Eq,[n.usePlaceholder?xn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Iq,R(e.node.raw),1))])):ie("",!0),oe(Kr,{name:"shimmer-fade"},{default:ke(()=>[v.value&&!e.node.loading?(w(),N("span",$q,[n.usePlaceholder?xn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Nq,R(e.node.raw),1))])):ie("",!0)]),_:3}),g.value?(w(),N("span",Lq,[xn(P.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=T("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[T("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)),T("span",null,R(A(I)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const Oq={key:2},Ii=Ve({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=cs(()=>t.customId),s=qt("markstreamHtmlPolicy",void 0),o=qt("markstreamNestedRendererProps",void 0),i=W(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=W(()=>{var p,m;const b=(p=o?.value)!=null?p:{};return Lt(rt({},b),{customId:(m=t.customId)!=null?m:b.customId,htmlPolicy:i.value})}),l=Mi({loader:()=>Promise.resolve().then(()=>ry),suspensible:!1}),a=W(()=>t.components[String(t.node.type)]),c=W(()=>!!(a.value&&n.value[t.node.type]&&!ad(String(t.node.type)))),u=W(()=>c.value?J0(t.node,i.value):void 0),d=W(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=W(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=W(()=>{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(),ge(Bs(a.value),pn({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ke(()=>[d.value?(w(),ge(A(l),pn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(w(),ge(A(l),pn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ge(Bs(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",Oq,R(h.value),1)):ie("",!0)}}),Pq=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Rq={key:0,translate:"no",class:"markstream-pre__diff-code"},Dq={class:"markstream-pre__diff-number","aria-hidden":"true"},Bq={class:"markstream-pre__diff-content"},Fq={class:"markstream-pre__diff-content-inner"},Hq={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},Wq=["textContent"],_o=Ve({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=W(()=>{var S,I,P;const D=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((P=String(D).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=W(()=>`language-${n.value}`),o=W(()=>{var S,I,P,D,H;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(I=t.node)==null?void 0:I.code)!=null?P:""):(function(z,U){const Q=String(z??"");return U?Q:Q.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((H=t.node)==null?void 0:H.loading)===!0)}),i=W(()=>o.value.split(/\r\n|\n|\r/)),r=W(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=W(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=W(()=>l.value&&t.diffInline===!0),c=W(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",P={}){const D=u(S);return{code:S,kind:D&&I!=="hunk"&&!P.preserveBlankKind?"context":I,empty:D}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const P=f(S),D=f(I),H=(function(me,Ae){const be=me.length,ze=Ae.length;if((be+1)*(ze+1)>15e5)return null;const qe=ze+1,Fe=new Uint32Array((be+1)*(ze+1));for(let te=1;te<=be;te++)for(let ee=1;ee<=ze;ee++){const q=te*qe+ee;if(me[te-1]===Ae[ee-1])Fe[q]=Fe[(te-1)*qe+(ee-1)]+1;else{const Y=Fe[(te-1)*qe+ee],de=Fe[te*qe+(ee-1)];Fe[q]=Y>=de?Y:de}}const Le=[];let le=be,F=ze;for(;le>0&&F>0;)me[le-1]===Ae[F-1]?(Le.push({originalIndex:le-1,modifiedIndex:F-1}),le--,F--):Fe[(le-1)*qe+F]>=Fe[le*qe+(F-1)]?le--:F--;return Le.reverse(),Le})(P,D);if(H){const me=[];let Ae=0,be=0;for(const ze of H){for(;Ae<ze.originalIndex;)me.push(Lt(rt({},d(P[Ae],"removed",{preserveBlankKind:h(P,Ae)})),{key:`inline-removed-source-${Ae}`,number:""})),Ae++;for(;be<ze.modifiedIndex;)me.push(Lt(rt({},d(D[be],"added",{preserveBlankKind:h(D,be)})),{key:`inline-added-source-${be}`,number:be+1})),be++;me.push(Lt(rt({},d(D[ze.modifiedIndex])),{key:`inline-context-source-${ze.originalIndex}-${ze.modifiedIndex}`,number:ze.modifiedIndex+1})),Ae=ze.originalIndex+1,be=ze.modifiedIndex+1}for(;Ae<P.length;)me.push(Lt(rt({},d(P[Ae],"removed",{preserveBlankKind:h(P,Ae)})),{key:`inline-removed-source-${Ae}`,number:""})),Ae++;for(;be<D.length;)me.push(Lt(rt({},d(D[be],"added",{preserveBlankKind:h(D,be)})),{key:`inline-added-source-${be}`,number:be+1})),be++;return me}const z=[];let U=0,Q=P.length-1,X=D.length-1;for(;U<=Q&&U<=X&&P[U]===D[U];)z.push(Lt(rt({},d(D[U])),{key:`inline-prefix-${U}`,number:U+1})),U++;const ue=[];for(;Q>=U&&X>=U&&P[Q]===D[X];)ue.unshift(Lt(rt({},d(D[X])),{key:`inline-suffix-${X}`,number:X+1})),Q--,X--;for(let me=U;me<=Q;me++)z.push(Lt(rt({},d(P[me],"removed",{preserveBlankKind:h(P,me)})),{key:`inline-removed-source-${me}`,number:""}));for(let me=U;me<=X;me++)z.push(Lt(rt({},d(D[me],"added",{preserveBlankKind:h(D,me)})),{key:`inline-added-source-${me}`,number:me+1}));return z.concat(ue)}const _=W(()=>{var S,I,P,D;const H=(function(X){const ue=X.some(Ae=>p(Ae)),me=X.some(Ae=>m(Ae));return ue&&me||(function(){var Ae,be,ze,qe;if(n.value==="diff")return!0;const Fe=(qe=(ze=String((be=(Ae=t.node)==null?void 0:Ae.raw)!=null?be:"").split(/\r?\n/,1)[0])==null?void 0:ze.trim())!=null?qe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Fe)})()&&(ue||me)})(i.value),z=(function(){var X,ue;return((X=t.node)==null?void 0:X.originalCode)!=null||((ue=t.node)==null?void 0:ue.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:H?(function(X){const ue=[];let me=1;for(const[Ae,be]of X.entries())if(be.startsWith("@@"))ue.push(Lt(rt({},d(be,"hunk")),{key:`inline-hunk-${Ae}`,number:""}));else if(p(be))ue.push(Lt(rt({},d(be.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Ae}`,number:""}));else if(m(be))ue.push(Lt(rt({},d(be.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${Ae}`,number:me++}));else{const ze=be.startsWith(" ")?be.slice(1):be;ue.push(Lt(rt({},d(ze)),{key:`inline-context-${Ae}`,number:me})),me++}return ue})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!H&&z){const X=f((P=t.node)==null?void 0:P.originalCode),ue=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:X.map((me,Ae)=>{const be=ue[Ae]===me?"context":"removed";return Lt(rt({},d(me,be,{preserveBlankKind:h(X,Ae)})),{key:`original-${Ae}`,number:Ae+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ue.map((me,Ae)=>{const be=X[Ae]===me?"context":"added";return Lt(rt({},d(me,be,{preserveBlankKind:h(ue,Ae)})),{key:`modified-${Ae}`,number:Ae+1})})}]}const U=[],Q=[];for(const X of i.value)if(X.startsWith("@@"))U.push(d(X,"hunk")),Q.push(d(X,"hunk"));else if(X.startsWith("-")&&!X.startsWith("---"))U.push(d(X.slice(1),"removed",{preserveBlankKind:!0}));else if(X.startsWith("+")&&!X.startsWith("+++"))Q.push(d(X.slice(1),"added",{preserveBlankKind:!0}));else{const ue=X.startsWith(" ")?X.slice(1):X;U.push(d(ue)),Q.push(d(ue))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((X,ue)=>Lt(rt({},X),{key:`original-${ue}`,number:ue+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((X,ue)=>Lt(rt({},X),{key:`modified-${ue}`,number:ue+1}))}]}),g=W(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Z(null),y=Z([]);let C=null,L=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function k(S,I){var P;if(!S)return I;const D=S.querySelector(".markstream-pre__diff-content"),H=D?.getBoundingClientRect(),z=(P=H?.height)!=null?P:0;return Math.max(I,Math.ceil(z))}function M(){typeof window<"u"&&(C!=null&&window.cancelAnimationFrame(C),C=window.requestAnimationFrame(()=>{(function(){var S,I;C=null;const P=v.value;if(!P||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(me){const Ae=window.getComputedStyle(me),be=$(Ae.getPropertyValue("--markstream-pre-diff-line-height"));if(be>0)return be;const ze=$(Ae.lineHeight);return ze>0?ze:18})(P),H=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),U=Math.max(H.length,z.length),Q=[];for(let me=0;me<U;me++){const Ae=k((S=H[me])!=null?S:null,D),be=k((I=z[me])!=null?I:null,D),ze=Math.max(D,Ae,be);Q.push({rowHeight:ze,originalHeight:Ae,modifiedHeight:be})}var X,ue;X=y.value,ue=Q,X.length===ue.length&&X.every((me,Ae)=>{const be=ue[Ae];return be&&Math.abs(me.rowHeight-be.rowHeight)<=.5&&Math.abs(me.originalHeight-be.originalHeight)<=.5&&Math.abs(me.modifiedHeight-be.modifiedHeight)<=.5})||(y.value=Q)})()}))}function E(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{M()}),L.observe(S))}function O(S,I){const P=y.value[S];if(!P)return;const D=I==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Ye(v,S=>{E(S),gt(()=>M())},{flush:"post"}),Ye([l,_],()=>{E(v.value),gt(()=>M())},{flush:"post",immediate:!0}),ms(()=>{C!=null&&(window.cancelAnimationFrame(C),C=null),L?.disconnect(),L=null}),(S,I)=>(w(),N("pre",{ref_key:"preRef",ref:v,style:Yt(c.value),class:De([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),N("code",Rq,[(w(!0),N(Oe,null,ot(_.value,P=>(w(),N("span",{key:P.key,class:De(["markstream-pre__diff-pane",P.className])},[(w(!0),N(Oe,null,ot(P.lines,(D,H)=>(w(),N("span",{key:D.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Yt(O(H,P.key))},[I[0]||(I[0]=T("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),T("span",Dq,R(D.number),1),T("span",Bq,[T("span",Fq,R(D.code),1)])],6))),128))],2))),128))])):(w(),N(Oe,{key:1},[t.showLineNumbers?(w(),N("span",Hq,[(w(!0),N(Oe,null,ot(r.value,P=>(w(),N("span",{key:P,class:"markstream-pre__line-number"},R(P),1))),128))])):ie("",!0),T("code",{translate:"no",class:"markstream-pre__code",textContent:R(o.value)},null,8,Wq)],64))],14,Pq))}});_o.install=e=>{e.component(_o.__name,_o)};const Ng=Yl(!1);let z2=null;const zq={key:0},Qn=dn(Ve({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(z2||(z2=Y0().then(_=>{Ng.value=!!_}).catch(()=>{Ng.value=!1})),Wf(Ng)),s=Ju(),o=qt("markstreamFade",void 0),i=qt("markstreamTextStreamState",void 0),r=qt("markstreamStreamVersion",void 0),l=W(()=>{const _=s.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=W(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=W(()=>{var _;const g=(_=s["index-key"])!=null?_:s.indexKey;return g==null||g===""?"":String(g)}),u=Z(t.node.content),d=Z("");let f=r?.value;const h=Z(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Ye([()=>t.node.content,c,a,()=>r?.value],([_,g,v,y])=>{const C=String(_??""),L=c.value,$=y!==f;f=y;const k=TM({nextContent:C,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),L&&i?.set(L,C)},{immediate:!0}),Ye(a,_=>{var g;_||(g=p(),u.value=g,d.value="")});const b=W(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,g)=>(w(),N("span",{class:De([[A(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),N("span",zq,R(u.value),1)):ie("",!0),d.value?(w(),N("span",{key:1,class:De(["text-node-stream-delta",[b.value]]),onAnimationend:m},R(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const UM=Ve({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return un(_o,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"}))}}}),Lg=Mi({loader:()=>qn(null,null,function*(){try{return(yield lo(()=>import("./CodeBlockNode-BeQAAdW3.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),_o}}),loadingComponent:UM,delay:0,suspensible:!1}),fi=Mi(()=>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 un(Qn,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 Y0())return(yield lo(()=>import("./index6-1drcChs1.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 un(Qn,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:""}$`}}))}})),qM=Mi(()=>qn(null,null,function*(){try{if(yield Y0())return(yield lo(()=>import("./index5-D2oq_xzS.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 un(Qn,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:""}$$`}}))}})),Gs=dn(Ve({__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))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Gs.install=e=>{e.component(Gs.__name,Gs)};const Uq={class:"superscript-node"},uo=dn(Ve({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,html_inline:Mo,strong:Ys,emphasis:Zs,footnote_reference:To,strikethrough:Xs,highlight:Eo,insert:po,subscript:fo,emoji:co,math_inline:fi,reference:Gs},n.value));return(o,i)=>(w(),N("sup",Uq,[(w(!0),N(Oe,null,ot(e.node.children,(r,l)=>(w(),ge(A(Ii),{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"]]);uo.install=e=>{e.component(uo.__name,uo)};const qq={class:"subscript-node"},fo=dn(Ve({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,html_inline:Mo,strong:Ys,emphasis:Zs,footnote_reference:To,strikethrough:Xs,highlight:Eo,insert:po,superscript:uo,emoji:co,math_inline:fi,reference:Gs},n.value));return(o,i)=>(w(),N("sub",qq,[(w(!0),N(Oe,null,ot(e.node.children,(r,l)=>(w(),ge(A(Ii),{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"]]);fo.install=e=>{e.component(fo.__name,fo)};const jq={class:"strong-node"},Ys=dn(Ve({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,html_inline:Mo,emphasis:Zs,strikethrough:Xs,highlight:Eo,insert:po,subscript:fo,superscript:uo,emoji:co,footnote_reference:To,math_inline:fi,reference:Gs},n.value));return(o,i)=>(w(),N("strong",jq,[(w(!0),N(Oe,null,ot(e.node.children,(r,l)=>(w(),ge(A(Ii),{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"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const Vq={class:"strikethrough-node"},Xs=dn(Ve({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,html_inline:Mo,strong:Ys,emphasis:Zs,highlight:Eo,insert:po,subscript:fo,superscript:uo,emoji:co,footnote_reference:To,math_inline:fi,reference:Gs},n.value));return(o,i)=>(w(),N("del",Vq,[(w(!0),N(Oe,null,ot(e.node.children,(r,l)=>(w(),ge(A(Ii),{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"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const Kq=["href","title","aria-label","aria-hidden","target","rel"],Gq=["aria-hidden"],Yq={class:"link-text-wrapper relative inline-flex"},Xq={class:"leading-[normal] link-text"},Qs=dn(Ve({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=qt("markstreamShowTooltips",void 0),s=W(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),o=W(()=>{var _,g,v,y,C;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(_=t.animationOpacity)!=null?_:.35,k=Math.max(.12,Math.min(.5*$,$)),M={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--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):(C=t.animationIteration)!=null?C:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=cs(()=>t.customId),r=W(()=>rt({text:Qn,strong:Ys,strikethrough:Xs,emphasis:Zs,image:Ur,html_inline:Mo,inline_code:Ws},i.value)),l=Ju(),a=W(()=>{var _,g;const v=(_=t.node)==null?void 0:_.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const C of v)Array.isArray(C)&&C[0]&&(y[String(C[0])]=String((g=C[1])!=null?g:""));else for(const[C,L]of Object.entries(v))C&&L!=null&&L!==!1&&(y[C]=L===!0?"":String(L));return P2(y,"safe","a")}),c=W(()=>rt(rt({},l),a.value)),u=W(()=>{var _,g;return P2({href:String((g=(_=t.node)==null?void 0:_.href)!=null?g:"")},"safe","a").href}),d=W(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(BB(u.value)?"_blank":void 0)}),f=W(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),h=W(()=>{if(!u.value)return;const _=c.value.rel,g=new Set((typeof _=="string"?_:String(_??"")).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=W(()=>{const _=rt({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function m(){s.value&&xq()}const b=W(()=>{var _,g;const v=(_=t.node)==null?void 0:_.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(_,g)=>{var v,y;return e.node.loading?(w(),N("span",pn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},A(l),{style:o.value}),[T("span",Yq,[T("span",Xq,[oe(A(Qn),{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]=T("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Gq)):(w(),N("a",pn({key:0,class:"link-node",href:u.value,title:s.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=C=>(function(L){var $,k,M,E;if(!s.value)return;const O=L,S=O?.clientX!=null&&O?.clientY!=null?{x:O.clientX,y:O.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((k=u.value)!=null&&k.includes("xn--")&&((E=(M=t.node)==null?void 0:M.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";Cq(L.currentTarget,I,"top",!1,S)})(C)),onMouseleave:m}),[(w(!0),N(Oe,null,ot(e.node.children,(C,L)=>(w(),ge(A(Ii),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:C,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Kq))}}}),[["__scopeId","data-v-367e6ca4"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const Qq={class:"insert-node"},po=dn(Ve({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,html_inline:Mo,strong:Ys,emphasis:Zs,strikethrough:Xs,highlight:Eo,subscript:fo,superscript:uo,emoji:co,footnote_reference:To,math_inline:fi,reference:Gs},n.value));return(o,i)=>(w(),N("ins",Qq,[(w(!0),N(Oe,null,ot(e.node.children,(r,l)=>(w(),ge(A(Ii),{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"]]);po.install=e=>{e.component(po.__name,po)};const Zq={class:"highlight-node"},Eo=dn(Ve({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,html_inline:Mo,strong:Ys,emphasis:Zs,strikethrough:Xs,insert:po,subscript:fo,superscript:uo,emoji:co,footnote_reference:To,math_inline:fi,reference:Gs},n.value));return(o,i)=>(w(),N("mark",Zq,[(w(!0),N(Oe,null,ot(e.node.children,(r,l)=>(w(),ge(A(Ii),{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"]]);Eo.install=e=>{e.component(Eo.__name,Eo)};const Jq={class:"emphasis-node"},Zs=dn(Ve({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,html_inline:Mo,strong:Ys,strikethrough:Xs,highlight:Eo,insert:po,subscript:fo,superscript:uo,emoji:co,footnote_reference:To,math_inline:fi,reference:Gs},n.value));return(o,i)=>(w(),N("em",Jq,[(w(!0),N(Oe,null,ot(e.node.children,(r,l)=>(w(),ge(A(Ii),{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"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const ej={class:"hard-break"},qr=dn(Ve({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("br",ej))}),[["__scopeId","data-v-50c58f70"]]);qr.install=e=>{e.component(qr.__name,qr)};const ju=Ve({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Rr({checkbox:Ao,checkbox_input:Ao,emoji:co,emphasis:Zs,hardbreak:qr,highlight:Eo,inline_code:Ws,insert:po,link:Qs,reference:Gs,strikethrough:Xs,strong:Ys,subscript:fo,superscript:uo,text:Qn}),s=cs(()=>t.customId),o=W(()=>{const i=s.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(w(!0),N(Oe,null,ot(e.nodes,(l,a)=>(w(),ge(A(Ii),{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 g1(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(g1)}function $p(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(g1))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(g1)?o:null}function rc(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 tj=["cite"],nj={key:0,dir:"auto",class:"paragraph-node"},sj=["custom-id"],$f=dn(Ve({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=cs(()=>t.customId),s=W(()=>!!n.value.paragraph),o=W(()=>!!n.value.text),i=W(()=>$p(t.node.children,!s.value)),r=W(()=>t.fade!==!1||o.value?null:rc(i.value));return On("markstreamShowTooltips",W(()=>t.showTooltips)),On("markstreamFade",W(()=>t.fade)),(l,a)=>(w(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),N("p",nj,[r.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,sj)):(w(),ge(A(ju),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ge(A(ho),{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,tj))}}),[["__scopeId","data-v-abfecebc"]]);$f.install=e=>{e.component($f.__name,$f)};const oj={class:"definition-list"},ij={class:"definition-term"},rj={class:"definition-desc"},Nf=dn(Ve({__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",oj,[(w(!0),N(Oe,null,ot(t.node.items,(o,i)=>(w(),N(Oe,{key:i},[T("dt",ij,[oe(A(ho),{"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"])]),T("dd",rj,[oe(A(ho),{"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"]]);Nf.install=e=>{e.component(Nf.__name,Nf)};const lj=["href","title"],vu=dn(Ve({__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,lj))}}),[["__scopeId","data-v-e1eb37b6"]]);vu.install=e=>{e.component(vu.__name,vu)};const aj=["id"],cj={class:"flex-1"},Lf=Ve({__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"},[T("div",cj,[oe(A(ho),{"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,aj))}});Lf.install=e=>{e.component(Lf.__name,Lf)};const uj=["custom-id"],v1=dn(Ve({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=qt("markstreamFade",void 0),o=W(()=>s?.value!==!1||n.value.text?null:rc(t.node.children)),i=W(()=>rt({text:Qn,inline_code:Ws,link:Qs,image:Ur,strong:Ys,emphasis:Zs,strikethrough:Xs,highlight:Eo,insert:po,subscript:fo,superscript:uo,emoji:co,checkbox:Ao,checkbox_input:Ao,footnote_reference:To,hardbreak:qr,math_inline:fi,reference:Gs},n.value));return(r,l)=>(w(),ge(Bs(`h${e.node.level}`),pn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ke(()=>[o.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(o.value),9,uj)):(w(!0),N(Oe,{key:1},ot(e.node.children,(a,c)=>(w(),ge(A(Ii),{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"]]),Np=v1;Np.install=e=>{e.component(v1.__name,v1)};const dj={key:0,dir:"auto",class:"paragraph-node"},fj=["custom-id"],pj={dir:"auto",class:"paragraph-node"},hj=["custom-id"],Xa=dn(Ve({__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=W(()=>{var h;return(h=t.node)!=null?h:t.item}),s=cs(()=>t.customId),o=W(()=>!!s.value.paragraph),i=W(()=>!!s.value.text),r=W(()=>{var h;return $p((h=n.value)==null?void 0:h.children,!o.value)}),l=W(()=>{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 b=p.slice(1);if(!b.every(g=>g?.type==="list"))return null;const _=$p([m]);return _?{paragraphChildren:_,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=W(()=>a()?rc(r.value):null),u=W(()=>{var h;return a()?rc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=W(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return On("markstreamShowTooltips",W(()=>t.showTooltips)),On("markstreamFade",W(()=>t.fade)),(h,p)=>{var m,b;return w(),N("li",pn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),N("p",dj,[c.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,fj)):(w(),ge(A(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},[T("p",pj,[u.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,hj)):(w(),ge(A(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,ot(l.value.nestedLists,(_,g)=>(w(),ge(A(ho),{key:g,nodes:[_],"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(),ge(A(ho),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(m=n.value)==null?void 0:m.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=_=>h.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Xa.install=e=>{e.component(Xa.__name,Xa)};const Qa=dn(Ve({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=cs(()=>e.customId),n=W(()=>t.value.list_item||Xa);return(s,o)=>(w(),ge(Bs(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ke(()=>[(w(!0),N(Oe,null,ot(e.node.items,(i,r)=>{var l;return w(),ge(Bs(n.value),pn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Qa.install=e=>{e.component(Qa.__name,Qa)};const jM=Symbol("ViewportPriority");function mj(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(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 b(){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&&b())},{timeout:1200}))}Ye(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const _=(g,v)=>{const y=Z(!1);let C,L=!1;const $=new Promise(E=>{C=()=>{L||(L=!0,E())}}),k=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!o||!i.value)return y.value=!0,C(),{isVisible:y,whenVisible:$,destroy:k};const M=(function(E,O){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,H){var z,U,Q;return{root:(z=e?.(D??null))!=null?z:null,rootMargin:(U=H?.rootMargin)!=null?U:"300px",threshold:(Q=H?.threshold)!=null?Q:0}})(E,O);if(a&&(P=S,(I=c)&&I.root===P.root&&I.rootMargin===P.rootMargin&&I.threshold===P.threshold))return a;var I,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const H of D)(H.isIntersecting||H.intersectionRatio>0)&&m(H.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(g,v);return M?(u.set(g,{resolve:C,visible:y}),M.observe(g),d.add(g),b(),{isVisible:y,whenVisible:$,destroy:k}):(y.value=!0,C(),{isVisible:y,whenVisible:$,destroy:k})};return On(jM,_),_}function gj(){var e,t;const n=qt(jM,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=Z(!1);let p,m=!1;const b=new Promise(v=>{p=()=>{m||(m=!0,v())}}),_=()=>{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:b,destroy:_}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:_})}}const vj={key:2,class:"html-block-node__raw"},yj=["innerHTML"],kj={key:1,class:"html-block-node__placeholder"},yu=dn(Ve({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=qt("markstreamHtmlPolicy",void 0),s=qt("markstreamNestedRendererProps",void 0),o=W(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=W(()=>{var L,$;const k=(L=s?.value)!=null?L:{};return Lt(rt({},k),{customId:($=t.customId)!=null?$:k.customId,htmlPolicy:o.value})}),r=Mi({loader:()=>Promise.resolve().then(()=>ry),suspensible:!1}),l=W(()=>{const L=t1(t.node.attrs,o.value);if(!L)return;const $=Tp(L);return Object.keys($).length>0?$:void 0}),a=W(()=>{const L=String(t.node.tag||"").trim(),$=t1(t.node.attrs,o.value,L);if(!$)return;const k=Tp($);return Object.keys(k).length>0?k:void 0}),c=cs(()=>t.customId),u=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),f=Z(typeof window>"u"),h=Z(t.node.content),p=W(()=>Array.isArray(t.node.children)?t.node.children:[]),m=W(()=>String(t.node.tag||"div")),b=W(()=>{const L=m.value.trim().toLowerCase();return IT.has(L)||U0(L,o.value)}),_=W(()=>p.value.length>0&&!!t.node.tag&&!b.value),g=W(()=>{var L,$,k;if(_.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=h.value)!=null?L:""};const M=($=h.value)!=null?$:t.node.content;if(!M)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Ya(M,o.value)};if(t.node.loading){const O=Ip(M,c.value,o.value);return O===null?{mode:"text",content:(k=t.node.raw)!=null?k:M}:{mode:"dynamic",nodes:O}}if(!WM(M,c.value))return{mode:"html",content:Ya(M,o.value)};const E=Ip(M,c.value,o.value);return E===null?{mode:"html",content:Ya(M,o.value)}:{mode:"dynamic",nodes:E}}),v=gj(),y=Z(null),C=!!t.node.loading;return typeof window<"u"?(Ye(d,L=>{var $,k;if((k=($=y.value)==null?void 0:$.destroy)==null||k.call($),y.value=null,!C)return f.value=!0,void(h.value=t.node.content);if(!L)return void(f.value=!1);const M=v(L,{rootMargin:"400px"});y.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ye(()=>t.node.content,L=>{C&&!f.value||(h.value=L)})):f.value=!0,ms(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(w(),ge(Bs(_.value?m.value:"div"),pn({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:ke(()=>[f.value?(w(),N(Oe,{key:0},[g.value.mode==="structured"?(w(),ge(A(r),pn({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(),ge(A(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),N("pre",vj,R(g.value.content),1)):(w(),N("div",pn({key:3},l.value,{innerHTML:g.value.content}),null,16,yj))],64)):(w(),N("div",kj,[xn(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=T("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=T("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=T("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);yu.install=e=>{e.component(yu.__name,yu)};const bj={dir:"auto",class:"paragraph-node"},_j=["custom-id"],zl=dn(Ve({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=cs(()=>t.customId),s=qt("markstreamHtmlPolicy",void 0),o=qt("markstreamFade",void 0),i=qt("markstreamParseOptions",void 0),r=qt("markstreamCustomMarkdownIt",void 0),l=qt("markstreamNestedRendererProps",void 0),a=W(()=>{var k;return(k=s?.value)!=null?k:"safe"}),c=W(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=W(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=W(()=>{var k,M;return(M=t.customHtmlTags)!=null?M:(k=l?.value)==null?void 0:k.customHtmlTags}),f=W(()=>{var k,M;const E=(k=l?.value)!=null?k:{};return Lt(rt({},E),{customId:(M=t.customId)!=null?M:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Mi({loader:()=>Promise.resolve().then(()=>ry),suspensible:!1});function p(k){var M;return k.type==="text"&&String((M=k.content)!=null?M:"").trim()===""}const m=W(()=>t.node.children.filter(k=>!p(k))),b=W(()=>m.value.length>0&&m.value.every(k=>k.type==="image"||(function(M){var E;const O=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!p(I)):[]})(M);return O.length===1&&((E=O[0])==null?void 0:E.type)==="image"})(k))),_=W(()=>new Set(pc(d.value))),g=W(()=>{if(!b.value||m.value.length<=1)return t.node.children;const k=[];for(let M=0;M<t.node.children.length;M++){const E=t.node.children[M];if(!p(E)){k.push(E);continue}const O=k.length>0,S=t.node.children.slice(M+1).some(I=>!p(I));O&&S&&k.push(Lt(rt({},E),{content:" ",raw:" "}))}return k}),v=W(()=>o?.value===!1&&!n.value.text),y=W(()=>v.value?rc(g.value):null);function C(k,M){return{node:k,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=W(()=>rt({inline_code:Ws,image:Ur,link:Qs,hardbreak:qr,emphasis:Zs,strong:Ys,strikethrough:Xs,highlight:Eo,insert:po,subscript:fo,superscript:uo,html_inline:Mo,html_block:yu,emoji:co,checkbox:Ao,math_inline:fi,checkbox_input:Ao,reference:Gs,footnote_anchor:vu,footnote_reference:To,text:Qn},n.value)),$=W(()=>g.value.map((k,M)=>{var E;const O=(function(S){var I,P,D,H;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||OT(S.content);if(z&&!_.value.has(z)&&PT((P=S.content)!=null?P:S.raw,z)){const U=String((H=(D=S.content)!=null?D:S.raw)!=null?H:"");return{child:{type:"text",content:U,raw:U},component:Qn,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!ad(String(S.type)))}})(k);return Lt(rt({},O),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:O.isCustomComponent?J0(O.child,a.value):void 0,hasSlotChildren:Array.isArray(O.child.children)&&O.child.children.length>0,slotContent:String((E=O.child.content)!=null?E:""),originalChild:k})}));return(k,M)=>(w(),N("p",bj,[y.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(y.value),9,_j)):(w(!0),N(Oe,{key:1},ot($.value,E=>{return w(),N(Oe,{key:E.key},[b.value&&p(E.originalChild)?(w(),N(Oe,{key:0},[je(R((O=E.originalChild,String((S=O.content)!=null?S:""))),1)],64)):E.isCustomComponent?(w(),ge(Bs(E.component),pn({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ke(()=>[E.hasSlotChildren?(w(),ge(A(h),pn({key:0,ref_for:!0},f.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(w(),ge(A(h),pn({key:1,ref_for:!0},f.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),ge(Bs(E.component),pn({key:2,ref_for:!0},C(E.child,E.index)),null,16))],64);var O,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);zl.install=e=>{e.component(zl.__name,zl)};const wj={class:"table-node-wrapper"},Sj=["aria-busy"],Cj={key:0},xj=["custom-id"],Aj=["aria-label","onPointerdown"],Tj=["custom-id"],Mj={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ku=dn(Ve({__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=W(()=>{var _;return(_=t.node.loading)!=null&&_}),s=W(()=>{var _;return(_=t.node.rows)!=null?_:[]}),o=Z(null),i=Z([]);let r=null;const l=W(()=>t.node.header.cells.length),a=W(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=W(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);On("markstreamShowTooltips",W(()=>t.showTooltips)),On("markstreamFade",W(()=>t.fade));const u=cs(()=>t.customId),d=W(()=>!!u.value.text),f=W(()=>!!u.value.paragraph),h=new WeakMap;function p(_){const g=t.fade===!1&&!d.value,v=!f.value,y=h.get(_);if(y?.children===_.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const C=$p(_.children,v,!0),L={simpleChildren:C,plainText:C&&g?rc(C):null};return h.set(_,{children:_.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(_){if(!r)return;_.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+_.clientX-r.startX))),C=[...r.widths];C[r.index]=y,C[r.index+1]=g-y,i.value=C}function b(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Ye(l,()=>{b(),i.value=[]}),ms(b),(_,g)=>(w(),N("div",wj,[T("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),N("colgroup",Cj,[(w(!0),N(Oe,null,ot(e.node.header.cells,(v,y)=>(w(),N("col",{key:y,style:Yt(c.value[y])},null,4))),128))])):ie("",!0),T("thead",null,[T("tr",null,[(w(!0),N(Oe,null,ot(e.node.header.cells,(v,y)=>(w(),N("th",{key:y,dir:"auto",class:De([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},R(p(v).plainText),9,xj)):p(v).simpleChildren?(w(),ge(A(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(),ge(A(ho),{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]=C=>_.$emit("copy",C))},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:C=>(function(L,$){if($.button!==0)return;const k=(function(){var O;const S=(O=o.value)==null?void 0:O.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),M=k[L],E=k[L+1];M&&E&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:M,nextStartWidth:E,widths:k},i.value=k,window.addEventListener("pointermove",m),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(y,C)},null,40,Aj)):ie("",!0)],2))),128))])]),T("tbody",null,[(w(!0),N(Oe,null,ot(s.value,(v,y)=>(w(),N("tr",{key:y},[(w(!0),N(Oe,null,ot(v.cells,(C,L)=>(w(),N("td",{key:L,class:De([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(C).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(p(C).plainText),9,Tj)):p(C).simpleChildren?(w(),ge(A(ju),{key:1,nodes:p(C).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(w(),ge(A(ho),{key:2,nodes:C.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]=$=>_.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Sj),oe(Kr,{name:"table-node-fade"},{default:ke(()=>[n.value?(w(),N("div",Mj,[xn(_.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=T("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=T("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);ku.install=e=>{e.component(ku.__name,ku)};const Ej={class:"hr-node"},Of=dn({},[["render",function(e,t){return w(),N("hr",Ej)}],["__scopeId","data-v-39b2349c"]]);Of.install=e=>{e.component(Of.__name,Of)};const Ij={class:"unknown-node"},y1=Ve({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),N("div",Ij,R(e.node.raw),1))}),Pf=dn(Ve({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=W(()=>`vmr-container vmr-container-${t.node.name}`),s=cs(()=>t.customId),o=W(()=>rt({text:Qn,paragraph:zl,heading:Np,inline_code:Ws,link:Qs,image:Ur,strong:Ys,emphasis:Zs,strikethrough:Xs,insert:po,subscript:fo,superscript:uo,checkbox:Ao,checkbox_input:Ao,hardbreak:qr,math_inline:fi,reference:Gs,list:Qa,math_block:qM,table:ku},s.value));return(i,r)=>(w(),N("div",pn({class:n.value},e.node.attrs),[(w(!0),N(Oe,null,ot(e.node.children,(l,a)=>{return w(),ge(Bs((c=l.type,o.value[c]||y1)),{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"]]);Pf.install=e=>{e.component(Pf.__name,Pf)};const $j=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],U2=[[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 Nj(e){if(e<=255)return $j[e];let t=0,n=U2.length-1;for(;t<=n;){const s=t+n>>1,o=U2[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const Lj=/[ \t\n\r\f]+/g,Oj=/[\t\n\r\f]| {2,}|^ | $/;let Og=null;const Pj=new RegExp("\\p{Script=Arabic}","u"),Th=new RegExp("\\p{M}","u"),VM=new RegExp("\\p{Nd}","u");function q2(e){return Pj.test(e)}function j2(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 Zi(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(j2(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(j2(n))return!0}}return!1}const Rj=new Set([" "," ","⁠","\uFEFF"]);function Dj(e){return Zi(e)}function k1(e){return!(function(t){const n=Lp(t);return n!==null&&(ey.has(n)||jl.has(n))})(e)&&!(function(t){const n=Lp(t);return n!==null&&Rj.has(n)})(e)}const ey=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Mh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),ty=new Set(["'","’"]),jl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Bj=new Set([":",".","،","؛"]),Fj=new Set(["၏"]),Hj=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Wj(e){if(ny(e))return!0;let t=!1;for(const n of e)if(jl.has(n))t=!0;else if(!t||!Th.test(n))return!1;return t}function zj(e){for(const t of e)if(!ey.has(t)&&!jl.has(t))return!1;return e.length>0}function Uj(e){if(ny(e))return!0;for(const t of e)if(!Mh.has(t)&&!ty.has(t)&&!Th.test(t))return!1;return e.length>0}function ny(e){let t=!1;for(const n of e)if(n!=="\\"&&!Th.test(n)){if(!(Mh.has(n)||jl.has(n)||ty.has(n)))return!1;t=!0}return t}function KM(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const 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 Lp(e){if(e.length===0)return null;const t=KM(e,e.length);return e.slice(t)}function qj(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Th.test(s))n--;else{if(!Mh.has(s)&&!ty.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function jj(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function V2(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 K2(e,t){return e&&t!==null&&Bj.has(t)}function Vj(e){const t=Lp(e);return t!==null&&Fj.has(t)}function Kj(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 b1(e){let t=e.length;for(;t>0;){const n=KM(e,t),s=e.slice(n,t);if(Hj.has(s))return!0;if(!jl.has(s))return!1;t=n}return!1}function Gj(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
237
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Yj=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Wo(e){return e.length===1?e[0]:e.join("")}function Xj(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Wo(n)}function Qj(e,t,n,s){if(!Yj.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=Gj(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:Wo(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:Wo(r),isWordLike:a,kind:i,start:l}),o}function Pg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Zj=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Jj(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Zj.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function eV(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const tV=new Set([":","-","/","×",",",".","+","–","—"]),G2=/^[A-Za-z0-9_]+[,:;]*$/,Y2=/[,:;]+$/;function X2(e){for(const t of e)if(VM.test(t))return!0;return!1}function Rf(e){if(e.length===0)return!1;for(const t of e)if(!VM.test(t)&&!tV.has(t))return!1;return!0}function Q2(e,t,n){var s,o,i;const r=(Og===null&&(Og=new Intl.Segmenter(void 0,{granularity:"word"})),Og);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 Qj(k.segment,(s=k.isWordLike)!=null&&s,k.index,n)){let E=function(){h[U]!==null&&(c[U]=[V2(a,h,p,U)],h[U]=null),c[U].push(M.text),u[U]=u[U]||M.isWordLike,m[U]=m[U]||I,b[U]=b[U]||P,_[U]=H,g[U]=z,v[U]=K2(b[U],D)};const O=M.kind==="text",S=jj(M.text,M.isWordLike,M.kind),I=Zi(M.text),P=q2(M.text),D=Lp(M.text),H=b1(M.text),z=Vj(M.text),U=l-1;t.carryCJKAfterClosingQuote&&O&&l>0&&d[U]==="text"&&I&&m[U]&&_[U]||O&&l>0&&d[U]==="text"&&zj(M.text)&&m[U]||O&&l>0&&d[U]==="text"&&g[U]?E():O&&l>0&&d[U]==="text"&&M.isWordLike&&P&&v[U]?(E(),u[U]=!0):S!==null&&l>0&&d[U]==="text"&&h[U]===S?p[U]=((o=p[U])!=null?o:1)+1:O&&!M.isWordLike&&l>0&&d[U]==="text"&&(Wj(M.text)||M.text==="-"&&u[U])?E():(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]=I,b[l]=P,_[l]=H,g[l]=z,v[l]=K2(P,D),l++)}for(let k=0;k<l;k++)h[k]===null?a[k]=Wo(c[k]):a[k]=V2(a,h,p,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&ny(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 C=-1;for(let k=l-1;k>=0;k--){const M=a[k];if(M.length!==0){if(d[k]==="text"&&!u[k]&&Uj(M)&&C>=0&&d[C]==="text"){const E=(i=y[C])!=null?i:[];E.push(M),y[C]=E,f[C]=f[k],a[k]="";continue}C=k}}for(let k=0;k<l;k++){const M=y[k];M!=null&&(a[k]=Xj(M,a[k]))}let L=0;for(let k=0;k<l;k++){const M=a[k];M.length!==0&&(L!==k&&(a[L]=M,u[L]=u[k],d[L]=d[k],f[L]=f[k]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(k){const M=k.texts.slice(),E=k.isWordLike.slice(),O=k.kinds.slice(),S=k.starts.slice();for(let I=0;I<M.length-1;I++){if(O[I]!=="text"||O[I+1]!=="text"||!Zi(M[I])||!Zi(M[I+1]))continue;const P=qj(M[I]);P!==null&&(M[I]=P.head,M[I+1]=P.tail+M[I+1],S[I+1]=S[I]+P.head.length)}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I],H=k.isWordLike[I];if(D==="text"&&H&&G2.test(P)){const z=[P];let U=Y2.test(P),Q=I+1;for(;U&&Q<k.len&&k.kinds[Q]==="text"&&k.isWordLike[Q]&&G2.test(k.texts[Q]);){const X=k.texts[Q];z.push(X),U=Y2.test(X),Q++}M.push(Wo(z)),E.push(!0),O.push("text"),S.push(k.starts[I]),I=Q-1;continue}M.push(P),E.push(H),O.push(D),S.push(k.starts[I])}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(k.kinds[I]==="text"&&P.includes("-")){const D=P.split("-");let H=D.length>1;for(let z=0;z<D.length;z++){const U=D[z];if(!H)break;U.length!==0&&X2(U)&&Rf(U)||(H=!1)}if(H){let z=0;for(let U=0;U<D.length;U++){const Q=D[U],X=U<D.length-1?`${Q}-`:Q;M.push(X),E.push(!0),O.push("text"),S.push(k.starts[I]+z),z+=X.length}continue}}M.push(P),E.push(k.isWordLike[I]),O.push(k.kinds[I]),S.push(k.starts[I])}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I];if(D==="text"&&Rf(P)&&X2(P)){const H=[P];let z=I+1;for(;z<k.len&&k.kinds[z]==="text"&&Rf(k.texts[z]);)H.push(k.texts[z]),z++;M.push(Wo(H)),E.push(!0),O.push("text"),S.push(k.starts[I]),I=z-1;continue}M.push(P),E.push(k.isWordLike[I]),O.push(D),S.push(k.starts[I])}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(M.push(P),E.push(k.isWordLike[I]),O.push(k.kinds[I]),S.push(k.starts[I]),!eV(P))continue;const D=I+1;if(D>=k.len||Pg(k.kinds[D]))continue;const H=[],z=k.starts[D];let U=D;for(;U<k.len&&!Pg(k.kinds[U]);)H.push(k.texts[U]),U++;H.length>0&&(M.push(Wo(H)),E.push(!0),O.push("text"),S.push(z),I=U-1)}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=k.texts.slice(),E=k.isWordLike.slice(),O=k.kinds.slice(),S=k.starts.slice();for(let P=0;P<k.len;P++){if(O[P]!=="text"||!Jj(k,P))continue;const D=[M[P]];let H=P+1;for(;H<k.len&&!Pg(O[H]);){D.push(M[H]),E[P]=!0;const z=M[H].includes("?");if(O[H]="text",M[H]="",H++,z)break}M[P]=Wo(D)}let I=0;for(let P=0;P<M.length;P++){const D=M[P];D.length!==0&&(I!==P&&(M[I]=D,E[I]=E[P],O[I]=O[P],S[I]=S[P]),I++)}return M.length=I,E.length=I,O.length=I,S.length=I,{len:I,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];let I=0;for(;I<k.len;){const P=[k.texts[I]];let D=k.isWordLike[I],H=k.kinds[I],z=k.starts[I];if(H==="glue"){const U=[P[0]],Q=z;for(I++;I<k.len&&k.kinds[I]==="glue";)U.push(k.texts[I]),I++;const X=Wo(U);if(!(I<k.len&&k.kinds[I]==="text")){M.push(X),E.push(!1),O.push("glue"),S.push(Q);continue}P[0]=X,P.push(k.texts[I]),D=k.isWordLike[I],H="text",z=Q,I++}else I++;if(H==="text")for(;I<k.len&&k.kinds[I]==="glue";){const U=[];for(;I<k.len&&k.kinds[I]==="glue";)U.push(k.texts[I]),I++;const Q=Wo(U);I<k.len&&k.kinds[I]==="text"?(P.push(Q,k.texts[I]),D=D||k.isWordLike[I],I++):P.push(Q)}M.push(Wo(P)),E.push(D),O.push(H),S.push(z)}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let k=0;k<$.len-1;k++){const M=Kj($.texts[k]);M!==null&&($.kinds[k]!=="space"&&$.kinds[k]!=="preserved-space"||$.kinds[k+1]!=="text"||!q2($.texts[k+1])||($.texts[k]=M.space,$.isWordLike[k]=!1,$.kinds[k]=$.kinds[k]==="preserved-space"?"preserved-space":"space",$.texts[k+1]=M.marks+$.texts[k+1],$.starts[k+1]=$.starts[k]+M.space.length))}return $}function nV(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 ka=null;const Z2=new Map;let ba=null;const sV=new RegExp("\\p{Emoji_Presentation}","u"),oV=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Rg=null;const J2=new Map;function _1(){if(ka!==null)return ka;if(typeof OffscreenCanvas<"u")return ka=new OffscreenCanvas(1,1).getContext("2d"),ka;if(typeof document<"u")return ka=document.createElement("canvas").getContext("2d"),ka;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Sr(e,t){let n=t.get(e);return n===void 0&&(n={width:_1().measureText(e).width,containsCJK:Zi(e)},t.set(e,n)),n}function Eh(){if(ba!==null)return ba;if(typeof navigator>"u")return ba={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ba;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 ba={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ba}function GM(){return Rg===null&&(Rg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Rg}function iV(e){return sV.test(e)||e.includes("️")}function xl(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=GM();for(const a of l.segment(i))iV(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function rV(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 lV(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function eS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Eh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(y=u,C=d,L=a){l++,a=0,c=!1,f=-1,h=0}function m(y,C){c=!0,u=y+1,d=0,a=C}function b(y,C,L){c=!0,u=y,d=C+1,a=L}function _(y,C){c?(a+=C,u=y+1,d=0):m(y,C)}function g(y,C){const L=i[y];for(let $=C;$<L.length;$++){const k=L[$];c?a+k>r?(p(),b(y,$,k)):(a+=k,u=y,d=$+1):b(y,$,k)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=rV(e,v),!(v>=s.length)));){const y=s[v],C=o[v],L=C==="space"||C==="preserved-space"||C==="tab"||C==="zero-width-break"||C==="soft-hyphen";if(c)if(a+y>r){if(L){_(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 _(v,y),L&&(f=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),L&&(f=v+1,h=a-y),v++}return c&&p(),l}let Dg=null;function aV(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=b1(d),l=Mh.has(d)}function u(d,f){s.push(d),i=i||f;const h=b1(d);r=d.length===1&&jl.has(d)&&r||h,l=!1}for(const d of(Dg===null&&(Dg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Dg).segment(e)){const f=d.segment,h=Zi(f);s.length!==0?l||ey.has(f)||jl.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 cV(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Zi(e[0].text),i=k1(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=Zi(a.text),u=k1(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 uV(e,t,n,s){const o=Eh(),{cache:i,emojiCorrection:r}=(function($,k){_1().font=$;const M=(function(S){let I=Z2.get(S);return I||(I=new Map,Z2.set(S,I)),I})($),E=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),O=k?(function(S,I){let P=J2.get(S);if(P!==void 0)return P;const D=_1();D.font=S;const H=D.measureText("😀").width;if(P=0,H>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const U=z.getBoundingClientRect().width;document.body.removeChild(z),H-U>.5&&(P=H-U)}return J2.set(S,P),P})($,E):0;return{cache:M,fontSize:E,emojiCorrection:O}})(t,(l=e.normalized,oV.test(l)));var l;const a=xl("-",Sr("-",i),r),c=8*xl(" ",Sr(" ",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($,k,M,E,O,S,I){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(p=!1),u.push(k),d.push(M),f.push(E),h.push(O),b.push(I),_!==null&&_.push($)}function y($,k,M,E,O){const S=Sr($,i),I=xl($,S,r),P=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:I,D=k==="space"||k==="zero-width-break"?0:I;if(O&&E&&$.length>1){let H="sum-graphemes";Rf($)?H="pair-context":o.preferPrefixWidthsForBreakableRuns&&(H="segment-prefixes");const z=(function(U,Q,X,ue,me){if(Q.breakableFitAdvances!==void 0)return Q.breakableFitAdvances;const Ae=GM(),be=[];for(const Le of Ae.segment(U))be.push(Le.segment);if(be.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(me==="sum-graphemes"){const Le=[];for(const le of be){const F=Sr(le,X);Le.push(xl(le,F,ue))}return Q.breakableFitAdvances=Le,Q.breakableFitAdvances}if(me==="pair-context"||be.length>96){const Le=[];let le=null,F=0;for(const te of be){const ee=xl(te,Sr(te,X),ue);if(le===null)Le.push(ee);else{const q=le+te,Y=Sr(q,X);Le.push(xl(q,Y,ue)-F)}le=te,F=ee}return Q.breakableFitAdvances=Le,Q.breakableFitAdvances}const ze=[];let qe="",Fe=0;for(const Le of be){qe+=Le;const le=xl(qe,Sr(qe,X),ue);ze.push(le-Fe),Fe=le}return Q.breakableFitAdvances=ze,Q.breakableFitAdvances})($,S,i,r,H);return void v($,I,P,D,k,M,z)}v($,I,P,D,k,M,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const k=e.texts[$],M=e.isWordLike[$],E=e.kinds[$],O=e.starts[$];if(E==="soft-hyphen"){v(k,0,a,a,E,O,null);continue}if(E==="hard-break"){v(k,0,0,0,E,O,null);continue}if(E==="tab"){v(k,0,0,0,E,O,null);continue}const S=Sr(k,i);if(E==="text"&&S.containsCJK){const I=aV(k,o),P=s==="keep-all"?cV(I):I;for(let D=0;D<P.length;D++){const H=P[D];y(H.text,"text",O+H.start,M,s==="keep-all"||!Zi(H.text))}continue}y(k,E,O,M,!0)}const C=(function($,k,M){const E=[];for(let O=0;O<$.length;O++){const S=$[O],I=S.startSegmentIndex<k.length?k[S.startSegmentIndex]:M,P=S.endSegmentIndex<k.length?k[S.endSegmentIndex]:M,D=S.consumedEndSegmentIndex<k.length?k[S.consumedEndSegmentIndex]:M;E.push({startSegmentIndex:I,endSegmentIndex:P,consumedEndSegmentIndex:D})}return E})(e.chunks,g,u.length),L=m===null?null:(function($,k){const M=(function(O){const S=O.length;if(S===0)return null;const I=new Array(S);let P=!1;for(let X=0;X<S;){const ue=O.charCodeAt(X);let me=ue,Ae=1;if(ue>=55296&&ue<=56319&&X+1<S){const ze=O.charCodeAt(X+1);ze>=56320&&ze<=57343&&(me=ze-56320+(ue-55296<<10)+65536,Ae=2)}const be=Nj(me);be!=="R"&&be!=="AL"&&be!=="AN"||(P=!0);for(let ze=0;ze<Ae;ze++)I[X+ze]=be;X+=Ae}if(!P)return null;let D=0;for(let X=0;X<S;X++){const ue=I[X];if(ue==="L"){D=0;break}if(ue==="R"||ue==="AL"){D=1;break}}const H=new Int8Array(S);for(let X=0;X<S;X++)H[X]=D;const z=1&D?"R":"L",U=z;let Q=U;for(let X=0;X<S;X++)I[X]==="NSM"?I[X]=Q:Q=I[X];Q=U;for(let X=0;X<S;X++){const ue=I[X];ue==="EN"?I[X]=Q==="AL"?"AN":"EN":ue!=="R"&&ue!=="L"&&ue!=="AL"||(Q=ue)}for(let X=0;X<S;X++)I[X]==="AL"&&(I[X]="R");for(let X=1;X<S-1;X++)I[X]==="ES"&&I[X-1]==="EN"&&I[X+1]==="EN"&&(I[X]="EN"),I[X]!=="CS"||I[X-1]!=="EN"&&I[X-1]!=="AN"||I[X+1]!==I[X-1]||(I[X]=I[X-1]);for(let X=0;X<S;X++){if(I[X]!=="EN")continue;let ue;for(ue=X-1;ue>=0&&I[ue]==="ET";ue--)I[ue]="EN";for(ue=X+1;ue<S&&I[ue]==="ET";ue++)I[ue]="EN"}for(let X=0;X<S;X++){const ue=I[X];ue!=="WS"&&ue!=="ES"&&ue!=="ET"&&ue!=="CS"||(I[X]="ON")}Q=U;for(let X=0;X<S;X++){const ue=I[X];ue==="EN"?I[X]=Q==="L"?"L":"EN":ue!=="R"&&ue!=="L"||(Q=ue)}for(let X=0;X<S;X++){if(I[X]!=="ON")continue;let ue=X+1;for(;ue<S&&I[ue]==="ON";)ue++;const me=(X>0?I[X-1]:U)!=="L"?"R":"L";if(me===((ue<S?I[ue]:U)!=="L"?"R":"L"))for(let Ae=X;Ae<ue;Ae++)I[Ae]=me;X=ue-1}for(let X=0;X<S;X++)I[X]==="ON"&&(I[X]=z);for(let X=0;X<S;X++){const ue=I[X];1&H[X]?ue!=="L"&&ue!=="AN"&&ue!=="EN"||H[X]++:ue==="R"?H[X]++:ue!=="AN"&&ue!=="EN"||(H[X]+=2)}return H})($);if(M===null)return null;const E=new Int8Array(k.length);for(let O=0;O<k.length;O++)E[O]=M[k[O]];return E})(e.normalized,m);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:C,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:C}}function dV(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return uV((function(c,u,d="normal",f="normal"){const h=(function(b){const _=b??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
238
- `).replace(/[\r\f]/g,`
239
- `):b.replace(/\r\n/g,`
240
- `)})(c):(function(b){if(!Oj.test(b))return b;let _=b.replace(Lj," ");return _.charCodeAt(0)===32&&(_=_.slice(1)),_.length>0&&_.charCodeAt(_.length-1)===32&&(_=_.slice(0,-1)),_})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(b){if(b.len<=1)return b;const _=[],g=[],v=[],y=[];let C=null,L=!1,$=0,k=!1,M=!1;function E(){C!==null&&(_.push(Wo(C)),g.push(L),v.push("text"),y.push($),C=null)}for(let O=0;O<b.len;O++){const S=b.texts[O],I=b.kinds[O],P=b.isWordLike[O],D=b.starts[O];if(I==="text"){const H=Dj(S),z=k1(S);if(C!==null&&k&&M){C.push(S),L=L||P,k=k||H,M=z;continue}E(),C=[S],L=P,$=D,k=H,M=z;continue}E(),_.push(S),g.push(P),v.push(I),y.push(D)}return E(),{len:_.length,texts:_,isWordLike:g,kinds:v,starts:y}})(Q2(p,u,h)):Q2(p,u,h);return rt({normalized:p,chunks:nV(m,h)},m)})(s,Eh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Bg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",fs=(()=>{const e=globalThis;if(e[Bg])return e[Bg];const t={configs:{},controllers:{},revision:Yl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Bg]=t,t})();let jc=null;const tS=fs.revision;function nS(e){var t;return e&&(t=fs.configs[e])!=null?t:null}function sS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function fV(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Fg(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!fV(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+=`
241
- `)}return o.length>0?o:null}function Hg(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(jc!=null)return jc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return jc=!!((i=r.getContext)!=null&&i.call(r,"2d")),jc}catch{return jc=!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=fs.blockEstimateCache.get(r);if(l)return fs.blockEstimateCache.delete(r),fs.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 b=`${m}\0${p}\0${h}`,_=fs.preparedCache.get(b);if(_)return fs.preparedCache.delete(b),fs.preparedCache.set(b,_),_.prepared;const g=dV(h,p,{whiteSpace:m});for(fs.preparedCache.set(b,{prepared:g});fs.preparedCache.size>240;){const v=fs.preparedCache.keys().next().value;if(!v)break;fs.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const b=(function(_,g){return _.simpleLineWalkFastPath?eS(_,g):(function(v,y){if(v.simpleLineWalkFastPath)return eS(v,y);const{widths:C,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:k,breakableFitAdvances:M,discretionaryHyphenWidth:E,tabStopAdvance:O,chunks:S}=v;if(C.length===0||S.length===0)return 0;const I=Eh(),P=I.lineFitEpsilon,D=y+P;let H=0,z=0,U=!1,Q=0,X=0,ue=-1,me=0,Ae=0,be=null;function ze(){ue=-1,me=0,Ae=0,be=null}function qe(Y=Q,de=X,ne=z){H++,z=0,U=!1,ze()}function Fe(Y,de){U=!0,Q=Y+1,X=0,z=de}function Le(Y,de,ne){U=!0,Q=Y,X=de+1,z=ne}function le(Y,de){U?(z+=de,Q=Y+1,X=0):Fe(Y,de)}function F(Y,de,ne,ce){if(!de)return;const j=Y==="tab"?0:L[ne],G=Y==="tab"?ce:$[ne];ue=ne+1,me=z-ce+j,Ae=z-ce+G,be=Y}function te(Y,de){const ne=M[Y];for(let ce=de;ce<ne.length;ce++){const j=ne[ce];U?z+j>D?(qe(),Le(Y,ce,j)):(z+=j,Q=Y,X=ce+1):Le(Y,ce,j)}U&&Q===Y&&X===ne.length&&(Q=Y+1,X=0)}function ee(Y){if(be!=="soft-hyphen")return!1;const de=M[Y];if(de==null)return!1;const{fitCount:ne,fittedWidth:ce}=(function(j,G,re,he,Ce){let Ee=0,ae=G;for(;Ee<j.length;){const xe=ae+j[Ee];if((Ee+1<j.length?xe+Ce:xe)>re+he)break;ae=xe,Ee++}return{fitCount:Ee,fittedWidth:ae}})(de,z,y,P,E);return ne!==0&&(z=ce,Q=Y,X=ne,ze(),ne===de.length?(Q=Y+1,X=0,!0):(qe(Y,ne,ce+E),te(Y,ne),!0))}function q(Y){H++,ze()}for(let Y=0;Y<S.length;Y++){const de=S[Y];if(de.startSegmentIndex===de.endSegmentIndex){q();continue}U=!1,z=0,de.startSegmentIndex,Q=de.startSegmentIndex,X=0,ze();let ne=de.startSegmentIndex;for(;ne<de.endSegmentIndex;){const ce=k[ne],j=ce==="space"||ce==="preserved-space"||ce==="tab"||ce==="zero-width-break"||ce==="soft-hyphen",G=ce==="tab"?lV(z,O):C[ne];if(ce!=="soft-hyphen")if(U){if(z+G>D){const re=z+(ce==="tab"?0:L[ne]),he=z+(ce==="tab"?G:$[ne]);if(be==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&me<=D){qe(ue,0,Ae);continue}if(be==="soft-hyphen"&&ee(ne)){ne++;continue}if(j&&re<=D){le(ne,G),qe(ne+1,0,he),ne++;continue}if(ue>=0&&me<=D){if(Q>ue||Q===ue&&X>0){qe();continue}const Ce=ue;qe(Ce,0,Ae),ne=Ce;continue}if(G>y&&M[ne]!==null){qe(),te(ne,0),ne++;continue}qe();continue}le(ne,G),F(ce,j,ne,G),ne++}else G>y&&M[ne]!==null?te(ne,0):Fe(ne,G),F(ce,j,ne,G),ne++;else U&&(Q=ne+1,X=0,ue=ne+1,me=z+E,Ae=z+E,be=ce),ne++}if(U){const ce=ue===de.consumedEndSegmentIndex?Ae:z;qe(de.consumedEndSegmentIndex,0,ce)}}return H})(_,g)})(h,p);return{lineCount:b,height:b*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(fs.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});fs.blockEstimateCache.size>4e3;){const h=fs.blockEstimateCache.keys().next().value;if(!h)break;fs.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function YM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Fg(e.children);return i&&n.paragraph?Hg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Fg(e.children),l=n.headings[i];return r&&l?Hg(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=Fg((o=i[0])==null?void 0:o.children);return r?Hg(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=YM(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function uf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function pV(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(uf(String((d=u.originalCode)!=null?d:"")),uf(String((f=u.updatedCode)!=null?f:"")),uf(String((h=u.code)!=null?h:""))):uf((function(p,m){const b=String(p??"");return m?b:b.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,b;if(!p)return 0;const _=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,_)+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 hV(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Wg(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:hV(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const mV=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function oS(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))mV.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const gV=!1;function lhe(){return gV}function iS(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 XM=Symbol("MarkstreamMathBlockMinHeightCache");function ahe(){return qt(XM,null)}const vV=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],yV=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],kV=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),QM=["raw","content","code","originalCode","updatedCode"],rS=new WeakMap,lS=new WeakMap;let bV=1;function ii(){return typeof performance<"u"?performance.now():Date.now()}function aS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function jo(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=rS.get(t);return n||(n=bV++,rS.set(t,n)),String(n)}function cS(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:jo(t),customMarkdownIt:jo(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:jo(e.validateLink),preTransformTokens:jo(e.preTransformTokens),postTransformTokens:jo(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function uS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
242
- `,t-1)+1;return e.slice(n,t).trim()}function dS(e){const t=ZM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function ZM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function JM(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function sy(e){const t=String(e??"");return`${t.length}:${JM(t)}`}function w1(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?sy(r):`${r.length}:${JM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${jo(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:${jo(s)}`;const i=jo(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>w1(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}:${w1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Op(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function e3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Op(s)?Zr(s,t,n+1):e3(s,t,n+1)).join(",")}`:Op(e)?Zr(e,t,n):w1(e,t,n)}function _V(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!QM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${sy(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${jo(o)}`:kV.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${e3(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${jo(o)}`:""}).filter(Boolean).join(";")}function wV(e){return QM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${sy(n)}`:""}).filter(Boolean).join(";")}function Zr(e,t=new WeakMap,n=0){const s=lS.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}:${jo(o)}`;const r=jo(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=>Zr(p,c,u+1)).join("|"):"";return[a.type,wV(d),_V(d,c,u),f.length,h].join(":")})(e,t,n);return lS.set(o,l),l}function t3(e,t){return Zr(e)===Zr(t)}function oy(e,t,n){const s=ii(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ii()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function fS(e,t,n){return oy(t,n,()=>Zr(e))}function n3(e,t,n){return fS(e,n,"stabilizeSignatureMs")===fS(t,n,"stabilizeSignatureMs")}function zg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function pS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function SV(e,t){return e.length===t.length&&e===t}function iy(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"||!SV(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(!Op(d)||!Op(f))return null;const h=iy(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function CV(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=iy(e,t);return n??t3(e,t)}function xV(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return oy(n,"stabilizeSignatureMs",()=>{s=iy(e,t)}),s??n3(e,t,n)}function AV(e,t){const n={};for(const s of vV){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function TV(e,t){var n;const s=g2(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:W(()=>!1),r=Z(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=ii();function m(){l&&(clearTimeout(l),l=void 0)}function b(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),p=ii()}Ye([t.renderContent,t.effectiveFinal,i],([M,E,O])=>{r.value!==M&&(!O||E||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const P=I.slice(S.length);return!!P&&(!!dS(uS(I))||!(!P.includes(`
243
-
244
- `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
245
- `)&&!(function(D){const H=uS(D);if(dS(H))return!1;const z=ZM(H);return z.length>=2&&z.some(U=>U.trim())})(I))})(r.value,M)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const P=I.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(ii()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),B1(m);const _=W(()=>{var M,E,O,S;return qB(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(S=(O=(E=t.customComponentsMap)==null?void 0:E.value)!=null?O:{},Object.entries(S).map(([I,P])=>{const D=Jo(I);return P==null||!D||ad(D)||ET.has(D)||id.has(D)?"":D}).filter(Boolean)))}),g=W(()=>{const{key:M,tags:E}=jB(_.value);if(!M)return s;const O=o.get(M);if(O)return O;const S=g2(t.instanceMsgId,{customHtmlTags:E});return o.set(M,S),S}),v=W(()=>{const M=g.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=W(()=>{var M,E;const O=(M=e.parseOptions)!=null?M:{},S=t.effectiveFinal.value,I=_.value,P=S!=null,D=I.length>0;return P||D||O.streamParse==null?rt(rt(Lt(rt({},O),{streamParse:(E=O.streamParse)==null||E}),P?{final:S}:{}),D?{customHtmlTags:I}:{}):O}),C=W(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),L=W(()=>cS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=W(()=>cS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ye([L,$],([M,E],[O,S])=>{O&&(M===O&&E===S||(b(),E!==S&&(a=[],d="")))},{flush:"sync"});const k=W(()=>{var M,E,O,S,I,P,D,H;if((M=e.nodes)!=null&&M.length)return a=[],d="",Rr(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const U=t.debugPerformanceEnabled.value,Q=U?ii():0,X=v.value,ue=L.value,me=$.value;c&&ue!==c&&(function(de){var ne,ce;(ce=(ne=de.stream)==null?void 0:ne.reset)==null||ce.call(ne)})(X),u&&me!==u&&(a=[],d="");const Ae=a.length>0&&z.startsWith(d)&&me===u,be=U?aS(X):null,ze=U?{}:void 0,qe=ze?Lt(rt({},y.value),{__timing:ze}):y.value,Fe=vM(z,X,qe),Le=U?ii():0,le=U?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let F,te=U?zg(Fe.length):void 0,ee=0,q=0;if(Ae){const de=U?ii():0;if(le){const ne=(function(ce,j,G){if(!j.length)return{nodes:ce,metrics:zg(ce.length)};const re=(function(Ee,ae,xe){const Ke=Math.min(Ee.length,ae.length);for(let st=0;st<Ke;st++)if(!xV(ae[st],Ee[st],xe))return st;return Ee.length===ae.length?-1:Ke})(ce,j,G);if(re<0)return{nodes:j,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:re,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const he=ce.slice();let Ce=re;for(let Ee=0;Ee<re;Ee++)he[Ee]=j[Ee];for(let Ee=re;Ee<ce.length;Ee++){const ae=j[Ee],xe=ce[Ee];ae&&n3(ae,xe,G)&&(he[Ee]=ae,Ce+=1)}return{nodes:he,metrics:{reusedNodeCount:Ce,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:pS(re,ce,j)}}})(Fe,a,le);F=ne.nodes,te=ne.metrics}else{const ne=(function(ce,j){if(!j.length)return{nodes:ce,metrics:zg(ce.length)};const G=(function(Ce,Ee){const ae=Math.min(Ce.length,Ee.length);for(let xe=0;xe<ae;xe++)if(!CV(Ee[xe],Ce[xe]))return xe;return Ce.length===Ee.length?-1:ae})(ce,j);if(G<0)return{nodes:j,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:G,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const re=ce.slice();let he=G;for(let Ce=0;Ce<G;Ce++)re[Ce]=j[Ce];for(let Ce=G;Ce<ce.length;Ce++){const Ee=j[Ce],ae=ce[Ce];Ee&&t3(Ee,ae)&&(re[Ce]=Ee,he+=1)}return{nodes:re,metrics:{reusedNodeCount:he,dirtyStartIndex:G,stablePrefixNodeCount:G,dirtyTailNodeCount:pS(G,ce,j)}}})(Fe,a);F=ne.nodes,te=ne.metrics}ee=U?ii()-de:0,q=te?.dirtyStartIndex==null||te.dirtyStartIndex<0?F.length:te.dirtyStartIndex}else F=Fe;le?(function(de,ne,ce=0){for(let j=Math.max(0,ce);j<de.length;j++)oy(ne,"primeSignatureMs",()=>Zr(de[j]))})(F,le,q):(function(de,ne=0){for(let ce=Math.max(0,ne);ce<de.length;ce++)Zr(de[ce])})(F,q);const Y=U?ii()-Le:0;if(f+=1,d=z,c=ue,u=me,a=F,U){const de=aS(X),ne=typeof de?.total=="number"&&de.total>((E=be?.total)!=null?E:0);t.logPerf(ne?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(ii()-Q),nodes:F.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:Y,signatureMs:(O=le?.signatureMs)!=null?O:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=le?.primeSignatureMs)!=null?I:0,signatureCallCount:(P=le?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(D=le?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(H=le?.primeSignatureCallCount)!=null?H:0,stabilizeMs:ee},te??{}),ze?Object.fromEntries(yV.map(ce=>{var j;return[ce,(j=ze[ce])!=null?j:0]})):{}),de?{streamMode:de.lastMode,streamDelta:AV(de,be),streamStats:de}:{}))}return Rr(F)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:C,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:k}}function MV(e){const{isClient:t}=e,n=Z(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 b=n.value,_=b.has(f);if(h){if(_)return;const v=new Set(b);return v.add(f),void(n.value=v)}if(!_)return;const g=new Set(b);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 EV(e={}){const t=Z(""),n=Z(""),s=Z(!1),o=IU(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=W(()=>Math.max(0,t.value.length-n.value.length)),a=W(()=>l.value===0),c=W(()=>s.value&&a.value);return D1()&&B1(()=>{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 hS=/auto|scroll|overlay/i;function IV(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return hS.test(t)||hS.test(n)}function $V(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 NV=Ve({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=W(()=>{var n,s;return a1((s=Pa(e.estimatedPreviewHeightPx))!=null?s:r1(String((n=e.node.code)!=null?n:"")))});return()=>un("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?un("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)"}},[un("div",{class:"flex items-center gap-x-2 overflow-hidden"},[un("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),un("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),un("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},()=>un("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,un("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[un("div",{class:"absolute inset-0"},[un("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),LV=Ve({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=W(()=>{var n,s;return l1((s=Pa(e.estimatedPreviewHeightPx))!=null?s:i1(String((n=e.node.code)!=null?n:"")))});return()=>un("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?un("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)"}},[un("div",{class:"flex items-center gap-x-2 overflow-hidden"},[un("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),un("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},()=>un("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[un("span",{class:"action-icon block"})])))]):null,un("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)"}},[un("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"}})])])}}),OV=["data-custom-id"],PV={class:"m-0 p-0"},RV=["data-probe"],DV=["data-node-index","data-node-type"],s3=dn(Ve(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=Ls(),r=qt("markstreamNestedRendererProps",void 0);function l(x){var B,V;const K=s[x];return(function(J){const fe=i?.vnode.props;return!!fe&&(Object.prototype.hasOwnProperty.call(fe,J)||Object.prototype.hasOwnProperty.call(fe,String(J).replace(/[A-Z]/g,ve=>`-${ve.toLowerCase()}`)))})(x)?K:(V=(B=r?.value)==null?void 0:B[x])!=null?V: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=W(()=>{return(x=l("mode"))==="chat"||x==="minimal"||x==="docs"?x:"docs";var x}),u=W(()=>{const x=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return x===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:x===!1||c.value==="docs"?"monaco":"pre"}),d=W(()=>a[c.value]),f=W(()=>{var x;return(x=l("showTooltips"))!=null?x:d.value.showTooltips}),h=W(()=>{var x;return(x=l("fade"))!=null?x:d.value.fade}),p=W(()=>{var x;return(x=l("batchRendering"))!=null?x:d.value.batchRendering}),m=W(()=>{var x;return(x=l("initialRenderBatchSize"))!=null?x:d.value.initialRenderBatchSize}),b=W(()=>{var x;return(x=l("renderBatchSize"))!=null?x:d.value.renderBatchSize}),_=W(()=>{var x;return(x=l("renderBatchDelay"))!=null?x:d.value.renderBatchDelay}),g=W(()=>{var x;return(x=l("renderBatchBudgetMs"))!=null?x:d.value.renderBatchBudgetMs}),v=W(()=>{var x;return(x=l("renderBatchIdleTimeoutMs"))!=null?x:d.value.renderBatchIdleTimeoutMs}),y=W(()=>{var x;return(x=l("deferNodesUntilVisible"))!=null?x:d.value.deferNodesUntilVisible}),C=W(()=>{var x;return(x=l("maxLiveNodes"))!=null?x:d.value.maxLiveNodes}),L=W(()=>{var x;return(x=l("liveNodeBuffer"))!=null?x:d.value.liveNodeBuffer}),$=W(()=>{var x;return(x=l("nodeVirtual"))!=null?x: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 b.value},get renderBatchDelay(){return _.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return C.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function M(x){o("height-change",x)}function E(x){o("virtual-state-change",x)}function O(x){o("anchor-change",x)}const S=Z(),I=Z(null),P=Z(null),D=Z(null),H=$s({1:null,2:null,3:null,4:null,5:null,6:null}),z=Z(!1),U=new Map,Q=Z(0),X=Z(0),ue=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function me(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.enabled)!==!0)return null;const V=(B=s.virtualScroll)==null?void 0:B.scrollRoot;return Ae(typeof V=="function"?V():V)}function Ae(x){return x?typeof HTMLElement<"u"&&x instanceof HTMLElement?x:typeof x=="object"&&"value"in x?Ae(x.value):typeof x=="object"&&"$el"in x?Ae(x.$el):null:null}const{isClient:be,renderAsFragment:ze,debugPerformanceEnabled:qe,resolvedShowTooltips:Fe,resolvedHtmlPolicy:Le,inheritedSmoothStreaming:le,ownsTypewriterCursor:F}=(function(x){const B=typeof window<"u",V=Ju(),K=qt("markstreamHtmlPolicy",void 0),J=qt("markstreamTypewriterCursor",void 0),fe=qt("markstreamSmoothStreaming",void 0),ve=W(()=>x.renderAsFragment===!0),we=W(()=>!!(x.debugPerformance&&B&&typeof console<"u")),Pe=W(()=>{var Be;if(typeof x.showTooltips=="boolean")return x.showTooltips;const $e=(Be=V.showTooltips)!=null?Be:V["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Me=W(()=>{var Be,$e;return($e=(Be=x.htmlPolicy)!=null?Be:K?.value)!=null?$e:"safe"}),We=W(()=>J?.value!==!0);return{isClient:B,renderAsFragment:ve,debugPerformanceEnabled:we,resolvedShowTooltips:Pe,resolvedHtmlPolicy:Me,inheritedSmoothStreaming:fe,inheritedTypewriterCursor:J,ownsTypewriterCursor:We}})(k),{resolveViewportRoot:te,resolveScrollContainer:ee,isReverseFlexScrollRoot:q,getNormalizedScrollTop:Y,getOffsetTopWithinRoot:de}=(function(x,B){function V(){var we,Pe;return(Pe=(we=B.scrollRoot)==null?void 0:we.call(B))!=null?Pe:null}function K(we){if(typeof window>"u")return null;const Pe=V();if(Pe)return Pe;const Me=we??x.value;if(!Me)return null;const We=Me.ownerDocument||document,Be=We.scrollingElement||We.documentElement;let $e=Me;for(;$e&&$e!==We.body&&$e!==Be;){if(IV(window.getComputedStyle($e))&&$V($e))return $e;$e=$e.parentElement}return null}function J(we){if(!B.isClient)return!1;try{const Pe=window.getComputedStyle(we);return!!(Pe.display||"").toLowerCase().includes("flex")&&(Pe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function fe(we,Pe,Me){var We,Be;if(Me)return ve(Pe);const $e=we.scrollTop;if(!J(we))return $e;const He=$e<0?-$e:$e;return Math.max(0,((We=we.scrollHeight)!=null?We:0)-((Be=we.clientHeight)!=null?Be:0))-He}function ve(we){var Pe,Me,We,Be,$e;const He=Number((Pe=we.scrollingElement)==null?void 0:Pe.scrollTop),Qe=Number((We=(Me=we.documentElement)==null?void 0:Me.scrollTop)!=null?We:0),Ze=Number(($e=(Be=we.body)==null?void 0:Be.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Qe)?Qe:0,Number.isFinite(Ze)?Ze:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(we){var Pe,Me,We,Be;const $e=V();if($e)return $e;const He=K((Pe=we??x.value)!=null?Pe:null);if(He)return He;const Qe=(Be=(We=we?.ownerDocument)!=null?We:(Me=x.value)==null?void 0:Me.ownerDocument)!=null?Be:typeof document<"u"?document:null;return Qe?.scrollingElement||Qe?.documentElement||null},isReverseFlexScrollRoot:J,getNormalizedScrollTop:fe,getOffsetTopWithinRoot:function(we,Pe){const Me=Pe.ownerDocument||we.ownerDocument||document;if((function(He,Qe){return He===Qe.documentElement||He===Qe.body||He===Qe.scrollingElement})(Pe,Me))return we.getBoundingClientRect().top+ve(Me);const We=Pe.getBoundingClientRect(),Be=we.getBoundingClientRect(),$e=fe(Pe,Me,!1);return Be.top-We.top+$e}}})(S,{isClient:be,scrollRoot:me});On("markstreamShowTooltips",Fe),On("markstreamHtmlPolicy",Le),On("markstreamTypewriter",W(()=>k.typewriter!==!1)),On("markstreamFade",W(()=>k.fade!==!1)),On("markstreamTypewriterCursor",W(()=>!0)),On("markstreamTextStreamState",U),On("markstreamStreamVersion",Q),On("markstreamParseOptions",W(()=>k.parseOptions)),On("markstreamCustomMarkdownIt",W(()=>k.customMarkdownIt));const{smoothStreamingEnabled:ne,renderContent:ce,effectiveFinal:j}=(function(x,B){const V=EV(x.smoothStreamingOptions),K=W(()=>{var Me,We,Be;return x.smoothStreaming!==!1&&!((Me=x.nodes)!=null&&Me.length)&&(x.smoothStreaming===!0||!((We=B.inheritedSmoothStreaming)!=null&&We.value))&&(x.smoothStreaming===!0||x.typewriter===!0||((Be=x.maxLiveNodes)!=null?Be:0)<=0)}),J=Z(!B.isClient||x.smoothStreaming===!0);bn(()=>{J.value=!0});const fe=W(()=>J.value&&K.value),ve=W(()=>{var Me;return fe.value?V.visible.value:(Me=x.content)!=null?Me:""}),we=W(()=>{var Me,We;const Be=(Me=x.parseOptions)!=null?Me:{};return(We=x.final)!=null?We:Be.final}),Pe=W(()=>{const Me=we.value;return fe.value&&Me!=null?!!Me&&V.caughtUp.value:Me});return Ye([()=>x.content,()=>x.nodes,fe,we],([Me,We,Be,$e])=>{if(We?.length)return void V.reset("");const He=Me??"";if(!Be)return V.reset(He),void($e&&V.finish({flush:!0}));const Qe=V.source.value;He?He===Qe||(He.startsWith(Qe)?V.enqueue(He.slice(Qe.length)):V.reset(He)):V.reset(""),$e&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:fe,renderContent:ve,requestedFinal:we,effectiveFinal:Pe}})(k,{isClient:be,inheritedSmoothStreaming:le});On("markstreamSmoothStreaming",ne);const G=Z(!1);let re="",he=!1,Ce=null;function Ee(){be&&Ce!=null&&(window.clearTimeout(Ce),Ce=null)}function ae(){G.value=!1,Ee()}function xe(x,B){if(!qe.value)return;const V=(function(){if(!qe.value)return null;const K=Et(Ke),J=Et(st),fe=Math.max(wt,J);if(K<=0&&fe<=0)return null;const ve={total:K,maxPerFrame:fe,byLabel:(we=Ke,Object.fromEntries(Array.from(we.entries()).sort((Pe,Me)=>Me[1]-Pe[1]||Pe[0].localeCompare(Me[0]))))};var we;return Ke.clear(),st.clear(),wt=0,ve})();console.info(`[markstream-vue][perf] ${x}`,V?Lt(rt({},B),{layoutReads:V}):B)}Ye([ce,()=>s.nodes,j],([x,B,V])=>{const K=x??"";return B?.length||V===!0?(ae(),re=K,void(he=!0)):he?(re&&K.length>re.length&&K.startsWith(re)?(G.value=!0,be&&(Ee(),Ce=window.setTimeout(()=>{var J;Ce=null,j.value===!0||(J=s.nodes)!=null&&J.length||(ca(),G.value=!1,Li())},1200))):(K.length<re.length||!K.startsWith(re))&&ae(),void(re=K)):(re=K,void(he=!0))},{flush:"sync",immediate:!0});const Ke=new Map,st=new Map;let _t=!1,wt=0;function Et(x){let B=0;for(const V of x.values())B+=V;return B}function Ot(){wt=Math.max(wt,Et(st)),st.clear(),_t=!1}function bt(x,B){return(function(V){var K,J;qe.value&&(Ke.set(V,((K=Ke.get(V))!=null?K:0)+1),st.set(V,((J=st.get(V))!=null?J:0)+1),_t||(_t=!0,be&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ot):typeof queueMicrotask!="function"?setTimeout(Ot,0):queueMicrotask(Ot)))})(x),B()}const Kt=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Fn=(function(x){const B=new Map;return{scope:x,cache:B,clear:()=>B.clear()}})(Kt),$n=W(()=>`${Kt}:${Q.value}`);On(XM,Fn);const Rt=cs(()=>k.customId),{effectiveCustomHtmlTagsSet:nn,mergedParseOptions:Hn,parsedNodes:nt}=TV(k,{instanceMsgId:Kt,renderContent:ce,effectiveFinal:j,smoothStreamingEnabled:ne,debugPerformanceEnabled:qe,customComponentsMap:Rt,logPerf:xe});Ye(nt,()=>{Fn.clear(),Q.value+=1},{immediate:!0});const Pn=W(()=>({customId:k.customId,customHtmlTags:Hn.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:Le.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:Fe.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));On("markstreamNestedRendererProps",Pn);const fn=W(()=>nt.value),Gn=W(()=>nt.value.length),Rn=Z(null),gs=Z(null),Xe=Z(null),Ge=Z(null),At=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),jt=!At&&k.customId?nS(k.customId):null,Xt=W(()=>jt?(tS.value,nS(k.customId)):null),Nn=W(()=>{var x;return!!(be&&!ze.value&&k.customId&&!At&&((x=Xt.value)!=null&&x.enabled))}),An=W(()=>{var x;return!!(!ze.value&&((x=s.virtualScroll)!=null&&x.enabled))}),ts=Z(!1);bn(()=>{ts.value=!0});const It=W(()=>!!(be&&An.value));On("markstreamHostScrollManaged",It);const Tn=W(()=>!!(ts.value&&It.value)),Qt=W(()=>Nn.value||It.value),_s=W(()=>Nn.value||Tn.value),ei=W(()=>{var x;return Qt.value&&((x=Xt.value)==null?void 0:x.textEstimation)!==!1}),No=W(()=>{var x;return Qt.value&&((x=Xt.value)==null?void 0:x.codeBlockEstimation)!==!1});function et(){const x=X.value||bt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=S.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(x)&&x>0?x:0}const it=W(()=>{const x=et();return x>0?Math.max(1,Math.round(x)):640}),lt=W(()=>{var x;return Math.max(1,(x=k.maxLiveNodes)!=null?x:320)}),pt=W(()=>{var x;return!ze.value&&k.nodeVirtual!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&(k.nodeVirtual===!0?nt.value.length>0:nt.value.length>lt.value)}),ti=W(()=>pt.value||Nn.value||It.value),hi=W(()=>k.viewportPriority!==!1&&!z.value),Ie=mj(x=>{var B;return te((B=x??S.value)!=null?B:null)},hi),{requestFrame:_e,cancelFrame:Re,hasIdleCallback:ln,isTestEnv:zt}=(function(x){const B=x.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=x.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=x.isClient&&typeof window.requestIdleCallback=="function",J=(function(){var fe;if(typeof globalThis>"u"||!("process"in globalThis))return;const ve=(fe=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:fe.value;return ve?.env})();return{requestFrame:B,cancelFrame:V,hasIdleCallback:K,isTestEnv:J?.NODE_ENV==="test"}})({isClient:be}),{resolvedBatchSize:us,resolvedInitialBatch:Wn,batchingEnabled:go,incrementalRenderingActive:ni,renderedCount:vs,previousRenderContext:rl,adaptiveBatchSize:ll,previousBatchConfig:gc}=(function(x,B){var V;const K=W(()=>{var Be;const $e=Math.trunc((Be=x.renderBatchSize)!=null?Be:80);return Number.isFinite($e)?Math.max(0,$e):0}),J=W(()=>{var Be;const $e=Math.trunc((Be=x.initialRenderBatchSize)!=null?Be:K.value);return Number.isFinite($e)?Math.max(0,$e):K.value}),fe=W(()=>!B.renderAsFragment.value&&x.batchRendering!==!1&&K.value>0&&B.isClient&&!B.isTestEnv),ve=Z(0),we=Z({key:x.indexKey,total:0}),Pe=Z(Math.max(1,K.value||1)),Me=W(()=>{var Be;return fe.value&&((Be=x.maxLiveNodes)!=null?Be:0)<=0}),We=Z({batchSize:K.value,initial:J.value,delay:(V=x.renderBatchDelay)!=null?V:16,enabled:Me.value});return{resolvedBatchSize:K,resolvedInitialBatch:J,batchingEnabled:fe,incrementalRenderingActive:Me,renderedCount:ve,previousRenderContext:we,adaptiveBatchSize:Pe,previousBatchConfig:We}})(k,{isClient:be,isTestEnv:zt,renderAsFragment:ze}),dt=new Map,pe=new Map,Ne=new WeakMap;let wn=null;const dd=new WeakMap,se=new Map,Se=Z(0),Te=W(()=>(Se.value,Array.from(dt.entries()).sort((x,B)=>x[0]-B[0]))),Ue=Z(null),tt=Z(null);let at=null,Bt=0,Zt=null;const{activeRestoreAnchor:Ht,getRelativeScrollTopWithinContainer:Lo,setRelativeScrollTopWithinContainer:Oo,resolveAnchorOffset:vn,clearRestoreReconcile:ns,scheduleRestoreReconcile:Ln,captureRestoreAnchor:ws,restoreAnchor:Ss,getAnchorDrift:lr}=(function(x){const{isClient:B,containerRef:V,parsedNodeCount:K,requestFrame:J,cancelFrame:fe,resolveScrollContainer:ve,getNormalizedScrollTop:we,getOffsetTopWithinRoot:Pe,isReverseFlexScrollRoot:Me,estimateIndexForOffset:We,estimateHeightRange:Be,getFallbackNodeHeight:$e,clamp:He}=x,Qe=Z(null);let Ze=null,St=[];function ct(){const Tt=ve(),Ft=V.value;if(!Tt||!Ft)return null;const Dt=Tt.ownerDocument||Ft.ownerDocument||document;if(Tt===Dt.documentElement||Tt===Dt.body||Tt===Dt.scrollingElement){const an=Ft.getBoundingClientRect();return Math.max(0,-an.top)}return Math.max(0,we(Tt,Dt,!1)-Pe(Ft,Tt))}function ut(Tt){var Ft;const Dt=ve(),an=V.value;if(!Dt||!an)return;const bo=Math.max(0,Tt),zs=Dt.ownerDocument||an.ownerDocument||document,si=zs.defaultView||(typeof window<"u"?window:null);if(Dt===zs.documentElement||Dt===zs.body||Dt===zs.scrollingElement){const pr=we(Dt,zs,!0)+an.getBoundingClientRect().top;return void((Ft=si?.scrollTo)==null||Ft.call(si,0,Math.max(0,pr+bo)))}iS(Dt,zs,Pe(an,Dt)+bo,{isReverseFlexScrollRoot:pr=>{var hr;return(hr=Me?.(pr))!=null&&hr},getNormalizedScrollTop:we})}function xt(Tt){const Ft=K.value,Dt=He(Tt.nodeIndex,0,Math.max(0,Ft-1));return Be(0,Dt)+Math.max(0,Tt.offsetWithinNodePx)}function Ct(){if(Ze!=null&&(fe?.(Ze),Ze=null),B)for(const Tt of St)window.clearTimeout(Tt);St=[]}function Jt(Tt){const Ft=xt(Tt),Dt=ct();Dt!=null&&Math.abs(Dt-Ft)<=.5||ut(Ft)}return{activeRestoreAnchor:Qe,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:ut,resolveAnchorOffset:xt,clearRestoreReconcile:Ct,applyRestoreAnchor:Jt,scheduleRestoreReconcile:function(){Qe.value&&B&&Ze==null&&(Ze=J?J(()=>{Ze=null,Qe.value&&Jt(Qe.value)}):null,Ze==null&&Qe.value&&Jt(Qe.value))},captureRestoreAnchor:function(){const Tt=ct(),Ft=K.value;if(Tt==null||Ft<=0)return null;const Dt=He(We(Tt+1),0,Ft-1),an=Be(0,Dt),bo=$e(Dt);return{nodeIndex:Dt,offsetWithinNodePx:He(Tt-an,0,Math.max(0,bo-1))}},restoreAnchor:function(Tt){const Ft=K.value;if(Qe.value={nodeIndex:He(Tt.nodeIndex,0,Math.max(0,Ft-1)),offsetWithinNodePx:Math.max(0,Tt.offsetWithinNodePx)},Ct(),Jt(Qe.value),B)for(const Dt of[0,120,280,480])St.push(window.setTimeout(()=>{Qe.value&&Jt(Qe.value)},Dt))},getAnchorDrift:function(Tt){const Ft=ct();return Ft==null?null:Ft-xt(Tt)}}})({isClient:be,containerRef:S,parsedNodeCount:Gn,requestFrame:_e,cancelFrame:Re,resolveScrollContainer:()=>Ue.value||ee(),getNormalizedScrollTop:Y,getOffsetTopWithinRoot:de,isReverseFlexScrollRoot:q,estimateIndexForOffset:xm,estimateHeightRange:fr,getFallbackNodeHeight:_d,clamp:As}),{nodeHeights:Cs,heightStats:Js,heightTreeSize:vc,heightSumTree:Wh,heightKnownTree:zh,averageNodeHeight:mi,resetHeightMeasurements:w4,pruneHeightMeasurements:S4,rebuildHeightTrees:fd,recordNodeHeight:C4,removeNodeHeights:x4,exportHeightCache:A4,importHeightCache:T4,fenwickRangeSum:pd}=(function(x={}){const B=$s({}),V=$s({total:0,count:0}),K=Z(0),J=Z([]),fe=Z([]);function ve(){for(const $e of Object.keys(B))delete B[Number($e)];V.total=0,V.count=0,K.value=0,J.value=[],fe.value=[]}function we($e,He,Qe){for(let Ze=He+1;Ze<$e.length;Ze+=Ze&-Ze)$e[Ze]+=Qe}function Pe($e,He){let Qe=0;for(let Ze=He+1;Ze>0;Ze-=Ze&-Ze)Qe+=$e[Ze];return Qe}function Me($e){K.value=$e;const He=new Array($e+1).fill(0),Qe=new Array($e+1).fill(0);for(const[Ze,St]of Object.entries(B)){const ct=Number(Ze),ut=Number(St);!Number.isFinite(ct)||ct<0||ct>=$e||!Number.isFinite(ut)||ut<=0||(we(He,ct,ut),we(Qe,ct,1))}J.value=He,fe.value=Qe}function We($e){if(!Number.isInteger($e)||$e<0)return!1;const He=B[$e];if(!Number.isFinite(He)||He<=0)return!1;if(delete B[$e],V.total=Math.max(0,V.total-He),V.count=Math.max(0,V.count-1),K.value>$e){const Qe=J.value,Ze=fe.value;Qe.length&&Ze.length&&(we(Qe,$e,-He),we(Ze,$e,-1))}return!0}const Be=W(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:B,heightStats:V,heightTreeSize:K,heightSumTree:J,heightKnownTree:fe,averageNodeHeight:Be,resetHeightMeasurements:ve,pruneHeightMeasurements:function($e){if($e<=0)return void ve();let He=0,Qe=0;for(const[Ze,St]of Object.entries(B)){const ct=Number(Ze),ut=Number(St);!Number.isFinite(ct)||ct<0||ct>=$e||!Number.isFinite(ut)||ut<=0?delete B[ct]:(He+=ut,Qe++)}V.total=He,V.count=Qe},rebuildHeightTrees:Me,recordNodeHeight:function($e,He,Qe={}){(function(Ze,St,ct={}){var ut;if(!Number.isFinite(St)||St<=0)return!1;const xt=B[Ze];if(xt&&(ct.allowShrink===!1&&St<xt||Math.abs(St-xt)<=1))return!1;if(B[Ze]=St,xt?V.total+=St-xt:(V.total+=St,V.count++),K.value>Ze){const Ct=J.value,Jt=fe.value;if(Ct.length&&Jt.length)if(xt){const Tt=St-xt;Tt!==0&&we(Ct,Ze,Tt)}else we(Ct,Ze,St),we(Jt,Ze,1)}ct.notify!==!1&&((ut=x.onHeightRecorded)==null||ut.call(x))})($e,He,Lt(rt({},Qe),{notify:!0}))},removeNodeHeight:function($e,He={}){var Qe;const Ze=We($e);return Ze&&He.notify!==!1&&((Qe=x.onHeightRecorded)==null||Qe.call(x)),Ze},removeNodeHeights:function($e,He={}){var Qe;let Ze=0;for(const St of $e)We(Number(St))&&Ze++;return Ze>0&&He.notify!==!1&&((Qe=x.onHeightRecorded)==null||Qe.call(x)),Ze},exportHeightCache:function(){return Object.entries(B).map(([$e,He])=>({index:Number($e),height:Number(He)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,He)=>$e.index-He.index)},importHeightCache:function($e,He={}){var Qe;if(!Array.isArray($e))return;const Ze=K.value;let St=!1;if(He.mode!=="merge"){const ct=Object.keys(B);if(ct.length>0){for(const ut of ct)delete B[Number(ut)];St=!0}}for(const ct of $e){const ut=Number(ct.index),xt=Number(ct.height);if(!Number.isInteger(ut)||ut<0||Ze>0&&ut>=Ze||!Number.isFinite(xt)||xt<=0)continue;const Ct=B[ut];Ct&&Math.abs(Ct-xt)<=1||(B[ut]=xt,St=!0)}St&&((function(){let ct=0,ut=0;const xt=K.value;for(const[Ct,Jt]of Object.entries(B)){const Tt=Number(Ct),Ft=Number(Jt);!Number.isFinite(Tt)||Tt<0||xt>0&&Tt>=xt||!Number.isFinite(Ft)||Ft<=0?delete B[Tt]:(ct+=Ft,ut++)}V.total=ct,V.count=ut})(),Ze>0&&Me(Ze),(Qe=x.onHeightRecorded)==null||Qe.call(x))},fenwickRangeSum:function($e,He,Qe){if(Qe<=He)return 0;const Ze=Pe($e,Qe-1);return He<=0?Ze:Ze-Pe($e,He-1)}}})({onHeightRecorded:()=>{Ro(),It.value&&Lc(),Ht.value&&Ln(),tt.value&&ra(),Mn("node-resize")}});function hd(){w4(),se.clear()}function Ay(x){!Number.isInteger(x)||x<0||x>=nt.value.length||se.set(x,wc(x))}function Ty(x,B,V={}){const K=Cs[x];C4(x,B,V);const J=Cs[x];J&&J>0?Ay(x):K&&se.delete(x)}function My(x,B){const V=bt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,J;return(J=(K=dt.get(x))==null?void 0:K.offsetHeight)!=null?J:0});return V>0?V:bt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function Ey(x,B={}){T4(x,B),gm()}const ar=W(()=>{var x;return!ze.value&&k.deferNodesUntilVisible!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&!pt.value&&!(nt.value.length>900)&&hi.value}),Iy=W(()=>!!Ie&&(ar.value||pt.value)),$y=W(()=>pt.value||It.value),{liveNodeBufferResolved:yc,focusIndex:Po,liveRange:xs,updateLiveRange:al}=(function(x,B){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:J,clamp:fe}=B,ve=W(()=>{var Me;return Math.max(0,(Me=x.liveNodeBuffer)!=null?Me:60)}),we=Z(0),Pe=$s({start:0,end:0});return{liveNodeBufferResolved:ve,focusIndex:we,liveRange:Pe,updateLiveRange:function(){const Me=V.value;if(!K.value||Me===0)return Pe.start=0,void(Pe.end=Me);const We=Math.min(J.value,Me),Be=ve.value,$e=fe(we.value-Be,0,Math.max(0,Me-We));Pe.start=$e,Pe.end=Math.min(Me,$e+We)}}})(k,{parsedNodeCount:Gn,virtualizationEnabled:pt,maxLiveNodesResolved:lt,clamp:As}),gi=new Map,cl=new Map,cr=new Map,md=[],$i=new Map,ur=new Set,Ny=Z(0);let Uh=!1;const Ly=W(()=>(Ny.value,ur.size)),vo=new Map,vi=new Map,Oy=Z(0),qh=W(()=>{Oy.value;let x=0;for(const B of vo.values())x+=Math.max(0,B);return x});let yo=null,jh=!0,Py=[0],Ry="";function Ro(){jh=!0}const gd=W(()=>{if(!pt.value)return nt.value.length;const x=yc.value,B=Math.max(xs.end+x,Wn.value),V=Math.min(nt.value.length,B);return Math.max(vs.value,V)});function vd(){Uh||(Uh=!0,queueMicrotask(()=>{Uh=!1,Ny.value+=1}))}function Dy(x,B,V="node-resize"){if(!be||typeof window>"u")return null;const K=window.setTimeout(()=>{ur.delete(K)&&vd();try{B()}finally{Mn(V)}},Math.max(0,x));return ur.add(K),vd(),K}function yd(x){be&&x!=null&&(ur.delete(x)&&vd(),window.clearTimeout(x))}function By(){if(be&&typeof window<"u")for(const x of ur)window.clearTimeout(x);ur.size&&(ur.clear(),vd()),md.length=0,cr.clear()}function M4(x){var B,V;return(V=(B=Ge.value)==null?void 0:B[x])!=null?V:null}const{cancelScheduledFocusSync:Vh,scheduleFocusSync:yi}=(function(x){const{isClient:B,containerRef:V,virtualizationEnabled:K,requestFrame:J,cancelFrame:fe,syncFocusToScroll:ve}=x;let we=null;function Pe(){var We,Be,$e;return($e=(Be=(We=V.value)==null?void 0:We.ownerDocument)==null?void 0:Be.defaultView)!=null?$e:typeof window<"u"?window:null}function Me(){if(!we)return;const We=Pe();we.viaTimeout?We?We.clearTimeout(we.id):clearTimeout(we.id):fe?.(we.id),we=null}return{cancelScheduledFocusSync:Me,scheduleFocusSync:function(We={}){if(!K.value)return;if(!B)return void ve(!0);if(We.immediate)return Me(),void ve(!0);if(we)return;const Be=()=>{we=null,ve()};if(J)return void(we={id:J(Be),viaTimeout:!1});const $e=Pe();we={id:$e?$e.setTimeout(Be,16):setTimeout(Be,16),viaTimeout:!0}}}})({isClient:be,containerRef:S,virtualizationEnabled:pt,requestFrame:_e,cancelFrame:Re,syncFocusToScroll:function(x=!1){var B;if(!pt.value)return;const V=Ue.value||ee();if(!V)return;const K=V.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,J=K?.defaultView||(typeof window<"u"?window:null),fe=V===K?.documentElement||V===K?.body,ve=nt.value.length;if(!fe&&ve>0&&q(V)){const Qe=bt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Ze=bt("syncFocusToScroll.scrollTop",()=>V.scrollTop),St=Ze<0?-Ze:Ze,ct=(function(xt){var Ct,Jt;const Tt=nt.value;if(!Tt.length)return 0;if(xt<=0)return Math.max(0,Tt.length-1);if(Qt.value){const Dt=(Ct=Qh()[Tt.length])!=null?Ct:0;return Vy(Math.max(0,Dt-xt))}if(vc.value===Tt.length){const Dt=fr(0,Tt.length);return xm(Math.max(0,Dt-xt))}let Ft=xt;for(let Dt=Tt.length-1;Dt>=0;Dt--){const an=(Jt=Cs[Dt])!=null?Jt:mi.value;if(Ft<=an)return Dt;Ft-=an}return 0})(Math.max(0,St)+.5*Math.max(0,Qe)),ut=As(ct,0,Math.max(0,ve-1));return void((x||Math.abs(ut-Po.value)>1)&&(Po.value=ut,al()))}const we=fe?null:bt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Pe=fe?0:we.top,Me=fe?bt("syncFocusToScroll.viewport.clientHeight",()=>{var Qe,Ze;return(Ze=(Qe=J?.innerHeight)!=null?Qe:V.clientHeight)!=null?Ze:0}):we.bottom,We=Te.value;let Be=null,$e=null;for(const[Qe,Ze]of We){if(!Ze)continue;const St=bt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ze.getBoundingClientRect());St.bottom<=Pe||St.top>=Me||(Be==null&&(Be=Qe),$e=Qe)}if(Be==null||$e==null){const Qe=S.value;if(!Qe)return;const Ze=fe?{top:0}:bt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),St=bt("syncFocusToScroll.fallback.scrollTop",()=>Y(V,K,fe)),ct=fe?(()=>{const Ct=bt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Qe.getBoundingClientRect()),Jt=(fe?0:Ze.top)-Ct.top;return Math.max(0,Jt)})():(()=>{const Ct=de(Qe,V);return Math.max(0,St-Ct)})(),ut=fe?bt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,Jt,Tt,Ft;return(Ft=(Tt=(Jt=J?.innerHeight)!=null?Jt:(Ct=K?.documentElement)==null?void 0:Ct.clientHeight)!=null?Tt:V.clientHeight)!=null?Ft:0}):bt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),xt=xm(ct+.5*Math.max(0,ut));return Po.value=As(xt,0,Math.max(0,nt.value.length-1)),void al()}const He=Math.round((Be+$e)/2);!x&&Math.abs(He-Po.value)<=1||(Po.value=As(He,0,Math.max(0,nt.value.length-1)),al())}}),{visibleNodeIndices:Kh,nodeVisibilityHandles:Jl,nodeVisibilityWatchStops:kd,nodeVisibilityFallbackTimers:Fy,clearVisibilityFallback:bd,markNodeVisible:dr,cleanupNodeVisibility:E4,destroyNodeVisibilityState:Gh}=MV({isClient:be,shouldTrackVisibleNodeIndices:()=>ar.value,shouldCleanupNodeVisibility:()=>pt.value,onNodeMarkedVisible:x=>{pt.value?yi():Po.value=As(x,0,Math.max(0,nt.value.length-1))},onNodeVisibilityCleaned:x=>{dt.delete(x)&&hk()}}),{cleanupScrollListener:Hy,setupScrollListener:I4}=(function(x){const{isClient:B,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:J,resolveScrollContainer:fe,scheduleFocusSync:ve,onScroll:we}=x;let Pe=null,Me=null;function We(){Pe&&(Pe(),Pe=null),Me=null,J.value=null}function Be($e){const He=x.getScrollTop?x.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:We,setupScrollListener:function(){if(!B)return;if(!(($e=K?.value)!=null?$e:V.value))return void We();var $e;const He=fe();if(!He)return void We();if(J.value===He&&Pe)return;We(),Me=Be(He);const Qe=()=>{if(we?.(),V.value){const Ze=(function(St){const ct=Be(St),ut=Me;Me=ct;const xt=Math.max(480,.75*(St.clientHeight||0));return ut==null?ct>xt?{immediate:!0}:void 0:Math.abs(ct-ut)>xt?{immediate:!0}:void 0})(He);Ze?ve(Ze):ve()}};He.addEventListener("scroll",Qe,{passive:!0}),J.value=He,Pe=()=>{He.removeEventListener("scroll",Qe)}}}})({isClient:be,virtualizationEnabled:pt,listenerEnabled:$y,scrollRootElement:Ue,resolveScrollContainer:ee,scheduleFocusSync:yi,onScroll:function(){const x=tt.value;if(!x)return;const B=_c();if(!B||(function(K){if(Tc()>=Bt)return Zt=null,!1;const J=Zt;if(J==null)return!0;const fe=Math.abs(K.scrollTop-J)<=2;return fe||(Zt=null),fe})(B))return;const V=tk(B);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,x.distanceFromBottomPx))>32)&&ia("restore"):ia("restore")},getScrollTop:x=>{var B;const V=x.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,K=x===V.documentElement||x===V.body||x===V.scrollingElement;return bt("scrollListener.getScrollTop",()=>Y(x,V,K))}});function As(x,B,V){return Math.min(Math.max(x,B),V)}function Yh(x){return x?.firstElementChild}function Wy(x,B){var V;return x?(V=x.matches)!=null&&V.call(x,B)?x:x.querySelector(B):null}function zy(){if(!Qt.value)return void(X.value=0);const x=bt("updateExperimentContainerWidth.clientWidth",()=>{var B,V;return(V=(B=S.value)==null?void 0:B.clientWidth)!=null?V:0});X.value=x>0?x:0}let kc=null;function Xh(){kc?.disconnect(),kc=null}const Uy=Mi({loader:()=>qn(null,null,function*(){return(yield lo(()=>import("./index8-Dirigide.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:UM,delay:0,suspensible:!1});function qy(x){return x===Uy}const jy=W(()=>u.value==="pre"?_o:u.value==="shiki"?Uy:Lg),ul=W(()=>{const x=nt.value;if(!x.length||!Qt.value)return x.map(()=>null);const B=X.value||bt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(B)||B<=0?x.map(()=>null):x.map((V,K)=>{const J=Cs[K],fe=typeof J=="number"&&J>0;if(ei.value&&!fe){const we=YM(V,B,ue.value);if(we)return we}if(No.value&&V.type==="code_block"){const we=(function(Pe){if(Pe.type!=="code_block")return null;const Me=Tk(Pe,Md(Pe));return qy(Me)?"markdown":Me===_o?"pre":Me===jy.value||Me===Lg?"monaco":null})(V);if(we==="monaco"||we==="markdown"||we==="pre")return pV(V,{rendererKind:we,monacoOptions:k.codeBlockMonacoOptions,showHeader:((ve=k.codeBlockProps)==null?void 0:ve.showHeader)!==!1})}var ve;return null})});function _d(x){var B;const V=Cs[x];if(Number.isFinite(V)&&V>0)return V;const K=(B=ul.value[x])==null?void 0:B.height;return Number.isFinite(K)&&K>0?K:Math.max(mi.value,(function(J){var fe,ve,we,Pe,Me,We,Be,$e,He,Qe,Ze,St,ct;const ut=nt.value[J];if(!ut||typeof ut!="object")return 32;const xt=String((fe=ut.type)!=null?fe:""),Ct=et()||640;switch(xt){case"heading":return 44;case"paragraph":return ea(String((we=(ve=ut.raw)!=null?ve:ut.content)!=null?we:""),Ct,34);case"list":{const Jt=Array.isArray(ut.items)?ut.items.length:1;return Math.max(48,30*Jt+12)}case"list_item":return ea(String((Me=(Pe=ut.raw)!=null?Pe:ut.content)!=null?Me:""),Ct,34);case"blockquote":return ea(String((Be=(We=ut.raw)!=null?We:ut.content)!=null?Be:""),Ct,56);case"table":{const Jt=Array.isArray(ut.rows)?ut.rows.length:Array.isArray(ut.children)?ut.children.length:3;return Math.max(120,38*Jt+48)}case"code_block":return ea(String((He=($e=ut.code)!=null?$e:ut.raw)!=null?He:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ea(String((Ze=(Qe=ut.raw)!=null?Qe:ut.content)!=null?Ze:""),Ct,96);case"thematic_break":return 24;default:return ea(String((ct=(St=ut.raw)!=null?St:ut.content)!=null?ct:""),Ct,40)}})(x))}function ea(x,B,V,K=22){const J=String(x??"");if(!J)return V;const fe=Math.max(18,Math.floor(Math.max(320,B)/8)),ve=J.split(/\r?\n/).length,we=Math.ceil(J.length/fe),Pe=Math.max(1,ve,we);return Math.max(V,Math.ceil(Pe*K+12))}function bc(x){const B=Number(x);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function Qh(){var x,B;const V=nt.value.length,K=bc(X.value||bt("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=S.value)==null?void 0:we.clientWidth)||0})),J=((x=s.virtualScroll)==null?void 0:x.measurementKey)==null?"":String(s.virtualScroll.measurementKey),fe=[V,Js.count,Math.round(Js.total),Math.round(100*mi.value),J,K,Qt.value?1:0,tS.value,Q.value].join(":");if(!jh&&Ry===fe)return Py;const ve=new Array(V+1);ve[0]=0;for(let we=0;we<V;we++)ve[we+1]=ve[we]+(Qt.value?_d(we):(B=Cs[we])!=null?B:mi.value);return Py=ve,Ry=fe,jh=!1,ve}function Vy(x){var B,V;const K=nt.value.length;if(K<=0||x<=0)return 0;const J=Qh();if(x>=((B=J[K])!=null?B:0))return K-1;let fe=0,ve=K-1,we=K-1;for(;fe<=ve;){const Pe=fe+ve>>1;((V=J[Pe+1])!=null?V:0)>=x?(we=Pe,ve=Pe-1):fe=Pe+1}return we}function fr(x,B){var V,K;if(x>=B)return 0;if(Qt.value)return(function(ve,we){var Pe,Me;const We=nt.value.length,Be=As(Math.trunc(ve),0,We),$e=As(Math.trunc(we),Be,We);if(Be>=$e)return 0;const He=Qh();return((Pe=He[$e])!=null?Pe:0)-((Me=He[Be])!=null?Me:0)})(x,B);if(vc.value!==nt.value.length){let ve=0;for(let we=x;we<B;we++)ve+=(V=Cs[we])!=null?V:mi.value;return ve}const J=Wh.value,fe=zh.value;if(!J.length||!fe.length){let ve=0;for(let we=x;we<B;we++)ve+=(K=Cs[we])!=null?K:mi.value;return ve}return pd(J,x,B)+(B-x-pd(fe,x,B))*mi.value}Ye(()=>nt.value.length,x=>{Ro(),x<=0?hd():(x<vc.value&&S4(x),x!==vc.value&&fd(x))},{immediate:!0});const $4=W(()=>{if(!pt.value)return nt.value.map((K,J)=>({node:K,index:J}));const x=nt.value.length,B=As(xs.start,0,x),V=As(xs.end,B,x);return nt.value.slice(B,V).map((K,J)=>({node:K,index:B+J}))}),Zh=W(()=>pt.value?fr(0,Math.min(xs.start,nt.value.length)):0),Jh=W(()=>{if(!pt.value)return 0;const x=nt.value.length;return fr(Math.min(xs.end,x),x)});function Ky(){if(!Qt.value)return 0;let x=0;const B=ul.value;for(let V=0;V<B.length;V++){if(!B[V])continue;const K=Cs[V];Number.isFinite(K)&&K>0||x++}return x}function Gy(){const x=nt.value.length;return{totalNodes:x,measuredCount:Js.count,estimatedCount:Ky(),averageNodeHeight:mi.value,topSpacerHeight:Zh.value,bottomSpacerHeight:Jh.value,estimatedTotalHeight:fr(0,x),width:dl()}}function N4(){const x=nt.value,B=Gy();return Lt(rt({},B),{probe:{paragraphReady:!!ue.value.paragraph,listItemReady:!!ue.value.listItem,listWrapperOverhead:ue.value.listWrapperOverhead,headingReadyLevels:Object.entries(ue.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:x.map((V,K)=>{var J,fe,ve,we,Pe,Me,We,Be,$e;return{index:K,type:V.type,estimateKind:(fe=(J=ul.value[K])==null?void 0:J.kind)!=null?fe:null,rendererKind:(we=(ve=ul.value[K])==null?void 0:ve.rendererKind)!=null?we:null,estimatedHeight:(Me=(Pe=ul.value[K])==null?void 0:Pe.height)!=null?Me:null,estimatedContentHeight:(Be=(We=ul.value[K])==null?void 0:We.contentHeight)!=null?Be:null,measuredHeight:($e=Cs[K])!=null?$e:null}})})}function em(){return s.indexKey!=null?String(s.indexKey):An.value?`virtual-${Dn()}`:"markdown-renderer"}function Yy(x){const B=String(x),V=`${em()}-`;if(!B.startsWith(V))return null;const K=B.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const J=Number(K[1]);return!Number.isInteger(J)||J<0||J>=nt.value.length?null:J}function Dn(){var x,B,V;const K=(x=s.virtualScroll)==null?void 0:x.sessionKey;return String(K!=null&&K!==""?K:(V=(B=s.indexKey)!=null?B:k.customId)!=null?V:Kt)}function ds(){var x;const B=(x=s.virtualScroll)==null?void 0:x.threadKey;return B==null||B===""?void 0:String(B)}function tm(x){var B;return(x??"")===((B=ds())!=null?B:"")}function L4(){var x;const B=(x=s.virtualScroll)==null?void 0:x.measurementKey;return B==null?"":String(B)}function O4(){var x,B;const V=u.value,K=V==="monaco"?k.codeBlockMonacoOptions:void 0,J=k.codeBlockProps,fe=V==="shiki";return[k.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",ys(k.codeBlockMinWidth),ys(k.codeBlockMaxWidth),...fe?[Mp((x=J?.themes)!=null?x:k.themes,(B=J?.langs)!=null?B:k.langs)]:[],ys(K?.fontSize),ys(K?.lineHeight),ys(K?.fontFamily),ys(K?.tabSize),ys(K?.MAX_HEIGHT),ys(K?.wordWrap),ys(K?.wrappingIndent),ys(K?.padding),ys(J?.showHeader),ys(J?.showCopyButton),ys(J?.showExpandButton),ys(J?.showPreviewButton),ys(J?.showCollapseButton),ys(J?.showFontSizeButtons)].join("\0")}function Ni(){return[L4(),O4()].join("\0")}function dl(){return et()}const wd=W(()=>bc(dl())),ko=W(()=>[Ni(),wd.value].join("\0")),P4=W(()=>{var x;return An.value?["virtual",(x=ds())!=null?x:"",Dn(),ko.value].join("\0"):s.indexKey});function ta(){Oy.value+=1}function nm(x){return!(!x||!Number.isInteger(x.index)||x.index<0||x.index>=nt.value.length||x.sessionKey!==Dn()||x.threadKey!==ds()||x.layoutEpochKey!==ko.value)}function Xy(x){const B=String(x),V=vi.get(B);return V?nm(V)?V.index:null:Yy(B)}function Qy(x="async-node"){(vo.size||vi.size)&&(vo.clear(),vi.clear(),ta(),Mn(x))}const na=qt(n1,null),sm={reportHeight(x,B){if(!It.value)return;const V=Xy(x);if(V==null)return;const K=gi.get(V);if(!K)return;const J=Number(B),fe=My(V,K);Ty(V,Number.isFinite(J)&&J>0?Math.max(J,fe||0):fe)},markPending(x){if(!It.value)return;const B=Yy(x);B!=null&&(function(V,K){var J;const fe=vi.get(V);if(fe&&nm(fe))return vo.set(V,Math.max(0,(J=vo.get(V))!=null?J:0)+1),ta(),void Mn("async-node");vo.set(V,1),vi.set(V,(function(ve){return{index:ve,sessionKey:Dn(),threadKey:ds(),layoutEpochKey:ko.value}})(K)),ta(),Mn("async-node")})(String(x),B)},markSettled(x){if(!It.value)return;const B=String(x),V=Xy(x);(V!=null||(function(K){return vo.has(String(K))})(B))&&(function(K){var J;const fe=(J=vo.get(K))!=null?J:0;return!(fe<=0||(fe<=1?(vo.delete(K),vi.delete(K)):vo.set(K,fe-1),ta(),fe===1&&Mn("async-node"),0))})(B)&&V!=null&&Li()}};function R4(){let x=0;for(const B of gi.values())x+=bt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=B?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,x))}On(n1,{reportHeight(x,B){sm.reportHeight(x,B),na?.reportHeight(x,B)},markPending(x){sm.markPending(x),na?.markPending(x)},markSettled(x){sm.markSettled(x),na?.markSettled(x)}});let om,im=null,sa=null;function Sd(x){return x!==!1&&x!=null&&x!==""}function Zy(){return pt.value?(function(){if(!pt.value)return!0;const x=nt.value.length,B=As(xs.start,0,x),V=As(xs.end,B,x);if(B>=V)return!0;for(let K=B;K<V;K++)if(!dt.has(K)||Am(K)&&!gi.has(K))return!1;return!0})():vs.value>=gd.value}function rm(){return j.value===!0&&!G.value&&qh.value===0&&ur.size===0&&$i.size===0&&yo==null&&Zy()}function Jy(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.settleMode)!=="manual"||im===Dn()&&om===ds())return!0;const V=(B=s.virtualScroll)==null?void 0:B.settledToken;return!!Sd(V)&&sa===Oc(V)}function lm(){return rm()&&Jy()}function D4(x,B){return B.totalNodes<=0?x==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?x==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function fl(x="manual",B){const V=Gy(),K=(function(J){return J||(j.value!==!0?nt.value.length>0?"streaming":"estimating":!Zy()||$i.size>0||yo!=null?"measuring":lm()?"settled":"settling")})(B);return{sessionKey:Dn(),threadKey:ds(),phase:K,nodeCount:V.totalNodes,liveRange:{start:xs.start,end:xs.end},renderedCount:vs.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:R4(),totalHeight:ek(),width:V.width,final:j.value===!0,stable:lm(),confidence:D4(K,V),reason:x}}function _c(){const x=Ue.value||ee(),B=S.value;if(!x||!B)return null;const V=x.ownerDocument||B.ownerDocument||document,K=x===V.documentElement||x===V.body||x===V.scrollingElement,J=bt("getScrollBox.scrollTop",()=>Y(x,V,K)),fe=bt("getScrollBox.scrollHeight",()=>{var we,Pe,Me,We,Be;return K?Math.max((Pe=(we=V.documentElement)==null?void 0:we.scrollHeight)!=null?Pe:0,(We=(Me=V.body)==null?void 0:Me.scrollHeight)!=null?We:0,(Be=x.scrollHeight)!=null?Be:0):x.scrollHeight}),ve=bt("getScrollBox.clientHeight",()=>{var we;return K?((we=V.documentElement)==null?void 0:we.clientHeight)||x.clientHeight||0:x.clientHeight});return{root:x,doc:V,isViewportRoot:K,scrollTop:J,scrollHeight:fe,clientHeight:ve}}function ek(){const x=nt.value.length,B=Math.max(0,fr(0,x)),V=bt("getRendererLogicalHeight.offsetHeight",()=>{var J,fe;return(fe=(J=S.value)==null?void 0:J.offsetHeight)!=null?fe:0}),K=Math.max(0,V>0?V:bt("getRendererLogicalHeight.scrollHeight",()=>{var J,fe;return(fe=(J=S.value)==null?void 0:J.scrollHeight)!=null?fe:0}));return x<=0?Math.ceil(V):pt.value?B>0?Math.max(1,Math.ceil(B),(function(){let J=Zh.value+Jh.value;for(const fe of dt.values())fe&&(J+=Math.max(0,bt("getVirtualizedDomLogicalHeight.offsetHeight",()=>fe.offsetHeight||0)));return Math.ceil(Math.max(0,J))})(),(function(J,fe){return J<=0||fe<=0?0:fe<=J+Math.max(512,.05*J)?Math.ceil(fe):0})(B,K)):Math.max(1,Math.ceil(K)):It.value?B>0||Js.count>0||Ky()>0?(ni.value&&vs.value,Math.max(1,Math.ceil(K),Math.ceil(B))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(B))}function tk(x){const B=S.value;if(!B)return null;const V=bt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(J){return J.isViewportRoot?J.clientHeight:bt("getViewportBottomInRoot.getBoundingClientRect",()=>J.root.getBoundingClientRect().bottom)})(x)-V.bottom}function B4(x={}){const B=x.requireViewport!==!1,V=(function(fe=64){const ve=_c(),we=S.value;if(!ve||!we)return!1;const Pe=(function(We){if(We.isViewportRoot)return{top:0,bottom:We.clientHeight};const Be=bt("getVirtualViewportRect.getBoundingClientRect",()=>We.root.getBoundingClientRect());return{top:Be.top,bottom:Be.bottom}})(ve),Me=bt("isRendererNearVirtualViewport.getBoundingClientRect",()=>we.getBoundingClientRect());return Me.bottom>=Pe.top-fe&&Me.top<=Pe.bottom+fe})();if(B&&!V)return null;const K=(function(){const fe=_c(),ve=S.value;if(!fe||!ve||Math.max(0,fe.scrollHeight-fe.scrollTop-fe.clientHeight)>64)return null;const we=tk(fe);return we==null?null:we>=-8&&we<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,we)}:null})();if(K)return{anchor:K,captured:!0};const J=ws();if(J)return{anchor:{type:"node",nodeIndex:J.nodeIndex,offsetWithinNodePx:J.offsetWithinNodePx},captured:V};if(x.allowFallback===!0){const fe=(function(){const ve=nt.value.length;return ve<=0?null:{type:"node",nodeIndex:As(Po.value,0,Math.max(0,ve-1)),offsetWithinNodePx:0}})();return fe?{anchor:fe,captured:!1}:null}return null}function am(x){let B=2166136261;for(let V=0;V<x.length;V++)B^=x.charCodeAt(V),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function F4(x,B){let V=x;for(let K=0;K<B.length;K++)V^=B.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const H4=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Cd(x,B=new WeakSet,V=0){if(x==null||typeof x=="number"||typeof x=="boolean")return String(x);if(typeof x=="string")return`s:${(function(K){const J=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${am(J)}`})(x)}`;if(typeof x=="function")return"fn";if(typeof x!="object")return typeof x;if(B.has(x))return"cycle";if(V>=6)return"max-depth";B.add(x);try{if(Array.isArray(x)){if(x.length<=160){const Me=[];for(let We=0;We<x.length;We++)Me.push(Cd(x[We],B,V+1));return`a:${x.length}:${Me.join(",")}`}const fe=[],ve=[],we=Math.max(0,x.length-32);let Pe=2166136261;for(let Me=0;Me<x.length;Me++){const We=Cd(x[Me],B,V+1);Pe=F4(Pe,We),Me<32&&fe.push(We),Me>=we&&ve.push(We)}return[`a:${x.length}`,`h=${fe.join(",")}`,`t=${ve.join(",")}`,`all=${(Pe>>>0).toString(36)}`].join(":")}const K=x,J=Object.keys(K).filter(fe=>{const ve=K[fe];return fe!=="parent"&&fe!=="el"&&fe!=="component"&&(ve==null||typeof ve=="string"||typeof ve=="number"||typeof ve=="boolean"||H4.has(fe))}).sort();return`o:${J.length}:${J.map(fe=>`${fe}=${Cd(K[fe],B,V+1)}`).join(";")}`}finally{B.delete(x)}}let nk=-1,cm="";function wc(x){const B=nt.value[x];return B?am(Cd(B)):""}function um(){const x=Q.value;if(nk===x)return cm;let B=2166136261;for(let V=0;V<nt.value.length;V++){const K=wc(V);for(let J=0;J<K.length;J++)B^=K.charCodeAt(J),B=Math.imul(B,16777619)}return cm=(B>>>0).toString(36),nk=x,cm}function oa(x,B={}){var V;const K=B.includeHeightCache===!0,J=(V=B.includeContentHash)!=null?V:K,fe=K?(function(we){const Pe=(function(){var Ze,St;const ct=Number((St=(Ze=s.virtualScroll)==null?void 0:Ze.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(Pe)||we.length<=Pe)return we;const Me=new Map,We=Ze=>{!Ze||Me.size>=Pe||Me.set(Ze.index,Ze)},Be=nt.value.length,$e=As(xs.start-2*yc.value,0,Be),He=As(xs.end+2*yc.value,$e,Be);for(const Ze of we)Ze.index>=$e&&Ze.index<He&&We(Ze);const Qe=Math.max(1,Math.ceil(we.length/Pe));for(let Ze=0;Ze<we.length&&Me.size<Pe;Ze+=Qe)We(we[Ze]);for(let Ze=we.length-1;Ze>=0&&Me.size<Pe;Ze-=Qe)We(we[Ze]);return Array.from(Me.values()).sort((Ze,St)=>Ze.index-St.index).slice(0,Pe)})(A4().map(we=>{var Pe;const Me=nt.value[we.index];return Me?Lt(rt({},we),{nodeType:String((Pe=Me.type)!=null?Pe:""),signature:wc(we.index)}):null}).filter(we=>!!we)):[],ve=B4({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ve||fe.length||B.includeEmptyState===!0?Lt(rt({sessionKey:x.sessionKey,threadKey:x.threadKey},ve?{anchor:ve.anchor,anchorCaptured:ve.captured}:{anchorCaptured:!1}),{metrics:x,width:x.width,contentHash:J?um():void 0,measurementKey:Ni()||void 0,heightCache:fe.length?fe:void 0}):null}function dm(x){var B,V;const K=_c();if(!K)return;const J=(function(we){const Pe=S.value;if(!Pe)return null;const Me=de(Pe,we.root),We=nt.value.length,Be=bt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Pe.offsetHeight||0),$e=Math.max(0,Be>0?Be:We>0?bt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Pe.scrollHeight||0):0),He=ek();return Me+Math.max($e,He)})(K);if(J==null)return;const fe=Math.max(0,x.distanceFromBottomPx),ve=Math.max(0,J-K.clientHeight-fe);(function(we){Bt=Tc()+120,Zt=we})(ve),K.isViewportRoot?(V=(B=K.doc.defaultView)==null?void 0:B.scrollTo)==null||V.call(B,0,ve):iS(K.root,K.doc,ve,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:Y})}const fm=[];function sk(){if(be)for(at!=null&&(Re?.(at),at=null);fm.length;){const x=fm.pop();x!=null&&window.clearTimeout(x)}}function ia(x){const B=!!tt.value;tt.value=null,Bt=0,Zt=null,sk(),B&&x&&Mn(x)}function ra(){if(!tt.value||!be||at!=null)return;const x=()=>{at=null;const B=tt.value;B&&dm(B)};at=_e?_e(x):null,at==null&&x()}function ok(x,B={}){const V=nt.value.length;return V<=0?[]:x.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(B.requireSignature&&!K.signature)&&!(B.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(J){var fe;const ve=nt.value[J.index];return!(!ve||J.nodeType&&J.nodeType!==String((fe=ve.type)!=null?fe:"")||J.signature&&J.signature!==wc(J.index))})(K))}function ik(x){const B=bc(dl()),V=bc(x);return B!==-1&&V!==-1&&B===V}function pm(x){var B;const V=Number(x?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((B=x?.metrics)==null?void 0:B.width);return Number.isFinite(K)&&K>0?K:null}function rk(x){var B;return x.sessionKey===Dn()&&!!tm(x.threadKey)&&((B=x.measurementKey)!=null?B:"")===Ni()&&!!ik(pm(x))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(lk(V)?K.some(J=>!!(J.nodeType||J.signature)):K.some(J=>!!J.signature))})(x)}function lk(x){return!!(x.contentHash&&x.contentHash===um())}function W4(x){return!lk(x)}let pl=null,hl=null,xd=null,Sc=null,Cc=null;function hm(x){var B;const V=x.map(J=>{var fe,ve;return[J.index,Math.round(10*J.height),(fe=J.nodeType)!=null?fe:"",(ve=J.signature)!=null?ve:""].join("")}).join(""),K=bc(dl());return[(B=ds())!=null?B:"",Dn(),Ni(),nt.value.length,K,x.length,am(V)].join(":")}function ak(x=(B=>(B=s.virtualScroll)==null?void 0:B.heightCache)()){if(!It.value||!x?.length||nt.value.length<=0||!ik((B=s.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const V=ok(x,{requireSignature:!0});if(!V.length)return!1;const K=hm(V);return K===pl?(hl="standalone",!0):(Ey(V,{mode:"merge"}),Ro(),pl=K,hl="standalone",Ec(),Mn("restore"),!0)}function mm(x,B={}){var V,K,J;if(!It.value||!x||x.sessionKey!==Dn()||!tm(x.threadKey)||nt.value.length<=0)return!1;const fe=!!((V=x.heightCache)!=null&&V.length)&&!Ad(),ve=!x.anchor||x.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:x.anchor,we=B.restoreAnchor===!0&&!!ve&&!Ad()&&Number(pm(x))>0;let Pe=!1;if((K=x.heightCache)!=null&&K.length&&rk(x)){const We=ok(x.heightCache,{requireCompatibilityMetadata:!x.contentHash,requireSignature:W4(x)});We.length&&(Ey(We,{mode:"merge"}),Ro(),pl=hm(We),hl="restore",Ec(),Pe=!0)}if(fe||we)return!1;if(!B.restoreAnchor||!ve)return Pe&&Mn("restore"),!0;const Me=(function(We,Be){var $e;const He=We.anchor,Qe=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[($e=ds())!=null?$e:"",Dn(),Ni(),wd.value,Be,Qe].join(":")})(x,(J=B.restoreToken)!=null?J:"imperative");return xd===Me?(Pe&&Mn("restore"),!0):(xd=Me,(function(We){const Be=()=>{if(We.type==="node")return ia(),void Ss({nodeIndex:We.nodeIndex,offsetWithinNodePx:We.offsetWithinNodePx});if(ns(),Ht.value=null,tt.value=We,sk(),dm(We),be)for(const $e of[0,120,280,480])fm.push(window.setTimeout(()=>{const He=tt.value;He&&dm(He)},$e))};(function($e){if(!pt.value)return!1;const He=nt.value.length;return!(He<=0||(Po.value=$e.type==="node"?As($e.nodeIndex,0,He-1):He-1,al(),0))})(We)?gt(Be):Be()})(ve),Mn("restore"),!0)}function Ad(){const x=dl();return Number.isFinite(x)&&x>0}function ck(x){var B;return x.sessionKey===Dn()&&!!tm(x.threadKey)&&(nt.value.length<=0||!(!((B=x.heightCache)!=null&&B.length)||Ad())||!(!(x.anchor&&Number(pm(x))>0)||Ad()))}function gm(){se.clear();for(const x of Object.keys(Cs)){const B=Number(x);Number.isInteger(B)&&B>=0&&B<nt.value.length&&Ay(B)}}function xc(){yo!=null&&(Re?.(yo),yo=null),Tm()}function uk(){return!be||zt?Promise.resolve():new Promise(x=>{let B=!1,V=null;const K=()=>{B||(B=!0,V!=null&&window.clearTimeout(V),x())};if(_e)return _e(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function vm(x,B=ds(),V=ko.value){return Dn()===x&&ds()===B&&ko.value===V}function ym(){return qn(this,arguments,function*(x={}){var B,V,K,J,fe;const ve=Dn(),we=ds(),Pe=ko.value,Me=(B=x.frames)!=null?B:2,We=(V=x.timeoutMs)!=null?V:120,Be=(K=x.reason)!=null?K:"manual",$e=x.expectedSettledTokenKey,He=x.flushPendingTimers===!0,Qe=fl(Be),Ze=()=>Lt(rt({},Qe),{phase:Qe.final?"settling":Qe.phase,stable:!1,confidence:Qe.confidence==="final"?"mixed":Qe.confidence,reason:Be}),St=()=>vm(ve,we,Pe)&&($e==null||Mc()===$e);for(let Ct=0;Ct<Me;Ct++){if(yield gt(),!St()||(yield uk(),!St()))return Ze();Li(),xc()}if(yield(function(Ct){return!be||Ct<=0?Promise.resolve():new Promise(Jt=>window.setTimeout(Jt,Ct))})(We),!St()||(He&&By(),Li(),xc(),!St()))return Ze();const ct=rm();ct&&(im=ve,om=we,((J=s.virtualScroll)==null?void 0:J.settleMode)==="manual"&&$e!=null&&Sd((fe=s.virtualScroll)==null?void 0:fe.settledToken)&&Mc()===$e&&(sa=Oc(s.virtualScroll.settledToken)));const ut=St()&&ct&&Jy(),xt=fl(Be,ut?"final":void 0);return Sm(xt,!0),xt})}let km="content",ml=null,gl=null,bm=0,Ac=null,la=null,_m=null,wm=null;function Tc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function dk(x){var B,V;const K=Ac;if(!K)return!0;const J=(V=(B=s.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?V:1;return Math.abs(x.totalHeight-K.totalHeight)>J||x.sessionKey!==K.sessionKey||x.phase!==K.phase||x.stable!==K.stable||x.final!==K.final||x.threadKey!==K.threadKey||x.nodeCount!==K.nodeCount||x.measuredCount!==K.measuredCount||x.width!==K.width}function ys(x){if(x==null)return"";if(typeof x=="string"||typeof x=="number"||typeof x=="boolean")return String(x);try{return JSON.stringify(x)}catch{return String(x)}}function Mc(x=(B=>(B=s.virtualScroll)==null?void 0:B.settledToken)()){return ys(x)}function fk(x,B){var V,K;return[x,B.sessionKey,(V=B.threadKey)!=null?V:"",Ni(),um(),ys((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Ec(){_m=null,wm=null,la=null}function z4(x){const B=x.heightCache;return B?.length?hm(B):""}function Ic(x){var B,V,K;const J=x.metrics,fe=x.anchor?(ve=x.anchor).type==="bottom"?`bottom:${Math.round(ve.distanceFromBottomPx)}`:`node:${ve.nodeIndex}:${Math.round(ve.offsetWithinNodePx)}`:"none";var ve;return[x.sessionKey,(B=x.threadKey)!=null?B:"",(V=x.measurementKey)!=null?V:Ni(),(K=x.contentHash)!=null?K:"",z4(x),fe,x.anchorCaptured?1:0,J.liveRange.start,J.liveRange.end,J.renderedCount,J.nodeCount,Math.round(J.totalHeight),Math.round(J.width),J.phase,J.stable?1:0].join("\0")}function Sm(x,B=!1){if(!It.value||(function(ve=!1){return!ve&&An.value&&!Tn.value})(B))return;const V=B||dk(x),K=(function(ve,we=!1){return we||ve.stable||ve.phase==="final"?{state:oa(ve,{includeHeightCache:!0})}:{state:oa(ve)}})(x,B),J=K.state,fe=!!(J&&(V||(function(ve,we=!1){return!!we||Ic(ve)!==la})(J,B)));if(V&&(M(x),Ac=x,bm=Tc()),J&&fe&&(E(J),J.anchor&&O(J.anchor),la=Ic(J)),x.stable){const ve=fk("settled",x);if(ve!==_m){_m=ve;const we=oa(x,{includeHeightCache:!0});we&&(E(we),la=Ic(we)),(function(Pe){o("render-settled",Pe)})(x)}}if(x.phase==="final"){const ve=fk("final",x);if(ve!==wm){wm=ve;const we=oa(x,{includeHeightCache:!0});we&&(E(we),la=Ic(we)),(function(Pe){o("render-final",Pe)})(x)}}}function Cm(){ml!=null&&(Re?.(ml),ml=null),gl!=null&&be&&(window.clearTimeout(gl),gl=null)}function pk(){ml=null,gl=null,(function(x){if($i.size>0||yo!=null)return!0;switch(x){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(km)&&(Li(),xc()),Sm(fl(km))}function Mn(x){var B,V;if(!It.value||(km=x,ml!=null||gl!=null))return;const K=Math.max(0,(V=(B=s.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?V:32),J=Math.max(0,K-(Tc()-bm)),fe=()=>{gl=null,ml=_e?_e(pk):null,ml==null&&pk()};be&&J>0?gl=window.setTimeout(fe,J):fe()}function xm(x){var B;if(x<=0)return 0;const V=nt.value;if(Qt.value)return Vy(x);if(vc.value===V.length&&Wh.value.length&&zh.value.length){const J=mi.value,fe=Wh.value,ve=zh.value,we=Be=>Be<=0?0:pd(fe,0,Be)+(Be-pd(ve,0,Be))*J;let Pe=0,Me=V.length-1,We=V.length-1;for(;Pe<=Me;){const Be=Pe+Me>>1;we(Be+1)>=x?(We=Be,Me=Be-1):Pe=Be+1}return We}let K=x;for(let J=0;J<V.length;J++){const fe=(B=Cs[J])!=null?B:mi.value;if(K<=fe)return J;K-=fe}return Math.max(0,V.length-1)}function hk(){Se.value+=1}function Am(x){return!(ni.value&&x>=vs.value)&&(!ar.value||x<Wn.value||Kh.value.has(x))}function aa(x){const B=kd.get(x);B&&(B(),kd.delete(x));const V=Jl.get(x);V&&(V.destroy(),Jl.delete(x)),bd(x)}function mk(x,B){let V=!1;if(B){const fe=dt.get(x);dt.set(x,B),fe!==B&&(V=!0)}else dt.delete(x)&&(V=!0);if(V&&hk(),B||bd(x),!Iy.value||!Ie||!pt.value&&ar.value&&!z.value&&Jl.size>=640&&(z.value||(z.value=!0,Gh()),!Iy.value||!Ie))return aa(x),void(B&&dr(x,!0));if(x<Wn.value&&!pt.value||Kh.value.has(x))return aa(x),void dr(x,!0);if(!B)return void aa(x);aa(x);const K=Ie(B,{rootMargin:"400px"});if(!K)return;Jl.set(x,K),dr(x,K.isVisible.value),ar.value&&(function(fe){if(!be||!ar.value)return;bd(fe);const ve=fe%17*23,we=window.setTimeout(()=>{if(Fy.delete(fe),!ar.value||Kh.value.has(fe))return;const Pe=dt.get(fe);if(!Pe)return;const Me=ee(Pe),We=Pe.ownerDocument||document,Be=We.defaultView||window,$e=!Me||Me===We.documentElement||Me===We.body,He=!$e&&Me?bt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Me.getBoundingClientRect()):null,Qe=$e?0:He.top,Ze=$e?bt("nodeVisibilityFallback.clientHeight",()=>{var ct,ut;return(ut=(ct=Be.innerHeight)!=null?ct:Me?.clientHeight)!=null?ut:0}):He.bottom,St=bt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Pe.getBoundingClientRect());St.bottom>=Qe-500&&St.top<=Ze+500&&dr(fe,!0)},1800+ve);Fy.set(fe,we)})(x);let J=null;J=Ye(()=>K.isVisible.value,fe=>{if(fe){bd(x),dr(x,!0),J?.(),kd.delete(x),Jl.get(x)===K&&Jl.delete(x);try{K.destroy()}catch{}}},{immediate:!0}),kd.set(x,J),pt.value&&yi()}function Tm(){yo=null;for(const[x,B]of $i)$i.delete(x),gi.get(x)===B.el&&cl.get(x)===B.version&&Ty(x,B.height,{allowShrink:B.allowShrink})}function ca(){yo!=null&&(Re?.(yo),yo=null),$i.clear()}function Td(x,B){(function(V,K,J){var fe;if(!Number.isFinite(J)||J<=0||gi.get(V)!==K)return;const ve=cl.get(V);if(ve==null)return;const we=nt.value[V],Pe=G.value&&j.value!==!0&&!((fe=s.nodes)!=null&&fe.length)&&V>=nt.value.length-2,Me=!(we?.loading===!0||Pe),We=$i.get(V),Be=We?We.allowShrink&&Me:Me,$e=We&&!Be?Math.max(We.height,J):J;$i.set(V,{height:$e,allowShrink:Be,version:ve,el:K}),yo==null&&(yo=_e?_e(Tm):null,yo==null&&Tm())})(x,B,My(x,B))}function Li(){for(const[x,B]of gi)B&&Td(x,B)}function gk(){wn?.disconnect(),wn=null,pe.clear()}function Mm(){for(;md.length;)yd(md.pop())}Ye(Tn,x=>{x&&Mn("content")},{flush:"post"}),t({getVirtualMetrics:fl,captureVirtualState:function(x={}){var B;return oa(fl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:x.allowFallbackAnchor===!0,requireViewport:x.requireViewport===!0,includeEmptyState:(B=x.includeEmptyState)==null||B})},restoreVirtualState:function(x,B={}){const V=B.restoreAnchor===!0,K=B.restoreToken==null?"imperative":String(B.restoreToken);Sc=x,Cc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!mm(x,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&ck(x)||(Sc=null,Cc=null)},forceMeasure:function(x="manual"){return qn(this,null,function*(){yield gt(),yield uk(),Li(),xc(),yield gt();const B=fl(x);return Sm(B,!0),B})},settle:ym,scrollToNode:function(x,B="start"){ia(),ns();const V=nt.value.length;if(V<=0)return;const K=As(x,0,V-1),J=()=>{var fe;const ve=vn({nodeIndex:K,offsetWithinNodePx:0}),we=_d(K),Pe=_c(),Me=(fe=Pe?.clientHeight)!=null?fe:0,We=Lo();let Be=ve;if(B==="center")Be=ve-Me/2+we/2;else if(B==="end")Be=ve-Me+we;else if(B==="nearest"&&We!=null){if(ve>=We&&ve+we<=We+Me)return;Be=ve<We?ve:ve-Me+we}Oo(Math.max(0,Be)),yi({immediate:!0}),pt.value&&(Po.value=K,al())};if(pt.value)return Po.value=K,al(),void gt(J);J()}}),Ye(()=>ti.value,x=>{if(!x){gk();for(const B of cr.values())for(const V of B)yd(V);cr.clear(),cl.clear(),Mm(),ca()}},{immediate:!0}),Ye(j,x=>{x&&(function(){if(be&&j.value&&gi.size){Mm();for(const B of[80,240,640]){const V=Dy(B,()=>{for(const[K,J]of gi)J&&Td(K,J)},"final");V!=null&&md.push(V)}}})(),Mn(x?"final":"content")}),Ye([()=>nt.value.length,()=>vs.value],()=>{tt.value&&ra(),Mn("content")},{flush:"post",immediate:!0}),Ye([()=>xs.start,()=>xs.end],()=>{Mn("batch")},{flush:"post"});const{cleanupBatchScheduler:U4}=(function(x){const{props:B,isClient:V,isTestEnv:K,parsedNodesIdentity:J,parsedNodeCount:fe,desiredRenderedCount:ve,datasetKey:we,batchingEnabled:Pe,incrementalRenderingActive:Me,resolvedBatchSize:We,resolvedInitialBatch:Be,renderedCount:$e,adaptiveBatchSize:He,previousRenderContext:Qe,previousBatchConfig:Ze,requestFrame:St,cancelFrame:ct,hasIdleCallback:ut,cleanupNodeVisibility:xt,onDatasetKeyChanged:Ct,onDatasetChanged:Jt}=x;let Tt=null,Ft=null,Dt=!1,an=null,bo=null,zs=0,si=!1,pr=!1;const hr=new Set,yl=new Set;function Ok(){if(V){Tt!=null&&(ct?.(Tt),Tt=null),Ft!=null&&(window.clearTimeout(Ft),Ft=null),bo!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(bo),bo=null),zs+=1;for(const Os of hr)ct?.(Os);hr.clear();for(const Os of yl)window.clearTimeout(Os);yl.clear(),Dt=!1,an=null,si=!1,pr=!1}}function Od(){return typeof performance<"u"?performance.now():Date.now()}function Pk(Os){(function(Oi){var mr;if(!Me.value)return;const Pi=Math.max(2,(mr=B.renderBatchBudgetMs)!=null?mr:6),Ri=Math.max(1,We.value||1),oi=Math.max(1,Math.floor(Ri/4));Oi>1.2*Pi?He.value=Math.max(oi,Math.floor(.7*He.value)):Oi<.5*Pi&&He.value<Ri&&(He.value=Math.min(Ri,Math.ceil(1.2*He.value)))})(Os),si=!1;const eo=pr||$e.value<ve.value;pr=!1,eo&&Bk()}function Rk(Os,eo={}){var Oi,mr;if(!Me.value)return;const Pi=ve.value;if($e.value>=Pi)return;const Ri=Math.max(1,Os),oi=()=>{const fa=Od();let pa=0;Tt=null,Ft=null,bo=null,Dt=!1;const ha=an??Ri;an=null;const Rm=Od();$e.value=Math.min(Pi,$e.value+ha),xt($e.value),pa=Od()-Rm,(function(Dm,Fk){if(!V)return void Pk(Fk);si=!0;const Hk=++zs;gt().then(()=>{var Wk;if(Hk!==zs)return;const cE=Od(),uE=Math.max(Fk,cE-Dm),zk=()=>{Hk===zs&&Pk(uE)};if(St){let qk=!1,Di=null;const jk=()=>{qk||(qk=!0,zk())},Pd=St(()=>{hr.delete(Pd),Di!=null&&(window.clearTimeout(Di),yl.delete(Di),Di=null),jk()});return hr.add(Pd),Di=window.setTimeout(()=>{Di!=null&&yl.delete(Di),Di=null,ct?.(Pd),hr.delete(Pd),jk()},Math.max(32,(Wk=B.renderBatchIdleTimeoutMs)!=null?Wk:120)),void yl.add(Di)}const Uk=window.setTimeout(()=>{yl.delete(Uk),zk()},0);yl.add(Uk)})})(fa,pa)};if(!V||eo.immediate)return void oi();const gr=Math.max(0,(Oi=B.renderBatchDelay)!=null?Oi:16);if(an=an!=null?Math.max(an,Ri):Ri,!Dt){if(Dt=!0,!K&&ut&&window.requestIdleCallback){const fa=Math.max(0,(mr=B.renderBatchIdleTimeoutMs)!=null?mr:120);return void(bo=window.requestIdleCallback(()=>oi(),{timeout:fa}))}St&&!K?Tt=St(()=>{gr!==0?Ft=window.setTimeout(()=>oi(),gr):oi()}):Ft=window.setTimeout(()=>oi(),gr)}}function Dk(Os,eo={}){si?pr=!0:Os==null?Bk():Rk(Os,eo)}function Bk(){Me.value&&Rk(Pe.value?Math.max(1,Math.round(He.value)):Math.max(1,We.value))}return Ye([J,fe,we,Me,We,Be,()=>B.renderBatchDelay],()=>{var Os;const eo=fe.value,Oi=Qe.value,mr=we.value,Pi=!Object.is(mr,Oi.key),Ri=eo!==Oi.total,oi=Pi||Ri;Qe.value={key:mr,total:eo};const gr=Ze.value,fa=(Os=B.renderBatchDelay)!=null?Os:16,pa=gr.batchSize!==We.value||gr.initial!==Be.value||gr.delay!==fa||gr.enabled!==Me.value;Ze.value={batchSize:We.value,initial:Be.value,delay:fa,enabled:Me.value},Pi&&Ct(eo),(oi||pa||!Me.value)&&Ok(),(oi||pa)&&(He.value=Math.max(1,We.value||1)),oi&&Jt();const ha=ve.value;if(!eo)return $e.value=0,void xt(0);if(!Me.value)return $e.value=ha,void xt($e.value);const Rm=Pi||Oi.total===0;$e.value=Rm||pa?Math.min(ha,Be.value):Math.min($e.value,ha);const Dm=Math.max(1,Be.value||We.value||eo);$e.value<ha?Dk(Dm,{immediate:!V}):xt($e.value)},{immediate:!0}),Ye(ve,(Os,eo)=>{Me.value&&(typeof eo=="number"&&Os<=eo||Os>$e.value&&Dk())}),{cleanupBatchScheduler:Ok}})({props:k,isClient:be,isTestEnv:zt,parsedNodesIdentity:fn,parsedNodeCount:Gn,desiredRenderedCount:gd,datasetKey:P4,batchingEnabled:go,incrementalRenderingActive:ni,resolvedBatchSize:us,resolvedInitialBatch:Wn,renderedCount:vs,adaptiveBatchSize:ll,previousRenderContext:rl,previousBatchConfig:gc,requestFrame:_e,cancelFrame:Re,hasIdleCallback:ln,cleanupNodeVisibility:E4,onDatasetKeyChanged:x=>{ca(),hd(),Ro(),Ec(),x>0&&fd(x)},onDatasetChanged:()=>{pt.value&&yi({immediate:!0})}});Ye([$y,pt,()=>S.value,()=>me()],([x,B])=>{if(!x)return Hy(),void Vh();I4(),B?yi({immediate:!0}):Vh()},{flush:"post",immediate:!0}),Ye([()=>nt.value.length,()=>pt.value],x=>qn(null,[x],function*([B,V]){V&&B&&be&&(yield gt(),yi({immediate:!0}))}),{flush:"post"}),Ye(Qt,x=>{x&&(function(){var B;if(Rn.value&&gs.value&&Xe.value&&((B=Ge.value)!=null&&B[1]))return;const V=Rr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Rr({type:"list_item",children:[V],raw:"- Probe paragraph text"}),J=Rr({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});Rn.value=V,gs.value=K,Xe.value=J;const fe={1:null,2:null,3:null,4:null,5:null,6:null};for(let ve=1;ve<=6;ve++)fe[ve]=Rr({type:"heading",level:ve,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ve)} Probe heading`});Ge.value=fe})()},{immediate:!0}),Ye([()=>S.value,Qt],()=>{if(!Qt.value)return Xh(),void(X.value=0);zy(),Xh(),Qt.value&&S.value&&typeof ResizeObserver<"u"&&(kc=new ResizeObserver(()=>{zy(),Ht.value&&Ln(),tt.value&&ra(),Mn("resize")}),kc.observe(S.value))},{immediate:!0}),Ye([Qt,it,ko],()=>qn(null,null,function*(){if(!Qt.value)return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ro();yield gt(),(function(){if(!Qt.value||typeof window>"u")return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ro();const x={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=Wy(Yh(I.value),".paragraph-node");x.paragraph=Wg(I.value,B,"pre-wrap");const V=Yh(P.value),K=V?.querySelector(".paragraph-node");x.listItem=Wg(P.value,K,"pre-wrap");const J=bt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ve,we;return(we=(ve=D.value)==null?void 0:ve.offsetHeight)!=null?we:0}),fe=bt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ve,we;return(we=(ve=P.value)==null?void 0:ve.offsetHeight)!=null?we:0});x.listWrapperOverhead=Math.max(0,J-fe);for(let ve=1;ve<=6;ve++){const we=Wy(Yh(H[ve]),`h${ve}`);x.headings[ve]=Wg(H[ve],we,"pre-wrap")}ue.value=x,Ro()})()}),{flush:"post",immediate:!0}),Ye(()=>nt.value.length,()=>{pt.value&&yi({immediate:!0})}),Ye([Qt,X],()=>{Ro(),pt.value&&yi({immediate:!0}),Ht.value&&Ln(),tt.value&&ra(),Mn("resize")},{immediate:!1}),Ye(()=>ar.value,x=>{if(x)for(const[B,V]of dt)mk(B,V);else{Gh();for(const[B,V]of dt)V&&dr(B,!0)}},{immediate:!1}),Ye([()=>k.viewportPriority,()=>nt.value.length],([x,B])=>{x!==!1?z.value&&B<=200&&(z.value=!1):z.value=!1}),Ye(()=>vs.value,()=>{pt.value&&yi({immediate:!0})}),Ye([Po,lt,yc,()=>nt.value.length,pt],()=>{al()},{immediate:!0});let $c=null,Nc=!1,ua=null;function Lc(){$c=null,im=null,om=void 0,sa=null,Ec()}function Em(){ca(),hd(),Ro(),se.clear();const x=nt.value.length;x>0&&fd(x),gm()}function Im(){Cm(),By(),Ac=null,pl=null,hl=null,xd=null,Sc=null,Cc=null,Nc=!1,Lc(),Qy("restore"),ns(),ia()}function Oc(x){var B;return[(B=ds())!=null?B:"",Dn(),Ni(),wd.value,Mc(x),nt.value.length,Math.round(fr(0,nt.value.length)),Math.round(dl()),Js.count,Math.round(Js.total)].join(":")}function vk(){return qn(this,null,function*(){var x,B,V,K;const J=(x=s.virtualScroll)==null?void 0:x.settledToken,fe=Mc(J),ve=Dn(),we=ds(),Pe=ko.value;if(It.value&&((B=s.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Sd(J))if(rm()){if(Oc(J)!==sa&&!Nc){Nc=!0;try{const Me=yield ym({reason:"manual",expectedSettledTokenKey:fe}),We=Mc()===fe;vm(ve,we,Pe)&&Me.sessionKey===ve&&Me.threadKey===we&&We&&Me.stable&&Me.phase==="final"&&(sa=Oc((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{Nc=!1,yield gt();const Me=(K=s.virtualScroll)==null?void 0:K.settledToken,We=Sd(Me)?Oc(Me):"";vm(ve,we,Pe)&&We&&sa!==We&&vk()}}}else Mn("manual")})}Ye(It,(x,B)=>{if(x!==B){if(!x)return Im(),void Cm();Im(),Em(),ua=ko.value,Mn("content")}},{flush:"post"}),Ye([It,ko],([x,B])=>{x?ua!=null?ua!==B&&(ua=B,(function(V="resize"){ca(),hd(),Ro(),se.clear();const K=nt.value.length;K>0&&fd(K),gm(),pl=null,hl=null,xd=null,Ac=null,Nc=!1,Lc(),ak(),gt(()=>{Li(),Ht.value&&Ln(),tt.value&&ra(),Mn(V)})})("resize")):ua=B:ua=null},{flush:"post",immediate:!0}),Ye([It,()=>Dn(),()=>ds()],([x])=>{x&&(Im(),Em(),Qy("content"),Mn("content"))}),Ye([It,()=>Dn(),()=>ds(),ko,()=>nt.value.length],([x])=>{x&&(function(B="async-node"){let V=!1;for(const[K,J]of Array.from(vi.entries()))nm(J)||(vi.delete(K),vo.delete(K),V=!0);V&&(ta(),Mn(B))})("async-node")},{flush:"post"}),Ye([It,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.sessionKey},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>s.indexKey,()=>Q.value],([x])=>{x&&(Ec(),(function(B="content"){if(!It.value)return;const V=[],K=nt.value.length;for(const J of Array.from(se.keys())){if(J>=K){V.push(J);continue}const fe=wc(J),ve=se.get(J);ve!=null&&ve!==fe&&V.push(J),se.set(J,fe)}for(const J of Array.from(se.keys()))J>=K&&se.delete(J);V.length&&((function(J,fe={}){const ve=Array.from(J,Number);x4(ve,fe)>0&&(function(Pe){for(const Me of Pe)se.delete(Me)})(ve)})(V,{notify:!1}),Ro(),Lc(),Ht.value&&Ln(),tt.value&&ra(),Mn(B))})("content"))},{flush:"post",immediate:!0}),Ye([It,()=>nt.value.length,()=>Dn(),()=>ds()],([x,B,V,K],[J,fe,ve,we])=>{x&&J&&V===ve&&K===we&&B!==fe&&Lc()},{flush:"post"}),Ye([It,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCache},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCacheWidth},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>nt.value.length,()=>Dn(),X],()=>{ak()},{flush:"post",immediate:!0}),Ye([It,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreAnchor},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>nt.value.length,()=>Dn(),X],x=>qn(null,[x],function*([B,V]){if(!B||!V)return;yield gt();const K=(function(){var J;const fe=(J=s.virtualScroll)==null?void 0:J.restoreAnchor;return fe==null||fe===!1?null:fe===!0?"true":String(fe)})();mm(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ye([It,X,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey}],([x])=>{var B;if(!x)return;const V=(B=s.virtualScroll)==null?void 0:B.restoreState;V&&pl&&hl==="restore"&&(rk(V)||(Em(),pl=null,hl=null,Mn("resize")))},{flush:"post"}),Ye([It,()=>nt.value.length,()=>Dn(),X],x=>qn(null,[x],function*([B]){var V;const K=Sc,J=Cc;B&&K&&(yield gt(),!mm(K,{restoreAnchor:J?.restoreAnchor===!0,restoreToken:(V=J?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:J?.allowUncapturedAnchor===!0})&&ck(K)||(Sc=null,Cc=null))}),{flush:"post",immediate:!0}),Ye([It,j,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>Dn(),()=>ds(),ko,qh,Ly,()=>vs.value,gd,()=>Js.count,()=>Js.total],([x,B,V])=>{if(!x||B!==!0||V==="manual"||!lm())return;const K=(function(){var J;const fe=nt.value.length;return[(J=ds())!=null?J:"",Dn(),Ni(),wd.value,fe,Math.round(fr(0,fe)),Math.round(dl()),Js.count,Math.round(Js.total)].join(":")})();$c!==K&&($c=K,ym({reason:"final"}).then(J=>{J.stable||$c!==K||($c=null)}))},{flush:"post",immediate:!0}),Ye([It,j,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settledToken},()=>Dn(),()=>ds(),ko,qh,Ly,()=>vs.value,gd,()=>nt.value.length,()=>Js.count,()=>Js.total],()=>{vk()},{flush:"post",immediate:!0}),Ye([()=>nt.value.length,pt,lt,yc,()=>xs.start,()=>xs.end],([x,B,V,K,J,fe])=>{qe.value&&xe("virtualization",{nodes:x,virtualization:B,maxLiveNodes:V,buffer:K,focusIndex:Po.value,scroll:B?(()=>{const ve=Ue.value||ee();return ve?{reverse:q(ve),scrollTop:Math.round(ve.scrollTop),scrollTopAbs:Math.round(Math.abs(ve.scrollTop)),scrollHeight:Math.round(ve.scrollHeight),clientHeight:Math.round(ve.clientHeight)}:null})():null,liveRange:{start:J,end:fe},rendered:vs.value})}),Ye([()=>k.customId],([x],B,V)=>{if(!x||At)return;const K=(function(J,fe){return J?(fs.controllers[J]=fe,()=>{fs.controllers[J]===fe&&delete fs.controllers[J]}):()=>{}})(x,{captureRestoreAnchor:ws,restoreAnchor:Ss,getAnchorDrift:lr,getReport:N4});V(()=>{K()})},{immediate:!0}),ms(()=>{(function(){if(It.value)try{Li(),xc();const x=fl("manual");dk(x)&&(M(x),Ac=x,bm=Tc());const B=oa(x,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(E(B),B.anchor&&O(B.anchor),la=Ic(B))}catch{}})(),U4(),Gh(),Ee(),gk();for(const x of cr.values())for(const B of x)yd(B);cr.clear(),cl.clear(),se.clear(),Mm(),ca(),Xh(),ns(),ia(),Cm(),Hy(),Vh()});const q4=Mi({loader:()=>qn(null,null,function*(){try{return(yield lo(()=>import("./index11-tnZiF2AO.js"),__vite__mapDeps([6,3]))).default}catch(x){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".',x),_o}}),loadingComponent:LV,delay:0}),j4=Mi({loader:()=>qn(null,null,function*(){try{return(yield lo(()=>import("./index10-DRCxutuy.js"),[])).default}catch(x){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.',x),_o}}),loadingComponent:NV,delay:0}),V4=Mi(()=>qn(null,null,function*(){try{return(yield lo(()=>import("./index7-aHTOwsn3.js"),[])).default}catch(x){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".',x),_o}})),yk={text:Qn,paragraph:zl,heading:Np,code_block:Lg,list:Qa,list_item:Xa,blockquote:$f,table:ku,definition_list:Nf,footnote:Lf,footnote_reference:To,footnote_anchor:vu,admonition:Df,vmr_container:Pf,hardbreak:qr,link:Qs,image:Ur,thematic_break:Of,math_inline:fi,math_block:qM,strong:Ys,emphasis:Zs,strikethrough:Xs,highlight:Eo,insert:po,subscript:fo,superscript:uo,emoji:co,checkbox:Ao,checkbox_input:Ao,inline_code:Ws,html_inline:Mo,reference:Gs,html_block:yu},K4=W(()=>em()),kk=W(()=>oS(k.codeBlockProps)),G4=W(()=>oS(k.codeBlockProps,{omit:["langs"]})),bk=W(()=>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 Fe.value=="boolean"?{showTooltips:Fe.value}:{}),G4.value)),_k=W(()=>rt(Lt(rt({},bk.value),{langs:k.langs}),kk.value));function wk(x){return typeof x=="boolean"?x:void 0}const Y4=W(()=>{const x=k.codeBlockProps||{},B={},V=wk(x.showLineNumbers);V!==void 0&&(B.showLineNumbers=V);const K=wk(x.diffInline);K!==void 0&&(B.diffInline=K);const J=(function(fe){const ve=Number(fe);return Number.isFinite(ve)&&ve>0?ve:void 0})(x.reservedHeightPx);return J!==void 0&&(B.reservedHeightPx=J),B}),X4=W(()=>rt(rt({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),kk.value)),Q4=W(()=>rt({},k.mermaidProps||{})),Sk=W(()=>rt({},k.d2Props||{})),Z4=W(()=>rt({},k.infographicProps||{})),Pc=W(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:Hn.value.customHtmlTags})),J4=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltip:Fe.value}:{})),eE=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),tE=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),nE=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}));function sE(x){return Array.isArray(x.children)&&x.children.length>0}const $m=W(()=>$4.value.map(x=>{var B,V,K,J,fe,ve,we,Pe;let Me=(function(ct){var ut,xt,Ct,Jt,Tt,Ft,Dt;if(ct.type!=="code_block")return ct;const an=ct,bo=[String((ut=an.language)!=null?ut:""),String((xt=an.loading)!=null?xt:""),String((Ct=an.diff)!=null?Ct:""),String((Jt=an.code)!=null?Jt:""),String((Tt=an.originalCode)!=null?Tt:""),String((Ft=an.updatedCode)!=null?Ft:""),String((Dt=an.raw)!=null?Dt:"")].join("\0"),zs=dd.get(an);if(zs&&zs.signature===bo)return zs.node;const si=rt({},an);return dd.set(an,{signature:bo,node:si}),si})(x.node);const We=Md(Me);let Be=Tk(Me,We);if((Me.type==="html_block"||Me.type==="html_inline")&&Be===yk[Me.type]){const ct=Me,ut=String((B=ct.tag)!=null?B:"").trim().toLowerCase()||OT(ct.content);if(ut){const xt=Rt.value[ut];if(nn.value.has(ut)&&xt)Be=xt,Me=Lt(rt({},ct),{type:ut,tag:ut,content:KB(ct.content,ut)});else if(PT((V=ct.content)!=null?V:ct.raw,ut)){const Ct=String((J=(K=ct.content)!=null?K:ct.raw)!=null?J:"");Me.type==="html_inline"?(Be=Qn,Me={type:"text",content:Ct,raw:Ct}):(Be=zl,Me={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const $e=Me.type==="code_block"&&u.value==="pre"&&Be===_o&&!Nm(Rt.value,We);let He=rt({},(function(ct,ut,xt){const Ct=ut??Md(ct);if(ct.type==="code_block"){const Jt=Ct?Nm(Rt.value,Ct):void 0;if(xt&&u.value==="pre"&&!Jt&&xt===_o)return Y4.value;if(xt&&Ct&&xt===Jt)return Ct==="mermaid"?xk(ct):Ct==="infographic"?Ak(ct):Ct==="d2"||Ct==="d2lang"?Sk.value:_k.value;if(xt&&xt===Rt.value.code_block)return _k.value;if(qy(xt))return X4.value}return Ct==="mermaid"?xk(ct):Ct==="infographic"?Ak(ct):Ct==="d2"||Ct==="d2lang"?Sk.value:ct.type==="link"?J4.value:ct.type==="list"?eE.value:ct.type==="blockquote"?tE.value:ct.type==="table"?nE.value:ct.type==="code_block"?bk.value:Pc.value})(Me,We,Be));const Qe=ul.value[x.index];Me.type==="code_block"&&Qe?.kind==="code-block"&&(He=Lt(rt({},He),$e?{reservedHeightPx:(fe=Qe.height)!=null?fe:Qe.contentHeight}:{estimatedHeightPx:Qe.height,estimatedContentHeightPx:Qe.contentHeight})),$e||Me.type!=="code_block"||We!=="mermaid"||Pa(He.estimatedPreviewHeightPx)!=null||(He=Lt(rt({},He),{estimatedPreviewHeightPx:l1(i1(String((ve=Me.code)!=null?ve:"")))})),$e||Me.type!=="code_block"||We!=="infographic"||Pa(He.estimatedPreviewHeightPx)!=null||(He=Lt(rt({},He),{estimatedPreviewHeightPx:a1(r1(String((we=Me.code)!=null?we:"")))})),Me.type==="math_block"&&(He=Lt(rt({},He),{cacheScope:$n.value}));const Ze=(function(ct,ut){const xt=String(ct.type);return!ad(xt)&&Rt.value[xt]===ut})(Me,Be),St=Ze?J0(Me,Le.value):void 0;return Lt(rt({},x),{node:Me,component:Be,bindings:He,customBindings:rt(rt({},St??{}),He),rendersCustomNode:Ze,hasSlotChildren:sE(Me),slotContent:String((Pe=Me.content)!=null?Pe:""),isCodeBlock:Me.type==="code_block",indexKey:`${K4.value}-${x.index}`})}));function Md(x){var B;return x?.type==="code_block"?String((B=x.language)!=null?B:"").trim().toLowerCase():""}function Nm(x,B){const V=B.trim().toLowerCase();if(V)for(const K of[V,V0(V),EM(V)]){const J=K&&x[K];if(J)return J}}function Ck(x,B,V,K){var J,fe;const ve=rt({},x.value);return Pa(ve.estimatedPreviewHeightPx)==null&&(ve.estimatedPreviewHeightPx=K(V(String((J=B?.code)!=null?J:"")),void 0,ve.maxHeight==="none"?null:(fe=Pa(ve.maxHeight))!=null?fe:void 0)),ve}function xk(x){return Ck(Q4,x,i1,l1)}function Ak(x){return Ck(Z4,x,r1,a1)}function Tk(x,B){if(!x)return y1;const V=Rt.value,K=V[String(x.type)];if(x.type==="code_block"){const J=B??Md(x),fe=J?Nm(V,J):void 0;return fe||(u.value==="pre"?V.code_block||_o:J==="mermaid"?V.mermaid||q4:J==="infographic"?V.infographic||j4:J==="d2"||J==="d2lang"?V.d2||V4:K||V.code_block||jy.value)}return K||yk[String(x.type)]||y1}function Lm(x){o("click",x)}function oE(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseover",x)}function iE(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseout",x)}function Mk(x){o("mouseover",x)}function Ek(x){o("mouseout",x)}const vl=Z(null),ki=Z(!1);let Rc,da=null,Om=0,Ed=0,Id=0;const Ik=["code_block","admonition","table","math_block","html_block","image","thematic_break"],rE=new Set(Ik),$k=[".typewriter-cursor",".height-estimation-probes",...Ik.map(x=>`[data-node-type="${x}"]`),"script","style"].join(",");function Nk(x){if(!x||typeof x!="object")return!1;const B=x.type;return typeof B=="string"&&rE.has(B)}function $d(x){var B,V;if(!x||typeof x!="object")return 0;const K=x,J=(V=(B=K.raw)!=null?B:K.content)!=null?V:K.code;if(typeof J=="string")return J.length;const fe=K.children;if(Array.isArray(fe))return fe.reduce((we,Pe)=>we+$d(Pe),0);const ve=K.items;return Array.isArray(ve)?ve.reduce((we,Pe)=>we+$d(Pe),0):0}function Nd(){Rc&&(clearTimeout(Rc),Rc=void 0)}function Lk(){Om+=1,da!=null&&(Re?.(da),da=null)}function Ld(){Lk(),vl.value&&(vl.value.style.visibility="hidden")}function lE(x){var B;if(x.nodeType!==Node.TEXT_NODE||!((B=x.textContent)!=null?B:"").trim())return!1;const V=x.parentElement;return!!V&&!V.closest($k)}function aE(x){let B=x.lastChild;for(;B;){if(lE(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const V=B;if(!V.matches($k)&&V.lastChild){B=V.lastChild;continue}}for(;B&&B!==x&&!B.previousSibling;)B=B.parentNode;if(!B||B===x)break;B=B.previousSibling}return null}function Pm(){if(!be||!ki.value||da!=null)return;const x=Om,B=()=>{da=null,x===Om&&(function(){var V,K;if(!(be&&ki.value&&S.value&&vl.value))return;const J=S.value,fe=vl.value;fe.style.visibility="hidden";const ve=(function(){const Be=$m.value;for(let $e=Be.length-1;$e>=0;$e--){const He=Be[$e];if(!He||Nk(He.node)||!Am(He.index))continue;const Qe=dt.get(He.index);if(!Qe)continue;const Ze=aE(Qe);if(Ze)return Ze}return null})();if(!ve)return;let we=0,Pe=0,Me=20,We=!1;if(ve?.textContent){const Be=ve.textContent.length,$e=document.createRange();$e.setStart(ve,Math.max(0,Be-1)),$e.setEnd(ve,Be);const He=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Qe=(K=He?.[He.length-1])!=null?K:(V=ve.parentElement)==null?void 0:V.getBoundingClientRect();if(Qe){const Ze=bt("typewriterCursor.root.getBoundingClientRect",()=>J.getBoundingClientRect());we=Qe.right-Ze.left+J.scrollLeft,Pe=Qe.top-Ze.top+J.scrollTop,Me=Qe.height||Me,We=!0}$e.detach()}We&&(fe.style.transform=`translate(${Math.max(0,we)}px, ${Math.max(0,Pe)}px)`,fe.style.height=`${Me}px`,fe.style.visibility="visible")})()};_e?da=_e(B):B()}return Ye([ce,()=>s.content,()=>s.nodes,()=>k.typewriter,j],()=>qn(null,null,function*(){var x,B;if(!be||ze.value||!F.value)return;if(j.value)return ki.value=!1,Nd(),void Ld();if((x=s.nodes)!=null&&x.length)return ki.value=!1,Nd(),Ld(),Ed=((B=s.content)!=null?B:"").length,void(Id=ce.value.length);const V=(function(){var we,Pe;return(we=s.nodes)!=null&&we.length?s.nodes.reduce((Me,We)=>Me+$d(We),0):((Pe=s.content)!=null?Pe:"").length})(),K=(function(){var we;return(we=s.nodes)!=null&&we.length?s.nodes.reduce((Pe,Me)=>Pe+$d(Me),0):ce.value.length})(),J=!Nk(nt.value[nt.value.length-1]),fe=V>Ed,ve=K>Id;if(k.typewriter===!1||!J||!fe&&!ve)return k.typewriter!==!1&&J||(ki.value=!1,Ld()),Ed=V,void(Id=K);Ed=V,Id=K,ki.value=!0,vl.value&&(vl.value.style.visibility="hidden"),Nd(),yield gt(),Pm(),Rc=setTimeout(()=>{Rc=void 0,ki.value=!1},3e3)}),{flush:"post",immediate:!0}),Ye(ki,x=>qn(null,null,function*(){x?(yield gt(),Pm()):Ld()}),{flush:"post"}),Ye([()=>vs.value,()=>xs.start,()=>xs.end],()=>qn(null,null,function*(){be&&!ze.value&&F.value&&ki.value&&(yield gt(),Pm())}),{flush:"post"}),ms(()=>{Nd(),Lk(),Fn.clear()}),(x,B)=>{const V=PI("NodeRenderer",!0);return A(ze)?(w(!0),N(Oe,{key:0},ot($m.value,K=>(w(),N(Oe,{key:K.index},[K.rendersCustomNode?(w(),ge(Bs(K.component),pn({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:Lm,onMouseover:Mk,onMouseout:Ek,onCopy:B[0]||(B[0]=J=>o("copy",J)),onHandleArtifactClick:B[1]||(B[1]=J=>o("handleArtifactClick",J))}),{default:ke(()=>[K.hasSlotChildren?(w(),ge(V,pn({key:0,ref_for:!0},Pn.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(),ge(V,pn({key:1,ref_for:!0},Pn.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"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Bs(K.component),pn({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:Lm,onMouseover:Mk,onMouseout:Ek,onCopy:B[2]||(B[2]=J=>o("copy",J)),onHandleArtifactClick:B[3]||(B[3]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),N("div",{key:1,ref_key:"containerRef",ref:S,class:De(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:pt.value},{"virtual-scroll-coordinated":Tn.value}]]),"data-custom-id":k.customId,onClick:Lm,onMouseover:oE,onMouseout:iE},[_s.value||pt.value?(w(),N(Oe,{key:0},[_s.value?(w(),N("div",{key:0,class:"height-estimation-probes",style:Yt({width:`${it.value}px`}),"aria-hidden":"true"},[T("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[oe(A(zl),{node:Rn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),T("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[T("ul",PV,[oe(A(Xa),{node:gs.value,"index-key":"probe-list-item"},null,8,["node"])])],512),T("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[oe(A(Qa),{node:Xe.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),N(Oe,null,ot(6,K=>T("div",{key:`probe-heading-${K}`,ref_for:!0,ref:J=>(function(fe,ve){fe<1||fe>6||(H[fe]=ve)})(K,J),class:"node-content","data-probe":`heading-${K}`},[oe(A(Np),{node:M4(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,RV)),64))],4)):ie("",!0),pt.value?(w(),N("div",{key:1,class:"node-spacer",style:Yt({height:`${Zh.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(w(!0),N(Oe,null,ot($m.value,K=>(w(),N("div",{key:K.index,ref_for:!0,ref:J=>mk(K.index,J),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Am(K.index)?(w(),N("div",{key:0,ref_for:!0,ref:J=>(function(fe,ve){var we;ve||(function(Be){const $e=`${em()}-${Be}`;let He=!1;for(const Qe of Array.from(vo.keys())){const Ze=vi.get(Qe);(Ze?.index===Be||Qe===$e||Qe.startsWith(`${$e}-`))&&(vo.delete(Qe),vi.delete(Qe),He=!0)}He&&(ta(),Mn("async-node"))})(fe),$i.delete(fe),(function(Be){var $e;const He=(($e=cl.get(Be))!=null?$e:0)+1;cl.set(Be,He)})(fe);const Pe=cr.get(fe);if(Pe){for(const Be of Pe)yd(Be);cr.delete(fe)}if((function(Be){const $e=pe.get(Be);$e&&(wn?.unobserve($e),Ne.delete($e),pe.delete(Be))})(fe),!ve||!ti.value)return gi.delete(fe),void cl.delete(fe);gi.set(fe,ve);const Me=()=>{Td(fe,ve)};queueMicrotask(Me);const We=(wn||typeof ResizeObserver>"u"||(wn=new ResizeObserver(Be=>{if(Be.length)for(const $e of Be){const He=Ne.get($e.target),Qe=pe.get(He??-1);He!=null&&Qe&&Td(He,Qe)}else Li()})),wn);if(We&&(pe.set(fe,ve),Ne.set(ve,fe),We.observe(ve)),typeof window<"u"){const Be=((we=nt.value[fe])==null?void 0:we.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(Be.length){const $e=Be.map(He=>Dy(He,Me,"node-resize")).filter(He=>He!=null);$e.length&&cr.set(fe,$e)}}})(K.index,J),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ge(Bs(K.component),pn({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:B[8]||(B[8]=J=>o("copy",J)),onHandleArtifactClick:B[9]||(B[9]=J=>o("handleArtifactClick",J))}),{default:ke(()=>[K.hasSlotChildren?(w(),ge(V,pn({key:0,ref_for:!0},Pn.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(),ge(V,pn({key:1,ref_for:!0},Pn.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"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Bs(K.component),pn({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:B[10]||(B[10]=J=>o("copy",J)),onHandleArtifactClick:B[11]||(B[11]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Kr,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:ke(()=>[K.rendersCustomNode?(w(),ge(Bs(K.component),pn({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:B[4]||(B[4]=J=>o("copy",J)),onHandleArtifactClick:B[5]||(B[5]=J=>o("handleArtifactClick",J))}),{default:ke(()=>[K.hasSlotChildren?(w(),ge(V,pn({key:0,ref_for:!0},Pn.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(),ge(V,pn({key:1,ref_for:!0},Pn.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"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Bs(K.component),pn({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:B[6]||(B[6]=J=>o("copy",J)),onHandleArtifactClick:B[7]||(B[7]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),N("div",{key:1,class:"node-placeholder",style:Yt({height:`${_d(K.index)}px`})},null,4))],8,DV))),128)),ki.value?(w(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:vl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),pt.value?(w(),N("div",{key:2,class:"node-spacer",style:Yt({height:`${Jh.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,OV))}}})),[["__scopeId","data-v-2e8e6e17"]]),ho=s3;ho.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",ho.__name,ho.name].filter(n=>!!n));for(const n of t)e.component(n,s3)};const ry=Object.freeze(Object.defineProperty({__proto__:null,default:ho},Symbol.toStringTag,{value:"Module"})),BV={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"},FV={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"},HV={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"},WV={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"},zV={class:"admonition-title"},UV=["aria-expanded","aria-controls"],qV=["id"],Df=dn(Ve({__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=W(()=>{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=Z(!!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:De(["admonition",[`admonition-${s.node.kind}`]])},[T("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(w(),N("svg",BV,[...u[1]||(u[1]=[T("circle",{cx:"12",cy:"12",r:"10"},null,-1),T("path",{d:"M12 16v-4"},null,-1),T("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(w(),N("svg",FV,[...u[2]||(u[2]=[T("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),T("path",{d:"M9 18h6"},null,-1),T("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(w(),N("svg",HV,[...u[3]||(u[3]=[T("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),T("path",{d:"M12 9v4"},null,-1),T("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(w(),N("svg",WV,[...u[4]||(u[4]=[T("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),T("path",{d:"M12 8v4"},null,-1),T("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),T("span",zV,R(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:Yt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[T("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,UV)):ie("",!0)]),In(T("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[oe(A(ho),{"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,qV),[[Vo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Df.install=e=>{e.component(Df.__name,Df)};const o3=()=>lo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let df=null,jV=o3;function che(){return qn(this,null,function*(){if(df)return df;const e=jV;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===o3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(df=(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),df):null})}function uhe(){return!1}function dhe(){return qn(this,null,function*(){return null})}const ff=Z(!1);let mS=!1;function Ug(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function VV(){return!mS&&typeof window<"u"&&typeof document<"u"&&(mS=!0,ff.value=Ug(),new MutationObserver(()=>{ff.value=Ug()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ff.value=Ug()})),ff}const i3=["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"],KV=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),S1=[...i3].sort((e,t)=>t.length-e.length).join("|"),qg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${S1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${S1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),r3=/[),.;!?,。;!?)]+$/;function GV(e){const t=e.toLowerCase();return i3.some(n=>t.endsWith(`.${n}`))}function YV(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${S1}))["']`,"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 XV(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(r3,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=KV.has(i),a=GV(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 QV(e,t={}){const n=[];qg.lastIndex=0;let s;for(;(s=qg.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(r3,""),u=a.length-c.length;a=c;const d=XV(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&&(qg.lastIndex-=u)}return n}const ZV=12e4,JV=6e4,eK=32,tK=3e4,gS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function nK(e){let t=0,n=0,s=0;gS.lastIndex=0;let o;for(;(o=gS.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=ZV||n>=JV||t>=eK||s>=tK?"pre":"shiki",codeFenceCount:t,codeChars:n}}function sK(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function oK(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const iK={key:1,class:"diff-wrap"},rK={class:"diff-bar"},lK=["onClick"],aK={class:"diff-pre"},cK="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",vS="github-light",yS="github-dark",uK=Ve({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){WU(),eq(),UU(),iq(),zU(new sK),oq(new oK);function t(P){return P.inline.ruler.disable("math"),P}const{t:n}=Nt(),s=qt("resolveImage"),o=Z(null),i=e,r=W(()=>!i.streaming),l=W(()=>YV(i.text??"")),a=W(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:nK(i.text??"")),c=VV(),u=W(()=>!i.streaming),d=$s(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(P){return!/^(https?:|data:|blob:)/i.test(P)}function b(P){if(!s)return;const D=[];for(const H of[h,p]){H.lastIndex=0;let z;for(;(z=H.exec(P))!==null;)D.push(z[2]??"")}for(const H of D)!H||!m(H)||d.has(H)||f.has(H)||(f.add(H),s(H).then(z=>{d.set(H,z!==H?z:"")}).catch(()=>{d.set(H,"")}).finally(()=>{f.delete(H)}))}function _(P){if(!s)return P;const D=H=>{if(!m(H))return null;const z=d.get(H);return z===void 0?cK:z===""?null:z};return P.replace(h,(H,z,U,Q)=>{const X=D(U);return X===null?H:`${z}${X}${Q}`}).replace(p,(H,z,U,Q)=>{const X=D(U);return X===null?H:`${z}${X}${Q}`})}Ye(()=>i.text,P=>b(P??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const P=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),D=[];let H=P.nextNode();for(;H;){const z=H,U=z.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&D.push(z),H=P.nextNode()}for(const z of D){const U=QV(z.data,{aliases:l.value});if(U.length===0||!z.parentNode)continue;const Q=document.createDocumentFragment();let X=0;for(const ue of U){ue.start>X&&Q.append(document.createTextNode(z.data.slice(X,ue.start)));const me=document.createElement("button");me.type="button",me.className="md-file-link",me.textContent=ue.text,me.title=ue.line?`${ue.path}:${ue.line}`:ue.path,me.addEventListener("click",Ae=>{Ae.preventDefault(),Ae.stopPropagation(),i.openFile?.({path:ue.path,line:ue.line})}),Q.append(me),X=ue.end}X<z.data.length&&Q.append(document.createTextNode(z.data.slice(X))),z.parentNode.replaceChild(Q,z)}}function v(P){return!(!P||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(P))}function y(P){let D=P.length;for(const H of["#","?"]){const z=P.indexOf(H);z!==-1&&z<D&&(D=z)}return P.slice(0,D)}function C(){if(!o.value||!i.openFile||i.streaming)return;const P=o.value.querySelectorAll("a[href]");for(const D of P){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const H=D.getAttribute("href")??"";v(H)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(H)})}))}}function L(){gt().then(()=>{g(),C()})}Ye(()=>i.text,L),Ye(()=>i.streaming,L);let $=null;bn(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),_n(()=>{$?.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,E=W(()=>{const P=_(i.text??""),D=[];let H=0;M.lastIndex=0;let z;for(;(z=M.exec(P))!==null;){const Q=z[1]??"",X=P.slice(H,z.index)+(Q||"");X.trim()&&D.push({kind:"md",text:X}),D.push({kind:"diff",code:z[2]??""}),H=M.lastIndex}const U=P.slice(H);return(U.trim()||D.length===0)&&D.push({kind:"md",text:U}),D});function O(P){return P.split(`
246
- `).map(D=>/^\+(?!\+\+)/.test(D)?{cls:"diff-add",text:D}:/^-(?!--)/.test(D)?{cls:"diff-del",text:D}:D.startsWith("@@")?{cls:"diff-hunk",text:D}:{cls:"diff-ctx",text:D})}const S=Z(null);function I(P,D){Hs(P).then(H=>{H&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(P,D)=>(w(),N("div",{ref_key:"mdRef",ref:o,class:"md"},[(w(!0),N(Oe,null,ot(E.value,(H,z)=>(w(),N(Oe,{key:z},[H.kind==="md"?(w(),ge(A(ho),{key:0,content:H.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":A(c),"code-block-light-theme":vS,"code-block-dark-theme":yS,themes:[vS,yS],"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",iK,[T("div",rK,[D[0]||(D[0]=T("span",{class:"diff-lang"},"diff",-1)),oe(Wt,{text:A(n)("filePreview.copyCode")},{default:ke(()=>[T("button",{class:"diff-copy",onClick:U=>I(H.code,z)},R(S.value===z?"✓":"⧉"),9,lK)]),_:2},1032,["text"])]),T("pre",aK,[T("code",null,[(w(!0),N(Oe,null,ot(O(H.code),(U,Q)=>(w(),N("span",{key:Q,class:De(U.cls)},R(U.text),3))),128))])])]))],64))),128))],512))}}),Ih=ft(uK,[["__scopeId","data-v-8b684052"]]),dK={class:"tc-anim"},fK={class:"prev-anim"},pK={class:"prev"},hK=Ve({__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=W(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=W(()=>n.foldable&&o.value.length>1),r=W(()=>n.streaming||!i.value),l=W(()=>o.value.pop()??""),a=Z(null);return bn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ye(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),N("div",{class:De(["think",{mob:e.mobile}])},[i.value?(w(),N("div",{key:0,class:De(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[T("div",dK,[T("pre",{ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513)]),T("div",fK,[T("span",pK,R(l.value),1)])],2)):(w(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513))],2))}}),mK=ft(hK,[["__scopeId","data-v-5f6e61ba"]]),gK={class:"activity-notice",role:"status"},vK={"aria-hidden":"true"},yK={class:"an-label"},kK=Ve({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),N("div",gK,[T("span",vK,[oe(Zo,{size:"sm"})]),T("span",yK,R(e.label),1)]))}}),bK=ft(kK,[["__scopeId","data-v-0d497074"]]),_K=["aria-label"],wK=120,SK=60,CK=Ve({__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*wK}ms`,"--moon-frame-fast-delay":`${s*SK}ms`}}return(s,o)=>(w(),N("span",{class:De(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),N(Oe,null,ot(t,(i,r)=>T("span",{key:i,class:"ui-moon__frame",style:Yt(n(r)),"aria-hidden":"true"},R(i),5)),64))],10,_K))}}),l3=ft(CK,[["__scopeId","data-v-a6b7ec07"]]);function xK(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 AK={class:"chat"},TK={key:0,class:"chat-loading"},MK={class:"chat-loading-text"},EK={key:1,class:"chat-empty"},IK={key:1,class:"top-sentinel-text"},$K=["data-turn-id"],NK={key:0,class:"u-imgs"},LK=["src"],OK=["src","alt"],PK={key:1,class:"skill-act"},RK={class:"skill-act-head"},DK={key:0,class:"skill-act-args"},BK={key:2,class:"skill-act"},FK={class:"skill-act-head"},HK={key:0,class:"skill-act-args"},WK={key:3,class:"u-text"},zK={key:0,class:"u-meta"},UK=["aria-label","onClick"],qK=["aria-label","onClick"],jK=["onClick"],VK=["data-turn-id"],KK=["onClick"],GK={class:"cd-view"},YK={key:1,class:"cd-label"},XK=["data-turn-id"],QK={key:1,class:"msg"},ZK={key:0,class:"a-msg-ft"},JK={key:0,class:"a-duration"},eG=["aria-label","onClick"],tG={key:4,class:"sending-placeholder"},nG={key:5,class:"q-stack"},sG={class:"q-head"},oG={class:"q-title"},iG={class:"q-hint"},rG=["onDragover","onDrop"],lG={class:"u-bub q-bub"},aG=["title","onDragstart"],cG=["title","disabled","onClick"],uG={key:0,class:"u-text q-text"},dG={key:1,class:"q-text q-text-placeholder"},fG={key:0,class:"q-imgs"},pG=["src"],hG=["src"],mG={key:1,class:"q-tag q-tag-next"},gG={key:2,class:"q-tag q-tag-idx"},vG=["aria-label","onClick"],yG=2500,kG=Ve({__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}=Nt(),{confirm:o}=sl();_n(()=>{be!==null&&(clearTimeout(be),be=null),z!==null&&(clearTimeout(z),z=null),M!==null&&(clearTimeout(M),M=null)});const i=e,r=Z(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Le=>{Le[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}bn(a),_n(()=>{l?.disconnect(),l=null}),Ye(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{gt().then(a)});const c=W(()=>{if(!i.running||i.turns.length===0)return null;const Le=i.turns.at(-1);return Le.role==="assistant"?Le.id:null}),u=W(()=>i.sending||i.running),d=n,f=Z(null),h=Z(null);function p(Le){return(Le.attachments?.length??0)>0}function m(Le,le){p(le)||d("editQueued",Le)}function b(Le,le){if(f.value=Le,!le.dataTransfer)return;le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",String(Le));const F=le.currentTarget?.closest(".q-turn");F&&le.dataTransfer.setDragImage(F,24,24)}function _(Le,le){if(f.value===null)return;le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move");const F=le.currentTarget.getBoundingClientRect(),te=le.clientY<F.top+F.height/2?"before":"after";h.value={index:Le,position:te}}function g(Le,le){le.preventDefault();const F=f.value,te=h.value?.position??"before";if(f.value=null,h.value=null,F===null)return;let ee=te==="before"?Le:Le+1;F<ee&&(ee-=1),F!==ee&&d("reorderQueue",{from:F,to:ee})}function v(){f.value=null,h.value=null}const y=W(()=>{for(let Le=i.turns.length-1;Le>=0;Le--)if(i.turns[Le].role==="user")return i.turns[Le].id;return null});function C(Le){return Le.role==="user"&&Le.id===y.value&&!i.running&&!i.sending&&!Le.skillActivation&&!Le.pluginCommand}function L(Le){const le=Le.compaction,F=le?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof le?.tokensBefore=="number"&&typeof le?.tokensAfter=="number"?F+s("conversation.compactedTokens",{before:S_(le.tokensBefore),after:S_(le.tokensAfter)}):F}const $=Z(null),k=Z(null);let M=null;const E=Z(new Set);function O(Le){return E.value.has(Le)}function S(Le){const le=new Set(E.value);le.has(Le)?le.delete(Le):le.add(Le),E.value=le}function I(Le,le){if(O(le)){const F=new Date(Le);if(Number.isNaN(F.getTime()))return Le;const te=ee=>String(ee).padStart(2,"0");return`${F.getFullYear()}-${te(F.getMonth()+1)}-${te(F.getDate())} ${te(F.getHours())}:${te(F.getMinutes())}`}return xK(Le,s("conversation.yesterday"))}async function P(Le){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&D(Le)}function D(Le){k.value===null&&(k.value=Le.id,d("editMessage",Le.text),M=setTimeout(()=>{M=null,k.value=null},yG))}Ye(()=>i.turns,Le=>{k.value!==null&&(Le.some(le=>le.id===k.value)||(k.value=null,M!==null&&(clearTimeout(M),M=null)))},{flush:"post"});const H=Z(!1);let z=null;function U(){if(i.turns.length===0)return;const Le=[];for(const F of i.turns){if(F.role==="compaction")continue;const te=F.role==="user"?"User":"Assistant",ee=MP(F);ee.trim()&&Le.push(`**${te}**
247
-
248
- ${ee}`)}const le=Le.join(`
249
-
250
- ---
251
-
252
- `);Hs(le).then(F=>{F&&(H.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,H.value=!1},2e3))}).catch(()=>{})}function Q(Le){const le=[];for(let F=Le;F>=0;F--){const te=i.turns[F];if(!te||te.role!=="assistant")break;le.unshift(te)}return le}function X(Le){return Q(Le).map(le=>TP(le)).filter(Boolean).join(`
253
-
254
- `)}function ue(){for(let Le=i.turns.length-1;Le>=0;Le-=1)if(i.turns[Le]?.role==="assistant")return X(Le);return""}function me(){const Le=ue();Le.trim()&&Hs(Le).then(le=>{le&&(H.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,H.value=!1},2e3))}).catch(()=>{})}t({copyConversation:U,copyFinalSummary:me});function Ae(Le){const le=i.turns[Le];if(!le||le.role!=="assistant")return!1;const F=i.turns[Le+1];return!F||F.role!=="assistant"}let be=null;function ze(Le){const le=i.turns[Le];if(!le)return;const F=X(Le);F.trim()&&Hs(F).then(te=>{te&&($.value=le.id,be!==null&&clearTimeout(be),be=setTimeout(()=>{be=null,$.value=null},1400))}).catch(()=>{})}function qe(Le){const le=Le.text;le.trim()&&Hs(le).then(F=>{F&&($.value=Le.id,be!==null&&clearTimeout(be),be=setTimeout(()=>{be=null,$.value=null},1400))}).catch(()=>{})}function Fe(Le,le){return Le.id!==c.value?!1:le.sourceIndex===uh(Le).length-1}return(Le,le)=>(w(),N("div",AK,[e.sessionLoading?(w(),N("div",TK,[oe(Zo,{size:"sm"}),T("span",MK,R(A(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),N("div",EK)):ie("",!0),e.hasMoreMessages||e.loadingMore?(w(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:De(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),N("span",IK,[oe(Zo,{size:"sm"}),je(" "+R(A(s)("conversation.loadingOlder")),1)])):(w(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:le[0]||(le[0]=F=>d("loadOlderMessages"))},R(A(s)("conversation.loadOlder")),1))],2)):ie("",!0),(w(!0),N(Oe,null,ot(e.turns,(F,te)=>(w(),N(Oe,{key:F.id},[F.role==="user"?(w(),N("div",{key:0,class:De(["u-turn",{"is-latest-user":F.id===y.value}])},[T("div",{class:De(["u-bub turn-anchor",{undoing:k.value===F.id}]),"data-turn-id":F.id},[F.images&&F.images.length>0?(w(),N("div",NK,[(w(!0),N(Oe,null,ot(F.images,(ee,q)=>(w(),N(Oe,{key:q},[ee.kind==="video"?(w(),N("video",{key:0,class:"u-img",src:ee.url,controls:"",playsinline:"",preload:"metadata"},null,8,LK)):(w(),N("img",{key:1,class:"u-img",src:ee.url,alt:ee.alt||"",loading:"lazy"},null,8,OK))],64))),128))])):ie("",!0),F.skillActivation?(w(),N("div",PK,[T("div",RK,[le[9]||(le[9]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,R(A(s)("conversation.activatedSkill",{name:F.skillActivation.name})),1)]),F.skillActivation.args?(w(),N("div",DK,R(F.skillActivation.args),1)):ie("",!0)])):F.pluginCommand?(w(),N("div",BK,[T("div",FK,[le[10]||(le[10]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,"/"+R(F.pluginCommand.pluginId)+":"+R(F.pluginCommand.commandName),1)]),F.pluginCommand.args?(w(),N("div",HK,R(F.pluginCommand.args),1)):ie("",!0)])):(w(),N("div",WK,R(F.text),1))],10,$K),F.createdAt||C(F)?(w(),N("div",zK,[C(F)?(w(),N("div",{key:0,class:De(["u-edit-wrap",{undoing:k.value===F.id}])},[T("button",{type:"button",class:"u-edit","aria-label":A(s)("conversation.undoTooltip"),onClick:ee=>P(F)},[oe(Je,{name:"undo",size:"sm"})],8,UK)],2)):ie("",!0),F.text.trim().length>0?(w(),N("button",{key:1,type:"button",class:"u-copy","aria-label":A(s)("filePreview.copy"),onClick:vt(ee=>qe(F),["stop"])},[$.value!==F.id?(w(),ge(Je,{key:0,name:"copy",size:"sm"})):(w(),ge(Je,{key:1,name:"check",size:"sm"}))],8,qK)):ie("",!0),F.createdAt?(w(),N("button",{key:2,type:"button",class:"u-time",onClick:vt(ee=>S(F.id),["stop"])},R(I(F.createdAt,F.id)),9,jK)):ie("",!0)])):ie("",!0)],2)):F.role==="compaction"?(w(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":F.id,role:"separator"},[le[11]||(le[11]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1)),F.text?(w(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ee=>d("openCompaction",{turnId:F.id})},[T("span",null,R(L(F)),1),T("span",GK,R(A(s)("conversation.viewSummary")),1)],8,KK)):(w(),N("span",YK,R(L(F)),1)),le[12]||(le[12]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,VK)):(w(),N("div",{key:2,class:"a-msg turn-anchor","data-turn-id":F.id},[(w(!0),N(Oe,null,ot(A(AP)(F),(ee,q)=>(w(),N(Oe,{key:A(EP)(ee,q)},[ee.kind==="thinking"?(w(),ge(mK,{key:0,text:ee.thinking,mobile:"",streaming:Fe(F,ee),onOpen:Y=>d("openThinking",{turnId:F.id,blockIndex:ee.sourceIndex})},null,8,["text","streaming","onOpen"])):ee.kind==="text"&&ee.text?(w(),N("div",QK,[oe(Ih,{text:ee.text,streaming:Fe(F,ee),"open-file":Y=>d("openFile",Y)},null,8,["text","streaming","open-file"])])):ee.kind==="tool-stack"?(w(),ge(PP,{key:2,tools:ee.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[1]||(le[1]=Y=>d("openMedia",Y)),onOpenFile:le[2]||(le[2]=Y=>d("openFile",Y)),onOpenToolDiff:le[3]||(le[3]=Y=>d("openToolDiff",Y)),onOpenAgent:le[4]||(le[4]=Y=>d("openAgent",Y))},null,8,["tools","tool-diff-panel"])):ee.kind==="tool"?(w(),ge(xA,{key:3,tool:ee.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[5]||(le[5]=Y=>d("openMedia",Y)),onOpenFile:le[6]||(le[6]=Y=>d("openFile",Y)),onOpenToolDiff:le[7]||(le[7]=Y=>d("openToolDiff",Y)),onOpenAgent:le[8]||(le[8]=Y=>d("openAgent",Y))},null,8,["tool","tool-diff-panel"])):ie("",!0)],64))),128)),F.id!==c.value&&Ae(te)&&(X(te).trim().length>0||F.durationMs!==void 0)?(w(),N("div",ZK,[oe(Wt,{text:`${F.durationMs} ms`},{default:ke(()=>[F.durationMs!==void 0?(w(),N("span",JK,R(A(SP)(F.durationMs)),1)):ie("",!0)]),_:2},1032,["text"]),X(te).trim().length>0?(w(),N("button",{key:0,class:"a-cpbtn","aria-label":A(s)("filePreview.copy"),onClick:ee=>ze(te)},[$.value!==F.id?(w(),ge(Je,{key:0,name:"copy",size:"sm"})):(w(),ge(Je,{key:1,name:"check",size:"sm"}))],8,eG)):ie("",!0)])):ie("",!0)],8,XK))],64))),128)),e.compaction?(w(),ge(bK,{key:3,label:A(s)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(w(),N("div",tG,[oe(l3,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0),e.queued.length>0?(w(),N("div",nG,[T("div",sG,[T("span",oG,[oe(Je,{name:"mail",size:"sm"}),je(" "+R(A(s)("composer.queueLabel"))+" · ",1),T("b",null,R(e.queued.length),1)]),T("span",iG,R(A(s)("composer.queueAutoDrain")),1)]),(w(!0),N(Oe,null,ot(e.queued,(F,te)=>(w(),N("div",{key:te,class:De(["u-turn q-turn",{"q-dragging":f.value===te,"drop-before":h.value?.index===te&&h.value.position==="before","drop-after":h.value?.index===te&&h.value.position==="after"}]),onDragover:ee=>_(te,ee),onDrop:ee=>g(te,ee)},[T("div",lG,[T("span",{class:"q-grip",title:A(s)("composer.queueDragTitle"),draggable:"true",onDragstart:ee=>b(te,ee),onDragend:v},[oe(Je,{name:"grip",size:"sm"})],40,aG),T("button",{type:"button",class:"q-body",title:p(F)?A(s)("composer.queuedHasImage",{n:F.attachments?.length??0}):A(s)("composer.editQueued"),disabled:p(F),onClick:ee=>m(te,F)},[F.text?(w(),N("span",uG,R(F.text),1)):(w(),N("span",dG,[oe(Je,{name:"image",size:"sm"}),je(" "+R(A(s)("composer.queuedImageOnly",{n:F.attachments?.length??0})),1)]))],8,cG),p(F)?(w(),N("div",fG,[(w(!0),N(Oe,null,ot(F.attachments,(ee,q)=>(w(),N(Oe,{key:q},[ee.kind==="video"?(w(),N("video",{key:0,class:"q-img",src:ee.url,muted:"",playsinline:"",preload:"metadata"},null,8,pG)):(w(),N("img",{key:1,class:"q-img",src:ee.url,alt:"",loading:"lazy"},null,8,hG))],64))),128))])):ie("",!0),te===0?(w(),N("span",mG,R(A(s)("composer.queueNext")),1)):(w(),N("span",gG,"#"+R(te+1),1)),T("button",{type:"button",class:"q-rm","aria-label":A(s)("composer.remove"),onClick:vt(ee=>d("unqueue",te),["stop"])},[oe(Je,{name:"close",size:"sm"})],8,vG)])],42,rG))),128))])):ie("",!0)]))}}),a3=ft(kG,[["__scopeId","data-v-13e4f733"]]),bG={class:"ch-id"},_G={key:0,class:"ch-ws"},wG={key:1,class:"ch-sep"},SG=["onKeydown"],CG={class:"ch-ses"},xG={key:0,class:"ch-pill ch-sync-pill"},AG={key:0,class:"ch-ahead"},TG={key:1,class:"ch-behind"},MG={key:1,class:"ch-pill ch-diff-pill"},EG={key:0,class:"ch-add"},IG={key:1,class:"ch-del"},$G=Ve({__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}=Nt(),{confirm:s}=sl(),o=e,i=t,r=W(()=>o.ahead??0),l=W(()=>o.behind??0),a=W(()=>o.gitDiffStats?.totalAdditions??0),c=W(()=>o.gitDiffStats?.totalDeletions??0),u=W(()=>a.value>0||c.value>0),d=Z(!1),f=Z(null),h=Z(null),p=Z({});function m(D){const H=D.target;h.value?.el?.contains(H)||f.value?.el?.contains(H)||g()}function b(){g()}async function _(D){if(D.stopPropagation(),d.value){g();return}d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",b),await gt();const H=f.value?.el,z=h.value?.el;if(!H||!z)return;const U=H.getBoundingClientRect(),Q=4,X=8,ue=z.offsetWidth,me=z.offsetHeight;let Ae=U.bottom+Q;Ae+me>window.innerHeight-X&&(Ae=Math.max(X,U.top-me-Q));let be=U.left;be+ue>window.innerWidth-X&&(be=Math.max(X,U.right-ue)),p.value={top:`${Math.round(Ae)}px`,left:`${Math.round(be)}px`}}function g(){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",b)}_n(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",b)});function v(){i("copyAll"),g()}function y(){i("copyFinalSummary"),g()}const C=Z(!1);function L(){o.sessionId&&Hs(o.sessionId).then(D=>{D&&(C.value=!0,setTimeout(()=>{C.value=!1},1200))})}const $=Z(!1),k=Z(""),M=Z(null);async function E(){if(g(),!!o.sessionId){$.value=!0,k.value=o.sessionTitle??"",await gt();try{M.value?.focus(),M.value?.select()}catch{}}}function O(){const D=k.value.trim();D&&o.sessionId&&D!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,D),$.value=!1}function S(){$.value=!1}function I(){o.sessionId&&(g(),i("forkSession",o.sessionId))}async function P(){o.sessionId&&(g(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(D,H)=>(w(),N("header",{class:De(["chat-header",{"macos-desktop":A(kA)}])},[T("div",bG,[e.workspaceName?(w(),N("span",_G,R(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(w(),N("span",wG,"/")):ie("",!0),$.value?In((w(),N("input",{key:2,ref_key:"renameInputRef",ref:M,"onUpdate:modelValue":H[0]||(H[0]=z=>k.value=z),class:"ch-rename",type:"text",onKeydown:[li(vt(O,["stop"]),["enter"]),li(vt(S,["stop"]),["esc"])],onBlur:O,onClick:H[1]||(H[1]=vt(()=>{},["stop"]))},null,40,SG)),[[mo,k.value]]):e.sessionTitle?(w(),ge(Wt,{key:3,text:e.sessionTitle},{default:ke(()=>[T("span",CG,R(e.sessionTitle),1)]),_:1},8,["text"])):ie("",!0)]),oe(mn,{ref_key:"kebabRef",ref:f,class:De(["ch-act-more",{open:d.value}]),label:A(n)("header.options"),"aria-expanded":d.value,"aria-haspopup":"menu",onClick:H[2]||(H[2]=vt(z=>_(z),["stop"]))},{default:ke(()=>[oe(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),d.value?(w(),ge(Fl,{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Yt(p.value),onClick:H[3]||(H[3]=vt(()=>{},["stop"]))},{default:ke(()=>[oe(hn,{onClick:v},{default:ke(()=>[je(R(e.copied?A(n)("header.copied"):A(n)("header.copyAll")),1)]),_:1}),oe(hn,{onClick:y},{default:ke(()=>[je(R(A(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),N(Oe,{key:0},[oe(hn,{separator:""}),oe(hn,{onClick:L},{default:ke(()=>[je(R(C.value?A(n)("header.copied"):A(n)("header.copySessionId")),1)]),_:1}),oe(hn,{onClick:E},{default:ke(()=>[je(R(A(n)("header.renameSession")),1)]),_:1}),oe(hn,{onClick:I},{default:ke(()=>[je(R(A(n)("header.forkSession")),1)]),_:1}),oe(hn,{danger:"",onClick:P},{default:ke(()=>[je(R(A(n)("header.archiveSession")),1)]),_:1})],64)):ie("",!0)]),_:1},8,["style"])):ie("",!0),H[6]||(H[6]=T("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),N("button",{key:1,type:"button",class:"ch-git",onClick:H[4]||(H[4]=z=>i("openChanges"))},[T("span",{class:De(["ch-branch",{"ch-detached":!e.branch}])},R(e.branch||A(n)("header.detached")),3),r.value>0||l.value>0?(w(),N("span",xG,[r.value>0?(w(),N("span",AG,"↑"+R(r.value),1)):ie("",!0),l.value>0?(w(),N("span",TG,"↓"+R(l.value),1)):ie("",!0)])):ie("",!0),u.value?(w(),N("span",MG,[a.value>0?(w(),N("span",EG,"+"+R(a.value),1)):ie("",!0),c.value>0?(w(),N("span",IG,"-"+R(c.value),1)):ie("",!0)])):ie("",!0)])):ie("",!0),e.pr?(w(),N("button",{key:2,type:"button",class:De(["ch-pill ch-pr",`pr-${e.pr.state}`]),onClick:H[5]||(H[5]=z=>e.pr&&i("openPr",e.pr.url))},[oe(Je,{name:"git-pull-request",size:"sm"}),T("span",null,"PR #"+R(e.pr.number)+" · "+R(e.pr.state),1)],2)):ie("",!0)],2))}}),NG=ft($G,[["__scopeId","data-v-39760f19"]]),LG={key:0,class:"slash-menu",role:"listbox"},OG=["aria-selected","onMouseenter","onMousedown"],PG={class:"slash-name"},RG={class:"slash-desc"},DG=Ve({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=Z([]);return Ye(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),N("div",LG,[(w(!0),N(Oe,null,ot(e.items,(a,c)=>(w(),N("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:De(["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"])},[T("span",PG,R(a.name),1),T("span",RG,R(a.isSkill?a.desc:A(n)(a.desc)),1)],42,OG))),128))])):ie("",!0)}}),BG=ft(DG,[["__scopeId","data-v-f60b70d9"]]),FG={class:"mention-menu",role:"listbox"},HG={key:0,class:"mention-state dim"},WG={key:1,class:"mention-state dim"},zG=["aria-selected","onMouseenter","onMousedown"],UG=["innerHTML"],qG={class:"mention-name"},jG={class:"mention-path"},VG=Ve({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=Ta("folder","sm"),r=Ta("code","sm"),l=Ta("file-text","sm"),a=Ta("image","sm"),c=Ta("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 b=p.name||m.split("/").pop()||m,_=b.lastIndexOf("."),g=_>0?b.slice(_+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(w(),N("div",FG,[n.loading?(w(),N("div",HG,R(A(o)("mention.searching")),1)):n.items.length===0?(w(),N("div",WG,R(A(o)("mention.noMatch")),1)):(w(!0),N(Oe,{key:2},ot(n.items,(b,_)=>(w(),N("div",{key:b.path,class:De(["mention-item",{active:_===n.activeIndex}]),role:"option","aria-selected":_===n.activeIndex,onMouseenter:g=>s("hover",_),onMousedown:vt(g=>s("select",b),["prevent"])},[T("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,UG),T("span",qG,R(b.name),1),T("span",jG,R(b.path),1)],42,zG))),128))]))}}),KG=ft(VG,[["__scopeId","data-v-f4d6b958"]]),c3=[{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 GG(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 u3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...c3,...t]}function YG(e,t=c3){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 d3(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 kS(e,t){switch(d3(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Pp=100;function XG(e){const t=td($t.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>Pp?n.slice(-Pp):n,o={[e]:s};return fc($t.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function QG(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=Z(XG(o())),r=W(()=>i.value[o()??""]??[]);let l=-1,a="";function c(_){const g=o();if(l=-1,!g)return;const v=_.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const C=[...y,v],L=C.length>Pp?C.slice(-Pp):C;i.value={...i.value,[g]:L},fc($t.inputHistory,i.value)}function u(){const _=n.value;return _?(_.selectionStart??0)===0:!1}function d(_){t.value=_,gt(()=>{const g=n.value;if(!g)return;s();const v=_.length;g.setSelectionRange(v,v)})}function f(){const _=r.value;if(_.length!==0){if(l===-1)a=t.value,l=_.length-1;else if(l>0)l-=1;else return;d(_[l])}}function h(){if(l===-1)return;const _=r.value;l<_.length-1?(l+=1,d(_[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function b(){return r.value.length>0}return Ye(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:b}}function ZG(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Z(!1),c=Z([]),u=Z(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=YG(h,u3(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} `,gt(()=>{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 JG(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=Z(!1),r=Z([]),l=Z(0),a=Z(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const b=h.slice(m,p);return b.startsWith("@")?{token:b.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,gt(()=>{const b=n.value;if(!b)return;const _=p.start+h.path.length;b.setSelectionRange(_,_),b.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function eY(e){const{sessionId:t}=e;function n(c){return Zn(f_(c))??""}function s(c,u){const d=f_(c);u?es(d,u):oc(d)}const o=Z(n(t())),i=Z(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ye(o,c=>{gt(r),s(t(),c)}),Ye(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),gt(r))});function l(c){o.value=c,gt(()=>{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 tY(e){const{uploadImage:t,sessionId:n}=e,s=Z({}),o=W(()=>s.value[n()??""]??[]),i=Z(null),r=Z(null),l=Z(!1);let a=0;function c(){return`att_${++a}`}function u(k,M){s.value={...s.value,[k]:M}}function d(k){try{URL.revokeObjectURL(k.previewUrl)}catch{}}function f(k){return k.startsWith("image/")?"image":k.startsWith("video/")?"video":null}async function h(k){const M=t();if(!M)return;const E=n()??"",O=k.map(S=>({file:S,kind:f(S.type)})).filter(S=>S.kind!==null);if(O.length!==0)for(const{file:S,kind:I}of O){const P=c(),D=URL.createObjectURL(S),H={localId:P,name:S.name,kind:I,previewUrl:D,uploading:!0};u(E,[...s.value[E]??[],H]),M(S,S.name).then(z=>{const U=s.value[E]??[];u(E,U.map(Q=>Q.localId===P?{...Q,uploading:!1,fileId:z?.fileId,error:z===null}:Q))}).catch(()=>{const z=s.value[E]??[];u(E,z.map(U=>U.localId===P?{...U,uploading:!1,error:!0}:U))})}}function p(k){const M=n()??"",E=s.value[M]??[],O=E.find(S=>S.localId===k);i.value?.localId===k&&(i.value=null),O&&d(O),u(M,E.filter(S=>S.localId!==k))}function m(k){i.value=k}function b(){i.value=null}function _(){r.value?.click()}function g(k){const M=k.target,E=Array.from(M.files??[]);h(E),M.value=""}function v(k){if(!t())return;const M=k.clipboardData;if(!M)return;const E=[],O=new Set,S=(I,P)=>{const D=`${I.size}:${I.type}:${P}`;if(O.has(D))return;O.add(D);const H=I.type.split("/")[1]??"png",z=P.includes(".")?P:`paste-${Date.now()}.${H}`;E.push(I instanceof File?I:new File([I],z,{type:I.type}))};for(const I of Array.from(M.items))if(I.kind==="file"&&f(I.type)){const P=I.getAsFile();P&&S(P,P.name||`paste-${Date.now()}.${I.type.split("/")[1]??"png"}`)}for(const I of Array.from(M.files))f(I.type)&&S(I,I.name);E.length!==0&&(k.preventDefault(),h(E))}function y(k){!t()||!Array.from(k.dataTransfer?.items??[]).some(E=>E.kind==="file")||(k.preventDefault(),l.value=!0)}function C(){l.value=!1}function L(k){if(l.value=!1,!t())return;k.preventDefault();const M=Array.from(k.dataTransfer?.files??[]);h(M)}function $(){const k=n()??"";for(const M of s.value[k]??[])d(M);u(k,[])}return Ye(n,()=>{i.value=null}),bn(()=>{document.addEventListener("paste",v)}),_n(()=>{document.removeEventListener("paste",v);for(const k of Object.values(s.value))for(const M of k)d(M);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:b,openFilePicker:_,handleFileInputChange:g,handleDragOver:y,handleDragLeave:C,handleDrop:L,clearAfterSubmit:$}}const nY={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},sY=["stroke-dasharray","stroke-dashoffset"],jg=7,oY=Ve({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*jg;return(s,o)=>(w(),N("svg",nY,[T("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:jg,fill:"none","stroke-width":"2.5"}),T("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:jg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,sY)]))}}),iY=ft(oY,[["__scopeId","data-v-a364f1f1"]]),rY={key:0,class:"att-strip"},lY=["onClick"],aY=["src"],cY=["src","alt"],uY={key:2,class:"att-video-badge","aria-hidden":"true"},dY={class:"att-name"},fY={class:"att-err-icon"},pY=["onClick"],hY={class:"att-lightbox-card"},mY=["src"],gY=["src","alt"],vY={class:"att-lightbox-name"},yY={class:"composer-card"},kY={class:"cin-wrap"},bY={class:"input-row"},_Y=["placeholder"],wY=["aria-label"],SY={class:"toolbar-left"},CY=["onKeydown"],xY=["onClick"],AY={class:"pd-check"},TY={class:"pd-info"},MY={class:"pd-desc"},EY={class:"mode-label"},IY={key:0,class:"mode-tag"},$Y={key:1,class:"mode-tag"},NY={key:2,class:"mode-tag"},LY={class:"mode-row-name"},OY={class:"mode-row-name"},PY={class:"mode-row-name"},RY={key:0,class:"mode-row-actions"},DY={class:"toolbar-right"},BY={key:0,class:"ctx-group"},FY={class:"ctx-num"},HY=["onKeydown"],WY={key:0,class:"think-suffix"},zY=["aria-label"],UY=["aria-label"],qY={key:0,class:"md-section"},jY=["onClick"],VY={class:"md-check"},KY={class:"md-name"},GY={class:"md-provider"},YY={key:1,class:"md-divider"},XY={key:2,class:"md-section"},QY=["onClick"],ZY={class:"md-check"},JY={class:"md-name"},eX={key:3,class:"md-divider"},tX=["disabled"],nX={class:"md-check"},sX={class:"md-name"},oX={key:0,class:"md-note"},iX={key:1,class:"md-note"},rX={class:"md-name"},bS=36,lX=Ve({__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=W(()=>s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=Nt(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=eY({sessionId:()=>s.sessionId}),f=Z(!1);function h(){f.value=!f.value,gt(()=>{c(),_(),a.value?.focus()})}function p(){f.value&&(f.value=!1,gt(c))}function m(et){if(typeof getComputedStyle>"u")return bS;const it=Number.parseFloat(getComputedStyle(et).minHeight);return Number.isFinite(it)&&it>0?it:bS}const b=Z(!1);function _(){const et=a.value;b.value=!!et&&et.scrollHeight>m(et)}Ye(l,()=>{gt(_)}),Ye(()=>s.sessionId,()=>{f.value=!1});const g=QG({text:l,textareaRef:a,autosize:c,sessionId:()=>s.sessionId}),{open:v,items:y,active:C,update:L,select:$}=ZG({text:l,textareaRef:a,autosize:c,skills:()=>s.skills,emitCommand:et=>i("command",et),historyPush:et=>g.push(et),clearDraft:d}),{open:k,items:M,active:E,loading:O,update:S,select:I}=JG({text:l,textareaRef:a,autosize:c,searchFiles:()=>s.searchFiles});function P(){g.resetBrowsing(),L(),S()}const{attachments:D,previewAttachment:H,fileInputRef:z,isDragOver:U,removeAttachment:Q,openAttachmentPreview:X,closeAttachmentPreview:ue,openFilePicker:me,handleFileInputChange:Ae,handleDragOver:be,handleDragLeave:ze,handleDrop:qe,clearAfterSubmit:Fe}=tY({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});bn(()=>{l.value&&gt(()=>{c(),_()})}),_n(()=>{document.removeEventListener("mousedown",At),q()});function Le(){a.value?.focus({preventScroll:!0})}t({loadForEdit:u,focus:Le});function le(){const et=l.value.trim();if(D.value.some(pt=>pt.uploading))return;const it=D.value.filter(pt=>!pt.uploading&&!pt.error&&pt.fileId);if(!et&&it.length===0)return;if(g.push(et),et){const pt=GG(et),ti=pt?u3(s.skills).some(hi=>hi.name===pt.cmd):!1;if(pt&&ti){l.value="",d(),v.value=!1,p(),i("command",pt.arg?`${pt.cmd} ${pt.arg}`:pt.cmd);return}}const lt={text:et,attachments:it.map(pt=>({fileId:pt.fileId,kind:pt.kind}))};H.value=null,Fe(),l.value="",d(),v.value=!1,k.value=!1,p(),i("submit",lt)}function F(){if(!s.running||D.value.some(pt=>pt.uploading))return;const et=l.value.trim(),it=D.value.filter(pt=>!pt.uploading&&!pt.error&&pt.fileId);if(!et&&it.length===0&&s.queued.length===0)return;const lt={text:et,attachments:it.map(pt=>({fileId:pt.fileId,kind:pt.kind}))};Fe(),g.push(et),l.value="",d(),v.value=!1,k.value=!1,p(),i("steer",lt)}let te=!1,ee=null;function q(){ee!==null&&(clearTimeout(ee),ee=null)}function Y(){q(),te=!0}function de(){q(),ee=setTimeout(()=>{ee=null,te=!1},0)}function ne(et){return te||et.isComposing||et.keyCode===229}function ce(et){if(!ne(et)){if(et.key==="Escape"){if(re.value){et.preventDefault(),ae();return}if(he.value){et.preventDefault(),Ke();return}}if(v.value){if(et.key==="ArrowDown"){et.preventDefault(),C.value=(C.value+1)%y.value.length;return}if(et.key==="ArrowUp"){et.preventDefault(),C.value=(C.value-1+y.value.length)%y.value.length;return}if(et.key==="Enter"||et.key==="Tab"){et.preventDefault();const it=y.value[C.value];it&&$(it);return}if(et.key==="Escape"){et.preventDefault(),v.value=!1;return}}if(k.value&&!O.value){if(et.key==="ArrowDown"){et.preventDefault(),E.value=(E.value+1)%Math.max(1,M.value.length);return}if(et.key==="ArrowUp"){et.preventDefault(),E.value=(E.value-1+Math.max(1,M.value.length))%Math.max(1,M.value.length);return}if(et.key==="Enter"||et.key==="Tab"){et.preventDefault();const it=M.value[E.value];it&&I(it);return}if(et.key==="Escape"){et.preventDefault(),k.value=!1;return}}if(et.key==="s"&&(et.ctrlKey||et.metaKey)&&!et.shiftKey&&!et.altKey){s.running&&(et.preventDefault(),F());return}if(!f.value&&!v.value&&!k.value&&!et.shiftKey&&!et.altKey&&!et.metaKey&&!et.ctrlKey){const it=g.isBrowsing();if(et.key==="ArrowUp"&&g.hasHistory()&&(it||g.caretAtTextStart())){et.preventDefault(),g.recallOlder();return}if(et.key==="ArrowDown"&&it){et.preventDefault(),g.recallNewer();return}}if(et.key==="Enter"&&!et.shiftKey){if(f.value&&!(et.metaKey||et.ctrlKey))return;et.preventDefault(),le()}}}const j=W(()=>r("composer.send")),G=W(()=>!!s.uploadImage),re=Z(!1),he=Z(!1),Ce=Z(null);function Ee(){re.value=!re.value,re.value?(he.value=!1,Ge(),document.addEventListener("click",st,!0)):document.removeEventListener("click",st,!0)}function ae(){re.value=!1,he.value||document.removeEventListener("click",st,!0)}function xe(){he.value=!he.value,he.value?(re.value=!1,Ge(),document.addEventListener("click",st,!0)):document.removeEventListener("click",st,!0)}function Ke(){he.value=!1,re.value||document.removeEventListener("click",st,!0)}function st(et){Ce.value&&!Ce.value.contains(et.target)&&(ae(),Ke())}_n(()=>{document.removeEventListener("click",st,!0)});const _t=et=>`${Math.round(et/1e3)}k`,wt=W(()=>{const et=s.status?.ctxMax??0;return et<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/et*100)))}),Et=W(()=>{const et=(s.status?.ctxUsed??0).toLocaleString(),it=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:et,max:it,pct:wt.value})}),Ot=W(()=>wt.value>=80),bt=W(()=>{const et=s.status?.modelId??s.status?.model??"";return s.models?.find(it=>it.id===et||it.model===et||it.displayName===s.status?.model)}),Kt=W(()=>d3(bt.value)),Fn=W(()=>Kt.value==="toggle"),$n=W(()=>Kt.value==="always-on"?!0:Kt.value==="unsupported"?!1:(s.thinking??"off")!=="off");function Rt(){Fn.value&&i("setThinking",$n.value?"off":"high")}const nn=W(()=>s.planMode===!0),Hn=W(()=>s.swarmMode===!0),nt=W(()=>s.activationBadges?.goal!==null),Pn=W(()=>nt.value||s.goalMode===!0),fn=Z(!1),Gn=Z(null),Rn=Z(null),gs=Z({}),Xe=W(()=>nn.value||Hn.value||Pn.value);function Ge(){fn.value=!1,document.removeEventListener("mousedown",At)}function At(et){const it=et.target;Gn.value?.contains(it)||Rn.value?.contains(it)||Ge()}function jt(){if(fn.value){Ge();return}ae(),Ke();const et=Gn.value?.getBoundingClientRect();et&&(gs.value={left:`${Math.round(et.left)}px`,bottom:`${Math.round(window.innerHeight-et.top+8)}px`}),fn.value=!0,setTimeout(()=>document.addEventListener("mousedown",At),0)}const Xt=[{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 Nn(et){i("setPermission",et),Ke()}const An=W(()=>Xt.find(et=>et.mode===s.status?.permission)),ts=W(()=>An.value?r(An.value.labelKey):""),It=W(()=>bt.value?.provider??""),Tn=W(()=>!It.value||!s.models?.length?[]:s.models.filter(et=>et.provider===It.value)),Qt=W(()=>new Set(s.starredIds??[]));function _s(et){return Qt.value.has(et)}const ei=W(()=>s.models?.length?s.models.filter(et=>_s(et.id)&&et.provider!==It.value):[]);function No(et){i("selectModel",et),ae()}return(et,it)=>(w(),N("div",{class:De(["composer",{"drag-over":A(U),expanded:f.value}]),onDragover:it[18]||(it[18]=(...lt)=>A(be)&&A(be)(...lt)),onDragleave:it[19]||(it[19]=(...lt)=>A(ze)&&A(ze)(...lt)),onDrop:it[20]||(it[20]=(...lt)=>A(qe)&&A(qe)(...lt))},[A(D).length>0?(w(),N("div",rY,[(w(!0),N(Oe,null,ot(A(D),lt=>(w(),N("div",{key:lt.localId,class:De(["att-chip",{"att-error":lt.error}])},[oe(Wt,{text:A(r)("composer.previewAttachment",{name:lt.name})},{default:ke(()=>[T("button",{type:"button",class:"att-preview",onClick:pt=>A(X)(lt)},[lt.kind==="video"?(w(),N("video",{key:0,class:"att-thumb",src:lt.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,aY)):(w(),N("img",{key:1,class:"att-thumb",src:lt.previewUrl,alt:lt.name},null,8,cY)),lt.kind==="video"?(w(),N("span",uY,[oe(Je,{name:"play",size:"sm"})])):ie("",!0)],8,lY)]),_:2},1032,["text"]),T("span",dY,R(lt.name),1),lt.uploading?(w(),ge(Zo,{key:0,size:"sm",label:A(r)("composer.uploading")},null,8,["label"])):lt.error?(w(),ge(Wt,{key:1,text:A(r)("composer.uploadFailed")},{default:ke(()=>[T("span",fY,[oe(Je,{name:"info",size:"sm"})])]),_:1},8,["text"])):ie("",!0),oe(Wt,{text:A(r)("composer.removeNamed",{name:lt.name})},{default:ke(()=>[T("button",{class:"att-rm",onClick:pt=>A(Q)(lt.localId)},[oe(Je,{name:"close",size:"sm"})],8,pY)]),_:2},1032,["text"])],2))),128))])):ie("",!0),A(H)?(w(),N("div",{key:1,class:"att-lightbox",onClick:it[1]||(it[1]=vt((...lt)=>A(ue)&&A(ue)(...lt),["self"]))},[T("div",hY,[oe(Wt,{text:A(r)("model.close")},{default:ke(()=>[T("button",{type:"button",class:"att-lightbox-close",onClick:it[0]||(it[0]=(...lt)=>A(ue)&&A(ue)(...lt))},"✕")]),_:1},8,["text"]),A(H).kind==="video"?(w(),N("video",{key:0,class:"att-lightbox-media",src:A(H).previewUrl,controls:"",playsinline:""},null,8,mY)):(w(),N("img",{key:1,class:"att-lightbox-media",src:A(H).previewUrl,alt:A(H).name},null,8,gY)),T("div",vY,R(A(H).name),1)])])):ie("",!0),T("div",yY,[T("div",kY,[A(v)?(w(),ge(BG,{key:0,items:A(y),"active-index":A(C),onSelect:A($),onHover:it[2]||(it[2]=lt=>C.value=lt)},null,8,["items","active-index","onSelect"])):ie("",!0),A(k)?(w(),ge(KG,{key:1,items:A(M),"active-index":A(E),loading:A(O),onSelect:A(I),onHover:it[3]||(it[3]=lt=>E.value=lt)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),T("div",bY,[In(T("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":it[4]||(it[4]=lt=>Jn(l)?l.value=lt:null),class:"ph",placeholder:o.value,rows:"1",onKeydown:ce,onCompositionstart:Y,onCompositionend:de,onInput:P},null,40,_Y),[[mo,A(l)]]),f.value||b.value?(w(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?A(r)("composer.collapseTitle"):A(r)("composer.expandTitle"),onClick:h},[f.value?(w(),ge(Je,{key:0,name:"collapse",size:"sm"})):(w(),ge(Je,{key:1,name:"expand",size:"sm"}))],8,wY)):ie("",!0)])]),G.value?(w(),N("input",{key:0,ref_key:"fileInputRef",ref:z,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:it[5]||(it[5]=(...lt)=>A(Ae)&&A(Ae)(...lt))},null,544)):ie("",!0),T("div",{ref_key:"toolbarRef",ref:Ce,class:"toolbar"},[T("div",SY,[G.value?(w(),ge(mn,{key:0,size:"md",label:A(r)("composer.attachImage"),onClick:A(me)},{default:ke(()=>[oe(Je,{name:"image"})]),_:1},8,["label","onClick"])):ie("",!0),e.status?(w(),N("span",{key:1,class:De(["perm-pill",["perm-"+e.status.permission,{open:he.value}]]),role:"button",tabindex:"0",onClick:vt(xe,["stop"]),onKeydown:[li(xe,["enter"]),li(vt(xe,["prevent"]),["space"])]},R(ts.value),43,CY)):ie("",!0),he.value&&e.status?(w(),N("div",{key:2,class:"perm-dropdown",role:"menu",onClick:it[6]||(it[6]=vt(()=>{},["stop"]))},[(w(),N(Oe,null,ot(Xt,lt=>T("button",{key:lt.mode,class:De(["pd-row",{"is-current":lt.mode===e.status.permission}]),role:"menuitem",onClick:pt=>Nn(lt.mode)},[T("span",AY,[lt.mode===e.status.permission?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",TY,[T("span",{class:"pd-name",style:Yt({color:lt.color})},R(A(r)(lt.labelKey)),5),T("span",MY,R(A(r)(lt.descKey)),1)])],10,xY)),64))])):ie("",!0),e.status?(w(),N("div",{key:3,ref_key:"modesRef",ref:Gn,class:"modes"},[T("button",{type:"button",class:De(["mode-pill",{on:Xe.value,open:fn.value}]),onClick:vt(jt,["stop"])},[T("span",EY,R(A(r)("status.modesLabel")),1),nn.value?(w(),N("span",IY,R(A(r)("status.planLabel")),1)):ie("",!0),Hn.value?(w(),N("span",$Y,R(A(r)("status.swarmLabel")),1)):ie("",!0),Pn.value?(w(),N("span",NY,R(A(r)("status.goalLabel")),1)):ie("",!0)],2),fn.value?(w(),N("div",{key:0,ref_key:"modesMenuRef",ref:Rn,class:"modes-menu",style:Yt(gs.value)},[T("button",{type:"button",class:De(["mode-row",{on:nn.value}]),onClick:it[7]||(it[7]=lt=>i("togglePlan"))},[T("span",LY,R(A(r)("status.planLabel")),1),T("span",{class:De(["mode-switch",{on:nn.value}])},[...it[21]||(it[21]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("button",{type:"button",class:De(["mode-row",{on:Hn.value}]),onClick:it[8]||(it[8]=lt=>i("toggleSwarm"))},[T("span",OY,R(A(r)("status.swarmLabel")),1),T("span",{class:De(["mode-switch",{on:Hn.value}])},[...it[22]||(it[22]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("div",{class:De(["mode-row mode-row-goal",{on:nt.value||s.goalMode}])},[T("button",{type:"button",class:"mode-row-main",onClick:it[9]||(it[9]=lt=>nt.value?i("controlGoal","cancel"):i("toggleGoal"))},[T("span",PY,R(A(r)("status.goalLabel")),1),nt.value?ie("",!0):(w(),N("span",{key:0,class:De(["mode-switch",{on:s.goalMode}])},[...it[23]||(it[23]=[T("span",{class:"mode-knob"},null,-1)])],2))]),nt.value?(w(),N("div",RY,[T("button",{type:"button",class:"mode-row-action",onClick:it[10]||(it[10]=lt=>i("controlGoal","pause"))},R(A(r)("status.goalPause")),1),T("button",{type:"button",class:"mode-row-action",onClick:it[11]||(it[11]=lt=>i("controlGoal","resume"))},R(A(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),T("div",DY,[Ot.value?(w(),N("button",{key:0,class:"compact-chip",onClick:it[12]||(it[12]=vt(lt=>i("compact"),["stop"]))},"/compact")):ie("",!0),oe(Wt,{text:Et.value},{default:ke(()=>[e.status&&!e.hideContext?(w(),N("span",BY,[oe(iY,{pct:wt.value},null,8,["pct"]),T("span",FY,R(_t(e.status.ctxUsed))+"/"+R(_t(e.status.ctxMax)),1)])):ie("",!0)]),_:1},8,["text"]),e.status?(w(),N("span",{key:1,class:De(["model-pill",{open:re.value}]),role:"button",tabindex:"0",onClick:vt(Ee,["stop"]),onKeydown:[li(Ee,["enter"]),li(vt(Ee,["prevent"]),["space"])]},[T("b",null,R(e.status.model),1),$n.value?(w(),N("span",WY,R(A(r)("composer.thinkingSuffix")),1)):ie("",!0),oe(Je,{class:"cv",name:"chevron-down",size:"sm"})],42,HY)):ie("",!0),e.running?(w(),ge(Wt,{key:2,text:A(r)("composer.interruptTitle")},{default:ke(()=>[T("button",{class:"stop","aria-label":A(r)("composer.interrupt"),onClick:it[13]||(it[13]=lt=>i("interrupt"))},[oe(Je,{name:"stop",size:"sm"})],8,zY)]),_:1},8,["text"])):ie("",!0),T("button",{class:"send","aria-label":j.value,onClick:it[14]||(it[14]=lt=>le())},[oe(Je,{name:"send",size:"sm"})],8,UY)]),re.value&&e.status?(w(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:it[17]||(it[17]=vt(()=>{},["stop"]))},[ei.value.length>0?(w(),N("div",qY,R(A(r)("status.starredModels")),1)):ie("",!0),(w(!0),N(Oe,null,ot(ei.value,lt=>(w(),N("button",{key:lt.id,class:De(["md-row",{"is-current":lt.id===e.status.modelId}]),role:"menuitem",onClick:pt=>No(lt.id)},[T("span",VY,[lt.id===e.status.model||lt.model===e.status.model||lt.displayName===e.status.model?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",KY,R(lt.displayName??lt.model),1),T("span",GY,R(lt.provider),1),oe(Je,{class:"md-star",name:"star",size:"sm"})],10,jY))),128)),ei.value.length>0?(w(),N("div",YY)):ie("",!0),Tn.value.length>0?(w(),N("div",XY,R(It.value),1)):ie("",!0),(w(!0),N(Oe,null,ot(Tn.value,lt=>(w(),N("button",{key:lt.id,class:De(["md-row",{"is-current":lt.id===e.status.modelId}]),role:"menuitem",onClick:pt=>No(lt.id)},[T("span",ZY,[lt.id===e.status.model||lt.model===e.status.model||lt.displayName===e.status.model?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",JY,R(lt.displayName??lt.model),1),_s(lt.id)?(w(),ge(Je,{key:0,class:"md-star",name:"star",size:"sm"})):ie("",!0)],10,QY))),128)),Tn.value.length>0?(w(),N("div",eX)):ie("",!0),T("button",{class:De(["md-row md-row-toggle",{"is-on":$n.value,"is-disabled":!Fn.value}]),role:"menuitem",disabled:!Fn.value,onClick:it[15]||(it[15]=lt=>Rt())},[T("span",nX,[$n.value?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",sX,R(A(r)("status.thinkingLabel")),1),Kt.value==="always-on"?(w(),N("span",oX,R(A(r)("status.planOn")),1)):Kt.value==="unsupported"?(w(),N("span",iX,R(A(r)("status.modeNotSupported")),1)):ie("",!0)],10,tX),it[24]||(it[24]=T("div",{class:"md-divider"},null,-1)),T("button",{class:"md-row md-row-more",role:"menuitem",onClick:it[16]||(it[16]=lt=>{ae(),i("pickModel")})},[T("span",rX,R(A(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),f3=ft(lX,[["__scopeId","data-v-0924690c"]]),aX=["id"],cX=["aria-expanded"],uX={class:"swarm-meta"},dX={class:"swarm-meta"},fX={class:"swarm-body"},pX={class:"row-name"},hX={key:0,class:"row-type"},mX={key:0,class:"row-activity"},gX={class:"row-phase"},vX=Ve({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=Z(!0),s=W(()=>t.group.members.length),o=W(()=>t.group.counts.completed+t.group.counts.failed),i=W(()=>t.group.counts.working+t.group.counts.queued+t.group.counts.suspended),r=W(()=>i.value>0?"running":t.group.counts.failed>0?"error":"done"),l=W(()=>{switch(r.value){case"running":return`${i.value} running`;case"error":return"has failures";default:return"completed"}});function a(f){switch(f){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(f){return f.outputLines?.map(h=>h.trimEnd()).filter(Boolean).at(-1)}function u(f){return f.suspendedReason||c(f)||f.summary}function d(){n.value=!n.value}return(f,h)=>(w(),N("section",{class:De(["swarm-card",{open:n.value}]),id:`swarm-${e.group.id}`},[T("button",{class:"swarm-head",type:"button","aria-expanded":n.value,onClick:d},[oe(Ru,{status:r.value},null,8,["status"]),oe(Je,{class:"swarm-ic",name:"git-pull-request",size:"sm"}),h[0]||(h[0]=T("span",{class:"swarm-title"},"Swarm",-1)),T("span",uX,"· "+R(o.value)+"/"+R(s.value),1),T("span",dX,"· "+R(l.value),1),oe(Je,{class:"swarm-car",name:"chevron-right",size:"sm"})],8,cX),In(T("div",fX,[(w(!0),N(Oe,null,ot(e.group.members,p=>(w(),N("div",{key:p.id,class:De(["swarm-row",`phase-${p.phase}`])},[oe(Ru,{class:"row-dot",status:p.phase},null,8,["status"]),oe(Wt,{text:p.name},{default:ke(()=>[T("span",pX,R(p.name),1)]),_:2},1032,["text"]),p.subagentType?(w(),N("span",hX,R(p.subagentType),1)):ie("",!0),oe(Wt,{text:u(p)},{default:ke(()=>[u(p)?(w(),N("span",mX,R(u(p)),1)):ie("",!0)]),_:2},1032,["text"]),T("span",gX,R(a(p.phase)),1)],2))),128))],512),[[Vo,n.value]])],10,aX))}}),yX=ft(vX,[["__scopeId","data-v-e56cfe7c"]]),kX={key:0,class:"ui-card__head"},bX={class:"ui-card__body"},_X={key:1,class:"ui-card__foot"},wX=Ve({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),N("div",kX,[xn(t.$slots,"head",{},void 0,!0)])):ie("",!0),T("div",bX,[xn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),N("div",_X,[xn(t.$slots,"foot",{},void 0,!0)])):ie("",!0)],2))}}),ly=ft(wX,[["__scopeId","data-v-9c9f9a9a"]]),SX=["type","disabled"],CX={class:"ui-button__content"},xX=Ve({__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:De(["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(),ge(Zo,{key:0,size:"sm",class:"ui-button__spinner"})):ie("",!0),T("span",CX,[xn(t.$slots,"default",{},void 0,!0)])],10,SX))}}),Pt=ft(xX,[["__scopeId","data-v-e58393a8"]]),AX={class:"goal-progress","aria-hidden":"true"},TX={class:"goal-full"},MX={key:0,class:"goal-criterion"},EX={class:"goal-stats"},IX={class:"goal-actions"},$X=Ve({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=Z(!1);Ye(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=W(()=>{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(),ge(ly,{class:De(["goal-strip",{expanded:i.value}])},G1({head:ke(()=>[T("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[4]||(c[4]=T("span",{class:"goal-kicker"},"Goal",-1)),T("span",{class:De(["goal-objective",{"expanded-hidden":i.value}])},R(e.goal.objective),3),oe(Is,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:ke(()=>[je(R(e.goal.status),1)]),_:1},8,["variant"]),T("span",AX,[T("span",{class:"goal-progress-fill",style:Yt({width:`${r.value}%`})},null,4)]),oe(Je,{class:De(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:ke(()=>[T("div",TX,R(e.goal.objective),1),e.goal.completionCriterion?(w(),N("div",MX,[c[5]||(c[5]=T("span",null,"Done when",-1)),T("p",null,R(e.goal.completionCriterion),1)])):ie("",!0),T("div",EX,[oe(Is,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(e.goal.turnsUsed)+" turns",1)]),_:1}),oe(Is,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(e.goal.tokensUsed.toLocaleString())+" tokens",1)]),_:1}),oe(Is,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(l(e.goal.wallClockMs)),1)]),_:1}),e.goal.budget.tokenBudget!==null?(w(),ge(Is,{key:0,variant:"neutral",size:"sm"},{default:ke(()=>[je(R(r.value)+"% token budget",1)]),_:1})):ie("",!0)])]),key:"0"}:void 0,i.value?{name:"foot",fn:ke(()=>[T("div",IX,[e.goal.status!=="paused"?(w(),ge(Pt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:c[1]||(c[1]=vt(u=>s("controlGoal","pause"),["stop"]))},{default:ke(()=>[je(R(A(o)("status.goalPause")),1)]),_:1})):ie("",!0),e.goal.status==="paused"?(w(),ge(Pt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:c[2]||(c[2]=vt(u=>s("controlGoal","resume"),["stop"]))},{default:ke(()=>[je(R(A(o)("status.goalResume")),1)]),_:1})):ie("",!0),oe(Pt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:c[3]||(c[3]=vt(u=>s("controlGoal","cancel"),["stop"]))},{default:ke(()=>[je(R(A(o)("status.goalCancel")),1)]),_:1})])]),key:"1"}:void 0]),1032,["class"]))}}),NX=ft($X,[["__scopeId","data-v-eaeefe1e"]]),LX={class:"qh"},OX={class:"qtitle"},PX={key:0,class:"qstep"},RX={key:1,class:"qmin-peek"},DX={class:"qbody"},BX=["aria-label"],FX=["aria-selected","aria-label","onClick"],HX={class:"qstep-num"},WX={key:1,class:"qheader-chip"},zX={class:"qtext"},UX={class:"qopts"},qX=["onClick"],jX={class:"qopt-key"},VX={class:"qopt-glyph"},KX={key:0,class:"chk"},GX={key:1,class:"rad"},YX={class:"qopt-text"},XX={class:"qopt-label"},QX={key:0,class:"qopt-desc"},ZX={class:"qopt-glyph"},JX={key:0,class:"chk"},eQ={key:1,class:"rad"},tQ={class:"qopt-label"},nQ=["placeholder"],sQ={class:"qfoot"},oQ=Ve({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Nt(),o=t,i=Z(0),r=Z(!1),l=W(()=>n.question.questions[i.value]),a=W(()=>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 z=p.value[H];return z?z.kind==="multi"?z.optionIds.length>0:z.kind==="multiWithOther"?z.optionIds.length>0||z.otherText.trim().length>0:z.kind==="other"?z.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=Z({});function m(H){return H.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${H.label} ${H.description??""}`.toLowerCase())}function b(){const H={...p.value};let z=!1;for(const U of n.question.questions){if(H[U.id])continue;const Q=U.options.filter(m);Q.length!==0&&(H[U.id]=U.multiSelect?{kind:"multi",optionIds:Q.map(X=>X.id)}:{kind:"single",optionId:Q[0].id},z=!0)}z&&(p.value=H)}Ye(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Ye(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function _(H,z){const U=p.value[H];if(U&&U.kind==="single"&&U.optionId===z){const Q={...p.value};delete Q[H],p.value=Q}else p.value={...p.value,[H]:{kind:"single",optionId:z}}}function g(H,z){const U=p.value[H],Q=U&&(U.kind==="multi"||U.kind==="multiWithOther")?U.kind==="multi"?[...U.optionIds]:[...U.optionIds]:[],X=Q.indexOf(z);X>=0?Q.splice(X,1):Q.push(z);const ue=p.value[H],me=ue&&ue.kind==="multiWithOther"?ue.otherText:"";me?p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:Q,otherText:me}}:p.value={...p.value,[H]:{kind:"multi",optionIds:Q}}}const v=Z({}),y=Z(null);function C(H){const z=n.question.questions.find(Q=>Q.id===H),U=v.value[H]??"";if(z.multiSelect){const Q=p.value[H],X=Q&&(Q.kind==="multi"||Q.kind==="multiWithOther")?Q.kind==="multi"?[...Q.optionIds]:[...Q.optionIds]:[];p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:X,otherText:U}}}else p.value={...p.value,[H]:{kind:"other",text:U}}}function L(H){C(H),gt(()=>y.value?.focus())}function $(H,z){const U=p.value[H];return U?U.kind==="single"?U.optionId===z:U.kind==="multi"||U.kind==="multiWithOther"?U.optionIds.includes(z):!1:!1}function k(H){const z=p.value[H];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function M(){return n.question.questions.every(H=>f(H.id))}const E=W(()=>n.busyKind==="answer"),O=W(()=>n.busyKind==="dismiss"),S=W(()=>!!n.busyKind);function I(){if(S.value||!M())return;const H={answers:p.value,method:"click"};o("answer",n.question.questionId,H)}function P(){S.value||o("dismiss",n.question.questionId)}function D(H){const z=(document.activeElement?.tagName??"").toLowerCase(),U=z==="input"||z==="textarea";if(S.value)return;if(H.key==="Enter"){if(H.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():M()&&I();return}if(U)return;if(H.key==="Escape"){H.preventDefault(),P();return}if(r.value)return;const Q=parseInt(H.key,10);if(!isNaN(Q)&&Q>=1&&Q<=9){H.preventDefault();const X=l.value,ue=Q-1,me=X.options[ue];me&&(X.multiSelect?g(X.id,me.id):_(X.id,me.id))}}return bn(()=>document.addEventListener("keydown",D)),_n(()=>document.removeEventListener("keydown",D)),(H,z)=>(w(),ge(ly,{class:De(["qcard",{minimized:r.value}])},G1({head:ke(()=>[T("div",LX,[z[5]||(z[5]=T("span",{class:"qh-ic"},"?",-1)),T("span",OX,R(A(s)("question.title")),1),a.value>1&&!r.value?(w(),N("span",PX,R(A(s)("question.step",{current:i.value+1,total:a.value})),1)):ie("",!0),r.value?(w(),N("span",RX,R(l.value.question),1)):ie("",!0),oe(mn,{class:"qmin",size:"sm",label:r.value?A(s)("question.expand"):A(s)("question.minimize"),onClick:z[0]||(z[0]=U=>r.value=!r.value)},{default:ke(()=>[r.value?(w(),ge(Je,{key:0,name:"chevron-down",size:"md"})):(w(),ge(Je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:ke(()=>[T("div",DX,[a.value>1?(w(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":A(s)("question.step",{current:i.value+1,total:a.value})},[(w(!0),N(Oe,null,ot(n.question.questions,(U,Q)=>(w(),N("button",{key:U.id,type:"button",class:De(["qstep-dot",{active:Q===i.value,answered:f(U.id)}]),"aria-selected":Q===i.value,"aria-label":A(s)("question.step",{current:Q+1,total:a.value}),onClick:X=>d(Q)},[T("span",HX,R(Q+1),1)],10,FX))),128))],8,BX)):ie("",!0),l.value.header?(w(),N("div",WX,[oe(Is,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(l.value.header),1)]),_:1})])):ie("",!0),T("div",zX,R(l.value.question),1),l.value.body?(w(),ge(Ih,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),T("div",UX,[(w(!0),N(Oe,null,ot(l.value.options,(U,Q)=>(w(),N("label",{key:U.id,class:De(["qopt",{selected:$(l.value.id,U.id)}]),onClick:vt(X=>l.value.multiSelect?g(l.value.id,U.id):_(l.value.id,U.id),["prevent"])},[T("span",jX,R(Q+1),1),T("span",VX,[l.value.multiSelect?(w(),N("span",KX,R($(l.value.id,U.id)?"■":"□"),1)):(w(),N("span",GX,R($(l.value.id,U.id)?"●":"○"),1))]),T("span",YX,[T("span",XX,R(U.label),1),U.description?(w(),N("span",QX,R(U.description),1)):ie("",!0)])],10,qX))),128)),l.value.allowOther?(w(),N("label",{key:0,class:De(["qopt",{selected:k(l.value.id)}]),onClick:z[4]||(z[4]=vt(U=>L(l.value.id),["prevent"]))},[z[6]||(z[6]=T("span",{class:"qopt-key"},null,-1)),T("span",ZX,[l.value.multiSelect?(w(),N("span",JX,R(k(l.value.id)?"■":"□"),1)):(w(),N("span",eQ,R(k(l.value.id)?"●":"○"),1))]),T("span",tQ,R(l.value.otherLabel??A(s)("question.otherDefault")),1),In(T("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":z[1]||(z[1]=U=>v.value[l.value.id]=U),class:"other-input",type:"text",placeholder:l.value.otherLabel??A(s)("question.otherDefault"),onInput:z[2]||(z[2]=U=>C(l.value.id)),onFocus:z[3]||(z[3]=U=>C(l.value.id))},null,40,nQ),[[mo,v.value[l.value.id]]])],2)):ie("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:ke(()=>[T("div",sQ,[i.value<a.value-1?(w(),ge(Pt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:ke(()=>[je(R(A(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),ge(Pt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!M(),loading:E.value,onClick:I},{default:ke(()=>[je(R(A(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),ge(Pt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:ke(()=>[je(R(A(s)("question.back")),1)]),_:1},8,["disabled"])):ie("",!0),oe(Pt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:O.value,disabled:S.value,onClick:P},{default:ke(()=>[je(R(A(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),iQ=ft(oQ,[["__scopeId","data-v-08fbd85e"]]),rQ={class:"ah"},lQ={class:"akind"},aQ={class:"apath"},cQ={class:"ah-path"},uQ={key:1,class:"diff"},dQ={class:"dg"},fQ={class:"dc"},pQ={key:2,class:"body-shell"},hQ={class:"shell-cmd"},mQ={key:0,class:"shell-cwd"},gQ={key:1,class:"shell-danger"},vQ={key:3,class:"body-file"},yQ={class:"file-bar"},kQ={class:"file-lang"},bQ={class:"file-content"},_Q={class:"file-ln"},wQ={class:"file-text"},SQ={key:4,class:"body-chip"},CQ={class:"chip-label"},xQ={class:"chip-value"},AQ={key:0,class:"chip-detail"},TQ={key:5,class:"body-chip"},MQ={key:0,class:"chip-label"},EQ={class:"chip-value"},IQ={key:6,class:"body-chip"},$Q={class:"chip-label"},NQ={class:"chip-value"},LQ={key:0,class:"chip-detail"},OQ={key:7,class:"body-chip"},PQ={class:"chip-label"},RQ={class:"chip-value"},DQ={key:0,class:"chip-detail"},BQ={key:8,class:"body-todo"},FQ={class:"todo-glyph"},HQ={key:9,class:"body-plan"},WQ={key:10,class:"body-generic"},zQ={class:"gen-text"},UQ={key:11,class:"feedback-wrap"},qQ=["placeholder"],jQ={class:"feedback-hint"},VQ={key:0,class:"plan-actions"},KQ={class:"k"},GQ={key:0,class:"k"},YQ={key:0,class:"k"},XQ={key:1,class:"abtn"},QQ=Ve({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=W(()=>{const E=n.block;return E.kind!=="plan_review"?null:{plan:E.plan,path:E.path,options:E.options??[]}}),r=Z(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const E=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${E}`)}const c=Z(!1),u=Z(""),d=Z(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const E=u.value.trim();i.value?_("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:E||void 0}):_("feedback",{decision:"rejected",feedback:E||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(E){E.key==="Enter"&&!E.shiftKey?(E.preventDefault(),h()):E.key==="Escape"&&(E.preventDefault(),p())}const b=Z(null);Ye(()=>n.busy,E=>{E||(b.value=null)});function _(E,O){n.busy||(b.value=E,s("decide",O))}function g(){_("approve",{decision:"approved"})}function v(){_("approveSession",{decision:"approved",scope:"session"})}function y(){_("reject",{decision:"rejected"})}function C(){_("approvePlan",{decision:"approved"})}function L(E){_(`option:${E}`,{decision:"approved",selectedLabel:E})}function $(){n.busy||f()}function k(){_("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function M(E){const O=(document.activeElement?.tagName??"").toLowerCase();if(O==="input"||O==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){E.key==="1"?(E.preventDefault(),C()):E.key==="2"?(E.preventDefault(),$()):E.key==="3"&&(E.preventDefault(),k());return}E.key==="1"&&S.options[0]?(E.preventDefault(),L(S.options[0].label)):E.key==="2"&&S.options[1]?(E.preventDefault(),L(S.options[1].label)):E.key==="3"&&S.options[2]&&(E.preventDefault(),L(S.options[2].label));return}E.key==="1"?(E.preventDefault(),g()):E.key==="2"?(E.preventDefault(),v()):E.key==="3"?(E.preventDefault(),y()):E.key==="4"&&(E.preventDefault(),f())}return bn(()=>document.addEventListener("keydown",M)),_n(()=>document.removeEventListener("keydown",M)),(E,O)=>(w(),ge(ly,{class:De(["appr",{minimized:r.value}])},G1({head:ke(()=>[T("div",rQ,[O[2]||(O[2]=T("span",{class:"ah-ic"},"!",-1)),T("span",lQ,R(a()),1),T("span",aQ,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),N(Oe,{key:0},[je(R(e.block.path),1)],64)):e.block.kind==="shell"?(w(),N(Oe,{key:1},[je(R(e.block.command),1)],64)):e.block.kind==="url"?(w(),N(Oe,{key:2},[je(R(e.block.url),1)],64)):e.block.kind==="search"?(w(),N(Oe,{key:3},[je(R(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),N(Oe,{key:4},[je(R(e.block.name),1)],64)):e.block.kind==="generic"?(w(),N(Oe,{key:5},[je(R(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(w(),ge(Is,{key:0,variant:"neutral",size:"sm"},{default:ke(()=>[je(R(A(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ie("",!0),r.value?ie("",!0):(w(),ge(Is,{key:1,variant:"warning",size:"sm",class:"aw"},{default:ke(()=>[je(R(A(o)("approval.required")),1)]),_:1})),oe(mn,{class:"amin",size:"sm",label:r.value?A(o)("question.expand"):A(o)("question.minimize"),onClick:O[0]||(O[0]=S=>r.value=!r.value)},{default:ke(()=>[r.value?(w(),ge(Je,{key:0,name:"chevron-down",size:"md"})):(w(),ge(Je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:ke(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),ge(Wt,{key:0,text:e.block.path},{default:ke(()=>[T("div",cQ,R(e.block.path),1)]),_:1},8,["text"])):ie("",!0),e.block.kind==="diff"?(w(),N("div",uQ,[(w(!0),N(Oe,null,ot(e.block.diff,(S,I)=>(w(),N("div",{key:I,class:De(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[T("span",dQ,R(S.gutter),1),T("span",fQ,R(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),N("div",pQ,[T("div",hQ,[O[3]||(O[3]=T("span",{class:"shell-dollar"},"$",-1)),je(" "+R(e.block.command),1)]),e.block.cwd?(w(),N("div",mQ,"cwd: "+R(e.block.cwd),1)):ie("",!0),e.block.danger?(w(),N("div",gQ,R(A(o)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(w(),N("div",vQ,[T("div",yQ,[T("span",kQ,R(e.block.language??""),1)]),T("div",bQ,[(w(!0),N(Oe,null,ot(e.block.content.split(`
255
- `),(S,I)=>(w(),N("div",{key:I,class:"file-line"},[T("span",_Q,R(I+1),1),T("span",wQ,R(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),N("div",SQ,[T("span",CQ,R(e.block.op),1),T("span",xQ,R(e.block.path),1),e.block.detail?(w(),N("span",AQ,R(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(w(),N("div",TQ,[e.block.method?(w(),N("span",MQ,R(e.block.method),1)):ie("",!0),T("span",EQ,R(e.block.url),1)])):e.block.kind==="search"?(w(),N("div",IQ,[T("span",$Q,R(A(o)("approval.searchQueryLabel")),1),T("span",NQ,R(e.block.query),1),e.block.scope?(w(),N("span",LQ,R(A(o)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(w(),N("div",OQ,[T("span",PQ,R(e.block.kind2),1),T("span",RQ,R(e.block.name),1),e.block.description?(w(),N("span",DQ,R(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(w(),N("div",BQ,[(w(!0),N(Oe,null,ot(e.block.items,(S,I)=>(w(),N("div",{key:I,class:"todo-item"},[T("span",FQ,R(S.status==="done"||S.status==="completed"?"✓":"○"),1),T("span",{class:De(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},R(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),N("div",HQ,[oe(Ih,{text:e.block.plan},null,8,["text"])])):(w(),N("div",WQ,[T("span",zQ,R(e.block.summary),1)])),c.value?(w(),N("div",UQ,[In(T("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":O[1]||(O[1]=S=>u.value=S),class:"feedback-ta",placeholder:A(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,qQ),[[mo,u.value]]),T("div",jQ,R(A(o)("approval.feedbackHint")),1)])):ie("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:ke(()=>[i.value?(w(),N("div",VQ,[i.value.options.length>0?(w(!0),N(Oe,{key:0},ot(i.value.options,(S,I)=>(w(),ge(Wt,{key:I,text:S.description},{default:ke(()=>[oe(Pt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:P=>L(S.label)},{default:ke(()=>[je(R(S.label),1),T("span",KQ,"["+R(I+1)+"]",1)]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),ge(Pt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:C},{default:ke(()=>[je(R(A(o)("approval.approvePlan")),1),O[4]||(O[4]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"])),oe(Pt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:ke(()=>[je(R(A(o)("approval.revise")),1),i.value.options.length===0?(w(),N("span",GQ,"[2]")):ie("",!0)]),_:1},8,["disabled"]),oe(Pt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:k},{default:ke(()=>[je(R(A(o)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),N("span",YQ,"[3]")):ie("",!0)]),_:1},8,["loading","disabled"])])):(w(),N("div",XQ,[oe(Pt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:g},{default:ke(()=>[je(R(A(o)("approval.approve")),1),O[5]||(O[5]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"]),oe(Pt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:v},{default:ke(()=>[je(R(A(o)("approval.approveSession")),1),O[6]||(O[6]=T("span",{class:"k"},"[2]",-1))]),_:1},8,["loading","disabled"]),oe(Pt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:y},{default:ke(()=>[je(R(A(o)("approval.reject")),1),O[7]||(O[7]=T("span",{class:"k"},"[3]",-1))]),_:1},8,["loading","disabled"]),oe(Pt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:ke(()=>[je(R(A(o)("approval.feedback")),1),O[8]||(O[8]=T("span",{class:"k"},"[4]",-1))]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),ZQ=ft(QQ,[["__scopeId","data-v-4c0c7bdb"]]),JQ=Ve({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(w(),N("span",{class:De(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},R(n[t.status]),3))}}),p3=ft(JQ,[["__scopeId","data-v-f595d935"]]),eZ={class:"taskspane"},tZ={class:"tp-head"},nZ={class:"tp-title"},sZ={class:"tp-count"},oZ={class:"tp-list"},iZ={key:0,class:"tp-empty"},rZ=["role","onClick"],lZ={class:"tp-name"},aZ={class:"tp-time"},cZ=["onClick"],uZ={key:0,class:"tp-detail"},dZ={key:0,class:"tp-codebox"},fZ=["onClick"],pZ={class:"tp-pre"},hZ={class:"tp-cmd"},mZ={key:1,class:"tp-codebox"},gZ=["onClick"],vZ={class:"tp-pre"},yZ=Ve({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Nt(),o=$s(new Set),i=$s(new Set),r=$s(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,b){await Hs(p)&&(b.add(m),setTimeout(()=>b.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(`
256
- `)??"";m&&await d(m,p.id,r)}return(p,m)=>(w(),N("div",eZ,[T("div",tZ,[T("span",nZ,R(A(s)("tasks.tag")),1),T("span",sZ,R(e.tasks.length),1)]),T("div",oZ,[e.tasks.length===0?(w(),N("div",iZ,R(A(s)("tasks.emptyTasks")),1)):(w(!0),N(Oe,{key:1},ot(e.tasks,b=>(w(),N("div",{key:b.id,class:De(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[T("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:_=>a(b)},[oe(p3,{status:u(b.state)},null,8,["status"]),T("span",lZ,R(b.name),1),oe(Is,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(b.kind),1)]),_:2},1024),T("span",aZ,R(b.timing),1),b.state==="run"?(w(),N("button",{key:0,class:"tp-stop",onClick:vt(_=>n("cancel",b.id),["stop"])},R(A(s)("tasks.stop")),9,cZ)):ie("",!0),b.kind==="subagent"?(w(),ge(Je,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(w(),ge(Je,{key:2,class:De(["tp-chevron",{open:o.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ie("",!0)],8,rZ),o.has(b.id)&&l(b)?(w(),N("div",uZ,[b.meta?(w(),N("div",dZ,[T("button",{class:De(["tp-copy",{copied:i.has(b.id)}]),onClick:vt(_=>f(b),["stop"])},R(i.has(b.id)?"已复制":"复制"),11,fZ),T("pre",pZ,[T("code",null,[T("span",hZ,R(b.meta),1)])])])):ie("",!0),b.output&&b.output.length>0?(w(),N("div",mZ,[T("button",{class:De(["tp-copy",{copied:r.has(b.id)}]),onClick:vt(_=>h(b),["stop"])},R(r.has(b.id)?"已复制":"复制"),11,gZ),T("pre",vZ,[T("code",null,[m[0]||(m[0]=je(`
257
- `,-1)),(w(!0),N(Oe,null,ot(b.output,(_,g)=>(w(),N("span",{key:g,class:"tp-line"},R(_),1))),128)),m[1]||(m[1]=je(`
258
- `,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),_S=ft(yZ,[["__scopeId","data-v-28fd5fc0"]]),kZ={class:"todo-card"},bZ={key:0,class:"tc-empty"},_Z={class:"tc-name"},wZ=Ve({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Nt();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(w(),N("div",kZ,[t.todos.length===0?(w(),N("div",bZ,[i[0]||(i[0]=T("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"},[T("path",{d:"M9 11l2 2 4-4"}),T("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),T("span",null,R(A(n)("tasks.emptyTodo")),1)])):ie("",!0),(w(!0),N(Oe,null,ot(t.todos,(r,l)=>(w(),N("div",{key:l,class:De(["tc-row",`s-${r.status}`])},[oe(p3,{status:s(r.status)},null,8,["status"]),T("span",_Z,R(r.title),1)],2))),128))]))}}),SZ=ft(wZ,[["__scopeId","data-v-5ad486e3"]]),CZ=["disabled","aria-pressed"],xZ=Ve({__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:De(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[xn(t.$slots,"default",{},void 0,!0)],10,CZ)):(w(),N("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[xn(t.$slots,"default",{},void 0,!0)],2))}}),Vg=ft(xZ,[["__scopeId","data-v-317ace1a"]]),AZ={class:"dock-work-head"},TZ={key:0,class:"dock-work-tab static"},MZ={key:1,class:"dock-work-tab static"},EZ={key:2,class:"dock-work-tab static"},IZ={class:"dock-work-body"},$Z={class:"dw-count"},NZ={class:"dw-count"},LZ={class:"dw-count"},OZ=Ve({__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}=Nt(),r=Z(null),l=Z(null),a=Z(null);function c(f){r.value?.loadForEdit(f)}function u(){r.value?.focus()}function d(f){if(!s.dockPanel)return;const h=f.target;h&&(l.value?.contains(h)||a.value?.contains(h)||o("close-dock-panel"))}return Ye(()=>s.dockPanel,f=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),f&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),_n(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c,focus:u}),(f,h)=>(w(),N("div",{class:De(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=vt(()=>{},["stop"]))},[oe(Kr,{name:"dock-panel"},{default:ke(()=>[e.dockPanel?(w(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=vt(()=>{},["stop"]))},[T("div",AZ,[e.dockPanel==="bash"?(w(),N("span",TZ,R(A(i)("tasks.dockBash"))+" · "+R(e.bashRunning)+" "+R(A(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),N("span",MZ,R(A(i)("tasks.dockSubagent"))+" · "+R(e.subagentRunning)+" "+R(A(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),N("span",EZ,R(A(i)("tasks.dockTodos"))+" · "+R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1)):ie("",!0)]),T("div",IZ,[e.dockPanel==="bash"?(w(),ge(_S,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=p=>o("cancelTask",p))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),ge(_S,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=p=>o("cancelTask",p)),onOpen:h[2]||(h[2]=p=>o("openAgent",p))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),ge(SZ,{key:2,todos:e.todos??[]},null,8,["todos"])):ie("",!0)])],512)):ie("",!0)]),_:1}),e.goal?(w(),ge(NX,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=p=>o("controlGoal",p))},null,8,["goal","force-expanded"])):ie("",!0),e.hasDockWork?(w(),N("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),ge(Vg,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=p=>o("toggle-dock-panel","bash"))},{default:ke(()=>[oe(Je,{name:"clock",size:"md"}),T("span",null,R(A(i)("tasks.dockBash")),1),T("span",$Z,[h[29]||(h[29]=je("(",-1)),T("b",null,R(e.bashTasks.length),1),h[30]||(h[30]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),e.subagentTasks.length>0?(w(),ge(Vg,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=p=>o("toggle-dock-panel","subagent"))},{default:ke(()=>[oe(Je,{name:"sparkles",size:"md"}),T("span",null,R(A(i)("tasks.dockSubagent")),1),T("span",NZ,[h[31]||(h[31]=je("(",-1)),T("b",null,R(e.subagentTasks.length),1),h[32]||(h[32]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),(e.todos?.length??0)>0?(w(),ge(Vg,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=p=>o("toggle-dock-panel","todos"))},{default:ke(()=>[oe(Je,{name:"check-list",size:"md"}),T("span",null,R(A(i)("tasks.dockTodos")),1),T("span",LZ,[h[33]||(h[33]=je("(",-1)),T("b",null,R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1),h[34]||(h[34]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(w(),ge(iQ,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(p,m)=>o("answer",p,m)),onDismiss:h[9]||(h[9]=p=>o("dismiss",p))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),ge(ZQ,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=p=>o("approval",e.pendingApproval.approvalId,p))},null,8,["block","agent-name","busy"])):(w(),ge(f3,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:h[11]||(h[11]=p=>o("submit",p)),onSteer:h[12]||(h[12]=p=>o("steer",p)),onCommand:h[13]||(h[13]=p=>o("command",p)),onInterrupt:h[14]||(h[14]=p=>o("interrupt")),onSetPermission:h[15]||(h[15]=p=>o("setPermission",p)),onSetThinking:h[16]||(h[16]=p=>o("setThinking",p)),onTogglePlan:h[17]||(h[17]=p=>o("togglePlan")),onToggleSwarm:h[18]||(h[18]=p=>o("toggleSwarm")),onToggleGoal:h[19]||(h[19]=p=>o("toggleGoal")),onOpenBtw:h[20]||(h[20]=p=>o("openBtw")),onCreateGoal:h[21]||(h[21]=p=>o("createGoal",p)),onControlGoal:h[22]||(h[22]=p=>o("controlGoal",p)),onFocusGoal:h[23]||(h[23]=p=>o("focusGoal")),onFocusSwarm:h[24]||(h[24]=p=>o("focusSwarm")),onCompact:h[25]||(h[25]=p=>o("compact")),onPickModel:h[26]||(h[26]=p=>o("pickModel")),onSelectModel:h[27]||(h[27]=p=>o("selectModel",p))},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))}}),PZ=ft(OZ,[["__scopeId","data-v-c6b691c5"]]),RZ=["aria-label","aria-hidden"],DZ={class:"toc-scroll"},BZ=["onClick"],FZ={class:"toc-label"},HZ=240,WZ=Ve({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=Z(null),r=Z(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=HZ}const c=W(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ye(c,u=>{l?.disconnect(),l=null,u&&gt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ms(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),N("nav",{key:0,ref_key:"navRef",ref:i,class:De(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":A(o)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[T("div",DZ,[(w(!0),N(Oe,null,ot(e.items,f=>(w(),N("button",{key:f.id,type:"button",class:De(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=T("span",{class:"toc-bar"},null,-1)),T("span",FZ,R(f.title),1)],10,BZ))),128))])],10,RZ)):ie("",!0)}}),zZ=ft(WZ,[["__scopeId","data-v-0a2a2a96"]]),UZ=5;function qZ(e,t,n,s=UZ){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 jZ={class:"chat-layout"},VZ={class:"empty-hint"},KZ={class:"empty-hint-title"},GZ={class:"empty-hint-text"},YZ={key:0,class:"ws-pick"},XZ={class:"ws-pick-name"},QZ={key:1,class:"ws-pick-menu"},ZZ=["onClick"],JZ={class:"ws-pick-item-name"},eJ={class:"ws-pick-item-path"},tJ={key:0,class:"swarm-stack"},nJ=["aria-label"],sJ={key:0,class:"abort-toast",role:"status","aria-live":"polite"},oJ={class:"abort-toast-text"},Kg=80,wS=1e3,iJ=420,rJ=3e3,lJ=Ve({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},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=Z(!1),r=Z(!1),l=W(()=>s.workspaces?.find(_e=>_e.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=W(()=>(s.workspaces?.length??0)>0),c=W(()=>qZ(s.workspaces??[],s.activeWorkspaceId,r.value)),u=W(()=>(s.workspaces?.length??0)-c.value.length);Ye(i,Ie=>{Ie||(r.value=!1)});const d=W(()=>s.swarms?.filter(Ie=>Ie.members.some(_e=>_e.phase!=="completed"&&_e.phase!=="failed"))??[]);function f(Ie){i.value=!1,Ie!==s.activeWorkspaceId&&o("selectWorkspace",Ie)}const{t:h}=Nt();oc($t.contentAlign);const p=Z(null),m=Z(null),b=Z(null),_=Z(!1),g=Z(0);let v=null;function y(Ie){(b.value??m.value)?.loadForEdit(Ie)}function C(){_.value=!0,v!==null&&clearTimeout(v),v=setTimeout(()=>{v=null,_.value=!1},2e3)}function L(){g.value++}function $(){gt(()=>{Fe.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const k=W(()=>s.tasks.filter(Ie=>Ie.kind!=="subagent")),M=W(()=>s.tasks.filter(Ie=>Ie.kind==="subagent"&&Ie.runInBackground)),E=W(()=>k.value.filter(Ie=>Ie.state==="run").length),O=W(()=>M.value.filter(Ie=>Ie.state==="run").length);function S(Ie){const _e=s.tasks,Re=_e.find(zt=>zt.id===Ie)??_e.find(zt=>zt.parentToolCallId===Ie);if(Re)return Re.id;const ln=_e.filter(zt=>zt.kind==="subagent"&&!zt.parentToolCallId);if(ln.length===1)return ln[0].id}On("resolveAgentTaskId",S);const I=W(()=>(s.todos??[]).filter(Ie=>Ie.status==="done").length),P=W(()=>k.value.length>0||M.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),D=Z(null),H=W(()=>s.gitInfo?s.changes?.length??0:0);function z(Ie){D.value=D.value===Ie?null:Ie}function U(){D.value=null}Ye(P,Ie=>{Ie||U()});function Q(Ie){if(Ie.role==="compaction")return h("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;if(Ie.pluginCommand)return`/${Ie.pluginCommand.pluginId}:${Ie.pluginCommand.commandName}`;const Re=Ie.text.trim().replaceAll(/\s+/g," ");return Re.length>0?Re:"user"}const _e=(Ie.text||Ie.thinking||"").trim().replaceAll(/\s+/g," ");return _e.length>0?_e:(Ie.tools?.length??0)>0?`${Ie.tools.length} tools`:"kimi"}const X=W(()=>s.turns.filter(Ie=>Ie.role==="user").map((Ie,_e)=>({id:Ie.id,role:Ie.role,no:_e+1,title:Q(Ie)}))),ue=Z(null);function me(){const Ie=Fe.value;if(!Ie)return;const _e=Ie.querySelectorAll(".turn-anchor[data-turn-id]");if(_e.length===0)return;const Re=X.value;if(Re.length===0)return;const ln=new Set(Re.map(go=>go.id));if(j()<=Kg){ue.value=Re[Re.length-1].id;return}const zt=Ie.getBoundingClientRect(),us=zt.height/2;let Wn=null;_e.forEach(go=>{const ni=go.dataset.turnId;if(!ni||!ln.has(ni))return;go.getBoundingClientRect().top-zt.top<=us&&(Wn=ni)}),ue.value=Wn??Re[0].id}const Ae=W(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),be=W(()=>{const Ie=Ae.value;if(Ie)return s.pendingQuestionActions?.[Ie.questionId]}),ze=W(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),qe=W(()=>{const Ie=ze.value;return Ie?!!s.pendingApprovalActions?.[Ie.approvalId]:!1}),Fe=Z(null),Le=Z(null),le=Z(0),F=Z(0),te=W(()=>({"--panes-scrollbar-width":`${le.value}px`}));function ee(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}function q(){const Ie=Fe.value;le.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0,F.value=Le.value?.offsetHeight??0}function Y(Ie){const _e=ee(Ie);Fe.value=_e,_e&&_s()}function de(Ie){const _e=ee(Ie);Le.value=_e??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"&&"focus"in Ie&&typeof Ie.focus=="function"?b.value={loadForEdit:Ie.loadForEdit.bind(Ie),focus:Ie.focus.bind(Ie)}:b.value=null,Qt()}const ne=Z(!0),ce=Z(!1);function j(){const Ie=Fe.value;return Ie?Ie.scrollHeight-Ie.scrollTop-Ie.clientHeight:0}let G=0,re=0,he=0,Ce=0,Ee=0,ae=0;function xe(){return Date.now()<re}function Ke(){const Ie=Fe.value;if(!Ie)return;const _e=Ie.scrollTop;if(performance.now()-he<100){G=_e;return}const Re=j();if(xe()){ne.value=!0,ce.value=!1,G=_e;return}_e<G-1&&Re>1?ne.value=!1:Re<=Kg&&_e>G+1&&(ne.value=!0,ce.value=!1),G=_e,me()}function st(Ie=!1){const _e=Fe.value;ne.value=!0,ce.value=!1,_e&&(!Ie&&performance.now()<Ce||(Ie&&typeof _e.scrollTo=="function"?(he=performance.now(),Ce=performance.now()+iJ,_e.scrollTo({top:_e.scrollHeight,behavior:"smooth"})):_e.scrollTop=_e.scrollHeight,G=_e.scrollTop))}function _t(Ie,_e){const Re=Ie.querySelectorAll(".turn-anchor");for(const ln of Re)if(ln.offsetTop>=_e){const zt=ln.dataset.turnId;if(zt)return{id:zt,top:ln.offsetTop}}return null}async function wt(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Ie=s.sessionId,_e=Fe.value,Re=_e?.scrollTop??0,ln=_e?.scrollHeight??0,zt=_e?_t(_e,Re):null;ts.value=!0;try{await s.loadOlderMessages(Ie),await gt()}finally{ts.value=!1}if(s.sessionId!==Ie)return;const us=Fe.value;if(!us)return;let Wn=0;if(zt){const go=us.querySelector(`.turn-anchor[data-turn-id="${Et(zt.id)}"]`);go&&(Wn=go.offsetTop-zt.top)}Wn===0&&(Wn=us.scrollHeight-ln),us.scrollTop=Re+Wn}function Et(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replaceAll(/["\\]/g,"\\$&")}function Ot(Ie){const _e=Fe.value;if(!_e)return;const Re=_e.querySelector(`.turn-anchor[data-turn-id="${Et(Ie)}"]`);Re&&(ne.value=!1,ce.value=j()>Kg,Re.scrollIntoView({behavior:"smooth",block:"center"}))}function bt(){const Ie=Fe.value;if(!Ie)return"none";const _e=Ie.firstElementChild,Re=_e instanceof HTMLElement?_e.offsetHeight:0,ln=Le.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${Re}:${ln}`}function Kt(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function Fn(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}function $n(Ie=36){if(!ne.value&&!xe())return;const _e=++ae;let Re="",ln=0,zt=0;Ee&&(Fn(Ee),Ee=0);const us=()=>{if(Ee=0,_e!==ae||!ne.value&&!xe())return;st(!1);const Wn=bt();ln=Wn===Re?ln+1:0,Re=Wn,zt++,ln<3&&zt<Ie&&(Ee=Kt(us))};Ee=Kt(us)}function Rt(Ie,_e){return Ie!==void 0&&Ie.length>0&&_e.length>=Ie.length&&Ie.firstId!==_e.firstId&&Ie.lastId===_e.lastId&&Ie.lastTextLen===_e.lastTextLen&&Ie.lastThinkingLen===_e.lastThinkingLen&&Ie.lastToolsLen===_e.lastToolsLen&&Ie.approvalIds===_e.approvalIds}const nn=W(()=>{const Ie=(s.approvals??[]).map(us=>us.approvalId).join(","),_e=s.turns,Re=_e.at(-1),ln=Re?.thinking?.length??0,zt=Re?.tools?.reduce((us,Wn)=>us+Wn.name.length+(Wn.arg?.length??0)+(Wn.output?.join("").length??0),0)??0;return{length:_e.length,firstId:_e[0]?.id??"",lastId:Re?.id??"",lastTextLen:Re?.text.length??0,lastThinkingLen:ln,lastToolsLen:zt,approvalIds:Ie}});Ye(nn,async(Ie,_e)=>{if(ts.value&&Rt(_e,Ie)){me();return}await gt(),ne.value||xe()?st(Ie.length<_e.length):ce.value=!0,me()}),Ye(Le,()=>{Qt()}),Ye(()=>s.mobile,async()=>{await gt(),q()});const Hn=new Map;Ye(()=>s.fileReloadKey,async(Ie,_e)=>{const Re=Fe.value;_e&&Re&&Hn.set(String(_e),{top:Re.scrollTop,following:ne.value}),await gt();const ln=Fe.value,zt=Ie?Hn.get(String(Ie)):void 0;zt&&ln?(ne.value=zt.following,ln.scrollTop=zt.top,G=zt.top,zt.following&&$n()):(ne.value=!0,G=0,st(!1),$n()),me()}),Ye(()=>s.sessionLoading,async(Ie,_e)=>{Ie||!_e||(ne.value=!0,await gt(),$n(),me())}),Ye(()=>s.running,async(Ie,_e)=>{Ie||!_e||!ne.value&&!xe()||(await gt(),$n(48),me())});function nt(){ne.value=!0,ce.value=!1,re=Date.now()+wS,gt(()=>{st(!0),$n(16)})}function Pn(Ie){nt(),o("submit",Ie)}function fn(Ie){ne.value=!0,ce.value=!1,re=Date.now()+wS,o("editMessage",Ie)}function Gn(Ie){const _e=s.queued?.[Ie]?.text??"";_e&&y(_e),o("editQueued",Ie)}function Rn(Ie){o("reorderQueue",Ie)}function gs(Ie,_e){nt(),o("answer",Ie,_e)}function Xe(Ie,_e){!Ie||!_e||o("approval",Ie,_e)}let Ge=null,At=null,jt=null,Xt=null,Nn=0,An=!1;const ts=Z(!1);function It(Ie){if(ts.value||(An=An||Ie,Nn))return;Nn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Re=>setTimeout(Re,16))(()=>{Nn=0;const Re=An;An=!1,ne.value||xe()?st(!1):Re&&(ce.value=!0)})}function Tn(){if(!At)return;const Ie=Fe.value?.firstElementChild??null;Ie!==jt&&(jt&&At.unobserve(jt),jt=Ie,Ie&&At.observe(Ie))}function Qt(){if(!At)return;const Ie=Le.value;Ie!==Xt&&(Xt&&At.unobserve(Xt),Xt=Ie,Ie&&At.observe(Ie))}function _s(){const Ie=Fe.value;q(),Ge&&(Ge.disconnect(),Ie&&Ge.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),At&&(At.disconnect(),jt=null,Xt=null,Ie&&At.observe(Ie),Tn(),Qt())}function ei(){Tn(),It(!0)}function No(){typeof document>"u"||document.visibilityState==="visible"&&ne.value&&$n()}const et=Z(!1);let it=null;function lt(){et.value=!0,it!==null&&clearTimeout(it),it=setTimeout(()=>{et.value=!1},rJ)}function pt(){lt(),o("interrupt")}function ti(Ie){Ie.key==="Escape"&&(s.running||s.sending)&&(Ie.preventDefault(),pt())}bn(()=>{gt(()=>{typeof MutationObserver=="function"&&(Ge=new MutationObserver(ei)),typeof ResizeObserver=="function"&&(At=new ResizeObserver(()=>{q(),It(!1)})),_s(),$n(48),me(),typeof document<"u"&&(document.addEventListener("visibilitychange",No),document.addEventListener("keydown",ti))})}),_n(()=>{Ge&&Ge.disconnect(),At&&At.disconnect(),Nn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Nn),Ee&&Fn(Ee),it!==null&&clearTimeout(it),v!==null&&(clearTimeout(v),v=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",No),document.removeEventListener("keydown",ti))});function hi(){(b.value??m.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:hi}),(Ie,_e)=>(w(),N("section",{class:De(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),ge(NG,{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":H.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:_.value,onOpenChanges:_e[0]||(_e[0]=Re=>o("openChanges")),onCopyAll:_e[1]||(_e[1]=Re=>p.value?.copyConversation()),onCopyFinalSummary:_e[2]||(_e[2]=Re=>p.value?.copyFinalSummary()),onOpenPr:_e[3]||(_e[3]=Re=>e.pr&&o("openPr",e.pr.url)),onRenameSession:_e[4]||(_e[4]=(Re,ln)=>o("renameSession",Re,ln)),onForkSession:_e[5]||(_e[5]=Re=>o("forkSession",Re)),onArchiveSession:_e[6]||(_e[6]=Re=>o("archiveSession",Re))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ie("",!0),e.conversationToc?(w(),ge(zZ,{key:1,items:X.value,"active-turn-id":ue.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:Ot},null,8,["items","active-turn-id","mobile","session-loading"])):ie("",!0),T("div",jZ,[T("div",{ref:Y,class:"panes chat-scroll",onScrollPassive:Ke},[T("div",{class:De(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),N(Oe,{key:0},[_e[54]||(_e[54]=T("div",{class:"empty-spacer"},null,-1)),T("div",VZ,[T("span",KZ,R(A(h)("composer.emptyConversationTitle")),1),T("span",GZ,R(A(h)("composer.emptyConversation")),1),a.value?(w(),N("div",YZ,[oe(Wt,{text:A(h)("conversation.switchWorkspace")},{default:ke(()=>[T("button",{type:"button",class:"ws-pick-btn",onClick:_e[7]||(_e[7]=vt(Re=>i.value=!i.value,["stop"]))},[oe(Je,{name:"folder",size:"sm"}),T("span",XZ,R(l.value),1),oe(Je,{class:De(["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:_e[8]||(_e[8]=Re=>i.value=!1)})):ie("",!0),i.value?(w(),N("div",QZ,[(w(!0),N(Oe,null,ot(c.value,Re=>(w(),N("button",{key:Re.id,type:"button",class:De(["ws-pick-item",{on:Re.id===e.activeWorkspaceId}]),onClick:vt(ln=>f(Re.id),["stop"])},[T("span",JZ,R(Re.name),1),T("span",eJ,R(Re.shortPath),1)],10,ZZ))),128)),u.value>0?(w(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:_e[9]||(_e[9]=vt(Re=>r.value=!r.value,["stop"]))},[T("span",null,R(A(h)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!0),_e[53]||(_e[53]=T("div",{class:"ws-pick-divider"},null,-1)),T("button",{type:"button",class:"ws-pick-action",onClick:_e[10]||(_e[10]=vt(Re=>{i.value=!1,o("addWorkspace")},["stop"]))},[oe(Je,{name:"plus",size:"sm"}),T("span",null,R(A(h)("conversation.addWorkspace")),1)])])):ie("",!0)])):(w(),N("button",{key:1,type:"button",class:"empty-add-workspace",onClick:_e[11]||(_e[11]=Re=>o("addWorkspace"))},[oe(Je,{name:"folder-plus",size:"sm"}),T("span",null,R(A(h)("conversation.addWorkspace")),1)]))]),oe(f3,{ref_key:"emptyComposerRef",ref:m,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Pn,onSteer:_e[12]||(_e[12]=Re=>o("steer",Re)),onCommand:_e[13]||(_e[13]=Re=>o("command",Re)),onInterrupt:pt,onUnqueue:_e[14]||(_e[14]=Re=>o("unqueue",Re)),onEditQueued:_e[15]||(_e[15]=Re=>o("editQueued",Re)),onSetPermission:_e[16]||(_e[16]=Re=>o("setPermission",Re)),onSetThinking:_e[17]||(_e[17]=Re=>o("setThinking",Re)),onTogglePlan:_e[18]||(_e[18]=Re=>o("togglePlan")),onToggleSwarm:_e[19]||(_e[19]=Re=>o("toggleSwarm")),onToggleGoal:_e[20]||(_e[20]=Re=>o("toggleGoal")),onOpenBtw:_e[21]||(_e[21]=Re=>o("command","/btw")),onCreateGoal:_e[22]||(_e[22]=Re=>o("createGoal",Re)),onControlGoal:_e[23]||(_e[23]=Re=>o("controlGoal",Re)),onFocusGoal:L,onFocusSwarm:$,onCompact:_e[24]||(_e[24]=Re=>o("compact")),onPickModel:_e[25]||(_e[25]=Re=>o("pickModel")),onSelectModel:_e[26]||(_e[26]=Re=>o("selectModel",Re))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),_e[55]||(_e[55]=T("div",{class:"empty-spacer"},null,-1))],64)):(w(),N(Oe,{key:1},[(w(),ge(a3,{ref_key:"chatPaneRef",ref:p,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":ne.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:_e[27]||(_e[27]=Re=>o("openFile",Re)),onOpenMedia:_e[28]||(_e[28]=Re=>o("openMedia",Re)),onCopyConversationCopied:C,onOpenThinking:_e[29]||(_e[29]=Re=>o("openThinking",Re)),onOpenCompaction:_e[30]||(_e[30]=Re=>o("openCompaction",Re)),onOpenAgent:_e[31]||(_e[31]=Re=>o("openAgent",Re)),onOpenToolDiff:_e[32]||(_e[32]=Re=>o("openToolDiff",Re)),onEditMessage:fn,onLoadOlderMessages:wt,onUnqueue:_e[33]||(_e[33]=Re=>o("unqueue",Re)),onEditQueued:Gn,onReorderQueue:Rn},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"])),d.value.length>0?(w(),N("div",tJ,[(w(!0),N(Oe,null,ot(d.value,Re=>(w(),ge(yX,{key:Re.id,group:Re},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(w(),ge(PZ,{key:0,ref:de,style:Yt(te.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":g.value,"dock-panel":D.value,"bash-tasks":k.value,"subagent-tasks":M.value,"bash-running":E.value,"subagent-running":O.value,"todo-done-count":I.value,"has-dock-work":P.value,todos:e.todos,"pending-question":Ae.value,"question-busy-kind":be.value,"pending-approval":ze.value,"approval-busy":qe.value,mobile:e.mobile,onToggleDockPanel:_e[34]||(_e[34]=Re=>z(Re)),onCloseDockPanel:_e[35]||(_e[35]=Re=>U()),onOpenAgent:_e[36]||(_e[36]=Re=>o("openAgent",Re)),onAnswer:gs,onDismiss:_e[37]||(_e[37]=Re=>o("dismiss",Re)),onApproval:Xe,onCancelTask:_e[38]||(_e[38]=Re=>o("cancelTask",Re)),onControlGoal:_e[39]||(_e[39]=Re=>o("controlGoal",Re)),onSubmit:Pn,onSteer:_e[40]||(_e[40]=Re=>o("steer",Re)),onCommand:_e[41]||(_e[41]=Re=>o("command",Re)),onInterrupt:pt,onSetPermission:_e[42]||(_e[42]=Re=>o("setPermission",Re)),onSetThinking:_e[43]||(_e[43]=Re=>o("setThinking",Re)),onTogglePlan:_e[44]||(_e[44]=Re=>o("togglePlan")),onToggleSwarm:_e[45]||(_e[45]=Re=>o("toggleSwarm")),onToggleGoal:_e[46]||(_e[46]=Re=>o("toggleGoal")),onOpenBtw:_e[47]||(_e[47]=Re=>o("command","/btw")),onCreateGoal:_e[48]||(_e[48]=Re=>o("createGoal",Re)),onFocusGoal:L,onFocusSwarm:$,onCompact:_e[49]||(_e[49]=Re=>o("compact")),onPickModel:_e[50]||(_e[50]=Re=>o("pickModel")),onSelectModel:_e[51]||(_e[51]=Re=>o("selectModel",Re))},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"]))]),oe(Kr,{name:"pill"},{default:ke(()=>[ce.value?(w(),N("button",{key:0,class:"newmsg-pill",style:Yt({bottom:`${F.value+12}px`}),"aria-label":A(h)("conversation.jumpToLatestAria"),onClick:_e[52]||(_e[52]=Re=>st(!0))},[oe(Je,{class:"pill-chevron",name:"chevron-down",size:"md"}),je(" "+R(A(h)("conversation.newMessages")),1)],12,nJ)):ie("",!0)]),_:1}),oe(Kr,{name:"abort-toast"},{default:ke(()=>[et.value?(w(),N("div",sJ,[T("span",oJ,R(A(h)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),aJ=ft(lJ,[["__scopeId","data-v-b7070e01"]]),cJ=["aria-selected","onClick"],uJ=Ve({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(w(),N("div",{class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),N(Oe,null,ot(e.options,i=>(w(),N("button",{key:i.value,class:De(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},R(i.label),11,cJ))),128))],2))}}),Xo=ft(uJ,[["__scopeId","data-v-d1aaccd7"]]),dJ={class:"ui-panel-header__title"},fJ={key:0,class:"ui-panel-header__sub"},pJ=Ve({__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:De(["ui-panel-header",{wrap:e.wrap}])},[T("span",dJ,R(e.title),1),oe(Wt,{text:e.subtitle},{default:ke(()=>[e.subtitle?(w(),N("span",fJ,R(e.subtitle),1)):ie("",!0)]),_:1},8,["text"]),xn(t.$slots,"default",{},void 0,!0),e.closable?(w(),ge(mn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:ke(()=>[oe(Je,{name:"close",size:"sm"})]),_:1},8,["label"])):ie("",!0)],2))}}),Vl=ft(pJ,[["__scopeId","data-v-c47879ad"]]),hJ={key:0,class:"fp-empty fp-error"},mJ={key:1,class:"fp-empty"},gJ={key:2,class:"fp-loading"},vJ={class:"fp-path"},yJ={class:"fp-meta"},kJ={key:0,class:"fp-lines"},bJ={class:"fp-size"},_J={key:3,class:"fp-search"},wJ=["placeholder"],SJ={key:0,class:"fp-search-count"},CJ=["href","aria-label"],xJ={key:1,class:"fp-code"},AJ={class:"fp-line-table"},TJ=["data-line"],MJ={class:"fp-gutter"},EJ=["innerHTML"],IJ={key:1,class:"fp-body fp-code"},$J={class:"fp-line-table"},NJ=["data-line"],LJ={class:"fp-gutter"},OJ=["innerHTML"],PJ={key:2,class:"fp-body"},RJ=["srcdoc","title"],DJ={key:1,class:"fp-code"},BJ={class:"fp-line-table"},FJ=["data-line"],HJ={class:"fp-gutter"},WJ=["innerHTML"],zJ={key:3,class:"fp-body fp-pdf-wrap"},UJ=["src","title"],qJ={key:1,class:"fp-binary-card"},jJ={class:"fp-binary-label"},VJ={key:4,class:"fp-body fp-table-wrap"},KJ={class:"fp-table"},GJ=["data-line"],YJ={key:5,class:"fp-body fp-image-wrap"},XJ=["src","alt"],QJ={key:1,class:"fp-binary-card"},ZJ={class:"fp-binary-icon"},JJ={class:"fp-binary-label"},eee={key:6,class:"fp-body fp-code"},tee={class:"fp-line-table"},nee=["data-line"],see={class:"fp-gutter"},oee=["innerHTML"],iee={key:7,class:"fp-body fp-binary-wrap"},ree={class:"fp-binary-card"},lee={class:"fp-binary-icon"},aee={class:"fp-binary-label"},cee=Ve({__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}=Nt();function s(le,F){const te=F?F.split("/").filter(Boolean):[];for(const ee of le.split("/"))ee===""||ee==="."||(ee===".."?te.pop():te.push(ee));return te.join("/")}const o=qt("resolveImage",async le=>le),i=W(()=>{const le=c.file?.path??"",F=le.lastIndexOf("/");return F>0?le.slice(0,F):""});function r(le){if(/^(https?:|data:|blob:)/i.test(le)||le.startsWith("/"))return le;const F=i.value;return F?s(le,F):le}async function l(le){const F=r(le);return o?o(F):F}On("resolveImage",l);function a(le){let F=le.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(F)||F.startsWith("/"))return le;for(const ee of["#","?"]){const q=F.indexOf(ee);q!==-1&&(F=F.slice(0,q))}const te=i.value;return{...le,path:s(F,te)}}const c=e,u=t;function d(le){c.openFile?.(a(le))}const f=Z(null),h=W(()=>{const le=c.file;if(!le)return"binary";const F=le.mime??"",te=le.languageId??"",ee=le.path.toLowerCase();return F==="text/markdown"||te==="markdown"||te==="md"||ee.endsWith(".mdx")?"markdown":F==="application/json"||te==="json"?"json":F==="text/html"||te==="html"||ee.endsWith(".html")||ee.endsWith(".htm")?"html":F==="application/pdf"||ee.endsWith(".pdf")?"pdf":F==="text/csv"||te==="csv"||ee.endsWith(".csv")?"csv":F.startsWith("image/")?"image":le.isBinary?"binary":F.startsWith("text/")||te!==""?"text":"binary"});function p(le){const F=atob(le),te=Uint8Array.from(F,ee=>ee.charCodeAt(0));return new TextDecoder().decode(te)}const m=W(()=>{const le=c.file;if(!le)return"";if(le.encoding==="base64")try{return p(le.content)}catch{return le.content}return le.content}),b=W(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),_=W(()=>c.file?(h.value==="json"?b.value:m.value).split(`
259
- `):[]),g=W(()=>c.file?h.value==="json"?b.value:m.value:""),v=Z(""),y=Z(0),C=W(()=>{const le=v.value.trim().toLowerCase();if(!le)return[];const F=[];return _.value.forEach((te,ee)=>{te.toLowerCase().includes(le)&&F.push(ee+1)}),F});Ye(v,()=>{y.value=0});function L(le,F=!1){le&&gt(()=>{const te=f.value?.querySelector(".fp-body"),ee=te?.querySelector(`[data-line="${le}"]`);if(!te||!ee)return;F&&(te.scrollTop=0);const q=te.getBoundingClientRect(),Y=ee.getBoundingClientRect(),de=Y.top-q.top+te.scrollTop;te.scrollTop=de-te.clientHeight/2+Y.height/2})}Ye(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(le){const F=C.value;F.length!==0&&(y.value=(y.value+le+F.length)%F.length,L(F[y.value]))}function k(le){const F=C.value;return{target:c.line===le,hit:F.includes(le),active:F[y.value]===le}}function M(le){return le<1024?`${le} B`:le<1024*1024?`${(le/1024).toFixed(1)} KB`:`${(le/(1024*1024)).toFixed(1)} MB`}const E=Z(!1),O=Z(!1);function S(){c.file&&Hs(g.value).then(le=>{le&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function I(){c.file&&Hs(c.file.path).then(le=>{le&&(O.value=!0,setTimeout(()=>{O.value=!1},1400))})}const P=Z("preview"),D=Z("preview"),H=Z("fit");function z(le){P.value=le}function U(le){D.value=le}function Q(le){H.value=le}Ye(h,le=>{P.value=le==="html"?"preview":"source",D.value="preview",H.value="fit"});const X=W(()=>{const le=c.file;return!le||h.value!=="image"?null:le.sourceUrl?le.sourceUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:le.mime==="image/svg+xml"?`data:${le.mime};charset=utf-8,${encodeURIComponent(le.content)}`:null}),ue=W(()=>{const le=c.file;return!le||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:null}),me=W(()=>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 Ae(le){const F=[];let te="",ee=!1;for(let q=0;q<le.length;q++){const Y=le[q];Y==='"'&&le[q+1]==='"'?(te+='"',q++):Y==='"'?ee=!ee:Y===","&&!ee?(F.push(te),te=""):te+=Y}return F.push(te),F}const be=W(()=>_.value.slice(0,200).map(Ae));function ze(le){return le.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function qe(){const le=c.file;if(!le)return"";const F=le.languageId?.toLowerCase();return F||(le.path.split(".").pop()?.toLowerCase()??"")}function Fe(le){const F=qe();let te=ze(le);return h.value==="json"||F==="json"||F==="jsonc"?(te=te.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),te=te.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),te=te.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),te=te.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),te):h.value==="html"||F==="html"||F==="xml"||F==="svg"?(te=te.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),te=te.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),te=te.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),te):(te=te.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>'),te=te.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),te=te.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),te)}function Le(le,F=55){return!le||le.length<=F?le:"…"+le.slice(le.length-F+1)}return(le,F)=>(w(),N("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),N("div",hJ,[T("span",null,R(e.error),1),e.closable?(w(),ge(Pt,{key:0,variant:"secondary",size:"sm",onClick:F[0]||(F[0]=te=>u("close"))},{default:ke(()=>[je(R(A(n)("filePreview.close")),1)]),_:1})):ie("",!0)])):!e.file&&!e.loading?(w(),N("div",mJ,R(A(n)("filePreview.empty")),1)):e.loading?(w(),N("div",gJ,[F[7]||(F[7]=T("span",{class:"spinner"},null,-1)),T("span",null,R(A(n)("filePreview.loading")),1)])):e.file?(w(),N(Oe,{key:3},[oe(Vl,{wrap:"",title:A(n)("common.preview"),closable:e.closable,"close-label":A(n)("filePreview.close"),onClose:F[6]||(F[6]=te=>u("close"))},{default:ke(()=>[oe(Wt,{text:e.file.path},{default:ke(()=>[T("span",vJ,R(Le(e.file.path)),1)]),_:1},8,["text"]),T("span",yJ,[e.file.lineCount?(w(),N("span",kJ,R(A(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),T("span",bJ,R(M(e.file.size)),1)]),h.value==="html"?(w(),ge(Xo,{key:0,"model-value":P.value,size:"sm",options:[{value:"preview",label:A(n)("filePreview.preview")},{value:"source",label:A(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):ie("",!0),h.value==="markdown"?(w(),ge(Xo,{key:1,"model-value":D.value,size:"sm",options:[{value:"preview",label:A(n)("filePreview.preview")},{value:"source",label:A(n)("filePreview.source")}],"onUpdate:modelValue":U},null,8,["model-value","options"])):ie("",!0),h.value==="image"?(w(),ge(Xo,{key:2,"model-value":H.value,size:"sm",options:[{value:"fit",label:A(n)("filePreview.fit")},{value:"actual",label:A(n)("filePreview.actual")}],"onUpdate:modelValue":Q},null,8,["model-value","options"])):ie("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),N("div",_J,[In(T("input",{"onUpdate:modelValue":F[1]||(F[1]=te=>v.value=te),class:"fp-search-input",type:"search",placeholder:A(n)("filePreview.search")},null,8,wJ),[[mo,v.value]]),v.value.trim()?(w(),N("span",SJ,R(C.value.length),1)):ie("",!0),oe(mn,{size:"sm",disabled:C.value.length===0,label:A(n)("filePreview.prevMatch"),onClick:F[2]||(F[2]=te=>$(-1))},{default:ke(()=>[oe(Je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),oe(mn,{size:"sm",disabled:C.value.length===0,label:A(n)("filePreview.nextMatch"),onClick:F[3]||(F[3]=te=>$(1))},{default:ke(()=>[oe(Je,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ie("",!0),oe(mn,{size:"sm",class:De({copied:O.value}),label:O.value?A(n)("filePreview.copied"):A(n)("filePreview.copyPath"),onClick:I},{default:ke(()=>[O.value?(w(),ge(Je,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ge(Je,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),ge(mn,{key:4,size:"sm",label:A(n)("filePreview.openInEditor"),onClick:F[4]||(F[4]=te=>u("openExternal"))},{default:ke(()=>[oe(Je,{name:"external-link",size:"md"})]),_:1},8,["label"])):ie("",!0),e.externalActions?(w(),ge(mn,{key:5,size:"sm",label:A(n)("filePreview.reveal"),onClick:F[5]||(F[5]=te=>u("reveal"))},{default:ke(()=>[oe(Je,{name:"folder",size:"md"})]),_:1},8,["label"])):ie("",!0),e.downloadUrl?(w(),N("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":A(n)("filePreview.download")},[oe(Je,{name:"download",size:"md"})],8,CJ)):ie("",!0),!e.file.isBinary&&h.value!=="image"?(w(),ge(mn,{key:7,size:"sm",class:De({copied:E.value}),label:E.value?A(n)("filePreview.copied"):A(n)("filePreview.copy"),onClick:S},{default:ke(()=>[E.value?(w(),ge(Je,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ge(Je,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ie("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),N("div",{key:0,class:De(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(w(),ge(Ih,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),N("div",xJ,[T("div",AJ,[(w(!0),N(Oe,null,ot(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",MJ,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,EJ)],10,TJ))),128))])]))],2)):h.value==="json"?(w(),N("div",IJ,[T("div",$J,[(w(!0),N(Oe,null,ot(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",LJ,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,OJ)],10,NJ))),128))])])):h.value==="html"?(w(),N("div",PJ,[P.value==="preview"?(w(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:me.value,title:e.file.path},null,8,RJ)):(w(),N("div",DJ,[T("div",BJ,[(w(!0),N(Oe,null,ot(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",HJ,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,WJ)],10,FJ))),128))])]))])):h.value==="pdf"?(w(),N("div",zJ,[ue.value?(w(),N("iframe",{key:0,class:"fp-pdf-frame",src:ue.value,title:e.file.path},null,8,UJ)):(w(),N("div",qJ,[T("span",jJ,R(A(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),N("div",VJ,[T("table",KJ,[T("tbody",null,[(w(!0),N(Oe,null,ot(be.value,(te,ee)=>(w(),N("tr",{key:ee,class:De(k(ee+1)),"data-line":ee+1},[T("th",null,R(ee+1),1),(w(!0),N(Oe,null,ot(te,(q,Y)=>(w(),N("td",{key:Y},R(q),1))),128))],10,GJ))),128))])])])):h.value==="image"?(w(),N("div",YJ,[X.value?(w(),N("img",{key:0,src:X.value,alt:e.file.path,class:De(["fp-image",{actual:H.value==="actual"}])},null,10,XJ)):(w(),N("div",QJ,[T("span",ZJ,[oe(Je,{name:"image-off",size:"lg"})]),T("span",JJ,R(A(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(w(),N("div",eee,[T("div",tee,[(w(!0),N(Oe,null,ot(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",see,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,oee)],10,nee))),128))])])):(w(),N("div",iee,[T("div",ree,[T("span",lee,[oe(Je,{name:"file-off",size:"lg"})]),T("span",aee,R(A(n)("filePreview.binaryNoPreview",{mime:e.file.mime||A(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),uee=ft(cee,[["__scopeId","data-v-62bfaf2d"]]),dee={class:"tp"},fee=Ve({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=Z(null);return Ye(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),N("div",dee,[oe(Vl,{title:A(o)("common.preview"),subtitle:e.subtitle??A(o)("thinking.panelTitle"),"close-label":A(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),T("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},R(e.text),513)]))}}),SS=ft(fee,[["__scopeId","data-v-6af94b37"]]),pee={class:"ap"},hee={key:0,class:"ap-type"},mee={key:1,class:"ap-reason"},gee={key:2,class:"ap-field"},vee={class:"ap-field-body"},yee={key:3,class:"ap-field"},kee={class:"ap-field-body ap-live"},bee={key:4,class:"ap-field"},_ee={class:"ap-field-body ap-progress"},wee={key:0,class:"ap-call"},See={key:1,class:"ap-output"},Cee=["onClick"],xee={key:5,class:"ap-field"},Aee={class:"ap-field-body"},Tee=8,CS=5,xS=2,Mee=Ve({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=W(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=W(()=>(n.member.text??"").trimEnd());function l(m){const b=[];let _=null,g=0;for(const v of m)v.startsWith("Calling ")?(_={key:`g${g++}`,call:v,output:[]},b.push(_)):_?_.output.push(v):(_={key:`g${g++}`,call:"",output:[v]},b.push(_));return b}const a=W(()=>l(i.value)),c=Z(new Set);function u(m){return c.value.has(m)}function d(m){const b=new Set(c.value);b.has(m)?b.delete(m):b.add(m),c.value=b}function f(m){return m.output.length-CS-xS}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=Z(null);return Ye(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||gt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,b)=>(w(),N("div",pee,[oe(Vl,{title:A(o)("common.preview"),subtitle:e.member.name,"close-label":A(o)("thinking.close"),onClose:b[0]||(b[0]=_=>s("close"))},{default:ke(()=>[oe(Is,{variant:"neutral",size:"sm",class:"ap-phase"},{default:ke(()=>[je(R(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),N("div",hee,R(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(w(),N("div",mee,R(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(w(),N("div",gee,[b[1]||(b[1]=T("span",{class:"ap-field-label"},"Task",-1)),T("div",vee,R(e.member.prompt),1)])):ie("",!0),r.value?(w(),N("div",yee,[b[2]||(b[2]=T("span",{class:"ap-field-label"},"Output",-1)),T("div",kee,R(r.value),1)])):ie("",!0),a.value.length>0?(w(),N("div",bee,[b[4]||(b[4]=T("span",{class:"ap-field-label"},"Progress",-1)),T("div",_ee,[(w(!0),N(Oe,null,ot(a.value,_=>(w(),N("div",{key:_.key,class:"ap-group"},[_.call?(w(),N("div",wee,[b[3]||(b[3]=T("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),je(" "+R(_.call),1)])):ie("",!0),_.output.length>0?(w(),N("div",See,[_.output.length<=Tee||u(_.key)?(w(!0),N(Oe,{key:0},ot(_.output,(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},R(g),1))),128)):(w(),N(Oe,{key:1},[(w(!0),N(Oe,null,ot(_.output.slice(0,CS),(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},R(g),1))),128)),T("button",{type:"button",class:"ap-fold",onClick:g=>d(_.key)}," … ("+R(f(_))+" more) ",9,Cee),(w(!0),N(Oe,null,ot(_.output.slice(-xS),(g,v)=>(w(),N("div",{key:"t"+v,class:"ap-out-line"},R(g),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(w(),N("div",xee,[b[5]||(b[5]=T("span",{class:"ap-field-label"},"Result",-1)),T("div",Aee,R(e.member.summary),1)])):ie("",!0)],512)]))}}),Eee=ft(Mee,[["__scopeId","data-v-715bd93e"]]),Iee={class:"diff-lines"},$ee={key:0,class:"hunk-text"},Nee={class:"dl-gutter old"},Lee={class:"dl-gutter new"},Oee={class:"dl-sign"},Pee={class:"dl-text"},Ree=Ve({__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",Iee,[(w(!0),N(Oe,null,ot(e.lines,(r,l)=>(w(),N("div",{key:l,class:De(["dl",s(r)])},[r.type==="hunk"?(w(),N("span",$ee,R(r.text),1)):(w(),N(Oe,{key:1},[T("span",Nee,R(t(r)),1),T("span",Lee,R(n(r)),1),T("span",Oee,R(r.type==="add"?"+":r.type==="del"?"-":" "),1),T("span",Pee,R(r.text),1)],64))],2))),128))]))}}),h3=ft(Ree,[["__scopeId","data-v-2f6bc1cc"]]),Dee={class:"tdp"},Bee={class:"tdp-body"},Fee={key:1,class:"tdp-output"},Hee={key:2,class:"tdp-empty"},Wee=Ve({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Nt();return(o,i)=>(w(),N("div",Dee,[oe(Vl,{title:e.target.title,subtitle:e.target.path,"close-label":A(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),T("div",Bee,[e.target.lines&&e.target.lines.length>0?(w(),ge(h3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),N("div",Fee,[(w(!0),N(Oe,null,ot(e.target.output,(r,l)=>(w(),N("div",{key:l},R(r),1))),128))])):(w(),N("div",Hee,R(A(s)("diff.noDiff")),1))])]))}}),zee=ft(Wee,[["__scopeId","data-v-76f2fbca"]]),Uee={class:"sc"},qee={key:0,class:"sc-empty"},jee={key:2,class:"sc-loading","aria-hidden":"true"},Vee={class:"sc-composer"},Kee=["placeholder"],Gee=["disabled"],Yee=Ve({__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}=Nt(),i=W(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=W(()=>n.title?.trim()||o("sideChat.title")),l=W(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=Z(""),c=Z(null),u=Z(null);function d(){const _=a.value.trim();_&&(s("send",_),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const _=u.value;_&&(_.scrollTop=_.scrollHeight)}const h=W(()=>{const _=n.turns;if(_.length===0)return"0";const g=_.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((C,L)=>C+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${_.length}:${g.text.length}:${v}:${y}`});Ye(h,async()=>{!n.running&&!n.sending||(await gt(),f())});const p=W(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),d())}function b(){const _=c.value;_&&(_.style.height="auto",_.style.height=`${Math.min(_.scrollHeight,160)}px`)}return(_,g)=>(w(),N("div",Uee,[oe(Vl,{title:r.value,subtitle:l.value,"close-label":A(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),N("div",qee,R(A(o)("sideChat.empty")),1)):(w(),ge(a3,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(w(),N("div",jee,[oe(l3)])):ie("",!0)],512),T("div",Vee,[In(T("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:A(o)("sideChat.placeholder"),onInput:b,onKeydown:m},null,40,Kee),[[mo,a.value]]),oe(Wt,{text:A(o)("sideChat.send")},{default:ke(()=>[T("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[oe(Je,{name:"arrow-right",size:"sm"})],8,Gee)]),_:1},8,["text"])])]))}}),Xee=ft(Yee,[["__scopeId","data-v-9ee5df02"]]),Qee={class:"changes-pane"},Zee={class:"dv-path"},Jee={class:"diff-head"},ete={class:"back-label"},tte={key:0,class:"empty-state"},nte={key:1,class:"dv-lines-wrap"},ste={key:2,class:"empty-state"},ote={class:"dv-change-count"},ite={class:"ch-head"},rte={class:"br-label"},lte={class:"br-name"},ate={key:0,class:"sync-info"},cte={key:0,class:"ahead"},ute={key:0,class:"behind"},dte={key:1,class:"empty-head"},fte={key:0,class:"ch-list"},pte=["onClick"],hte={class:"fpath"},mte={key:1,class:"ch-list ch-tree"},gte={class:"tree-list"},vte=["onClick"],yte={class:"tree-name"},kte=["onClick"],bte={class:"tree-name"},_te={key:2,class:"empty-state"},wte={key:3,class:"empty-state"},Ste=Ve({__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}=Nt(),s=e,o=t;function i(O){const S=O.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(O){return r[i(O)]??"?"}function a(O,S=60){return O.length<=S?O:"…"+O.slice(O.length-S+1)}const c=W(()=>s.gitInfo!==null),u=W(()=>s.changes.length>0),d=W(()=>(s.selectedDiffPath??null)!==null),f=W(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=W(()=>s.fileDiff??[]),p=W(()=>s.fileDiffLoading===!0);function m(O){o("open",O)}function b(){o("back")}function _(){o("close")}const g=Z("list");function v(O){g.value=O}function y(O){const S={children:[]},I=[...O].sort((P,D)=>P.path.localeCompare(D.path));for(const P of I){const D=P.path.split("/");let H=S;for(let z=0;z<D.length;z++){const U=D[z],Q=z===D.length-1,X=D.slice(0,z+1).join("/");let ue=H.children.find(me=>me.name===U&&me.kind===(Q?"file":"folder"));ue||(ue={name:U,path:X,kind:Q?"file":"folder",status:Q?P.status:void 0,children:[]},H.children.push(ue)),H=ue}}return S.children}const C=W(()=>y(s.changes)),L=Z(new Set);function $(O){return!L.value.has(O)}const k=W(()=>{const O=[];function S(I,P){for(const D of I)O.push({node:D,depth:P}),D.kind==="folder"&&$(D.path)&&S(D.children,P+1)}return S(C.value,0),O});function M(O){const S=new Set(L.value);S.has(O.path)?S.delete(O.path):S.add(O.path),L.value=S}function E(O){return`${16+O*16}px`}return(O,S)=>(w(),N("div",Qee,[f.value?(w(),N(Oe,{key:0},[oe(Vl,{title:A(n)("diff.title"),closable:e.closable,"close-label":A(n)("diff.close"),onClose:_},{default:ke(()=>[oe(Wt,{text:e.selectedDiffPath??""},{default:ke(()=>[T("span",Zee,R(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),T("div",Jee,[e.hideBack?ie("",!0):(w(),ge(Pt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:ke(()=>[S[0]||(S[0]=T("span",{"aria-hidden":"true"},"←",-1)),T("span",ete,R(A(n)("diff.back")),1)]),_:1}))]),p.value?(w(),N("div",tte,R(A(n)("diff.loading")),1)):h.value.length>0?(w(),N("div",nte,[oe(h3,{lines:h.value},null,8,["lines"])])):(w(),N("div",ste,R(A(n)("diff.noDiff")),1))],64)):(w(),N(Oe,{key:1},[oe(Vl,{title:A(n)("diff.title"),closable:e.closable,"close-label":A(n)("diff.close"),onClose:_},{default:ke(()=>[T("span",ote,R(A(n)("diff.changeCount",{count:e.changes.length})),1),oe(Xo,{"model-value":g.value,size:"sm",options:[{value:"list",label:A(n)("diff.list")},{value:"tree",label:A(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),T("div",ite,[c.value?(w(),N(Oe,{key:0},[T("span",rte,R(A(n)("diff.branch")),1),T("span",lte,R(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),N("span",ate,[oe(Wt,{text:A(n)("diff.aheadTitle")},{default:ke(()=>[e.gitInfo.ahead>0?(w(),N("span",cte,"↑"+R(e.gitInfo.ahead),1)):ie("",!0)]),_:1},8,["text"]),oe(Wt,{text:A(n)("diff.behindTitle")},{default:ke(()=>[e.gitInfo.behind>0?(w(),N("span",ute,"↓"+R(e.gitInfo.behind),1)):ie("",!0)]),_:1},8,["text"])])):ie("",!0)],64)):(w(),N("span",dte,R(A(n)("diff.empty")),1))]),u.value&&g.value==="list"?(w(),N("div",fte,[(w(!0),N(Oe,null,ot(e.changes,I=>(w(),ge(Wt,{key:I.path,text:I.path},{default:ke(()=>[T("button",{type:"button",class:"ch-row",onClick:P=>m(I.path)},[T("span",{class:De(["badge",i(I.status)])},R(l(I.status)),3),T("span",hte,R(a(I.path)),1)],8,pte)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(w(),N("div",mte,[T("ul",gte,[(w(!0),N(Oe,null,ot(k.value,({node:I,depth:P})=>(w(),N("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(w(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:Yt({paddingLeft:E(P)}),onClick:D=>M(I)},[oe(Je,{class:"tree-icon",name:"folder-solid",size:"sm"}),T("span",yte,R(I.name),1)],12,vte)):(w(),ge(Wt,{key:1,text:I.path},{default:ke(()=>[T("button",{type:"button",class:"tree-row tree-file",style:Yt({paddingLeft:E(P)}),onClick:D=>m(I.path)},[T("span",{class:De(["badge",i(I.status)])},R(l(I.status)),3),T("span",bte,R(I.name),1)],12,kte)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),N("div",_te,R(A(n)("diff.clean")),1)):(w(),N("div",wte,R(A(n)("diff.empty")),1))],64))]))}}),Cte=ft(Ste,[["__scopeId","data-v-7778610a"]]);function ay(e,t){let n=null;bn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),ms(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const xte=["type","value","placeholder","disabled","readonly"],Ate=Ve({__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=Z();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:De(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,xte))}}),Za=ft(Ate,[["__scopeId","data-v-340f0da2"]]),Tte={class:"search-wrap"},Mte={key:0,class:"tab-strip"},Ete={key:1,class:"state-row"},Ite={key:2,class:"state-row unavail"},$te={key:3,class:"model-list"},Nte=["aria-selected","onClick","onMouseenter"],Lte={class:"check"},Ote={class:"model-main"},Pte={class:"model-name"},Rte={class:"model-id"},Dte={key:0,class:"caps"},Bte={class:"model-provider"},Fte={class:"model-ctx"},Hte={key:0,class:"empty"},Wte={class:"footer-hint"},zte=Ve({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=W(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=Z(""),a=Z(null),c=Z(null),u=Z("all");ay(c,a);const d=W(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const C of s.models)v.has(C.provider)||(v.add(C.provider),y.push({id:C.provider,label:C.provider}));return y}),f=W(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(C=>{if(u.value!=="all"&&C.provider!==u.value)return!1;const L=(C.displayName??C.model).toLowerCase().includes(v),$=C.provider.toLowerCase().includes(v),k=C.id.toLowerCase().includes(v);return!v||L||$||k});return u.value!=="all"?y:y.sort((C,L)=>{const $=r(C.id)?1:0;return(r(L.id)?1:0)-$})}),h=W(()=>f.value),p=Z(0);Ye([l,u],()=>{p.value=0}),Ye(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ye(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)}}bn(()=>{document.addEventListener("keydown",m)}),_n(()=>{document.removeEventListener("keydown",m)});function b(v){o("select",v)}function _(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(w(),ge(rr,{open:!0,"close-on-esc":!1,title:A(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=C=>o("close"))},{default:ke(()=>[T("div",{ref_key:"dialogRef",ref:c,class:"mp"},[T("div",Tte,[oe(Za,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=C=>l.value=C),placeholder:A(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),N("div",Mte,[(w(!0),N(Oe,null,ot(d.value,C=>(w(),ge(Pt,{key:C.id,variant:C.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(C.id)},{default:ke(()=>[je(R(C.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ie("",!0),e.loading?(w(),N("div",Ete,[oe(Zo,{size:"sm"}),T("span",null,R(A(n)("model.loading")),1)])):e.unavailable?(w(),N("div",Ite,[oe(Je,{name:"alert-triangle",size:"lg"}),T("span",null,R(A(n)("model.unavailable")),1)])):(w(),N("div",$te,[(w(!0),N(Oe,null,ot(h.value,C=>(w(),N("div",{key:C.id,class:De(["model-row",{"is-current":C.id===e.current,"is-selected":_(C)===p.value}]),role:"option","aria-selected":C.id===e.current,onClick:L=>b(C.id),onMouseenter:L=>p.value=_(C)},[T("span",Lte,[C.id===e.current?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",Ote,[T("span",Pte,R(C.displayName??C.model),1),T("span",Rte,R(C.id),1),C.capabilities&&C.capabilities.length>0?(w(),N("span",Dte,[(w(!0),N(Oe,null,ot(C.capabilities,L=>(w(),ge(Is,{key:L,variant:"info",size:"sm"},{default:ke(()=>[je(R(L),1)]),_:2},1024))),128))])):ie("",!0)]),T("span",Bte,R(C.provider),1),T("span",Fte,R(A(n)("model.contextSuffix",{size:Math.round(C.maxContextSize/1e3)})),1),oe(mn,{size:"sm",label:r(C.id)?A(n)("model.unstarTitle"):A(n)("model.starTitle"),onClick:vt(L=>o("toggle-star",C.id),["stop"])},{default:ke(()=>[r(C.id)?(w(),ge(Je,{key:0,name:"star",size:"md"})):(w(),ge(Je,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Nte))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),N("div",Hte,R(s.models.length===0?A(n)("model.emptyNoModels"):A(n)("model.emptyNoMatch")),1)):ie("",!0)])),T("div",Wte,R(A(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Ute=ft(zte,[["__scopeId","data-v-e93073d7"]]),qte={key:0,class:"ui-field__label"},jte={key:1,class:"ui-field__error"},Vte={key:2,class:"ui-field__hint"},Kte=Ve({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),N("label",qte,R(e.label),1)):ie("",!0),xn(t.$slots,"default",{},void 0,!0),e.error?(w(),N("span",jte,R(e.error),1)):e.hint?(w(),N("span",Vte,R(e.hint),1)):ie("",!0)],2))}}),Zc=ft(Kte,[["__scopeId","data-v-49bce958"]]),Gte=["value","disabled"],Yte=Ve({__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:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[xn(o.$slots,"default",{},void 0,!0)],42,Gte))}}),m3=ft(Yte,[["__scopeId","data-v-92a040fd"]]),Xte={class:"prov-list"},Qte={key:0,class:"state-row"},Zte={key:1,class:"state-row unavail"},Jte={key:2,class:"empty"},ene={class:"prov-info"},tne={class:"prov-type"},nne={key:0,class:"prov-url"},sne={class:"prov-meta"},one={key:0},ine={class:"prov-actions"},rne={key:0,class:"add-section"},lne={key:0,class:"add-btns"},ane={key:1,class:"add-form"},cne=["value"],une={key:0,class:"add-error"},dne={class:"form-btns"},fne={class:"footer-hint"},pne=Ve({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Nt(),{confirm:s}=sl(),o=Z(null);ay(o);const i=t;async function r(_){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",_)}const l=Z(!1),a=$s({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Z(""),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(_){if(_.key==="Escape"){if(l.value){f();return}i("close")}}bn(()=>document.addEventListener("keydown",p)),_n(()=>document.removeEventListener("keydown",p));function m(_){return _==="connected"?"var(--color-success)":_==="error"?"var(--color-danger)":"var(--color-text-faint)"}function b(_){return n(_==="connected"?"providers.status.connected":_==="error"?"providers.status.error":"providers.status.unconfigured")}return(_,g)=>(w(),ge(rr,{open:!0,"close-on-esc":!1,title:A(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:ke(()=>[T("div",{ref_key:"dialogRef",ref:o,class:"pm"},[T("div",Xte,[e.loading?(w(),N("div",Qte,[oe(Zo,{size:"sm"}),T("span",null,R(A(n)("providers.loading")),1)])):e.unavailable?(w(),N("div",Zte,[oe(Je,{name:"alert-triangle",size:"md"}),T("span",null,R(A(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),N("div",Jte,R(A(n)("providers.empty")),1)):(w(!0),N(Oe,{key:3},ot(e.providers,v=>(w(),N("div",{key:v.id,class:"prov-row"},[oe(Wt,{text:b(v.status)},{default:ke(()=>[T("span",{class:De(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Yt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),T("div",ene,[T("span",tne,R(v.type),1),v.baseUrl?(w(),N("span",nne,R(v.baseUrl),1)):ie("",!0),T("span",sne,[oe(Is,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:ke(()=>[je(R(v.hasApiKey?A(n)("providers.keySet"):A(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(w(),N("span",one," · "+R(A(n)("providers.modelCount",{count:v.models.length})),1)):ie("",!0)])]),T("div",ine,[oe(Wt,{text:A(n)("providers.refreshTitle",{type:v.type})},{default:ke(()=>[oe(Pt,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:ke(()=>[je(R(A(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),oe(Wt,{text:A(n)("providers.deleteTitle",{type:v.type})},{default:ke(()=>[oe(Pt,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:ke(()=>[je(R(A(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ie("",!0):(w(),N("div",rne,[l.value?(w(),N("div",ane,[oe(Zc,{label:A(n)("providers.fieldType")},{default:ke(()=>[oe(m3,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:ke(()=>[(w(),N(Oe,null,ot(u,v=>T("option",{key:v,value:v},R(v),9,cne)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),oe(Zc,{label:A(n)("providers.fieldApiKey")},{default:ke(()=>[oe(Za,{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"]),oe(Zc,{label:A(n)("providers.fieldBaseUrl")},{default:ke(()=>[oe(Za,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:A(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),oe(Zc,{label:A(n)("providers.fieldDefaultModel")},{default:ke(()=>[oe(Za,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:A(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(w(),N("div",une,R(c.value),1)):ie("",!0),T("div",dne,[oe(Pt,{variant:"primary",size:"sm",onClick:h},{default:ke(()=>[je(R(A(n)("providers.add")),1)]),_:1}),oe(Pt,{variant:"secondary",size:"sm",onClick:f},{default:ke(()=>[je(R(A(n)("common.cancel")),1)]),_:1})])])):(w(),N("div",lne,[oe(Pt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:ke(()=>[oe(Je,{name:"user",size:"sm"}),je(" "+R(A(n)("providers.loginKimi")),1)]),_:1}),oe(Pt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:ke(()=>[oe(Je,{name:"user",size:"sm"}),je(" "+R(A(n)("providers.loginAnthropic")),1)]),_:1}),oe(Pt,{variant:"primary",size:"sm",onClick:d},{default:ke(()=>[oe(Je,{name:"plus",size:"sm"}),je(" "+R(A(n)("providers.enterApiKey")),1)]),_:1})]))])),T("div",fne,R(A(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),hne=ft(pne,[["__scopeId","data-v-fb6f1365"]]),mne={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},gne={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},vne={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Gg=Ve({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),N("svg",mne,[...n[0]||(n[0]=[T("circle",{cx:"18",cy:"18",r:"15"},null,-1),T("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),N("svg",gne,[...n[1]||(n[1]=[T("circle",{cx:"14",cy:"14",r:"12"},null,-1),T("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),T("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),N("svg",vne,[...n[2]||(n[2]=[T("path",{d:"M14 3 L26 24 H2 Z"},null,-1),T("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),T("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),yne={key:0,class:"center-body"},kne={class:"center-text"},bne={key:1,class:"nb"},_ne={class:"nb-lead"},wne=["href"],Sne={class:"nb-or"},Cne={class:"nb-fallback"},xne={class:"nb-fb-text"},Ane=["href"],Tne={class:"nb-code-row"},Mne={class:"nb-code"},Ene={class:"nb-status"},Ine={class:"nb-status-text"},$ne={class:"nb-countdown"},Nne={key:2,class:"center-body"},Lne={class:"center-text success-text"},One={class:"center-hint"},Pne={class:"center-body"},Rne={class:"center-text err-text"},Dne={class:"center-hint"},Bne={class:"actions"},Fne={class:"center-body"},Hne={class:"center-text warn-text"},Wne={class:"center-hint"},zne={class:"actions"},Une=Ve({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=Z(!0),o=t,i=e,r=Z("starting"),l=Z(null),a=Z(0),c=Z(!1);let u=null,d=null;bn(async()=>{await f()}),_n(()=>{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 C=await i.onPollOAuthLogin();C?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):C?.status==="expired"||C?.status==="cancelled"?(m(),r.value="expired"):p(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function b(){await f()}async function _(){!l.value||!await Hs(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 C=Math.floor(y/60),L=y%60;return`${C}:${String(L).padStart(2,"0")}`}return(y,C)=>(w(),ge(rr,{open:s.value,"onUpdate:open":C[0]||(C[0]=L=>s.value=L),title:A(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:ke(()=>[r.value==="starting"?(w(),N("div",yne,[oe(Zo,{size:"md"}),T("span",kne,R(A(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(w(),N("div",bne,[T("div",_ne,R(A(n)("login.lead")),1),T("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[je(R(A(n)("login.authorizeInBrowser"))+" ",1),oe(Je,{name:"external-link",size:"sm"})],8,wne),T("div",Sne,R(A(n)("login.orDivider")),1),T("div",Cne,[T("div",xne,[je(R(A(n)("login.fallbackPrefix")),1),T("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},R(l.value.verificationUri),9,Ane),je(R(A(n)("login.fallbackSuffix")),1)]),T("div",Tne,[T("span",Mne,R(l.value.userCode),1),oe(Pt,{class:De(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:_},{default:ke(()=>[c.value?(w(),N(Oe,{key:0},[oe(Je,{name:"check",size:"sm"}),je(" "+R(A(n)("login.copied")),1)],64)):(w(),N(Oe,{key:1},[oe(Je,{name:"copy",size:"sm"}),je(" "+R(A(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),T("div",Ene,[oe(Zo,{size:"sm",label:A(n)("login.waitingAuth")},null,8,["label"]),T("span",Ine,R(A(n)("login.waitingAutoClose")),1),T("span",$ne,R(v(a.value)),1)])])):r.value==="success"?(w(),N("div",Nne,[oe(Gg,{kind:"success"}),T("span",Lne,R(A(n)("login.success")),1),T("span",One,R(A(n)("login.successHint")),1)])):r.value==="expired"?(w(),N(Oe,{key:3},[T("div",Pne,[oe(Gg,{kind:"expired"}),T("span",Rne,R(A(n)("login.expiredTitle")),1),T("span",Dne,R(A(n)("login.expiredHint")),1)]),T("div",Bne,[oe(Pt,{variant:"primary",onClick:b},{default:ke(()=>[je(R(A(n)("login.retry")),1)]),_:1}),oe(Pt,{variant:"secondary",onClick:g},{default:ke(()=>[je(R(A(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),N(Oe,{key:4},[T("div",Fne,[oe(Gg,{kind:"error"}),T("span",Hne,R(A(n)("login.errorTitle")),1),T("span",Wne,R(A(n)("login.errorHint")),1)]),T("div",zne,[oe(Pt,{variant:"primary",onClick:b},{default:ke(()=>[je(R(A(n)("login.retry")),1)]),_:1}),oe(Pt,{variant:"secondary",onClick:g},{default:ke(()=>[je(R(A(n)("login.closeBtn")),1)]),_:1})])],64)):ie("",!0)]),_:1},8,["open","title"]))}}),qne=ft(Une,[["__scopeId","data-v-b228800e"]]),g3=Ve({__name:"LanguageSwitcher",setup(e){const{locale:t}=Nt(),n=bA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&_A(o)}return(o,i)=>(w(),ge(Xo,{"model-value":A(t),options:A(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),AS=1e3,Yg=16384,Xg=500,Qg=50,jne=6,Vne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Kne=/^[A-Za-z0-9+/=_-]{200,}$/;let Zg=null;function pi(){if(Zg!==null)return Zg;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=Zn($t.debug)==="1"),Zg=e,e}const Fr=[];let Gne=1;const cy=Z(0),Jc=Yl(!1);function Yne(){return Fr}function Xne(){Fr.length=0,cy.value++}function il(e){Jc.value||(Fr.push({id:Gne++,ts:Date.now(),...e}),Fr.length>AS&&Fr.splice(0,Fr.length-AS),cy.value++)}function C1(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 Kne.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>Xg?`${o.slice(0,Xg)}… [+${o.length-Xg} chars]`:o}if(n!=="object")return String(e);if(t>=jne)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,Qg).map(i=>C1(i,t+1));return e.length>Qg&&o.push(`[+${e.length-Qg} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=Vne.test(o)?"[redacted]":C1(i,t+1);return s}function Zl(e){if(e===void 0)return;const t=C1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Yg)return{_truncated:`detail JSON was ${n.length} chars; first ${Yg} kept`,preview:n.slice(0,Yg)}}catch{return"[unserializable detail]"}return t}function TS(e){pi()&&il({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Zl(e.body)}})}function MS(e){if(!pi())return;const t=e.code!==0;il({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:Zl(e.data)}})}function pf(e){pi()&&il({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 _a(e,t){pi()&&il({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Zl(t)})}function Qne(e){if(!pi())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;il({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Zl(e)})}function Zne(e){if(!pi())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);il({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Zl(t.payload)})}const Jne={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Jg(e,t,n){pi()&&il({source:"client",kind:`client:${e}`,label:`${Jne[e]} ${t}`,detail:Zl(n)})}function Nr(e,t){pi()&&il({source:"client",kind:"client:event",label:`· ${e}`,detail:Zl(t)})}let ES=!1;function ese(){if(!(ES||!pi())){ES=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Jg("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;Jg("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{Jg(e,n.map(tse).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function tse(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 v3(e=Fr){if(typeof document>"u")return;const t=new Blob([nse(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 nse(e=Fr){return e.map(t=>JSON.stringify(t)).join(`
260
- `)}const sse=["aria-checked","aria-label","disabled"],ose=Ve({__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:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[T("span",{class:"ui-switch__thumb"},null,-1)])],10,sse))}}),Cr=ft(ose,[["__scopeId","data-v-dbe22dc4"]]),ise=["aria-label"],rse=["aria-selected","onClick"],lse={class:"body"},ase={class:"panel"},cse={class:"sec"},use={class:"sec-title"},dse={class:"row"},fse={class:"rlabel"},pse={class:"row"},hse={class:"rlabel"},mse={class:"row"},gse={class:"rlabel"},vse={class:"num-field"},yse=["value","aria-label"],kse={class:"row"},bse={class:"rlabel"},_se={class:"row"},wse={class:"rlabel"},Sse={class:"hint"},Cse={class:"sec"},xse={class:"sec-title"},Ase={class:"row"},Tse={class:"rlabel"},Mse={key:0,class:"hint"},Ese={class:"row"},Ise={class:"rlabel"},$se={key:0,class:"hint"},Nse={class:"row"},Lse={class:"rlabel"},Ose={class:"panel"},Pse={class:"sec"},Rse={class:"sec-title"},Dse={class:"row"},Bse={class:"rlabel"},Fse={key:0,class:"rvalue"},Hse={class:"actions"},Wse={class:"panel"},zse={class:"sec"},Use={class:"sec-head"},qse={class:"sec-title"},jse={key:0,class:"saving"},Vse={class:"row"},Kse={class:"rlabel"},Gse={class:"hint"},Yse={key:0,class:"select-wrap"},Xse={key:0,value:"",disabled:""},Qse=["label"],Zse=["value"],Jse={key:1,class:"rvalue mono"},eoe={class:"row"},toe={class:"rlabel"},noe={class:"hint"},soe={class:"row"},ooe={class:"rlabel"},ioe={class:"hint"},roe={class:"row"},loe={class:"rlabel"},aoe={class:"hint"},coe={class:"row"},uoe={class:"rlabel"},doe={class:"hint"},foe={key:1,class:"empty-config"},poe={class:"panel"},hoe={class:"sec"},moe={class:"sec-title"},goe={class:"row"},voe={class:"rlabel"},yoe={class:"rvalue mono"},koe={class:"row"},boe={class:"rlabel"},_oe={class:"rvalue mono"},woe={key:0,class:"row"},Soe={class:"rlabel"},Coe={class:"hint"},xoe={class:"hint"},Aoe={class:"row"},Toe={class:"rlabel"},Moe={key:0,class:"hint"},Eoe=Ve({__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}=Nt(),s=e,o=t,i=Z("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"}],l=b5(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=Z(null);ay(u);function d(E){E.key==="Escape"&&o("close")}bn(()=>document.addEventListener("keydown",d)),_n(()=>document.removeEventListener("keydown",d));function f(){v3()}const h=W(()=>{const E=new Map;for(const O of s.models??[])E.set(O.id,{id:O.id,label:O.displayName??O.model??O.id,provider:O.provider});for(const[O,S]of Object.entries(s.config?.models??{})){if(E.has(O))continue;const I=b(S);E.set(O,{id:O,label:_(O,S,I),provider:I??O})}return Array.from(E.values())}),p=W(()=>{const E=new Map;for(const O of h.value){const S=E.get(O.provider)??[];S.push(O),E.set(O.provider,S)}for(const O of E.values())O.sort((S,I)=>S.label.localeCompare(I.label));return Array.from(E.entries()).toSorted(([O],[S])=>O.localeCompare(S)).map(([O,S])=>({provider:O,options:S}))}),m=W(()=>{const E=s.config?.defaultPermissionMode;return E==="auto"||E==="yolo"||E==="manual"?E:"manual"});function b(E){if(!E||typeof E!="object")return;const O=E;return typeof O.provider=="string"?O.provider:void 0}function _(E,O,S){if(!O||typeof O!="object")return E;const I=O,P=typeof I.model=="string"?I.model:void 0,D=S??b(O);return P&&D?`${E} (${D}/${P})`:P?`${E} (${P})`:E}function g(E){return E===!0}function v(E){!E||E===s.config?.defaultModel||o("updateConfig",{defaultModel:E})}function y(E){E!==m.value&&o("updateConfig",{defaultPermissionMode:E})}function C(E){const O=s.config?.[E];o("updateConfig",{[E]:!g(O)})}function L(){const E=s.config?.thinking;return!E||typeof E!="object"?!0:E.enabled!==!1}function $(){o("updateConfig",{thinking:{enabled:!L()}})}function k(){const E=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!E})}function M(E){i.value=E}return(E,O)=>(w(),ge(rr,{open:!0,"close-on-esc":!1,title:A(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:O[15]||(O[15]=S=>o("close"))},{default:ke(()=>[T("div",{ref_key:"dialogRef",ref:u,class:"sd"},[T("nav",{class:"settings-tabs",role:"tablist","aria-label":A(n)("settings.title")},[(w(),N(Oe,null,ot(r,S=>T("button",{key:S.id,type:"button",class:De(["tab",{on:i.value===S.id}]),role:"tab","aria-selected":i.value===S.id,onClick:I=>M(S.id)},R(A(n)(S.labelKey)),11,rse)),64))],8,ise),T("div",lse,[In(T("section",ase,[T("section",cse,[T("h3",use,R(A(n)("settings.appearance")),1),T("div",dse,[T("span",fse,R(A(n)("theme.colorSchemeLabel")),1),oe(Xo,{"model-value":e.colorScheme,options:[{value:"light",label:A(n)("theme.light")},{value:"dark",label:A(n)("theme.dark")},{value:"system",label:A(n)("theme.system")}],"onUpdate:modelValue":O[0]||(O[0]=S=>o("setColorScheme",S))},null,8,["model-value","options"])]),T("div",pse,[T("span",hse,R(A(n)("theme.accentLabel")),1),oe(Xo,{"model-value":e.accent,options:[{value:"blue",label:A(n)("theme.accentBlue")},{value:"mono",label:A(n)("theme.accentBlack")}],"onUpdate:modelValue":O[1]||(O[1]=S=>o("setAccent",S))},null,8,["model-value","options"])]),T("div",mse,[T("span",gse,R(A(n)("settings.uiFontSize")),1),T("label",vse,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:O[2]||(O[2]=S=>o("setUiFontSize",Number(S.target.value)))},null,40,yse),O[16]||(O[16]=T("span",{class:"num-unit"},"px",-1))])]),T("div",kse,[T("span",bse,R(A(n)("sidebar.language")),1),oe(g3)]),T("div",_se,[T("span",wse,[je(R(A(n)("settings.conversationToc"))+" ",1),T("span",Sse,R(A(n)("settings.conversationTocHint")),1)]),oe(Cr,{"model-value":e.conversationToc??!0,label:A(n)("settings.conversationToc"),"onUpdate:modelValue":O[3]||(O[3]=S=>o("setConversationToc",S))},null,8,["model-value","label"])])]),T("section",Cse,[T("h3",xse,R(A(n)("settings.notifications")),1),T("div",Ase,[T("span",Tse,[je(R(A(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",Mse,R(A(n)("settings.notifyDenied")),1)):ie("",!0)]),oe(Cr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:A(n)("settings.notifyOnComplete"),"onUpdate:modelValue":O[4]||(O[4]=S=>o("setNotify",S))},null,8,["model-value","disabled","label"])]),T("div",Ese,[T("span",Ise,[je(R(A(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",$se,R(A(n)("settings.notifyDenied")),1)):ie("",!0)]),oe(Cr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:A(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":O[5]||(O[5]=S=>o("setNotifyQuestion",S))},null,8,["model-value","disabled","label"])]),T("div",Nse,[T("span",Lse,R(A(n)("settings.soundOnComplete")),1),oe(Cr,{"model-value":e.sound,label:A(n)("settings.soundOnComplete"),"onUpdate:modelValue":O[6]||(O[6]=S=>o("setSound",S))},null,8,["model-value","label"])])])],512),[[Vo,i.value==="general"]]),In(T("section",Ose,[T("section",Pse,[T("h3",Rse,R(A(n)("settings.account")),1),T("div",Dse,[T("span",Bse,R(e.authReady?"managed:kimi-code":A(n)("sidebar.notSignedIn")),1),oe(Wt,{text:e.accountModel},{default:ke(()=>[e.authReady&&e.accountModel?(w(),N("span",Fse,R(e.accountModel),1)):ie("",!0)]),_:1},8,["text"])]),T("div",Hse,[oe(Pt,{variant:"secondary",size:"sm",onClick:O[7]||(O[7]=S=>{o("openOnboarding"),o("close")})},{default:ke(()=>[je(R(A(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),ge(Pt,{key:0,variant:"danger-soft",size:"sm",onClick:O[8]||(O[8]=S=>o("logout"))},{default:ke(()=>[je(R(A(n)("sidebar.signOut")),1)]),_:1})):(w(),ge(Pt,{key:1,variant:"primary",size:"sm",onClick:O[9]||(O[9]=S=>o("login"))},{default:ke(()=>[je(R(A(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[Vo,i.value==="account"]]),In(T("section",Wse,[T("section",zse,[T("div",Use,[T("h3",qse,R(A(n)("settings.agentDefaults")),1),e.configSaving?(w(),N("span",jse,R(A(n)("settings.saving")),1)):ie("",!0)]),e.config?(w(),N(Oe,{key:0},[T("div",Vse,[T("span",Kse,[je(R(A(n)("settings.defaultModel"))+" ",1),T("span",Gse,R(A(n)("settings.defaultModelHint")),1)]),p.value.length>0?(w(),N("div",Yse,[oe(m3,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":A(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:ke(()=>[e.config.defaultModel?ie("",!0):(w(),N("option",Xse,R(A(n)("settings.noDefaultModel")),1)),(w(!0),N(Oe,null,ot(p.value,S=>(w(),N("optgroup",{key:S.provider,label:S.provider},[(w(!0),N(Oe,null,ot(S.options,I=>(w(),N("option",{key:I.id,value:I.id},R(I.label),9,Zse))),128))],8,Qse))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),N("span",Jse,R(e.config.defaultModel??A(n)("settings.noDefaultModel")),1))]),T("div",eoe,[T("span",toe,[je(R(A(n)("settings.defaultPermission"))+" ",1),T("span",noe,R(A(n)("settings.defaultPermissionHint")),1)]),oe(Xo,{"model-value":m.value,options:a.map(S=>({value:S,label:A(n)(c[S])})),"onUpdate:modelValue":O[10]||(O[10]=S=>y(S))},null,8,["model-value","options"])]),T("div",soe,[T("span",ooe,[je(R(A(n)("settings.defaultThinking"))+" ",1),T("span",ioe,R(A(n)("settings.defaultThinkingHint")),1)]),oe(Cr,{"model-value":L(),disabled:e.configSaving,label:A(n)("settings.defaultThinking"),"onUpdate:modelValue":O[11]||(O[11]=S=>$())},null,8,["model-value","disabled","label"])]),T("div",roe,[T("span",loe,[je(R(A(n)("settings.defaultPlanMode"))+" ",1),T("span",aoe,R(A(n)("settings.defaultPlanModeHint")),1)]),oe(Cr,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:A(n)("settings.defaultPlanMode"),"onUpdate:modelValue":O[12]||(O[12]=S=>C("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),T("div",coe,[T("span",uoe,[je(R(A(n)("settings.mergeSkills"))+" ",1),T("span",doe,R(A(n)("settings.mergeSkillsHint")),1)]),oe(Cr,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:A(n)("settings.mergeSkills"),"onUpdate:modelValue":O[13]||(O[13]=S=>C("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),N("div",foe,R(A(n)("settings.configUnavailable")),1))])],512),[[Vo,i.value==="agent"]]),In(T("section",poe,[T("section",hoe,[T("h3",moe,R(A(n)("settings.advanced")),1),T("div",goe,[T("span",voe,R(A(n)("sidebar.daemon")),1),T("span",yoe,R(A(l)),1)]),T("div",koe,[T("span",boe,R(A(n)("settings.serverVersion")),1),T("span",_oe,R(e.serverVersion||"-"),1)]),e.config?(w(),N("div",woe,[T("span",Soe,[je(R(A(n)("settings.telemetry"))+" ",1),T("span",Coe,R(A(n)("settings.telemetryHint")),1),T("span",xoe,R(A(n)("settings.telemetryRestartHint")),1)]),oe(Cr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:A(n)("settings.telemetry"),"onUpdate:modelValue":O[14]||(O[14]=S=>k())},null,8,["model-value","disabled","label"])])):ie("",!0),T("div",Aoe,[T("span",Toe,[je(R(A(n)("settings.exportLog"))+" ",1),A(pi)()?ie("",!0):(w(),N("span",Moe,R(A(n)("settings.logHint")),1))]),oe(Pt,{variant:"secondary",size:"sm",onClick:f},{default:ke(()=>[je(R(A(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[Vo,i.value==="advanced"]])])],512)]),_:1},8,["title"]))}}),Ioe=ft(Eoe,[["__scopeId","data-v-b6913864"]]),$oe={class:"aw"},Noe={class:"crumbbar"},Loe={class:"crumbs"},Ooe={key:0,class:"crumb-sep"},Poe=["onClick"],Roe={key:0,class:"filterbar"},Doe=["placeholder"],Boe={class:"folder-list"},Foe={key:0,class:"fl-loading"},Hoe=["onClick"],Woe={class:"folder-name search-rel"},zoe={key:0,class:"git-branch"},Uoe={key:0,class:"fl-empty"},qoe={key:1,class:"fl-loading"},joe=["onClick"],Voe={class:"folder-name"},Koe={key:0,class:"git-branch"},Goe={key:0,class:"fl-empty"},Yoe={class:"paste-row"},Xoe={class:"paste-input-wrap"},Qoe={key:1,class:"add-error",role:"alert"},Zoe={class:"actions"},Joe={class:"footer-hint"},eie=600,tie=6,IS=150,nie=Ve({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=Z(!0),r=Z(!1),l=Z(!1),a=Z(""),c=Z(null),u=Z([]),d=Z(""),f=Z(!1),h=Z([]),p=W(()=>d.value.trim().length>0);let m=0,b=null;function _(I,P){const D=I.toLowerCase(),H=P.toLowerCase();let z=0;for(let U=0;U<H.length&&z<D.length;U++)H[U]===D[z]&&z++;return z===D.length}async function g(I){const P=a.value,D=I.trim();if(!P||D===""){h.value=[],f.value=!1;return}const H=++m;f.value=!0;const z=[],U=[{path:P,depth:0}];let Q=0;for(;U.length>0&&Q<eie&&z.length<IS;){if(H!==m)return;const X=U.shift();Q++;let ue;try{ue=await s.browseFs(X.path)}catch{continue}if(H!==m)return;for(const me of ue.entries){if(!me.isDir)continue;const Ae=me.path.startsWith(P)?me.path.slice(P.length).replace(/^\/+/,""):me.path;if(_(D,Ae||me.name)&&(z.push({path:me.path,name:me.name,rel:Ae||me.name,isGitRepo:me.isGitRepo,branch:me.branch}),z.length>=IS))break;X.depth+1<tie&&U.push({path:me.path,depth:X.depth+1})}H===m&&(h.value=[...z])}H===m&&(f.value=!1)}Ye(d,I=>{if(b&&clearTimeout(b),I.trim()===""){m++,h.value=[],f.value=!1;return}b=setTimeout(()=>void g(I),220)});const v=Z(!1),y=Z(""),C=W(()=>y.value.trim()),L=W(()=>{const I=a.value;if(!I)return[];const P=I.split("/").filter(Boolean),D=[{label:"/",path:"/"}];let H="";for(const z of P)H+=`/${z}`,D.push({label:z,path:H});return D}),$=W(()=>a.value.length>0);async function k(I){r.value=!0;try{const P=await s.browseFs(I);if(!P.path){l.value=!0;return}a.value=P.path,c.value=P.parent,u.value=P.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function M(I){I.isDir&&k(I.path)}function E(){c.value&&k(c.value)}function O(){$.value&&o("add",a.value)}function S(){C.value.length!==0&&o("add",C.value)}return bn(async()=>{r.value=!0;try{if(s.defaultPath&&(await k(s.defaultPath),!l.value))return;const I=await s.getFsHome();I.home?await k(I.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),_n(()=>{b&&clearTimeout(b)}),(I,P)=>(w(),ge(rr,{open:i.value,"onUpdate:open":P[5]||(P[5]=D=>i.value=D),title:A(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:P[6]||(P[6]=D=>o("close"))},{default:ke(()=>[T("div",$oe,[l.value?ie("",!0):(w(),N(Oe,{key:0},[T("div",Noe,[oe(mn,{size:"sm",disabled:!c.value,label:A(n)("workspace.up"),onClick:E},{default:ke(()=>[oe(Je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),T("div",Loe,[(w(!0),N(Oe,null,ot(L.value,(D,H)=>(w(),N(Oe,{key:D.path},[H>1?(w(),N("span",Ooe,"/")):ie("",!0),T("button",{class:De(["crumb",{last:H===L.value.length-1}]),onClick:z=>k(D.path)},R(D.label),11,Poe)],64))),128))])]),r.value?ie("",!0):(w(),N("div",Roe,[oe(Je,{class:"filter-icon",name:"search",size:"md"}),In(T("input",{"onUpdate:modelValue":P[0]||(P[0]=D=>d.value=D),class:"filter-input",type:"text",placeholder:A(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:P[1]||(P[1]=vt(()=>{},["stop"]))},null,40,Doe),[[mo,d.value]]),f.value?(w(),ge(Zo,{key:0,size:"sm"})):ie("",!0)])),T("div",Boe,[r.value?(w(),N("div",Foe,R(A(n)("workspace.browsing")),1)):p.value?(w(),N(Oe,{key:1},[(w(!0),N(Oe,null,ot(h.value,D=>(w(),N("button",{key:D.path,class:"folder-row",onClick:H=>k(D.path)},[oe(Je,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",Woe,R(D.rel),1),D.isGitRepo?(w(),ge(Is,{key:0,variant:"info",size:"sm"},{default:ke(()=>[je(R(A(n)("workspace.gitTag")),1),D.branch?(w(),N("span",zoe,R(D.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,Hoe))),128)),!f.value&&h.value.length===0?(w(),N("div",Uoe,R(A(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),N("div",qoe,R(A(n)("workspace.searching")),1)):ie("",!0)],64)):(w(),N(Oe,{key:2},[(w(!0),N(Oe,null,ot(u.value,D=>(w(),N("button",{key:D.path,class:"folder-row",onClick:H=>M(D)},[oe(Je,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",Voe,R(D.name),1),D.isGitRepo?(w(),ge(Is,{key:0,variant:"info",size:"sm"},{default:ke(()=>[je(R(A(n)("workspace.gitTag")),1),D.branch?(w(),N("span",Koe,R(D.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,joe))),128)),u.value.length===0?(w(),N("div",Goe,R(A(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),T("div",{class:De(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(w(),ge(Pt,{key:0,variant:"ghost",size:"sm",onClick:P[2]||(P[2]=D=>v.value=!0)},{default:ke(()=>[je(R(A(n)("workspace.pasteToggle")),1)]),_:1})):(w(),ge(Zc,{key:1,label:A(n)("workspace.pathLabel")},{default:ke(()=>[T("div",Yoe,[T("div",Xoe,[oe(Za,{modelValue:y.value,"onUpdate:modelValue":P[3]||(P[3]=D=>y.value=D),placeholder:A(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:li(vt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),oe(mn,{disabled:C.value.length===0,label:A(n)("workspace.add"),onClick:S},{default:ke(()=>[oe(Je,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(w(),N("div",Qoe,R(e.error),1)):ie("",!0),T("div",Zoe,[oe(Wt,{text:a.value},{default:ke(()=>[l.value?ie("",!0):(w(),ge(Pt,{key:0,variant:"primary",disabled:!$.value,onClick:O},{default:ke(()=>[je(R(A(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),oe(Pt,{variant:"secondary",onClick:P[4]||(P[4]=D=>o("close"))},{default:ke(()=>[je(R(A(n)("workspace.cancel")),1)]),_:1})]),T("div",Joe,R(A(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),sie=ft(nie,[["__scopeId","data-v-ad529757"]]),oie={key:0,class:"confirm-dialog__message"},iie=Ve({__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}=Nt();function o(){n("update:open",!1),n("cancel")}return(i,r)=>(w(),ge(rr,{open:e.open,title:e.title,height:"auto","onUpdate:open":r[1]||(r[1]=l=>n("update:open",l)),onClose:o},{foot:ke(()=>[oe(Pt,{variant:"secondary",disabled:e.loading,onClick:o},{default:ke(()=>[je(R(e.cancelLabel??A(s)("common.cancel")),1)]),_:1},8,["disabled"]),oe(Pt,{variant:e.variant,loading:e.loading,onClick:r[0]||(r[0]=l=>n("confirm"))},{default:ke(()=>[je(R(e.confirmLabel??A(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:ke(()=>[e.message?(w(),N("p",oie,R(e.message),1)):ie("",!0)]),_:1},8,["open","title"]))}}),rie=ft(iie,[["__scopeId","data-v-a9df9b9a"]]),lie=Ve({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=sl();return(s,o)=>(w(),ge(rie,{open:A(t)!==null,title:A(t)?.title??"",message:A(t)?.message,"confirm-label":A(t)?.confirmLabel,"cancel-label":A(t)?.cancelLabel,variant:A(t)?.variant,onConfirm:o[0]||(o[0]=i=>A(n)(!0)),onCancel:o[1]||(o[1]=i=>A(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),aie={class:"rows"},cie={class:"row"},uie={class:"row"},die={class:"row"},fie={class:"row"},pie={class:"row"},hie={class:"row"},mie={class:"ctx-text"},gie={key:0,class:"bar"},vie={class:"row"},yie=Ve({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=Z(!0),r=W(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=W(()=>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=W(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=W(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=W(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=W(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=W(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(w(),ge(rr,{open:i.value,"onUpdate:open":m[0]||(m[0]=b=>i.value=b),title:A(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=b=>o("close"))},{default:ke(()=>[T("dl",aie,[T("div",cie,[T("dt",null,R(A(n)("status.statusModel")),1),T("dd",null,R(e.status.model),1)]),T("div",uie,[T("dt",null,R(A(n)("status.statusThinking")),1),T("dd",null,R(e.thinking),1)]),T("div",die,[T("dt",null,R(A(n)("status.statusPermission")),1),T("dd",{style:Yt({color:c.value})},R(a(e.status.permission)),5)]),T("div",fie,[T("dt",null,R(A(n)("status.statusPlanMode")),1),T("dd",{class:De({"plan-on":e.planMode})},R(u.value),3)]),T("div",pie,[T("dt",null,R(A(n)("status.statusSwarmMode")),1),T("dd",{class:De({"swarm-on":e.swarmMode})},R(d.value),3)]),T("div",hie,[T("dt",null,R(A(n)("status.statusContext")),1),T("dd",null,[T("span",mie,R(l.value),1),e.status.ctxMax>0?(w(),N("span",gie,[T("i",{style:Yt({width:r.value+"%"})},null,4)])):ie("",!0)])]),T("div",vie,[T("dt",null,R(A(n)("status.statusCost")),1),T("dd",null,R(h.value),1)])])]),_:1},8,["open","title"]))}}),kie=ft(yie,[["__scopeId","data-v-59dd31f3"]]),bie={class:"ui-toast__icon","aria-hidden":"true"},_ie={class:"ui-toast__body"},wie={class:"ui-toast__title"},Sie={key:0,class:"ui-toast__msg"},Cie=Ve({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[T("span",bie,[xn(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),ge(Je,{key:0,name:"check"})):e.variant==="danger"?(w(),ge(Je,{key:1,name:"close"})):e.variant==="warning"?(w(),ge(Je,{key:2,name:"alert-triangle"})):(w(),ge(Je,{key:3,name:"info"}))],!0)]),T("div",_ie,[T("div",wie,R(e.title),1),e.message?(w(),N("div",Sie,R(e.message),1)):ie("",!0),xn(t.$slots,"default",{},void 0,!0)]),oe(mn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:ke(()=>[oe(Je,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),xie=ft(Cie,[["__scopeId","data-v-adc6f346"]]),Aie={key:0,class:"actions"},Tie=["onClick"],Mie=["onClick"],Eie={key:1,class:"details"},Iie=Ve({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt();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 E=k.details??[];if(E.length>0){M.push("",`${o("warnings.diagnostics")}:`);for(const O of E)M.push(`${O.label}: ${O.value}`)}return M.join(`
261
- `)}let f=1;const h=Z([]),p=new Map,m=new Map;function b(k){const M=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function _(k,M){const E=p.get(k)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>$(k),M),E.deadline=Date.now()+M,p.set(k,E)}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(O=>O.id===k)?.detailsOpen)return;const E=p.get(k);!E||E.handle!==null||_(k,E.remaining)}function C(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?v(k.id):y(k.id)}async function L(k){if(!await Hs(d(k.warning)))return;k.copied=!0;const E=m.get(k.id);E&&clearTimeout(E),m.set(k.id,setTimeout(()=>{k.copied=!1,m.delete(k.id)},1400))}function $(k){g(k);const M=m.get(k);M&&clearTimeout(M),m.delete(k);const E=h.value.findIndex(O=>O.id===k);E!==-1&&(h.value=h.value.filter(O=>O.id!==k),s("dismiss",E))}return Ye(()=>n.warnings,k=>{const M=[...h.value];h.value=k.map(E=>{const O=u(E),S=M.findIndex(D=>D.key===O),I=S===-1?void 0:M.splice(S,1)[0];if(I)return I.warning=E,I;const P={id:f++,key:O,warning:E,detailsOpen:!1,copied:!1};return _(P.id,b(E)),P});for(const E of M){g(E.id);const O=m.get(E.id);O&&clearTimeout(O),m.delete(E.id)}},{immediate:!0,flush:"post"}),_n(()=>{p.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),p.clear(),m.forEach(k=>clearTimeout(k)),m.clear()}),(k,M)=>(w(),ge(K$,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:ke(()=>[(w(!0),N(Oe,null,ot(h.value,E=>(w(),ge(xie,{key:E.id,variant:c(E.warning)?"danger":"warning",title:r(E.warning),message:l(E.warning),"dismiss-label":A(o)("warnings.dismiss"),onDismiss:O=>$(E.id),onPointerenter:O=>v(E.id),onPointerleave:O=>y(E.id)},{default:ke(()=>[a(E.warning)?.length?(w(),N("div",Aie,[T("button",{class:"link",type:"button",onClick:O=>C(E)},R(E.detailsOpen?A(o)("warnings.hideDetails"):A(o)("warnings.showDetails")),9,Tie),T("button",{class:"link",type:"button",onClick:O=>L(E)},R(E.copied?A(o)("warnings.copied"):A(o)("warnings.copyDetails")),9,Mie)])):ie("",!0),E.detailsOpen&&a(E.warning)?.length?(w(),N("dl",Eie,[(w(!0),N(Oe,null,ot(a(E.warning),O=>(w(),N("div",{key:`${O.label}:${O.value}`,class:"detail-row"},[T("dt",null,R(O.label),1),T("dd",null,R(O.value),1)]))),128))])):ie("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),$ie=ft(Iie,[["__scopeId","data-v-92efeff8"]]),Nie={class:"topbar"},Lie={class:"wsq"},Oie=["aria-label"],Pie={class:"tb-path"},Rie={class:"ws"},Die={class:"se"},Bie={class:"tb-sub"},Fie=Ve({__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}=Nt(),s=e,o=t,i=W(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=W(()=>s.workspace?.name??n("workspace.noWorkspace")),l=W(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),N("div",Nie,[T("span",Lie,R(i.value),1),T("button",{type:"button",class:"tb-mid","aria-label":A(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[T("span",Pie,[T("span",Rie,R(r.value),1),e.sessionTitle?(w(),N(Oe,{key:0},[c[2]||(c[2]=T("span",{class:"sl"},"/",-1)),T("span",Die,R(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=T("span",{class:"cv"},"⌄",-1))]),T("span",Bie,[T("span",{class:De(["rd",{on:e.running}])},null,2),T("span",null,R(l.value),1),e.branch?(w(),N(Oe,{key:0},[je(" · "+R(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(w(),N(Oe,{key:1},[je(" · "+R(A(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,Oie),oe(mn,{size:"lg",label:A(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:ke(()=>[oe(Je,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Hie=ft(Fie,[["__scopeId","data-v-59a11935"]]),Wie={key:0,class:"sheet-root"},zie=["aria-label"],Uie=["aria-label"],qie={key:0,class:"sheet-head"},jie={class:"sheet-title"},Vie={class:"sheet-body"},Kie=Ve({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ye(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),_n(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),ge(Kr,{name:"sheet"},{default:ke(()=>[e.modelValue?(w(),N("div",Wie,[T("div",{class:"sheet-scrim",onClick:i}),T("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||A(n)("mobile.sheetLabel")},[T("button",{type:"button",class:"sheet-grab","aria-label":A(n)("mobile.closeSheet"),onClick:i},null,8,Uie),e.title?(w(),N("div",qie,[T("span",jie,R(e.title),1)])):ie("",!0),T("div",Vie,[xn(l.$slots,"default",{},void 0,!0)])],8,zie)])):ie("",!0)]),_:3}))}}),y3=ft(Kie,[["__scopeId","data-v-4441dd70"]]),Gie={class:"mlist"},Yie={key:0,class:"mempty"},Xie=["onClick"],Qie={class:"mgh-main"},Zie={class:"mgh-name"},Jie={class:"mgh-path"},ere={key:2,class:"att"},tre={key:0,class:"mempty small"},nre=["onClick"],sre={class:"m"},ore={class:"s"},ire={key:0,class:"att"},rre=["disabled","onClick"],lre=["onClick"],are=Ve({__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}=Nt(),{confirm:s}=sl(),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=Z(new Set);function f(S){return d.value.has(S)}function h(S){const I=new Set(d.value);I.has(S)?I.delete(S):I.add(S),d.value=I,y.value=null,k.value=null}const p=Z(new Set);function m(S){return p.value.has(S)}function b(S){const I=new Set(p.value);I.has(S)?I.delete(S):I.add(S),p.value=I}function _(S){if(m(S.workspace.id))return S.sessions;const I=S.sessions.slice(0,S.initialCount);if(o.activeId&&!I.some(P=>P.id===o.activeId)){const P=S.sessions.find(D=>D.id===o.activeId);if(P)return[...I,P]}return I}function g(S){if(!p.value.has(S)){const I=new Set(p.value);I.add(S),p.value=I}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=Z(null);function C(S){y.value=y.value===S?null:S,k.value=null}function L(S){y.value=null;const P=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();P&&i("rename",S.id,P)}async function $(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const k=Z(null);function M(S){k.value=k.value===S?null:S,y.value=null}function E(S){Hs(S.root),k.value=null}async function O(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,I)=>(w(),ge(y3,{"model-value":e.modelValue,"onUpdate:modelValue":I[2]||(I[2]=P=>i("update:modelValue",P))},{default:ke(()=>[T("button",{type:"button",class:"newrow",onClick:c},[oe(Je,{name:"message",size:"sm"}),je(" "+R(A(n)("sidebar.newChat")),1)]),T("button",{type:"button",class:"newrow secondary",onClick:u},[oe(Je,{name:"folder",size:"sm"}),je(" "+R(A(n)("sidebar.newWorkspace")),1)]),T("div",Gie,[e.groups.length===0?(w(),N("div",Yie,R(A(n)("workspace.noWorkspace")),1)):ie("",!0),(w(!0),N(Oe,null,ot(e.groups,P=>(w(),N("div",{key:P.workspace.id,class:"mgroup"},[T("div",{class:De(["mgh",{on:P.workspace.id===e.activeWorkspaceId}]),onClick:D=>h(P.workspace.id)},[f(P.workspace.id)?(w(),ge(Je,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),ge(Je,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),T("div",Qie,[T("span",Zie,R(P.workspace.name),1),oe(Wt,{text:P.workspace.root},{default:ke(()=>[T("span",Jie,R(P.workspace.branch||P.workspace.shortPath),1)]),_:2},1032,["text"])]),f(P.workspace.id)&&v(P.workspace.id)>0?(w(),N("span",ere,R(v(P.workspace.id)),1)):ie("",!0),oe(mn,{size:"lg",class:"mgh-more",label:A(n)("sidebar.options"),onClick:vt(D=>M(P.workspace.id),["stop"])},{default:ke(()=>[oe(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),oe(mn,{size:"lg",class:"mgh-add",label:A(n)("workspace.newInGroup"),onClick:vt(D=>a(P.workspace.id),["stop"])},{default:ke(()=>[oe(Je,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),k.value===P.workspace.id?(w(),ge(Fl,{key:3,class:"kmenu wsmenu",onClick:I[0]||(I[0]=vt(()=>{},["stop"]))},{default:ke(()=>[oe(hn,{size:"lg",onClick:D=>E(P.workspace)},{default:ke(()=>[je(R(A(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),oe(hn,{size:"lg",danger:"",onClick:D=>O(P.workspace)},{default:ke(()=>[je(R(A(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,Xie),In(T("div",null,[P.sessions.length===0?(w(),N("div",tre,R(A(n)("sidebar.noSessions")),1)):ie("",!0),(w(!0),N(Oe,null,ot(_(P),D=>(w(),N("div",{key:D.id,class:De(["srow",{cur:D.id===e.activeId}]),onClick:H=>l(D.id)},[T("div",sre,[T("div",{class:De(["t",{run:D.busy,aborted:D.status==="aborted"}])},R(D.title),3),T("div",ore,R(D.time),1)]),(e.attentionBySession[D.id]??0)>0?(w(),N("span",ire,R(e.attentionBySession[D.id]),1)):ie("",!0),oe(mn,{size:"lg",class:"kb",label:A(n)("sidebar.options"),onClick:vt(H=>C(D.id),["stop"])},{default:ke(()=>[oe(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===D.id?(w(),ge(Fl,{key:1,class:"kmenu",onClick:I[1]||(I[1]=vt(()=>{},["stop"]))},{default:ke(()=>[oe(hn,{size:"lg",onClick:H=>L(D)},{default:ke(()=>[je(R(A(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),oe(hn,{size:"lg",danger:"",onClick:H=>$(D.id)},{default:ke(()=>[je(R(A(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,nre))),128)),P.hasMore||P.loadingMore?(w(),N("button",{key:1,type:"button",class:"mshow-more",disabled:P.loadingMore,onClick:vt(D=>g(P.workspace.id),["stop"])},R(P.loadingMore?A(n)("sidebar.loadingMore"):A(n)("sidebar.showMore",{count:Math.max(0,P.workspace.sessionCount-P.sessions.length)})),9,rre)):ie("",!0),P.sessions.length>P.initialCount?(w(),N("button",{key:2,type:"button",class:"mshow-more",onClick:vt(D=>b(P.workspace.id),["stop"])},R(m(P.workspace.id)?A(n)("sidebar.showLess"):A(n)("sidebar.showAll",{count:P.sessions.length-P.initialCount})),9,lre)):ie("",!0)],512),[[Vo,!f(P.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),cre=ft(are,[["__scopeId","data-v-58db7de1"]]),ure={class:"group-title"},dre={class:"srow-main"},fre={class:"srow-label"},pre={class:"srow-sub"},hre={class:"srow-main"},mre={class:"srow-label"},gre={class:"srow-val"},vre={class:"srow-main"},yre={class:"srow-label"},kre={class:"srow-sub"},bre=["aria-checked"],_re={class:"srow-main"},wre={class:"srow-label"},Sre={class:"srow-sub"},Cre=["aria-checked"],xre={class:"srow-main"},Are={class:"srow-label"},Tre={class:"srow read-only"},Mre={class:"srow-main"},Ere={class:"srow-label"},Ire={class:"srow-sub"},$re=["aria-label"],Nre={class:"group-title"},Lre={class:"srow read-only pref"},Ore={class:"srow-main"},Pre={class:"srow-label"},Rre={class:"srow read-only pref"},Dre={class:"srow-main"},Bre={class:"srow-label"},Fre={class:"srow read-only pref"},Hre={class:"srow-main"},Wre={class:"srow-label"},zre={class:"num-field"},Ure=["value","aria-label"],qre={class:"srow-main"},jre={class:"srow-label"},Vre={class:"srow-sub"},Kre=["aria-checked"],Gre={class:"srow-main"},Yre={class:"srow-label"},Xre={class:"srow-main"},Qre={class:"srow-label"},Zre={key:2,class:"srow read-only"},Jre={class:"srow-main"},ele={class:"srow-label"},tle={class:"srow-val dim"},nle=Ve({__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:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t;function i(y){o("setColorScheme",y)}const r=["manual","auto","yolo"],l=W(()=>s.thinking??"high"),a=W(()=>s.planMode===!0),c=W(()=>s.swarmMode===!0),u=W(()=>{const y=s.status.permission;return y==="yolo"?"var(--color-danger)":y==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),d=W(()=>{const y=s.status.permission,C=n(y==="yolo"?"mobile.permYoloSub":y==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${y} · ${C}`}),f=y=>`${Math.round(y/1e3)}k`,h=W(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),p=W(()=>s.status.ctxMax>0?`${f(s.status.ctxUsed)}/${f(s.status.ctxMax)}`:n("status.statusNone"));function m(){o("setThinking",l.value==="off"?"high":"off")}function b(){const y=r.indexOf(s.status.permission),C=r[(y+1)%r.length];o("setPermission",C)}function _(){o("pickModel"),o("update:modelValue",!1)}function g(){o("login"),o("update:modelValue",!1)}function v(){o("logout"),o("update:modelValue",!1)}return(y,C)=>(w(),ge(y3,{"model-value":e.modelValue,title:A(n)("mobile.settingsTitle"),"onUpdate:modelValue":C[4]||(C[4]=L=>o("update:modelValue",L))},{default:ke(()=>[T("div",ure,R(A(n)("mobile.groupSession")),1),T("button",{type:"button",class:"srow",onClick:_},[T("span",dre,[T("span",fre,R(A(n)("status.statusModel")),1),T("span",pre,R(e.status.model),1)]),C[5]||(C[5]=T("span",{class:"chev"},"›",-1))]),T("button",{type:"button",class:"srow",onClick:m},[T("span",hre,[T("span",mre,R(A(n)("status.statusThinking")),1)]),T("span",gre,R(l.value==="off"?A(n)("status.planOff"):A(n)("status.planOn")),1),C[6]||(C[6]=T("span",{class:"chev"},"›",-1))]),T("button",{type:"button",class:"srow",onClick:C[0]||(C[0]=L=>o("togglePlan"))},[T("span",vre,[T("span",yre,R(A(n)("status.statusPlanMode")),1),T("span",kre,R(A(n)("mobile.planModeSub")),1)]),T("span",{class:De(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,bre)]),T("button",{type:"button",class:"srow",onClick:C[1]||(C[1]=L=>o("toggleSwarm"))},[T("span",_re,[T("span",wre,R(A(n)("status.statusSwarmMode")),1),T("span",Sre,R(A(n)("mobile.swarmModeSub")),1)]),T("span",{class:De(["toggle",{on:c.value}]),role:"switch","aria-checked":c.value},null,10,Cre)]),T("button",{type:"button",class:"srow",onClick:b},[T("span",xre,[T("span",Are,R(A(n)("status.statusPermission")),1),T("span",{class:"srow-sub",style:Yt({color:u.value})},R(d.value),5)]),C[7]||(C[7]=T("span",{class:"chev"},"›",-1))]),T("div",Tre,[T("span",Mre,[T("span",Ere,R(A(n)("status.statusContext")),1),T("span",Ire,R(p.value),1)]),T("span",{class:"ctx-meter","aria-label":p.value},[T("i",{style:Yt({width:h.value+"%"})},null,4)],8,$re)]),T("div",Nre,R(A(n)("mobile.groupApp")),1),T("div",Lre,[T("span",Ore,[T("span",Pre,R(A(n)("theme.colorSchemeLabel")),1)]),oe(Xo,{"model-value":e.colorScheme??"system",options:[{value:"light",label:A(n)("theme.light")},{value:"dark",label:A(n)("theme.dark")},{value:"system",label:A(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),T("div",Rre,[T("span",Dre,[T("span",Bre,R(A(n)("sidebar.language")),1)]),oe(g3)]),T("div",Fre,[T("span",Hre,[T("span",Wre,R(A(n)("settings.uiFontSize")),1)]),T("label",zre,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:C[2]||(C[2]=L=>o("setUiFontSize",Number(L.target.value)))},null,40,Ure),C[8]||(C[8]=T("span",{class:"num-unit"},"px",-1))])]),T("button",{type:"button",class:"srow",onClick:C[3]||(C[3]=L=>o("setConversationToc",!e.conversationToc))},[T("span",qre,[T("span",jre,R(A(n)("settings.conversationToc")),1),T("span",Vre,R(A(n)("settings.conversationTocHint")),1)]),T("span",{class:De(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Kre)]),e.authReady?(w(),N("button",{key:0,type:"button",class:"srow acct out",onClick:v},[T("span",Gre,[T("span",Yre,R(A(n)("sidebar.signOut")),1)])])):(w(),N("button",{key:1,type:"button",class:"srow acct in",onClick:g},[T("span",Xre,[T("span",Qre,R(A(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),N("div",Zre,[T("span",Jre,[T("span",ele,R(A(n)("settings.serverVersion")),1)]),T("span",tle,R(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),sle=ft(nle,[["__scopeId","data-v-6c7aa567"]]),k3=["blue","mono"],b3=["light","dark","system"],_3=14,ole=12,ile=20;function rle(){const e=Zn($t.accent);return e&&k3.includes(e)?e:"blue"}function lle(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function ale(){const e=Zn($t.colorScheme);return e&&b3.includes(e)?e:"system"}function cle(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 uy(e){return Number.isFinite(e)?Math.min(ile,Math.max(ole,Math.round(e))):_3}function ule(){const e=Zn($t.uiFontSize);return e===null?_3:uy(Number(e))}function dle(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${uy(e)}px`)}const dy=Z(ale()),fy=Z(rle()),py=Z(ule());Ye(dy,cle,{immediate:!0});Ye(fy,lle,{immediate:!0});Ye(py,dle,{immediate:!0});function fle(e){b3.includes(e)&&(dy.value=e,es($t.colorScheme,e))}function ple(e){k3.includes(e)&&(fy.value=e,es($t.accent,e))}function hle(e){const t=uy(e);py.value=t,es($t.uiFontSize,String(t))}const mle=600,gle=250,$h=250,vle=1e3,yle=160,Rp=Z(!1);let $l=[],Pl=null,Dp=-$h;function kle(){$l=[],Dp=-$h,Rp.value=!1,Pl!==null&&(clearTimeout(Pl),Pl=null)}function ble(){Rp.value=!0,Pl!==null&&clearTimeout(Pl),Pl=setTimeout(()=>{Pl=null,$l=[],Dp=-$h,Rp.value=!1},vle)}function _le(e){if(e<=0)return;const t=Date.now();$l.push({time:t,chars:e});const n=t-mle;if($l=$l.filter(l=>l.time>=n),t-Dp<$h)return;Dp=t;const s=$l[0]?.time??t,o=Math.max(t-s,gle);$l.reduce((l,a)=>l+a.chars,0)/o*1e3>=yle&&ble()}function w3(){return{colorScheme:dy,accent:fy,uiFontSize:py,fastMoon:Rp,setColorScheme:fle,setAccent:ple,setUiFontSize:hle,resetFastMoon:kle,recordMoonDelta:_le}}const wle={class:"ob-brand"},Sle={class:"ob-brand-text"},Cle={class:"ob-title"},xle={class:"ob-sub"},Ale={class:"ob-sec"},Tle={class:"ob-label"},Mle={class:"ob-sec"},Ele={class:"ob-label"},Ile={class:"ob-sec"},$le={class:"ob-label"},Nle=Ve({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Nt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=w3();function c(d){o.value!==d&&_A(d)}function u(){n("complete")}return(d,f)=>(w(),ge(rr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:ke(()=>[T("div",wle,[f[4]||(f[4]=T("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[T("defs",null,[T("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[T("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),T("g",{class:"ob-eyes",fill:"#000"},[T("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),T("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),T("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),T("div",Sle,[T("div",Cle,R(A(s)("onboarding.title")),1),T("div",xle,R(A(s)("onboarding.subtitle")),1)])])]),default:ke(()=>[T("section",Ale,[T("div",Tle,R(A(s)("onboarding.languageLabel")),1),oe(Xo,{"model-value":A(o),options:A(bA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),T("section",Mle,[T("div",Ele,R(A(s)("theme.colorSchemeLabel")),1),oe(Xo,{"model-value":A(i),options:[{value:"light",label:A(s)("theme.light")},{value:"dark",label:A(s)("theme.dark")},{value:"system",label:A(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>A(l)(h))},null,8,["model-value","options"])]),T("section",Ile,[T("div",$le,R(A(s)("theme.accentLabel")),1),oe(Xo,{"model-value":A(r),options:[{value:"blue",label:A(s)("theme.accentBlue")},{value:"mono",label:A(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>A(a)(h))},null,8,["model-value","options"])]),oe(Pt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:ke(()=>[je(R(A(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),Lle=ft(Nle,[["__scopeId","data-v-fbdd3eab"]]),Ole=["aria-label"],Ple={class:"gload-box"},Rle={class:"gload-text"},Dle=Ve({__name:"GlobalLoading",setup(e){const{t}=Nt();return(n,s)=>(w(),N("div",{class:"gload",role:"status","aria-label":A(t)("app.connecting")},[T("div",Ple,[s[0]||(s[0]=e0('<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)),oe(Zo,{size:"md",label:A(t)("app.connecting")},null,8,["label"]),T("div",Rle,R(A(t)("app.connecting")),1)])],8,Ole))}}),Ble=ft(Dle,[["__scopeId","data-v-8d6a5c44"]]),Fle={class:"kap-root"},Hle={class:"kap-head"},Wle={class:"kap-count"},zle={class:"kap-head-actions"},Ule={class:"kap-filters"},qle=["value"],jle={class:"kap-check"},Vle={class:"kap-check"},Kle={class:"kap-view-toggle",role:"group"},Gle={key:0,class:"kap-empty"},Yle=["onClick"],Xle={class:"kap-ts"},Qle={class:"kap-label"},Zle={key:0,class:"kap-detail"},Jle={class:"kap-detail-actions"},eae=["onClick"],tae={key:1,class:"kap-agg"},nae={class:"mono"},sae={class:"mono"},oae={class:"num"},iae={class:"num"},rae={key:0},lae={class:"mono"},aae={class:"num"},cae={class:"num"},uae={key:0},dae=Ve({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=Z("all"),o=Z(""),i=Z(""),r=Z(!1),l=Z("timeline"),a=W(()=>(cy.value,[...Yne()])),c=W(()=>{const M=new Set;for(const E of a.value)E.sessionId&&M.add(E.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=W(()=>{const M=o.value.trim().toLowerCase();return a.value.filter(E=>!(s.value!=="all"&&E.source!==s.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||M&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(M)))}),f=W(()=>{const M=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const O=E.kind==="ws:in"?"←":"→",S=`${O} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,I=M.get(S)??{key:S,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:O,count:0};I.count++,E.seq!==void 0&&(I.lastSeq=E.seq),M.set(S,I)}return[...M.values()].sort((E,O)=>O.count-E.count)}),h=W(()=>{const M=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const O=`${E.method??"?"} ${E.path??"?"}`,S=M.get(O)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(E)&&S.errors++,E.durationMs!==void 0&&(S.totalMs+=E.durationMs,S.timed++),M.set(O,S)}return[...M.entries()].map(([E,O])=>({key:E,count:O.count,errors:O.errors,avgMs:O.timed>0?Math.round(O.totalMs/O.timed):0})).sort((E,O)=>O.count-E.count)}),p=Z(null),m=Z(!0),b=Z(null),_=Z(null);Ye(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await gt();const M=b.value;M&&(M.scrollTop=M.scrollHeight)});function g(M){p.value=p.value===M?null:M}function v(M){const E=new Date(M),O=(S,I=2)=>String(S).padStart(I,"0");return`${O(E.getHours())}:${O(E.getMinutes())}:${O(E.getSeconds())}.${O(E.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function C(M){await Hs(y(M))&&(_.value=M.id,setTimeout(()=>{_.value===M.id&&(_.value=null)},1500))}function L(){v3(d.value)}function $(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,E)=>(w(),N("section",Fle,[T("header",Hle,[E[11]||(E[11]=T("strong",null,"KAP debug",-1)),T("span",Wle,R(d.value.length)+"/"+R(a.value.length),1),T("div",zle,[T("button",{type:"button",class:De({on:A(Jc)}),onClick:E[0]||(E[0]=O=>Jc.value=!A(Jc))},R(A(Jc)?"resume":"pause"),3),T("button",{type:"button",onClick:E[1]||(E[1]=O=>A(Xne)())},"clear"),T("button",{type:"button",onClick:E[2]||(E[2]=O=>L())},"export jsonl"),oe(Wt,{text:"Close window"},{default:ke(()=>[T("button",{type:"button",onClick:E[3]||(E[3]=O=>n("close"))},"✕")]),_:1})])]),T("div",Ule,[In(T("select",{"onUpdate:modelValue":E[4]||(E[4]=O=>s.value=O),"aria-label":"Source filter"},[...E[12]||(E[12]=[T("option",{value:"all"},"rest + ws + app",-1),T("option",{value:"rest"},"rest",-1),T("option",{value:"ws"},"ws",-1),T("option",{value:"client"},"app errors",-1)])],512),[[Mv,s.value]]),In(T("select",{"onUpdate:modelValue":E[5]||(E[5]=O=>i.value=O),"aria-label":"Session filter"},[E[13]||(E[13]=T("option",{value:""},"all sessions",-1)),(w(!0),N(Oe,null,ot(c.value,O=>(w(),N("option",{key:O,value:O},R(O),9,qle))),128))],512),[[Mv,i.value]]),In(T("input",{"onUpdate:modelValue":E[6]||(E[6]=O=>o.value=O),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[mo,o.value]]),T("label",jle,[In(T("input",{"onUpdate:modelValue":E[7]||(E[7]=O=>r.value=O),type:"checkbox"},null,512),[[np,r.value]]),E[14]||(E[14]=je(" errors",-1))]),T("label",Vle,[In(T("input",{"onUpdate:modelValue":E[8]||(E[8]=O=>m.value=O),type:"checkbox"},null,512),[[np,m.value]]),E[15]||(E[15]=je(" follow",-1))]),T("div",Kle,[T("button",{type:"button",class:De({on:l.value==="timeline"}),onClick:E[9]||(E[9]=O=>l.value="timeline")},"timeline",2),T("button",{type:"button",class:De({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=O=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),N("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(w(),N("div",Gle," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(w(!0),N(Oe,null,ot(d.value,O=>(w(),N("div",{key:O.id,class:"kap-row-wrap"},[T("button",{type:"button",class:De(["kap-row",{expanded:p.value===O.id}]),onClick:S=>g(O.id)},[T("span",Xle,R(v(O.ts)),1),T("span",{class:De(["kap-badge",$(O)])},R(k(O)),3),T("span",Qle,R(O.label),1)],10,Yle),p.value===O.id?(w(),N("div",Zle,[T("div",Jle,[T("button",{type:"button",onClick:S=>C(O)},R(_.value===O.id?"copied ✓":"copy json"),9,eae)]),T("pre",null,R(y(O)),1)])):ie("",!0)]))),128))],512)):(w(),N("div",tae,[E[20]||(E[20]=T("h4",null,"WS frames by session / type",-1)),T("table",null,[E[17]||(E[17]=T("thead",null,[T("tr",null,[T("th",null,"dir"),T("th",null,"type"),T("th",null,"session"),T("th",null,"count"),T("th",null,"last seq")])],-1)),T("tbody",null,[(w(!0),N(Oe,null,ot(f.value,O=>(w(),N("tr",{key:O.key},[T("td",null,R(O.dir),1),T("td",nae,R(O.eventType),1),T("td",sae,R(O.sessionId),1),T("td",oae,R(O.count),1),T("td",iae,R(O.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),N("tr",rae,[...E[16]||(E[16]=[T("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),E[21]||(E[21]=T("h4",null,"REST by endpoint",-1)),T("table",null,[E[19]||(E[19]=T("thead",null,[T("tr",null,[T("th",null,"endpoint"),T("th",null,"count"),T("th",null,"errors"),T("th",null,"avg ms")])],-1)),T("tbody",null,[(w(!0),N(Oe,null,ot(h.value,O=>(w(),N("tr",{key:O.key},[T("td",lae,R(O.key),1),T("td",aae,R(O.count),1),T("td",{class:De(["num",{err:O.errors>0}])},R(O.errors),3),T("td",cae,R(O.avgMs),1)]))),128)),h.value.length===0?(w(),N("tr",uae,[...E[18]||(E[18]=[T("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),fae=ft(dae,[["__scopeId","data-v-3cda6fe3"]]),pae=Ve({__name:"DebugPanel",setup(e){const t=Z(!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=sp(fae,{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 bn(()=>{c()}),ms(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),ge(Wt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:ke(()=>[T("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),hae=ft(pae,[["__scopeId","data-v-21346738"]]);function S3(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 x1(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 mae(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 Ci(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:x1(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:S3(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 bu(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 $S(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 hy(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:$S(e.source)};case"video":return{type:"video",source:$S(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 A1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(hy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function gae(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 vae(e){return{content:e.content.map(gae),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 yae(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function C3(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function kae(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function bae(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(kae),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function x3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(bae),createdAt:e.created_at}}function _ae(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 wae(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=_ae(s);return{answers:t,method:e.method,note:e.note}}function T1(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 NS(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 xr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function wa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Bo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Sae(e){if(!e||typeof e!="object")return null;const t=e,n=xr(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:xr(t,"goalId")??xr(t,"goal_id")??"goal",objective:xr(t,"objective")??"",completionCriterion:xr(t,"completionCriterion")??xr(t,"completion_criterion"),status:n,turnsUsed:wa(t,"turnsUsed")??wa(t,"turns_used")??0,tokensUsed:wa(t,"tokensUsed")??wa(t,"tokens_used")??0,wallClockMs:wa(t,"wallClockMs")??wa(t,"wall_clock_ms")??0,terminalReason:xr(t,"terminalReason")??xr(t,"terminal_reason"),budget:{tokenBudget:Bo(o,"tokenBudget")??Bo(o,"token_budget"),remainingTokens:Bo(o,"remainingTokens")??Bo(o,"remaining_tokens"),turnBudget:Bo(o,"turnBudget")??Bo(o,"turn_budget"),remainingTurns:Bo(o,"remainingTurns")??Bo(o,"remaining_turns"),wallClockBudgetMs:Bo(o,"wallClockBudgetMs")??Bo(o,"wall_clock_budget_ms"),remainingWallClockMs:Bo(o,"remainingWallClockMs")??Bo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Cae(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ci(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ci(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:bu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:bu(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:x1(t.payload.status),previousStatus:x1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:S3(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=Sae(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:A1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(hy),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:C3(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:x3(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:T1(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:M1(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 xae(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function LS(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 M1(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 Aae(e){return e.session_id}function Tae(e){return e.seq}const Mae="main",Eae=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 Lr(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 Iae(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 OS(){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 oo(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Tl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Fo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function $ae(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=oo(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=oo(t,"goalId")??oo(t,"goal_id")??"goal",r=oo(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:oo(t,"completionCriterion")??oo(t,"completion_criterion"),status:o,turnsUsed:Tl(t,"turnsUsed")??Tl(t,"turns_used")??0,tokensUsed:Tl(t,"tokensUsed")??Tl(t,"tokens_used")??0,wallClockMs:Tl(t,"wallClockMs")??Tl(t,"wall_clock_ms")??0,terminalReason:oo(t,"terminalReason")??oo(t,"terminal_reason"),budget:{tokenBudget:Fo(s,"tokenBudget")??Fo(s,"token_budget"),remainingTokens:Fo(s,"remainingTokens")??Fo(s,"remaining_tokens"),turnBudget:Fo(s,"turnBudget")??Fo(s,"turn_budget"),remainingTurns:Fo(s,"remainingTurns")??Fo(s,"remaining_turns"),wallClockBudgetMs:Fo(s,"wallClockBudgetMs")??Fo(s,"wall_clock_budget_ms"),remainingWallClockMs:Fo(s,"remainingWallClockMs")??Fo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Ra(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 Nae(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=oo(t,"name")??oo(t,"toolName")??"tool",s=nd(Lae(n)),o=Oae(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=oo(n,"text");if(o)return ev(o);const i=oo(n,"message");if(i)return ev(i)}const s=oo(t,"message");if(s)return ev(s)}return null}function Lae(e){return e.replace(/_\d+$/,"")}const PS=2e3;function ev(e){return e.length>PS?`${e.slice(0,PS)}…`:e}function Oae(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Pu(e,n)}function Pae(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=oo(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Ra(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=Nae(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Ra(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 hf(e){return{...e,content:e.content.map(t=>({...t}))}}function RS(e,t,n){const s={id:Lr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Rae(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 Dae(e){return Array.isArray(e)?e.map(t=>hy(t)):[]}function DS(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 Bae(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 Fae(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 BS(e,t){e.messages.find(n=>n.id===t)}function Hae(e,t,n,s,o,i){const r={id:Lr("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 tv(e,t){return e.messages.find(n=>n.id===t)}function FS(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 Wae(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=OS(),e.set(u,d)),d}function s(u){e.set(u,OS())}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??Lr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=RS(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 b=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:b}),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:hf(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 _=="string"&&_!==Mae){const g=t.has(_);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:_,reason:m?.reason}];if(Eae.has(u))return Pae(p,f,_,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)&&b.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=Dae(m?.content);if(y.length===0)break;p.currentPromptId=g;const C=Rae(p,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:hf(C)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??Lr("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,b.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=Lr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=RS(p,f,v);p.currentAssistantMsgId=y.id,b.push({type:"messageCreated",message:hf(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"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=DS(p,g,"thinking",v);if(C<0)break;p.turnThinkLen+=v.length,b.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,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"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=DS(p,g,"text",v);if(C<0)break;p.turnTextLen+=v.length,b.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,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 C=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};Bae(p,g,C,L,$);const k=tv(p,g);k&&k.content.length-1,p.toolStartTimes.set(C,Date.now()),k&&b.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=Fae(m??{});g&&v&&b.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=Lr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=m?.toolCallId,C=m?.output,L=m?.isError??!1;p.toolStartTimes.get(y)??Date.now(),p.toolStartTimes.delete(y);const $=Hae(p,f,y,C,L,v);b.push({type:"messageCreated",message:hf($)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=Iae(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){BS(p,g);const y=tv(p,g);y&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(C=>({...C})),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),b.push({type:"sessionUsageUpdated",sessionId:f,usage:FS(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=Tl(m??{},"durationMs");if(g){BS(p,g);const $=tv(p,g);$&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:$.content.map(k=>({...k})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}p.turnCount++;const C=FS(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:C});const L=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";b.push({type:"sessionStatusChanged",sessionId:f,status:L,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:Lr("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),b.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Ra(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&b.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Ra(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&b.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Ra(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:f,task:v}),b.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=Ra(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:f,task:v}),b.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{b.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):Lr("task_"),C=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:jn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:C,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;b.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??{};b.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}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=$ae(m?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const zae=new Set(["server_hello","ack","ping","resync_required","error","pong"]),HS=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"]),Uae=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"]),qae=new Set(["assistant.delta","thinking.delta"]);function jae(e,t){if(zae.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return qae.has(s)?Vae(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Uae.has(s)?{route:"protocol"}:HS.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:HS.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Vae(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 E1 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 eu 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 Jr(e){return e instanceof E1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function A3(e){return e instanceof eu||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const my="kimi-web.server-credential",Kae="token";let Vu;const I1=new Set;function Gae(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Kae);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 Yae(){try{return globalThis.sessionStorage?.getItem(my)??void 0}catch{return}}function Xae(){const e=Gae();return e?(M3(e),!0):(Vu=Yae(),Vu!==void 0)}function T3(){return Vu}function M3(e){Vu=e;try{globalThis.sessionStorage?.setItem(my,e)}catch{}}function Qae(){Vu=void 0;try{globalThis.sessionStorage?.removeItem(my)}catch{}}function Zae(e){return I1.add(e),()=>{I1.delete(e)}}function Jae(){Qae();for(const e of I1)try{e()}catch{}}const tu=3e4,E3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",WS=500,ece=40101;function zS(){try{return AbortSignal.timeout(tu)}catch{return}}function tce(e,t){let n="",s=e;for(let o=0;o<t;o++)n=E3[s%32]+n,s=Math.floor(s/32);return n}function nce(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>E3[n%32]).join("")}function US(){return`${tce(Date.now(),10)}${nce(16)}`}function sce(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 qS(e){try{const t=await e.text();return t?t.length>WS?`${t.slice(0,WS)}...`:t:void 0}catch{return}}class oce{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=lp(this.origin,t),o=US(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();TS({method:"POST",path:t,url:s,requestId:o,body:sce(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:zS()})}catch(u){throw pf({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new eu({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:tu,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw pf({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new eu({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:tu,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await qS(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(MS({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 E1({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=lp(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,b]of Object.entries(o))b!==void 0&&h.set(m,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=US(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();TS({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:zS()})}catch(h){throw pf({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new eu({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:tu,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw pf({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new eu({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:tu,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await qS(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(MS({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 E1({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=T3();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===ece)&&Jae()}}const ice="kimi-code.bearer.";class rce{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;_a("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=T3(),n=t!==void 0?[`${ice}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{_a("open")},s.onmessage=o=>{try{const i=JSON.parse(String(o.data));Zne(i),this.handleFrame(i)}catch(i){_a("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{_a("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{_a("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,_a("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=mf(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(mf(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(mf(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=mf(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=jae(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)),Qne(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function mf(e,t){return`${e}\0${t}`}function nv(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 jS(e){return e==="auto_compact"||e==="manual_compact"}class lce{http;config;constructor(t){this.config=t,this.http=new oce(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?mae(t.status):void 0,include_archive:t?.includeArchive,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Ci),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 Ci(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ci(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 Ci(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 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(A1),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:Ci(n.session),messages:n.messages.items.map(A1),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(C3),pendingQuestions:n.pending_questions.map(x3)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,vae(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 Ci(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 Ci(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ci)}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)}`,yae(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)}`,wae(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(T1)}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 T1(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(nv)}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 nv(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return nv(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 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(NS)])):void 0;return{items:o.items.map(NS),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 lp(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(bu)}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 bu(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 bu(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(xae)}async listProviders(){return(await this.http.get("/providers")).items.map(LS)}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 LS(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 sv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return sv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return sv(t)}async getConfig(){const t=await this.http.get("/config");return M1(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 M1(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 lp(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=_5(this.config.serverHttpUrl,this.config.clientId),s=Wae(),o=new rce(n,this.config.clientId,{onWireEvent:i=>{const r=Aae(i),l=Tae(i),a=Cae(i);a.type==="historyCompacted"&&!jS(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"&&!jS(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 sv(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 VS;function mt(){return VS??=new lce(g5()),VS}function ace(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function cce(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function uce(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:ace(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=cce(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,b=r[p.id]===!1?m:Math.max(p.sessionCount,m);let _=p.branch;!_&&i&&o===p.root&&(_=i),f.push({...p,sessionCount:b,branch:_})}return f}function dce(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 fce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function pce(e){return fce.has(e.type)}function hce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function mce(e,t,n=hce){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}function I3(e,t){const n=Zn(e);return n===null?t:n==="1"}const gy=Z(I3($t.notifyOnComplete,!0)),vy=Z(I3($t.notifyOnQuestion,!1)),yy=Z(typeof Notification<"u"?Notification.permission:"denied");async function $3(e,t,n){if(!n){e.value=!1,es(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}yy.value=s,s==="granted"&&(e.value=!0,es(t,"1"))}function gce(e){return $3(gy,$t.notifyOnComplete,e)}function vce(e){return $3(vy,$t.notifyOnQuestion,e)}function N3(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{yy.value=i,i==="granted"&&KS(t,n,s)});return}KS(t,n,s)}}function KS(e,t,n){if(e.isActiveAndVisible)return;const s=e.sessionTitle.trim()||"Kimi Code";try{const o=new Notification(s,{body:t,tag:n});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function yce(e,t){N3(gy.value,t,jn.global.t("settings.notifyBody"),`kimi-complete-${e}`)}function kce(e,t){const n=t.questionPreview||jn.global.t("settings.notifyQuestionBody");N3(vy.value,t,n,`kimi-question-${e}`)}function bce(){return{notifyOnComplete:gy,notifyOnQuestion:vy,notifyPermission:yy,setNotifyOnComplete:gce,setNotifyOnQuestion:vce,maybeNotifyCompletion:yce,maybeNotifyQuestion:kce}}function _ce(){return Zn($t.soundOnComplete)==="1"}const cd=Z(_ce());function wce(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let ov=null;function L3(){const e=wce();if(!e)return null;if(ov===null)try{ov=new e}catch{return null}return ov}function O3(){if(!cd.value)return;const e=L3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Nr("sound: audio context resumed",{state:e.state})},t=>{Nr("sound: audio context resume rejected",{error:String(t)})})}let GS=!1;function Sce(){if(GS||typeof window>"u")return;GS=!0;const e=()=>{O3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Sce();function Cce(e){cd.value=e,es($t.soundOnComplete,e?"1":"0"),e&&O3()}function YS(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 P3(){const e=L3();if(e===null){Nr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Nr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Nr("sound: context resumed for next time",{state:e.state})},t=>{Nr("sound: resume rejected",{error:String(t)})});return}try{YS(e,880,0,.16,.18),YS(e,1320,.1,.22,.16),Nr("sound: chime scheduled",{state:e.state})}catch(t){Nr("sound: failed to play",{error:String(t)})}}function xce(){cd.value&&P3()}function Ace(){cd.value&&P3()}function Tce(){return{soundOnComplete:cd,setSoundOnComplete:Cce,maybePlayCompletionSound:xce,maybePlayQuestionSound:Ace}}function XS(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 Mce=1e3,Ece=4096,QS=32*1024;function Ice(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await mt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:XS(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=mt(),b=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:QS});y.outputPreview!==void 0&&b.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),b.size===0)return;const _=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:_.map(g=>{const v=b.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=mt();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",C=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!C)&&!(C&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await h.getTask(f,v.id,{withOutput:!0,outputBytes:y?Ece:QS});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{C&&o.add(v.id)}}));const b=e.tasksBySession[f]??[],_=new Map(b.map(v=>[v.id,v])),g=p.map(v=>{const y=_.get(v.id),C=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:C?.preview??y?.outputPreview,outputBytes:C?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:XS(g,b)}}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())},Mce))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=Z(0);let d=null;return Ye(()=>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}),Ye(()=>{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 b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:W(()=>u.value),loadTasksForSession:i}}const R3=$t.starredModels;function $ce(){try{const e=Zn(R3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Nce(e){try{es(R3,JSON.stringify(e))}catch{}}function Lce(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Z([]),d=Z($ce()),f=Z({}),h=Z([]),p=Z(null);function m(z){if(!(z==null||z.length===0))return u.value.find(U=>U.id===z||U.model===z)}function b(){const z=e.activeSessionId?e.sessions.find(U=>U.id===e.activeSessionId):void 0;return m(z?.model??p.value??e.defaultModel)}function _(z){const U=kS(b(),z);return e.thinking=U,l(U),U}async function g(z){try{const Q=await mt().listSkills(z);f.value={...f.value,[z]:Q}}catch{}}async function v(){try{const z=mt();u.value=await z.listModels(),_(e.thinking)}catch(z){n("loadModels",z)}}async function y(){try{const z=await mt().refreshOAuthProviderModels();for(const U of z.failed)n("refreshOAuthProviderModels",new Error(U.reason),{message:U.provider})}catch{}}async function C(){try{const z=mt();h.value=await z.listProviders()}catch(z){n("loadProviders",z)}}async function L(z){const U=e.activeSessionId,Q=kS(m(z),e.thinking),X=e.thinking;if(!U){p.value=z,_(Q);return}const ue=e.sessions.find(me=>me.id===U)?.model;a(U,me=>({...me,model:z})),Q!==X&&(e.thinking=Q,l(Q));try{await mt().updateSession(U,{model:z,thinking:Q!==X?Q:void 0})}catch(me){a(U,Ae=>({...Ae,model:ue??Ae.model})),Q!==X&&(e.thinking=X,l(X)),n("setModel",me,{sessionId:U});return}await s(U)}function $(z){const U=new Set(d.value);U.has(z)?U.delete(z):U.add(z),d.value=Array.from(U),Nce(d.value)}async function k(z,U){const Q=e.activeSessionId;if(!Q)return;const X=i.value==="idle"&&!r.has(Q),ue=`msg_skill_opt_${Date.now().toString(36)}`;if(X){r.add(Q),e.sendingBySession={...e.sendingBySession,[Q]:!0};const me={id:ue,sessionId:Q,role:"user",content:[{type:"text",text:`/${z}${U?` ${U}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:z,skillArgs:U}}};c(Q,Ae=>[...Ae,me])}try{await mt().activateSkill(Q,z,U)}catch(me){X&&(r.delete(Q),e.sendingBySession={...e.sendingBySession,[Q]:!1},c(Q,Ae=>Ae.filter(be=>be.id!==ue))),n("activateSkill",me,{sessionId:Q})}}async function M(z){try{await mt().addProvider(z),await Promise.all([C(),v()])}catch(U){n("addProvider",U)}}async function E(z){try{await mt().deleteProvider(z),await Promise.all([C(),v()])}catch(U){n("deleteProvider",U)}}async function O(z){try{const U=await mt().refreshProvider(z);for(const Q of U.failed)n("refreshProvider",new Error(Q.reason),{message:Q.provider});await Promise.all([C(),v()])}catch(U){n("refreshProvider",U)}}async function S(){try{const z=await mt().refreshAllProviders();for(const U of z.failed)n("refreshAllProviders",new Error(U.reason),{message:U.provider});await Promise.all([C(),v()])}catch(z){n("refreshAllProviders",z)}}async function I(){try{return await mt().startOAuthLogin()}catch{return null}}async function P(){try{return await mt().pollOAuthLogin()}catch{return null}}async function D(){try{await mt().cancelOAuthLogin()}catch{}}function H(z){const U=_(z);o({thinking:U})}return{models:u,starredModelIds:d,providers:h,draftModel:p,skillsBySession:f,loadSkillsForSession:g,loadModels:v,refreshOAuthProviderModels:y,loadProviders:C,setModel:L,toggleStarModel:$,activateSkill:k,addProvider:M,deleteProvider:E,refreshProvider:O,refreshAllProviders:S,startOAuthLogin:I,pollOAuthLogin:P,cancelOAuthLogin:D,setThinking:H}}const D3="kimiWeb.compaction",Oce=["queued","working","suspended","completed","failed"];function B3(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Pce(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Rce(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:B3(n),summary:n.outputPreview,outputLines:n.outputLines,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=Pce();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 Dce(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Oce)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const Bce=/^read[_-]?media(?:file)?$/i,Fce=/^data:([^;]+);base64,(.*)$/s,Hce=/^<(image|video|audio)\s+path="([^"]+)">$/,Wce=/Mime type:\s*([^.\s]+)/i,zce=/Size:\s*(\d+)\s*bytes/i,Uce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function qce(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 jce(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 Vce(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 Kce(e,t){if(!Bce.test(e))return;const n=jce(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=Hce.exec(h);p&&(o=p[1],s=p[2]);const m=Wce.exec(h);m?.[1]&&(i=m[1]);const b=zce.exec(h);b?.[1]&&(r=Number(b[1]));const _=Uce.exec(h);_?.[1]&&_[2]&&(l=`${_[1]}x${_[2]}`);continue}const f=Vce(d);f&&(a=f)}if(a===null)return;const c=Fce.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=qce(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Gce(e){if(e!=null){if(typeof e=="string")return e.split(`
262
- `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
263
- `));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
264
- `)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
265
- `)):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 Yce(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 Xce(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function Qce(e,t){const n=e.split(`
266
- `),s=t.split(`
267
- `),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 Zce(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:Qce(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 Jce(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 eue(e){return e.metadata?.origin?.kind==="compaction_summary"}function tue(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function nue(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 F3(e,t,n,s=!0,o=[],i={}){const r=[];let l=1;const a=new Map;for(const p of t)a.set(p.toolCallId,p);const c=new Map;for(const p of o){if(p.kind!=="subagent")continue;const m=[p.parentToolCallId,p.id].filter(b=>typeof b=="string"&&b.length>0);for(const b of m){const _=c.get(b)??[];_.push(p),c.set(b,_)}}for(const[p,m]of c.entries())c.set(p,m.toSorted(Xce));let u=null;function d(p=!1){if(!u)return;const m=u;if(u=null,!p||!s)for(let b=0;b<m.tools.length;b++){const _=m.tools[b];if(_.status!=="running")continue;const g={..._,status:"ok"};m.tools[b]=g;const v=m.blocks.find(y=>y.kind==="tool"&&y.tool.id===g.id);v&&v.kind==="tool"&&(v.tool=g)}r.push({id:m.id,role:"assistant",no:l++,text:m.textParts.join(`
268
- `),thinking:m.thinkingParts.length>0?m.thinkingParts.join(`
269
- `):void 0,tools:m.tools.length>0?m.tools:void 0,blocks:m.blocks.length>0?m.blocks:void 0,approval:m.approval,approvalId:m.approvalId,durationMs:m.durationMs})}function f(p,m){for(const b of m)if(b.type==="text"){if(b.text){p.textParts.push(b.text);const _=p.blocks.at(-1);_&&_.kind==="text"?_.text+=`
270
- `+b.text:p.blocks.push({kind:"text",text:b.text})}}else if(b.type==="thinking"){if(b.thinking){p.thinkingParts.push(b.thinking);const _=p.blocks.at(-1);_&&_.kind==="thinking"?_.thinking+=`
271
- `+b.thinking:p.blocks.push({kind:"thinking",thinking:b.thinking})}}else if(b.type==="toolUse"){const _=c.get(b.toolCallId);if(_&&_.length>0){const y=_.filter(C=>C.swarmIndex!==void 0);if(y.length>1&&y.some(L=>{const $=B3(L);return $!=="completed"&&$!=="failed"}))continue}const g=a.get(b.toolCallId),v={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),status:"running",output:b.outputLines,planPath:b.toolName==="ExitPlanMode"?i[b.toolCallId]?.path:void 0};p.tools.push(v),p.blocks.push({kind:"tool",tool:v}),g&&(p.approval=Zce(g),p.approvalId=g.approvalId)}else if(b.type==="toolResult"){const _=p.tools.findIndex(g=>g.id===b.toolCallId);if(_!==-1){const g=p.tools[_],v={...g,status:b.isError?"error":"ok",output:Gce(b.output),media:b.isError?void 0:Kce(g.name,b.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=nue(v.output)),p.tools[_]=v;const y=p.blocks.find(C=>C.kind==="tool"&&C.tool.id===b.toolCallId);y&&y.kind==="tool"&&(y.tool=v)}}}function h(p){if(p.type==="image"||p.type==="video"){const m=p.type,b=p.source;if(b.kind==="url")return{url:b.url,kind:m};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:m};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:m}}if(p.type==="file"&&n){if(p.mediaType.startsWith("image/"))return{url:n(p.fileId),kind:"image"};if(p.mediaType.startsWith("video/"))return{url:n(p.fileId),kind:"video"}}}for(const p of e){if(p.role==="system")continue;if(eue(p)){d();const v=p.metadata?.[D3];r.push({id:p.id,role:"compaction",no:l,text:p.content.filter(y=>y.type==="text").map(y=>y.text).join(`
272
- `),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(p.role==="user"){if(d(),!Jce(p))continue;const v=p.metadata?.origin,y=v?.kind==="skill_activation"&&v?.trigger==="user-slash",C=v?.kind==="plugin_command"&&v?.trigger==="user-slash",L=[],$=[];for(const k of p.content){k.type==="text"&&(y?L.push(v.skillArgs??""):C?L.push(v.commandArgs??""):L.push(k.text));const M=h(k);M&&$.push({url:M.url,kind:M.kind,alt:k.type==="file"?k.name:void 0})}r.push({id:p.id,role:"user",no:l++,text:L.join(`
273
- `),images:$.length>0?$:void 0,skillActivation:y?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:C?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:p.createdAt});continue}if(p.role==="tool"){u&&f(u,p.content);continue}const m=p.promptId;tue(u,m)?u!==null&&u.promptId===void 0&&m!==void 0&&(u.promptId=m):(d(),u={id:p.id,promptId:m,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:p.durationMs});const _=u;if(_===null)continue;const g=JSON.stringify(p.content);_.promptId!==void 0&&_.seenSigs.has(g)||(_.seenSigs.add(g),f(_,p.content))}return d(!0),r}function sue(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=Z({}),l=W(()=>{const $=e.activeSessionId;if(!$)return null;const k=r.value[$];return k?{parentId:$,agentId:k.agentId}:null}),a=W(()=>l.value?.parentId??null),c=W(()=>l.value!==null),u=W(()=>{const $=l.value;return $?!!e.sideChatSendingByAgent[$.agentId]:!1}),d=W(()=>{const $=l.value;return $?e.sideChatSendingByAgent[$.agentId]?!0:(e.tasksBySession[$.parentId]??[]).some(k=>k.id===$.agentId&&k.status==="running"):!1}),f=W(()=>{const $=l.value;if(!$)return[];const k=e.sideChatMessagesByAgent[$.agentId]??[];return F3(k,[],M=>mt().getFileUrl(M),d.value,[])});function h($,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[$]:k(e.sideChatMessagesByAgent[$]??[])}}function p($,k){h($,M=>[...M,k])}function m($){h($,k=>{const M=[...k].reverse().findIndex(O=>O.role==="user");if(M===-1)return k;const E=k.length-1-M;return k.filter((O,S)=>S!==E)})}function b($,k){h($,M=>{const E=[...M];for(let O=E.length-1;O>=0;O-=1){const S=E[O];if(S.role==="user")return E[O]={...S,promptId:S.promptId??k},E}return M})}function _($,k,M){M&&h($,E=>{const O=E.at(-1);if(O?.role==="assistant"){const S=O.content[0],I=S?.type==="text"?S.text:"";return[...E.slice(0,-1),{...O,content:[{type:"text",text:`${I}${M}`}]}]}return[...E,{id:s(),sessionId:k,role:"assistant",content:[{type:"text",text:M}],createdAt:new Date().toISOString()}]})}function g($,k,M){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[$]:!1},!M)return;const O=(e.sideChatMessagesByAgent[$]??[]).at(-1);(O?.role==="assistant"&&O.content[0]?.type==="text"?O.content[0].text:"").trim().length>0||_($,k,M)}async function v($){const k=e.activeSessionId;if(k){if(!r.value[k]){let M;try{({agentId:M}=await mt().startBtw(k))}catch(E){n("openSideChat",E,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:e.sideChatMessagesByAgent[M]??[]},r.value={...r.value,[k]:{agentId:M}},o(),i()?.markSideChannelAgent(M)}$&&$.trim()&&await C($.trim())}}function y(){const $=e.activeSessionId;if(!$)return;const{[$]:k,...M}=r.value;r.value=M}async function C($){const k=l.value,M=$.trim();if(!k||!M)return;const E=k.parentId,O=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!0};const S={id:s(),sessionId:E,role:"user",content:[{type:"text",text:M}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(O,S);try{const I=await mt().submitPrompt(E,{content:[{type:"text",text:M}],agentId:O});b(O,I.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[E]:[...e.sideChatUserMessageIdsBySession[E]??[],I.userMessageId]}}catch(I){n("sendSideChatPrompt",I,{sessionId:E}),m(O),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!1}}}function L($){if(!r.value[$])return;const{[$]:k,...M}=r.value;r.value=M}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:_,finishSideChatAgent:g,openSideChat:v,closeSideChat:y,sendSideChatPrompt:C,clearSideChatForSession:L}}function oue(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 iue(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
274
- `)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&oue(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 $1="/sessions/";function ZS(e){const{pathname:t}=e;if(!t.startsWith($1))return;const n=t.slice($1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function rue(e){return e===void 0||e.length===0?"/":`${$1}${encodeURIComponent(e)}`}const lue=50,N1=5,aue=40402,cue=40410,uue=40902;function iv(e){return Jr(e)&&e.code===uue}const due=40904;function fue(e){return Jr(e)&&e.code===due}const Al=$s({}),gf=$s({}),rv=$s({});function pue(e,t){const{t:n}=jn.global,{confirm:s}=sl(),{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:b,updateSessionMessages:_,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:C,hasLoadedMessages:L,refreshSessionStatus:$,persistSessionProfile:k,mergedWorkspaces:M,workspacesView:E,status:O,workspaceIdForSession:S,savePermissionToStorage:I,savePlanModeToStorage:P,saveSwarmModeToStorage:D,saveGoalModeToStorage:H,draftModes:z,saveUnread:U,saveActiveWorkspaceToStorage:Q,saveHiddenWorkspacesToStorage:X,goalErrorMessage:ue,resetFastMoon:me,initialized:Ae,selectedDiffPath:be,fileDiffLines:ze,fileDiffLoading:qe}=t;async function Fe(se){if(e.messagesLoadingMoreBySession[se])return;const Se=e.messagesBySession[se];if(!Se||Se.length===0)return;const Te=Se[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!1};try{const Ue=await mt().listMessages(se,{beforeId:Te,pageSize:lue}),tt=[...Ue.items].reverse();_(se,at=>[...tt,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[se]:Ue.hasMore}}catch(Ue){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!0},l("loadOlderMessages",Ue,{sessionId:se})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!1}}}function Le(se){o.loadTasksForSession(se),te(se),$(se),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,se)||r.loadSkillsForSession(se)}async function le(se){const Se=e.activeSessionId;if(Se){be.value=se,ze.value=[],qe.value=!0;try{const Ue=await mt().getFileDiff(Se,se);if(be.value!==se)return;ze.value=iue(Ue.diff)}catch(Te){be.value===se&&(ze.value=[]),console.warn("[loadFileDiff] diff unavailable for",se,Te)}finally{be.value===se&&(qe.value=!1)}}}function F(){be.value=null,ze.value=[],qe.value=!1}async function te(se){try{const Te=await mt().getGitStatus(se);e.gitStatusBySession={...e.gitStatusBySession,[se]:Te}}catch{}}async function ee(){try{const Se=await mt().getAuth();e.authReady=Se.ready,e.defaultModel=Se.defaultModel,e.managedProviderStatus=Se.managedProvider?.status??null}catch{}}async function q(){try{const se=mt();e.config=await se.getConfig()}catch{}}async function Y(se){try{const Te=await mt().setConfig(se);return e.config=Te,e.defaultModel=Te.defaultModel??null,!0}catch(Se){return l("setConfig",Se),!1}}const de=100,ne=30,ce=720*60*1e3;async function j(){const se=mt(),Se=[];let Te;for(;;){const Ue=await se.listSessions({pageSize:de,beforeId:Te,excludeEmpty:!0});if(Se.push(...Ue.items),!Ue.hasMore||Ue.items.length===0)break;Te=Ue.items[Ue.items.length-1].id}return Se}async function G(se){const Se=mt(),Te=[],Ue=Date.now(),tt=Ht=>Ue-new Date(Ht.updatedAt).getTime();let at,Bt=!1,Zt=!0;for(;;){let Ht;try{Ht=await Se.listSessions({workspaceId:se,pageSize:N1,beforeId:at,excludeEmpty:!0})}catch(vn){if(Zt)throw vn;break}if(Bt=Ht.hasMore,Ht.items.length===0)break;const Lo=Ht.items[Ht.items.length-1],Oo=tt(Lo)>=ce;if(!Zt&&Oo){const vn=Ht.items.findIndex(Ln=>tt(Ln)>=ce),ns=vn>=0?vn+1:Ht.items.length;Te.push(...Ht.items.slice(0,ns)),Bt=Ht.hasMore||ns<Ht.items.length;break}if(Te.push(...Ht.items),Zt=!1,!Ht.hasMore||Oo)break;at=Lo.id}return{workspaceId:se,page:{items:Te,hasMore:Bt}}}async function re(){const se=e.workspaces;if(se.length===0){const Bt=await j().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Bt}const Se=await Promise.all(se.map(Bt=>G(Bt.id).catch(()=>({workspaceId:Bt.id,page:{items:[],hasMore:!1}})))),Te=[],Ue={},tt={},at={};for(const{workspaceId:Bt,page:Zt}of Se)Te.push(...Zt.items),Ue[Bt]=Zt.hasMore,tt[Bt]=Zt.items.length>0?Zt.items[Zt.items.length-1].id:void 0,at[Bt]=Math.max(Zt.items.length,N1);return e.sessionsHasMoreByWorkspace=Ue,e.sessionsCursorByWorkspace=tt,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Te.sort((Bt,Zt)=>new Date(Zt.updatedAt).getTime()-new Date(Bt.updatedAt).getTime()),Te}async function he(se){if(e.sessionsLoadingMoreByWorkspace[se]||e.sessionsHasMoreByWorkspace[se]===!1)return;const Se=e.sessionsCursorByWorkspace[se];if(Se!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!0};try{const Te=await mt().listSessions({workspaceId:se,pageSize:ne,beforeId:Se,excludeEmpty:!0}),Ue=new Set(e.sessions.map(at=>at.id)),tt=Te.items.filter(at=>!Ue.has(at.id));tt.length>0&&d([...e.sessions,...tt]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:Te.items.length>0?Te.items[Te.items.length-1].id:Se},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[se]:Te.hasMore}}catch(Te){l("loadMoreSessions",Te)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!1}}}}async function Ce(){if(e.sessionsFullyLoaded)return;const se=await j().catch(()=>null);if(se===null)return;d(se),e.sessionsFullyLoaded=!0;const Se={};for(const Te of e.workspaces)Se[Te.id]=!1;e.sessionsHasMoreByWorkspace=Se}async function Ee(){e.loading=!0;try{const se=mt();await Promise.all([se.getHealth().catch(()=>null),se.getMeta().then(Bt=>{e.serverVersion=Bt.serverVersion,e.availableOpenInApps=Bt.openInApps}).catch(()=>null),r.loadModels()]),await ee(),await q(),await ae();const Se=await re();d(Se);const Te=Se[0],Ue=e.activeWorkspaceId;!(Ue!==null&&M.value.some(Bt=>Bt.id===Ue))&&Te&&Ke(S(Te)),Pn();const at=typeof window<"u"?ZS(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(Zt=>Zt.id===at)||await nn(at))&&await fn(at,{urlMode:"replace"}),!e.activeSessionId&&Se.length>0&&await fn(Se[0].id,{urlMode:"replace"})}catch(se){l("load",se)}finally{e.loading=!1,Ae.value=!0}}async function ae(){try{const se=mt(),[Se,Te]=await Promise.all([se.listWorkspaces().catch(()=>[]),se.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=xe(Se),e.fsHome=Te.home||null,e.recentRoots=Te.recentRoots}catch{}}function xe(se){const Se=Yd();return Object.keys(Se).length===0?se:se.map(Te=>{const Ue=Se[Te.root];return Ue!==void 0?{...Te,name:Ue}:Te})}function Ke(se){e.activeWorkspaceId=se,Q(se)}function st(se){Ke(se);const Se=e.sessions.filter(Te=>S(Te)===se);if(Se.length>0){const Te=Se[0];Te&&Te.id!==e.activeSessionId&&fn(Te.id)}else b(void 0),Rt(void 0,"push")}function _t(se){const Se=Yd()[se.root],Te=Se!==void 0?{...se,name:Se}:se;e.hiddenWorkspaceRoots.includes(Te.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Te.root),X(e.hiddenWorkspaceRoots));const Ue=e.workspaces.findIndex(at=>at.id===Te.id||at.root===Te.root);if(Ue===-1){e.workspaces=[Te,...e.workspaces];return}const tt=[...e.workspaces];tt[Ue]=Te,e.workspaces=tt}function wt(se){if(se.type==="workspaceCreated"||se.type==="workspaceUpdated"){_t(se.workspace);return}const Se=e.workspaces.find(Ue=>Ue.id===se.workspaceId)?.root??se.root;if(Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],X(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Ue=>Ue.id!==se.workspaceId&&Ue.root!==Se),e.activeWorkspaceId===se.workspaceId||e.activeWorkspaceId===Se){const Ue=E.value[0]?.id??null;if(e.activeWorkspaceId=Ue,Ue)Q(Ue);else try{oc($t.activeWorkspace)}catch{}b(void 0),e.sessionLoading=!1,F(),Rt(void 0,"replace")}}function Et(){b(void 0),Rt(void 0,"push")}function Ot(se){Ke(se),Et(),F()}async function bt(se,Se,Te){const Ue=M.value.find(tt=>tt.id===se);if(Ue)try{const tt=mt();let at,Bt=Ue.root;try{const vn=await tt.addWorkspace({root:Ue.root});at=vn.id,Bt=vn.root,_t(vn)}catch{}const Zt=r.draftModel.value??void 0,Ht=await tt.createSession({workspaceId:at,cwd:Bt,model:Zt});r.draftModel.value=null;const Lo=Zt!==void 0&&(!Ht.model||Ht.model.length===0)?{...Ht,model:Zt}:Ht;h(Lo),Ke(Ht.workspaceId??at??se),await fn(Ht.id);const Oo=Ht.id;z.planMode&&(e.planModeBySession={...e.planModeBySession,[Oo]:!0},P()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Oo]:!0},D()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Oo]:!0},H()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,await Gn(Ht.id,Se,Te)}catch(tt){l("startSessionAndSendPrompt",tt)}}async function Kt(se){const Se=se.trim();if(!Se)return!1;const Te=mt();try{const Ue=await Te.addWorkspace({root:Se});return _t(Ue),Ot(Ue.id),!0}catch{return!1}}async function Fn(se){try{return await mt().browseFs(se)}catch{return{path:"",parent:null,entries:[]}}}async function $n(){try{return await mt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Rt(se,Se){if(Se==="none"||typeof window>"u"||!window.history)return;const Te=rue(se);if(window.location.pathname!==Te)try{Se==="push"?window.history.pushState(null,"",Te):window.history.replaceState(null,"",Te)}catch{}}async function nn(se){try{const Se=await mt().getSession(se);return e.sessions.some(Te=>Te.id===Se.id)||p(Se),!0}catch{return!1}}function Hn(){const se=ZS(window.location);if(se===void 0){b(void 0);return}if(se!==e.activeSessionId){if(e.sessions.some(Se=>Se.id===se)){fn(se,{urlMode:"none"});return}(async()=>{if(await nn(se)){await fn(se,{urlMode:"none"});return}const Se=e.sessions[0];Se?await fn(Se.id,{urlMode:"replace"}):(b(void 0),Rt(void 0,"replace"))})()}}let nt=!1;function Pn(){nt||typeof window>"u"||(nt=!0,window.addEventListener("popstate",Hn))}async function fn(se,Se){const Te=L(se),Ue=!Te&&u.has(se);u.delete(se);try{Rt(se,Se?.urlMode??"push"),e.sessionLoading=!Te&&!Ue,b(se),me(),e.unreadBySession[se]&&(e.unreadBySession={...e.unreadBySession,[se]:!1},U({[se]:!1})),F();const tt=e.sessions.find(at=>at.id===se);if(tt){const at=S(tt);e.activeWorkspaceId!==at&&Ke(at)}if(Te){if(await C(se)==="not-found")return}else if(await y(se)==="not-found")return;Le(se)}catch(tt){l("selectSession",tt,{sessionId:se})}finally{e.activeSessionId===se&&(e.sessionLoading=!1)}}async function Gn(se,Se,Te){c.add(se),e.sendingBySession={...e.sendingBySession,[se]:!0};const Ue=g();try{const tt=mt(),at=[];Se&&at.push({type:"text",text:Se});for(const Ln of Te??[])Ln.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:Ln.fileId}}):at.push({type:"image",source:{kind:"file",fileId:Ln.fileId}});if(at.length===0)return c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},!1;const Bt={id:Ue,sessionId:se,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(se,Ln=>[...Ln,Bt]);const Zt=e.sessions.find(Ln=>Ln.id===se),Ht=(Zt?.model&&Zt.model.length>0?Zt.model:e.defaultModel)??void 0,Lo=e.planModeBySession[se]??!1,Oo=e.swarmModeBySession[se]??!1,vn=e.goalModeBySession[se]??!1;if(vn&&Se)try{await tt.updateSession(se,{goalObjective:Se.trim()})}catch(Ln){return l("createGoal",Ln,{sessionId:se}),c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},_(se,ws=>ws.some(Ss=>Ss.id===Ue)?ws.filter(Ss=>Ss.id!==Ue):ws),!1}const ns=await tt.submitPrompt(se,{content:at,model:Ht,thinking:e.thinking,permissionMode:e.permission,planMode:Lo,swarmMode:Oo});return vn&&(e.goalModeBySession={...e.goalModeBySession,[se]:!1},H()),e.promptIdBySession={...e.promptIdBySession,[se]:ns.promptId},_(se,Ln=>{const ws=Ln.findIndex(lr=>lr.id===Ue);if(ws===-1)return Ln;const Ss=[...Ln];return Ss[ws]={...Ss[ws],promptId:Ss[ws].promptId??ns.promptId},Ss}),v()?.bindNextPromptId(se,ns.promptId),!0}catch(tt){return c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},_(se,at=>at.some(Bt=>Bt.id===Ue)?at.filter(Bt=>Bt.id!==Ue):at),l("sendPrompt",tt,{sessionId:se}),!1}}async function Rn(se,Se){const Te=e.activeSessionId;if(Te){if(a.value!=="idle"||c.has(Te)){Ge(se,Se);return}await Gn(Te,se,Se)}}async function gs(se,Se){const Te=e.activeSessionId;if(!Te)return;const Ue=e.queuedBySession[Te]??[],tt=[],at=[];for(const vn of Ue){const ns=vn.text.trim();ns&&tt.push(ns),vn.attachments?.length&&at.push(...vn.attachments)}const Bt=se.trim();if(Bt&&tt.push(Bt),Se?.length&&at.push(...Se),tt.length===0&&at.length===0)return;Ue.length>0&&(e.queuedBySession={...e.queuedBySession,[Te]:[]});const Zt=tt.join(`
275
-
276
- `);if(a.value==="idle"&&!c.has(Te)){await Gn(Te,Zt,at);return}const Ht=[];Zt&&Ht.push({type:"text",text:Zt});for(const vn of at)vn.kind==="video"?Ht.push({type:"video",source:{kind:"file",fileId:vn.fileId}}):Ht.push({type:"image",source:{kind:"file",fileId:vn.fileId}});const Lo=g(),Oo={id:Lo,sessionId:Te,role:"user",content:Ht,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(Te,vn=>[...vn,Oo]);try{const vn=mt(),ns=e.sessions.find(Ss=>Ss.id===Te),Ln=(ns?.model&&ns.model.length>0?ns.model:e.defaultModel)??void 0,ws=await vn.submitPrompt(Te,{content:Ht,model:Ln,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Te]??!1,swarmMode:e.swarmModeBySession[Te]??!1});if(_(Te,Ss=>{const lr=Ss.findIndex(Js=>Js.id===Lo);if(lr===-1)return Ss;const Cs=[...Ss];return Cs[lr]={...Cs[lr],promptId:Cs[lr].promptId??ws.promptId},Cs}),ws.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Te]:ws.promptId},v()?.bindNextPromptId(Te,ws.promptId);return}try{await vn.steerPrompts(Te,[ws.promptId])}catch{}}catch(vn){_(Te,ns=>ns.filter(Ln=>Ln.id!==Lo)),l("steer",vn,{sessionId:Te})}}async function Xe(se,Se){try{const Ue=await mt().uploadFile({file:se,name:Se});return{fileId:Ue.id,name:Ue.name,mediaType:Ue.mediaType}}catch(Te){return l("uploadImage",Te),null}}function Ge(se,Se){const Te=e.activeSessionId;if(!Te)return;const Ue=e.queuedBySession[Te]??[];e.queuedBySession={...e.queuedBySession,[Te]:[...Ue,{text:se,attachments:Se}]}}async function At(){const se=e.activeSessionId;if(!se)return;const Se=e.sessions.find(tt=>tt.id===se);let Te=e.promptIdBySession[se];if(Te===void 0){const tt=Se?.currentPromptId;tt?.startsWith("prompt_")&&(Te=tt)}const Ue=mt();if(Te!==void 0)try{if((await Ue.abortPrompt(se,Te)).aborted)return;const at={...e.promptIdBySession};delete at[se],e.promptIdBySession=at}catch(tt){if(Jr(tt)&&tt.code===aue){const at={...e.promptIdBySession};delete at[se],e.promptIdBySession=at}else{l("abortCurrentPrompt",tt,{sessionId:se});return}}try{await Ue.abortSession(se)}catch(tt){l("abortCurrentPrompt",tt,{sessionId:se})}}function jt(se,Se){const Te=e.approvalsBySession[se]??[];e.approvalsBySession={...e.approvalsBySession,[se]:Te.filter(Ue=>Ue.approvalId!==Se)}}function Xt(se,Se){const Te=e.questionsBySession[se]??[];e.questionsBySession={...e.questionsBySession,[se]:Te.filter(Ue=>Ue.questionId!==Se)}}async function Nn(se,Se){const Te=e.activeSessionId;if(Te&&!gf[se]){gf[se]=!0;try{const Ue=mt(),tt={decision:Se.decision,scope:Se.scope,feedback:Se.feedback,selectedLabel:Se.selectedLabel};await Ue.respondApproval(Te,se,tt),jt(Te,se)}catch(Ue){iv(Ue)?jt(Te,se):l("respondApproval",Ue,{sessionId:Te})}finally{delete gf[se]}}}async function An(se,Se){const Te=e.activeSessionId;if(Te&&!Al[se]){Al[se]="answer";try{await mt().respondQuestion(Te,se,Se),Xt(Te,se)}catch(Ue){iv(Ue)?Xt(Te,se):l("respondQuestion",Ue,{sessionId:Te})}finally{delete Al[se]}}}async function ts(se){const Se=e.activeSessionId;if(Se&&!Al[se]){Al[se]="dismiss";try{await mt().dismissQuestion(Se,se),Xt(Se,se)}catch(Te){iv(Te)?Xt(Se,se):l("dismissQuestion",Te,{sessionId:Se})}finally{delete Al[se]}}}async function It(se){const Se=e.activeSessionId;if(Se&&!rv[se]){rv[se]=!0;try{await mt().cancelTask(Se,se);const Ue=e.tasksBySession[Se]??[];e.tasksBySession={...e.tasksBySession,[Se]:Ue.map(tt=>tt.id===se?{...tt,status:"cancelled"}:tt)}}catch(Te){fue(Te)||l("cancelTask",Te,{sessionId:Se})}finally{delete rv[se]}}}function Tn(se){const Se=e.activeSessionId;Se?(e.planModeBySession={...e.planModeBySession,[Se]:se},P(),k({planMode:se})):z.planMode=se}function Qt(){const se=e.activeSessionId,Se=se?e.planModeBySession[se]??!1:z.planMode;Tn(!Se)}function _s(se){const Se=e.activeSessionId;Se?(e.swarmModeBySession={...e.swarmModeBySession,[Se]:se},D(),k({swarmMode:se})):z.swarmMode=se}async function ei(){const se=e.activeSessionId,Te=!(se?e.swarmModeBySession[se]??!1:z.swarmMode);Te&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||_s(Te)}function No(se){const Se=e.activeSessionId;Se?(e.goalModeBySession={...e.goalModeBySession,[Se]:se},H()):z.goalMode=se}function et(){const se=e.activeSessionId,Se=se?e.goalModeBySession[se]??!1:z.goalMode;No(!Se)}async function it(se){const Se=se.trim();if(!Se||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:Se}),variant:"primary"}))return;const Te=e.activeSessionId;if(Te){try{await mt().updateSession(Te,{goalObjective:Se})}catch(Ue){l("createGoal",Ue,{sessionId:Te,message:ue(Ue)});return}await Rn(Se)}}function lt(se){const Se=e.activeSessionId;Se&&Promise.resolve(mt().updateSession(Se,{goalControl:se})).catch(Te=>{l("controlGoal",Te,{sessionId:Se,message:ue(Te)})})}function pt(se){e.permission=se,I(se),k({permissionMode:se})}function ti(se){const Se=[...e.warnings];Se.splice(se,1),e.warnings=Se}async function hi(se,Se){try{await mt().updateSession(se,{title:Se}),f(se,Ue=>({...Ue,title:Se}))}catch(Te){l("renameSession",Te,{sessionId:se})}}async function Ie(se,Se){const Te=e.workspaces.find(tt=>tt.id===se)?.root,Ue=()=>{e.workspaces=e.workspaces.map(tt=>tt.id===se?{...tt,name:Se}:tt)};try{if(await mt().updateWorkspace(se,{name:Se}),Te!==void 0){const tt=Yd();Te in tt&&(delete tt[Te],p_(tt))}Ue()}catch(tt){if(Te!==void 0&&Jr(tt)&&tt.code===cue){p_({...Yd(),[Te]:Se}),Ue();return}l("renameWorkspace",tt)}}async function _e(se){const Se=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,Ue=e.activeWorkspaceId===se||e.activeWorkspaceId===Se,tt=!!(Te&&(Te.cwd===Se||Te.workspaceId===se||S(Te)===se));Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],X(e.hiddenWorkspaceRoots));try{await mt().deleteWorkspace(se)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==se&&at.root!==Se),Ue||tt){const at=E.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Q(at);else try{oc($t.activeWorkspace)}catch{}}(Ue||tt)&&(b(void 0),e.sessionLoading=!1,F(),Rt(void 0,"replace"))}async function Re(se){try{await mt().archiveSession(se),m(se),i.clearSideChatForSession(se);const{[se]:Te,...Ue}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Ue,e.activeSessionId===se){const tt=e.sessions[0];tt?await fn(tt.id,{urlMode:"replace"}):(b(void 0),Rt(void 0,"replace"))}}catch(Se){l("archiveSession",Se,{sessionId:se})}}async function ln(){try{await mt().logout(),await ee(),await Ee()}catch(se){l("logout",se)}}function zt(se){const Se=e.activeSessionId;Se&&mt().compactSession(Se,se).catch(Te=>{l("compact",Te,{sessionId:Se})})}async function us(se){const Se=se??e.activeSessionId;if(Se)try{const Te=await mt().forkSession(Se);h(Te),await fn(Te.id)}catch(Te){l("fork",Te,{sessionId:Se})}}async function Wn(se=1){const Se=e.activeSessionId;if(!Se)return null;const Te=(()=>{const Ue=e.messagesBySession[Se]??[];for(let tt=Ue.length-1;tt>=0;tt--){const at=Ue[tt];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Bt=>Bt.type==="text").map(Bt=>Bt.text).join(`
277
- `)}return null})();try{return await mt().undoSession(Se,se),await y(Se),Te}catch(Ue){return l("undo",Ue,{sessionId:Se}),null}}function go(se){const Se=e.activeSessionId;if(!Se)return;const Te=e.queuedBySession[Se]??[];if(se<0||se>=Te.length)return;const Ue=[...Te];Ue.splice(se,1),e.queuedBySession={...e.queuedBySession,[Se]:Ue}}function ni(se,Se){const Te=e.activeSessionId;if(!Te)return;const Ue=e.queuedBySession[Te]??[];if(se===Se||se<0||se>=Ue.length||Se<0||Se>=Ue.length)return;const tt=[...Ue],[at]=tt.splice(se,1);at!==void 0&&(tt.splice(Se,0,at),e.queuedBySession={...e.queuedBySession,[Te]:tt})}async function vs(se){const Se=e.activeSessionId;if(!Se)return[];try{return(await mt().listDirectory(Se,{path:se,includeGitStatus:!0})).items}catch{return[]}}async function rl(se){const Se=e.activeSessionId;if(!Se)return null;try{const Ue=await mt().readFile(Se,{path:se});return{path:Ue.path,content:Ue.content,encoding:Ue.encoding,mime:Ue.mime,languageId:Ue.languageId,isBinary:Ue.isBinary,size:Ue.size,lineCount:Ue.lineCount}}catch{return null}}const ll=10485760;function gc(se){const Se=e.activeSessionId;return Se?mt().getFileDownloadUrl(Se,se):null}async function dt(se,Se){const Te=e.activeSessionId;if(!Te)return!1;try{return await mt().openFile(Te,{path:se,line:Se}),!0}catch(Ue){return l("openFile",Ue,{sessionId:Te}),!1}}async function pe(se){const Se=e.activeSessionId;if(!Se)return;const Te=O.value.cwd||".";try{await mt().openInApp(Se,se,Te)}catch(Ue){l("openInApp",Ue,{sessionId:Se})}}async function Ne(se){const Se=e.activeSessionId;if(!Se)return!1;try{return await mt().revealFile(Se,{path:se}),!0}catch(Te){return l("revealFile",Te,{sessionId:Se}),!1}}async function wn(se){if(/^(https?:|data:|blob:)/i.test(se))return se;const Se=e.activeSessionId;if(!Se)return se;let Te=se;if(Te.startsWith("/")){const Ue=e.sessions.find(tt=>tt.id===Se)?.cwd;if(Ue&&(Te===Ue||Te.startsWith(Ue.endsWith("/")?Ue:`${Ue}/`))){if(Te=Te.slice(Ue.length).replace(/^\//,""),!Te)return se}else return se}try{const tt=await mt().readFile(Se,{path:Te,length:ll});return!tt.isBinary||tt.encoding!=="base64"||tt.truncated?se:`data:${tt.mime};base64,${tt.content}`}catch{return se}}async function dd(se){const Se=e.activeSessionId;if(!Se)return[];try{return(await mt().searchFiles(Se,{query:se,limit:20})).items.map(tt=>({path:tt.path,name:tt.name}))}catch{return[]}}return{loadFileDiff:le,clearFileDiff:F,loadGitStatus:te,checkAuth:ee,loadConfig:q,updateConfig:Y,listAllSessionsGlobal:j,load:Ee,loadWorkspaces:ae,loadMoreSessions:he,loadAllSessions:Ce,selectWorkspace:Ke,openWorkspace:st,upsertWorkspacePreserveOrder:_t,applyWorkspaceEvent:wt,clearActiveSession:Et,openWorkspaceDraft:Ot,startSessionAndSendPrompt:bt,addWorkspaceByPath:Kt,browseFs:Fn,getFsHome:$n,writeSessionUrl:Rt,fetchSessionIntoList:nn,onSessionRoutePopState:Hn,bindSessionRoute:Pn,selectSession:fn,submitPromptInternal:Gn,sendPrompt:Rn,steerPrompt:gs,uploadImage:Xe,enqueue:Ge,unqueue:go,reorderQueue:ni,abortCurrentPrompt:At,respondApproval:Nn,respondQuestion:An,dismissQuestion:ts,pendingQuestionActions:Al,pendingApprovalActions:gf,cancelTask:It,setPlanMode:Tn,togglePlanMode:Qt,setSwarmMode:_s,toggleSwarmMode:ei,setGoalMode:No,toggleGoalMode:et,createGoal:it,controlGoal:lt,setPermission:pt,dismissWarning:ti,renameSession:hi,renameWorkspace:Ie,deleteWorkspace:_e,archiveSession:Re,logout:ln,compact:zt,forkSession:us,undo:Wn,listDir:vs,readFileContent:rl,getFileDownloadUrl:gc,openWorkspaceFile:dt,openInApp:pe,revealWorkspaceFile:Ne,resolveImageUrl:wn,searchFiles:dd,loadOlderMessages:Fe,refreshSessionSidecars:Le}}const hue="kimiWeb.optimisticUserMessage";function mue(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function gue(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 vue(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 lv(e){return e.role==="user"&&e.metadata?.[hue]===!0}function yue(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function JS(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function kue(e,t){const n=JS(e),s=JS(t);return n.text===s.text&&n.media===s.media}function bue(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(lv(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(lv(o)&&yue(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(lv(o)&&kue(o,t))return s}return-1}function _ue(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 wue(e,t,n){const s=gue(e);switch(vue(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"},[D3]: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"){const a=bue(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]=_ue(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];l[r]={...t.task,outputLines:i[r].outputLines,text:i[r].text},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?jn.global.t("warnings.errorLabel"):jn.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 Sue(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Cue(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"||Xl(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:Sue(a.status)}]:[]})}}return[]}const Ai=w3(),Nl=bce(),Bp=Tce(),H3=$t.permission,W3=$t.activeWorkspace,z3=$t.thinking,U3=$t.planMode,q3=$t.swarmMode,j3=$t.goalMode,eC=40401,V3=$t.onboarded,xue=["off","low","medium","high","xhigh","max"];oc($t.codeFont);oc($t.theme);function Aue(){try{const e=Zn(H3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Tue(e){try{es(H3,e)}catch{}}function Mue(){try{const e=Zn(z3);if(e&&xue.includes(e))return e}catch{}return"high"}function Eue(e){try{es(z3,e)}catch{}}function av(e){const t=Zn(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 ky(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);es(e,JSON.stringify(n))}catch{}}function K3(){ky(U3,ye.planModeBySession)}function G3(){ky(q3,ye.swarmModeBySession)}function Y3(){ky(j3,ye.goalModeBySession)}function Iue(){try{return Zn(W3)}catch{return null}}const X3=$t.hiddenWorkspaces;function $ue(){try{const e=Zn(X3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Nue(e){try{es(X3,JSON.stringify(e))}catch{}}function Lue(e){try{es(W3,e)}catch{}}function Oue(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 ye=$s({...mue(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:Aue(),thinking:Mue(),planModeBySession:av(U3),swarmModeBySession:av(q3),goalModeBySession:av(j3),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:f0(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Iue(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:$ue(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Nh=$s({planMode:!1,swarmMode:!1,goalMode:!1});function Q3(e){ye.sessions=e}function Lh(e,t){ye.sessions=ye.sessions.map(n=>n.id===e?t(n):n)}function Pue(e){ye.sessions=[e,...ye.sessions.filter(t=>t.id!==e.id)]}function Rue(e){ye.sessions=[...ye.sessions,e]}function Due(e){ye.sessions=ye.sessions.filter(t=>t.id!==e)}function Z3(){const e=ye.activeSessionId;e&&ye.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!1},p0({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(ye.unreadBySession=f0(),Z3())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&Z3()});function by(e){ye.activeSessionId=e}function Bue(e){ye.messagesBySession=e}function Fue(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t}}function J3(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t(ye.messagesBySession[e]??[])}}function Hue(e){const{[e]:t,...n}=ye.messagesBySession;ye.messagesBySession=n}function e4(e){ui?.unsubscribe(e),ade(e),Ku.flush(),Due(e),Hue(e),delete ye.approvalsBySession[e],delete ye.questionsBySession[e],delete ye.tasksBySession[e],delete ye.goalBySession[e],delete ye.gitStatusBySession[e],delete ye.lastSeqBySession[e],delete ye.compactionBySession[e],delete ye.messagesLoadingMoreBySession[e],delete ye.messagesHasMoreBySession[e],delete ye.messagesLoadMoreErrorBySession[e],delete Rh[e],u4.delete(e),Ph.delete(e),delete ye.queuedBySession[e],delete ye.promptIdBySession[e],delete ye.sendingBySession[e],delete ye.planModeBySession[e],delete ye.swarmModeBySession[e],delete ye.goalModeBySession[e],K3(),G3(),Y3()}const t4=Z(null),n4=Z([]),s4=Z(!1),o4=Z(!1);async function Oh(e){let t;try{t=await mt().getSessionStatus(e)}catch{return}Lh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),ye.swarmModeBySession={...ye.swarmModeBySession,[e]:t.swarmMode},ye.planModeBySession={...ye.planModeBySession,[e]:t.planMode}}function i4(e){const t=ye.activeSessionId;t&&Promise.resolve(mt().updateSession(t,e)).then(()=>Oh(t)).catch(()=>{})}const r4=$t.conversationToc;function Wue(){try{const e=Zn(r4);return e===null?!0:e==="true"}catch{return!0}}function zue(e){try{es(r4,e?"true":"false")}catch{}}const l4=Z(Wue());function Uue(e){l4.value=e,zue(e)}function que(e){try{return Zn(e)??""}catch{return""}}const a4=Z(que(V3)==="1");function jue(e){a4.value=e;try{es(V3,e?"1":"0")}catch{}}let ui=null,tC=0;function c4(){return tC+=1,`msg_opt_${Date.now().toString(36)}_${tC}`}const Ph=new Set;function Vue(e,t,n){const s={sessions:ye.sessions,activeSessionId:ye.activeSessionId,messagesBySession:ye.messagesBySession,approvalsBySession:ye.approvalsBySession,planReviewByToolCallId:ye.planReviewByToolCallId,questionsBySession:ye.questionsBySession,tasksBySession:ye.tasksBySession,goalBySession:ye.goalBySession,lastSeqBySession:ye.lastSeqBySession,compactionBySession:ye.compactionBySession,config:ye.config,warnings:ye.warnings},o=wue(s,e,{sessionId:t,seq:n});Q3(o.sessions),by(o.activeSessionId),Bue(o.messagesBySession),ye.approvalsBySession=o.approvalsBySession,ye.planReviewByToolCallId=o.planReviewByToolCallId,ye.questionsBySession=o.questionsBySession,ye.tasksBySession=o.tasksBySession,ye.goalBySession=o.goalBySession,ye.lastSeqBySession=o.lastSeqBySession,ye.compactionBySession=o.compactionBySession,ye.config=o.config??null,ye.warnings=o.warnings,e.type==="configChanged"&&(ye.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Un.loadModels(),Un.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(ye.swarmModeBySession={...ye.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(ye.planModeBySession={...ye.planModeBySession,[e.sessionId]:e.planMode}))}function Kue(e,t){Vue(e,t.sessionId,t.seq);const n=Rs.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&Rs.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?Rs.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?Rs.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&Rs.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;ye.promptIdBySession[s]!==e.message.promptId&&(ye.promptIdBySession={...ye.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===ye.activeSessionId&&Ai.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&cfe(e.sessionId,e.status),e.type==="questionRequested"&&ufe(e.sessionId,e.question)}const Ku=mce(({appEvent:e,meta:t})=>Kue(e,t),({appEvent:e})=>pce(e));function _y(){if(ui!==null||typeof WebSocket>"u")return;ye.connection="connecting",ui=mt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){yt.applyWorkspaceEvent(t);return}Ku({appEvent:t,meta:n})},onResync(t,n,s){Ku.flush(),s!==void 0&&(Rh[t]=s),ide.request(t)},onError(t,n,s){wy({severity:"error",title:jn.global.t("warnings.wsTitle"),message:n,details:[zn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){ye.connected=t,ye.connection=t?"connected":"disconnected"}})}const Rh={},u4=new Set;function Gue(e){return Jr(e)&&e.code===eC?!0:typeof e=="object"&&e!==null&&e.code===eC}function zn(e,t){if(!(t==null||t===""))return{label:jn.global.t(`warnings.details.${e}`),value:d4(t)}}function d4(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 Yue(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Xue(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Que(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Zue(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function nC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function Jue(e,t,n){const s=A3(t),o=Jr(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[zn("operation",e),zn("sessionId",n??ye.activeSessionId),zn("connection",ye.connection),zn("timestamp",Zue(i??Date.now()))];return s?l.push(zn("duration",nC(r)),zn("request",`${t.method} ${t.path}`),zn("endpoint",t.url),zn("requestId",t.requestId),zn("phase",t.phase),zn("timeout",`${t.timeoutMs}ms`),zn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),zn("contentType",t.contentType),zn("responsePreview",t.bodyPreview),zn("cause",t.cause)):o?l.push(zn("duration",nC(r)),zn("code",t.code),zn("requestId",t.requestId),zn("message",t.message),zn("details",t.details)):l.push(zn("errorName",Yue(t)),zn("message",Xue(t)??d4(t)),zn("stack",Que(t))),l.filter(a=>a!==void 0)}function ede(e,t,n={}){const s=A3(t),o=Jr(t),i=n.title??(s?jn.global.t("warnings.daemonNetworkTitle"):o?jn.global.t("warnings.daemonApiTitle"):jn.global.t("warnings.operationFailedTitle")),r=n.message??(s?jn.global.t("warnings.daemonNetworkMessage"):o?t.message:jn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Jue(e,t,n.sessionId)}}function wy(e){ye.warnings=[...ye.warnings,e]}function Dh(e,t,n){wy(ede(e,t,n))}const tde={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function nde(e){if(!Jr(e))return;const t=tde[e.code];return t?jn.global.t(t):void 0}async function sde(e){if(e4(e),ye.activeSessionId!==e)return;const t=ye.sessions[0];t?await yt.selectSession(t.id,{urlMode:"replace"}):(by(void 0),ye.sessionLoading=!1,yt.writeSessionUrl(void 0,"replace"))}const sC=new Set;async function ode(e){if(!sC.has(e)){sC.add(e);try{const t=await mt().getSessionWarnings(e),n=jn.global.t("warnings.noteLabel");for(const s of t)wy(`${n}: ${s.message}`)}catch{}}}async function Sy(e){try{const n=await mt().getSessionSnapshot(e);Ku.flush(),Lh(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),Fue(e,n.messages),ye.messagesHasMoreBySession={...ye.messagesHasMoreBySession,[e]:n.hasMoreMessages},ye.approvalsBySession={...ye.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&&(ye.planReviewByToolCallId={...ye.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return ye.questionsBySession={...ye.questionsBySession,[e]:n.pendingQuestions},ye.lastSeqBySession={...ye.lastSeqBySession,[e]:n.asOfSeq},Rh[e]=n.epoch,_y(),ui&&(ui.seedSnapshot(e,n),ui.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),f4(e)),Bh.delete(e),ode(e),"ok"}catch(t){return Gue(t)?(await sde(e),"not-found"):(Dh("getSessionSnapshot",t,{title:jn.global.t("warnings.sessionSnapshotTitle"),message:jn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const ide=dce(Sy);function rde(e){return Object.prototype.hasOwnProperty.call(ye.messagesBySession,e)}const lde=4,Ui=[],Bh=new Set;function f4(e){const t=Ui.indexOf(e);for(t!==-1&&Ui.splice(t,1),Ui.unshift(e);Ui.length>lde;){let n=-1;for(let o=Ui.length-1;o>=0;o--)if(Ui[o]!==ye.activeSessionId){n=o;break}if(n===-1)break;const[s]=Ui.splice(n,1);if(s===void 0)break;ui?.unsubscribe(s),Bh.add(s)}}function ade(e){const t=Ui.indexOf(e);t!==-1&&Ui.splice(t,1),Bh.delete(e)}function cde(e){if(_y(),ui){Ku.flush();const t=ye.lastSeqBySession[e]??0,n=Rh[e];ui.subscribe(e,{seq:t,epoch:n}),f4(e)}}async function ude(e){return Bh.has(e)?Sy(e):(cde(e),"ok")}function Fh(e){const t=ye.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Rs.sideChatTargetBySession.value[e]?.agentId,o=(ye.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&ye.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Cy(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return jn.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 dde=3e4,Gu=Z(0);let cv=null;function fde(){cv===null&&(cv=setInterval(()=>{Gu.value=(Gu.value+1)%Number.MAX_SAFE_INTEGER},dde),cv.unref?.())}function pde(e,t){const n=e.split(`
278
- `),s=t.split(`
279
- `),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 hde(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:pde(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 mde(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 gde(e){const t=ye.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 vde(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=jn.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=jn.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??gde(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 yde=W(()=>{const e=ye.sessions.find(n=>n.id===ye.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:ye.workspaceName,branch:t}}),kde=W(()=>(Gu.value,ye.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Cy(e.updatedAt,e.status),status:e.status,busy:Fh(e.id)})))),bde=W(()=>ye.activeSessionId??""),_de=W(()=>{const e=ye.activeSessionId;return e?Un.skillsBySession.value[e]??[]:[]}),wde=W(()=>{const e=ye.activeSessionId;return e?ye.sendingBySession[e]??!1:!1}),Rs=sue(ye,{pushOperationFailure:Dh,nextOptimisticMsgId:c4,connectEventsIfNeeded:_y,getEventConn:()=>ui}),ud=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=Rs.sideChatTargetBySession.value[e]?.agentId;return(ye.tasksBySession[e]??[]).filter(n=>n.id!==t)}),p4=Ice(ye,ud),Sde=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=new Set(ye.sideChatUserMessageIdsBySession[e]??[]),n=(ye.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=ye.approvalsBySession[e]??[];return F3(n,s,o=>mt().getFileUrl(o),Hh.value!=="idle",ud.value,ye.planReviewByToolCallId)}),Cde=W(()=>(p4.taskClock.value,ud.value.map(vde))),h4=W(()=>Rce(ud.value)),Ma=W(()=>{const e=ye.activeSessionId;return e?ye.goalBySession[e]??null:null}),xde=W(()=>{const e=ye.activeSessionId;return e?Cue(ye.messagesBySession[e]??[]):[]}),Ade=W(()=>{const e=ye.activeSessionId;return e?ye.compactionBySession[e]??null:null}),Tde=W(()=>ye.connection),Mde=W(()=>ye.loading),Ede=W(()=>ye.sessionLoading),Ide=W(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadingMoreBySession[e]??!1:!1}),$de=W(()=>{const e=ye.activeSessionId;return e?ye.messagesHasMoreBySession[e]??!1:!1}),Nde=W(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadMoreErrorBySession[e]??!1:!1}),Lde=W(()=>ye.serverVersion),Ode=W(()=>ye.permission),Pde=W(()=>ye.thinking),m4=W(()=>{const e=ye.activeSessionId;return e?ye.planModeBySession[e]??!1:Nh.planMode}),Rde=W(()=>{const e=ye.activeSessionId;return e?ye.swarmModeBySession[e]??!1:Nh.swarmMode}),Dde=W(()=>{const e=ye.activeSessionId;return e?ye.goalModeBySession[e]??!1:Nh.goalMode}),Bde=W(()=>{const e=Dce(h4.value);return{plan:m4.value,goal:Ma.value&&Ma.value.status!=="complete"?{status:Ma.value.status,turnsUsed:Ma.value.turnsUsed,elapsedMs:Ma.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Fde=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=mt();return(ye.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)}))}))}),Hde=W(()=>ye.warnings),Wde=W(()=>{const e=ye.activeSessionId;return e?(ye.questionsBySession[e]??[]).map(mde):[]}),zde=W(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:hde(t),agentName:t.agentName})):[]}),Hh=W(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).length>0?"awaiting-approval":(ye.questionsBySession[e]??[]).length>0?"awaiting-question":Fh(e)?"running":"idle":"idle"}),Un=Lce(ye,{pushOperationFailure:Dh,refreshSessionStatus:Oh,persistSessionProfile:i4,activity:Hh,inFlightPromptSessions:Ph,saveThinkingToStorage:Eue,updateSession:Lh,updateSessionMessages:J3}),Fp=W(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Ude=W(()=>{const e=ye.activeSessionId;return e?ye.gitStatusBySession[e]?.pullRequest??null:null}),qde=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=ye.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),jde=W(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),g4=W(()=>{const e=ye.sessions.find(r=>r.id===ye.activeSessionId),t=Fp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Un.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??ye.defaultModel)??"—",o=Un.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:ye.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Fp.value!==null}}),Vde=W(()=>n4.value),Kde=W(()=>ye.sessions.find(t=>t.id===ye.activeSessionId)?.usage.totalCostUsd??0),Gde=W(()=>ye.authReady),Yde=W(()=>ye.defaultModel),Xde=W(()=>ye.managedProviderStatus),Qde=W(()=>ye.config),Zde=W(()=>{const e=ye.activeSessionId;if(!e)return{};const t=ye.gitStatusBySession[e];return t?{...t.entries}:{}});function lc(e){return ye.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const xy=W(()=>uce({workspaces:ye.workspaces,sessions:ye.sessions,hiddenWorkspaceRoots:ye.hiddenWorkspaceRoots,activeRoot:ye.sessions.find(e=>e.id===ye.activeSessionId)?.cwd,activeBranch:Fp.value?.branch??null,sessionsHasMoreByWorkspace:ye.sessionsHasMoreByWorkspace})),Hp=Z(f5()),ac=Z(p5()==="manual"?"manual":"recent");Ye(()=>[xy.value.map(e=>e.id).join("\0"),ye.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=x5(n,Hp.value);s!==null&&(Hp.value=s,fA(s))});const Kl=W(()=>{const e=xy.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Oue(t.root,ye.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(ac.value==="recent"){const t=new Map;for(const n of ye.sessions){if(n.parentSessionId)continue;const s=lc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return M5(e,t)}return A5(e,Hp.value)}),v4=W(()=>{const e=ye.activeWorkspaceId,t=Kl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),Jde=W(()=>{const e=v4.value;return e?Kl.value.find(t=>t.id===e)??null:null}),efe=W(()=>{Gu.value;const e=new Set(Kl.value.map(n=>n.id)),t=new Map(Kl.value.map(n=>[n.id,n.name]));return ye.sessions.filter(n=>!n.parentSessionId&&e.has(lc(n))).map(n=>{const s=lc(n);return{id:n.id,title:n.title,time:Cy(n.updatedAt,n.status),status:n.status,busy:Fh(n.id),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),tfe=W(()=>{Gu.value;const e=new Map;for(const t of ye.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=lc(t),s={id:t.id,title:t.title,time:Cy(t.updatedAt,t.status),status:t.status,busy:Fh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Kl.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:ye.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:ye.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:ye.sessionsInitialCountByWorkspace[t.id]??N1}))});function nfe(e){Hp.value=e,fA(e),ac.value!=="manual"&&(ac.value="manual",pA("manual"))}function sfe(e){ac.value!==e&&(ac.value=e,pA(e))}const y4=W(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),ofe=W(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),ife=W(()=>{const e={};for(const[t,n]of Object.entries(ye.unreadBySession))n&&(e[t]=!0);return e}),rfe=W(()=>{const e={},t=y4.value;for(const n of ye.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=lc(n);e[o]=(e[o]??0)+s}return e}),lfe=W(()=>ye.recentRoots),afe=W(()=>ye.availableOpenInApps),yt=pue(ye,{taskPoller:p4,sideChat:Rs,modelProvider:Un,pushOperationFailure:Dh,activity:Hh,inFlightPromptSessions:Ph,sessionsKnownEmpty:u4,setSessions:Q3,updateSession:Lh,upsertSessionFront:Pue,appendSession:Rue,forgetSession:e4,setActiveSessionId:by,updateSessionMessages:J3,nextOptimisticMsgId:c4,getEventConn:()=>ui,syncSessionFromSnapshot:Sy,reopenSession:ude,hasLoadedMessages:rde,refreshSessionStatus:Oh,persistSessionProfile:i4,mergedWorkspaces:xy,workspacesView:Kl,status:g4,workspaceIdForSession:lc,savePermissionToStorage:Tue,savePlanModeToStorage:K3,saveSwarmModeToStorage:G3,saveGoalModeToStorage:Y3,draftModes:Nh,saveUnread:p0,saveActiveWorkspaceToStorage:Lue,saveHiddenWorkspacesToStorage:Nue,goalErrorMessage:nde,resetFastMoon:Ai.resetFastMoon,initialized:o4,selectedDiffPath:t4,fileDiffLines:n4,fileDiffLoading:s4});function cfe(e,t){if(Ph.delete(e),ye.sendingBySession={...ye.sendingBySession,[e]:!1},ye.promptIdBySession[e]!==void 0){const i={...ye.promptIdBySession};delete i[e],ye.promptIdBySession=i}e===ye.activeSessionId?(Ai.resetFastMoon(),yt.loadGitStatus(e),Oh(e)):t==="idle"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!0},p0({[e]:!0})),Nl.maybeNotifyCompletion(e,{isActiveAndVisible:e===ye.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:ye.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{yt.selectSession(e)}}),t==="idle"&&Bp.maybePlayCompletionSound();const n=ye.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;ye.queuedBySession={...ye.queuedBySession,[e]:o},s!==void 0&&yt.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=ye.queuedBySession[e]??[];ye.queuedBySession={...ye.queuedBySession,[e]:[s,...r]}}})}function ufe(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Nl.maybeNotifyQuestion(e,{isActiveAndVisible:e===ye.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:ye.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{yt.selectSession(e)}}),Bp.maybePlayQuestionSound()}function dfe(){return fde(),{workspace:yde,sessions:kde,activeSessionId:bde,workspacesView:Kl,workspaceSortMode:ac,visibleWorkspace:Jde,activeWorkspaceId:v4,sessionsForView:efe,workspaceGroups:tfe,attentionBySession:y4,pendingBySession:ofe,attentionByWorkspace:rfe,unreadBySession:ife,recentRoots:lfe,turns:Sde,tasks:Cde,activeAppTasks:ud,todos:xde,goal:Ma,swarms:h4,activationBadges:Bde,compaction:Ade,status:g4,sessionCost:Kde,fileDiff:Vde,selectedDiffPath:t4,fileDiffLoading:s4,changes:qde,gitInfo:Fp,gitDiffStats:jde,activePullRequest:Ude,changesByPath:Zde,pendingApprovals:zde,availableOpenInApps:afe,connection:Tde,loading:Mde,sessionLoading:Ede,loadingMoreMessages:Ide,hasMoreMessages:$de,loadMoreMessagesError:Nde,serverVersion:Lde,initialized:o4,permission:Ode,thinking:Pde,planMode:m4,swarmMode:Rde,goalMode:Dde,queued:Fde,warnings:Hde,questions:Wde,activity:Hh,isSending:wde,fastMoon:Ai.fastMoon,models:Un.models,starredModelIds:Un.starredModelIds,providers:Un.providers,uiFontSize:Ai.uiFontSize,setUiFontSize:Ai.setUiFontSize,conversationToc:l4,setConversationToc:Uue,colorScheme:Ai.colorScheme,setColorScheme:Ai.setColorScheme,accent:Ai.accent,setAccent:Ai.setAccent,notifyOnComplete:Nl.notifyOnComplete,notifyOnQuestion:Nl.notifyOnQuestion,notifyPermission:Nl.notifyPermission,setNotifyOnComplete:Nl.setNotifyOnComplete,setNotifyOnQuestion:Nl.setNotifyOnQuestion,soundOnComplete:Bp.soundOnComplete,setSoundOnComplete:Bp.setSoundOnComplete,onboarded:a4,setOnboarded:jue,load:yt.load,selectSession:yt.selectSession,clearActiveSession:yt.clearActiveSession,loadOlderMessages:yt.loadOlderMessages,loadWorkspaces:yt.loadWorkspaces,loadMoreSessions:yt.loadMoreSessions,loadAllSessions:yt.loadAllSessions,selectWorkspace:yt.selectWorkspace,openWorkspace:yt.openWorkspace,openWorkspaceDraft:yt.openWorkspaceDraft,startSessionAndSendPrompt:yt.startSessionAndSendPrompt,addWorkspaceByPath:yt.addWorkspaceByPath,browseFs:yt.browseFs,getFsHome:yt.getFsHome,sendPrompt:yt.sendPrompt,steerPrompt:yt.steerPrompt,sideChatVisible:Rs.sideChatVisible,sideChatSessionId:Rs.sideChatSessionId,sideChatTurns:Rs.sideChatTurns,sideChatRunning:Rs.sideChatRunning,sideChatSending:Rs.sideChatSending,openSideChat:Rs.openSideChat,closeSideChat:Rs.closeSideChat,sendSideChatPrompt:Rs.sendSideChatPrompt,uploadImage:yt.uploadImage,abortCurrentPrompt:yt.abortCurrentPrompt,respondApproval:yt.respondApproval,respondQuestion:yt.respondQuestion,dismissQuestion:yt.dismissQuestion,pendingQuestionActions:yt.pendingQuestionActions,pendingApprovalActions:yt.pendingApprovalActions,cancelTask:yt.cancelTask,setPermission:yt.setPermission,setThinking:Un.setThinking,setPlanMode:yt.setPlanMode,togglePlanMode:yt.togglePlanMode,setSwarmMode:yt.setSwarmMode,toggleSwarmMode:yt.toggleSwarmMode,setGoalMode:yt.setGoalMode,toggleGoalMode:yt.toggleGoalMode,createGoal:yt.createGoal,controlGoal:yt.controlGoal,enqueue:yt.enqueue,dismissWarning:yt.dismissWarning,renameSession:yt.renameSession,renameWorkspace:yt.renameWorkspace,deleteWorkspace:yt.deleteWorkspace,reorderWorkspaces:nfe,setWorkspaceSortMode:sfe,archiveSession:yt.archiveSession,compact:yt.compact,forkSession:yt.forkSession,undo:yt.undo,unqueue:yt.unqueue,reorderQueue:yt.reorderQueue,searchFiles:yt.searchFiles,loadGitStatus:yt.loadGitStatus,loadFileDiff:yt.loadFileDiff,clearFileDiff:yt.clearFileDiff,listDir:yt.listDir,readFileContent:yt.readFileContent,getFileDownloadUrl:yt.getFileDownloadUrl,openWorkspaceFile:yt.openWorkspaceFile,openInApp:yt.openInApp,revealWorkspaceFile:yt.revealWorkspaceFile,resolveImageUrl:yt.resolveImageUrl,refreshOAuthProviderModels:Un.refreshOAuthProviderModels,loadModels:Un.loadModels,loadProviders:Un.loadProviders,skills:_de,activateSkill:Un.activateSkill,setModel:Un.setModel,toggleStarModel:Un.toggleStarModel,addProvider:Un.addProvider,deleteProvider:Un.deleteProvider,refreshProvider:Un.refreshProvider,refreshAllProviders:Un.refreshAllProviders,authReady:Gde,defaultModel:Yde,managedProviderStatus:Xde,config:Qde,updateConfig:yt.updateConfig,checkAuth:yt.checkAuth,startOAuthLogin:Un.startOAuthLogin,pollOAuthLogin:Un.pollOAuthLogin,cancelOAuthLogin:Un.cancelOAuthLogin,logout:yt.logout}}function ffe({client:e,authLogoRef:t}){const n=W(()=>e.authReady.value),s=W(()=>e.initialized.value&&!n.value),o="/login",i=Z(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ye(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 _n(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function pfe({running:e,showAuthGate:t}){const{t:n}=Nt(),s=["◐","◓","◑","◒"],o=Z(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}Ye(e,c=>{c?r():l()},{immediate:!0});const a=W(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});cI(()=>{typeof document<"u"&&(document.title=a.value)}),_n(()=>{l()})}const k4=Z(typeof window>"u"?0:window.innerWidth);let vf=0,Wp=!1;function L1(){k4.value=window.innerWidth}function hfe(){Wp||typeof window>"u"||(window.addEventListener("resize",L1),Wp=!0,L1())}function mfe(){!Wp||typeof window>"u"||(window.removeEventListener("resize",L1),Wp=!1)}function b4(e,t,n){return Math.max(t,e-n)}function O1(e,t,n){return Math.min(n,Math.max(t,e))}function _4(){return bn(()=>{vf+=1,hfe()}),ms(()=>{vf=Math.max(0,vf-1),vf===0&&mfe()}),{viewportWidth:k4}}const gfe="kimi-web.file-preview-width",Ea=320;function vfe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=_4(),i=W(()=>Math.max(0,o.value-t.value)),r=W(()=>b4(i.value,Ea,Ea));function l(ee){return O1(Math.round(ee),Ea,r.value)}function a(){return l(i.value/2)}const c=W(()=>a()),u=Z(c.value),d=W(()=>O1(u.value,Ea,r.value)),f=Z(null),h=W(()=>{const ee=f.value;if(!ee)return null;const Y=e.turns.value.find(de=>de.id===ee.turnId)?.blocks?.[ee.blockIndex];return Y?.kind==="thinking"?Y.thinking:null}),p=W(()=>h.value!==null);function m(ee){const q=f.value;if(q&&q.turnId===ee.turnId&&q.blockIndex===ee.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ee}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const _=Z(null),g=W(()=>{const ee=_.value;if(!ee)return null;const q=e.turns.value.find(Y=>Y.id===ee.turnId);return q?.role==="compaction"&&q.text?q.text:null}),v=W(()=>g.value!==null);function y(ee){if(_.value?.turnId===ee.turnId){_.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",_.value=ee}function C(){_.value=null,n.value==="compaction"&&(n.value=null)}const L=Z(null);function $(ee){const q=e.activeAppTasks.value,Y=q.find(ne=>ne.id===ee)??q.find(ne=>ne.parentToolCallId===ee);if(Y)return Y.id;const de=q.filter(ne=>ne.kind==="subagent"&&!ne.parentToolCallId);if(de.length===1)return de[0].id}const k=W(()=>{const ee=L.value;if(!ee)return null;const q=e.activeAppTasks.value.find(Y=>Y.id===ee.subagentId);return q?Yce(q):null}),M=W(()=>k.value!==null);function E(ee){const q=$(ee);if(q){if(L.value?.subagentId===q){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:q},n.value="agent"}}function O(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Z(null),I=W(()=>{const ee=S.value;if(!ee)return null;const q=sP(e.turns.value,ee);return q?{id:ee,title:nd(q.name),path:nP(q.arg),lines:q.status==="error"?null:CA(q),output:q.output}:null}),P=W(()=>I.value!==null);function D(ee){if(n.value==="toolDiff"&&S.value===ee){H();return}n.value="toolDiff",S.value=ee}function H(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=Z("list"),U=Z(null);function Q(){if(n.value==="diff"){X();return}n.value="diff",z.value="list",U.value=null,e.loadGitStatus(e.activeSessionId.value)}function X(){n.value==="diff"&&(n.value=null),z.value="list",U.value=null,e.clearFileDiff()}async function ue(ee){z.value="detail",U.value=ee,await e.loadFileDiff(ee)}async function me(ee){await e.openSideChat(ee),n.value="btw"}function Ae(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function be(){n.value==="btw"&&(n.value=null)}const ze=W(()=>e.sideChatVisible.value),qe=W(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||M.value)&&(n.value!=="toolDiff"||P.value)&&(n.value!=="btw"||ze.value)),Fe=Z(!1),Le=Z({});function le(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return _.value?{kind:"compaction",..._.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function F(ee){if(ee)switch(ee.kind){case"thinking":f.value={turnId:ee.turnId,blockIndex:ee.blockIndex},n.value="thinking";break;case"compaction":_.value={turnId:ee.turnId},n.value="compaction";break;case"agent":L.value={subagentId:ee.subagentId},n.value="agent";break;case"toolDiff":S.value=ee.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function te(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&v.value?(C(),!0):n.value==="agent"&&M.value?(O(),!0):n.value==="toolDiff"&&P.value?(H(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(X(),!0):n.value==="btw"?(Ae(),!0):!1}return Ye(e.activeSessionId,(ee,q)=>{if(q){const Y=le();Y?Le.value[q]=Y:delete Le.value[q]}s(),b(),C(),O(),H(),X(),be(),ee&&F(Le.value[ee])}),{PREVIEW_WIDTH_KEY:gfe,PREVIEW_MIN:Ea,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:b,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:C,agentPanelMember:k,agentPanelVisible:M,openAgentPanel:E,closeAgentPanel:O,toolDiffTarget:I,toolDiffVisible:P,openToolDiff:D,closeToolDiff:H,detailDiffMode:z,detailDiffPath:U,openDiffDetail:Q,closeDiffDetail:X,selectDiffFile:ue,btwVisible:ze,openSideChatTab:me,closeSideChat:Ae,hideSideChatPanel:be,sidePanelVisible:qe,panelDragging:Fe,closeOpenSidePanel:te}}const yfe=$t.sidebarWidth,oC=$t.sidebarCollapsed,iC=270,uv=170,kfe=36,bfe=320;function _fe(e={}){const{viewportWidth:t}=_4(),n=Z(iC),s=Z(!1),o=W(()=>{const c=bfe+(EC(e.previewOpen)?Ea:0);return b4(t.value,uv,c)}),i=W(()=>s.value?kfe:O1(n.value,uv,o.value));function r(){try{s.value=Zn(oC)==="true"}catch{s.value=!1}}function l(){try{es(oC,String(s.value))}catch{}}function a(){s.value=!s.value,l()}return{SIDEBAR_WIDTH_KEY:yfe,SIDEBAR_DEFAULT:iC,SIDEBAR_MIN:uv,sidebarMax:o,sessionColWidth:n,sidebarCollapsed:s,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function wfe({client:e,detailTarget:t}){const{t:n}=Nt(),s=Z(null),o=Z(null),i=Z(!1),r=Z(null),l=Z(null);let a=0;const c=W(()=>{const y=l.value;return y?e.getFileDownloadUrl(y):null}),u=W(()=>s.value!==null);function d(y){return y.length>1?y.replace(/\/+$/,""):y}function f(y){const C=[];for(const L of y.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){C.pop();continue}C.push(L)}return C.join("/")}function h(y){const C=y.trim();if(!C)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(C))return{error:n("filePreview.errors.unsupportedPath")};if(C.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=d(e.status.value.cwd);if(C.startsWith("/")){if(!L||C!==L&&!C.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const k=C===L?"":C.slice(L.length+1);if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const M=f(k);return M?{path:M}:{error:n("filePreview.errors.isDirectory")}}if(C.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const $=f(C);return $?{path:$}:{error:n("filePreview.errors.emptyPath")}}async function p(y){const C=s.value;if(t.value==="file"&&C&&C.path===y.path&&C.line===y.line){_();return}const L=++a;t.value="file",o.value=null,r.value=null,i.value=!0,s.value=y,l.value=null;const $=h(y.path);if("error"in $){i.value=!1,r.value=$.error;return}l.value=$.path;try{const k=await e.readFileContent($.path);if(L!==a)return;k?o.value={...k,path:k.path||$.path}:o.value={path:$.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(k){if(L!==a)return;r.value=k instanceof Error?k.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function m(y){return/^data:([^;,]+)/i.exec(y)?.[1]}function b(y){y.kind==="image"&&(t.value="file",s.value=null,l.value=null,r.value=null,i.value=!1,o.value={path:y.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:y.mimeType??m(y.url)??"image/*",sourceUrl:y.url,isBinary:!0,size:y.bytes??0})}function _(){s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function g(){const y=o.value?.path??s.value?.path;y&&e.openWorkspaceFile(y,s.value?.line)}function v(){const y=o.value?.path??s.value?.path;y&&e.revealWorkspaceFile(y)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:p,openMediaPreview:b,closeFilePreview:_,openPreviewInEditor:g,revealPreviewFile:v}}const Sfe=640,Cfe=`(max-width: ${Sfe}px)`;function xfe(){const e=Z(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Cfe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),_n(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),_n(()=>t.removeListener(n))),e}const Afe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Tfe={class:"server-auth-card"},Mfe={class:"server-auth-body"},Efe={class:"server-auth-foot"},Ife=Ve({__name:"ServerAuthDialog",setup(e){const t=Z(""),n=Z(null),s=Z(!1);bn(()=>{gt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,M3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(w(),N("div",Afe,[T("div",Tfe,[l[1]||(l[1]=T("div",{class:"server-auth-head"},[T("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),T("p",{class:"server-auth-hint"},[je(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),T("code",null,"KIMI_CODE_PASSWORD"),je("). ")])],-1)),T("div",Mfe,[oe(Za,{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"])]),T("div",Efe,[oe(Pt,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:ke(()=>[je(R(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),$fe=ft(Ife,[["__scopeId","data-v-82150ea4"]]),Nfe={class:"app-shell"},Lfe={key:1,class:"auth-page"},Ofe={class:"auth-page-inner"},Pfe={class:"auth-page-copy"},Rfe={key:0,class:"sidebar-rail"},Dfe=["aria-label","aria-hidden"],Bfe=Ve({__name:"App",setup(e){const t=Xae(),n=Z(!t);let s=null;const o=dfe();On("resolveImage",o.resolveImageUrl);const{t:i}=Nt(),r=pi(),l=xfe(),a=Z(!1),c=Z(!1),u=W(()=>{const dt=o.activeSessionId.value;return o.sessions.value.find(pe=>pe.id===dt)?.title??""}),d=W(()=>o.visibleWorkspace.value?.sessionCount??0),f=W(()=>o.activity.value!=="idle"),h=Z(null),{showAuthGate:p,blinkAuthLogo:m}=ffe({client:o,authLogoRef:h});pfe({running:f,showAuthGate:p});function b(dt){return dt==="off"?"high":"off"}const _=Z(!o.onboarded.value);function g(){o.setOnboarded(!0),_.value=!1}function v(){_.value=!0}bn(()=>{o.load(),qe(),document.addEventListener("keydown",y,!0),s=Zae(()=>{n.value=!0})}),_n(()=>{document.removeEventListener("keydown",y,!0),s!==null&&(s(),s=null)});function y(dt){dt.key==="Escape"&&(jt.value||Hn()&&(dt.stopPropagation(),dt.preventDefault()))}const C=Z(null),L=Z(!1);Ye(o.activeSessionId,()=>{L.value=!0,gt(()=>{L.value=!1})});const{previewTarget:$,previewFile:k,previewLoading:M,previewError:E,previewDownloadUrl:O,previewExternalActions:S,openFilePreview:I,openMediaPreview:P,closeFilePreview:D,openPreviewInEditor:H,revealPreviewFile:z}=wfe({client:o,detailTarget:C}),U=W(()=>C.value!==null),{SIDEBAR_WIDTH_KEY:Q,SIDEBAR_DEFAULT:X,SIDEBAR_MIN:ue,sidebarMax:me,sessionColWidth:Ae,sidebarCollapsed:be,sideWidth:ze,loadSidebarCollapsed:qe,toggleSidebarCollapse:Fe}=_fe({previewOpen:U}),{PREVIEW_WIDTH_KEY:Le,PREVIEW_MIN:le,previewDefaultWidth:F,previewMax:te,previewWidth:ee,previewPanelWidth:q,thinkingPanelText:Y,thinkingVisible:de,openThinkingPanel:ne,closeThinkingPanel:ce,compactionPanelText:j,compactionPanelVisible:G,openCompactionPanel:re,closeCompactionPanel:he,agentPanelMember:Ce,openAgentPanel:Ee,closeAgentPanel:ae,toolDiffTarget:xe,openToolDiff:Ke,closeToolDiff:st,detailDiffMode:_t,detailDiffPath:wt,openDiffDetail:Et,closeDiffDetail:Ot,selectDiffFile:bt,btwVisible:Kt,openSideChatTab:Fn,closeSideChat:$n,sidePanelVisible:Rt,panelDragging:nn,closeOpenSidePanel:Hn}=vfe({client:o,sideWidth:ze,detailTarget:C,closeFilePreview:D}),nt=Z(null),Pn=Z(!1),fn=Z(!1),Gn=Z(!1),Rn=Z(!1),gs=Z(!1),Xe=Z(!1),Ge=Z(null),At=Z(null),jt=W(()=>Aa.value>0||Pn.value||fn.value||Gn.value||Rn.value||gs.value||Xe.value||_.value||a.value||c.value),Xt=Z(!1),Nn=Z(!1),An=Z(!1),ts=Z(!1),It=Z(!1);async function Tn(){Xt.value=!0,Nn.value=!1,Pn.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{Nn.value=!0}finally{Xt.value=!1}}async function Qt(){An.value=!0,ts.value=!1,fn.value=!0;try{await o.loadProviders()}catch{ts.value=!0}finally{An.value=!1}}function _s(){Gn.value=!0}async function ei(dt){Pn.value=!1,await o.setModel(dt)}async function No(dt){await o.addProvider(dt)}async function et(dt){await o.deleteProvider(dt)}async function it(dt){await o.refreshProvider(dt)}async function lt(dt){It.value=!0;try{await o.updateConfig(dt)&&await o.checkAuth()}finally{It.value=!1}}async function pt(){return o.startOAuthLogin()}async function ti(){return o.pollOAuthLogin()}async function hi(){return o.cancelOAuthLogin()}async function Ie(){Gn.value=!1,await o.checkAuth(),await o.load()}async function _e(dt){await o.undo(1),await gt(),nt.value?.loadComposerForEdit(dt)}function Re(dt){if(dt==="/compact"||dt.startsWith("/compact ")){o.compact(dt.slice(8).trim()||void 0);return}if(dt==="/swarm"||dt.startsWith("/swarm ")){const pe=dt.slice(6).trim();pe==="on"?o.setSwarmMode(!0):pe==="off"?o.setSwarmMode(!1):pe?(o.setSwarmMode(!0),o.sendPrompt(pe)):o.toggleSwarmMode();return}if(dt==="/goal"||dt.startsWith("/goal ")){const pe=dt.slice(5).trim();pe==="pause"||pe==="resume"||pe==="cancel"?o.controlGoal(pe):pe?o.createGoal(pe):o.toggleGoalMode();return}if(dt==="/btw"||dt.startsWith("/btw ")){const pe=dt.slice(4).trim();!pe&&o.sideChatVisible.value?$n():Fn(pe||void 0);return}switch(dt){case"/new":case"/clear":rl();break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const pe=o.permission.value,Ne=pe==="manual"?"auto":pe==="auto"?"yolo":"manual";o.setPermission(Ne);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":gs.value=!0;break;case"/model":Tn();break;case"/provider":break;case"/login":_s();break;default:{const pe=dt.indexOf(" "),Ne=(pe===-1?dt:dt.slice(0,pe)).slice(1),wn=pe===-1?void 0:dt.slice(pe+1).trim()||void 0;Ne&&o.activateSkill(Ne,wn);break}}}function ln(dt){o.unqueue(dt)}function zt(dt){o.unqueue(dt)}function us(dt){o.reorderQueue(dt.from,dt.to)}async function Wn(dt){const pe=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&pe){await o.startSessionAndSendPrompt(pe,dt.text,dt.attachments);return}if(!o.activeSessionId.value&&!pe){Ge.value=dt,Rn.value=!0;return}o.sendPrompt(dt.text,dt.attachments)}async function go(dt){if(At.value=null,!await o.addWorkspaceByPath(dt)){At.value=i("workspace.addFailed");return}Rn.value=!1;const Ne=Ge.value;Ge.value=null;const wn=o.activeWorkspaceId.value;Ne&&wn&&await o.startSessionAndSendPrompt(wn,Ne.text,Ne.attachments)}function ni(){Ge.value=null,At.value=null,Rn.value=!1}function vs(){gt(()=>{nt.value?.focusComposer()})}function rl(){const dt=o.activeWorkspaceId.value;dt?o.openWorkspaceDraft(dt):o.clearActiveSession(),vs()}function ll(dt){o.openWorkspaceDraft(dt),vs()}function gc(dt){dt&&window.open(dt,"_blank","noopener")}return(dt,pe)=>(w(),N("div",Nfe,[n.value?(w(),ge($fe,{key:0})):ie("",!0),A(p)?(w(),N("section",Lfe,[T("div",Ofe,[(w(),N("svg",{ref_key:"authLogoRef",ref:h,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:pe[0]||(pe[0]=vt(()=>{},["prevent"])),onClick:pe[1]||(pe[1]=(...Ne)=>A(m)&&A(m)(...Ne))},[...pe[94]||(pe[94]=[e0('<defs data-v-7ac9791f><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-7ac9791f><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-7ac9791f></rect><g class="ch-eyes" fill="#000" data-v-7ac9791f><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-7ac9791f></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-7ac9791f></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-7ac9791f></rect>',2)])],544)),T("div",Pfe,[T("h1",null,R(A(i)("app.authPageTitle")),1),T("p",null,R(A(i)("app.authPageMessage")),1)]),oe(Pt,{class:"auth-page-btn",variant:"primary",onClick:_s},{default:ke(()=>[oe(Je,{name:"log-in",size:"md"}),T("span",null,R(A(i)("app.authPageLogin")),1)]),_:1})])])):(w(),N("div",{key:2,class:De(["app",{mobile:A(l),"sidebar-collapsed":A(be)&&!A(l)}]),style:Yt({"--side-w":A(ze)+"px","--preview-w":A(q)+"px"})},[A(l)?(w(),ge(Hie,{key:1,workspace:A(o).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:A(o).status.value.branch,"session-count":d.value,onOpenSwitcher:pe[17]||(pe[17]=Ne=>a.value=!0),onOpenSettings:pe[18]||(pe[18]=Ne=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),N(Oe,{key:0},[In(oe(vL,{"col-width":A(ze),"active-workspace":A(o).visibleWorkspace.value,"active-workspace-id":A(o).activeWorkspaceId.value,sessions:A(o).sessionsForView.value,groups:A(o).workspaceGroups.value,"active-id":A(o).activeSessionId.value,"attention-by-session":A(o).attentionBySession.value,"pending-by-session":A(o).pendingBySession.value,"unread-by-session":A(o).unreadBySession.value,"workspace-sort-mode":A(o).workspaceSortMode.value,onSelect:pe[2]||(pe[2]=Ne=>A(o).selectSession(Ne)),onCreate:rl,onCreateInWorkspace:pe[3]||(pe[3]=Ne=>ll(Ne)),onSelectWorkspace:pe[4]||(pe[4]=Ne=>A(o).openWorkspace(Ne)),onAddWorkspace:pe[5]||(pe[5]=Ne=>Rn.value=!0),onRename:pe[6]||(pe[6]=(Ne,wn)=>A(o).renameSession(Ne,wn)),onArchive:pe[7]||(pe[7]=Ne=>A(o).archiveSession(Ne)),onFork:pe[8]||(pe[8]=Ne=>A(o).forkSession(Ne)),onRenameWorkspace:pe[9]||(pe[9]=(Ne,wn)=>A(o).renameWorkspace(Ne,wn)),onDeleteWorkspace:pe[10]||(pe[10]=Ne=>A(o).deleteWorkspace(Ne)),onReorderWorkspaces:pe[11]||(pe[11]=Ne=>A(o).reorderWorkspaces(Ne)),onSetWorkspaceSortMode:pe[12]||(pe[12]=Ne=>A(o).setWorkspaceSortMode(Ne)),onLoadMoreSessions:pe[13]||(pe[13]=Ne=>void A(o).loadMoreSessions(Ne)),onLoadAllSessions:pe[14]||(pe[14]=Ne=>void A(o).loadAllSessions()),onOpenSettings:pe[15]||(pe[15]=Ne=>Xe.value=!0),onCollapse:A(Fe)},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"]),[[Vo,!A(be)]]),In(oe(b_,{"storage-key":A(Q),"default-width":A(X),min:A(ue),max:A(me),"onUpdate:width":pe[16]||(pe[16]=Ne=>Ae.value=Ne)},null,8,["storage-key","default-width","min","max"]),[[Vo,!A(be)]]),A(be)?(w(),N("div",Rfe,[oe(mn,{size:"sm",label:A(i)("sidebar.expandSidebar"),onClick:A(Fe)},{default:ke(()=>[oe(Je,{name:"panel-expand",size:"sm"})]),_:1},8,["label","onClick"])])):ie("",!0)],64)),oe(aJ,{ref_key:"conversationPaneRef",ref:nt,mobile:A(l),turns:A(o).turns.value,"session-id":A(o).activeSessionId.value,approvals:A(o).pendingApprovals.value,changes:A(o).changes.value,"git-info":A(o).gitInfo.value,tasks:A(o).tasks.value,todos:A(o).todos.value,goal:A(o).goal.value,swarms:A(o).swarms.value,"activation-badges":A(o).activationBadges.value,status:A(o).status.value,thinking:A(o).thinking.value,"plan-mode":A(o).planMode.value,"swarm-mode":A(o).swarmMode.value,"goal-mode":A(o).goalMode.value,models:A(o).models.value,"starred-ids":A(o).starredModelIds.value,skills:A(o).skills.value,questions:A(o).questions.value,"pending-question-actions":A(o).pendingQuestionActions,"pending-approval-actions":A(o).pendingApprovalActions,running:f.value,queued:A(o).queued.value,"search-files":A(o).searchFiles,"upload-image":A(o).uploadImage,sending:A(o).isSending.value,"fast-moon":A(o).fastMoon.value,"file-reload-key":A(o).activeSessionId.value,"session-loading":A(o).sessionLoading.value,compaction:A(o).compaction.value,"has-more-messages":A(o).hasMoreMessages.value,"loading-more":A(o).loadingMoreMessages.value,"loading-more-error":A(o).loadMoreMessagesError.value,"load-older-messages":A(o).loadOlderMessages,"workspace-name":A(o).visibleWorkspace.value?.name,"workspace-root":A(o).visibleWorkspace.value?.root??A(o).status.value.cwd,"git-diff-stats":A(o).gitDiffStats.value,workspaces:A(o).workspacesView.value,"active-workspace-id":A(o).activeWorkspaceId.value,"session-title":u.value,pr:A(o).activePullRequest.value,"conversation-toc":A(o).conversationToc.value,onOpenChanges:pe[19]||(pe[19]=Ne=>A(Et)()),onSelectWorkspace:pe[20]||(pe[20]=Ne=>ll(Ne)),onAddWorkspace:pe[21]||(pe[21]=Ne=>Rn.value=!0),onOpenPr:gc,onSubmit:pe[22]||(pe[22]=Ne=>Wn(Ne)),onSteer:pe[23]||(pe[23]=Ne=>A(o).steerPrompt(Ne.text,Ne.attachments)),onApproval:pe[24]||(pe[24]=(Ne,wn)=>A(o).respondApproval(Ne,wn)),onCancelTask:pe[25]||(pe[25]=Ne=>A(o).cancelTask(Ne)),onAnswer:pe[26]||(pe[26]=(Ne,wn)=>A(o).respondQuestion(Ne,wn)),onDismiss:pe[27]||(pe[27]=Ne=>A(o).dismissQuestion(Ne)),onCommand:Re,onInterrupt:pe[28]||(pe[28]=Ne=>A(o).abortCurrentPrompt()),onUnqueue:ln,onEditQueued:zt,onReorderQueue:us,onSetPermission:pe[29]||(pe[29]=Ne=>A(o).setPermission(Ne)),onSetThinking:pe[30]||(pe[30]=Ne=>A(o).setThinking(Ne)),onTogglePlan:pe[31]||(pe[31]=Ne=>A(o).togglePlanMode()),onToggleSwarm:pe[32]||(pe[32]=Ne=>A(o).toggleSwarmMode()),onToggleGoal:pe[33]||(pe[33]=Ne=>A(o).toggleGoalMode()),onCreateGoal:pe[34]||(pe[34]=Ne=>A(o).createGoal(Ne)),onControlGoal:pe[35]||(pe[35]=Ne=>A(o).controlGoal(Ne)),onRefreshGitStatus:pe[36]||(pe[36]=Ne=>A(o).activeSessionId.value&&A(o).loadGitStatus(A(o).activeSessionId.value)),onRenameSession:pe[37]||(pe[37]=(Ne,wn)=>A(o).renameSession(Ne,wn)),onForkSession:pe[38]||(pe[38]=Ne=>A(o).forkSession(Ne)),onArchiveSession:pe[39]||(pe[39]=Ne=>A(o).archiveSession(Ne)),onCompact:pe[40]||(pe[40]=Ne=>A(o).compact()),onPickModel:pe[41]||(pe[41]=Ne=>Tn()),onSelectModel:pe[42]||(pe[42]=Ne=>A(o).setModel(Ne)),onOpenFile:pe[43]||(pe[43]=Ne=>A(I)(Ne)),onOpenMedia:pe[44]||(pe[44]=Ne=>A(P)(Ne)),onOpenThinking:pe[45]||(pe[45]=Ne=>A(ne)(Ne)),onOpenCompaction:pe[46]||(pe[46]=Ne=>A(re)(Ne)),onOpenAgent:pe[47]||(pe[47]=Ne=>A(Ee)(Ne)),onOpenToolDiff:pe[48]||(pe[48]=Ne=>A(Ke)(Ne)),onEditMessage:_e},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","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"]),A(Rt)&&!A(l)?(w(),ge(b_,{key:2,"storage-key":A(Le),"default-width":A(F),min:A(le),max:A(te),reverse:"","aria-label":A(i)("layout.resizePreviewAria"),"onUpdate:width":pe[49]||(pe[49]=Ne=>ee.value=Ne),"onUpdate:dragging":pe[50]||(pe[50]=Ne=>nn.value=Ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!A(l)||A(Rt)?(w(),N("aside",{key:3,class:De(["global-preview",{open:A(Rt),mobile:A(l),"no-anim":A(nn)||L.value}]),role:"complementary","aria-label":A(i)("layout.detailPanelAria"),"aria-hidden":!A(Rt)},[C.value==="thinking"&&A(de)?(w(),ge(SS,{key:0,text:A(Y)??"",onClose:A(ce)},null,8,["text","onClose"])):C.value==="compaction"&&A(G)?(w(),ge(SS,{key:1,text:A(j)??"",subtitle:A(i)("conversation.summaryTitle"),onClose:A(he)},null,8,["text","subtitle","onClose"])):C.value==="agent"&&A(Ce)?(w(),ge(Eee,{key:2,member:A(Ce),onClose:A(ae)},null,8,["member","onClose"])):C.value==="btw"&&A(Kt)?(w(),ge(Xee,{key:3,turns:A(o).sideChatTurns.value,running:A(o).sideChatRunning.value,sending:A(o).sideChatSending.value,onSend:pe[51]||(pe[51]=Ne=>A(o).sendSideChatPrompt(Ne)),onClose:A($n)},null,8,["turns","running","sending","onClose"])):C.value==="diff"?(w(),ge(Cte,{key:4,mode:A(_t),changes:A(o).changes.value,"git-info":A(o).gitInfo.value,"file-diff":A(o).fileDiff.value,"selected-diff-path":A(o).selectedDiffPath.value,"file-diff-loading":A(o).fileDiffLoading.value,closable:"",onOpen:A(bt),onBack:pe[52]||(pe[52]=Ne=>{_t.value="list",wt.value=null,A(o).clearFileDiff()}),onClose:A(Ot)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):C.value==="toolDiff"&&A(xe)?(w(),ge(zee,{key:5,target:A(xe),onClose:A(st)},null,8,["target","onClose"])):C.value==="file"?(w(),ge(uee,{key:6,file:A(k),loading:A(M),error:A(E),line:A($)?.line,"download-url":A(O),closable:"","external-actions":A(S),"open-file":A(I),onClose:A(D),onOpenExternal:A(H),onReveal:A(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,Dfe)):ie("",!0),Pn.value?(w(),ge(Ute,{key:4,models:A(o).models.value,current:A(o).status.value.modelId,"starred-ids":A(o).starredModelIds.value,loading:Xt.value,unavailable:Nn.value,onSelect:pe[53]||(pe[53]=Ne=>ei(Ne)),onToggleStar:pe[54]||(pe[54]=Ne=>A(o).toggleStarModel(Ne)),onClose:pe[55]||(pe[55]=Ne=>Pn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),Xe.value?(w(),ge(Ioe,{key:5,"color-scheme":A(o).colorScheme.value,accent:A(o).accent.value,"ui-font-size":A(o).uiFontSize.value,"auth-ready":A(o).authReady.value,"account-model":A(o).defaultModel.value,notify:A(o).notifyOnComplete.value,"notify-question":A(o).notifyOnQuestion.value,"notify-permission":A(o).notifyPermission.value,sound:A(o).soundOnComplete.value,"conversation-toc":A(o).conversationToc.value,config:A(o).config.value,models:A(o).models.value,"config-saving":It.value,"server-version":A(o).serverVersion.value,onSetColorScheme:pe[56]||(pe[56]=Ne=>A(o).setColorScheme(Ne)),onSetAccent:pe[57]||(pe[57]=Ne=>A(o).setAccent(Ne)),onSetUiFontSize:pe[58]||(pe[58]=Ne=>A(o).setUiFontSize(Ne)),onSetNotify:pe[59]||(pe[59]=Ne=>A(o).setNotifyOnComplete(Ne)),onSetNotifyQuestion:pe[60]||(pe[60]=Ne=>A(o).setNotifyOnQuestion(Ne)),onSetSound:pe[61]||(pe[61]=Ne=>A(o).setSoundOnComplete(Ne)),onSetConversationToc:pe[62]||(pe[62]=Ne=>A(o).setConversationToc(Ne)),onUpdateConfig:pe[63]||(pe[63]=Ne=>lt(Ne)),onLogin:pe[64]||(pe[64]=()=>{Xe.value=!1,_s()}),onLogout:A(o).logout,onOpenOnboarding:pe[65]||(pe[65]=()=>{Xe.value=!1,v()}),onOpenProviders:pe[66]||(pe[66]=()=>{Xe.value=!1,Qt()}),onClose:pe[67]||(pe[67]=Ne=>Xe.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"])):ie("",!0),fn.value?(w(),ge(hne,{key:6,providers:A(o).providers.value,loading:An.value,unavailable:ts.value,onAdd:pe[68]||(pe[68]=Ne=>No(Ne)),onRefresh:pe[69]||(pe[69]=Ne=>it(Ne)),onDelete:pe[70]||(pe[70]=Ne=>et(Ne)),onOpenLogin:pe[71]||(pe[71]=()=>{fn.value=!1,_s()}),onClose:pe[72]||(pe[72]=Ne=>fn.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),gs.value?(w(),ge(kie,{key:7,status:A(o).status.value,thinking:A(o).thinking.value,"plan-mode":A(o).planMode.value,"swarm-mode":A(o).swarmMode.value,"cost-usd":A(o).sessionCost.value,onClose:pe[73]||(pe[73]=Ne=>gs.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),Rn.value?(w(),ge(sie,{key:8,"browse-fs":A(o).browseFs,"get-fs-home":A(o).getFsHome,"default-path":A(o).visibleWorkspace.value?.root??A(o).status.value.cwd,error:At.value,onAdd:pe[74]||(pe[74]=Ne=>go(Ne)),onClose:ni},null,8,["browse-fs","get-fs-home","default-path","error"])):ie("",!0),oe(Kr,{name:"gload-fade"},{default:ke(()=>[A(o).initialized.value?ie("",!0):(w(),ge(Ble,{key:0}))]),_:1}),_.value&&!A(p)?(w(),ge(Lle,{key:9,onComplete:g,onSkip:g})):ie("",!0),oe($ie,{warnings:A(o).warnings.value,onDismiss:A(o).dismissWarning},null,8,["warnings","onDismiss"]),A(r)?(w(),ge(hae,{key:10})):ie("",!0),oe(lie),A(l)?(w(),ge(cre,{key:11,modelValue:a.value,"onUpdate:modelValue":pe[75]||(pe[75]=Ne=>a.value=Ne),groups:A(o).workspaceGroups.value,"active-workspace-id":A(o).activeWorkspaceId.value,"active-id":A(o).activeSessionId.value,"attention-by-session":A(o).attentionBySession.value,"attention-by-workspace":A(o).attentionByWorkspace.value,onSelect:pe[76]||(pe[76]=Ne=>A(o).selectSession(Ne)),onCreate:rl,onCreateInWorkspace:pe[77]||(pe[77]=Ne=>ll(Ne)),onAddWorkspace:pe[78]||(pe[78]=Ne=>Rn.value=!0),onRename:pe[79]||(pe[79]=(Ne,wn)=>A(o).renameSession(Ne,wn)),onArchive:pe[80]||(pe[80]=Ne=>A(o).archiveSession(Ne)),onDeleteWorkspace:pe[81]||(pe[81]=Ne=>A(o).deleteWorkspace(Ne)),onLoadMore:pe[82]||(pe[82]=Ne=>void A(o).loadMoreSessions(Ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),A(l)?(w(),ge(sle,{key:12,modelValue:c.value,"onUpdate:modelValue":pe[83]||(pe[83]=Ne=>c.value=Ne),status:A(o).status.value,thinking:A(o).thinking.value,"plan-mode":A(o).planMode.value,"swarm-mode":A(o).swarmMode.value,"color-scheme":A(o).colorScheme.value,"ui-font-size":A(o).uiFontSize.value,"auth-ready":A(o).authReady.value,"conversation-toc":A(o).conversationToc.value,"server-version":A(o).serverVersion.value,onPickModel:pe[84]||(pe[84]=Ne=>Tn()),onSetThinking:pe[85]||(pe[85]=Ne=>A(o).setThinking(Ne)),onTogglePlan:pe[86]||(pe[86]=Ne=>A(o).togglePlanMode()),onToggleSwarm:pe[87]||(pe[87]=Ne=>A(o).toggleSwarmMode()),onSetPermission:pe[88]||(pe[88]=Ne=>A(o).setPermission(Ne)),onSetColorScheme:pe[89]||(pe[89]=Ne=>A(o).setColorScheme(Ne)),onSetUiFontSize:pe[90]||(pe[90]=Ne=>A(o).setUiFontSize(Ne)),onSetConversationToc:pe[91]||(pe[91]=Ne=>A(o).setConversationToc(Ne)),onLogin:pe[92]||(pe[92]=()=>{c.value=!1,_s()}),onLogout:A(o).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ie("",!0)],6)),Gn.value?(w(),ge(qne,{key:3,"on-start-o-auth-login":pt,"on-poll-o-auth-login":ti,"on-cancel-o-auth-login":hi,onSuccess:Ie,onClose:pe[93]||(pe[93]=Ne=>Gn.value=!1)})):ie("",!0)]))}}),Ffe=ft(Bfe,[["__scopeId","data-v-7ac9791f"]]);ese();sp(Ffe).use(jn).mount("#app");export{AE as $,G1 as A,gI as B,is as C,Bpe as D,fC as E,Oe as F,e0 as G,je as H,oe as I,YE as J,cpe as K,Mi as L,Ve as M,z$ as N,ppe as O,hpe as P,vpe as Q,Ff as R,Ua as S,sh as T,mpe as U,n0 as V,fpe as W,Hpe as X,gpe as Y,Lpe as Z,Wfe as _,WC as a,Bs as a$,Ls as a0,D1 as a1,Yfe as a2,U1 as a3,f$ as a4,un as a5,uc as a6,tpe as a7,Upe as a8,ipe as a9,VC as aA,TI as aB,LI as aC,bn as aD,NI as aE,$I as aF,B1 as aG,II as aH,_n as aI,j1 as aJ,eI as aK,w as aL,F$ as aM,Jfe as aN,On as aO,IC as aP,Zfe as aQ,qf as aR,$s as aS,Wf as aT,Z as aU,Tpe as aV,o6 as aW,ot as aX,xn as aY,PI as aZ,upe as a_,ape as aa,lpe as ab,rpe as ac,Epe as ad,qpe as ae,qt as af,y$ as ag,th as ah,Hr as ai,nr as aj,Jn as ak,Mpe as al,Co as am,Vr as an,Rr as ao,bpe as ap,_pe as aq,pn as ar,gt as as,S$ as at,De as au,Hfe as av,Yt as aw,AI as ax,EI as ay,ms as az,Qfe as b,Tq as b$,Rpe as b0,xu as b1,Xf as b2,Ope as b3,jr as b4,jE as b5,Ufe as b6,Yl as b7,lI as b8,Ppe as b9,mo as bA,Vo as bB,k$ as bC,$pe as bD,Ye as bE,cI as bF,npe as bG,uI as bH,Spe as bI,ke as bJ,ype as bK,In as bL,li as bM,Ipe as bN,vt as bO,epe as bP,dn as bQ,lo as bR,ehe as bS,gj as bT,PM as bU,nhe as bV,jU as bW,Y0 as bX,the as bY,n1 as bZ,ahe as b_,zfe as ba,R as bb,yf as bc,dpe as bd,Gt as be,Vfe as bf,jfe as bg,EC as bh,Ape as bi,qfe as bj,A as bk,Ju as bl,zpe as bm,Fpe as bn,q$ as bo,spe as bp,Cpe as bq,aI as br,Wpe as bs,kpe as bt,ope as bu,HC as bv,np as bw,J$ as bx,Nx as by,Mv as bz,Npe as c,Aq as c0,V0 as c1,xq as c2,Qpe as c3,BU as c4,Xpe as c5,Mp as c6,Kpe as c7,Cq as c8,EM as c9,lhe as ca,Gpe as cb,uhe as cc,a1 as cd,Pa as ce,r1 as cf,dhe as cg,che as ch,Jpe as ci,_o as cj,Ype as ck,Zpe as cl,KU as cm,rhe as cn,l1 as co,i1 as cp,ihe as cq,Vpe as cr,ohe as cs,she as ct,jpe as cu,hA as cv,U5 as cw,xpe as d,Wr as e,Kfe as f,Kr as g,K$ as h,Gfe as i,Xfe as j,Qo as k,Xu as l,hs as m,Kp as n,sr as o,Dpe as p,W as q,sp as r,ge as s,ie as t,N as u,T as v,s$ as w,wpe as x,n$ as y,i6 as z};