@moonshot-ai/kimi-code 0.23.2 → 0.23.4

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 (93) hide show
  1. package/dist/main.mjs +53452 -51661
  2. package/dist-web/assets/{CodeBlockNode-EM_kCY-N.js → CodeBlockNode-DI6gCVXa.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-CRgIOeOQ.js → CodeBlockShell.vue_vue_type_style_index_0_lang-BeZI5g5_.js} +1 -1
  4. package/dist-web/assets/DesignSystemView-B0VQ8shl.css +1 -0
  5. package/dist-web/assets/DesignSystemView-DQSXggUP.js +13 -0
  6. package/dist-web/assets/{Tooltip-CzU8Fz35.js → Tooltip-B3YtzPNZ.js} +1 -1
  7. package/dist-web/assets/{arc-DJW0hKnH.js → arc-bQMfCHSI.js} +1 -1
  8. package/dist-web/assets/{architectureDiagram-3BPJPVTR-BugvyD1E.js → architectureDiagram-3BPJPVTR-sZkP4A5D.js} +1 -1
  9. package/dist-web/assets/{blockDiagram-GPEHLZMM-CYo-sII1.js → blockDiagram-GPEHLZMM-Cnf-tp-z.js} +1 -1
  10. package/dist-web/assets/{c4Diagram-AAUBKEIU-D5-N6MBf.js → c4Diagram-AAUBKEIU-D1Ej05NX.js} +1 -1
  11. package/dist-web/assets/channel-UBfbidLp.js +1 -0
  12. package/dist-web/assets/{chunk-2J33WTMH-B3rIAyxG.js → chunk-2J33WTMH-BhnDBJIi.js} +1 -1
  13. package/dist-web/assets/{chunk-4BX2VUAB-BqE5MO-d.js → chunk-4BX2VUAB-CiOLp8_3.js} +1 -1
  14. package/dist-web/assets/{chunk-55IACEB6-CLF660V6.js → chunk-55IACEB6-aUOZP4x-.js} +1 -1
  15. package/dist-web/assets/{chunk-727SXJPM-B0BhWK0K.js → chunk-727SXJPM-CHY14gq8.js} +1 -1
  16. package/dist-web/assets/{chunk-AQP2D5EJ-DPjMnAJ0.js → chunk-AQP2D5EJ-BKQr3gru.js} +1 -1
  17. package/dist-web/assets/{chunk-FMBD7UC4-D5PTPUwg.js → chunk-FMBD7UC4-BNnO5ZRK.js} +1 -1
  18. package/dist-web/assets/{chunk-ND2GUHAM-kAaY_4Vl.js → chunk-ND2GUHAM-CzE2E83w.js} +1 -1
  19. package/dist-web/assets/{chunk-QZHKN3VN-C9evXZPa.js → chunk-QZHKN3VN-BVjSv3p6.js} +1 -1
  20. package/dist-web/assets/classDiagram-4FO5ZUOK-B6r9FPXR.js +1 -0
  21. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B6r9FPXR.js +1 -0
  22. package/dist-web/assets/{cose-bilkent-S5V4N54A-CLouiVVi.js → cose-bilkent-S5V4N54A-DaSWvU-5.js} +1 -1
  23. package/dist-web/assets/{dagre-BM42HDAG-DzxOlw1n.js → dagre-BM42HDAG-VuVwg9z6.js} +1 -1
  24. package/dist-web/assets/{diagram-2AECGRRQ-BByJ2hb_.js → diagram-2AECGRRQ-BI5_WXHg.js} +1 -1
  25. package/dist-web/assets/{diagram-5GNKFQAL-IRsTcFso.js → diagram-5GNKFQAL-3M89yso9.js} +1 -1
  26. package/dist-web/assets/{diagram-KO2AKTUF-OnKw1-KB.js → diagram-KO2AKTUF-C9Qx0fJd.js} +1 -1
  27. package/dist-web/assets/{diagram-LMA3HP47-BDxe5igX.js → diagram-LMA3HP47-yJ-bCZyw.js} +1 -1
  28. package/dist-web/assets/{diagram-OG6HWLK6-C8HfQ_tC.js → diagram-OG6HWLK6-CZnqkQin.js} +1 -1
  29. package/dist-web/assets/{erDiagram-TEJ5UH35-9GqhMJHB.js → erDiagram-TEJ5UH35-BQucaPqh.js} +1 -1
  30. package/dist-web/assets/{flowDiagram-I6XJVG4X-BxnUU20J.js → flowDiagram-I6XJVG4X-CNpuVBgN.js} +1 -1
  31. package/dist-web/assets/{ganttDiagram-6RSMTGT7-BvvI2pVg.js → ganttDiagram-6RSMTGT7-KIhg0NCT.js} +1 -1
  32. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-B7iu5op7.js → gitGraphDiagram-PVQCEYII-C4YXqCii.js} +1 -1
  33. package/dist-web/assets/index-5DXn785n.css +1 -0
  34. package/dist-web/assets/index-CBO7u0oz.js +322 -0
  35. package/dist-web/assets/{index-BCLn8KKh.js → index-CL0UgQBD.js} +2 -2
  36. package/dist-web/assets/{index-Bi8oHSIr.js → index-v28kS3Hg.js} +1 -1
  37. package/dist-web/assets/{index10-CCuAby3p.js → index10-RB_ZIgWs.js} +1 -1
  38. package/dist-web/assets/{index11-Dfvs1Rhd.js → index11-DyrslmWY.js} +1 -1
  39. package/dist-web/assets/{index5-iCBVHj23.js → index5-Bn5298gF.js} +1 -1
  40. package/dist-web/assets/{index6-pl4U4MZe.js → index6-Di9uDNmo.js} +1 -1
  41. package/dist-web/assets/{index7-DHIAb9rr.js → index7-CL9Ie_DH.js} +1 -1
  42. package/dist-web/assets/{index8-f7_g7Sdt.js → index8-CHlcChT0.js} +2 -2
  43. package/dist-web/assets/{infoDiagram-5YYISTIA-CyYBC3kA.js → infoDiagram-5YYISTIA-DTw-WQIn.js} +1 -1
  44. package/dist-web/assets/inter-cyrillic-ext-opsz-italic-fe11NjBs.woff2 +0 -0
  45. package/dist-web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  46. package/dist-web/assets/inter-cyrillic-opsz-italic-Ck9oD2H0.woff2 +0 -0
  47. package/dist-web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  48. package/dist-web/assets/inter-greek-ext-opsz-italic-BIcRYUEt.woff2 +0 -0
  49. package/dist-web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  50. package/dist-web/assets/inter-greek-opsz-italic-mtaF_0H_.woff2 +0 -0
  51. package/dist-web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  52. package/dist-web/assets/inter-latin-ext-opsz-italic-BLMf5All.woff2 +0 -0
  53. package/dist-web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  54. package/dist-web/assets/inter-latin-opsz-italic-BbqH_2Ar.woff2 +0 -0
  55. package/dist-web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  56. package/dist-web/assets/inter-vietnamese-opsz-italic-C7TReJrb.woff2 +0 -0
  57. package/dist-web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  58. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-Jlcx9xTb.js → ishikawaDiagram-YF4QCWOH-BUmTsigt.js} +1 -1
  59. package/dist-web/assets/{journeyDiagram-JHISSGLW-CL5Yb_5k.js → journeyDiagram-JHISSGLW-B8yfgocJ.js} +1 -1
  60. package/dist-web/assets/{kanban-definition-UN3LZRKU-BqnauHAF.js → kanban-definition-UN3LZRKU-BUcF33Xd.js} +1 -1
  61. package/dist-web/assets/{linear-CMWGjNOi.js → linear-DY3q771w.js} +1 -1
  62. package/dist-web/assets/{mermaid.core-KmcIQ1Ur.js → mermaid.core-D1ZdIpxL.js} +4 -4
  63. package/dist-web/assets/{mindmap-definition-RKZ34NQL-CVr19Hb0.js → mindmap-definition-RKZ34NQL-ltEULHzt.js} +1 -1
  64. package/dist-web/assets/{pieDiagram-4H26LBE5-DJkmgpkl.js → pieDiagram-4H26LBE5-iCUA44fk.js} +1 -1
  65. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-Q6FJUxUg.js → quadrantDiagram-W4KKPZXB-Zrit1Fzo.js} +1 -1
  66. package/dist-web/assets/{requirementDiagram-4Y6WPE33-CQTp7wfD.js → requirementDiagram-4Y6WPE33-n610iR9M.js} +1 -1
  67. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-CyNSPnTi.js → sankeyDiagram-5OEKKPKP-RQEY2tBl.js} +1 -1
  68. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-DoC6yllg.js → sequenceDiagram-3UESZ5HK-QrJ3Ysl6.js} +1 -1
  69. package/dist-web/assets/{stateDiagram-AJRCARHV-DJPyh7eE.js → stateDiagram-AJRCARHV-D0mG4Tjg.js} +1 -1
  70. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CctN1EOf.js +1 -0
  71. package/dist-web/assets/{timeline-definition-PNZ67QCA-C3cofncr.js → timeline-definition-PNZ67QCA-DacB6B1v.js} +1 -1
  72. package/dist-web/assets/{vennDiagram-CIIHVFJN-D9J8WcHA.js → vennDiagram-CIIHVFJN-CXO9WlfO.js} +1 -1
  73. package/dist-web/assets/{vue.runtime.esm-bundler-C14m1nnd.js → vue.runtime.esm-bundler-Dj6KWBND.js} +1 -1
  74. package/dist-web/assets/{wardley-L42UT6IY-DkNDXFdt.js → wardley-L42UT6IY-BbMWJCmQ.js} +1 -1
  75. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-BHgVdx4X.js → wardleyDiagram-YWT4CUSO-BIcvmjmV.js} +1 -1
  76. package/dist-web/assets/{xychartDiagram-2RQKCTM6-eziUIMuM.js → xychartDiagram-2RQKCTM6-CX9xzSCM.js} +1 -1
  77. package/dist-web/index.html +2 -2
  78. package/package.json +4 -4
  79. package/dist-web/assets/DesignSystemView-CHgJ_72D.css +0 -1
  80. package/dist-web/assets/DesignSystemView-CcrMrQZg.js +0 -12
  81. package/dist-web/assets/channel-CC7oTf8I.js +0 -1
  82. package/dist-web/assets/classDiagram-4FO5ZUOK-Khrb0akV.js +0 -1
  83. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Khrb0akV.js +0 -1
  84. package/dist-web/assets/index-D-9xA0Nc.css +0 -1
  85. package/dist-web/assets/index-e04Pgjfa.js +0 -290
  86. package/dist-web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  87. package/dist-web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  88. package/dist-web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  89. package/dist-web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  90. package/dist-web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  91. package/dist-web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  92. package/dist-web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  93. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-D6D0vb-i.js +0 -1
@@ -0,0 +1,322 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-DQSXggUP.js","assets/DesignSystemView-B0VQ8shl.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-DI6gCVXa.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-BeZI5g5_.js","assets/index8-CHlcChT0.js","assets/index11-DyrslmWY.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 dp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Gt={},rc=[],li=()=>{},AC=()=>!1,gd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fp=e=>e.startsWith("onUpdate:"),mn=Object.assign,xv=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},N8=Object.prototype.hasOwnProperty,on=(e,t)=>N8.call(e,t),_t=Array.isArray,lc=e=>Ic(e)==="[object Map]",da=e=>Ic(e)==="[object Set]",Y2=e=>Ic(e)==="[object Date]",I8=e=>Ic(e)==="[object RegExp]",It=e=>typeof e=="function",bn=e=>typeof e=="string",zo=e=>typeof e=="symbol",rn=e=>e!==null&&typeof e=="object",_v=e=>(rn(e)||It(e))&&It(e.then)&&It(e.catch),MC=Object.prototype.toString,Ic=e=>MC.call(e),$8=e=>Ic(e).slice(8,-1),hp=e=>Ic(e)==="[object Object]",pp=e=>bn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zl=dp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},L8=/-\w/g,vs=mp(e=>e.replace(L8,t=>t.slice(1).toUpperCase())),F8=/\B([A-Z])/g,go=mp(e=>e.replace(F8,"-$1").toLowerCase()),gp=mp(e=>e.charAt(0).toUpperCase()+e.slice(1)),Df=mp(e=>e?`on${gp(e)}`:""),Is=(e,t)=>!Object.is(e,t),ac=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},EC=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},vp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ih=e=>{const t=bn(e)?Number(e):NaN;return isNaN(t)?e:t};let Z2;const yp=()=>Z2||(Z2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),O8="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",R8=dp(O8);function qt(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bn(s)?H8(s):qt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(bn(e)||rn(e))return e}const B8=/;(?![^(]*\))/g,D8=/:([^]+)/,P8=/\/\*[^]*?\*\//g;function H8(e){const t={};return e.replace(P8,"").split(B8).forEach(n=>{if(n){const s=n.split(D8);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function De(e){let t="";if(bn(e))t=e;else if(_t(e))for(let n=0;n<e.length;n++){const s=De(e[n]);s&&(t+=s+" ")}else if(rn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function P2e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!bn(t)&&(e.class=De(t)),n&&(e.style=qt(n)),e}const W8="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",z8=dp(W8);function TC(e){return!!e||e===""}function U8(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=vr(e[s],t[s]);return n}function vr(e,t){if(e===t)return!0;let n=Y2(e),s=Y2(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=zo(e),s=zo(t),n||s)return e===t;if(n=_t(e),s=_t(t),n||s)return n&&s?U8(e,t):!1;if(n=rn(e),s=rn(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!vr(e[r],t[r]))return!1}}return String(e)===String(t)}function kp(e,t){return e.findIndex(n=>vr(n,t))}const NC=e=>!!(e&&e.__v_isRef===!0),B=e=>bn(e)?e:e==null?"":_t(e)||rn(e)&&(e.toString===MC||!It(e.toString))?NC(e)?B(e.value):JSON.stringify(e,IC,2):String(e),IC=(e,t)=>NC(t)?IC(e,t.value):lc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[f1(s,i)+" =>"]=o,n),{})}:da(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>f1(n))}:zo(t)?f1(t):rn(t)&&!_t(t)&&!hp(t)?String(t):t,f1=(e,t="")=>{var n;return zo(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function j8(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
7
+ * @vue/reactivity v3.5.35
8
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
+ * @license MIT
10
+ **/let gs;class $C{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&gs&&(gs.active?(this.parent=gs,this.index=(gs.scopes||(gs.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=gs;try{return gs=this,t()}finally{gs=n}}}on(){++this._on===1&&(this.prevScope=gs,gs=this)}off(){if(this._on>0&&--this._on===0){if(gs===this)gs=this.prevScope;else{let t=gs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function q8(e){return new $C(e)}function wv(){return gs}function Sv(e,t=!1){gs&&gs.cleanups.push(e)}let Fn;const h1=new WeakSet;class rh{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,gs&&(gs.active?gs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,h1.has(this)&&(h1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||FC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Q2(this),OC(this);const t=Fn,n=_i;Fn=this,_i=!0;try{return this.fn()}finally{RC(this),Fn=t,_i=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Mv(t);this.deps=this.depsTail=void 0,Q2(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?h1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){K0(this)&&this.run()}get dirty(){return K0(this)}}let LC=0,_u,wu;function FC(e,t=!1){if(e.flags|=8,t){e.next=wu,wu=e;return}e.next=_u,_u=e}function Cv(){LC++}function Av(){if(--LC>0)return;if(wu){let t=wu;for(wu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;_u;){let t=_u;for(_u=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function OC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function RC(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Mv(s),V8(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function K0(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(BC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function BC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===zu)||(e.globalVersion=zu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!K0(e))))return;e.flags|=2;const t=e.dep,n=Fn,s=_i;Fn=e,_i=!0;try{OC(e);const o=e.fn(e._value);(t.version===0||Is(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Fn=n,_i=s,RC(e),e.flags&=-3}}function Mv(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Mv(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function V8(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function H2e(e,t){e.effect instanceof rh&&(e=e.effect.fn);const n=new rh(e);t&&mn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function W2e(e){e.effect.stop()}let _i=!0;const DC=[];function yr(){DC.push(_i),_i=!1}function kr(){const e=DC.pop();_i=e===void 0?!0:e}function Q2(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Fn;Fn=void 0;try{t()}finally{Fn=n}}}let zu=0;class K8{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class bp{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Fn||!_i||Fn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Fn)n=this.activeLink=new K8(Fn,this),Fn.deps?(n.prevDep=Fn.depsTail,Fn.depsTail.nextDep=n,Fn.depsTail=n):Fn.deps=Fn.depsTail=n,PC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Fn.depsTail,n.nextDep=void 0,Fn.depsTail.nextDep=n,Fn.depsTail=n,Fn.deps===n&&(Fn.deps=s)}return n}trigger(t){this.version++,zu++,this.notify(t)}notify(t){Cv();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Av()}}}function PC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)PC(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const lh=new WeakMap,Ql=Symbol(""),G0=Symbol(""),Uu=Symbol("");function zs(e,t,n){if(_i&&Fn){let s=lh.get(e);s||lh.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new bp),o.map=s,o.key=n),o.track()}}function cr(e,t,n,s,o,i){const r=lh.get(e);if(!r){zu++;return}const l=a=>{a&&a.trigger()};if(Cv(),t==="clear")r.forEach(l);else{const a=_t(e),c=a&&pp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===Uu||!zo(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Uu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Ql)),lc(e)&&l(r.get(G0)));break;case"delete":a||(l(r.get(Ql)),lc(e)&&l(r.get(G0)));break;case"set":lc(e)&&l(r.get(Ql));break}}Av()}function G8(e,t){const n=lh.get(e);return n&&n.get(t)}function Fa(e){const t=Xt(e);return t===e?t:(zs(t,"iterate",Uu),Oo(e)?t:t.map(Si))}function xp(e){return zs(e=Xt(e),"iterate",Uu),e}function Hi(e,t){return br(e)?xc(nl(e)?Si(t):t):Si(t)}const Y8={__proto__:null,[Symbol.iterator](){return p1(this,Symbol.iterator,e=>Hi(this,e))},concat(...e){return Fa(this).concat(...e.map(t=>_t(t)?Fa(t):t))},entries(){return p1(this,"entries",e=>(e[1]=Hi(this,e[1]),e))},every(e,t){return Xi(this,"every",e,t,void 0,arguments)},filter(e,t){return Xi(this,"filter",e,t,n=>n.map(s=>Hi(this,s)),arguments)},find(e,t){return Xi(this,"find",e,t,n=>Hi(this,n),arguments)},findIndex(e,t){return Xi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Xi(this,"findLast",e,t,n=>Hi(this,n),arguments)},findLastIndex(e,t){return Xi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Xi(this,"forEach",e,t,void 0,arguments)},includes(...e){return m1(this,"includes",e)},indexOf(...e){return m1(this,"indexOf",e)},join(e){return Fa(this).join(e)},lastIndexOf(...e){return m1(this,"lastIndexOf",e)},map(e,t){return Xi(this,"map",e,t,void 0,arguments)},pop(){return su(this,"pop")},push(...e){return su(this,"push",e)},reduce(e,...t){return X2(this,"reduce",e,t)},reduceRight(e,...t){return X2(this,"reduceRight",e,t)},shift(){return su(this,"shift")},some(e,t){return Xi(this,"some",e,t,void 0,arguments)},splice(...e){return su(this,"splice",e)},toReversed(){return Fa(this).toReversed()},toSorted(e){return Fa(this).toSorted(e)},toSpliced(...e){return Fa(this).toSpliced(...e)},unshift(...e){return su(this,"unshift",e)},values(){return p1(this,"values",e=>Hi(this,e))}};function p1(e,t,n){const s=xp(e),o=s[t]();return s!==e&&!Oo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const Z8=Array.prototype;function Xi(e,t,n,s,o,i){const r=xp(e),l=r!==e&&!Oo(e),a=r[t];if(a!==Z8[t]){const d=a.apply(e,i);return l?Si(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Hi(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function X2(e,t,n,s){const o=xp(e),i=o!==e&&!Oo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Hi(e,c)),n.call(this,c,Hi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Hi(e,a):a}function m1(e,t,n){const s=Xt(e);zs(s,"iterate",Uu);const o=s[t](...n);return(o===-1||o===!1)&&Sp(n[0])?(n[0]=Xt(n[0]),s[t](...n)):o}function su(e,t,n=[]){yr(),Cv();const s=Xt(e)[t].apply(e,n);return Av(),kr(),s}const Q8=dp("__proto__,__v_isRef,__isVue"),HC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zo));function X8(e){zo(e)||(e=String(e));const t=Xt(this);return zs(t,"has",e),t.hasOwnProperty(e)}class WC{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?KC:VC:i?qC:jC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=_t(t);if(!o){let a;if(r&&(a=Y8[n]))return a;if(n==="hasOwnProperty")return X8}const l=Reflect.get(t,n,Jn(t)?t:s);if((zo(n)?HC.has(n):Q8(n))||(o||zs(t,"get",n),i))return l;if(Jn(l)){const a=r&&pp(n)?l:l.value;return o&&rn(a)?ah(a):a}return rn(l)?o?ah(l):Ss(l):l}}class zC extends WC{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=_t(t)&&pp(n);if(!this._isShallow){const c=br(i);if(!Oo(s)&&!br(s)&&(i=Xt(i),s=Xt(s)),!r&&Jn(i)&&!Jn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:on(t,n),a=Reflect.set(t,n,s,Jn(t)?t:o);return t===Xt(o)&&(l?Is(s,i)&&cr(t,"set",n,s):cr(t,"add",n,s)),a}deleteProperty(t,n){const s=on(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&cr(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!zo(n)||!HC.has(n))&&zs(t,"has",n),s}ownKeys(t){return zs(t,"iterate",_t(t)?"length":Ql),Reflect.ownKeys(t)}}class UC extends WC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const J8=new zC,eE=new UC,tE=new zC(!0),nE=new UC(!0),Y0=e=>e,nf=e=>Reflect.getPrototypeOf(e);function sE(e,t,n){return function(...s){const o=this.__v_raw,i=Xt(o),r=lc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Y0:t?xc:Si;return!t&&zs(i,"iterate",a?G0:Ql),mn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function sf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function oE(e,t){const n={get(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);e||(Is(o,l)&&zs(r,"get",o),zs(r,"get",l));const{has:a}=nf(r),c=t?Y0:e?xc:Si;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&zs(Xt(o),"iterate",Ql),o.size},has(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);return e||(Is(o,l)&&zs(r,"has",o),zs(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Xt(l),c=t?Y0:e?xc:Si;return!e&&zs(a,"iterate",Ql),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return mn(n,e?{add:sf("add"),set:sf("set"),delete:sf("delete"),clear:sf("clear")}:{add(o){const i=Xt(this),r=nf(i),l=Xt(o),a=!t&&!Oo(o)&&!br(o)?l:o;return r.has.call(i,a)||Is(o,a)&&r.has.call(i,o)||Is(l,a)&&r.has.call(i,l)||(i.add(a),cr(i,"add",a,a)),this},set(o,i){!t&&!Oo(i)&&!br(i)&&(i=Xt(i));const r=Xt(this),{has:l,get:a}=nf(r);let c=l.call(r,o);c||(o=Xt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Is(i,u)&&cr(r,"set",o,i):cr(r,"add",o,i),this},delete(o){const i=Xt(this),{has:r,get:l}=nf(i);let a=r.call(i,o);a||(o=Xt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&cr(i,"delete",o,void 0),c},clear(){const o=Xt(this),i=o.size!==0,r=o.clear();return i&&cr(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=sE(o,e,t)}),n}function _p(e,t){const n=oE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(on(n,o)&&o in s?n:s,o,i)}const iE={get:_p(!1,!1)},rE={get:_p(!1,!0)},lE={get:_p(!0,!1)},aE={get:_p(!0,!0)},jC=new WeakMap,qC=new WeakMap,VC=new WeakMap,KC=new WeakMap;function cE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ss(e){return br(e)?e:wp(e,!1,J8,iE,jC)}function uE(e){return wp(e,!1,tE,rE,qC)}function ah(e){return wp(e,!0,eE,lE,VC)}function z2e(e){return wp(e,!0,nE,aE,KC)}function wp(e,t,n,s,o){if(!rn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=cE($8(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function nl(e){return br(e)?nl(e.__v_raw):!!(e&&e.__v_isReactive)}function br(e){return!!(e&&e.__v_isReadonly)}function Oo(e){return!!(e&&e.__v_isShallow)}function Sp(e){return e?!!e.__v_raw:!1}function Xt(e){const t=e&&e.__v_raw;return t?Xt(t):e}function mt(e){return!on(e,"__v_skip")&&Object.isExtensible(e)&&EC(e,"__v_skip",!0),e}const Si=e=>rn(e)?Ss(e):e,xc=e=>rn(e)?ah(e):e;function Jn(e){return e?e.__v_isRef===!0:!1}function Q(e){return GC(e,!1)}function fa(e){return GC(e,!0)}function GC(e,t){return Jn(e)?e:new dE(e,t)}class dE{constructor(t,n){this.dep=new bp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Xt(t),this._value=n?t:Si(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Oo(t)||br(t);t=s?t:Xt(t),Is(t,n)&&(this._rawValue=t,this._value=s?t:Si(t),this.dep.trigger())}}function U2e(e){e.dep&&e.dep.trigger()}function C(e){return Jn(e)?e.value:e}function YC(e){return It(e)?e():C(e)}const fE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Jn(o)&&!Jn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function ZC(e){return nl(e)?e:new Proxy(e,fE)}class hE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new bp,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function pE(e){return new hE(e)}function j2e(e){const t=_t(e)?new Array(e.length):{};for(const n in e)t[n]=QC(e,n);return t}class mE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=zo(n)?n:String(n),this._raw=Xt(t);let o=!0,i=t;if(!_t(t)||zo(this._key)||!pp(this._key))do o=!Sp(i)||Oo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Jn(this._raw[this._key])){const n=this._object[this._key];if(Jn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return G8(this._raw,this._key)}}class gE{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function q2e(e,t,n){return Jn(e)?e:It(e)?new gE(e):rn(e)&&arguments.length>1?QC(e,t,n):Q(e)}function QC(e,t,n){return new mE(e,t,n)}class vE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new bp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Fn!==this)return FC(this,!0),!0}get value(){const t=this.dep.track();return BC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function yE(e,t,n=!1){let s,o;return It(e)?s=e:(s=e.get,o=e.set),new vE(s,o,n)}const V2e={GET:"get",HAS:"has",ITERATE:"iterate"},K2e={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},of={},ch=new WeakMap;let Vr;function G2e(){return Vr}function kE(e,t=!1,n=Vr){if(n){let s=ch.get(n);s||ch.set(n,s=[]),s.push(e)}}function bE(e,t,n=Gt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Oo(y)||o===!1||o===0?ur(y,1):ur(y);let u,d,f,p,h=!1,m=!1;if(Jn(e)?(d=()=>e.value,h=Oo(e)):nl(e)?(d=()=>c(e),h=!0):_t(e)?(m=!0,h=e.some(y=>nl(y)||Oo(y)),d=()=>e.map(y=>{if(Jn(y))return y.value;if(nl(y))return c(y);if(It(y))return a?a(y,2):y()})):It(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){yr();try{f()}finally{kr()}}const y=Vr;Vr=u;try{return a?a(e,3,[p]):e(p)}finally{Vr=y}}:d=li,t&&o){const y=d,A=o===!0?1/0:o;d=()=>ur(y(),A)}const _=wv(),k=()=>{u.stop(),_&&_.active&&xv(_.effects,u)};if(i&&t){const y=t;t=(...A)=>{y(...A),k()}}let g=m?new Array(e.length).fill(of):of;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const A=u.run();if(o||h||(m?A.some((L,$)=>Is(L,g[$])):Is(A,g))){f&&f();const L=Vr;Vr=u;try{const $=[A,g===of?void 0:m&&g[0]===of?[]:g,p];g=A,a?a(t,3,$):t(...$)}finally{Vr=L}}}else u.run()};return l&&l(v),u=new rh(d),u.scheduler=r?()=>r(v,!1):v,p=y=>kE(y,!1,u),f=u.onStop=()=>{const y=ch.get(u);if(y){if(a)a(y,4);else for(const A of y)A();ch.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function ur(e,t=1/0,n){if(t<=0||!rn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Jn(e))ur(e.value,t,n);else if(_t(e))for(let s=0;s<e.length;s++)ur(e[s],t,n);else if(da(e)||lc(e))e.forEach(s=>{ur(s,t,n)});else if(hp(e)){for(const s in e)ur(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&ur(e[s],t,n)}return e}/**
11
+ * @vue/runtime-core v3.5.35
12
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
+ * @license MIT
14
+ **/const XC=[];function xE(e){XC.push(e)}function _E(){XC.pop()}function Y2e(e,t){}const Z2e={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},wE={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function vd(e,t,n,s){try{return s?e(...s):e()}catch(o){$c(o,t,n)}}function ui(e,t,n,s){if(It(e)){const o=vd(e,t,n,s);return o&&_v(o)&&o.catch(i=>{$c(i,t,n)}),o}if(_t(e)){const o=[];for(let i=0;i<e.length;i++)o.push(ui(e[i],t,n,s));return o}}function $c(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Gt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){yr(),vd(i,null,10,[e,a,c]),kr();return}}SE(e,n,o,s,r)}function SE(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Js=[];let Ri=-1;const cc=[];let Kr=null,ja=0;const JC=Promise.resolve();let uh=null;function pt(e){const t=uh||JC;return e?t.then(this?e.bind(this):e):t}function CE(e){let t=Ri+1,n=Js.length;for(;t<n;){const s=t+n>>>1,o=Js[s],i=ju(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function Ev(e){if(!(e.flags&1)){const t=ju(e),n=Js[Js.length-1];!n||!(e.flags&2)&&t>=ju(n)?Js.push(e):Js.splice(CE(t),0,e),e.flags|=1,e4()}}function e4(){uh||(uh=JC.then(t4))}function dh(e){_t(e)?cc.push(...e):Kr&&e.id===-1?Kr.splice(ja+1,0,e):e.flags&1||(cc.push(e),e.flags|=1),e4()}function J2(e,t,n=Ri+1){for(;n<Js.length;n++){const s=Js[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Js.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function fh(e){if(cc.length){const t=[...new Set(cc)].sort((n,s)=>ju(n)-ju(s));if(cc.length=0,Kr){Kr.push(...t);return}for(Kr=t,ja=0;ja<Kr.length;ja++){const n=Kr[ja];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Kr=null,ja=0}}const ju=e=>e.id==null?e.flags&2?-1:1/0:e.id;function t4(e){try{for(Ri=0;Ri<Js.length;Ri++){const t=Js[Ri];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),vd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ri<Js.length;Ri++){const t=Js[Ri];t&&(t.flags&=-2)}Ri=-1,Js.length=0,fh(),uh=null,(Js.length||cc.length)&&t4()}}let qa,rf=[];function n4(e,t){var n,s;qa=e,qa?(qa.enabled=!0,rf.forEach(({event:o,args:i})=>qa.emit(o,...i)),rf=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{n4(i,t)}),setTimeout(()=>{qa||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,rf=[])},3e3)):rf=[]}let Fs=null,Cp=null;function qu(e){const t=Fs;return Fs=e,Cp=e&&e.type.__scopeId||null,t}function Q2e(e){Cp=e}function X2e(){Cp=null}const J2e=e=>Ee;function Ee(e,t=Fs,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&vh(-1);const i=qu(t);let r;try{r=e(...o)}finally{qu(i),s._d&&vh(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Tn(e,t){if(Fs===null)return e;const n=xd(Fs),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Gt]=t[o];i&&(It(i)&&(i={mounted:i,updated:i}),i.deep&&ur(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Bi(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(yr(),ui(a,n,8,[e.el,l,e,t]),kr())}}function An(e,t){if(Ls){let n=Ls.provides;const s=Ls.parent&&Ls.parent.provides;s===n&&(n=Ls.provides=Object.create(s)),n[e]=t}}function Ut(e,t,n=!1){const s=Os();if(s||Xl){let o=Xl?Xl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&It(t)?t.call(s&&s.proxy):t}}function ebe(){return!!(Os()||Xl)}const AE=Symbol.for("v-scx"),ME=()=>Ut(AE);function EE(e,t){return yd(e,null,t)}function tbe(e,t){return yd(e,null,{flush:"post"})}function TE(e,t){return yd(e,null,{flush:"sync"})}function Ke(e,t,n){return yd(e,t,n)}function yd(e,t,n=Gt){const{immediate:s,deep:o,flush:i,once:r}=n,l=mn({},n),a=t&&s||!t&&i!=="post";let c;if(ia){if(i==="sync"){const p=ME();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=li,p.resume=li,p.pause=li,p}}const u=Ls;l.call=(p,h,m)=>ui(p,u,h,m);let d=!1;i==="post"?l.scheduler=p=>{os(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():Ev(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=bE(e,t,l);return ia&&(c?c.push(f):a&&f()),f}function NE(e,t,n){const s=this.proxy,o=bn(e)?e.includes(".")?s4(s,e):()=>s[e]:e.bind(s,s);let i;It(t)?i=t:(i=t.handler,n=t);const r=Lc(this),l=yd(o,i.bind(s),n);return r(),l}function s4(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Ur=new WeakMap,o4=Symbol("_vte"),i4=e=>e.__isTeleport,zl=e=>e&&(e.disabled||e.disabled===""),IE=e=>e&&(e.defer||e.defer===""),eb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,tb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Z0=(e,t)=>{const n=e&&e.to;return bn(n)?t?t(n):null:n},$E={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:_,parentNode:k}}=c,g=zl(t.props);let{dynamicChildren:v}=t;const y=($,x,E)=>{$.shapeFlag&16&&u($.children,x,E,o,i,r,l,a)},A=($=t)=>{const x=zl($.props),E=$.target=Z0($.props,h),N=Q0(E,$,m,p);E&&(r!=="svg"&&eb(E)?r="svg":r!=="mathml"&&tb(E)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(E),x||(y($,E,N),pu($,!1)))},L=$=>{const x=()=>{if(Ur.get($)===x){if(Ur.delete($),zl($.props)){const E=k($.el)||n;y($,E,$.anchor),pu($,!0)}A($)}};Ur.set($,x),os(x,i)};if(e==null){const $=t.el=m(""),x=t.anchor=m("");if(p($,n,s),p(x,n,s),IE(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,x),pu(t,!0)),A()}else{t.el=e.el;const $=t.anchor=e.anchor,x=Ur.get(e);if(x){x.flags|=8,Ur.delete(e),L(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=zl(e.props),S=F?n:E,T=F?$:N;if(r==="svg"||eb(E)?r="svg":(r==="mathml"||tb(E))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),Pv(e,t,!0)):a||d(e,t,S,T,o,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):lf(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Z0(t.props,h);R&&lf(t,R,null,c,0)}else F&&lf(t,E,N,c,1);pu(t,g)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,p=i||!zl(f),h=Ur.get(e);if(h&&(h.flags|=8,Ur.delete(e)),d&&(o(c),o(u)),i&&o(a),!h&&r&16)for(let m=0;m<l.length;m++){const _=l[m];s(_,t,n,p,!!_.dynamicChildren)}},move:lf,hydrate:LE};function lf(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!Ur.has(e)&&(!d||zl(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function LE(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function p(_,k){k.anchor=d(r(_),k,l(_),n,s,o,i)}const h=t.target=Z0(t.props,a),m=zl(t.props);if(h){const _=h._lpa||h.firstChild;t.shapeFlag&16&&(m?(p(e,t),f(h,_),t.targetAnchor||Q0(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,_),t.targetAnchor||Q0(h,t,u,c),d(_&&r(_),t,h,n,s,o,i))),pu(t,m)}else m&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Ap=$E;function pu(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Q0(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[o4]=r,e&&(s(i,e,o),s(r,e,o)),r}const ti=Symbol("_leaveCb"),ou=Symbol("_enterCb");function r4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ln(()=>{e.isMounted=!0}),es(()=>{e.isUnmounting=!0}),e}const Zo=[Function,Array],l4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Zo,onEnter:Zo,onAfterEnter:Zo,onEnterCancelled:Zo,onBeforeLeave:Zo,onLeave:Zo,onAfterLeave:Zo,onLeaveCancelled:Zo,onBeforeAppear:Zo,onAppear:Zo,onAfterAppear:Zo,onAppearCancelled:Zo},a4=e=>{const t=e.subTree;return t.component?a4(t.component):t},FE={name:"BaseTransition",props:l4,setup(e,{slots:t}){const n=Os(),s=r4();return()=>{const o=t.default&&Tv(t.default(),!0),i=o&&o.length?c4(o):n.subTree?le():void 0;if(!i)return;const r=Xt(e),{mode:l}=r;if(s.isLeaving)return g1(i);const a=nb(i);if(!a)return g1(i);let c=Vu(a,r,s,n,d=>c=d);a.type!==rs&&ll(a,c);let u=n.subTree&&nb(n.subTree);if(u&&u.type!==rs&&!yi(u,a)&&a4(n).type!==rs){let d=Vu(u,r,s,n);if(ll(u,d),l==="out-in"&&a.type!==rs)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},g1(i);l==="in-out"&&a.type!==rs?d.delayLeave=(f,p,h)=>{const m=u4(s,u);m[String(u.key)]=u,f[ti]=()=>{p(),f[ti]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function c4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==rs){t=n;break}}return t}const OE=FE;function u4(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Vu(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:_,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),A=u4(n,e),L=(E,N)=>{E&&ui(E,s,9,N)},$=(E,N)=>{const F=N[1];L(E,N),_t(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(E){let N=a;if(!n.isMounted)if(i)N=_||a;else return;E[ti]&&E[ti](!0);const F=A[y];F&&yi(e,F)&&F.el[ti]&&F.el[ti](),L(N,[E])},enter(E){if(A[y]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=k||c,F=g||u,S=v||d;else return;let T=!1;E[ou]=O=>{T||(T=!0,O?L(S,[E]):L(F,[E]),x.delayedLeave&&x.delayedLeave(),E[ou]=void 0)};const R=E[ou].bind(null,!1);N?$(N,[E,R]):R()},leave(E,N){const F=String(e.key);if(E[ou]&&E[ou](!0),n.isUnmounting)return N();L(f,[E]);let S=!1;E[ti]=R=>{S||(S=!0,N(),R?L(m,[E]):L(h,[E]),E[ti]=void 0,A[F]===e&&delete A[F])};const T=E[ti].bind(null,!1);A[F]=e,p?$(p,[E,T]):T()},clone(E){const N=Vu(E,t,n,s,o);return o&&o(N),N}};return x}function g1(e){if(kd(e))return e=xr(e),e.children=null,e}function nb(e){if(!kd(e))return i4(e.type)&&e.children?c4(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&It(n.default))return n.default()}}function ll(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ll(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Tv(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Be?(r.patchFlag&128&&o++,s=s.concat(Tv(r.children,t,l))):(t||r.type!==rs)&&s.push(l!=null?xr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function qe(e,t){return It(e)?mn({name:e.name},t,{setup:e}):e}function nbe(){const e=Os();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Nv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function sbe(e){const t=Os(),n=fa(null);if(t){const o=t.refs===Gt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function sb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const hh=new WeakMap;function uc(e,t,n,s,o=!1){if(_t(e)){e.forEach((m,_)=>uc(m,t&&(_t(t)?t[_]:t),n,s,o));return}if(mr(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&uc(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?xd(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Gt?l.refs={}:l.refs,d=l.setupState,f=Xt(d),p=d===Gt?AC:m=>sb(u,m)?!1:on(f,m),h=(m,_)=>!(_&&sb(u,_));if(c!=null&&c!==a){if(ob(t),bn(c))u[c]=null,p(c)&&(d[c]=null);else if(Jn(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(It(a))vd(a,l,12,[r,u]);else{const m=bn(a),_=Jn(a);if(m||_){const k=()=>{if(e.f){const g=m?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(o)_t(g)&&xv(g,i);else if(_t(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],p(a)&&(d[a]=u[a]);else{const v=[i];h(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,p(a)&&(d[a]=r)):_&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),hh.delete(e)};g.id=-1,hh.set(e,g),os(g,n)}else ob(e),k()}}}function ob(e){const t=hh.get(e);t&&(t.flags|=8,hh.delete(e))}let ib=!1;const Oa=()=>{ib||(console.error("Hydration completed but contains mismatches."),ib=!0)},RE=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",BE=e=>e.namespaceURI.includes("MathML"),af=e=>{if(e.nodeType===1){if(RE(e))return"svg";if(BE(e))return"mathml"}},Ja=e=>e.nodeType===8;function DE(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),fh(),y._vnode=v;return}d(y.firstChild,v,null,null,null),fh(),y._vnode=v},d=(v,y,A,L,$,x=!1)=>{x=x||!!y.dynamicChildren;const E=Ja(v)&&v.data==="[",N=()=>m(v,y,A,L,$,E),{type:F,ref:S,shapeFlag:T,patchFlag:R}=y;let O=v.nodeType;y.el=v,R===-2&&(x=!1,y.dynamicChildren=null);let D=null;switch(F){case sl:O!==3?y.children===""?(a(y.el=o(""),r(v),v),D=v):D=N():(v.data!==y.children&&(Oa(),v.data=y.children),D=i(v));break;case rs:g(v)?(D=i(v),k(y.el=v.content.firstChild,v,A)):O!==8||E?D=N():D=i(v);break;case fc:if(E&&(v=i(v),O=v.nodeType),O===1||O===3){D=v;const W=!y.children.length;for(let z=0;z<y.staticCount;z++)W&&(y.children+=D.nodeType===1?D.outerHTML:D.data),z===y.staticCount-1&&(y.anchor=D),D=i(D);return E?i(D):D}else N();break;case Be:E?D=h(v,y,A,L,$,x):D=N();break;default:if(T&1)(O!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?D=N():D=f(v,y,A,L,$,x);else if(T&6){y.slotScopeIds=$;const W=r(v);if(E?D=_(v):Ja(v)&&v.data==="teleport start"?D=_(v,v.data,"teleport end"):D=i(v),t(y,W,null,A,L,af(W),x),mr(y)&&!y.type.__asyncResolved){let z;E?(z=ie(Be),z.anchor=D?D.previousSibling:W.lastChild):z=v.nodeType===3?Ge(""):ie("div"),z.el=v,y.component.subTree=z}}else T&64?O!==8?D=N():D=y.type.hydrate(v,y,A,L,$,x,e,p):T&128&&(D=y.type.hydrate(v,y,A,L,af(r(v)),$,x,e,d))}return S!=null&&uc(S,null,L,y),D},f=(v,y,A,L,$,x)=>{x=x||!!y.dynamicChildren;const{type:E,props:N,patchFlag:F,shapeFlag:S,dirs:T,transition:R}=y,O=E==="input"||E==="option";if(O||F!==-1){T&&Bi(y,null,A,"created");let D=!1;if(g(v)){D=T4(null,R)&&A&&A.vnode.props&&A.vnode.props.appear;const z=v.content.firstChild;if(D){const V=z.getAttribute("class");V&&(z.$cls=V),R.beforeEnter(z)}k(z,v,A),y.el=v=z}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let z=p(v.firstChild,y,v,A,L,$,x);for(z&&!cf(v,1)&&Oa();z;){const V=z;z=z.nextSibling,l(V)}}else if(S&8){let z=y.children;z[0]===`
15
+ `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(z=z.slice(1));const{textContent:V}=v;V!==z&&V!==z.replace(/\r\n|\r/g,`
16
+ `)&&(cf(v,0)||Oa(),v.textContent=y.children)}if(N){if(O||!x||F&48){const z=v.tagName.includes("-");for(const V in N)(O&&(V.endsWith("value")||V==="indeterminate")||gd(V)&&!Zl(V)||V[0]==="."||z&&!Zl(V))&&s(v,V,null,N[V],void 0,A)}else if(N.onClick)s(v,"onClick",null,N.onClick,void 0,A);else if(F&4&&nl(N.style))for(const z in N.style)N.style[z]}let W;(W=N&&N.onVnodeBeforeMount)&&ho(W,A,y),T&&Bi(y,null,A,"beforeMount"),((W=N&&N.onVnodeMounted)||T||D)&&L4(()=>{W&&ho(W,A,y),D&&R.enter(v),T&&Bi(y,null,A,"mounted")},L)}return v.nextSibling},p=(v,y,A,L,$,x,E)=>{E=E||!!y.dynamicChildren;const N=y.children,F=N.length;let S=!1;for(let T=0;T<F;T++){const R=E?N[T]:N[T]=mo(N[T]),O=R.type===sl;v?(O&&!E&&T+1<F&&mo(N[T+1]).type===sl&&(a(o(v.data.slice(R.children.length)),A,i(v)),v.data=R.children),v=d(v,R,L,$,x,E)):O&&!R.children?a(R.el=o(""),A):(S||(S=!0,cf(A,1)||Oa()),n(null,R,A,null,L,$,af(A),x))}return v},h=(v,y,A,L,$,x)=>{const{slotScopeIds:E}=y;E&&($=$?$.concat(E):E);const N=r(v),F=p(i(v),y,N,A,L,$,x);return F&&Ja(F)&&F.data==="]"?i(y.anchor=F):(Oa(),a(y.anchor=c("]"),N,F),F)},m=(v,y,A,L,$,x)=>{if(cf(v.parentElement,1)||Oa(),y.el=null,x){const F=_(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const E=i(v),N=r(v);return l(v),n(null,y,N,E,A,L,af(N),$),A&&(A.vnode.el=y.el,Tp(A,y.el)),E},_=(v,y="[",A="]")=>{let L=0;for(;v;)if(v=i(v),v&&Ja(v)&&(v.data===y&&L++,v.data===A)){if(L===0)return i(v);L--}return v},k=(v,y,A)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=A;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const rb="data-allow-mismatch",PE={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function cf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(rb);)e=e.parentElement;const n=e&&e.getAttribute(rb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(PE[t])}}const HE=yp().requestIdleCallback||(e=>setTimeout(e,1)),WE=yp().cancelIdleCallback||(e=>clearTimeout(e)),obe=(e=1e4)=>t=>{const n=HE(t,{timeout:e});return()=>WE(n)};function zE(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const ibe=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(zE(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},rbe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},lbe=(e=[])=>(t,n)=>{bn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function UE(e,t){if(Ja(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Ja(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const mr=e=>!!e.type.__asyncLoader;function ki(e){It(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,p()),p=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,k)=>{a(m,()=>_(f()),()=>k(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return qe({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,_){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||_()},v=i?()=>{const y=i(g,A=>UE(h,A));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():p().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const h=Ls;if(Nv(h),u)return()=>uf(u,h);const m=v=>{c=null,$c(v,h,13,!s)};if(l&&h.suspense||ia)return p().then(v=>()=>uf(v,h)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const _=Q(!1),k=Q(),g=Q(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!_.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),p().then(()=>{_.value=!0,h.parent&&kd(h.parent.vnode)&&h.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(_.value&&u)return uf(u,h);if(k.value&&s)return ie(s,{error:k.value});if(n&&!g.value)return uf(n,h)}}})}function uf(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ie(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const kd=e=>e.type.__isKeepAlive,jE={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Os(),s=n.ctx;if(!s.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(g,v,y,A,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,A,g.slotScopeIds,L),os(()=>{$.isDeactivated=!1,$.a&&ac($.a);const x=g.props&&g.props.onVnodeMounted;x&&ho(x,$.parent,g)},l)},s.deactivate=g=>{const v=g.component;mh(v.m),mh(v.a),c(g,f,null,1,l),os(()=>{v.da&&ac(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&ho(y,v.parent,g),v.isDeactivated=!0},l)};function p(g){v1(g),u(g,n,l,!0)}function h(g){o.forEach((v,y)=>{const A=rg(mr(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!yi(v,r))?p(v):r&&v1(r),o.delete(g),i.delete(g)}Ke(()=>[e.include,e.exclude],([g,v])=>{g&&h(y=>mu(g,y)),v&&h(y=>!mu(v,y))},{flush:"post",deep:!0});let _=null;const k=()=>{_!=null&&(gh(n.subTree.type)?os(()=>{o.set(_,df(n.subTree))},n.subTree.suspense):o.set(_,df(n.subTree)))};return ln(k),Iv(k),es(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,A=df(v);if(g.type===A.type&&g.key===A.key){v1(A);const L=A.component.da;L&&os(L,y);return}p(g)})}),()=>{if(_=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!al(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=df(v);if(y.type===rs)return r=null,y;const A=y.type,L=rg(mr(y)?y.type.__asyncResolved||{}:A),{include:$,exclude:x,max:E}=e;if($&&(!L||!mu($,L))||x&&L&&mu(x,L))return y.shapeFlag&=-257,r=y,v;const N=y.key==null?A:y.key,F=o.get(N);return y.el&&(y=xr(y),v.shapeFlag&128&&(v.ssContent=y)),_=N,F?(y.el=F.el,y.component=F.component,y.transition&&ll(y,y.transition),y.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,gh(v.type)?v:y}}},abe=jE;function mu(e,t){return _t(e)?e.some(n=>mu(n,t)):bn(e)?e.split(",").includes(t):I8(e)?(e.lastIndex=0,e.test(t)):!1}function qE(e,t){d4(e,"a",t)}function VE(e,t){d4(e,"da",t)}function d4(e,t,n=Ls){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Mp(t,s,n),n){let o=n.parent;for(;o&&o.parent;)kd(o.parent.vnode)&&KE(s,t,n,o),o=o.parent}}function KE(e,t,n,s){const o=Mp(t,e,s,!0);fn(()=>{xv(s[t],o)},n)}function v1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function df(e){return e.shapeFlag&128?e.ssContent:e}function Mp(e,t,n=Ls,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{yr();const l=Lc(n),a=ui(t,n,e,r);return l(),kr(),a});return s?o.unshift(i):o.push(i),i}}const wr=e=>(t,n=Ls)=>{(!ia||e==="sp")&&Mp(e,(...s)=>t(...s),n)},GE=wr("bm"),ln=wr("m"),f4=wr("bu"),Iv=wr("u"),es=wr("bum"),fn=wr("um"),YE=wr("sp"),ZE=wr("rtg"),QE=wr("rtc");function XE(e,t=Ls){Mp("ec",e,t)}const $v="components",JE="directives";function eT(e,t){return Lv($v,e,!0,t)||e}const h4=Symbol.for("v-ndc");function $s(e){return bn(e)?Lv($v,e,!1)||e:e||h4}function cbe(e){return Lv(JE,e)}function Lv(e,t,n=!0,s=!1){const o=Fs||Ls;if(o){const i=o.type;if(e===$v){const l=rg(i,!1);if(l&&(l===t||l===vs(t)||l===gp(vs(t))))return i}const r=lb(o[e]||i[e],t)||lb(o.appContext[e],t);return!r&&s?i:r}}function lb(e,t){return e&&(e[t]||e[vs(t)]||e[gp(vs(t))])}function nt(e,t,n,s){let o;const i=n&&n[s],r=_t(e);if(r||bn(e)){const l=r&&nl(e);let a=!1,c=!1;l&&(a=!Oo(e),c=br(e),e=xp(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?xc(Si(e[u])):Si(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(rn(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function Fv(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(_t(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function In(e,t,n={},s,o){if(Fs.ce||Fs.parent&&mr(Fs.parent)&&Fs.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),ye(Be,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),b();const r=i&&Ov(i(n)),l=n.key||r&&r.key,a=ye(Be,{key:(l&&!zo(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function Ov(e){return e.some(t=>al(t)?!(t.type===rs||t.type===Be&&!Ov(t.children)):!0)?e:null}function ube(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:Df(s)]=e[s];return n}const X0=e=>e?D4(e)?xd(e):X0(e.parent):null,Su=mn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>X0(e.parent),$root:e=>X0(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Rv(e),$forceUpdate:e=>e.f||(e.f=()=>{Ev(e.update)}),$nextTick:e=>e.n||(e.n=pt.bind(e.proxy)),$watch:e=>NE.bind(e)}),y1=(e,t)=>e!==Gt&&!e.__isScriptSetup&&on(e,t),J0={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(y1(s,t))return r[t]=1,s[t];if(o!==Gt&&on(o,t))return r[t]=2,o[t];if(on(i,t))return r[t]=3,i[t];if(n!==Gt&&on(n,t))return r[t]=4,n[t];eg&&(r[t]=0)}}const c=Su[t];let u,d;if(c)return t==="$attrs"&&zs(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Gt&&on(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,on(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return y1(o,t)?(o[t]=n,!0):s!==Gt&&on(s,t)?(s[t]=n,!0):on(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Gt&&l[0]!=="$"&&on(e,l)||y1(t,l)||on(i,l)||on(s,l)||on(Su,l)||on(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:on(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},tT=mn({},J0,{get(e,t){if(t!==Symbol.unscopables)return J0.get(e,t,e)},has(e,t){return t[0]!=="_"&&!R8(t)}});function dbe(){return null}function fbe(){return null}function hbe(e){}function pbe(e){}function mbe(){return null}function gbe(){}function vbe(e,t){return null}function ybe(){return p4().slots}function bd(){return p4().attrs}function p4(e){const t=Os();return t.setupContext||(t.setupContext=W4(t))}function Ku(e){return _t(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function kbe(e,t){const n=Ku(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?_t(o)||It(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function bbe(e,t){return!e||!t?e||t:_t(e)&&_t(t)?e.concat(t):mn({},Ku(e),Ku(t))}function xbe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function _be(e){const t=Os(),n=ia;let s=e();Yu(),n&&hc(!1);const o=()=>{Lc(t),n&&hc(!0)},i=()=>{Os()!==t&&t.scope.off(),Yu(),n&&hc(!1)};return _v(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let eg=!0;function nT(e){const t=Rv(e),n=e.proxy,s=e.ctx;eg=!1,t.beforeCreate&&ab(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:_,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:A,renderTracked:L,renderTriggered:$,errorCaptured:x,serverPrefetch:E,expose:N,inheritAttrs:F,components:S,directives:T,filters:R}=t;if(c&&sT(c,s,null),r)for(const W in r){const z=r[W];It(z)&&(s[W]=z.bind(n))}if(o){const W=o.call(n,n);rn(W)&&(e.data=Ss(W))}if(eg=!0,i)for(const W in i){const z=i[W],V=It(z)?z.bind(n,n):It(z.get)?z.get.bind(n,n):li,U=!It(z)&&It(z.set)?z.set.bind(n):li,re=P({get:V,set:U});Object.defineProperty(s,W,{enumerable:!0,configurable:!0,get:()=>re.value,set:ae=>re.value=ae})}if(l)for(const W in l)m4(l[W],s,n,W);if(a){const W=It(a)?a.call(n):a;Reflect.ownKeys(W).forEach(z=>{An(z,W[z])})}u&&ab(u,e,"c");function D(W,z){_t(z)?z.forEach(V=>W(V.bind(n))):z&&W(z.bind(n))}if(D(GE,d),D(ln,f),D(f4,p),D(Iv,h),D(qE,m),D(VE,_),D(XE,x),D(QE,L),D(ZE,$),D(es,g),D(fn,y),D(YE,E),_t(N))if(N.length){const W=e.exposed||(e.exposed={});N.forEach(z=>{Object.defineProperty(W,z,{get:()=>n[z],set:V=>n[z]=V,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===li&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),T&&(e.directives=T),E&&Nv(e)}function sT(e,t,n=li){_t(e)&&(e=tg(e));for(const s in e){const o=e[s];let i;rn(o)?"default"in o?i=Ut(o.from||s,o.default,!0):i=Ut(o.from||s):i=Ut(o),Jn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function ab(e,t,n){ui(_t(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function m4(e,t,n,s){let o=s.includes(".")?s4(n,s):()=>n[s];if(bn(e)){const i=t[e];It(i)&&Ke(o,i)}else if(It(e))Ke(o,e.bind(n));else if(rn(e))if(_t(e))e.forEach(i=>m4(i,t,n,s));else{const i=It(e.handler)?e.handler.bind(n):t[e.handler];It(i)&&Ke(o,i,e)}}function Rv(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>ph(a,c,r,!0)),ph(a,t,r)),rn(t)&&i.set(t,a),a}function ph(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&ph(e,i,n,!0),o&&o.forEach(r=>ph(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=oT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const oT={data:cb,props:ub,emits:ub,methods:gu,computed:gu,beforeCreate:Ys,created:Ys,beforeMount:Ys,mounted:Ys,beforeUpdate:Ys,updated:Ys,beforeDestroy:Ys,beforeUnmount:Ys,destroyed:Ys,unmounted:Ys,activated:Ys,deactivated:Ys,errorCaptured:Ys,serverPrefetch:Ys,components:gu,directives:gu,watch:rT,provide:cb,inject:iT};function cb(e,t){return t?e?function(){return mn(It(e)?e.call(this,this):e,It(t)?t.call(this,this):t)}:t:e}function iT(e,t){return gu(tg(e),tg(t))}function tg(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ys(e,t){return e?[...new Set([].concat(e,t))]:t}function gu(e,t){return e?mn(Object.create(null),e,t):t}function ub(e,t){return e?_t(e)&&_t(t)?[...new Set([...e,...t])]:mn(Object.create(null),Ku(e),Ku(t??{})):t}function rT(e,t){if(!e)return t;if(!t)return e;const n=mn(Object.create(null),e);for(const s in t)n[s]=Ys(e[s],t[s]);return n}function g4(){return{app:null,config:{isNativeTag:AC,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let lT=0;function aT(e,t){return function(s,o=null){It(s)||(s=mn({},s)),o!=null&&!rn(o)&&(o=null);const i=g4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:lT++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:DT,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&It(u.install)?(r.add(u),u.install(c,...d)):It(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const p=c._ceVNode||ie(s,o);return p.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(p,u):e(p,u,f),a=!0,c._container=u,u.__vue_app__=c,xd(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(ui(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=Xl;Xl=c;try{return u()}finally{Xl=d}}};return c}}let Xl=null;function wbe(e,t,n=Gt){const s=Os(),o=vs(t),i=go(t),r=v4(e,o),l=pE((a,c)=>{let u,d=Gt,f;return TE(()=>{const p=e[o];Is(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Is(h,u)&&!(d!==Gt&&Is(p,d)))return;const m=s.vnode.props;m&&(t in m||o in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${i}`in m)||(u=p,c()),s.emit(`update:${t}`,h),Is(p,h)&&Is(p,d)&&!Is(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Gt:l,done:!1}:{done:!0}}}},l}const v4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${vs(t)}Modifiers`]||e[`${go(t)}Modifiers`];function cT(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Gt;let o=n;const i=t.startsWith("update:"),r=i&&v4(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>bn(u)?u.trim():u)),r.number&&(o=n.map(vp)));let l,a=s[l=Df(t)]||s[l=Df(vs(t))];!a&&i&&(a=s[l=Df(go(t))]),a&&ui(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ui(c,e,6,o)}}const uT=new WeakMap;function y4(e,t,n=!1){const s=n?uT:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!It(e)){const a=c=>{const u=y4(c,t,!0);u&&(l=!0,mn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(rn(e)&&s.set(e,null),null):(_t(i)?i.forEach(a=>r[a]=null):mn(r,i),rn(e)&&s.set(e,r),r)}function Ep(e,t){return!e||!gd(t)?!1:(t=t.slice(2).replace(/Once$/,""),on(e,t[0].toLowerCase()+t.slice(1))||on(e,go(t))||on(e,t))}function Pf(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:p,ctx:h,inheritAttrs:m}=e,_=qu(e);let k,g;try{if(n.shapeFlag&4){const y=o||s,A=y;k=mo(c.call(A,y,u,d,p,f,h)),g=l}else{const y=t;k=mo(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:fT(l)}}catch(y){Cu.length=0,$c(y,e,1),k=ie(rs)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:A}=v;y.length&&A&7&&(i&&y.some(fp)&&(g=hT(g,i)),v=xr(v,g,!1,!0))}return n.dirs&&(v=xr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&ll(v,n.transition),k=v,qu(_),k}function dT(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(al(o)){if(o.type!==rs||o.children==="v-if"){if(n)return;n=o}}else return}return n}const fT=e=>{let t;for(const n in e)(n==="class"||n==="style"||gd(n))&&((t||(t={}))[n]=e[n]);return t},hT=(e,t)=>{const n={};for(const s in e)(!fp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function pT(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?db(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(k4(r,s,f)&&!Ep(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?db(s,r,c):!0:!!r;return!1}function db(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(k4(t,e,i)&&!Ep(n,i))return!0}return!1}function k4(e,t,n){const s=e[n],o=t[n];return n==="style"&&rn(s)&&rn(o)?!vr(s,o):s!==o}function Tp({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const b4={},x4=()=>Object.create(b4),_4=e=>Object.getPrototypeOf(e)===b4;function mT(e,t,n,s=!1){const o={},i=x4();e.propsDefaults=Object.create(null),w4(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:uE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function gT(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Xt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(Ep(e.emitsOptions,f))continue;const p=t[f];if(a)if(on(i,f))p!==i[f]&&(i[f]=p,c=!0);else{const h=vs(f);o[h]=ng(a,l,h,p,e,!1)}else p!==i[f]&&(i[f]=p,c=!0)}}}else{w4(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!on(t,d)&&((u=go(d))===d||!on(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=ng(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!on(t,d))&&(delete i[d],c=!0)}c&&cr(e.attrs,"set","")}function w4(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Zl(a))continue;const c=t[a];let u;o&&on(o,u=vs(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:Ep(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Xt(n),c=l||Gt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=ng(o,a,d,c[d],e,!on(c,d))}}return r}function ng(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=on(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&It(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Lc(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===go(n))&&(s=!0))}return s}const vT=new WeakMap;function S4(e,t,n=!1){const s=n?vT:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!It(e)){const u=d=>{a=!0;const[f,p]=S4(d,t,!0);mn(r,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return rn(e)&&s.set(e,rc),rc;if(_t(i))for(let u=0;u<i.length;u++){const d=vs(i[u]);fb(d)&&(r[d]=Gt)}else if(i)for(const u in i){const d=vs(u);if(fb(d)){const f=i[u],p=r[d]=_t(f)||It(f)?{type:f}:mn({},f),h=p.type;let m=!1,_=!0;if(_t(h))for(let k=0;k<h.length;++k){const g=h[k],v=It(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(_=!1)}else m=It(h)&&h.name==="Boolean";p[0]=m,p[1]=_,(m||on(p,"default"))&&l.push(d)}}const c=[r,l];return rn(e)&&s.set(e,c),c}function fb(e){return e[0]!=="$"&&!Zl(e)}const Bv=e=>e==="_"||e==="_ctx"||e==="$stable",Dv=e=>_t(e)?e.map(mo):[mo(e)],yT=(e,t,n)=>{if(t._n)return t;const s=Ee((...o)=>Dv(t(...o)),n);return s._c=!1,s},C4=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Bv(o))continue;const i=e[o];if(It(i))t[o]=yT(o,i,s);else if(i!=null){const r=Dv(i);t[o]=()=>r}}},A4=(e,t)=>{const n=Dv(t);e.slots.default=()=>n},M4=(e,t,n)=>{for(const s in t)(n||!Bv(s))&&(e[s]=t[s])},kT=(e,t,n)=>{const s=e.slots=x4();if(e.vnode.shapeFlag&32){const o=t._;o?(M4(s,t,n),n&&EC(s,"_",o,!0)):C4(t,s)}else t&&A4(e,t)},bT=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Gt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:M4(o,t,n):(i=!t.$stable,C4(t,o)),r=t}else t&&(A4(e,t),r={default:1});if(i)for(const l in o)!Bv(l)&&r[l]==null&&delete o[l]},os=L4;function xT(e){return E4(e)}function _T(e){return E4(e,DE)}function E4(e,t){const n=yp();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=li,insertStaticContent:h}=e,m=(j,se,ge,ue=null,pe=null,q=null,J=void 0,he=null,Te=!!se.dynamicChildren)=>{if(j===se)return;j&&!yi(j,se)&&(ue=Se(j),ae(j,pe,q,!0),j=null),se.patchFlag===-2&&(Te=!1,se.dynamicChildren=null);const{type:Ie,ref:Oe,shapeFlag:de}=se;switch(Ie){case sl:_(j,se,ge,ue);break;case rs:k(j,se,ge,ue);break;case fc:j==null&&g(se,ge,ue,J);break;case Be:S(j,se,ge,ue,pe,q,J,he,Te);break;default:de&1?A(j,se,ge,ue,pe,q,J,he,Te):de&6?T(j,se,ge,ue,pe,q,J,he,Te):(de&64||de&128)&&Ie.process(j,se,ge,ue,pe,q,J,he,Te,Y)}Oe!=null&&pe?uc(Oe,j&&j.ref,q,se||j,!se):Oe==null&&j&&j.ref!=null&&uc(j.ref,null,q,j,!0)},_=(j,se,ge,ue)=>{if(j==null)s(se.el=l(se.children),ge,ue);else{const pe=se.el=j.el;se.children!==j.children&&c(pe,se.children)}},k=(j,se,ge,ue)=>{j==null?s(se.el=a(se.children||""),ge,ue):se.el=j.el},g=(j,se,ge,ue)=>{[j.el,j.anchor]=h(j.children,se,ge,ue,j.el,j.anchor)},v=({el:j,anchor:se},ge,ue)=>{let pe;for(;j&&j!==se;)pe=f(j),s(j,ge,ue),j=pe;s(se,ge,ue)},y=({el:j,anchor:se})=>{let ge;for(;j&&j!==se;)ge=f(j),o(j),j=ge;o(se)},A=(j,se,ge,ue,pe,q,J,he,Te)=>{if(se.type==="svg"?J="svg":se.type==="math"&&(J="mathml"),j==null)L(se,ge,ue,pe,q,J,he,Te);else{const Ie=j.el&&j.el._isVueCE?j.el:null;try{Ie&&Ie._beginPatch(),E(j,se,pe,q,J,he,Te)}finally{Ie&&Ie._endPatch()}}},L=(j,se,ge,ue,pe,q,J,he)=>{let Te,Ie;const{props:Oe,shapeFlag:de,transition:$e,dirs:Qe}=j;if(Te=j.el=r(j.type,q,Oe&&Oe.is,Oe),de&8?u(Te,j.children):de&16&&x(j.children,Te,null,ue,pe,k1(j,q),J,he),Qe&&Bi(j,null,ue,"created"),$(Te,j,j.scopeId,J,ue),Oe){for(const vt in Oe)vt!=="value"&&!Zl(vt)&&i(Te,vt,null,Oe[vt],q,ue);"value"in Oe&&i(Te,"value",null,Oe.value,q),(Ie=Oe.onVnodeBeforeMount)&&ho(Ie,ue,j)}Qe&&Bi(j,null,ue,"beforeMount");const tt=T4(pe,$e);tt&&$e.beforeEnter(Te),s(Te,se,ge),((Ie=Oe&&Oe.onVnodeMounted)||tt||Qe)&&os(()=>{try{Ie&&ho(Ie,ue,j),tt&&$e.enter(Te),Qe&&Bi(j,null,ue,"mounted")}finally{}},pe)},$=(j,se,ge,ue,pe)=>{if(ge&&p(j,ge),ue)for(let q=0;q<ue.length;q++)p(j,ue[q]);if(pe){let q=pe.subTree;if(se===q||gh(q.type)&&(q.ssContent===se||q.ssFallback===se)){const J=pe.vnode;$(j,J,J.scopeId,J.slotScopeIds,pe.parent)}}},x=(j,se,ge,ue,pe,q,J,he,Te=0)=>{for(let Ie=Te;Ie<j.length;Ie++){const Oe=j[Ie]=he?lr(j[Ie]):mo(j[Ie]);m(null,Oe,se,ge,ue,pe,q,J,he)}},E=(j,se,ge,ue,pe,q,J)=>{const he=se.el=j.el;let{patchFlag:Te,dynamicChildren:Ie,dirs:Oe}=se;Te|=j.patchFlag&16;const de=j.props||Gt,$e=se.props||Gt;let Qe;if(ge&&Fl(ge,!1),(Qe=$e.onVnodeBeforeUpdate)&&ho(Qe,ge,se,j),Oe&&Bi(se,j,ge,"beforeUpdate"),ge&&Fl(ge,!0),(de.innerHTML&&$e.innerHTML==null||de.textContent&&$e.textContent==null)&&u(he,""),Ie?N(j.dynamicChildren,Ie,he,ge,ue,k1(se,pe),q):J||z(j,se,he,null,ge,ue,k1(se,pe),q,!1),Te>0){if(Te&16)F(he,de,$e,ge,pe);else if(Te&2&&de.class!==$e.class&&i(he,"class",null,$e.class,pe),Te&4&&i(he,"style",de.style,$e.style,pe),Te&8){const tt=se.dynamicProps;for(let vt=0;vt<tt.length;vt++){const wt=tt[vt],xt=de[wt],Rt=$e[wt];(Rt!==xt||wt==="value")&&i(he,wt,xt,Rt,pe,ge)}}Te&1&&j.children!==se.children&&u(he,se.children)}else!J&&Ie==null&&F(he,de,$e,ge,pe);((Qe=$e.onVnodeUpdated)||Oe)&&os(()=>{Qe&&ho(Qe,ge,se,j),Oe&&Bi(se,j,ge,"updated")},ue)},N=(j,se,ge,ue,pe,q,J)=>{for(let he=0;he<se.length;he++){const Te=j[he],Ie=se[he],Oe=Te.el&&(Te.type===Be||!yi(Te,Ie)||Te.shapeFlag&198)?d(Te.el):ge;m(Te,Ie,Oe,null,ue,pe,q,J,!0)}},F=(j,se,ge,ue,pe)=>{if(se!==ge){if(se!==Gt)for(const q in se)!Zl(q)&&!(q in ge)&&i(j,q,se[q],null,pe,ue);for(const q in ge){if(Zl(q))continue;const J=ge[q],he=se[q];J!==he&&q!=="value"&&i(j,q,he,J,pe,ue)}"value"in ge&&i(j,"value",se.value,ge.value,pe)}},S=(j,se,ge,ue,pe,q,J,he,Te)=>{const Ie=se.el=j?j.el:l(""),Oe=se.anchor=j?j.anchor:l("");let{patchFlag:de,dynamicChildren:$e,slotScopeIds:Qe}=se;Qe&&(he=he?he.concat(Qe):Qe),j==null?(s(Ie,ge,ue),s(Oe,ge,ue),x(se.children||[],ge,Oe,pe,q,J,he,Te)):de>0&&de&64&&$e&&j.dynamicChildren&&j.dynamicChildren.length===$e.length?(N(j.dynamicChildren,$e,ge,pe,q,J,he),(se.key!=null||pe&&se===pe.subTree)&&Pv(j,se,!0)):z(j,se,ge,Oe,pe,q,J,he,Te)},T=(j,se,ge,ue,pe,q,J,he,Te)=>{se.slotScopeIds=he,j==null?se.shapeFlag&512?pe.ctx.activate(se,ge,ue,J,Te):R(se,ge,ue,pe,q,J,Te):O(j,se,Te)},R=(j,se,ge,ue,pe,q,J)=>{const he=j.component=B4(j,ue,pe);if(kd(j)&&(he.ctx.renderer=Y),P4(he,!1,J),he.asyncDep){if(pe&&pe.registerDep(he,D,J),!j.el){const Te=he.subTree=ie(rs);k(null,Te,se,ge),j.placeholder=Te.el}}else D(he,j,se,ge,pe,q,J)},O=(j,se,ge)=>{const ue=se.component=j.component;if(pT(j,se,ge))if(ue.asyncDep&&!ue.asyncResolved){W(ue,se,ge);return}else ue.next=se,ue.update();else se.el=j.el,ue.vnode=se},D=(j,se,ge,ue,pe,q,J)=>{const he=()=>{if(j.isMounted){let{next:de,bu:$e,u:Qe,parent:tt,vnode:vt}=j;{const nn=N4(j);if(nn){de&&(de.el=vt.el,W(j,de,J)),nn.asyncDep.then(()=>{os(()=>{j.isUnmounted||Ie()},pe)});return}}let wt=de,xt;Fl(j,!1),de?(de.el=vt.el,W(j,de,J)):de=vt,$e&&ac($e),(xt=de.props&&de.props.onVnodeBeforeUpdate)&&ho(xt,tt,de,vt),Fl(j,!0);const Rt=Pf(j),yt=j.subTree;j.subTree=Rt,m(yt,Rt,d(yt.el),Se(yt),j,pe,q),de.el=Rt.el,wt===null&&Tp(j,Rt.el),Qe&&os(Qe,pe),(xt=de.props&&de.props.onVnodeUpdated)&&os(()=>ho(xt,tt,de,vt),pe)}else{let de;const{el:$e,props:Qe}=se,{bm:tt,m:vt,parent:wt,root:xt,type:Rt}=j,yt=mr(se);if(Fl(j,!1),tt&&ac(tt),!yt&&(de=Qe&&Qe.onVnodeBeforeMount)&&ho(de,wt,se),Fl(j,!0),$e&&fe){const nn=()=>{j.subTree=Pf(j),fe($e,j.subTree,j,pe,null)};yt&&Rt.__asyncHydrate?Rt.__asyncHydrate($e,j,nn):nn()}else{xt.ce&&xt.ce._hasShadowRoot()&&xt.ce._injectChildStyle(Rt,j.parent?j.parent.type:void 0);const nn=j.subTree=Pf(j);m(null,nn,ge,ue,j,pe,q),se.el=nn.el}if(vt&&os(vt,pe),!yt&&(de=Qe&&Qe.onVnodeMounted)){const nn=se;os(()=>ho(de,wt,nn),pe)}(se.shapeFlag&256||wt&&mr(wt.vnode)&&wt.vnode.shapeFlag&256)&&j.a&&os(j.a,pe),j.isMounted=!0,se=ge=ue=null}};j.scope.on();const Te=j.effect=new rh(he);j.scope.off();const Ie=j.update=Te.run.bind(Te),Oe=j.job=Te.runIfDirty.bind(Te);Oe.i=j,Oe.id=j.uid,Te.scheduler=()=>Ev(Oe),Fl(j,!0),Ie()},W=(j,se,ge)=>{se.component=j;const ue=j.vnode.props;j.vnode=se,j.next=null,gT(j,se.props,ue,ge),bT(j,se.children,ge),yr(),J2(j),kr()},z=(j,se,ge,ue,pe,q,J,he,Te=!1)=>{const Ie=j&&j.children,Oe=j?j.shapeFlag:0,de=se.children,{patchFlag:$e,shapeFlag:Qe}=se;if($e>0){if($e&128){U(Ie,de,ge,ue,pe,q,J,he,Te);return}else if($e&256){V(Ie,de,ge,ue,pe,q,J,he,Te);return}}Qe&8?(Oe&16&&ke(Ie,pe,q),de!==Ie&&u(ge,de)):Oe&16?Qe&16?U(Ie,de,ge,ue,pe,q,J,he,Te):ke(Ie,pe,q,!0):(Oe&8&&u(ge,""),Qe&16&&x(de,ge,ue,pe,q,J,he,Te))},V=(j,se,ge,ue,pe,q,J,he,Te)=>{j=j||rc,se=se||rc;const Ie=j.length,Oe=se.length,de=Math.min(Ie,Oe);let $e;for($e=0;$e<de;$e++){const Qe=se[$e]=Te?lr(se[$e]):mo(se[$e]);m(j[$e],Qe,ge,null,pe,q,J,he,Te)}Ie>Oe?ke(j,pe,q,!0,!1,de):x(se,ge,ue,pe,q,J,he,Te,de)},U=(j,se,ge,ue,pe,q,J,he,Te)=>{let Ie=0;const Oe=se.length;let de=j.length-1,$e=Oe-1;for(;Ie<=de&&Ie<=$e;){const Qe=j[Ie],tt=se[Ie]=Te?lr(se[Ie]):mo(se[Ie]);if(yi(Qe,tt))m(Qe,tt,ge,null,pe,q,J,he,Te);else break;Ie++}for(;Ie<=de&&Ie<=$e;){const Qe=j[de],tt=se[$e]=Te?lr(se[$e]):mo(se[$e]);if(yi(Qe,tt))m(Qe,tt,ge,null,pe,q,J,he,Te);else break;de--,$e--}if(Ie>de){if(Ie<=$e){const Qe=$e+1,tt=Qe<Oe?se[Qe].el:ue;for(;Ie<=$e;)m(null,se[Ie]=Te?lr(se[Ie]):mo(se[Ie]),ge,tt,pe,q,J,he,Te),Ie++}}else if(Ie>$e)for(;Ie<=de;)ae(j[Ie],pe,q,!0),Ie++;else{const Qe=Ie,tt=Ie,vt=new Map;for(Ie=tt;Ie<=$e;Ie++){const Wt=se[Ie]=Te?lr(se[Ie]):mo(se[Ie]);Wt.key!=null&&vt.set(Wt.key,Ie)}let wt,xt=0;const Rt=$e-tt+1;let yt=!1,nn=0;const xn=new Array(Rt);for(Ie=0;Ie<Rt;Ie++)xn[Ie]=0;for(Ie=Qe;Ie<=de;Ie++){const Wt=j[Ie];if(xt>=Rt){ae(Wt,pe,q,!0);continue}let _n;if(Wt.key!=null)_n=vt.get(Wt.key);else for(wt=tt;wt<=$e;wt++)if(xn[wt-tt]===0&&yi(Wt,se[wt])){_n=wt;break}_n===void 0?ae(Wt,pe,q,!0):(xn[_n-tt]=Ie+1,_n>=nn?nn=_n:yt=!0,m(Wt,se[_n],ge,null,pe,q,J,he,Te),xt++)}const ns=yt?wT(xn):rc;for(wt=ns.length-1,Ie=Rt-1;Ie>=0;Ie--){const Wt=tt+Ie,_n=se[Wt],gn=se[Wt+1],ot=Wt+1<Oe?gn.el||I4(gn):ue;xn[Ie]===0?m(null,_n,ge,ot,pe,q,J,he,Te):yt&&(wt<0||Ie!==ns[wt]?re(_n,ge,ot,2):wt--)}}},re=(j,se,ge,ue,pe=null)=>{const{el:q,type:J,transition:he,children:Te,shapeFlag:Ie}=j;if(Ie&6){re(j.component.subTree,se,ge,ue);return}if(Ie&128){j.suspense.move(se,ge,ue);return}if(Ie&64){J.move(j,se,ge,Y);return}if(J===Be){s(q,se,ge);for(let de=0;de<Te.length;de++)re(Te[de],se,ge,ue);s(j.anchor,se,ge);return}if(J===fc){v(j,se,ge);return}if(ue!==2&&Ie&1&&he)if(ue===0)he.persisted&&!q[ti]?s(q,se,ge):(he.beforeEnter(q),s(q,se,ge),os(()=>he.enter(q),pe));else{const{leave:de,delayLeave:$e,afterLeave:Qe}=he,tt=()=>{j.ctx.isUnmounted?o(q):s(q,se,ge)},vt=()=>{const wt=q._isLeaving||!!q[ti];q._isLeaving&&q[ti](!0),he.persisted&&!wt?tt():de(q,()=>{tt(),Qe&&Qe()})};$e?$e(q,tt,vt):vt()}else s(q,se,ge)},ae=(j,se,ge,ue=!1,pe=!1)=>{const{type:q,props:J,ref:he,children:Te,dynamicChildren:Ie,shapeFlag:Oe,patchFlag:de,dirs:$e,cacheIndex:Qe,memo:tt}=j;if(de===-2&&(pe=!1),he!=null&&(yr(),uc(he,null,ge,j,!0),kr()),Qe!=null&&(se.renderCache[Qe]=void 0),Oe&256){se.ctx.deactivate(j);return}const vt=Oe&1&&$e,wt=!mr(j);let xt;if(wt&&(xt=J&&J.onVnodeBeforeUnmount)&&ho(xt,se,j),Oe&6)ne(j.component,ge,ue);else{if(Oe&128){j.suspense.unmount(ge,ue);return}vt&&Bi(j,null,se,"beforeUnmount"),Oe&64?j.type.remove(j,se,ge,Y,ue):Ie&&!Ie.hasOnce&&(q!==Be||de>0&&de&64)?ke(Ie,se,ge,!1,!0):(q===Be&&de&384||!pe&&Oe&16)&&ke(Te,se,ge),ue&&te(j)}const Rt=tt!=null&&Qe==null;(wt&&(xt=J&&J.onVnodeUnmounted)||vt||Rt)&&os(()=>{xt&&ho(xt,se,j),vt&&Bi(j,null,se,"unmounted"),Rt&&(j.el=null)},ge)},te=j=>{const{type:se,el:ge,anchor:ue,transition:pe}=j;if(se===Be){Z(ge,ue);return}if(se===fc){y(j);return}const q=()=>{o(ge),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(j.shapeFlag&1&&pe&&!pe.persisted){const{leave:J,delayLeave:he}=pe,Te=()=>J(ge,q);he?he(j.el,q,Te):Te()}else q()},Z=(j,se)=>{let ge;for(;j!==se;)ge=f(j),o(j),j=ge;o(se)},ne=(j,se,ge)=>{const{bum:ue,scope:pe,job:q,subTree:J,um:he,m:Te,a:Ie}=j;mh(Te),mh(Ie),ue&&ac(ue),pe.stop(),q&&(q.flags|=8,ae(J,j,se,ge)),he&&os(he,se),os(()=>{j.isUnmounted=!0},se)},ke=(j,se,ge,ue=!1,pe=!1,q=0)=>{for(let J=q;J<j.length;J++)ae(j[J],se,ge,ue,pe)},Se=j=>{if(j.shapeFlag&6)return Se(j.component.subTree);if(j.shapeFlag&128)return j.suspense.next();const se=f(j.anchor||j.el),ge=se&&se[o4];return ge?f(ge):se};let Ye=!1;const ve=(j,se,ge)=>{let ue;j==null?se._vnode&&(ae(se._vnode,null,null,!0),ue=se._vnode.component):m(se._vnode||null,j,se,null,null,null,ge),se._vnode=j,Ye||(Ye=!0,J2(ue),fh(),Ye=!1)},Y={p:m,um:ae,m:re,r:te,mt:R,mc:x,pc:z,pbc:N,n:Se,o:e};let ce,fe;return t&&([ce,fe]=t(Y)),{render:ve,hydrate:ce,createApp:aT(ve,ce)}}function k1({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Fl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function T4(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Pv(e,t,n=!1){const s=e.children,o=t.children;if(_t(s)&&_t(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=lr(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Pv(r,l)),l.type===sl&&(l.patchFlag===-1&&(l=o[i]=lr(l)),l.el=r.el),l.type===rs&&!l.el&&(l.el=r.el)}}function wT(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function N4(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:N4(t)}function mh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function I4(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?I4(t.subTree):null}const gh=e=>e.__isSuspense;let sg=0;const ST={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)CT(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}AT(e,t,n,s,o,r,l,a,c)}},hydrate:MT,normalize:ET},Sbe=ST;function Gu(e,t){const n=e.props&&e.props[t];It(n)&&n()}function CT(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=$4(e,o,s,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,s,f,i,r),f.deps>0?(Gu(e,"onPending"),Gu(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),dc(f,e.ssFallback)):f.resolve(!1,!0)}function AT(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,p=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:_,isHydrating:k}=d;if(m)d.pendingBranch=f,yi(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():_&&(k||(a(h,p,n,s,o,null,i,r,l),dc(d,p)))):(d.pendingId=sg++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(h,p,n,s,o,null,i,r,l),dc(d,p))):h&&yi(h,f)?(a(h,f,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(h&&yi(h,f))a(h,f,n,s,o,d,i,r,l),dc(d,f);else if(Gu(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=sg++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(p)},g):g===0&&d.fallback(p)}}function $4(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:_}}=c;let k;const g=TT(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?ih(e.props.timeout):void 0,y=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:sg++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:x,activeBranch:E,pendingBranch:N,pendingId:F,effects:S,parentComponent:T,container:R,isInFallback:O}=A;let D=!1;if(A.isHydrating)A.isHydrating=!1;else if(!L){D=E&&N.transition&&N.transition.mode==="out-in";let V=!1;D&&(E.transition.afterLeave=()=>{F===A.pendingId&&(f(N,R,i===y&&!V?h(E):i,0),dh(S),O&&x.ssFallback&&(x.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(m(E.el)===R&&(i=h(E),V=!0),p(E,T,A,!0),!D&&O&&x.ssFallback&&os(()=>x.ssFallback.el=null,A)),D||f(N,R,i,0)}A.isFallbackMountPending=!1,dc(A,N),A.pendingBranch=null,A.isInFallback=!1;let W=A.parent,z=!1;for(;W;){if(W.pendingBranch){W.effects.push(...S),z=!0;break}W=W.parent}!z&&!D&&dh(S),A.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),Gu(x,"onResolve")},fallback(L){if(!A.pendingBranch)return;const{vnode:$,activeBranch:x,parentComponent:E,container:N,namespace:F}=A;Gu($,"onFallback");const S=h(x),T=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,L,N,S,E,null,F,l,a),dc(A,L))},R=L.transition&&L.transition.mode==="out-in";R&&(A.isFallbackMountPending=!0,x.transition.afterLeave=T),A.isInFallback=!0,p(x,E,null,!0),R||T()},move(L,$,x){A.activeBranch&&f(A.activeBranch,L,$,x),A.container=L},next(){return A.activeBranch&&h(A.activeBranch)},registerDep(L,$,x){const E=!!A.pendingBranch;E&&A.deps++;const N=L.vnode.el;L.asyncDep.catch(F=>{$c(F,L,0)}).then(F=>{if(L.isUnmounted||A.isUnmounted||A.pendingId!==L.suspenseId)return;Yu(),L.asyncResolved=!0;const{vnode:S}=L;og(L,F,!1),N&&(S.el=N);const T=!N&&L.subTree.el;$(L,S,m(N||L.subTree.el),N?null:h(L.subTree),A,r,x),T&&(S.placeholder=null,_(T)),Tp(L,S.el),E&&--A.deps===0&&A.resolve()})},unmount(L,$){A.isUnmounted=!0,A.activeBranch&&p(A.activeBranch,n,L,$),A.pendingBranch&&p(A.pendingBranch,n,L,$)}};return A}function MT(e,t,n,s,o,i,r,l,a){const c=t.suspense=$4(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function ET(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=hb(s?n.default:n),e.ssFallback=s?hb(n.fallback):ie(rs)}function hb(e){let t;if(It(e)){const n=oa&&e._c;n&&(e._d=!1,b()),e=e(),n&&(e._d=!0,t=Us,F4())}return _t(e)&&(e=dT(e)),e=mo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function L4(e,t){t&&t.pendingBranch?_t(e)?t.effects.push(...e):t.effects.push(e):dh(e)}function dc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,Tp(s,o))}function TT(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Be=Symbol.for("v-fgt"),sl=Symbol.for("v-txt"),rs=Symbol.for("v-cmt"),fc=Symbol.for("v-stc"),Cu=[];let Us=null;function b(e=!1){Cu.push(Us=e?null:[])}function F4(){Cu.pop(),Us=Cu[Cu.length-1]||null}let oa=1;function vh(e,t=!1){oa+=e,e<0&&Us&&t&&(Us.hasOnce=!0)}function O4(e){return e.dynamicChildren=oa>0?Us||rc:null,F4(),oa>0&&Us&&Us.push(e),e}function I(e,t,n,s,o,i){return O4(w(e,t,n,s,o,i,!0))}function ye(e,t,n,s,o){return O4(ie(e,t,n,s,o,!0))}function al(e){return e?e.__v_isVNode===!0:!1}function yi(e,t){return e.type===t.type&&e.key===t.key}function Cbe(e){}const R4=({key:e})=>e??null,Hf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bn(e)||Jn(e)||It(e)?{i:Fs,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,s=0,o=null,i=e===Be?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&R4(t),ref:t&&Hf(t),scopeId:Cp,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Fs};return l?(Wv(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=bn(n)?8:16),oa>0&&!r&&Us&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Us.push(a),a}const ie=NT;function NT(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===h4)&&(e=rs),al(e)){const l=xr(e,t,!0);return n&&Wv(l,n),oa>0&&!i&&Us&&(l.shapeFlag&6?Us[Us.indexOf(e)]=l:Us.push(l)),l.patchFlag=-2,l}if(RT(e)&&(e=e.__vccOpts),t){t=IT(t);let{class:l,style:a}=t;l&&!bn(l)&&(t.class=De(l)),rn(a)&&(Sp(a)&&!_t(a)&&(a=mn({},a)),t.style=qt(a))}const r=bn(e)?1:gh(e)?128:i4(e)?64:rn(e)?4:It(e)?2:0;return w(e,t,n,s,o,r,i,!0)}function IT(e){return e?Sp(e)||_4(e)?mn({},e):e:null}function xr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?pn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&R4(c),ref:t&&t.ref?n&&i?_t(i)?i.concat(Hf(t)):[i,Hf(t)]:Hf(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Be?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&xr(e.ssContent),ssFallback:e.ssFallback&&xr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&ll(u,a.clone(u)),u}function Ge(e=" ",t=0){return ie(sl,null,e,t)}function Hv(e,t){const n=ie(fc,null,e);return n.staticCount=t,n}function le(e="",t=!1){return t?(b(),ye(rs,null,e)):ie(rs,null,e)}function mo(e){return e==null||typeof e=="boolean"?ie(rs):_t(e)?ie(Be,null,e.slice()):al(e)?lr(e):ie(sl,null,String(e))}function lr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:xr(e)}function Wv(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_t(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Wv(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!_4(t)?t._ctx=Fs:o===3&&Fs&&(Fs.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else It(t)?(t={default:t,_ctx:Fs},n=32):(t=String(t),s&64?(n=16,t=[Ge(t)]):n=8);e.children=t,e.shapeFlag|=n}function pn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=De([t.class,s.class]));else if(o==="style")t.style=qt([t.style,s.style]);else if(gd(o)){const i=t[o],r=s[o];r&&i!==r&&!(_t(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!fp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function ho(e,t,n,s=null){ui(e,t,7,[n,s])}const $T=g4();let LT=0;function B4(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||$T,i={uid:LT++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $C(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:S4(s,o),emitsOptions:y4(s,o),emit:null,emitted:null,propsDefaults:Gt,inheritAttrs:s.inheritAttrs,ctx:Gt,data:Gt,props:Gt,attrs:Gt,slots:Gt,refs:Gt,setupState:Gt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=cT.bind(null,i),e.ce&&e.ce(i),i}let Ls=null;const Os=()=>Ls||Fs;let yh,hc;{const e=yp(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};yh=t("__VUE_INSTANCE_SETTERS__",n=>Ls=n),hc=t("__VUE_SSR_SETTERS__",n=>ia=n)}const Lc=e=>{const t=Ls;return yh(e),e.scope.on(),()=>{e.scope.off(),yh(t)}},Yu=()=>{Ls&&Ls.scope.off(),yh(null)};function D4(e){return e.vnode.shapeFlag&4}let ia=!1;function P4(e,t=!1,n=!1){t&&hc(t);const{props:s,children:o}=e.vnode,i=D4(e);mT(e,s,i,t),kT(e,o,n||t);const r=i?FT(e,t):void 0;return t&&hc(!1),r}function FT(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,J0);const{setup:s}=n;if(s){yr();const o=e.setupContext=s.length>1?W4(e):null,i=Lc(e),r=vd(s,e,0,[e.props,o]),l=_v(r);if(kr(),i(),(l||e.sp)&&!mr(e)&&Nv(e),l){if(r.then(Yu,Yu),t)return r.then(a=>{og(e,a,t)}).catch(a=>{$c(a,e,0)});e.asyncDep=r}else og(e,r,t)}else H4(e,t)}function og(e,t,n){It(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:rn(t)&&(e.setupState=ZC(t)),H4(e,n)}let kh,ig;function Abe(e){kh=e,ig=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,tT))}}const Mbe=()=>!kh;function H4(e,t,n){const s=e.type;if(!e.render){if(!t&&kh&&!s.render){const o=s.template||Rv(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=mn(mn({isCustomElement:i,delimiters:l},r),a);s.render=kh(o,c)}}e.render=s.render||li,ig&&ig(e)}{const o=Lc(e);yr();try{nT(e)}finally{kr(),o()}}}const OT={get(e,t){return zs(e,"get",""),e[t]}};function W4(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,OT),slots:e.slots,emit:e.emit,expose:t}}function xd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ZC(mt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Su)return Su[n](e)},has(t,n){return n in t||n in Su}})):e.proxy}function rg(e,t=!0){return It(e)?e.displayName||e.name:e.name||t&&e.__name}function RT(e){return It(e)&&"__vccOpts"in e}const P=(e,t)=>yE(e,t,ia);function dn(e,t,n){try{vh(-1);const s=arguments.length;return s===2?rn(t)&&!_t(t)?al(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&al(n)&&(n=[n]),ie(e,t,n))}finally{vh(1)}}function Ebe(){}function Tbe(e,t,n,s){const o=n[s];if(o&&BT(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function BT(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Is(n[s],t[s]))return!1;return oa>0&&Us&&Us.push(e),!0}const DT="3.5.35",Nbe=li,Ibe=wE,$be=qa,Lbe=n4,PT={createComponentInstance:B4,setupComponent:P4,renderComponentRoot:Pf,setCurrentRenderingInstance:qu,isVNode:al,normalizeVNode:mo,getComponentPublicInstance:xd,ensureValidVNode:Ov,pushWarningContext:xE,popWarningContext:_E},Fbe=PT,Obe=null,Rbe=null,Bbe=null;/**
17
+ * @vue/runtime-dom v3.5.35
18
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
+ * @license MIT
20
+ **/let lg;const pb=typeof window<"u"&&window.trustedTypes;if(pb)try{lg=pb.createPolicy("vue",{createHTML:e=>e})}catch{}const z4=lg?e=>lg.createHTML(e):e=>e,HT="http://www.w3.org/2000/svg",WT="http://www.w3.org/1998/Math/MathML",sr=typeof document<"u"?document:null,mb=sr&&sr.createElement("template"),zT={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?sr.createElementNS(HT,e):t==="mathml"?sr.createElementNS(WT,e):n?sr.createElement(e,{is:n}):sr.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>sr.createTextNode(e),createComment:e=>sr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>sr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{mb.innerHTML=z4(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=mb.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Or="transition",iu="animation",_c=Symbol("_vtc"),U4={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},j4=mn({},l4,U4),UT=e=>(e.displayName="Transition",e.props=j4,e),cl=UT((e,{slots:t})=>dn(OE,q4(e),t)),Ol=(e,t=[])=>{_t(e)?e.forEach(n=>n(...t)):e&&e(...t)},gb=e=>e?_t(e)?e.some(t=>t.length>1):e.length>1:!1;function q4(e){const t={};for(const S in e)S in U4||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=jT(o),m=h&&h[0],_=h&&h[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:A,onBeforeAppear:L=k,onAppear:$=g,onAppearCancelled:x=v}=t,E=(S,T,R,O)=>{S._enterCancelled=O,jr(S,T?u:l),jr(S,T?c:r),R&&R()},N=(S,T)=>{S._isLeaving=!1,jr(S,d),jr(S,p),jr(S,f),T&&T()},F=S=>(T,R)=>{const O=S?$:g,D=()=>E(T,S,R);Ol(O,[T,D]),vb(()=>{jr(T,S?a:i),Oi(T,S?u:l),gb(O)||yb(T,s,m,D)})};return mn(t,{onBeforeEnter(S){Ol(k,[S]),Oi(S,i),Oi(S,r)},onBeforeAppear(S){Ol(L,[S]),Oi(S,a),Oi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,T){S._isLeaving=!0;const R=()=>N(S,T);Oi(S,d),S._enterCancelled?(Oi(S,f),ag(S)):(ag(S),Oi(S,f)),vb(()=>{S._isLeaving&&(jr(S,d),Oi(S,p),gb(y)||yb(S,s,_,R))}),Ol(y,[S,R])},onEnterCancelled(S){E(S,!1,void 0,!0),Ol(v,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),Ol(x,[S])},onLeaveCancelled(S){N(S),Ol(A,[S])}})}function jT(e){if(e==null)return null;if(rn(e))return[b1(e.enter),b1(e.leave)];{const t=b1(e);return[t,t]}}function b1(e){return ih(e)}function Oi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[_c]||(e[_c]=new Set)).add(t)}function jr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[_c];n&&(n.delete(t),n.size||(e[_c]=void 0))}function vb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let qT=0;function yb(e,t,n,s){const o=e._endId=++qT,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=V4(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function V4(e,t){const n=window.getComputedStyle(e),s=h=>(n[h]||"").split(", "),o=s(`${Or}Delay`),i=s(`${Or}Duration`),r=kb(o,i),l=s(`${iu}Delay`),a=s(`${iu}Duration`),c=kb(l,a);let u=null,d=0,f=0;t===Or?r>0&&(u=Or,d=r,f=i.length):t===iu?c>0&&(u=iu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Or:iu:null,f=u?u===Or?i.length:a.length:0);const p=u===Or&&/\b(?:transform|all)(?:,|$)/.test(s(`${Or}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function kb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>bb(n)+bb(e[s])))}function bb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ag(e){return(e?e.ownerDocument:document).body.offsetHeight}function VT(e,t,n){const s=e[_c];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const bh=Symbol("_vod"),K4=Symbol("_vsh"),oi={name:"show",beforeMount(e,{value:t},{transition:n}){e[bh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ru(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),ru(e,!0),s.enter(e)):s.leave(e,()=>{ru(e,!1)}):ru(e,t))},beforeUnmount(e,{value:t}){ru(e,t)}};function ru(e,t){e.style.display=t?e[bh]:"none",e[K4]=!t}function KT(){oi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const G4=Symbol("");function Dbe(e){const t=Os();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>xh(i,o))},s=()=>{const o=e(t.proxy);t.ce?xh(t.ce,o):cg(t.subTree,o),n(o)};f4(()=>{dh(s)}),ln(()=>{Ke(s,li,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),fn(()=>o.disconnect())})}function cg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{cg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)xh(e.el,t);else if(e.type===Be)e.children.forEach(n=>cg(n,t));else if(e.type===fc){let{el:n,anchor:s}=e;for(;n&&(xh(n,t),n!==s);)n=n.nextSibling}}function xh(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=j8(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[G4]=s}}const GT=/(?:^|;)\s*display\s*:/;function YT(e,t,n){const s=e.style,o=bn(n);let i=!1;if(n&&!o){if(t)if(bn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&vu(s,l,"")}else for(const r in t)n[r]==null&&vu(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?QT(e,r,!bn(t)&&t?t[r]:void 0,l)||vu(s,r,l):vu(s,r,"")}}else if(o){if(t!==n){const r=s[G4];r&&(n+=";"+r),s.cssText=n,i=GT.test(n)}}else t&&e.removeAttribute("style");bh in e&&(e[bh]=i?s.display:"",e[K4]&&(s.display="none"))}const xb=/\s*!important$/;function vu(e,t,n){if(_t(n))n.forEach(s=>vu(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=ZT(e,t);xb.test(n)?e.setProperty(go(s),n.replace(xb,""),"important"):e[s]=n}}const _b=["Webkit","Moz","ms"],x1={};function ZT(e,t){const n=x1[t];if(n)return n;let s=vs(t);if(s!=="filter"&&s in e)return x1[t]=s;s=gp(s);for(let o=0;o<_b.length;o++){const i=_b[o]+s;if(i in e)return x1[t]=i}return t}function QT(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bn(s)&&n===s}const wb="http://www.w3.org/1999/xlink";function Sb(e,t,n,s,o,i=z8(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(wb,t.slice(6,t.length)):e.setAttributeNS(wb,t,n):n==null||i&&!TC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":zo(n)?String(n):n)}function Cb(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?z4(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=TC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function dr(e,t,n,s){e.addEventListener(t,n,s)}function XT(e,t,n,s){e.removeEventListener(t,n,s)}const Ab=Symbol("_vei");function JT(e,t,n,s,o=null){const i=e[Ab]||(e[Ab]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=e9(t);if(s){const c=i[t]=s9(s,o);dr(e,l,c,a)}else r&&(XT(e,l,r,a),i[t]=void 0)}}const Mb=/(?:Once|Passive|Capture)$/;function e9(e){let t;if(Mb.test(e)){t={};let s;for(;s=e.match(Mb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):go(e.slice(2)),t]}let _1=0;const t9=Promise.resolve(),n9=()=>_1||(t9.then(()=>_1=0),_1=Date.now());function s9(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(_t(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&ui(c,t,5,l)}}else ui(o,t,5,[s])};return n.value=e,n.attached=n9(),n}const Eb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,o9=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?VT(e,s,r):t==="style"?YT(e,n,s):gd(t)?fp(t)||JT(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):i9(e,t,s,r))?(Cb(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Sb(e,t,s,r,i,t!=="value")):e._isVueCE&&(r9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bn(s)))?Cb(e,vs(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Sb(e,t,s,r))};function i9(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Eb(t)&&It(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Eb(t)&&bn(n)?!1:t in e}function r9(e,t){const n=e._def.props;if(!n)return!1;const s=vs(t);return Array.isArray(n)?n.some(o=>vs(o)===s):Object.keys(n).some(o=>vs(o)===s)}const Tb={};function l9(e,t,n){let s=qe(e,t);hp(s)&&(s=mn({},s,t));class o extends zv{constructor(r){super(s,r,n)}}return o.def=s,o}const Pbe=((e,t)=>l9(e,t,S9)),a9=typeof HTMLElement<"u"?HTMLElement:class{};class zv extends a9{constructor(t,n={},s=Sh){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==Sh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(mn({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof zv){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,pt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!_t(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=ih(this._props[a])),(l||(l=Object.create(null)))[vs(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)on(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=_t(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(vs))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):Tb;const o=vs(t);n&&this._numberProps&&this._numberProps[o]&&(s=ih(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Tb?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(go(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(go(t),n+""):n||this.removeAttribute(go(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),w9(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,mn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,hp(r[0])?mn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),go(i)!==i&&o(go(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function c9(e){const t=Os(),n=t&&t.ce;return n||null}function Hbe(){const e=c9();return e&&e.shadowRoot}function Wbe(e="$style"){{const t=Os();if(!t)return Gt;const n=t.type.__cssModules;if(!n)return Gt;const s=n[e];return s||Gt}}const Y4=new WeakMap,Z4=new WeakMap,_h=Symbol("_moveCb"),Nb=Symbol("_enterCb"),u9=e=>(delete e.props.mode,e),d9=u9({name:"TransitionGroup",props:mn({},j4,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Os(),s=r4();let o,i;return Iv(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!g9(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(h9),o.forEach(p9);const l=o.filter(m9);ag(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Oi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[_h]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[_h]=null,jr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Xt(e),l=q4(r);let a=r.tag||Be;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),ll(u,Vu(u,l,s,n)),Y4.set(u,Q4(u.el)))}i=t.default?Tv(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&ll(u,Vu(u,l,s,n))}return ie(a,null,i)}}}),f9=d9;function h9(e){const t=e.el;t[_h]&&t[_h](),t[Nb]&&t[Nb]()}function p9(e){Z4.set(e,Q4(e.el))}function m9(e){const t=Y4.get(e),n=Z4.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function Q4(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function g9(e,t,n){const s=e.cloneNode(),o=e[_c];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=V4(s);return i.removeChild(s),r}const ul=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _t(t)?n=>ac(t,n):t};function v9(e){e.target.composing=!0}function Ib(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ai=Symbol("_assign");function $b(e,t,n){return t&&(e=e.trim()),n&&(e=vp(e)),e}const ao={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[ai]=ul(o);const i=s||o.props&&o.props.type==="number";dr(e,t?"change":"input",r=>{r.target.composing||e[ai]($b(e.value,n,i))}),(n||i)&&dr(e,"change",()=>{e.value=$b(e.value,n,i)}),t||(dr(e,"compositionstart",v9),dr(e,"compositionend",Ib),dr(e,"change",Ib))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[ai]=ul(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?vp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},wh={deep:!0,created(e,t,n){e[ai]=ul(n),dr(e,"change",()=>{const s=e._modelValue,o=wc(e),i=e.checked,r=e[ai];if(_t(s)){const l=kp(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(da(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(J4(e,i))})},mounted:Lb,beforeUpdate(e,t,n){e[ai]=ul(n),Lb(e,t,n)}};function Lb(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(_t(t))o=kp(t,s.props.value)>-1;else if(da(t))o=t.has(s.props.value);else{if(t===n)return;o=vr(t,J4(e,!0))}e.checked!==o&&(e.checked=o)}const X4={created(e,{value:t},n){e.checked=vr(t,n.props.value),e[ai]=ul(n),dr(e,"change",()=>{e[ai](wc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[ai]=ul(s),t!==n&&(e.checked=vr(t,s.props.value))}},ug={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=da(t);dr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?vp(wc(r)):wc(r));e[ai](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,pt(()=>{e._assigning=!1})}),e[ai]=ul(s)},mounted(e,{value:t}){Fb(e,t)},beforeUpdate(e,t,n){e[ai]=ul(n)},updated(e,{value:t}){e._assigning||Fb(e,t)}};function Fb(e,t){const n=e.multiple,s=_t(t);if(!(n&&!s&&!da(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=wc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=kp(t,l)>-1}else r.selected=t.has(l);else if(vr(wc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function wc(e){return"_value"in e?e._value:e.value}function J4(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const y9={created(e,t,n){ff(e,t,n,null,"created")},mounted(e,t,n){ff(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){ff(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){ff(e,t,n,s,"updated")}};function e3(e,t){switch(e){case"SELECT":return ug;case"TEXTAREA":return ao;default:switch(t){case"checkbox":return wh;case"radio":return X4;default:return ao}}}function ff(e,t,n,s,o){const r=e3(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function k9(){ao.getSSRProps=({value:e})=>({value:e}),X4.getSSRProps=({value:e},t)=>{if(t.props&&vr(t.props.value,e))return{checked:!0}},wh.getSSRProps=({value:e},t)=>{if(_t(e)){if(t.props&&kp(e,t.props.value)>-1)return{checked:!0}}else if(da(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},y9.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=e3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const b9=["ctrl","shift","alt","meta"],x9={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>b9.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=x9[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},_9={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},bi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=go(o.key);if(t.some(r=>r===i||_9[r]===i))return e(o)}))},t3=mn({patchProp:o9},zT);let Au,Ob=!1;function n3(){return Au||(Au=xT(t3))}function s3(){return Au=Ob?Au:_T(t3),Ob=!0,Au}const w9=((...e)=>{n3().render(...e)}),zbe=((...e)=>{s3().hydrate(...e)}),Sh=((...e)=>{const t=n3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=i3(s);if(!o)return;const i=t._component;!It(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,o3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),S9=((...e)=>{const t=s3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=i3(s);if(o)return n(o,!0,o3(o))},t});function o3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function i3(e){return bn(e)?document.querySelector(e):e}let Rb=!1;const Ube=()=>{Rb||(Rb=!0,k9(),KT())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function C9(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Ch=typeof window<"u",gl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),A9=(e,t,n)=>M9({l:e,k:t,s:n}),M9=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),as=e=>typeof e=="number"&&isFinite(e),r3=e=>jv(e)==="[object Date]",Sc=e=>jv(e)==="[object RegExp]",Np=e=>Yt(e)&&Object.keys(e).length===0,cs=Object.assign,E9=Object.create,kn=(e=null)=>E9(e);let Bb;const Vl=()=>Bb||(Bb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:kn());function Db(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 T9(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 N9=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,I9=/^(?:href|src|action|formaction)$/i;function Uv(e){return N9.test(e)}function $9(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+=Uv(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function Pb(e,t){if(I9.test(e)&&Uv(t))return"about:blank";const n=e.toLowerCase()==="style"?$9(t):t;return T9(n)}function L9(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${Pb(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${Pb(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)=>Uv(o)?`${s}about:blank`:n),e}const F9=Object.prototype.hasOwnProperty;function ri(e,t){return F9.call(e,t)}const Yn=Array.isArray,Pn=e=>typeof e=="function",gt=e=>typeof e=="string",en=e=>typeof e=="boolean",tn=e=>e!==null&&typeof e=="object",O9=e=>tn(e)&&Pn(e.then)&&Pn(e.catch),l3=Object.prototype.toString,jv=e=>l3.call(e),Yt=e=>jv(e)==="[object Object]",R9=e=>e==null?"":Yn(e)||Yt(e)&&e.toString===l3?JSON.stringify(e,null,2):String(e);function qv(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const hf=e=>!tn(e)||Yn(e);function Wf(e,t){if(hf(e)||hf(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])?[]:kn()),hf(o[i])||hf(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 B9(e,t,n){return{line:e,column:t,offset:n}}function dg(e,t,n){return{start:e,end:t}}const un={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},D9=17;function Ip(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 P9(e){throw e}const $i=" ",H9="\r",Ps=`
29
+ `,W9="\u2028",z9="\u2029";function U9(e){const t=e;let n=0,s=1,o=1,i=0;const r=$=>t[$]===H9&&t[$+1]===Ps,l=$=>t[$]===Ps,a=$=>t[$]===z9,c=$=>t[$]===W9,u=$=>r($)||l($)||a($)||c($),d=()=>n,f=()=>s,p=()=>o,h=()=>i,m=$=>r($)||a($)||c($)?Ps:t[$],_=()=>m(n),k=()=>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 A($=0){i=$}function L(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:_,currentPeek:k,next:g,peek:v,reset:y,resetPeek:A,skipToPeek:L}}const Ji=void 0,j9=".",Hb="'",q9="tokenizer";function V9(e,t={}){const n=t.location!==!1,s=U9(e),o=()=>s.index(),i=()=>B9(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(q,J,he,...Te){const Ie=c();if(J.column+=he,J.offset+=he,u){const Oe=n?dg(Ie.startLoc,J):null,de=Ip(q,Oe,{domain:q9,args:Te});u(de)}}function f(q,J,he){q.endLoc=i(),q.currentType=J;const Te={type:J};return n&&(Te.loc=dg(q.startLoc,q.endLoc)),he!=null&&(Te.value=he),Te}const p=q=>f(q,13);function h(q,J){return q.currentChar()===J?(q.next(),J):(d(un.EXPECTED_TOKEN,i(),0,J),"")}function m(q){let J="";for(;q.currentPeek()===$i||q.currentPeek()===Ps;)J+=q.currentPeek(),q.peek();return J}function _(q){const J=m(q);return q.skipToPeek(),J}function k(q){if(q===Ji)return!1;const J=q.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J===95}function g(q){if(q===Ji)return!1;const J=q.charCodeAt(0);return J>=48&&J<=57}function v(q,J){const{currentType:he}=J;if(he!==2)return!1;m(q);const Te=k(q.currentPeek());return q.resetPeek(),Te}function y(q,J){const{currentType:he}=J;if(he!==2)return!1;m(q);const Te=q.currentPeek()==="-"?q.peek():q.currentPeek(),Ie=g(Te);return q.resetPeek(),Ie}function A(q,J){const{currentType:he}=J;if(he!==2)return!1;m(q);const Te=q.currentPeek()===Hb;return q.resetPeek(),Te}function L(q,J){const{currentType:he}=J;if(he!==7)return!1;m(q);const Te=q.currentPeek()===".";return q.resetPeek(),Te}function $(q,J){const{currentType:he}=J;if(he!==8)return!1;m(q);const Te=k(q.currentPeek());return q.resetPeek(),Te}function x(q,J){const{currentType:he}=J;if(!(he===7||he===11))return!1;m(q);const Te=q.currentPeek()===":";return q.resetPeek(),Te}function E(q,J){const{currentType:he}=J;if(he!==9)return!1;const Te=()=>{const Oe=q.currentPeek();return Oe==="{"?k(q.peek()):Oe==="@"||Oe==="|"||Oe===":"||Oe==="."||Oe===$i||!Oe?!1:Oe===Ps?(q.peek(),Te()):F(q,!1)},Ie=Te();return q.resetPeek(),Ie}function N(q){m(q);const J=q.currentPeek()==="|";return q.resetPeek(),J}function F(q,J=!0){const he=(Ie=!1,Oe="")=>{const de=q.currentPeek();return de==="{"||de==="@"||!de?Ie:de==="|"?!(Oe===$i||Oe===Ps):de===$i?(q.peek(),he(!0,$i)):de===Ps?(q.peek(),he(!0,Ps)):!0},Te=he();return J&&q.resetPeek(),Te}function S(q,J){const he=q.currentChar();return he===Ji?Ji:J(he)?(q.next(),he):null}function T(q){const J=q.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36}function R(q){return S(q,T)}function O(q){const J=q.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36||J===45}function D(q){return S(q,O)}function W(q){const J=q.charCodeAt(0);return J>=48&&J<=57}function z(q){return S(q,W)}function V(q){const J=q.charCodeAt(0);return J>=48&&J<=57||J>=65&&J<=70||J>=97&&J<=102}function U(q){return S(q,V)}function re(q){let J="",he="";for(;J=z(q);)he+=J;return he}function ae(q){let J="";for(;;){const he=q.currentChar();if(he==="\\"){const Te=q.peek();Te==="{"||Te==="}"||Te==="@"||Te==="|"||Te==="\\"?(J+=he+Te,q.next(),q.next()):(q.resetPeek(),J+=he,q.next())}else{if(he==="{"||he==="}"||he==="@"||he==="|"||!he)break;if(he===$i||he===Ps)if(F(q))J+=he,q.next();else{if(N(q))break;J+=he,q.next()}else J+=he,q.next()}}return J}function te(q){_(q);let J="",he="";for(;J=D(q);)he+=J;const Te=q.currentChar();if(Te&&Te!=="}"&&Te!==Ji&&Te!==$i&&Te!==Ps&&Te!==" "){const Ie=Y(q);return d(un.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,he+Ie),he+Ie}return q.currentChar()===Ji&&d(un.UNTERMINATED_CLOSING_BRACE,i(),0),he}function Z(q){_(q);let J="";return q.currentChar()==="-"?(q.next(),J+=`-${re(q)}`):J+=re(q),q.currentChar()===Ji&&d(un.UNTERMINATED_CLOSING_BRACE,i(),0),J}function ne(q){return q!==Hb&&q!==Ps}function ke(q){_(q),h(q,"'");let J="",he="";for(;J=S(q,ne);)J==="\\"?he+=Se(q):he+=J;const Te=q.currentChar();return Te===Ps||Te===Ji?(d(un.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Te===Ps&&(q.next(),h(q,"'")),he):(h(q,"'"),he)}function Se(q){const J=q.currentChar();switch(J){case"\\":case"'":return q.next(),`\\${J}`;case"u":return Ye(q,J,4);case"U":return Ye(q,J,6);default:return d(un.UNKNOWN_ESCAPE_SEQUENCE,i(),0,J),""}}function Ye(q,J,he){h(q,J);let Te="";for(let Ie=0;Ie<he;Ie++){const Oe=U(q);if(!Oe){d(un.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${J}${Te}${q.currentChar()}`);break}Te+=Oe}return`\\${J}${Te}`}function ve(q){return q!=="{"&&q!=="}"&&q!==$i&&q!==Ps}function Y(q){_(q);let J="",he="";for(;J=S(q,ve);)he+=J;return he}function ce(q){let J="",he="";for(;J=R(q);)he+=J;return he}function fe(q){const J=he=>{const Te=q.currentChar();return Te==="{"||Te==="@"||Te==="|"||Te==="("||Te===")"||!Te||Te===$i?he:(he+=Te,q.next(),J(he))};return J("")}function j(q){_(q);const J=h(q,"|");return _(q),J}function se(q,J){let he=null;switch(q.currentChar()){case"{":return J.braceNest>=1&&d(un.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),q.next(),he=f(J,2,"{"),_(q),J.braceNest++,he;case"}":return J.braceNest>0&&J.currentType===2&&d(un.EMPTY_PLACEHOLDER,i(),0),q.next(),he=f(J,3,"}"),J.braceNest--,J.braceNest>0&&_(q),J.inLinked&&J.braceNest===0&&(J.inLinked=!1),he;case"@":return J.braceNest>0&&d(un.UNTERMINATED_CLOSING_BRACE,i(),0),he=ge(q,J)||p(J),J.braceNest=0,he;default:{let Ie=!0,Oe=!0,de=!0;if(N(q))return J.braceNest>0&&d(un.UNTERMINATED_CLOSING_BRACE,i(),0),he=f(J,1,j(q)),J.braceNest=0,J.inLinked=!1,he;if(J.braceNest>0&&(J.currentType===4||J.currentType===5||J.currentType===6))return d(un.UNTERMINATED_CLOSING_BRACE,i(),0),J.braceNest=0,ue(q,J);if(Ie=v(q,J))return he=f(J,4,te(q)),_(q),he;if(Oe=y(q,J))return he=f(J,5,Z(q)),_(q),he;if(de=A(q,J))return he=f(J,6,ke(q)),_(q),he;if(!Ie&&!Oe&&!de)return he=f(J,12,Y(q)),d(un.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,he.value),_(q),he;break}}return he}function ge(q,J){const{currentType:he}=J;let Te=null;const Ie=q.currentChar();switch((he===7||he===8||he===11||he===9)&&(Ie===Ps||Ie===$i)&&d(un.INVALID_LINKED_FORMAT,i(),0),Ie){case"@":return q.next(),Te=f(J,7,"@"),J.inLinked=!0,Te;case".":return _(q),q.next(),f(J,8,".");case":":return _(q),q.next(),f(J,9,":");default:return N(q)?(Te=f(J,1,j(q)),J.braceNest=0,J.inLinked=!1,Te):L(q,J)||x(q,J)?(_(q),ge(q,J)):$(q,J)?(_(q),f(J,11,ce(q))):E(q,J)?(_(q),Ie==="{"?se(q,J)||Te:f(J,10,fe(q))):(he===7&&d(un.INVALID_LINKED_FORMAT,i(),0),J.braceNest=0,J.inLinked=!1,ue(q,J))}}function ue(q,J){let he={type:13};if(J.braceNest>0)return se(q,J)||p(J);if(J.inLinked)return ge(q,J)||p(J);switch(q.currentChar()){case"{":return se(q,J)||p(J);case"}":return d(un.UNBALANCED_CLOSING_BRACE,i(),0),q.next(),f(J,3,"}");case"@":return ge(q,J)||p(J);default:{if(N(q))return he=f(J,1,j(q)),J.braceNest=0,J.inLinked=!1,he;if(F(q))return f(J,0,ae(q));break}}return he}function pe(){const{currentType:q,offset:J,startLoc:he,endLoc:Te}=a;return a.lastType=q,a.lastOffset=J,a.lastStartLoc=he,a.lastEndLoc=Te,a.offset=o(),a.startLoc=i(),s.currentChar()===Ji?f(a,13):ue(s,a)}return{nextToken:pe,currentOffset:o,currentPosition:i,context:c}}const K9="parser",G9=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,Y9=/\\([\\@{}|])/g;function Z9(e,t){return t}function Q9(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 X9(e={}){const t=e.location!==!1,{onError:n}=e;function s(k,g,v,y,...A){const L=k.currentPosition();if(L.offset+=y,L.column+=y,n){const $=t?dg(v,L):null,x=Ip(g,$,{domain:K9,args:A});n(x)}}function o(k,g,v){const y={type:k};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(k,g,v,y){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),y=o(3,v.offset,v.startLoc);return y.value=g.replace(Y9,Z9),i(y,k.currentOffset(),k.currentPosition()),y}function l(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(5,y,A);return L.index=parseInt(g,10),k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function a(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(4,y,A);return L.key=g,k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function c(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(9,y,A);return L.value=g.replace(G9,Q9),k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(8,y,A);return g.type!==11?(s(k,un.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),L.value="",i(L,y,A),{nextConsumeToken:g,node:L}):(g.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Li(g)),L.value=g.value||"",i(L,k.currentOffset(),k.currentPosition()),{node:L})}function d(k,g){const v=k.context(),y=o(7,v.offset,v.startLoc);return y.value=g,i(y,k.currentOffset(),k.currentPosition()),y}function f(k){const g=k.context(),v=o(6,g.offset,g.startLoc);let y=k.nextToken();if(y.type===8){const A=u(k);v.modifier=A.node,y=A.nextConsumeToken||k.nextToken()}switch(y.type!==9&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(y)),y=k.nextToken(),y.type===2&&(y=k.nextToken()),y.type){case 10:y.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(y)),v.key=d(k,y.value||"");break;case 4:y.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(y)),v.key=a(k,y.value||"");break;case 5:y.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(y)),v.key=l(k,y.value||"");break;case 6:y.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(y)),v.key=c(k,y.value||"");break;default:{s(k,un.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const A=k.context(),L=o(7,A.offset,A.startLoc);return L.value="",i(L,A.offset,A.startLoc),v.key=L,i(v,A.offset,A.startLoc),{nextConsumeToken:y,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function p(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,A=o(2,v,y);A.items=[];let L=null;do{const E=L||k.nextToken();switch(L=null,E.type){case 0:E.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(E)),A.items.push(r(k,E.value||""));break;case 5:E.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(E)),A.items.push(l(k,E.value||""));break;case 4:E.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(E)),A.items.push(a(k,E.value||""));break;case 6:E.value==null&&s(k,un.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Li(E)),A.items.push(c(k,E.value||""));break;case 7:{const N=f(k);A.items.push(N.node),L=N.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:k.currentOffset(),x=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(A,$,x),A}function h(k,g,v,y){const A=k.context();let L=y.items.length===0;const $=o(1,g,v);$.cases=[],$.cases.push(y);do{const x=p(k);L||(L=x.items.length===0),$.cases.push(x)}while(A.currentType!==13);return L&&s(k,un.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i($,k.currentOffset(),k.currentPosition()),$}function m(k){const g=k.context(),{offset:v,startLoc:y}=g,A=p(k);return g.currentType===13?A:h(k,v,y,A)}function _(k){const g=V9(k,cs({},e)),v=g.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=k),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(k)),v.currentType!==13&&s(g,un.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:_}}function Li(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 J9(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Wb(e,t){for(let n=0;n<e.length;n++)Vv(e[n],t)}function Vv(e,t){switch(e.type){case 1:Wb(e.cases,t),t.helper("plural");break;case 2:Wb(e.items,t);break;case 6:{Vv(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 e7(e,t={}){const n=J9(e);n.helper("normalize"),e.body&&Vv(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function t7(e){const t=e.body;return t.type===2?zb(t):t.cases.forEach(n=>zb(n)),e}function zb(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=qv(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 Va(e){switch(e.t=e.type,e.type){case 0:{const t=e;Va(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++)Va(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++)Va(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;Va(t.key),t.k=t.key,delete t.key,t.modifier&&(Va(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 n7(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,_){r.code+=m}function c(m,_=!0){const k=_?s:"";a(o?k+" ".repeat(m):k)}function u(m=!0){const _=++r.indentLevel;m&&c(_)}function d(m=!0){const _=--r.indentLevel;m&&c(_)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function s7(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Cc(e,t.key),t.modifier?(e.push(", "),Cc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function o7(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(Cc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function i7(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(Cc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function r7(e,t){t.body?Cc(e,t.body):e.push("null")}function Cc(e,t){const{helper:n}=e;switch(t.type){case 0:r7(e,t);break;case 1:i7(e,t);break;case 2:o7(e,t);break;case 6:s7(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 l7=(e,t={})=>{const n=gt(t.mode)?t.mode:"normal",s=gt(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=n7(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${qv(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Cc(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function a7(e,t={}){const n=cs({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=X9(n).parse(e);return s?(i&&t7(l),o&&Va(l),{ast:l,code:""}):(e7(l,n),l7(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function c7(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Vl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Vl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Wi(e){return tn(e)&&Kv(e)===0&&(ri(e,"b")||ri(e,"body"))}const a3=["b","body"];function u7(e){return vl(e,a3)}const c3=["c","cases"];function d7(e){return vl(e,c3,[])}const u3=["s","static"];function f7(e){return vl(e,u3)}const d3=["i","items"];function h7(e){return vl(e,d3,[])}const f3=["t","type"];function Kv(e){return vl(e,f3)}const h3=["v","value"];function pf(e,t){const n=vl(e,h3);if(n!=null)return n;throw Zu(t)}const p3=["m","modifier"];function p7(e){return vl(e,p3)}const m3=["k","key"];function m7(e){const t=vl(e,m3);if(t)return t;throw Zu(6)}function vl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(ri(e,o)&&e[o]!=null)return e[o]}return n}const g3=[...a3,...c3,...u3,...d3,...m3,...p3,...h3,...f3];function Zu(e){return new Error(`unhandled node type: ${e}`)}function w1(e){return n=>g7(n,e)}function g7(e,t){const n=u7(t);if(n==null)throw Zu(0);if(Kv(n)===1){const i=d7(n);return e.plural(i.reduce((r,l)=>[...r,Ub(e,l)],[]))}else return Ub(e,n)}function Ub(e,t){const n=f7(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=h7(t).reduce((o,i)=>[...o,fg(e,i)],[]);return e.normalize(s)}}function fg(e,t){const n=Kv(t);switch(n){case 3:return pf(t,n);case 9:return pf(t,n);case 4:{const s=t;if(ri(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(ri(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Zu(n)}case 5:{const s=t;if(ri(s,"i")&&as(s.i))return e.interpolate(e.list(s.i));if(ri(s,"index")&&as(s.index))return e.interpolate(e.list(s.index));throw Zu(n)}case 6:{const s=t,o=p7(s),i=m7(s);return e.linked(fg(e,i),o?fg(e,o):void 0,e.type)}case 7:return pf(t,n);case 8:return pf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const v7=e=>e;let mf=kn();function y7(e,t={}){let n=!1;const s=t.onError||P9;return t.onError=o=>{n=!0,s(o)},{...a7(e,t),detectError:n}}function k7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&gt(e)){en(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||v7)(e),o=mf[s];if(o)return o;const{ast:i,detectError:r}=y7(e,{...t,location:!1,jit:!0}),l=w1(i);return r?l:mf[s]=l}else{const n=e.cacheKey;if(n){const s=mf[n];return s||(mf[n]=w1(e))}else return w1(e)}}let Qu=null;function b7(e){Qu=e}function x7(e,t,n){Qu&&Qu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const _7=w7("function:translate");function w7(e){return t=>Qu&&Qu.emit(e,t)}const fr={INVALID_ARGUMENT:D9,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},S7=24;function hr(e){return Ip(e,null,void 0)}function Gv(e,t){return t.locale!=null?jb(t.locale):jb(e.locale)}let S1;function jb(e){if(gt(e))return e;if(Pn(e)){if(e.resolvedOnce&&S1!=null)return S1;if(e.constructor.name==="Function"){const t=e();if(O9(t))throw hr(fr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return S1=t}else throw hr(fr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw hr(fr.NOT_SUPPORT_LOCALE_TYPE)}function C7(e,t,n){return[...new Set([n,...Yn(t)?t:tn(t)?Object.keys(t):gt(t)?[t]:[n]])]}function hg(e,t,n){const s=gt(n)?n:Xu,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Yn(r);)r=qb(i,r,t);const l=Yn(t)||!Yt(t)?t:t.default?t.default:null;r=gt(l)?[l]:l,Yn(r)&&qb(i,r,!1),o.__localeChainCache.set(s,i)}return i}function qb(e,t,n){let s=!0;for(let o=0;o<t.length&&en(s);o++){const i=t[o];gt(i)&&(s=A7(e,t[o],n))}return s}function A7(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=M7(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function M7(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),(Yn(n)||Yt(n))&&n[o]&&(s=n[o])}return s}const yl=[];yl[0]={w:[0],i:[3,0],"[":[4],o:[7]};yl[1]={w:[1],".":[2],"[":[4],o:[7]};yl[2]={w:[2],i:[3,0],0:[3,0]};yl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};yl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};yl[5]={"'":[4,0],o:8,l:[5,0]};yl[6]={'"':[4,0],o:8,l:[6,0]};const E7=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function T7(e){return E7.test(e)}function N7(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 I7(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 $7(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:T7(t)?N7(t):"*"+t}function L7(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=$7(r),r===!1))return!1;f[1]()}};function p(){const h=e[n+1];if(s===5&&h==="'"||s===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&p())){if(a=I7(i),d=yl[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 Vb=new Map;function F7(e,t){return tn(e)?e[t]:null}function O7(e,t){if(!tn(e))return null;let n=Vb.get(t);if(n||(n=L7(t),n&&Vb.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(g3.includes(r)&&Wi(o)||!tn(o)||!ri(o,r))return null;const l=o[r];if(l===void 0||Pn(o))return null;o=l,i++}return o}const R7="11.4.5",$p=-1,Xu="en-US",Ah="",Kb=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function B7(){return{upper:(e,t)=>t==="text"&&gt(e)?e.toUpperCase():t==="vnode"&&tn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&gt(e)?e.toLowerCase():t==="vnode"&&tn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&gt(e)?Kb(e):t==="vnode"&&tn(e)&&"__v_isVNode"in e?Kb(e.children):e}}let v3;function D7(e){v3=e}let y3;function P7(e){y3=e}let k3;function H7(e){k3=e}let b3=null;const W7=e=>{b3=e},z7=()=>b3;let x3=null;const Gb=e=>{x3=e},U7=()=>x3;let Yb=0;function j7(e={}){const t=Pn(e.onWarn)?e.onWarn:C9,n=gt(e.version)?e.version:R7,s=gt(e.locale)||Pn(e.locale)?e.locale:Xu,o=Pn(s)?Xu:s,i=Yn(e.fallbackLocale)||Yt(e.fallbackLocale)||gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Yt(e.messages)?e.messages:C1(o),l=Yt(e.datetimeFormats)?e.datetimeFormats:C1(o),a=Yt(e.numberFormats)?e.numberFormats:C1(o),c=cs(kn(),e.modifiers,B7()),u=e.pluralRules||kn(),d=Pn(e.missing)?e.missing:null,f=en(e.missingWarn)||Sc(e.missingWarn)?e.missingWarn:!0,p=en(e.fallbackWarn)||Sc(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,m=!!e.unresolving,_=Pn(e.postTranslation)?e.postTranslation:null,k=Yt(e.processor)?e.processor:null,g=en(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Pn(e.messageCompiler)?e.messageCompiler:v3,A=Pn(e.messageResolver)?e.messageResolver:y3||F7,L=Pn(e.localeFallbacker)?e.localeFallbacker:k3||C7,$=tn(e.fallbackContext)?e.fallbackContext:void 0,x=e,E=tn(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,N=tn(x.__numberFormatters)?x.__numberFormatters:new Map,F=tn(x.__meta)?x.__meta:{};Yb++;const S={version:n,cid:Yb,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:_,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:A,localeFallbacker:L,fallbackContext:$,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=E,S.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&x7(S,n,F),S}const C1=e=>({[e]:kn()});function Yv(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return gt(l)?l:t}else return t}function lu(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function q7(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function V7(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(q7(e,t[s]))return!0;return!1}function Zb(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!gt(t[0])&&!r3(t[0])&&!as(t[0]))return Ah;const[a,c,u,d]=pg(...t),f=en(u.missingWarn)?u.missingWarn:e.missingWarn;en(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=Gv(e,u),m=r(e,o,h);if(!gt(a)||a===""){const L=new Intl.DateTimeFormat(h.replace(/!/g,""),d);return p?L.formatToParts(c):L.format(c)}let _={},k,g=null;const v="datetime format";for(let L=0;L<m.length&&(k=m[L],_=n[k]||{},g=_[a],!Yt(g));L++)Yv(e,a,k,f,v);if(!Yt(g)||!gt(k))return s?$p:a;let y=`${k}__${a}`;Np(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.DateTimeFormat(k,cs({},g,d)),l.set(y,A)),p?A.formatToParts(c):A.format(c)}const _3=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function pg(...e){const[t,n,s,o]=e,i=kn();let r=kn(),l;if(gt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw hr(fr.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 hr(fr.INVALID_ISO_DATE_ARGUMENT)}}else if(r3(t)){if(isNaN(t.getTime()))throw hr(fr.INVALID_DATE_ARGUMENT);l=t}else if(as(t))l=t;else throw hr(fr.INVALID_ARGUMENT);return gt(n)?i.key=n:Yt(n)&&Object.keys(n).forEach(a=>{_3.includes(a)?r[a]=n[a]:i[a]=n[a]}),gt(s)?i.locale=s:Yt(s)&&(r=s),Yt(o)&&(r=o),[i.key||"",l,i,r]}function Qb(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Xb(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!as(t[0]))return Ah;const[a,c,u,d]=mg(...t),f=en(u.missingWarn)?u.missingWarn:e.missingWarn;en(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=Gv(e,u),m=r(e,o,h);if(!gt(a)||a===""){const L=new Intl.NumberFormat(h.replace(/!/g,""),d);return p?L.formatToParts(c):L.format(c)}let _={},k,g=null;const v="number format";for(let L=0;L<m.length&&(k=m[L],_=n[k]||{},g=_[a],!Yt(g));L++)Yv(e,a,k,f,v);if(!Yt(g)||!gt(k))return s?$p:a;let y=`${k}__${a}`;Np(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.NumberFormat(k,cs({},g,d)),l.set(y,A)),p?A.formatToParts(c):A.format(c)}const w3=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function mg(...e){const[t,n,s,o]=e,i=kn();let r=kn();if(!as(t))throw hr(fr.INVALID_ARGUMENT);const l=t;return gt(n)?i.key=n:Yt(n)&&Object.keys(n).forEach(a=>{w3.includes(a)?r[a]=n[a]:i[a]=n[a]}),gt(s)?i.locale=s:Yt(s)&&(r=s),Yt(o)&&(r=o),[i.key||"",l,i,r]}function Jb(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const K7=e=>e,G7=e=>"",Y7="text",Z7=e=>e.length===0?"":qv(e),Q7=R9;function A1(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function X7(e){const t=as(e.pluralIndex)?e.pluralIndex:-1;return as(e.named?.count)?e.named.count:as(e.named?.n)?e.named.n:t}function J7(e={}){const t=e.locale,n=X7(e),s=gt(t)&&Pn(e.pluralRules?.[t])?e.pluralRules[t]:A1,o=s===A1?void 0:A1,i=k=>k[s(n,k.length,o)],r=e.list||[],l=k=>r[k],a=e.named||kn();as(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=Pn(e.messages)?e.messages(k,!!g):tn(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):G7)}const d=k=>e.modifiers?e.modifiers[k]:K7,f=Pn(e.processor?.normalize)?e.processor.normalize:Z7,p=Pn(e.processor?.interpolate)?e.processor.interpolate:Q7,h=gt(e.processor?.type)?e.processor.type:Y7,_={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,y]=g;let A="text",L="";g.length===1?tn(v)?(L=v.modifier||L,A=v.type||A):gt(v)&&(L=v||L):g.length===2&&(gt(v)&&(L=v||L),gt(y)&&(A=y||A));const $=u(k,!0)(_),x=$===""||$===void 0?k:$,E=A==="vnode"&&Yn(x)&&L?x[0]:x;return L?d(L)(E,A):E},message:u,type:h,interpolate:p,normalize:f,values:cs(kn(),r,a)};return _}const ex=()=>"",ni=e=>Pn(e);function tx(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=gg(...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,p=!!c.resolvedMessage,h=gt(c.default)||en(c.default)?en(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||h!=null&&(gt(h)||Pn(h)),_=Gv(e,c);f&&eN(c);let[k,g,v]=p?[a,_,l[_]||kn()]:S3(e,a,_,r,d,u),y=k,A=a;if(!p&&!(gt(y)||Wi(y)||ni(y))&&m&&(y=h,A=y),!p&&(!(gt(y)||Wi(y)||ni(y))||!gt(g)))return o?$p:a;let L=!1;const $=()=>{L=!0},x=ni(y)?y:C3(e,a,g,y,A,$);if(L)return y;const E=sN(e,g,v,c),N=J7(E),F=tN(e,x,N);let S=s?s(F,a):F;if(f&&gt(S)&&(S=L9(S)),__INTLIFY_PROD_DEVTOOLS__){const T={timestamp:Date.now(),key:gt(a)?a:ni(y)?y.key:"",locale:g||(ni(y)?y.locale:""),format:gt(y)?y:ni(y)?y.source:"",message:S};T.meta=cs({},e.__meta,z7()||{}),_7(T)}return S}function eN(e){Yn(e.list)?e.list=e.list.map(t=>gt(t)?Db(t):t):tn(e.named)&&Object.keys(e.named).forEach(t=>{gt(e.named[t])&&(e.named[t]=Db(e.named[t]))})}function S3(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=kn(),f,p=null;const h="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||kn(),(p=a(d,t))===null&&(p=d[t]),!(gt(p)||Wi(p)||ni(p)));m++)if(!V7(f,u)){const _=Yv(e,t,f,i,h);_!==t&&(p=_)}return[p,f,d]}function C3(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(ni(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,nN(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function tN(e,t,n){return t(n)}function gg(...e){const[t,n,s]=e,o=kn();if(!gt(t)&&!as(t)&&!ni(t)&&!Wi(t))throw hr(fr.INVALID_ARGUMENT);const i=as(t)?String(t):(ni(t),t);return as(n)?o.plural=n:gt(n)?o.default=n:Yt(n)&&!Np(n)?o.named=n:Yn(n)&&(o.list=n),as(s)?o.plural=s:gt(s)?o.default=s:Yt(s)&&cs(o,s),[i,o]}function nN(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>A9(t,n,r)}}function sN(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:(p,h)=>{let m=r(n,p);if(m==null&&(u||h)){const[_,,k]=S3(u||e,p,t,l,a,c);m=_??r(k,p)}if(gt(m)||Wi(m)){let _=!1;const g=C3(e,p,t,m,p,()=>{_=!0});return _?ex:g}else return ni(m)?m:ex}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),as(s.plural)&&(f.pluralIndex=s.plural),f}c7();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const oN="11.4.5";function iN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Vl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Vl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Vl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Vl().__INTLIFY_PROD_DEVTOOLS__=!1)}const no={UNEXPECTED_RETURN_TYPE:S7,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 vo(e,...t){return Ip(e,null,void 0)}const vg=gl("__translateVNode"),yg=gl("__datetimeParts"),kg=gl("__numberParts"),A3=gl("__setPluralRules"),M3=gl("__injectWithOption"),ec=gl("__dispose");function Ju(e){if(!tn(e)||Wi(e))return e;for(const t in e)if(ri(e,t))if(!t.includes("."))tn(e[t])&&Ju(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]]=kn()),!tn(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Wi(o)?g3.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Wi(o)){const r=o[n[s]];tn(r)&&Ju(r)}}return e}function Zv(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Yt(n)?n:Yn(s)?kn():{[e]:kn()};if(Yn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||kn(),Wf(c,r[a])):Wf(c,r)}else gt(l)&&Wf(JSON.parse(l),r)}),o==null&&i)for(const l in r)ri(r,l)&&Ju(r[l]);return r}function E3(e){return e.type}function T3(e,t,n){let s=tn(t.messages)?t.messages:kn();"__i18nGlobal"in n&&(s=Zv(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 nx(e){return ie(sl,null,e,0)}function ed(){return Os()}const sx="__INTLIFY_META__",ox=()=>[],rN=()=>!1;let ix=0;function rx(e){return((t,n,s,o)=>e(n,s,ed()||void 0,o))}const lN=()=>{const e=ed();let t=null;return e&&(t=E3(e)[sx])?{[sx]:t}:null};function Mh(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=Ch?Q:fa;let r=en(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:gt(e.locale)?e.locale:Xu),a=i(t&&r?t.fallbackLocale.value:gt(e.fallbackLocale)||Yn(e.fallbackLocale)||Yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Zv(l.value,e)),u=i(Yt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Yt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:en(e.missingWarn)||Sc(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:en(e.fallbackWarn)||Sc(e.fallbackWarn)?e.fallbackWarn:!0,h=t?t.fallbackRoot:en(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,_=Pn(e.missing)?e.missing:null,k=Pn(e.missing)?rx(e.missing):null,g=Pn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:en(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const A=t?t.modifiers:Yt(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&Gb(null);const de={version:oN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:L,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};de.datetimeFormats=u.value,de.numberFormats=d.value,de.__datetimeFormatters=Yt($)?$.__datetimeFormatters:void 0,de.__numberFormatters=Yt($)?$.__numberFormatters:void 0;const $e=j7(de);return s&&Gb($e),$e})(),lu($,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const N=P({get:()=>l.value,set:de=>{$.locale=de,l.value=de}}),F=P({get:()=>a.value,set:de=>{$.fallbackLocale=de,a.value=de,lu($,l.value,de)}}),S=P(()=>c.value),T=P(()=>u.value),R=P(()=>d.value);function O(){return Pn(g)?g:null}function D(de){g=de,$.postTranslation=de}function W(){return _}function z(de){de!==null&&(k=rx(de)),_=de,$.missing=k}const V=(de,$e,Qe,tt,vt,wt)=>{E();let xt;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?U7():void 0),xt=de($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Qe!=="translate exists"&&as(xt)&&xt===$p||Qe==="translate exists"&&!xt){const[Rt,yt]=$e();return t&&h?tt(t):vt(Rt)}else{if(wt(xt))return xt;throw vo(no.UNEXPECTED_RETURN_TYPE)}};function U(...de){return V($e=>Reflect.apply(tx,null,[$e,...de]),()=>gg(...de),"translate",$e=>Reflect.apply($e.t,$e,[...de]),$e=>$e,$e=>gt($e))}function re(...de){const[$e,Qe,tt]=de;if(tt&&!tn(tt))throw vo(no.INVALID_ARGUMENT);return U($e,Qe,cs({resolvedMessage:!0},tt||{}))}function ae(...de){return V($e=>Reflect.apply(Zb,null,[$e,...de]),()=>pg(...de),"datetime format",$e=>Reflect.apply($e.d,$e,[...de]),()=>Ah,$e=>gt($e)||Yn($e))}function te(...de){return V($e=>Reflect.apply(Xb,null,[$e,...de]),()=>mg(...de),"number format",$e=>Reflect.apply($e.n,$e,[...de]),()=>Ah,$e=>gt($e)||Yn($e))}function Z(de){return de.map($e=>gt($e)||as($e)||en($e)?nx(String($e)):$e)}const ke={normalize:Z,interpolate:de=>de,type:"vnode"};function Se(...de){return V($e=>{let Qe;const tt=$e;try{tt.processor=ke,Qe=Reflect.apply(tx,null,[tt,...de])}finally{tt.processor=null}return Qe},()=>gg(...de),"translate",$e=>$e[vg](...de),$e=>[nx($e)],$e=>Yn($e))}function Ye(...de){return V($e=>Reflect.apply(Xb,null,[$e,...de]),()=>mg(...de),"number format",$e=>$e[kg](...de),ox,$e=>gt($e)||Yn($e))}function ve(...de){return V($e=>Reflect.apply(Zb,null,[$e,...de]),()=>pg(...de),"datetime format",$e=>$e[yg](...de),ox,$e=>gt($e)||Yn($e))}function Y(de){L=de,$.pluralRules=L}function ce(de,$e){return V(()=>{if(!de)return!1;const Qe=gt($e)?$e:l.value,tt=gt($e)?[Qe]:hg($,a.value,Qe);for(let vt=0;vt<tt.length;vt++){const wt=se(tt[vt]);let xt=$.messageResolver(wt,de);if(xt===null&&(xt=wt[de]),Wi(xt)||ni(xt)||gt(xt))return!0}return!1},()=>[de],"translate exists",Qe=>Reflect.apply(Qe.te,Qe,[de,$e]),rN,Qe=>en(Qe))}function fe(de){let $e=null;const Qe=hg($,a.value,l.value);for(let tt=0;tt<Qe.length;tt++){const vt=c.value[Qe[tt]]||{},wt=$.messageResolver(vt,de);if(wt!=null){$e=wt;break}}return $e}function j(de){const $e=fe(de);return $e??(t?t.tm(de)||{}:{})}function se(de){return c.value[de]||{}}function ge(de,$e){if(o){const Qe={[de]:$e};for(const tt in Qe)ri(Qe,tt)&&Ju(Qe[tt]);$e=Qe[de]}c.value[de]=$e,$.messages=c.value}function ue(de,$e){c.value[de]=c.value[de]||{};const Qe={[de]:$e};if(o)for(const tt in Qe)ri(Qe,tt)&&Ju(Qe[tt]);$e=Qe[de],Wf($e,c.value[de]),$.messages=c.value}function pe(de){return u.value[de]||{}}function q(de,$e){u.value[de]=$e,$.datetimeFormats=u.value,Qb($,de,$e)}function J(de,$e){u.value[de]=cs(u.value[de]||{},$e),$.datetimeFormats=u.value,Qb($,de,$e)}function he(de){return d.value[de]||{}}function Te(de,$e){d.value[de]=$e,$.numberFormats=d.value,Jb($,de,$e)}function Ie(de,$e){d.value[de]=cs(d.value[de]||{},$e),$.numberFormats=d.value,Jb($,de,$e)}ix++,t&&Ch&&(Ke(t.locale,de=>{r&&(l.value=de,$.locale=de,lu($,l.value,a.value))}),Ke(t.fallbackLocale,de=>{r&&(a.value=de,$.fallbackLocale=de,lu($,l.value,a.value))}));const Oe={id:ix,locale:N,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(de){r=de,de&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,lu($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return L||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(de){f=de,$.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(de){p=de,$.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(de){h=de},get fallbackFormat(){return m},set fallbackFormat(de){m=de,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(de){v=de,$.warnHtmlMessage=de},get escapeParameter(){return y},set escapeParameter(de){y=de,$.escapeParameter=de},t:U,getLocaleMessage:se,setLocaleMessage:ge,mergeLocaleMessage:ue,getPostTranslationHandler:O,setPostTranslationHandler:D,getMissingHandler:W,setMissingHandler:z,[A3]:Y};return Oe.datetimeFormats=T,Oe.numberFormats=R,Oe.rt=re,Oe.te=ce,Oe.tm=j,Oe.d=ae,Oe.n=te,Oe.getDateTimeFormat=pe,Oe.setDateTimeFormat=q,Oe.mergeDateTimeFormat=J,Oe.getNumberFormat=he,Oe.setNumberFormat=Te,Oe.mergeNumberFormat=Ie,Oe[M3]=n,Oe[vg]=Se,Oe[yg]=ve,Oe[kg]=Ye,Oe}function aN(e){const t=gt(e.locale)?e.locale:Xu,n=gt(e.fallbackLocale)||Yn(e.fallbackLocale)||Yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Pn(e.missing)?e.missing:void 0,o=en(e.silentTranslationWarn)||Sc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=en(e.silentFallbackWarn)||Sc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=en(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Yt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Pn(e.postTranslation)?e.postTranslation:void 0,d=gt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,p=en(e.sync)?e.sync:!0;let h=e.messages;if(Yt(e.sharedMessages)){const A=e.sharedMessages;h=Object.keys(A).reduce(($,x)=>{const E=$[x]||($[x]={});return cs(E,A[x]),$},h||{})}const{__i18n:m,__root:_,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:h,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:p,__i18n:m,__root:_,__injectWithOption:k}}function bg(e={}){const t=Mh(aN(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 cN(e,t,n){return{beforeCreate(){const s=ed();if(!s)throw vo(no.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=lx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=bg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=lx(e,o);else{this.$i18n=bg({__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&&T3(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=ed();if(!s)throw vo(no.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 lx(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[A3](t.pluralizationRules||e.pluralizationRules);const n=Zv(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 Qv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function uN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Be?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},kn())}function N3(){return Be}const dN=qe({name:"i18n-t",props:cs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>as(e)||!isNaN(e)}},Qv),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Et({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=kn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=gt(e.plural)?+e.plural:e.plural);const u=uN(t,a);return o[vg](e.keypath,u,c)},r=cs(kn(),s),l=gt(e.tag)||tn(e.tag)?e.tag:N3();return tn(l)?dn(l,r,{default:i}):dn(l,r,i())}}}),ax=dN;function fN(e){return Yn(e)&&!gt(e[0])}function I3(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=kn();e.locale&&(c.locale=e.locale),gt(e.format)?c.key=e.format:tn(e.format)&&(gt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((p,h)=>n.includes(h)?cs(kn(),p,{[h]:e.format[h]}):p,kn()));const d=s(e.value,c,u);let f=[c.key];return Yn(d)?f=d.map((p,h)=>{const m=o[p.type],_=m?m({[p.type]:p.value,index:h,parts:d}):[p.value];return fN(_)&&(_[0].key=`${p.type}-${h}`),_}):gt(d)&&(f=[d]),f},l=cs(kn(),i),a=gt(e.tag)||tn(e.tag)?e.tag:N3();return tn(a)?dn(a,l,{default:r}):dn(a,l,r())}}const hN=qe({name:"i18n-n",props:cs({value:{type:Number,required:!0},format:{type:[String,Object]}},Qv),setup(e,t){const n=e.i18n||Et({useScope:e.scope,__useComponent:!0});return I3(e,t,w3,(...s)=>n[kg](...s))}}),cx=hN;function pN(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 mN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw vo(no.UNEXPECTED_ERROR);const c=pN(e,l.$),u=ux(a);return[Reflect.apply(c.t,c,[...dx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Ch&&(r.__i18nWatcher=Ke(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Ch&&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=ux(l);r.textContent=Reflect.apply(a.t,a,[...dx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function ux(e){if(gt(e))return{path:e};if(Yt(e)){if(!("path"in e))throw vo(no.REQUIRED_VALUE,"path");return e}else throw vo(no.INVALID_VALUE)}function dx(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return gt(n)&&(r.locale=n),as(o)&&(r.plural=o),as(i)&&(r.plural=i),[t,l,r]}function gN(e,t,...n){const s=Yt(n[0])?n[0]:{};(en(s.globalInstall)?s.globalInstall:!0)&&([ax.name,"I18nT"].forEach(i=>e.component(i,ax)),[cx.name,"I18nN"].forEach(i=>e.component(i,cx)),[px.name,"I18nD"].forEach(i=>e.component(i,px))),e.directive("t",mN(t))}const vN=gl("global-vue-i18n");function yN(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]=kN(e,t),r=gl("");function l(d){return s.get(d)||null}function a(d,f){s.set(d,f)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Yt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let p=null;!t&&n&&(p=AN(d,u.global)),__VUE_I18N_FULL_INSTALL__&&gN(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(cN(i,i.__composer,u));const h=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),h()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Et(e={}){const t=ed();if(t==null)throw vo(no.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw vo(no.NOT_INSTALLED);const n=bN(t),s=_N(n),o=E3(t),i=xN(e,o);if(i==="global")return T3(s,e,o),s;if(i==="parent"){let a=fx(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw vo(no.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=cs({},e),u=fx(n,t);c.__root=u||s;const d=Mh(c);return a.__composerExtend&&(d[ec]=a.__composerExtend(d)),wv()&&Sv(()=>{const p=d[ec];p&&(p(),delete d[ec])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=cs({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=Mh(a),r.__composerExtend&&(l[ec]=r.__composerExtend(l)),SN(r,t,l),r.__setInstance(t,l)}return l}function kN(e,t){const n=q8(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>bg(e)):n.run(()=>Mh(e));if(s==null)throw vo(no.UNEXPECTED_ERROR);return[n,s]}function bN(e){const t=Ut(e.isCE?vN:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw vo(e.isCE?no.NOT_INSTALLED_WITH_PROVIDE:no.UNEXPECTED_ERROR);return t}function xN(e,t){return Np(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function _N(e){return e.mode==="composition"?e.global:e.global.__composer}function fx(e,t,n=!1){let s=null;const o=t.root;let i=wN(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[M3]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function wN(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function SN(e,t,n){ln(()=>{},t),fn(()=>{const s=n;e.__deleteInstance(t);const o=s[ec];o&&(o(),delete s[ec])},t)}const CN=["locale","fallbackLocale","availableLocales"],hx=["t","rt","d","n","tm","te"];function AN(e,t){const n=Object.create(null);return CN.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw vo(no.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,hx.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw vo(no.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,hx.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const MN=qe({name:"i18n-d",props:cs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Qv),setup(e,t){const n=e.i18n||Et({useScope:e.scope,__useComponent:!0});return I3(e,t,_3,(...s)=>n[yg](...s))}}),px=MN;iN();D7(k7);P7(O7);H7(hg);if(__INTLIFY_PROD_DEVTOOLS__){const e=Vl();e.__INTLIFY__=!0,b7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const EN="modulepreload",TN=function(e){return"/"+e},mx={},eo=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=TN(c),c in mx)return;mx[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":EN,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(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)})},$t={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function gx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function Qn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ts(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Ac(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Lp(e){const t=Qn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function _d(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Xv(){const e=Qn($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 Jv(e){const n={...Xv()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ts($t.unread,JSON.stringify(n))}function NN(){const e=Lp($t.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function M1(e){_d($t.collapsedWorkspaces,Array.from(e))}function IN(){const e=Lp($t.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function $3(e){_d($t.workspaceOrder,Array.from(e))}function gf(){const e=Lp($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 vx(e){_d($t.workspaceNameOverrides,e)}function $N(){return Qn($t.workspaceSort)}function L3(e){ts($t.workspaceSort,e)}const yx=$t.clientId,LN="kimi-code-web",FN="web";function ON(){return{serverHttpUrl:BN(),clientId:WN(),clientName:LN,clientVersion:zN(),clientUiMode:FN}}function RN(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function BN(e){const t=RN(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function DN(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function PN(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return DN(e)}function Mu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function HN(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 WN(){const e=Qn(yx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ts(yx,t),t}function zN(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function js(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return UN(e)}function UN(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 jN(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 qN(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 VN(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 KN(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const GN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function kx(e){return e.replace(/[&<>"']/g,t=>GN[t]??t)}function YN(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ZN(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 bx(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return bx(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 bx(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function E1(e,t){const n=kx(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(YN(kx(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const Ka=Q(0),QN=["type","disabled","aria-label"],XN=qe({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),I("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},[In(s.$slots,"default",{},void 0,!0)],10,QN))}}),ut=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Nn=ut(XN,[["__scopeId","data-v-c9e67023"]]),JN={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function eI(e,t){return b(),I("svg",JN,[...t[0]||(t[0]=[w("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const tI=mt({name:"kimi-add-conversation",render:eI}),nI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sI(e,t){return b(),I("svg",nI,[...t[0]||(t[0]=[w("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const oI=mt({name:"kimi-folder",render:sI}),iI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rI=["clip-path"],lI=["id"];function aI(e,t){return b(),I("svg",iI,[w("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[w("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,rI),w("defs",null,[w("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[w("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,lI)])])}const cI=mt({name:"kimi-folder-open",render:aI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),uI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dI(e,t){return b(),I("svg",uI,[...t[0]||(t[0]=[w("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),w("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),w("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const fI=mt({name:"kimi-more",render:dI}),hI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pI(e,t){return b(),I("svg",hI,[...t[0]||(t[0]=[w("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const mI=mt({name:"kimi-search",render:pI}),gI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function vI(e,t){return b(),I("svg",gI,[...t[0]||(t[0]=[w("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),w("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const yI=mt({name:"kimi-setting",render:vI}),kI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bI(e,t){return b(),I("svg",kI,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const xI=mt({name:"tabler-layout-sidebar-left-collapse",render:bI}),_I={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wI(e,t){return b(),I("svg",_I,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const SI=mt({name:"tabler-layout-sidebar-left-expand",render:wI}),CI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AI(e,t){return b(),I("svg",CI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const MI=mt({name:"ri-add-line",render:AI}),EI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TI(e,t){return b(),I("svg",EI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const NI=mt({name:"ri-alert-line",render:TI}),II={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $I(e,t){return b(),I("svg",II,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const LI=mt({name:"ri-arrow-down-line",render:$I}),FI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OI(e,t){return b(),I("svg",FI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const RI=mt({name:"ri-arrow-down-s-line",render:OI}),BI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DI(e,t){return b(),I("svg",BI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const PI=mt({name:"ri-arrow-go-back-line",render:DI}),HI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WI(e,t){return b(),I("svg",HI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const zI=mt({name:"ri-arrow-right-line",render:WI}),UI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jI(e,t){return b(),I("svg",UI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const qI=mt({name:"ri-arrow-right-s-line",render:jI}),VI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KI(e,t){return b(),I("svg",VI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const xx=mt({name:"ri-arrow-up-line",render:KI}),GI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YI(e,t){return b(),I("svg",GI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const ZI=mt({name:"ri-braces-line",render:YI}),QI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XI(e,t){return b(),I("svg",QI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const JI=mt({name:"ri-calendar-close-line",render:XI}),e$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t$(e,t){return b(),I("svg",e$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const n$=mt({name:"ri-calendar-schedule-line",render:t$}),s$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o$(e,t){return b(),I("svg",s$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const i$=mt({name:"ri-calendar-todo-line",render:o$}),r$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l$(e,t){return b(),I("svg",r$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const a$=mt({name:"ri-check-line",render:l$}),c$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u$(e,t){return b(),I("svg",c$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const d$=mt({name:"ri-close-line",render:u$}),f$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h$(e,t){return b(),I("svg",f$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const p$=mt({name:"ri-code-line",render:h$}),m$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g$(e,t){return b(),I("svg",m$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const v$=mt({name:"ri-collapse-diagonal-line",render:g$}),y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k$(e,t){return b(),I("svg",y$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const b$=mt({name:"ri-download-line",render:k$}),x$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _$(e,t){return b(),I("svg",x$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const w$=mt({name:"ri-draggable",render:_$}),S$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C$(e,t){return b(),I("svg",S$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const A$=mt({name:"ri-equalizer-line",render:C$}),M$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E$(e,t){return b(),I("svg",M$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const T$=mt({name:"ri-expand-diagonal-line",render:E$}),N$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function I$(e,t){return b(),I("svg",N$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const $$=mt({name:"ri-external-link-line",render:I$}),L$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function F$(e,t){return b(),I("svg",L$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const O$=mt({name:"ri-file-add-line",render:F$}),R$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B$(e,t){return b(),I("svg",R$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const D$=mt({name:"ri-file-copy-line",render:B$}),P$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H$(e,t){return b(),I("svg",P$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const W$=mt({name:"ri-file-edit-line",render:H$}),z$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U$(e,t){return b(),I("svg",z$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const _x=mt({name:"ri-file-line",render:U$}),j$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q$(e,t){return b(),I("svg",j$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const V$=mt({name:"ri-file-text-line",render:q$}),K$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G$(e,t){return b(),I("svg",K$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const Y$=mt({name:"ri-flashlight-line",render:G$}),Z$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q$(e,t){return b(),I("svg",Z$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const X$=mt({name:"ri-folder-add-line",render:Q$}),J$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eL(e,t){return b(),I("svg",J$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const tL=mt({name:"ri-folder-fill",render:eL}),nL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sL(e,t){return b(),I("svg",nL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const oL=mt({name:"ri-git-pull-request-line",render:sL}),iL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rL(e,t){return b(),I("svg",iL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const lL=mt({name:"ri-global-line",render:rL}),aL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cL(e,t){return b(),I("svg",aL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const wx=mt({name:"ri-image-line",render:cL}),uL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dL(e,t){return b(),I("svg",uL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const fL=mt({name:"ri-information-line",render:dL}),hL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pL(e,t){return b(),I("svg",hL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const mL=mt({name:"ri-links-line",render:pL}),gL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vL(e,t){return b(),I("svg",gL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const yL=mt({name:"ri-list-check",render:vL}),kL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bL(e,t){return b(),I("svg",kL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const xL=mt({name:"ri-list-unordered",render:bL}),_L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wL(e,t){return b(),I("svg",_L,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const SL=mt({name:"ri-login-box-line",render:wL}),CL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AL(e,t){return b(),I("svg",CL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const ML=mt({name:"ri-mail-line",render:AL}),EL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TL(e,t){return b(),I("svg",EL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const NL=mt({name:"ri-message-line",render:TL}),IL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $L(e,t){return b(),I("svg",IL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const LL=mt({name:"ri-pause-fill",render:$L}),FL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OL(e,t){return b(),I("svg",FL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const RL=mt({name:"ri-pencil-line",render:OL}),BL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DL(e,t){return b(),I("svg",BL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const PL=mt({name:"ri-play-fill",render:DL}),HL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WL(e,t){return b(),I("svg",HL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const zL=mt({name:"ri-question-line",render:WL}),UL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jL(e,t){return b(),I("svg",UL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const qL=mt({name:"ri-sort-desc",render:jL}),VL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KL(e,t){return b(),I("svg",VL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const GL=mt({name:"ri-sparkling-line",render:KL}),YL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZL(e,t){return b(),I("svg",YL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const QL=mt({name:"ri-star-fill",render:ZL}),XL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JL(e,t){return b(),I("svg",XL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const eF=mt({name:"ri-star-line",render:JL}),tF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nF(e,t){return b(),I("svg",tF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const sF=mt({name:"ri-stop-fill",render:nF}),oF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iF(e,t){return b(),I("svg",oF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const rF=mt({name:"ri-subtract-line",render:iF}),lF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aF(e,t){return b(),I("svg",lF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const cF=mt({name:"ri-target-line",render:aF}),uF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dF(e,t){return b(),I("svg",uF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const fF=mt({name:"ri-terminal-box-line",render:dF}),hF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pF(e,t){return b(),I("svg",hF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const mF=mt({name:"ri-time-line",render:pF}),gF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vF(e,t){return b(),I("svg",gF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const yF=mt({name:"ri-tools-line",render:vF}),kF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bF(e,t){return b(),I("svg",kF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const xF=mt({name:"ri-user-line",render:bF}),_F=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
39
+ <path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
40
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
41
+ </svg>
42
+ `,wF=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ <path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
44
+ </svg>
45
+ `,SF=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
+ <g clip-path="url(#clip0_4626_2033)">
47
+ <path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
48
+ </g>
49
+ <defs>
50
+ <clipPath id="clip0_4626_2033">
51
+ <rect width="24" height="24" fill="white"/>
52
+ </clipPath>
53
+ </defs>
54
+ </svg>
55
+ `,CF=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
56
+ <path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
57
+ <path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
58
+ <path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
59
+ </svg>
60
+ `,AF=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
+ <path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
62
+ </svg>
63
+ `,MF=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
64
+ <path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
65
+ <path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
66
+ </svg>
67
+ `,EF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',TF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',NF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',IF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',$F='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',LF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',FF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',OF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',RF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',Sx='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',BF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',DF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',PF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',HF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',WF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',zF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',UF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',jF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',qF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',VF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',KF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',GF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',YF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',ZF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',QF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',XF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',Cx='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',JF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',eO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',tO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',nO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',sO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',oO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',Ax='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',iO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',rO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',lO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',aO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',cO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',uO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',dO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',fO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',hO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',pO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',mO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',gO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',vO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',yO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',kO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',bO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',xO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',_O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',wO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',SO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',CO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',AO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',F3={sm:14,md:16,lg:20};function kt(e,t){return{component:e,svg:t}}const O3={plus:kt(MI,NF),"chat-new":kt(tI,_F),"calendar-close":kt(JI,DF),"calendar-schedule":kt(n$,PF),"calendar-todo":kt(i$,HF),close:kt(d$,zF),check:kt(a$,WF),search:kt(mI,AF),copy:kt(D$,QF),link:kt(mL,rO),"external-link":kt($$,YF),download:kt(b$,qF),undo:kt(PI,FF),send:kt(xx,Sx),image:kt(wx,Ax),settings:kt(yI,MF),sliders:kt(A$,KF),"log-in":kt(SL,cO),"chevron-down":kt(RI,LF),"chevron-right":kt(qI,RF),"arrow-up":kt(xx,Sx),"arrow-down":kt(LI,$F),"arrow-right":kt(zI,OF),minus:kt(rF,xO),"panel-collapse":kt(xI,EF),"panel-expand":kt(SI,TF),expand:kt(T$,GF),collapse:kt(v$,jF),list:kt(xL,aO),sort:kt(qL,gO),grip:kt(w$,VF),folder:kt(cI,SF),"folder-closed":kt(oI,wF),"folder-plus":kt(X$,tO),"folder-solid":kt(tL,nO),file:kt(_x,Cx),"file-text":kt(V$,JF),"file-edit":kt(W$,XF),"file-plus":kt(O$,ZF),"file-off":kt(_x,Cx),"image-off":kt(wx,Ax),code:kt(p$,UF),terminal:kt(fF,wO),pencil:kt(RL,hO),tool:kt(yF,CO),glob:kt(ZI,BF),globe:kt(lL,oO),"check-list":kt(yL,lO),bolt:kt(Y$,eO),"git-pull-request":kt(oL,sO),message:kt(NL,dO),mail:kt(ML,uO),user:kt(xF,AO),info:kt(fL,iO),"help-circle":kt(zL,mO),"alert-triangle":kt(NI,IF),clock:kt(mF,SO),sparkles:kt(GL,vO),target:kt(cF,_O),pause:kt(LL,fO),play:kt(PL,pO),stop:kt(sF,bO),star:kt(QL,yO),"star-outline":kt(eF,kO),"dots-horizontal":kt(fI,CF)};function MO(e){return O3[e]}function EO(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Ga(e,t="md"){const n=O3[e];return n?EO(n.svg,F3[t]):""}const jbe=[["Actions",["plus","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-pull-request","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],Ve=qe({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=P(()=>MO(t.name)),s=P(()=>F3[t.size]);return(o,i)=>n.value?(b(),ye($s(n.value.component),{key:0,class:"kw-icon",width:s.value,height:s.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):le("",!0)}}),TO={key:0,class:"ui-dialog__head"},NO={class:"ui-dialog__titles"},IO={key:0,class:"ui-dialog__title"},$O={key:1,class:"ui-dialog__desc"},LO={class:"ui-dialog__body"},FO={key:1,class:"ui-dialog__foot"},OO='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',RO=qe({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=Q(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(OO)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?o.value?.querySelector(d)??null:o.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),p=f[0],h=f[f.length-1];if(!p||!h){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===p?(d.preventDefault(),h.focus()):!d.shiftKey&&m===h&&(d.preventDefault(),p.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Ke(()=>n.open,async d=>{if(d){Ka.value+=1,i=document.activeElement,await pt();const f=a(),p=l();(f??p[0]??o.value)?.focus()}else Ka.value=Math.max(0,Ka.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),es(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Ka.value=Math.max(0,Ka.value-1))}),(d,f)=>(b(),ye(Ap,{to:"body"},[e.open?(b(),I("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[w("div",{ref_key:"panel",ref:o,class:De(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(b(),I("div",TO,[In(d.$slots,"head",{},()=>[w("div",NO,[e.title?(b(),I("div",IO,B(e.title),1)):le("",!0),e.description?(b(),I("div",$O,B(e.description),1)):le("",!0)])],!0),ie(Nn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[ie(Ve,{name:"close",size:"md"})]),_:1})])):le("",!0),w("div",LO,[In(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(b(),I("div",FO,[In(d.$slots,"foot",{},void 0,!0)])):le("",!0)],2)],32)):le("",!0)]))}}),Sr=ut(RO,[["__scopeId","data-v-3dce23a4"]]),BO={class:"sd-head"},DO=["placeholder","aria-label"],PO=["aria-selected","onClick","onMousemove"],HO={class:"sd-meta"},WO=["innerHTML"],zO={class:"sd-time"},UO=["innerHTML"],jO=["innerHTML"],qO={key:1,class:"sd-empty"},VO={class:"sd-hint"},KO=200,GO=qe({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=Q(""),l=Q(null),a=Q(null),c=P(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",A=v.lastPrompt??"",L=v.workspaceName??"",$=k.length>0&&y.toLowerCase().includes(k),x=k.length>0&&A.toLowerCase().includes(k),E=k.length>0&&L.toLowerCase().includes(k);if(!(k.length>0&&!$&&!x&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?ZN(A,r.value):""}),g.length>=KO))break}return g}),u=Q(0);Ke(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await pt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function p(k){u.value=d(u.value+k),f()}function h(k){o("select",k),o("close")}function m(){const k=c.value[u.value];k&&h(k.session.id)}function _(k){k.key==="ArrowDown"?(k.preventDefault(),p(1)):k.key==="ArrowUp"?(k.preventDefault(),p(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return ln(()=>{l.value?.focus()}),(k,g)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>o("close"))},{head:Ee(()=>[w("div",BO,[ie(Ve,{class:"sd-search-icon",name:"search",size:"md"}),Tn(w("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:_},null,40,DO),[[ao,r.value]])])]),foot:Ee(()=>[w("span",VO,B(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(b(!0),I(Be,{key:0},nt(c.value,(v,y)=>(b(),I("button",{key:v.session.id,class:De(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:A=>h(v.session.id),onMousemove:A=>u.value=y},[w("span",HO,[ie(Ve,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(E1)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,WO),w("span",zO,B(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(E1)(v.session.title,v.inTitle?r.value:"")},null,8,UO),v.snippetText?(b(),I("span",{key:0,class:"sd-snippet",innerHTML:C(E1)(v.snippetText,r.value)},null,8,jO)):le("",!0)],42,PO))),128)):(b(),I("div",qO,B(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),YO=ut(GO,[["__scopeId","data-v-a678f802"]]),ZO=["aria-label"],QO=qe({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(b(),I("span",{class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[w("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[w("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),w("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,ZO))}}),wo=ut(QO,[["__scopeId","data-v-e5c5b17d"]]),XO={key:0,class:"ui-badge__dot","aria-hidden":"true"},JO=qe({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(b(),I("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(b(),I("span",XO)):le("",!0),In(t.$slots,"default",{},void 0,!0)],2))}}),Ro=ut(JO,[["__scopeId","data-v-5bc5cd6d"]]),td=Q(null);function R3(e){const t=td.value;t&&(td.value=null,t.resolve(e))}function eR(e){return td.value&&R3(!1),new Promise(t=>{td.value={...e,resolve:t}})}function kl(){return{current:td,confirm:eR,settle:R3}}const tR=qe({__name:"Menu",setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),I("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[In(s.$slots,"default",{},void 0,!0)],512))}}),Jl=ut(tR,[["__scopeId","data-v-60e6cd8d"]]),nR={key:0,class:"ui-menu-sep",role:"separator"},sR=["disabled"],oR=qe({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(b(),I("div",nR)):(b(),I("button",{key:1,class:De(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[In(t.$slots,"default",{},void 0,!0)],10,sR))}}),Mn=ut(oR,[["__scopeId","data-v-f940771a"]]),Rr=6,Br=8,iR=150,rR=qe({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Q(),s=Q(),o=Q(!1),i=Q(!1),r=Q({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const _=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&_.top-Rr-g<Br?A="bottom":A==="bottom"&&_.bottom+Rr+g>y-Br?A="top":A==="left"&&_.left-Rr-k<Br?A="right":A==="right"&&_.right+Rr+k>v-Br&&(A="left");let L=0,$=0;A==="top"?(L=_.top-Rr-g,$=_.left+_.width/2-k/2):A==="bottom"?(L=_.bottom+Rr,$=_.left+_.width/2-k/2):A==="left"?(L=_.top+_.height/2-g/2,$=_.left-Rr-k):(L=_.top+_.height/2-g/2,$=_.right+Rr),$=Math.min(Math.max($,Br),v-Br-k),L=Math.min(Math.max(L,Br),y-Br-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,pt(()=>{u(),i.value=!0})},iR))}function f(){window.clearTimeout(l),o.value=!1,i.value=!1}function p(){o.value&&f()}function h(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return ln(()=>{const m=n.value??null;h(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const _=m.firstElementChild??null;_!==a&&(f(),h(_??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p)}),es(()=>{window.clearTimeout(l),c?.disconnect(),h(null),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}),(m,_)=>(b(),I(Be,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[In(m.$slots,"default",{},void 0,!0)],512),(b(),ye(Ap,{to:"body"},[Tn(w("div",{ref_key:"bubble",ref:s,class:De(["ui-tip__bubble",{positioned:i.value}]),style:qt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},B(e.text),7),[[oi,o.value]])]))],64))}}),jt=ut(rR,[["__scopeId","data-v-4c261eb6"]]),lR={class:"row"},aR={class:"lead","aria-hidden":"true"},cR={key:1,class:"unread-dot"},uR={class:"left"},dR=["onKeydown"],fR={class:"act"},hR={class:"ts"},pR={class:"menu-time"},mR=qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=Et(),{confirm:o}=kl(),i=e,r=n;function l(S){const T=new Date(S);if(Number.isNaN(T.getTime()))return S;const R=O=>String(O).padStart(2,"0");return`${T.getFullYear()}-${R(T.getMonth()+1)}-${R(T.getDate())} ${R(T.getHours())}:${R(T.getMinutes())}`}const a=P(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Q(!1),u=Q(null),d=Q(null),f=Q({});function p(S){const T=S.target;d.value?.el?.contains(T)||u.value?.el?.contains(T)||_()}function h(){const S=u.value?.el;if(!S)return;const T=d.value?.el,R=S.getBoundingClientRect(),O=4,D=8,W=T?.offsetHeight??0,z=T?.offsetWidth??0;let V=R.bottom+O;V+W>window.innerHeight-D&&(V=Math.max(D,R.top-W-O));let U=R.right-z;U<D&&(U=D),f.value={top:`${Math.round(V)}px`,left:`${Math.round(U)}px`}}async function m(S){if(S.stopPropagation(),c.value){_();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",p),0),window.addEventListener("resize",_),await pt(),h()}function _(){c.value=!1,document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)}fn(()=>{document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)});const k=Q(!1),g=Q(""),v=Q(null);async function y(){_(),k.value=!0,g.value=i.session.title,await pt();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const S=g.value.trim();S&&r("rename",i.session.id,S),k.value=!1}function L(){k.value=!1}const $=Q(!1),x=Q(!1);async function E(){const S=await js(i.session.id);$.value=S,x.value=!S,setTimeout(()=>{$.value=!1,x.value=!1,_()},1500)}function N(){_(),r("fork",i.session.id)}async function F(){_(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:_}),(S,T)=>(b(),I("div",{class:De(["se",{on:e.active}]),onClick:T[4]||(T[4]=R=>r("select",e.session.id))},[w("div",lR,[w("span",aR,[e.session.busy?(b(),ye(wo,{key:0,size:"sm"})):e.unread?(b(),I("span",cR)):le("",!0)]),w("div",uR,[k.value?Tn((b(),I("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":T[0]||(T[0]=R=>g.value=R),class:"rename-input",onClick:T[1]||(T[1]=bt(()=>{},["stop"])),onKeydown:[bi(bt(A,["stop"]),["enter"]),bi(bt(L,["stop"]),["esc"])],onBlur:A},null,40,dR)),[[ao,g.value]]):(b(),I("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},B(e.session.title),33))]),ie(jt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.awaitingAnswer")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(b(),ye(Ro,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.awaitingPermission")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.abortedTitle")},{default:Ee(()=>[!k.value&&e.session.status==="aborted"?(b(),ye(Ro,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Ge(B(C(s)("workspace.aborted")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),w("span",fR,[w("span",hR,B(e.session.time),1),k.value?le("",!0):(b(),ye(Nn,{key:0,ref_key:"kebabRef",ref:u,class:De(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:T[2]||(T[2]=bt(R=>m(R),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(b(),ye(Ap,{to:"body"},[c.value?(b(),ye(Jl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:qt(f.value),onClick:T[3]||(T[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{danger:x.value,onClick:E},{default:Ee(()=>[Ge(B(x.value?C(s)("sidebar.copyFailed"):$.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(Mn,{separator:""}),ie(Mn,{onClick:y},{default:Ee(()=>[Ge(B(C(s)("sidebar.rename")),1)]),_:1}),ie(Mn,{onClick:N},{default:Ee(()=>[Ge(B(C(s)("sidebar.fork")),1)]),_:1}),ie(Mn,{danger:"",onClick:F},{default:Ee(()=>[Ge(B(C(s)("sidebar.archive")),1)]),_:1}),ie(Mn,{separator:""}),w("div",pR,B(a.value),1)]),_:1},8,["style"])):le("",!0)]))],2))}}),gR=ut(mR,[["__scopeId","data-v-e3ea544d"]]),vR={class:"gh-top"},yR={class:"gh-name"},kR=["inert"],bR=["disabled"],xR={class:"show-more-label"},_R={class:"show-more-label"},wR={key:2,class:"group-empty"},SR=qe({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=P(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const f=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!f.some(p=>p.id===s.activeId)){const p=s.group.sessions.find(h=>h.id===s.activeId);if(p)return[...f,p]}return f}),l=P(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(f){s.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(f,p)=>(b(),I("div",{class:De(["group",{dragging:e.dragging}])},[w("div",{class:De(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:p[7]||(p[7]=bt(h=>o("groupClick",e.group.workspace.id,h),["stop"])),onContextmenu:p[8]||(p[8]=h=>o("groupContextmenu",e.group.workspace,h)),onDragstart:d,onDragend:p[9]||(p[9]=h=>o("wsDragend"))},[w("div",vR,[e.isCollapsed(e.group.workspace.id)?(b(),ye(Ve,{key:0,class:"gh-folder",name:"folder-closed"})):(b(),ye(Ve,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(b(),ye(jt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[w("span",yR,B(e.group.workspace.name),1)]),_:1},8,["text"])):Tn((b(),I("input",{key:3,ref:u,"onUpdate:modelValue":p[0]||(p[0]=h=>i.value=h),class:"gh-rename",type:"text",onKeydown:[p[1]||(p[1]=bi(h=>o("confirmRename"),["enter"])),p[2]||(p[2]=bi(h=>o("cancelRename"),["esc"]))],onBlur:p[3]||(p[3]=h=>o("cancelRename")),onClick:p[4]||(p[4]=bt(()=>{},["stop"]))},null,544)),[[ao,i.value]]),e.renamingId!==e.group.workspace.id?(b(),I("div",{key:4,class:De(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ie(Nn,{class:De(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:p[5]||(p[5]=bt(h=>o("toggleWsMenu",e.group.workspace,h),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ie(Nn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:p[6]||(p[6]=bt(h=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"chat-new"})]),_:1},8,["label"])],2)):le("",!0)])],34),w("div",{class:De(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(b(!0),I(Be,null,nt(r.value,h=>(b(),ye(gR,{key:h.id,session:h,active:h.id===e.activeId,"approval-count":e.pendingBySession[h.id]?.approvals??0,"question-count":e.pendingBySession[h.id]?.questions??0,unread:e.unreadBySession[h.id]??!1,onSelect:p[10]||(p[10]=m=>o("selectSession",m)),onRename:p[11]||(p[11]=(m,_)=>o("renameSession",m,_)),onArchive:p[12]||(p[12]=m=>o("archiveSession",m)),onFork:p[13]||(p[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(b(),I("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:p[14]||(p[14]=bt(h=>o("loadMore",e.group.workspace.id),["stop"]))},[p[16]||(p[16]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",xR,B(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,bR)):le("",!0),l.value?(b(),I("button",{key:1,class:"show-more",onClick:p[15]||(p[15]=bt(h=>o("toggleExpand",e.group.workspace.id),["stop"]))},[p[17]||(p[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",_R,B(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):le("",!0),e.group.sessions.length===0?(b(),I("div",wR,B(C(n)("sidebar.noSessions")),1)):le("",!0)],10,kR)],2))}}),CR=ut(SR,[["__scopeId","data-v-cbca6d9c"]]),AR="kimi_desktop",MR="platform",Mx="kimi-desktop",Ex="kimi-desktop-platform";function ER(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(AR)?(sessionStorage.setItem(Mx,"1"),e=!0):e=e||sessionStorage.getItem(Mx)==="1";const s=n.get(MR);s?(sessionStorage.setItem(Ex,s),t=s):t=sessionStorage.getItem(Ex)}catch{}return{isDesktop:e,platform:t}}const xg=ER(),TR=xg.isDesktop,pc=xg.isDesktop&&xg.platform==="darwin",NR={class:"ui-kbd"},IR=qe({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(b(),I("span",NR,[(b(!0),I(Be,null,nt(e.keys,s=>(b(),I("kbd",{key:s,class:"ui-kbd__key"},B(s),1))),128))]))}}),tr=ut(IR,[["__scopeId","data-v-32292ed8"]]),$R={class:"ch"},LR={class:"ch-brand"},FR={class:"ch-name"},OR={key:0,class:"ch-endpoint"},RR={class:"btn-wrap"},BR={class:"search-input"},DR={key:0,class:"empty"},PR={class:"side-section-label"},HR={class:"side-section-title"},WR={class:"side-section-actions"},zR=["onDragover","onDrop"],UR={class:"side-footer"},jR={class:"section-menu-check"},qR={class:"section-menu-check"},VR=1e3,KR=qe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=!1,i="",r=e,l=t,a=Q(!1),c=f()?["⌘","K"]:["Ctrl","K"];function u(){l("loadAllSessions"),a.value=!0}function d(Xe){(Xe.metaKey||Xe.ctrlKey)&&Xe.key.toLowerCase()==="k"&&(Xe.preventDefault(),u())}ln(()=>window.addEventListener("keydown",d)),es(()=>window.removeEventListener("keydown",d));function f(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Xe=navigator.userAgentData;return Xe?.platform==="macOS"||Xe?.platform==="iOS"}const p=Q(!1);function h(Xe){p.value=Xe.target.scrollTop>0}const m=Q(new Set(NN()));function _(Xe){return m.value.has(Xe)}function k(Xe){const Ze=new Set(m.value);Ze.has(Xe)?Ze.delete(Xe):Ze.add(Xe),m.value=Ze,M1(Ze)}function g(){const Xe=new Set(r.groups.map(Ze=>Ze.workspace.id));m.value=Xe,M1(Xe)}function v(){const Xe=new Set;m.value=Xe,M1(Xe)}const y=P(()=>r.groups.length>0&&r.groups.every(Xe=>m.value.has(Xe.workspace.id))),A=Q(new Set);function L(Xe){return A.value.has(Xe)}function $(Xe){const Ze=new Set(A.value);Ze.has(Xe)?Ze.delete(Xe):Ze.add(Xe),A.value=Ze}function x(Xe){if(!A.value.has(Xe)){const Ze=new Set(A.value);Ze.add(Xe),A.value=Ze}l("loadMoreSessions",Xe)}const E=Q(null),N=Q(null);function F(Xe){E.value=Xe}function S(){E.value=null,N.value=null}function T(Xe){const Ze=Xe.currentTarget.getBoundingClientRect();return Xe.clientY<Ze.top+Ze.height/2?"before":"after"}function R(Xe,Ze){E.value===null||E.value===Ze||(Xe.preventDefault(),Xe.dataTransfer&&(Xe.dataTransfer.dropEffect="move"),N.value={id:Ze,position:T(Xe)})}function O(Xe){const Ze=E.value,Mt=N.value?.id===Xe?N.value.position:"before";if(N.value=null,E.value=null,!Ze||Ze===Xe)return;const Dt=VN(r.groups.map(zt=>zt.workspace.id),Ze,Xe,Mt);l("reorderWorkspaces",Dt)}function D(Xe,Ze){Ze.target.closest(".gh-more, .gh-add")||k(Xe)}function W(Xe){l("select",Xe)}const z=Q(null),V=Q(""),U=Q(null);function re(){return U}function ae(Xe,Ze){z.value=Xe,V.value=Ze,pt().then(()=>U.value?.focus())}function te(){const Xe=z.value,Ze=V.value.trim();Xe&&Ze&&l("renameWorkspace",Xe,Ze),z.value=null}function Z(){z.value=null}function ne(Xe){V.value=Xe}const ke=Q(!1),Se=Q(null),Ye=Q({}),ve=Q(null);function Y(Xe){ve.value?.el&&!ve.value.el.contains(Xe.target)&&fe()}function ce(Xe,Ze){Ze.preventDefault(),Ze.stopPropagation(),Se.value=Xe,Ye.value={top:`${Ze.clientY}px`,left:`${Ze.clientX}px`},ke.value=!0,document.addEventListener("mousedown",Y,!0)}function fe(){ke.value=!1,document.removeEventListener("mousedown",Y,!0),Se.value=null}function j(){Se.value&&js(Se.value.root),fe()}function se(){Se.value&&ae(Se.value.id,Se.value.name),fe()}async function ge(){const Xe=Se.value;Xe&&(fe(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id))}const ue=Q(null),pe=Q(null),q=Q({}),J=Q(null);function he(Xe){const Ze=Xe.target;Ze.closest(".gh-more")||Ze.closest(".ws-menu")||Ie()}async function Te(Xe,Ze){if(ue.value===Xe.id){Ie();return}const Mt=Ze.currentTarget;pe.value=Xe,ue.value=Xe.id,document.addEventListener("mousedown",he),window.addEventListener("resize",Ie),await pt();const Dt=J.value?.el,zt=Mt.getBoundingClientRect(),wn=4,Rn=8,hs=Dt?.offsetHeight??0,ss=Dt?.offsetWidth??0;let sn=zt.bottom+wn;sn+hs>window.innerHeight-Rn&&(sn=Math.max(Rn,zt.top-hs-wn));let Lt=zt.right-ss;Lt<Rn&&(Lt=Rn),q.value={top:`${Math.round(sn)}px`,left:`${Math.round(Lt)}px`}}function Ie(){ue.value=null,pe.value=null,document.removeEventListener("mousedown",he),window.removeEventListener("resize",Ie)}function Oe(Xe){js(Xe.root),Ie()}function de(Xe){ae(Xe.id,Xe.name),Ie()}async function $e(Xe){Ie(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Xe.name}),variant:"danger"})&&l("deleteWorkspace",Xe.id)}const Qe=Q(!1),tt=Q({}),vt=Q(null);function wt(Xe){const Ze=Xe.target;Ze.closest(".side-section-kebab")||Ze.closest(".section-menu")||Rt()}async function xt(Xe){if(Qe.value){Rt();return}const Ze=Xe.currentTarget;Qe.value=!0,document.addEventListener("mousedown",wt),window.addEventListener("resize",Rt),await pt();const Mt=vt.value?.el,Dt=Ze.getBoundingClientRect(),zt=4,wn=8,Rn=Mt?.offsetHeight??0,hs=Mt?.offsetWidth??0;let ss=Dt.bottom+zt;ss+Rn>window.innerHeight-wn&&(ss=Math.max(wn,Dt.top-Rn-zt));let sn=Dt.right-hs;sn<wn&&(sn=wn),tt.value={top:`${Math.round(ss)}px`,left:`${Math.round(sn)}px`}}function Rt(){Qe.value=!1,document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Rt)}function yt(Xe){l("setWorkspaceSortMode",Xe),Rt()}es(()=>{document.removeEventListener("mousedown",Y,!0),document.removeEventListener("mousedown",he),document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Ie),window.removeEventListener("resize",Rt)});const nn=Q(null);let xn;function ns(){const Xe=nn.value;Xe&&(Xe.classList.remove("blink-now"),Xe.getBoundingClientRect(),Xe.classList.add("blink-now"),clearTimeout(xn),xn=setTimeout(()=>Xe.classList.remove("blink-now"),300))}const Wt=ki(()=>eo(()=>import("./DesignSystemView-DQSXggUP.js"),__vite__mapDeps([0,1]))),_n=Q(!1);let gn,ot=!1;function ds(Xe){ot=!1,clearTimeout(gn),Xe.currentTarget.setPointerCapture?.(Xe.pointerId),gn=setTimeout(()=>{ot=!0,_n.value=!0},VR)}function ys(Xe){clearTimeout(gn);const Ze=Xe.currentTarget;Ze.hasPointerCapture?.(Xe.pointerId)&&Ze.releasePointerCapture(Xe.pointerId)}function fs(){if(ot){ot=!1;return}ns()}return es(()=>{clearTimeout(gn)}),(Xe,Ze)=>(b(),I("aside",{class:De(["side",{"macos-desktop":C(pc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:qt({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:qt({width:e.colWidth+"px"})},[w("div",$R,[w("div",LR,[C(pc)?le("",!0):(b(),I(Be,{key:0},[(b(),I("svg",{ref_key:"logoRef",ref:nn,class:De(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:fs,onPointerdown:ds,onPointerup:ys,onPointercancel:ys},[...Ze[20]||(Ze[20]=[Hv('<defs data-v-c1a5226d><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-c1a5226d><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-c1a5226d></rect><g class="ch-eyes" fill="#000" data-v-c1a5226d><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-c1a5226d></rect>',2)])],34)),w("span",FR,[Ze[21]||(Ze[21]=Ge("Kimi Code",-1)),C(o)?(b(),I("span",OR," · "+B(C(i)),1)):le("",!0)])],64))]),C(pc)?le("",!0):(b(),ye(Nn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Ze[0]||(Ze[0]=bt(Mt=>l("collapse"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",RR,[w("button",{class:"btn-new-chat",type:"button",onClick:Ze[1]||(Ze[1]=bt(Mt=>l("create"),["stop"]))},[ie(Ve,{name:"chat-new"}),w("span",null,B(C(n)("sidebar.newChat")),1)]),le("",!0)]),w("div",{class:De(["search-wrap",{"search-wrap--scrolled":p.value}])},[w("button",{class:"search",type:"button",onClick:u},[ie(Ve,{class:"search-icon",name:"search"}),w("span",BR,B(C(n)("sidebar.search")),1),ie(tr,{keys:C(c)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:h},[e.groups.length===0?(b(),I("div",DR,B(C(n)("workspace.noWorkspace")),1)):(b(),I(Be,{key:1},[w("div",PR,[w("span",HR,B(C(n)("sidebar.workspaces")),1),w("div",WR,[ie(Nn,{class:"side-section-toggle",size:"sm",label:y.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Ze[3]||(Ze[3]=bt(Mt=>y.value?v():g(),["stop"]))},{default:Ee(()=>[y.value?(b(),ye(Ve,{key:0,name:"expand"})):(b(),ye(Ve,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Nn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Qe.value,onClick:Ze[4]||(Ze[4]=bt(Mt=>xt(Mt),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(b(!0),I(Be,null,nt(e.groups,Mt=>(b(),I("div",{key:Mt.workspace.id,class:De(["ws-drop-target",{"drop-before":N.value?.id===Mt.workspace.id&&N.value.position==="before","drop-after":N.value?.id===Mt.workspace.id&&N.value.position==="after"}]),onDragover:Dt=>R(Dt,Mt.workspace.id),onDrop:Dt=>O(Mt.workspace.id)},[ie(CR,{group:Mt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":z.value,"rename-value":V.value,"rename-input-ref":re(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ue.value,dragging:E.value===Mt.workspace.id,"is-collapsed":_,"is-expanded":L,onGroupClick:D,onGroupContextmenu:ce,onToggleWsMenu:Te,onCreateInWorkspace:Ze[5]||(Ze[5]=Dt=>l("createInWorkspace",Dt)),onSelectSession:W,onRenameSession:Ze[6]||(Ze[6]=(Dt,zt)=>l("rename",Dt,zt)),onArchiveSession:Ze[7]||(Ze[7]=Dt=>l("archive",Dt)),onForkSession:Ze[8]||(Ze[8]=Dt=>l("fork",Dt)),onLoadMore:x,onToggleExpand:$,onConfirmRename:te,onCancelRename:Z,onUpdateRenameValue:ne,onWsDragstart:F,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,zR))),128))],64))],32),w("div",UR,[w("button",{class:"btn-settings",type:"button",onClick:Ze[9]||(Ze[9]=bt(Mt=>l("openSettings"),["stop"]))},[ie(Ve,{name:"settings"}),w("span",null,B(C(n)("settings.title")),1)])])],4),ke.value?(b(),ye(Jl,{key:0,ref_key:"ghMenuRef",ref:ve,class:"gh-menu",style:qt(Ye.value),onClick:Ze[10]||(Ze[10]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:j},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1}),ie(Mn,{onClick:se},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1}),ie(Mn,{danger:"",onClick:ge},{default:Ee(()=>[Ge(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),ue.value!==null&&pe.value?(b(),ye(Jl,{key:1,ref_key:"wsMenuRef",ref:J,class:"ws-menu",style:qt(q.value),onClick:Ze[14]||(Ze[14]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:Ze[11]||(Ze[11]=Mt=>Oe(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1}),ie(Mn,{separator:""}),ie(Mn,{onClick:Ze[12]||(Ze[12]=Mt=>de(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1}),ie(Mn,{separator:""}),ie(Mn,{danger:"",onClick:Ze[13]||(Ze[13]=Mt=>$e(pe.value))},{default:Ee(()=>[Ge(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),Qe.value?(b(),ye(Jl,{key:2,ref_key:"sectionMenuRef",ref:vt,class:"section-menu",style:qt(tt.value),onClick:Ze[17]||(Ze[17]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:Ze[15]||(Ze[15]=Mt=>yt("manual"))},{default:Ee(()=>[w("span",jR,[e.workspaceSortMode==="manual"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),Ge(" "+B(C(n)("sidebar.sortManual")),1)]),_:1}),ie(Mn,{onClick:Ze[16]||(Ze[16]=Mt=>yt("recent"))},{default:Ee(()=>[w("span",qR,[e.workspaceSortMode==="recent"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),Ge(" "+B(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):le("",!0),a.value?(b(),ye(YO,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:W,onClose:Ze[18]||(Ze[18]=Mt=>a.value=!1)},null,8,["sessions","active-id"])):le("",!0),(b(),ye(Ap,{to:"body"},[_n.value?(b(),ye(C(Wt),{key:0,onClose:Ze[19]||(Ze[19]=Mt=>_n.value=!1)})):le("",!0)]))],6))}}),GR=ut(KR,[["__scopeId","data-v-c1a5226d"]]);function YR(e){try{const t=Qn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function ZR(e,t){try{ts(e,String(t))}catch{}}function QR(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(YC(o),Math.max(s,Math.round(k))):n}const l=Q(r(YR(t)??n)),a=Q(!1);function c(k){const g=r(k);l.value=g,ZR(t,g)}let u=0,d=0,f=null,p=-1;function h(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(p)}catch{}f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,p=-1}}function _(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,p=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(p)}catch{}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return es(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const XR=["aria-label"],JR=qe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),{width:i,dragging:r,onPointerDown:l}=QR({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ke(i,a=>s("update:width",a)),Ke(r,a=>s("update:dragging",a)),(a,c)=>(b(),I("div",{class:De(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[w("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,XR))}}),Tx=ut(JR,[["__scopeId","data-v-ad762f1c"]]),eB=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Nx=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function tB(e){if(e<=255)return eB[e];let t=0,n=Nx.length-1;for(;t<=n;){const s=t+n>>1,o=Nx[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function nB(e){const t=e.length;if(t===0)return null;const n=new Array(t);let s=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const h=e.charCodeAt(c+1);h>=56320&&h<=57343&&(d=(u-55296<<10)+(h-56320)+65536,f=2)}const p=tB(d);(p==="R"||p==="AL"||p==="AN")&&(s=!0);for(let h=0;h<f;h++)n[c+h]=p;c+=f}if(!s)return null;let o=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){o=0;break}if(u==="R"||u==="AL"){o=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;const r=o&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,p=d!=="L"?"R":"L";if(p===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=p;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function sB(e,t){const n=nB(e);if(n===null)return null;const s=new Int8Array(t.length);for(let o=0;o<t.length;o++)s[o]=n[t[o]];return s}const oB=/[ \t\n\r\f]+/g,iB=/[\t\n\r\f]| {2,}|^ | $/;function rB(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function lB(e){if(!iB.test(e))return e;let t=e.replace(oB," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function aB(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
68
+ `).replace(/[\r\f]/g,`
69
+ `):e}let T1=null,cB;function uB(){return T1===null&&(T1=new Intl.Segmenter(cB,{granularity:"word"})),T1}const dB=/\p{Script=Arabic}/u,bl=/\p{M}/u,ey=/\p{Nd}/u;function Ix(e){return dB.test(e)}function $x(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function zi(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){const o=(n-55296<<10)+(s-56320)+65536;if($x(o))return!0;t++;continue}}if($x(n))return!0}}return!1}function fB(e){const t=wd(e);return t!==null&&(ty.has(t)||ra.has(t))}const hB=new Set([" "," ","⁠","\uFEFF"]),pB=new Set(["-","‐","–","—"]);function mB(e){const t=wd(e);return t!==null&&hB.has(t)}function gB(e){const t=wd(e);return t!==null&&pB.has(t)}function B3(e,t){return mB(e)?!1:t?!(fB(e)||gB(e)):!0}const ty=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Fp=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),ny=new Set(["'","’"]),ra=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),vB=new Set([":",".","،","؛"]),yB=new Set(["၏"]),kB=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function bB(e){if(sy(e))return!0;let t=!1;for(const n of e){if(ra.has(n)||Rp(n)){t=!0;continue}if(!(t&&bl.test(n)))return!1}return t}function xB(e){for(const t of e)if(!ty.has(t)&&!ra.has(t))return!1;return e.length>0}function _B(e){if(sy(e))return!0;for(const t of e)if(!Fp.has(t)&&!ny.has(t)&&!bl.test(t)&&!Rp(t))return!1;return e.length>0}function sy(e){let t=!1;for(const n of e)if(!(n==="\\"||bl.test(n))){if(Fp.has(n)||ra.has(n)||ny.has(n)){t=!0;continue}return!1}return t}function Op(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function wd(e){if(e.length===0)return null;const t=Op(e,e.length);return e.slice(t)}function wB(e){for(const t of e)if(!bl.test(t))return t;return null}function SB(e){for(let t=e.length;t>0;){const n=Op(e,t),s=e.slice(n,t);if(!bl.test(s))return s;t=n}return null}const CB=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function AB(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Rp(e){const t=e.codePointAt(0);return t!==void 0&&AB(t,CB)}function MB(e){const t=SB(e);return t!==null&&Rp(t)}function EB(e){const t=wB(e);return t!==null&&ey.test(t)}function TB(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(bl.test(s)){n--;continue}if(Fp.has(s)||ny.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function NB(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function Lx(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function Fx(e,t){return e&&t!==null&&vB.has(t)}function IB(e){const t=wd(e);return t!==null&&yB.has(t)}function $B(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function _g(e){let t=e.length;for(;t>0;){const n=Op(e,t),s=e.slice(n,t);if(kB.has(s))return!0;if(!ra.has(s))return!1;t=n}return!1}function LB(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
70
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const FB=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function wi(e){return e.length===1?e[0]:e.join("")}function OB(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),wi(n)}function RB(e,t,n,s){if(!FB.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=LB(u,s),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&o.push({text:wi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&o.push({text:wi(r),isWordLike:a,kind:i,start:l}),o}function wg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const BB=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function DB(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:BB.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function PB(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function HB(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let r=0;r<e.len;r++){if(s[r]!=="text"||!DB(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!wg(s[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(s[a]="text",t[a]="",a++,c)break}t[r]=wi(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],s[i]=s[r],o[i]=o[r]),i++)}return t.length=i,n.length=i,s.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:s,starts:o}}function WB(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i]),!PB(r))continue;const l=i+1;if(l>=e.len||wg(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!wg(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(wi(a)),n.push(!0),s.push("text"),o.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}const zB=new Set([":","-","/","×",",",".","+","–","—"]),UB=/[\p{P}\p{S}\p{Co}]/u,jB=/\p{Emoji_Presentation}/u,qB=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function VB(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function D3(e){const t=e.charCodeAt(0);return t<128?VB(t):!qB.has(e)&&!jB.test(e)&&UB.test(e)}function Ox(e){let t=!1;for(const n of e)if(!bl.test(n)){if(!D3(n))return!1;t=!0}return t}function KB(e){for(let t=e.length;t>0;){const n=Op(e,t),s=e.slice(n,t);if(bl.test(s)){t=n;continue}return D3(s)||Rp(s)}return!1}function GB(e,t,n,s){const o=!t&&Ox(e),i=!s&&Ox(n),r=MB(e),l=(t||r)&&KB(e);return!o&&!i&&!l||zi(e)||zi(n)?!1:(t||o||r)&&(s||i)}function P3(e){for(const t of e)if(ey.test(t))return!0;return!1}function Eh(e){if(e.length===0)return!1;for(const t of e)if(!(ey.test(t)||zB.has(t)))return!1;return!0}function YB(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Eh(r)&&P3(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Eh(e.texts[c]);)a.push(e.texts[c]),c++;t.push(wi(a)),n.push(!0),s.push("text"),o.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),s.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function ZB(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&GB(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(wi(c)),n.push(d),s.push("text"),o.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),s.push(l),o.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function QB(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!P3(u)||!Eh(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),s.push("text"),o.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function XB(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=wi(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),s.push("glue"),o.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=wi(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(wi(r)),n.push(l),s.push(a),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function JB(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(s[i]!=="text"||s[i+1]!=="text"||!zi(t[i])||!zi(t[i+1]))continue;const r=TB(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],o[i+1]=o[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function eD(e,t,n){const s=uB();let o=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],p=[],h=[],m=[],_=[];for(const L of s.segment(e))for(const $ of RB(L.segment,L.isWordLike??!1,L.index,n)){let D=function(){u[O]!==null&&(r[O]=[Lx(i,u,d,O)],u[O]=null),r[O].push($.text),l[O]=l[O]||$.isWordLike,f[O]=f[O]||N,p[O]=p[O]||F,h[O]=T,m[O]=R,_[O]=Fx(p[O],S)};const x=$.kind==="text",E=NB($.text,$.isWordLike,$.kind),N=zi($.text),F=Ix($.text),S=wd($.text),T=_g($.text),R=IB($.text),O=o-1;t.carryCJKAfterClosingQuote&&x&&o>0&&a[O]==="text"&&N&&f[O]&&h[O]||x&&o>0&&a[O]==="text"&&xB($.text)&&f[O]||x&&o>0&&a[O]==="text"&&m[O]?D():x&&o>0&&a[O]==="text"&&$.isWordLike&&F&&_[O]?(D(),l[O]=!0):E!==null&&o>0&&a[O]==="text"&&u[O]===E?d[O]=(d[O]??1)+1:x&&!$.isWordLike&&o>0&&a[O]==="text"&&!f[O]&&(bB($.text)||$.text==="-"&&l[O])?D():(i[o]=$.text,r[o]=[$.text],l[o]=$.isWordLike,a[o]=$.kind,c[o]=$.start,u[o]=E,d[o]=E===null?0:1,f[o]=N,p[o]=F,h[o]=T,m[o]=R,_[o]=Fx(F,S),o++)}for(let L=0;L<o;L++){if(u[L]!==null){i[L]=Lx(i,u,d,L);continue}i[L]=wi(r[L])}for(let L=1;L<o;L++)a[L]==="text"&&!l[L]&&sy(i[L])&&a[L-1]==="text"&&!f[L-1]&&(i[L-1]+=i[L],l[L-1]=l[L-1]||l[L],i[L]="");const k=Array.from({length:o},()=>null);let g=-1;for(let L=o-1;L>=0;L--){const $=i[L];if($.length!==0){if(a[L]==="text"&&!l[L]&&g>=0&&a[g]==="text"&&(_B($)||$==="-"&&EB(i[g]))){const x=k[g]??[];x.push($),k[g]=x,c[g]=c[L],i[L]="";continue}g=L}}for(let L=0;L<o;L++){const $=k[L];$!=null&&(i[L]=OB($,i[L]))}let v=0;for(let L=0;L<o;L++){const $=i[L];$.length!==0&&(v!==L&&(i[v]=$,l[v]=l[L],a[v]=a[L],c[v]=c[L]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const y=XB({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),A=JB(ZB(QB(YB(WB(HB(y))))));for(let L=0;L<A.len-1;L++){const $=$B(A.texts[L]);$!==null&&(A.kinds[L]!=="space"&&A.kinds[L]!=="preserved-space"||A.kinds[L+1]!=="text"||!Ix(A.texts[L+1])||(A.texts[L]=$.space,A.isWordLike[L]=!1,A.kinds[L]=A.kinds[L]==="preserved-space"?"preserved-space":"space",A.texts[L+1]=$.marks+A.texts[L+1],A.starts[L+1]=A.starts[L]+$.space.length))}return A}function tD(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function nD(e,t,n){if(t.len<=1)return t;const s=[],o=[],i=[],r=[];let l=-1,a=!1;function c(f){s.push(t.texts[f]),o.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,p){let h=!1;for(let k=f;k<p;k++)h=h||t.isWordLike[k];const m=t.starts[f],_=p<t.len?t.starts[p]:e.length;s.push(e.slice(m,_)),o.push(h),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let p=l;p<f;p++)c(p);l=-1,a=!1}}for(let f=0;f<t.len;f++){const p=t.texts[f],h=t.kinds[f];if(h==="text"){l>=0&&!B3(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||zi(p);continue}d(f),s.push(p),o.push(t.isWordLike[f]),i.push(h),r.push(t.starts[f])}return d(t.len),{len:s.length,texts:s,isWordLike:o,kinds:i,starts:r}}function sD(e,t,n="normal",s="normal"){const o=rB(n),i=o.mode==="pre-wrap"?aB(e):lB(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=eD(i,t,o),l=s==="keep-all"?nD(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:tD(l,o),...l}}let Ra=null;const Rx=new Map;let Ba=null;const oD=96,iD=/\p{Emoji_Presentation}/u,rD=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let N1=null;const Bx=new Map;function oy(){if(Ra!==null)return Ra;if(typeof OffscreenCanvas<"u")return Ra=new OffscreenCanvas(1,1).getContext("2d"),Ra;if(typeof document<"u")return Ra=document.createElement("canvas").getContext("2d"),Ra;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function lD(e){let t=Rx.get(e);return t||(t=new Map,Rx.set(e,t)),t}function Xr(e,t){let n=t.get(e);return n===void 0&&(n={width:oy().measureText(e).width,containsCJK:zi(e)},t.set(e,n)),n}function Bp(){if(Ba!==null)return Ba;if(typeof navigator>"u")return Ba={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ba;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),s=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Ba={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Ba}function aD(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function H3(){return N1===null&&(N1=new Intl.Segmenter(void 0,{granularity:"grapheme"})),N1}function cD(e){return iD.test(e)||e.includes("️")}function uD(e){return rD.test(e)}function dD(e,t){let n=Bx.get(e);if(n!==void 0)return n;const s=oy();s.font=e;const o=s.measureText("😀").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),o-r>.5&&(n=o-r)}return Bx.set(e,n),n}function fD(e){let t=0;const n=H3();for(const s of n.segment(e))cD(s.segment)&&t++;return t}function hD(e,t){return t.emojiCount===void 0&&(t.emojiCount=fD(e)),t.emojiCount}function Kl(e,t,n){return n===0?t.width:t.width-hD(e,t)*n}function pD(e,t,n,s,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const i=H3(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const u=[];for(const d of r){const f=Xr(d,n);u.push(Kl(d,f,s))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(o==="pair-context"||r.length>oD){const u=[];let d=null,f=0;for(const p of r){const h=Xr(p,n),m=Kl(p,h,s);if(d===null)u.push(m);else{const _=d+p,k=Xr(_,n);u.push(Kl(_,k,s)-f)}d=p,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=Xr(a,n),f=Kl(a,d,s);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function mD(e,t){const n=oy();n.font=e;const s=lD(e),o=aD(e),i=t?dD(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function gD(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function W3(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function z3(e,t,n=e.widths.length){for(;t<n;){const s=e.kinds[t];if(!gD(s))break;t++}return t}function vD(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function yD(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function iy(e,t){return t===0?0:e+t}function kD(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function bD(e,t,n,s,o){const i=t==="tab"?o+kD(e,n):e.lineEndFitAdvances[n];return iy(s,i)}function Dx(e,t,n,s){const o=t==="tab"?0:e.lineEndFitAdvances[n];return iy(s,o)}function Px(e,t,n,s,o){const i=t==="tab"?o:e.lineEndPaintAdvances[n];return iy(s,i)}function xD(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function _D(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Th(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function wD(e,t,n,s,o){if(e.letterSpacing===0)return 0;if(o>0)return e.spacingGraphemeCounts[s]>0?e.letterSpacing:0;for(let i=s-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===s-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function SD(e,t,n,s,o,i){return t+wD(e,n,s,o,i)}function CD(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(s.length===0)return 0;const a=Bp().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,p=0,h=0,m=0,_=0,k=-1,g=0;function v(){k=-1,g=0}function y(N=m,F=_,S=d){u++,n?.(S,p,h,N,F),d=0,f=!1,v()}function A(N,F){f=!0,p=N,h=0,m=N+1,_=0,d=F}function L(N,F,S){f=!0,p=N,h=F,m=N,_=F+1,d=S}function $(N,F){if(!f){A(N,F);return}d+=F,m=N+1,_=0}function x(N,F){const S=i[N],T=r[N]??null;let R=T===null?-1:Th(T,0,F+1),O=-1,D=0,W=F;for(;W<S.length;){const z=S[W];if(!f)L(N,W,z);else if(d+z>c){if(T!==null&&O>F){y(N,O,D),W=O,R=Th(T,R,W+1),O=-1,D=0;continue}y(),L(N,W,z)}else d+=z,m=N,_=W+1;const V=W+1;T!==null&&T[R]===V&&(O=V,D=d,R++),W++}f&&m===N&&_===S.length&&(m=N+1,_=0)}let E=0;for(;E<s.length&&!(!f&&(E=z3(e,E),E>=s.length));){const N=s[E],F=o[E],S=W3(F);if(!f){N>c&&i[E]!==null?x(E,0):A(E,N),S&&(k=E+1,g=d-N),E++;continue}if(d+N>c){if(S){$(E,N),y(E+1,0,d-N),E++;continue}if(k>=0){if(m>k||m===k&&_>0){y();continue}y(k,0,g);continue}if(N>c&&i[E]!==null){y(),x(E,0),E++;continue}y();continue}$(E,N),S&&(k=E+1,g=d-N),E++}return f&&y(),u}function AD(e,t,n){if(e.simpleLineWalkFastPath)return CD(e,t,n);const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(s.length===0||a.length===0)return 0;const c=Bp(),u=c.lineFitEpsilon,d=t+u;let f=0,p=0,h=!1,m=0,_=0,k=0,g=0,v=-1,y=0,A=0,L=null;function $(){v=-1,y=0,A=0,L=null}function x(){return L==="soft-hyphen"&&v===k&&g===0?A:p}function E(D=k,W=g,z){f++,n!==void 0&&n(SD(e,z??x(),m,_,D,W),m,_,D,W),p=0,h=!1,$()}function N(D,W){h=!0,m=D,_=0,k=D+1,g=0,p=W}function F(D,W,z){h=!0,m=D,_=W,k=D,g=W+1,p=z}function S(D,W){if(!h){N(D,W);return}p+=W,k=D+1,g=0}function T(D,W,z,V,U,re){if(!W)return;const ae=Dx(e,D,z,U),te=Px(e,D,z,U,V);v=z+1,y=p-re+ae,A=p-re+te,L=D}function R(D,W){const z=i[D],V=r[D]??null;let U=V===null?-1:Th(V,0,W+1),re=-1,ae=0,te=W;for(;te<z.length;){const Z=z[te];if(!h)F(D,te,Z);else{const ke=xD(e,!0,Z),Se=p+ke;if(_D(e,Se)>d){if(V!==null&&re>W){E(D,re,ae),te=re,U=Th(V,U,te+1),re=-1,ae=0;continue}E(),F(D,te,Z)}else p=Se,k=D,g=te+1}const ne=te+1;V!==null&&V[U]===ne&&(re=ne,ae=p,U++),te++}h&&k===D&&g===z.length&&(k=D+1,g=0)}function O(D){f++,n?.(0,D.startSegmentIndex,0,D.consumedEndSegmentIndex,0),$()}for(let D=0;D<a.length;D++){const W=a[D];if(W.startSegmentIndex===W.endSegmentIndex){O(W);continue}h=!1,p=0,m=W.startSegmentIndex,_=0,k=W.startSegmentIndex,g=0,$();let z=W.startSegmentIndex;for(;z<W.endSegmentIndex&&!(!h&&(z=z3(e,z,W.endSegmentIndex),z>=W.endSegmentIndex));){const V=o[z],U=W3(V),re=yD(e,h,z),ae=V==="tab"?vD(p+re,e.tabStopAdvance):s[z],te=re+ae,Z=bD(e,V,z,re,ae);if(V==="soft-hyphen"){h&&(k=z+1,g=0,v=z+1,y=p+l,A=p+l,L=V),z++;continue}if(!h){Z>d&&i[z]!==null?R(z,0):N(z,ae),T(V,U,z,ae,re,te),z++;continue}if(p+Z>d){const ke=p+Dx(e,V,z,re),Se=p+Px(e,V,z,re,ae);if(L==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&y<=d){E(v,0,A);continue}if(U&&ke<=d){S(z,te),E(z+1,0,Se),z++;continue}if(v>=0&&y<=d){if(k>v||k===v&&g>0){E();continue}const Ye=v;E(Ye,0,A),z=Ye;continue}if(Z>d&&i[z]!==null){E(),R(z,0),z++;continue}E();continue}S(z,te),T(V,U,z,ae,re,te),z++}if(h){const V=v===W.consumedEndSegmentIndex?A:p;E(W.consumedEndSegmentIndex,0,V)}}return f}let I1=null;function ry(){return I1===null&&(I1=new Intl.Segmenter(void 0,{granularity:"grapheme"})),I1}function MD(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function ED(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,p){s=[d],o=f,i=p,r=_g(d),l=Fp.has(d)}function u(d,f){s.push(d),i=i||f;const p=_g(d);d.length===1&&ra.has(d)?r=r||p:r=p,l=!1}for(const d of ry().segment(e)){const f=d.segment,p=zi(f);if(s.length===0){c(f,d.index,p);continue}if(l||ty.has(f)||ra.has(f)||t.carryCJKAfterClosingQuote&&p&&r){u(f,p);continue}if(!i&&!p){u(f,p);continue}a(),c(f,d.index,p)}return a(),n}function TD(e,t,n){if(t.length<=1)return t;const s=[];let o=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;s.push({text:e.slice(u,d),start:u})}function l(a){if(!(o<0)){if(i)o+1===a?s.push(t[o]):r(o,a);else for(let c=o;c<a;c++)s.push(t[c]);o=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];o>=0&&!B3(t[a-1].text,n)&&l(a),o<0&&(o=a),i=i||zi(c.text)}return l(t.length),s}function Hx(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const s=ry();for(const o of s.segment(e))n++;return n}function ND(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function ID(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const s of ry().segment(e))n++,ND(s.segment)&&t.push(n);return t.length===0?null:t}function $D(e,t,n){return t>1?e+(t-1)*n:e}function LD(e,t,n,s,o){const i=Bp(),{cache:r,emojiCorrection:l}=mD(t,uD(e.normalized)),a=Kl("-",Xr("-",r),l)+(o===0?0:o*2),u=Kl(" ",Xr(" ",r),l)*8,d=o!==0;if(e.len===0)return MD();const f=[],p=[],h=[],m=[];let _=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],y=[],A=n?[]:null,L=Array.from({length:e.len});function $(F,S,T,R,O,D,W,z,V){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(_=!1),f.push(S),p.push(T),h.push(R),m.push(O),k?.push(D),g.push(W),v.push(z),d&&y.push(V),A!==null&&A.push(F)}function x(F,S,T,R,O){const D=Xr(F,r),W=d?Hx(F,S):0,z=$D(Kl(F,D,l),W,o),V=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:z,U=V===0?0:V+(W>0?o:0),re=S==="space"||S==="zero-width-break"?0:z;if(O&&R&&F.length>1){let ae="sum-graphemes";o!==0?ae="segment-prefixes":Eh(F)?ae="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ae="segment-prefixes");const te=pD(F,D,r,l,ae),Z=te===null||s==="keep-all"?null:ID(F);$(F,z,U,re,S,T,te,Z,W);return}$(F,z,U,re,S,T,null,null,W)}for(let F=0;F<e.len;F++){L[F]=f.length;const S=e.texts[F],T=e.isWordLike[F],R=e.kinds[F],O=e.starts[F];if(R==="soft-hyphen"){$(S,0,a,a,R,O,null,null,0);continue}if(R==="hard-break"){$(S,0,0,0,R,O,null,null,0);continue}if(R==="tab"){$(S,0,0,0,R,O,null,null,d?Hx(S,R):0);continue}const D=Xr(S,r);if(R==="text"&&D.containsCJK){const W=ED(S,i),z=s==="keep-all"?TD(S,W,i.breakKeepAllAfterPunctuation):W;for(let V=0;V<z.length;V++){const U=z[V];x(U.text,"text",O+U.start,T,s==="keep-all"||!zi(U.text))}continue}x(S,R,O,T,!0)}const E=FD(e.chunks,L,f.length),N=k===null?null:sB(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:_,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E,segments:A}:{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:_,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E}}function FD(e,t,n){const s=[];for(let o=0;o<e.length;o++){const i=e[o],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;s.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return s}function OD(e,t,n,s){const o=s?.wordBreak??"normal",i=s?.letterSpacing??0,r=sD(e,Bp(),s?.whiteSpace,o);return LD(r,t,n,o,i)}function U3(e,t,n){return OD(e,t,!0,n)}function j3(e){let t=0;return AD(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const RD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},BD={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",internalBuildBanner:"Internal testing only"},DD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},PD={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},HD={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},WD={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},zD={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},UD={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again"},jD={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},qD={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},VD={justNow:"just now"},KD={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},GD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},YD={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",collapse:"Collapse",expand:"Expand"},ZD={panelTitle:"Thinking",close:"Close"},QD={title:"Changes",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} changes",empty:"No git changes / not provided by daemon",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",list:"List",tree:"Tree",close:"Close"},XD={},JD={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},eP={searching:"Searching…",noMatch:"No matches"},tP={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},nP={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},sP={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},oP={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},iP={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},rP={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},lP={preview:"预览",confirm:"确认",cancel:"取消"},aP={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},cP={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},uP={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},dP={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},fP={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},hP={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · 思考: {level}"},pP={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试"},mP={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},gP={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},vP={justNow:"刚刚"},yP={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},kP={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},bP={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},xP={panelTitle:"思考过程",close:"关闭"},_P={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},wP={},SP={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},CP={searching:"搜索中…",noMatch:"无匹配"},AP={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},MP={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},EP={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},TP={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},NP={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},IP={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},$P={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},LP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},FP={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},OP={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},RP={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive"},BP={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},DP={title:"Side chat",subtitle:"forked from this session",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},PP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},HP={en:{common:RD,app:BD,sidebar:DD,workspace:PD,conversation:HD,status:WD,composer:zD,login:UD,providers:jD,model:qD,sessions:VD,approval:KD,question:GD,tasks:YD,thinking:ZD,diff:QD,fileTree:XD,filePreview:JD,mention:eP,warnings:tP,commands:nP,tools:sP,layout:oP,mobile:iP,theme:rP,onboarding:$P,settings:FP,header:RP,sideChat:DP},zh:{common:lP,app:aP,sidebar:cP,workspace:uP,conversation:dP,status:fP,composer:hP,login:pP,providers:mP,model:gP,sessions:vP,approval:yP,question:kP,tasks:bP,thinking:xP,diff:_P,fileTree:wP,filePreview:SP,mention:CP,warnings:AP,commands:MP,tools:EP,layout:TP,mobile:NP,theme:IP,onboarding:LP,settings:OP,header:BP,sideChat:PP}},q3=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function WP(){const e=Qn($t.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const yn=yN({legacy:!1,locale:WP(),fallbackLocale:"en",messages:HP});function V3(e){yn.global.locale.value=e,ts($t.locale,e)}const Ws=yn.global.t,zP={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},UP={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function ha(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return UP[t]??t}function pa(e){const t=zP[ha(e)];return t?Ws(t):e}const jP={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function Dp(e){const t=ha(e);let n=jP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Ga(n,"sm")}const K3=80;function qP(e,t=K3){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function VP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function KP(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Kt(e){return typeof e=="string"&&e.length>0?e:void 0}function qr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function GP(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function $1(e){return Kt(e.path)??Kt(e.file_path)??Kt(e.filePath)??Kt(e.filename)}const YP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function ZP(e){const t=Kt(e);if(!t)return;const n=YP[t];return n?Ws(n):t}function QP(e){const t=qr(e.value),n=Kt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return Ws("tools.goal.turns",{value:t});case"tokens":return Ws("tools.goal.tokens",{value:t});case"milliseconds":return Ws("tools.goal.milliseconds",{value:t});case"seconds":return Ws("tools.goal.seconds",{value:t});case"minutes":return Ws("tools.goal.minutes",{value:t});case"hours":return Ws("tools.goal.hours",{value:t});default:return Ws("tools.goal.budget",{value:t,unit:n})}}const XP=64;function nd(e,t,n=!1){const s=(o,i=K3)=>n?o.trim():qP(o,i);try{const o=KP(t);if(!n&&VP(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(ha(e)){case"read":{const r=$1(o);if(!r)return i();const l=qr(o.offset)??qr(o.line_start)??qr(o.start_line),a=qr(o.limit)??qr(o.length),c=qr(o.line_end)??qr(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=$1(o);return r?s(`${r} ${Ws("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=$1(o);return r?s(r):i()}case"bash":{const r=Kt(o.command)??Kt(o.cmd)??Kt(o.script);return r?s(r,XP):i()}case"grep":case"search":{const r=Kt(o.pattern)??Kt(o.query)??Kt(o.regex),l=Kt(o.path)??Kt(o.glob)??Kt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Kt(o.pattern)??Kt(o.glob)??Kt(o.query),l=Kt(o.path)??Kt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Kt(o.path)?s(Kt(o.path)):i()}case"ls":{const r=Kt(o.path)??Kt(o.dir)??Kt(o.directory)??Kt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Kt(o.url)??Kt(o.uri);return r?s(GP(r)):i()}case"todo":case"task":{const r=Kt(o.description)??Kt(o.title)??Kt(o.prompt)??Kt(o.name)??Kt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(Ws("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Kt(o.objective),l=Kt(o.completionCriterion);return r&&l?s(Ws("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?s(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=QP(o);return r?s(r):i()}case"updategoal":{if(n)return i();const r=ZP(o.status);return r?s(Ws("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function JP(e){try{switch(ha(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Ws("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return Ws("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Ws("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const eH=qe({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=P(()=>n(t.status));return(o,i)=>(b(),I("span",{class:De(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),sd=ut(eH,[["__scopeId","data-v-e36198e5"]]),tH=["innerHTML"],nH={class:"bh-text"},sH={class:"a"},oH={key:0,class:"p"},iH={class:"rt"},rH=["aria-label"],lH={key:0,class:"tm"},aH=["inert"],cH={class:"bb-pad"},uH=qe({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,s=Ut("pinScroll",()=>{}),o=Q(null);function i(){n("toggle");const r=o.value;r&&pt(()=>s(r))}return(r,l)=>(b(),I("div",{class:De(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[w("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(b(),I("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,tH)):le("",!0),w("span",nH,[w("span",sH,B(e.name),1),ie(jt,{text:e.arg},{default:Ee(()=>[e.arg?(b(),I("span",oH,B(e.arg),1)):le("",!0)]),_:1},8,["text"])]),w("span",iH,[w("span",{class:De(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):e.status==="error"?(b(),ye(Ve,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(b(),ye(sd,{key:2,status:"suspended"})):(b(),ye(sd,{key:3,status:"running"}))],10,rH),In(r.$slots,"trailing"),e.time?(b(),I("span",lH,B(e.time),1)):le("",!0)]),e.expandable?(b(),ye(Ve,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):le("",!0)],512),w("div",{class:De(["bb",{open:e.open}]),inert:!e.open},[w("div",cH,[In(r.$slots,"default")])],10,aH)],2))}}),Pp=ut(uH,[["__scopeId","data-v-fef8aad2"]]),dH={key:0,class:"at-type"},fH={key:1,class:"at-task"},hH={key:2,class:"bb-code"},pH=qe({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=P(()=>i(s.tool.arg)),l=P(()=>!!s.tool.output&&s.tool.output.length>0),a=P(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Q(s.tool.defaultExpanded===!0&&a.value),u=P(()=>s.tool.status),d=P(()=>pa(s.tool.name)),f=P(()=>Dp(s.tool.name)),p=P(()=>r.value.description||r.value.subagentType||""),h=Ut("resolveAgentTaskId"),m=P(()=>h?h(s.tool.id)!==void 0:!0);function _(){a.value&&(c.value=!c.value)}return Ke(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(b(),ye(Pp,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":p.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:_},{trailing:Ee(()=>[m.value?(b(),I("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=bt(v=>o("openAgent",e.tool.id),["stop"]))},B(C(n)("tasks.openDetail")),1)):le("",!0)]),default:Ee(()=>[r.value.subagentType?(b(),I("div",dH,B(r.value.subagentType),1)):le("",!0),r.value.prompt?(b(),I("div",fH,B(r.value.prompt),1)):le("",!0),l.value?(b(),I("div",hH,[(b(!0),I(Be,null,nt(e.tool.output??[],(v,y)=>(b(),I("div",{key:y},B(v),1))),128))])):le("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),mH=ut(pH,[["__scopeId","data-v-14ef8750"]]);function gH(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const s=[];for(const o of n){if(!o||typeof o!="object")continue;const i=o,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];s.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return s}catch{return[]}}const vf={recognized:!1,answers:{},note:""};function vH(e){const t=e?.[0];if(!t)return vf;let n;try{n=JSON.parse(t)}catch{return vf}if(!n||typeof n!="object"||Array.isArray(n))return vf;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return vf;const o={};for(const[i,r]of Object.entries(s))typeof r=="string"?o[i]=r:r===!0&&(o[i]=!0);return{recognized:!0,answers:o,note:typeof n.note=="string"?n.note:""}}function yH(e,t,n){return e[t]??e[`q_${n}`]}const kH=/^opt_\d+_(\d+)$/;function bH(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const s=n.get(e);if(s!==void 0)return{selected:new Set([s]),otherText:"",indeterminate:!1};const o=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){o.add(a);continue}const c=kH.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const xH={key:0,class:"chip"},_H={key:0,class:"au-dismissed"},wH={key:1,class:"au-list"},SH={class:"au-q"},CH={key:0,class:"au-hdr"},AH={class:"au-qtext"},MH={class:"au-opts"},EH={class:"au-glyph"},TH={class:"au-label"},NH={key:0,class:"au-desc"},IH={key:0,class:"au-opt sel"},$H={class:"au-glyph"},LH={class:"au-label"},FH={key:1,class:"au-opt sel"},OH={class:"au-label"},RH={key:2,class:"au-raw"},BH=80,DH=qe({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Et();function s($,x=BH){const E=$.trim();return E.length>x?E.slice(0,x-1)+"…":E}const o=P(()=>gH(t.tool.arg)),i=P(()=>vH(t.tool.output)),r=P(()=>i.value.recognized),l=P(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=P(()=>o.value.map(($,x)=>bH(yH(i.value.answers,$.question,x),$.options))),c=P(()=>Object.keys(i.value.answers).length);function u($,x){return a.value[$]?.selected.has(x)??!1}function d($){return a.value[$]?.otherText??""}function f($){return a.value[$]?.indeterminate??!1}function p($,x){return $?x?"■":"□":x?"●":"○"}const h=P(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const $=o.value[0]?.question??"",x=s($);return o.value.length<=1?x:`${x} ${n("tools.ask.more",{count:o.value.length-1})}`}),m=P(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),_=P(()=>!!t.tool.output&&t.tool.output.length>0),k=P(()=>r.value&&(o.value.length>0||l.value)||_.value),g=Q(t.tool.defaultExpanded===!0&&k.value),v=P(()=>t.tool.status),y=P(()=>pa(t.tool.name)),A=P(()=>Dp(t.tool.name));function L(){k.value&&(g.value=!g.value)}return Ke(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),($,x)=>(b(),ye(Pp,{status:v.value,icon:A.value,name:y.value,arg:g.value?"":h.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:L},{trailing:Ee(()=>[m.value?(b(),I("span",xH,B(m.value),1)):le("",!0)]),default:Ee(()=>[l.value?(b(),I("div",_H,B(i.value.note),1)):r.value?(b(),I("div",wH,[(b(!0),I(Be,null,nt(o.value,(E,N)=>(b(),I("div",{key:N,class:"au-block"},[w("div",SH,[E.header?(b(),I("span",CH,B(E.header),1)):le("",!0),w("span",AH,B(E.question),1)]),w("div",MH,[(b(!0),I(Be,null,nt(E.options,(F,S)=>(b(),I("div",{key:S,class:De(["au-opt",{sel:u(N,S)}])},[w("span",EH,B(p(E.multiSelect,u(N,S))),1),w("span",TH,B(F.label),1),F.description?(b(),I("span",NH,B(F.description),1)):le("",!0)],2))),128)),d(N)?(b(),I("div",IH,[w("span",$H,B(p(E.multiSelect,!0)),1),w("span",LH,B(d(N)),1)])):le("",!0),f(N)?(b(),I("div",FH,[x[0]||(x[0]=w("span",{class:"au-glyph"},"●",-1)),w("span",OH,B(C(n)("tools.ask.answered")),1)])):le("",!0)])]))),128))])):(b(),I("div",RH,[(b(!0),I(Be,null,nt(e.tool.output??[],(E,N)=>(b(),I("div",{key:N},B(E),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),PH=ut(DH,[["__scopeId","data-v-a9a0f259"]]),HH=1e6,Wx=5e3;function zx(e){if(e==="")return[];const t=e.split(`
71
+ `);return t.at(-1)===""&&t.pop(),t}function WH(e,t){const n=zx(e),s=zx(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>Wx||i>Wx||(o+1)*(i+1)>HH)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let p=1;p<=o;p++)for(let h=1;h<=i;h++)r[p][h]=n[p-1]===s[h-1]?r[p-1][h-1]+1:Math.max(r[p-1][h],r[p][h-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 p of l)p.type==="context"?(u.push({type:"context",text:p.text,oldNo:d,newNo:f}),d++,f++):p.type==="add"?(u.push({type:"add",text:p.text,newNo:f}),f++):(u.push({type:"del",text:p.text,oldNo:d}),d++);return u}function zH(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 G3(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 Y3(e){const t=ha(e.name);if(t!=="edit"&&t!=="write")return null;const n=G3(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:WH(s,o)}return null}function UH(e){const t=G3(e);return t&&typeof t.path=="string"?t.path:void 0}function jH(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const qH={key:0,class:"bb-empty"},Ux=50,VH=qe({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=P(()=>t.lines??[]),s=P(()=>n.value.length>Ux),o={"--tool-output-visible-lines":String(Ux)};return(i,r)=>(b(),I("div",{class:De(["bb-code tool-output-block",{scroll:s.value}]),style:o},[n.value.length===0&&e.emptyText?(b(),I("div",qH,B(e.emptyText),1)):le("",!0),(b(!0),I(Be,null,nt(n.value,(l,a)=>(b(),I("div",{key:a},B(l),1))),128))],2))}}),Z3=ut(VH,[["__scopeId","data-v-262bbea0"]]),KH={key:0,class:"chip"},GH={key:0,class:"bb-summary"},YH=qe({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,s=t,o=P(()=>n.tool.status),i=P(()=>pa(n.tool.name)),r=P(()=>Dp(n.tool.name)),l=P(()=>nd(n.tool.name,n.tool.arg)),a=P(()=>nd(n.tool.name,n.tool.arg,!0)),c=P(()=>Y3(n.tool)),u=P(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:_,removed:k}=zH(m);if(_||k)return`+${_} −${k}`}return""}),d=P(()=>!!n.tool.output&&n.tool.output.length>0),f=Q(!1),p=P(()=>d.value&&!n.toolDiffPanel);function h(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,_)=>(b(),ye(Pp,{status:o.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:p.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:h},{trailing:Ee(()=>[u.value?(b(),I("span",KH,B(u.value),1)):le("",!0)]),default:Ee(()=>[a.value?(b(),I("div",GH,B(a.value),1)):le("",!0),ie(Z3,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),ZH=ut(YH,[["__scopeId","data-v-74e1da99"]]),QH={key:0,class:"chip"},XH={key:0,class:"bb-summary"},JH=qe({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=P(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=P(()=>!!t.tool.output&&t.tool.output.length>0),o=P(()=>s.value||n.value),i=Q(t.tool.defaultExpanded===!0&&o.value),r=P(()=>t.tool.status),l=P(()=>pa(t.tool.name)),a=P(()=>Dp(t.tool.name)),c=P(()=>nd(t.tool.name,t.tool.arg)),u=P(()=>nd(t.tool.name,t.tool.arg,!0)),d=P(()=>JP({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 Ke(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(p,h)=>(b(),ye(Pp,{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:Ee(()=>[d.value?(b(),I("span",QH,B(d.value),1)):le("",!0)]),default:Ee(()=>[u.value?(b(),I("div",XH,B(u.value),1)):le("",!0),ie(Z3,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),eW=ut(JH,[["__scopeId","data-v-aa4edcb0"]]),tW={class:"media-title"},nW=["src","alt"],sW=["src"],oW=["src"],iW=qe({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=P(()=>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=P(()=>{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?(b(),I("div",{key:0,class:De(["media-tool",{mob:e.mobile}])},[ie(jt,{text:o.value.path||l.value},{default:Ee(()=>[w("div",tW,B(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(b(),ye(jt,{key:0,text:o.value.path||l.value},{default:Ee(()=>[w("button",{type:"button",class:"media-image-button",onClick:a},[w("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,nW)])]),_:1},8,["text"])):o.value.kind==="video"?(b(),I("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,sW)):(b(),I("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,oW))],2)):le("",!0)}}),rW=ut(iW,[["__scopeId","data-v-bec13b73"]]),lW=/<summary>([\s\S]*?)<\/summary>/,aW=/<resume_hint>([\s\S]*?)<\/resume_hint>/,L1=/<subagent\b([^>]*)>|<\/subagent>/g,cW="</subagent>",jx=/(completed|failed|aborted):\s*(\d+)/g,qx=/([a-z_]+)="([^"]*)"/g;function uW(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function dW(e){const t={};qx.lastIndex=0;let n;for(;(n=qx.exec(e))!==null;)t[n[1]]=uW(n[2]);return t}function fW(e){const t={completed:0,failed:0,aborted:0};jx.lastIndex=0;let n;for(;(n=jx.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function hW(e,t){const n=dW(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function pW(e){const t=[],n=[];L1.lastIndex=0;let s;for(;(s=L1.exec(e))!==null;)if(s[0]===cW){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(hW(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:L1.lastIndex}):n.push(null);return t}function mW(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
72
+ `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=lW.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=fW(n),r=aW.exec(t)?.[1]?.trim(),l=pW(t),a=s+o+i;return{summary:n,completed:s,failed:o,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function Vx(e){return e?e.split(`
73
+ `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function gW(e){return e.suspendedReason||Vx(e.text)||Vx(e.outputLines?.join(`
74
+ `))||e.summary||""}function vW(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
75
+ `):e.summary??""}function yW(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function Kx(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
76
+ `)[0]??"",phase:yW(e.outcome),body:e.body}}function kW(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function bW(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:gW(o),phase:o.phase,body:vW(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>kW(i,o))).map((o,i)=>Kx(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>Kx(o,i))}const xW=["aria-expanded"],_W={class:"title"},wW={key:0,class:"meta"},SW={key:1,class:"sum-txt"},CW={class:"rt"},AW={class:"status"},MW={key:0,class:"chip"},EW={key:1,class:"tm"},TW={class:"body"},NW={class:"overview"},IW={class:"overview-line"},$W={class:"big"},LW={key:0,class:"lbl"},FW={key:1,class:"lbl"},OW={key:2,class:"lbl"},RW={key:0,class:"seg","aria-hidden":"true"},BW={key:1,class:"legend"},DW=["aria-expanded","onClick"],PW={class:"mname"},HW={class:"mact"},WW={class:"mphase"},zW={key:1,class:"fallback-output"},UW={key:2,class:"waiting"},jW=qe({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Et(),n=e;function s(N){if(!N)return{};try{const F=JSON.parse(N),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const o=Ut("resolveSwarmMembers"),i=P(()=>s(n.tool.arg)),r=P(()=>pa(n.tool.name)),l=P(()=>i.value.description??""),a=P(()=>o?.(n.tool.id)??[]),c=P(()=>mW(n.tool.output)),u=P(()=>n.tool.status),d=P(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=P(()=>bW(a.value,c.value)),p=P(()=>{const N={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)N[F.phase]++;return N}),h=P(()=>f.value.length||i.value.itemCount||0),m=P(()=>p.value.completed+p.value.failed),_=P(()=>p.value.working+p.value.suspended+p.value.queued),k=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],g=P(()=>k.map(({phase:N,cls:F})=>({phase:N,count:p.value[N],cls:F})).filter(N=>N.count>0)),v=Q(!1);function y(){v.value=!v.value}const A=P(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
77
+ `).trim()),L=Q(new Set);function $(N){const F=new Set(L.value);F.has(N)?F.delete(N):F.add(N),L.value=F}function x(N){return L.value.has(N)}function E(N){return t(`tools.swarm.phase${N[0].toUpperCase()}${N.slice(1)}`)}return(N,F)=>(b(),I("div",{class:De(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[w("button",{class:"head",type:"button","aria-expanded":v.value,onClick:y},[ie(Ve,{class:"ic",name:"git-pull-request",size:"sm"}),w("span",_W,B(r.value),1),l.value?(b(),I("span",wW,"·")):le("",!0),l.value?(b(),I("span",SW,B(l.value),1)):le("",!0),w("span",CW,[w("span",AW,[d.value==="ok"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):d.value==="error"?(b(),ye(Ve,{key:1,name:"close",size:"sm"})):(b(),ye(sd,{key:2,status:"running"}))]),m.value>0||h.value>0?(b(),I("span",MW,B(m.value)+" / "+B(h.value),1)):le("",!0),e.tool.timing?(b(),I("span",EW,B(e.tool.timing),1)):le("",!0)]),ie(Ve,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,xW),Tn(w("div",TW,[w("div",NW,[w("div",IW,[w("span",$W,B(C(t)("tools.swarm.progress",{done:m.value,total:h.value})),1),d.value==="running"&&h.value>0?(b(),I("span",LW,B(C(t)("tools.swarm.runningSub",{count:_.value})),1)):c.value?(b(),I("span",FW,B(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(b(),I("span",OW,B(C(t)("tools.swarm.waiting")),1))]),h.value>0&&g.value.length>0?(b(),I("div",RW,[(b(!0),I(Be,null,nt(g.value,S=>(b(),I("span",{key:S.phase,class:De(S.cls),style:qt({flex:S.count})},null,6))),128))])):le("",!0),g.value.length>1?(b(),I("div",BW,[(b(!0),I(Be,null,nt(g.value,S=>(b(),I("span",{key:S.phase},[w("i",{class:De(["lg-dot",S.cls])},null,2),Ge(B(E(S.phase))+" "+B(S.count),1)]))),128))])):le("",!0)]),f.value.length>0?(b(!0),I(Be,{key:0},nt(f.value,S=>(b(),I("div",{key:S.id,class:De(["member",[`phase-${S.phase}`,{open:x(S.id)}]])},[w("button",{class:"member-head",type:"button","aria-expanded":x(S.id),onClick:T=>$(S.id)},[ie(sd,{class:"row-dot",status:S.phase},null,8,["status"]),ie(jt,{text:S.name},{default:Ee(()=>[w("span",PW,B(S.name),1)]),_:2},1032,["text"]),S.activity?(b(),ye(jt,{key:0,text:S.activity},{default:Ee(()=>[w("span",HW,B(S.activity),1)]),_:2},1032,["text"])):le("",!0),w("span",WW,B(E(S.phase)),1),ie(Ve,{class:"mcar",name:x(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,DW),Tn(w("div",{class:"member-body"},B(S.body),513),[[oi,x(S.id)]])],2))),128)):A.value?(b(),I("div",zW,B(A.value),1)):(b(),I("div",UW,B(C(t)("tools.swarm.waiting")),1))],512),[[oi,v.value]])],2))}}),qW=ut(jW,[["__scopeId","data-v-3b95ba79"]]);function VW(e){if(e.media&&e.status==="ok")return rW;const t=ha(e.name);return t==="edit"||t==="write"||t==="multi_edit"?ZH:t==="task"?mH:t==="agentswarm"?qW:t==="askuserquestion"?PH:eW}const Q3=qe({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=P(()=>VW(n.tool));return(i,r)=>(b(),ye($s(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 Gx(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function KW(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 Hp(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 GW(e){return!(e.tool.status==="ok"&&e.tool.media)}function YW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function ZW(e){const t=Hp(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(GW(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 QW(e){return Hp(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
78
+
79
+ `)}function XW(e){const t=[];for(const n of Hp(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
80
+ > ${n.thinking.split(`
81
+ `).join(`
82
+ > `)}`);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(`
83
+ `);t.push(`\`\`\`
84
+ [${n.tool.name}]
85
+ ${s}
86
+ \`\`\``)}return t.join(`
87
+
88
+ `)}function X3(e){return e.tool.id||`tool-${e.sourceIndex}`}function JW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?X3({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const ez=["aria-expanded"],tz={class:"tg-title"},nz={class:"tg-meta"},sz=["inert"],oz={class:"tool-group-body-inner"},iz=qe({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=Q(!0),i=P(()=>n.tools.length),r=P(()=>n.tools.some(p=>p.tool.status==="running")?"running":n.tools.some(p=>p.tool.status==="error")?"error":"done"),{t:l}=Et(),a=P(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){o.value=!o.value}const u=Ut("pinScroll",()=>{}),d=Q(null);function f(){c();const p=d.value;p&&pt(()=>u(p))}return(p,h)=>(b(),I("div",{class:De(["tool-group",{open:o.value}])},[w("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":o.value,onClick:f},[ie(sd,{status:r.value},null,8,["status"]),ie(Ve,{class:"tg-ic",name:"list",size:"sm"}),w("span",tz,B(C(l)("tools.group.title",i.value)),1),w("span",nz,"· "+B(a.value),1),ie(Ve,{class:"tg-car",name:"chevron-right",size:"sm"})],8,ez),w("div",{class:De(["tool-group-body",{open:o.value}]),inert:!o.value},[w("div",oz,[(b(!0),I(Be,null,nt(e.tools,(m,_)=>(b(),ye(Q3,{key:C(X3)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(YW)(_,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:h[0]||(h[0]=k=>s("openMedia",k)),onOpenFile:h[1]||(h[1]=k=>s("openFile",k)),onOpenToolDiff:h[2]||(h[2]=k=>s("openToolDiff",k)),onOpenAgent:h[3]||(h[3]=k=>s("openAgent",k))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,sz)],2))}}),rz=ut(iz,[["__scopeId","data-v-37eb334f"]]);var lz=Object.create,ly=Object.defineProperty,az=Object.getOwnPropertyDescriptor,J3=Object.getOwnPropertyNames,cz=Object.getPrototypeOf,uz=Object.prototype.hasOwnProperty,eA=(e,t)=>function(){return t||(0,e[J3(e)[0]])((t={exports:{}}).exports,t),t.exports},tA=e=>{let t={};for(var n in e)ly(t,n,{get:e[n],enumerable:!0});return t},dz=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=J3(t),i=0,r=o.length,l;i<r;i++)l=o[i],!uz.call(e,l)&&l!==n&&ly(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=az(t,l))||s.enumerable});return e},nA=(e,t,n)=>(n=e!=null?lz(cz(e)):{},dz(ly(n,"default",{value:e,enumerable:!0}),e));function fz(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 hz(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function pz(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 mz(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
89
+ `:`<hr class="footnotes-sep">
90
+ `)+`<section class="footnotes">
91
+ <ol class="footnotes-list">
92
+ `}function gz(){return`</ol>
93
+ </section>
94
+ `}function vz(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 yz(){return`</li>
95
+ `}function kz(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 bz(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=pz,e.renderer.rules.footnote_block_open=mz,e.renderer.rules.footnote_block_close=gz,e.renderer.rules.footnote_open=vz,e.renderer.rules.footnote_close=yz,e.renderer.rules.footnote_anchor=kz,e.renderer.rules.footnote_caption=hz,e.renderer.rules.footnote_anchor_name=fz;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 p;for(p=d+2;p<f;p++){if(l.src.charCodeAt(p)===32)return!1;if(l.src.charCodeAt(p)===93)break}if(p===d+2||p+1>=f||l.src.charCodeAt(++p)!==58)return!1;if(u)return!0;p++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const h=l.src.slice(d+2,p-2);l.env.footnotes.refs[`:${h}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:h},m.level=l.level++,l.tokens.push(m);const _=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,y=p,A=l.sCount[a]+p-(l.bMarks[a]+l.tShift[a]);let L=A;for(;p<f;){const x=l.src.charCodeAt(p);if(n(x))x===9?L+=4-L%4:L++;else break;p++}l.tShift[a]=p-y,l.sCount[a]=L-A,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]=k,l.sCount[a]=g,l.bMarks[a]=_;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 p=l.env.footnotes.list.length,h=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,h);const m=l.push("footnote_ref","",0);m.meta={id:p},l.env.footnotes.list[p]={content:l.src.slice(d,f),tokens:h}}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 p;l.env.footnotes.refs[`:${f}`]<0?(p=l.env.footnotes.list.length,l.env.footnotes.list[p]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=p):p=l.env.footnotes.refs[`:${f}`];const h=l.env.footnotes.list[p].count;l.env.footnotes.list[p].count++;const m=l.push("footnote_ref","",0);m.meta={id:p,subId:h,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(h){return h.type==="footnote_reference_open"?(d=!0,c=[],u=h.meta.label,!1):h.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(h),!d)}),!l.env.footnotes.list))return;const p=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let h=0,m=p.length;h<m;h++){const _=new l.Token("footnote_open","",1);if(_.meta={id:h,label:p[h].label},l.tokens.push(_),p[h].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=p[h].tokens,y.content=p[h].content,a.push(y);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else p[h].label&&(a=f[`:${p[h].label}`]);a&&(l.tokens=l.tokens.concat(a));let k;l.tokens[l.tokens.length-1].type==="paragraph_close"?k=l.tokens.pop():k=null;const g=p[h].count>0?p[h].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:h,subId:v,label:p[h].label},l.tokens.push(y)}k&&l.tokens.push(k),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 xz(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 _z(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 wz=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Sz(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(wz,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function Cz(e){e.inline.ruler.after("emphasis","sub",Sz)}const Az=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Mz(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(Az,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function Ez(e){e.inline.ruler.after("emphasis","sup",Mz)}var Tz=eA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,y=2;y<g.length;y++)o(g,y)&&(i(g[y],v,_,k.Token),v+=1,n(g[y-2],"class",_.liClass),n(g[s(g,y-2)],"class",_.ulClass))})};function n(m,_,k){var g=m.attrIndex(_),v=[_,k];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,_){for(var k=m[_].level-1,g=_-1;g>=0;g--)if(m[g].level===k)return g;return-1}function o(m,_){return d(m[_])&&f(m[_-1])&&p(m[_-2])&&h(m[_])}function i(m,_,k,g){var v=k.idPrefix+_;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,k,g)),k.divWrap&&(m.children.unshift(c(k,g)),m.children.push(u(g)))}function r(m,_,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",_]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,_){var k=new _("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,_){var k=new _("checkbox_open","div",0);return k.attrs=[["class",m.divClass]],k}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 p(m){return m.type==="list_item_open"}function h(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),Nz=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))),Iz=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),F1;const $z=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]]),Lz=(F1=String.fromCodePoint)!==null&&F1!==void 0?F1:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Fz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=$z.get(e))!==null&&t!==void 0?t:e}var ws;(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"})(ws||(ws={}));const Oz=32;var Jr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Jr||(Jr={}));function Sg(e){return e>=ws.ZERO&&e<=ws.NINE}function Rz(e){return e>=ws.UPPER_A&&e<=ws.UPPER_F||e>=ws.LOWER_A&&e<=ws.LOWER_F}function Bz(e){return e>=ws.UPPER_A&&e<=ws.UPPER_Z||e>=ws.LOWER_A&&e<=ws.LOWER_Z||Sg(e)}function Dz(e){return e===ws.EQUALS||Bz(e)}var _s;(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"})(_s||(_s={}));var Zr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Zr||(Zr={}));var Pz=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=_s.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Zr.Strict}startEntity(e){this.decodeMode=e,this.state=_s.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case _s.EntityStart:return e.charCodeAt(t)===ws.NUM?(this.state=_s.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=_s.NamedEntity,this.stateNamedEntity(e,t));case _s.NumericStart:return this.stateNumericStart(e,t);case _s.NumericDecimal:return this.stateNumericDecimal(e,t);case _s.NumericHex:return this.stateNumericHex(e,t);case _s.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Oz)===ws.LOWER_X?(this.state=_s.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=_s.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(Sg(s)||Rz(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(Sg(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===ws.SEMI)this.consumed+=1;else if(this.decodeMode===Zr.Strict)return 0;return this.emitCodePoint(Fz(this.result),this.consumed),this.errors&&(e!==ws.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&Jr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=Hz(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Zr.Attribute&&(o===0||Dz(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&Jr.VALUE_LENGTH)>>14,o!==0){if(i===ws.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Zr.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]&Jr.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]&~Jr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case _s.NamedEntity:return this.result!==0&&(this.decodeMode!==Zr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case _s.NumericDecimal:return this.emitNumericEntity(0,2);case _s.NumericHex:return this.emitNumericEntity(0,3);case _s.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case _s.EntityStart:return 0}}};function sA(e){let t="";const n=new Pz(e,s=>t+=Lz(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 Hz(e,t,n,s){const o=(t&Jr.BRANCH_LENGTH)>>7,i=t&Jr.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 Wz=sA(Nz);sA(Iz);function ay(e,t=Zr.Legacy){return Wz(e,t)}var zz=nA(Tz());const Yx={};function Uz(e){let t=Yx[e];if(t)return t;t=Yx[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 Wp(e,t){typeof t!="string"&&(t=Wp.defaultChars);const n=Uz(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})}Wp.defaultChars=";/?:@&=+$,#";Wp.componentChars="";var Cg=Wp;const Zx={};function jz(e){let t=Zx[e];if(t)return t;t=Zx[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 zp(e,t,n){typeof t!="string"&&(n=t,t=zp.defaultChars),typeof n>"u"&&(n=!0);const s=jz(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}zp.defaultChars=";/?:@&=+$,-_.!~*'()#";zp.componentChars="-_.!~*'()";var oA=zp;function cy(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 Nh(){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 qz=/^([a-z0-9.+-]+:)/i,Vz=/:[0-9]*$/,Kz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Gz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
96
+ `," "]),Yz=["'"].concat(Gz),Qx=["%","/","?",";","#"].concat(Yz),Xx=["/","?","#"],Zz=255,Jx=/^[+a-z0-9A-Z_-]{0,63}$/,Qz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,e_={javascript:!0,"javascript:":!0},t_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Xz(e,t){if(e&&e instanceof Nh)return e;const n=new Nh;return n.parse(e,t),n}Nh.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=Kz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=qz.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&&!t_[r])){let c=-1;for(let h=0;h<Xx.length;h++)s=i.indexOf(Xx[h]),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 h=0;h<Qx.length;h++)s=i.indexOf(Qx[h]),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 p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const h=this.hostname.split(/\./);for(let m=0,_=h.length;m<_;m++){const k=h[m];if(k&&!k.match(Jx)){let g="";for(let v=0,y=k.length;v<y;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(Jx)){const v=h.slice(0,m),y=h.slice(m+1),A=k.match(Qz);A&&(v.push(A[1]),y.unshift(A[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>Zz&&(this.hostname=""),p&&(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),t_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Nh.prototype.parseHost=function(e){let t=Vz.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 uy=Xz,iA=tA({decode:()=>Cg,encode:()=>oA,format:()=>cy,parse:()=>uy}),rA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lA=/[\0-\x1F\x7F-\x9F]/,Jz=/[\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]/,aA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,eU=/[\$\+<->\^`\|~\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]/,cA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,tU=tA({Any:()=>rA,Cc:()=>lA,Cf:()=>Jz,P:()=>aA,S:()=>eU,Z:()=>cA}),nU=Object.defineProperty,uA=e=>{let t={};for(var n in e)nU(t,n,{get:e[n],enumerable:!0});return t},ls=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}`}},sU=uA({arrayReplaceAt:()=>uU,assign:()=>aU,countLines:()=>Gn,escapeHtml:()=>kU,escapeRE:()=>xU,fromCodePoint:()=>id,has:()=>lU,isMdAsciiPunct:()=>Lh,isPunctChar:()=>$h,isPunctCode:()=>Ag,isSpace:()=>cU,isString:()=>iU,isValidEntityCode:()=>jp,isWhiteSpace:()=>od,lib:()=>_U,mdurl:()=>iA,normalizeReference:()=>Up,ucmicro:()=>Ih,unescapeAll:()=>rd,unescapeMd:()=>pU});const Ih=tU;function oU(e){return Object.prototype.toString.call(e)}function iU(e){return oU(e)==="[object String]"}const rU=Object.prototype.hasOwnProperty;function lU(e,t){return rU.call(e,t)}function aU(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 cU(e){return e===9||e===32}function od(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 $h(e){return Ih.P.test(e)||Ih.S.test(e)}const n_=new Map;function Ag(e){if(Lh(e))return!0;const t=n_.get(e);if(t!==void 0)return t;const n=$h(String.fromCharCode(e));return n_.set(e,n),n}function Lh(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 Up(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function uU(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function jp(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 id(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 dA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,dU=new RegExp(`${dA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),fU=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function hU(e,t){if(t.charCodeAt(0)===35&&fU.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return jp(s)?id(s):e}const n=ay(e);return n!==e?n:e}function pU(e){return e.includes("\\")?e.replace(dA,"$1"):e}function rd(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(dU,(t,n,s)=>n||hU(t,s))}const mU=/[&<>"]/,gU=/[&<>"]/g,vU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function yU(e){return vU[e]}function kU(e){return mU.test(e)?e.replace(gU,yU):e}const bU=/[.?*+^$[\]\\(){}|-]/g;function xU(e){return e.replace(bU,"\\$&")}const _U={mdurl:iA,ucmicro:Ih};function Gn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
97
+ `,n+1))!==-1;)t++;return t}const wU=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,SU=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,CU=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,dy=["references","footnotes","abbreviations","abbr","abbrs"],fy=Symbol.for("markdown-it-ts.global-state"),hy=Object.prototype.hasOwnProperty;function s_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function xi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ol(e){if(Array.isArray(e))return e.map(t=>ol(t));if(xi(e)){const t={};for(const n of Object.keys(e))t[n]=ol(e[n]);return t}return e}function Fh(e){return Array.isArray(e)?e.map((t,n)=>String(n)):xi(e)?Object.keys(e):[]}function Mg(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(!Mg(e[n],t[n]))return!1;return!0}if(xi(e)||xi(t)){if(!xi(e)||!xi(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(!hy.call(t,o)||!Mg(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function fA(e,t){if(Array.isArray(e))return e[Number(t)];if(xi(e))return e[t]}function AU(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=ol(t[n]);return e}if(xi(e)&&xi(t)){for(const n of Object.keys(e))hy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=ol(t[n]);return e}return ol(t)}function MU(e,t,n){const s=n.ownedKeys??[],o=e[t];if(xi(o)||Array.isArray(o)){const i=new Set(Fh(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=ol(fA(n.value,r)):delete o[r];!n.existed&&Fh(o).length===0&&delete e[t];return}n.existed?e[t]=ol(n.value):delete e[t]}function py(e){const t=e[fy];return s_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&s_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function EU(e,t){Object.defineProperty(e,fy,{value:t,enumerable:!1,configurable:!0,writable:!0})}function po(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:wU.test(e)?"footnote-definition":SU.test(e)?"abbreviation-definition":CU.test(e)?"reference-definition":null}function Sd(e){return py(e)?.reason??null}function mc(e,t,n){if(Sd(e)&&_r(e),!t)return n();my(e,t);try{const s=n();return gy(e),s}catch(s){throw _r(e),s}}function my(e,t){try{_r(e);const n={};for(const s of dy)n[s]=hy.call(e,s)?{existed:!0,value:ol(e[s])}:{existed:!1};EU(e,{reason:t,snapshot:n})}catch{}}function gy(e){const t=py(e);if(t)for(const n of dy){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!xi(o)&&!Array.isArray(o))continue;const i=new Set(Fh(s.existed?s.value:void 0));s.ownedKeys=Fh(o).filter(r=>i.has(r)?!Mg(o[r],fA(s.value,r)):!0)}}function _r(e){const t=py(e);if(t){for(const n of dy){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){MU(e,n,s);continue}s.existed?e[n]=AU(e[n],s.value):delete e[n]}delete e[fy]}}const Eg=Symbol.for("markdown-it-ts.diagnostics");function qp(e,t){if(e)try{const n=e[Eg];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[Eg]=s,s}catch{return}}function or(e){return qp(e,!1)}function TU(e){if(e)try{const t=e[Eg];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function Zs(e){TU(e)}function is(e,t){const n=qp(e,!0);n&&(n.strategy=t)}function O1(e,t){const n=qp(e,!0);n&&(n.chunk=t)}function hA(e,t){const n=qp(e,!0);n&&(n.unbounded=t)}function NU(e){const t={};e=e||{},t.src_Any=rA.source,t.src_Cc=lA.source,t.src_Z=cA.source,t.src_P=aA.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 Tg(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Vp(e){return Object.prototype.toString.call(e)}function IU(e){return Vp(e)==="[object String]"}function $U(e){return Vp(e)==="[object Object]"}function LU(e){return Vp(e)==="[object RegExp]"}function o_(e){return Vp(e)==="[object Function]"}function FU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const pA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function OU(e){return Object.keys(e||{}).reduce(function(t,n){return t||pA.hasOwnProperty(n)},!1)}const RU={"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}}},BU="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]",DU="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function PU(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function i_(){return function(e,t){t.normalize(e)}}function Oh(e){const t=e.re=NU(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(BU),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,$U(a)){LU(a.validate)?c.validate=PU(a.validate):o_(a.validate)?c.validate=a.validate:i(l,a),o_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=i_();return}if(IU(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:i_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(FU).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function mA(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 Uo(e,t){if(!(this instanceof Uo))return new Uo(e,t);t||OU(e)&&(t=e,e={}),this.__opts__=Tg({},pA,t),this.__schemas__=Tg({},RU,e),this.__compiled__={},this.__tlds__=DU,this.__tlds_replaced__=!1,this.re={},Oh(this)}Uo.prototype.add=function(t,n){return this.__schemas__[t]=n,Oh(this),this};Uo.prototype.set=function(t){return this.__opts__=Tg(this.__opts__,t),this};Uo.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)};Uo.prototype.pretest=function(t){return this.re.pretest.test(t)};Uo.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};Uo.prototype.match=function(t){const n=[],s=[],o=[],i=[];let r,l,a;function c(f,p){return f?p?f.index!==p.index?f.index<p.index?f:p:f.lastIndex>=p.lastIndex?f:p:f:p}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]]],p=c(c(f[0],f[1]),f[2]);if(!p)break;if(p===f[0]?u[0]++:p===f[1]?u[1]++:u[2]++,p.index<d)continue;const h=new mA(t,p.schema,p.index,p.lastIndex);this.__compiled__[h.schema].normalize(h,this),n.push(h),d=p.lastIndex}return n.length?n:null};Uo.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 mA(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};Uo.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(),Oh(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Oh(this),this)};Uo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Uo.prototype.onCompile=function(){};var gA=Uo,HU=eA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,_=Math.floor,k=String.fromCharCode;function g(O){throw new RangeError(h[O])}function v(O,D){const W=[];let z=O.length;for(;z--;)W[z]=D(O[z]);return W}function y(O,D){const W=O.split("@");let z="";W.length>1&&(z=W[0]+"@",O=W[1]),O=O.replace(p,".");const V=v(O.split("."),D).join(".");return z+V}function A(O){const D=[];let W=0;const z=O.length;for(;W<z;){const V=O.charCodeAt(W++);if(V>=55296&&V<=56319&&W<z){const U=O.charCodeAt(W++);(U&64512)==56320?D.push(((V&1023)<<10)+(U&1023)+65536):(D.push(V),W--)}else D.push(V)}return D}const L=O=>String.fromCodePoint(...O),$=function(O){return O>=48&&O<58?26+(O-48):O>=65&&O<91?O-65:O>=97&&O<123?O-97:36},x=function(O,D){return O+22+75*(O<26)-((D!=0)<<5)},E=function(O,D,W){let z=0;for(O=W?_(O/700):O>>1,O+=_(O/D);O>m*26>>1;z+=36)O=_(O/m);return _(z+(m+1)*O/(O+38))},N=function(O){const D=[],W=O.length;let z=0,V=128,U=72,re=O.lastIndexOf("-");re<0&&(re=0);for(let ae=0;ae<re;++ae)O.charCodeAt(ae)>=128&&g("not-basic"),D.push(O.charCodeAt(ae));for(let ae=re>0?re+1:0;ae<W;){const te=z;for(let ne=1,ke=36;;ke+=36){ae>=W&&g("invalid-input");const Se=$(O.charCodeAt(ae++));Se>=36&&g("invalid-input"),Se>_((2147483647-z)/ne)&&g("overflow"),z+=Se*ne;const Ye=ke<=U?1:ke>=U+26?26:ke-U;if(Se<Ye)break;const ve=36-Ye;ne>_(2147483647/ve)&&g("overflow"),ne*=ve}const Z=D.length+1;U=E(z-te,Z,te==0),_(z/Z)>2147483647-V&&g("overflow"),V+=_(z/Z),z%=Z,D.splice(z++,0,V)}return String.fromCodePoint(...D)},F=function(O){const D=[];O=A(O);const W=O.length;let z=128,V=0,U=72;for(const te of O)te<128&&D.push(k(te));const re=D.length;let ae=re;for(re&&D.push("-");ae<W;){let te=2147483647;for(const ne of O)ne>=z&&ne<te&&(te=ne);const Z=ae+1;te-z>_((2147483647-V)/Z)&&g("overflow"),V+=(te-z)*Z,z=te;for(const ne of O)if(ne<z&&++V>2147483647&&g("overflow"),ne===z){let ke=V;for(let Se=36;;Se+=36){const Ye=Se<=U?1:Se>=U+26?26:Se-U;if(ke<Ye)break;const ve=ke-Ye,Y=36-Ye;D.push(k(x(Ye+ve%Y,0))),ke=_(ve/Y)}D.push(k(x(ke,0))),U=E(V,Z,ae===re),V=0,++ae}++V,++z}return D.join("")},R={version:"2.3.1",ucs2:{decode:A,encode:L},decode:N,encode:F,toASCII:function(O){return y(O,function(D){return f.test(D)?"xn--"+F(D):D})},toUnicode:function(O){return y(O,function(D){return d.test(D)?N(D.slice(4).toLowerCase()):D})}};t.exports=R})}),vA=nA(HU());function vy(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=rd(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=rd(e.slice(t,o)),i.pos=o,i.ok=!0),i}var yA=vy;const zf=-2;function WU(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 zf}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return zf;if(r===91){o++,i++;continue}i++}return-1}function yy(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=WU(l,t,a,n);if(f!==zf)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 p=-1;return o&&(p=e.pos),e.pos=c,p}var Rh=yy;function ky(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+=rd(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+=rd(e.slice(t,i)),r}var kA=ky;function Kp(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 by(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function zU(e,t,n){const s=Kp(e,t),o=[t,n];s<0?by(e,o):e.attrs[s]=o}function UU(e,t){const n=Kp(e,t);return n>=0?e.attrs[n][1]:null}function jU(e,t,n){const s=Kp(e,t);s<0?by(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var qU=uA({attrGet:()=>UU,attrIndex:()=>Kp,attrJoin:()=>jU,attrPush:()=>by,attrSet:()=>zU,parseLinkDestination:()=>vy,parseLinkLabel:()=>yy,parseLinkTitle:()=>ky});function VU(e){return e.includes("\r")||e.includes("\0")}function bA(e){return typeof e=="string"?e:e.toString()}function KU(e){if(e.inlineMode){const t=new ls("inline","",0);t.content=bA(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 GU=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,YU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function ZU(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(YU.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(GU.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 QU=ZU;function XU(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(`
98
+ `)&&(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 JU=XU;function r_(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 p=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+p,i[c]=p,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 ej(e){const t=e.tokens_meta,n=e.tokens_meta.length;r_(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&r_(t[s].delimiters)}var tj=ej;function nj(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 l_(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 sj(e){const t=e.tokens_meta,n=e.tokens_meta.length;l_(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&l_(e,t[s].delimiters)}const a_={tokenize:nj,postProcess:sj};function xA(e){return ay(e)}function xy(e){return e>=48&&e<=57}function oj(e){const t=e|32;return xy(e)||t>=97&&t<=102}function _A(e){const t=e|32;return t>=97&&t<=122}function ij(e){return _A(e)||xy(e)}function rj(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?oj(l):xy(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function lj(e,t,n){let s=t+1;if(s>=n||!_A(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&ij(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 xA(o)!==o?o:null}function aj(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=rj(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=jp(i)?id(i):id(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=lj(e.src,n,s);if(o){const i=xA(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 cj=aj;const wA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Ng=new Array(128),SA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Ng[e]=`\\${t}`,SA[e]=wA[e]?t:Ng[e]}function c_(e,t,n){e.pending&&e.pushPending();const s=new ls("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 uj(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):(c_(e,SA[i],Ng[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 c_(e,i<256&&wA[i]?r:l,l),e.pos=n+1,!0}var dj=uj;function fj(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 hj=fj;const CA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,AA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",pj=new RegExp(`^(?:${CA}|${AA}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),mj=new RegExp(`^(?:${CA}|${AA})`);function MA(e){return e===32||e===9||e===10||e===12||e===13}function gj(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||MA(t)}function vj(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(!MA(n))return!1}return!1}function yj(e){const t=e|32;return t>=97&&t<=122}function kj(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&&!yj(i))return!1;const r=o.slice(s).match(pj);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,gj(l)&&e.linkLevel++,vj(l)&&e.linkLevel--}return e.pos+=l.length,!0}var bj=kj;function xj(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 p=e.pos+2,h=Rh(e,e.pos+1,!1);if(h<0)return!1;if(i=h+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=yA(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=Rh(e,i),i>=0?o=e.src.slice(c,i++):i=h+1):i=h+1,o||(o=e.src.slice(p,h)),r=e.env.references[Up(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(p,h);const m=[];e.md.inline.parse(s,e.md,e.env,m);const _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=m,_.content=s,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var _j=xj;function wj(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,p=Rh(e,e.pos,!0);if(p<0)return!1;let h=p+1;if(h<d&&e.src.charCodeAt(h)===40){for(c=!1,h++;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(h>=d)return!1;if(o=yA(e.src,h,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?h=o.pos:r="",a=h;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(o=kA(e.src,h,e.posMax),h<d&&a!==h&&o.ok)for(l=o.str,h=o.pos;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);}(h>=d||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h<d&&e.src.charCodeAt(h)===91?(a=h+1,h=Rh(e,h),h>=0?s=e.src.slice(a,h++):h=p+1):h=p+1,s||(s=e.src.slice(f,p)),i=e.env.references[Up(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=p;const m=e.push("link_open","a",1),_=[["href",r]];m.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=d,!0}var Sj=wj;function EA(e){const t=e|32;return t>=97&&t<=122}function Cj(e){return e>=48&&e<=57}function Aj(e){return EA(e)||Cj(e)||e===43||e===45||e===46}function Mj(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Aj(e.charCodeAt(t));)t--;return t++,t>=e.length||!EA(e.charCodeAt(t))?null:e.slice(t)}function Ej(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 Tj(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=Mj(e.pending);if(!o)return!1;const i=Ej(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 Nj(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 Ij=Nj;function $j(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 u_(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 Lj(e){const t=e.delimiters;u_(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&u_(e,n[s].delimiters)}const d_={tokenize:$j,postProcess:Lj};function f_(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 Fj(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||f_(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!f_(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var Oj=Fj;function _y(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Rj(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 Bj(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 TA(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:_y(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function gc(e,t,n,s,o,i){const r=TA(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Bj(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=_y()}function Dj(e){const t=TA(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=Rj(o.samples)}return t.completedAt=_y(),t}var h_=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}},NA=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 ls("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 ls(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 ls(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=od(l),u=od(a),d=Ag(l),f=Ag(a),p=!u&&(!f||c||d),h=!c&&(!d||u||f);return{can_open:p&&(t||!h||d),can_close:h&&(t||!p||f),length:r}}};NA.prototype.Token=ls;const Pj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function IA(e){return!Pj.test(e)}var Hj=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new h_,this.ruler2=new h_,this.ruler.push("text",Oj),this.ruler.push("linkify",Tj),this.ruler.push("newline",Ij),this.ruler.push("escape",dj),this.ruler.push("backticks",JU),this.ruler.push("strikethrough",d_.tokenize),this.ruler.push("emphasis",a_.tokenize),this.ruler.push("link",Sj),this.ruler.push("image",_j),this.ruler.push("autolink",QU),this.ruler.push("html_inline",bj),this.ruler.push("entity",cj),this.ruler2.push("balance_pairs",tj),this.ruler2.push("strikethrough",d_.postProcess),this.ruler2.push("emphasis",a_.postProcess),this.ruler2.push("fragments_join",hj),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(gc(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(gc(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()&&IA(e)){const a=new ls("text","",0);a.content=e,s.push(a);return}const o=new NA(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();gc(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 Wj(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&&IA(i.content)){const r=new ls("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const zj=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,Uj=/[0-9a-z]/i;function jj(e){return/^<a[>\s]/i.test(e)}function qj(e){return/^<\/a\s*>/i.test(e)}function Vj(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(!zj.test(s)||!Uj.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 Kj(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"&&(jj(l.content)&&i>0&&i--,qj(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(p=>Vj(e.md.linkify,p));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 p=0;p<c.length;p++){const h=c[p],m=e.md.normalizeLink(h.url);if(!e.md.validateLink(m))continue;let _=h.text;h.schema?h.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const k=h.index;if(k>f){const A=new ls("text","",0);A.content=a.slice(f,k),A.level=d,u.push(A)}const g=new ls("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new ls("text","",0);v.content=_,v.level=d,u.push(v);const y=new ls("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=h.lastIndex}if(f!==0){if(f<a.length){const p=new ls("text","",0);p.content=a.slice(f),p.level=d,u.push(p)}o.splice(r,1,...u)}}}}const Gj=/\r\n?|\n/g,Yj=/\0/g;function Zj(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(Gj,`
99
+ `)),s&&(o=o.replace(Yj,"�")),e.src=o}const $A=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Qj=/\((?:c|tm|r)\)/i,Xj=/\((c|tm|r)\)/gi,Jj={c:"©",r:"®",tm:"™"};function eq(e,t){return Jj[t.toLowerCase()]}function tq(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(Xj,eq)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function nq(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&$A.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 sq(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(""):"");Qj.test(s)&&tq(n.children||[]),$A.test(s)&&nq(n.children||[])}}var oq=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 iq=/['"]/,p_=/['"]/g,m_="’";function yf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function rq(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;){p_.lastIndex=c;const d=p_.exec(a);if(!d)break;let f=!0,p=!0;c=d.index+1;const h=d[0]==="'";let m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let _=32;if(c<u)_=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){_=e[n].content.charCodeAt(0);break}const k=Lh(m)||$h(String.fromCharCode(m)),g=Lh(_)||$h(String.fromCharCode(_)),v=od(m),y=od(_);if(y?f=!1:g&&(v||k||(f=!1)),v?p=!1:k&&(y||g||(p=!1)),_===34&&d[0]==='"'&&m>=48&&m<=57&&(p=f=!1),f&&p&&(f=k,p=g),!f&&!p){h&&(r.content=yf(r.content,d.index,m_));continue}if(p)for(n=s.length-1;n>=0;n--){let A=s[n];if(s[n].level<l)break;if(A.single===h&&s[n].level===l){A=s[n];let L,$;h?(L=o[2]||"‘",$=o[3]||"’"):(L=o[0]||"“",$=o[1]||"”"),r.content=yf(r.content,d.index,$),e[A.token].content=yf(e[A.token].content,A.pos,L),c+=$.length-1,A.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:h,level:l}):p&&h&&(r.content=yf(r.content,d.index,m_))}}}function lq(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("");!iq.test(s)||!n.children||rq(n.children,e)}}function aq(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 cq=/^(?:vbscript|javascript|file|data):/,uq=/^data:image\/(?:gif|png|jpeg|webp);/,LA=["http:","https:","mailto:"];function FA(e){const t=e.trim().toLowerCase();return cq.test(t)?uq.test(t):!0}function OA(e){const t=uy(e,!0);if(t.hostname&&(!t.protocol||LA.includes(t.protocol)))try{t.hostname=vA.default.toASCII(t.hostname)}catch{}return oA(cy(t))}function RA(e){const t=uy(e,!0);if(t.hostname&&(!t.protocol||LA.includes(t.protocol)))try{t.hostname=vA.default.toUnicode(t.hostname)}catch{}return Cg(cy(t),`${Cg.defaultChars}%`)}function dq(e){switch(e){case 9:case 32:return!0}return!1}function fq(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 p=[],h=[],m=[],_=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const E=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!E){let F=a[y]+1,S,T;o.charCodeAt(u)===32?(u++,F++,T=!1,S=!0):o.charCodeAt(u)===9?(S=!0,(c[y]+F)%4===3?(u++,F++,T=!1):T=!0):S=!1;let R=F;for(p.push(i[y]),i[y]=u;u<d;){const O=o.charCodeAt(u);if(dq(O))O===9?R+=4-(R+c[y]+(T?1:0))%4:R++;else break;u++}v=u>=d,h.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=R-F,_.push(l[y]),l[y]=u-i[y];continue}if(v)break;let N=!1;for(let F=0,S=k.length;F<S;F++)if(k[F](e,y,n,!0)){N=!0;break}if(N){e.lineMax=y,e.blkIndent!==0&&(p.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}p.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]=-1}const A=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 x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=f,e.parentType=g,$[1]=e.line;for(let E=0;E<_.length;E++)i[E+t]=p[E],l[E+t]=_[E],a[E+t]=m[E],c[E+t]=h[E];return e.blkIndent=A,!0}function hq(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)}
100
+ `,i.map=[t,e.line],!0}function pq(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 p=e.push("fence","code",0);return p.info=u,p.content=e.getLines(t+1,d,a,!0),p.markup=c,p.map=[t,e.line],!0}const g_=["","h1","h2","h3","h4","h5","h6"],v_=["","#","##","###","####","#####","######"];function y_(e){switch(e){case 9:case 32:return!0}return!1}function mq(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&&!y_(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&y_(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const p=e.push("heading_open",g_[d],1);p.markup=v_[d],p.map=[t,e.line];const h=e.push("inline","",0);h.content=o.slice(a,c).trim(),h.map=[t,e.line],h.children=[];const m=e.push("heading_close",g_[d],-1);return m.markup=v_[d],!0}function gq(e){switch(e){case 9:case 32:return!0}return!1}function vq(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&&!gq(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 Da=[[/^<(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(`${mj.source}\\s*$`),/^$/,!1]];function yq(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<Da.length&&!Da[l][0].test(r);l++);if(l===Da.length)return!1;if(s)return Da[l][2];let a=t+1;if(!Da[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),Da[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 k_(e){switch(e){case 9:case 32:return!0}return!1}const Eu={Pipe:1,ParagraphTerminator:2};function kq(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 BA=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|=Eu.Pipe|Eu.ParagraphTerminator),!a)if(k_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,kq(f)&&(c|=Eu.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 ls(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new ls(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 p=s?this.eMarks[u]+1:this.eMarks[u];let h=0;const m=this.src,_=this.bsCount,k=this.tShift;for(;f<p&&h<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?h+=4-(h+_[u])%4:h++;else if(f-d<k[u])h++;else break;f++}return h>n?new Array(h-n+1).join(" ")+m.slice(f,p):m.slice(f,p)}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 p=r[d];let h=p,m;for(d+1<t||s?m=l[d]+1:m=l[d];h<m&&f<n;){const _=i.charCodeAt(h);if(k_(_))_===9?f+=4-(f+a[d])%4:f++;else if(h-p<c[d])f++;else break;h++}f>n?o[u]=new Array(f-n+1).join(" ")+i.slice(h,m):o[u]=i.slice(h,m)}return o.join("")}};BA.prototype.Token=ls;function bq(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function DA(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function PA(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&Eu.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:bq(n,s,o)}const b_=["","h1","h2"];function xq(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=DA(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,p,h=t+1;for(;h<n;h++){const y=i[h]+r[h],A=l[h];if(y>=A)break;if(a[h]-c>3)continue;if(a[h]>=c&&(p=o.charCodeAt(y),p===45||p===61)){let $=y+1,x=$;for(;$<A&&o.charCodeAt($)===p;)$++;for(x=$;$<A;){const E=o.charCodeAt($);if(E!==9&&E!==32)break;$++}if($>=A){f=p===61?1:2;break}if(x-y>1)continue}if(a[h]<0||u&&!PA(e,h,o,y,A))continue;let L=!1;for(let $=0,x=s.length;$<x;$++)if(s[$](e,h,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(h===t+1){const y=i[t]+r[t];let A=l[t];for(;A>y;){const L=o.charCodeAt(A-1);if(L!==9&&L!==32)break;A--}m=o.slice(y,A)}else m=e.getLines(t,h,c,!1).trim();e.line=h+1;const _=p===61?"=":"-",k=e.push("heading_open",b_[f],1);k.markup=_,k.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",b_[f],-1);return v.markup=_,e.parentType=d,!0}function HA(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&&!HA(i.charCodeAt(l))?-1:l}function __(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),!HA(c))?-1:a}function _q(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 wq=["0","1","2","3","4","5","6","7","8","9"];function Sq(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 Cq(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 p=e.src,h=e.bMarks,m=e.tShift,_=e.eMarks,k=e.sCount,g=e.bsCount,v=h[l]+m[l];if(v>=_[l])return!1;const y=p.charCodeAt(v);if(y>=48&&y<=57){if(f=__(e,l),f<0||(u=!0,r=v,d=_q(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)>=_[l])return!1;if(s)return!0;const A=p.charCodeAt(f-1),L=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=L;let x=!1;const E=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,o=_[l];const S=k[l]+f-(h[l]+m[l]);let T=S;for(;i<o;){const Z=p.charCodeAt(i);if(Z===9)T+=4-(T+g[l])%4;else if(Z===32)T++;else break;i++}const R=i;let O;R>=o?O=1:O=T-S,O>4&&(O=1);const D=S+O,W=e.push("list_item_open","li",1);W.markup=L;const z=[l,0];W.map=z,u&&(W.info=f-r-1===1?wq[p.charCodeAt(r)-48]:p.slice(r,f-1));const V=e.tight,U=e.tShift[l],re=e.sCount[l],ae=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=D,e.tight=!0,e.tShift[l]=R-h[l],e.sCount[l]=T,R>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||x)&&(a=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ae,e.tShift[l]=U,e.sCount[l]=re,e.tight=V,e.push("list_item_close","li",-1).markup=L,l=e.line,z[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let te=!1;for(let Z=0,ne=N.length;Z<ne;Z++)if(N[Z](e,l,n,!0)){te=!0;break}if(te)break;if(u){if(f=__(e,l),f<0)break;r=h[l]+m[l]}else if(f=x_(e,l),f<0)break;if(A!==p.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=F,a&&Sq(e,E),!0}function w_(e){return e===9||e===32}function Aq(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=DA(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 A=i.charCodeAt(v);if(A===42||A===45||A===43){if(v+1>=y||w_(i.charCodeAt(v+1)))break}else if(A>=48&&A<=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||w_(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const _=r[f]+l[f],k=a[f];if(d&&!PA(e,f,i,_,k))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 p=e.getLines(t,f,u,!1).trim();e.line=f;const h=e.push("paragraph_open","p",1);h.map=[t,e.line];const m=e.push("inline","",0);return m.content=p,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function kf(e){switch(e){case 9:case 32:return!0}return!1}function Mq(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 A=!1;if(e.sCount[v]-e.blkIndent>3&&(A=!0),e.sCount[v]<0&&(A=!0),!A){const x=e.parentType;e.parentType="reference";let E=!1;for(let N=0,F=l.length;N<F;N++)if(l[N](e,v,y,!0)){E=!0;break}if(e.parentType=x,E)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(!kf(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 p=o,h=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(!kf(v))break}let _=e.md.helpers.parseLinkTitle(c,o,i);for(;_.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,_=e.md.helpers.parseLinkTitle(c,o,i,_)}let k;for(o<i&&m!==o&&_.ok?(k=_.str,o=_.pos):(k="",o=p,r=h);o<i&&kf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&k)for(k="",o=p,r=h;o<i&&kf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=Up(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:k,href:f}),e.line=r),!0):!1}function R1(e){switch(e){case 9:case 32:return!0}return!1}const Eq=65536;function B1(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function Tq(e,t){if(e.lineFlags)return(e.lineFlags[t]&Eu.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 S_(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 Nq(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&&!R1(l)||r===45&&R1(l)||!Tq(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!R1(y))return!1;i++}let a=B1(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const A=c[y].trim();if(!A){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=B1(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=S_(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 p=e.md.block.ruler.getRulesForState(e,"blockquote"),h=e.push("table_open","table",1),m=[t,0];h.map=m;const _=e.push("thead_open","thead",1);_.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let y=0;y<c.length;y++){const A=e.push("th_open","th",1);u[y]&&(A.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,$=p.length;L<$;L++)if(p[L](e,o,n,!0)){y=!0;break}if(y||(a=B1(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=S_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>Eq))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const A=e.push("tr_open","tr",1);A.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 x=e.push("inline","",0);x.content=c[L]?c[L].trim():"",x.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 Iq=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 gc(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 bf=[["table",Nq,["paragraph","reference"]],["code",hq],["fence",pq,["paragraph","reference","blockquote","list"]],["blockquote",fq,["paragraph","reference","blockquote","list"]],["hr",vq,["paragraph","reference","blockquote","list"]],["list",Cq,["paragraph","reference","blockquote"]],["reference",Mq],["html_block",yq,["paragraph","reference","blockquote"]],["heading",mq,["paragraph","reference","blockquote"]],["lheading",xq],["paragraph",Aq]];var $q=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Iq;for(let e=0;e<bf.length;e++)this.ruler.push(bf[e][0],bf[e][1],{alt:(bf[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 p=e.line;let h=!1;for(let m=0;m<o;m++)if(h=s[m](e,u,n,!1),h){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}if(!h)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 p=e.line;let h=!1;for(let m=0;m<o;m++){const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();h=f[m].fn(e,u,n,!1);const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(gc(e.env,"block",f[m].name,k-_,h,!1),h){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!h)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 BA(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}},WA=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}};WA.prototype.Token=ls;const C_=[["normalize",Zj],["block",KU],["inline",Wj],["linkify",Kj],["replacements",sq],["smartquotes",lq],["text_join",aq]],Lq={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Fq={parseLinkLabel:yy,parseLinkDestination:vy,parseLinkTitle:ky};function Oq(){return{...Lq}}function Rq(){return{...Fq}}var Bq=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new $q,this.inline=new Hj,this.ruler=new oq;for(let e=0;e<C_.length;e++){const[t,n]=C_[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:Oq(),helpers:Rq(),normalizeLink:OA,normalizeLinkText:RA,validateLink:FA,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new gA),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 WA(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();gc(e.env,"core",t[n].name,o-s,!0,!1)}Dj(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&VU(e))return this.parse(bA(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 Dq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Bh(e){return!Dq.test(e)}function yu(e,t){const n=e.indexOf(`
101
+ `,t);return n===-1?e.length:n}function Uf(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 A_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function D1(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Pq(e){if(e.length>3)return Bh(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 Hq=["","h1","h2","h3","h4","h5","h6"],Wq=["","#","##","###","####","#####","######"],M_=0,P1=1,H1=2;function Fo(e,t,n,s){const o=new ls(e,t,n);return o.level=s,o.block=!0,o}function zA(e,t,n){const s=Fo("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new ls("text","",0);return o.content=e,s.children=[o],s}function zq(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(!Bh(u))return!1;const d=Hq[i],f=Wq[i],p=Fo("heading_open",d,1,0);p.map=[o,o+1],p.markup=f,e.push(p),e.push(zA(u,o,1));const h=Fo("heading_close",d,-1,0);return h.markup=f,e.push(h),!0}function Uq(e,t,n){const s=Fo("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(zA(t,n,1)),e.push(Fo("paragraph_close","p",-1,0))}function jq(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function W1(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function qq(e,t){const n=Fo("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function Vq(e,t,n){const s=Fo("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=Fo("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=Fo("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new ls("text","",0);r.content=t,i.children=[r],e.push(i);const l=Fo("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Fo("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function Kq(e){const t=Fo("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function Gq(e,t,n,s){if(!A_(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=yu(e,l);if(A_(e,l,c)&&Uf(e,l+3,c)){const u=Fo("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 Yq(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?M_:H1,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=yu(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(!Uf(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!zq(t,e,r,a,l))return null;const p=a<e.length?a+1:a;r=W1(e,p),l+=1+r-p;continue}if(c===45){if(!D1(e,r,a))return null;const p=l;let h=r,m=l,_=null,k=null;for(;h<e.length;){const y=yu(e,h);if(!D1(e,h,y))break;const A=h+2,L=y===A+1?e[A]:e.slice(A,y);if(!Pq(L))return null;_===null&&(_=qq(t,p)),k=Vq(t,L,m),h=y<e.length?y+1:y,m++}if(_===null||k===null)return null;let g=h,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=yu(e,g);if(!Uf(e,g,y)){if(D1(e,g,y))return null;break}g=y<e.length?y+1:y,v++}_.map[1]=v,k.map[1]=v,Kq(t),r=g,l=v;continue}if(c===96){const p=Gq(e,r,a,l);if(!p)return null;t.push(p.token),r=W1(e,p.nextPos),l=p.nextLine+r-p.nextPos;continue}const u=jq(e,r,a);let d;if(n===H1?d=Bh(u):n===P1&&u===s?d=o:(d=Bh(u),n===M_?(i&&(n=u===s?P1:H1),s=u,o=d,i=!0):n===P1&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!Uf(e,f,yu(e,f)))return null;Uq(t,u,l),r=W1(e,f),l+=1+r-f}return t}const Zq=/[&<>"]/,E_=/[&<>"]/g,Qq=/&/g,Xq=/[<>"]/g,Jq={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function z1(e){return Jq[e]||e}function En(e){if(e.length===0)return"";if(e.length<32)return Zq.test(e)?e.replace(E_,z1):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(Qq,"&amp;"):t?e.replace(E_,z1):e.replace(Xq,z1)}const eV=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),tV=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function UA(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(eV,(t,n,s)=>{if(n)return n;if(tV.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return jp(i)?id(i):"�"}const o=ay(t);return o!==t?o:t})}const nV=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,sV=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,oV=/"/g;function tc(e,t){const n=e.indexOf(`
102
+ `,t);return n===-1?e.length:n}function Dh(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 xf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function iV(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!Dh(e,t,tc(e,t))}function T_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function rV(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function wy(e){return sV.test(e)?nV.test(e)?null:e.replace(oV,"&quot;"):e}function lV(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=wy(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
103
+ `}function N_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function aV(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
104
+ `;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>
105
+ `}function cV(e,t,n){const s=t+2;if(n===s+1)return aV(e,s);const o=wy(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
106
+ `}function uV(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 dV(e,t,n,s){if(!T_(e,t,n))return null;const o=uV(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=tc(e,l);if(T_(e,l,a)&&Dh(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-${En(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${En(c)}</code></pre>
107
+ `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function I_(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=tc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!Dh(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=lV(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=xf(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=tc(e,m);if(!N_(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const _=e.slice(t,m);let k;if(_===r)k=l;else{let v=t;for(k=`<ul>
108
+ `;v<m;){const y=tc(e,v),A=cV(e,v,y);if(A===null)return null;k+=A,v=y<e.length?y+1:y}k+=`</ul>
109
+ `,r=_,l=k}let g=xf(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=tc(e,g);if(!Dh(e,g,v)){if(N_(e,g,v))return null;break}g=v<e.length?v+1:v}s?o.push(k):n+=k,t=g;continue}if(d===96){const m=dV(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=xf(e,m.nextPos);continue}const f=rV(e,t,u);let p;if(f===a)p=c;else{const m=wy(f);if(m===null)return null;p=`<p>${m}</p>
110
+ `,a=f,c=p}const h=u<e.length?u+1:u;if(h<e.length&&e.charCodeAt(h)!==10&&iV(e,h))return null;s?o.push(p):n+=p,t=xf(e,h)}return s?o.join(""):n}const fV={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Ph(e,t,n={},s){Zs(n);const o={...fV,...s||{}},i=po(t);if(o.fallbackOnGlobalState!==!1&&i)return O1(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),mc(n,i,()=>e.core.parse(t,n,e).tokens);let r=jf(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=gV(r,o.maxChunks)),qf(t,r))return O1(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),mc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return O1(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),mc(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&&pV(f,l),mV(a,f),l+=u.lineCount}return a})}function jf(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 p=e.indexOf(`
111
+ `,f),h=p;p===-1?(p=e.length,h=e.length):h=p+1;const m=vV(e,f,p);if(t.fenceAware){let g=f;for(;g<p;){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<p&&e[y]===v;)y++;const A=y-g;A>=3&&(u?u.marker===v&&A>=u.length&&(u=null):u={marker:v,length:A})}}const _=h-f;o+=_,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=_);const k=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(k)d(h);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(h)}f=h}return n&&d(e.length),s}function qf(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!hV(e,t[o].end))return!0;return!1}function hV(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 pV(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 mV(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function gV(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 vV(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 jA=4e6,qA=8e4,yV=1e4,kV=200,bV=1e4,xV=200;function VA(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function _V(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 Dr(e){return e.length===0?0:Gn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function wV(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 SV(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
112
+ `,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 CV(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 wV(e,n+1,e.length-1)?!SV(e,t):!1}function AV(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??bV:e.options.fullChunkSizeChars??yV),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??xV:e.options.fullChunkSizeLines??kV);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 Cd=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=Dr(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=jf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(qf(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,Dr(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!CV(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Dr(this.pending)),null;const n=jf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Dr(this.pending)),null;const s=qf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Dr(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=jf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=qf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Dr(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:Dr(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Dr(this.pending);return AV(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Sd(e)&&_r(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=po(t);n&&(my(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&&_V(r,a),this.options.retainTokens!==!1&&VA(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&&gy(t),n}catch(s){throw this.markedGlobalStateReason&&(_r(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){hA(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 MV(e,t,n={},s={}){Zs(n);const o=new Cd(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function EV(e,t,n={},s={}){Zs(n);const o=new Cd(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function TV(e,t,n,s={},o={}){Zs(s);const i=new Cd(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 NV(e,t,n,s={},o={}){Zs(s);const i=new Cd(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 KA(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??jA,o=e.options.autoUnboundedThresholdLines??qA;return t>=s||n>=o}function GA(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??jA))return"yes";const s=e.options.autoUnboundedThresholdLines??qA;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Tu(e,t,n={},s={}){Zs(n);const o=po(t);if(Sd(n)&&_r(n),s.fallbackOnGlobalState!==!1&&o)return hA(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:Gn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),mc(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Cd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){VA(i,l)}});if(o&&my(n,o),r.feed(t),r.flushForce(n),o&&(gy(n),s.fallbackOnGlobalState===!1)){const l=or(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const vc=(e,t,n)=>e<t?t:e>n?n:e;function YA(e){return e.experimental?{...e,...e.experimental}:e}const $_=[{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"}],L_=[{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 ZA(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function IV(e,t=Math.max(0,e/40|0),n={}){const s=YA(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<$_.length;l++){const a=$_[l];if(e<=a.max){if(a.strategy!=="adaptive")return ZA(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:vc(Math.ceil(e/i),8e3,64e3),maxChunkLines:vc(Math.ceil(t/i),150,700),maxChunks:vc(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 F_(e,t=Math.max(0,e/40|0),n={}){const s=YA(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<L_.length;l++){const a=L_[l];if(e<=a.max){if(a.strategy!=="adaptive")return ZA(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:vc(Math.ceil(e/i),8e3,64e3),maxChunkLines:vc(Math.ceil(t/i),150,700),maxChunks:vc(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 $V={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"]}}},LV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},FV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Gp(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Vf(e,t){if(Gp(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const O_=e=>Gp(e)?e:Promise.resolve(e);function Nu(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 En(e)}}function dl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Nu(t[0])}="${En(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Nu(o[0])}="${En(o[1])}"`}return n}function QA(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 Iu(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
113
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${En(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
114
+ `;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${dl(r)}>${t}</code></pre>
115
+ `}return`<pre><code${dl(e.attrs)}>${t}</code></pre>
116
+ `}function Hh(e){return!e.attrs||e.attrs.length===0?`<code>${En(e.content)}</code>`:`<code${dl(e.attrs)}>${En(e.content)}</code>`}function Ig(e){const t=En(e.content);return e.attrs?`<pre${dl(e.attrs)}><code>${t}</code></pre>
117
+ `:`<pre><code>${t}</code></pre>
118
+ `}function OV(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="${En(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${En(n[0][1])}">`}return null}function R_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Nu(t[0][0])}="${En(t[0][1])}">`:t.length===2?`<a ${Nu(t[0][0])}="${En(t[0][1])}" ${Nu(t[1][0])}="${En(t[1][1])}">`:`<a${dl(t)}>`}function RV(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 B_(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 Wh(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+dl(n);return s===0&&t&&(i+=" /"),`${i}>`}const BV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},_f=Object.prototype.hasOwnProperty,Sn={code_inline(e,t){return Hh(e[t])},code_block(e,t){return Ig(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?UA(i.info).trim():"",{langName:l,langAttrs:a}=QA(r),c=n.highlight,u=En(i.content);if(!c)return Iu(i,u,r,l,n);const d=c(i.content,l,a);return Gp(d)?d.then(f=>Iu(i,f||u,r,l,n)):Iu(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]],Wh(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
119
+ `:`<br>
120
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
121
+ `:`<br>
122
+ `:`
123
+ `},text(e,t){return En(e[t].content)},text_special(e,t){return En(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function D_(e,t,n){const s=e.info?UA(e.info).trim():"",{langName:o,langAttrs:i}=QA(s),r=t.highlight,l=En(e.content);if(!r)return Iu(e,l,s,o,t);const a=r(e.content,o,i);if(Gp(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Iu(e,a||l,s,o,t)}function wf(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?"":En(l.content);break;case"text_special":if(o.text_special===Sn.text_special)return l.content.length===0?"":En(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 Hh(l);break}const a=o[l.type];if(!a)return Wh(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Vf(c,l.type)}var DV=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,p="",h="",m=!1,_="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,y=k>0&&e[k-1].hidden?`
124
+ `:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const $=e[k+1],x=e[k+2],E=e[k+3];if($.type==="paragraph_open"&&$.hidden&&x.type==="inline"&&E.type==="paragraph_close"&&E.hidden){_+=`${y}<li>${this.renderInlineTokens(x.children||[],s,o)}`,k+=3;continue}}if(k+2<e.length){const $=e[k+1],x=e[k+2];if($.type==="inline"&&x.nesting===-1&&x.tag===g.tag&&!x.hidden){const E=OV(g,y);if(E!==null){_+=`${E+this.renderInlineTokens($.children||[],s,o)}</${g.tag}>
125
+ `,k+=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,p=s.xhtmlOut?`<br />
126
+ `:`<br>
127
+ `,h=s.breaks?p:`
128
+ `,m=!0);const x=$[0];switch(x.type){case"text":if(l===Sn.text){_+=En(x.content);continue}break;case"text_special":if(a===Sn.text_special){_+=En(x.content);continue}break;case"softbreak":if(c===Sn.softbreak){_+=h;continue}break;case"hardbreak":if(u===Sn.hardbreak){_+=p;continue}break;case"html_inline":if(d===Sn.html_inline){_+=x.content;continue}break;case"code_inline":if(f===Sn.code_inline){_+=Hh(x);continue}break}}_+=this.renderInlineTokens($,s,o);continue}const A=i[v];if(!A){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(v){case"hr":_+=r?`<hr />
129
+ `:`<hr>
130
+ `;continue;case"heading_open":_+=`<${g.tag}>`;continue;case"heading_close":_+=`</${g.tag}>
131
+ `;continue;case"paragraph_open":_+=`${y}<p>`;continue;case"paragraph_close":_+=`</p>
132
+ `;continue;case"list_item_open":{const x=e[k+1];_+=y+(x&&(x.type==="inline"||x.hidden||x.nesting===-1&&x.tag==="li")?"<li>":`<li>
133
+ `);continue}case"list_item_close":_+=`</li>
134
+ `;continue;case"bullet_list_open":_+=`${y}<ul>
135
+ `;continue;case"bullet_list_close":_+=`</ul>
136
+ `;continue;case"blockquote_open":_+=y+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
137
+ `);continue;case"blockquote_close":_+=`</blockquote>
138
+ `;continue;case"ordered_list_open":_+=`${y}<ol>
139
+ `;continue;case"ordered_list_close":_+=`</ol>
140
+ `;continue;case"table_open":_+=`${y}<table>
141
+ `;continue;case"table_close":_+=`</table>
142
+ `;continue;case"thead_open":_+=`${y}<thead>
143
+ `;continue;case"thead_close":_+=`</thead>
144
+ `;continue;case"tbody_open":_+=`${y}<tbody>
145
+ `;continue;case"tbody_close":_+=`</tbody>
146
+ `;continue;case"tr_open":_+=`${y}<tr>
147
+ `;continue;case"tr_close":_+=`</tr>
148
+ `;continue;case"td_open":_+=`${y}<td>`;continue;case"td_close":_+=`</td>
149
+ `;continue;case"th_open":_+=`${y}<th>`;continue;case"th_close":_+=`</th>
150
+ `;continue}else if($.length===1){const x=$[0];if(v==="ordered_list_open"&&x[0]==="start"){_+=`${y}<ol start="${En(x[1])}">
151
+ `;continue}if(v==="td_open"&&x[0]==="style"){_+=`${y}<td style="${En(x[1])}">`;continue}if(v==="th_open"&&x[0]==="style"){_+=`${y}<th style="${En(x[1])}">`;continue}}}_+=this.renderToken(e,k,s);continue}if(v==="code_block"&&A===Sn.code_block){_+=Ig(g);continue}if(v==="fence"&&A===Sn.fence){_+=D_(g,s);continue}if(v==="html_block"&&A===Sn.html_block){_+=g.content;continue}const L=A(e,k,s,o,this);typeof L=="string"?_+=L:_+=Vf(L,g.type)}return _}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await O_(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 dl(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?`
152
+ `:"",u=a?`>
153
+ `:">";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+dl(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(_f.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),_f.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(_f.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(_f.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...BV,...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 Ig(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):Wh(t,r.xhtmlOut===!0);if(i==="fence"&&a===Sn.fence)return D_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Vf(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,p=s.em_close,h=s.strong_open,m=s.strong_close,_=t.xhtmlOut===!0,k=_?`<br />
154
+ `:`<br>
155
+ `,g=t.breaks?k:`
156
+ `;if(e.length===1)return wf(e,t,n,this,s,k,g);let v="";for(let y=0;y<e.length;y++){const A=e[y];if(A.type==="link_open"&&!u&&!d&&y+2<e.length){const x=e[y+1];if(e[y+2].type==="link_close"&&RV(x)){const E=`${R_(A)+wf([x],t,n,this,s,k,g)}</a>`;if(r===Sn.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=E+g,y+=3;continue}v+=E,y+=2;continue}}if(A.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${R_(A)}</a>`,y+=1;continue}if(A.type==="em_open"&&!f&&!p&&y+2<e.length){const x=e[y+1];if(e[y+2].type==="em_close"&&B_(x)){v+=`<em>${wf([x],t,n,this,s,k,g)}</em>`,y+=2;continue}}if(A.type==="strong_open"&&!h&&!m&&y+2<e.length){const x=e[y+1];if(e[y+2].type==="strong_close"&&B_(x)){v+=`<strong>${wf([x],t,n,this,s,k,g)}</strong>`,y+=2;continue}}switch(A.type){case"text":if(o===Sn.text){const x=A.content.length===0?"":En(A.content);if(a===Sn.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=x+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=x;continue}break;case"text_special":if(i===Sn.text_special){A.content.length!==0&&(v+=En(A.content));continue}break;case"softbreak":if(r===Sn.softbreak){v+=g;continue}break;case"hardbreak":if(l===Sn.hardbreak){v+=k;continue}break;case"html_inline":if(a===Sn.html_inline){for(v+=A.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+=Hh(A);continue}break}const L=s[A.type];if(!L){v+=A.block?this.renderToken(e,y,t):Wh(A,_);continue}const $=L(e,y,t,n,this);typeof $=="string"?v+=$:v+=Vf($,A.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 O_(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+=`
157
+ `;break}}return s}},PV=DV;const HV=[],U1=4096;function WV(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
158
+ `,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 zV(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 UV(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(!XA(e[n],t[n]))return!1;return!0}function XA(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||!zV(e.attrs,t.attrs)||!UV(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function P_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var jV=class{core;cache=null;stats=P_();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=P_(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Zs(s??o?.env),!o||s&&s!==o.env){const T=s??{},R=!!n.__explicitStreamChunkFallbackSetting,O=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,D=!!n.options?.streamChunkedFallback,W=!R&&O,z=D||W,V=n.options?.streamChunkAdaptive!==!1,U=n.options?.streamChunkTargetChunks??8,re=n.options?.streamChunkSizeChars,ae=n.options?.streamChunkSizeLines,te=n.options?.streamChunkMaxChunks,Z=!!n.__explicitStreamChunkConfig,ne=n.options?.autoTuneChunks!==!1,ke=n.options?.streamChunkFenceAware??!0,Se=n.options?.streamLargeCachePolicy??"retain",Ye=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,ve=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let Y,ce=!1;if(Se==="skip"&&(ce=e.length>=Ye,!ce&&ve!==void 0&&(Y=Gn(e),ce=Y>=ve)),ce){const j=this.parseFullDocument(e,T,n,Y,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(T,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!or(T)?.unbounded}),j.tokens}else if(z){const j=(he,Te,Ie)=>he<Te?Te:he>Ie?Ie:he;Y===void 0&&(Y=Gn(e));const se=ne&&!Z?F_(e.length,Y,n.options):null,ge=se?.maxChunkChars??(V?j(Math.ceil(e.length/U),8e3,64e3):re??1e4),ue=se?.maxChunkLines??(V?j(Math.ceil(Y/U),150,700):ae??200),pe=se?.maxChunks??(V?j(Math.ceil(e.length/64e3),U,32):te),q=e.length>0&&e.charCodeAt(e.length-1)===10,J=W&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&se?.strategy!=="plain";if((D||J)&&(e.length>=ge*2||Y>=ue*2)&&q){const he=Ph(n,e,T,{maxChunkChars:ge,maxChunkLines:ue,fenceAware:se?.fenceAware??ke,maxChunks:pe});return this.cache={src:e,tokens:he,env:T,lineCount:Y,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,Y),this.recordChunkedParseResult(T,D?"explicit-initial-large-doc":"default-initial-large-doc"),he}}const fe=this.parseFullDocument(e,T,n,Y);return Y=fe.lineCount,this.cache={src:e,tokens:fe.tokens,env:T,lineCount:Y,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,Y),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(T,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!or(T)?.unbounded}),fe.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",is(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const i=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=po(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):po(e),a=r||l;if(a){const T=s??o.env;_r(T);const R=po(e),O=this.parseFullDocument(e,T,n),D=O.tokens,W=O.lineCount;return this.cache={src:e,tokens:D,env:T,lineCount:W,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(T,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!or(T)?.unbounded}),D}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 T=s??o.env,R=this.parseFullDocument(e,T,n),O=R.tokens,D=R.lineCount;return this.cache={src:e,tokens:O,env:T,lineCount:D,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,D),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(T,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!or(T)?.unbounded}),O}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const T=o.lineCount??Gn(o.src);let R=3;u.length>5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,T);let O=null;const D=n.options?.streamContextParseStrategy??"chars",W=n.options?.streamContextParseMinChars??200,z=n.options?.streamContextParseMinLines??2;let V;const U=()=>(V===void 0&&(V=Gn(u)),V),re=this.canDirectlyParseAppend(o),ae=re&&this.shouldUseUnboundedAppend(e,o,u);let te=!1;if(!re)switch(D){case"lines":te=U()>=z;break;case"constructs":if(u.length>=W){te=!0;break}if(WV(u)){te=!0;break}te=U()>=z;break;case"chars":default:te=u.length>=W}if(R>0&&te){const ke=this.getTailLines(o.src,R)+u;try{const Se=this.core.parse(ke,o.env,n).tokens,Ye=Se.findIndex(ve=>ve.map&&typeof ve.map[1]=="number"&&ve.map[1]>R);if(Ye!==-1){const ve=Se.slice(Ye),Y=T-R;Y!==0&&this.shiftTokenLines(ve,Y),O={tokens:ve}}}catch{O=null}}else O=null;if(!O){const ke=T;if(ae)O={tokens:Tu(n,u,o.env,{mode:"stream"})},ke>0&&this.shiftTokenLines(O.tokens,ke);else{const Se=this.core.parse(u,o.env,n);ke>0&&this.shiftTokenLines(Se.tokens,ke),O=Se}}let Z=0;if(o.tokens.length>0&&O.tokens.length>0){const ke=o.tokens[o.tokens.length-1],Se=O.tokens[0];try{ke.type==="inline"&&Se.type==="inline"&&(Se.children&&Se.children.length>0&&(ke.children||(ke.children=[]),this.appendTokens(ke.children,Se.children)),ke.content=(ke.content||"")+(Se.content||""),Z=1)}catch{Z=0}}const ne=o.tokens.length;if(O.tokens.length>Z){const ke=o.tokens,Se=O.tokens,Ye=Math.min(ke.length,Se.length-Z);let ve=0;for(let Y=Ye;Y>0;Y--){let ce=!0;for(let fe=0;fe<Y;fe++){const j=ke[ke.length-Y+fe],se=Se[Z+fe];if(!XA(j,se)){ce=!1;break}}if(ce){ve=Y;break}}ve>0&&(Z+=ve),Se.length>Z&&this.appendTokens(o.tokens,Se,Z)}if(o.src=e,o.globalStateReason=null,o.lineCount=T+(V??U()),o.tokens.length>ne){const ke=this.getLastSegment(o.tokens,e,ne,o.tokens.length,e.length-u.length,T);ke?o.lastSegment=ke:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ae&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",is(o.env,{area:"stream",path:ae?"stream-unbounded-append":"stream-append",reason:ae?"large-delta":"safe-append",unbounded:ae}),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",is(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const p=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,_=!p&&!u&&h,k=m||_,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,x=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let N=u&&o.lineCount!==void 0?o.lineCount+Gn(u):void 0;if(k){N===void 0&&(N=Gn(e));const T=(U,re,ae)=>U<re?re:U>ae?ae:U,R=x&&!$?F_(e.length,N,n.options):null,O=R?.maxChunkChars??(g?T(Math.ceil(e.length/v),8e3,64e3):y??1e4),D=R?.maxChunkLines??(g?T(Math.ceil(N/v),150,700):A??200),W=R?.maxChunks??(g?T(Math.ceil(e.length/64e3),v,32):L),z=e.length>0&&e.charCodeAt(e.length-1)===10,V=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((m||V)&&(e.length>=O*2||N>=D*2)&&z){const U=Ph(n,e,d,{maxChunkChars:O,maxChunkLines:D,fenceAware:R?.fenceAware??E,maxChunks:W});return this.cache={src:e,tokens:U,env:d,lineCount:N,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,N),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),U}}const F=this.parseFullDocument(e,d,n,N),S=F.tokens;return N=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:N,lastSegment:void 0,globalStateReason:po(e)},this.updateCacheLineCount(this.cache,N),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!or(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=or(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",is(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!or(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",is(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=po(e);Sd(t)&&_r(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?GA(n,e.length,s):"no";if(r==="yes"){const a=Tu(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?Gn(e):0)}}let l=s;if(r==="need-lines"&&(l=Gn(e),KA(n,e.length,l))){const a=Tu(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Gn(e):0),{tokens:mc(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:Gn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
159
+ `))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(`
160
+ `);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+Gn(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(`
161
+ `,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??HV}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??Gn(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(-U1))+t,s=po(n);return e.globalStateCarry=n.length>U1?n.slice(n.length-U1):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(`
162
+ `,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(`
163
+ `,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??Gn(t.src);f>0&&this.shiftTokenLines(d,f);const p=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),h=this.getListParagraphMode(u,0,u.length,0);(p==="loose"||h==="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+Gn(i);t.lineCount=m;const _=this.getDocLineCount(e,m);return r.map&&(r.map[1]=_),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),p=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!f||!p||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const h=p.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(h.length===0)return null;const m=o.lineEnd-2;m!==0&&this.shiftTokenLines(h,m);const _=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex,k=t.lineCount??Gn(t.src);t.tokens.splice(_,0,...h),t.src=e,t.env=n,t.globalStateReason=null;const g=k+Gn(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),p.tbodyOpenIndex>=0){const y=t.tokens[p.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(`
164
+ `);if(t<0)return null;const n=e.indexOf(`
165
+ `,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=Gn(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 H_={default:LV,zero:FV,commonmark:$V};function qV(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function VV(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 W_(e){return e.experimental?{...e,...e.experimental}:e}function Jo(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 z_(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(Jo(t,o)||Jo(e,o))return!0}return!1}function U_(e,t,n){return Jo(t,n)||Jo(e,n)}function j_(e,t){const n=or(e)?.chunk;if(n?.fallback){is(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}is(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function KV(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=H_[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=W_(n),typeof n.quotes=="string"){const x=n.quotes;x.length>=4?n.quotes=[x[0],x[1],x[2],x[3]]:n.quotes=["“","”","‘","’"]}let r=z_(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=z_(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=U_(i?.options,o,"fullChunkedFallback"),c=U_(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const p=new Bq;let h=null;const m=()=>(h||(h=new PV(n)),h);let _=null;const k=()=>(_||(_=new jV(p)),_);let g=null;const v=()=>(g||(g=new gA),g),y=x=>!u&&!!d&&!VV(x,d),A=(x,E)=>s==="default"&&!u&&h===null&&f!==null&&x.parse===f&&y(x)&&!x.stream.enabled&&E<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.xhtmlOut===!1&&x.options.breaks===!1&&x.options.langPrefix==="language-"&&x.options.linkify===!1&&x.options.typographer===!1&&x.options.highlight===null,L=(x,E)=>s==="default"&&!u&&y(x)&&!x.stream.enabled&&!x.options.fullChunkedFallback&&E<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.linkify===!1&&x.options.typographer===!1,$={core:p,block:p.block,inline:p.inline,get linkify(){const x=v();return Object.defineProperty(this,"linkify",{value:x,writable:!0,configurable:!0}),x},get renderer(){const x=m();return Object.defineProperty(this,"renderer",{value:x,writable:!0,configurable:!0}),x},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(x){const E=W_(x);return this.options={...this.options,...E},(Jo(x,"fullChunkSizeChars")||Jo(x,"fullChunkSizeLines")||Jo(x,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Jo(x,"streamChunkSizeChars")||Jo(x,"streamChunkSizeLines")||Jo(x,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Jo(x,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Jo(x,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,_&&(_.reset(),_.resetStats())),this},configure(x){const E=typeof x=="string"?H_[x]:x;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const N=E.components;N.core?.rules&&this.core.ruler.enableOnly(N.core.rules),N.block?.rules&&this.block.ruler.enableOnly(N.block.rules),N.inline?.rules&&this.inline.ruler.enableOnly(N.inline.rules),N.inline2?.rules&&this.inline.ruler2.enableOnly(N.inline2.rules)}return this},enable(x,E){const N=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const T of F){if(!T)continue;const R=T.enable(N,!0);for(let O=0;O<R.length;O++)S.add(R[O])}if(!E){const T=N.filter(R=>!S.has(R));if(T.length)throw new Error(`Rules manager: invalid rule name ${T.join(", ")}`)}return this},disable(x,E){const N=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const T of F){if(!T)continue;const R=T.disable(N,!0);for(let O=0;O<R.length;O++)S.add(R[O])}if(!E){const T=N.filter(R=>!S.has(R));if(T.length)throw new Error(`Rules manager: invalid rule name ${T.join(", ")}`)}return this},use(x,...E){const N=typeof x=="function"?x:x&&typeof x.default=="function"?x.default:void 0;if(!N)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...E],S=x;return u=!0,N.apply(S,F),this},render(x,E){if(A(this,x.length)){E!==void 0&&Zs(E);const S=I_(x);if(S!==null)return E!==void 0&&is(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=E??{},F=this.parse(x,N);return m().render(F,this.options,N)},async renderAsync(x,E){if(A(this,x.length)){E!==void 0&&Zs(E);const S=I_(x);if(S!==null)return E!==void 0&&is(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=E??{},F=this.parse(x,N);return m().renderAsync(F,this.options,N)},renderIterable(x,E={}){const N=this.parseIterable(x,E);return m().render(N,this.options,E)},async renderAsyncIterable(x,E={}){const N=await this.parseAsyncIterable(x,E);return m().renderAsync(N,this.options,E)},renderInline(x,E={}){const N=this.parseInline(x,E);return m().render(N,this.options,E)},validateLink:FA,normalizeLink:OA,normalizeLinkText:RA,utils:sU,helpers:{...qU},parse(x,E){if(typeof x!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&Zs(E),L(this,x.length)){const T=Yq(x);if(T!==null)return E!==void 0&&is(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),T}const N=E??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const T=GA(this,x.length);if(T==="yes"){const R=Tu(this,x,N);return is(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}T==="need-lines"&&(F=Gn(x))}if(!this.stream.enabled){const T=x.length,R=this.options.autoTuneChunks!==!1,O=r,D=!a&&y(this),W=!!this.options.fullChunkedFallback,z=D&&T>=2e5;let V;(W||z||F!==void 0)&&(V=F??Gn(x));const U=(W||z)&&R&&!O?IV(T,V,this.options):null;if(W||z){const re=V??0;if(W?T>=(this.options.fullChunkThresholdChars??2e4)||re>=(this.options.fullChunkThresholdLines??400):z){if(U&&U.strategy!=="plain"){const ae=Ph(this,x,N,{maxChunkChars:U.maxChunkChars,maxChunkLines:U.maxChunkLines,fenceAware:U.fenceAware,maxChunks:U.maxChunks});return E&&j_(E,W?"explicit-full-chunk":"default-large-string"),ae}if(W){const ae=(ce,fe,j)=>ce<fe?fe:ce>j?j:ce,te=this.options.fullChunkAdaptive!==!1,Z=this.options.fullChunkTargetChunks??8,ne=ae(Math.ceil(T/Z),8e3,64e3),ke=ae(Math.ceil(re/Z),150,700),Se=te?ne:this.options.fullChunkSizeChars??1e4,Ye=te?ke:this.options.fullChunkSizeLines??200,ve=te?ae(Math.ceil(T/64e3),Z,32):this.options.fullChunkMaxChunks,Y=Ph(this,x,N,{maxChunkChars:Se,maxChunkLines:Ye,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ve});return E&&j_(E,"explicit-full-chunk"),Y}}}if(F!==void 0&&y(this)&&KA(this,T,V??F)){const re=Tu(this,x,N);return is(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),re}}const S=po(x);return is(E,{area:"parse",path:"plain",reason:"default-plain"}),mc(N,S,()=>p.parse(x,N,this).tokens)},parseIterable(x,E={}){return Zs(E),MV(this,x,E)},parseAsyncIterable(x,E={}){return Zs(E),EV(this,x,E)},parseIterableToSink(x,E,N={}){return Zs(N),TV(this,x,E,N)},parseAsyncIterableToSink(x,E,N={}){return Zs(N),NV(this,x,E,N)},parseInline(x,E={}){if(typeof x!="string")throw new TypeError("Input data should be a String");Zs(E),Sd(E)&&_r(E);const N=p.createState(x,E,this);return N.inlineMode=!0,p.process(N),N.tokens}};if($.stream={enabled:!!n.stream,parse(x,E){return $.stream.enabled?k().parse(x,E,$):$.parse(x,E??{})},reset(){k().reset()},peek(){return _?_.peek():[]},stats(){return _?_.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){_&&_.resetStats()}},i?.components){const x=i.components;x.core?.rules&&$.core.ruler.enableOnly(x.core.rules),x.block?.rules&&$.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&$.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&$.inline.ruler2.enableOnly(x.inline2.rules)}return d=qV($),f=$.parse,$}var GV=KV;const JA=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],YV=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],e6=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],ZV=["svg","g","path"],QV=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],XV=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],JV=["action","data","href","src","srcset","poster","xlink:href","formaction"],eK=["script"],tK=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],ma=new Set(JA),nK=new Set(e6),ld=new Set([...JA,...YV,...e6,...ZV]),t6=new Set([...ld,...QV]),sK=new Set(XV),oK=new Set(JV),Ad=new Set(eK),n6=new Set(tK);function s6(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 iK={amp:"&",bsol:"\\",colon:":",newline:`
166
+ `,sol:"/",tab:" "};function o6(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 iK[String(o??"").toLowerCase()]??t})}const Sf=new Set(["http","https","mailto","tel"]),rK=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Rl=new Set(["http","https"]);function i6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function lK(e,t,n){if(!$u(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function $u(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function aK(e,t){return t==="href"||t==="xlink:href"?$u(e,t)?Sf:Rl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Rl:($u(e,t),Sf)}function ea(e,t={}){const n=s6(o6(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=i6(n);return i?i==="file"?!lK(n,s,o):$u(s,o)?rK.has(i):!aK(s,o).has(i):!1}function cK(e){const t=o6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=i6(s6(t).toLowerCase());return n==="http"||n==="https"}function uK(e,t={}){const n=String(e??"").trim();return n?ea(n,t)?"":n:""}function q_(e){return uK(e,{tagName:"img",attrName:"src"})}function dK(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,p,h,m,_){return f[p].nesting===1&&f[p].attrJoin("class",t),_.renderToken(f,p,h,m,_)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(f,p,h,m){let _,k=!1,g=f.bMarks[p]+f.tShift[p],v=f.eMarks[p];if(l!==f.src.charCodeAt(g))return!1;for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);const y=Math.floor((_-g)/a);if(y<i)return!1;_-=(_-g)%a;const A=f.src.slice(g,_),L=f.src.slice(_,v);if(!c(L,A))return!1;if(m)return!0;let $=p;for(;$++,!($>=h||(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(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);if(!(Math.floor((_-g)/a)<y)&&(_-=(_-g)%a,_=f.skipSpaces(_),!(_<v))){k=!0;break}}const x=f.parentType,E=f.lineMax;f.parentType="container",f.lineMax=$;const N=f.push("container_"+t+"_open","div",1);N.markup=A,N.block=!0,N.info=L,N.map=[p,$],f.md.block.tokenize(f,p+1,$);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,_),F.block=!0,f.parentType=x,f.lineMax=E,f.line=$+(k?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 fK(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let _=0;_<a.length;_++){const k=a[_];if(k==="\\"){_++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=_;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),p=a.slice(d+1).trim();if(!f)return null;let h=f;if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{h=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(h))return null;let m;if(!p)m="";else if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{m=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=p}else/^-?\d+(?:\.\d+)?$/.test(p)?m=Number(p):p==="true"||p==="false"?m=p==="true":p==="null"?m=null:m=p;l[h]=m}return l}function hK(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(dK,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
167
+ `}})}),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,p;const h=d.indexOf("{"),m=h>=0?d.slice(h).trimStart():void 0;if(h===-1)f=d||void 0;else{if(f=d.slice(0,h).trim()||void 0,m?.startsWith("{")){let A=0,L=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?A++:m[$]==="}"&&A--,A===0){L=$+1;break}L>0&&(p=m.slice(0,L))}p||(f=d||void 0)}if(o)return!0;const _=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=s;){const A=i.bMarks[k]+i.tShift[k],L=i.eMarks[k];if(i.src.slice(A,L).trim()===":::"){g=!0;break}k++}g||(k=s);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!_},f&&v.attrSet("data-args",f),p)try{const A=JSON.parse(p);for(const[L,$]of Object.entries(A)){const x=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,x?JSON.stringify($):String($))}}catch{const A=fK(p);if(A)for(const[L,$]of Object.entries(A)){const x=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,x?JSON.stringify($):String($))}else v.attrSet("data-attrs",p)}const y=[];for(let A=n+1;A<k;A++){const L=i.bMarks[A]+i.tShift[A],$=i.eMarks[A];y.push(i.src.slice(L,$))}if(y.some(A=>A.trim().length>0)){let A=y.join(`
168
+ `);A.endsWith(`
169
+ `)||(A+=`
170
+ `),A.endsWith(`
171
+
172
+ `)||(A+=`
173
+ `);const L=i.tokens[i.tokens.length-1];L&&(L.raw=A);const $=[];i.md.block.parse(A,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Bo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Un(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 Yp(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 pK=/^[a-z][a-z0-9_-]*$/;function V_(e){return pK.test(String(e??"").trim().toLowerCase())}function di(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return V_(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)?"":V_(o)?o:""}function Fc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=di(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function mK(...e){const t=new Set,n=[];for(const s of e)for(const o of Fc(s))t.has(o)||(t.add(o),n.push(o));return n}function gK(e){const t=Fc(e);return{key:t.join(","),tags:t}}function r6(e){return di(e)}function vK(e,t){const n=String(e??""),s=di(t);if(!s)return!1;const o=Bo(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 l6(e,t){const n=di(t);return!!n&&!ld.has(n)&&!vK(e,n)}function yK(e,t){const n=String(e??""),s=di(t);if(!s)return n;const o=Bo(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 a6=ma,kK=ld,c6=new Set(nK);c6.delete("details");const bK=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,xK=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,$g=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,_K=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function zh(e){return(e.match($g)?.[1]??"").toLowerCase()}function Sy(e){return/^\s*<\s*\//.test(e)}function Cy(e,t){return a6.has(t)||/\/\s*>\s*$/.test(e)}function wK(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=zh(i);if(r===t){if(Sy(i)){if(n===0)return s;n--;continue}Cy(i,r)||n++}}return-1}function SK(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=zh(o);if(i===t){if(Sy(o)){n>0&&n--;continue}Cy(o,i)||n++}}return n}function K_(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Bo(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 CK(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Bo(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 Uh(e){const t=e;return String(t.raw??t.content??t.markup??"")}function AK(e){const t=e;return t.meta||(t.meta={}),t.meta}function j1(e,t,n){const s=AK(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function MK(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${Bo(p)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=p=>p?n.some(h=>h.test(p)):!1,r=p=>{if(!(!p||!s.length))for(const h of s)h.raw+=p,h.inner+=p},l=()=>{!s.length||!o||(r(`
174
+ `),o=!1)},a=p=>{r(p)},c=p=>{for(let m=0;m<s.length;m++)s[m].raw+=p,m<s.length-1&&(s[m].inner+=p);const h=s.pop();j1(h.token,h.raw,h.inner)},u=p=>{const h=s[s.length-1]?.tag;if(!h)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Bo(h)}\s*>`,"i");return p.match(m)?.[0]??null},d=p=>!!u(p),f=(p,h,m)=>{const _=m??(p.type==="html_inline"?zh(h):"");if(!(_&&t.has(_))){r(h);return}const k=Sy(h),g=!k&&Cy(h,_);if(k){if(!s.length||s[s.length-1].tag!==_){r(h);return}c(h);return}if(r(h),g){j1(p,h,"");return}s.push({tag:_,token:p,raw:h,inner:""})};for(const p of e){if(p.type==="inline"&&Array.isArray(p.children)){const h=String(p.content??"");if(d(h)?o=!1:l(),!s.length&&!i(h)){o=!1;continue}let m=0,_=!0;for(const k of p.children){const g=Uh(k),v=k.type==="html_inline"?zh(g):"",y=v&&t.has(v);let A=g;if(_&&h&&g&&(s.length||y)){const L=h.indexOf(g,m);if(L!==-1)a(h.slice(m,L)),A=h.slice(L,L+g.length),m=L+g.length;else{if(s.length&&!y)continue;_=!1}}f(k,A,v)}_&&h&&m<h.length&&s.length&&a(h.slice(m)),o=s.length>0;continue}if(s.length&&typeof p.content=="string"){const h=Uh(p),m=p.type==="html_block"?u(h):null;if(m){c(`${o?`
175
+ `:""}${m}`),o=s.length>0;continue}if(!p.content)continue;l(),r(p.content),o=!0}}for(const p of s)j1(p.token,p.raw,p.inner)}function EK(e){return/^\s*<\s*[!?]/.test(e)}function TK(e){const t=new Set(kK);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 G_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function NK(e,t){let n=null;for(const i of e.matchAll(bK)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();G_(l,t)&&Un(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(xK)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();G_(l,t)&&Un(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 IK(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function $K(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(IK(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),p=f.match($g);if(!p){i("<",c),u=d+1;continue}const h=Un(f);if(h===-1){i("<",c),u=d+1;continue}const m=f.slice(0,h+1),_=(p[1]??"").toLowerCase();t.has(_)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=NK(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+=Uh(a),o=s.buffer;const c=Un(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=Uh(a),u=(c.match($g)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Un(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 LK=["a","span","strong","em","b","i","u"];function FK(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const p=di(f);p&&n.add(p)}const s=f=>{const p=f,h=new Set(n),m=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=di(String(v??""));y&&h.add(y)}const _=TK(Array.from(h)),k=new Set(LK);for(const v of h)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:_,customTagSet:h,shouldMergeHtmlBlockTag:v=>h.has(v)||!_.has(v)||c6.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 p=f.children[0];return p?.type!=="html_block"?"":String(f.content??p.content??"")},i=(f,p)=>{f.type="html_block",f.content=p,f.raw=p,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,p)=>{const h=r(f);if(!/\S/.test(h))return[];if(l(h))return[{type:"code_block",content:a(h),raw:h}];const m=h.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const _={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:m,raw:m}]:[_]},u=(f,p,h)=>f[p-1]?.type==="paragraph_open"&&f[p+1]?.type==="paragraph_close"?"inline":h,d=(f,p)=>{const h=r(p);return!/\S/.test(h)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${h}`,f.children.push({type:"text",content:h,raw:h}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const p=f.tokens??[],{commonHtmlTags:h,customTagSet:m}=s(f);for(const _ of p){const k=_;if(k.type!=="inline"||!Array.isArray(k.children))continue;const g=String(k.content??""),v=k.children.length?k.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=$K(v,h);if(k.children=y.children,y.pendingBuffer){const A=g.lastIndexOf(y.pendingBuffer);if(A!==-1){const L=g.slice(0,A);k.content=L,typeof k.raw=="string"&&(k.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}MK(p,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const p=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:m,shouldMergeHtmlBlockTag:_}=s(f),k=[];for(let g=0;g<p.length;g++){const v=p[g];if(k.length>0){const[A,L]=k[k.length-1];if(g!==L){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(g,1),g--;continue}const $=String(v.content??v.raw??"");if($){const x=p[L],E=`${String(x.content||"")}
176
+ ${$}`,N=Un(E),F=N===-1?null:K_(E,A,N+1);if(F){const S=E.slice(0,F.end),T=E.slice(F.end);x.content=S,x.loading=!1,p.splice(g,1),k.pop();const R=d(x,T)?[]:c(T,u(p,g,"paragraph"));R.length&&p.splice(g,0,...R),g--;continue}x.content=E,x.loading!==!1&&(x.loading=!0)}p.splice(g,1),g--;continue}}const y=o(v);if(y){if(EK(y))continue;const A=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!A||!_(A))continue;if(i(v,y),!L)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(y)&&CK(y,A)>0&&k.push([A,g]);else if(k.length>0&&A&&k[k.length-1][0]===A){const[,$]=k[k.length-1],x=p[$];x.content=`${String(x.content||"")}
177
+ ${y}`,x.loading=!1,k.pop(),p.splice(g,1),g--}continue}else if(k.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(g,1),g--;continue}const A=v.content||"",L=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(A);if(A){const[,$]=k[k.length-1],x=p[$];x.content=`${x.content||""}
178
+ ${A}`,x.loading!==!1&&(x.loading=!L)}L&&k.pop(),p.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=$=>{let x=g.get($);return x||(x=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,x)),x},A=$=>{let x=v.get($);return x||(x=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),v.set($,x)),x},L=[];for(let $=0;$<p.length;$++){const x=p[$],E=String(x.content??"");if(L.length>0){const F=L[L.length-1],S=p[F.index],T=x.type==="html_block"?A(F.tag).exec(E):null;if(T){const D=T.index+T[0].length,W=E.slice(0,D),z=E.slice(D);S.content=`${String(S.content??"")}
179
+ ${W}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),L.pop();const V=d(S,z)?[]:c(z,u(p,$,"paragraph"));V.length?p.splice($,1,...V):(p.splice($,1),$--);continue}if(x.type!=="inline")continue;const R=Array.isArray(x.children)?x.children:[],O=wK(R,F.tag);if(O!==-1){const D=R.slice(0,O+1),W=R.slice(O+1),z=D.map(V=>String(V?.content??V?.raw??"")).join("");if(S.content=`${String(S.content??"")}
180
+ ${z}`,Array.isArray(S.children)&&S.children.push(...D),W.length){const V=W.map(U=>String(U.content??U.raw??"")).join("");if(V.trim()){const U=V.replace(/^\s+/,"");if(d(S,V))p.splice($,1),$--;else if(U.startsWith("<"))p.splice($,1,{type:"html_block",content:U});else{const re=c(V,u(p,$,"paragraph"));p.splice($,1,...re)}}else p.splice($,1),$--}else p.splice($,1),$--;L.pop();continue}S.content=`${String(S.content??"")}
181
+ ${E}`,Array.isArray(S.children)&&S.children.push(...R),p.splice($,1),$--;continue}if(x.type!=="inline")continue;const N=Array.isArray(x.children)?x.children:[];for(const F of m)if((N.length?SK(N,F):y(F).test(E)&&!A(F).test(E)?1:0)>0){L.push({tag:F,index:$});break}}}{let g=0;for(let v=0;v<p.length;v++){const y=p[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(p.splice(v,1),v--))}}for(let g=0;g<p.length;g++){const v=p[g];if(v.type==="html_block"){const x=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(x.startsWith("!")||x.startsWith("?")){v.loading=!1;continue}if(m.has(x)){const O=String(v.content??""),D=Un(O),W=D===-1?null:K_(O,x,D+1);v.loading=W?!1:v.loading!==void 0?v.loading:!0;const z=W?.start??-1,V=W?W.end-W.start:0;if(z!==-1){const U=O.slice(0,z+V);let re="";D!==-1&&D<z&&(re=O.slice(D+1,z)),v.children=[{type:x,content:re,raw:U,attrs:[],tag:x,loading:!1}],v.content=U,v.raw=U;const ae=c(O.slice(z+V)||"","text");ae.length&&p.splice(g+1,0,...ae)}else v.children=[{type:x,content:"",raw:O,attrs:[],tag:x,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(x))continue;v.type="inline";const E=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=E.exec(v.content||""))!==null;)N[1],N[2]||N[3]||N[4];const F=String(v.content??""),S=new RegExp(`<\\/\\s*${x}\\s*>`,"i").exec(F),T=S?S.index:-1,R=S?S[0].length:0;if(T!==-1){const O=F.slice(0,T+R),D=(F.slice(T+R)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:O,tag:x,loading:!1}],v.content=O,v.raw=O,D&&p.splice(g+1,0,D.startsWith("<")?{type:"html_block",content:D}:{type:"text",content:D,raw:D})}else v.children=[{type:"html_block",content:v.content,tag:x,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const x=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=v.children[1],N=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&N===x)continue;h.has(x)?(v.children[0].loading=!0,v.children[0].tag=x,v.children.push({type:"html_inline",tag:x,loading:!0,content:`</${x}>`})):v.children=[{type:"html_block",loading:!0,tag:x,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 x=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has(x))continue;v.children=[{type:"html_block",loading:!1,tag:x,content:v.children.map(E=>E.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),A=v,L=A.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(A.children.length=0);continue}const $=String(L.content??y).match(_K)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(y)||a6.has($)){A.children=[{type:"html_inline",content:y}];continue}A.children.length=0}}})}function OK(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 RK(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&&!OK(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 u6=/\.([a-z0-9]{1,15})$/i,BK=/[_()[\]{}<>]/u,DK=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,PK=/[?#@]/u,HK=/[\\/]/u,WK=/^[\p{L}\p{N}./\\-]+$/u,zK=/^[A-Za-z0-9-]{1,63}$/u,UK=/^xn--[a-z0-9-]{2,59}$/i,jK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,qK=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,VK=/文件名\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,KK=/文件名\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,GK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,YK=new Set(["ai","md","py","rs","sh","zip"]),d6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),ZK=new Set([...d6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),QK=new Set(["com","dev","io","page","site"]),XK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),JK=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 ad(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function q1(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return ad(n)?n:void 0}function Y_(e,t){if(!ad(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 Z_(e){const t=Md(e);return ad(t)?t:void 0}function eG(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Q_(e,t){if(!ad(t))return;const n=String(e??"").trim().split(/\s+/u).map(eG).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>jh(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>jh(o,{marketTicker:!0}))&&(s.marketTicker=!0),ad(s)?s:void 0}function xl(e,t=!1){let n;return{options(s){return t||s==null?Y_(e,n):Y_(e,q1(Z_(s),Q_(s,n)))},remember(s){const o=Z_(s);n=t?q1(n,o):q1(o,Q_(s,n))},reset(){n=void 0}}}function X_(e){return zK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function tG(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return X_(n)||UK.test(n)?t.every(X_):!1}function f6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function nG(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function sG(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function h6(e,t,n){const s=nG(t);return f6(e)&&sG(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function Md(e){const t=String(e??"");return{explicitFilename:VK.test(t),filename:KK.test(t),marketTicker:GK.test(t)}}function oG(e){return tG(e.split(/[\\/]/)[0]??"")}function iG(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function rG(e){if(BK.test(e)||!WK.test(e))return!0;if(HK.test(e))return!oG(e);const t=e.replace(u6,"");return f6(t)?!0:t.split(".").filter(Boolean).some(iG)}function lG(e,t,n){if(!(n?ZK:d6).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?qK:jK).test(s)}function jh(e,t={}){if(!e||DK.test(e)||PK.test(e))return!1;const n=e.match(u6);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return lG(e,s,t.marketTicker===!0)?!0:JK.has(s)?!YK.has(s)||t.filename?!0:rG(e):!!(t.explicitFilename&&QK.has(s)||t.filename&&XK.has(s))}const J_=["!"];function fo(e){return{type:"text",content:e,raw:e}}function Bl(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 Dl(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 Pr(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 aG(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(fo(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 cG(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function uG(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 dG(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 fG(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=hG(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function hG(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=Md(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=dG(e,s,i),l=cG(o);if(o.markup==="linkify"&&r&&!h6(r,l,t)&&jh(r,n)){e.splice(s,i-s+1,fo(r));continue}const a=ew(l,J_);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,J_);if(d===-1)continue;const f=u.content[d],p=u.content.slice(0,d);let h=u.content.slice(d);for(let k=c+1;k<i;k++){const g=e[k];g?.type==="text"&&typeof g.content=="string"&&(h+=g.content)}u.content=p,u.raw=p;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let _=l;if(a!==-1)_=l.slice(0,a);else if(h){const k=encodeURI(h);if(k&&l.endsWith(k))_=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(_=l.slice(0,v))}}_!==l&&uG(o,_),h&&e.splice(i+1,0,fo(h));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(fo(r));const c=i[1],u=l[1].length;Bl(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(Pr(c,d,!e[s+4]?.content?.startsWith(")"))),Dl(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(fo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(fo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let p=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(p+=e[s+4]?.content||"",e[s+4].content=""),Bl(a,f),a.push(Pr(c,p,!e[s+4]?.content?.startsWith(")"))),Dl(a,f),e[s+4]?.type==="text"){const h=e[s+4].content?.replace(/^\)/,"");h&&a.push(fo(h)),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(Pr(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(fo(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(Pr(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(fo(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(h=>h[0]==="href")?.[1]||"",a=r.find(h=>h[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const h=d[1].length;Bl(f,h)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let h=s+1;h<e.length;h++){const m=d?d[1].length:e[s-3].markup.length,_=e[h];if(m===1&&_.type==="em_close")break;if(m===2&&_.type==="strong_close")break;if(m===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const p={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(p),d){const h=d[1].length;Dl(f,h)}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(fo(l)),Bl(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(Pr(a,c,u)),Dl(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(fo(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(fo(r)),Bl(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(Pr(l,a,c)),Dl(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(fo(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(fo(r)),Bl(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(p=>p[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(Pr(a,c,d)),Dl(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=[];Bl(a,2),a.push(Pr(r,l,!1)),Dl(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;aG(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function pG(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=mG(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function mG(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 gG(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=vG(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function vG(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 p=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const k=e[_];p==="__"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,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 p=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const k=e[_];p==="_"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,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:""}],p=c.slice(0,-1);p&&f.unshift({type:"text",content:p,raw:p}),l.splice(i,d,...f)}return l=yG(l),l}function yG(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),p=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),p&&t.push({...c,type:"text",content:p,raw:p}),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=kG(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 kG(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 bG(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=AG(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 tw(){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 nw(){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 sw(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 p6(e,t){if(!e.startsWith("|")||e.includes(`
182
+ `)||!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 V1(e){return p6(e)!==null}function m6(e){return/^:?-+:?$/.test(e.trim())}function xG(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(m6)}function _G(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function wG(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(m6)&&_G(n)}function SG(e){return e==="|"||e==="|:"}function CG(e){const t=p6(e);return t!==null&&t.every(n=>!n.includes(":"))}function AG(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(`
183
+ `)[0]??"",[a="",c="",...u]=r.split(`
184
+ `),d=!t&&!r.includes(`
185
+ `)&&/\r?\n$/.test(n)&&V1(r);if(!t&&(r.includes(`
186
+ `)&&u.length===0&&V1(a)&&wG(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>sw(h)),p=[...tw(),...f,...nw()];s.splice(o-1,3,...p)}else if(r.includes(`
187
+ `)&&u.length===0&&V1(a)&&xG(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>sw(h)),p=[...tw(),...f,...nw()];s.splice(o-1,3,...p)}else r.includes(`
188
+ `)&&u.length===0&&CG(a)&&SG(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function MG(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 EG=MG;const TG=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],qh=TG.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),NG=/\\[a-z]+/i,g6="(?:\\\\|\\u0008)",IG=new RegExp(String.raw`${g6}(?:${qh})\s*\{[^}]+\}`,"i"),$G=new RegExp(String.raw`(?:${g6})?(?:${qh})\s*\{`,"i"),LG=/\\(?:text|frac|left|right|times)/,FG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,OG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,RG=/[A-Z]+\s*\([^)]+\)/i,BG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,DG=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,PG=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,HG={"\b":"\\b","\v":"\\v","\f":"\\f"};function WG(e){let t="";for(const n of e)t+=HG[n]??n;return t}function nc(e){if(!e)return!1;const t=WG(e),n=t.trim();if(PG.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=NG.test(t),o=IG.test(t),i=$G.test(t),r=LG.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=FG.test(t)&&!OG.test(t),c=RG.test(t),u=BG.test(n),d=DG.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||f||p}const v6="__markstreamMathPluginApplied",Lg=80,y6=2e4,ow=y6+4096;function k6(e){return!!e[v6]}function zG(e){e[v6]=!0}const b6=["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"],UG=["cdot","mathbf{","partial","mu_{"],x6=b6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),_6="[ \r\b\f\v]",jG=new RegExp(`([^\\\\])(${UG.map(e=>e).join("|")})+`,"g"),qG=/span\{([^}]+)\}/,VG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,KG=/(^|[^\\])\\\r?\n/g,GG=/(^|[^\\])\\$/g,YG=new RegExp(`(${_6})|(${x6})\\b`,"g"),iw=new Map,rw=new Map;function ZG(e){if(!e)return YG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=iw.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${_6})|(${o})\\b`,"g");return iw.set(n,i),i}function QG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=rw.get(s);if(o)return o;const i=e?[qh,x6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),qh].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return rw.set(s,r),r}const lw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function aw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function cw(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 Hr(e,t){const n=t?.commands??b6,s=t?.escapeExclamation??!0,o=t?.commands==null,i=ZG(o?void 0:n);let r=e.replace(i,(c,u,d,f,p)=>{if(u!==void 0&&lw[u]!==void 0)return`\\${lw[u]}`;if(d&&n.includes(d)){const h=p&&typeof f=="number"?p[f-1]:void 0;return h==="\\"||h&&/\w/.test(h)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=QG(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(qG,"span\\{$1\\}").replace(VG,"\\operatorname{span}\\{$1\\}"),l=l.replace(KG,`$1\\\\
189
+ `),l=l.replace(GG,"$1\\\\"),l=l.replace(jG,"$1\\$2"),l}function uw(e){const t=e.trim();return!(!nc(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 w6(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 Vh(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function XG(e,t=!1){const n=[];let 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 Ed(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Fg(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(Ed(e,s)){n=s+1;continue}return s}return-1}function K1(e,t){let n=t;for(;n<e.length;){const s=Fg(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 ku(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(!Ed(e,o))return o;s=o+Math.max(1,t.length)}return-1}function dw(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=Vh(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Ed(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Ay(e,t,n){const s=ud(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!ud(s.slice(0,o)).trim()||Ed(s,o))return-1;const i=w6(s);if(Vh(i,o))return-1;const r=dw(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>dw(s,n,0,o,i))return-1;return o}function cd(e){return e===" "||e===" "}function ud(e){let t=e.length;for(;t>0&&cd(e[t-1]);)t--;return e.slice(0,t)}function fw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
190
+ `&&t++;return t}function hw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function JG(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(!cd(o))return!1}return n>=3}function eY(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 tY(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(eY)}function nY(e){let t=0;if(!hw(e[t]))return!1;for(;hw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:cd(e[t+1])}function S6(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&&cd(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&cd(t[1])||nY(t)||JG(t)||tY(t))}function pw(e,t){return e?t?`${e}
191
+ ${t}`:e:t}function Og(e){const t=String(e??"").trim();return t?nc(t):!1}function mw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function C6(e){if(e.length<=ow)return{source:e,lineOffset:0};let t=e.length-ow;const n=e.indexOf(`
192
+ `,t);return n===-1?{source:"",lineOffset:fw(e)}:(t=n+1,{source:e.slice(t),lineOffset:fw(e.slice(0,t))})}function A6(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=C6(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-Lg-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=ud(s[r]);if(l&&!S6(l)){for(const[a,c]of i)if(Ay(l,a,c)!==-1)return!0}}return!1}function sY(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=C6(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-Lg-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=ud(o[l]);for(const[c,u]of r){const d=Ay(a,c,u);if(d===-1)continue;let f="",p=!1;for(let h=l+1;h<o.length;h++){if(h-l>Lg){p=!0;break}const m=o[h],_=ku(m,u);if(_!==-1){const k=pw(f,m.slice(0,_));if(!Og(k)){p=!0;break}const g=m.slice(_+u.length),v=g.trim()?`suffix:${mw(g)}`:"nosuffix";return["closed",c,s+l,d,s+h,_,mw(k),v].join(":")}if(S6(m)){p=!0;break}if(f=pw(f,m),f.length>y6){p=!0;break}}if(!p&&Og(f))return["pending",c,s+l,d].join(":")}}return null}function G1(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function oY(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 Y1(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function iY(e,t){zG(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]===`
193
+ `||g[y]==="\r"&&g[y+1]===`
194
+ `))return v;const A=g.slice(v,y),L=a.push("text","",0);return L.content=A,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 A=a.push("text","",0);return A.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),h=Math.max(0,a.pos-p.length);let m=h,_=h;const k=h;for(const[g,v]of f){const y=a.src,A=w6(y),L=XG(y,u);let $=!1;g==="$$"&&m!==k&&(m=k);let x=-1,E=-1,N=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const O=a.push("text_special","",0);O.content=S==="\\)"?")":"(",O.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let O=0;for(;O<S.length;){const D=Fg(S,O);if(D===-1){const ke=S.slice(O);if(ke){const Se=a.push("text","",0);Se.content=ke,a.pos=a.pos+ke.length,m=a.pos}break}if(D>0&&S[D-1]==="$"||D+1<S.length&&S[D+1]==="$"){const ke=S.slice(O,D+1);if(ke){const Se=a.push("text","",0);Se.content=ke,a.pos=a.pos+ke.length,m=a.pos}O=D+1;continue}const W=S.slice(O,D);if(W){const ke=a.push("text","",0);ke.content=W,a.pos=a.pos+W.length,m=a.pos}const z=K1(S,D+1);if(z===-1){const ke=S.slice(D),Se=a.push("text","",0);Se.content=ke,a.pos=a.pos+ke.length,m=a.pos;break}const V=S.slice(D+1,z),U=V.includes("`"),re=!V||!V.trim(),ae=S[z+1],te=G1(V,ae),Z=Y1(V);if(!U&&!re&&!te&&!Z){const ke=a.push("math_inline","math",0);ke.content=Hr(V,t),ke.markup="$",ke.raw=`$${V}$`,ke.loading=!1,a.pos=a.pos+(z-D+1),m=a.pos,O=z+1;continue}const ne=a.push("text","",0);ne.content="$",a.pos=a.pos+1,m=a.pos,O=D+1}return}const T=S.indexOf("![");if(T!==-1){if(T>0){const W=S.slice(0,T),z=a.push("text","",0);z.content=W,a.pos=a.pos+W.length,m=a.pos}const O=S.slice(T).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(O){const[,W,z]=O,V=z.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),U=V?V[1]:z,re=V&&V[2]?V[2]:null,ae=a.push("image","img",0);ae.attrs=[["src",U],["alt",W]],re&&ae.attrs.push(["title",re]),ae.content=W,ae.children=[{type:"text",content:W,tag:""}],a.pos=a.pos+O[0].length,m=a.pos;const te=S.slice(T+O[0].length);te&&F(te);return}const D=a.push("text","",0);D.content=S,a.pos=a.pos+S.length,m=a.pos;return}const R=a.push("text","",0);R.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(Ed(y,S)){m=S+Math.max(1,g.length);continue}const T=Vh(A,S);if(T){m=T[1];continue}const R=Vh(L,S);if(R){m=R[1];continue}if(S===x&&m===E){if(N++,N>2){m=S+Math.max(1,g.length);continue}}else N=0,x=S,E=m;if(g==="("&&S>0){let te=S-1;for(;te>=0&&y[te]===" ";)te--;if(te>=0&&y[te]==="]"){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 O=g==="$"?K1(y,S+g.length):EG(y,S+g.length,g,v);if(O===-1){const te=y.slice(S+g.length);if(te.includes(g)){m=y.indexOf(g,S+g.length);continue}if(O===-1){const Z=g==="$"&&oY(te);if(u&&!c&&!Z&&nc(te)&&!te.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const ne=_?y.slice(_,m):y.slice(0,m),ke=aw(ne)%2===1;if(_)F(y.slice(_,m));else{let Se=y.slice(0,m);Se.endsWith(g)&&(Se=Se.slice(0,Se.length-g.length)),F(Se)}if(ke){const Se=cw(ne)?.marker??"**",Ye=a.push("strong_open","",0);Ye.markup=Se;const ve=a.push("math_inline","math",0);ve.content=Hr(te,t),ve.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ve.raw=`${g}${te}${v}`,ve.loading=!0,Ye.content=te,a.push("strong_close","",0)}else{const Se=a.push("math_inline","math",0);Se.content=Hr(te,t),Se.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Se.raw=`${g}${te}${v}`,Se.loading=!0}a.pos=y.length}m=y.length,_=m}break}}const D=y.slice(S+g.length,O),W=D.includes("`"),z=!D||!D.trim(),V=g==="$",U=y[O+v.length],re=V&&G1(D,U),ae=V&&Y1(D);if(c?W||z||re||ae:W||z||re||ae||!V&&!nc(D)){m=O+v.length;const te=y.slice(a.pos,m);a.pending||(F(te),_=m);continue}if($=!0,!l){const te=y.slice(a.pos-(a.pending??"").length,S);let Z=y.slice(0,m)?y.slice(_,S):te;const ne=aw(Z)%2===1;S!==a.pos&&ne&&(Z=a.pending+y.slice(a.pos,S));const ke=ne?cw(Z):null,Se=ke?.marker??"**";if(a.pending!==Z)if(a.pending="",ne)if(ke){const Ye=Z.slice(ke.index+Se.length);F(Z.slice(0,ke.index));const ve=a.push("strong_open","",0);ve.markup=Se;const Y=a.push("text","",0);Y.content=Ye,a.push("strong_close","",0)}else F(Z);else F(Z);if(ne){const Ye=a.push("strong_open","",0);Ye.markup=Se;const ve=a.push("math_inline","math",0);ve.content=Hr(D,t),ve.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ve.raw=`${g}${D}${v}`,ve.loading=!1;const Y=y.slice(O+v.length).startsWith(Se);return Y&&a.push("strong_close","",0),a.pos=d(y,O+v.length),m=a.pos,_=m,Y||a.push("strong_close","",0),!0}else{const Ye=a.push("math_inline","math",0);Ye.content=Hr(D,t),Ye.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ye.raw=`${g}${D}${v}`,Ye.loading=!1}}return m=d(y,O+v.length),_=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 T=Fg(y,S);if(T===-1)break;if(T+1<y.length&&y[T+1]==="$"){S=T+2;continue}if(T>0&&y[T-1]==="$"){S=T+1;continue}const R=K1(y,T+1);if(R===-1)break;const O=y.slice(T+1,R),D=O.includes("`"),W=!O||!O.trim(),z=y[R+1],V=G1(O,z),U=Y1(O);if(!D&&!W&&!V&&!U){const re=y.slice(m,T);re&&F(re);const ae=a.push("math_inline","math",0);ae.content=Hr(O,t),ae.markup="$",ae.raw=`$${O}$`,ae.loading=!1,m=R+1,S=R+1}else F("$"),S=T+1}S<y.length&&F(y.slice(S))}else m<y.length&&F(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,p=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],h=u.bMarks[l]+u.tShift[l];let m=u.src.slice(h,u.eMarks[l]).trim(),_=!1,k="",g="",v=!1,y="",A=!1;for(const[re,ae]of p)if(m.startsWith(re))if(re.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){_=!0,k=re,g=ae;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){_=!0,k=re,g=ae;break}continue}else{const te=u.tokens[u.tokens.length-1];if(te&&te.type==="list_item_open"&&te.mark==="-"&&m.slice(re.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const Z=m.indexOf("]");if(m.slice(Z).trim()!=="]")continue;const ne=m.slice(re.length,Z);if(re==="["?uw(ne):nc(ne)){_=!0,k=re,g=ae;break}continue}}else{_=!0,k=re,g=ae;break}else if((re==="$$"||re==="\\[")&&m.endsWith(re)&&l+1<a){const te=Ay(m,re,ae);if(te===-1)continue;y=ud(m.slice(0,te)),A=!0;const Z=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(Z,u.eMarks[l+1]).trim(),v=!0,_=!0,k=re,g=ae;break}if(!_)return!1;if(c&&!A)return!0;const L=m.indexOf(k),$=L+k.length,x=!f&&k==="["?m.indexOf("\\]",$):-1,E=x>=0?"\\]":g,N=x>=0?x:ku(m,g,$);if(!v&&N>k.length){const re=m.slice(L+k.length,N),ae=u.push("math_block","math",0);ae.content=Hr(re),ae.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ae.map=[l,l+1],ae.raw=`${k}${re}${E}`,ae.block=!0,ae.loading=!1,u.line=l+1;const te=m.slice(N+E.length);return te.trim()&&n(u,te,l),!0}let F=l,S="",T=!1,R="",O=l;const D=v?m:m===k?"":m.slice(k.length),W=!f&&k==="\\["?"]":"",z=ku(D,g);if(z!==-1){const re=z;S=D.slice(0,re),R=D.slice(re+g.length),O=v?l+1:l,T=!0,F=O}else for(D&&!v&&(S=D),F=l+1;F<a;F++){const re=u.bMarks[F]+u.tShift[F],ae=u.eMarks[F],te=u.src.slice(re,ae),Z=te.trim();if(!f&&k==="["&&Z==="\\]"){g="\\]",T=!0;break}if(W&&te.trim()===W){g=W,T=!0;break}if(Z===g){T=!0;break}else if(!f&&k==="["&&te.includes("\\]")){T=!0;const ne=te.indexOf("\\]");g="\\]";const ke=te.slice(0,ne);ke&&(S+=(S?`
195
+ `:"")+ke),R=te.slice(ne+g.length),O=F;break}else if(ku(te,g)!==-1){T=!0;const ne=ku(te,g),ke=te.slice(0,ne);ke&&(S+=(S?`
196
+ `:"")+ke),R=te.slice(ne+g.length),O=F;break}S+=(S?`
197
+ `:"")+te}if((!d||f)&&!T)return!1;const V=/^\s*!\[/.test(S);if(!(A?!V&&Og(S):k==="$$"?!V:k==="["?uw(S):nc(S)))return!1;if(c)return!0;y&&n(u,y,l);const U=u.push("math_block","math",0);return U.content=Hr(S),U.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",U.raw=`${k}${S}${S.startsWith(`
198
+ `)?`
199
+ `:""}${g}`,U.map=[l,F+1],U.block=!0,U.loading=!T,u.line=F+1,R.trim()&&n(u,R,O),!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 rY(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 lY(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 GV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!ea(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&iY(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&hK(i),e.enableFixIndentedCodeBlock!==!1&&RK(i),fG(i),gG(i),pG(i),bG(i),rY(i),FK(i,{customHtmlTags:e.customHtmlTags}),i}function ta(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=>ta(n))),t}function aY(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function cY(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 uY(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Cf(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(...jn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const gw=/\r?\n[ \t]*`+\s*$/,M6=["diff ","index ","--- ","+++ ","@@ "],dY=/\r?\n/;function fY(e){const t=String(e??"");return t?M6.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 hY(e,t){const n=[],s=[],o=[],i=[],r=e.split(dY),l=/\r?\n$/.test(e),a=r.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),c=p=>{const h=p;if(!M6.some(m=>h.startsWith(m)))if(h.startsWith("-")){const m=h.slice(1);o.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(h.startsWith("+")){const m=h.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{vw(n,s,o,i);const m=a&&h.startsWith(" ")?h.slice(1):h;n.push(m),s.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let p=0;p<u;p++){const h=r[p]??"";!t&&!l&&p===u-1&&fY(h)||c(h)}(t||o.length>0||i.length>0)&&vw(n,s,o,i);const d=n.join(`
200
+ `),f=s.join(`
201
+ `);return{original:t&&l&&d?`${d}
202
+ `:d,updated:t&&l&&f?`${f}
203
+ `:f}}function My(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(gw.test(a)&&(a=a.replace(gw,"")),r){const{original:c,updated:u}=hY(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 pY(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function mY(){return{type:"hardbreak",raw:`\\
204
+ `}}function gY(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(...jn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let Z1=null;const Q1=new WeakMap;function yw(){return Z1||(Z1={customTagSet:null,allowedTagSet:Xp()}),Z1}function E6(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function T6(e){return/^<\s*\//.test(e)}function N6(e,t){return/\/\s*>\s*$/.test(t)||ma.has(e)}function vY(e){if(!e||e.length===0)return yw();const t=Q1.get(e);if(t)return t;const n=e.map(di).filter(Boolean);if(!n.length){const o=yw();return Q1.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Xp({customHtmlTags:e})};return Q1.set(e,s),s}function I6(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function yY(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Kh(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 kY(e,t,n){const s=e.slice();return Kh(s,"href")||s.push(["href",t]),n!=null&&!Kh(s,"title")&&s.push(["title",n]),s}function Rg(e){return e.map(I6).join("")}function Kf(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:Kf(s.children)});continue}t.push(s)}return t}function bY(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=E6(r),a=T6(r),c=N6(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function X1(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?bY(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:Rg(s),innerTokens:o,nextIndex:i}}function xY(e,t,n,s,o,i,r){const l=String(e.content??""),a=E6(l),{customTagSet:c,allowedTagSet:u}=vY(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!X1(t,n,a).closed){const A=I6(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=T6(l),f=N6(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=X1(t,n,a),L=Yp(l),$=A.innerTokens,x=String(Kh(L,"href")??""),E=Kh(L,"title"),N=E==null?null:String(E),F=kY(L,x,N),S=Kf($.length?s($,o,i,r):[]),T=$.length?Rg($):x||"";return!S.length&&T&&S.push({type:"text",content:T,raw:T}),[{type:"link",href:x,title:N,text:T,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const p=X1(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Kf(p.innerTokens.length?s(p.innerTokens,o,i,r):[]),raw:p.html},p.nextIndex];const h=Kf(p.innerTokens.length?s(p.innerTokens,o,i,r):[]);let m=p.html||l,_=!p.closed,k=!1;if(!p.closed){const A=`</${a}>`;m.toLowerCase().includes(A.toLowerCase())||(m+=A),k=!0,_=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const A=y[1],L=y[2]||y[3]||y[4]||"";g.push([A,L])}if(c?.has(a)){const A=yY(e);return[{type:a,tag:a,attrs:g,content:A?A.inner:p.innerTokens.length?Rg(p.innerTokens):"",children:p.innerTokens.length?s(p.innerTokens,o,i,r):[],raw:A?.raw??m,loading:e.loading||_,autoClosed:k},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:h,raw:m,loading:_,autoClosed:k},p.nextIndex]}function $6(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=>$6(t)).join(""):String(e.content??"")}function _Y(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>$6(t)).join("")}function kw(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=_Y(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 wY(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function SY(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(...jn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function CY(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 Gh(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 AY(e,t,n){const s=e.slice();return Gh(s,"href")||s.push(["href",t]),n!=null&&!Gh(s,"title")&&s.push(["title",n]),s}function Af(e,t,n){const s=e[t],o=CY(s.attrs),i=String(Gh(o,"href")??""),r=Gh(o,"title"),l=r==null?null:String(r),a=AY(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 p=u[u.length-1];if(n?.__insideStrong&&p?.type==="text"&&String(p.content??"").endsWith("**")&&!u.some(_=>_.type==="strong_open")){const _=String(p.content??""),k=String(p.raw??_),g=ta(p);g.content=_.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const h=jn(f,void 0,void 0,n),m=h.map(_=>{const k=_;return"content"in _?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:h,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function bw(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 MY(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(...jn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const EY=/\\([\\()[\]`$|*_\-!])/g;function TY(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(EY,"$1")===t))return n}function au(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(...jn(l,TY(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function NY(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(...jn(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 IY(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(...jn(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 $Y(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const LY=/[^~]*~{2,}[^~]+/,FY=/\*\*/,OY=/[[_*^~]/,RY=/\\([\\()[\]`$|*_\-!])/g,Ey=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),BY=/\s/u,DY=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,PY=/\p{P}/u,HY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,WY=/:\/\//;function zY(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 L6(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&&Ey.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function fl(e){return!!e&&BY.test(e)}function hl(e){return!!e&&(DY.test(e)||PY.test(e))}function UY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||fl(s)?!1:!(hl(s)&&n&&!fl(n)&&!hl(n))}function jY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||fl(n)?!1:!(hl(n)&&s&&!fl(s)&&!hl(s))}function qY(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?L6(e,s):t.indexOf("*",s);if(i===-1)break;if(jY(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function VY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||fl(s)?!1:!(hl(s)&&n&&!fl(n)&&!hl(n))}function KY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||fl(n)?!1:!(hl(n)&&s&&!fl(s)&&!hl(s))}function GY(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(KY(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function YY(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&&Ey.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function ZY(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&Ey.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function QY(e,t,n){const s=ZY(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 XY=/[\p{L}\p{N}]/u,JY=/^[\p{L}\p{N}]+$/u;function Bg(e){return e?XY.test(e):!1}function F6(e){return e?JY.test(e):!1}function Lu(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:Bg(s)&&Bg(o)}}function eZ(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=Lu(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(!F6(e.slice(s.end,o.start)))return o.end}return-1}function tZ(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function nZ(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=Lu(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function sZ(e){return e?HY.test(e)||WY.test(e):!1}function oZ(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function jn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=Md(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 p(){return e===f&&(e=e.slice()),e}function h(){c=null}function m(Y,ce){const fe=e.length===1?t:String(ce.content??""),j=[],se=eZ(Y);if(se!==-1){A(Y.slice(0,se),Y.slice(0,se));const ue=Y.slice(se);return ue&&(N({type:"text",content:ue,raw:ue}),u--),u++,!0}if(LY.test(Y)){const ue=Y.indexOf("~~");ue!==-1&&j.push({type:"strikethrough",index:ue})}if(FY.test(Y)){const ue=Y.indexOf("**");ue!==-1&&j.push({type:"strong",index:ue})}if(/[^*]*\*[^*]+/.test(Y)){const ue=fe?L6(fe,0):Y.indexOf("*");if(fe&&ue===-1)return!1;ue!==-1&&j.push({type:"emphasis",index:ue})}j.sort((ue,pe)=>ue.index!==pe.index?ue.index-pe.index:ue.type===pe.type?0:ue.type==="strong"?-1:pe.type==="strong"?1:0);const ge=j[0];if(!ge)return!1;if(ge.type==="strikethrough"){const ue=ge.index,pe=ue>-1?Y.slice(0,ue):"";if(pe&&A(pe,pe),ue===-1)return u++,!0;const q=Y.indexOf("~~",ue+2),J=q===-1?Y.slice(ue+2):Y.slice(ue+2,q),he=q===-1?"":Y.slice(q+2),{node:Te}=xw([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:J,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return h(),y(Te),he&&(N({type:"text",content:he,raw:he}),u--),u++,!0}if(ge.type==="strong"){const ue=ge.index,pe=ue>-1?Y.slice(0,ue):"";if(pe&&A(pe,pe),ue===-1)return u++,!0;if(t&&ue===0){let Oe=!1,de=0;for(;de<Y.length&&Y[de]==="*";)de++;if(t.startsWith("\\*")&&(Oe=!0),Oe){let $e=0,Qe=0;for(;Qe<t.length&&$e<de;)if(t[Qe]==="\\"&&Qe+1<t.length&&t[Qe+1]==="*")$e+=1,Qe+=2;else{if(t[Qe]==="*")break;Qe++}if($e>=2)return A(Y,Y),u++,!0}}if(t&&(Y.match(/\*/g)||[]).length>zY(t))return A(Y.slice(pe.length),Y.slice(pe.length)),u++,!0;const q=Lu(Y,ue);if(q.len>=3){const Oe=nZ(Y,ue+q.len);if(Oe!==-1){const de=Y.slice(ue+q.len,Oe);if(tZ(de)){const{node:$e}=au([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:de,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);h(),y($e);const Qe=Y.slice(Oe+3);return Qe&&(N({type:"text",content:Qe,raw:Qe}),u--),u++,!0}}}if(!VY(Y,ue)){const Oe=Y.slice(ue,ue+q.len);A(Oe,Oe);const de=Y.slice(ue+q.len);return de&&(N({type:"text",content:de,raw:de}),u--),u++,!0}const J=GY(Y,ue+2);let he="",Te="";if(J.index!==-1){he=Y.slice(ue+2,J.index),Te=Y.slice(J.index+2);const Oe=J.index,de=Lu(Y,Oe);if(q.intraword&&de.intraword&&!F6(he)||!he&&q.len>=4&&q.intraword)return A(Y.slice(pe.length),Y.slice(pe.length)),u++,!0}else{if(d||J.sawInvalidClose||q.intraword)return A(Y.slice(pe.length),Y.slice(pe.length)),u++,!0;he=Y.slice(ue+2),Te=""}if(!he&&/^\*+$/.test(Te))return A(Y,Y),u++,!0;const{node:Ie}=au([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:he,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return h(),y(Ie),Te&&(N({type:"text",content:Te,raw:Te}),u--),u++,!0}if(ge.type==="emphasis"){let ue=ge.index;ue===-1&&(ue=0);const pe=Y.slice(0,ue);if(pe&&A(pe,pe),!UY(Y,ue)){A(Y[ue],Y[ue]);const Oe=Y.slice(ue+1);return Oe&&(N({type:"text",content:Oe,raw:Oe}),u--),u++,!0}const q=Lu(Y,ue),J=qY(fe,Y,ue+1),he=J.index,Te=e[u+1];if(s?.final&&Te?.type==="em_open"&&he!==-1&&Y.slice(ue+1,he).trim()!==Y.slice(ue+1,he)||he===-1&&(J.sawInvalidClose||s?.final||q.intraword||!Bg(Y[ue+1])))return A(Y.slice(ue),Y.slice(ue)),u++,!0;const{node:Ie}=Cf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:he>-1?Y.slice(ue+1,he):Y.slice(ue+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(h(),y(Ie),he!==-1&&he<Y.length-1){const Oe=Y.slice(he+1);Oe&&(N({type:"text",content:Oe,raw:Oe}),u--)}return u++,!0}return!1}function _(Y,ce){if(!Y.includes("`"))return!1;const j=(Te=>{for(let Ie=0;Ie<Te.length;Ie++){if(Te[Ie]!=="`")continue;let Oe=0;for(let de=Ie-1;de>=0&&Te[de]==="\\";de--)Oe++;if(Oe%2===0)return Ie}return-1})(Y);if(j===-1)return!1;let se=1;for(let Te=j+1;Te<Y.length&&Y[Te]==="`";Te++)se++;const ge="`".repeat(se),ue=j+se,pe=Y.indexOf(ge,ue);if(pe===-1){if(se===1){const Ie=Y.slice(0,j),Oe=Y.slice(j+1);return Ie&&(m(Ie,ce)?u--:A(Ie,Ie)),g({type:"inline_code",code:Oe,raw:String(Oe)}),u++,!0}let Te=Y;for(let Ie=u+1;Ie<e.length;Ie++)Te+=String((e[Ie].content??"")+(e[Ie].markup??""));return u=e.length-1,A(Te,Te),u++,!0}h();const q=Y.slice(0,j),J=Y.slice(j+se,pe),he=Y.slice(pe+se);return q&&(m(q,ce)?u--:A(q,q)),g({type:"inline_code",code:J,raw:String(J??"")}),he&&(N({type:"text",content:he,raw:he}),u--),u++,!0}function k(Y){const ce=l?.__markdownIt;if(!ce||e.length<=1||!e.some(ge=>ge?.type==="math_inline")||!OY.test(Y))return null;const fe=ce.parseInline(Y,{__markstreamFinal:!!s?.final});if(!Array.isArray(fe)||fe.length===0)return null;const j=(fe.find(ge=>ge?.type==="inline")?.children??[]).filter(ge=>!(ge?.type==="text"&&String(ge.content??"")===""));if(!j.length||!j.some(ge=>ge?.type!=="text")||j.length===1&&j[0]?.type==="text"&&String(j[0].content??"")===Y)return null;const se=jn(j,Y,n,s);return se.length?se:null}function g(Y){h(),a.push(Y)}function v(Y){h();const ce=ta(Y);a.push(ce)}function y(Y){g(Y)}function A(Y,ce){c?(c.content+=Y,c.raw+=ce??Y):(c={type:"text",content:String(Y??""),raw:String(ce??Y??"")},a.push(c))}function L(Y,ce){if(!Y)return;const fe=jn([{...ce,type:"text",content:Y,raw:Y}],Y,n,s);if(fe.length===1&&fe[0]?.type==="text"){const j=fe[0];A(String(j.content??""),String(j.raw??j.content??""));return}for(const j of fe)y(j)}function $(Y,ce){return String(Y.markup??"").startsWith(ce)}function x(Y){return Y.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function E(Y,ce){let fe=Y;const j=String(ce.content??"");return fe.endsWith("\\")&&!$(ce,"\\\\")&&!j.endsWith("\\\\")&&(fe=fe.slice(0,-1)),fe.endsWith("(")&&!$(ce,"\\(")&&!j.endsWith("\\(")&&(fe=fe.slice(0,-1)),/\*+$/.test(fe)&&!$(ce,"\\*")&&!j.endsWith("\\*")&&(fe=fe.replace(/\*+$/,"")),fe}for(;u<e.length;){const Y=e[u];N(Y)}function N(Y){switch(Y.type){case"text":S(Y);break;case"softbreak":c?(c.content+=`
205
+ `,c.raw+=`
206
+ `):(c={type:"text",content:`
207
+ `,raw:`
208
+ `},a.push(c)),u++;break;case"code_inline":y(wY(Y)),u++;break;case"html_inline":{const[ce,fe]=xY(Y,e,u,jn,t,n,s);y(ce),u=fe;break}case"link_open":T(Y);break;case"image":te(Y)||(h(),y(kw(Y)),u++);break;case"strong_open":{h();const{node:ce,nextIndex:fe}=au(e,u,Y.content,s);y(ce),u=fe;break}case"em_open":{h();const{node:ce,nextIndex:fe}=Cf(e,u,s);y(ce),u=fe;break}case"s_open":{h();const{node:ce,nextIndex:fe}=xw(e,u,s);y(ce),u=fe;break}case"mark_open":{h();const{node:ce,nextIndex:fe}=gY(e,u,s);y(ce),u=fe;break}case"ins_open":{h();const{node:ce,nextIndex:fe}=SY(e,u,s);y(ce),u=fe;break}case"sub_open":{h();const{node:ce,nextIndex:fe}=NY(e,u,s);y(ce),u=fe;break}case"sup_open":{h();const{node:ce,nextIndex:fe}=IY(e,u,s);y(ce),u=fe;break}case"sub":h(),y({type:"subscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`~${String(Y.content??"")}~`}),u++;break;case"sup":h(),y({type:"superscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`^${String(Y.content??"")}^`}),u++;break;case"emoji":{h();const ce=e[u-1];ce?.type==="text"&&/\|:-+/.test(String(ce.content??""))?A("",""):y(uY(Y)),u++;break}case"checkbox":h(),y(aY(Y)),u++;break;case"checkbox_input":h(),y(cY(Y)),u++;break;case"footnote_ref":h(),y(pY(Y)),u++;break;case"footnote_anchor":{h();const ce=Y.meta??{};g({type:"footnote_anchor",id:String(ce.label??Y.content??""),raw:String(Y.content??"")}),u++;break}case"hardbreak":h(),y(mY()),u++;break;case"fence":h(),y(My(e[u])),u++;break;case"math_inline":h(),!Y.content&&Y.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(bw({...Y,content:e[u+1].content})),u+=2):y(bw(Y)),u++;break;case"reference":O(Y);break;case"text_special":A(String(Y.content??""),String(Y.content??"")),u++;break;default:{const ce=Y;if(Y.type==="link"&&ce.href!=null&&s?.validateLink&&!s.validateLink(String(ce.href))){h();const fe=String(ce.text??"");A(fe,fe),u++}else Z(Y)||W(Y)||V(Y)||D(Y)||v(Y),u++;break}}}function F(Y,ce,fe,j){const se=$Y({...ce,content:Y});if(c){c.content+=E(se.content,ce),c.raw+=se.raw;return}const ge=fe?.tag==="br"&&e[u-2]?.content==="[";j||(se.content=E(se.content,ce)),c=se,c.center=ge,a.push(c)}function S(Y){const ce=String(Y.content??""),fe=e.length===1&&ce.includes("\\")&&typeof t=="string"?String(t):"";let j=fe?YY(fe):ce.replace(RY,"$1");if(Y.content==="<"||j==="1"&&e[u-1]?.tag==="br"){u++;return}const se=j.indexOf("$");se!==-1&&se===j.lastIndexOf("$")&&j.endsWith("$")&&(j=j.slice(0,-1)),j.endsWith("undefined")&&!t?.endsWith("undefined")&&(j=j.slice(0,-9));let ge=a.length,ue="";for(let he=a.length-1;he>=0;he--){const Te=a[he];if(Te.type!=="text")break;ge=he,ue=String(Te.content??"")+ue}ge<a.length&&(j.startsWith(ue)?(c=null,a.length=ge):c=a[a.length-1]);const pe=e[u+1];if((j==="`"||j==="|"||j==="$")&&!$(Y,`\\${j}`)||/^\*+$/.test(j)&&!$(Y,"\\*")){u++;return}if(!pe&&/[^\]]\s*\(\s*$/.test(j)&&(j=j.replace(/\(\s*$/,"")),!j){u++;return}if(ae(j)||ne(j))return;if(!(j.includes("*")||j.includes("_")||j.includes("~")||j.includes("`")||j.includes("[")||j.includes("!")||j.includes("$")||j.includes("|")||j.includes("("))){F(j,Y,e[u-1],pe),u++;return}if(ve(j))return;const q=e[u-1];if(j==="["&&!pe?.markup?.includes("*")&&!$(Y,"\\[")||j==="]"&&!q?.markup?.includes("*")&&!$(Y,"\\]")){u++;return}if(_(ce,Y)||Ye(j)||(e[u+1]?.type!=="link_open"||x(j))&&Se(j,Y))return;const J=k(ce);if(J){h();for(const he of J)y(he);u++;return}m(j,Y)||(F(j,Y,q,pe),u++)}function T(Y){if(R(Y))return;if(ke()){const{node:pe,nextIndex:q}=Af(e,u,s),J=String(pe.text||pe.href||"");A(J,J),u=q;return}h();const{node:ce,nextIndex:fe}=Af(e,u,s);u=fe;const j=ce.text||ce.href||"";if(Y.markup==="linkify"&&!h6(j,ce.href,t)&&jh(j,l?.__linkifyDemotionContext)){A(j,j);return}const se=ce.children.length===1&&ce.children[0]?.type==="text";if(ce.loading&&t&&ce.text===ce.href&&se){const pe=oZ(t,ce.href);pe&&(ce.text=pe,ce.children=[{type:"text",content:pe,raw:pe}],ce.raw=`[${pe}](${ce.href}${ce.title?` "${ce.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ce.href)){A(ce.text,ce.text);return}const ge=Y.attrs?.find(([pe])=>pe==="href")?.[1],ue=String(ge??"");if(t&&ue){const pe=t.indexOf("](");if(pe!==-1){const q=t.indexOf(")",pe+2);q===-1?ce.loading=!0:ce.loading&&t.slice(pe+2,q).includes(ue)&&(ce.loading=!1)}}D(ce)||g(ce)}function R(Y){if(Y.markup!=="linkify")return!1;const{node:ce,nextIndex:fe}=Af(e,u,s);return z(ce,fe)?(u=fe,!0):!1}function O(Y){h(),y(MY(Y)),u++}function D(Y){if(Y.type!=="link")return!1;const ce=a[a.length-1];if(!ce||ce.type!=="text")return!1;const fe=String(ce.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!fe)return!1;const j=Y,se=String(j.href??""),ge=String(j.text??""),ue=String(fe[2]??""),pe=se.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!se||!(ge===se||ge===pe||sZ(ge)))return!1;const q=String(fe[1]??"");return q?(ce.content=q,ce.raw=q):a.pop(),g({...Y,text:ue,children:[{type:"text",content:ue,raw:ue}],raw:`[${ue}](${se}${j.title?` "${j.title}"`:""})`}),!0}function W(Y){if(Y.type!=="link")return!1;const ce=Y,fe=String(ce.href??"");return fe?z({href:fe,title:ce.title==null||ce.title===""?null:String(ce.title),loading:!!ce.loading},u+1):!1}function z(Y,ce){const fe=a[a.length-1];if(fe?.type!=="image"||fe.src||!fe.loading||!String(fe.raw??"").endsWith("]("))return!1;const j=e[ce],se=String(j?.content??"");if(j?.type!=="text"||!se.startsWith(")"))return!1;a.pop(),c=null;const ge=String(fe.alt??"");g({type:"image",src:Y.href,alt:ge,title:Y.title,raw:`![${ge}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const ue=se.slice(1),pe=ta(j);return pe.content=ue,pe.raw=ue,p()[ce]=pe,!0}function V(Y){if(Y.type!=="link")return!1;const ce=a[a.length-1],fe=e[u-1];if(!ce||ce.type!=="text"||fe?.type!=="text")return!1;const j=String(ce.content??""),se=String(fe.content??"");if(!j.endsWith("!")||!se.endsWith("!")||$(fe,"\\!"))return!1;const ge=j.slice(0,-1);ge?(ce.content=ge,ce.raw=ge,c=ce):(a.pop(),c=null);const ue=Y,pe=String(ue.text??ue.children?.map(he=>String(he?.content??he?.raw??"")).join("")??""),q=String(ue.href??""),J=ue.title==null||ue.title===""?null:String(ue.title);return g({type:"image",src:q,alt:pe,title:J,raw:`![${pe}](${q}${J?` "${J}"`:""})`,loading:!!ue.loading}),!0}function U(Y,ce="",fe=null){const j=String(Y.alt??Y.raw??"");return{type:"link",href:ce,title:fe,text:j,children:[Y],raw:`[${j}](${ce}${fe?` "${fe}"`:""})`,loading:!0}}function re(Y){const ce=Y.startsWith("![")?Y:`![${Y}`,fe=ce.slice(2),j=fe.indexOf("](");return{type:"image",src:"",alt:j===-1?fe.replace(/\]$/,""):fe.slice(0,j),title:null,raw:ce,loading:!0}}function ae(Y){const ce=Y.indexOf("[![");if(ce===-1||typeof t=="string"&&e.length===1&&QY(t,ce,"["))return!1;const fe=Y.slice(0,ce);return fe&&A(fe,fe),g(U(re(Y.slice(ce+1)))),u++,!0}function te(Y){if(s?.final)return!1;const ce=e[u-1];if(ce?.type!=="text"||!String(ce.content??"").endsWith("[")||$(ce,"\\["))return!1;const fe=a[a.length-1];if(fe?.type==="text"&&fe.content.endsWith("[")){const j=fe.content.slice(0,-1);j?(fe.content=j,fe.raw=j,c=fe):(a.pop(),c=null)}return g(U(kw(Y))),u++,!0}function Z(Y){if(Y.type!=="link")return!1;const ce=Y,fe=String(ce.raw??""),j=String(ce.text??"");if(!fe.startsWith("[![")&&!j.startsWith("!["))return!1;const se=ce.title==null||ce.title===""?null:String(ce.title);return g(U({type:"image",src:String(ce.href??""),alt:j.replace(/^!\[/,"").replace(/\]$/,""),title:se,raw:fe.startsWith("[![")?fe.slice(1):fe,loading:!0})),!0}function ne(Y){if(!Y.startsWith("]("))return!1;const ce=e[u-2];if(ce?.type==="text"&&String(ce.content??"").endsWith("[")&&$(ce,"\\["))return!1;const fe=a[a.length-1];if(fe?.type!=="image"&&fe?.type!=="link")return!1;const j=fe,se=fe?.type==="link"&&Array.isArray(j.children)&&j.children.length===1&&j.children[0]?.type==="image"?a.pop():null,ge=se?se.children[0]:a.pop();if(!ge||ge.type!=="image")return!1;const ue=e[u+1];let pe=String(se?.href??""),q=se?.title==null?null:String(se.title),J=!0;if(ue?.type==="link_open"){const{node:Te,nextIndex:Ie}=Af(e,u+1,s);pe=Te.href,q=Te.title,J=!0,u=Ie}else{if(pe=Y.slice(2),pe.includes('"')){const Te=pe.split('"');pe=String(Te[0]??"").trim(),q=Te[1]==null?null:String(Te[1]).trim()}u++}const he=U(ge,pe,q);return he.loading=J,g(he),!0}function ke(){const Y=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&$(Y,"\\[")}function Se(Y,ce){const fe=Y.indexOf("[");if(fe===-1)return!1;let j=Y.slice(0,fe);const se=Y.indexOf("](",fe);if(se!==-1){const ge=e[u+2];let ue=Y.slice(fe+1,se);if(ue.includes("[")){const Oe=ue.indexOf("[");j+=Y.slice(0,fe+Oe+1);const de=fe+Oe+1;ue=Y.slice(de+1,se)}const pe=e[u+1];if(Y.endsWith("](")&&pe?.type==="link_open"&&ge){const Oe=e[u+4];let de=4,$e=!0;if(Oe?.type==="text"){const tt=String(Oe.content??"");if(tt.startsWith(")")){$e=!1;const vt=tt.slice(1);if(vt){const wt=ta(Oe);wt.content=vt,wt.raw=vt,p()[u+4]=wt}else de++}else tt==="."&&de++}L(j,ce);const Qe=String(ge.content??"");return s?.validateLink&&!s.validateLink(Qe)?A(ue,ue):g({type:"link",href:Qe,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:$e}),u+=de,!0}const q=Y.indexOf(")",se),J=q!==-1?Y.slice(se+2,q):"",he=q===-1;let Te=j.match(/\*+$/);if(Te&&(j=j.replace(/\*+$/,"")),L(j,ce),Te||(Te=ue.match(/^\*+/)),!d&&Te){const Oe=Te[0].length;ue=ue.replace(/^\*+/,"").replace(/\*+$/,"");const de=[];if(Oe===1?de.push({type:"em_open",tag:"em",nesting:1}):Oe===2?de.push({type:"strong_open",tag:"strong",nesting:1}):Oe===3&&(de.push({type:"strong_open",tag:"strong",nesting:1}),de.push({type:"em_open",tag:"em",nesting:1})),de.push({type:"link",href:J,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:he}),Oe===1){de.push({type:"em_close",tag:"em",nesting:-1});const{node:$e}=Cf(de,0,s);y($e)}else if(Oe===2){de.push({type:"strong_close",tag:"strong",nesting:-1});const{node:$e}=au(de,0,void 0,s);y($e)}else if(Oe===3){de.push({type:"em_close",tag:"em",nesting:-1}),de.push({type:"strong_close",tag:"strong",nesting:-1});const{node:$e}=au(de,0,void 0,s);y($e)}else{const{node:$e}=Cf(de,0,s);y($e)}}else s?.validateLink&&!s.validateLink(J)?A(ue,ue):g({type:"link",href:J,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:he});const Ie=q!==-1?Y.slice(q+1):"";return Ie&&(N({type:"text",content:Ie,raw:Ie}),u--),u++,!0}return!1}function Ye(Y){const ce=Y.indexOf("![");if(ce===-1)return!1;const fe=Y.slice(0,ce);return fe&&!c?c={type:"text",content:fe,raw:fe}:fe&&c&&(c.content+=fe),c&&(a.push(c),c=null),g(re(Y.slice(ce))),u++,!0}function ve(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ce=Y.slice(1).match(/[^\s\]]/);if(ce===null)return u++,!0;if(ce&&/x/i.test(ce[0])){const fe=ce[0]==="x"||ce[0]==="X";return g({type:"checkbox_input",checked:fe,raw:fe?"[x]":"[ ]"}),u++,!0}return!1}return a}function iZ(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 rZ(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 lZ(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Oc(e,t,n){const s=e[t],o=[],i=xl(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=lZ(c)?ta(c):c,d=e[a-1];u!==c&&(rZ(u),iZ(u));const f=String(u.content??"");l.push({type:"paragraph",children:jn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Rc(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]=Oc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Ny(e,a,i.options(),Ty);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(`
209
+ `)},r+1]}function aZ(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=xl(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:jn(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]=Oc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Rc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Zp(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}
210
+ ${r.map(c=>c.raw).join(`
211
+ `)}
212
+ :::`},a+1]}const cZ=new Set(["warning","info","note","tip","danger","caution"]);function uZ(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 cZ.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function dZ(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=uZ(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=xl(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 p=-1;for(let m=f.length-1;m>=0;m--){const _=f[m];if(_.type==="text"&&/:+/.test(_.content)){p=m;break}}const h={type:"paragraph",children:jn((p!==-1?f.slice(0,p):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Oc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Rc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Zp(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}
213
+ ${l.map(d=>d.raw).join(`
214
+ `)}
215
+ :::`},c+1]}const fZ=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function hZ(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=fZ.exec(String(s.info??""));return o?aZ(e,t,o,n):null}const Ty={parseContainer:(e,t,n)=>dZ(e,t,n),matchAdmonition:hZ};function Rc(e,t,n){const s=[],o=xl(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:jn(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]=Oc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Rc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=Ny(e,i,o.options(),Ty);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(`
216
+ `)},i+1]}function pZ(e){if(e.info?.startsWith("diff"))return My(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 mZ(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=xl(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=jn(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:jn(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(`
217
+ `)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
218
+ `)},o+1]}function gZ(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=xl(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:jn(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(`
219
+ `)}`},l+1]}function vZ(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:jn(a.children||[],c,void 0,n),raw:c}}function yZ(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=Un(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=Un(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 O6(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=Un(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=ma.has(n),l=Yp(o),a=(s===-1?-1:yZ(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
220
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function kZ(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 bZ(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 R6(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function B6(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return R6(n)?n:void 0}function xZ(e,t,n){const s=B6(Md(t),n);if(!R6(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 _Z(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",p=e[c+1],h=String(p.content??""),m=bZ(e[c].attrs),_=a.length,k=!f&&!r,g=k?o?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:jn(p.children||[],h,void 0,xZ(n,g,k?u:void 0)),raw:h,align:m}),k&&(u=B6(u,Md(h))),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(`
221
+ `)},s+1]}function wZ(){return{type:"thematic_break",raw:"---"}}let J1=null;const e0=new WeakMap;function _w(){return J1||(J1={allowedTagSet:Xp(),customTagSet:null}),J1}function SZ(e){if(!e||e.length===0)return _w();const t=e0.get(e);if(t)return t;const n=e.map(di).filter(Boolean);if(!n.length){const o=_w();return e0.set(e,o),o}const s={allowedTagSet:Xp({customHtmlTags:e}),customTagSet:new Set(n)};return e0.set(e,s),s}function CZ(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[p,h]of o)if(p==="class"){const m=h.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(p.startsWith("data-")){const m=p.slice(5);try{r[m]=JSON.parse(h)}catch{r[m]=h}}}const l=[],a=xl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const p=e[c+1];if(p){const h={type:"paragraph",children:jn(p.children||[],void 0,void 0,a.options()),raw:String(p.content??"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[p,h]=Oc(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else if(e[c].type==="blockquote_open"){const[p,h]=Rc(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else{const p=Zp(e,c,a.options());p?(l.push(p[0]),a.remember(p[0].raw),c=p[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+=`
222
+ `,l.length>0&&(f+=s.raw??l.map(p=>p.raw).join(`
223
+ `),f+=`
224
+ `),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 AZ(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function MZ(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function EZ(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Bo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Bo(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=Un(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=Un(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 TZ(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=Un(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const h=c+1;return{raw:e.slice(r,h),end:h}}let u=1,d=c+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(m)},p=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),end:e.length};if(p(h)){const m=e.indexOf(">",h);if(m===-1)return null;if(u--,u===0){const _=m+1;return{raw:e.slice(r,_),end:_}}d=m+1;continue}if(f(h)){const m=Un(e.slice(h));if(m===-1)return null;u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),end:e.length}}function Dg(e){return Number.isFinite(e)&&e>0?e:0}function NZ(e,t){const n=Dg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
225
+ `&&(s++,s===n))return o+1;return e.length}function Zp(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[vZ(e,t,n),t+3];case"code_block":return[pZ(s),t+1];case"fence":return[My(s),t+1];case"math_block":return[kZ(s),t+1];case"html_block":{const o=O6(s),i=o.tag?SZ(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)?NZ(l,Number(s.map?.[0]??0)):0,u=TZ(l,r,Math.max(Dg(a),Dg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Un(d),p=f!==-1?d.slice(0,f+1):d,h=f!==-1&&/\/\s*>\s*$/.test(p),m=f===-1?null:EZ(d,r,f+1),_=m?.start??-1;let k="";f!==-1&&(_!==-1&&f<_?k=d.slice(f+1,_):k=d.slice(f+1)),_===-1&&(k=MZ(k,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(p))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const $=y[2]||y[3]||y[4]||"";g.push([L,$])}const A=!n?.final&&!h&&m==null;return[{type:r,tag:r,content:AZ(k),raw:String(u?.raw??o.raw??d),loading:A,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=_Z(e,t,n);return[o,i]}case"dl_open":{const[o,i]=mZ(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=gZ(e,t,n);return[o,i]}case"hr":return[wZ(),t+1]}return null}function Ny(e,t,n,s){const o=Zp(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 CZ(e,t,n)}return null}function IZ(){return{type:"hardbreak",raw:`\\
226
+ `}}function $Z(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:jn(s.children||[],o,void 0,n),raw:o}}const ww=new WeakMap,Qp=new WeakMap,LZ=["$$","\\["];function Mc(){return typeof performance<"u"?performance.now():Date.now()}function Iy(e,t,n){e&&(e[t]=(e[t]??0)+n)}function D6(e){return e.__timing}function t0(e,t,n){return t&&Iy(t,"parseMarkdownToStructureTotalMs",Mc()-n),e}function Sw(e,t,n){if(!n)return $w(e,t);const s=Mc(),o=$w(e,t);return Iy(n,"processTokensMs",Mc()-s),o}function FZ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Fc(t);return n.length?new Set(n):null}function OZ(e,t){const n=e;let s=ww.get(n);s||(s=new Map,ww.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 RZ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Mf(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]=Ul(o.value,n))}}function Ul(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(Ul(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Ul(l,t),Ul(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Ul(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),Mf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Mf(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),Mf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!RZ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Mf(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Ul(i[r],t);return o}function P6(e,t=!0){if(!t)return ta(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=>P6(a,t)):t&&r&&typeof r=="object"&&(l=Ul(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function Cw(e,t=!0){return e.map(n=>P6(n,t))}function H6(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 BZ(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 DZ(e){Qp.delete(e)}function PZ(e,t,n){Qp.set(e,{source:t,key:n,pendingCandidate:n===null&&A6(t)})}function HZ(e){return e.endsWith("$")||e.endsWith("\\")}function WZ(e){const t=Math.max(e.lastIndexOf(`
227
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return LZ.some(s=>n.endsWith(s))}function zZ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||WZ(e)&&/[\r\n]/.test(t)):!1}function UZ(e,t){if(!k6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=Qp.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&&!zZ(o.source,l)&&!HZ(t)){o.source=t;return}}const i=sY(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),PZ(e,t,i)}function jZ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function qZ(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 n0(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&&qZ(e,t)}function Aw(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function VZ(e){for(let t=0;t+5<e.length;t++)if(Aw(e,t)&&Aw(e,t+3)&&n0(e[t],e[t+3])&&n0(e[t+1],e[t+4])&&n0(e[t+2],e[t+5]))return!0;return!1}function KZ(e,t,n){return k6(e)&&A6(t)&&VZ(n)}function GZ(e){const t=Qp.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function Mw(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!H6(e,s)||(UZ(e,t),GZ(e)))return e.parse(t,n);const o=e.stream.parse(t,OZ(e,n));if(KZ(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!jZ(s))return o;const i=D6(s);if(!i)return Cw(o,!0);const r=Mc(),l=Cw(o,!0);return Iy(i,"tokenCloneMs",Mc()-r),l}function Xp(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return ld;const n=new Set(ld);for(const s of Fc(t))s&&n.add(s);return n}function YZ(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:e.type==="hardbreak"?"<br>":""}function Ew(e){return{type:"paragraph",children:e,raw:e.map(YZ).join("")}}function Tw(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=FZ(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(p=>p?.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(Ew(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(Ew(c)),a}function ZZ(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 Fu(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function QZ(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*${Bo(t)}\s*>\s*$`,"i").test(n)}function $y(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Bo(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=Un(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(ma.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${Bo(s)}(?=\s|>|/)`,"i").test(m)},p=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${Bo(s)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(p(h)){const m=Un(e.slice(h));if(m===-1)return null;u--;const _=h+m+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(f(h)){const m=Un(e.slice(h));if(m===-1)return null;const _=e.slice(h,h+m+1);/\/\s*>$/.test(_)||u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function XZ(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]===`
228
+ `){n++;continue}return-1}return s===t.length?n:-1}function JZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
229
+ </${t}>`}function Nw(e){return e.replace(/\r\n/g,`
230
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function eQ(e,t,n){return n?e.includes(n,t)?!0:Nw(e.slice(Math.max(0,t))).includes(Nw(n)):!1}function tQ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
231
+ `&&n++,n):e[n]===`
232
+ `?n+1:t}function Iw(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 nQ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Ly(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Bo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function W6(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const sQ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),oQ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function iQ(e){return/\n\s*\n/.test(e)||oQ.test(e)}function rQ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>sQ.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(!iQ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function lQ(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"||n6.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Un(l);if(a===-1)return o;const c=Ly(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=Ou(u,t,W6(n,s));return rQ(u,d)?{...o,children:d}:o})}function Ou(e,t,n){return e.trim()?U6(e,t,{...n,__disableStreamParse:!0}):[]}function aQ(e,t,n){const s=Ou(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function cQ(e,t,n){const s=O6({content:e}),o=Un(e),i=Ly(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=aQ(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function uQ(e,t,n){const s=Un(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=$y(o,"summary",0);if(!i)return Ou(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Ou(r,t,n),cQ(i.raw,t,n),...Ou(l,t,n)]}function z6(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=Fu(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!Iw(c)){r.push(c);continue}const f=String(c.raw??Fu(c)??""),p=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(p===-1){r.push(c);continue}let h=1,m=-1;for(let V=a+1;V<e.length;V++){const U=e[V];if(Iw(U)){h++;continue}if(nQ(U)&&(h--,h===0)){m=V;break}}const _=$y(t,"details",p),k=m===-1&&_?.closed===!0,g=k?(()=>{const V=Ly(f,"details");return V!==-1?f.slice(0,V):f})():f,[v]=z6(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,p+f.length),y=uQ(g,n,W6(s,o)),A=m===-1?"</details>":String(e[m].raw??Fu(e[m])??"</details>"),L=k||m!==-1&&_?.closed===!0,$=A.replace(/[\t\r\n ]+$/,""),x=L?(()=>{const V=(_?.raw??"").lastIndexOf($);return V===-1?t.length:p+V})():t.length,E=Un(f),N=k&&E!==-1?p+E+1:p+f.length,F=t.slice(N,x===-1?t.length:x),S=n.parse(F,{__markstreamFinal:o}),T=n.renderer.render(S,n.options,{__markstreamFinal:o}),R=x+$.length,O=L?Math.max(x+A.length,tQ(t,R)):t.length,D=L?t.slice(x,O):A,W=L?t.slice(p,O):t.slice(p),z=k&&E!==-1?f.slice(0,E+1):f;if(r.push({...c,tag:"details",attrs:Yp(f.slice(0,E+1)),raw:W,content:`${z}${T}${D}`,children:[...y,...v],loading:!o&&!L}),l=L?O:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function dQ(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=Fu(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=$y(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),p=JZ(u.raw,c,u.closed),h=!t&&!u.closed,m=d!==p||f!==u.raw||!!r.loading!==h,_=Un(u.raw),k=_===-1?"":u.raw.slice(0,_+1),g=k?Yp(k):[];if(r.content=p,r.raw=u.raw,r.loading=h,r.attrs=g.length?g:void 0,!m)continue;let v=XZ(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&QZ(s[y],c)){s.splice(y,1);continue}const A=Fu(s[y]);if(!A)break;const L=u.raw.indexOf(A,v);if(L===-1){if(eQ(n,u.end,A))break;s.splice(y,1);continue}v=L+A.length,s.splice(y,1)}}return s}function fQ(e){const t=l=>l===" "||l===" "||l===`
233
+ `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const _=m.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=m=>{const _=m.charCodeAt(0);return _>=48&&_<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",p=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",h=p;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(!p(l[a]))return!1;for(a++;a<l.length&&h(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let A=v;for(;A<g.length&&g[A]===y;)A++;const L=A-v;return L<3?null:{markerChar:y,markerLen:L,rest:g.slice(A)}},h=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=p(g);if(v)return v;const y=h(g);return y==null?null:p(y)};let _=0;const k=l.split(/\r?\n/);for(const g of k){const v=_,y=_+g.length;if(a<v)break;const A=m(g);if(A){const L=A.markerChar,$=A.markerLen;c?L===u&&$>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=$)}if(a<=y)break;_=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
234
+ `||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]===`
235
+ `||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function hQ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=h=>h===" "||h===" ",o=h=>{const m=h.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||h==="_"||h==="-"||h===":"},i=h=>{if(!h)return!1;if(h[0]===" ")return!0;let m=0;for(let _=0;_<h.length;_++){const k=h[_];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=h=>{let m=!1,_=!1;for(let k=0;k<h.length;k++){const g=h[k];if(g==="\\"){k++;continue}if(!_&&g==="'"){m=!m;continue}if(!m&&g==='"'){_=!_;continue}if(!m&&!_&&g===">")return k}return-1},l=h=>{let m=0;for(;m<h.length&&s(h[m]);)m++;const _=h[m];if(_!=="`"&&_!=="~")return null;let k=m;for(;k<h.length&&h[k]===_;)k++;const g=k-m;return g<3?null:{markerChar:_,markerLen:g,rest:h.slice(k)}},a=(h,m)=>{if(i(h))return-1;const _=h.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let k=!1,g=0;for(;g<h.length;){const v=h[g];if(v!=="<"){s(v)||(k=!0),g++;continue}const y=r(h.slice(g));if(y===-1){k=!0,g++;continue}const A=h.slice(g,g+y+1);let L=1;for(;L<A.length&&s(A[L]);)L++;if(L>=A.length){k=!0,g++;continue}const $=A[L];if($==="!"||$==="?"){k=!0,g+=y+1;continue}if($==="/"){k=!0,g+=y+1;continue}const x=L;for(;L<A.length&&o(A[L]);)L++;if(L===x){k=!0,g++;continue}const E=A.slice(x,L).toLowerCase(),N=A[L];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){k=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),S=/\/\s*>$/.test(A),T=F.test(h.slice(g+y+1)),R=F.test(e.slice(m+g+y+1)),O=/[\r\n]/.test(e.slice(m+g+y+1));if(k&&n.has(E)&&!S&&!T&&(R||O))return g;k=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",p=0;for(;p<e.length;){const h=e.indexOf(`
236
+ `,p),m=h!==-1,_=m&&h>p&&e[h-1]==="\r",k=m?_?h-1:h:e.length,g=e.slice(p,k),v=m?_?`\r
237
+ `:`
238
+ `:"",y=l(g);let A=g;if(!c&&!y){const L=a(g,p);if(L!==-1){const $=v||`
239
+ `;A=`${g.slice(0,L).replace(/[ \t]+$/,"")}${$}${$}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=A,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)),p=m?h+1:e.length}return f}function pQ(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,p=!1;for(let h=0;h<d.length;h++){const m=d[h];if(m==="\\"){h++;continue}if(!p&&m==="'"){f=!f;continue}if(!f&&m==='"'){p=!p;continue}if(!f&&!p&&m===">")return h}return-1},l=(d,f,p)=>{const h=p.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let _=m+1;for(;_<d.length&&s(d[_]);)_++;if(_>=d.length||d[_]!=="/"){m=d.indexOf("<",m+1);continue}for(_++;_<d.length&&s(d[_]);)_++;if(_+h.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<h.length;v++){const y=d[_+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==h[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=_+h.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 p=f;for(;f<d.length&&o(d[f]);)f++;if(f===p)return d;const h=d.slice(p,f).toLowerCase();if(!n.has(h))return d;const m=r(d.slice(f));if(m===-1)return d;const _=f+m;if(l(d,_+1,h))return d;const k=i(d.slice(_+1));return k?`${d.slice(0,_+1)}
240
+ ${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
241
+ `,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",p=f?d-1:d,h=e.slice(u,p);c+=a(h),c+=f?`\r
242
+ `:`
243
+ `,u=d+1}return c}function mQ(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 p=0,h=!1,m=0;for(;p<f.length;){for(;p<f.length&&s(f[p]);)p++;if(p>=f.length||f[p]!==">")break;for(h=!0,p++;p<f.length&&s(f[p]);)p++;m=p}return h?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let p=0;for(;p<f.length&&s(f[p]);)p++;const h=f[p];if(h!=="`"&&h!=="~")return null;let m=p;for(;m<f.length&&f[m]===h;)m++;const _=m-p;return _<3?null:{markerChar:h,markerLen:_,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
244
+ `,d),p=f!==-1,h=p&&f>d&&e[f-1]==="\r",m=p?h?f-1:f:e.length,_=e.slice(d,m),k=p?h?`\r
245
+ `:`
246
+ `:"",g=o(_),v=g?.prefix??"",y=g?.content??_,A=i(y);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let L=y;if(!l&&L.includes("</"))for(const $ of r)L=L.replace($,(x,E,N,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return x;const S=F.slice(0,N).replace(/^[\t ]+/,"");if(S.length>0){const T=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!T||!R||T!==R)return x}return`${E}
247
+
248
+ `});if(v){const $=v+L.split(`
249
+ `).join(`
250
+ ${v}`);u+=$}else u+=L;u+=k,d=p?f+1:e.length}return u}function gQ(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 T=0;for(let R=0;R<S.length;R++){const O=S[R];if(O===" "){if(T++,T>=4)return!0;continue}if(O===" ")return!0;break}return!1},i=S=>{const T=S.charCodeAt(0);return T>=65&&T<=90||T>=97&&T<=122||T>=48&&T<=57||S==="_"||S==="-"||S===":"},r=S=>{let T=0;for(;T<S.length&&s(S[T]);)T++;return S.slice(T)},l=S=>{let T=0,R=!1,O=0;for(;T<S.length;){for(;T<S.length&&s(S[T]);)T++;if(T>=S.length||S[T]!==">")break;for(R=!0,T++;T<S.length&&s(S[T]);)T++;O=T}if(!R)return null;const D=S.slice(0,O);return{prefix:D,key:D.replace(/[ \t]+$/,""),content:S.slice(O)}},a=S=>r(S).startsWith("<"),c=S=>{for(let T=0;T<S.length;T++){const R=S[T];if(R!==" "&&R!==" ")return!1}return!0},u=S=>{if(o(S))return"";const T=r(S);if(!T.startsWith("<"))return"";let R=1;for(;R<T.length&&s(T[R]);)R++;if(R>=T.length||T[R]==="/"||T[R]==="!"||T[R]==="?")return"";const O=R;for(;R<T.length&&i(T[R]);)R++;if(R===O)return"";const D=T.slice(O,R).toLowerCase();if(!n.has(D))return"";const W=T[R];return W&&W!==" "&&W!==" "&&W!==">"&&W!=="/"?"":D},d=S=>{if(o(S))return null;const T=r(S);if(!T.startsWith("<"))return null;let R=1;for(;R<T.length&&s(T[R]);)R++;if(R>=T.length)return null;const O=T[R]==="/";if(O)for(R++;R<T.length&&s(T[R]);)R++;const D=T[R];if(!D||D==="!"||D==="?")return null;const W=R;for(;R<T.length&&i(T[R]);)R++;if(R===W)return null;const z=T.slice(W,R).toLowerCase();if(!n.has(z))return null;const V=T[R];if(V&&V!==" "&&V!==" "&&V!==">"&&V!=="/")return null;if(O)return{type:"close",name:z};if(/\/\s*>\s*$/.test(T))return{type:"open",name:z,complete:!0};const U=T.indexOf(">",R);if(U!==-1){const re=T.slice(U+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(re))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},f=S=>{if(o(S))return null;const T=r(S).replace(/[ \t]+$/,"");if(!T.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(T))return null;const R=T.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const O=T.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!O?.[1]||!O[2])return null;const D=O[1].toLowerCase();return D===O[2].toLowerCase()?D:null};let p=!1,h="",m=0;const _=S=>{let T=0;for(;T<S.length&&s(S[T]);)T++;const R=S[T];if(R!=="`"&&R!=="~")return null;let O=T;for(;O<S.length&&S[O]===R;)O++;const D=O-T;return D<3?null:{markerChar:R,markerLen:D,rest:S.slice(O)}},k=S=>_(S),g=S=>{const T=r(S);return T?o(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(T):!1},v=(S,T,R)=>{let O=S,D=0;for(;O<e.length;){const W=e.indexOf(`
251
+ `,O),z=W!==-1,V=z&&W>O&&e[W-1]==="\r",U=z?V?W-1:W:e.length,re=e.slice(O,U),ae=l(re),te=ae?.key??"";if(D>0&&T&&te!==T)break;const Z=ae?.content??re,ne=d(Z);if(ne?.name===R){if(ne.type==="open")ne.complete||D++;else if(D>0&&(D--,D===0))return!1}else if(D>0&&(c(Z)||g(Z)))return!0;if(z)O=W+1;else break}return!1};let y="",A=0,L=!0,$=!1,x=!1,E=`
252
+ `;const N=[];let F="";for(;A<e.length;){const S=e.indexOf(`
253
+ `,A),T=S!==-1,R=T&&S>A&&e[S-1]==="\r",O=T?R?S-1:S:e.length,D=e.slice(A,O),W=T?R?`\r
254
+ `:`
255
+ `:"",z=l(D),V=z?.key??"",U=z?.content??D,re=k(U);re&&(p?re.markerChar===h&&re.markerLen>=m&&/^\s*$/.test(re.rest)&&(p=!1,h="",m=0):(p=!0,h=re.markerChar,m=re.markerLen));const ae=N.length>0;if(!p&&!ae){const Z=u(U),ne=!!Z&&!L&&$&&x&&v(A,V,Z);Z&&!L&&(!$||ne)&&(V&&F&&V===F?y+=`${V}${E}`:V||(y+=E))}if(y+=D,y+=W,W&&(E=W),!p){const Z=d(U);if(Z){if(Z.type==="open")Z.complete||N.push(Z.name);else for(let ne=N.length-1;ne>=0;ne--)if(N[ne]===Z.name){N.length=ne;break}}}const te=c(U);L=te,$=!te&&a(U),x=!te&&!!f(U),F=V,A=T?S+1:e.length}return y}function U6(e,t,n={}){const s=D6(n),o=s?Mc():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(BZ(t,n)&&(t.stream.reset(),DZ(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,_=>_.startsWith(`
256
+ `)?`
257
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,_=>_.startsWith(`
258
+ `)?`
259
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,_=>_.startsWith(`
260
+ `)?`
261
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
262
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,_=>_.startsWith(`
263
+ `)?`
264
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(_,k,g)=>`${k}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,_=>_.startsWith(`
265
+ `)?`
266
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
267
+ `))),n.customHtmlTags?.length&&r.includes("<")){const _=Fc(n.customHtmlTags);if(_.length&&(r=hQ(r,_),r=pQ(r,_),r=gQ(r,_),r=mQ(r,_),r.includes("</")))for(const k of _){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${k}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=fQ(r));const l=ZZ(r);if(l){const _=n.preTransformTokens,k=n.postTransformTokens;if(H6(t,n)||typeof _=="function"||typeof k=="function"){const g=Mw(t,r,{__markstreamFinal:i},n),v=typeof _=="function"&&_(g)||g;typeof k=="function"&&k(v)}return t0(l,s,o)}const a=Mw(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return t0([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,p=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),h={...n,validateLink:p,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=Sw(d,h,s);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const k=_[0],g=k?.type;k&&typeof g=="string"?m=Sw(_,void 0,s):m=_}}if(m=dQ(m,i,r),m=z6(m,r,t,n,i)[0],m=lQ(m,t,n,i),i){const _=new WeakSet,k=g=>{if(!g||typeof g!="object"||_.has(g))return;if(_.add(g),Array.isArray(g)){for(const y of g)k(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))k(y)};k(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),t0(m,s,o)}function $w(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=xl(t);let o=0;for(;o<e.length;){const i=Ny(e,o,s.options(),Ty);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=$Z(e,o,s.options(l)),c=Tw(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=Oc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=Rc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(IZ()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=jn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=Tw(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const vQ=new Set([...Ad,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),yQ=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),Lw=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function Fw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kQ(e){return typeof e=="string"?e:e==null?"":String(e)}function j6(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Qr(e){return kQ(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function q6(e){return Qr(e).replace(/`/g,"&#96;")}function Jp(e){return String(e??"").trim().toLowerCase()}function Fy(e,t="safe"){const n=Jp(e);return n?t==="escape"?!0:t==="trusted"?Ad.has(n):!yQ.has(n):!1}function V6(e,t="safe"){const n=Jp(e);return n?t==="escape"?!0:t==="trusted"?Ad.has(n):vQ.has(n):!1}function Ow(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${q6(s)}"`).join("")}function bQ(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||ea(o,{tagName:t,attrName:"srcset"})})}function K6(e,t,n,s){return sK.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?bQ(t,s):!!(oK.has(e)&&t&&ea(t,{tagName:s,attrName:e}))}function jl(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function G6(e,t,n,s=!1){if(t!=="safe"||Jp(n)!=="a")return e;const o=jl(e,"href");if(s&&(!o||!e[o])){const a=jl(e,"target"),c=jl(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=jl(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=jl(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function Rw(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!j6(r)||K6(l,i,t,n)||(s[r]=i)}return G6(s,t,n,!!jl(e,"href"))}function Y6(e,t){const n=e.toLowerCase();return t6.has(n)?!1:Fw(t,n)||Fw(t,e)}function Oy(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!j6(r)||K6(l,i,t,n)||(s[r]=i)}return G6(s,t,n,!!jl(e,"href"))}function Yh(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function Pg(e,t="safe",n){const s=Oy(Yh(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function xQ(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function _Q(e){const t={};for(const[n,s]of Object.entries(e))t[n]=xQ(s,n);return t}function Bw(e){return e.trim().length>0}function wQ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);Bw(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);Bw(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||ma.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function SQ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const f=e.indexOf("]]>",s);if(f!==-1){t.push({type:"text",content:e.slice(s,f+3)}),n=f+3;continue}break}if(e.startsWith("!",s+1)){const f=e.indexOf(">",s);if(f!==-1){n=f+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||ma.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function CQ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${Qr(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${Qr(s)}`:` ${Qr(s)}="${q6(o)}"`).join("");return e.type==="self_closing"?`&lt;${Qr(t)}${n} /&gt;`:`&lt;${Qr(t)}${n}&gt;`}function AQ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;Lw.lastIndex=0;let n;for(;(n=Lw.exec(e))!==null;)if(Y6(n[1],t))return!0;return!1}function yc(e,t="safe"){if(!e)return"";if(t==="escape")return Qr(e);const n=SQ(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(Qr(r.content??""));continue}const l=Jp(r.tagName);if(!l)continue;if(V6(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&Fy(l,t)){o.push(CQ(r));continue}if(r.type==="self_closing"){o.push(`<${l}${Ow(Rw(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${Ow(Rw(r.attrs??{},t,l))}>`),ma.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const MQ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],Dw="http://www.w3.org/2000/svg",EQ=new Set(["script","style","iframe","object","embed","link","meta"]),TQ=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),NQ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),IQ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),$Q=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function LQ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function FQ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function OQ(e){const t=e.nodeName.toLowerCase();return t==="use"?LQ(e):t==="image"?FQ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():$Q.has(t)}function RQ(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function BQ(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?ea(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ea(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ea(i,{tagName:s,attrName:o})?"":i:""}function DQ(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function Z6(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function Q6(e){const t=Z6(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=DQ(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function Pw(e){const t=Z6(e);return MQ.some(n=>n.test(t))||Q6(t)}function PQ(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Ef(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function X6(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!EQ.has(s)){if(s==="br"){t.push(`
268
+ `);return}for(const o of Array.from(n.childNodes))X6(o,t)}}function HQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];X6(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Ef(t.getAttribute("width")),i=Ef(t.getAttribute("height")),r=Ef(t.getAttribute("x")),l=Ef(t.getAttribute("y")),a=e.ownerDocument.createElementNS(Dw,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,f]of s.entries()){const p=e.ownerDocument.createElementNS(Dw,"tspan");p.setAttribute("x",String(r+o/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=f,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function WQ(e){HQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!TQ.has(s)){n.remove();continue}if(s==="style"&&Pw(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&Pw(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(NQ.has(r)&&i.value){const l=BQ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(IQ.has(r)&&i.value&&Q6(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=RQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}PQ(n)}}function qbe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return WQ(n),zQ(n)?null:n}catch{return null}}function zQ(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){OQ(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const Hw=[];function s0(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function UQ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function jQ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function Ww(e=`editor-${Date.now()}`,t={}){const n=lY(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;o=p=>f[p]??s[p]??p}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const p=f;if(Array.isArray(p)){const[h,...m]=p;typeof h=="function"&&n.use(h,...m)}else typeof p=="function"&&n.use(p)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(p){console.error("[getMarkdown] apply function threw an error",p)}if(Hw.length)for(const f of Hw)if(Array.isArray(f)){const[p,...h]=f;typeof p=="function"&&n.use(p,...h)}else typeof f=="function"&&n.use(f);n.use(Cz),n.use(Ez),n.use(_z);const i=zz,r=i.default??i;n.use(r),n.use(xz),n.use(bz),n.core.ruler.after("block","mark_fence_closed",f=>{const p=f,h=p.src,m=!!p.env?.__markstreamFinal,_=h.split(/\r?\n/);for(const k of p.tokens){if(k.type!=="fence"||!k.map||!k.markup)continue;const g=k.map[0],v=k.map[1],y=k.markup,A=y[0],L=y.length,$=_[Math.max(0,v-1)]??"";let x=0;for(;x<$.length&&($[x]===" "||$[x]===" ");)x++;let E=0;for(;x+E<$.length&&$[x+E]===A;)E++;let N=x+E;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;const F=m?!0:v>g+1&&E>=L&&N===$.length,S=k;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,p)=>{const h=f,m=h.pos;if(h.src[m]!=="~")return!1;const _=h.src[m-1],k=h.src[m+1];if(/\d/.test(_)&&/\d/.test(k)){if(!p){const g=h.push("text","",0);g.content="~"}return h.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,p)=>{const h=f[p],m=String(h.info??"").trim(),_=String(h.content??""),k=btoa(unescape(encodeURIComponent(_))),g=UQ(m),v=s0(g),y=jQ(`editor-${e}-${p}-${g}`),A=s0(o("common.copy"));return`<div class="code-block" data-code="${k}" data-lang="${v}" id="${y}">
269
+ <div class="code-header">
270
+ <span class="code-lang">${s0(g.toUpperCase())}</span>
271
+ <button class="copy-button" data-code="${k}">${A}</button>
272
+ </div>
273
+ <div class="code-editor"></div>
274
+ </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const p=c.exec(f);if(!p)return f!=="["&&!/^\[\d+$/.test(f);const h=String(p[1]??"");return f.slice(p[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},d=(f,p)=>{const h=f;if(h.src[h.pos]!=="[")return!1;const m=a.exec(h.src.slice(h.pos));if(!m)return!1;const _=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const k=h.src.slice(h.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))return!1;if(!p){const g=m[1],v=h.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return h.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,p)=>{const m=String(f[p].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function qQ({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function J6({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:qQ({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const zw=new WeakMap;function VQ(e){let t=zw.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},zw.set(e,t)),t}function Uw(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function Ry(e){return!!(e.themes?.length||e.langs?.length)}function e5(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function KQ(e,t){return!t?.length||e.registeredAllLangs?!0:e5(e.registeredLangs,t)}function o0(e,t){return Ry(t)&&e5(e.registeredThemes,t.themes)&&KQ(e,t.langs)}function GQ(e,t){if(!Ry(t))return t;const n=Uw(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:Uw(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const YQ={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function ZQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function t5(e){const t=ZQ(e);return YQ[t]??t}function n5(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>t5(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function s5(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function QQ(e){return s5(e)?.join("\0")??""}function o5(e,t){const n=s5(e),s=n5(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Zh(e,t){return`${QQ(e)}\0\0${n5(t)?.join("\0")??""}`}function Vbe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=o5(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Zh(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Kbe(e,t={},n){if(!e)return"ready";const s=o5(t.themes,t.langs),o=Zh(s.themes,s.langs),i=n&&n===o?n:o,r=VQ(e);if(r.completed.has(i))return"ready";if(o0(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||o0(r,s))return r.completed.add(i),"ready";const c=GQ(r,s),u=Zh(c.themes,c.langs);return r.completed.has(u)||o0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(Ry(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function Pa(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function jw(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var XQ=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,p=this.pendingChars<=0;if(this.source+=d,p){const h=qw();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=qw();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),p=Math.min(100,Math.max(0,d-this.lastTick));if(p<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const h=this.pendingChars,m=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=nX(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=tX(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Pa(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Pa(s,1e3,1)),this.normalizedTargetLatencyMs=Pa(o,900,1),this.normalizedCatchUpLatencyMs=Pa(i,350,1),this.normalizedCatchUpThreshold=jw(r,600),this.normalizedStartDelayMs=jw(a,80),this.maxCommitFps=Math.trunc(Pa(l,30,1)),this.maxCharsPerCommit=Math.trunc(Pa(c,80,1)),this.flushOnFinish=u,this.segmenter=eX(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function JQ(e={},t){const n=new XQ(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function eX(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function tX(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function qw(){return typeof performance<"u"?performance.now():Date.now()}function nX(e,t,n){return Math.min(n,Math.max(t,e))}var sX=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Hg=Symbol.for("markstream-vue:node-lifecycle"),Vw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',Kw='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',oX={id:"material",core:{"":Kw,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:Kw,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:Vw,csharp:Vw,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>eo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Wg=new Map;let Gw="material";const sc=new Map,Yw=new Map;let zg=null;function iX(e){Wg.set(e.id,e)}function rX(e){return sX(this,null,function*(){var t,n,s;if(sc.has(e.id))return(t=sc.get(e.id))!=null?t:null;let o=Yw.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(sc.set(e.id,i),zg?.(),i)).catch(()=>(sc.set(e.id,null),null)),Yw.set(e.id,o)),o})}const lX=fa(0);zg=()=>{lX.value++},iX(oX);const aX={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function By(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=aX[n])!=null?t:n}function Gbe(e){const t=By(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Ybe(e){return(function(s){const o=Wg.get(Gw);if(!o)return;const i=o.core[s];if(i)return i;const r=sc.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!sc.has(o.id)&&rX(o)})(By(e))||((n=(t=Wg.get(Gw))==null?void 0:t.fallback)!=null?n:"");var t,n}const Zbe={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let i5=!1;function Qbe(){return i5}function Xbe(){i5=!0}var em=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Lo=null,Gf=!1,tm=Py;function nm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Dy(){try{const e=globalThis;return nm(e?.katex)}catch{return null}}function Py(){return em(null,null,function*(){const e=Dy();if(e)return e;const t=yield eo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield eo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return nm(t)})}function cX(e){tm=e,Lo=null,Gf=!1}function uX(e){cX(Py)}function r5(){return typeof tm=="function"}function Jbe(){var e;const t=tm;if(!t||t===Py)return null;if(Lo)return Lo;const n=Dy();if(n)return Lo=n,Lo;try{const s=t();return s&&typeof s?.then!="function"?(Lo=(e=nm(s))!=null?e:s,Lo):null}catch{return null}}function Hy(){return em(this,null,function*(){var e;const t=Dy();if(t)return Lo=t,Lo;if(Lo)return Lo;if(Gf)return null;const n=tm;if(!n)return Gf=!0,null;try{const s=yield n();if(s)return Lo=(e=nm(s))!=null?e:s,Lo}catch{}return Gf=!0,null})}function l5(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let el=null,Gr=null;const si=new Map,pr=new Map;let Qh=5;const Gl=new Set;function dd(){if(si.size<Qh&&Gl.size){const e=Array.from(Gl);Gl.clear();for(const t of e)try{t()}catch{}}}function dX(e){el=e,Gr=null,el.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=si.get(n);if(i)if(si.delete(n),clearTimeout(i.timeoutId),dd(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(pr.set(a,s),pr.size>200){const c=pr.keys().next().value;pr.delete(c)}}i.resolve(s)}},el.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of si.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));si.clear(),dd()}}function fX(){var e;el&&((e=el.terminate)==null||e.call(el)),el=null,Gr=null}function hX(e,t=!0,n=2e3,s){return em(this,null,function*(){performance.now();const o=l5(e);if(!r5()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Gr)return Promise.reject(Gr);const i=`${t?"d":"i"}:${o}`,r=pr.get(i);if(r)return Promise.resolve(r);const l=el||(Gr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Gr.name="WorkerInitError",Gr.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Gr);if(si.size>=Qh){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=si.size,a.max=Qh,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const h=new Error("Aborted");return h.name="AbortError",void c(h)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{si.delete(u);const h=new Error("Worker render timed out");h.name="WorkerTimeout",h.code="WORKER_TIMEOUT",c(h),dd()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),si.has(u)&&si.delete(u);const h=new Error("Aborted");h.name="AbortError",c(h),dd()},{once:!0});const f=a,p=c;si.set(u,{resolve:h=>{f(h)},reject:h=>{p(h)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function exe(e,t=!0,n){const s=`${t?"d":"i"}:${l5(e)}`;if(pr.set(s,n),pr.size>200){const o=pr.keys().next().value;pr.delete(o)}}const pX="WORKER_BUSY";function mX(e=2e3,t){return si.size<Qh?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Gl.delete(r),n())};if(Gl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Gl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>dd()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Gl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const cu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function txe(e){return em(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!r5()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:cu.timeout,c=(i=s.waitTimeout)!=null?i:cu.waitTimeout,u=(r=s.backoffMs)!=null?r:cu.backoffMs,d=(l=s.maxRetries)!=null?l:cu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):cu.maxRetries,p=s.signal;let h=0;for(;;){if(p?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield hX(t,n,a,p)}catch(m){if(m?.code!==pX||h>=f)throw m;if(h++,yield mX(c,p).catch(()=>{}),p?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*h)))}}})}function oc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function gX(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Ug(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=gX(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function jg(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function a5(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function qg(e,t=360,n=500){return a5(e,t,n)}function Vg(e,t=360,n=500){return a5(e,t,n)}var vX=Object.defineProperty,yX=Object.defineProperties,kX=Object.getOwnPropertyDescriptors,Zw=Object.getOwnPropertySymbols,bX=Object.prototype.hasOwnProperty,xX=Object.prototype.propertyIsEnumerable,Qw=(e,t,n)=>t in e?vX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c5=(e,t)=>{for(var n in t||(t={}))bX.call(t,n)&&Qw(e,n,t[n]);if(Zw)for(var n of Zw(t))xX.call(t,n)&&Qw(e,n,t[n]);return e},Wy=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const zy=()=>eo(()=>import("./mermaid.core-D1ZdIpxL.js").then(e=>e.bn),[]);let nr=null,Uy=zy;function _X(e){Uy=e,nr=null}function wX(e){_X(zy)}function SX(){return typeof Uy=="function"}function Xw(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=c5({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},yX(n,kX(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function Jw(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=c5({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function nxe(){return Wy(this,null,function*(){if(nr)return nr;const e=(function(){try{const s=globalThis;return Xw(s?.mermaid)}catch{return null}})();if(e)return nr=e,Jw(nr),nr;const t=Uy;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===zy?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(nr=Xw(n),Jw(nr),nr):null})}let Xs=null,Yr=null;const Ns=new Map;let eS=5,tS=!1;const CX="WORKER_BUSY",AX="MERMAID_DISABLED";function MX(e){Xs=e,Yr=null;const t=e;Xs.onmessage=n=>{if(Xs!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Ns.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Xs.onerror=n=>{var s,o;if(Xs===t)if(Ns.size!==0){try{tS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Ns.entries())r.reject(new Error(`Worker error: ${n.message}`));Ns.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Xs.onmessageerror=n=>{var s,o;if(Xs===t)if(Ns.size!==0){try{tS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Ns.entries())r.reject(new Error("Worker messageerror"));Ns.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function EX(){var e;if(Xs)try{for(const[t,n]of Ns.entries())n.reject(new Error("Worker cleared"));Ns.clear(),(e=Xs.terminate)==null||e.call(Xs)}catch{}Xs=null,Yr=null}function u5(e,t,n=1400){if(!SX()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=AX,Promise.reject(o)}if(Yr)return Promise.reject(Yr);const s=Xs||(Yr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Yr.name="WorkerInitError",Yr.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Yr);if(Ns.size>=eS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=CX,o.inFlight=Ns.size,o.max=eS,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Ns.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Ns.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Ns.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=Ns.get(r);f&&f.reject(d)},n)})}function sxe(e,t,n=1400){return Wy(this,null,function*(){try{return yield u5("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function oxe(e,t,n=1400){return Wy(this,null,function*(){try{return yield u5("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function ixe(){if(Xs)try{for(const[e,t]of Ns.entries())t.reject(new Error("Worker terminated"));Ns.clear(),Xs.terminate()}finally{Xs=null}}var TX=Object.defineProperty,NX=Object.defineProperties,IX=Object.getOwnPropertyDescriptors,nS=Object.getOwnPropertySymbols,$X=Object.prototype.hasOwnProperty,LX=Object.prototype.propertyIsEnumerable,sS=(e,t,n)=>t in e?TX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))$X.call(t,n)&&sS(e,n,t[n]);if(nS)for(var n of nS(t))LX.call(t,n)&&sS(e,n,t[n]);return e},Bt=(e,t)=>NX(e,IX(t)),zn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const FX="__global__",i0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Kg=(()=>{const e=globalThis;if(e[i0])return e[i0];const t={scopedCustomComponents:{},revision:fa(0)};return e[i0]=t,t})(),oS=Kg.revision,OX=Symbol("markstreamCustomComponents"),RX=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function Td(e){return RX.has(String(e).trim().toLowerCase())}function BX(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function r0(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([di(n),di(BX(n))]))!o||Td(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function us(e){const t=Ut(OX,null);return P(()=>{var n;return oS.value,(function(s,o={}){return oS.value,it(it(it({},r0(Kg.scopedCustomComponents[FX]||{})),r0(o)),r0((function(i){return i&&Kg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const DX=["aria-label"],PX={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},HX={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},hn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Do=hn(qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),I("svg",HX,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),I("svg",PX,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,DX))}),[["__scopeId","data-v-be21ab83"]]);Do.install=e=>{e.component(Do.__name,Do)};const WX={class:"emoji-node"},yo=hn(qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("span",WX,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);yo.install=e=>{e.component(yo.__name,yo)};const zX=["id"],UX=["title"],Po=hn(qe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(b(),I("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,UX)],8,zX))}}),[["__scopeId","data-v-c1463a29"]]);Po.install=e=>{e.component(Po.__name,Po)};const d5=(()=>{try{return!1}catch{}return!1})();function l0(e){d5&&console.warn(e)}function iS(e,t="safe",n){return Oy(e,t,n)}function f5(e){return _Q(e)}function a0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function jy(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Pg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),a0(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),a0(r.value)]):Object.entries(o).map(([r,l])=>[r,a0(l)]):null,t,n);var o;if(!s)return;const i=f5(Yh(s));return Object.keys(i).length>0?i:void 0}function rS(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function uu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function c0(e,t,n,s,o,i,r=!1){const l=(function(d,f){return Y6(d,f)})(e,s);if(Ad.has(e.toLowerCase())||!l&&V6(e,i))return null;if(!l&&Fy(e,i))return r?[rS(e,t,!0)]:[rS(e,t),...n,`</${e}>`];const a=Oy(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=f5(a);return dn(d,Bt(it({},f),{key:u}),n.length>0?n:void 0)}return dn(e,Bt(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function h5(e,t){return AQ(e,t)}function Xh(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=c0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);uu(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let p=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){p=h;break}if(p!==-1)for(;c.length>p;){const h=c.pop(),m=c0(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?uu(c[c.length-1].children,m):uu(u,m),h.tagName.toLowerCase()!==f&&c.length>p&&l0(`Auto-closing unclosed tag: <${h.tagName}>`)}else l0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=c0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?uu(c[c.length-1].children,f):uu(u,f),l0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(wQ(e),t,n)}catch(o){return s=o,d5&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const jX=["innerHTML"],Ho=hn(qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=P(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=us(()=>t.customId),i=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=P(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:yc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Xh(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!h5(l,o.value))return{mode:"html",content:yc(l,s.value)};const a=Xh(l,o.value,s.value);return a===null?{mode:"html",content:yc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),I("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ie(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(b(),I("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(b(),I("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,jX))}}),[["__scopeId","data-v-d17f12b0"]]);Ho.install=e=>{e.component(Ho.__name,Ho)};const qX={class:"inline-code"},VX={key:0},qs=hn(qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=bd(),s=Ut("markstreamFade",void 0),o=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=P(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=P(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=P(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=P(()=>!l.value),u=P(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Q(t.node.code),f=Q("");let p=i?.value;const h=Q(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}Ke([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const L=String(g??""),$=u.value,x=A!==p;p=A;const E=J6({nextContent:L,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(h.value+=1),$&&o?.set($,L)},{immediate:!0}),Ke(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=P(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(b(),I("code",qX,[c.value?(b(),I(Be,{key:0},[Ge(B(a.value),1)],64)):(b(),I(Be,{key:1},[d.value?(b(),I("span",VX,B(d.value),1)):le("",!0),f.value?(b(),I("span",{key:1,class:De(["inline-code-stream-delta",[k.value]]),onAnimationend:_},B(f.value),35)):le("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);qs.install=e=>{e.component(qs.__name,qs)};const Gg=Q(!1),lS=Q(""),aS=Q("top"),Ru=Q(null),Bu=Q(null),Yg=Q(null),Zg=Q(null),cS=Q(null);let Yf=null,Zf=null,Qg=0;function p5(){Yf&&(clearTimeout(Yf),Yf=null),Zf&&(clearTimeout(Zf),Zf=null)}let Tf=!1,Nf=null,uS=!1;function KX(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Qg;p5();const l=()=>zn(null,null,function*(){var a,c;if(yield(function(){return zn(this,null,function*(){if(!Tf&&!uS&&typeof document<"u"){Nf!=null||(Nf=zn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([eo(()=>import("./vue.runtime.esm-bundler-Dj6KWBND.js"),[]),eo(()=>import("./Tooltip-B3YtzPNZ.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:Gg.value,"anchor-el":Ru.value,content:lS.value,placement:aS.value,id:Bu.value,originX:Yg.value,originY:Zg.value,isDark:(h=cS.value)!=null?h:void 0})}}).mount(p),Tf=!0}));try{yield Nf}catch(u){Tf=!1,Nf=null,uS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Tf&&r===Qg){Bu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ru.value=e,lS.value=t,aS.value=n,Yg.value=(a=o?.x)!=null?a:null,Zg.value=(c=o?.y)!=null?c:null,cS.value=typeof i=="boolean"?i:null,Gg.value=!0;try{e.setAttribute("aria-describedby",Bu.value)}catch{}}});s?l():Yf=setTimeout(l,80)}function GX(e=!1){Qg+=1,p5();const t=()=>{if(Ru.value&&Bu.value)try{Ru.value.removeAttribute("aria-describedby")}catch{}Gg.value=!1,Ru.value=null,Bu.value=null,Yg.value=null,Zg.value=null};e?t():Zf=setTimeout(t,120)}const Xg={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Jg=e=>{var t;return(t=Xg[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function dS(e){return{t(t){if(e.te&&Xg[t]&&!e.te(t))return Jg(t);const n=e.t(t);return n===t&&Xg[t]?Jg(t):n}}}function YX(){const e=(function(){var t,n;try{const s=Os(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return dS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return dS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Jg}}function ZX(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const QX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],XX={key:1,class:"image-placeholder"},JX={key:1,class:"image-node__raw-text"},eJ={key:0,class:"image-shimmer-overlay"},tJ={key:1,class:"image-node__raw-text"},nJ={key:2,class:"image-error"},il=hn(qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=Q(!1),i=Q(!1),r=Q(""),l=Q("primary"),a=Q(null),c=bd(),u=Ut(Hg,null);let d="",f=null;const p=P(()=>q_(n.node.src)),h=P(()=>q_(n.fallbackSrc)),m=P(()=>r.value),_=P(()=>!n.lazy),k=P(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=P(()=>l.value==="failed"),v=P(()=>!_.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=P(()=>ZX(n,c));function A(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=y.value){R&&pt(()=>{A(R)})}function $(){f&&(clearTimeout(f),f=null)}function x(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),$(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(L(R),E())},8e3)))}function E(){return zn(this,null,function*(){const R=d;R&&($(),d="",yield pt(),A(R),u?.markSettled(R))})}function N(){if(l.value==="primary"&&h.value&&h.value!==r.value)return l.value="fallback",r.value=h.value,o.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,s("error",r.value),L()}function F(){o.value=!0,i.value=!1,s("load",m.value),L()}function S(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,m.value])}const{t:T}=YX();return Ke([p,h,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||p.value?(r.value=p.value,void(l.value="primary")):h.value?(r.value=h.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ke([k,o,i,m,()=>n.lazy],([R,O,D,W,z])=>R&&W&&!D?O?(E(),void L()):z?(x(),void L()):void(O||D||x()):(E(),void L()),{flush:"post",immediate:!0}),es(()=>{(function(){const R=d;R&&($(),d="",u?.markSettled(R))})()}),(R,O)=>{var D,W,z,V,U;return b(),I("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(b(),I("img",{key:0,src:m.value,alt:String((W=(D=n.node.alt)!=null?D:n.node.title)!=null?W:""),title:String((V=(z=n.node.title)!=null?z:n.node.alt)!=null?V:""),class:De(["image-node__img",{"is-loading":!_.value&&!o.value,"is-loaded":_.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(U=n.node.alt)!=null?U:C(T)("image.preview"),onError:N,onLoad:F,onClick:S},null,42,QX)):le("",!0),e.node.loading&&!i.value?(b(),I("span",XX,[n.usePlaceholder?In(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[0]||(O[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),I("span",JX,B(e.node.raw),1))])):le("",!0),ie(cl,{name:"shimmer-fade"},{default:Ee(()=>[v.value&&!e.node.loading?(b(),I("span",eJ,[n.usePlaceholder?In(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[1]||(O[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),I("span",tJ,B(e.node.raw),1))])):le("",!0)]),_:3}),g.value?(b(),I("span",nJ,[In(R.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[2]||(O[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),w("span",null,B(C(T)("image.loadError")),1)],!0)])):le("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);il.install=e=>{e.component(il.__name,il)};const sJ={key:2},Ui=qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),i=P(()=>{var h;return(h=s?.value)!=null?h:"safe"}),r=P(()=>{var h,m;const _=(h=o?.value)!=null?h:{};return Bt(it({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1}),a=P(()=>t.components[String(t.node.type)]),c=P(()=>!!(a.value&&n.value[t.node.type]&&!Td(String(t.node.type)))),u=P(()=>c.value?jy(t.node,i.value):void 0),d=P(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=P(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=P(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(b(),ye($s(a.value),pn({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:Ee(()=>[d.value?(b(),ye(C(l),pn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(b(),ye(C(l),pn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),ye($s(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),I("span",sJ,B(p.value),1)):le("",!0)}}),oJ=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],iJ={key:0,translate:"no",class:"markstream-pre__diff-code"},rJ={class:"markstream-pre__diff-number","aria-hidden":"true"},lJ={class:"markstream-pre__diff-content"},aJ={class:"markstream-pre__diff-content-inner"},cJ={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},uJ=["textContent"],$o=qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=P(()=>{var S,T,R;const O=String((T=(S=t.node)==null?void 0:S.language)!=null?T:"");return String((R=String(O).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=P(()=>`language-${n.value}`),o=P(()=>{var S,T,R,O,D;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(T=t.node)==null?void 0:T.code)!=null?R:""):(function(W,z){const V=String(W??"");return z?V:V.replace(/\r\n$|\n$|\r$/,"")})((O=t.node)==null?void 0:O.code,((D=t.node)==null?void 0:D.loading)===!0)}),i=P(()=>o.value.split(/\r\n|\n|\r/)),r=P(()=>Array.from({length:Math.max(1,i.value.length)},(S,T)=>T+1)),l=P(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=P(()=>l.value&&t.diffInline===!0),c=P(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const T=`${Math.ceil(S)}px`;return{height:T,minHeight:T,maxHeight:T,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,T="context",R={}){const O=u(S);return{code:S,kind:O&&T!=="hunk"&&!R.preserveBlankKind?"context":T,empty:O}}function f(S){const T=String(S??"");return T?T.split(/\r\n|\n|\r/):[]}function p(S,T){return!u(S[T])||T<S.length-1}function h(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function _(S,T){const R=f(S),O=f(T),D=(function(ae,te){const Z=ae.length,ne=te.length;if((Z+1)*(ne+1)>15e5)return null;const ke=ne+1,Se=new Uint32Array((Z+1)*(ne+1));for(let ce=1;ce<=Z;ce++)for(let fe=1;fe<=ne;fe++){const j=ce*ke+fe;if(ae[ce-1]===te[fe-1])Se[j]=Se[(ce-1)*ke+(fe-1)]+1;else{const se=Se[(ce-1)*ke+fe],ge=Se[ce*ke+(fe-1)];Se[j]=se>=ge?se:ge}}const Ye=[];let ve=Z,Y=ne;for(;ve>0&&Y>0;)ae[ve-1]===te[Y-1]?(Ye.push({originalIndex:ve-1,modifiedIndex:Y-1}),ve--,Y--):Se[(ve-1)*ke+Y]>=Se[ve*ke+(Y-1)]?ve--:Y--;return Ye.reverse(),Ye})(R,O);if(D){const ae=[];let te=0,Z=0;for(const ne of D){for(;te<ne.originalIndex;)ae.push(Bt(it({},d(R[te],"removed",{preserveBlankKind:p(R,te)})),{key:`inline-removed-source-${te}`,number:""})),te++;for(;Z<ne.modifiedIndex;)ae.push(Bt(it({},d(O[Z],"added",{preserveBlankKind:p(O,Z)})),{key:`inline-added-source-${Z}`,number:Z+1})),Z++;ae.push(Bt(it({},d(O[ne.modifiedIndex])),{key:`inline-context-source-${ne.originalIndex}-${ne.modifiedIndex}`,number:ne.modifiedIndex+1})),te=ne.originalIndex+1,Z=ne.modifiedIndex+1}for(;te<R.length;)ae.push(Bt(it({},d(R[te],"removed",{preserveBlankKind:p(R,te)})),{key:`inline-removed-source-${te}`,number:""})),te++;for(;Z<O.length;)ae.push(Bt(it({},d(O[Z],"added",{preserveBlankKind:p(O,Z)})),{key:`inline-added-source-${Z}`,number:Z+1})),Z++;return ae}const W=[];let z=0,V=R.length-1,U=O.length-1;for(;z<=V&&z<=U&&R[z]===O[z];)W.push(Bt(it({},d(O[z])),{key:`inline-prefix-${z}`,number:z+1})),z++;const re=[];for(;V>=z&&U>=z&&R[V]===O[U];)re.unshift(Bt(it({},d(O[U])),{key:`inline-suffix-${U}`,number:U+1})),V--,U--;for(let ae=z;ae<=V;ae++)W.push(Bt(it({},d(R[ae],"removed",{preserveBlankKind:p(R,ae)})),{key:`inline-removed-source-${ae}`,number:""}));for(let ae=z;ae<=U;ae++)W.push(Bt(it({},d(O[ae],"added",{preserveBlankKind:p(O,ae)})),{key:`inline-added-source-${ae}`,number:ae+1}));return W.concat(re)}const k=P(()=>{var S,T,R,O;const D=(function(U){const re=U.some(te=>h(te)),ae=U.some(te=>m(te));return re&&ae||(function(){var te,Z,ne,ke;if(n.value==="diff")return!0;const Se=(ke=(ne=String((Z=(te=t.node)==null?void 0:te.raw)!=null?Z:"").split(/\r?\n/,1)[0])==null?void 0:ne.trim())!=null?ke:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Se)})()&&(re||ae)})(i.value),W=(function(){var U,re;return((U=t.node)==null?void 0:U.originalCode)!=null||((re=t.node)==null?void 0:re.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:D?(function(U){const re=[];let ae=1;for(const[te,Z]of U.entries())if(Z.startsWith("@@"))re.push(Bt(it({},d(Z,"hunk")),{key:`inline-hunk-${te}`,number:""}));else if(h(Z))re.push(Bt(it({},d(Z.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${te}`,number:""}));else if(m(Z))re.push(Bt(it({},d(Z.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${te}`,number:ae++}));else{const ne=Z.startsWith(" ")?Z.slice(1):Z;re.push(Bt(it({},d(ne)),{key:`inline-context-${te}`,number:ae})),ae++}return re})(i.value):_((S=t.node)==null?void 0:S.originalCode,(T=t.node)==null?void 0:T.updatedCode)}];if(!D&&W){const U=f((R=t.node)==null?void 0:R.originalCode),re=f((O=t.node)==null?void 0:O.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((ae,te)=>{const Z=re[te]===ae?"context":"removed";return Bt(it({},d(ae,Z,{preserveBlankKind:p(U,te)})),{key:`original-${te}`,number:te+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:re.map((ae,te)=>{const Z=U[te]===ae?"context":"added";return Bt(it({},d(ae,Z,{preserveBlankKind:p(re,te)})),{key:`modified-${te}`,number:te+1})})}]}const z=[],V=[];for(const U of i.value)if(U.startsWith("@@"))z.push(d(U,"hunk")),V.push(d(U,"hunk"));else if(U.startsWith("-")&&!U.startsWith("---"))z.push(d(U.slice(1),"removed",{preserveBlankKind:!0}));else if(U.startsWith("+")&&!U.startsWith("+++"))V.push(d(U.slice(1),"added",{preserveBlankKind:!0}));else{const re=U.startsWith(" ")?U.slice(1):U;z.push(d(re)),V.push(d(re))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:z.map((U,re)=>Bt(it({},U),{key:`original-${re}`,number:re+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:V.map((U,re)=>Bt(it({},U),{key:`modified-${re}`,number:re+1}))}]}),g=P(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Q(null),y=Q([]);let A=null,L=null;function $(S){const T=Number.parseFloat(String(S??""));return Number.isFinite(T)&&T>0?T:0}function x(S,T){var R;if(!S)return T;const O=S.querySelector(".markstream-pre__diff-content"),D=O?.getBoundingClientRect(),W=(R=D?.height)!=null?R:0;return Math.max(T,Math.ceil(W))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,T;A=null;const R=v.value;if(!R||!l.value)return void(y.value.length&&(y.value=[]));const O=(function(ae){const te=window.getComputedStyle(ae),Z=$(te.getPropertyValue("--markstream-pre-diff-line-height"));if(Z>0)return Z;const ne=$(te.lineHeight);return ne>0?ne:18})(R),D=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),W=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),z=Math.max(D.length,W.length),V=[];for(let ae=0;ae<z;ae++){const te=x((S=D[ae])!=null?S:null,O),Z=x((T=W[ae])!=null?T:null,O),ne=Math.max(O,te,Z);V.push({rowHeight:ne,originalHeight:te,modifiedHeight:Z})}var U,re;U=y.value,re=V,U.length===re.length&&U.every((ae,te)=>{const Z=re[te];return Z&&Math.abs(ae.rowHeight-Z.rowHeight)<=.5&&Math.abs(ae.originalHeight-Z.originalHeight)<=.5&&Math.abs(ae.modifiedHeight-Z.modifiedHeight)<=.5})||(y.value=V)})()}))}function N(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{E()}),L.observe(S))}function F(S,T){const R=y.value[S];if(!R)return;const O=T==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(O)}px`}}return Ke(v,S=>{N(S),pt(()=>E())},{flush:"post"}),Ke([l,k],()=>{N(v.value),pt(()=>E())},{flush:"post",immediate:!0}),es(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),L?.disconnect(),L=null}),(S,T)=>(b(),I("pre",{ref_key:"preRef",ref:v,style:qt(c.value),class:De([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(b(),I("code",iJ,[(b(!0),I(Be,null,nt(k.value,R=>(b(),I("span",{key:R.key,class:De(["markstream-pre__diff-pane",R.className])},[(b(!0),I(Be,null,nt(R.lines,(O,D)=>(b(),I("span",{key:O.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${O.kind}`,{"markstream-pre__diff-line--empty":O.empty}]]),style:qt(F(D,R.key))},[T[0]||(T[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",rJ,B(O.number),1),w("span",lJ,[w("span",aJ,B(O.code),1)])],6))),128))],2))),128))])):(b(),I(Be,{key:1},[t.showLineNumbers?(b(),I("span",cJ,[(b(!0),I(Be,null,nt(r.value,R=>(b(),I("span",{key:R,class:"markstream-pre__line-number"},B(R),1))),128))])):le("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:B(o.value)},null,8,uJ)],64))],14,oJ))}});$o.install=e=>{e.component($o.__name,$o)};const u0=fa(!1);let fS=null;const dJ={key:0},Zn=hn(qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(fS||(fS=Hy().then(k=>{u0.value=!!k}).catch(()=>{u0.value=!1})),ah(u0)),s=bd(),o=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=P(()=>{const k=s.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),a=P(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=P(()=>{var k;const g=(k=s["index-key"])!=null?k:s.indexKey;return g==null||g===""?"":String(g)}),u=Q(t.node.content),d=Q("");let f=r?.value;const p=Q(0);function h(){return u.value+d.value}function m(){d.value&&(u.value=h(),d.value="")}Ke([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const A=String(k??""),L=c.value,$=y!==f;f=y;const x=J6({nextContent:A,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(p.value+=1),L&&i?.set(L,A)},{immediate:!0}),Ke(a,k=>{var g;k||(g=h(),u.value=g,d.value="")});const _=P(()=>p.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(b(),I("span",{class:De([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(b(),I("span",dJ,B(u.value),1)):le("",!0),d.value?(b(),I("span",{key:1,class:De(["text-node-stream-delta",[_.value]]),onAnimationend:m},B(d.value),35)):le("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const m5=qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return dn($o,Bt(it({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),d0=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./CodeBlockNode-DI6gCVXa.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),$o}}),loadingComponent:m5,delay:0,suspensible:!1}),Ci=ki(()=>zn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return dn(Zn,Bt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Hy())return(yield eo(()=>import("./index6-Di9uDNmo.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return dn(Zn,Bt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),g5=ki(()=>zn(null,null,function*(){try{if(yield Hy())return(yield eo(()=>import("./index5-Bn5298gF.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return dn(Zn,Bt(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),so=hn(qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),I("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);so.install=e=>{e.component(so.__name,so)};const fJ={class:"superscript-node"},ko=hn(qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,footnote_reference:Po,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,emoji:yo,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("sup",fJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);ko.install=e=>{e.component(ko.__name,ko)};const hJ={class:"subscript-node"},bo=hn(qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,footnote_reference:Po,strikethrough:io,highlight:Wo,insert:xo,superscript:ko,emoji:yo,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("sub",hJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);bo.install=e=>{e.component(bo.__name,bo)};const pJ={class:"strong-node"},oo=hn(qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("strong",pJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);oo.install=e=>{e.component(oo.__name,oo)};const mJ={class:"strikethrough-node"},io=hn(qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("del",mJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);io.install=e=>{e.component(io.__name,io)};const gJ=["href","title","aria-label","aria-hidden","target","rel"],vJ=["aria-hidden"],yJ={class:"link-text-wrapper relative inline-flex"},kJ={class:"leading-[normal] link-text"},ro=hn(qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Ut("markstreamShowTooltips",void 0),s=P(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=P(()=>{var k,g,v,y,A;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(k=t.animationOpacity)!=null?k:.35,x=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--underline-rest-opacity":String(x),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=us(()=>t.customId),r=P(()=>it({text:Zn,strong:oo,strikethrough:io,emphasis:lo,image:il,html_inline:Ho,inline_code:qs},i.value)),l=bd(),a=P(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,L]of Object.entries(v))A&&L!=null&&L!==!1&&(y[A]=L===!0?"":String(L));return iS(y,"safe","a")}),c=P(()=>it(it({},l),a.value)),u=P(()=>{var k,g;return iS({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=P(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(cK(u.value)?"_blank":void 0)}),f=P(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),p=P(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),h=P(()=>{const k=it({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&GX()}const _=P(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,y;return e.node.loading?(b(),I("span",pn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[w("span",yJ,[w("span",kJ,[ie(C(Zn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,vJ)):(b(),I("a",pn({key:0,class:"link-node",href:u.value,title:s.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:o.value,onMouseenter:g[0]||(g[0]=A=>(function(L){var $,x,E,N;if(!s.value)return;const F=L,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,T=(($=t.node)==null?void 0:$.title)||((x=u.value)!=null&&x.includes("xn--")&&((N=(E=t.node)==null?void 0:E.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";KX(L.currentTarget,T,"top",!1,S)})(A)),onMouseleave:m}),[(b(!0),I(Be,null,nt(e.node.children,(A,L)=>(b(),ye(C(Ui),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,gJ))}}}),[["__scopeId","data-v-367e6ca4"]]);ro.install=e=>{e.component(ro.__name,ro)};const bJ={class:"insert-node"},xo=hn(qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("ins",bJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);xo.install=e=>{e.component(xo.__name,xo)};const xJ={class:"highlight-node"},Wo=hn(qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,emphasis:lo,strikethrough:io,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("mark",xJ,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Wo.install=e=>{e.component(Wo.__name,Wo)};const _J={class:"emphasis-node"},lo=hn(qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=P(()=>it({text:Zn,inline_code:qs,link:ro,html_inline:Ho,strong:oo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,footnote_reference:Po,math_inline:Ci,reference:so},n.value));return(o,i)=>(b(),I("em",_J,[(b(!0),I(Be,null,nt(e.node.children,(r,l)=>(b(),ye(C(Ui),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);lo.install=e=>{e.component(lo.__name,lo)};const wJ={class:"hard-break"},rl=hn(qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),I("br",wJ))}),[["__scopeId","data-v-50c58f70"]]);rl.install=e=>{e.component(rl.__name,rl)};const fd=qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=mt({checkbox:Do,checkbox_input:Do,emoji:yo,emphasis:lo,hardbreak:rl,highlight:Wo,inline_code:qs,insert:xo,link:ro,reference:so,strikethrough:io,strong:oo,subscript:bo,superscript:ko,text:Zn}),s=us(()=>t.customId),o=P(()=>{const i=s.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(b(!0),I(Be,null,nt(e.nodes,(l,a)=>(b(),ye(C(Ui),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function ev(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(ev)}function Jh(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(ev))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(ev)?o:null}function Ec(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const SJ=["cite"],CJ={key:0,dir:"auto",class:"paragraph-node"},AJ=["custom-id"],Qf=hn(qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=us(()=>t.customId),s=P(()=>!!n.value.paragraph),o=P(()=>!!n.value.text),i=P(()=>Jh(t.node.children,!s.value)),r=P(()=>t.fade!==!1||o.value?null:Ec(i.value));return An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade)),(l,a)=>(b(),I("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(b(),I("p",CJ,[r.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,AJ)):(b(),ye(C(fd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),ye(C(_o),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,SJ))}}),[["__scopeId","data-v-abfecebc"]]);Qf.install=e=>{e.component(Qf.__name,Qf)};const MJ={class:"definition-list"},EJ={class:"definition-term"},TJ={class:"definition-desc"},Xf=hn(qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),I("dl",MJ,[(b(!0),I(Be,null,nt(t.node.items,(o,i)=>(b(),I(Be,{key:i},[w("dt",EJ,[ie(C(_o),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),w("dd",TJ,[ie(C(_o),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Xf.install=e=>{e.component(Xf.__name,Xf)};const NJ=["href","title"],Du=hn(qe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(b(),I("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,NJ))}}),[["__scopeId","data-v-e1eb37b6"]]);Du.install=e=>{e.component(Du.__name,Du)};const IJ=["id"],$J={class:"flex-1"},Jf=qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),I("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",$J,[ie(C(_o),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,IJ))}});Jf.install=e=>{e.component(Jf.__name,Jf)};const LJ=["custom-id"],tv=hn(qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamFade",void 0),o=P(()=>s?.value!==!1||n.value.text?null:Ec(t.node.children)),i=P(()=>it({text:Zn,inline_code:qs,link:ro,image:il,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,checkbox:Do,checkbox_input:Do,footnote_reference:Po,hardbreak:rl,math_inline:Ci,reference:so},n.value));return(r,l)=>(b(),ye($s(`h${e.node.level}`),pn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[o.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,LJ)):(b(!0),I(Be,{key:1},nt(e.node.children,(a,c)=>(b(),ye(C(Ui),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),ep=tv;ep.install=e=>{e.component(tv.__name,tv)};const FJ={key:0,dir:"auto",class:"paragraph-node"},OJ=["custom-id"],RJ={dir:"auto",class:"paragraph-node"},BJ=["custom-id"],kc=hn(qe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=P(()=>{var p;return(p=t.node)!=null?p:t.item}),s=us(()=>t.customId),o=P(()=>!!s.value.paragraph),i=P(()=>!!s.value.text),r=P(()=>{var p;return Jh((p=n.value)==null?void 0:p.children,!o.value)}),l=P(()=>{var p;if(o.value)return null;const h=(p=n.value)==null?void 0:p.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=h.slice(1);if(!_.every(g=>g?.type==="list"))return null;const k=Jh([m]);return k?{paragraphChildren:k,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=P(()=>a()?Ec(r.value):null),u=P(()=>{var p;return a()?Ec((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=P(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade)),(p,h)=>{var m,_;return b(),I("li",pn({class:"list-item",dir:"auto"},f.value),[r.value?(b(),I("p",FJ,[c.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,OJ)):(b(),ye(C(fd),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(b(),I(Be,{key:1},[w("p",RJ,[u.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,BJ)):(b(),ye(C(fd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(b(!0),I(Be,null,nt(l.value.nestedLists,(k,g)=>(b(),ye(C(_o),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:h[0]||(h[0]=v=>p.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(b(),ye(C(_o),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=k=>p.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);kc.install=e=>{e.component(kc.__name,kc)};const bc=hn(qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=us(()=>e.customId),n=P(()=>t.value.list_item||kc);return(s,o)=>(b(),ye($s(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(b(!0),I(Be,null,nt(e.node.items,(i,r)=>{var l;return b(),ye($s(n.value),pn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);bc.install=e=>{e.component(bc.__name,bc)};const v5=Symbol("ViewportPriority");function DJ(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function p(){if(f!=null){try{l?.(f)}catch{}f=null}}function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||p()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&_())},{timeout:1200}))}Ke(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);p()}},{flush:"sync"});const k=(g,v)=>{const y=Q(!1);let A,L=!1;const $=new Promise(N=>{A=()=>{L||(L=!0,N())}}),x=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()};if(!o||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x};const E=(function(N,F){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(O,D){var W,z,V;return{root:(W=e?.(O??null))!=null?W:null,rootMargin:(z=D?.rootMargin)!=null?z:"300px",threshold:(V=D?.threshold)!=null?V:0}})(N,F);if(a&&(R=S,(T=c)&&T.root===R.root&&T.rootMargin===R.rootMargin&&T.threshold===R.threshold))return a;var T,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(O=>{for(const D of O)(D.isIntersecting||D.intersectionRatio>0)&&m(D.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const O of u.keys())a.observe(O);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),_(),{isVisible:y,whenVisible:$,destroy:x}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x})};return An(v5,k),k}function PJ(){var e,t;const n=Ut(v5,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const p=s.get(f);if(p){if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const p=Q(!1);let h,m=!1;const _=new Promise(v=>{h=()=>{m||(m=!0,v())}}),k=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(f,{resolve:h,visible:p}),g.observe(f),i.add(f),d(),{isVisible:p,whenVisible:_,destroy:k}):(p.value=!0,h(),{isVisible:p,whenVisible:_,destroy:k})}}const HJ={key:2,class:"html-block-node__raw"},WJ=["innerHTML"],zJ={key:1,class:"html-block-node__placeholder"},Pu=hn(qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),o=P(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=P(()=>{var L,$;const x=(L=s?.value)!=null?L:{};return Bt(it({},x),{customId:($=t.customId)!=null?$:x.customId,htmlPolicy:o.value})}),r=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1}),l=P(()=>{const L=Pg(t.node.attrs,o.value);if(!L)return;const $=Yh(L);return Object.keys($).length>0?$:void 0}),a=P(()=>{const L=String(t.node.tag||"").trim(),$=Pg(t.node.attrs,o.value,L);if(!$)return;const x=Yh($);return Object.keys(x).length>0?x:void 0}),c=us(()=>t.customId),u=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Q(null),f=Q(typeof window>"u"),p=Q(t.node.content),h=P(()=>Array.isArray(t.node.children)?t.node.children:[]),m=P(()=>String(t.node.tag||"div")),_=P(()=>{const L=m.value.trim().toLowerCase();return n6.has(L)||Fy(L,o.value)}),k=P(()=>h.value.length>0&&!!t.node.tag&&!_.value),g=P(()=>{var L,$,x;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=p.value)!=null?L:""};const E=($=p.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:yc(E,o.value)};if(t.node.loading){const F=Xh(E,c.value,o.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:E}:{mode:"dynamic",nodes:F}}if(!h5(E,c.value))return{mode:"html",content:yc(E,o.value)};const N=Xh(E,c.value,o.value);return N===null?{mode:"html",content:yc(E,o.value)}:{mode:"dynamic",nodes:N}}),v=PJ(),y=Q(null),A=!!t.node.loading;return typeof window<"u"?(Ke(d,L=>{var $,x;if((x=($=y.value)==null?void 0:$.destroy)==null||x.call($),y.value=null,!A)return f.value=!0,void(p.value=t.node.content);if(!L)return void(f.value=!1);const E=v(L,{rootMargin:"400px"});y.value=E,f.value=E.isVisible.value,E.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ke(()=>t.node.content,L=>{A&&!f.value||(p.value=L)})):f.value=!0,es(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(b(),ye($s(k.value?m.value:"div"),pn({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:Ee(()=>[f.value?(b(),I(Be,{key:0},[g.value.mode==="structured"?(b(),ye(C(r),pn({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(b(),ye(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(b(),I("pre",HJ,B(g.value.content),1)):(b(),I("div",pn({key:3},l.value,{innerHTML:g.value.content}),null,16,WJ))],64)):(b(),I("div",zJ,[In(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Pu.install=e=>{e.component(Pu.__name,Pu)};const UJ={dir:"auto",class:"paragraph-node"},jJ=["custom-id"],na=hn(qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=us(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=P(()=>{var x;return(x=s?.value)!=null?x:"safe"}),c=P(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=P(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=P(()=>{var x,E;return(E=t.customHtmlTags)!=null?E:(x=l?.value)==null?void 0:x.customHtmlTags}),f=P(()=>{var x,E;const N=(x=l?.value)!=null?x:{};return Bt(it({},N),{customId:(E=t.customId)!=null?E:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=ki({loader:()=>Promise.resolve().then(()=>Qy),suspensible:!1});function h(x){var E;return x.type==="text"&&String((E=x.content)!=null?E:"").trim()===""}const m=P(()=>t.node.children.filter(x=>!h(x))),_=P(()=>m.value.length>0&&m.value.every(x=>x.type==="image"||(function(E){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(T=>!h(T)):[]})(E);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(x))),k=P(()=>new Set(Fc(d.value))),g=P(()=>{if(!_.value||m.value.length<=1)return t.node.children;const x=[];for(let E=0;E<t.node.children.length;E++){const N=t.node.children[E];if(!h(N)){x.push(N);continue}const F=x.length>0,S=t.node.children.slice(E+1).some(T=>!h(T));F&&S&&x.push(Bt(it({},N),{content:" ",raw:" "}))}return x}),v=P(()=>o?.value===!1&&!n.value.text),y=P(()=>v.value?Ec(g.value):null);function A(x,E){return{node:x,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=P(()=>it({inline_code:qs,image:il,link:ro,hardbreak:rl,emphasis:lo,strong:oo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,html_inline:Ho,html_block:Pu,emoji:yo,checkbox:Do,math_inline:Ci,checkbox_input:Do,reference:so,footnote_anchor:Du,footnote_reference:Po,text:Zn},n.value)),$=P(()=>g.value.map((x,E)=>{var N;const F=(function(S){var T,R,O,D;if(S.type==="html_block"||S.type==="html_inline"){const W=String((T=S.tag)!=null?T:"").trim().toLowerCase()||r6(S.content);if(W&&!k.value.has(W)&&l6((R=S.content)!=null?R:S.raw,W)){const z=String((D=(O=S.content)!=null?O:S.raw)!=null?D:"");return{child:{type:"text",content:z,raw:z},component:Zn,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Td(String(S.type)))}})(x);return Bt(it({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?jy(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:x})}));return(x,E)=>(b(),I("p",UJ,[y.value!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(y.value),9,jJ)):(b(!0),I(Be,{key:1},nt($.value,N=>{return b(),I(Be,{key:N.key},[_.value&&h(N.originalChild)?(b(),I(Be,{key:0},[Ge(B((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(b(),ye($s(N.component),pn({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[N.hasSlotChildren?(b(),ye(C(p),pn({key:0,ref_for:!0},f.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(b(),ye(C(p),pn({key:1,ref_for:!0},f.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),ye($s(N.component),pn({key:2,ref_for:!0},A(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);na.install=e=>{e.component(na.__name,na)};const qJ={class:"table-node-wrapper"},VJ=["aria-busy"],KJ={key:0},GJ=["custom-id"],YJ=["aria-label","onPointerdown"],ZJ=["custom-id"],QJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Hu=hn(qe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=P(()=>{var k;return(k=t.node.loading)!=null&&k}),s=P(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=Q(null),i=Q([]);let r=null;const l=P(()=>t.node.header.cells.length),a=P(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=P(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);An("markstreamShowTooltips",P(()=>t.showTooltips)),An("markstreamFade",P(()=>t.fade));const u=us(()=>t.customId),d=P(()=>!!u.value.text),f=P(()=>!!u.value.paragraph),p=new WeakMap;function h(k){const g=t.fade===!1&&!d.value,v=!f.value,y=p.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=Jh(k.children,v,!0),L={simpleChildren:A,plainText:A&&g?Ec(A):null};return p.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return Ke(l,()=>{_(),i.value=[]}),es(_),(k,g)=>(b(),I("div",qJ,[w("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),I("colgroup",KJ,[(b(!0),I(Be,null,nt(e.node.header.cells,(v,y)=>(b(),I("col",{key:y,style:qt(c.value[y])},null,4))),128))])):le("",!0),w("thead",null,[w("tr",null,[(b(!0),I(Be,null,nt(e.node.header.cells,(v,y)=>(b(),I("th",{key:y,dir:"auto",class:De([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[h(v).plainText!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(h(v).plainText),9,GJ)):h(v).simpleChildren?(b(),ye(C(fd),{key:1,nodes:h(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(b(),ye(C(_o),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>k.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(b(),I("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(L,$){if($.button!==0)return;const x=(function(){var F;const S=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],T=>Math.round(T.getBoundingClientRect().width))})(),E=x[L],N=x[L+1];E&&N&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:E,nextStartWidth:N,widths:x},i.value=x,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,A)},null,40,YJ)):le("",!0)],2))),128))])]),w("tbody",null,[(b(!0),I(Be,null,nt(s.value,(v,y)=>(b(),I("tr",{key:y},[(b(!0),I(Be,null,nt(v.cells,(A,L)=>(b(),I("td",{key:L,class:De([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(A).plainText!==null?(b(),I("span",{key:0,class:"text-node","custom-id":t.customId},B(h(A).plainText),9,ZJ)):h(A).simpleChildren?(b(),ye(C(fd),{key:1,nodes:h(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),ye(C(_o),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=$=>k.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,VJ),ie(cl,{name:"table-node-fade"},{default:Ee(()=>[n.value?(b(),I("div",QJ,[In(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):le("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Hu.install=e=>{e.component(Hu.__name,Hu)};const XJ={class:"hr-node"},eh=hn({},[["render",function(e,t){return b(),I("hr",XJ)}],["__scopeId","data-v-39b2349c"]]);eh.install=e=>{e.component(eh.__name,eh)};const JJ={class:"unknown-node"},nv=qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),I("div",JJ,B(e.node.raw),1))}),th=hn(qe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=P(()=>`vmr-container vmr-container-${t.node.name}`),s=us(()=>t.customId),o=P(()=>it({text:Zn,paragraph:na,heading:ep,inline_code:qs,link:ro,image:il,strong:oo,emphasis:lo,strikethrough:io,insert:xo,subscript:bo,superscript:ko,checkbox:Do,checkbox_input:Do,hardbreak:rl,math_inline:Ci,reference:so,list:bc,math_block:g5,table:Hu},s.value));return(i,r)=>(b(),I("div",pn({class:n.value},e.node.attrs),[(b(!0),I(Be,null,nt(e.node.children,(l,a)=>{return b(),ye($s((c=l.type,o.value[c]||nv)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);th.install=e=>{e.component(th.__name,th)};const eee=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],hS=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function tee(e){if(e<=255)return eee[e];let t=0,n=hS.length-1;for(;t<=n;){const s=t+n>>1,o=hS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const nee=/[ \t\n\r\f]+/g,see=/[\t\n\r\f]| {2,}|^ | $/;let f0=null;const oee=new RegExp("\\p{Script=Arabic}","u"),sm=new RegExp("\\p{M}","u"),y5=new RegExp("\\p{Nd}","u");function pS(e){return oee.test(e)}function mS(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function gr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(mS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(mS(n))return!0}}return!1}const iee=new Set([" "," ","⁠","\uFEFF"]);function ree(e){return gr(e)}function sv(e){return!(function(t){const n=tp(t);return n!==null&&(qy.has(n)||la.has(n))})(e)&&!(function(t){const n=tp(t);return n!==null&&iee.has(n)})(e)}const qy=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),om=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Vy=new Set(["'","’"]),la=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),lee=new Set([":",".","،","؛"]),aee=new Set(["၏"]),cee=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function uee(e){if(Ky(e))return!0;let t=!1;for(const n of e)if(la.has(n))t=!0;else if(!t||!sm.test(n))return!1;return t}function dee(e){for(const t of e)if(!qy.has(t)&&!la.has(t))return!1;return e.length>0}function fee(e){if(Ky(e))return!0;for(const t of e)if(!om.has(t)&&!Vy.has(t)&&!sm.test(t))return!1;return e.length>0}function Ky(e){let t=!1;for(const n of e)if(n!=="\\"&&!sm.test(n)){if(!(om.has(n)||la.has(n)||Vy.has(n)))return!1;t=!0}return t}function k5(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function tp(e){if(e.length===0)return null;const t=k5(e,e.length);return e.slice(t)}function hee(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(sm.test(s))n--;else{if(!om.has(s)&&!Vy.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function pee(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function gS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function vS(e,t){return e&&t!==null&&lee.has(t)}function mee(e){const t=tp(e);return t!==null&&aee.has(t)}function gee(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function ov(e){let t=e.length;for(;t>0;){const n=k5(e,t),s=e.slice(n,t);if(cee.has(s))return!0;if(!la.has(s))return!1;t=n}return!1}function vee(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
275
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const yee=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ei(e){return e.length===1?e[0]:e.join("")}function kee(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),ei(n)}function bee(e,t,n,s){if(!yee.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=vee(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:ei(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:ei(r),isWordLike:a,kind:i,start:l}),o}function h0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const xee=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function _ee(e,t){const n=e.texts[t];return!!n.startsWith("www.")||xee.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function wee(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const See=new Set([":","-","/","×",",",".","+","–","—"]),yS=/^[A-Za-z0-9_]+[,:;]*$/,kS=/[,:;]+$/;function bS(e){for(const t of e)if(y5.test(t))return!0;return!1}function nh(e){if(e.length===0)return!1;for(const t of e)if(!y5.test(t)&&!See.has(t))return!1;return!0}function xS(e,t,n){var s,o,i;const r=(f0===null&&(f0=new Intl.Segmenter(void 0,{granularity:"word"})),f0);let l=0;const a=[],c=[],u=[],d=[],f=[],p=[],h=[],m=[],_=[],k=[],g=[],v=[];for(const x of r.segment(e))for(const E of bee(x.segment,(s=x.isWordLike)!=null&&s,x.index,n)){let N=function(){p[z]!==null&&(c[z]=[gS(a,p,h,z)],p[z]=null),c[z].push(E.text),u[z]=u[z]||E.isWordLike,m[z]=m[z]||T,_[z]=_[z]||R,k[z]=D,g[z]=W,v[z]=vS(_[z],O)};const F=E.kind==="text",S=pee(E.text,E.isWordLike,E.kind),T=gr(E.text),R=pS(E.text),O=tp(E.text),D=ov(E.text),W=mee(E.text),z=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[z]==="text"&&T&&m[z]&&k[z]||F&&l>0&&d[z]==="text"&&dee(E.text)&&m[z]||F&&l>0&&d[z]==="text"&&g[z]?N():F&&l>0&&d[z]==="text"&&E.isWordLike&&R&&v[z]?(N(),u[z]=!0):S!==null&&l>0&&d[z]==="text"&&p[z]===S?h[z]=((o=h[z])!=null?o:1)+1:F&&!E.isWordLike&&l>0&&d[z]==="text"&&(uee(E.text)||E.text==="-"&&u[z])?N():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,f[l]=E.start,p[l]=S,h[l]=S===null?0:1,m[l]=T,_[l]=R,k[l]=D,g[l]=W,v[l]=vS(R,O),l++)}for(let x=0;x<l;x++)p[x]===null?a[x]=ei(c[x]):a[x]=gS(a,p,h,x);for(let x=1;x<l;x++)d[x]==="text"&&!u[x]&&Ky(a[x])&&d[x-1]==="text"&&(a[x-1]+=a[x],u[x-1]=u[x-1]||u[x],a[x]="");const y=Array.from({length:l},()=>null);let A=-1;for(let x=l-1;x>=0;x--){const E=a[x];if(E.length!==0){if(d[x]==="text"&&!u[x]&&fee(E)&&A>=0&&d[A]==="text"){const N=(i=y[A])!=null?i:[];N.push(E),y[A]=N,f[A]=f[x],a[x]="";continue}A=x}}for(let x=0;x<l;x++){const E=y[x];E!=null&&(a[x]=kee(E,a[x]))}let L=0;for(let x=0;x<l;x++){const E=a[x];E.length!==0&&(L!==x&&(a[L]=E,u[L]=u[x],d[L]=d[x],f[L]=f[x]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(x){const E=x.texts.slice(),N=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let T=0;T<E.length-1;T++){if(F[T]!=="text"||F[T+1]!=="text"||!gr(E[T])||!gr(E[T+1]))continue;const R=hee(E[T]);R!==null&&(E[T]=R.head,E[T+1]=R.tail+E[T+1],S[T+1]=S[T]+R.head.length)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T],O=x.kinds[T],D=x.isWordLike[T];if(O==="text"&&D&&yS.test(R)){const W=[R];let z=kS.test(R),V=T+1;for(;z&&V<x.len&&x.kinds[V]==="text"&&x.isWordLike[V]&&yS.test(x.texts[V]);){const U=x.texts[V];W.push(U),z=kS.test(U),V++}E.push(ei(W)),N.push(!0),F.push("text"),S.push(x.starts[T]),T=V-1;continue}E.push(R),N.push(D),F.push(O),S.push(x.starts[T])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T];if(x.kinds[T]==="text"&&R.includes("-")){const O=R.split("-");let D=O.length>1;for(let W=0;W<O.length;W++){const z=O[W];if(!D)break;z.length!==0&&bS(z)&&nh(z)||(D=!1)}if(D){let W=0;for(let z=0;z<O.length;z++){const V=O[z],U=z<O.length-1?`${V}-`:V;E.push(U),N.push(!0),F.push("text"),S.push(x.starts[T]+W),W+=U.length}continue}}E.push(R),N.push(x.isWordLike[T]),F.push(x.kinds[T]),S.push(x.starts[T])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T],O=x.kinds[T];if(O==="text"&&nh(R)&&bS(R)){const D=[R];let W=T+1;for(;W<x.len&&x.kinds[W]==="text"&&nh(x.texts[W]);)D.push(x.texts[W]),W++;E.push(ei(D)),N.push(!0),F.push("text"),S.push(x.starts[T]),T=W-1;continue}E.push(R),N.push(x.isWordLike[T]),F.push(O),S.push(x.starts[T])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];for(let T=0;T<x.len;T++){const R=x.texts[T];if(E.push(R),N.push(x.isWordLike[T]),F.push(x.kinds[T]),S.push(x.starts[T]),!wee(R))continue;const O=T+1;if(O>=x.len||h0(x.kinds[O]))continue;const D=[],W=x.starts[O];let z=O;for(;z<x.len&&!h0(x.kinds[z]);)D.push(x.texts[z]),z++;D.length>0&&(E.push(ei(D)),N.push(!0),F.push("text"),S.push(W),T=z-1)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=x.texts.slice(),N=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let R=0;R<x.len;R++){if(F[R]!=="text"||!_ee(x,R))continue;const O=[E[R]];let D=R+1;for(;D<x.len&&!h0(F[D]);){O.push(E[D]),N[R]=!0;const W=E[D].includes("?");if(F[D]="text",E[D]="",D++,W)break}E[R]=ei(O)}let T=0;for(let R=0;R<E.length;R++){const O=E[R];O.length!==0&&(T!==R&&(E[T]=O,N[T]=N[R],F[T]=F[R],S[T]=S[R]),T++)}return E.length=T,N.length=T,F.length=T,S.length=T,{len:T,texts:E,isWordLike:N,kinds:F,starts:S}})((function(x){const E=[],N=[],F=[],S=[];let T=0;for(;T<x.len;){const R=[x.texts[T]];let O=x.isWordLike[T],D=x.kinds[T],W=x.starts[T];if(D==="glue"){const z=[R[0]],V=W;for(T++;T<x.len&&x.kinds[T]==="glue";)z.push(x.texts[T]),T++;const U=ei(z);if(!(T<x.len&&x.kinds[T]==="text")){E.push(U),N.push(!1),F.push("glue"),S.push(V);continue}R[0]=U,R.push(x.texts[T]),O=x.isWordLike[T],D="text",W=V,T++}else T++;if(D==="text")for(;T<x.len&&x.kinds[T]==="glue";){const z=[];for(;T<x.len&&x.kinds[T]==="glue";)z.push(x.texts[T]),T++;const V=ei(z);T<x.len&&x.kinds[T]==="text"?(R.push(V,x.texts[T]),O=O||x.isWordLike[T],T++):R.push(V)}E.push(ei(R)),N.push(O),F.push(D),S.push(W)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let x=0;x<$.len-1;x++){const E=gee($.texts[x]);E!==null&&($.kinds[x]!=="space"&&$.kinds[x]!=="preserved-space"||$.kinds[x+1]!=="text"||!pS($.texts[x+1])||($.texts[x]=E.space,$.isWordLike[x]=!1,$.kinds[x]=$.kinds[x]==="preserved-space"?"preserved-space":"space",$.texts[x+1]=E.marks+$.texts[x+1],$.starts[x+1]=$.starts[x]+E.space.length))}return $}function Cee(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Ha=null;const _S=new Map;let Wa=null;const Aee=new RegExp("\\p{Emoji_Presentation}","u"),Mee=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let p0=null;const wS=new Map;function iv(){if(Ha!==null)return Ha;if(typeof OffscreenCanvas<"u")return Ha=new OffscreenCanvas(1,1).getContext("2d"),Ha;if(typeof document<"u")return Ha=document.createElement("canvas").getContext("2d"),Ha;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Wr(e,t){let n=t.get(e);return n===void 0&&(n={width:iv().measureText(e).width,containsCJK:gr(e)},t.set(e,n)),n}function im(){if(Wa!==null)return Wa;if(typeof navigator>"u")return Wa={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Wa;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Wa={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Wa}function b5(){return p0===null&&(p0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),p0}function Eee(e){return Aee.test(e)||e.includes("️")}function Pl(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=b5();for(const a of l.segment(i))Eee(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function Tee(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function Nee(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function SS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+im().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,p=0;function h(y=u,A=d,L=a){l++,a=0,c=!1,f=-1,p=0}function m(y,A){c=!0,u=y+1,d=0,a=A}function _(y,A,L){c=!0,u=y,d=A+1,a=L}function k(y,A){c?(a+=A,u=y+1,d=0):m(y,A)}function g(y,A){const L=i[y];for(let $=A;$<L.length;$++){const x=L[$];c?a+x>r?(h(),_(y,$,x)):(a+=x,u=y,d=$+1):_(y,$,x)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=Tee(e,v),!(v>=s.length)));){const y=s[v],A=o[v],L=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+y>r){if(L){k(v,y),h(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){h();continue}h(f,0,p);continue}if(y>t&&i[v]!==null){h(),g(v,0),v++;continue}h()}else k(v,y),L&&(f=v+1,p=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),L&&(f=v+1,p=a-y),v++}return c&&h(),l}let m0=null;function Iee(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,p){s=[d],o=f,i=p,r=ov(d),l=om.has(d)}function u(d,f){s.push(d),i=i||f;const p=ov(d);r=d.length===1&&la.has(d)&&r||p,l=!1}for(const d of(m0===null&&(m0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),m0).segment(e)){const f=d.segment,p=gr(f);s.length!==0?l||qy.has(f)||la.has(f)||t.carryCJKAfterClosingQuote&&p&&r?u(f,p):i||p?(a(),c(f,d.index,p)):u(f,p):c(f,d.index,p)}return a(),n}function $ee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=gr(e[0].text),i=sv(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=gr(a.text),u=sv(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function Lee(e,t,n,s){const o=im(),{cache:i,emojiCorrection:r}=(function($,x){iv().font=$;const E=(function(S){let T=_S.get(S);return T||(T=new Map,_S.set(S,T)),T})($),N=(function(S){const T=S.match(/(\d+(?:\.\d+)?)\s*px/);return T?parseFloat(T[1]):16})($),F=x?(function(S,T){let R=wS.get(S);if(R!==void 0)return R;const O=iv();O.font=S;const D=O.measureText("😀").width;if(R=0,D>T+.5&&typeof document<"u"&&document.body!==null){const W=document.createElement("span");W.style.font=S,W.style.display="inline-block",W.style.visibility="hidden",W.style.position="absolute",W.textContent="😀",document.body.appendChild(W);const z=W.getBoundingClientRect().width;document.body.removeChild(W),D-z>.5&&(R=D-z)}return wS.set(S,R),R})($,N):0;return{cache:E,fontSize:N,emojiCorrection:F}})(t,(l=e.normalized,Mee.test(l)));var l;const a=Pl("-",Wr("-",i),r),c=8*Pl(" ",Wr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],p=[];let h=e.chunks.length<=1;const m=null,_=[],k=n?[]:null,g=Array.from({length:e.len});function v($,x,E,N,F,S,T){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(h=!1),u.push(x),d.push(E),f.push(N),p.push(F),_.push(T),k!==null&&k.push($)}function y($,x,E,N,F){const S=Wr($,i),T=Pl($,S,r),R=x==="space"||x==="preserved-space"||x==="zero-width-break"?0:T,O=x==="space"||x==="zero-width-break"?0:T;if(F&&N&&$.length>1){let D="sum-graphemes";nh($)?D="pair-context":o.preferPrefixWidthsForBreakableRuns&&(D="segment-prefixes");const W=(function(z,V,U,re,ae){if(V.breakableFitAdvances!==void 0)return V.breakableFitAdvances;const te=b5(),Z=[];for(const Ye of te.segment(z))Z.push(Ye.segment);if(Z.length<=1)return V.breakableFitAdvances=null,V.breakableFitAdvances;if(ae==="sum-graphemes"){const Ye=[];for(const ve of Z){const Y=Wr(ve,U);Ye.push(Pl(ve,Y,re))}return V.breakableFitAdvances=Ye,V.breakableFitAdvances}if(ae==="pair-context"||Z.length>96){const Ye=[];let ve=null,Y=0;for(const ce of Z){const fe=Pl(ce,Wr(ce,U),re);if(ve===null)Ye.push(fe);else{const j=ve+ce,se=Wr(j,U);Ye.push(Pl(j,se,re)-Y)}ve=ce,Y=fe}return V.breakableFitAdvances=Ye,V.breakableFitAdvances}const ne=[];let ke="",Se=0;for(const Ye of Z){ke+=Ye;const ve=Pl(ke,Wr(ke,U),re);ne.push(ve-Se),Se=ve}return V.breakableFitAdvances=ne,V.breakableFitAdvances})($,S,i,r,D);return void v($,T,R,O,x,E,W)}v($,T,R,O,x,E,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const x=e.texts[$],E=e.isWordLike[$],N=e.kinds[$],F=e.starts[$];if(N==="soft-hyphen"){v(x,0,a,a,N,F,null);continue}if(N==="hard-break"){v(x,0,0,0,N,F,null);continue}if(N==="tab"){v(x,0,0,0,N,F,null);continue}const S=Wr(x,i);if(N==="text"&&S.containsCJK){const T=Iee(x,o),R=s==="keep-all"?$ee(T):T;for(let O=0;O<R.length;O++){const D=R[O];y(D.text,"text",F+D.start,E,s==="keep-all"||!gr(D.text))}continue}y(x,N,F,E,!0)}const A=(function($,x,E){const N=[];for(let F=0;F<$.length;F++){const S=$[F],T=S.startSegmentIndex<x.length?x[S.startSegmentIndex]:E,R=S.endSegmentIndex<x.length?x[S.endSegmentIndex]:E,O=S.consumedEndSegmentIndex<x.length?x[S.consumedEndSegmentIndex]:E;N.push({startSegmentIndex:T,endSegmentIndex:R,consumedEndSegmentIndex:O})}return N})(e.chunks,g,u.length),L=m===null?null:(function($,x){const E=(function(F){const S=F.length;if(S===0)return null;const T=new Array(S);let R=!1;for(let U=0;U<S;){const re=F.charCodeAt(U);let ae=re,te=1;if(re>=55296&&re<=56319&&U+1<S){const ne=F.charCodeAt(U+1);ne>=56320&&ne<=57343&&(ae=ne-56320+(re-55296<<10)+65536,te=2)}const Z=tee(ae);Z!=="R"&&Z!=="AL"&&Z!=="AN"||(R=!0);for(let ne=0;ne<te;ne++)T[U+ne]=Z;U+=te}if(!R)return null;let O=0;for(let U=0;U<S;U++){const re=T[U];if(re==="L"){O=0;break}if(re==="R"||re==="AL"){O=1;break}}const D=new Int8Array(S);for(let U=0;U<S;U++)D[U]=O;const W=1&O?"R":"L",z=W;let V=z;for(let U=0;U<S;U++)T[U]==="NSM"?T[U]=V:V=T[U];V=z;for(let U=0;U<S;U++){const re=T[U];re==="EN"?T[U]=V==="AL"?"AN":"EN":re!=="R"&&re!=="L"&&re!=="AL"||(V=re)}for(let U=0;U<S;U++)T[U]==="AL"&&(T[U]="R");for(let U=1;U<S-1;U++)T[U]==="ES"&&T[U-1]==="EN"&&T[U+1]==="EN"&&(T[U]="EN"),T[U]!=="CS"||T[U-1]!=="EN"&&T[U-1]!=="AN"||T[U+1]!==T[U-1]||(T[U]=T[U-1]);for(let U=0;U<S;U++){if(T[U]!=="EN")continue;let re;for(re=U-1;re>=0&&T[re]==="ET";re--)T[re]="EN";for(re=U+1;re<S&&T[re]==="ET";re++)T[re]="EN"}for(let U=0;U<S;U++){const re=T[U];re!=="WS"&&re!=="ES"&&re!=="ET"&&re!=="CS"||(T[U]="ON")}V=z;for(let U=0;U<S;U++){const re=T[U];re==="EN"?T[U]=V==="L"?"L":"EN":re!=="R"&&re!=="L"||(V=re)}for(let U=0;U<S;U++){if(T[U]!=="ON")continue;let re=U+1;for(;re<S&&T[re]==="ON";)re++;const ae=(U>0?T[U-1]:z)!=="L"?"R":"L";if(ae===((re<S?T[re]:z)!=="L"?"R":"L"))for(let te=U;te<re;te++)T[te]=ae;U=re-1}for(let U=0;U<S;U++)T[U]==="ON"&&(T[U]=W);for(let U=0;U<S;U++){const re=T[U];1&D[U]?re!=="L"&&re!=="AN"&&re!=="EN"||D[U]++:re==="R"?D[U]++:re!=="AN"&&re!=="EN"||(D[U]+=2)}return D})($);if(E===null)return null;const N=new Int8Array(x.length);for(let F=0;F<x.length;F++)N[F]=E[x[F]];return N})(e.normalized,m);return k!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:k}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function Fee(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return Lee((function(c,u,d="normal",f="normal"){const p=(function(_){const k=_??"normal";return k==="pre-wrap"?{mode:k,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:k,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),h=p.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
276
+ `).replace(/[\r\f]/g,`
277
+ `):_.replace(/\r\n/g,`
278
+ `)})(c):(function(_){if(!see.test(_))return _;let k=_.replace(nee," ");return k.charCodeAt(0)===32&&(k=k.slice(1)),k.length>0&&k.charCodeAt(k.length-1)===32&&(k=k.slice(0,-1)),k})(c);if(h.length===0)return{normalized:h,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const k=[],g=[],v=[],y=[];let A=null,L=!1,$=0,x=!1,E=!1;function N(){A!==null&&(k.push(ei(A)),g.push(L),v.push("text"),y.push($),A=null)}for(let F=0;F<_.len;F++){const S=_.texts[F],T=_.kinds[F],R=_.isWordLike[F],O=_.starts[F];if(T==="text"){const D=ree(S),W=sv(S);if(A!==null&&x&&E){A.push(S),L=L||R,x=x||D,E=W;continue}N(),A=[S],L=R,$=O,x=D,E=W;continue}N(),k.push(S),g.push(R),v.push(T),y.push(O)}return N(),{len:k.length,texts:k,isWordLike:g,kinds:v,starts:y}})(xS(h,u,p)):xS(h,u,p);return it({normalized:h,chunks:Cee(m,p)},m)})(s,im(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const g0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",ms=(()=>{const e=globalThis;if(e[g0])return e[g0];const t={configs:{},controllers:{},revision:fa(0),preparedCache:new Map,blockEstimateCache:new Map};return e[g0]=t,t})();let du=null;const CS=ms.revision;function AS(e){var t;return e&&(t=ms.configs[e])!=null?t:null}function MS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Oee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function v0(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!Oee(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
279
+ `)}return o.length>0?o:null}function y0(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(du!=null)return du;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return du=!!((i=r.getContext)!=null&&i.call(r,"2d")),du}catch{return du=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=ms.blockEstimateCache.get(r);if(l)return ms.blockEstimateCache.delete(r),ms.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(p,h,m){const _=`${m}\0${h}\0${p}`,k=ms.preparedCache.get(_);if(k)return ms.preparedCache.delete(_),ms.preparedCache.set(_,k),k.prepared;const g=Fee(p,h,{whiteSpace:m});for(ms.preparedCache.set(_,{prepared:g});ms.preparedCache.size>240;){const v=ms.preparedCache.keys().next().value;if(!v)break;ms.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(p,h,m){const _=(function(k,g){return k.simpleLineWalkFastPath?SS(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return SS(v,y);const{widths:A,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:x,breakableFitAdvances:E,discretionaryHyphenWidth:N,tabStopAdvance:F,chunks:S}=v;if(A.length===0||S.length===0)return 0;const T=im(),R=T.lineFitEpsilon,O=y+R;let D=0,W=0,z=!1,V=0,U=0,re=-1,ae=0,te=0,Z=null;function ne(){re=-1,ae=0,te=0,Z=null}function ke(se=V,ge=U,ue=W){D++,W=0,z=!1,ne()}function Se(se,ge){z=!0,V=se+1,U=0,W=ge}function Ye(se,ge,ue){z=!0,V=se,U=ge+1,W=ue}function ve(se,ge){z?(W+=ge,V=se+1,U=0):Se(se,ge)}function Y(se,ge,ue,pe){if(!ge)return;const q=se==="tab"?0:L[ue],J=se==="tab"?pe:$[ue];re=ue+1,ae=W-pe+q,te=W-pe+J,Z=se}function ce(se,ge){const ue=E[se];for(let pe=ge;pe<ue.length;pe++){const q=ue[pe];z?W+q>O?(ke(),Ye(se,pe,q)):(W+=q,V=se,U=pe+1):Ye(se,pe,q)}z&&V===se&&U===ue.length&&(V=se+1,U=0)}function fe(se){if(Z!=="soft-hyphen")return!1;const ge=E[se];if(ge==null)return!1;const{fitCount:ue,fittedWidth:pe}=(function(q,J,he,Te,Ie){let Oe=0,de=J;for(;Oe<q.length;){const $e=de+q[Oe];if((Oe+1<q.length?$e+Ie:$e)>he+Te)break;de=$e,Oe++}return{fitCount:Oe,fittedWidth:de}})(ge,W,y,R,N);return ue!==0&&(W=pe,V=se,U=ue,ne(),ue===ge.length?(V=se+1,U=0,!0):(ke(se,ue,pe+N),ce(se,ue),!0))}function j(se){D++,ne()}for(let se=0;se<S.length;se++){const ge=S[se];if(ge.startSegmentIndex===ge.endSegmentIndex){j();continue}z=!1,W=0,ge.startSegmentIndex,V=ge.startSegmentIndex,U=0,ne();let ue=ge.startSegmentIndex;for(;ue<ge.endSegmentIndex;){const pe=x[ue],q=pe==="space"||pe==="preserved-space"||pe==="tab"||pe==="zero-width-break"||pe==="soft-hyphen",J=pe==="tab"?Nee(W,F):A[ue];if(pe!=="soft-hyphen")if(z){if(W+J>O){const he=W+(pe==="tab"?0:L[ue]),Te=W+(pe==="tab"?J:$[ue]);if(Z==="soft-hyphen"&&T.preferEarlySoftHyphenBreak&&ae<=O){ke(re,0,te);continue}if(Z==="soft-hyphen"&&fe(ue)){ue++;continue}if(q&&he<=O){ve(ue,J),ke(ue+1,0,Te),ue++;continue}if(re>=0&&ae<=O){if(V>re||V===re&&U>0){ke();continue}const Ie=re;ke(Ie,0,te),ue=Ie;continue}if(J>y&&E[ue]!==null){ke(),ce(ue,0),ue++;continue}ke();continue}ve(ue,J),Y(pe,q,ue,J),ue++}else J>y&&E[ue]!==null?ce(ue,0):Se(ue,J),Y(pe,q,ue,J),ue++;else z&&(V=ue+1,U=0,re=ue+1,ae=W+N,te=W+N,Z=pe),ue++}if(z){const pe=re===ge.consumedEndSegmentIndex?te:W;ke(ge.consumedEndSegmentIndex,0,pe)}}return D})(k,g)})(p,h);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(ms.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});ms.blockEstimateCache.size>4e3;){const p=ms.blockEstimateCache.keys().next().value;if(!p)break;ms.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function x5(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=v0(e.children);return i&&n.paragraph?y0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=v0(e.children),l=n.headings[i];return r&&l?y0(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=v0((o=i[0])==null?void 0:o.children);return r?y0(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=x5(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function If(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Ree(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,p;return u.diff?Math.max(If(String((d=u.originalCode)!=null?d:"")),If(String((f=u.updatedCode)!=null?f:"")),If(String((p=u.code)!=null?p:""))):If((function(h,m){const _=String(h??"");return m?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(p,h){const m=typeof p?.fontSize=="number"&&p.fontSize>0?p.fontSize:h?13:12;return typeof p?.lineHeight=="number"&&p.lineHeight>0?p.lineHeight:h?30:Math.round(1.5*m)})(u,r),f=(function(p,h){var m,_;if(!h)return 0;const k=typeof((m=p?.padding)==null?void 0:m.top)=="number"?p.padding.top:10,g=typeof((_=p?.padding)==null?void 0:_.bottom)=="number"?p.padding.bottom:22;return Math.max(0,k)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else s==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(o?40:0)),contentHeight:c,rendererKind:s}}function Bee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function k0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=MS(s.lineHeight,1.5*MS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Bee(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Dee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function ES(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))Dee.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const Pee=!1;function rxe(){return Pee}function TS(e,t,n,s){var o;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,p){return Number.isFinite(f)?Math.min(Math.max(0,f),p):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const p=s.getNormalizedScrollTop(e,t,!1),h=Math.abs(p-r);h<u&&(u=h,c=f)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const _5=Symbol("MarkstreamMathBlockMinHeightCache");function lxe(){return Ut(_5,null)}const Hee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Wee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],zee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),w5=["raw","content","code","originalCode","updatedCode"],NS=new WeakMap,IS=new WeakMap;let Uee=1;function gi(){return typeof performance<"u"?performance.now():Date.now()}function $S(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ii(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=NS.get(t);return n||(n=Uee++,NS.set(t,n)),String(n)}function LS(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:ii(t),customMarkdownIt:ii(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:ii(e.validateLink),preTransformTokens:ii(e.preTransformTokens),postTransformTokens:ii(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function FS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
280
+ `,t-1)+1;return e.slice(n,t).trim()}function OS(e){const t=S5(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function S5(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function C5(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Gy(e){const t=String(e??"");return`${t.length}:${C5(t)}`}function rv(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?Gy(r):`${r.length}:${C5(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ii(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${ii(s)}`;const i=ii(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>rv(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${rv(r[c],t,n+1)}`).join(";")}`}return typeof e}function np(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function A5(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>np(s)?pl(s,t,n+1):A5(s,t,n+1)).join(",")}`:np(e)?pl(e,t,n):rv(e,t,n)}function jee(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!w5.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${Gy(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${ii(o)}`:zee.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${A5(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${ii(o)}`:""}).filter(Boolean).join(";")}function qee(e){return w5.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Gy(n)}`:""}).filter(Boolean).join(";")}function pl(e,t=new WeakMap,n=0){const s=IS.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${ii(o)}`;const r=ii(o);t.set(o,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],p=f.length?f.slice(0,200).map(h=>pl(h,c,u+1)).join("|"):"";return[a.type,qee(d),jee(d,c,u),f.length,p].join(":")})(e,t,n);return IS.set(o,l),l}function M5(e,t){return pl(e)===pl(t)}function Yy(e,t,n){const s=gi(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=gi()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function RS(e,t,n){return Yy(t,n,()=>pl(e))}function E5(e,t,n){return RS(e,n,"stabilizeSignatureMs")===RS(t,n,"stabilizeSignatureMs")}function b0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function BS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function Vee(e,t){return e.length===t.length&&e===t}function Zy(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=s[d],p=o[d];if(typeof f!=typeof p)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,p))return!1}else if(typeof p!="string"||!Vee(f,p))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!np(d)||!np(f))return null;const p=Zy(d,f,n+1);if(p==null)return null;if(!p)return!1}return!0}function Kee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Zy(e,t);return n??M5(e,t)}function Gee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return Yy(n,"stabilizeSignatureMs",()=>{s=Zy(e,t)}),s??E5(e,t,n)}function Yee(e,t){const n={};for(const s of Hee){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function Zee(e,t){var n;const s=Ww(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:P(()=>!1),r=Q(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,p=0,h=gi();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const E=t.renderContent.value;r.value!==E&&(r.value=E),h=gi()}Ke([t.renderContent,t.effectiveFinal,i],([E,N,F])=>{r.value!==E&&(!F||N||(function(S,T){if(!S&&T||T.length<=80||T.length<S.length||!T.startsWith(S))return!0;const R=T.slice(S.length);return!!R&&(!!OS(FS(T))||!(!R.includes(`
281
+
282
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
283
+ `)&&!(function(O){const D=FS(O);if(OS(D))return!1;const W=S5(D);return W.length>=2&&W.some(z=>z.trim())})(T))})(r.value,E)?_():(function(){if(p+=1,l)return;const S=Math.max(0,(function(T){const R=T.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(gi()-h));S<=0?_():l=setTimeout(_,S)})())},{flush:"sync",immediate:!0}),Sv(m);const k=P(()=>{var E,N,F,S;return mK(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(N=t.customComponentsMap)==null?void 0:N.value)!=null?F:{},Object.entries(S).map(([T,R])=>{const O=di(T);return R==null||!O||Td(O)||t6.has(O)||Ad.has(O)?"":O}).filter(Boolean)))}),g=P(()=>{const{key:E,tags:N}=gK(k.value);if(!E)return s;const F=o.get(E);if(F)return F;const S=Ww(t.instanceMsgId,{customHtmlTags:N});return o.set(E,S),S}),v=P(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=P(()=>{var E,N;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,T=k.value,R=S!=null,O=T.length>0;return R||O||F.streamParse==null?it(it(Bt(it({},F),{streamParse:(N=F.streamParse)==null||N}),R?{final:S}:{}),O?{customHtmlTags:T}:{}):F}),A=P(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(N=>String(N).trim().toLowerCase()).filter(Boolean))}),L=P(()=>LS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=P(()=>LS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ke([L,$],([E,N],[F,S])=>{F&&(E===F&&N===S||(_(),N!==S&&(a=[],d="")))},{flush:"sync"});const x=P(()=>{var E,N,F,S,T,R,O,D;if((E=e.nodes)!=null&&E.length)return a=[],d="",mt(e.nodes.slice());const W=r.value;if(!W)return a=[],d="",[];const z=t.debugPerformanceEnabled.value,V=z?gi():0,U=v.value,re=L.value,ae=$.value;c&&re!==c&&(function(ge){var ue,pe;(pe=(ue=ge.stream)==null?void 0:ue.reset)==null||pe.call(ue)})(U),u&&ae!==u&&(a=[],d="");const te=a.length>0&&W.startsWith(d)&&ae===u,Z=z?$S(U):null,ne=z?{}:void 0,ke=ne?Bt(it({},y.value),{__timing:ne}):y.value,Se=U6(W,U,ke),Ye=z?gi():0,ve=z?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Y,ce=z?b0(Se.length):void 0,fe=0,j=0;if(te){const ge=z?gi():0;if(ve){const ue=(function(pe,q,J){if(!q.length)return{nodes:pe,metrics:b0(pe.length)};const he=(function(Oe,de,$e){const Qe=Math.min(Oe.length,de.length);for(let tt=0;tt<Qe;tt++)if(!Gee(de[tt],Oe[tt],$e))return tt;return Oe.length===de.length?-1:Qe})(pe,q,J);if(he<0)return{nodes:q,metrics:{reusedNodeCount:pe.length,dirtyStartIndex:he,stablePrefixNodeCount:pe.length,dirtyTailNodeCount:0}};const Te=pe.slice();let Ie=he;for(let Oe=0;Oe<he;Oe++)Te[Oe]=q[Oe];for(let Oe=he;Oe<pe.length;Oe++){const de=q[Oe],$e=pe[Oe];de&&E5(de,$e,J)&&(Te[Oe]=de,Ie+=1)}return{nodes:Te,metrics:{reusedNodeCount:Ie,dirtyStartIndex:he,stablePrefixNodeCount:he,dirtyTailNodeCount:BS(he,pe,q)}}})(Se,a,ve);Y=ue.nodes,ce=ue.metrics}else{const ue=(function(pe,q){if(!q.length)return{nodes:pe,metrics:b0(pe.length)};const J=(function(Ie,Oe){const de=Math.min(Ie.length,Oe.length);for(let $e=0;$e<de;$e++)if(!Kee(Oe[$e],Ie[$e]))return $e;return Ie.length===Oe.length?-1:de})(pe,q);if(J<0)return{nodes:q,metrics:{reusedNodeCount:pe.length,dirtyStartIndex:J,stablePrefixNodeCount:pe.length,dirtyTailNodeCount:0}};const he=pe.slice();let Te=J;for(let Ie=0;Ie<J;Ie++)he[Ie]=q[Ie];for(let Ie=J;Ie<pe.length;Ie++){const Oe=q[Ie],de=pe[Ie];Oe&&M5(Oe,de)&&(he[Ie]=Oe,Te+=1)}return{nodes:he,metrics:{reusedNodeCount:Te,dirtyStartIndex:J,stablePrefixNodeCount:J,dirtyTailNodeCount:BS(J,pe,q)}}})(Se,a);Y=ue.nodes,ce=ue.metrics}fe=z?gi()-ge:0,j=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?Y.length:ce.dirtyStartIndex}else Y=Se;ve?(function(ge,ue,pe=0){for(let q=Math.max(0,pe);q<ge.length;q++)Yy(ue,"primeSignatureMs",()=>pl(ge[q]))})(Y,ve,j):(function(ge,ue=0){for(let pe=Math.max(0,ue);pe<ge.length;pe++)pl(ge[pe])})(Y,j);const se=z?gi()-Ye:0;if(f+=1,d=W,c=re,u=ae,a=Y,z){const ge=$S(U),ue=typeof ge?.total=="number"&&ge.total>((N=Z?.total)!=null?N:0);t.logPerf(ue?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(gi()-V),nodes:Y.length,contentLength:W.length,parseCommitCount:f,parseCoalescedCount:p,nodeReuseMs:se,signatureMs:(F=ve?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=ve?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(T=ve?.primeSignatureMs)!=null?T:0,signatureCallCount:(R=ve?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(O=ve?.stabilizeSignatureCallCount)!=null?O:0,primeSignatureCallCount:(D=ve?.primeSignatureCallCount)!=null?D:0,stabilizeMs:fe},ce??{}),ne?Object.fromEntries(Wee.map(pe=>{var q;return[pe,(q=ne[pe])!=null?q:0]})):{}),ge?{streamMode:ge.lastMode,streamDelta:Yee(ge,Z),streamStats:ge}:{}))}return mt(Y)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:x}}function Qee(e){const{isClient:t}=e,n=Q(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,p){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const _=n.value,k=_.has(f);if(p){if(k)return;const v=new Set(_);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(_);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,p]of o.entries())f<c||(p(),o.delete(f));for(const[f,p]of s.entries())f<c||(p.destroy(),s.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function Xee(e={}){const t=Q(""),n=Q(""),s=Q(!1),o=JQ(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=P(()=>Math.max(0,t.value.length-n.value.length)),a=P(()=>l.value===0),c=P(()=>s.value&&a.value);return wv()&&Sv(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const DS=/auto|scroll|overlay/i;function Jee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return DS.test(t)||DS.test(n)}function ete(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const tte=qe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=P(()=>{var n,s;return Vg((s=oc(e.estimatedPreviewHeightPx))!=null?s:jg(String((n=e.node.code)!=null?n:"")))});return()=>dn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?dn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[dn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[dn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),dn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),dn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>dn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,dn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[dn("div",{class:"absolute inset-0"},[dn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),nte=qe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=P(()=>{var n,s;return qg((s=oc(e.estimatedPreviewHeightPx))!=null?s:Ug(String((n=e.node.code)!=null?n:"")))});return()=>dn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?dn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[dn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[dn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),dn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>dn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[dn("span",{class:"action-icon block"})])))]):null,dn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[dn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}),ste=["data-custom-id"],ote={class:"m-0 p-0"},ite=["data-probe"],rte=["data-node-index","data-node-type"],T5=hn(qe(Bt(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Os(),r=Ut("markstreamNestedRendererProps",void 0);function l(M){var H,K;const G=s[M];return(function(oe){const be=i?.vnode.props;return!!be&&(Object.prototype.hasOwnProperty.call(be,oe)||Object.prototype.hasOwnProperty.call(be,String(oe).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?G:(K=(H=r?.value)==null?void 0:H[M])!=null?K:G}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=P(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=P(()=>{const M=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return M===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:M===!1||c.value==="docs"?"monaco":"pre"}),d=P(()=>a[c.value]),f=P(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),p=P(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),h=P(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),m=P(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),_=P(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),k=P(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),g=P(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),v=P(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),y=P(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=P(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),L=P(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),$=P(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return p.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(M){o("height-change",M)}function N(M){o("virtual-state-change",M)}function F(M){o("anchor-change",M)}const S=Q(),T=Q(null),R=Q(null),O=Q(null),D=Ss({1:null,2:null,3:null,4:null,5:null,6:null}),W=Q(!1),z=new Map,V=Q(0),U=Q(0),re=Q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ae(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const K=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return te(typeof K=="function"?K():K)}function te(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?te(M.value):typeof M=="object"&&"$el"in M?te(M.$el):null:null}const{isClient:Z,renderAsFragment:ne,debugPerformanceEnabled:ke,resolvedShowTooltips:Se,resolvedHtmlPolicy:Ye,inheritedSmoothStreaming:ve,ownsTypewriterCursor:Y}=(function(M){const H=typeof window<"u",K=bd(),G=Ut("markstreamHtmlPolicy",void 0),oe=Ut("markstreamTypewriterCursor",void 0),be=Ut("markstreamSmoothStreaming",void 0),Me=P(()=>M.renderAsFragment===!0),Ne=P(()=>!!(M.debugPerformance&&H&&typeof console<"u")),He=P(()=>{var We;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Re=(We=K.showTooltips)!=null?We:K["show-tooltips"];return Re===""||Re===!0||Re==="true"||Re!==!1&&Re!=="false"&&void 0}),Fe=P(()=>{var We,Re;return(Re=(We=M.htmlPolicy)!=null?We:G?.value)!=null?Re:"safe"}),Ue=P(()=>oe?.value!==!0);return{isClient:H,renderAsFragment:Me,debugPerformanceEnabled:Ne,resolvedShowTooltips:He,resolvedHtmlPolicy:Fe,inheritedSmoothStreaming:be,inheritedTypewriterCursor:oe,ownsTypewriterCursor:Ue}})(x),{resolveViewportRoot:ce,resolveScrollContainer:fe,isReverseFlexScrollRoot:j,getNormalizedScrollTop:se,getOffsetTopWithinRoot:ge}=(function(M,H){function K(){var Ne,He;return(He=(Ne=H.scrollRoot)==null?void 0:Ne.call(H))!=null?He:null}function G(Ne){if(typeof window>"u")return null;const He=K();if(He)return He;const Fe=Ne??M.value;if(!Fe)return null;const Ue=Fe.ownerDocument||document,We=Ue.scrollingElement||Ue.documentElement;let Re=Fe;for(;Re&&Re!==Ue.body&&Re!==We;){if(Jee(window.getComputedStyle(Re))&&ete(Re))return Re;Re=Re.parentElement}return null}function oe(Ne){if(!H.isClient)return!1;try{const He=window.getComputedStyle(Ne);return!!(He.display||"").toLowerCase().includes("flex")&&(He.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function be(Ne,He,Fe){var Ue,We;if(Fe)return Me(He);const Re=Ne.scrollTop;if(!oe(Ne))return Re;const ze=Re<0?-Re:Re;return Math.max(0,((Ue=Ne.scrollHeight)!=null?Ue:0)-((We=Ne.clientHeight)!=null?We:0))-ze}function Me(Ne){var He,Fe,Ue,We,Re;const ze=Number((He=Ne.scrollingElement)==null?void 0:He.scrollTop),Je=Number((Ue=(Fe=Ne.documentElement)==null?void 0:Fe.scrollTop)!=null?Ue:0),et=Number((Re=(We=Ne.body)==null?void 0:We.scrollTop)!=null?Re:0);return Math.max(0,Number.isFinite(ze)?ze:0,Number.isFinite(Je)?Je:0,Number.isFinite(et)?et:0)}return{resolveViewportRoot:G,resolveScrollContainer:function(Ne){var He,Fe,Ue,We;const Re=K();if(Re)return Re;const ze=G((He=Ne??M.value)!=null?He:null);if(ze)return ze;const Je=(We=(Ue=Ne?.ownerDocument)!=null?Ue:(Fe=M.value)==null?void 0:Fe.ownerDocument)!=null?We:typeof document<"u"?document:null;return Je?.scrollingElement||Je?.documentElement||null},isReverseFlexScrollRoot:oe,getNormalizedScrollTop:be,getOffsetTopWithinRoot:function(Ne,He){const Fe=He.ownerDocument||Ne.ownerDocument||document;if((function(ze,Je){return ze===Je.documentElement||ze===Je.body||ze===Je.scrollingElement})(He,Fe))return Ne.getBoundingClientRect().top+Me(Fe);const Ue=He.getBoundingClientRect(),We=Ne.getBoundingClientRect(),Re=be(He,Fe,!1);return We.top-Ue.top+Re}}})(S,{isClient:Z,scrollRoot:ae});An("markstreamShowTooltips",Se),An("markstreamHtmlPolicy",Ye),An("markstreamTypewriter",P(()=>x.typewriter!==!1)),An("markstreamFade",P(()=>x.fade!==!1)),An("markstreamTypewriterCursor",P(()=>!0)),An("markstreamTextStreamState",z),An("markstreamStreamVersion",V),An("markstreamParseOptions",P(()=>x.parseOptions)),An("markstreamCustomMarkdownIt",P(()=>x.customMarkdownIt));const{smoothStreamingEnabled:ue,renderContent:pe,effectiveFinal:q}=(function(M,H){const K=Xee(M.smoothStreamingOptions),G=P(()=>{var Fe,Ue,We;return M.smoothStreaming!==!1&&!((Fe=M.nodes)!=null&&Fe.length)&&(M.smoothStreaming===!0||!((Ue=H.inheritedSmoothStreaming)!=null&&Ue.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((We=M.maxLiveNodes)!=null?We:0)<=0)}),oe=Q(!H.isClient||M.smoothStreaming===!0);ln(()=>{oe.value=!0});const be=P(()=>oe.value&&G.value),Me=P(()=>{var Fe;return be.value?K.visible.value:(Fe=M.content)!=null?Fe:""}),Ne=P(()=>{var Fe,Ue;const We=(Fe=M.parseOptions)!=null?Fe:{};return(Ue=M.final)!=null?Ue:We.final}),He=P(()=>{const Fe=Ne.value;return be.value&&Fe!=null?!!Fe&&K.caughtUp.value:Fe});return Ke([()=>M.content,()=>M.nodes,be,Ne],([Fe,Ue,We,Re])=>{if(Ue?.length)return void K.reset("");const ze=Fe??"";if(!We)return K.reset(ze),void(Re&&K.finish({flush:!0}));const Je=K.source.value;ze?ze===Je||(ze.startsWith(Je)?K.enqueue(ze.slice(Je.length)):K.reset(ze)):K.reset(""),Re&&K.finish()},{immediate:!0}),{smoothStream:K,smoothStreamingEligible:G,smoothStreamingEnabled:be,renderContent:Me,requestedFinal:Ne,effectiveFinal:He}})(x,{isClient:Z,inheritedSmoothStreaming:ve});An("markstreamSmoothStreaming",ue);const J=Q(!1);let he="",Te=!1,Ie=null;function Oe(){Z&&Ie!=null&&(window.clearTimeout(Ie),Ie=null)}function de(){J.value=!1,Oe()}function $e(M,H){if(!ke.value)return;const K=(function(){if(!ke.value)return null;const G=xt(Qe),oe=xt(tt),be=Math.max(wt,oe);if(G<=0&&be<=0)return null;const Me={total:G,maxPerFrame:be,byLabel:(Ne=Qe,Object.fromEntries(Array.from(Ne.entries()).sort((He,Fe)=>Fe[1]-He[1]||He[0].localeCompare(Fe[0]))))};var Ne;return Qe.clear(),tt.clear(),wt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,K?Bt(it({},H),{layoutReads:K}):H)}Ke([pe,()=>s.nodes,q],([M,H,K])=>{const G=M??"";return H?.length||K===!0?(de(),he=G,void(Te=!0)):Te?(he&&G.length>he.length&&G.startsWith(he)?(J.value=!0,Z&&(Oe(),Ie=window.setTimeout(()=>{var oe;Ie=null,q.value===!0||(oe=s.nodes)!=null&&oe.length||(Ea(),J.value=!1,Ki())},1200))):(G.length<he.length||!G.startsWith(he))&&de(),void(he=G)):(he=G,void(Te=!0))},{flush:"sync",immediate:!0});const Qe=new Map,tt=new Map;let vt=!1,wt=0;function xt(M){let H=0;for(const K of M.values())H+=K;return H}function Rt(){wt=Math.max(wt,xt(tt)),tt.clear(),vt=!1}function yt(M,H){return(function(K){var G,oe;ke.value&&(Qe.set(K,((G=Qe.get(K))!=null?G:0)+1),tt.set(K,((oe=tt.get(K))!=null?oe:0)+1),vt||(vt=!0,Z&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Rt):typeof queueMicrotask!="function"?setTimeout(Rt,0):queueMicrotask(Rt)))})(M),H()}const nn=x.customId?`renderer-${x.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,xn=(function(M){const H=new Map;return{scope:M,cache:H,clear:()=>H.clear()}})(nn),ns=P(()=>`${nn}:${V.value}`);An(_5,xn);const Wt=us(()=>x.customId),{effectiveCustomHtmlTagsSet:_n,mergedParseOptions:gn,parsedNodes:ot}=Zee(x,{instanceMsgId:nn,renderContent:pe,effectiveFinal:q,smoothStreamingEnabled:ue,debugPerformanceEnabled:ke,customComponentsMap:Wt,logPerf:$e});Ke(ot,()=>{xn.clear(),V.value+=1},{immediate:!0});const ds=P(()=>({customId:x.customId,customHtmlTags:gn.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:Ye.value,viewportPriority:x.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:x.codeBlockStream,codeBlockDarkTheme:x.codeBlockDarkTheme,codeBlockLightTheme:x.codeBlockLightTheme,codeBlockMonacoOptions:x.codeBlockMonacoOptions,renderCodeBlocksAsPre:x.renderCodeBlocksAsPre,codeBlockMinWidth:x.codeBlockMinWidth,codeBlockMaxWidth:x.codeBlockMaxWidth,codeBlockProps:x.codeBlockProps,mermaidProps:x.mermaidProps,d2Props:x.d2Props,infographicProps:x.infographicProps,showTooltips:Se.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));An("markstreamNestedRendererProps",ds);const ys=P(()=>ot.value),fs=P(()=>ot.value.length),Xe=Q(null),Ze=Q(null),Mt=Q(null),Dt=Q(null),zt=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),wn=!zt&&x.customId?AS(x.customId):null,Rn=P(()=>wn?(CS.value,AS(x.customId)):null),hs=P(()=>{var M;return!!(Z&&!ne.value&&x.customId&&!zt&&((M=Rn.value)!=null&&M.enabled))}),ss=P(()=>{var M;return!!(!ne.value&&((M=s.virtualScroll)!=null&&M.enabled))}),sn=Q(!1);ln(()=>{sn.value=!0});const Lt=P(()=>!!(Z&&ss.value));An("markstreamHostScrollManaged",Lt);const Vs=P(()=>!!(sn.value&&Lt.value)),an=P(()=>hs.value||Lt.value),So=P(()=>hs.value||Vs.value),Co=P(()=>{var M;return an.value&&((M=Rn.value)==null?void 0:M.textEstimation)!==!1}),Rs=P(()=>{var M;return an.value&&((M=Rn.value)==null?void 0:M.codeBlockEstimation)!==!1});function fi(){const M=U.value||yt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const co=P(()=>{const M=fi();return M>0?Math.max(1,Math.round(M)):640}),jo=P(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),Ot=P(()=>{var M;return!ne.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?ot.value.length>0:ot.value.length>jo.value)}),Bs=P(()=>Ot.value||hs.value||Lt.value),qn=P(()=>x.viewportPriority!==!1&&!W.value),Cs=DJ(M=>{var H;return ce((H=M??S.value)!=null?H:null)},qn),{requestFrame:On,cancelFrame:Hn,hasIdleCallback:hi,isTestEnv:Xn}=(function(M){const H=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,K=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,G=M.isClient&&typeof window.requestIdleCallback=="function",oe=(function(){var be;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(be=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:be.value;return Me?.env})();return{requestFrame:H,cancelFrame:K,hasIdleCallback:G,isTestEnv:oe?.NODE_ENV==="test"}})({isClient:Z}),{resolvedBatchSize:qo,resolvedInitialBatch:Ks,batchingEnabled:Mi,incrementalRenderingActive:Ao,renderedCount:Vn,previousRenderContext:Vo,adaptiveBatchSize:ji,previousBatchConfig:Ko}=(function(M,H){var K;const G=P(()=>{var We;const Re=Math.trunc((We=M.renderBatchSize)!=null?We:80);return Number.isFinite(Re)?Math.max(0,Re):0}),oe=P(()=>{var We;const Re=Math.trunc((We=M.initialRenderBatchSize)!=null?We:G.value);return Number.isFinite(Re)?Math.max(0,Re):G.value}),be=P(()=>!H.renderAsFragment.value&&M.batchRendering!==!1&&G.value>0&&H.isClient&&!H.isTestEnv),Me=Q(0),Ne=Q({key:M.indexKey,total:0}),He=Q(Math.max(1,G.value||1)),Fe=P(()=>{var We;return be.value&&((We=M.maxLiveNodes)!=null?We:0)<=0}),Ue=Q({batchSize:G.value,initial:oe.value,delay:(K=M.renderBatchDelay)!=null?K:16,enabled:Fe.value});return{resolvedBatchSize:G,resolvedInitialBatch:oe,batchingEnabled:be,incrementalRenderingActive:Fe,renderedCount:Me,previousRenderContext:Ne,adaptiveBatchSize:He,previousBatchConfig:Ue}})(x,{isClient:Z,isTestEnv:Xn,renderAsFragment:ne}),Bn=new Map,Kn=new Map,Mo=new WeakMap;let rt=null;const xe=new WeakMap,Le=new Map,we=Q(0),X=P(()=>(we.value,Array.from(Bn.entries()).sort((M,H)=>M[0]-H[0]))),me=Q(null),je=Q(null);let lt=null,ee=0,_e=null;const{activeRestoreAnchor:Ae,getRelativeScrollTopWithinContainer:Pe,setRelativeScrollTopWithinContainer:st,resolveAnchorOffset:at,clearRestoreReconcile:Nt,scheduleRestoreReconcile:Zt,captureRestoreAnchor:Qt,restoreAnchor:As,getAnchorDrift:Cr}=(function(M){const{isClient:H,containerRef:K,parsedNodeCount:G,requestFrame:oe,cancelFrame:be,resolveScrollContainer:Me,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:He,isReverseFlexScrollRoot:Fe,estimateIndexForOffset:Ue,estimateHeightRange:We,getFallbackNodeHeight:Re,clamp:ze}=M,Je=Q(null);let et=null,St=[];function ct(){const Tt=Me(),Ht=K.value;if(!Tt||!Ht)return null;const Pt=Tt.ownerDocument||Ht.ownerDocument||document;if(Tt===Pt.documentElement||Tt===Pt.body||Tt===Pt.scrollingElement){const cn=Ht.getBoundingClientRect();return Math.max(0,-cn.top)}return Math.max(0,Ne(Tt,Pt,!1)-He(Ht,Tt))}function dt(Tt){var Ht;const Pt=Me(),cn=K.value;if(!Pt||!cn)return;const Io=Math.max(0,Tt),Gs=Pt.ownerDocument||cn.ownerDocument||document,pi=Gs.defaultView||(typeof window<"u"?window:null);if(Pt===Gs.documentElement||Pt===Gs.body||Pt===Gs.scrollingElement){const Ir=Ne(Pt,Gs,!0)+cn.getBoundingClientRect().top;return void((Ht=pi?.scrollTo)==null||Ht.call(pi,0,Math.max(0,Ir+Io)))}TS(Pt,Gs,He(cn,Pt)+Io,{isReverseFlexScrollRoot:Ir=>{var $r;return($r=Fe?.(Ir))!=null&&$r},getNormalizedScrollTop:Ne})}function At(Tt){const Ht=G.value,Pt=ze(Tt.nodeIndex,0,Math.max(0,Ht-1));return We(0,Pt)+Math.max(0,Tt.offsetWithinNodePx)}function Ct(){if(et!=null&&(be?.(et),et=null),H)for(const Tt of St)window.clearTimeout(Tt);St=[]}function Jt(Tt){const Ht=At(Tt),Pt=ct();Pt!=null&&Math.abs(Pt-Ht)<=.5||dt(Ht)}return{activeRestoreAnchor:Je,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:dt,resolveAnchorOffset:At,clearRestoreReconcile:Ct,applyRestoreAnchor:Jt,scheduleRestoreReconcile:function(){Je.value&&H&&et==null&&(et=oe?oe(()=>{et=null,Je.value&&Jt(Je.value)}):null,et==null&&Je.value&&Jt(Je.value))},captureRestoreAnchor:function(){const Tt=ct(),Ht=G.value;if(Tt==null||Ht<=0)return null;const Pt=ze(Ue(Tt+1),0,Ht-1),cn=We(0,Pt),Io=Re(Pt);return{nodeIndex:Pt,offsetWithinNodePx:ze(Tt-cn,0,Math.max(0,Io-1))}},restoreAnchor:function(Tt){const Ht=G.value;if(Je.value={nodeIndex:ze(Tt.nodeIndex,0,Math.max(0,Ht-1)),offsetWithinNodePx:Math.max(0,Tt.offsetWithinNodePx)},Ct(),Jt(Je.value),H)for(const Pt of[0,120,280,480])St.push(window.setTimeout(()=>{Je.value&&Jt(Je.value)},Pt))},getAnchorDrift:function(Tt){const Ht=ct();return Ht==null?null:Ht-At(Tt)}}})({isClient:Z,containerRef:S,parsedNodeCount:fs,requestFrame:On,cancelFrame:Hn,resolveScrollContainer:()=>me.value||fe(),getNormalizedScrollTop:se,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:j,estimateIndexForOffset:Jm,estimateHeightRange:Nr,getFallbackNodeHeight:Wd,clamp:Ts}),{nodeHeights:Vt,heightStats:vn,heightTreeSize:$n,heightSumTree:ks,heightKnownTree:bs,averageNodeHeight:Ms,resetHeightMeasurements:va,pruneHeightMeasurements:gm,rebuildHeightTrees:$d,recordNodeHeight:UM,removeNodeHeights:jM,exportHeightCache:qM,importHeightCache:VM,fenwickRangeSum:Ld}=(function(M={}){const H=Ss({}),K=Ss({total:0,count:0}),G=Q(0),oe=Q([]),be=Q([]);function Me(){for(const Re of Object.keys(H))delete H[Number(Re)];K.total=0,K.count=0,G.value=0,oe.value=[],be.value=[]}function Ne(Re,ze,Je){for(let et=ze+1;et<Re.length;et+=et&-et)Re[et]+=Je}function He(Re,ze){let Je=0;for(let et=ze+1;et>0;et-=et&-et)Je+=Re[et];return Je}function Fe(Re){G.value=Re;const ze=new Array(Re+1).fill(0),Je=new Array(Re+1).fill(0);for(const[et,St]of Object.entries(H)){const ct=Number(et),dt=Number(St);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0||(Ne(ze,ct,dt),Ne(Je,ct,1))}oe.value=ze,be.value=Je}function Ue(Re){if(!Number.isInteger(Re)||Re<0)return!1;const ze=H[Re];if(!Number.isFinite(ze)||ze<=0)return!1;if(delete H[Re],K.total=Math.max(0,K.total-ze),K.count=Math.max(0,K.count-1),G.value>Re){const Je=oe.value,et=be.value;Je.length&&et.length&&(Ne(Je,Re,-ze),Ne(et,Re,-1))}return!0}const We=P(()=>K.count>0?Math.max(12,K.total/K.count):32);return{nodeHeights:H,heightStats:K,heightTreeSize:G,heightSumTree:oe,heightKnownTree:be,averageNodeHeight:We,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Re){if(Re<=0)return void Me();let ze=0,Je=0;for(const[et,St]of Object.entries(H)){const ct=Number(et),dt=Number(St);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0?delete H[ct]:(ze+=dt,Je++)}K.total=ze,K.count=Je},rebuildHeightTrees:Fe,recordNodeHeight:function(Re,ze,Je={}){(function(et,St,ct={}){var dt;if(!Number.isFinite(St)||St<=0)return!1;const At=H[et];if(At&&(ct.allowShrink===!1&&St<At||Math.abs(St-At)<=1))return!1;if(H[et]=St,At?K.total+=St-At:(K.total+=St,K.count++),G.value>et){const Ct=oe.value,Jt=be.value;if(Ct.length&&Jt.length)if(At){const Tt=St-At;Tt!==0&&Ne(Ct,et,Tt)}else Ne(Ct,et,St),Ne(Jt,et,1)}ct.notify!==!1&&((dt=M.onHeightRecorded)==null||dt.call(M))})(Re,ze,Bt(it({},Je),{notify:!0}))},removeNodeHeight:function(Re,ze={}){var Je;const et=Ue(Re);return et&&ze.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},removeNodeHeights:function(Re,ze={}){var Je;let et=0;for(const St of Re)Ue(Number(St))&&et++;return et>0&&ze.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},exportHeightCache:function(){return Object.entries(H).map(([Re,ze])=>({index:Number(Re),height:Number(ze)})).filter(Re=>Number.isFinite(Re.index)&&Re.index>=0&&Number.isFinite(Re.height)&&Re.height>0).sort((Re,ze)=>Re.index-ze.index)},importHeightCache:function(Re,ze={}){var Je;if(!Array.isArray(Re))return;const et=G.value;let St=!1;if(ze.mode!=="merge"){const ct=Object.keys(H);if(ct.length>0){for(const dt of ct)delete H[Number(dt)];St=!0}}for(const ct of Re){const dt=Number(ct.index),At=Number(ct.height);if(!Number.isInteger(dt)||dt<0||et>0&&dt>=et||!Number.isFinite(At)||At<=0)continue;const Ct=H[dt];Ct&&Math.abs(Ct-At)<=1||(H[dt]=At,St=!0)}St&&((function(){let ct=0,dt=0;const At=G.value;for(const[Ct,Jt]of Object.entries(H)){const Tt=Number(Ct),Ht=Number(Jt);!Number.isFinite(Tt)||Tt<0||At>0&&Tt>=At||!Number.isFinite(Ht)||Ht<=0?delete H[Tt]:(ct+=Ht,dt++)}K.total=ct,K.count=dt})(),et>0&&Fe(et),(Je=M.onHeightRecorded)==null||Je.call(M))},fenwickRangeSum:function(Re,ze,Je){if(Je<=ze)return 0;const et=He(Re,Je-1);return ze<=0?et:et-He(Re,ze-1)}}})({onHeightRecorded:()=>{Yo(),Lt.value&&Jc(),Ae.value&&Zt(),je.value&&Ca(),Ln("node-resize")}});function Fd(){va(),Le.clear()}function Tk(M){!Number.isInteger(M)||M<0||M>=ot.value.length||Le.set(M,zc(M))}function Nk(M,H,K={}){const G=Vt[M];UM(M,H,K);const oe=Vt[M];oe&&oe>0?Tk(M):G&&Le.delete(M)}function Ik(M,H){const K=yt("getNodeLayoutHeight.slot.offsetHeight",()=>{var G,oe;return(oe=(G=Bn.get(M))==null?void 0:G.offsetHeight)!=null?oe:0});return K>0?K:yt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function $k(M,H={}){VM(M,H),jm()}const Ar=P(()=>{var M;return!ne.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!Ot.value&&!(ot.value.length>900)&&qn.value}),Lk=P(()=>!!Cs&&(Ar.value||Ot.value)),Fk=P(()=>Ot.value||Lt.value),{liveNodeBufferResolved:Dc,focusIndex:Go,liveRange:Es,updateLiveRange:wl}=(function(M,H){const{parsedNodeCount:K,virtualizationEnabled:G,maxLiveNodesResolved:oe,clamp:be}=H,Me=P(()=>{var Fe;return Math.max(0,(Fe=M.liveNodeBuffer)!=null?Fe:60)}),Ne=Q(0),He=Ss({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Ne,liveRange:He,updateLiveRange:function(){const Fe=K.value;if(!G.value||Fe===0)return He.start=0,void(He.end=Fe);const Ue=Math.min(oe.value,Fe),We=Me.value,Re=be(Ne.value-We,0,Math.max(0,Fe-Ue));He.start=Re,He.end=Math.min(Fe,Re+Ue)}}})(x,{parsedNodeCount:fs,virtualizationEnabled:Ot,maxLiveNodesResolved:jo,clamp:Ts}),Ei=new Map,Sl=new Map,Mr=new Map,Od=[],qi=new Map,Er=new Set,Ok=Q(0);let vm=!1;const Rk=P(()=>(Ok.value,Er.size)),Eo=new Map,Ti=new Map,Bk=Q(0),ym=P(()=>{Bk.value;let M=0;for(const H of Eo.values())M+=Math.max(0,H);return M});let To=null,km=!0,Dk=[0],Pk="";function Yo(){km=!0}const Rd=P(()=>{if(!Ot.value)return ot.value.length;const M=Dc.value,H=Math.max(Es.end+M,Ks.value),K=Math.min(ot.value.length,H);return Math.max(Vn.value,K)});function Bd(){vm||(vm=!0,queueMicrotask(()=>{vm=!1,Ok.value+=1}))}function Hk(M,H,K="node-resize"){if(!Z||typeof window>"u")return null;const G=window.setTimeout(()=>{Er.delete(G)&&Bd();try{H()}finally{Ln(K)}},Math.max(0,M));return Er.add(G),Bd(),G}function Dd(M){Z&&M!=null&&(Er.delete(M)&&Bd(),window.clearTimeout(M))}function Wk(){if(Z&&typeof window<"u")for(const M of Er)window.clearTimeout(M);Er.size&&(Er.clear(),Bd()),Od.length=0,Mr.clear()}function KM(M){var H,K;return(K=(H=Dt.value)==null?void 0:H[M])!=null?K:null}const{cancelScheduledFocusSync:bm,scheduleFocusSync:Ni}=(function(M){const{isClient:H,containerRef:K,virtualizationEnabled:G,requestFrame:oe,cancelFrame:be,syncFocusToScroll:Me}=M;let Ne=null;function He(){var Ue,We,Re;return(Re=(We=(Ue=K.value)==null?void 0:Ue.ownerDocument)==null?void 0:We.defaultView)!=null?Re:typeof window<"u"?window:null}function Fe(){if(!Ne)return;const Ue=He();Ne.viaTimeout?Ue?Ue.clearTimeout(Ne.id):clearTimeout(Ne.id):be?.(Ne.id),Ne=null}return{cancelScheduledFocusSync:Fe,scheduleFocusSync:function(Ue={}){if(!G.value)return;if(!H)return void Me(!0);if(Ue.immediate)return Fe(),void Me(!0);if(Ne)return;const We=()=>{Ne=null,Me()};if(oe)return void(Ne={id:oe(We),viaTimeout:!1});const Re=He();Ne={id:Re?Re.setTimeout(We,16):setTimeout(We,16),viaTimeout:!0}}}})({isClient:Z,containerRef:S,virtualizationEnabled:Ot,requestFrame:On,cancelFrame:Hn,syncFocusToScroll:function(M=!1){var H;if(!Ot.value)return;const K=me.value||fe();if(!K)return;const G=K.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,oe=G?.defaultView||(typeof window<"u"?window:null),be=K===G?.documentElement||K===G?.body,Me=ot.value.length;if(!be&&Me>0&&j(K)){const Je=yt("syncFocusToScroll.clientHeight",()=>K.clientHeight||0),et=yt("syncFocusToScroll.scrollTop",()=>K.scrollTop),St=et<0?-et:et,ct=(function(At){var Ct,Jt;const Tt=ot.value;if(!Tt.length)return 0;if(At<=0)return Math.max(0,Tt.length-1);if(an.value){const Pt=(Ct=Cm()[Tt.length])!=null?Ct:0;return Yk(Math.max(0,Pt-At))}if($n.value===Tt.length){const Pt=Nr(0,Tt.length);return Jm(Math.max(0,Pt-At))}let Ht=At;for(let Pt=Tt.length-1;Pt>=0;Pt--){const cn=(Jt=Vt[Pt])!=null?Jt:Ms.value;if(Ht<=cn)return Pt;Ht-=cn}return 0})(Math.max(0,St)+.5*Math.max(0,Je)),dt=Ts(ct,0,Math.max(0,Me-1));return void((M||Math.abs(dt-Go.value)>1)&&(Go.value=dt,wl()))}const Ne=be?null:yt("syncFocusToScroll.root.getBoundingClientRect",()=>K.getBoundingClientRect()),He=be?0:Ne.top,Fe=be?yt("syncFocusToScroll.viewport.clientHeight",()=>{var Je,et;return(et=(Je=oe?.innerHeight)!=null?Je:K.clientHeight)!=null?et:0}):Ne.bottom,Ue=X.value;let We=null,Re=null;for(const[Je,et]of Ue){if(!et)continue;const St=yt("syncFocusToScroll.slot.getBoundingClientRect",()=>et.getBoundingClientRect());St.bottom<=He||St.top>=Fe||(We==null&&(We=Je),Re=Je)}if(We==null||Re==null){const Je=S.value;if(!Je)return;const et=be?{top:0}:yt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>K.getBoundingClientRect()),St=yt("syncFocusToScroll.fallback.scrollTop",()=>se(K,G,be)),ct=be?(()=>{const Ct=yt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Je.getBoundingClientRect()),Jt=(be?0:et.top)-Ct.top;return Math.max(0,Jt)})():(()=>{const Ct=ge(Je,K);return Math.max(0,St-Ct)})(),dt=be?yt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,Jt,Tt,Ht;return(Ht=(Tt=(Jt=oe?.innerHeight)!=null?Jt:(Ct=G?.documentElement)==null?void 0:Ct.clientHeight)!=null?Tt:K.clientHeight)!=null?Ht:0}):yt("syncFocusToScroll.fallback.root.clientHeight",()=>K.clientHeight),At=Jm(ct+.5*Math.max(0,dt));return Go.value=Ts(At,0,Math.max(0,ot.value.length-1)),void wl()}const ze=Math.round((We+Re)/2);!M&&Math.abs(ze-Go.value)<=1||(Go.value=Ts(ze,0,Math.max(0,ot.value.length-1)),wl())}}),{visibleNodeIndices:xm,nodeVisibilityHandles:ya,nodeVisibilityWatchStops:Pd,nodeVisibilityFallbackTimers:zk,clearVisibilityFallback:Hd,markNodeVisible:Tr,cleanupNodeVisibility:GM,destroyNodeVisibilityState:_m}=Qee({isClient:Z,shouldTrackVisibleNodeIndices:()=>Ar.value,shouldCleanupNodeVisibility:()=>Ot.value,onNodeMarkedVisible:M=>{Ot.value?Ni():Go.value=Ts(M,0,Math.max(0,ot.value.length-1))},onNodeVisibilityCleaned:M=>{Bn.delete(M)&&v2()}}),{cleanupScrollListener:Uk,setupScrollListener:YM}=(function(M){const{isClient:H,virtualizationEnabled:K,listenerEnabled:G,scrollRootElement:oe,resolveScrollContainer:be,scheduleFocusSync:Me,onScroll:Ne}=M;let He=null,Fe=null;function Ue(){He&&(He(),He=null),Fe=null,oe.value=null}function We(Re){const ze=M.getScrollTop?M.getScrollTop(Re):Re.scrollTop;return Math.max(0,Number.isFinite(ze)?Math.abs(ze):0)}return{cleanupScrollListener:Ue,setupScrollListener:function(){if(!H)return;if(!((Re=G?.value)!=null?Re:K.value))return void Ue();var Re;const ze=be();if(!ze)return void Ue();if(oe.value===ze&&He)return;Ue(),Fe=We(ze);const Je=()=>{if(Ne?.(),K.value){const et=(function(St){const ct=We(St),dt=Fe;Fe=ct;const At=Math.max(480,.75*(St.clientHeight||0));return dt==null?ct>At?{immediate:!0}:void 0:Math.abs(ct-dt)>At?{immediate:!0}:void 0})(ze);et?Me(et):Me()}};ze.addEventListener("scroll",Je,{passive:!0}),oe.value=ze,He=()=>{ze.removeEventListener("scroll",Je)}}}})({isClient:Z,virtualizationEnabled:Ot,listenerEnabled:Fk,scrollRootElement:me,resolveScrollContainer:fe,scheduleFocusSync:Ni,onScroll:function(){const M=je.value;if(!M)return;const H=Wc();if(!H||(function(G){if(Kc()>=ee)return _e=null,!1;const oe=_e;if(oe==null)return!0;const be=Math.abs(G.scrollTop-oe)<=2;return be||(_e=null),be})(H))return;const K=o2(H);K!=null?(K<-32||Math.abs(Math.max(0,K)-Math.max(0,M.distanceFromBottomPx))>32)&&Sa("restore"):Sa("restore")},getScrollTop:M=>{var H;const K=M.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,G=M===K.documentElement||M===K.body||M===K.scrollingElement;return yt("scrollListener.getScrollTop",()=>se(M,K,G))}});function Ts(M,H,K){return Math.min(Math.max(M,H),K)}function wm(M){return M?.firstElementChild}function jk(M,H){var K;return M?(K=M.matches)!=null&&K.call(M,H)?M:M.querySelector(H):null}function qk(){if(!an.value)return void(U.value=0);const M=yt("updateExperimentContainerWidth.clientWidth",()=>{var H,K;return(K=(H=S.value)==null?void 0:H.clientWidth)!=null?K:0});U.value=M>0?M:0}let Pc=null;function Sm(){Pc?.disconnect(),Pc=null}const Vk=ki({loader:()=>zn(null,null,function*(){return(yield eo(()=>import("./index8-CHlcChT0.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:m5,delay:0,suspensible:!1});function Kk(M){return M===Vk}const Gk=P(()=>u.value==="pre"?$o:u.value==="shiki"?Vk:d0),Cl=P(()=>{const M=ot.value;if(!M.length||!an.value)return M.map(()=>null);const H=U.value||yt("estimatedNodeHeights.clientWidth",()=>{var K;return((K=S.value)==null?void 0:K.clientWidth)||0});return!Number.isFinite(H)||H<=0?M.map(()=>null):M.map((K,G)=>{const oe=Vt[G],be=typeof oe=="number"&&oe>0;if(Co.value&&!be){const Ne=x5(K,H,re.value);if(Ne)return Ne}if(Rs.value&&K.type==="code_block"){const Ne=(function(He){if(He.type!=="code_block")return null;const Fe=N2(He,Gd(He));return Kk(Fe)?"markdown":Fe===$o?"pre":Fe===Gk.value||Fe===d0?"monaco":null})(K);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return Ree(K,{rendererKind:Ne,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Me=x.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function Wd(M){var H;const K=Vt[M];if(Number.isFinite(K)&&K>0)return K;const G=(H=Cl.value[M])==null?void 0:H.height;return Number.isFinite(G)&&G>0?G:Math.max(Ms.value,(function(oe){var be,Me,Ne,He,Fe,Ue,We,Re,ze,Je,et,St,ct;const dt=ot.value[oe];if(!dt||typeof dt!="object")return 32;const At=String((be=dt.type)!=null?be:""),Ct=fi()||640;switch(At){case"heading":return 44;case"paragraph":return ka(String((Ne=(Me=dt.raw)!=null?Me:dt.content)!=null?Ne:""),Ct,34);case"list":{const Jt=Array.isArray(dt.items)?dt.items.length:1;return Math.max(48,30*Jt+12)}case"list_item":return ka(String((Fe=(He=dt.raw)!=null?He:dt.content)!=null?Fe:""),Ct,34);case"blockquote":return ka(String((We=(Ue=dt.raw)!=null?Ue:dt.content)!=null?We:""),Ct,56);case"table":{const Jt=Array.isArray(dt.rows)?dt.rows.length:Array.isArray(dt.children)?dt.children.length:3;return Math.max(120,38*Jt+48)}case"code_block":return ka(String((ze=(Re=dt.code)!=null?Re:dt.raw)!=null?ze:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ka(String((et=(Je=dt.raw)!=null?Je:dt.content)!=null?et:""),Ct,96);case"thematic_break":return 24;default:return ka(String((ct=(St=dt.raw)!=null?St:dt.content)!=null?ct:""),Ct,40)}})(M))}function ka(M,H,K,G=22){const oe=String(M??"");if(!oe)return K;const be=Math.max(18,Math.floor(Math.max(320,H)/8)),Me=oe.split(/\r?\n/).length,Ne=Math.ceil(oe.length/be),He=Math.max(1,Me,Ne);return Math.max(K,Math.ceil(He*G+12))}function Hc(M){const H=Number(M);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function Cm(){var M,H;const K=ot.value.length,G=Hc(U.value||yt("getFallbackHeightPrefix.clientWidth",()=>{var Ne;return((Ne=S.value)==null?void 0:Ne.clientWidth)||0})),oe=((M=s.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(s.virtualScroll.measurementKey),be=[K,vn.count,Math.round(vn.total),Math.round(100*Ms.value),oe,G,an.value?1:0,CS.value,V.value].join(":");if(!km&&Pk===be)return Dk;const Me=new Array(K+1);Me[0]=0;for(let Ne=0;Ne<K;Ne++)Me[Ne+1]=Me[Ne]+(an.value?Wd(Ne):(H=Vt[Ne])!=null?H:Ms.value);return Dk=Me,Pk=be,km=!1,Me}function Yk(M){var H,K;const G=ot.value.length;if(G<=0||M<=0)return 0;const oe=Cm();if(M>=((H=oe[G])!=null?H:0))return G-1;let be=0,Me=G-1,Ne=G-1;for(;be<=Me;){const He=be+Me>>1;((K=oe[He+1])!=null?K:0)>=M?(Ne=He,Me=He-1):be=He+1}return Ne}function Nr(M,H){var K,G;if(M>=H)return 0;if(an.value)return(function(Me,Ne){var He,Fe;const Ue=ot.value.length,We=Ts(Math.trunc(Me),0,Ue),Re=Ts(Math.trunc(Ne),We,Ue);if(We>=Re)return 0;const ze=Cm();return((He=ze[Re])!=null?He:0)-((Fe=ze[We])!=null?Fe:0)})(M,H);if($n.value!==ot.value.length){let Me=0;for(let Ne=M;Ne<H;Ne++)Me+=(K=Vt[Ne])!=null?K:Ms.value;return Me}const oe=ks.value,be=bs.value;if(!oe.length||!be.length){let Me=0;for(let Ne=M;Ne<H;Ne++)Me+=(G=Vt[Ne])!=null?G:Ms.value;return Me}return Ld(oe,M,H)+(H-M-Ld(be,M,H))*Ms.value}Ke(()=>ot.value.length,M=>{Yo(),M<=0?Fd():(M<$n.value&&gm(M),M!==$n.value&&$d(M))},{immediate:!0});const ZM=P(()=>{if(!Ot.value)return ot.value.map((G,oe)=>({node:G,index:oe}));const M=ot.value.length,H=Ts(Es.start,0,M),K=Ts(Es.end,H,M);return ot.value.slice(H,K).map((G,oe)=>({node:G,index:H+oe}))}),Am=P(()=>Ot.value?Nr(0,Math.min(Es.start,ot.value.length)):0),Mm=P(()=>{if(!Ot.value)return 0;const M=ot.value.length;return Nr(Math.min(Es.end,M),M)});function Zk(){if(!an.value)return 0;let M=0;const H=Cl.value;for(let K=0;K<H.length;K++){if(!H[K])continue;const G=Vt[K];Number.isFinite(G)&&G>0||M++}return M}function Qk(){const M=ot.value.length;return{totalNodes:M,measuredCount:vn.count,estimatedCount:Zk(),averageNodeHeight:Ms.value,topSpacerHeight:Am.value,bottomSpacerHeight:Mm.value,estimatedTotalHeight:Nr(0,M),width:Al()}}function QM(){const M=ot.value,H=Qk();return Bt(it({},H),{probe:{paragraphReady:!!re.value.paragraph,listItemReady:!!re.value.listItem,listWrapperOverhead:re.value.listWrapperOverhead,headingReadyLevels:Object.entries(re.value.headings).filter(([,K])=>!!K).map(([K])=>Number(K))},nodes:M.map((K,G)=>{var oe,be,Me,Ne,He,Fe,Ue,We,Re;return{index:G,type:K.type,estimateKind:(be=(oe=Cl.value[G])==null?void 0:oe.kind)!=null?be:null,rendererKind:(Ne=(Me=Cl.value[G])==null?void 0:Me.rendererKind)!=null?Ne:null,estimatedHeight:(Fe=(He=Cl.value[G])==null?void 0:He.height)!=null?Fe:null,estimatedContentHeight:(We=(Ue=Cl.value[G])==null?void 0:Ue.contentHeight)!=null?We:null,measuredHeight:(Re=Vt[G])!=null?Re:null}})})}function Em(){return s.indexKey!=null?String(s.indexKey):ss.value?`virtual-${Dn()}`:"markdown-renderer"}function Xk(M){const H=String(M),K=`${Em()}-`;if(!H.startsWith(K))return null;const G=H.slice(K.length).match(/^(\d+)(?:$|-)/);if(!G)return null;const oe=Number(G[1]);return!Number.isInteger(oe)||oe<0||oe>=ot.value.length?null:oe}function Dn(){var M,H,K;const G=(M=s.virtualScroll)==null?void 0:M.sessionKey;return String(G!=null&&G!==""?G:(K=(H=s.indexKey)!=null?H:x.customId)!=null?K:nn)}function ps(){var M;const H=(M=s.virtualScroll)==null?void 0:M.threadKey;return H==null||H===""?void 0:String(H)}function Tm(M){var H;return(M??"")===((H=ps())!=null?H:"")}function XM(){var M;const H=(M=s.virtualScroll)==null?void 0:M.measurementKey;return H==null?"":String(H)}function JM(){var M,H;const K=u.value,G=K==="monaco"?x.codeBlockMonacoOptions:void 0,oe=x.codeBlockProps,be=K==="shiki";return[x.isDark?"dark":"light",K==="monaco"?"code-rich":K==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",xs(x.codeBlockMinWidth),xs(x.codeBlockMaxWidth),...be?[Zh((M=oe?.themes)!=null?M:x.themes,(H=oe?.langs)!=null?H:x.langs)]:[],xs(G?.fontSize),xs(G?.lineHeight),xs(G?.fontFamily),xs(G?.tabSize),xs(G?.MAX_HEIGHT),xs(G?.wordWrap),xs(G?.wrappingIndent),xs(G?.padding),xs(oe?.showHeader),xs(oe?.showCopyButton),xs(oe?.showExpandButton),xs(oe?.showPreviewButton),xs(oe?.showCollapseButton),xs(oe?.showFontSizeButtons)].join("\0")}function Vi(){return[XM(),JM()].join("\0")}function Al(){return fi()}const zd=P(()=>Hc(Al())),No=P(()=>[Vi(),zd.value].join("\0")),e8=P(()=>{var M;return ss.value?["virtual",(M=ps())!=null?M:"",Dn(),No.value].join("\0"):s.indexKey});function ba(){Bk.value+=1}function Nm(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=ot.value.length||M.sessionKey!==Dn()||M.threadKey!==ps()||M.layoutEpochKey!==No.value)}function Jk(M){const H=String(M),K=Ti.get(H);return K?Nm(K)?K.index:null:Xk(H)}function e2(M="async-node"){(Eo.size||Ti.size)&&(Eo.clear(),Ti.clear(),ba(),Ln(M))}const xa=Ut(Hg,null),Im={reportHeight(M,H){if(!Lt.value)return;const K=Jk(M);if(K==null)return;const G=Ei.get(K);if(!G)return;const oe=Number(H),be=Ik(K,G);Nk(K,Number.isFinite(oe)&&oe>0?Math.max(oe,be||0):be)},markPending(M){if(!Lt.value)return;const H=Xk(M);H!=null&&(function(K,G){var oe;const be=Ti.get(K);if(be&&Nm(be))return Eo.set(K,Math.max(0,(oe=Eo.get(K))!=null?oe:0)+1),ba(),void Ln("async-node");Eo.set(K,1),Ti.set(K,(function(Me){return{index:Me,sessionKey:Dn(),threadKey:ps(),layoutEpochKey:No.value}})(G)),ba(),Ln("async-node")})(String(M),H)},markSettled(M){if(!Lt.value)return;const H=String(M),K=Jk(M);(K!=null||(function(G){return Eo.has(String(G))})(H))&&(function(G){var oe;const be=(oe=Eo.get(G))!=null?oe:0;return!(be<=0||(be<=1?(Eo.delete(G),Ti.delete(G)):Eo.set(G,be-1),ba(),be===1&&Ln("async-node"),0))})(H)&&K!=null&&Ki()}};function t8(){let M=0;for(const H of Ei.values())M+=yt("getVisibleDomHeight.offsetHeight",()=>{var K;return(K=H?.offsetHeight)!=null?K:0});return Math.ceil(Math.max(0,M))}An(Hg,{reportHeight(M,H){Im.reportHeight(M,H),xa?.reportHeight(M,H)},markPending(M){Im.markPending(M),xa?.markPending(M)},markSettled(M){Im.markSettled(M),xa?.markSettled(M)}});let $m,Lm=null,_a=null;function Ud(M){return M!==!1&&M!=null&&M!==""}function t2(){return Ot.value?(function(){if(!Ot.value)return!0;const M=ot.value.length,H=Ts(Es.start,0,M),K=Ts(Es.end,H,M);if(H>=K)return!0;for(let G=H;G<K;G++)if(!Bn.has(G)||e1(G)&&!Ei.has(G))return!1;return!0})():Vn.value>=Rd.value}function Fm(){return q.value===!0&&!J.value&&ym.value===0&&Er.size===0&&qi.size===0&&To==null&&t2()}function n2(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.settleMode)!=="manual"||Lm===Dn()&&$m===ps())return!0;const K=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!Ud(K)&&_a===eu(K)}function Om(){return Fm()&&n2()}function n8(M,H){return H.totalNodes<=0?M==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?M==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function Ml(M="manual",H){const K=Qk(),G=(function(oe){return oe||(q.value!==!0?ot.value.length>0?"streaming":"estimating":!t2()||qi.size>0||To!=null?"measuring":Om()?"settled":"settling")})(H);return{sessionKey:Dn(),threadKey:ps(),phase:G,nodeCount:K.totalNodes,liveRange:{start:Es.start,end:Es.end},renderedCount:Vn.value,measuredCount:K.measuredCount,estimatedCount:K.estimatedCount,averageNodeHeight:K.averageNodeHeight,topSpacerHeight:K.topSpacerHeight,bottomSpacerHeight:K.bottomSpacerHeight,visibleDomHeight:t8(),totalHeight:s2(),width:K.width,final:q.value===!0,stable:Om(),confidence:n8(G,K),reason:M}}function Wc(){const M=me.value||fe(),H=S.value;if(!M||!H)return null;const K=M.ownerDocument||H.ownerDocument||document,G=M===K.documentElement||M===K.body||M===K.scrollingElement,oe=yt("getScrollBox.scrollTop",()=>se(M,K,G)),be=yt("getScrollBox.scrollHeight",()=>{var Ne,He,Fe,Ue,We;return G?Math.max((He=(Ne=K.documentElement)==null?void 0:Ne.scrollHeight)!=null?He:0,(Ue=(Fe=K.body)==null?void 0:Fe.scrollHeight)!=null?Ue:0,(We=M.scrollHeight)!=null?We:0):M.scrollHeight}),Me=yt("getScrollBox.clientHeight",()=>{var Ne;return G?((Ne=K.documentElement)==null?void 0:Ne.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:K,isViewportRoot:G,scrollTop:oe,scrollHeight:be,clientHeight:Me}}function s2(){const M=ot.value.length,H=Math.max(0,Nr(0,M)),K=yt("getRendererLogicalHeight.offsetHeight",()=>{var oe,be;return(be=(oe=S.value)==null?void 0:oe.offsetHeight)!=null?be:0}),G=Math.max(0,K>0?K:yt("getRendererLogicalHeight.scrollHeight",()=>{var oe,be;return(be=(oe=S.value)==null?void 0:oe.scrollHeight)!=null?be:0}));return M<=0?Math.ceil(K):Ot.value?H>0?Math.max(1,Math.ceil(H),(function(){let oe=Am.value+Mm.value;for(const be of Bn.values())be&&(oe+=Math.max(0,yt("getVirtualizedDomLogicalHeight.offsetHeight",()=>be.offsetHeight||0)));return Math.ceil(Math.max(0,oe))})(),(function(oe,be){return oe<=0||be<=0?0:be<=oe+Math.max(512,.05*oe)?Math.ceil(be):0})(H,G)):Math.max(1,Math.ceil(G)):Lt.value?H>0||vn.count>0||Zk()>0?(Ao.value&&Vn.value,Math.max(1,Math.ceil(G),Math.ceil(H))):Math.ceil(G):Math.max(1,Math.ceil(G),Math.ceil(H))}function o2(M){const H=S.value;if(!H)return null;const K=yt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(oe){return oe.isViewportRoot?oe.clientHeight:yt("getViewportBottomInRoot.getBoundingClientRect",()=>oe.root.getBoundingClientRect().bottom)})(M)-K.bottom}function s8(M={}){const H=M.requireViewport!==!1,K=(function(be=64){const Me=Wc(),Ne=S.value;if(!Me||!Ne)return!1;const He=(function(Ue){if(Ue.isViewportRoot)return{top:0,bottom:Ue.clientHeight};const We=yt("getVirtualViewportRect.getBoundingClientRect",()=>Ue.root.getBoundingClientRect());return{top:We.top,bottom:We.bottom}})(Me),Fe=yt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ne.getBoundingClientRect());return Fe.bottom>=He.top-be&&Fe.top<=He.bottom+be})();if(H&&!K)return null;const G=(function(){const be=Wc(),Me=S.value;if(!be||!Me||Math.max(0,be.scrollHeight-be.scrollTop-be.clientHeight)>64)return null;const Ne=o2(be);return Ne==null?null:Ne>=-8&&Ne<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ne)}:null})();if(G)return{anchor:G,captured:!0};const oe=Qt();if(oe)return{anchor:{type:"node",nodeIndex:oe.nodeIndex,offsetWithinNodePx:oe.offsetWithinNodePx},captured:K};if(M.allowFallback===!0){const be=(function(){const Me=ot.value.length;return Me<=0?null:{type:"node",nodeIndex:Ts(Go.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return be?{anchor:be,captured:!1}:null}return null}function Rm(M){let H=2166136261;for(let K=0;K<M.length;K++)H^=M.charCodeAt(K),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function o8(M,H){let K=M;for(let G=0;G<H.length;G++)K^=H.charCodeAt(G),K=Math.imul(K,16777619);return K^=31,K=Math.imul(K,16777619),K}const i8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function jd(M,H=new WeakSet,K=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(G){const oe=G.length>8192?`${G.slice(0,8192)}...${G.length}`:G;return`${G.length}:${Rm(oe)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(H.has(M))return"cycle";if(K>=6)return"max-depth";H.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Fe=[];for(let Ue=0;Ue<M.length;Ue++)Fe.push(jd(M[Ue],H,K+1));return`a:${M.length}:${Fe.join(",")}`}const be=[],Me=[],Ne=Math.max(0,M.length-32);let He=2166136261;for(let Fe=0;Fe<M.length;Fe++){const Ue=jd(M[Fe],H,K+1);He=o8(He,Ue),Fe<32&&be.push(Ue),Fe>=Ne&&Me.push(Ue)}return[`a:${M.length}`,`h=${be.join(",")}`,`t=${Me.join(",")}`,`all=${(He>>>0).toString(36)}`].join(":")}const G=M,oe=Object.keys(G).filter(be=>{const Me=G[be];return be!=="parent"&&be!=="el"&&be!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||i8.has(be))}).sort();return`o:${oe.length}:${oe.map(be=>`${be}=${jd(G[be],H,K+1)}`).join(";")}`}finally{H.delete(M)}}let i2=-1,Bm="";function zc(M){const H=ot.value[M];return H?Rm(jd(H)):""}function Dm(){const M=V.value;if(i2===M)return Bm;let H=2166136261;for(let K=0;K<ot.value.length;K++){const G=zc(K);for(let oe=0;oe<G.length;oe++)H^=G.charCodeAt(oe),H=Math.imul(H,16777619)}return Bm=(H>>>0).toString(36),i2=M,Bm}function wa(M,H={}){var K;const G=H.includeHeightCache===!0,oe=(K=H.includeContentHash)!=null?K:G,be=G?(function(Ne){const He=(function(){var et,St;const ct=Number((St=(et=s.virtualScroll)==null?void 0:et.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(He)||Ne.length<=He)return Ne;const Fe=new Map,Ue=et=>{!et||Fe.size>=He||Fe.set(et.index,et)},We=ot.value.length,Re=Ts(Es.start-2*Dc.value,0,We),ze=Ts(Es.end+2*Dc.value,Re,We);for(const et of Ne)et.index>=Re&&et.index<ze&&Ue(et);const Je=Math.max(1,Math.ceil(Ne.length/He));for(let et=0;et<Ne.length&&Fe.size<He;et+=Je)Ue(Ne[et]);for(let et=Ne.length-1;et>=0&&Fe.size<He;et-=Je)Ue(Ne[et]);return Array.from(Fe.values()).sort((et,St)=>et.index-St.index).slice(0,He)})(qM().map(Ne=>{var He;const Fe=ot.value[Ne.index];return Fe?Bt(it({},Ne),{nodeType:String((He=Fe.type)!=null?He:""),signature:zc(Ne.index)}):null}).filter(Ne=>!!Ne)):[],Me=s8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Me||be.length||H.includeEmptyState===!0?Bt(it({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:oe?Dm():void 0,measurementKey:Vi()||void 0,heightCache:be.length?be:void 0}):null}function Pm(M){var H,K;const G=Wc();if(!G)return;const oe=(function(Ne){const He=S.value;if(!He)return null;const Fe=ge(He,Ne.root),Ue=ot.value.length,We=yt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>He.offsetHeight||0),Re=Math.max(0,We>0?We:Ue>0?yt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>He.scrollHeight||0):0),ze=s2();return Fe+Math.max(Re,ze)})(G);if(oe==null)return;const be=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,oe-G.clientHeight-be);(function(Ne){ee=Kc()+120,_e=Ne})(Me),G.isViewportRoot?(K=(H=G.doc.defaultView)==null?void 0:H.scrollTo)==null||K.call(H,0,Me):TS(G.root,G.doc,Me,{isReverseFlexScrollRoot:j,getNormalizedScrollTop:se})}const Hm=[];function r2(){if(Z)for(lt!=null&&(Hn?.(lt),lt=null);Hm.length;){const M=Hm.pop();M!=null&&window.clearTimeout(M)}}function Sa(M){const H=!!je.value;je.value=null,ee=0,_e=null,r2(),H&&M&&Ln(M)}function Ca(){if(!je.value||!Z||lt!=null)return;const M=()=>{lt=null;const H=je.value;H&&Pm(H)};lt=On?On(M):null,lt==null&&M()}function l2(M,H={}){const K=ot.value.length;return K<=0?[]:M.filter(G=>!(!Number.isInteger(G.index)||G.index<0||G.index>=K)&&!(!Number.isFinite(G.height)||G.height<=0)&&!(H.requireSignature&&!G.signature)&&!(H.requireCompatibilityMetadata&&!G.nodeType&&!G.signature)&&(function(oe){var be;const Me=ot.value[oe.index];return!(!Me||oe.nodeType&&oe.nodeType!==String((be=Me.type)!=null?be:"")||oe.signature&&oe.signature!==zc(oe.index))})(G))}function a2(M){const H=Hc(Al()),K=Hc(M);return H!==-1&&K!==-1&&H===K}function Wm(M){var H;const K=Number(M?.width);if(Number.isFinite(K)&&K>0)return K;const G=Number((H=M?.metrics)==null?void 0:H.width);return Number.isFinite(G)&&G>0?G:null}function c2(M){var H;return M.sessionKey===Dn()&&!!Tm(M.threadKey)&&((H=M.measurementKey)!=null?H:"")===Vi()&&!!a2(Wm(M))&&!!(function(K){const G=K.heightCache;return!!G?.length&&(u2(K)?G.some(oe=>!!(oe.nodeType||oe.signature)):G.some(oe=>!!oe.signature))})(M)}function u2(M){return!!(M.contentHash&&M.contentHash===Dm())}function r8(M){return!u2(M)}let El=null,Tl=null,qd=null,Uc=null,jc=null;function zm(M){var H;const K=M.map(oe=>{var be,Me;return[oe.index,Math.round(10*oe.height),(be=oe.nodeType)!=null?be:"",(Me=oe.signature)!=null?Me:""].join("")}).join(""),G=Hc(Al());return[(H=ps())!=null?H:"",Dn(),Vi(),ot.value.length,G,M.length,Rm(K)].join(":")}function d2(M=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Lt.value||!M?.length||ot.value.length<=0||!a2((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const K=l2(M,{requireSignature:!0});if(!K.length)return!1;const G=zm(K);return G===El?(Tl="standalone",!0):($k(K,{mode:"merge"}),Yo(),El=G,Tl="standalone",Yc(),Ln("restore"),!0)}function Um(M,H={}){var K,G,oe;if(!Lt.value||!M||M.sessionKey!==Dn()||!Tm(M.threadKey)||ot.value.length<=0)return!1;const be=!!((K=M.heightCache)!=null&&K.length)&&!Vd(),Me=!M.anchor||M.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:M.anchor,Ne=H.restoreAnchor===!0&&!!Me&&!Vd()&&Number(Wm(M))>0;let He=!1;if((G=M.heightCache)!=null&&G.length&&c2(M)){const Ue=l2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:r8(M)});Ue.length&&($k(Ue,{mode:"merge"}),Yo(),El=zm(Ue),Tl="restore",Yc(),He=!0)}if(be||Ne)return!1;if(!H.restoreAnchor||!Me)return He&&Ln("restore"),!0;const Fe=(function(Ue,We){var Re;const ze=Ue.anchor,Je=ze?ze.type==="bottom"?`bottom:${Math.round(ze.distanceFromBottomPx)}`:`node:${ze.nodeIndex}:${Math.round(ze.offsetWithinNodePx)}`:"none";return[(Re=ps())!=null?Re:"",Dn(),Vi(),zd.value,We,Je].join(":")})(M,(oe=H.restoreToken)!=null?oe:"imperative");return qd===Fe?(He&&Ln("restore"),!0):(qd=Fe,(function(Ue){const We=()=>{if(Ue.type==="node")return Sa(),void As({nodeIndex:Ue.nodeIndex,offsetWithinNodePx:Ue.offsetWithinNodePx});if(Nt(),Ae.value=null,je.value=Ue,r2(),Pm(Ue),Z)for(const Re of[0,120,280,480])Hm.push(window.setTimeout(()=>{const ze=je.value;ze&&Pm(ze)},Re))};(function(Re){if(!Ot.value)return!1;const ze=ot.value.length;return!(ze<=0||(Go.value=Re.type==="node"?Ts(Re.nodeIndex,0,ze-1):ze-1,wl(),0))})(Ue)?pt(We):We()})(Me),Ln("restore"),!0)}function Vd(){const M=Al();return Number.isFinite(M)&&M>0}function f2(M){var H;return M.sessionKey===Dn()&&!!Tm(M.threadKey)&&(ot.value.length<=0||!(!((H=M.heightCache)!=null&&H.length)||Vd())||!(!(M.anchor&&Number(Wm(M))>0)||Vd()))}function jm(){Le.clear();for(const M of Object.keys(Vt)){const H=Number(M);Number.isInteger(H)&&H>=0&&H<ot.value.length&&Tk(H)}}function qc(){To!=null&&(Hn?.(To),To=null),t1()}function h2(){return!Z||Xn?Promise.resolve():new Promise(M=>{let H=!1,K=null;const G=()=>{H||(H=!0,K!=null&&window.clearTimeout(K),M())};if(On)return On(G),void(K=window.setTimeout(G,50));K=window.setTimeout(G,0)})}function qm(M,H=ps(),K=No.value){return Dn()===M&&ps()===H&&No.value===K}function Vm(){return zn(this,arguments,function*(M={}){var H,K,G,oe,be;const Me=Dn(),Ne=ps(),He=No.value,Fe=(H=M.frames)!=null?H:2,Ue=(K=M.timeoutMs)!=null?K:120,We=(G=M.reason)!=null?G:"manual",Re=M.expectedSettledTokenKey,ze=M.flushPendingTimers===!0,Je=Ml(We),et=()=>Bt(it({},Je),{phase:Je.final?"settling":Je.phase,stable:!1,confidence:Je.confidence==="final"?"mixed":Je.confidence,reason:We}),St=()=>qm(Me,Ne,He)&&(Re==null||Gc()===Re);for(let Ct=0;Ct<Fe;Ct++){if(yield pt(),!St()||(yield h2(),!St()))return et();Ki(),qc()}if(yield(function(Ct){return!Z||Ct<=0?Promise.resolve():new Promise(Jt=>window.setTimeout(Jt,Ct))})(Ue),!St()||(ze&&Wk(),Ki(),qc(),!St()))return et();const ct=Fm();ct&&(Lm=Me,$m=Ne,((oe=s.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&Re!=null&&Ud((be=s.virtualScroll)==null?void 0:be.settledToken)&&Gc()===Re&&(_a=eu(s.virtualScroll.settledToken)));const dt=St()&&ct&&n2(),At=Ml(We,dt?"final":void 0);return Qm(At,!0),At})}let Km="content",Nl=null,Il=null,Gm=0,Vc=null,Aa=null,Ym=null,Zm=null;function Kc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function p2(M){var H,K;const G=Vc;if(!G)return!0;const oe=(K=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?K:1;return Math.abs(M.totalHeight-G.totalHeight)>oe||M.sessionKey!==G.sessionKey||M.phase!==G.phase||M.stable!==G.stable||M.final!==G.final||M.threadKey!==G.threadKey||M.nodeCount!==G.nodeCount||M.measuredCount!==G.measuredCount||M.width!==G.width}function xs(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function Gc(M=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return xs(M)}function m2(M,H){var K,G;return[M,H.sessionKey,(K=H.threadKey)!=null?K:"",Vi(),Dm(),xs((G=s.virtualScroll)==null?void 0:G.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function Yc(){Ym=null,Zm=null,Aa=null}function l8(M){const H=M.heightCache;return H?.length?zm(H):""}function Zc(M){var H,K,G;const oe=M.metrics,be=M.anchor?(Me=M.anchor).type==="bottom"?`bottom:${Math.round(Me.distanceFromBottomPx)}`:`node:${Me.nodeIndex}:${Math.round(Me.offsetWithinNodePx)}`:"none";var Me;return[M.sessionKey,(H=M.threadKey)!=null?H:"",(K=M.measurementKey)!=null?K:Vi(),(G=M.contentHash)!=null?G:"",l8(M),be,M.anchorCaptured?1:0,oe.liveRange.start,oe.liveRange.end,oe.renderedCount,oe.nodeCount,Math.round(oe.totalHeight),Math.round(oe.width),oe.phase,oe.stable?1:0].join("\0")}function Qm(M,H=!1){if(!Lt.value||(function(Me=!1){return!Me&&ss.value&&!Vs.value})(H))return;const K=H||p2(M),G=(function(Me,Ne=!1){return Ne||Me.stable||Me.phase==="final"?{state:wa(Me,{includeHeightCache:!0})}:{state:wa(Me)}})(M,H),oe=G.state,be=!!(oe&&(K||(function(Me,Ne=!1){return!!Ne||Zc(Me)!==Aa})(oe,H)));if(K&&(E(M),Vc=M,Gm=Kc()),oe&&be&&(N(oe),oe.anchor&&F(oe.anchor),Aa=Zc(oe)),M.stable){const Me=m2("settled",M);if(Me!==Ym){Ym=Me;const Ne=wa(M,{includeHeightCache:!0});Ne&&(N(Ne),Aa=Zc(Ne)),(function(He){o("render-settled",He)})(M)}}if(M.phase==="final"){const Me=m2("final",M);if(Me!==Zm){Zm=Me;const Ne=wa(M,{includeHeightCache:!0});Ne&&(N(Ne),Aa=Zc(Ne)),(function(He){o("render-final",He)})(M)}}}function Xm(){Nl!=null&&(Hn?.(Nl),Nl=null),Il!=null&&Z&&(window.clearTimeout(Il),Il=null)}function g2(){Nl=null,Il=null,(function(M){if(qi.size>0||To!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Km)&&(Ki(),qc()),Qm(Ml(Km))}function Ln(M){var H,K;if(!Lt.value||(Km=M,Nl!=null||Il!=null))return;const G=Math.max(0,(K=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?K:32),oe=Math.max(0,G-(Kc()-Gm)),be=()=>{Il=null,Nl=On?On(g2):null,Nl==null&&g2()};Z&&oe>0?Il=window.setTimeout(be,oe):be()}function Jm(M){var H;if(M<=0)return 0;const K=ot.value;if(an.value)return Yk(M);if($n.value===K.length&&ks.value.length&&bs.value.length){const oe=Ms.value,be=ks.value,Me=bs.value,Ne=We=>We<=0?0:Ld(be,0,We)+(We-Ld(Me,0,We))*oe;let He=0,Fe=K.length-1,Ue=K.length-1;for(;He<=Fe;){const We=He+Fe>>1;Ne(We+1)>=M?(Ue=We,Fe=We-1):He=We+1}return Ue}let G=M;for(let oe=0;oe<K.length;oe++){const be=(H=Vt[oe])!=null?H:Ms.value;if(G<=be)return oe;G-=be}return Math.max(0,K.length-1)}function v2(){we.value+=1}function e1(M){return!(Ao.value&&M>=Vn.value)&&(!Ar.value||M<Ks.value||xm.value.has(M))}function Ma(M){const H=Pd.get(M);H&&(H(),Pd.delete(M));const K=ya.get(M);K&&(K.destroy(),ya.delete(M)),Hd(M)}function y2(M,H){let K=!1;if(H){const be=Bn.get(M);Bn.set(M,H),be!==H&&(K=!0)}else Bn.delete(M)&&(K=!0);if(K&&v2(),H||Hd(M),!Lk.value||!Cs||!Ot.value&&Ar.value&&!W.value&&ya.size>=640&&(W.value||(W.value=!0,_m()),!Lk.value||!Cs))return Ma(M),void(H&&Tr(M,!0));if(M<Ks.value&&!Ot.value||xm.value.has(M))return Ma(M),void Tr(M,!0);if(!H)return void Ma(M);Ma(M);const G=Cs(H,{rootMargin:"400px"});if(!G)return;ya.set(M,G),Tr(M,G.isVisible.value),Ar.value&&(function(be){if(!Z||!Ar.value)return;Hd(be);const Me=be%17*23,Ne=window.setTimeout(()=>{if(zk.delete(be),!Ar.value||xm.value.has(be))return;const He=Bn.get(be);if(!He)return;const Fe=fe(He),Ue=He.ownerDocument||document,We=Ue.defaultView||window,Re=!Fe||Fe===Ue.documentElement||Fe===Ue.body,ze=!Re&&Fe?yt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Fe.getBoundingClientRect()):null,Je=Re?0:ze.top,et=Re?yt("nodeVisibilityFallback.clientHeight",()=>{var ct,dt;return(dt=(ct=We.innerHeight)!=null?ct:Fe?.clientHeight)!=null?dt:0}):ze.bottom,St=yt("nodeVisibilityFallback.node.getBoundingClientRect",()=>He.getBoundingClientRect());St.bottom>=Je-500&&St.top<=et+500&&Tr(be,!0)},1800+Me);zk.set(be,Ne)})(M);let oe=null;oe=Ke(()=>G.isVisible.value,be=>{if(be){Hd(M),Tr(M,!0),oe?.(),Pd.delete(M),ya.get(M)===G&&ya.delete(M);try{G.destroy()}catch{}}},{immediate:!0}),Pd.set(M,oe),Ot.value&&Ni()}function t1(){To=null;for(const[M,H]of qi)qi.delete(M),Ei.get(M)===H.el&&Sl.get(M)===H.version&&Nk(M,H.height,{allowShrink:H.allowShrink})}function Ea(){To!=null&&(Hn?.(To),To=null),qi.clear()}function Kd(M,H){(function(K,G,oe){var be;if(!Number.isFinite(oe)||oe<=0||Ei.get(K)!==G)return;const Me=Sl.get(K);if(Me==null)return;const Ne=ot.value[K],He=J.value&&q.value!==!0&&!((be=s.nodes)!=null&&be.length)&&K>=ot.value.length-2,Fe=!(Ne?.loading===!0||He),Ue=qi.get(K),We=Ue?Ue.allowShrink&&Fe:Fe,Re=Ue&&!We?Math.max(Ue.height,oe):oe;qi.set(K,{height:Re,allowShrink:We,version:Me,el:G}),To==null&&(To=On?On(t1):null,To==null&&t1())})(M,H,Ik(M,H))}function Ki(){for(const[M,H]of Ei)H&&Kd(M,H)}function k2(){rt?.disconnect(),rt=null,Kn.clear()}function n1(){for(;Od.length;)Dd(Od.pop())}Ke(Vs,M=>{M&&Ln("content")},{flush:"post"}),t({getVirtualMetrics:Ml,captureVirtualState:function(M={}){var H;return wa(Ml("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(H=M.includeEmptyState)==null||H})},restoreVirtualState:function(M,H={}){const K=H.restoreAnchor===!0,G=H.restoreToken==null?"imperative":String(H.restoreToken);Uc=M,jc={restoreAnchor:K,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!Um(M,{restoreAnchor:K,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&f2(M)||(Uc=null,jc=null)},forceMeasure:function(M="manual"){return zn(this,null,function*(){yield pt(),yield h2(),Ki(),qc(),yield pt();const H=Ml(M);return Qm(H,!0),H})},settle:Vm,scrollToNode:function(M,H="start"){Sa(),Nt();const K=ot.value.length;if(K<=0)return;const G=Ts(M,0,K-1),oe=()=>{var be;const Me=at({nodeIndex:G,offsetWithinNodePx:0}),Ne=Wd(G),He=Wc(),Fe=(be=He?.clientHeight)!=null?be:0,Ue=Pe();let We=Me;if(H==="center")We=Me-Fe/2+Ne/2;else if(H==="end")We=Me-Fe+Ne;else if(H==="nearest"&&Ue!=null){if(Me>=Ue&&Me+Ne<=Ue+Fe)return;We=Me<Ue?Me:Me-Fe+Ne}st(Math.max(0,We)),Ni({immediate:!0}),Ot.value&&(Go.value=G,wl())};if(Ot.value)return Go.value=G,wl(),void pt(oe);oe()}}),Ke(()=>Bs.value,M=>{if(!M){k2();for(const H of Mr.values())for(const K of H)Dd(K);Mr.clear(),Sl.clear(),n1(),Ea()}},{immediate:!0}),Ke(q,M=>{M&&(function(){if(Z&&q.value&&Ei.size){n1();for(const H of[80,240,640]){const K=Hk(H,()=>{for(const[G,oe]of Ei)oe&&Kd(G,oe)},"final");K!=null&&Od.push(K)}}})(),Ln(M?"final":"content")}),Ke([()=>ot.value.length,()=>Vn.value],()=>{je.value&&Ca(),Ln("content")},{flush:"post",immediate:!0}),Ke([()=>Es.start,()=>Es.end],()=>{Ln("batch")},{flush:"post"});const{cleanupBatchScheduler:a8}=(function(M){const{props:H,isClient:K,isTestEnv:G,parsedNodesIdentity:oe,parsedNodeCount:be,desiredRenderedCount:Me,datasetKey:Ne,batchingEnabled:He,incrementalRenderingActive:Fe,resolvedBatchSize:Ue,resolvedInitialBatch:We,renderedCount:Re,adaptiveBatchSize:ze,previousRenderContext:Je,previousBatchConfig:et,requestFrame:St,cancelFrame:ct,hasIdleCallback:dt,cleanupNodeVisibility:At,onDatasetKeyChanged:Ct,onDatasetChanged:Jt}=M;let Tt=null,Ht=null,Pt=!1,cn=null,Io=null,Gs=0,pi=!1,Ir=!1;const $r=new Set,Ll=new Set;function B2(){if(K){Tt!=null&&(ct?.(Tt),Tt=null),Ht!=null&&(window.clearTimeout(Ht),Ht=null),Io!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Io),Io=null),Gs+=1;for(const Ds of $r)ct?.(Ds);$r.clear();for(const Ds of Ll)window.clearTimeout(Ds);Ll.clear(),Pt=!1,cn=null,pi=!1,Ir=!1}}function ef(){return typeof performance<"u"?performance.now():Date.now()}function D2(Ds){(function(Gi){var Lr;if(!Fe.value)return;const Yi=Math.max(2,(Lr=H.renderBatchBudgetMs)!=null?Lr:6),Zi=Math.max(1,Ue.value||1),mi=Math.max(1,Math.floor(Zi/4));Gi>1.2*Yi?ze.value=Math.max(mi,Math.floor(.7*ze.value)):Gi<.5*Yi&&ze.value<Zi&&(ze.value=Math.min(Zi,Math.ceil(1.2*ze.value)))})(Ds),pi=!1;const uo=Ir||Re.value<Me.value;Ir=!1,uo&&W2()}function P2(Ds,uo={}){var Gi,Lr;if(!Fe.value)return;const Yi=Me.value;if(Re.value>=Yi)return;const Zi=Math.max(1,Ds),mi=()=>{const Ia=ef();let $a=0;Tt=null,Ht=null,Io=null,Pt=!1;const La=cn??Zi;cn=null;const u1=ef();Re.value=Math.min(Yi,Re.value+La),At(Re.value),$a=ef()-u1,(function(d1,z2){if(!K)return void D2(z2);pi=!0;const U2=++Gs;pt().then(()=>{var j2;if(U2!==Gs)return;const E8=ef(),T8=Math.max(z2,E8-d1),q2=()=>{U2===Gs&&D2(T8)};if(St){let K2=!1,Qi=null;const G2=()=>{K2||(K2=!0,q2())},tf=St(()=>{$r.delete(tf),Qi!=null&&(window.clearTimeout(Qi),Ll.delete(Qi),Qi=null),G2()});return $r.add(tf),Qi=window.setTimeout(()=>{Qi!=null&&Ll.delete(Qi),Qi=null,ct?.(tf),$r.delete(tf),G2()},Math.max(32,(j2=H.renderBatchIdleTimeoutMs)!=null?j2:120)),void Ll.add(Qi)}const V2=window.setTimeout(()=>{Ll.delete(V2),q2()},0);Ll.add(V2)})})(Ia,$a)};if(!K||uo.immediate)return void mi();const Fr=Math.max(0,(Gi=H.renderBatchDelay)!=null?Gi:16);if(cn=cn!=null?Math.max(cn,Zi):Zi,!Pt){if(Pt=!0,!G&&dt&&window.requestIdleCallback){const Ia=Math.max(0,(Lr=H.renderBatchIdleTimeoutMs)!=null?Lr:120);return void(Io=window.requestIdleCallback(()=>mi(),{timeout:Ia}))}St&&!G?Tt=St(()=>{Fr!==0?Ht=window.setTimeout(()=>mi(),Fr):mi()}):Ht=window.setTimeout(()=>mi(),Fr)}}function H2(Ds,uo={}){pi?Ir=!0:Ds==null?W2():P2(Ds,uo)}function W2(){Fe.value&&P2(He.value?Math.max(1,Math.round(ze.value)):Math.max(1,Ue.value))}return Ke([oe,be,Ne,Fe,Ue,We,()=>H.renderBatchDelay],()=>{var Ds;const uo=be.value,Gi=Je.value,Lr=Ne.value,Yi=!Object.is(Lr,Gi.key),Zi=uo!==Gi.total,mi=Yi||Zi;Je.value={key:Lr,total:uo};const Fr=et.value,Ia=(Ds=H.renderBatchDelay)!=null?Ds:16,$a=Fr.batchSize!==Ue.value||Fr.initial!==We.value||Fr.delay!==Ia||Fr.enabled!==Fe.value;et.value={batchSize:Ue.value,initial:We.value,delay:Ia,enabled:Fe.value},Yi&&Ct(uo),(mi||$a||!Fe.value)&&B2(),(mi||$a)&&(ze.value=Math.max(1,Ue.value||1)),mi&&Jt();const La=Me.value;if(!uo)return Re.value=0,void At(0);if(!Fe.value)return Re.value=La,void At(Re.value);const u1=Yi||Gi.total===0;Re.value=u1||$a?Math.min(La,We.value):Math.min(Re.value,La);const d1=Math.max(1,We.value||Ue.value||uo);Re.value<La?H2(d1,{immediate:!K}):At(Re.value)},{immediate:!0}),Ke(Me,(Ds,uo)=>{Fe.value&&(typeof uo=="number"&&Ds<=uo||Ds>Re.value&&H2())}),{cleanupBatchScheduler:B2}})({props:x,isClient:Z,isTestEnv:Xn,parsedNodesIdentity:ys,parsedNodeCount:fs,desiredRenderedCount:Rd,datasetKey:e8,batchingEnabled:Mi,incrementalRenderingActive:Ao,resolvedBatchSize:qo,resolvedInitialBatch:Ks,renderedCount:Vn,adaptiveBatchSize:ji,previousRenderContext:Vo,previousBatchConfig:Ko,requestFrame:On,cancelFrame:Hn,hasIdleCallback:hi,cleanupNodeVisibility:GM,onDatasetKeyChanged:M=>{Ea(),Fd(),Yo(),Yc(),M>0&&$d(M)},onDatasetChanged:()=>{Ot.value&&Ni({immediate:!0})}});Ke([Fk,Ot,()=>S.value,()=>ae()],([M,H])=>{if(!M)return Uk(),void bm();YM(),H?Ni({immediate:!0}):bm()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,()=>Ot.value],M=>zn(null,[M],function*([H,K]){K&&H&&Z&&(yield pt(),Ni({immediate:!0}))}),{flush:"post"}),Ke(an,M=>{M&&(function(){var H;if(Xe.value&&Ze.value&&Mt.value&&((H=Dt.value)!=null&&H[1]))return;const K=mt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),G=mt({type:"list_item",children:[K],raw:"- Probe paragraph text"}),oe=mt({type:"list",ordered:!1,items:[G],raw:"- Probe paragraph text"});Xe.value=K,Ze.value=G,Mt.value=oe;const be={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)be[Me]=mt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});Dt.value=be})()},{immediate:!0}),Ke([()=>S.value,an],()=>{if(!an.value)return Sm(),void(U.value=0);qk(),Sm(),an.value&&S.value&&typeof ResizeObserver<"u"&&(Pc=new ResizeObserver(()=>{qk(),Ae.value&&Zt(),je.value&&Ca(),Ln("resize")}),Pc.observe(S.value))},{immediate:!0}),Ke([an,co,No],()=>zn(null,null,function*(){if(!an.value)return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Yo();yield pt(),(function(){if(!an.value||typeof window>"u")return re.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Yo();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=jk(wm(T.value),".paragraph-node");M.paragraph=k0(T.value,H,"pre-wrap");const K=wm(R.value),G=K?.querySelector(".paragraph-node");M.listItem=k0(R.value,G,"pre-wrap");const oe=yt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Ne;return(Ne=(Me=O.value)==null?void 0:Me.offsetHeight)!=null?Ne:0}),be=yt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Ne;return(Ne=(Me=R.value)==null?void 0:Me.offsetHeight)!=null?Ne:0});M.listWrapperOverhead=Math.max(0,oe-be);for(let Me=1;Me<=6;Me++){const Ne=jk(wm(D[Me]),`h${Me}`);M.headings[Me]=k0(D[Me],Ne,"pre-wrap")}re.value=M,Yo()})()}),{flush:"post",immediate:!0}),Ke(()=>ot.value.length,()=>{Ot.value&&Ni({immediate:!0})}),Ke([an,U],()=>{Yo(),Ot.value&&Ni({immediate:!0}),Ae.value&&Zt(),je.value&&Ca(),Ln("resize")},{immediate:!1}),Ke(()=>Ar.value,M=>{if(M)for(const[H,K]of Bn)y2(H,K);else{_m();for(const[H,K]of Bn)K&&Tr(H,!0)}},{immediate:!1}),Ke([()=>x.viewportPriority,()=>ot.value.length],([M,H])=>{M!==!1?W.value&&H<=200&&(W.value=!1):W.value=!1}),Ke(()=>Vn.value,()=>{Ot.value&&Ni({immediate:!0})}),Ke([Go,jo,Dc,()=>ot.value.length,Ot],()=>{wl()},{immediate:!0});let Qc=null,Xc=!1,Ta=null;function Jc(){Qc=null,Lm=null,$m=void 0,_a=null,Yc()}function s1(){Ea(),Fd(),Yo(),Le.clear();const M=ot.value.length;M>0&&$d(M),jm()}function o1(){Xm(),Wk(),Vc=null,El=null,Tl=null,qd=null,Uc=null,jc=null,Xc=!1,Jc(),e2("restore"),Nt(),Sa()}function eu(M){var H;return[(H=ps())!=null?H:"",Dn(),Vi(),zd.value,Gc(M),ot.value.length,Math.round(Nr(0,ot.value.length)),Math.round(Al()),vn.count,Math.round(vn.total)].join(":")}function b2(){return zn(this,null,function*(){var M,H,K,G;const oe=(M=s.virtualScroll)==null?void 0:M.settledToken,be=Gc(oe),Me=Dn(),Ne=ps(),He=No.value;if(Lt.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&Ud(oe))if(Fm()){if(eu(oe)!==_a&&!Xc){Xc=!0;try{const Fe=yield Vm({reason:"manual",expectedSettledTokenKey:be}),Ue=Gc()===be;qm(Me,Ne,He)&&Fe.sessionKey===Me&&Fe.threadKey===Ne&&Ue&&Fe.stable&&Fe.phase==="final"&&(_a=eu((K=s.virtualScroll)==null?void 0:K.settledToken))}finally{Xc=!1,yield pt();const Fe=(G=s.virtualScroll)==null?void 0:G.settledToken,Ue=Ud(Fe)?eu(Fe):"";qm(Me,Ne,He)&&Ue&&_a!==Ue&&b2()}}}else Ln("manual")})}Ke(Lt,(M,H)=>{if(M!==H){if(!M)return o1(),void Xm();o1(),s1(),Ta=No.value,Ln("content")}},{flush:"post"}),Ke([Lt,No],([M,H])=>{M?Ta!=null?Ta!==H&&(Ta=H,(function(K="resize"){Ea(),Fd(),Yo(),Le.clear();const G=ot.value.length;G>0&&$d(G),jm(),El=null,Tl=null,qd=null,Vc=null,Xc=!1,Jc(),d2(),pt(()=>{Ki(),Ae.value&&Zt(),je.value&&Ca(),Ln(K)})})("resize")):Ta=H:Ta=null},{flush:"post",immediate:!0}),Ke([Lt,()=>Dn(),()=>ps()],([M])=>{M&&(o1(),s1(),e2("content"),Ln("content"))}),Ke([Lt,()=>Dn(),()=>ps(),No,()=>ot.value.length],([M])=>{M&&(function(H="async-node"){let K=!1;for(const[G,oe]of Array.from(Ti.entries()))Nm(oe)||(Ti.delete(G),Eo.delete(G),K=!0);K&&(ba(),Ln(H))})("async-node")},{flush:"post"}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>s.indexKey,()=>V.value],([M])=>{M&&(Yc(),(function(H="content"){if(!Lt.value)return;const K=[],G=ot.value.length;for(const oe of Array.from(Le.keys())){if(oe>=G){K.push(oe);continue}const be=zc(oe),Me=Le.get(oe);Me!=null&&Me!==be&&K.push(oe),Le.set(oe,be)}for(const oe of Array.from(Le.keys()))oe>=G&&Le.delete(oe);K.length&&((function(oe,be={}){const Me=Array.from(oe,Number);jM(Me,be)>0&&(function(He){for(const Fe of He)Le.delete(Fe)})(Me)})(K,{notify:!1}),Yo(),Jc(),Ae.value&&Zt(),je.value&&Ca(),Ln(H))})("content"))},{flush:"post",immediate:!0}),Ke([Lt,()=>ot.value.length,()=>Dn(),()=>ps()],([M,H,K,G],[oe,be,Me,Ne])=>{M&&oe&&K===Me&&G===Ne&&H!==be&&Jc()},{flush:"post"}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>ot.value.length,()=>Dn(),U],()=>{d2()},{flush:"post",immediate:!0}),Ke([Lt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>ot.value.length,()=>Dn(),U],M=>zn(null,[M],function*([H,K]){if(!H||!K)return;yield pt();const G=(function(){var oe;const be=(oe=s.virtualScroll)==null?void 0:oe.restoreAnchor;return be==null||be===!1?null:be===!0?"true":String(be)})();Um(K,{restoreAnchor:G!=null,restoreToken:G??void 0})}),{flush:"post",immediate:!0}),Ke([Lt,U,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var H;if(!M)return;const K=(H=s.virtualScroll)==null?void 0:H.restoreState;K&&El&&Tl==="restore"&&(c2(K)||(s1(),El=null,Tl=null,Ln("resize")))},{flush:"post"}),Ke([Lt,()=>ot.value.length,()=>Dn(),U],M=>zn(null,[M],function*([H]){var K;const G=Uc,oe=jc;H&&G&&(yield pt(),!Um(G,{restoreAnchor:oe?.restoreAnchor===!0,restoreToken:(K=oe?.restoreToken)!=null?K:"imperative",allowUncapturedAnchor:oe?.allowUncapturedAnchor===!0})&&f2(G)||(Uc=null,jc=null))}),{flush:"post",immediate:!0}),Ke([Lt,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>Dn(),()=>ps(),No,ym,Rk,()=>Vn.value,Rd,()=>vn.count,()=>vn.total],([M,H,K])=>{if(!M||H!==!0||K==="manual"||!Om())return;const G=(function(){var oe;const be=ot.value.length;return[(oe=ps())!=null?oe:"",Dn(),Vi(),zd.value,be,Math.round(Nr(0,be)),Math.round(Al()),vn.count,Math.round(vn.total)].join(":")})();Qc!==G&&(Qc=G,Vm({reason:"final"}).then(oe=>{oe.stable||Qc!==G||(Qc=null)}))},{flush:"post",immediate:!0}),Ke([Lt,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settledToken},()=>Dn(),()=>ps(),No,ym,Rk,()=>Vn.value,Rd,()=>ot.value.length,()=>vn.count,()=>vn.total],()=>{b2()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,Ot,jo,Dc,()=>Es.start,()=>Es.end],([M,H,K,G,oe,be])=>{ke.value&&$e("virtualization",{nodes:M,virtualization:H,maxLiveNodes:K,buffer:G,focusIndex:Go.value,scroll:H?(()=>{const Me=me.value||fe();return Me?{reverse:j(Me),scrollTop:Math.round(Me.scrollTop),scrollTopAbs:Math.round(Math.abs(Me.scrollTop)),scrollHeight:Math.round(Me.scrollHeight),clientHeight:Math.round(Me.clientHeight)}:null})():null,liveRange:{start:oe,end:be},rendered:Vn.value})}),Ke([()=>x.customId],([M],H,K)=>{if(!M||zt)return;const G=(function(oe,be){return oe?(ms.controllers[oe]=be,()=>{ms.controllers[oe]===be&&delete ms.controllers[oe]}):()=>{}})(M,{captureRestoreAnchor:Qt,restoreAnchor:As,getAnchorDrift:Cr,getReport:QM});K(()=>{G()})},{immediate:!0}),es(()=>{(function(){if(Lt.value)try{Ki(),qc();const M=Ml("manual");p2(M)&&(E(M),Vc=M,Gm=Kc());const H=wa(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(N(H),H.anchor&&F(H.anchor),Aa=Zc(H))}catch{}})(),a8(),_m(),Oe(),k2();for(const M of Mr.values())for(const H of M)Dd(H);Mr.clear(),Sl.clear(),Le.clear(),n1(),Ea(),Sm(),Nt(),Sa(),Xm(),Uk(),bm()});const c8=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index11-DyrslmWY.js"),__vite__mapDeps([8,5]))).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',M),$o}}),loadingComponent:nte,delay:0}),u8=ki({loader:()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index10-RB_ZIgWs.js"),[])).default}catch(M){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',M),$o}}),loadingComponent:tte,delay:0}),d8=ki(()=>zn(null,null,function*(){try{return(yield eo(()=>import("./index7-CL9Ie_DH.js"),[])).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',M),$o}})),x2={text:Zn,paragraph:na,heading:ep,code_block:d0,list:bc,list_item:kc,blockquote:Qf,table:Hu,definition_list:Xf,footnote:Jf,footnote_reference:Po,footnote_anchor:Du,admonition:sh,vmr_container:th,hardbreak:rl,link:ro,image:il,thematic_break:eh,math_inline:Ci,math_block:g5,strong:oo,emphasis:lo,strikethrough:io,highlight:Wo,insert:xo,subscript:bo,superscript:ko,emoji:yo,checkbox:Do,checkbox_input:Do,inline_code:qs,html_inline:Ho,reference:so,html_block:Pu},f8=P(()=>Em()),_2=P(()=>ES(x.codeBlockProps)),h8=P(()=>ES(x.codeBlockProps,{omit:["langs"]})),w2=P(()=>it(it({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,monacoOptions:x.codeBlockMonacoOptions,themes:x.themes,langs:u.value==="shiki"?x.langs:void 0,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),h8.value)),S2=P(()=>it(Bt(it({},w2.value),{langs:x.langs}),_2.value));function C2(M){return typeof M=="boolean"?M:void 0}const p8=P(()=>{const M=x.codeBlockProps||{},H={},K=C2(M.showLineNumbers);K!==void 0&&(H.showLineNumbers=K);const G=C2(M.diffInline);G!==void 0&&(H.diffInline=G);const oe=(function(be){const Me=Number(be);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return oe!==void 0&&(H.reservedHeightPx=oe),H}),m8=P(()=>it(it({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),_2.value)),g8=P(()=>it({},x.mermaidProps||{})),A2=P(()=>it({},x.d2Props||{})),v8=P(()=>it({},x.infographicProps||{})),tu=P(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:gn.value.customHtmlTags})),y8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltip:Se.value}:{})),k8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),b8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),x8=P(()=>it(it({},tu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{}));function _8(M){return Array.isArray(M.children)&&M.children.length>0}const i1=P(()=>ZM.value.map(M=>{var H,K,G,oe,be,Me,Ne,He;let Fe=(function(ct){var dt,At,Ct,Jt,Tt,Ht,Pt;if(ct.type!=="code_block")return ct;const cn=ct,Io=[String((dt=cn.language)!=null?dt:""),String((At=cn.loading)!=null?At:""),String((Ct=cn.diff)!=null?Ct:""),String((Jt=cn.code)!=null?Jt:""),String((Tt=cn.originalCode)!=null?Tt:""),String((Ht=cn.updatedCode)!=null?Ht:""),String((Pt=cn.raw)!=null?Pt:"")].join("\0"),Gs=xe.get(cn);if(Gs&&Gs.signature===Io)return Gs.node;const pi=it({},cn);return xe.set(cn,{signature:Io,node:pi}),pi})(M.node);const Ue=Gd(Fe);let We=N2(Fe,Ue);if((Fe.type==="html_block"||Fe.type==="html_inline")&&We===x2[Fe.type]){const ct=Fe,dt=String((H=ct.tag)!=null?H:"").trim().toLowerCase()||r6(ct.content);if(dt){const At=Wt.value[dt];if(_n.value.has(dt)&&At)We=At,Fe=Bt(it({},ct),{type:dt,tag:dt,content:yK(ct.content,dt)});else if(l6((K=ct.content)!=null?K:ct.raw,dt)){const Ct=String((oe=(G=ct.content)!=null?G:ct.raw)!=null?oe:"");Fe.type==="html_inline"?(We=Zn,Fe={type:"text",content:Ct,raw:Ct}):(We=na,Fe={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const Re=Fe.type==="code_block"&&u.value==="pre"&&We===$o&&!r1(Wt.value,Ue);let ze=it({},(function(ct,dt,At){const Ct=dt??Gd(ct);if(ct.type==="code_block"){const Jt=Ct?r1(Wt.value,Ct):void 0;if(At&&u.value==="pre"&&!Jt&&At===$o)return p8.value;if(At&&Ct&&At===Jt)return Ct==="mermaid"?E2(ct):Ct==="infographic"?T2(ct):Ct==="d2"||Ct==="d2lang"?A2.value:S2.value;if(At&&At===Wt.value.code_block)return S2.value;if(Kk(At))return m8.value}return Ct==="mermaid"?E2(ct):Ct==="infographic"?T2(ct):Ct==="d2"||Ct==="d2lang"?A2.value:ct.type==="link"?y8.value:ct.type==="list"?k8.value:ct.type==="blockquote"?b8.value:ct.type==="table"?x8.value:ct.type==="code_block"?w2.value:tu.value})(Fe,Ue,We));const Je=Cl.value[M.index];Fe.type==="code_block"&&Je?.kind==="code-block"&&(ze=Bt(it({},ze),Re?{reservedHeightPx:(be=Je.height)!=null?be:Je.contentHeight}:{estimatedHeightPx:Je.height,estimatedContentHeightPx:Je.contentHeight})),Re||Fe.type!=="code_block"||Ue!=="mermaid"||oc(ze.estimatedPreviewHeightPx)!=null||(ze=Bt(it({},ze),{estimatedPreviewHeightPx:qg(Ug(String((Me=Fe.code)!=null?Me:"")))})),Re||Fe.type!=="code_block"||Ue!=="infographic"||oc(ze.estimatedPreviewHeightPx)!=null||(ze=Bt(it({},ze),{estimatedPreviewHeightPx:Vg(jg(String((Ne=Fe.code)!=null?Ne:"")))})),Fe.type==="math_block"&&(ze=Bt(it({},ze),{cacheScope:ns.value}));const et=(function(ct,dt){const At=String(ct.type);return!Td(At)&&Wt.value[At]===dt})(Fe,We),St=et?jy(Fe,Ye.value):void 0;return Bt(it({},M),{node:Fe,component:We,bindings:ze,customBindings:it(it({},St??{}),ze),rendersCustomNode:et,hasSlotChildren:_8(Fe),slotContent:String((He=Fe.content)!=null?He:""),isCodeBlock:Fe.type==="code_block",indexKey:`${f8.value}-${M.index}`})}));function Gd(M){var H;return M?.type==="code_block"?String((H=M.language)!=null?H:"").trim().toLowerCase():""}function r1(M,H){const K=H.trim().toLowerCase();if(K)for(const G of[K,By(K),t5(K)]){const oe=G&&M[G];if(oe)return oe}}function M2(M,H,K,G){var oe,be;const Me=it({},M.value);return oc(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=G(K(String((oe=H?.code)!=null?oe:"")),void 0,Me.maxHeight==="none"?null:(be=oc(Me.maxHeight))!=null?be:void 0)),Me}function E2(M){return M2(g8,M,Ug,qg)}function T2(M){return M2(v8,M,jg,Vg)}function N2(M,H){if(!M)return nv;const K=Wt.value,G=K[String(M.type)];if(M.type==="code_block"){const oe=H??Gd(M),be=oe?r1(K,oe):void 0;return be||(u.value==="pre"?K.code_block||$o:oe==="mermaid"?K.mermaid||c8:oe==="infographic"?K.infographic||u8:oe==="d2"||oe==="d2lang"?K.d2||d8:G||K.code_block||Gk.value)}return G||x2[String(M.type)]||nv}function l1(M){o("click",M)}function w8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",M)}function S8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",M)}function I2(M){o("mouseover",M)}function $2(M){o("mouseout",M)}const $l=Q(null),Ii=Q(!1);let nu,Na=null,a1=0,Yd=0,Zd=0;const L2=["code_block","admonition","table","math_block","html_block","image","thematic_break"],C8=new Set(L2),F2=[".typewriter-cursor",".height-estimation-probes",...L2.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function O2(M){if(!M||typeof M!="object")return!1;const H=M.type;return typeof H=="string"&&C8.has(H)}function Qd(M){var H,K;if(!M||typeof M!="object")return 0;const G=M,oe=(K=(H=G.raw)!=null?H:G.content)!=null?K:G.code;if(typeof oe=="string")return oe.length;const be=G.children;if(Array.isArray(be))return be.reduce((Ne,He)=>Ne+Qd(He),0);const Me=G.items;return Array.isArray(Me)?Me.reduce((Ne,He)=>Ne+Qd(He),0):0}function Xd(){nu&&(clearTimeout(nu),nu=void 0)}function R2(){a1+=1,Na!=null&&(Hn?.(Na),Na=null)}function Jd(){R2(),$l.value&&($l.value.style.visibility="hidden")}function A8(M){var H;if(M.nodeType!==Node.TEXT_NODE||!((H=M.textContent)!=null?H:"").trim())return!1;const K=M.parentElement;return!!K&&!K.closest(F2)}function M8(M){let H=M.lastChild;for(;H;){if(A8(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const K=H;if(!K.matches(F2)&&K.lastChild){H=K.lastChild;continue}}for(;H&&H!==M&&!H.previousSibling;)H=H.parentNode;if(!H||H===M)break;H=H.previousSibling}return null}function c1(){if(!Z||!Ii.value||Na!=null)return;const M=a1,H=()=>{Na=null,M===a1&&(function(){var K,G;if(!(Z&&Ii.value&&S.value&&$l.value))return;const oe=S.value,be=$l.value;be.style.visibility="hidden";const Me=(function(){const We=i1.value;for(let Re=We.length-1;Re>=0;Re--){const ze=We[Re];if(!ze||O2(ze.node)||!e1(ze.index))continue;const Je=Bn.get(ze.index);if(!Je)continue;const et=M8(Je);if(et)return et}return null})();if(!Me)return;let Ne=0,He=0,Fe=20,Ue=!1;if(Me?.textContent){const We=Me.textContent.length,Re=document.createRange();Re.setStart(Me,Math.max(0,We-1)),Re.setEnd(Me,We);const ze=typeof Re.getClientRects=="function"?Re.getClientRects():void 0,Je=(G=ze?.[ze.length-1])!=null?G:(K=Me.parentElement)==null?void 0:K.getBoundingClientRect();if(Je){const et=yt("typewriterCursor.root.getBoundingClientRect",()=>oe.getBoundingClientRect());Ne=Je.right-et.left+oe.scrollLeft,He=Je.top-et.top+oe.scrollTop,Fe=Je.height||Fe,Ue=!0}Re.detach()}Ue&&(be.style.transform=`translate(${Math.max(0,Ne)}px, ${Math.max(0,He)}px)`,be.style.height=`${Fe}px`,be.style.visibility="visible")})()};On?Na=On(H):H()}return Ke([pe,()=>s.content,()=>s.nodes,()=>x.typewriter,q],()=>zn(null,null,function*(){var M,H;if(!Z||ne.value||!Y.value)return;if(q.value)return Ii.value=!1,Xd(),void Jd();if((M=s.nodes)!=null&&M.length)return Ii.value=!1,Xd(),Jd(),Yd=((H=s.content)!=null?H:"").length,void(Zd=pe.value.length);const K=(function(){var Ne,He;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((Fe,Ue)=>Fe+Qd(Ue),0):((He=s.content)!=null?He:"").length})(),G=(function(){var Ne;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((He,Fe)=>He+Qd(Fe),0):pe.value.length})(),oe=!O2(ot.value[ot.value.length-1]),be=K>Yd,Me=G>Zd;if(x.typewriter===!1||!oe||!be&&!Me)return x.typewriter!==!1&&oe||(Ii.value=!1,Jd()),Yd=K,void(Zd=G);Yd=K,Zd=G,Ii.value=!0,$l.value&&($l.value.style.visibility="hidden"),Xd(),yield pt(),c1(),nu=setTimeout(()=>{nu=void 0,Ii.value=!1},3e3)}),{flush:"post",immediate:!0}),Ke(Ii,M=>zn(null,null,function*(){M?(yield pt(),c1()):Jd()}),{flush:"post"}),Ke([()=>Vn.value,()=>Es.start,()=>Es.end],()=>zn(null,null,function*(){Z&&!ne.value&&Y.value&&Ii.value&&(yield pt(),c1())}),{flush:"post"}),es(()=>{Xd(),R2(),xn.clear()}),(M,H)=>{const K=eT("NodeRenderer",!0);return C(ne)?(b(!0),I(Be,{key:0},nt(i1.value,G=>(b(),I(Be,{key:G.index},[G.rendersCustomNode?(b(),ye($s(G.component),pn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:l1,onMouseover:I2,onMouseout:$2,onCopy:H[0]||(H[0]=oe=>o("copy",oe)),onHandleArtifactClick:H[1]||(H[1]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:l1,onMouseover:I2,onMouseout:$2,onCopy:H[2]||(H[2]=oe=>o("copy",oe)),onHandleArtifactClick:H[3]||(H[3]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),I("div",{key:1,ref_key:"containerRef",ref:S,class:De(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:Ot.value},{"virtual-scroll-coordinated":Vs.value}]]),"data-custom-id":x.customId,onClick:l1,onMouseover:w8,onMouseout:S8},[So.value||Ot.value?(b(),I(Be,{key:0},[So.value?(b(),I("div",{key:0,class:"height-estimation-probes",style:qt({width:`${co.value}px`}),"aria-hidden":"true"},[w("div",{ref_key:"paragraphProbeWrapperRef",ref:T,class:"node-content","data-probe":"paragraph"},[ie(C(na),{node:Xe.value,"index-key":"probe-paragraph"},null,8,["node"])],512),w("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[w("ul",ote,[ie(C(kc),{node:Ze.value,"index-key":"probe-list-item"},null,8,["node"])])],512),w("div",{ref_key:"listProbeWrapperRef",ref:O,class:"node-content","data-probe":"list"},[ie(C(bc),{node:Mt.value,"index-key":"probe-list"},null,8,["node"])],512),(b(),I(Be,null,nt(6,G=>w("div",{key:`probe-heading-${G}`,ref_for:!0,ref:oe=>(function(be,Me){be<1||be>6||(D[be]=Me)})(G,oe),class:"node-content","data-probe":`heading-${G}`},[ie(C(ep),{node:KM(G),"index-key":`probe-heading-${G}`},null,8,["node","index-key"])],8,ite)),64))],4)):le("",!0),Ot.value?(b(),I("div",{key:1,class:"node-spacer",style:qt({height:`${Am.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],64)):le("",!0),(b(!0),I(Be,null,nt(i1.value,G=>(b(),I("div",{key:G.index,ref_for:!0,ref:oe=>y2(G.index,oe),class:"node-slot","data-node-index":G.index,"data-node-type":G.node.type},[e1(G.index)?(b(),I("div",{key:0,ref_for:!0,ref:oe=>(function(be,Me){var Ne;Me||(function(We){const Re=`${Em()}-${We}`;let ze=!1;for(const Je of Array.from(Eo.keys())){const et=Ti.get(Je);(et?.index===We||Je===Re||Je.startsWith(`${Re}-`))&&(Eo.delete(Je),Ti.delete(Je),ze=!0)}ze&&(ba(),Ln("async-node"))})(be),qi.delete(be),(function(We){var Re;const ze=((Re=Sl.get(We))!=null?Re:0)+1;Sl.set(We,ze)})(be);const He=Mr.get(be);if(He){for(const We of He)Dd(We);Mr.delete(be)}if((function(We){const Re=Kn.get(We);Re&&(rt?.unobserve(Re),Mo.delete(Re),Kn.delete(We))})(be),!Me||!Bs.value)return Ei.delete(be),void Sl.delete(be);Ei.set(be,Me);const Fe=()=>{Kd(be,Me)};queueMicrotask(Fe);const Ue=(rt||typeof ResizeObserver>"u"||(rt=new ResizeObserver(We=>{if(We.length)for(const Re of We){const ze=Mo.get(Re.target),Je=Kn.get(ze??-1);ze!=null&&Je&&Kd(ze,Je)}else Ki()})),rt);if(Ue&&(Kn.set(be,Me),Mo.set(Me,be),Ue.observe(Me)),typeof window<"u"){const We=((Ne=ot.value[be])==null?void 0:Ne.type)==="code_block"?[16,80,240,800]:q.value?[80]:[];if(We.length){const Re=We.map(ze=>Hk(ze,Fe,"node-resize")).filter(ze=>ze!=null);Re.length&&Mr.set(be,Re)}}})(G.index,oe),class:"node-content"},[G.isCodeBlock?G.rendersCustomNode?(b(),ye($s(G.component),pn({key:1,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[8]||(H[8]=oe=>o("copy",oe)),onHandleArtifactClick:H[9]||(H[9]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:2,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[10]||(H[10]=oe=>o("copy",oe)),onHandleArtifactClick:H[11]||(H[11]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),ye(cl,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[G.rendersCustomNode?(b(),ye($s(G.component),pn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[4]||(H[4]=oe=>o("copy",oe)),onHandleArtifactClick:H[5]||(H[5]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[G.hasSlotChildren?(b(),ye(K,pn({key:0,ref_for:!0},ds.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(b(),ye(K,pn({key:1,ref_for:!0},ds.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ye($s(G.component),pn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[6]||(H[6]=oe=>o("copy",oe)),onHandleArtifactClick:H[7]||(H[7]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),I("div",{key:1,class:"node-placeholder",style:qt({height:`${Wd(G.index)}px`})},null,4))],8,rte))),128)),Ii.value?(b(),I("span",{key:1,ref_key:"typewriterCursorRef",ref:$l,class:"typewriter-cursor","aria-hidden":"true"},null,512)):le("",!0),Ot.value?(b(),I("div",{key:2,class:"node-spacer",style:qt({height:`${Mm.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],42,ste))}}})),[["__scopeId","data-v-2e8e6e17"]]),_o=T5;_o.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",_o.__name,_o.name].filter(n=>!!n));for(const n of t)e.component(n,T5)};const Qy=Object.freeze(Object.defineProperty({__proto__:null,default:_o},Symbol.toStringTag,{value:"Module"})),lte={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},ate={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},cte={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},ute={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},dte={class:"admonition-title"},fte=["aria-expanded","aria-controls"],hte=["id"],sh=hn(qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=P(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Q(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(b(),I("div",{class:De(["admonition",[`admonition-${s.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(b(),I("svg",lte,[...u[1]||(u[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(b(),I("svg",ate,[...u[2]||(u[2]=[w("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(b(),I("svg",cte,[...u[3]||(u[3]=[w("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(b(),I("svg",ute,[...u[4]||(u[4]=[w("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):le("",!0),w("span",dte,B(i.value),1),s.node.collapsible?(b(),I("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),I("svg",{style:qt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,fte)):le("",!0)]),Tn(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(_o),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,hte),[[oi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);sh.install=e=>{e.component(sh.__name,sh)};const N5=()=>eo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let $f=null,pte=N5;function axe(){return zn(this,null,function*(){if($f)return $f;const e=pte;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===N5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?($f=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),$f):null})}function cxe(){return!1}function uxe(){return zn(this,null,function*(){return null})}const Lf=Q(!1);let PS=!1;function x0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function mte(){return!PS&&typeof window<"u"&&typeof document<"u"&&(PS=!0,Lf.value=x0(),new MutationObserver(()=>{Lf.value=x0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Lf.value=x0()})),Lf}const I5=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],gte=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),lv=[...I5].sort((e,t)=>t.length-e.length).join("|"),_0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${lv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${lv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),$5=/[),.;!?,。;!?)]+$/;function vte(e){const t=e.toLowerCase();return I5.some(n=>t.endsWith(`.${n}`))}function yte(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${lv}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function kte(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace($5,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=gte.has(i),a=vte(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function bte(e,t={}){const n=[];_0.lastIndex=0;let s;for(;(s=_0.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace($5,""),u=a.length-c.length;a=c;const d=kte(a,t);if(!d)continue;const f=s.index+r,p=f+a.length;n.push({...d,start:f,end:p,text:a}),u>0&&(_0.lastIndex-=u)}return n}const xte=12e4,_te=6e4,wte=32,Ste=3e4,HS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Cte(e){let t=0,n=0,s=0;HS.lastIndex=0;let o;for(;(o=HS.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=xte||n>=_te||t>=wte||s>=Ste?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Ate(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Mte(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Ete={key:1,class:"diff-wrap"},Tte={class:"diff-bar"},Nte=["aria-label","onClick"],Ite={class:"diff-pre"},$te={key:0,class:"diff-sign"},Lte={class:"diff-text"},Fte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",WS="github-light",zS="github-dark",Ote=qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){uX(),wX(),fX(),EX(),dX(new Ate),MX(new Mte);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Et(),s=Ut("resolveImage"),o=Q(null),i=e,r=P(()=>!i.streaming),l=P(()=>yte(i.text??"")),a=P(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Cte(i.text??"")),c=mte(),u=P(()=>!i.streaming),d=Ss(new Map),f=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function _(R){if(!s)return;const O=[];for(const D of[p,h]){D.lastIndex=0;let W;for(;(W=D.exec(R))!==null;)O.push(W[2]??"")}for(const D of O)!D||!m(D)||d.has(D)||f.has(D)||(f.add(D),s(D).then(W=>{d.set(D,W!==D?W:"")}).catch(()=>{d.set(D,"")}).finally(()=>{f.delete(D)}))}function k(R){if(!s)return R;const O=D=>{if(!m(D))return null;const W=d.get(D);return W===void 0?Fte:W===""?null:W};return R.replace(p,(D,W,z,V)=>{const U=O(z);return U===null?D:`${W}${U}${V}`}).replace(h,(D,W,z,V)=>{const U=O(z);return U===null?D:`${W}${U}${V}`})}Ke(()=>i.text,R=>_(R??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),O=[];let D=R.nextNode();for(;D;){const W=D,z=W.parentElement;z&&!z.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&O.push(W),D=R.nextNode()}for(const W of O){const z=bte(W.data,{aliases:l.value});if(z.length===0||!W.parentNode)continue;const V=document.createDocumentFragment();let U=0;for(const re of z){re.start>U&&V.append(document.createTextNode(W.data.slice(U,re.start)));const ae=document.createElement("button");ae.type="button",ae.className="md-file-link",ae.textContent=re.text,ae.title=re.line?`${re.path}:${re.line}`:re.path,ae.addEventListener("click",te=>{te.preventDefault(),te.stopPropagation(),i.openFile?.({path:re.path,line:re.line})}),V.append(ae),U=re.end}U<W.data.length&&V.append(document.createTextNode(W.data.slice(U))),W.parentNode.replaceChild(V,W)}}function v(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(R){let O=R.length;for(const D of["#","?"]){const W=R.indexOf(D);W!==-1&&W<O&&(O=W)}return R.slice(0,O)}function A(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const O of R){if(O.dataset.mdLinkHandled==="true"||O.closest("svg"))continue;const D=O.getAttribute("href")??"";v(D)&&(O.dataset.mdLinkHandled="true",O.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),i.openFile?.({path:y(D)})}))}}function L(){pt().then(()=>{g(),A()})}Ke(()=>i.text,L),Ke(()=>i.streaming,L);let $=null;ln(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),fn(()=>{$?.disconnect()});const x={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=P(()=>{const R=k(i.text??""),O=[];let D=0;E.lastIndex=0;let W;for(;(W=E.exec(R))!==null;){const V=W[1]??"",U=R.slice(D,W.index)+(V||"");U.trim()&&O.push({kind:"md",text:U}),O.push({kind:"diff",code:W[2]??""}),D=E.lastIndex}const z=R.slice(D);return(z.trim()||O.length===0)&&O.push({kind:"md",text:z}),O});function F(R){return R.split(`
284
+ `).map(O=>O.startsWith("@@")?{type:"hunk",sign:"",text:O}:/^\+(?!\+\+)/.test(O)?{type:"add",sign:"+",text:O.slice(1)}:/^-(?!--)/.test(O)?{type:"del",sign:"-",text:O.slice(1)}:O.startsWith(" ")?{type:"ctx",sign:"",text:O.slice(1)}:{type:"ctx",sign:"",text:O})}const S=Q(null);function T(R,O){js(R).then(D=>{D&&(S.value=O,setTimeout(()=>{S.value=null},1400))})}return(R,O)=>(b(),I("div",{ref_key:"mdRef",ref:o,class:"md"},[(b(!0),I(Be,null,nt(N.value,(D,W)=>(b(),I(Be,{key:W},[D.kind==="md"?(b(),ye(C(_o),{key:0,content:D.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":WS,"code-block-dark-theme":zS,themes:[WS,zS],"code-block-props":x,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(b(),I("div",Ete,[w("div",Tte,[O[0]||(O[0]=w("span",{class:"diff-lang"},"diff",-1)),ie(jt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:z=>T(D.code,W)},[ie(Ve,{name:S.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,Nte)]),_:2},1032,["text"])]),w("pre",Ite,[w("code",null,[(b(!0),I(Be,null,nt(F(D.code),(z,V)=>(b(),I("span",{key:V,class:De(["diff-line",`diff-${z.type}`])},[z.type!=="hunk"?(b(),I("span",$te,B(z.sign),1)):le("",!0),w("span",Lte,B(z.text),1)],2))),128))])])]))],64))),128))],512))}}),rm=ut(Ote,[["__scopeId","data-v-cb379ba3"]]),Rte={class:"tc-anim"},Bte={class:"prev-anim"},Dte={class:"prev"},Pte=qe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=P(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=P(()=>n.foldable&&o.value.length>1),r=P(()=>n.streaming||!i.value),l=P(()=>o.value.at(-1)??""),a=Q(null);return ln(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ke(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||pt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(b(),I("div",{class:De(["think",{mob:e.mobile}])},[i.value?(b(),I("div",{key:0,class:De(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[w("div",Rte,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513)]),w("div",Bte,[w("span",Dte,B(l.value),1)])],2)):(b(),I("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513))],2))}}),Hte=ut(Pte,[["__scopeId","data-v-fdc551ea"]]),Wte={class:"activity-notice",role:"status"},zte={"aria-hidden":"true"},Ute={class:"an-label"},jte=qe({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(b(),I("div",Wte,[w("span",zte,[ie(wo,{size:"sm"})]),w("span",Ute,B(e.label),1)]))}}),qte=ut(jte,[["__scopeId","data-v-0d497074"]]);function Vte(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const Kte=qe({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Et(),s=Q(!1),o=P(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=P(()=>s.value?o.value:Vte(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(b(),I("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},B(i.value),1))}}),L5=ut(Kte,[["__scopeId","data-v-9672fbd5"]]);function Gte(e){return e.length===1?`0${e}`:e}function Yte(e,t){return`${String(Number(e))}:${Gte(t)}`}const US=e=>/^\d+$/.test(e);function Zte(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[s,o,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(s==="*"&&o==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(s);if(u&&o==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(s==="0"&&o==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(o);if(s==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(US(s)&&US(o)&&c){const f=Yte(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const Qte=["data-turn-id"],Xte={class:"cn-bubble"},Jte={class:"cn-title"},ene={key:0,class:"cn-prompt"},tne={class:"cn-meta"},nne={key:0,class:"cn-meta-item"},sne={key:1,class:"cn-meta-item"},one=["aria-label"],ine=["title"],rne=qe({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Et(),s=P(()=>t.cron),o=P(()=>s.value?.missedCount!==void 0),i=P(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=P(()=>{const u=s.value?.cron;return u?Zte(u,n):""}),l=P(()=>o.value?"error":"ok"),a=P(()=>{const u=s.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=P(()=>t.text??"");return(u,d)=>(b(),I("div",{class:De(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",Xte,[w("span",Jte,B(i.value),1),c.value?(b(),I("span",ene,B(c.value),1)):le("",!0)]),w("div",tne,[ie(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(b(),I("span",nne,B(r.value),1)):le("",!0),a.value?(b(),I("span",sne,B(a.value),1)):le("",!0),w("span",{class:De(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):(b(),ye(Ve,{key:1,name:"close",size:"sm"}))],10,one),s.value?.jobId?(b(),I("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:s.value.jobId})},B(s.value.jobId),9,ine)):le("",!0),e.createdAt?(b(),ye(L5,{key:3,time:e.createdAt},null,8,["time"])):le("",!0)])],10,Qte))}}),lne=ut(rne,[["__scopeId","data-v-a62a6587"]]);function F5(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function av(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function ane(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function vi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:av(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:F5(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Wu(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function jS(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function Xy(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:jS(e.source)};case"video":return{type:"video",source:jS(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function cv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Xy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function cne(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function une(e){return{content:e.content.map(cne),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function dne(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function O5(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function fne(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function hne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(fne),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function R5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(hne),createdAt:e.created_at}}function pne(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function mne(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=pne(s);return{answers:t,method:e.method,note:e.note}}function uv(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function qS(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function zr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function za(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Qo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function gne(e){if(!e||typeof e!="object")return null;const t=e,n=zr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:zr(t,"goalId")??zr(t,"goal_id")??"goal",objective:zr(t,"objective")??"",completionCriterion:zr(t,"completionCriterion")??zr(t,"completion_criterion"),status:n,turnsUsed:za(t,"turnsUsed")??za(t,"turns_used")??0,tokensUsed:za(t,"tokensUsed")??za(t,"tokens_used")??0,wallClockMs:za(t,"wallClockMs")??za(t,"wall_clock_ms")??0,terminalReason:zr(t,"terminalReason")??zr(t,"terminal_reason"),budget:{tokenBudget:Qo(o,"tokenBudget")??Qo(o,"token_budget"),remainingTokens:Qo(o,"remainingTokens")??Qo(o,"remaining_tokens"),turnBudget:Qo(o,"turnBudget")??Qo(o,"turn_budget"),remainingTurns:Qo(o,"remainingTurns")??Qo(o,"remaining_turns"),wallClockBudgetMs:Qo(o,"wallClockBudgetMs")??Qo(o,"wall_clock_budget_ms"),remainingWallClockMs:Qo(o,"remainingWallClockMs")??Qo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function vne(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:vi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:vi(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Wu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Wu(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:av(t.payload.status),previousStatus:av(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:F5(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=gne(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:cv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Xy),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:O5(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:R5(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:uv(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:dv(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function yne(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function VS(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function dv(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function kne(e){return e.session_id}function bne(e){return e.seq}const xne="main",_ne=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function ir(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function wne(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function KS(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function Qs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Wl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Xo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Sne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=Qs(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=Qs(t,"goalId")??Qs(t,"goal_id")??"goal",r=Qs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:Qs(t,"completionCriterion")??Qs(t,"completion_criterion"),status:o,turnsUsed:Wl(t,"turnsUsed")??Wl(t,"turns_used")??0,tokensUsed:Wl(t,"tokensUsed")??Wl(t,"tokens_used")??0,wallClockMs:Wl(t,"wallClockMs")??Wl(t,"wall_clock_ms")??0,terminalReason:Qs(t,"terminalReason")??Qs(t,"terminal_reason"),budget:{tokenBudget:Xo(s,"tokenBudget")??Xo(s,"token_budget"),remainingTokens:Xo(s,"remainingTokens")??Xo(s,"remaining_tokens"),turnBudget:Xo(s,"turnBudget")??Xo(s,"turn_budget"),remainingTurns:Xo(s,"remainingTurns")??Xo(s,"remaining_turns"),wallClockBudgetMs:Xo(s,"wallClockBudgetMs")??Xo(s,"wall_clock_budget_ms"),remainingWallClockMs:Xo(s,"remainingWallClockMs")??Xo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function ic(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Cne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=Qs(t,"name")??Qs(t,"toolName")??"tool",s=pa(Ane(n)),o=Mne(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=Qs(n,"text");if(o)return w0(o);const i=Qs(n,"message");if(i)return w0(i)}const s=Qs(t,"message");if(s)return w0(s)}return null}function Ane(e){return e.replace(/_\d+$/,"")}const GS=2e3;function w0(e){return e.length>GS?`${e.slice(0,GS)}…`:e}function Mne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return nd(e,n)}function Ene(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=Qs(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ic(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),p=[];return f&&p.push({type:"taskCreated",sessionId:t,task:f}),p.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),p}const r=Cne(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ic(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function fu(e){return{...e,content:e.content.map(t=>({...t}))}}function YS(e,t,n){const s={id:ir("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Tne(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function Nne(e){return Array.isArray(e)?e.map(t=>Xy(t)):[]}function ZS(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function Ine(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function $ne(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function QS(e,t){e.messages.find(n=>n.id===t)}function Lne(e,t,n,s,o,i){const r={id:ir("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function S0(e,t){return e.messages.find(n=>n.id===t)}function XS(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function Fne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=KS(),e.set(u,d)),d}function s(u){e.set(u,KS())}function o(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){s(u);const f=n(u),p=d.promptId??ir("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=YS(f,u,p);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:p},{type:"messageCreated",message:fu(h)}]}function l(u,d,f,p){try{return c(u,d,f,p)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,p){const h=n(f),m=d,_=[],k=m?.agentId;if(typeof k=="string"&&k!==xne){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(_ne.has(u))return Ene(h,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=Nne(m?.content);if(y.length===0)break;h.currentPromptId=g;const A=Tne(h,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:fu(A)});break}case"turn.started":{const g=m?.turnId,v=h.currentPromptId??ir("pr_");h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v),h.turnTextLen=0,h.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=ir("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=YS(h,f,v);h.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:fu(y)});break}case"thinking.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const y=a(h.turnThinkLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=ZS(h,g,"thinking",v);if(A<0)break;h.turnThinkLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const y=a(h.turnTextLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=ZS(h,g,"text",v);if(A<0)break;h.turnTextLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=h.currentAssistantMsgId,v=m?.turnId,y=h.turnPromptId.get(v)??h.currentPromptId;if(!g||!y)break;const A=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};Ine(h,g,A,L,$);const x=S0(h,g);x&&x.content.length-1,h.toolStartTimes.set(A,Date.now()),x&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:x.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=$ne(m??{});g&&v&&_.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=ir("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=m?.toolCallId,A=m?.output,L=m?.isError??!1;h.toolStartTimes.get(y)??Date.now(),h.toolStartTimes.delete(y);const $=Lne(h,f,y,A,L,v);_.push({type:"messageCreated",message:fu($)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=h.currentAssistantMsgId,v=wne(m?.usage);if(h.totalInput+=v.input,h.totalOutput+=v.output,h.totalCacheRead+=v.cacheRead,h.totalCacheCreate+=v.cacheCreate,g){QS(h,g);const y=S0(h,g);y&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:XS(h),model:h.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=h.currentAssistantMsgId,v=m?.reason??"completed",y=Wl(m??{},"durationMs");if(g){QS(h,g);const $=S0(h,g);$&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:$.content.map(x=>({...x})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}h.turnCount++;const A=XS(h);_.push({type:"sessionUsageUpdated",sessionId:f,usage:A});const L=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:f,status:L,previousStatus:"running"}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{h.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:ir("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};h.subagentMeta.set(v.id,v),_.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=ic(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=ic(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=ic(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=ic(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):ir("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:yn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:A,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Sne(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=Qs(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:ir("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};h.messages.push(y),_.push({type:"messageCreated",message:fu(y)})}break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const One=new Set(["server_hello","ack","ping","resync_required","error","pong"]),JS=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated","cron.fired"]),Rne=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),Bne=new Set(["assistant.delta","thinking.delta"]);function Dne(e,t){if(One.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Bne.has(s)?Pne(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Rne.has(s)?{route:"protocol"}:JS.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:JS.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Pne(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class oh extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class Ya extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function ml(e){return e instanceof oh||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function B5(e){return e instanceof Ya||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const eC=1e3,C0=16384,A0=500,M0=50,Hne=6,Wne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,zne=/^[A-Za-z0-9+/=_-]{200,}$/;let E0=null;function Ai(){if(E0!==null)return E0;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=Qn($t.debug)==="1"),E0=e,e}const tl=[];let Une=1;const Jy=Q(0),bu=fa(!1);function jne(){return tl}function qne(){tl.length=0,Jy.value++}function _l(e){bu.value||(tl.push({id:Une++,ts:Date.now(),...e}),tl.length>eC&&tl.splice(0,tl.length-eC),Jy.value++)}function fv(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return zne.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>A0?`${o.slice(0,A0)}… [+${o.length-A0} chars]`:o}if(n!=="object")return String(e);if(t>=Hne)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,M0).map(i=>fv(i,t+1));return e.length>M0&&o.push(`[+${e.length-M0} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=Wne.test(o)?"[redacted]":fv(i,t+1);return s}function ga(e){if(e===void 0)return;const t=fv(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>C0)return{_truncated:`detail JSON was ${n.length} chars; first ${C0} kept`,preview:n.slice(0,C0)}}catch{return"[unserializable detail]"}return t}function T0(e){Ai()&&_l({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ga(e.body)}})}function Ff(e){if(!Ai())return;const t=e.code!==0;_l({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:ga(e.data)}})}function hu(e){Ai()&&_l({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function Ua(e,t){Ai()&&_l({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ga(t)})}function Vne(e){if(!Ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;_l({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:ga(e)})}function Kne(e){if(!Ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);_l({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ga(t.payload)})}const Gne={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function N0(e,t,n){Ai()&&_l({source:"client",kind:`client:${e}`,label:`${Gne[e]} ${t}`,detail:ga(n)})}function ar(e,t){Ai()&&_l({source:"client",kind:"client:event",label:`· ${e}`,detail:ga(t)})}let tC=!1;function Yne(){if(!(tC||!Ai())){tC=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{N0("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;N0("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{N0(e,n.map(Zne).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Zne(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function D5(e=tl){if(typeof document>"u")return;const t=new Blob([Qne(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function Qne(e=tl){return e.map(t=>JSON.stringify(t)).join(`
285
+ `)}const ek="kimi-web.server-credential",Xne="token";let hd;const hv=new Set;function Jne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Xne);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function ese(){try{return globalThis.sessionStorage?.getItem(ek)??void 0}catch{return}}function tse(){const e=Jne();return e?(H5(e),!0):(hd=ese(),hd!==void 0)}function P5(){return hd}function H5(e){hd=e;try{globalThis.sessionStorage?.setItem(ek,e)}catch{}}function nse(){hd=void 0;try{globalThis.sessionStorage?.removeItem(ek)}catch{}}function sse(e){return hv.add(e),()=>{hv.delete(e)}}function ose(){nse();for(const e of hv)try{e()}catch{}}const Za=3e4,W5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",nC=500,ise=40101;function I0(){try{return AbortSignal.timeout(Za)}catch{return}}function rse(e,t){let n="",s=e;for(let o=0;o<t;o++)n=W5[s%32]+n,s=Math.floor(s/32);return n}function lse(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>W5[n%32]).join("")}function $0(){return`${rse(Date.now(),10)}${lse(16)}`}function ase(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function sC(e){try{const t=await e.text();return t?t.length>nC?`${t.slice(0,nC)}...`:t:void 0}catch{return}}class cse{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=Mu(this.origin,t),s=$0(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();T0({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:I0()})}catch(a){throw hu({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new Ya({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:Za,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return Ff({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),Ff({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new oh({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??s,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=Mu(this.origin,t),o=$0(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();T0({method:"POST",path:t,url:s,requestId:o,body:ase(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:I0()})}catch(u){throw hu({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new Ya({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:Za,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw hu({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Ya({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:Za,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await sC(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(Ff({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new oh({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=Mu(this.origin,n);if(o){const p=new URLSearchParams;for(const[m,_]of Object.entries(o))_!==void 0&&p.set(m,String(_));const h=p.toString();h&&(r=`${r}?${h}`)}const l=$0(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();T0({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:I0()})}catch(p){throw hu({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new Ya({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Za,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(p){throw hu({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new Ya({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Za,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await sC(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(Ff({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new oh({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=P5();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===ise)&&ose()}}const use="kimi-code.bearer.",dse=3e4;class fse{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),Ua("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=P5(),n=t!==void 0?[`${use}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{Ua("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));Kne(i),this.handleFrame(i)}catch(i){Ua("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{Ua("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{Ua("close",o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Ua("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=Of(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Of(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(Of(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,dse),s=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:s}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const s=n.payload?.heartbeat_ms;typeof s=="number"&&s>0&&(this.heartbeatMs=s),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=Of(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=Dne(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Vne(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Of(e,t){return`${e}\0${t}`}function L0(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function oC(e){return e==="auto_compact"||e==="manual_compact"}class hse{http;config;constructor(t){this.config=t,this.http=new cse(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?ane(t.status):void 0,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(vi),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return vi(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return vi(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return vi(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return vi(n)}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(cv),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:vi(n.session),messages:n.messages.items.map(cv),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(O5),pendingQuestions:n.pending_questions.map(R5)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,une(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return vi(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return vi(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(vi)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,dne(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,mne(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(uv)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return uv(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(L0)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return L0(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return L0(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(qS)])):void 0;return{items:o.items.map(qS),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Mu(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Wu)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Wu(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const s=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Wu(s)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(yne)}async listProviders(){return(await this.http.get("/providers")).items.map(VS)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return VS(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return F0(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return F0(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return F0(t)}async getConfig(){const t=await this.http.get("/config");return dv(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return dv(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return Mu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=HN(this.config.serverHttpUrl,this.config.clientId),s=Fne(),o=new fse(n,this.config.clientId,{onWireEvent:i=>{const r=kne(i),l=bne(i),a=vne(i);a.type==="historyCompacted"&&!oC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!oC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}}function F0(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let iC;function ft(){return iC??=new hse(ON()),iC}const pse=["src","controls","muted"],mse=["src","alt"],O0=qe({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=Q(t.fileId?"":t.url),s=Q(null),o=Q(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(o.value)try{const f=await ft().getFileBlob(t.fileId),p=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(p);return}i=p,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ke(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),ln(()=>{typeof IntersectionObserver=="function"&&s.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(s.value)):o.value=!0}),es(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(b(),I("video",{key:0,ref_key:"mediaEl",ref:s,class:De(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,pse)):(b(),I("img",{key:1,ref_key:"mediaEl",ref:s,class:De(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,mse))}}),gse=["aria-label"],vse=120,yse=60,kse=qe({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*vse}ms`,"--moon-frame-fast-delay":`${s*yse}ms`}}return(s,o)=>(b(),I("span",{class:De(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(b(),I(Be,null,nt(t,(i,r)=>w("span",{key:i,class:"ui-moon__frame",style:qt(n(r)),"aria-hidden":"true"},B(i),5)),64))],10,gse))}}),z5=ut(kse,[["__scopeId","data-v-a6b7ec07"]]),bse={class:"chat"},xse={key:0,class:"chat-loading"},_se={class:"chat-loading-text"},wse={key:1,class:"chat-empty"},Sse={key:1,class:"top-sentinel-text"},Cse={key:0,class:"u-turn"},Ase=["data-turn-id"],Mse={key:0,class:"u-imgs"},Ese=["aria-label","onClick"],Tse={key:1,class:"skill-act"},Nse={class:"skill-act-head"},Ise={key:0,class:"skill-act-args"},$se={key:2,class:"skill-act"},Lse={class:"skill-act-head"},Fse={key:0,class:"skill-act-args"},Ose={key:3,class:"u-text"},Rse={key:0,class:"u-meta"},Bse=["aria-label","onClick"],Dse=["aria-label","onClick"],Pse=["data-turn-id"],Hse=["onClick"],Wse={class:"cd-view"},zse={key:1,class:"cd-label"},Use=["data-turn-id"],jse={key:1,class:"msg"},qse={key:0,class:"a-msg-ft"},Vse={key:0,class:"a-duration"},Kse=["aria-label","onClick"],Gse={key:4,class:"sending-placeholder"},Yse={key:5,class:"q-stack"},Zse={class:"q-head"},Qse={class:"q-title"},Xse={class:"q-hint"},Jse=["onDragover","onDrop"],eoe={class:"u-bub q-bub"},toe=["title","onDragstart"],noe=["title","onClick"],soe={key:0,class:"u-text q-text"},ooe={key:1,class:"q-text q-text-placeholder"},ioe={key:0,class:"q-imgs"},roe={key:1,class:"q-tag q-tag-next"},loe={key:2,class:"q-tag q-tag-idx"},aoe=["aria-label","onClick"],coe=2500,uoe=qe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:s}=Et(),{confirm:o}=kl();fn(()=>{U!==null&&(clearTimeout(U),U=null),T!==null&&(clearTimeout(T),T=null),E!==null&&(clearTimeout(E),E=null)});const i=e,r=Q(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(ne=>{ne[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}ln(a),fn(()=>{l?.disconnect(),l=null}),Ke(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{pt().then(a)});const c=P(()=>{if(!i.running||i.turns.length===0)return null;const ne=i.turns.at(-1);return ne.role==="assistant"?ne.id:null}),u=P(()=>i.sending||i.running),d=n,f=Q(null),p=Q(null);function h(ne){return(ne.attachments?.length??0)>0}function m(ne){d("editQueued",ne)}function _(ne,ke){if(f.value=ne,!ke.dataTransfer)return;ke.dataTransfer.effectAllowed="move",ke.dataTransfer.setData("text/plain",String(ne));const Se=ke.currentTarget?.closest(".q-turn");Se&&ke.dataTransfer.setDragImage(Se,24,24)}function k(ne,ke){if(f.value===null)return;ke.preventDefault(),ke.dataTransfer&&(ke.dataTransfer.dropEffect="move");const Se=ke.currentTarget.getBoundingClientRect(),Ye=ke.clientY<Se.top+Se.height/2?"before":"after";p.value={index:ne,position:Ye}}function g(ne,ke){ke.preventDefault();const Se=f.value,Ye=p.value?.position??"before";if(f.value=null,p.value=null,Se===null)return;let ve=Ye==="before"?ne:ne+1;Se<ve&&(ve-=1),Se!==ve&&d("reorderQueue",{from:Se,to:ve})}function v(){f.value=null,p.value=null}const y=P(()=>{for(let ne=i.turns.length-1;ne>=0;ne--)if(i.turns[ne].role==="user")return i.turns[ne].id;return null});function A(ne){return ne.role==="user"&&ne.id===y.value&&!i.running&&!i.sending&&!ne.skillActivation&&!ne.pluginCommand}function L(ne){const ke=ne.compaction,Se=ke?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof ke?.tokensBefore=="number"&&typeof ke?.tokensAfter=="number"?Se+s("conversation.compactedTokens",{before:Gx(ke.tokensBefore),after:Gx(ke.tokensAfter)}):Se}const $=Q(null),x=Q(null);let E=null;async function N(ne){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&F(ne)}function F(ne){x.value===null&&(x.value=ne.id,d("editMessage",{text:ne.text,images:ne.images}),E=setTimeout(()=>{E=null,x.value=null},coe))}Ke(()=>i.turns,ne=>{x.value!==null&&(ne.some(ke=>ke.id===x.value)||(x.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const S=Q(!1);let T=null;function R(){if(i.turns.length===0)return;const ne=[];for(const Se of i.turns){if(Se.role==="compaction"||Se.role==="cron")continue;const Ye=Se.role==="user"?"User":"Assistant",ve=XW(Se);ve.trim()&&ne.push(`**${Ye}**
286
+
287
+ ${ve}`)}const ke=ne.join(`
288
+
289
+ ---
290
+
291
+ `);js(ke).then(Se=>{Se&&(S.value=!0,d("copyConversationCopied"),T!==null&&clearTimeout(T),T=setTimeout(()=>{T=null,S.value=!1},2e3))}).catch(()=>{})}function O(ne){const ke=[];for(let Se=ne;Se>=0;Se--){const Ye=i.turns[Se];if(!Ye||Ye.role!=="assistant")break;ke.unshift(Ye)}return ke}function D(ne){return O(ne).map(ke=>QW(ke)).filter(Boolean).join(`
292
+
293
+ `)}function W(){for(let ne=i.turns.length-1;ne>=0;ne-=1)if(i.turns[ne]?.role==="assistant")return D(ne);return""}function z(){const ne=W();ne.trim()&&js(ne).then(ke=>{ke&&(S.value=!0,d("copyConversationCopied"),T!==null&&clearTimeout(T),T=setTimeout(()=>{T=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:R,copyFinalSummary:z});function V(ne){const ke=i.turns[ne];if(!ke||ke.role!=="assistant")return!1;const Se=i.turns[ne+1];return!Se||Se.role!=="assistant"}let U=null;function re(ne){const ke=i.turns[ne];if(!ke)return;const Se=D(ne);Se.trim()&&js(Se).then(Ye=>{Ye&&($.value=ke.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function ae(ne){const ke=ne.text;ke.trim()&&js(ke).then(Se=>{Se&&($.value=ne.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function te(ne){return{kind:"image",url:ne.url,path:ne.alt,fileId:ne.fileId}}function Z(ne,ke){return ne.id!==c.value?!1:ke.sourceIndex===Hp(ne).length-1}return(ne,ke)=>(b(),I("div",bse,[e.sessionLoading?(b(),I("div",xse,[ie(wo,{size:"sm"}),w("span",_se,B(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(b(),I("div",wse)):le("",!0),e.hasMoreMessages||e.loadingMore?(b(),I("div",{key:2,ref_key:"topSentinelRef",ref:r,class:De(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(b(),I("span",Sse,[ie(wo,{size:"sm"}),Ge(" "+B(C(s)("conversation.loadingOlder")),1)])):(b(),I("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:ke[0]||(ke[0]=Se=>d("loadOlderMessages"))},B(C(s)("conversation.loadOlder")),1))],2)):le("",!0),(b(!0),I(Be,null,nt(e.turns,(Se,Ye)=>(b(),I(Be,{key:Se.id},[Se.role==="user"?(b(),I("div",Cse,[w("div",{class:De(["u-bub turn-anchor",{undoing:x.value===Se.id}]),"data-turn-id":Se.id},[Se.images&&Se.images.length>0?(b(),I("div",Mse,[(b(!0),I(Be,null,nt(Se.images,(ve,Y)=>(b(),I(Be,{key:Y},[ve.kind==="video"?(b(),ye(O0,{key:0,url:ve.url,kind:"video","file-id":ve.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(b(),I("button",{key:1,type:"button",class:"u-img-btn","aria-label":C(s)("filePreview.enlargeImage"),onClick:ce=>d("openMedia",te(ve))},[ie(O0,{url:ve.url,kind:"image",alt:ve.alt,"file-id":ve.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,Ese))],64))),128))])):le("",!0),Se.skillActivation?(b(),I("div",Tse,[w("div",Nse,[ke[9]||(ke[9]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,B(C(s)("conversation.activatedSkill",{name:Se.skillActivation.name})),1)]),Se.skillActivation.args?(b(),I("div",Ise,B(Se.skillActivation.args),1)):le("",!0)])):Se.pluginCommand?(b(),I("div",$se,[w("div",Lse,[ke[10]||(ke[10]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,"/"+B(Se.pluginCommand.pluginId)+":"+B(Se.pluginCommand.commandName),1)]),Se.pluginCommand.args?(b(),I("div",Fse,B(Se.pluginCommand.args),1)):le("",!0)])):(b(),I("div",Ose,B(Se.text),1))],10,Ase),Se.createdAt||A(Se)?(b(),I("div",Rse,[A(Se)?(b(),I("div",{key:0,class:De(["u-edit-wrap",{undoing:x.value===Se.id}])},[w("button",{type:"button",class:"u-edit","aria-label":C(s)("conversation.undoTooltip"),onClick:ve=>N(Se)},[ie(Ve,{name:"undo",size:"sm"})],8,Bse)],2)):le("",!0),Se.text.trim().length>0?(b(),I("button",{key:1,type:"button",class:"u-copy","aria-label":C(s)("filePreview.copy"),onClick:bt(ve=>ae(Se),["stop"])},[$.value!==Se.id?(b(),ye(Ve,{key:0,name:"copy",size:"sm"})):(b(),ye(Ve,{key:1,name:"check",size:"sm"}))],8,Dse)):le("",!0),Se.createdAt?(b(),ye(L5,{key:2,time:Se.createdAt},null,8,["time"])):le("",!0)])):le("",!0)])):Se.role==="compaction"?(b(),I("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":Se.id,role:"separator"},[ke[11]||(ke[11]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Se.text?(b(),I("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ve=>d("openCompaction",{turnId:Se.id})},[w("span",null,B(L(Se)),1),w("span",Wse,B(C(s)("conversation.viewSummary")),1)],8,Hse)):(b(),I("span",zse,B(L(Se)),1)),ke[12]||(ke[12]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Pse)):Se.role==="cron"?(b(),ye(lne,{key:2,text:Se.text,cron:Se.cron,"turn-id":Se.id,"created-at":Se.createdAt},null,8,["text","cron","turn-id","created-at"])):(b(),I("div",{key:3,class:"a-msg turn-anchor","data-turn-id":Se.id},[(b(!0),I(Be,null,nt(C(ZW)(Se),(ve,Y)=>(b(),I(Be,{key:C(JW)(ve,Y)},[ve.kind==="thinking"?(b(),ye(Hte,{key:0,text:ve.thinking,mobile:"",streaming:Z(Se,ve),onOpen:ce=>d("openThinking",{turnId:Se.id,blockIndex:ve.sourceIndex})},null,8,["text","streaming","onOpen"])):ve.kind==="text"&&ve.text?(b(),I("div",jse,[ie(rm,{text:ve.text,streaming:Z(Se,ve),"open-file":ce=>d("openFile",ce)},null,8,["text","streaming","open-file"])])):ve.kind==="tool-stack"?(b(),ye(rz,{key:2,tools:ve.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:ke[1]||(ke[1]=ce=>d("openMedia",ce)),onOpenFile:ke[2]||(ke[2]=ce=>d("openFile",ce)),onOpenToolDiff:ke[3]||(ke[3]=ce=>d("openToolDiff",ce)),onOpenAgent:ke[4]||(ke[4]=ce=>d("openAgent",ce))},null,8,["tools","tool-diff-panel"])):ve.kind==="tool"?(b(),ye(Q3,{key:3,tool:ve.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:ke[5]||(ke[5]=ce=>d("openMedia",ce)),onOpenFile:ke[6]||(ke[6]=ce=>d("openFile",ce)),onOpenToolDiff:ke[7]||(ke[7]=ce=>d("openToolDiff",ce)),onOpenAgent:ke[8]||(ke[8]=ce=>d("openAgent",ce))},null,8,["tool","tool-diff-panel"])):le("",!0)],64))),128)),Se.id!==c.value&&V(Ye)&&(D(Ye).trim().length>0||Se.durationMs!==void 0)?(b(),I("div",qse,[ie(jt,{text:`${Se.durationMs} ms`},{default:Ee(()=>[Se.durationMs!==void 0?(b(),I("span",Vse,B(C(KW)(Se.durationMs)),1)):le("",!0)]),_:2},1032,["text"]),D(Ye).trim().length>0?(b(),I("button",{key:0,class:"a-cpbtn","aria-label":C(s)("filePreview.copy"),onClick:ve=>re(Ye)},[$.value!==Se.id?(b(),ye(Ve,{key:0,name:"copy",size:"sm"})):(b(),ye(Ve,{key:1,name:"check",size:"sm"}))],8,Kse)):le("",!0)])):le("",!0)],8,Use))],64))),128)),e.compaction?(b(),ye(qte,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):le("",!0),u.value?(b(),I("div",Gse,[ie(z5,{fast:e.fastMoon},null,8,["fast"])])):le("",!0),e.queued.length>0?(b(),I("div",Yse,[w("div",Zse,[w("span",Qse,[ie(Ve,{name:"mail",size:"sm"}),Ge(" "+B(C(s)("composer.queueLabel"))+" · ",1),w("b",null,B(e.queued.length),1)]),w("span",Xse,B(C(s)("composer.queueAutoDrain")),1)]),(b(!0),I(Be,null,nt(e.queued,(Se,Ye)=>(b(),I("div",{key:Ye,class:De(["u-turn q-turn",{"q-dragging":f.value===Ye,"drop-before":p.value?.index===Ye&&p.value.position==="before","drop-after":p.value?.index===Ye&&p.value.position==="after"}]),onDragover:ve=>k(Ye,ve),onDrop:ve=>g(Ye,ve)},[w("div",eoe,[w("span",{class:"q-grip",title:C(s)("composer.queueDragTitle"),draggable:"true",onDragstart:ve=>_(Ye,ve),onDragend:v},[ie(Ve,{name:"grip",size:"sm"})],40,toe),w("button",{type:"button",class:"q-body",title:C(s)("composer.editQueued"),onClick:ve=>m(Ye)},[Se.text?(b(),I("span",soe,B(Se.text),1)):(b(),I("span",ooe,[ie(Ve,{name:"image",size:"sm"}),Ge(" "+B(C(s)("composer.queuedImageOnly",{n:Se.attachments?.length??0})),1)]))],8,noe),h(Se)?(b(),I("div",ioe,[(b(!0),I(Be,null,nt(Se.attachments,(ve,Y)=>(b(),ye(O0,{key:Y,url:ve.url,kind:ve.kind,"file-id":ve.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):le("",!0),Ye===0?(b(),I("span",roe,B(C(s)("composer.queueNext")),1)):(b(),I("span",loe,"#"+B(Ye+1),1)),w("button",{type:"button",class:"q-rm","aria-label":C(s)("composer.remove"),onClick:bt(ve=>d("unqueue",Ye),["stop"])},[ie(Ve,{name:"close",size:"sm"})],8,aoe)])],42,Jse))),128))])):le("",!0)]))}}),U5=ut(uoe,[["__scopeId","data-v-923f3347"]]),doe={class:"ch-id"},foe={key:0,class:"ch-ws"},hoe={key:1,class:"ch-sep"},poe=["onKeydown"],moe={class:"ch-ses"},goe={key:0,class:"ch-pill ch-sync-pill"},voe={key:0,class:"ch-ahead"},yoe={key:1,class:"ch-behind"},koe={key:1,class:"ch-pill ch-diff-pill"},boe={key:0,class:"ch-add"},xoe={key:1,class:"ch-del"},_oe=qe({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=e,i=t,r=P(()=>o.ahead??0),l=P(()=>o.behind??0),a=P(()=>o.gitDiffStats?.totalAdditions??0),c=P(()=>o.gitDiffStats?.totalDeletions??0),u=P(()=>a.value>0||c.value>0),d={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function f(V){return V.trim().toLowerCase().replaceAll("_","-")}function p(V){const U=f(V);return d[U]?`pr-${U}`:"pr-unknown"}function h(V){return n(d[f(V)]??"header.prStatusUnknown")}const m=Q(!1),_=Q(null),k=Q(null),g=Q({});function v(V){const U=V.target;k.value?.el?.contains(U)||_.value?.el?.contains(U)||L()}function y(){L()}async function A(V){if(V.stopPropagation(),m.value){L();return}m.value=!0,document.addEventListener("mousedown",v),window.addEventListener("resize",y),await pt();const U=_.value?.el,re=k.value?.el;if(!U||!re)return;const ae=U.getBoundingClientRect(),te=4,Z=8,ne=re.offsetWidth,ke=re.offsetHeight;let Se=ae.bottom+te;Se+ke>window.innerHeight-Z&&(Se=Math.max(Z,ae.top-ke-te));let Ye=ae.left;Ye+ne>window.innerWidth-Z&&(Ye=Math.max(Z,ae.right-ne)),g.value={top:`${Math.round(Se)}px`,left:`${Math.round(Ye)}px`}}function L(){m.value=!1,document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)}fn(()=>{document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)});function $(){i("copyAll"),L()}function x(){i("copyFinalSummary"),L()}const E=Q(!1);function N(){o.sessionId&&js(o.sessionId).then(V=>{V&&(E.value=!0,setTimeout(()=>{E.value=!1},1200))})}const F=Q(!1),S=Q(""),T=Q(null);async function R(){if(L(),!!o.sessionId){F.value=!0,S.value=o.sessionTitle??"",await pt();try{T.value?.focus(),T.value?.select()}catch{}}}function O(){const V=S.value.trim();V&&o.sessionId&&V!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,V),F.value=!1}function D(){F.value=!1}function W(){o.sessionId&&(L(),i("forkSession",o.sessionId))}async function z(){o.sessionId&&(L(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(V,U)=>(b(),I("header",{class:De(["chat-header",{"macos-desktop":C(pc)}])},[w("div",doe,[e.workspaceName?(b(),I("span",foe,B(e.workspaceName),1)):le("",!0),e.workspaceName&&e.sessionTitle?(b(),I("span",hoe,"/")):le("",!0),F.value?Tn((b(),I("input",{key:2,ref_key:"renameInputRef",ref:T,"onUpdate:modelValue":U[0]||(U[0]=re=>S.value=re),class:"ch-rename",type:"text",onKeydown:[bi(bt(O,["stop"]),["enter"]),bi(bt(D,["stop"]),["esc"])],onBlur:O,onClick:U[1]||(U[1]=bt(()=>{},["stop"]))},null,40,poe)),[[ao,S.value]]):e.sessionTitle?(b(),ye(jt,{key:3,text:e.sessionTitle},{default:Ee(()=>[w("span",moe,B(e.sessionTitle),1)]),_:1},8,["text"])):le("",!0)]),ie(Nn,{ref_key:"kebabRef",ref:_,class:De(["ch-act-more",{open:m.value}]),label:C(n)("header.options"),"aria-expanded":m.value,"aria-haspopup":"menu",onClick:U[2]||(U[2]=bt(re=>A(re),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),m.value?(b(),ye(Jl,{key:0,ref_key:"menuRef",ref:k,class:"ch-menu",style:qt(g.value),onClick:U[3]||(U[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{onClick:$},{default:Ee(()=>[Ge(B(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ie(Mn,{onClick:x},{default:Ee(()=>[Ge(B(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(b(),I(Be,{key:0},[ie(Mn,{separator:""}),ie(Mn,{onClick:N},{default:Ee(()=>[Ge(B(E.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ie(Mn,{onClick:R},{default:Ee(()=>[Ge(B(C(n)("header.renameSession")),1)]),_:1}),ie(Mn,{onClick:W},{default:Ee(()=>[Ge(B(C(n)("header.forkSession")),1)]),_:1}),ie(Mn,{danger:"",onClick:z},{default:Ee(()=>[Ge(B(C(n)("header.archiveSession")),1)]),_:1})],64)):le("",!0)]),_:1},8,["style"])):le("",!0),U[6]||(U[6]=w("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(b(),I("button",{key:1,type:"button",class:"ch-git",onClick:U[4]||(U[4]=re=>i("openChanges"))},[w("span",{class:De(["ch-branch",{"ch-detached":!e.branch}])},B(e.branch||C(n)("header.detached")),3),r.value>0||l.value>0?(b(),I("span",goe,[r.value>0?(b(),I("span",voe,"↑"+B(r.value),1)):le("",!0),l.value>0?(b(),I("span",yoe,"↓"+B(l.value),1)):le("",!0)])):le("",!0),u.value?(b(),I("span",koe,[a.value>0?(b(),I("span",boe,"+"+B(a.value),1)):le("",!0),c.value>0?(b(),I("span",xoe,"-"+B(c.value),1)):le("",!0)])):le("",!0)])):le("",!0),e.pr?(b(),I("button",{key:2,type:"button",class:De(["ch-pill ch-pr",p(e.pr.state)]),onClick:U[5]||(U[5]=re=>e.pr&&i("openPr",e.pr.url))},[ie(Ve,{name:"git-pull-request",size:"sm"}),w("span",null,"PR #"+B(e.pr.number)+" · "+B(h(e.pr.state)),1)],2)):le("",!0)],2))}}),woe=ut(_oe,[["__scopeId","data-v-141e88ee"]]),Soe={key:0,class:"slash-menu",role:"listbox"},Coe=["aria-selected","onMouseenter","onMousedown"],Aoe={class:"slash-name"},Moe={class:"slash-desc"},Eoe=qe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q([]);return Ke(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(b(),I("div",Soe,[(b(!0),I(Be,null,nt(e.items,(a,c)=>(b(),I("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:bt(u=>o("select",a),["prevent"])},[w("span",Aoe,B(a.name),1),w("span",Moe,B(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Coe))),128))])):le("",!0)}}),Toe=ut(Eoe,[["__scopeId","data-v-f60b70d9"]]),Noe={class:"mention-menu",role:"listbox"},Ioe={key:0,class:"mention-state dim"},$oe={key:1,class:"mention-state dim"},Loe=["aria-selected","onMouseenter","onMousedown"],Foe=["innerHTML"],Ooe={class:"mention-name"},Roe={class:"mention-path"},Boe=qe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=Ga("folder","sm"),r=Ga("code","sm"),l=Ga("file-text","sm"),a=Ga("image","sm"),c=Ga("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 p(h){const m=h.path;if(m.endsWith("/"))return i;const _=h.name||m.split("/").pop()||m,k=_.lastIndexOf("."),g=k>0?_.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(h,m)=>(b(),I("div",Noe,[n.loading?(b(),I("div",Ioe,B(C(o)("mention.searching")),1)):n.items.length===0?(b(),I("div",$oe,B(C(o)("mention.noMatch")),1)):(b(!0),I(Be,{key:2},nt(n.items,(_,k)=>(b(),I("div",{key:_.path,class:De(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>s("hover",k),onMousedown:bt(g=>s("select",_),["prevent"])},[w("span",{class:"mention-icon",innerHTML:p(_),"aria-hidden":"true"},null,8,Foe),w("span",Ooe,B(_.name),1),w("span",Roe,B(_.path),1)],42,Loe))),128))]))}}),Doe=ut(Boe,[["__scopeId","data-v-f4d6b958"]]),j5=[{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 Poe(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const sp="skill:";function Hoe(e){return e.startsWith(sp)?e.slice(sp.length):e}function q5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${sp}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...j5,...t]}function Woe(e,t=j5){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 Nd(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 tk(e){return e?.supportEfforts??[]}function zoe(e){return e[Math.floor(e.length/2)]}function pv(e){if(Nd(e)==="unsupported")return"off";const t=tk(e);return t.length>0?e?.defaultEffort??zoe(t):"on"}function nk(e){const t=tk(e),n=Nd(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function mv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Uoe(e){return e!=="off"}function aa(e,t){if(e===void 0)return t;const n=Nd(e);if(n==="unsupported")return"off";if(t==="off")return n==="always-on"?pv(e):"off";const s=tk(e);return s.length>0?s.includes(t)?t:pv(e):"on"}function sk(e,t){return t==="off"?"off":t==="on"?pv(e):t}const op=100;function joe(e){const t=Lp($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>op?n.slice(-op):n,o={[e]:s};return _d($t.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function qoe(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=Q(joe(o())),r=P(()=>i.value[o()??""]??[]);let l=-1,a="";function c(k){const g=o();if(l=-1,!g)return;const v=k.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const A=[...y,v],L=A.length>op?A.slice(-op):A;i.value={...i.value,[g]:L},_d($t.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,pt(()=>{const g=n.value;if(!g)return;s();const v=k.length;g.setSelectionRange(v,v)})}function f(){const k=r.value;if(k.length!==0){if(l===-1)a=t.value,l=k.length-1;else if(l>0)l-=1;else return;d(k[l])}}function p(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function h(){l=-1}function m(){return l!==-1}function _(){return r.value.length>0}return Ke(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:p,resetBrowsing:h,isBrowsing:m,hasHistory:_}}function Voe(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Q(!1),c=Q([]),u=Q(0);function d(){const p=t.value;p.startsWith("/")&&!p.includes(" ")?(c.value=Woe(p,q5(o())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(p){if(a.value=!1,p.acceptsInput){t.value=`${p.name} `,pt(()=>{const h=n.value;if(!h)return;const m=t.value.length;h.setSelectionRange(m,m),h.focus(),s()});return}t.value="",l?.(),r(p.name),i(p.name)}return{open:a,items:c,active:u,update:d,select:f}}function Koe(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=Q(!1),r=Q([]),l=Q(0),a=Q(!1);let c=null;function u(){const p=t.value,h=n.value?.selectionStart??p.length;let m=h-1;for(;m>=0&&!/\s/.test(p[m]);)m--;m++;const _=p.slice(m,h);return _.startsWith("@")?{token:_.slice(1),start:m,end:h}:null}function d(){const p=u(),h=o();if(!p||!h){i.value=!1;return}const m=p.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await h(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(p){const h=u();if(!h)return;const m=t.value;t.value=m.slice(0,h.start)+p.path+m.slice(h.end),i.value=!1,pt(()=>{const _=n.value;if(!_)return;const k=h.start+p.path.length;_.setSelectionRange(k,k),_.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Goe(e){const{sessionId:t}=e;function n(c){return Qn(gx(c))??""}function s(c,u){const d=gx(c);u?ts(d,u):Ac(d)}const o=Q(n(t())),i=Q(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ke(o,c=>{pt(r),s(t(),c)}),Ke(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),pt(r))});function l(c){o.value=c,pt(()=>{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 Yoe(e){const{uploadImage:t,sessionId:n}=e,s=Q({}),o=P(()=>s.value[n()??""]??[]),i=Q(null),r=Q(null),l=Q(!1);let a=0;function c(){return`att_${++a}`}function u(F,S){s.value={...s.value,[F]:S}}function d(F){try{URL.revokeObjectURL(F.previewUrl)}catch{}}function f(F){return F.startsWith("image/")?"image":F.startsWith("video/")?"video":null}async function p(F){const S=t();if(!S)return;const T=n()??"",R=F.map(O=>({file:O,kind:f(O.type)})).filter(O=>O.kind!==null);if(R.length!==0)for(const{file:O,kind:D}of R){const W=c(),z=URL.createObjectURL(O),V={localId:W,name:O.name,kind:D,previewUrl:z,uploading:!0};u(T,[...s.value[T]??[],V]),S(O,O.name).then(U=>{const re=s.value[T]??[];u(T,re.map(ae=>ae.localId===W?{...ae,uploading:!1,fileId:U?.fileId,error:U===null}:ae))}).catch(()=>{const U=s.value[T]??[];u(T,U.map(re=>re.localId===W?{...re,uploading:!1,error:!0}:re))})}}function h(F){const S=n()??"",T=s.value[S]??[],R=T.find(O=>O.localId===F);i.value?.localId===F&&(i.value=null),R&&d(R),u(S,T.filter(O=>O.localId!==F))}function m(F){i.value=F}function _(){i.value=null}function k(){r.value?.click()}function g(F){const S=F.target,T=Array.from(S.files??[]);p(T),S.value=""}function v(F){if(!t())return;const S=F.clipboardData;if(!S)return;const T=[],R=new Set,O=(D,W)=>{const z=`${D.size}:${D.type}:${W}`;if(R.has(z))return;R.add(z);const V=D.type.split("/")[1]??"png",U=W.includes(".")?W:`paste-${Date.now()}.${V}`;T.push(D instanceof File?D:new File([D],U,{type:D.type}))};for(const D of Array.from(S.items))if(D.kind==="file"&&f(D.type)){const W=D.getAsFile();W&&O(W,W.name||`paste-${Date.now()}.${D.type.split("/")[1]??"png"}`)}for(const D of Array.from(S.files))f(D.type)&&O(D,D.name);T.length!==0&&(F.preventDefault(),p(T))}function y(F){!t()||!Array.from(F.dataTransfer?.items??[]).some(T=>T.kind==="file")||(F.preventDefault(),l.value=!0)}function A(){l.value=!1}function L(F){if(l.value=!1,!t())return;F.preventDefault();const S=Array.from(F.dataTransfer?.files??[]);p(S)}function $(){const F=n()??"";for(const S of s.value[F]??[])d(S);u(F,[])}function x(F,S,T){const R=s.value[F]??[];R.some(O=>O.localId===S)&&u(F,R.map(O=>O.localId===S?{...O,...T}:O))}function E(F){return fetch(F).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function N(F){const S=n()??"";for(const T of s.value[S]??[])d(T);u(S,[]);for(const T of F){const R=c(),O=/^data:/i.test(T.url),D=/^blob:/i.test(T.url),W=T.name??T.kind;if(T.fileId){const z={localId:R,name:W,kind:T.kind,previewUrl:T.url,uploading:!1,fileId:T.fileId};u(S,[...s.value[S]??[],z]),!O&&!D&&ft().getFileBlob(T.fileId).then(V=>{const U=URL.createObjectURL(V);if(!(s.value[S]??[]).some(ae=>ae.localId===R)){URL.revokeObjectURL(U);return}x(S,R,{previewUrl:U})}).catch(()=>{})}else{const z=t();if(!z)continue;const V={localId:R,name:W,kind:T.kind,previewUrl:T.url,uploading:!0};u(S,[...s.value[S]??[],V]),E(T.url).then(U=>{const re=W.includes(".")?W:`${W}.${U.type.split("/")[1]??"bin"}`;return z(U,re)}).then(U=>{if(U===null){const re=s.value[S]??[];u(S,re.filter(ae=>ae.localId!==R));return}x(S,R,{uploading:!1,fileId:U.fileId})}).catch(()=>{const U=s.value[S]??[];u(S,U.filter(re=>re.localId!==R))})}}}return Ke(n,()=>{i.value=null}),ln(()=>{document.addEventListener("paste",v)}),fn(()=>{document.removeEventListener("paste",v);for(const F of Object.values(s.value))for(const S of F)d(S);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:h,openAttachmentPreview:m,closeAttachmentPreview:_,openFilePicker:k,handleFileInputChange:g,handleDragOver:y,handleDragLeave:A,handleDrop:L,clearAfterSubmit:$,loadAttachments:N}}const Zoe=["type","disabled"],Qoe={class:"ui-button__content"},Xoe=qe({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(b(),I("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?(b(),ye(wo,{key:0,size:"sm",class:"ui-button__spinner"})):le("",!0),w("span",Qoe,[In(t.$slots,"default",{},void 0,!0)])],10,Zoe))}}),Ft=ut(Xoe,[["__scopeId","data-v-e58393a8"]]),Joe={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},eie=["stroke-dasharray","stroke-dashoffset"],R0=7,tie=qe({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*R0;return(s,o)=>(b(),I("svg",Joe,[w("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:R0,fill:"none","stroke-width":"2.5"}),w("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:R0,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,eie)]))}}),nie=ut(tie,[["__scopeId","data-v-a364f1f1"]]),sie={key:0,class:"att-strip"},oie=["onClick"],iie=["src"],rie=["src","alt"],lie={key:2,class:"att-video-badge","aria-hidden":"true"},aie={class:"att-name"},cie={class:"att-err-icon"},uie=["onClick"],die={class:"att-lightbox-card"},fie=["src"],hie=["src","alt"],pie={class:"att-lightbox-name"},mie={class:"composer-card"},gie={class:"cin-wrap"},vie={class:"input-row"},yie=["placeholder","disabled"],kie=["aria-label"],bie={class:"toolbar-left"},xie=["onKeydown"],_ie=["onClick"],wie={class:"pd-check"},Sie={class:"pd-info"},Cie={class:"pd-desc"},Aie={class:"mode-label"},Mie={key:0,class:"mode-tag"},Eie={key:1,class:"mode-tag"},Tie={key:2,class:"mode-tag"},Nie={class:"mode-row-icon"},Iie={class:"mode-row-info"},$ie={class:"mode-row-name"},Lie={class:"mode-row-desc"},Fie={class:"mode-row-icon"},Oie={class:"mode-row-info"},Rie={class:"mode-row-name"},Bie={class:"mode-row-desc"},Die={class:"mode-row-icon"},Pie={class:"mode-row-info"},Hie={class:"mode-row-name"},Wie={class:"mode-row-desc"},zie={key:0,class:"mode-row-actions"},Uie={class:"toolbar-right"},jie=["aria-label"],qie={class:"ctx-num"},Vie=["onKeydown"],Kie={key:0,class:"think-suffix"},Gie=["aria-label"],Yie=["aria-label","disabled"],Zie={key:0,class:"md-section"},Qie=["onClick"],Xie={class:"md-check"},Jie={class:"md-name"},ere={class:"md-provider"},tre={key:1,class:"md-divider"},nre={key:2,class:"md-section"},sre=["onClick"],ore={class:"md-check"},ire={class:"md-name"},rre={key:3,class:"md-divider"},lre={class:"md-name"},are={key:0,class:"md-note"},cre=["aria-label"],ure=["disabled","onClick"],dre={class:"md-name"},rC=36,fre=qe({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=P(()=>s.starting?r("composer.starting"):s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Et(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Goe({sessionId:()=>s.sessionId}),p=Q(!1);function h(){p.value=!p.value,pt(()=>{u(),g(),c.value?.focus()})}function m(){p.value&&(p.value=!1,pt(u))}function _(X){if(typeof getComputedStyle>"u")return rC;const me=Number.parseFloat(getComputedStyle(X).minHeight);return Number.isFinite(me)&&me>0?me:rC}const k=Q(!1);function g(){const X=c.value;k.value=!!X&&X.scrollHeight>_(X)}Ke(a,()=>{pt(g)}),Ke(()=>s.sessionId,()=>{p.value=!1});const v=qoe({text:a,textareaRef:c,autosize:u,sessionId:()=>s.sessionId}),{open:y,items:A,active:L,update:$,select:x}=Voe({text:a,textareaRef:c,autosize:u,skills:()=>s.skills,emitCommand:X=>i("command",X),historyPush:X=>v.push(X),clearDraft:f}),{open:E,items:N,active:F,loading:S,update:T,select:R}=Koe({text:a,textareaRef:c,autosize:u,searchFiles:()=>s.searchFiles});function O(){v.resetBrowsing(),$(),T()}const{attachments:D,previewAttachment:W,fileInputRef:z,isDragOver:V,removeAttachment:U,openAttachmentPreview:re,closeAttachmentPreview:ae,openFilePicker:te,handleFileInputChange:Z,handleDragOver:ne,handleDragLeave:ke,handleDrop:Se,clearAfterSubmit:Ye,loadAttachments:ve}=Yoe({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});ln(()=>{a.value&&pt(()=>{u(),g()})}),fn(()=>{document.removeEventListener("mousedown",Rs),ue()});function Y(){c.value?.focus({preventScroll:!0})}function ce(X){ve(X)}t({loadForEdit:d,loadAttachmentsForEdit:ce,focus:Y});function fe(){const X=a.value.trim();if(D.value.some(lt=>lt.uploading))return;const me=D.value.filter(lt=>!lt.uploading&&!lt.error&&lt.fileId);if(!X&&me.length===0)return;if(v.push(X),X){const lt=Poe(X),ee=lt?q5(s.skills).some(_e=>_e.name===lt.cmd||_e.name===`/${sp}${lt.cmd.slice(1)}`):!1;if(lt&&ee){a.value="",f(),y.value=!1,m(),i("command",lt.arg?`${lt.cmd} ${lt.arg}`:lt.cmd);return}}const je={text:X,attachments:me.map(lt=>({fileId:lt.fileId,kind:lt.kind}))};W.value=null,Ye(),a.value="",f(),y.value=!1,E.value=!1,m(),i("submit",je)}function j(){if(!s.running||D.value.some(lt=>lt.uploading))return;const X=a.value.trim(),me=D.value.filter(lt=>!lt.uploading&&!lt.error&&lt.fileId);if(!X&&me.length===0&&s.queued.length===0)return;const je={text:X,attachments:me.map(lt=>({fileId:lt.fileId,kind:lt.kind}))};Ye(),v.push(X),a.value="",f(),y.value=!1,E.value=!1,m(),i("steer",je)}let se=!1,ge=null;function ue(){ge!==null&&(clearTimeout(ge),ge=null)}function pe(){ue(),se=!0}function q(){ue(),ge=setTimeout(()=>{ge=null,se=!1},0)}function J(X){return se||X.isComposing||X.keyCode===229}function he(X){if(!J(X)){if(X.key==="Escape"){if(Oe.value){X.preventDefault(),tt();return}if(de.value){X.preventDefault(),wt();return}}if(y.value){if(X.key==="ArrowDown"){X.preventDefault(),L.value=(L.value+1)%A.value.length;return}if(X.key==="ArrowUp"){X.preventDefault(),L.value=(L.value-1+A.value.length)%A.value.length;return}if(X.key==="Enter"||X.key==="Tab"){X.preventDefault();const me=A.value[L.value];me&&x(me);return}if(X.key==="Escape"){X.preventDefault(),y.value=!1;return}}if(E.value&&!S.value){if(X.key==="ArrowDown"){X.preventDefault(),F.value=(F.value+1)%Math.max(1,N.value.length);return}if(X.key==="ArrowUp"){X.preventDefault(),F.value=(F.value-1+Math.max(1,N.value.length))%Math.max(1,N.value.length);return}if(X.key==="Enter"||X.key==="Tab"){X.preventDefault();const me=N.value[F.value];me&&R(me);return}if(X.key==="Escape"){X.preventDefault(),E.value=!1;return}}if(X.key==="s"&&(X.ctrlKey||X.metaKey)&&!X.shiftKey&&!X.altKey){s.running&&(X.preventDefault(),j());return}if(!p.value&&!y.value&&!E.value&&!X.shiftKey&&!X.altKey&&!X.metaKey&&!X.ctrlKey){const me=v.isBrowsing();if(X.key==="ArrowUp"&&v.hasHistory()&&(me||v.caretAtTextStart())){X.preventDefault(),v.recallOlder();return}if(X.key==="ArrowDown"&&me){X.preventDefault(),v.recallNewer();return}}if(X.key==="Enter"&&!X.shiftKey){if(p.value&&!(X.metaKey||X.ctrlKey))return;X.preventDefault(),fe()}}}const Te=P(()=>r("composer.send")),Ie=P(()=>!!s.uploadImage),Oe=Q(!1),de=Q(!1),$e=Q(null);function Qe(){Oe.value=!Oe.value,Oe.value?(de.value=!1,Co(),document.addEventListener("click",xt,!0)):document.removeEventListener("click",xt,!0)}function tt(){Oe.value=!1,de.value||document.removeEventListener("click",xt,!0)}function vt(){de.value=!de.value,de.value?(Oe.value=!1,Co(),document.addEventListener("click",xt,!0)):document.removeEventListener("click",xt,!0)}function wt(){de.value=!1,Oe.value||document.removeEventListener("click",xt,!0)}function xt(X){$e.value&&!$e.value.contains(X.target)&&(tt(),wt())}fn(()=>{document.removeEventListener("click",xt,!0)});const Rt=X=>`${Math.round(X/1e3)}k`,yt=P(()=>{const X=s.status?.ctxMax??0;return X<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/X*100)))}),nn=P(()=>{const X=(s.status?.ctxUsed??0).toLocaleString(),me=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:X,max:me,pct:yt.value})}),xn=P(()=>yt.value>=80),ns=P(()=>{const X=s.status?.modelId??s.status?.model??"";return s.models?.find(me=>me.id===X||me.model===X||me.displayName===s.status?.model)}),Wt=P(()=>Nd(ns.value)),_n=P(()=>nk(ns.value)),gn=P(()=>aa(ns.value,s.thinking??"off")),ot=P(()=>{const X=_n.value,me=gn.value;return X.includes(me)?me:X.includes("on")?"on":X[0]??"off"}),ds=P(()=>Wt.value==="always-on"?!0:Wt.value==="unsupported"?!1:Uoe(gn.value)),ys=P(()=>Wt.value==="unsupported"||_n.value.length<=1),fs=P(()=>{if(!ds.value)return"";const X=(ns.value?.supportEfforts?.length??0)>0,me=gn.value;return X&&me!=="on"?r("composer.thinkingSuffixEffort",{level:me}):r("composer.thinkingSuffix")});function Xe(X){ys.value||i("setThinking",sk(ns.value,X))}function Ze(X){return X==="on"?r("status.thinkingOn"):X==="off"?r("status.thinkingOff"):mv(X)}const Mt=P(()=>s.planMode===!0),Dt=P(()=>s.swarmMode===!0),zt=P(()=>s.goal?.status??s.activationBadges?.goal?.status??null),wn=P(()=>zt.value!==null&&zt.value!=="complete"),Rn=P(()=>wn.value||s.goalMode===!0),hs=P(()=>zt.value==="active"),ss=P(()=>zt.value==="paused"||zt.value==="blocked"),sn=Q(!1),Lt=Q(null),Vs=Q(null),an=Q({}),So=P(()=>Mt.value||Dt.value||Rn.value);function Co(){sn.value=!1,document.removeEventListener("mousedown",Rs)}function Rs(X){const me=X.target;Lt.value?.contains(me)||Vs.value?.contains(me)||Co()}function fi(){if(sn.value){Co();return}tt(),wt();const X=Lt.value?.getBoundingClientRect();X&&(an.value={left:`${Math.round(X.left)}px`,bottom:`${Math.round(window.innerHeight-X.top+8)}px`}),sn.value=!0,setTimeout(()=>document.addEventListener("mousedown",Rs),0)}const co=[{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"}],jo=["status.planDesc","status.swarmDesc","status.goalDesc"],Ot=Q(null),Bs=Q(""),qn=Q("");function Cs(X){const me={};return X&&(me["--composer-menu-desc-width"]=X),me}const On=P(()=>Cs(Bs.value)),Hn=P(()=>Cs(qn.value)),hi=P(()=>({...an.value,...Hn.value}));let Xn=null;function qo(X){const me=Number.parseFloat(X);return Number.isFinite(me)?me:0}function Ks(X){return`${X.fontStyle||"normal"} ${X.fontWeight||"400"} ${X.fontSize} ${X.fontFamily}`}function Mi(X){return X.letterSpacing==="normal"?0:qo(X.letterSpacing)}function Ao(X,me){if(!X)return 0;const je=U3(X,Ks(me),{letterSpacing:Mi(me)});return j3(je)}function Vn(){const X=Ot.value?.querySelector(".pd-desc");if(!X)return;const me=getComputedStyle(X),je=Math.max(0,...co.map(ee=>Ao(r(ee.descKey),me))),lt=Math.max(0,...jo.map(ee=>Ao(r(ee),me)));Bs.value=je>0?`${Math.ceil(je)}px`:"",qn.value=lt>0?`${Math.ceil(lt)}px`:""}function Vo(){typeof window>"u"||(Xn!==null&&window.cancelAnimationFrame(Xn),pt(()=>{Xn=window.requestAnimationFrame(()=>{Xn=null,Vn()})}))}Ke(l,Vo,{immediate:!0}),ln(()=>{Vo(),document.fonts?.ready.then(Vo)}),fn(()=>{Xn!==null&&(window.cancelAnimationFrame(Xn),Xn=null)});function ji(X){i("setPermission",X),wt()}const Ko=P(()=>co.find(X=>X.mode===s.status?.permission)),Bn=P(()=>Ko.value?r(Ko.value.labelKey):""),Kn=P(()=>ns.value?.provider??""),Mo=P(()=>!Kn.value||!s.models?.length?[]:s.models.filter(X=>X.provider===Kn.value)),rt=P(()=>new Set(s.starredIds??[]));function xe(X){return rt.value.has(X)}const Le=P(()=>s.models?.length?s.models.filter(X=>xe(X.id)&&X.provider!==Kn.value):[]);function we(X){i("selectModel",X),tt()}return(X,me)=>(b(),I("div",{class:De(["composer",{"drag-over":C(V),expanded:p.value}]),onDragover:me[18]||(me[18]=(...je)=>C(ne)&&C(ne)(...je)),onDragleave:me[19]||(me[19]=(...je)=>C(ke)&&C(ke)(...je)),onDrop:me[20]||(me[20]=(...je)=>C(Se)&&C(Se)(...je))},[C(D).length>0?(b(),I("div",sie,[(b(!0),I(Be,null,nt(C(D),je=>(b(),I("div",{key:je.localId,class:De(["att-chip",{"att-error":je.error}])},[ie(jt,{text:C(r)("composer.previewAttachment",{name:je.name})},{default:Ee(()=>[w("button",{type:"button",class:"att-preview",onClick:lt=>C(re)(je)},[je.kind==="video"?(b(),I("video",{key:0,class:"att-thumb",src:je.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,iie)):(b(),I("img",{key:1,class:"att-thumb",src:je.previewUrl,alt:je.name},null,8,rie)),je.kind==="video"?(b(),I("span",lie,[ie(Ve,{name:"play",size:"sm"})])):le("",!0)],8,oie)]),_:2},1032,["text"]),w("span",aie,B(je.name),1),je.uploading?(b(),ye(wo,{key:0,size:"sm",label:C(r)("composer.uploading")},null,8,["label"])):je.error?(b(),ye(jt,{key:1,text:C(r)("composer.uploadFailed")},{default:Ee(()=>[w("span",cie,[ie(Ve,{name:"info",size:"sm"})])]),_:1},8,["text"])):le("",!0),ie(jt,{text:C(r)("composer.removeNamed",{name:je.name})},{default:Ee(()=>[w("button",{class:"att-rm",onClick:lt=>C(U)(je.localId)},[ie(Ve,{name:"close",size:"sm"})],8,uie)]),_:2},1032,["text"])],2))),128))])):le("",!0),C(W)?(b(),I("div",{key:1,class:"att-lightbox",onClick:me[1]||(me[1]=bt((...je)=>C(ae)&&C(ae)(...je),["self"]))},[w("div",die,[ie(jt,{text:C(r)("model.close")},{default:Ee(()=>[w("button",{type:"button",class:"att-lightbox-close",onClick:me[0]||(me[0]=(...je)=>C(ae)&&C(ae)(...je))},"✕")]),_:1},8,["text"]),C(W).kind==="video"?(b(),I("video",{key:0,class:"att-lightbox-media",src:C(W).previewUrl,controls:"",playsinline:""},null,8,fie)):(b(),I("img",{key:1,class:"att-lightbox-media",src:C(W).previewUrl,alt:C(W).name},null,8,hie)),w("div",pie,B(C(W).name),1)])])):le("",!0),w("div",mie,[w("div",gie,[C(y)?(b(),ye(Toe,{key:0,items:C(A),"active-index":C(L),onSelect:C(x),onHover:me[2]||(me[2]=je=>L.value=je)},null,8,["items","active-index","onSelect"])):le("",!0),C(E)?(b(),ye(Doe,{key:1,items:C(N),"active-index":C(F),loading:C(S),onSelect:C(R),onHover:me[3]||(me[3]=je=>F.value=je)},null,8,["items","active-index","loading","onSelect"])):le("",!0),w("div",vie,[Tn(w("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":me[4]||(me[4]=je=>Jn(a)?a.value=je:null),class:"ph",placeholder:o.value,disabled:e.starting,rows:"1",onKeydown:he,onCompositionstart:pe,onCompositionend:q,onInput:O},null,40,yie),[[ao,C(a)]]),p.value||k.value?(b(),I("button",{key:0,class:"expand-btn",type:"button","aria-label":p.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:h},[p.value?(b(),ye(Ve,{key:0,name:"collapse",size:"sm"})):(b(),ye(Ve,{key:1,name:"expand",size:"sm"}))],8,kie)):le("",!0)])]),Ie.value?(b(),I("input",{key:0,ref_key:"fileInputRef",ref:z,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:me[5]||(me[5]=(...je)=>C(Z)&&C(Z)(...je))},null,544)):le("",!0),w("div",{ref_key:"toolbarRef",ref:$e,class:"toolbar"},[w("div",{ref_key:"menuMeasureRef",ref:Ot,class:"menu-measure","aria-hidden":"true"},[...me[21]||(me[21]=[w("span",{class:"pd-desc"},null,-1)])],512),w("div",bie,[Ie.value?(b(),ye(Nn,{key:0,size:"md",label:C(r)("composer.attachImage"),onClick:C(te)},{default:Ee(()=>[ie(Ve,{name:"image"})]),_:1},8,["label","onClick"])):le("",!0),e.status?(b(),I("span",{key:1,class:De(["perm-pill",["perm-"+e.status.permission,{open:de.value}]]),role:"button",tabindex:"0",onClick:bt(vt,["stop"]),onKeydown:[bi(vt,["enter"]),bi(bt(vt,["prevent"]),["space"])]},B(Bn.value),43,xie)):le("",!0),de.value&&e.status?(b(),I("div",{key:2,class:"perm-dropdown",style:qt(On.value),role:"menu",onClick:me[6]||(me[6]=bt(()=>{},["stop"]))},[(b(),I(Be,null,nt(co,je=>w("button",{key:je.mode,class:De(["pd-row",{"is-current":je.mode===e.status.permission}]),role:"menuitem",onClick:lt=>ji(je.mode)},[w("span",wie,[je.mode===e.status.permission?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),w("span",Sie,[w("span",{class:"pd-name",style:qt({color:je.color})},B(C(r)(je.labelKey)),5),w("span",Cie,B(C(r)(je.descKey)),1)])],10,_ie)),64))],4)):le("",!0),e.status?(b(),I("div",{key:3,ref_key:"modesRef",ref:Lt,class:"modes"},[w("button",{type:"button",class:De(["mode-pill",{on:So.value,open:sn.value}]),onClick:bt(fi,["stop"])},[w("span",Aie,B(C(r)("status.modesLabel")),1),Mt.value?(b(),I("span",Mie,B(C(r)("status.planLabel")),1)):le("",!0),Dt.value?(b(),I("span",Eie,B(C(r)("status.swarmLabel")),1)):le("",!0),Rn.value?(b(),I("span",Tie,B(C(r)("status.goalLabel")),1)):le("",!0)],2),sn.value?(b(),I("div",{key:0,ref_key:"modesMenuRef",ref:Vs,class:"modes-menu",style:qt(hi.value),role:"menu"},[w("button",{type:"button",class:De(["mode-row",{on:Mt.value}]),role:"menuitem",onClick:me[7]||(me[7]=je=>i("togglePlan"))},[w("span",Nie,[ie(Ve,{name:"file-edit",size:"sm"})]),w("span",Iie,[w("span",$ie,B(C(r)("status.planLabel")),1),w("span",Lie,B(C(r)("status.planDesc")),1)]),w("span",{class:De(["mode-switch",{on:Mt.value}])},[...me[22]||(me[22]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("button",{type:"button",class:De(["mode-row",{on:Dt.value}]),role:"menuitem",onClick:me[8]||(me[8]=je=>i("toggleSwarm"))},[w("span",Fie,[ie(Ve,{name:"sparkles",size:"sm"})]),w("span",Oie,[w("span",Rie,B(C(r)("status.swarmLabel")),1),w("span",Bie,B(C(r)("status.swarmDesc")),1)]),w("span",{class:De(["mode-switch",{on:Dt.value}])},[...me[23]||(me[23]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("div",{class:De(["mode-row mode-row-goal",{on:wn.value||s.goalMode}])},[w("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:me[9]||(me[9]=je=>wn.value?i("focusGoal"):i("toggleGoal"))},[w("span",Die,[ie(Ve,{name:"target",size:"sm"})]),w("span",Pie,[w("span",Hie,B(C(r)("status.goalLabel")),1),w("span",Wie,B(C(r)("status.goalDesc")),1)]),wn.value?le("",!0):(b(),I("span",{key:0,class:De(["mode-switch",{on:s.goalMode}])},[...me[24]||(me[24]=[w("span",{class:"mode-knob"},null,-1)])],2))]),wn.value?(b(),I("div",zie,[hs.value?(b(),ye(Ft,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:me[10]||(me[10]=je=>i("controlGoal","pause"))},{default:Ee(()=>[ie(Ve,{name:"pause",size:"sm"}),w("span",null,B(C(r)("status.goalPause")),1)]),_:1})):le("",!0),ss.value?(b(),ye(Ft,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:me[11]||(me[11]=je=>i("controlGoal","resume"))},{default:Ee(()=>[ie(Ve,{name:"play",size:"sm"}),w("span",null,B(C(r)("status.goalResume")),1)]),_:1})):le("",!0),ie(Ft,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:me[12]||(me[12]=je=>i("controlGoal","cancel"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"}),w("span",null,B(C(r)("status.goalCancel")),1)]),_:1})])):le("",!0)],2)],4)):le("",!0)],512)):le("",!0)]),w("div",Uie,[xn.value?(b(),I("button",{key:0,class:"compact-chip",onClick:me[13]||(me[13]=bt(je=>i("compact"),["stop"]))},"/compact")):le("",!0),ie(jt,{text:nn.value},{default:Ee(()=>[e.status&&!e.hideContext?(b(),I("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":nn.value},[ie(nie,{pct:yt.value},null,8,["pct"]),w("span",qie,B(Rt(e.status.ctxUsed))+"/"+B(Rt(e.status.ctxMax)),1)],8,jie)):le("",!0)]),_:1},8,["text"]),e.status?(b(),I("span",{key:1,class:De(["model-pill",{open:Oe.value}]),role:"button",tabindex:"0",onClick:bt(Qe,["stop"]),onKeydown:[bi(Qe,["enter"]),bi(bt(Qe,["prevent"]),["space"])]},[w("b",null,B(e.status.model),1),fs.value?(b(),I("span",Kie,B(fs.value),1)):le("",!0),ie(Ve,{class:"cv",name:"chevron-down",size:"sm"})],42,Vie)):le("",!0),e.running?(b(),ye(jt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[w("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:me[14]||(me[14]=je=>i("interrupt"))},[ie(Ve,{name:"stop",size:"sm"})],8,Gie)]),_:1},8,["text"])):le("",!0),w("button",{class:De(["send",{"is-starting":e.starting}]),"aria-label":Te.value,disabled:e.starting,onClick:me[15]||(me[15]=je=>fe())},[e.starting?(b(),ye(wo,{key:0,size:"sm"})):(b(),ye(Ve,{key:1,name:"send",size:"sm"}))],10,Yie)]),Oe.value&&e.status?(b(),I("div",{key:0,class:"model-dropdown",role:"menu",onClick:me[17]||(me[17]=bt(()=>{},["stop"]))},[Le.value.length>0?(b(),I("div",Zie,B(C(r)("status.starredModels")),1)):le("",!0),(b(!0),I(Be,null,nt(Le.value,je=>(b(),I("button",{key:je.id,class:De(["md-row",{"is-current":je.id===e.status.modelId}]),role:"menuitem",onClick:lt=>we(je.id)},[w("span",Xie,[je.id===e.status.model||je.model===e.status.model||je.displayName===e.status.model?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),w("span",Jie,B(je.displayName??je.model),1),w("span",ere,B(je.provider),1),ie(Ve,{class:"md-star",name:"star",size:"sm"})],10,Qie))),128)),Le.value.length>0?(b(),I("div",tre)):le("",!0),Mo.value.length>0?(b(),I("div",nre,B(Kn.value),1)):le("",!0),(b(!0),I(Be,null,nt(Mo.value,je=>(b(),I("button",{key:je.id,class:De(["md-row",{"is-current":je.id===e.status.modelId}]),role:"menuitem",onClick:lt=>we(je.id)},[w("span",ore,[je.id===e.status.model||je.model===e.status.model||je.displayName===e.status.model?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),w("span",ire,B(je.displayName??je.model),1),xe(je.id)?(b(),ye(Ve,{key:0,class:"md-star",name:"star",size:"sm"})):le("",!0)],10,sre))),128)),Mo.value.length>0?(b(),I("div",rre)):le("",!0),w("div",{class:De(["md-thinking",{"is-readonly":ys.value}])},[w("span",lre,B(C(r)("status.thinkingLabel")),1),Wt.value==="unsupported"?(b(),I("span",are,B(C(r)("status.modeNotSupported")),1)):(b(),I("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(b(!0),I(Be,null,nt(_n.value,je=>(b(),I("button",{key:je,type:"button",class:De(["effort-seg",{"is-active":je===ot.value}]),disabled:ys.value,onClick:lt=>Xe(je)},B(Ze(je)),11,ure))),128))],8,cre))],2),me[25]||(me[25]=w("div",{class:"md-divider"},null,-1)),w("button",{class:"md-row md-row-more",role:"menuitem",onClick:me[16]||(me[16]=je=>{tt(),i("pickModel")})},[w("span",dre,B(C(r)("status.moreModels")),1)])])):le("",!0)],512)])],34))}}),V5=ut(fre,[["__scopeId","data-v-8de55dad"]]),hre={key:0,class:"ui-card__head"},pre={class:"ui-card__body"},mre={key:1,class:"ui-card__foot"},gre=qe({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(b(),I("div",hre,[In(t.$slots,"head",{},void 0,!0)])):le("",!0),w("div",pre,[In(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(b(),I("div",mre,[In(t.$slots,"foot",{},void 0,!0)])):le("",!0)],2))}}),ok=ut(gre,[["__scopeId","data-v-9c9f9a9a"]]),vre={class:"goal-kicker"},yre={class:"goal-progress","aria-hidden":"true"},kre={class:"goal-full"},bre={key:0,class:"goal-criterion"},xre={class:"goal-footer"},_re={class:"goal-meta"},wre={key:0},Sre={class:"goal-actions"},Cre=qe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=Q(!1);Ke(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=P(()=>{const c=n.goal.budget.tokenBudget;return!c||c<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/c*100)))});function l(c){switch(c){case"active":return o("status.goalStatusActive");case"paused":return o("status.goalStatusPaused");case"blocked":return o("status.goalStatusBlocked");case"complete":return o("status.goalStatusComplete")}}function a(c){const u=Math.max(0,Math.round(c/1e3)),d=Math.floor(u/60),f=u%60;return d<=0?`${f}s`:d<60?`${d}m ${f}s`:`${Math.floor(d/60)}h ${d%60}m`}return(c,u)=>(b(),ye(ok,{class:De(["goal-strip",{expanded:i.value}])},Fv({head:Ee(()=>[w("button",{class:"goal-row",type:"button",onClick:u[0]||(u[0]=d=>i.value=!i.value)},[w("span",vre,B(C(o)("status.goalLabel")),1),w("span",{class:De(["goal-objective",{"expanded-hidden":i.value}])},B(e.goal.objective),3),ie(Ro,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Ge(B(l(e.goal.status)),1)]),_:1},8,["variant"]),w("span",yre,[w("span",{class:"goal-progress-fill",style:qt({width:`${r.value}%`})},null,4)]),ie(Ve,{class:De(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:Ee(()=>[w("div",kre,B(e.goal.objective),1),e.goal.completionCriterion?(b(),I("div",bre,[u[4]||(u[4]=w("span",null,"Done when",-1)),w("p",null,B(e.goal.completionCriterion),1)])):le("",!0)]),key:"0"}:void 0,i.value?{name:"foot",fn:Ee(()=>[w("div",xre,[w("div",_re,[w("span",null,B(e.goal.turnsUsed)+" turns",1),w("span",null,B(e.goal.tokensUsed.toLocaleString())+" tokens",1),w("span",null,B(a(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(b(),I("span",wre,B(r.value)+"% token budget",1)):le("",!0)]),w("div",Sre,[e.goal.status==="active"?(b(),ye(Ft,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:u[1]||(u[1]=bt(d=>s("controlGoal","pause"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"pause",size:"md"}),w("span",null,B(C(o)("status.goalPause")),1)]),_:1})):le("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(b(),ye(Ft,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:u[2]||(u[2]=bt(d=>s("controlGoal","resume"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"play",size:"md"}),w("span",null,B(C(o)("status.goalResume")),1)]),_:1})):le("",!0),ie(Ft,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:u[3]||(u[3]=bt(d=>s("controlGoal","cancel"),["stop"]))},{default:Ee(()=>[ie(Ve,{name:"close",size:"md"}),w("span",null,B(C(o)("status.goalCancel")),1)]),_:1})])])]),key:"1"}:void 0]),1032,["class"]))}}),Are=ut(Cre,[["__scopeId","data-v-439258c7"]]),Mre={class:"qh"},Ere={class:"qtitle"},Tre={key:0,class:"qstep"},Nre={key:1,class:"qmin-peek"},Ire={class:"qbody"},$re=["aria-label"],Lre=["aria-selected","aria-label","onClick"],Fre={class:"qstep-num"},Ore={key:1,class:"qheader-chip"},Rre={class:"qtext"},Bre={class:"qopts"},Dre=["onClick"],Pre={class:"qopt-key"},Hre={class:"qopt-glyph"},Wre={key:0,class:"chk"},zre={key:1,class:"rad"},Ure={class:"qopt-text"},jre={class:"qopt-label"},qre={key:0,class:"qopt-desc"},Vre={class:"qopt-glyph"},Kre={key:0,class:"chk"},Gre={key:1,class:"rad"},Yre={class:"qopt-label"},Zre=["placeholder"],Qre={class:"qfoot"},Xre=qe({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Et(),o=t,i=Q(0),r=Q(!1),l=P(()=>n.question.questions[i.value]),a=P(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(D){D>=0&&D<a.value&&(i.value=D)}function f(D){const W=h.value[D];return W?W.kind==="multi"?W.optionIds.length>0:W.kind==="multiWithOther"?W.optionIds.length>0||W.otherText.trim().length>0:W.kind==="other"?W.text.trim().length>0:!0:!1}function p(){return f(l.value.id)}const h=Q({});function m(D){return D.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${D.label} ${D.description??""}`.toLowerCase())}function _(){const D={...h.value};let W=!1;for(const z of n.question.questions){if(D[z.id])continue;const V=z.options.filter(m);V.length!==0&&(D[z.id]=z.multiSelect?{kind:"multi",optionIds:V.map(U=>U.id)}:{kind:"single",optionId:V[0].id},W=!0)}W&&(h.value=D)}Ke(()=>n.question.questionId,()=>{i.value=0,r.value=!1,h.value={},v.value={}}),Ke(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function k(D,W){const z=h.value[D];if(z&&z.kind==="single"&&z.optionId===W){const V={...h.value};delete V[D],h.value=V}else h.value={...h.value,[D]:{kind:"single",optionId:W}}}function g(D,W){const z=h.value[D],V=z&&(z.kind==="multi"||z.kind==="multiWithOther")?z.kind==="multi"?[...z.optionIds]:[...z.optionIds]:[],U=V.indexOf(W);U>=0?V.splice(U,1):V.push(W);const re=h.value[D],ae=re&&re.kind==="multiWithOther"?re.otherText:"";ae?h.value={...h.value,[D]:{kind:"multiWithOther",optionIds:V,otherText:ae}}:h.value={...h.value,[D]:{kind:"multi",optionIds:V}}}const v=Q({}),y=Q(null);function A(D){const W=n.question.questions.find(V=>V.id===D),z=v.value[D]??"";if(W.multiSelect){const V=h.value[D],U=V&&(V.kind==="multi"||V.kind==="multiWithOther")?V.kind==="multi"?[...V.optionIds]:[...V.optionIds]:[];h.value={...h.value,[D]:{kind:"multiWithOther",optionIds:U,otherText:z}}}else h.value={...h.value,[D]:{kind:"other",text:z}}}function L(D){A(D),pt(()=>y.value?.focus())}function $(D,W){const z=h.value[D];return z?z.kind==="single"?z.optionId===W:z.kind==="multi"||z.kind==="multiWithOther"?z.optionIds.includes(W):!1:!1}function x(D){const W=h.value[D];return!!(W&&(W.kind==="other"||W.kind==="multiWithOther"))}function E(){return n.question.questions.every(D=>f(D.id))}const N=P(()=>n.busyKind==="answer"),F=P(()=>n.busyKind==="dismiss"),S=P(()=>!!n.busyKind);function T(){if(S.value||!E())return;const D={answers:h.value,method:"click"};o("answer",n.question.questionId,D)}function R(){S.value||o("dismiss",n.question.questionId)}function O(D){const W=(document.activeElement?.tagName??"").toLowerCase(),z=W==="input"||W==="textarea";if(S.value)return;if(D.key==="Enter"){if(D.preventDefault(),r.value)return;i.value<a.value-1&&p()?u():E()&&T();return}if(z)return;if(D.key==="Escape"){D.preventDefault(),R();return}if(r.value)return;const V=parseInt(D.key,10);if(!isNaN(V)&&V>=1&&V<=9){D.preventDefault();const U=l.value,re=V-1,ae=U.options[re];ae&&(U.multiSelect?g(U.id,ae.id):k(U.id,ae.id))}}return ln(()=>document.addEventListener("keydown",O)),fn(()=>document.removeEventListener("keydown",O)),(D,W)=>(b(),ye(ok,{class:De(["qcard",{minimized:r.value}])},Fv({head:Ee(()=>[w("div",Mre,[W[5]||(W[5]=w("span",{class:"qh-ic"},"?",-1)),w("span",Ere,B(C(s)("question.title")),1),a.value>1&&!r.value?(b(),I("span",Tre,B(C(s)("question.step",{current:i.value+1,total:a.value})),1)):le("",!0),r.value?(b(),I("span",Nre,B(l.value.question),1)):le("",!0),ie(Nn,{class:"qmin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:W[0]||(W[0]=z=>r.value=!r.value)},{default:Ee(()=>[r.value?(b(),ye(Ve,{key:0,name:"chevron-down",size:"md"})):(b(),ye(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[w("div",Ire,[a.value>1?(b(),I("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(s)("question.step",{current:i.value+1,total:a.value})},[(b(!0),I(Be,null,nt(n.question.questions,(z,V)=>(b(),I("button",{key:z.id,type:"button",class:De(["qstep-dot",{active:V===i.value,answered:f(z.id)}]),"aria-selected":V===i.value,"aria-label":C(s)("question.step",{current:V+1,total:a.value}),onClick:U=>d(V)},[w("span",Fre,B(V+1),1)],10,Lre))),128))],8,$re)):le("",!0),l.value.header?(b(),I("div",Ore,[ie(Ro,{variant:"neutral",size:"sm"},{default:Ee(()=>[Ge(B(l.value.header),1)]),_:1})])):le("",!0),w("div",Rre,B(l.value.question),1),l.value.body?(b(),ye(rm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):le("",!0),w("div",Bre,[(b(!0),I(Be,null,nt(l.value.options,(z,V)=>(b(),I("label",{key:z.id,class:De(["qopt",{selected:$(l.value.id,z.id)}]),onClick:bt(U=>l.value.multiSelect?g(l.value.id,z.id):k(l.value.id,z.id),["prevent"])},[w("span",Pre,B(V+1),1),w("span",Hre,[l.value.multiSelect?(b(),I("span",Wre,B($(l.value.id,z.id)?"■":"□"),1)):(b(),I("span",zre,B($(l.value.id,z.id)?"●":"○"),1))]),w("span",Ure,[w("span",jre,B(z.label),1),z.description?(b(),I("span",qre,B(z.description),1)):le("",!0)])],10,Dre))),128)),l.value.allowOther?(b(),I("label",{key:0,class:De(["qopt",{selected:x(l.value.id)}]),onClick:W[4]||(W[4]=bt(z=>L(l.value.id),["prevent"]))},[W[6]||(W[6]=w("span",{class:"qopt-key"},null,-1)),w("span",Vre,[l.value.multiSelect?(b(),I("span",Kre,B(x(l.value.id)?"■":"□"),1)):(b(),I("span",Gre,B(x(l.value.id)?"●":"○"),1))]),w("span",Yre,B(l.value.otherLabel??C(s)("question.otherDefault")),1),Tn(w("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":W[1]||(W[1]=z=>v.value[l.value.id]=z),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:W[2]||(W[2]=z=>A(l.value.id)),onFocus:W[3]||(W[3]=z=>A(l.value.id))},null,40,Zre),[[ao,v.value[l.value.id]]])],2)):le("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[w("div",Qre,[i.value<a.value-1?(b(),ye(Ft,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!p(),onClick:u},{default:Ee(()=>[Ge(B(C(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(b(),ye(Ft,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:N.value,onClick:T},{default:Ee(()=>[Ge(B(C(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(b(),ye(Ft,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Ge(B(C(s)("question.back")),1)]),_:1},8,["disabled"])):le("",!0),ie(Ft,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:R},{default:Ee(()=>[Ge(B(C(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Jre=ut(Xre,[["__scopeId","data-v-9525707a"]]),ele={class:"ah"},tle={class:"akind"},nle={class:"apath"},sle={class:"ah-path"},ole={key:1,class:"diff"},ile={class:"dg"},rle={class:"dc"},lle={key:2,class:"body-shell"},ale={class:"shell-cmd"},cle={key:0,class:"shell-cwd"},ule={key:1,class:"shell-danger"},dle={key:3,class:"body-file"},fle={class:"file-bar"},hle={class:"file-lang"},ple={class:"file-content"},mle={class:"file-ln"},gle={class:"file-text"},vle={key:4,class:"body-chip"},yle={class:"chip-label"},kle={class:"chip-value"},ble={key:0,class:"chip-detail"},xle={key:5,class:"body-chip"},_le={key:0,class:"chip-label"},wle={class:"chip-value"},Sle={key:6,class:"body-chip"},Cle={class:"chip-label"},Ale={class:"chip-value"},Mle={key:0,class:"chip-detail"},Ele={key:7,class:"body-chip"},Tle={class:"chip-label"},Nle={class:"chip-value"},Ile={key:0,class:"chip-detail"},$le={key:8,class:"body-todo"},Lle={class:"todo-glyph"},Fle={key:9,class:"body-plan"},Ole={key:10,class:"body-generic"},Rle={class:"gen-text"},Ble={key:11,class:"feedback-wrap"},Dle=["placeholder"],Ple={class:"feedback-hint"},Hle={key:0,class:"plan-actions"},Wle={key:1,class:"abtn"},zle=qe({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=P(()=>{const N=n.block;return N.kind!=="plan_review"?null:{plan:N.plan,path:N.path,options:N.options??[]}}),r=Q(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const N=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${N}`)}const c=Q(!1),u=Q(""),d=Q(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function p(){if(n.busy)return;const N=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:N||void 0}):k("feedback",{decision:"rejected",feedback:N||void 0}),c.value=!1,u.value=""}function h(){c.value=!1,u.value=""}function m(N){N.key==="Enter"&&!N.shiftKey?(N.preventDefault(),p()):N.key==="Escape"&&(N.preventDefault(),h())}const _=Q(null);Ke(()=>n.busy,N=>{N||(_.value=null)});function k(N,F){n.busy||(_.value=N,s("decide",F))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function y(){k("reject",{decision:"rejected"})}function A(){k("approvePlan",{decision:"approved"})}function L(N){k(`option:${N}`,{decision:"approved",selectedLabel:N})}function $(){n.busy||f()}function x(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(N){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){N.key==="1"?(N.preventDefault(),A()):N.key==="2"?(N.preventDefault(),$()):N.key==="3"&&(N.preventDefault(),x());return}N.key==="1"&&S.options[0]?(N.preventDefault(),L(S.options[0].label)):N.key==="2"&&S.options[1]?(N.preventDefault(),L(S.options[1].label)):N.key==="3"&&S.options[2]&&(N.preventDefault(),L(S.options[2].label));return}N.key==="1"?(N.preventDefault(),g()):N.key==="2"?(N.preventDefault(),v()):N.key==="3"?(N.preventDefault(),y()):N.key==="4"&&(N.preventDefault(),f())}return ln(()=>document.addEventListener("keydown",E)),fn(()=>document.removeEventListener("keydown",E)),(N,F)=>(b(),ye(ok,{class:De(["appr",{minimized:r.value}])},Fv({head:Ee(()=>[w("div",ele,[F[2]||(F[2]=w("span",{class:"ah-ic"},"!",-1)),w("span",tle,B(a()),1),w("span",nle,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(b(),I(Be,{key:0},[Ge(B(e.block.path),1)],64)):e.block.kind==="shell"?(b(),I(Be,{key:1},[Ge(B(e.block.command),1)],64)):e.block.kind==="url"?(b(),I(Be,{key:2},[Ge(B(e.block.url),1)],64)):e.block.kind==="search"?(b(),I(Be,{key:3},[Ge(B(e.block.query),1)],64)):e.block.kind==="invocation"?(b(),I(Be,{key:4},[Ge(B(e.block.name),1)],64)):e.block.kind==="generic"?(b(),I(Be,{key:5},[Ge(B(e.block.summary),1)],64)):le("",!0)]),e.agentName&&!r.value?(b(),ye(Ro,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Ge(B(C(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):le("",!0),r.value?le("",!0):(b(),ye(Ro,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Ge(B(C(o)("approval.required")),1)]),_:1})),ie(Nn,{class:"amin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ee(()=>[r.value?(b(),ye(Ve,{key:0,name:"chevron-down",size:"md"})):(b(),ye(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(b(),ye(jt,{key:0,text:e.block.path},{default:Ee(()=>[w("div",sle,B(e.block.path),1)]),_:1},8,["text"])):le("",!0),e.block.kind==="diff"?(b(),I("div",ole,[(b(!0),I(Be,null,nt(e.block.diff,(S,T)=>(b(),I("div",{key:T,class:De(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[w("span",ile,B(S.gutter),1),w("span",rle,B(S.text),1)],2))),128))])):e.block.kind==="shell"?(b(),I("div",lle,[w("div",ale,[F[3]||(F[3]=w("span",{class:"shell-dollar"},"$",-1)),Ge(" "+B(e.block.command),1)]),e.block.cwd?(b(),I("div",cle,"cwd: "+B(e.block.cwd),1)):le("",!0),e.block.danger?(b(),I("div",ule,B(C(o)("approval.danger",{detail:e.block.danger})),1)):le("",!0)])):e.block.kind==="file"?(b(),I("div",dle,[w("div",fle,[w("span",hle,B(e.block.language??""),1)]),w("div",ple,[(b(!0),I(Be,null,nt(e.block.content.split(`
294
+ `),(S,T)=>(b(),I("div",{key:T,class:"file-line"},[w("span",mle,B(T+1),1),w("span",gle,B(S),1)]))),128))])])):e.block.kind==="fileop"?(b(),I("div",vle,[w("span",yle,B(e.block.op),1),w("span",kle,B(e.block.path),1),e.block.detail?(b(),I("span",ble,B(e.block.detail),1)):le("",!0)])):e.block.kind==="url"?(b(),I("div",xle,[e.block.method?(b(),I("span",_le,B(e.block.method),1)):le("",!0),w("span",wle,B(e.block.url),1)])):e.block.kind==="search"?(b(),I("div",Sle,[w("span",Cle,B(C(o)("approval.searchQueryLabel")),1),w("span",Ale,B(e.block.query),1),e.block.scope?(b(),I("span",Mle,B(C(o)("approval.searchScope",{scope:e.block.scope})),1)):le("",!0)])):e.block.kind==="invocation"?(b(),I("div",Ele,[w("span",Tle,B(e.block.kind2),1),w("span",Nle,B(e.block.name),1),e.block.description?(b(),I("span",Ile,B(e.block.description),1)):le("",!0)])):e.block.kind==="todo"?(b(),I("div",$le,[(b(!0),I(Be,null,nt(e.block.items,(S,T)=>(b(),I("div",{key:T,class:"todo-item"},[w("span",Lle,B(S.status==="done"||S.status==="completed"?"✓":"○"),1),w("span",{class:De(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},B(S.title),3)]))),128))])):e.block.kind==="plan_review"?(b(),I("div",Fle,[ie(rm,{text:e.block.plan},null,8,["text"])])):(b(),I("div",Ole,[w("span",Rle,B(e.block.summary),1)])),c.value?(b(),I("div",Ble,[Tn(w("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,Dle),[[ao,u.value]]),w("div",Ple,B(C(o)("approval.feedbackHint")),1)])):le("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(b(),I("div",Hle,[i.value.options.length>0?(b(!0),I(Be,{key:0},nt(i.value.options,(S,T)=>(b(),ye(jt,{key:T,text:S.description},{default:Ee(()=>[ie(Ft,{class:"kbtn",size:"sm",variant:"primary",loading:_.value===`option:${S.label}`,disabled:e.busy,onClick:R=>L(S.label)},{default:Ee(()=>[Ge(B(S.label),1),ie(tr,{class:"k",keys:[String(T+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(b(),ye(Ft,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ee(()=>[Ge(B(C(o)("approval.approvePlan")),1),ie(tr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ie(Ft,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:Ee(()=>[Ge(B(C(o)("approval.revise")),1),i.value.options.length===0?(b(),ye(tr,{key:0,class:"k",keys:["2"]})):le("",!0)]),_:1},8,["disabled"]),ie(Ft,{class:"kbtn",size:"sm",variant:"danger-soft",loading:_.value==="rejectAndExit",disabled:e.busy,onClick:x},{default:Ee(()=>[Ge(B(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(b(),ye(tr,{key:0,class:"k",keys:["3"]})):le("",!0)]),_:1},8,["loading","disabled"])])):(b(),I("div",Wle,[ie(Ft,{class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approve",disabled:e.busy,onClick:g},{default:Ee(()=>[Ge(B(C(o)("approval.approve")),1),ie(tr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ie(Ft,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="approveSession",disabled:e.busy,onClick:v},{default:Ee(()=>[Ge(B(C(o)("approval.approveSession")),1),ie(tr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ie(Ft,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="reject",disabled:e.busy,onClick:y},{default:Ee(()=>[Ge(B(C(o)("approval.reject")),1),ie(tr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ie(Ft,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Ge(B(C(o)("approval.feedback")),1),ie(tr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),Ule=ut(zle,[["__scopeId","data-v-12609161"]]),jle=qe({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(b(),I("span",{class:De(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},B(n[t.status]),3))}}),K5=ut(jle,[["__scopeId","data-v-f595d935"]]),qle={class:"taskspane"},Vle={class:"tp-head"},Kle={class:"tp-title"},Gle={class:"tp-count"},Yle={class:"tp-list"},Zle={key:0,class:"tp-empty"},Qle=["role","onClick"],Xle={class:"tp-name"},Jle={class:"tp-time"},eae=["onClick"],tae={key:0,class:"tp-detail"},nae={key:0,class:"tp-codebox"},sae=["onClick"],oae={class:"tp-pre"},iae={class:"tp-cmd"},rae={key:1,class:"tp-codebox"},lae=["onClick"],aae={class:"tp-pre"},cae=qe({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Et(),o=Ss(new Set),i=Ss(new Set),r=Ss(new Set);function l(h){return!!(h.output&&h.output.length>0||h.meta)}function a(h){if(h.kind==="subagent"){n("open",h.id);return}l(h)&&(o.has(h.id)?o.delete(h.id):o.add(h.id))}function c(h){return h.kind==="subagent"||l(h)}function u(h){return h==="run"||h==="done"||h==="fail"?h:"pending"}async function d(h,m,_){await js(h)&&(_.add(m),setTimeout(()=>_.delete(m),1500))}async function f(h){h.meta&&await d(h.meta,h.id,i)}async function p(h){const m=h.output?.join(`
295
+ `)??"";m&&await d(m,h.id,r)}return(h,m)=>(b(),I("div",qle,[w("div",Vle,[w("span",Kle,B(C(s)("tasks.tag")),1),w("span",Gle,B(e.tasks.length),1)]),w("div",Yle,[e.tasks.length===0?(b(),I("div",Zle,B(C(s)("tasks.emptyTasks")),1)):(b(!0),I(Be,{key:1},nt(e.tasks,_=>(b(),I("div",{key:_.id,class:De(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:c(_)}])},[w("div",{class:"tp-main",role:c(_)?"button":void 0,onClick:k=>a(_)},[ie(K5,{status:u(_.state)},null,8,["status"]),w("span",Xle,B(_.name),1),ie(Ro,{variant:"neutral",size:"sm"},{default:Ee(()=>[Ge(B(_.kind),1)]),_:2},1024),w("span",Jle,B(_.timing),1),_.state==="run"?(b(),I("button",{key:0,class:"tp-stop",onClick:bt(k=>n("cancel",_.id),["stop"])},B(C(s)("tasks.stop")),9,eae)):le("",!0),_.kind==="subagent"?(b(),ye(Ve,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(_)?(b(),ye(Ve,{key:2,class:De(["tp-chevron",{open:o.has(_.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):le("",!0)],8,Qle),o.has(_.id)&&l(_)?(b(),I("div",tae,[_.meta?(b(),I("div",nae,[w("button",{class:De(["tp-copy",{copied:i.has(_.id)}]),onClick:bt(k=>f(_),["stop"])},B(i.has(_.id)?"已复制":"复制"),11,sae),w("pre",oae,[w("code",null,[w("span",iae,B(_.meta),1)])])])):le("",!0),_.output&&_.output.length>0?(b(),I("div",rae,[w("button",{class:De(["tp-copy",{copied:r.has(_.id)}]),onClick:bt(k=>p(_),["stop"])},B(r.has(_.id)?"已复制":"复制"),11,lae),w("pre",aae,[w("code",null,[m[0]||(m[0]=Ge(`
296
+ `,-1)),(b(!0),I(Be,null,nt(_.output,(k,g)=>(b(),I("span",{key:g,class:"tp-line"},B(k),1))),128)),m[1]||(m[1]=Ge(`
297
+ `,-1))])])])):le("",!0)])):le("",!0)],2))),128))])]))}}),lC=ut(cae,[["__scopeId","data-v-28fd5fc0"]]),uae={class:"todo-card"},dae={key:0,class:"tc-empty"},fae={class:"tc-name"},hae=qe({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Et();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(b(),I("div",uae,[t.todos.length===0?(b(),I("div",dae,[i[0]||(i[0]=w("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[w("path",{d:"M9 11l2 2 4-4"}),w("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),w("span",null,B(C(n)("tasks.emptyTodo")),1)])):le("",!0),(b(!0),I(Be,null,nt(t.todos,(r,l)=>(b(),I("div",{key:l,class:De(["tc-row",`s-${r.status}`])},[ie(K5,{status:s(r.status)},null,8,["status"]),w("span",fae,B(r.title),1)],2))),128))]))}}),pae=ut(hae,[["__scopeId","data-v-01c65735"]]),mae=["disabled","aria-pressed"],gae=qe({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(b(),I("button",{key:0,class:De(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[In(t.$slots,"default",{},void 0,!0)],10,mae)):(b(),I("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[In(t.$slots,"default",{},void 0,!0)],2))}}),B0=ut(gae,[["__scopeId","data-v-317ace1a"]]),vae={class:"dock-work-head"},yae={key:0,class:"dock-work-tab static"},kae={key:1,class:"dock-work-tab static"},bae={key:2,class:"dock-work-tab static"},xae={class:"dock-work-body"},_ae={class:"dw-count"},wae={class:"dw-count"},Sae={class:"dw-count"},Cae=qe({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=Et(),r=Q(null),l=Q(null),a=Q(null);function c(p){return r.value?(r.value.loadForEdit(p),!0):!1}function u(p){r.value?.loadAttachmentsForEdit(p)}function d(){r.value?.focus()}function f(p){if(!s.dockPanel)return;const h=p.target;h&&(l.value?.contains(h)||a.value?.contains(h)||o("close-dock-panel"))}return Ke(()=>s.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),p&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),fn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(p,h)=>(b(),I("div",{class:De(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=bt(()=>{},["stop"]))},[ie(cl,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(b(),I("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=bt(()=>{},["stop"]))},[w("div",vae,[e.dockPanel==="bash"?(b(),I("span",yae,B(C(i)("tasks.dockBash"))+" · "+B(e.bashRunning)+" "+B(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(b(),I("span",kae,B(C(i)("tasks.dockSubagent"))+" · "+B(e.subagentRunning)+" "+B(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(b(),I("span",bae,B(C(i)("tasks.dockTodos"))+" · "+B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1)):le("",!0)]),w("div",xae,[e.dockPanel==="bash"?(b(),ye(lC,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=m=>o("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(b(),ye(lC,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=m=>o("cancelTask",m)),onOpen:h[2]||(h[2]=m=>o("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(b(),ye(pae,{key:2,todos:e.todos??[]},null,8,["todos"])):le("",!0)])],512)):le("",!0)]),_:1}),e.goal?(b(),ye(Are,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=m=>o("controlGoal",m))},null,8,["goal","force-expanded"])):le("",!0),e.hasDockWork?(b(),I("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(b(),ye(B0,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=m=>o("toggle-dock-panel","bash"))},{default:Ee(()=>[ie(Ve,{name:"clock",size:"md"}),w("span",null,B(C(i)("tasks.dockBash")),1),w("span",_ae,[h[29]||(h[29]=Ge("(",-1)),w("b",null,B(e.bashTasks.length),1),h[30]||(h[30]=Ge(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),e.subagentTasks.length>0?(b(),ye(B0,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=m=>o("toggle-dock-panel","subagent"))},{default:Ee(()=>[ie(Ve,{name:"sparkles",size:"md"}),w("span",null,B(C(i)("tasks.dockSubagent")),1),w("span",wae,[h[31]||(h[31]=Ge("(",-1)),w("b",null,B(e.subagentTasks.length),1),h[32]||(h[32]=Ge(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),(e.todos?.length??0)>0?(b(),ye(B0,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=m=>o("toggle-dock-panel","todos"))},{default:Ee(()=>[ie(Ve,{name:"check-list",size:"md"}),w("span",null,B(C(i)("tasks.dockTodos")),1),w("span",Sae,[h[33]||(h[33]=Ge("(",-1)),w("b",null,B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1),h[34]||(h[34]=Ge(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0)],512)):le("",!0),e.pendingQuestion?(b(),ye(Jre,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(m,_)=>o("answer",m,_)),onDismiss:h[9]||(h[9]=m=>o("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(b(),ye(Ule,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=m=>o("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(b(),ye(V5,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:h[11]||(h[11]=m=>o("submit",m)),onSteer:h[12]||(h[12]=m=>o("steer",m)),onCommand:h[13]||(h[13]=m=>o("command",m)),onInterrupt:h[14]||(h[14]=m=>o("interrupt")),onSetPermission:h[15]||(h[15]=m=>o("setPermission",m)),onSetThinking:h[16]||(h[16]=m=>o("setThinking",m)),onTogglePlan:h[17]||(h[17]=m=>o("togglePlan")),onToggleSwarm:h[18]||(h[18]=m=>o("toggleSwarm")),onToggleGoal:h[19]||(h[19]=m=>o("toggleGoal")),onOpenBtw:h[20]||(h[20]=m=>o("openBtw")),onCreateGoal:h[21]||(h[21]=m=>o("createGoal",m)),onControlGoal:h[22]||(h[22]=m=>o("controlGoal",m)),onFocusGoal:h[23]||(h[23]=m=>o("focusGoal")),onFocusSwarm:h[24]||(h[24]=m=>o("focusSwarm")),onCompact:h[25]||(h[25]=m=>o("compact")),onPickModel:h[26]||(h[26]=m=>o("pickModel")),onSelectModel:h[27]||(h[27]=m=>o("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Aae=ut(Cae,[["__scopeId","data-v-67df0d16"]]),Mae=["aria-label","aria-hidden"],Eae={class:"toc-scroll"},Tae=["onClick"],Nae={class:"toc-label"},Iae=240,$ae=qe({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=Q(null),r=Q(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,p=d.getBoundingClientRect().right;r.value=p-f>=Iae}const c=P(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ke(c,u=>{l?.disconnect(),l=null,u&&pt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),es(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(b(),I("nav",{key:0,ref_key:"navRef",ref:i,class:De(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":C(o)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[w("div",Eae,[(b(!0),I(Be,null,nt(e.items,f=>(b(),I("button",{key:f.id,type:"button",class:De(["toc-row",{active:e.activeTurnId===f.id}]),onClick:p=>s("select",f.id)},[d[0]||(d[0]=w("span",{class:"toc-bar"},null,-1)),w("span",Nae,B(f.title),1)],10,Tae))),128))])],10,Mae)):le("",!0)}}),Lae=ut($ae,[["__scopeId","data-v-0a2a2a96"]]),Fae=5;function Oae(e,t,n,s=Fae){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const Rae={class:"chat-layout"},Bae={class:"empty-hint"},Dae={key:0,class:"empty-hint-text"},Pae={type:"button",class:"ws-pick-btn",tabindex:"-1"},Hae={class:"ws-pick-name"},Wae={class:"ws-pick-menu"},zae={type:"button",class:"ws-pick-item ws-pick-more",tabindex:"-1"},Uae={type:"button",class:"ws-pick-action",tabindex:"-1"},jae={class:"ws-pick-name"},qae={key:1,class:"ws-pick-menu"},Vae=["onClick"],Kae={class:"ws-pick-item-name"},Gae={class:"ws-pick-item-path"},Yae=["aria-label"],Zae={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Qae={class:"abort-toast-text"},D0=80,aC=1e3,Xae=420,Jae=3e3,ece=qe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const{t:s,locale:o}=Et(),i=e,r=n,l=Q(!1),a=Q(!1),c=Q(null),u=Q(null),d=Q(""),f=P(()=>d.value?{"--ws-pick-menu-width":d.value}:void 0);let p=null;const h=P(()=>i.workspaces?.find(X=>X.id===i.activeWorkspaceId)?.name??i.workspaceName??""),m=P(()=>(i.workspaces?.length??0)>0),_=P(()=>Oae(i.workspaces??[],i.activeWorkspaceId,a.value)),k=P(()=>(i.workspaces?.length??0)-_.value.length);Ke(l,we=>{we||(a.value=!1)});function g(we){l.value=!1,we!==i.activeWorkspaceId&&r("selectWorkspace",we)}function v(we){const X=Number.parseFloat(we);return Number.isFinite(X)?X:0}function y(we){return`${we.fontStyle||"normal"} ${we.fontWeight||"400"} ${we.fontSize} ${we.fontFamily}`}function A(we){return we.letterSpacing==="normal"?0:v(we.letterSpacing)}function L(we,X){if(!we)return 0;const me=U3(we,y(X),{letterSpacing:A(X)});return j3(me)}function $(){const we=c.value?.getBoundingClientRect().width??window.innerWidth;return Math.max(0,we*.75)}function x(){const we=u.value;if(!we)return;const X=we.querySelector(".ws-pick-item-path");if(!X)return;const me=getComputedStyle(X),je=(i.workspaces??[]).reduce((lt,ee)=>Math.max(lt,L(ee.shortPath,me)),0);d.value=je?`${Math.ceil(Math.min(je,$()))}px`:""}function E(){typeof window>"u"||pt(()=>{p!==null&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{p=null,x()})})}Ke(()=>[i.activeWorkspaceId,i.workspaceName,i.workspaces?.map(we=>`${we.id}\0${we.name}\0${we.shortPath}`).join("")??"",k.value,o.value],E,{immediate:!0}),ln(()=>{E(),window.addEventListener("resize",E),document.fonts?.ready.then(E)}),fn(()=>{p!==null&&window.cancelAnimationFrame(p),window.removeEventListener("resize",E)}),Ac($t.contentAlign);const N=Q(null),F=Q(null),S=Q(null),T=Q(!1),R=Q(0);let O=null;function D(we,X){const me=S.value??F.value;return!me||me.loadForEdit(we)===!1?!1:(me.loadAttachmentsForEdit(X??[]),!0)}function W(){T.value=!0,O!==null&&clearTimeout(O),O=setTimeout(()=>{O=null,T.value=!1},2e3)}function z(){R.value++}const V=P(()=>i.tasks.filter(we=>we.kind!=="subagent")),U=P(()=>i.tasks.filter(we=>we.kind==="subagent"&&we.runInBackground)),re=P(()=>V.value.filter(we=>we.state==="run").length),ae=P(()=>U.value.filter(we=>we.state==="run").length);function te(we){const X=i.tasks,me=X.find(lt=>lt.id===we)??X.find(lt=>lt.parentToolCallId===we);if(me)return me.id;const je=X.filter(lt=>lt.kind==="subagent"&&!lt.parentToolCallId);if(je.length===1)return je[0].id}An("resolveAgentTaskId",te),An("pinScroll",ss);const Z=P(()=>(i.todos??[]).filter(we=>we.status==="done").length),ne=P(()=>V.value.length>0||U.value.length>0||(i.todos?.length??0)>0||(i.queued?.length??0)>0),ke=Q(null),Se=P(()=>i.gitInfo?i.changes?.length??0:0);function Ye(we){ke.value=ke.value===we?null:we}function ve(){ke.value=null}Ke(ne,we=>{we||ve()});function Y(we){if(we.role==="compaction")return s("conversation.compactedPlain");if(we.role==="user"){if(we.skillActivation)return`/${we.skillActivation.name}`;if(we.pluginCommand)return`/${we.pluginCommand.pluginId}:${we.pluginCommand.commandName}`;const me=we.text.trim().replaceAll(/\s+/g," ");return me.length>0?me:"user"}const X=(we.text||we.thinking||"").trim().replaceAll(/\s+/g," ");return X.length>0?X:(we.tools?.length??0)>0?`${we.tools.length} tools`:"kimi"}const ce=P(()=>i.turns.filter(we=>we.role==="user").map((we,X)=>({id:we.id,role:we.role,no:X+1,title:Y(we)}))),fe=Q(null);function j(){const we=q.value;if(!we)return;const X=we.querySelectorAll(".turn-anchor[data-turn-id]");if(X.length===0)return;const me=ce.value;if(me.length===0)return;const je=new Set(me.map(Ae=>Ae.id));if(wt()<=D0){fe.value=me[me.length-1].id;return}const lt=we.getBoundingClientRect(),ee=lt.height/2;let _e=null;X.forEach(Ae=>{const Pe=Ae.dataset.turnId;if(!Pe||!je.has(Pe))return;Ae.getBoundingClientRect().top-lt.top<=ee&&(_e=Pe)}),fe.value=_e??me[0].id}const se=P(()=>i.questions&&i.questions.length>0?i.questions[0]:void 0),ge=P(()=>{const we=se.value;if(we)return i.pendingQuestionActions?.[we.questionId]}),ue=P(()=>i.approvals&&i.approvals.length>0?i.approvals[0]:void 0),pe=P(()=>{const we=ue.value;return we?!!i.pendingApprovalActions?.[we.approvalId]:!1}),q=Q(null),J=Q(null),he=Q(0),Te=Q(0),Ie=P(()=>({"--panes-scrollbar-width":`${he.value}px`}));function Oe(we){return we instanceof HTMLElement?we:we&&"$el"in we&&we.$el instanceof HTMLElement?we.$el:null}function de(){const we=q.value;he.value=we?Math.max(0,we.offsetWidth-we.clientWidth):0,Te.value=J.value?.offsetHeight??0}function $e(we){const X=Oe(we);q.value=X,X&&Vo()}function Qe(we){const X=Oe(we);J.value=X??null,we&&"loadForEdit"in we&&typeof we.loadForEdit=="function"&&"focus"in we&&typeof we.focus=="function"?S.value={loadForEdit:we.loadForEdit.bind(we),loadAttachmentsForEdit:"loadAttachmentsForEdit"in we&&typeof we.loadAttachmentsForEdit=="function"?we.loadAttachmentsForEdit.bind(we):()=>{},focus:we.focus.bind(we)}:S.value=null,Vn()}const tt=Q(!0),vt=Q(!1);function wt(){const we=q.value;return we?we.scrollHeight-we.scrollTop-we.clientHeight:0}let xt=0,Rt=0,yt=0,nn=0,xn=0,ns=0;function Wt(){return Date.now()<Rt}function _n(){const we=q.value;if(!we)return;const X=we.scrollTop;if(hs()){xt=X;return}if(performance.now()-yt<100){xt=X;return}const me=wt();if(Wt()){tt.value=!0,vt.value=!1,xt=X;return}X<xt-1&&me>1?(tt.value=!1,vt.value=!0):me<=D0&&X>xt+1&&(tt.value=!0,vt.value=!1),xt=X,j()}function gn(we=!1){const X=q.value;tt.value=!0,vt.value=!1,X&&(!we&&performance.now()<nn||(we&&typeof X.scrollTo=="function"?(yt=performance.now(),nn=performance.now()+Xae,X.scrollTo({top:X.scrollHeight,behavior:"smooth"})):X.scrollTop=X.scrollHeight,xt=X.scrollTop))}function ot(we,X){const me=we.querySelectorAll(".turn-anchor");for(const je of me)if(je.offsetTop>=X){const lt=je.dataset.turnId;if(lt)return{id:lt,top:je.offsetTop}}return null}async function ds(){if(!i.sessionId||!i.loadOlderMessages||i.loadingMore||!i.hasMoreMessages)return;const we=i.sessionId,X=q.value,me=X?.scrollTop??0,je=X?.scrollHeight??0,lt=X?ot(X,me):null;Ks.value=!0;try{await i.loadOlderMessages(we),await pt()}finally{Ks.value=!1}if(i.sessionId!==we)return;const ee=q.value;if(!ee)return;let _e=0;if(lt){const Ae=ee.querySelector(`.turn-anchor[data-turn-id="${ys(lt.id)}"]`);Ae&&(_e=Ae.offsetTop-lt.top)}_e===0&&(_e=ee.scrollHeight-je),ee.scrollTop=me+_e}function ys(we){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(we):we.replaceAll(/["\\]/g,"\\$&")}function fs(we){const X=q.value;if(!X)return;const me=X.querySelector(`.turn-anchor[data-turn-id="${ys(we)}"]`);me&&(tt.value=!1,vt.value=wt()>D0,me.scrollIntoView({behavior:"smooth",block:"center"}))}function Xe(){const we=q.value;if(!we)return"none";const X=we.firstElementChild,me=X instanceof HTMLElement?X.offsetHeight:0,je=J.value?.offsetHeight??0;return`${we.scrollHeight}:${we.clientHeight}:${me}:${je}`}function Ze(we){return typeof requestAnimationFrame=="function"?requestAnimationFrame(we):setTimeout(we,16)}function Mt(we){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(we):clearTimeout(we)}let Dt=0,zt=0,wn=null,Rn=0;function hs(){return performance.now()<Dt}function ss(we,X=260){const me=q.value;if(!me||(wn=we,Rn=we.getBoundingClientRect().top,Dt=performance.now()+X,zt))return;const je=()=>{if(zt=0,performance.now()>=Dt||!wn){wn=null;return}const lt=wn.getBoundingClientRect().top-Rn;lt&&(me.scrollTop+=lt),zt=Ze(je)};zt=Ze(je)}function sn(we=36){if(!tt.value&&!Wt())return;const X=++ns;let me="",je=0,lt=0;xn&&(Mt(xn),xn=0);const ee=()=>{if(xn=0,X!==ns||!tt.value&&!Wt())return;gn(!1);const _e=Xe();je=_e===me?je+1:0,me=_e,lt++,je<3&&lt<we&&(xn=Ze(ee))};xn=Ze(ee)}function Lt(we,X){return we!==void 0&&we.length>0&&X.length>=we.length&&we.firstId!==X.firstId&&we.lastId===X.lastId&&we.lastTextLen===X.lastTextLen&&we.lastThinkingLen===X.lastThinkingLen&&we.lastToolsLen===X.lastToolsLen&&we.approvalIds===X.approvalIds}const Vs=P(()=>{const we=(i.approvals??[]).map(ee=>ee.approvalId).join(","),X=i.turns,me=X.at(-1),je=me?.thinking?.length??0,lt=me?.tools?.reduce((ee,_e)=>ee+_e.name.length+(_e.arg?.length??0)+(_e.output?.join("").length??0),0)??0;return{length:X.length,firstId:X[0]?.id??"",lastId:me?.id??"",lastTextLen:me?.text.length??0,lastThinkingLen:je,lastToolsLen:lt,approvalIds:we}});Ke(Vs,async(we,X)=>{if(Ks.value&&Lt(X,we)){j();return}await pt(),tt.value||Wt()?gn(we.length<X.length):vt.value=!0,j()}),Ke(J,()=>{Vn()}),Ke(()=>i.mobile,async()=>{await pt(),de()});const an=new Map;Ke(()=>i.fileReloadKey,async(we,X)=>{const me=q.value;X&&me&&an.set(String(X),{top:me.scrollTop,following:tt.value}),await pt();const je=q.value,lt=we?an.get(String(we)):void 0;lt&&je?(tt.value=lt.following,je.scrollTop=lt.top,xt=lt.top,lt.following&&sn()):(tt.value=!0,xt=0,gn(!1),sn()),j()}),Ke(()=>i.sessionLoading,async(we,X)=>{we||!X||(tt.value=!0,await pt(),sn(),j())}),Ke(()=>i.running,async(we,X)=>{we||!X||!tt.value&&!Wt()||(await pt(),sn(48),j())});function So(){tt.value=!0,vt.value=!1,Rt=Date.now()+aC,pt(()=>{gn(!0),sn(16)})}function Co(we){So(),r("submit",we)}function Rs(we){tt.value=!0,vt.value=!1,Rt=Date.now()+aC,r("editMessage",we)}function fi(we){const X=i.queued?.[we],me=X?.text??"";D(me,X?.attachments)&&r("editQueued",we)}function co(we){r("reorderQueue",we)}function jo(we,X){So(),r("answer",we,X)}function Ot(we,X){!we||!X||r("approval",we,X)}let Bs=null,qn=null,Cs=null,On=null,Hn=0,hi=0,Xn=0,qo=!1;const Ks=Q(!1);function Mi(we){if(Ks.value||(qo=qo||we,Xn))return;Xn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:me=>setTimeout(me,16))(()=>{Xn=0;const me=qo;qo=!1,!hs()&&(tt.value||Wt()?gn(!1):me&&(vt.value=!0))})}function Ao(){if(!qn)return;const we=q.value?.firstElementChild??null;we!==Cs&&(Cs&&qn.unobserve(Cs),Cs=we,we&&qn.observe(we))}function Vn(){if(!qn)return;const we=J.value;we!==On&&(On&&qn.unobserve(On),On=we,we&&qn.observe(we))}function Vo(){const we=q.value;de(),Bs&&(Bs.disconnect(),we&&Bs.observe(we,{childList:!0,subtree:!0,characterData:!0})),qn&&(qn.disconnect(),Cs=null,On=null,we&&qn.observe(we),Ao(),Vn()),Hn=we?.scrollHeight??0,hi=we?.clientHeight??0}function ji(){Ao(),Mi(!0)}function Ko(){typeof document>"u"||document.visibilityState==="visible"&&tt.value&&sn()}const Bn=Q(!1);let Kn=null;function Mo(){Bn.value=!0,Kn!==null&&clearTimeout(Kn),Kn=setTimeout(()=>{Bn.value=!1},Jae)}function rt(){Mo(),r("interrupt")}function xe(we){we.key==="Escape"&&(i.running||i.sending)&&(we.preventDefault(),rt())}ln(()=>{pt(()=>{typeof MutationObserver=="function"&&(Bs=new MutationObserver(ji)),typeof ResizeObserver=="function"&&(qn=new ResizeObserver(()=>{de();const we=q.value;if(!we)return;const{scrollHeight:X,clientHeight:me}=we,je=X>Hn+1,lt=me<hi-1;Hn=X,hi=me,!hs()&&(je||lt)&&Mi(!1)})),Vo(),sn(48),j(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ko),document.addEventListener("keydown",xe))})}),fn(()=>{Bs&&Bs.disconnect(),qn&&qn.disconnect(),Xn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Xn),xn&&Mt(xn),zt&&Mt(zt),Kn!==null&&clearTimeout(Kn),O!==null&&(clearTimeout(O),O=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ko),document.removeEventListener("keydown",xe))});function Le(){(S.value??F.value)?.focus()}return t({loadComposerForEdit:D,focusComposer:Le}),(we,X)=>(b(),I("section",{class:De(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(b(),ye(woe,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":Se.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:T.value,onOpenChanges:X[0]||(X[0]=me=>r("openChanges")),onCopyAll:X[1]||(X[1]=me=>N.value?.copyConversation()),onCopyFinalSummary:X[2]||(X[2]=me=>N.value?.copyFinalSummary()),onOpenPr:X[3]||(X[3]=me=>e.pr&&r("openPr",e.pr.url)),onRenameSession:X[4]||(X[4]=(me,je)=>r("renameSession",me,je)),onForkSession:X[5]||(X[5]=me=>r("forkSession",me)),onArchiveSession:X[6]||(X[6]=me=>r("archiveSession",me))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):le("",!0),e.conversationToc?(b(),ye(Lae,{key:1,items:ce.value,"active-turn-id":fe.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:fs},null,8,["items","active-turn-id","mobile","session-loading"])):le("",!0),w("div",Rae,[w("div",{ref:$e,class:"panes chat-scroll",onScrollPassive:_n},[w("div",{ref_key:"contentWrapRef",ref:c,class:De(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(b(),I(Be,{key:0},[X[55]||(X[55]=w("div",{class:"empty-spacer"},null,-1)),w("div",Bae,[w("span",{class:De(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(b(),ye(wo,{key:0,size:"sm"})):le("",!0),w("span",null,B(e.starting?C(s)("conversation.starting"):C(s)("composer.emptyConversationTitle")),1)],2),e.starting?le("",!0):(b(),I("span",Dae,B(C(s)("composer.emptyConversation")),1)),m.value&&!e.starting?(b(),I("div",{key:1,class:"ws-pick",style:qt(f.value)},[w("div",{ref_key:"wsPickMeasureRef",ref:u,class:"ws-pick-measure","aria-hidden":"true"},[w("button",Pae,[ie(Ve,{name:"folder",size:"sm"}),w("span",Hae,B(h.value),1),ie(Ve,{class:"ws-pick-chev",name:"chevron-down",size:"sm"})]),w("div",Wae,[X[53]||(X[53]=w("button",{type:"button",class:"ws-pick-item",tabindex:"-1"},[w("span",{class:"ws-pick-item-name"}),w("span",{class:"ws-pick-item-path"})],-1)),w("button",zae,[w("span",null,B(C(s)("conversation.moreWorkspaces",{count:k.value})),1)]),w("button",Uae,[ie(Ve,{name:"plus",size:"sm"}),w("span",null,B(C(s)("conversation.addWorkspace")),1)])])],512),ie(jt,{text:C(s)("conversation.switchWorkspace")},{default:Ee(()=>[w("button",{type:"button",class:"ws-pick-btn",onClick:X[7]||(X[7]=bt(me=>l.value=!l.value,["stop"]))},[ie(Ve,{name:"folder",size:"sm"}),w("span",jae,B(h.value),1),ie(Ve,{class:De(["ws-pick-chev",{open:l.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),l.value?(b(),I("div",{key:0,class:"ws-pick-backdrop",onClick:X[8]||(X[8]=me=>l.value=!1)})):le("",!0),l.value?(b(),I("div",qae,[(b(!0),I(Be,null,nt(_.value,me=>(b(),I("button",{key:me.id,type:"button",class:De(["ws-pick-item",{on:me.id===e.activeWorkspaceId}]),onClick:bt(je=>g(me.id),["stop"])},[w("span",Kae,B(me.name),1),w("span",Gae,B(me.shortPath),1)],10,Vae))),128)),k.value>0?(b(),I("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:X[9]||(X[9]=bt(me=>a.value=!a.value,["stop"]))},[w("span",null,B(C(s)("conversation.moreWorkspaces",{count:k.value})),1)])):le("",!0),X[54]||(X[54]=w("div",{class:"ws-pick-divider"},null,-1)),w("button",{type:"button",class:"ws-pick-action",onClick:X[10]||(X[10]=bt(me=>{l.value=!1,r("addWorkspace")},["stop"]))},[ie(Ve,{name:"plus",size:"sm"}),w("span",null,B(C(s)("conversation.addWorkspace")),1)])])):le("",!0)],4)):e.starting?le("",!0):(b(),I("button",{key:2,type:"button",class:"empty-add-workspace",onClick:X[11]||(X[11]=me=>r("addWorkspace"))},[ie(Ve,{name:"folder-plus",size:"sm"}),w("span",null,B(C(s)("conversation.addWorkspace")),1)]))]),ie(V5,{ref_key:"emptyComposerRef",ref:F,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Co,onSteer:X[12]||(X[12]=me=>r("steer",me)),onCommand:X[13]||(X[13]=me=>r("command",me)),onInterrupt:rt,onUnqueue:X[14]||(X[14]=me=>r("unqueue",me)),onEditQueued:X[15]||(X[15]=me=>r("editQueued",me)),onSetPermission:X[16]||(X[16]=me=>r("setPermission",me)),onSetThinking:X[17]||(X[17]=me=>r("setThinking",me)),onTogglePlan:X[18]||(X[18]=me=>r("togglePlan")),onToggleSwarm:X[19]||(X[19]=me=>r("toggleSwarm")),onToggleGoal:X[20]||(X[20]=me=>r("toggleGoal")),onOpenBtw:X[21]||(X[21]=me=>r("command","/btw")),onCreateGoal:X[22]||(X[22]=me=>r("createGoal",me)),onControlGoal:X[23]||(X[23]=me=>r("controlGoal",me)),onFocusGoal:z,onCompact:X[24]||(X[24]=me=>r("compact")),onPickModel:X[25]||(X[25]=me=>r("pickModel")),onSelectModel:X[26]||(X[26]=me=>r("selectModel",me))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),X[56]||(X[56]=w("div",{class:"empty-spacer"},null,-1))],64)):(b(),ye(U5,{ref_key:"chatPaneRef",ref:N,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":tt.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:X[27]||(X[27]=me=>r("openFile",me)),onOpenMedia:X[28]||(X[28]=me=>r("openMedia",me)),onCopyConversationCopied:W,onOpenThinking:X[29]||(X[29]=me=>r("openThinking",me)),onOpenCompaction:X[30]||(X[30]=me=>r("openCompaction",me)),onOpenAgent:X[31]||(X[31]=me=>r("openAgent",me)),onOpenToolDiff:X[32]||(X[32]=me=>r("openToolDiff",me)),onEditMessage:Rs,onLoadOlderMessages:ds,onUnqueue:X[33]||(X[33]=me=>r("unqueue",me)),onEditQueued:fi,onReorderQueue:co},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],32),e.turns.length===0&&!e.sessionLoading?le("",!0):(b(),ye(Aae,{key:0,ref:Qe,style:qt(Ie.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":R.value,"dock-panel":ke.value,"bash-tasks":V.value,"subagent-tasks":U.value,"bash-running":re.value,"subagent-running":ae.value,"todo-done-count":Z.value,"has-dock-work":ne.value,todos:e.todos,"pending-question":se.value,"question-busy-kind":ge.value,"pending-approval":ue.value,"approval-busy":pe.value,mobile:e.mobile,onToggleDockPanel:X[34]||(X[34]=me=>Ye(me)),onCloseDockPanel:X[35]||(X[35]=me=>ve()),onOpenAgent:X[36]||(X[36]=me=>r("openAgent",me)),onAnswer:jo,onDismiss:X[37]||(X[37]=me=>r("dismiss",me)),onApproval:Ot,onCancelTask:X[38]||(X[38]=me=>r("cancelTask",me)),onControlGoal:X[39]||(X[39]=me=>r("controlGoal",me)),onSubmit:Co,onSteer:X[40]||(X[40]=me=>r("steer",me)),onCommand:X[41]||(X[41]=me=>r("command",me)),onInterrupt:rt,onSetPermission:X[42]||(X[42]=me=>r("setPermission",me)),onSetThinking:X[43]||(X[43]=me=>r("setThinking",me)),onTogglePlan:X[44]||(X[44]=me=>r("togglePlan")),onToggleSwarm:X[45]||(X[45]=me=>r("toggleSwarm")),onToggleGoal:X[46]||(X[46]=me=>r("toggleGoal")),onOpenBtw:X[47]||(X[47]=me=>r("command","/btw")),onCreateGoal:X[48]||(X[48]=me=>r("createGoal",me)),onFocusGoal:z,onCompact:X[49]||(X[49]=me=>r("compact")),onPickModel:X[50]||(X[50]=me=>r("pickModel")),onSelectModel:X[51]||(X[51]=me=>r("selectModel",me))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ie(cl,{name:"pill"},{default:Ee(()=>[vt.value?(b(),I("button",{key:0,class:"newmsg-pill",style:qt({bottom:`${Te.value+12}px`}),"aria-label":C(s)("conversation.jumpToLatestAria"),onClick:X[52]||(X[52]=me=>gn(!0))},[ie(Ve,{class:"pill-chevron",name:"chevron-down",size:"md"}),Ge(" "+B(C(s)("conversation.newMessages")),1)],12,Yae)):le("",!0)]),_:1}),ie(cl,{name:"abort-toast"},{default:Ee(()=>[Bn.value?(b(),I("div",Zae,[w("span",Qae,B(C(s)("conversation.manuallyAborted")),1)])):le("",!0)]),_:1})],2))}}),tce=ut(ece,[["__scopeId","data-v-cc90eb04"]]),nce=["aria-selected","onClick"],sce=qe({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),I("div",{class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(b(!0),I(Be,null,nt(e.options,i=>(b(),I("button",{key:i.value,class:De(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},B(i.label),11,nce))),128))],2))}}),to=ut(sce,[["__scopeId","data-v-d1aaccd7"]]),oce={class:"ui-panel-header__title"},ice={key:0,class:"ui-panel-header__sub"},rce=qe({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-panel-header",{wrap:e.wrap}])},[w("span",oce,B(e.title),1),ie(jt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(b(),I("span",ice,B(e.subtitle),1)):le("",!0)]),_:1},8,["text"]),In(t.$slots,"default",{},void 0,!0),e.closable?(b(),ye(Nn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])):le("",!0)],2))}}),ca=ut(rce,[["__scopeId","data-v-c47879ad"]]),lce={key:0,class:"fp-empty fp-error"},ace={key:1,class:"fp-empty"},cce={key:2,class:"fp-loading"},uce={class:"fp-path"},dce={class:"fp-meta"},fce={key:0,class:"fp-lines"},hce={class:"fp-size"},pce={key:3,class:"fp-search"},mce=["placeholder"],gce={key:0,class:"fp-search-count"},vce=["href","aria-label"],yce={key:1,class:"fp-code"},kce={class:"fp-line-table"},bce=["data-line"],xce={class:"fp-gutter"},_ce=["innerHTML"],wce={key:1,class:"fp-body fp-code"},Sce={class:"fp-line-table"},Cce=["data-line"],Ace={class:"fp-gutter"},Mce=["innerHTML"],Ece={key:2,class:"fp-body"},Tce=["srcdoc","title"],Nce={key:1,class:"fp-code"},Ice={class:"fp-line-table"},$ce=["data-line"],Lce={class:"fp-gutter"},Fce=["innerHTML"],Oce={key:3,class:"fp-body fp-pdf-wrap"},Rce=["src","title"],Bce={key:1,class:"fp-binary-card"},Dce={class:"fp-binary-label"},Pce={key:4,class:"fp-body fp-table-wrap"},Hce={class:"fp-table"},Wce=["data-line"],zce={key:5,class:"fp-body fp-image-wrap"},Uce=["src","alt"],jce={key:1,class:"fp-binary-card"},qce={class:"fp-binary-icon"},Vce={class:"fp-binary-label"},Kce={key:6,class:"fp-body fp-code"},Gce={class:"fp-line-table"},Yce=["data-line"],Zce={class:"fp-gutter"},Qce=["innerHTML"],Xce={key:7,class:"fp-body fp-binary-wrap"},Jce={class:"fp-binary-card"},eue={class:"fp-binary-icon"},tue={class:"fp-binary-label"},nue=qe({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Et();function s(ve,Y){const ce=Y?Y.split("/").filter(Boolean):[];for(const fe of ve.split("/"))fe===""||fe==="."||(fe===".."?ce.pop():ce.push(fe));return ce.join("/")}const o=Ut("resolveImage",async ve=>ve),i=P(()=>{const ve=c.file?.path??"",Y=ve.lastIndexOf("/");return Y>0?ve.slice(0,Y):""});function r(ve){if(/^(https?:|data:|blob:)/i.test(ve)||ve.startsWith("/"))return ve;const Y=i.value;return Y?s(ve,Y):ve}async function l(ve){const Y=r(ve);return o?o(Y):Y}An("resolveImage",l);function a(ve){let Y=ve.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(Y)||Y.startsWith("/"))return ve;for(const fe of["#","?"]){const j=Y.indexOf(fe);j!==-1&&(Y=Y.slice(0,j))}const ce=i.value;return{...ve,path:s(Y,ce)}}const c=e,u=t;function d(ve){c.openFile?.(a(ve))}const f=Q(null),p=P(()=>{const ve=c.file;if(!ve)return"binary";const Y=ve.mime??"",ce=ve.languageId??"",fe=ve.path.toLowerCase();return Y==="text/markdown"||ce==="markdown"||ce==="md"||fe.endsWith(".mdx")?"markdown":Y==="application/json"||ce==="json"?"json":Y==="text/html"||ce==="html"||fe.endsWith(".html")||fe.endsWith(".htm")?"html":Y==="application/pdf"||fe.endsWith(".pdf")?"pdf":Y==="text/csv"||ce==="csv"||fe.endsWith(".csv")?"csv":Y.startsWith("image/")?"image":ve.isBinary?"binary":Y.startsWith("text/")||ce!==""?"text":"binary"});function h(ve){const Y=atob(ve),ce=Uint8Array.from(Y,fe=>fe.charCodeAt(0));return new TextDecoder().decode(ce)}const m=P(()=>{const ve=c.file;if(!ve)return"";if(ve.encoding==="base64")try{return h(ve.content)}catch{return ve.content}return ve.content}),_=P(()=>{if(p.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=P(()=>c.file?(p.value==="json"?_.value:m.value).split(`
298
+ `):[]),g=P(()=>c.file?p.value==="json"?_.value:m.value:""),v=Q(""),y=Q(0),A=P(()=>{const ve=v.value.trim().toLowerCase();if(!ve)return[];const Y=[];return k.value.forEach((ce,fe)=>{ce.toLowerCase().includes(ve)&&Y.push(fe+1)}),Y});Ke(v,()=>{y.value=0});function L(ve,Y=!1){ve&&pt(()=>{const ce=f.value?.querySelector(".fp-body"),fe=ce?.querySelector(`[data-line="${ve}"]`);if(!ce||!fe)return;Y&&(ce.scrollTop=0);const j=ce.getBoundingClientRect(),se=fe.getBoundingClientRect(),ge=se.top-j.top+ce.scrollTop;ce.scrollTop=ge-ce.clientHeight/2+se.height/2})}Ke(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(ve){const Y=A.value;Y.length!==0&&(y.value=(y.value+ve+Y.length)%Y.length,L(Y[y.value]))}function x(ve){const Y=A.value;return{target:c.line===ve,hit:Y.includes(ve),active:Y[y.value]===ve}}function E(ve){return ve<1024?`${ve} B`:ve<1024*1024?`${(ve/1024).toFixed(1)} KB`:`${(ve/(1024*1024)).toFixed(1)} MB`}const N=Q(!1),F=Q(!1);function S(){c.file&&js(g.value).then(ve=>{ve&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function T(){c.file&&js(c.file.path).then(ve=>{ve&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const R=Q("preview"),O=Q("preview"),D=Q("fit");function W(ve){R.value=ve}function z(ve){O.value=ve}function V(ve){D.value=ve}Ke(p,ve=>{R.value=ve==="html"?"preview":"source",O.value="preview",D.value="fit"});const U=P(()=>{const ve=c.file;return!ve||p.value!=="image"?null:ve.sourceUrl?ve.sourceUrl:ve.encoding==="base64"?`data:${ve.mime};base64,${ve.content}`:ve.mime==="image/svg+xml"?`data:${ve.mime};charset=utf-8,${encodeURIComponent(ve.content)}`:null}),re=P(()=>{const ve=c.file;return!ve||p.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ve.encoding==="base64"?`data:${ve.mime};base64,${ve.content}`:null}),ae=P(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function te(ve){const Y=[];let ce="",fe=!1;for(let j=0;j<ve.length;j++){const se=ve[j];se==='"'&&ve[j+1]==='"'?(ce+='"',j++):se==='"'?fe=!fe:se===","&&!fe?(Y.push(ce),ce=""):ce+=se}return Y.push(ce),Y}const Z=P(()=>k.value.slice(0,200).map(te));function ne(ve){return ve.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ke(){const ve=c.file;if(!ve)return"";const Y=ve.languageId?.toLowerCase();return Y||(ve.path.split(".").pop()?.toLowerCase()??"")}function Se(ve){const Y=ke();let ce=ne(ve);return p.value==="json"||Y==="json"||Y==="jsonc"?(ce=ce.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),ce=ce.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),ce=ce.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ce=ce.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ce):p.value==="html"||Y==="html"||Y==="xml"||Y==="svg"?(ce=ce.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ce=ce.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ce):(ce=ce.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),ce=ce.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ce)}function Ye(ve,Y=55){return!ve||ve.length<=Y?ve:"…"+ve.slice(ve.length-Y+1)}return(ve,Y)=>(b(),I("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(b(),I("div",lce,[w("span",null,B(e.error),1),e.closable?(b(),ye(Ft,{key:0,variant:"secondary",size:"sm",onClick:Y[0]||(Y[0]=ce=>u("close"))},{default:Ee(()=>[Ge(B(C(n)("filePreview.close")),1)]),_:1})):le("",!0)])):!e.file&&!e.loading?(b(),I("div",ace,B(C(n)("filePreview.empty")),1)):e.loading?(b(),I("div",cce,[Y[7]||(Y[7]=w("span",{class:"spinner"},null,-1)),w("span",null,B(C(n)("filePreview.loading")),1)])):e.file?(b(),I(Be,{key:3},[ie(ca,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:Y[6]||(Y[6]=ce=>u("close"))},{default:Ee(()=>[ie(jt,{text:e.file.path},{default:Ee(()=>[w("span",uce,B(Ye(e.file.path)),1)]),_:1},8,["text"]),w("span",dce,[e.file.lineCount?(b(),I("span",fce,B(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):le("",!0),w("span",hce,B(E(e.file.size)),1)]),p.value==="html"?(b(),ye(to,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):le("",!0),p.value==="markdown"?(b(),ye(to,{key:1,"model-value":O.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):le("",!0),p.value==="image"?(b(),ye(to,{key:2,"model-value":D.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":V},null,8,["model-value","options"])):le("",!0),p.value==="text"||p.value==="json"||p.value==="html"||p.value==="csv"?(b(),I("div",pce,[Tn(w("input",{"onUpdate:modelValue":Y[1]||(Y[1]=ce=>v.value=ce),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,mce),[[ao,v.value]]),v.value.trim()?(b(),I("span",gce,B(A.value.length),1)):le("",!0),ie(Nn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:Y[2]||(Y[2]=ce=>$(-1))},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Nn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:Y[3]||(Y[3]=ce=>$(1))},{default:Ee(()=>[ie(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):le("",!0),ie(Nn,{size:"sm",class:De({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:T},{default:Ee(()=>[F.value?(b(),ye(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ye(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(b(),ye(Nn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:Y[4]||(Y[4]=ce=>u("openExternal"))},{default:Ee(()=>[ie(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):le("",!0),e.externalActions?(b(),ye(Nn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:Y[5]||(Y[5]=ce=>u("reveal"))},{default:Ee(()=>[ie(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):le("",!0),e.downloadUrl?(b(),I("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ie(Ve,{name:"download",size:"md"})],8,vce)):le("",!0),!e.file.isBinary&&p.value!=="image"?(b(),ye(Nn,{key:7,size:"sm",class:De({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[N.value?(b(),ye(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ye(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):le("",!0)]),_:1},8,["title","closable","close-label"]),p.value==="markdown"?(b(),I("div",{key:0,class:De(["fp-body",{"fp-markdown":O.value==="preview"}])},[O.value==="preview"?(b(),ye(rm,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(b(),I("div",yce,[w("div",kce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",xce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,_ce)],10,bce))),128))])]))],2)):p.value==="json"?(b(),I("div",wce,[w("div",Sce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Ace,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Mce)],10,Cce))),128))])])):p.value==="html"?(b(),I("div",Ece,[R.value==="preview"?(b(),I("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ae.value,title:e.file.path},null,8,Tce)):(b(),I("div",Nce,[w("div",Ice,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Lce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Fce)],10,$ce))),128))])]))])):p.value==="pdf"?(b(),I("div",Oce,[re.value?(b(),I("iframe",{key:0,class:"fp-pdf-frame",src:re.value,title:e.file.path},null,8,Rce)):(b(),I("div",Bce,[w("span",Dce,B(C(n)("filePreview.pdfNoPreview")),1)]))])):p.value==="csv"?(b(),I("div",Pce,[w("table",Hce,[w("tbody",null,[(b(!0),I(Be,null,nt(Z.value,(ce,fe)=>(b(),I("tr",{key:fe,class:De(x(fe+1)),"data-line":fe+1},[w("th",null,B(fe+1),1),(b(!0),I(Be,null,nt(ce,(j,se)=>(b(),I("td",{key:se},B(j),1))),128))],10,Wce))),128))])])])):p.value==="image"?(b(),I("div",zce,[U.value?(b(),I("img",{key:0,src:U.value,alt:e.file.path,class:De(["fp-image",{actual:D.value==="actual"}])},null,10,Uce)):(b(),I("div",jce,[w("span",qce,[ie(Ve,{name:"image-off",size:"lg"})]),w("span",Vce,B(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):p.value==="text"?(b(),I("div",Kce,[w("div",Gce,[(b(!0),I(Be,null,nt(k.value,(ce,fe)=>(b(),I("div",{key:fe,class:De(["fp-line-row",x(fe+1)]),"data-line":fe+1},[w("span",Zce,B(fe+1),1),w("span",{class:"fp-line-text",innerHTML:Se(ce)},null,8,Qce)],10,Yce))),128))])])):(b(),I("div",Xce,[w("div",Jce,[w("span",eue,[ie(Ve,{name:"file-off",size:"lg"})]),w("span",tue,B(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):le("",!0)],512))}}),sue=ut(nue,[["__scopeId","data-v-62bfaf2d"]]),oue={class:"tp"},iue=qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=Q(null);return Ke(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||pt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(b(),I("div",oue,[ie(ca,{title:C(o)("common.preview"),subtitle:e.subtitle??C(o)("thinking.panelTitle"),"close-label":C(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),w("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},B(e.text),513)]))}}),cC=ut(iue,[["__scopeId","data-v-cf9c560b"]]),rue={class:"ap"},lue={key:0,class:"ap-type"},aue={key:1,class:"ap-reason"},cue={key:2,class:"ap-field"},uue={class:"ap-field-body"},due={key:3,class:"ap-field"},fue={class:"ap-field-body ap-live"},hue={key:4,class:"ap-field"},pue={class:"ap-field-body ap-progress"},mue={key:0,class:"ap-call"},gue={key:1,class:"ap-output"},vue=["onClick"],yue={key:5,class:"ap-field"},kue={class:"ap-field-body"},bue=8,uC=5,dC=2,xue=qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=P(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=P(()=>(n.member.text??"").trimEnd());function l(m){const _=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},_.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},_.push(k));return _}const a=P(()=>l(i.value)),c=Q(new Set);function u(m){return c.value.has(m)}function d(m){const _=new Set(c.value);_.has(m)?_.delete(m):_.add(m),c.value=_}function f(m){return m.output.length-uC-dC}function p(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const h=Q(null);return Ke(()=>i.value.length+r.value.length,()=>{const m=h.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||pt(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})},{immediate:!0}),(m,_)=>(b(),I("div",rue,[ie(ca,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:_[0]||(_[0]=k=>s("close"))},{default:Ee(()=>[ie(Ro,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Ge(B(p(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:h,class:"ap-body"},[e.member.subagentType?(b(),I("div",lue,B(e.member.subagentType),1)):le("",!0),e.member.suspendedReason?(b(),I("div",aue,B(e.member.suspendedReason),1)):le("",!0),e.member.prompt?(b(),I("div",cue,[_[1]||(_[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",uue,B(e.member.prompt),1)])):le("",!0),r.value?(b(),I("div",due,[_[2]||(_[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",fue,B(r.value),1)])):le("",!0),a.value.length>0?(b(),I("div",hue,[_[4]||(_[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",pue,[(b(!0),I(Be,null,nt(a.value,k=>(b(),I("div",{key:k.key,class:"ap-group"},[k.call?(b(),I("div",mue,[_[3]||(_[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Ge(" "+B(k.call),1)])):le("",!0),k.output.length>0?(b(),I("div",gue,[k.output.length<=bue||u(k.key)?(b(!0),I(Be,{key:0},nt(k.output,(g,v)=>(b(),I("div",{key:v,class:"ap-out-line"},B(g),1))),128)):(b(),I(Be,{key:1},[(b(!0),I(Be,null,nt(k.output.slice(0,uC),(g,v)=>(b(),I("div",{key:v,class:"ap-out-line"},B(g),1))),128)),w("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+B(f(k))+" more) ",9,vue),(b(!0),I(Be,null,nt(k.output.slice(-dC),(g,v)=>(b(),I("div",{key:"t"+v,class:"ap-out-line"},B(g),1))),128))],64))])):le("",!0)]))),128))])])):le("",!0),e.member.summary?(b(),I("div",yue,[_[5]||(_[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",kue,B(e.member.summary),1)])):le("",!0)],512)]))}}),_ue=ut(xue,[["__scopeId","data-v-715bd93e"]]),wue={class:"diff-lines"},Sue={key:0,class:"hunk-text"},Cue={class:"dl-gutter old"},Aue={class:"dl-gutter new"},Mue={class:"dl-sign"},Eue={class:"dl-text"},Tue=qe({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(b(),I("div",wue,[(b(!0),I(Be,null,nt(e.lines,(r,l)=>(b(),I("div",{key:l,class:De(["dl",s(r)])},[r.type==="hunk"?(b(),I("span",Sue,B(r.text),1)):(b(),I(Be,{key:1},[w("span",Cue,B(t(r)),1),w("span",Aue,B(n(r)),1),w("span",Mue,B(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",Eue,B(r.text),1)],64))],2))),128))]))}}),G5=ut(Tue,[["__scopeId","data-v-2f6bc1cc"]]),Nue={class:"tdp"},Iue={class:"tdp-body"},$ue={key:1,class:"tdp-output"},Lue={key:2,class:"tdp-empty"},Fue=qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Et();return(o,i)=>(b(),I("div",Nue,[ie(ca,{title:e.target.title,subtitle:e.target.path,"close-label":C(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),w("div",Iue,[e.target.lines&&e.target.lines.length>0?(b(),ye(G5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(b(),I("div",$ue,[(b(!0),I(Be,null,nt(e.target.output,(r,l)=>(b(),I("div",{key:l},B(r),1))),128))])):(b(),I("div",Lue,B(C(s)("diff.noDiff")),1))])]))}}),Oue=ut(Fue,[["__scopeId","data-v-76f2fbca"]]),Rue={class:"sc"},Bue={key:0,class:"sc-empty"},Due={key:2,class:"sc-loading","aria-hidden":"true"},Pue={class:"sc-composer"},Hue=["placeholder"],Wue=["disabled"],zue=qe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et(),i=P(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=P(()=>n.title?.trim()||o("sideChat.title")),l=P(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=Q(""),c=Q(null),u=Q(null);function d(){const k=a.value.trim();k&&(s("send",k),a.value="",pt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const p=P(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((A,L)=>A+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Ke(p,async()=>{!n.running&&!n.sending||(await pt(),f())});const h=P(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function _(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(b(),I("div",Rue,[ie(ca,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(b(),I("div",Bue,B(C(o)("sideChat.empty")),1)):(b(),ye(U5,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),h.value?(b(),I("div",Due,[ie(z5)])):le("",!0)],512),w("div",Pue,[Tn(w("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,Hue),[[ao,a.value]]),ie(jt,{text:C(o)("sideChat.send")},{default:Ee(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(Ve,{name:"arrow-right",size:"sm"})],8,Wue)]),_:1},8,["text"])])]))}}),Uue=ut(zue,[["__scopeId","data-v-9ee5df02"]]),jue={class:"changes-pane"},que={class:"dv-path"},Vue={class:"diff-head"},Kue={class:"back-label"},Gue={key:0,class:"empty-state"},Yue={key:1,class:"dv-lines-wrap"},Zue={key:2,class:"empty-state"},Que={class:"dv-change-count"},Xue={class:"ch-head"},Jue={class:"br-label"},ede={class:"br-name"},tde={key:0,class:"sync-info"},nde={key:0,class:"ahead"},sde={key:0,class:"behind"},ode={key:1,class:"empty-head"},ide={key:0,class:"ch-list"},rde=["onClick"],lde={class:"fpath"},ade={key:1,class:"ch-list ch-tree"},cde={class:"tree-list"},ude=["onClick"],dde={class:"tree-name"},fde=["onClick"],hde={class:"tree-name"},pde={key:2,class:"empty-state"},mde={key:3,class:"empty-state"},gde=qe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=P(()=>s.gitInfo!==null),u=P(()=>s.changes.length>0),d=P(()=>(s.selectedDiffPath??null)!==null),f=P(()=>s.mode==="detail"||s.mode==="full"&&d.value),p=P(()=>s.fileDiff??[]),h=P(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function _(){o("back")}function k(){o("close")}const g=Q("list");function v(F){g.value=F}function y(F){const S={children:[]},T=[...F].sort((R,O)=>R.path.localeCompare(O.path));for(const R of T){const O=R.path.split("/");let D=S;for(let W=0;W<O.length;W++){const z=O[W],V=W===O.length-1,U=O.slice(0,W+1).join("/");let re=D.children.find(ae=>ae.name===z&&ae.kind===(V?"file":"folder"));re||(re={name:z,path:U,kind:V?"file":"folder",status:V?R.status:void 0,children:[]},D.children.push(re)),D=re}}return S.children}const A=P(()=>y(s.changes)),L=Q(new Set);function $(F){return!L.value.has(F)}const x=P(()=>{const F=[];function S(T,R){for(const O of T)F.push({node:O,depth:R}),O.kind==="folder"&&$(O.path)&&S(O.children,R+1)}return S(A.value,0),F});function E(F){const S=new Set(L.value);S.has(F.path)?S.delete(F.path):S.add(F.path),L.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(b(),I("div",jue,[f.value?(b(),I(Be,{key:0},[ie(ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[ie(jt,{text:e.selectedDiffPath??""},{default:Ee(()=>[w("span",que,B(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",Vue,[e.hideBack?le("",!0):(b(),ye(Ft,{key:0,variant:"ghost",size:"sm",onClick:_},{default:Ee(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",Kue,B(C(n)("diff.back")),1)]),_:1}))]),h.value?(b(),I("div",Gue,B(C(n)("diff.loading")),1)):p.value.length>0?(b(),I("div",Yue,[ie(G5,{lines:p.value},null,8,["lines"])])):(b(),I("div",Zue,B(C(n)("diff.noDiff")),1))],64)):(b(),I(Be,{key:1},[ie(ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[w("span",Que,B(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(to,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),w("div",Xue,[c.value?(b(),I(Be,{key:0},[w("span",Jue,B(C(n)("diff.branch")),1),w("span",ede,B(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(b(),I("span",tde,[ie(jt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(b(),I("span",nde,"↑"+B(e.gitInfo.ahead),1)):le("",!0)]),_:1},8,["text"]),ie(jt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(b(),I("span",sde,"↓"+B(e.gitInfo.behind),1)):le("",!0)]),_:1},8,["text"])])):le("",!0)],64)):(b(),I("span",ode,B(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(b(),I("div",ide,[(b(!0),I(Be,null,nt(e.changes,T=>(b(),ye(jt,{key:T.path,text:T.path},{default:Ee(()=>[w("button",{type:"button",class:"ch-row",onClick:R=>m(T.path)},[w("span",{class:De(["badge",i(T.status)])},B(l(T.status)),3),w("span",lde,B(a(T.path)),1)],8,rde)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(b(),I("div",ade,[w("ul",cde,[(b(!0),I(Be,null,nt(x.value,({node:T,depth:R})=>(b(),I("li",{key:T.path,class:"tree-node"},[T.kind==="folder"?(b(),I("button",{key:0,type:"button",class:"tree-row tree-folder",style:qt({paddingLeft:N(R)}),onClick:O=>E(T)},[ie(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",dde,B(T.name),1)],12,ude)):(b(),ye(jt,{key:1,text:T.path},{default:Ee(()=>[w("button",{type:"button",class:"tree-row tree-file",style:qt({paddingLeft:N(R)}),onClick:O=>m(T.path)},[w("span",{class:De(["badge",i(T.status)])},B(l(T.status)),3),w("span",hde,B(T.name),1)],12,fde)]),_:2},1032,["text"]))]))),128))])])):c.value?(b(),I("div",pde,B(C(n)("diff.clean")),1)):(b(),I("div",mde,B(C(n)("diff.empty")),1))],64))]))}}),vde=ut(gde,[["__scopeId","data-v-7778610a"]]);function ik(e,t){let n=null;ln(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,pt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),es(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const yde=["type","value","placeholder","disabled","readonly"],kde=qe({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const s=n,o=Q();function i(a){s("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,c)=>(b(),I("input",{ref_key:"el",ref:o,class:De(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,yde))}}),sa=ut(kde,[["__scopeId","data-v-340f0da2"]]),bde={class:"search-wrap"},xde={key:0,class:"tab-strip"},_de={key:1,class:"state-row"},wde={key:2,class:"state-row unavail"},Sde={key:3,class:"model-list"},Cde=["aria-selected","onClick","onMouseenter"],Ade={class:"check"},Mde={class:"model-main"},Ede={class:"model-name"},Tde={class:"model-id"},Nde={key:0,class:"caps"},Ide={class:"model-provider"},$de={class:"model-ctx"},Lde={key:0,class:"empty"},Fde={class:"footer-hint"},Ode=qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=Q(""),a=Q(null),c=Q(null),u=Q("all");ik(c,a);const d=P(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const A of s.models)v.has(A.provider)||(v.add(A.provider),y.push({id:A.provider,label:A.provider}));return y}),f=P(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const L=(A.displayName??A.model).toLowerCase().includes(v),$=A.provider.toLowerCase().includes(v),x=A.id.toLowerCase().includes(v);return!v||L||$||x});return u.value!=="all"?y:y.sort((A,L)=>{const $=r(A.id)?1:0;return(r(L.id)?1:0)-$})}),p=P(()=>f.value),h=Q(0);Ke([l,u],()=>{h.value=0}),Ke(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ke(p,v=>{h.value=Math.min(h.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),h.value=Math.min(h.value+1,p.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),h.value=Math.max(h.value-1,0);else if(v.key==="Enter"){const y=p.value[h.value];y&&o("select",y.id)}}ln(()=>{document.addEventListener("keydown",m)}),fn(()=>{document.removeEventListener("keydown",m)});function _(v){o("select",v)}function k(v){return p.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=A=>o("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",bde,[ie(sa,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(b(),I("div",xde,[(b(!0),I(Be,null,nt(d.value,A=>(b(),ye(Ft,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(A.id)},{default:Ee(()=>[Ge(B(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):le("",!0),e.loading?(b(),I("div",_de,[ie(wo,{size:"sm"}),w("span",null,B(C(n)("model.loading")),1)])):e.unavailable?(b(),I("div",wde,[ie(Ve,{name:"alert-triangle",size:"lg"}),w("span",null,B(C(n)("model.unavailable")),1)])):(b(),I("div",Sde,[(b(!0),I(Be,null,nt(p.value,A=>(b(),I("div",{key:A.id,class:De(["model-row",{"is-current":A.id===e.current,"is-selected":k(A)===h.value}]),role:"option","aria-selected":A.id===e.current,onClick:L=>_(A.id),onMouseenter:L=>h.value=k(A)},[w("span",Ade,[A.id===e.current?(b(),ye(Ve,{key:0,name:"check",size:"sm"})):le("",!0)]),w("span",Mde,[w("span",Ede,B(A.displayName??A.model),1),w("span",Tde,B(A.id),1),A.capabilities&&A.capabilities.length>0?(b(),I("span",Nde,[(b(!0),I(Be,null,nt(A.capabilities,L=>(b(),ye(Ro,{key:L,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(L),1)]),_:2},1024))),128))])):le("",!0)]),w("span",Ide,B(A.provider),1),w("span",$de,B(C(n)("model.contextSuffix",{size:Math.round(A.maxContextSize/1e3)})),1),ie(Nn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt(L=>o("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(b(),ye(Ve,{key:0,name:"star",size:"md"})):(b(),ye(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Cde))),128)),p.value.length===0&&!e.loading&&!e.unavailable?(b(),I("div",Lde,B(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):le("",!0)])),w("div",Fde,B(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Rde=ut(Ode,[["__scopeId","data-v-e93073d7"]]),Bde={key:0,class:"ui-field__label"},Dde={key:1,class:"ui-field__error"},Pde={key:2,class:"ui-field__hint"},Hde=qe({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(b(),I("label",Bde,B(e.label),1)):le("",!0),In(t.$slots,"default",{},void 0,!0),e.error?(b(),I("span",Dde,B(e.error),1)):e.hint?(b(),I("span",Pde,B(e.hint),1)):le("",!0)],2))}}),xu=ut(Hde,[["__scopeId","data-v-49bce958"]]),Wde=["value","disabled"],zde=qe({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(b(),I("select",{class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[In(o.$slots,"default",{},void 0,!0)],42,Wde))}}),gv=ut(zde,[["__scopeId","data-v-92a040fd"]]),Ude={class:"prov-list"},jde={key:0,class:"state-row"},qde={key:1,class:"state-row unavail"},Vde={key:2,class:"empty"},Kde={class:"prov-info"},Gde={class:"prov-type"},Yde={key:0,class:"prov-url"},Zde={class:"prov-meta"},Qde={key:0},Xde={class:"prov-actions"},Jde={key:0,class:"add-section"},efe={key:0,class:"add-btns"},tfe={key:1,class:"add-form"},nfe=["value"],sfe={key:0,class:"add-error"},ofe={class:"form-btns"},ife={class:"footer-hint"},rfe=qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=Q(null);ik(o);const i=t;async function r(k){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",k)}const l=Q(!1),a=Ss({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Q(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function p(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function h(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}ln(()=>document.addEventListener("keydown",h)),fn(()=>document.removeEventListener("keydown",h));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function _(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",Ude,[e.loading?(b(),I("div",jde,[ie(wo,{size:"sm"}),w("span",null,B(C(n)("providers.loading")),1)])):e.unavailable?(b(),I("div",qde,[ie(Ve,{name:"alert-triangle",size:"md"}),w("span",null,B(C(n)("providers.unavailable")),1)])):e.providers.length===0?(b(),I("div",Vde,B(C(n)("providers.empty")),1)):(b(!0),I(Be,{key:3},nt(e.providers,v=>(b(),I("div",{key:v.id,class:"prov-row"},[ie(jt,{text:_(v.status)},{default:Ee(()=>[w("span",{class:De(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:qt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",Kde,[w("span",Gde,B(v.type),1),v.baseUrl?(b(),I("span",Yde,B(v.baseUrl),1)):le("",!0),w("span",Zde,[ie(Ro,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Ge(B(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(b(),I("span",Qde," · "+B(C(n)("providers.modelCount",{count:v.models.length})),1)):le("",!0)])]),w("div",Xde,[ie(jt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:Ee(()=>[ie(Ft,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:Ee(()=>[Ge(B(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(jt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:Ee(()=>[ie(Ft,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:Ee(()=>[Ge(B(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?le("",!0):(b(),I("div",Jde,[l.value?(b(),I("div",tfe,[ie(xu,{label:C(n)("providers.fieldType")},{default:Ee(()=>[ie(gv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:Ee(()=>[(b(),I(Be,null,nt(u,v=>w("option",{key:v,value:v},B(v),9,nfe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[ie(sa,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[ie(sa,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(xu,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[ie(sa,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(b(),I("div",sfe,B(c.value),1)):le("",!0),w("div",ofe,[ie(Ft,{variant:"primary",size:"sm",onClick:p},{default:Ee(()=>[Ge(B(C(n)("providers.add")),1)]),_:1}),ie(Ft,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ge(B(C(n)("common.cancel")),1)]),_:1})])])):(b(),I("div",efe,[ie(Ft,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Ge(" "+B(C(n)("providers.loginKimi")),1)]),_:1}),ie(Ft,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:Ee(()=>[ie(Ve,{name:"user",size:"sm"}),Ge(" "+B(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Ft,{variant:"primary",size:"sm",onClick:d},{default:Ee(()=>[ie(Ve,{name:"plus",size:"sm"}),Ge(" "+B(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",ife,B(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),lfe=ut(rfe,[["__scopeId","data-v-fb6f1365"]]),afe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},cfe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},ufe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},P0=qe({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(b(),I("svg",afe,[...n[0]||(n[0]=[w("circle",{cx:"18",cy:"18",r:"15"},null,-1),w("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(b(),I("svg",cfe,[...n[1]||(n[1]=[w("circle",{cx:"14",cy:"14",r:"12"},null,-1),w("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),w("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(b(),I("svg",ufe,[...n[2]||(n[2]=[w("path",{d:"M14 3 L26 24 H2 Z"},null,-1),w("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),w("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),dfe={key:0,class:"center-body"},ffe={class:"center-text"},hfe={key:1,class:"nb"},pfe={class:"nb-lead"},mfe=["href"],gfe={class:"nb-or"},vfe={class:"nb-fallback"},yfe={class:"nb-fb-text"},kfe=["href"],bfe={class:"nb-code-row"},xfe={class:"nb-code"},_fe={class:"nb-status"},wfe={class:"nb-status-text"},Sfe={class:"nb-countdown"},Cfe={key:2,class:"center-body"},Afe={class:"center-text success-text"},Mfe={class:"center-hint"},Efe={class:"center-body"},Tfe={class:"center-text err-text"},Nfe={class:"center-hint"},Ife={class:"actions"},$fe={class:"center-body"},Lfe={class:"center-text warn-text"},Ffe={class:"center-hint"},Ofe={class:"actions"},Rfe=qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Et(),s=Q(!0),o=t,i=e,r=Q("starting"),l=Q(null),a=Q(0),c=Q(!1);let u=null,d=null;ln(async()=>{await f()}),fn(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",p(),h(y.interval)}function p(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(y){u&&clearTimeout(u),u=setTimeout(async()=>{const A=await i.onPollOAuthLogin();A?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):A?.status==="expired"||A?.status==="cancelled"?(m(),r.value="expired"):h(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function k(){!l.value||!await js(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(y){const A=Math.floor(y/60),L=y%60;return`${A}:${String(L).padStart(2,"0")}`}return(y,A)=>(b(),ye(Sr,{open:s.value,"onUpdate:open":A[0]||(A[0]=L=>s.value=L),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:Ee(()=>[r.value==="starting"?(b(),I("div",dfe,[ie(wo,{size:"md"}),w("span",ffe,B(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(b(),I("div",hfe,[w("div",pfe,B(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Ge(B(C(n)("login.authorizeInBrowser"))+" ",1),ie(Ve,{name:"external-link",size:"sm"})],8,mfe),w("div",gfe,B(C(n)("login.orDivider")),1),w("div",vfe,[w("div",yfe,[Ge(B(C(n)("login.fallbackPrefix")),1),w("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},B(l.value.verificationUri),9,kfe),Ge(B(C(n)("login.fallbackSuffix")),1)]),w("div",bfe,[w("span",xfe,B(l.value.userCode),1),ie(Ft,{class:De(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:Ee(()=>[c.value?(b(),I(Be,{key:0},[ie(Ve,{name:"check",size:"sm"}),Ge(" "+B(C(n)("login.copied")),1)],64)):(b(),I(Be,{key:1},[ie(Ve,{name:"copy",size:"sm"}),Ge(" "+B(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",_fe,[ie(wo,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",wfe,B(C(n)("login.waitingAutoClose")),1),w("span",Sfe,B(v(a.value)),1)])])):r.value==="success"?(b(),I("div",Cfe,[ie(P0,{kind:"success"}),w("span",Afe,B(C(n)("login.success")),1),w("span",Mfe,B(C(n)("login.successHint")),1)])):r.value==="expired"?(b(),I(Be,{key:3},[w("div",Efe,[ie(P0,{kind:"expired"}),w("span",Tfe,B(C(n)("login.expiredTitle")),1),w("span",Nfe,B(C(n)("login.expiredHint")),1)]),w("div",Ife,[ie(Ft,{variant:"primary",onClick:_},{default:Ee(()=>[Ge(B(C(n)("login.retry")),1)]),_:1}),ie(Ft,{variant:"secondary",onClick:g},{default:Ee(()=>[Ge(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(b(),I(Be,{key:4},[w("div",$fe,[ie(P0,{kind:"error"}),w("span",Lfe,B(C(n)("login.errorTitle")),1),w("span",Ffe,B(C(n)("login.errorHint")),1)]),w("div",Ofe,[ie(Ft,{variant:"primary",onClick:_},{default:Ee(()=>[Ge(B(C(n)("login.retry")),1)]),_:1}),ie(Ft,{variant:"secondary",onClick:g},{default:Ee(()=>[Ge(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):le("",!0)]),_:1},8,["open","title"]))}}),Bfe=ut(Rfe,[["__scopeId","data-v-b228800e"]]);function Dfe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Pfe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Hfe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),a=new Map;for(const p of t)l.has(p.root)||a.has(p.root)||a.set(p.root,{...p});for(const p of n){const h=p.cwd;h&&(l.has(h)||a.has(h)||a.set(h,{id:p.workspaceId??h,root:h,name:Dfe(h),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const p of n){const h=Pfe(t,p);c.set(h,(c.get(h)??0)+1)}const u=[...new Set(t.filter(p=>!l.has(p.root)).map(p=>p.root))],d=[...a.keys()].filter(p=>!u.includes(p));d.sort((p,h)=>p.localeCompare(h));const f=[];for(const p of[...u,...d]){const h=a.get(p),m=c.get(h.id)??c.get(h.root)??0,_=r[h.id]===!1?m:Math.max(h.sessionCount,m);let k=h.branch;!k&&i&&o===h.root&&(k=i),f.push({...h,sessionCount:_,branch:k})}return f}function Wfe(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const s=e.filter(o=>{const i=Date.parse(o.createdAt);return!Number.isNaN(i)&&i<n});return s.length>0?[...s,...t]:t}function zfe(e){const t=new Map,n=new Set;function s(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&s(i)});return t.set(i,l),l}function o(i){if(t.has(i)){n.add(i);return}s(i)}return{run:s,request:o}}const Ufe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function jfe(e){return Ufe.has(e.type)}function qfe(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Vfe(e,t,n=qfe){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}const Y5=["blue","mono"],Z5=["light","dark","system"],Q5=14,Kfe=12,Gfe=20;function Yfe(){const e=Qn($t.accent);return e&&Y5.includes(e)?e:"blue"}function Zfe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Qfe(){const e=Qn($t.colorScheme);return e&&Z5.includes(e)?e:"system"}function Xfe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function rk(e){return Number.isFinite(e)?Math.min(Gfe,Math.max(Kfe,Math.round(e))):Q5}function Jfe(){const e=Qn($t.uiFontSize);return e===null?Q5:rk(Number(e))}function ehe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${rk(e)}px`)}const lk=Q(Qfe()),ak=Q(Yfe()),ck=Q(Jfe());Ke(lk,Xfe,{immediate:!0});Ke(ak,Zfe,{immediate:!0});Ke(ck,ehe,{immediate:!0});function the(e){Z5.includes(e)&&(lk.value=e,ts($t.colorScheme,e))}function nhe(e){Y5.includes(e)&&(ak.value=e,ts($t.accent,e))}function she(e){const t=rk(e);ck.value=t,ts($t.uiFontSize,String(t))}const ohe=600,ihe=250,lm=250,rhe=1e3,lhe=160,ip=Q(!1);let ql=[],Yl=null,rp=-lm;function ahe(){ql=[],rp=-lm,ip.value=!1,Yl!==null&&(clearTimeout(Yl),Yl=null)}function che(){ip.value=!0,Yl!==null&&clearTimeout(Yl),Yl=setTimeout(()=>{Yl=null,ql=[],rp=-lm,ip.value=!1},rhe)}function uhe(e){if(e<=0)return;const t=Date.now();ql.push({time:t,chars:e});const n=t-ohe;if(ql=ql.filter(l=>l.time>=n),t-rp<lm)return;rp=t;const s=ql[0]?.time??t,o=Math.max(t-s,ihe);ql.reduce((l,a)=>l+a.chars,0)/o*1e3>=lhe&&che()}function X5(){return{colorScheme:lk,accent:ak,uiFontSize:ck,fastMoon:ip,setColorScheme:the,setAccent:nhe,setUiFontSize:she,resetFastMoon:ahe,recordMoonDelta:uhe}}function dhe(e,t,n){return e==="idle"&&!t&&!n}function uk(e,t){const n=Qn(e);return n===null?t:n==="1"}const dk=Q(uk($t.notifyOnComplete,!0)),fk=Q(uk($t.notifyOnQuestion,!1)),hk=Q(uk($t.notifyOnApproval,!1)),pk=Q(typeof Notification<"u"?Notification.permission:"denied"),fhe="/favicon.ico";async function mk(e,t,n){if(!n){e.value=!1,ts(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}pk.value=s,s==="granted"&&(e.value=!0,ts(t,"1"))}function hhe(e){return mk(dk,$t.notifyOnComplete,e)}function phe(e){return mk(fk,$t.notifyOnQuestion,e)}function mhe(e){return mk(hk,$t.notifyOnApproval,e)}function gk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function ghe(e){return{title:yn.global.t("settings.notifyTitle"),body:gk(e,yn.global.t("settings.notifyFallback"))}}function vhe(e,t){return{title:yn.global.t("settings.notifyQuestionTitle"),body:gk(t,e,yn.global.t("settings.notifyQuestionFallback"))}}function yhe(e,t){return{title:yn.global.t("settings.notifyApprovalTitle"),body:gk(t,e,yn.global.t("settings.notifyApprovalFallback"))}}function vk(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{pk.value=i,i==="granted"&&fC(t,n,s)});return}fC(t,n,s)}}function fC(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:fhe});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function khe(e,t){vk(dk.value,t,ghe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function bhe(e){vk(fk.value,e,vhe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function xhe(e){vk(hk.value,e,yhe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function _he(){return{notifyOnComplete:dk,notifyOnQuestion:fk,notifyOnApproval:hk,notifyPermission:pk,setNotifyOnComplete:hhe,setNotifyOnQuestion:phe,setNotifyOnApproval:mhe,maybeNotifyCompletion:khe,maybeNotifyQuestion:bhe,maybeNotifyApproval:xhe}}function whe(){return Qn($t.soundOnComplete)==="1"}const Bc=Q(whe());function She(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let H0=null;function J5(){const e=She();if(!e)return null;if(H0===null)try{H0=new e}catch{return null}return H0}function eM(){if(!Bc.value)return;const e=J5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{ar("sound: audio context resumed",{state:e.state})},t=>{ar("sound: audio context resume rejected",{error:String(t)})})}let hC=!1;function Che(){if(hC||typeof window>"u")return;hC=!0;const e=()=>{eM()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Che();function Ahe(e){Bc.value=e,ts($t.soundOnComplete,e?"1":"0"),e&&eM()}function pC(e,t,n,s,o){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(o,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+s),i.start(l),i.stop(l+s+.02)}function yk(){const e=J5();if(e===null){ar("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){ar("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{ar("sound: context resumed for next time",{state:e.state})},t=>{ar("sound: resume rejected",{error:String(t)})});return}try{pC(e,880,0,.16,.18),pC(e,1320,.1,.22,.16),ar("sound: chime scheduled",{state:e.state})}catch(t){ar("sound: failed to play",{error:String(t)})}}function Mhe(){Bc.value&&yk()}function Ehe(){Bc.value&&yk()}function The(){Bc.value&&yk()}function Nhe(){return{soundOnComplete:Bc,setSoundOnComplete:Ahe,maybePlayCompletionSound:Mhe,maybePlayQuestionSound:Ehe,maybePlayApprovalSound:The}}function mC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const Ihe=1e3,$he=4096,gC=32*1024;function Lhe(e,t){let n=null,s;const o=new Set;async function i(f){try{const h=await ft().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:mC(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,p){if(e.activeSessionId!==f)return;const h=p??e.tasksBySession[f]??[],m=ft(),_=new Map;if(await Promise.all(h.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!o.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:gC});y.outputPreview!==void 0&&_.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),_.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=_.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const p=ft();let h;try{h=await p.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async v=>{const y=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!A)&&!(A&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await p.getTask(f,v.id,{withOutput:!0,outputBytes:y?$he:gC});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{A&&o.add(v.id)}}));const _=e.tasksBySession[f]??[],k=new Map(_.map(v=>[v.id,v])),g=h.map(v=>{const y=k.get(v.id),A=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:A?.preview??y?.outputPreview,outputBytes:A?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:mC(g,_)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Ihe))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=Q(0);let d=null;return Ke(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ke(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[f]??[];return{sid:f,hasRunning:p.some(h=>h.status==="running")}},({sid:f,hasRunning:p},h,m)=>{let _;p&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:P(()=>u.value),loadTasksForSession:i}}const tM=$t.starredModels;function Fhe(){try{const e=Qn(tM);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Ohe(e){try{ts(tM,JSON.stringify(e))}catch{}}function Rhe(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Q([]),d=Q(Fhe()),f=Q({}),p=Q({}),h=Q([]),m=Q(null);function _(V){if(!(V==null||V.length===0))return u.value.find(U=>U.id===V||U.model===V)}function k(){const V=e.activeSessionId?e.sessions.find(U=>U.id===e.activeSessionId):void 0;return _(V?.model??m.value??e.defaultModel)}function g(V){const U=aa(k(),V);return e.thinking=U,l(U),U}async function v(V){try{const re=await ft().listSkills(V);f.value={...f.value,[V]:re}}catch{}}async function y(V){try{const re=await ft().listSkillsForWorkspace(V);p.value={...p.value,[V]:re}}catch{}}async function A(){try{const V=ft();u.value=await V.listModels(),g(e.thinking)}catch(V){n("loadModels",V)}}async function L(){try{const V=await ft().refreshOAuthProviderModels();for(const U of V.failed)n("refreshOAuthProviderModels",new Error(U.reason),{message:U.provider})}catch{}}async function $(){try{const V=ft();h.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function x(V){const U=e.activeSessionId,re=aa(_(V),e.thinking),ae=e.thinking;if(!U)return m.value=V,g(re),!0;const te=e.sessions.find(Z=>Z.id===U)?.model;a(U,Z=>({...Z,model:V})),re!==ae&&(e.thinking=re,l(re));try{await ft().updateSession(U,{model:V,thinking:re!==ae?re:void 0})}catch(Z){return a(U,ne=>({...ne,model:te??ne.model})),re!==ae&&(e.thinking=ae,l(ae)),n("setModel",Z,{sessionId:U}),!1}return await s(U),!0}function E(V){const U=new Set(d.value);U.has(V)?U.delete(V):U.add(V),d.value=Array.from(U),Ohe(d.value)}async function N(V,U,re){const ae=re??e.activeSessionId;if(!ae)return;const te=i.value==="idle"&&!r.has(ae),Z=`msg_skill_opt_${Date.now().toString(36)}`;if(te){r.add(ae),e.sendingBySession={...e.sendingBySession,[ae]:!0};const ne={id:Z,sessionId:ae,role:"user",content:[{type:"text",text:`/${V}${U?` ${U}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:U}}};c(ae,ke=>[...ke,ne])}try{await ft().activateSkill(ae,V,U)}catch(ne){te&&(r.delete(ae),e.sendingBySession={...e.sendingBySession,[ae]:!1},c(ae,ke=>ke.filter(Se=>Se.id!==Z))),n("activateSkill",ne,{sessionId:ae})}}async function F(V){try{await ft().addProvider(V),await Promise.all([$(),A()])}catch(U){n("addProvider",U)}}async function S(V){try{await ft().deleteProvider(V),await Promise.all([$(),A()])}catch(U){n("deleteProvider",U)}}async function T(V){try{const U=await ft().refreshProvider(V);for(const re of U.failed)n("refreshProvider",new Error(re.reason),{message:re.provider});await Promise.all([$(),A()])}catch(U){n("refreshProvider",U)}}async function R(){try{const V=await ft().refreshAllProviders();for(const U of V.failed)n("refreshAllProviders",new Error(U.reason),{message:U.provider});await Promise.all([$(),A()])}catch(V){n("refreshAllProviders",V)}}async function O(){try{return await ft().startOAuthLogin()}catch{return null}}async function D(){try{return await ft().pollOAuthLogin()}catch{return null}}async function W(){try{await ft().cancelOAuthLogin()}catch{}}function z(V){const U=g(V);o({thinking:U})}return{models:u,starredModelIds:d,providers:h,draftModel:m,skillsBySession:f,skillsByWorkspace:p,loadSkillsForSession:v,loadSkillsForWorkspace:y,loadModels:A,refreshOAuthProviderModels:L,loadProviders:$,setModel:x,toggleStarModel:E,activateSkill:N,addProvider:F,deleteProvider:S,refreshProvider:T,refreshAllProviders:R,startOAuthLogin:O,pollOAuthLogin:D,cancelOAuthLogin:W,setThinking:z}}const nM="kimiWeb.compaction",Bhe=/^read[_-]?media(?:file)?$/i,Dhe=/^data:([^;]+);base64,(.*)$/s,Phe=/^<(image|video|audio)\s+path="([^"]+)">$/,Hhe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Whe=/Mime type:\s*([^.\s]+)/i,zhe=/Size:\s*(\d+)\s*bytes/i,Uhe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function jhe(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function qhe(e){const t=Hhe.exec(e.trim());return t?{kind:t[1],path:jhe(t[2])}:null}const Vhe=/^f_[A-Za-z0-9]{10,}$/;function Khe(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return Vhe.test(s)?s:void 0}function Ghe(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function Yhe(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function Zhe(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Qhe(e,t){if(!Bhe.test(e))return;const n=Yhe(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const p=d.text,h=Phe.exec(p);h&&(o=h[1],s=h[2]);const m=Whe.exec(p);m?.[1]&&(i=m[1]);const _=zhe.exec(p);_?.[1]&&(r=Number(_[1]));const k=Uhe.exec(p);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Zhe(d);f&&(a=f)}if(a===null)return;const c=Dhe.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Ghe(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Xhe(e){if(e!=null){if(typeof e=="string")return e.split(`
299
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
300
+ `));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
301
+ `)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
302
+ `)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Jhe(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 epe(e,t){const n=e.split(`
303
+ `),s=t.split(`
304
+ `),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function tpe(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:epe(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 npe(e){const t=`<prompt>
305
+ `,n=`
306
+ </prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):spe(e)}function spe(e){const t=e.split(`
307
+ `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
308
+ `):e}function ope(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function ipe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
309
+ `);return npe(t)}function rpe(e,t){const n=e.metadata?.origin??{},s=ipe(e);return t==="cron_missed"?{text:s,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:s,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function lpe(e,t,n){const{text:s,cron:o}=rpe(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function ape(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 cpe(e){return e.metadata?.origin?.kind==="compaction_summary"}function upe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function dpe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function sM(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);let a=null;function c(f=!1){if(!a)return;const p=a;if(a=null,!f||!s)for(let h=0;h<p.tools.length;h++){const m=p.tools[h];if(m.status!=="running")continue;const _={...m,status:"ok"};p.tools[h]=_;const k=p.blocks.find(g=>g.kind==="tool"&&g.tool.id===_.id);k&&k.kind==="tool"&&(k.tool=_)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
310
+ `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
311
+ `):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(f,p){for(const h of p)if(h.type==="text"){if(h.text){f.textParts.push(h.text);const m=f.blocks.at(-1);m&&m.kind==="text"?m.text+=`
312
+ `+h.text:f.blocks.push({kind:"text",text:h.text})}}else if(h.type==="thinking"){if(h.thinking){f.thinkingParts.push(h.thinking);const m=f.blocks.at(-1);m&&m.kind==="thinking"?m.thinking+=`
313
+ `+h.thinking:f.blocks.push({kind:"thinking",thinking:h.thinking})}}else if(h.type==="toolUse"){const m=l.get(h.toolCallId),_={id:h.toolCallId,name:h.toolName,arg:typeof h.input=="string"?h.input:JSON.stringify(h.input),status:"running",output:h.outputLines,planPath:h.toolName==="ExitPlanMode"?o[h.toolCallId]?.path:void 0};f.tools.push(_),f.blocks.push({kind:"tool",tool:_}),m&&(f.approval=tpe(m),f.approvalId=m.approvalId)}else if(h.type==="toolResult"){const m=f.tools.findIndex(_=>_.id===h.toolCallId);if(m!==-1){const _=f.tools[m],k={..._,status:h.isError?"error":"ok",output:Xhe(h.output),media:h.isError?void 0:Qhe(_.name,h.output)};k.name==="ExitPlanMode"&&!k.planPath&&(k.planPath=dpe(k.output)),f.tools[m]=k;const g=f.blocks.find(v=>v.kind==="tool"&&v.tool.id===h.toolCallId);g&&g.kind==="tool"&&(g.tool=k)}}}function d(f){if(f.type==="image"||f.type==="video"){const p=f.type,h=f.source;if(h.kind==="url")return{url:h.url,kind:p};if(h.kind==="base64")return{url:`data:${h.mediaType};base64,${h.data}`,kind:p};if(h.kind==="file"&&n)return{url:n(h.fileId),kind:p,fileId:h.fileId}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image",fileId:f.fileId};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video",fileId:f.fileId}}}for(const f of e){if(f.role==="system")continue;if(cpe(f)){c();const k=f.metadata?.[nM];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(g=>g.type==="text").map(g=>g.text).join(`
314
+ `),compaction:{trigger:k?.trigger,tokensBefore:k?.tokensBefore,tokensAfter:k?.tokensAfter}});continue}if(f.role==="user"){const k=ope(f);if(c(),k!==void 0){i.push(lpe(f,r++,k));continue}if(!ape(f))continue;const g=f.metadata?.origin,v=g?.kind==="skill_activation"&&g?.trigger==="user-slash",y=g?.kind==="plugin_command"&&g?.trigger==="user-slash",A=[],L=[];for(const $ of f.content){if($.type==="text")if(v)A.push(g.skillArgs??"");else if(y)A.push(g.commandArgs??"");else{const E=qhe($.text);if(E&&(E.kind==="video"||E.kind==="image")&&n){const N=Khe(E.path);if(N){L.push({url:n(N),kind:E.kind,alt:N,fileId:N});continue}}A.push($.text)}const x=d($);x&&L.push({url:x.url,kind:x.kind,alt:$.type==="file"?$.name:void 0,fileId:x.fileId})}i.push({id:f.id,role:"user",no:r++,text:A.join(`
315
+ `),images:L.length>0?L:void 0,skillActivation:v?{name:g.skillName,args:g.skillArgs}:void 0,pluginCommand:y?{pluginId:g.pluginId,commandName:g.commandName,args:g.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){a&&u(a,f.content);continue}const p=f.promptId;upe(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:f.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const m=a;if(m===null)continue;const _=JSON.stringify(f.content);m.promptId!==void 0&&m.seenSigs.has(_)||(m.seenSigs.add(_),u(m,f.content))}return c(!0),i}function fpe(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=Q({}),l=P(()=>{const E=e.activeSessionId;if(!E)return null;const N=r.value[E];return N?{parentId:E,agentId:N.agentId}:null}),a=P(()=>l.value?.parentId??null),c=P(()=>l.value!==null),u=P(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=P(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(N=>N.id===E.agentId&&N.status==="running"):!1}),f=P(()=>{const E=l.value;if(!E)return[];const N=e.sideChatMessagesByAgent[E.agentId]??[];return sM(N,[],F=>ft().getFileUrl(F),d.value)});function p(E,N){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:N(e.sideChatMessagesByAgent[E]??[])}}function h(E,N){p(E,F=>[...F,N])}function m(E){p(E,N=>{const F=[...N].reverse().findIndex(T=>T.role==="user");if(F===-1)return N;const S=N.length-1-F;return N.filter((T,R)=>R!==S)})}function _(E,N){p(E,F=>{const S=[...F];for(let T=S.length-1;T>=0;T-=1){const R=S[T];if(R.role==="user")return S[T]={...R,promptId:R.promptId??N},S}return F})}function k(E,N,F){F&&p(E,S=>{const T=S.at(-1);if(T?.role==="assistant"){const R=T.content[0],O=R?.type==="text"?R.text:"";return[...S.slice(0,-1),{...T,content:[{type:"text",text:`${O}${F}`}]}]}return[...S,{id:s(),sessionId:N,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function g(E,N,F){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!F)return;const T=(e.sideChatMessagesByAgent[E]??[]).at(-1);(T?.role==="assistant"&&T.content[0]?.type==="text"?T.content[0].text:"").trim().length>0||k(E,N,F)}async function v(E){const N=e.activeSessionId;N&&await y(N,E)}async function y(E,N){if(!r.value[E]){let F;try{({agentId:F}=await ft().startBtw(E))}catch(S){n("openSideChat",S,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[F]:e.sideChatMessagesByAgent[F]??[]},r.value={...r.value,[E]:{agentId:F}},o(),i()?.markSideChannelAgent(F)}N&&N.trim()&&await A(E,N.trim())}async function A(E,N){const F=r.value[E],S=N.trim();if(!F||!S)return;const T=E,R=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!0};const O={id:s(),sessionId:T,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};h(R,O);try{const D=e.sessions.find(U=>U.id===T),W=(D?.model&&D.model.length>0?D.model:e.defaultModel)??void 0,z=W===void 0?void 0:t.models().find(U=>U.model===W||U.id===W||U.displayName===W),V=await ft().submitPrompt(T,{content:[{type:"text",text:S}],agentId:R,model:W,thinking:aa(z,e.thinking),permissionMode:e.permission,planMode:e.planModeBySession[T]??!1,swarmMode:e.swarmModeBySession[T]??!1});_(R,V.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[T]:[...e.sideChatUserMessageIdsBySession[T]??[],V.userMessageId]}}catch(D){n("sendSideChatPrompt",D,{sessionId:T}),m(R),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!1}}}function L(){const E=e.activeSessionId;if(!E)return;const{[E]:N,...F}=r.value;r.value=F}async function $(E){const N=l.value;N&&await A(N.parentId,E)}function x(E){if(!r.value[E])return;const{[E]:N,...F}=r.value;r.value=F}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:k,finishSideChatAgent:g,openSideChat:v,openSideChatOn:y,closeSideChat:L,sendSideChatPrompt:$,clearSideChatForSession:x}}function hpe(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 ppe(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
316
+ `)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&hpe(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const vv="/sessions/";function vC(e){const{pathname:t}=e;if(!t.startsWith(vv))return;const n=t.slice(vv.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function mpe(e){return e===void 0||e.length===0?"/":`${vv}${encodeURIComponent(e)}`}const gpe=50,yv=5,vpe=40402,ype=40410,kpe=40902;function W0(e){return ml(e)&&e.code===kpe}const bpe=40904;function xpe(e){return ml(e)&&e.code===bpe}const Hl=Ss({}),Rf=Ss({}),z0=Ss({}),Fi=Ss(new Set);function _pe(e,t){const{t:n}=yn.global,{confirm:s}=kl(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:p,appendSession:h,forgetSession:m,setActiveSessionId:_,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:A,hasLoadedMessages:L,refreshSessionStatus:$,persistSessionProfile:x,mergedWorkspaces:E,workspacesView:N,status:F,workspaceIdForSession:S,savePermissionToStorage:T,savePlanModeToStorage:R,saveSwarmModeToStorage:O,saveGoalModeToStorage:D,draftModes:W,saveUnread:z,saveActiveWorkspaceToStorage:V,saveHiddenWorkspacesToStorage:U,goalErrorMessage:re,resetFastMoon:ae,initialized:te,selectedDiffPath:Z,fileDiffLines:ne,fileDiffLoading:ke}=t;async function Se(ee){if(e.messagesLoadingMoreBySession[ee])return;const _e=e.messagesBySession[ee];if(!_e||_e.length===0)return;const Ae=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!1};try{const Pe=await ft().listMessages(ee,{beforeId:Ae,pageSize:gpe}),st=[...Pe.items].reverse();k(ee,at=>[...st,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ee]:Pe.hasMore}}catch(Pe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!0},l("loadOlderMessages",Pe,{sessionId:ee})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!1}}}function Ye(ee){o.loadTasksForSession(ee),ce(ee),$(ee),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,ee)||r.loadSkillsForSession(ee)}async function ve(ee){const _e=e.activeSessionId;if(_e){Z.value=ee,ne.value=[],ke.value=!0;try{const Pe=await ft().getFileDiff(_e,ee);if(Z.value!==ee)return;ne.value=ppe(Pe.diff)}catch(Ae){Z.value===ee&&(ne.value=[]),console.warn("[loadFileDiff] diff unavailable for",ee,Ae)}finally{Z.value===ee&&(ke.value=!1)}}}function Y(){Z.value=null,ne.value=[],ke.value=!1}async function ce(ee){try{const Ae=await ft().getGitStatus(ee);e.gitStatusBySession={...e.gitStatusBySession,[ee]:Ae}}catch{}}async function fe(){try{const _e=await ft().getAuth();e.authReady=_e.ready,e.defaultModel=_e.defaultModel,e.managedProviderStatus=_e.managedProvider?.status??null}catch{}}async function j(){try{const ee=ft();e.config=await ee.getConfig()}catch{}}async function se(ee){try{const Ae=await ft().setConfig(ee);return e.config=Ae,e.defaultModel=Ae.defaultModel??null,!0}catch(_e){return l("setConfig",_e),!1}}const ge=100,ue=30,pe=720*60*1e3;async function q(){const ee=ft(),_e=[];let Ae;for(;;){const Pe=await ee.listSessions({pageSize:ge,beforeId:Ae,excludeEmpty:!0});if(_e.push(...Pe.items),!Pe.hasMore||Pe.items.length===0)break;Ae=Pe.items[Pe.items.length-1].id}return _e}async function J(ee){const _e=ft(),Ae=[],Pe=Date.now(),st=Qt=>Pe-new Date(Qt.updatedAt).getTime();let at,Nt=!1,Zt=!0;for(;;){let Qt;try{Qt=await _e.listSessions({workspaceId:ee,pageSize:yv,beforeId:at,excludeEmpty:!0})}catch(Vt){if(Zt)throw Vt;break}if(Nt=Qt.hasMore,Qt.items.length===0)break;const As=Qt.items[Qt.items.length-1],Cr=st(As)>=pe;if(!Zt&&Cr){const Vt=Qt.items.findIndex($n=>st($n)>=pe),vn=Vt>=0?Vt+1:Qt.items.length;Ae.push(...Qt.items.slice(0,vn)),Nt=Qt.hasMore||vn<Qt.items.length;break}if(Ae.push(...Qt.items),Zt=!1,!Qt.hasMore||Cr)break;at=As.id}return{workspaceId:ee,page:{items:Ae,hasMore:Nt}}}async function he(){const ee=e.workspaces;if(ee.length===0){const Nt=await q().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Nt}const _e=await Promise.all(ee.map(Nt=>J(Nt.id).catch(()=>({workspaceId:Nt.id,page:{items:[],hasMore:!1}})))),Ae=[],Pe={},st={},at={};for(const{workspaceId:Nt,page:Zt}of _e)Ae.push(...Zt.items),Pe[Nt]=Zt.hasMore,st[Nt]=Zt.items.length>0?Zt.items[Zt.items.length-1].id:void 0,at[Nt]=Math.max(Zt.items.length,yv);return e.sessionsHasMoreByWorkspace=Pe,e.sessionsCursorByWorkspace=st,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Ae.sort((Nt,Zt)=>new Date(Zt.updatedAt).getTime()-new Date(Nt.updatedAt).getTime()),Ae}async function Te(ee){if(e.sessionsLoadingMoreByWorkspace[ee]||e.sessionsHasMoreByWorkspace[ee]===!1)return;const _e=e.sessionsCursorByWorkspace[ee];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!0};try{const Ae=await ft().listSessions({workspaceId:ee,pageSize:ue,beforeId:_e,excludeEmpty:!0}),Pe=new Set(e.sessions.map(at=>at.id)),st=Ae.items.filter(at=>!Pe.has(at.id));st.length>0&&d([...e.sessions,...st]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[ee]:Ae.items.length>0?Ae.items[Ae.items.length-1].id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[ee]:Ae.hasMore}}catch(Ae){l("loadMoreSessions",Ae)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!1}}}}async function Ie(){if(e.sessionsFullyLoaded)return;const ee=await q().catch(()=>null);if(ee===null)return;d(ee),e.sessionsFullyLoaded=!0;const _e={};for(const Ae of e.workspaces)_e[Ae.id]=!1;e.sessionsHasMoreByWorkspace=_e}async function Oe(){e.loading=!0;try{const ee=ft();await Promise.all([ee.getHealth().catch(()=>null),ee.getMeta().then(Nt=>{e.serverVersion=Nt.serverVersion,e.availableOpenInApps=Nt.openInApps,e.dangerousBypassAuth=Nt.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),await fe(),await j(),await de();const _e=await he();d(_e);const Ae=_e[0],Pe=e.activeWorkspaceId;!(Pe!==null&&E.value.some(Nt=>Nt.id===Pe))&&Ae&&Qe(S(Ae)),Xe();const at=typeof window<"u"?vC(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(Zt=>Zt.id===at)||await ds(at))&&await Ze(at,{urlMode:"replace"}),!e.activeSessionId&&_e.length>0&&await Ze(_e[0].id,{urlMode:"replace"})}catch(ee){l("load",ee)}finally{e.loading=!1,te.value=!0}}async function de(){try{const ee=ft(),[_e,Ae]=await Promise.all([ee.listWorkspaces().catch(()=>[]),ee.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=$e(_e),e.fsHome=Ae.home||null,e.recentRoots=Ae.recentRoots}catch{}}function $e(ee){const _e=gf();return Object.keys(_e).length===0?ee:ee.map(Ae=>{const Pe=_e[Ae.root];return Pe!==void 0?{...Ae,name:Pe}:Ae})}function Qe(ee){e.activeWorkspaceId=ee,V(ee)}function tt(ee){Qe(ee);const _e=e.sessions.filter(Ae=>S(Ae)===ee);if(_e.length>0){const Ae=_e[0];Ae&&Ae.id!==e.activeSessionId&&Ze(Ae.id)}else _(void 0),ot(void 0,"push")}function vt(ee){const _e=gf()[ee.root],Ae=_e!==void 0?{...ee,name:_e}:ee;e.hiddenWorkspaceRoots.includes(Ae.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Ae.root),U(e.hiddenWorkspaceRoots));const Pe=e.workspaces.findIndex(at=>at.id===Ae.id||at.root===Ae.root);if(Pe===-1){e.workspaces=[Ae,...e.workspaces];return}const st=[...e.workspaces];st[Pe]=Ae,e.workspaces=st}function wt(ee){if(ee.type==="workspaceCreated"||ee.type==="workspaceUpdated"){vt(ee.workspace);return}const _e=e.workspaces.find(Pe=>Pe.id===ee.workspaceId)?.root??ee.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],U(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Pe=>Pe.id!==ee.workspaceId&&Pe.root!==_e),e.activeWorkspaceId===ee.workspaceId||e.activeWorkspaceId===_e){const Pe=N.value[0]?.id??null;if(e.activeWorkspaceId=Pe,Pe)V(Pe);else try{Ac($t.activeWorkspace)}catch{}_(void 0),e.sessionLoading=!1,Y(),ot(void 0,"replace")}}function xt(){_(void 0),ot(void 0,"push")}function Rt(ee){Qe(ee),xt(),Y()}async function yt(ee){const _e=E.value.find(As=>As.id===ee);if(!_e)return null;const Ae=ft();let Pe,st=_e.root;try{const As=await Ae.addWorkspace({root:_e.root});Pe=As.id,st=As.root,vt(As)}catch{}const at=r.draftModel.value??void 0,Nt=await Ae.createSession({workspaceId:Pe,cwd:st,model:at});r.draftModel.value=null;const Zt=at!==void 0&&(!Nt.model||Nt.model.length===0)?{...Nt,model:at}:Nt;p(Zt),Qe(Nt.workspaceId??Pe??ee),await Ze(Nt.id);const Qt=Nt.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[Qt]:!0},R()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Qt]:!0},O()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Qt]:!0},D()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,Qt}async function nn(ee,_e,Ae){if(!Fi.has(ee)){Fi.add(ee);try{const Pe=await yt(ee);if(!Pe)return;await Dt(Pe,_e,Ae)}catch(Pe){l("startSessionAndSendPrompt",Pe)}finally{Fi.delete(ee)}}}async function xn(ee,_e,Ae){if(!Fi.has(ee)){Fi.add(ee);try{const Pe=await yt(ee);if(!Pe)return;const st=e.planModeBySession[Pe]??!1,at=e.swarmModeBySession[Pe]??!1,Nt=e.sessions.find(Qt=>Qt.id===Pe),Zt=(Nt?.model&&Nt.model.length>0?Nt.model:e.defaultModel)??void 0;await x({model:Zt,planMode:st,swarmMode:at,permissionMode:e.permission,thinking:Mt(Zt)},Pe),await r.activateSkill(_e,Ae,Pe)}catch(Pe){l("startSessionAndActivateSkill",Pe)}finally{Fi.delete(ee)}}}async function ns(ee,_e){if(!Fi.has(ee)){Fi.add(ee);try{const Ae=await yt(ee);if(!Ae)return;await i.openSideChatOn(Ae,_e)}catch(Ae){l("startSessionAndOpenSideChat",Ae)}finally{Fi.delete(ee)}}}async function Wt(ee){const _e=ee.trim();if(!_e)return!1;const Ae=ft();try{const Pe=await Ae.addWorkspace({root:_e});return vt(Pe),Rt(Pe.id),!0}catch{return!1}}async function _n(ee){try{return await ft().browseFs(ee)}catch{return{path:"",parent:null,entries:[]}}}async function gn(){try{return await ft().getFsHome()}catch{return{home:"",recentRoots:[]}}}function ot(ee,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const Ae=mpe(ee);if(window.location.pathname!==Ae)try{_e==="push"?window.history.pushState(null,"",Ae):window.history.replaceState(null,"",Ae)}catch{}}async function ds(ee){try{const _e=await ft().getSession(ee);return e.sessions.some(Ae=>Ae.id===_e.id)||h(_e),!0}catch{return!1}}function ys(){const ee=vC(window.location);if(ee===void 0){_(void 0);return}if(ee!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===ee)){Ze(ee,{urlMode:"none"});return}(async()=>{if(await ds(ee)){await Ze(ee,{urlMode:"none"});return}const _e=e.sessions[0];_e?await Ze(_e.id,{urlMode:"replace"}):(_(void 0),ot(void 0,"replace"))})()}}let fs=!1;function Xe(){fs||typeof window>"u"||(fs=!0,window.addEventListener("popstate",ys))}async function Ze(ee,_e){const Ae=L(ee),Pe=!Ae&&u.has(ee);u.delete(ee);try{ot(ee,_e?.urlMode??"push"),e.sessionLoading=!Ae&&!Pe,_(ee),ae(),e.unreadBySession[ee]&&(e.unreadBySession={...e.unreadBySession,[ee]:!1},z({[ee]:!1})),Y();const st=e.sessions.find(at=>at.id===ee);if(st){const at=S(st);e.activeWorkspaceId!==at&&Qe(at)}if(Ae){if(await A(ee)==="not-found")return}else if(await y(ee)==="not-found")return;Ye(ee)}catch(st){l("selectSession",st,{sessionId:ee})}finally{e.activeSessionId===ee&&(e.sessionLoading=!1)}}function Mt(ee){const _e=ee===void 0?void 0:r.models.value.find(Ae=>Ae.model===ee||Ae.id===ee||Ae.displayName===ee);return aa(_e,e.thinking)}async function Dt(ee,_e,Ae){c.add(ee),e.sendingBySession={...e.sendingBySession,[ee]:!0};const Pe=g();try{const st=ft(),at=[];_e&&at.push({type:"text",text:_e});for(const $n of Ae??[])$n.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:$n.fileId}}):at.push({type:"image",source:{kind:"file",fileId:$n.fileId}});if(at.length===0)return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},!1;const Nt={id:Pe,sessionId:ee,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(ee,$n=>[...$n,Nt]);const Zt=e.sessions.find($n=>$n.id===ee),Qt=(Zt?.model&&Zt.model.length>0?Zt.model:e.defaultModel)??void 0,As=e.planModeBySession[ee]??!1,Cr=e.swarmModeBySession[ee]??!1,Vt=e.goalModeBySession[ee]??!1;if(Vt&&_e)try{await st.updateSession(ee,{goalObjective:_e.trim()})}catch($n){return l("createGoal",$n,{sessionId:ee}),c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,ks=>ks.some(bs=>bs.id===Pe)?ks.filter(bs=>bs.id!==Pe):ks),!1}const vn=await st.submitPrompt(ee,{content:at,model:Qt,thinking:Mt(Qt),permissionMode:e.permission,planMode:As,swarmMode:Cr});return Vt&&(e.goalModeBySession={...e.goalModeBySession,[ee]:!1},D()),e.promptIdBySession={...e.promptIdBySession,[ee]:vn.promptId},k(ee,$n=>{const ks=$n.findIndex(Ms=>Ms.id===Pe);if(ks===-1)return $n;const bs=[...$n];return bs[ks]={...bs[ks],promptId:bs[ks].promptId??vn.promptId},bs}),v()?.bindNextPromptId(ee,vn.promptId),!0}catch(st){return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,at=>at.some(Nt=>Nt.id===Pe)?at.filter(Nt=>Nt.id!==Pe):at),l("sendPrompt",st,{sessionId:ee}),!1}}async function zt(ee,_e){const Ae=e.activeSessionId;if(Ae){if(a.value!=="idle"||c.has(Ae)){hs(ee,_e);return}await Dt(Ae,ee,_e)}}async function wn(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[],st=[],at=[];for(const Vt of Pe){const vn=Vt.text.trim();vn&&st.push(vn),Vt.attachments?.length&&at.push(...Vt.attachments)}const Nt=ee.trim();if(Nt&&st.push(Nt),_e?.length&&at.push(..._e),st.length===0&&at.length===0)return;Pe.length>0&&(e.queuedBySession={...e.queuedBySession,[Ae]:[]});const Zt=st.join(`
317
+
318
+ `);if(a.value==="idle"&&!c.has(Ae)){await Dt(Ae,Zt,at);return}const Qt=[];Zt&&Qt.push({type:"text",text:Zt});for(const Vt of at)Vt.kind==="video"?Qt.push({type:"video",source:{kind:"file",fileId:Vt.fileId}}):Qt.push({type:"image",source:{kind:"file",fileId:Vt.fileId}});const As=g(),Cr={id:As,sessionId:Ae,role:"user",content:Qt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Ae,Vt=>[...Vt,Cr]);try{const Vt=ft(),vn=e.sessions.find(bs=>bs.id===Ae),$n=(vn?.model&&vn.model.length>0?vn.model:e.defaultModel)??void 0,ks=await Vt.submitPrompt(Ae,{content:Qt,model:$n,thinking:Mt($n),permissionMode:e.permission,planMode:e.planModeBySession[Ae]??!1,swarmMode:e.swarmModeBySession[Ae]??!1});if(k(Ae,bs=>{const Ms=bs.findIndex(gm=>gm.id===As);if(Ms===-1)return bs;const va=[...bs];return va[Ms]={...va[Ms],promptId:va[Ms].promptId??ks.promptId},va}),ks.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ae]:ks.promptId},v()?.bindNextPromptId(Ae,ks.promptId);return}try{await Vt.steerPrompts(Ae,[ks.promptId])}catch{}}catch(Vt){k(Ae,vn=>vn.filter($n=>$n.id!==As)),l("steer",Vt,{sessionId:Ae})}}async function Rn(ee,_e){try{const Pe=await ft().uploadFile({file:ee,name:_e});return{fileId:Pe.id,name:Pe.name,mediaType:Pe.mediaType}}catch(Ae){return l("uploadImage",Ae),null}}function hs(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[];e.queuedBySession={...e.queuedBySession,[Ae]:[...Pe,{text:ee,attachments:_e}]}}async function ss(){const ee=e.activeSessionId;if(!ee)return;const _e=e.sessions.find(st=>st.id===ee);let Ae=e.promptIdBySession[ee];if(Ae===void 0){const st=_e?.currentPromptId;st?.startsWith("prompt_")&&(Ae=st)}const Pe=ft();if(Ae!==void 0)try{if((await Pe.abortPrompt(ee,Ae)).aborted)return;const at={...e.promptIdBySession};delete at[ee],e.promptIdBySession=at}catch(st){if(ml(st)&&st.code===vpe){const at={...e.promptIdBySession};delete at[ee],e.promptIdBySession=at}else{l("abortCurrentPrompt",st,{sessionId:ee});return}}try{await Pe.abortSession(ee)}catch(st){l("abortCurrentPrompt",st,{sessionId:ee})}}function sn(ee,_e){const Ae=e.approvalsBySession[ee]??[];e.approvalsBySession={...e.approvalsBySession,[ee]:Ae.filter(Pe=>Pe.approvalId!==_e)}}function Lt(ee,_e){const Ae=e.questionsBySession[ee]??[];e.questionsBySession={...e.questionsBySession,[ee]:Ae.filter(Pe=>Pe.questionId!==_e)}}async function Vs(ee,_e){const Ae=e.activeSessionId;if(Ae&&!Rf[ee]){Rf[ee]=!0;try{const Pe=ft(),st={decision:_e.decision,scope:_e.scope,feedback:_e.feedback,selectedLabel:_e.selectedLabel};await Pe.respondApproval(Ae,ee,st),sn(Ae,ee)}catch(Pe){W0(Pe)?sn(Ae,ee):l("respondApproval",Pe,{sessionId:Ae})}finally{delete Rf[ee]}}}async function an(ee,_e){const Ae=e.activeSessionId;if(Ae&&!Hl[ee]){Hl[ee]="answer";try{await ft().respondQuestion(Ae,ee,_e),Lt(Ae,ee)}catch(Pe){W0(Pe)?Lt(Ae,ee):l("respondQuestion",Pe,{sessionId:Ae})}finally{delete Hl[ee]}}}async function So(ee){const _e=e.activeSessionId;if(_e&&!Hl[ee]){Hl[ee]="dismiss";try{await ft().dismissQuestion(_e,ee),Lt(_e,ee)}catch(Ae){W0(Ae)?Lt(_e,ee):l("dismissQuestion",Ae,{sessionId:_e})}finally{delete Hl[ee]}}}async function Co(ee){const _e=e.activeSessionId;if(_e&&!z0[ee]){z0[ee]=!0;try{await ft().cancelTask(_e,ee);const Pe=e.tasksBySession[_e]??[];e.tasksBySession={...e.tasksBySession,[_e]:Pe.map(st=>st.id===ee?{...st,status:"cancelled"}:st)}}catch(Ae){xpe(Ae)||l("cancelTask",Ae,{sessionId:_e})}finally{delete z0[ee]}}}function Rs(ee){const _e=e.activeSessionId;_e?(e.planModeBySession={...e.planModeBySession,[_e]:ee},R(),x({planMode:ee})):W.planMode=ee}function fi(){const ee=e.activeSessionId,_e=ee?e.planModeBySession[ee]??!1:W.planMode;Rs(!_e)}function co(ee){const _e=e.activeSessionId;_e?(e.swarmModeBySession={...e.swarmModeBySession,[_e]:ee},O(),x({swarmMode:ee})):W.swarmMode=ee}async function jo(){const ee=e.activeSessionId,Ae=!(ee?e.swarmModeBySession[ee]??!1:W.swarmMode);Ae&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||co(Ae)}function Ot(ee){const _e=e.activeSessionId;_e?(e.goalModeBySession={...e.goalModeBySession,[_e]:ee},D()):W.goalMode=ee}function Bs(){const ee=e.activeSessionId,_e=ee?e.goalModeBySession[ee]??!1:W.goalMode;Ot(!_e)}async function qn(ee){const _e=ee.trim();if(!_e||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:_e}),variant:"primary"}))return;let Ae=e.activeSessionId;if(!Ae){const Pe=e.activeWorkspaceId,st=Pe&&N.value.some(at=>at.id===Pe)?Pe:N.value[0]?.id??null;if(!st)return;try{Ae=await yt(st)??void 0}catch(at){l("createGoal",at);return}if(!Ae)return}try{await ft().updateSession(Ae,{goalObjective:_e})}catch(Pe){l("createGoal",Pe,{sessionId:Ae,message:re(Pe)});return}e.goalModeBySession[Ae]&&(e.goalModeBySession={...e.goalModeBySession,[Ae]:!1},D()),e.activeSessionId===Ae?await zt(_e):await Dt(Ae,_e)}function Cs(ee){const _e=e.activeSessionId;_e&&Promise.resolve(ft().updateSession(_e,{goalControl:ee})).catch(Ae=>{l("controlGoal",Ae,{sessionId:_e,message:re(Ae)})})}function On(ee){e.permission=ee,T(ee),x({permissionMode:ee})}function Hn(ee){const _e=[...e.warnings];_e.splice(ee,1),e.warnings=_e}async function hi(ee,_e){try{await ft().updateSession(ee,{title:_e}),f(ee,Pe=>({...Pe,title:_e}))}catch(Ae){l("renameSession",Ae,{sessionId:ee})}}async function Xn(ee,_e){const Ae=e.workspaces.find(st=>st.id===ee)?.root,Pe=()=>{e.workspaces=e.workspaces.map(st=>st.id===ee?{...st,name:_e}:st)};try{if(await ft().updateWorkspace(ee,{name:_e}),Ae!==void 0){const st=gf();Ae in st&&(delete st[Ae],vx(st))}Pe()}catch(st){if(Ae!==void 0&&ml(st)&&st.code===ype){vx({...gf(),[Ae]:_e}),Pe();return}l("renameWorkspace",st)}}async function qo(ee){const _e=e.workspaces.find(at=>at.id===ee)?.root??E.value.find(at=>at.id===ee)?.root??ee,Ae=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Pe=e.activeWorkspaceId===ee||e.activeWorkspaceId===_e,st=!!(Ae&&(Ae.cwd===_e||Ae.workspaceId===ee||S(Ae)===ee));_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],U(e.hiddenWorkspaceRoots));try{await ft().deleteWorkspace(ee)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==ee&&at.root!==_e),Pe||st){const at=N.value[0]?.id??null;if(e.activeWorkspaceId=at,at)V(at);else try{Ac($t.activeWorkspace)}catch{}}(Pe||st)&&(_(void 0),e.sessionLoading=!1,Y(),ot(void 0,"replace"))}async function Ks(ee){try{await ft().archiveSession(ee),m(ee),i.clearSideChatForSession(ee);const{[ee]:Ae,...Pe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Pe,e.activeSessionId===ee){const st=e.sessions[0];st?await Ze(st.id,{urlMode:"replace"}):(_(void 0),ot(void 0,"replace"))}}catch(_e){l("archiveSession",_e,{sessionId:ee})}}async function Mi(ee){try{const _e=await ft().restoreSession(ee);return p(_e),!0}catch(_e){return l("restoreSession",_e,{sessionId:ee}),!1}}function Ao(ee){return ft().listSessions({archivedOnly:!0,beforeId:ee?.beforeId,pageSize:ee?.pageSize??50})}async function Vn(){try{await ft().logout(),await fe(),await Oe()}catch(ee){l("logout",ee)}}function Vo(ee){const _e=e.activeSessionId;_e&&ft().compactSession(_e,ee).catch(Ae=>{l("compact",Ae,{sessionId:_e})})}async function ji(ee){const _e=ee??e.activeSessionId;if(_e)try{const Ae=await ft().forkSession(_e);p(Ae),await Ze(Ae.id)}catch(Ae){l("fork",Ae,{sessionId:_e})}}async function Ko(ee=1){const _e=e.activeSessionId;if(!_e)return null;const Ae=(()=>{const Pe=e.messagesBySession[_e]??[];for(let st=Pe.length-1;st>=0;st--){const at=Pe[st];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Nt=>Nt.type==="text").map(Nt=>Nt.text).join(`
319
+ `)}return null})();try{return await ft().undoSession(_e,ee),await y(_e),Ae}catch(Pe){return l("undo",Pe,{sessionId:_e}),null}}function Bn(ee){const _e=e.activeSessionId;if(!_e)return;const Ae=e.queuedBySession[_e]??[];if(ee<0||ee>=Ae.length)return;const Pe=[...Ae];Pe.splice(ee,1),e.queuedBySession={...e.queuedBySession,[_e]:Pe}}function Kn(ee,_e){const Ae=e.activeSessionId;if(!Ae)return;const Pe=e.queuedBySession[Ae]??[];if(ee===_e||ee<0||ee>=Pe.length||_e<0||_e>=Pe.length)return;const st=[...Pe],[at]=st.splice(ee,1);at!==void 0&&(st.splice(_e,0,at),e.queuedBySession={...e.queuedBySession,[Ae]:st})}async function Mo(ee){const _e=e.activeSessionId;if(!_e)return[];try{return(await ft().listDirectory(_e,{path:ee,includeGitStatus:!0})).items}catch{return[]}}async function rt(ee){const _e=e.activeSessionId;if(!_e)return null;try{const Pe=await ft().readFile(_e,{path:ee});return{path:Pe.path,content:Pe.content,encoding:Pe.encoding,mime:Pe.mime,languageId:Pe.languageId,isBinary:Pe.isBinary,size:Pe.size,lineCount:Pe.lineCount}}catch{return null}}const xe=10485760;function Le(ee){const _e=e.activeSessionId;return _e?ft().getFileDownloadUrl(_e,ee):null}async function we(ee,_e){const Ae=e.activeSessionId;if(!Ae)return!1;try{return await ft().openFile(Ae,{path:ee,line:_e}),!0}catch(Pe){return l("openFile",Pe,{sessionId:Ae}),!1}}async function X(ee){const _e=e.activeSessionId;if(!_e)return;const Ae=F.value.cwd||".";try{await ft().openInApp(_e,ee,Ae)}catch(Pe){l("openInApp",Pe,{sessionId:_e})}}async function me(ee){const _e=e.activeSessionId;if(!_e)return!1;try{return await ft().revealFile(_e,{path:ee}),!0}catch(Ae){return l("revealFile",Ae,{sessionId:_e}),!1}}async function je(ee){if(/^(https?:|data:|blob:)/i.test(ee))return ee;const _e=e.activeSessionId;if(!_e)return ee;let Ae=ee;if(Ae.startsWith("/")){const Pe=e.sessions.find(st=>st.id===_e)?.cwd;if(Pe&&(Ae===Pe||Ae.startsWith(Pe.endsWith("/")?Pe:`${Pe}/`))){if(Ae=Ae.slice(Pe.length).replace(/^\//,""),!Ae)return ee}else return ee}try{const st=await ft().readFile(_e,{path:Ae,length:xe});return!st.isBinary||st.encoding!=="base64"||st.truncated?ee:`data:${st.mime};base64,${st.content}`}catch{return ee}}async function lt(ee){const _e=e.activeSessionId;if(!_e)return[];try{return(await ft().searchFiles(_e,{query:ee,limit:20})).items.map(st=>({path:st.path,name:st.name}))}catch{return[]}}return{loadFileDiff:ve,clearFileDiff:Y,loadGitStatus:ce,checkAuth:fe,loadConfig:j,updateConfig:se,listAllSessionsGlobal:q,load:Oe,loadWorkspaces:de,loadMoreSessions:Te,loadAllSessions:Ie,selectWorkspace:Qe,openWorkspace:tt,upsertWorkspacePreserveOrder:vt,applyWorkspaceEvent:wt,clearActiveSession:xt,openWorkspaceDraft:Rt,startSessionAndSendPrompt:nn,startSessionAndActivateSkill:xn,startSessionAndOpenSideChat:ns,addWorkspaceByPath:Wt,browseFs:_n,getFsHome:gn,writeSessionUrl:ot,fetchSessionIntoList:ds,onSessionRoutePopState:ys,bindSessionRoute:Xe,selectSession:Ze,submitPromptInternal:Dt,sendPrompt:zt,steerPrompt:wn,uploadImage:Rn,enqueue:hs,unqueue:Bn,reorderQueue:Kn,abortCurrentPrompt:ss,respondApproval:Vs,respondQuestion:an,dismissQuestion:So,pendingQuestionActions:Hl,pendingApprovalActions:Rf,cancelTask:Co,setPlanMode:Rs,togglePlanMode:fi,setSwarmMode:co,toggleSwarmMode:jo,setGoalMode:Ot,toggleGoalMode:Bs,createGoal:qn,controlGoal:Cs,setPermission:On,dismissWarning:Hn,renameSession:hi,renameWorkspace:Xn,deleteWorkspace:qo,archiveSession:Ks,restoreSession:Mi,loadArchivedSessions:Ao,logout:Vn,compact:Vo,forkSession:ji,undo:Ko,listDir:Mo,readFileContent:rt,getFileDownloadUrl:Le,openWorkspaceFile:we,openInApp:X,revealWorkspaceFile:me,resolveImageUrl:je,searchFiles:lt,loadOlderMessages:Se,refreshSessionSidecars:Ye,isStartingFirstPrompt:()=>Fi.size>0}}const wpe="kimiWeb.optimisticUserMessage";function Spe(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Cpe(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Ape(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function U0(e){return e.role==="user"&&e.metadata?.[wpe]===!0}function Mpe(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Epe(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const Tpe=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function yC(e){let t="",n=0;for(const s of e.content)s.type==="text"?Tpe.test(s.text.trim())?n+=1:t+=s.text:(s.type==="image"||s.type==="video"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Npe(e,t){const n=yC(e),s=yC(t);return n.text===s.text&&n.media===s.media}function Ipe(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&Epe(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(U0(o)&&Npe(o,t))return s}return-1}function $pe(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function Lpe(e,t,n){const s=Cpe(e);switch(Ape(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[nM]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!Mpe(t.message)){const a=Ipe(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=$pe(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?yn.global.t("warnings.errorLabel"):yn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function Fpe(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Ope(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||ha(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:Fpe(a.status)}]:[]})}}return[]}const Rpe=["queued","working","suspended","completed","failed"];function oM(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Bpe(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Dpe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:oM(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Bpe();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function Ppe(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Rpe)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function Hpe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const s=t.get(n.parentToolCallId)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:oM(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,s)}for(const[n,s]of t)t.set(n,s.toSorted((o,i)=>o.swarmIndex-i.swarmIndex||o.id.localeCompare(i.id)));return t}const Di=X5(),Pi=_he(),pd=Nhe(),iM=$t.permission,rM=$t.activeWorkspace,lM=$t.thinking,aM=$t.planMode,cM=$t.swarmMode,uM=$t.goalMode,kC=40401,dM=$t.onboarded,Wpe=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Ac($t.codeFont);Ac($t.theme);function zpe(){try{const e=Qn(iM);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Upe(e){try{ts(iM,e)}catch{}}function jpe(){try{const e=Qn(lM);if(e&&Wpe.test(e))return e}catch{}return"high"}function qpe(e){try{ts(lM,e)}catch{}}function j0(e){const t=Qn(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const s={};for(const[o,i]of Object.entries(n))i===!0&&(s[o]=!0);return s}catch{return{}}}function kk(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ts(e,JSON.stringify(n))}catch{}}function fM(){kk(aM,Ce.planModeBySession)}function hM(){kk(cM,Ce.swarmModeBySession)}function pM(){kk(uM,Ce.goalModeBySession)}function Vpe(){try{return Qn(rM)}catch{return null}}const mM=$t.hiddenWorkspaces;function Kpe(){try{const e=Qn(mM);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Gpe(e){try{ts(mM,JSON.stringify(e))}catch{}}function Ype(e){try{ts(rM,e)}catch{}}function Zpe(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ce=Ss({...Spe(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:zpe(),thinking:jpe(),planModeBySession:j0(aM),swarmModeBySession:j0(cM),goalModeBySession:j0(uM),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:Xv(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Vpe(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Kpe(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),am=Ss({planMode:!1,swarmMode:!1,goalMode:!1});function gM(e){Ce.sessions=e}function cm(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function Qpe(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function Xpe(e){Ce.sessions=[...Ce.sessions,e]}function Jpe(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function vM(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},Jv({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(Ce.unreadBySession=Xv(),vM())});function eme(){if(ci===null||!ci.health().stale)return;ar("ws: stale socket on focus, reconnecting",{activeSessionId:Ce.activeSessionId}),ci.reconnect();const e=Ce.activeSessionId;e&&$M.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(vM(),eme())});function bk(e){Ce.activeSessionId=e}function tme(e){Ce.messagesBySession=e}function nme(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function yM(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function sme(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function kM(e){ci?.unsubscribe(e),Ame(e),lp.flush(),Jpe(e),sme(e),delete Ce.approvalsBySession[e],delete Ce.questionsBySession[e],delete Ce.tasksBySession[e],delete Ce.goalBySession[e],delete Ce.gitStatusBySession[e],delete Ce.lastSeqBySession[e],delete Ce.compactionBySession[e],delete Ce.messagesLoadingMoreBySession[e],delete Ce.messagesHasMoreBySession[e],delete Ce.messagesLoadMoreErrorBySession[e],delete xk[e],NM.delete(e),dm.delete(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.sendingBySession[e],delete Ce.planModeBySession[e],delete Ce.swarmModeBySession[e],delete Ce.goalModeBySession[e],fM(),hM(),pM()}const bM=Q(null),xM=Q([]),_M=Q(!1),wM=Q(!1);async function um(e){let t;try{t=await ft().getSessionStatus(e)}catch{return}cm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmModeBySession={...Ce.swarmModeBySession,[e]:t.swarmMode},Ce.planModeBySession={...Ce.planModeBySession,[e]:t.planMode}}function SM(e,t){const n=t??Ce.activeSessionId;return n?Promise.resolve(ft().updateSession(n,e)).then(()=>um(n)).catch(()=>{}):Promise.resolve()}const CM=$t.conversationToc;function ome(){try{const e=Qn(CM);return e===null?!0:e==="true"}catch{return!0}}function ime(e){try{ts(CM,e?"true":"false")}catch{}}const AM=Q(ome());function rme(e){AM.value=e,ime(e)}function lme(e){try{return Qn(e)??""}catch{return""}}const MM=Q(lme(dM)==="1");function ame(e){MM.value=e;try{ts(dM,e?"1":"0")}catch{}}let ci=null,bC=0;function EM(){return bC+=1,`msg_opt_${Date.now().toString(36)}_${bC}`}const dm=new Set;function cme(e,t,n){const s={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,planReviewByToolCallId:Ce.planReviewByToolCallId,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,lastSeqBySession:Ce.lastSeqBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},o=Lpe(s,e,{sessionId:t,seq:n});gM(o.sessions),bk(o.activeSessionId),tme(o.messagesBySession),Ce.approvalsBySession=o.approvalsBySession,Ce.planReviewByToolCallId=o.planReviewByToolCallId,Ce.questionsBySession=o.questionsBySession,Ce.tasksBySession=o.tasksBySession,Ce.goalBySession=o.goalBySession,Ce.lastSeqBySession=o.lastSeqBySession,Ce.compactionBySession=o.compactionBySession,Ce.config=o.config??null,Ce.warnings=o.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Cn.loadModels(),Cn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Ce.swarmModeBySession={...Ce.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Ce.planModeBySession={...Ce.planModeBySession,[e.sessionId]:e.planMode}))}function ume(e,t){cme(e,t.sessionId,t.seq);const n=Hs.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&Hs.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?Hs.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?Hs.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&Hs.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;Ce.promptIdBySession[s]!==e.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ce.activeSessionId&&Di.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&N1e(e.sessionId,e.status),e.type==="questionRequested"&&I1e(e.sessionId,e.question),e.type==="approvalRequested"&&$1e(e.sessionId,e.approval)}const lp=Vfe(({appEvent:e,meta:t})=>ume(e,t),({appEvent:e})=>jfe(e));function TM(){if(ci!==null||typeof WebSocket>"u")return;Ce.connection="connecting",ci=ft().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ht.applyWorkspaceEvent(t);return}lp({appEvent:t,meta:n})},onResync(t,n,s){lp.flush(),s!==void 0&&(xk[t]=s),$M.request(t)},onError(t,n,s){_k({severity:"error",title:yn.global.t("warnings.wsTitle"),message:n,details:[Wn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Ce.connected=t,Ce.connection=t?"connected":"disconnected",t&&yme()}})}const xk={},NM=new Set;function dme(e){return ml(e)&&e.code===kC?!0:typeof e=="object"&&e!==null&&e.code===kC}function Wn(e,t){if(!(t==null||t===""))return{label:yn.global.t(`warnings.details.${e}`),value:IM(t)}}function IM(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function fme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function hme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function pme(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function mme(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function xC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function gme(e,t,n){const s=B5(t),o=ml(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Wn("operation",e),Wn("sessionId",n??Ce.activeSessionId),Wn("connection",Ce.connection),Wn("timestamp",mme(i??Date.now()))];return s?l.push(Wn("duration",xC(r)),Wn("request",`${t.method} ${t.path}`),Wn("endpoint",t.url),Wn("requestId",t.requestId),Wn("phase",t.phase),Wn("timeout",`${t.timeoutMs}ms`),Wn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Wn("contentType",t.contentType),Wn("responsePreview",t.bodyPreview),Wn("cause",t.cause)):o?l.push(Wn("duration",xC(r)),Wn("code",t.code),Wn("requestId",t.requestId),Wn("message",t.message),Wn("details",t.details)):l.push(Wn("errorName",fme(t)),Wn("message",hme(t)??IM(t)),Wn("stack",pme(t))),l.filter(a=>a!==void 0)}function vme(e,t,n={}){const s=B5(t),o=ml(t),i=n.title??(s?yn.global.t("warnings.daemonNetworkTitle"):o?yn.global.t("warnings.daemonApiTitle"):yn.global.t("warnings.operationFailedTitle")),r=n.message??(s?yn.global.t("warnings.daemonNetworkMessage"):o?t.message:yn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:gme(e,t,n.sessionId)}}function _k(e){Ce.warnings=[...Ce.warnings,e]}function yme(){const e=yn.global.t("warnings.wsTitle"),t=Ce.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ce.warnings.length&&(Ce.warnings=t)}function fm(e,t,n){_k(vme(e,t,n))}const kme={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function bme(e){if(!ml(e))return;const t=kme[e.code];return t?yn.global.t(t):void 0}async function xme(e){if(kM(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await ht.selectSession(t.id,{urlMode:"replace"}):(bk(void 0),Ce.sessionLoading=!1,ht.writeSessionUrl(void 0,"replace"))}const _C=new Set;async function _me(e){if(!_C.has(e)){_C.add(e);try{const t=await ft().getSessionWarnings(e),n=yn.global.t("warnings.noteLabel");for(const s of t)_k(`${n}: ${s.message}`)}catch{}}}async function wk(e){try{const n=await ft().getSessionSnapshot(e);lp.flush(),cm(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),nme(e,Wfe(Ce.messagesBySession[e]??[],n.messages)),Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:n.hasMoreMessages},Ce.approvalsBySession={...Ce.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(Ce.planReviewByToolCallId={...Ce.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return Ce.questionsBySession={...Ce.questionsBySession,[e]:n.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:n.asOfSeq},xk[e]=n.epoch,TM(),ci&&(ci.seedSnapshot(e,n),ci.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),Cme(e)),Sk.delete(e),_me(e),"ok"}catch(t){return dme(t)?(await xme(e),"not-found"):(fm("getSessionSnapshot",t,{title:yn.global.t("warnings.sessionSnapshotTitle"),message:yn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const $M=zfe(wk);function wme(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}const Sme=4,rr=[],Sk=new Set;function Cme(e){const t=rr.indexOf(e);for(t!==-1&&rr.splice(t,1),rr.unshift(e);rr.length>Sme;){let n=-1;for(let o=rr.length-1;o>=0;o--)if(rr[o]!==Ce.activeSessionId){n=o;break}if(n===-1)break;const[s]=rr.splice(n,1);if(s===void 0)break;ci?.unsubscribe(s),Sk.add(s)}}function Ame(e){const t=rr.indexOf(e);t!==-1&&rr.splice(t,1),Sk.delete(e)}async function Mme(e){return wk(e)}function hm(e){const t=Ce.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Hs.sideChatTargetBySession.value[e]?.agentId,o=(Ce.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Ce.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Ck(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return yn.global.t("sessions.justNow");if(i<1)return`${Math.round(o/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=o/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}mo`:`${Math.round(r/365)}y`}catch{return e}}const Eme=3e4,md=Q(0);let q0=null;function Tme(){q0===null&&(q0=setInterval(()=>{md.value=(md.value+1)%Number.MAX_SAFE_INTEGER},Eme),q0.unref?.())}function Nme(e,t){const n=e.split(`
320
+ `),s=t.split(`
321
+ `),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Ime(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Nme(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const s=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function $me(e){return{questionId:e.questionId,sessionId:e.sessionId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function Lme(e){const t=Ce.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Fme(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=yn.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=yn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Lme(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const Ome=P(()=>{const e=Ce.sessions.find(n=>n.id===Ce.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ce.workspaceName,branch:t}}),Rme=P(()=>(md.value,Ce.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Ck(e.updatedAt,e.status),status:e.status,busy:hm(e.id)})))),Bme=P(()=>Ce.activeSessionId??""),Dme=P(()=>{const e=Ce.activeSessionId;if(e)return Cn.skillsBySession.value[e]??[];const t=mm.value;return t?Cn.skillsByWorkspace.value[t]??[]:[]}),Pme=P(()=>{const e=Ce.activeSessionId;return e?Ce.sendingBySession[e]??!1:!1}),Hme=P(()=>ht.isStartingFirstPrompt()),Hs=fpe(Ce,{pushOperationFailure:fm,nextOptimisticMsgId:EM,connectEventsIfNeeded:TM,getEventConn:()=>ci,models:()=>Cn.models.value}),Id=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Hs.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),LM=Lhe(Ce,Id),Wme=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Ce.approvalsBySession[e]??[];return sM(n,s,o=>ft().getFileUrl(o),pm.value!=="idle",Ce.planReviewByToolCallId)}),zme=P(()=>(LM.taskClock.value,Id.value.map(Fme))),FM=P(()=>Dpe(Id.value)),Ume=P(()=>Hpe(Id.value)),Qa=P(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),jme=P(()=>{const e=Ce.activeSessionId;return e?Ope(Ce.messagesBySession[e]??[]):[]}),qme=P(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),Vme=P(()=>Ce.connection),Kme=P(()=>Ce.loading),Gme=P(()=>Ce.sessionLoading),Yme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),Zme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),Qme=P(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),Xme=P(()=>Ce.serverVersion),Jme=P(()=>Ce.dangerousBypassAuth);function e1e(){Ce.dangerousBypassAuth=!1}const t1e=P(()=>Ce.permission),n1e=P(()=>Ce.thinking),OM=P(()=>{const e=Ce.activeSessionId;return e?Ce.planModeBySession[e]??!1:am.planMode}),s1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.swarmModeBySession[e]??!1:am.swarmMode}),o1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.goalModeBySession[e]??!1:am.goalMode}),i1e=P(()=>{const e=Ppe(FM.value);return{plan:OM.value,goal:Qa.value&&Qa.value.status!=="complete"?{status:Qa.value.status,turnsUsed:Qa.value.turnsUsed,elapsedMs:Qa.value.wallClockMs}:null,swarm:e.total>0?e:null}}),r1e=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=ft();return(Ce.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(s=>({fileId:s.fileId,kind:s.kind,url:t.getFileUrl(s.fileId)}))}))}),l1e=P(()=>Ce.warnings),a1e=P(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map($me):[]}),c1e=P(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Ime(t),agentName:t.agentName})):[]}),pm=P(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ce.questionsBySession[e]??[]).length>0?"awaiting-question":hm(e)?"running":"idle":"idle"}),Cn=Rhe(Ce,{pushOperationFailure:fm,refreshSessionStatus:um,persistSessionProfile:SM,activity:pm,inFlightPromptSessions:dm,saveThinkingToStorage:qpe,updateSession:cm,updateSessionMessages:yM}),ap=P(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),u1e=P(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),d1e=P(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),f1e=P(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),RM=P(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=ap.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Cn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Ce.defaultModel)??"—",o=Cn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:ap.value!==null}}),h1e=P(()=>xM.value),p1e=P(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),m1e=P(()=>Ce.authReady),g1e=P(()=>Ce.defaultModel),v1e=P(()=>Ce.managedProviderStatus),y1e=P(()=>Ce.config),k1e=P(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function Tc(e){return Ce.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const Ak=P(()=>Hfe({workspaces:Ce.workspaces,sessions:Ce.sessions,hiddenWorkspaceRoots:Ce.hiddenWorkspaceRoots,activeRoot:Ce.sessions.find(e=>e.id===Ce.activeSessionId)?.cwd,activeBranch:ap.value?.branch??null,sessionsHasMoreByWorkspace:Ce.sessionsHasMoreByWorkspace})),cp=Q(IN()),Nc=Q($N()==="manual"?"manual":"recent");Ke(()=>[Ak.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=jN(n,cp.value);s!==null&&(cp.value=s,$3(s))});const ua=P(()=>{const e=Ak.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Zpe(t.root,Ce.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Nc.value==="recent"){const t=new Map;for(const n of Ce.sessions){if(n.parentSessionId)continue;const s=Tc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return KN(e,t)}return qN(e,cp.value)}),mm=P(()=>{const e=Ce.activeWorkspaceId,t=ua.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ke(mm,e=>{e&&(Object.prototype.hasOwnProperty.call(Cn.skillsByWorkspace.value,e)||Cn.loadSkillsForWorkspace(e))},{immediate:!0});const b1e=P(()=>{const e=mm.value;return e?ua.value.find(t=>t.id===e)??null:null}),x1e=P(()=>{md.value;const e=new Set(ua.value.map(n=>n.id)),t=new Map(ua.value.map(n=>[n.id,n.name]));return Ce.sessions.filter(n=>!n.parentSessionId&&e.has(Tc(n))).map(n=>{const s=Tc(n);return{id:n.id,title:n.title,time:Ck(n.updatedAt,n.status),status:n.status,busy:hm(n.id),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),_1e=P(()=>{md.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Tc(t),s={id:t.id,title:t.title,time:Ck(t.updatedAt,t.status),status:t.status,busy:hm(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return ua.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ce.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ce.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ce.sessionsInitialCountByWorkspace[t.id]??yv}))});function w1e(e){cp.value=e,$3(e),Nc.value!=="manual"&&(Nc.value="manual",L3("manual"))}function S1e(e){Nc.value!==e&&(Nc.value=e,L3(e))}const BM=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),C1e=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),A1e=P(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),M1e=P(()=>{const e={},t=BM.value;for(const n of Ce.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Tc(n);e[o]=(e[o]??0)+s}return e}),E1e=P(()=>Ce.recentRoots),T1e=P(()=>Ce.availableOpenInApps),ht=_pe(Ce,{taskPoller:LM,sideChat:Hs,modelProvider:Cn,pushOperationFailure:fm,activity:pm,inFlightPromptSessions:dm,sessionsKnownEmpty:NM,setSessions:gM,updateSession:cm,upsertSessionFront:Qpe,appendSession:Xpe,forgetSession:kM,setActiveSessionId:bk,updateSessionMessages:yM,nextOptimisticMsgId:EM,getEventConn:()=>ci,syncSessionFromSnapshot:wk,reopenSession:Mme,hasLoadedMessages:wme,refreshSessionStatus:um,persistSessionProfile:SM,mergedWorkspaces:Ak,workspacesView:ua,status:RM,workspaceIdForSession:Tc,savePermissionToStorage:Upe,savePlanModeToStorage:fM,saveSwarmModeToStorage:hM,saveGoalModeToStorage:pM,draftModes:am,saveUnread:Jv,saveActiveWorkspaceToStorage:Ype,saveHiddenWorkspacesToStorage:Gpe,goalErrorMessage:bme,resetFastMoon:Di.resetFastMoon,initialized:wM,selectedDiffPath:bM,fileDiffLines:xM,fileDiffLoading:_M});function Mk(e){return e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function N1e(e,t){dm.delete(e),Ce.sendingBySession={...Ce.sendingBySession,[e]:!1};const n=Ce.promptIdBySession[e];if(Ce.promptIdBySession[e]!==void 0){const a={...Ce.promptIdBySession};delete a[e],Ce.promptIdBySession=a}e===Ce.activeSessionId?(Di.resetFastMoon(),ht.loadGitStatus(e),um(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},Jv({[e]:!0}));const s=(Ce.approvalsBySession[e]??[]).length>0,o=(Ce.questionsBySession[e]??[]).length>0;dhe(t,s,o)&&Pi.maybeNotifyCompletion(e,{isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(a=>a.id===e)?.title??"",promptId:n,onClick:()=>{ht.selectSession(e)}}),t==="idle"&&pd.maybePlayCompletionSound();const i=Ce.queuedBySession[e]??[];if(i.length===0)return;const[r,...l]=i;Ce.queuedBySession={...Ce.queuedBySession,[e]:l},r!==void 0&&ht.submitPromptInternal(e,r.text,r.attachments).then(a=>{if(!a){const c=Ce.queuedBySession[e]??[];Ce.queuedBySession={...Ce.queuedBySession,[e]:[r,...c]}}})}function I1e(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Pi.maybeNotifyQuestion({isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ht.selectSession(e)}}),pd.maybePlayQuestionSound()}function $1e(e,t){Pi.maybeNotifyApproval({isUserWatching:Mk(e),sessionTitle:Ce.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ht.selectSession(e)}}),pd.maybePlayApprovalSound()}function Ek(){return Tme(),{workspace:Ome,sessions:Rme,activeSessionId:Bme,workspacesView:ua,workspaceSortMode:Nc,visibleWorkspace:b1e,activeWorkspaceId:mm,sessionsForView:x1e,workspaceGroups:_1e,attentionBySession:BM,pendingBySession:C1e,attentionByWorkspace:M1e,unreadBySession:A1e,recentRoots:E1e,turns:Wme,tasks:zme,activeAppTasks:Id,todos:jme,goal:Qa,swarms:FM,swarmMembersByToolCallId:Ume,activationBadges:i1e,compaction:qme,status:RM,sessionCost:p1e,fileDiff:h1e,selectedDiffPath:bM,fileDiffLoading:_M,changes:d1e,gitInfo:ap,gitDiffStats:f1e,activePullRequest:u1e,changesByPath:k1e,pendingApprovals:c1e,availableOpenInApps:T1e,connection:Vme,loading:Kme,sessionLoading:Gme,loadingMoreMessages:Yme,hasMoreMessages:Zme,loadMoreMessagesError:Qme,serverVersion:Xme,dangerousBypassAuth:Jme,clearDangerousBypassAuth:e1e,initialized:wM,permission:t1e,thinking:n1e,planMode:OM,swarmMode:s1e,goalMode:o1e,queued:r1e,warnings:l1e,questions:a1e,activity:pm,isSending:Pme,isStartingFirstPrompt:Hme,fastMoon:Di.fastMoon,models:Cn.models,starredModelIds:Cn.starredModelIds,providers:Cn.providers,uiFontSize:Di.uiFontSize,setUiFontSize:Di.setUiFontSize,conversationToc:AM,setConversationToc:rme,colorScheme:Di.colorScheme,setColorScheme:Di.setColorScheme,accent:Di.accent,setAccent:Di.setAccent,notifyOnComplete:Pi.notifyOnComplete,notifyOnQuestion:Pi.notifyOnQuestion,notifyOnApproval:Pi.notifyOnApproval,notifyPermission:Pi.notifyPermission,setNotifyOnComplete:Pi.setNotifyOnComplete,setNotifyOnQuestion:Pi.setNotifyOnQuestion,setNotifyOnApproval:Pi.setNotifyOnApproval,soundOnComplete:pd.soundOnComplete,setSoundOnComplete:pd.setSoundOnComplete,onboarded:MM,setOnboarded:ame,load:ht.load,selectSession:ht.selectSession,clearActiveSession:ht.clearActiveSession,loadOlderMessages:ht.loadOlderMessages,loadWorkspaces:ht.loadWorkspaces,loadMoreSessions:ht.loadMoreSessions,loadAllSessions:ht.loadAllSessions,selectWorkspace:ht.selectWorkspace,openWorkspace:ht.openWorkspace,openWorkspaceDraft:ht.openWorkspaceDraft,startSessionAndSendPrompt:ht.startSessionAndSendPrompt,startSessionAndActivateSkill:ht.startSessionAndActivateSkill,startSessionAndOpenSideChat:ht.startSessionAndOpenSideChat,addWorkspaceByPath:ht.addWorkspaceByPath,browseFs:ht.browseFs,getFsHome:ht.getFsHome,sendPrompt:ht.sendPrompt,steerPrompt:ht.steerPrompt,sideChatVisible:Hs.sideChatVisible,sideChatSessionId:Hs.sideChatSessionId,sideChatTurns:Hs.sideChatTurns,sideChatRunning:Hs.sideChatRunning,sideChatSending:Hs.sideChatSending,openSideChat:Hs.openSideChat,closeSideChat:Hs.closeSideChat,sendSideChatPrompt:Hs.sendSideChatPrompt,uploadImage:ht.uploadImage,abortCurrentPrompt:ht.abortCurrentPrompt,respondApproval:ht.respondApproval,respondQuestion:ht.respondQuestion,dismissQuestion:ht.dismissQuestion,pendingQuestionActions:ht.pendingQuestionActions,pendingApprovalActions:ht.pendingApprovalActions,cancelTask:ht.cancelTask,setPermission:ht.setPermission,setThinking:Cn.setThinking,setPlanMode:ht.setPlanMode,togglePlanMode:ht.togglePlanMode,setSwarmMode:ht.setSwarmMode,toggleSwarmMode:ht.toggleSwarmMode,setGoalMode:ht.setGoalMode,toggleGoalMode:ht.toggleGoalMode,createGoal:ht.createGoal,controlGoal:ht.controlGoal,enqueue:ht.enqueue,dismissWarning:ht.dismissWarning,renameSession:ht.renameSession,renameWorkspace:ht.renameWorkspace,deleteWorkspace:ht.deleteWorkspace,reorderWorkspaces:w1e,setWorkspaceSortMode:S1e,archiveSession:ht.archiveSession,restoreSession:ht.restoreSession,loadArchivedSessions:ht.loadArchivedSessions,compact:ht.compact,forkSession:ht.forkSession,undo:ht.undo,unqueue:ht.unqueue,reorderQueue:ht.reorderQueue,searchFiles:ht.searchFiles,loadGitStatus:ht.loadGitStatus,loadFileDiff:ht.loadFileDiff,clearFileDiff:ht.clearFileDiff,listDir:ht.listDir,readFileContent:ht.readFileContent,getFileDownloadUrl:ht.getFileDownloadUrl,openWorkspaceFile:ht.openWorkspaceFile,openInApp:ht.openInApp,revealWorkspaceFile:ht.revealWorkspaceFile,resolveImageUrl:ht.resolveImageUrl,refreshOAuthProviderModels:Cn.refreshOAuthProviderModels,loadModels:Cn.loadModels,loadProviders:Cn.loadProviders,skills:Dme,activateSkill:Cn.activateSkill,setModel:Cn.setModel,toggleStarModel:Cn.toggleStarModel,addProvider:Cn.addProvider,deleteProvider:Cn.deleteProvider,refreshProvider:Cn.refreshProvider,refreshAllProviders:Cn.refreshAllProviders,authReady:m1e,defaultModel:g1e,managedProviderStatus:v1e,config:y1e,updateConfig:ht.updateConfig,checkAuth:ht.checkAuth,startOAuthLogin:Cn.startOAuthLogin,pollOAuthLogin:Cn.pollOAuthLogin,cancelOAuthLogin:Cn.cancelOAuthLogin,logout:ht.logout}}const DM=qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=Et(),n=q3.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&V3(o)}return(o,i)=>(b(),ye(to,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),L1e=["aria-checked","aria-label","disabled"],F1e=qe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),I("button",{class:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[w("span",{class:"ui-switch__thumb"},null,-1)])],10,L1e))}}),er=ut(F1e,[["__scopeId","data-v-dbe22dc4"]]),O1e=["aria-label"],R1e=["aria-selected","onClick"],B1e={class:"body"},D1e={class:"panel"},P1e={class:"sec"},H1e={class:"sec-title"},W1e={class:"row"},z1e={class:"rlabel"},U1e={class:"row"},j1e={class:"rlabel"},q1e={class:"row"},V1e={class:"rlabel"},K1e={class:"num-field"},G1e=["value","aria-label"],Y1e={class:"row"},Z1e={class:"rlabel"},Q1e={class:"row"},X1e={class:"rlabel"},J1e={class:"hint"},e0e={class:"sec"},t0e={class:"sec-title"},n0e={class:"row"},s0e={class:"rlabel"},o0e={key:0,class:"hint"},i0e={class:"row"},r0e={class:"rlabel"},l0e={key:0,class:"hint"},a0e={class:"row"},c0e={class:"rlabel"},u0e={key:0,class:"hint"},d0e={class:"row"},f0e={class:"rlabel"},h0e={class:"panel"},p0e={class:"sec"},m0e={class:"sec-title"},g0e={class:"row"},v0e={class:"rlabel"},y0e={key:0,class:"rvalue"},k0e={class:"actions"},b0e={class:"panel"},x0e={class:"sec"},_0e={class:"sec-head"},w0e={class:"sec-title"},S0e={key:0,class:"saving"},C0e={class:"row"},A0e={class:"rlabel"},M0e={class:"hint"},E0e={key:0,class:"select-wrap"},T0e={key:0,value:"",disabled:""},N0e=["label"],I0e=["value"],$0e={key:1,class:"rvalue mono"},L0e={class:"row"},F0e={class:"rlabel"},O0e={class:"hint"},R0e={class:"row"},B0e={class:"rlabel"},D0e={class:"hint"},P0e={class:"row"},H0e={class:"rlabel"},W0e={class:"hint"},z0e={class:"row"},U0e={class:"rlabel"},j0e={class:"hint"},q0e={key:1,class:"empty-config"},V0e={class:"panel"},K0e={class:"sec"},G0e={class:"sec-title"},Y0e={class:"row"},Z0e={class:"rlabel"},Q0e={class:"rvalue mono"},X0e={class:"row"},J0e={class:"rlabel"},ege={class:"rvalue mono"},tge={key:0,class:"row"},nge={class:"rlabel"},sge={class:"hint"},oge={class:"hint"},ige={class:"row"},rge={class:"rlabel"},lge={key:0,class:"hint"},age={class:"panel"},cge={class:"panel-head"},uge={class:"panel-title"},dge={class:"panel-desc"},fge={class:"archive-toolbar"},hge={class:"archive-search"},pge=["placeholder"],mge={value:"all"},gge=["value"],vge={key:0,class:"archive-empty"},yge={key:0,class:"archive-list"},kge={class:"archive-workspace"},bge={class:"path"},xge={class:"count"},_ge={class:"setting-card"},wge={class:"archive-meta"},Sge={class:"archive-name"},Cge={class:"archive-time"},Age={key:1,class:"archive-empty"},Mge=100,Ege=qe({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=PN(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=Q(null);ik(u);function d(te){te.key==="Escape"&&o("close")}ln(()=>document.addEventListener("keydown",d)),fn(()=>document.removeEventListener("keydown",d));function f(){D5()}const p=P(()=>{const te=new Map;for(const Z of s.models??[])te.set(Z.id,{id:Z.id,label:Z.displayName??Z.model??Z.id,provider:Z.provider});for(const[Z,ne]of Object.entries(s.config?.models??{})){if(te.has(Z))continue;const ke=_(ne);te.set(Z,{id:Z,label:k(Z,ne,ke),provider:ke??Z})}return Array.from(te.values())}),h=P(()=>{const te=new Map;for(const Z of p.value){const ne=te.get(Z.provider)??[];ne.push(Z),te.set(Z.provider,ne)}for(const Z of te.values())Z.sort((ne,ke)=>ne.label.localeCompare(ke.label));return Array.from(te.entries()).toSorted(([Z],[ne])=>Z.localeCompare(ne)).map(([Z,ne])=>({provider:Z,options:ne}))}),m=P(()=>{const te=s.config?.defaultPermissionMode;return te==="auto"||te==="yolo"||te==="manual"?te:"manual"});function _(te){if(!te||typeof te!="object")return;const Z=te;return typeof Z.provider=="string"?Z.provider:void 0}function k(te,Z,ne){if(!Z||typeof Z!="object")return te;const ke=Z,Se=typeof ke.model=="string"?ke.model:void 0,Ye=ne??_(Z);return Se&&Ye?`${te} (${Ye}/${Se})`:Se?`${te} (${Se})`:te}function g(te){return te===!0}function v(te){!te||te===s.config?.defaultModel||o("updateConfig",{defaultModel:te})}function y(te){te!==m.value&&o("updateConfig",{defaultPermissionMode:te})}function A(te){const Z=s.config?.[te];o("updateConfig",{[te]:!g(Z)})}function L(){const te=s.config?.thinking;return!te||typeof te!="object"?!0:te.enabled!==!1}function $(){o("updateConfig",{thinking:{enabled:!L()}})}function x(){const te=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!te})}function E(te){i.value=te}const N=Ek(),F=Q([]),S=Q(!1),T=Q(!1),R=Q(""),O=Q("all"),D=Q("archived-desc");async function W(){if(!(S.value||T.value)){S.value=!0;try{const te=[];let Z;for(;;){const ne=await N.loadArchivedSessions({beforeId:Z,pageSize:Mge});if(te.push(...ne.items),!ne.hasMore||ne.items.length===0)break;const ke=ne.items.at(-1)?.id;if(ke===void 0)break;Z=ke}F.value=te,T.value=!0}catch(te){console.warn("loadAllArchived failed",te)}finally{S.value=!1}}}Ke(i,te=>{te==="archived"&&!T.value&&W()});const z=P(()=>{const te=new Set;for(const Z of F.value)te.add(Z.cwd);return Array.from(te).sort((Z,ne)=>Z.localeCompare(ne))}),V=P(()=>{const te=R.value.trim().toLowerCase();let Z=F.value.filter(ne=>ne.archived===!0);return O.value!=="all"&&(Z=Z.filter(ne=>ne.cwd===O.value)),te&&(Z=Z.filter(ne=>ne.title.toLowerCase().includes(te))),Z=Z.slice(),D.value==="archived-desc"?Z.sort((ne,ke)=>ke.updatedAt.localeCompare(ne.updatedAt)):D.value==="created-desc"?Z.sort((ne,ke)=>ke.createdAt.localeCompare(ne.createdAt)):Z.sort((ne,ke)=>ne.title.localeCompare(ke.title,"zh")),Z}),U=P(()=>{const te=new Map;for(const Z of V.value){const ne=te.get(Z.cwd)??[];ne.push(Z),te.set(Z.cwd,ne)}return Array.from(te.entries()).map(([Z,ne])=>({cwd:Z,items:ne}))});async function re(te){await N.restoreSession(te)&&(F.value=F.value.filter(ne=>ne.id!==te))}function ae(te){const Z=new Date(te);if(Number.isNaN(Z.getTime()))return te;const ne=ke=>String(ke).padStart(2,"0");return`${Z.getFullYear()}-${ne(Z.getMonth()+1)}-${ne(Z.getDate())} ${ne(Z.getHours())}:${ne(Z.getMinutes())}`}return(te,Z)=>(b(),ye(Sr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:Z[19]||(Z[19]=ne=>o("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:u,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(b(),I(Be,null,nt(r,ne=>w("button",{key:ne.id,type:"button",class:De(["tab",{on:i.value===ne.id}]),role:"tab","aria-selected":i.value===ne.id,onClick:ke=>E(ne.id)},B(C(n)(ne.labelKey)),11,R1e)),64))],8,O1e),w("div",B1e,[Tn(w("section",D1e,[w("section",P1e,[w("h3",H1e,B(C(n)("settings.appearance")),1),w("div",W1e,[w("span",z1e,B(C(n)("theme.colorSchemeLabel")),1),ie(to,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":Z[0]||(Z[0]=ne=>o("setColorScheme",ne))},null,8,["model-value","options"])]),w("div",U1e,[w("span",j1e,B(C(n)("theme.accentLabel")),1),ie(to,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":Z[1]||(Z[1]=ne=>o("setAccent",ne))},null,8,["model-value","options"])]),w("div",q1e,[w("span",V1e,B(C(n)("settings.uiFontSize")),1),w("label",K1e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:Z[2]||(Z[2]=ne=>o("setUiFontSize",Number(ne.target.value)))},null,40,G1e),Z[20]||(Z[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",Y1e,[w("span",Z1e,B(C(n)("sidebar.language")),1),ie(DM)]),w("div",Q1e,[w("span",X1e,[Ge(B(C(n)("settings.conversationToc"))+" ",1),w("span",J1e,B(C(n)("settings.conversationTocHint")),1)]),ie(er,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":Z[3]||(Z[3]=ne=>o("setConversationToc",ne))},null,8,["model-value","label"])])]),w("section",e0e,[w("h3",t0e,B(C(n)("settings.notifications")),1),w("div",n0e,[w("span",s0e,[Ge(B(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",o0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Z[4]||(Z[4]=ne=>o("setNotify",ne))},null,8,["model-value","disabled","label"])]),w("div",i0e,[w("span",r0e,[Ge(B(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",l0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Z[5]||(Z[5]=ne=>o("setNotifyQuestion",ne))},null,8,["model-value","disabled","label"])]),w("div",a0e,[w("span",c0e,[Ge(B(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(b(),I("span",u0e,B(C(n)("settings.notifyDenied")),1)):le("",!0)]),ie(er,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Z[6]||(Z[6]=ne=>o("setNotifyApproval",ne))},null,8,["model-value","disabled","label"])]),w("div",d0e,[w("span",f0e,B(C(n)("settings.soundOnComplete")),1),ie(er,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":Z[7]||(Z[7]=ne=>o("setSound",ne))},null,8,["model-value","label"])])])],512),[[oi,i.value==="general"]]),Tn(w("section",h0e,[w("section",p0e,[w("h3",m0e,B(C(n)("settings.account")),1),w("div",g0e,[w("span",v0e,B(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(jt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(b(),I("span",y0e,B(e.accountModel),1)):le("",!0)]),_:1},8,["text"])]),w("div",k0e,[ie(Ft,{variant:"secondary",size:"sm",onClick:Z[8]||(Z[8]=ne=>{o("openOnboarding"),o("close")})},{default:Ee(()=>[Ge(B(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(b(),ye(Ft,{key:0,variant:"danger-soft",size:"sm",onClick:Z[9]||(Z[9]=ne=>o("logout"))},{default:Ee(()=>[Ge(B(C(n)("sidebar.signOut")),1)]),_:1})):(b(),ye(Ft,{key:1,variant:"primary",size:"sm",onClick:Z[10]||(Z[10]=ne=>o("login"))},{default:Ee(()=>[Ge(B(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[oi,i.value==="account"]]),Tn(w("section",b0e,[w("section",x0e,[w("div",_0e,[w("h3",w0e,B(C(n)("settings.agentDefaults")),1),e.configSaving?(b(),I("span",S0e,B(C(n)("settings.saving")),1)):le("",!0)]),e.config?(b(),I(Be,{key:0},[w("div",C0e,[w("span",A0e,[Ge(B(C(n)("settings.defaultModel"))+" ",1),w("span",M0e,B(C(n)("settings.defaultModelHint")),1)]),h.value.length>0?(b(),I("div",E0e,[ie(gv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:Ee(()=>[e.config.defaultModel?le("",!0):(b(),I("option",T0e,B(C(n)("settings.noDefaultModel")),1)),(b(!0),I(Be,null,nt(h.value,ne=>(b(),I("optgroup",{key:ne.provider,label:ne.provider},[(b(!0),I(Be,null,nt(ne.options,ke=>(b(),I("option",{key:ke.id,value:ke.id},B(ke.label),9,I0e))),128))],8,N0e))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(b(),I("span",$0e,B(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",L0e,[w("span",F0e,[Ge(B(C(n)("settings.defaultPermission"))+" ",1),w("span",O0e,B(C(n)("settings.defaultPermissionHint")),1)]),ie(to,{"model-value":m.value,options:a.map(ne=>({value:ne,label:C(n)(c[ne])})),"onUpdate:modelValue":Z[11]||(Z[11]=ne=>y(ne))},null,8,["model-value","options"])]),w("div",R0e,[w("span",B0e,[Ge(B(C(n)("settings.defaultThinking"))+" ",1),w("span",D0e,B(C(n)("settings.defaultThinkingHint")),1)]),ie(er,{"model-value":L(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":Z[12]||(Z[12]=ne=>$())},null,8,["model-value","disabled","label"])]),w("div",P0e,[w("span",H0e,[Ge(B(C(n)("settings.defaultPlanMode"))+" ",1),w("span",W0e,B(C(n)("settings.defaultPlanModeHint")),1)]),ie(er,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Z[13]||(Z[13]=ne=>A("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",z0e,[w("span",U0e,[Ge(B(C(n)("settings.mergeSkills"))+" ",1),w("span",j0e,B(C(n)("settings.mergeSkillsHint")),1)]),ie(er,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":Z[14]||(Z[14]=ne=>A("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(b(),I("div",q0e,B(C(n)("settings.configUnavailable")),1))])],512),[[oi,i.value==="agent"]]),Tn(w("section",V0e,[w("section",K0e,[w("h3",G0e,B(C(n)("settings.advanced")),1),w("div",Y0e,[w("span",Z0e,B(C(n)("sidebar.daemon")),1),w("span",Q0e,B(C(l)),1)]),w("div",X0e,[w("span",J0e,B(C(n)("settings.serverVersion")),1),w("span",ege,B(e.serverVersion||"-"),1)]),e.config?(b(),I("div",tge,[w("span",nge,[Ge(B(C(n)("settings.telemetry"))+" ",1),w("span",sge,B(C(n)("settings.telemetryHint")),1),w("span",oge,B(C(n)("settings.telemetryRestartHint")),1)]),ie(er,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":Z[15]||(Z[15]=ne=>x())},null,8,["model-value","disabled","label"])])):le("",!0),w("div",ige,[w("span",rge,[Ge(B(C(n)("settings.exportLog"))+" ",1),C(Ai)()?le("",!0):(b(),I("span",lge,B(C(n)("settings.logHint")),1))]),ie(Ft,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ge(B(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[oi,i.value==="advanced"]]),Tn(w("section",age,[w("div",cge,[Z[21]||(Z[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",uge,B(C(n)("settings.archivedTitle")),1),w("p",dge,B(C(n)("settings.archivedDesc")),1)]),w("div",fge,[w("label",hge,[Z[22]||(Z[22]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("circle",{cx:"11",cy:"11",r:"7"}),w("path",{d:"m21 21-4.3-4.3"})],-1)),Tn(w("input",{"onUpdate:modelValue":Z[16]||(Z[16]=ne=>R.value=ne),placeholder:C(n)("settings.archivedSearch")},null,8,pge),[[ao,R.value]])]),ie(gv,{"model-value":O.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Z[17]||(Z[17]=ne=>O.value=ne)},{default:Ee(()=>[w("option",mge,B(C(n)("settings.archivedAllWorkspaces")),1),(b(!0),I(Be,null,nt(z.value,ne=>(b(),I("option",{key:ne,value:ne},B(ne),9,gge))),128))]),_:1},8,["model-value","aria-label"]),ie(to,{size:"sm","model-value":D.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":Z[18]||(Z[18]=ne=>D.value=ne)},null,8,["model-value","options"])]),S.value?(b(),I("div",vge,B(C(n)("settings.archivedLoadingAll")),1)):(b(),I(Be,{key:1},[U.value.length>0?(b(),I("div",yge,[(b(!0),I(Be,null,nt(U.value,ne=>(b(),I("section",{key:ne.cwd,class:"archive-card"},[w("div",kge,[Z[23]||(Z[23]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("path",{d:"M3 7h6l2 2h10v9H3z"}),w("path",{d:"M3 7V5h6l2 2"})],-1)),w("span",bge,B(ne.cwd),1),w("span",xge,B(C(n)("settings.archivedSessionsCount",{count:ne.items.length})),1)]),w("div",_ge,[(b(!0),I(Be,null,nt(ne.items,ke=>(b(),I("div",{key:ke.id,class:"archive-row"},[w("div",wge,[w("div",Sge,B(ke.title),1),w("div",Cge,B(C(n)("settings.archivedAt",{time:ae(ke.updatedAt)})),1)]),ie(Ft,{variant:"secondary",size:"sm",onClick:Se=>re(ke.id)},{default:Ee(()=>[Ge(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(b(),I("div",Age,B(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[oi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Tge=ut(Ege,[["__scopeId","data-v-0c2e1aca"]]),Nge={class:"aw"},Ige={class:"crumbbar"},$ge={class:"crumbs"},Lge={key:0,class:"crumb-sep"},Fge=["onClick"],Oge={key:0,class:"filterbar"},Rge=["placeholder"],Bge={class:"folder-list"},Dge={key:0,class:"fl-loading"},Pge=["onClick"],Hge={class:"folder-name search-rel"},Wge={key:0,class:"git-branch"},zge={key:0,class:"fl-empty"},Uge={key:1,class:"fl-loading"},jge=["onClick"],qge={class:"folder-name"},Vge={key:0,class:"git-branch"},Kge={key:0,class:"fl-empty"},Gge={class:"paste-row"},Yge={class:"paste-input-wrap"},Zge={key:1,class:"add-error",role:"alert"},Qge={class:"actions"},Xge={class:"footer-hint"},Jge=600,eve=6,wC=150,tve=qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=Q(!1),l=Q(!1),a=Q(""),c=Q(null),u=Q([]),d=Q(""),f=Q(!1),p=Q([]),h=P(()=>d.value.trim().length>0);let m=0,_=null;function k(T,R){const O=T.toLowerCase(),D=R.toLowerCase();let W=0;for(let z=0;z<D.length&&W<O.length;z++)D[z]===O[W]&&W++;return W===O.length}async function g(T){const R=a.value,O=T.trim();if(!R||O===""){p.value=[],f.value=!1;return}const D=++m;f.value=!0;const W=[],z=[{path:R,depth:0}];let V=0;for(;z.length>0&&V<Jge&&W.length<wC;){if(D!==m)return;const U=z.shift();V++;let re;try{re=await s.browseFs(U.path)}catch{continue}if(D!==m)return;for(const ae of re.entries){if(!ae.isDir)continue;const te=ae.path.startsWith(R)?ae.path.slice(R.length).replace(/^\/+/,""):ae.path;if(k(O,te||ae.name)&&(W.push({path:ae.path,name:ae.name,rel:te||ae.name,isGitRepo:ae.isGitRepo,branch:ae.branch}),W.length>=wC))break;U.depth+1<eve&&z.push({path:ae.path,depth:U.depth+1})}D===m&&(p.value=[...W])}D===m&&(f.value=!1)}Ke(d,T=>{if(_&&clearTimeout(_),T.trim()===""){m++,p.value=[],f.value=!1;return}_=setTimeout(()=>void g(T),220)});const v=Q(!1),y=Q(""),A=P(()=>y.value.trim()),L=P(()=>{const T=a.value;if(!T)return[];const R=T.split("/").filter(Boolean),O=[{label:"/",path:"/"}];let D="";for(const W of R)D+=`/${W}`,O.push({label:W,path:D});return O}),$=P(()=>a.value.length>0);async function x(T){r.value=!0;try{const R=await s.browseFs(T);if(!R.path){l.value=!0;return}a.value=R.path,c.value=R.parent,u.value=R.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function E(T){T.isDir&&x(T.path)}function N(){c.value&&x(c.value)}function F(){$.value&&o("add",a.value)}function S(){A.value.length!==0&&o("add",A.value)}return ln(async()=>{r.value=!0;try{if(s.defaultPath&&(await x(s.defaultPath),!l.value))return;const T=await s.getFsHome();T.home?await x(T.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),fn(()=>{_&&clearTimeout(_)}),(T,R)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":R[5]||(R[5]=O=>i.value=O),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:R[6]||(R[6]=O=>o("close"))},{default:Ee(()=>[w("div",Nge,[l.value?le("",!0):(b(),I(Be,{key:0},[w("div",Ige,[ie(Nn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:N},{default:Ee(()=>[ie(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",$ge,[(b(!0),I(Be,null,nt(L.value,(O,D)=>(b(),I(Be,{key:O.path},[D>1?(b(),I("span",Lge,"/")):le("",!0),w("button",{class:De(["crumb",{last:D===L.value.length-1}]),onClick:W=>x(O.path)},B(O.label),11,Fge)],64))),128))])]),r.value?le("",!0):(b(),I("div",Oge,[ie(Ve,{class:"filter-icon",name:"search",size:"md"}),Tn(w("input",{"onUpdate:modelValue":R[0]||(R[0]=O=>d.value=O),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[1]||(R[1]=bt(()=>{},["stop"]))},null,40,Rge),[[ao,d.value]]),f.value?(b(),ye(wo,{key:0,size:"sm"})):le("",!0)])),w("div",Bge,[r.value?(b(),I("div",Dge,B(C(n)("workspace.browsing")),1)):h.value?(b(),I(Be,{key:1},[(b(!0),I(Be,null,nt(p.value,O=>(b(),I("button",{key:O.path,class:"folder-row",onClick:D=>x(O.path)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Hge,B(O.rel),1),O.isGitRepo?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(n)("workspace.gitTag")),1),O.branch?(b(),I("span",Wge,B(O.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,Pge))),128)),!f.value&&p.value.length===0?(b(),I("div",zge,B(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&p.value.length===0?(b(),I("div",Uge,B(C(n)("workspace.searching")),1)):le("",!0)],64)):(b(),I(Be,{key:2},[(b(!0),I(Be,null,nt(u.value,O=>(b(),I("button",{key:O.path,class:"folder-row",onClick:D=>E(O)},[ie(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",qge,B(O.name),1),O.isGitRepo?(b(),ye(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ge(B(C(n)("workspace.gitTag")),1),O.branch?(b(),I("span",Vge,B(O.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,jge))),128)),u.value.length===0?(b(),I("div",Kge,B(C(n)("workspace.noSubfolders")),1)):le("",!0)],64))])],64)),w("div",{class:De(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(b(),ye(Ft,{key:0,variant:"ghost",size:"sm",onClick:R[2]||(R[2]=O=>v.value=!0)},{default:Ee(()=>[Ge(B(C(n)("workspace.pasteToggle")),1)]),_:1})):(b(),ye(xu,{key:1,label:C(n)("workspace.pathLabel")},{default:Ee(()=>[w("div",Gge,[w("div",Yge,[ie(sa,{modelValue:y.value,"onUpdate:modelValue":R[3]||(R[3]=O=>y.value=O),placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:bi(bt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),ie(Nn,{disabled:A.value.length===0,label:C(n)("workspace.add"),onClick:S},{default:Ee(()=>[ie(Ve,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(b(),I("div",Zge,B(e.error),1)):le("",!0),w("div",Qge,[ie(jt,{text:a.value},{default:Ee(()=>[l.value?le("",!0):(b(),ye(Ft,{key:0,variant:"primary",disabled:!$.value,onClick:F},{default:Ee(()=>[Ge(B(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Ft,{variant:"secondary",onClick:R[4]||(R[4]=O=>o("close"))},{default:Ee(()=>[Ge(B(C(n)("workspace.cancel")),1)]),_:1})]),w("div",Xge,B(C(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),nve=ut(tve,[["__scopeId","data-v-ad529757"]]),sve={key:0,class:"confirm-dialog__message"},ove=qe({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=Q(null);function s(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const o=e,i=t,{t:r}=Et();function l(){i("update:open",!1),i("cancel")}function a(c){if(c.key!=="Enter"||!o.open||o.loading)return;const u=c.target;u instanceof HTMLButtonElement||u instanceof HTMLAnchorElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement||u instanceof HTMLInputElement||(c.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",a),es(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(b(),ye(Sr,{open:e.open,title:e.title,height:"auto","initial-focus":s,"onUpdate:open":u[1]||(u[1]=d=>i("update:open",d)),onClose:l},{foot:Ee(()=>[ie(Ft,{variant:"secondary",disabled:e.loading,onClick:l},{default:Ee(()=>[Ge(B(e.cancelLabel??C(r)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Ft,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:Ee(()=>[Ge(B(e.confirmLabel??C(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(b(),I("p",sve,B(e.message),1)):le("",!0)]),_:1},8,["open","title"]))}}),ive=ut(ove,[["__scopeId","data-v-76e206e7"]]),rve=qe({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=kl();return(s,o)=>(b(),ye(ive,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,onConfirm:o[0]||(o[0]=i=>C(n)(!0)),onCancel:o[1]||(o[1]=i=>C(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),lve={class:"rows"},ave={class:"row"},cve={class:"row"},uve={class:"row"},dve={class:"row"},fve={class:"row"},hve={class:"row"},pve={class:"ctx-text"},mve={key:0,class:"bar"},gve={class:"row"},vve=qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=Q(!0),r=P(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=P(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const c=P(()=>{const h=s.status.permission;return h==="yolo"?"var(--color-danger)":h==="auto"?"var(--color-warning)":"var(--color-text)"}),u=P(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=P(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=P(()=>typeof s.costUsd=="number"&&s.costUsd>0),p=P(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(h,m)=>(b(),ye(Sr,{open:i.value,"onUpdate:open":m[0]||(m[0]=_=>i.value=_),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=_=>o("close"))},{default:Ee(()=>[w("dl",lve,[w("div",ave,[w("dt",null,B(C(n)("status.statusModel")),1),w("dd",null,B(e.status.model),1)]),w("div",cve,[w("dt",null,B(C(n)("status.statusThinking")),1),w("dd",null,B(e.thinking),1)]),w("div",uve,[w("dt",null,B(C(n)("status.statusPermission")),1),w("dd",{style:qt({color:c.value})},B(a(e.status.permission)),5)]),w("div",dve,[w("dt",null,B(C(n)("status.statusPlanMode")),1),w("dd",{class:De({"plan-on":e.planMode})},B(u.value),3)]),w("div",fve,[w("dt",null,B(C(n)("status.statusSwarmMode")),1),w("dd",{class:De({"swarm-on":e.swarmMode})},B(d.value),3)]),w("div",hve,[w("dt",null,B(C(n)("status.statusContext")),1),w("dd",null,[w("span",pve,B(l.value),1),e.status.ctxMax>0?(b(),I("span",mve,[w("i",{style:qt({width:r.value+"%"})},null,4)])):le("",!0)])]),w("div",gve,[w("dt",null,B(C(n)("status.statusCost")),1),w("dd",null,B(p.value),1)])])]),_:1},8,["open","title"]))}}),yve=ut(vve,[["__scopeId","data-v-59dd31f3"]]),kve={class:"ui-toast__icon","aria-hidden":"true"},bve={class:"ui-toast__body"},xve={class:"ui-toast__title"},_ve={key:0,class:"ui-toast__msg"},wve=qe({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(b(),I("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[w("span",kve,[In(t.$slots,"icon",{},()=>[e.variant==="success"?(b(),ye(Ve,{key:0,name:"check"})):e.variant==="danger"?(b(),ye(Ve,{key:1,name:"close"})):e.variant==="warning"?(b(),ye(Ve,{key:2,name:"alert-triangle"})):(b(),ye(Ve,{key:3,name:"info"}))],!0)]),w("div",bve,[w("div",xve,B(e.title),1),e.message?(b(),I("div",_ve,B(e.message),1)):le("",!0),In(t.$slots,"default",{},void 0,!0)]),ie(Nn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Ee(()=>[ie(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Sve=ut(wve,[["__scopeId","data-v-adc6f346"]]),Cve={key:0,class:"actions"},Ave=["onClick"],Mve=["onClick"],Eve={key:1,class:"details"},Tve=qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Et();function i(x){return typeof x=="object"&&x!==null}function r(x){return i(x)?x.title:x}function l(x){return i(x)?x.message??"":""}function a(x){return i(x)?x.details:void 0}function c(x){return i(x)?x.severity==="error":x.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function u(x){return i(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function d(x){if(!i(x))return x;const E=[x.title];x.message&&E.push(x.message);const N=x.details??[];if(N.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const F of N)E.push(`${F.label}: ${F.value}`)}return E.join(`
322
+ `)}let f=1;const p=Q([]),h=new Map,m=new Map;function _(x){const E=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function k(x,E){const N=h.get(x)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(x),E),N.deadline=Date.now()+E,h.set(x,N)}function g(x){const E=h.get(x);E&&E.handle!==null&&clearTimeout(E.handle),h.delete(x)}function v(x){const E=h.get(x);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function y(x){if(p.value.find(F=>F.id===x)?.detailsOpen)return;const N=h.get(x);!N||N.handle!==null||k(x,N.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?v(x.id):y(x.id)}async function L(x){if(!await js(d(x.warning)))return;x.copied=!0;const N=m.get(x.id);N&&clearTimeout(N),m.set(x.id,setTimeout(()=>{x.copied=!1,m.delete(x.id)},1400))}function $(x){g(x);const E=m.get(x);E&&clearTimeout(E),m.delete(x);const N=p.value.findIndex(F=>F.id===x);N!==-1&&(p.value=p.value.filter(F=>F.id!==x),s("dismiss",N))}return Ke(()=>n.warnings,x=>{const E=[...p.value];p.value=x.map(N=>{const F=u(N),S=E.findIndex(O=>O.key===F),T=S===-1?void 0:E.splice(S,1)[0];if(T)return T.warning=N,T;const R={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return k(R.id,_(N)),R});for(const N of E){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),fn(()=>{h.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),h.clear(),m.forEach(x=>clearTimeout(x)),m.clear()}),(x,E)=>(b(),ye(f9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(b(!0),I(Be,null,nt(p.value,N=>(b(),ye(Sve,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:F=>$(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>y(N.id)},{default:Ee(()=>[a(N.warning)?.length?(b(),I("div",Cve,[w("button",{class:"link",type:"button",onClick:F=>A(N)},B(N.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,Ave),w("button",{class:"link",type:"button",onClick:F=>L(N)},B(N.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,Mve)])):le("",!0),N.detailsOpen&&a(N.warning)?.length?(b(),I("dl",Eve,[(b(!0),I(Be,null,nt(a(N.warning),F=>(b(),I("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[w("dt",null,B(F.label),1),w("dd",null,B(F.value),1)]))),128))])):le("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Nve=ut(Tve,[["__scopeId","data-v-92efeff8"]]),Ive={class:"topbar"},$ve={class:"wsq"},Lve=["aria-label"],Fve={class:"tb-path"},Ove={class:"ws"},Rve={class:"se"},Bve={class:"tb-sub"},Dve=qe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t,i=P(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=P(()=>s.workspace?.name??n("workspace.noWorkspace")),l=P(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(b(),I("div",Ive,[w("span",$ve,B(i.value),1),w("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[w("span",Fve,[w("span",Ove,B(r.value),1),e.sessionTitle?(b(),I(Be,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",Rve,B(e.sessionTitle),1)],64)):le("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",Bve,[w("span",{class:De(["rd",{on:e.running}])},null,2),w("span",null,B(l.value),1),e.branch?(b(),I(Be,{key:0},[Ge(" · "+B(e.branch),1)],64)):le("",!0),e.sessionCount>0?(b(),I(Be,{key:1},[Ge(" · "+B(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):le("",!0)])],8,Lve),ie(Nn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Ee(()=>[ie(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Pve=ut(Dve,[["__scopeId","data-v-59a11935"]]),Hve={key:0,class:"sheet-root"},Wve=["aria-label"],zve=["aria-label"],Uve={key:0,class:"sheet-head"},jve={class:"sheet-title"},qve={class:"sheet-body"},Vve=qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ke(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),fn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(b(),ye(cl,{name:"sheet"},{default:Ee(()=>[e.modelValue?(b(),I("div",Hve,[w("div",{class:"sheet-scrim",onClick:i}),w("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[w("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,zve),e.title?(b(),I("div",Uve,[w("span",jve,B(e.title),1)])):le("",!0),w("div",qve,[In(l.$slots,"default",{},void 0,!0)])],8,Wve)])):le("",!0)]),_:3}))}}),PM=ut(Vve,[["__scopeId","data-v-4441dd70"]]),Kve={class:"mlist"},Gve={key:0,class:"mempty"},Yve=["onClick"],Zve={class:"mgh-main"},Qve={class:"mgh-name"},Xve={class:"mgh-path"},Jve={key:2,class:"att"},eye={key:0,class:"mempty small"},tye=["onClick"],nye={class:"m"},sye={class:"s"},oye={key:0,class:"att"},iye=["disabled","onClick"],rye=["onClick"],lye=qe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Et(),{confirm:s}=kl(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=Q(new Set);function f(S){return d.value.has(S)}function p(S){const T=new Set(d.value);T.has(S)?T.delete(S):T.add(S),d.value=T,y.value=null,x.value=null}const h=Q(new Set);function m(S){return h.value.has(S)}function _(S){const T=new Set(h.value);T.has(S)?T.delete(S):T.add(S),h.value=T}function k(S){if(m(S.workspace.id))return S.sessions;const T=S.sessions.slice(0,S.initialCount);if(o.activeId&&!T.some(R=>R.id===o.activeId)){const R=S.sessions.find(O=>O.id===o.activeId);if(R)return[...T,R]}return T}function g(S){if(!h.value.has(S)){const T=new Set(h.value);T.add(S),h.value=T}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=Q(null);function A(S){y.value=y.value===S?null:S,x.value=null}function L(S){y.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();R&&i("rename",S.id,R)}async function $(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const x=Q(null);function E(S){x.value=x.value===S?null:S,y.value=null}function N(S){js(S.root),x.value=null}async function F(S){x.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,T)=>(b(),ye(PM,{"model-value":e.modelValue,"onUpdate:modelValue":T[2]||(T[2]=R=>i("update:modelValue",R))},{default:Ee(()=>[w("button",{type:"button",class:"newrow",onClick:c},[ie(Ve,{name:"message",size:"sm"}),Ge(" "+B(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:u},[ie(Ve,{name:"folder",size:"sm"}),Ge(" "+B(C(n)("sidebar.newWorkspace")),1)]),w("div",Kve,[e.groups.length===0?(b(),I("div",Gve,B(C(n)("workspace.noWorkspace")),1)):le("",!0),(b(!0),I(Be,null,nt(e.groups,R=>(b(),I("div",{key:R.workspace.id,class:"mgroup"},[w("div",{class:De(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:O=>p(R.workspace.id)},[f(R.workspace.id)?(b(),ye(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(b(),ye(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",Zve,[w("span",Qve,B(R.workspace.name),1),ie(jt,{text:R.workspace.root},{default:Ee(()=>[w("span",Xve,B(R.workspace.branch||R.workspace.shortPath),1)]),_:2},1032,["text"])]),f(R.workspace.id)&&v(R.workspace.id)>0?(b(),I("span",Jve,B(v(R.workspace.id)),1)):le("",!0),ie(Nn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(O=>E(R.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Nn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(O=>a(R.workspace.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),x.value===R.workspace.id?(b(),ye(Jl,{key:3,class:"kmenu wsmenu",onClick:T[0]||(T[0]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{size:"lg",onClick:O=>N(R.workspace)},{default:Ee(()=>[Ge(B(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(Mn,{size:"lg",danger:"",onClick:O=>F(R.workspace)},{default:Ee(()=>[Ge(B(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,Yve),Tn(w("div",null,[R.sessions.length===0?(b(),I("div",eye,B(C(n)("sidebar.noSessions")),1)):le("",!0),(b(!0),I(Be,null,nt(k(R),O=>(b(),I("div",{key:O.id,class:De(["srow",{cur:O.id===e.activeId}]),onClick:D=>l(O.id)},[w("div",nye,[w("div",{class:De(["t",{run:O.busy,aborted:O.status==="aborted"}])},B(O.title),3),w("div",sye,B(O.time),1)]),(e.attentionBySession[O.id]??0)>0?(b(),I("span",oye,B(e.attentionBySession[O.id]),1)):le("",!0),ie(Nn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(D=>A(O.id),["stop"])},{default:Ee(()=>[ie(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===O.id?(b(),ye(Jl,{key:1,class:"kmenu",onClick:T[1]||(T[1]=bt(()=>{},["stop"]))},{default:Ee(()=>[ie(Mn,{size:"lg",onClick:D=>L(O)},{default:Ee(()=>[Ge(B(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(Mn,{size:"lg",danger:"",onClick:D=>$(O.id)},{default:Ee(()=>[Ge(B(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,tye))),128)),R.hasMore||R.loadingMore?(b(),I("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:bt(O=>g(R.workspace.id),["stop"])},B(R.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,iye)):le("",!0),R.sessions.length>R.initialCount?(b(),I("button",{key:2,type:"button",class:"mshow-more",onClick:bt(O=>_(R.workspace.id),["stop"])},B(m(R.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,rye)):le("",!0)],512),[[oi,!f(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),aye=ut(lye,[["__scopeId","data-v-7ca5a6a0"]]),cye={class:"group-title"},uye={class:"srow-main"},dye={class:"srow-label"},fye={class:"srow-sub"},hye={class:"srow read-only"},pye={class:"srow-main"},mye={class:"srow-label"},gye={key:0,class:"srow-sub"},vye={class:"srow-main"},yye={class:"srow-label"},kye={class:"srow-sub"},bye=["aria-checked"],xye={class:"srow-main"},_ye={class:"srow-label"},wye={class:"srow-sub"},Sye=["aria-checked"],Cye={class:"srow-main"},Aye={class:"srow-label"},Mye={class:"srow read-only"},Eye={class:"srow-main"},Tye={class:"srow-label"},Nye={class:"srow-sub"},Iye=["aria-label"],$ye={class:"group-title"},Lye={class:"srow-main"},Fye={class:"srow-label"},Oye={class:"srow-sub"},Rye={class:"srow read-only pref"},Bye={class:"srow-main"},Dye={class:"srow-label"},Pye={class:"srow read-only pref"},Hye={class:"srow-main"},Wye={class:"srow-label"},zye={class:"srow read-only pref"},Uye={class:"srow-main"},jye={class:"srow-label"},qye={class:"num-field"},Vye=["value","aria-label"],Kye={class:"srow-main"},Gye={class:"srow-label"},Yye={class:"srow-sub"},Zye=["aria-checked"],Qye={class:"srow-main"},Xye={class:"srow-label"},Jye={class:"srow-main"},eke={class:"srow-label"},tke={key:2,class:"srow read-only"},nke={class:"srow-main"},ske={class:"srow-label"},oke={class:"srow-val dim"},ike={class:"arch-subhead"},rke={class:"arch-count"},lke={class:"arch-tools"},ake={key:0,class:"arch-empty"},cke={class:"arch-meta"},uke={class:"arch-name"},dke={class:"arch-time"},fke={key:2,class:"arch-empty"},hke=100,pke=qe({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Et(),s=e,o=t;function i(ae){o("setColorScheme",ae)}const r=["manual","auto","yolo"],l=P(()=>{const ae=s.status?.modelId??s.status?.model??"";return s.models?.find(te=>te.id===ae||te.model===ae||te.displayName===s.status?.model)}),a=P(()=>Nd(l.value)),c=P(()=>nk(l.value)),u=P(()=>aa(l.value,s.thinking??"off")),d=P(()=>{const ae=c.value,te=u.value;return ae.includes(te)?te:ae.includes("on")?"on":ae[0]??"off"}),f=P(()=>c.value.map(ae=>({value:ae,label:mv(ae)}))),p=P(()=>s.planMode===!0),h=P(()=>s.swarmMode===!0),m=P(()=>{const ae=s.status.permission;return ae==="yolo"?"var(--color-danger)":ae==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),_=P(()=>{const ae=s.status.permission,te=n(ae==="yolo"?"mobile.permYoloSub":ae==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ae} · ${te}`}),k=ae=>`${Math.round(ae/1e3)}k`,g=P(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),v=P(()=>s.status.ctxMax>0?`${k(s.status.ctxUsed)}/${k(s.status.ctxMax)}`:n("status.statusNone"));function y(ae){o("setThinking",sk(l.value,ae))}function A(){const ae=r.indexOf(s.status.permission),te=r[(ae+1)%r.length];o("setPermission",te)}function L(){o("pickModel"),o("update:modelValue",!1)}function $(){o("login"),o("update:modelValue",!1)}function x(){o("logout"),o("update:modelValue",!1)}const E=Ek(),N=Q("main"),F=Q([]),S=Q(!1),T=Q(!1),R=Q(""),O=Q("archived-desc");async function D(){if(!S.value){S.value=!0,T.value=!1;try{const ae=[];let te;for(;;){const Z=await E.loadArchivedSessions({beforeId:te,pageSize:hke});if(ae.push(...Z.items),!Z.hasMore||Z.items.length===0)break;const ne=Z.items.at(-1)?.id;if(ne===void 0)break;te=ne}F.value=ae,T.value=!0}catch(ae){console.warn("loadAllArchived failed",ae)}finally{S.value=!1}}}function W(){N.value="archived",R.value="",D()}function z(){N.value="main"}const V=P(()=>{const ae=R.value.trim().toLowerCase();let te=F.value.filter(Z=>Z.archived===!0);return ae&&(te=te.filter(Z=>Z.title.toLowerCase().includes(ae))),te=te.slice(),O.value==="archived-desc"?te.sort((Z,ne)=>ne.updatedAt.localeCompare(Z.updatedAt)):O.value==="created-desc"?te.sort((Z,ne)=>ne.createdAt.localeCompare(Z.createdAt)):te.sort((Z,ne)=>Z.title.localeCompare(ne.title,"zh")),te});async function U(ae){await E.restoreSession(ae)&&(F.value=F.value.filter(Z=>Z.id!==ae))}function re(ae){const te=new Date(ae);if(Number.isNaN(te.getTime()))return ae;const Z=ne=>String(ne).padStart(2,"0");return`${te.getFullYear()}-${Z(te.getMonth()+1)}-${Z(te.getDate())} ${Z(te.getHours())}:${Z(te.getMinutes())}`}return Ke(()=>s.modelValue,ae=>{ae||(N.value="main")}),(ae,te)=>(b(),ye(PM,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":te[6]||(te[6]=Z=>o("update:modelValue",Z))},{default:Ee(()=>[N.value==="main"?(b(),I(Be,{key:0},[w("div",cye,B(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",uye,[w("span",dye,B(C(n)("status.statusModel")),1),w("span",fye,B(e.status.model),1)]),te[7]||(te[7]=w("span",{class:"chev"},"›",-1))]),w("div",hye,[w("span",pye,[w("span",mye,B(C(n)("status.statusThinking")),1),a.value==="unsupported"?(b(),I("span",gye,B(C(n)("status.modeNotSupported")),1)):le("",!0)]),c.value.length>1?(b(),ye(to,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(b(),I("span",{key:1,class:De(["srow-val",{dim:d.value==="off"}])},B(d.value==="off"?C(n)("status.planOff"):C(mv)(d.value)),3))]),w("button",{type:"button",class:"srow",onClick:te[0]||(te[0]=Z=>o("togglePlan"))},[w("span",vye,[w("span",yye,B(C(n)("status.statusPlanMode")),1),w("span",kye,B(C(n)("mobile.planModeSub")),1)]),w("span",{class:De(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,bye)]),w("button",{type:"button",class:"srow",onClick:te[1]||(te[1]=Z=>o("toggleSwarm"))},[w("span",xye,[w("span",_ye,B(C(n)("status.statusSwarmMode")),1),w("span",wye,B(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:De(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,Sye)]),w("button",{type:"button",class:"srow",onClick:A},[w("span",Cye,[w("span",Aye,B(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:qt({color:m.value})},B(_.value),5)]),te[8]||(te[8]=w("span",{class:"chev"},"›",-1))]),w("div",Mye,[w("span",Eye,[w("span",Tye,B(C(n)("status.statusContext")),1),w("span",Nye,B(v.value),1)]),w("span",{class:"ctx-meter","aria-label":v.value},[w("i",{style:qt({width:g.value+"%"})},null,4)],8,Iye)]),w("div",$ye,B(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:W},[w("span",Lye,[w("span",Fye,B(C(n)("mobile.archivedSessions")),1),w("span",Oye,B(C(n)("mobile.archivedSessionsSub")),1)]),te[9]||(te[9]=w("span",{class:"chev"},"›",-1))]),w("div",Rye,[w("span",Bye,[w("span",Dye,B(C(n)("theme.colorSchemeLabel")),1)]),ie(to,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),w("div",Pye,[w("span",Hye,[w("span",Wye,B(C(n)("sidebar.language")),1)]),ie(DM)]),w("div",zye,[w("span",Uye,[w("span",jye,B(C(n)("settings.uiFontSize")),1)]),w("label",qye,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:te[2]||(te[2]=Z=>o("setUiFontSize",Number(Z.target.value)))},null,40,Vye),te[10]||(te[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:te[3]||(te[3]=Z=>o("setConversationToc",!e.conversationToc))},[w("span",Kye,[w("span",Gye,B(C(n)("settings.conversationToc")),1),w("span",Yye,B(C(n)("settings.conversationTocHint")),1)]),w("span",{class:De(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Zye)]),e.authReady?(b(),I("button",{key:0,type:"button",class:"srow acct out",onClick:x},[w("span",Qye,[w("span",Xye,B(C(n)("sidebar.signOut")),1)])])):(b(),I("button",{key:1,type:"button",class:"srow acct in",onClick:$},[w("span",Jye,[w("span",eke,B(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(b(),I("div",tke,[w("span",nke,[w("span",ske,B(C(n)("settings.serverVersion")),1)]),w("span",oke,B(e.serverVersion),1)])):le("",!0)],64)):(b(),I(Be,{key:1},[w("div",ike,[w("button",{type:"button",class:"arch-back",onClick:z},[te[11]||(te[11]=w("span",{class:"chev back"},"‹",-1)),Ge(" "+B(C(n)("mobile.archivedBack")),1)]),w("span",rke,B(C(n)("mobile.sessionCount",{n:V.value.length})),1)]),w("div",lke,[ie(sa,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":te[4]||(te[4]=Z=>R.value=Z)},null,8,["model-value","placeholder"]),ie(to,{size:"sm","model-value":O.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":te[5]||(te[5]=Z=>O.value=Z)},null,8,["model-value","options"])]),S.value?(b(),I("div",ake,B(C(n)("settings.archivedLoadingAll")),1)):V.value.length>0?(b(!0),I(Be,{key:1},nt(V.value,Z=>(b(),I("div",{key:Z.id,class:"arch-row"},[w("div",cke,[w("div",uke,B(Z.title),1),w("div",dke,B(C(n)("settings.archivedAt",{time:re(Z.updatedAt)})),1)]),ie(Ft,{variant:"secondary",size:"sm",onClick:ne=>U(Z.id)},{default:Ee(()=>[Ge(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(b(),I("div",fke,B(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),mke=ut(pke,[["__scopeId","data-v-eeaf31bb"]]),gke={class:"ob-brand"},vke={class:"ob-brand-text"},yke={class:"ob-title"},kke={class:"ob-sub"},bke={class:"ob-sec"},xke={class:"ob-label"},_ke={class:"ob-sec"},wke={class:"ob-label"},Ske={class:"ob-sec"},Cke={class:"ob-label"},Ake=qe({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Et(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=X5();function c(d){o.value!==d&&V3(d)}function u(){n("complete")}return(d,f)=>(b(),ye(Sr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=p=>n("skip"))},{head:Ee(()=>[w("div",gke,[f[4]||(f[4]=w("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[w("defs",null,[w("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[w("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),w("g",{class:"ob-eyes",fill:"#000"},[w("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),w("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),w("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),w("div",vke,[w("div",yke,B(C(s)("onboarding.title")),1),w("div",kke,B(C(s)("onboarding.subtitle")),1)])])]),default:Ee(()=>[w("section",bke,[w("div",xke,B(C(s)("onboarding.languageLabel")),1),ie(to,{"model-value":C(o),options:C(q3).map(p=>({value:p.code,label:p.label})),"onUpdate:modelValue":f[0]||(f[0]=p=>c(p))},null,8,["model-value","options"])]),w("section",_ke,[w("div",wke,B(C(s)("theme.colorSchemeLabel")),1),ie(to,{"model-value":C(i),options:[{value:"light",label:C(s)("theme.light")},{value:"dark",label:C(s)("theme.dark")},{value:"system",label:C(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=p=>C(l)(p))},null,8,["model-value","options"])]),w("section",Ske,[w("div",Cke,B(C(s)("theme.accentLabel")),1),ie(to,{"model-value":C(r),options:[{value:"blue",label:C(s)("theme.accentBlue")},{value:"mono",label:C(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=p=>C(a)(p))},null,8,["model-value","options"])]),ie(Ft,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Ge(B(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),Mke=ut(Ake,[["__scopeId","data-v-fbdd3eab"]]),Eke=["aria-label"],Tke={class:"gload-box"},Nke={class:"gload-text"},Ike=qe({__name:"GlobalLoading",setup(e){const{t}=Et();return(n,s)=>(b(),I("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",Tke,[s[0]||(s[0]=Hv('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-8d6a5c44></path></svg>',1)),ie(wo,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",Nke,B(C(t)("app.connecting")),1)])],8,Eke))}}),$ke=ut(Ike,[["__scopeId","data-v-8d6a5c44"]]),Lke={class:"kap-root"},Fke={class:"kap-head"},Oke={class:"kap-count"},Rke={class:"kap-head-actions"},Bke={class:"kap-filters"},Dke=["value"],Pke={class:"kap-check"},Hke={class:"kap-check"},Wke={class:"kap-view-toggle",role:"group"},zke={key:0,class:"kap-empty"},Uke=["onClick"],jke={class:"kap-ts"},qke={class:"kap-label"},Vke={key:0,class:"kap-detail"},Kke={class:"kap-detail-actions"},Gke=["onClick"],Yke={key:1,class:"kap-agg"},Zke={class:"mono"},Qke={class:"mono"},Xke={class:"num"},Jke={class:"num"},e2e={key:0},t2e={class:"mono"},n2e={class:"num"},s2e={class:"num"},o2e={key:0},i2e=qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=Q("all"),o=Q(""),i=Q(""),r=Q(!1),l=Q("timeline"),a=P(()=>(Jy.value,[...jne()])),c=P(()=>{const E=new Set;for(const N of a.value)N.sessionId&&E.add(N.sessionId);return[...E].sort()});function u(E){return E.kind==="rest:error"||E.code!==void 0&&E.code!==0||E.eventType==="error"||E.eventType==="parse-error"}const d=P(()=>{const E=o.value.trim().toLowerCase();return a.value.filter(N=>!(s.value!=="all"&&N.source!==s.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||E&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes(E)))}),f=P(()=>{const E=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,T=E.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};T.count++,N.seq!==void 0&&(T.lastSeq=N.seq),E.set(S,T)}return[...E.values()].sort((N,F)=>F.count-N.count)}),p=P(()=>{const E=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),E.set(F,S)}return[...E.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),h=Q(null),m=Q(!0),_=Q(null),k=Q(null);Ke(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await pt();const E=_.value;E&&(E.scrollTop=E.scrollHeight)});function g(E){h.value=h.value===E?null:E}function v(E){const N=new Date(E),F=(S,T=2)=>String(S).padStart(T,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function y(E){return JSON.stringify(E,null,2)}async function A(E){await js(y(E))&&(k.value=E.id,setTimeout(()=>{k.value===E.id&&(k.value=null)},1500))}function L(){D5(d.value)}function $(E){return u(E)||E.source==="client"?"b-err":E.source==="rest"?"b-rest":E.kind==="ws:lifecycle"?"b-life":E.kind==="ws:out"?"b-out":"b-in"}function x(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,N)=>(b(),I("section",Lke,[w("header",Fke,[N[11]||(N[11]=w("strong",null,"KAP debug",-1)),w("span",Oke,B(d.value.length)+"/"+B(a.value.length),1),w("div",Rke,[w("button",{type:"button",class:De({on:C(bu)}),onClick:N[0]||(N[0]=F=>bu.value=!C(bu))},B(C(bu)?"resume":"pause"),3),w("button",{type:"button",onClick:N[1]||(N[1]=F=>C(qne)())},"clear"),w("button",{type:"button",onClick:N[2]||(N[2]=F=>L())},"export jsonl"),ie(jt,{text:"Close window"},{default:Ee(()=>[w("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",Bke,[Tn(w("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>s.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[w("option",{value:"all"},"rest + ws + app",-1),w("option",{value:"rest"},"rest",-1),w("option",{value:"ws"},"ws",-1),w("option",{value:"client"},"app errors",-1)])],512),[[ug,s.value]]),Tn(w("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=w("option",{value:""},"all sessions",-1)),(b(!0),I(Be,null,nt(c.value,F=>(b(),I("option",{key:F,value:F},B(F),9,Dke))),128))],512),[[ug,i.value]]),Tn(w("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ao,o.value]]),w("label",Pke,[Tn(w("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[wh,r.value]]),N[14]||(N[14]=Ge(" errors",-1))]),w("label",Hke,[Tn(w("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[wh,m.value]]),N[15]||(N[15]=Ge(" follow",-1))]),w("div",Wke,[w("button",{type:"button",class:De({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:De({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(b(),I("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(b(),I("div",zke," No trace entries yet. REST calls and WS frames will appear here. ")):le("",!0),(b(!0),I(Be,null,nt(d.value,F=>(b(),I("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:De(["kap-row",{expanded:h.value===F.id}]),onClick:S=>g(F.id)},[w("span",jke,B(v(F.ts)),1),w("span",{class:De(["kap-badge",$(F)])},B(x(F)),3),w("span",qke,B(F.label),1)],10,Uke),h.value===F.id?(b(),I("div",Vke,[w("div",Kke,[w("button",{type:"button",onClick:S=>A(F)},B(k.value===F.id?"copied ✓":"copy json"),9,Gke)]),w("pre",null,B(y(F)),1)])):le("",!0)]))),128))],512)):(b(),I("div",Yke,[N[20]||(N[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[N[17]||(N[17]=w("thead",null,[w("tr",null,[w("th",null,"dir"),w("th",null,"type"),w("th",null,"session"),w("th",null,"count"),w("th",null,"last seq")])],-1)),w("tbody",null,[(b(!0),I(Be,null,nt(f.value,F=>(b(),I("tr",{key:F.key},[w("td",null,B(F.dir),1),w("td",Zke,B(F.eventType),1),w("td",Qke,B(F.sessionId),1),w("td",Xke,B(F.count),1),w("td",Jke,B(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(b(),I("tr",e2e,[...N[16]||(N[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):le("",!0)])]),N[21]||(N[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[N[19]||(N[19]=w("thead",null,[w("tr",null,[w("th",null,"endpoint"),w("th",null,"count"),w("th",null,"errors"),w("th",null,"avg ms")])],-1)),w("tbody",null,[(b(!0),I(Be,null,nt(p.value,F=>(b(),I("tr",{key:F.key},[w("td",t2e,B(F.key),1),w("td",n2e,B(F.count),1),w("td",{class:De(["num",{err:F.errors>0}])},B(F.errors),3),w("td",s2e,B(F.avgMs),1)]))),128)),p.value.length===0?(b(),I("tr",o2e,[...N[18]||(N[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):le("",!0)])])]))]))}}),r2e=ut(i2e,[["__scopeId","data-v-3cda6fe3"]]),l2e=qe({__name:"DebugPanel",setup(e){const t=Q(!1);let n=null,s=null,o=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const p of i){const h=d.getAttribute(p);h!==null?f.setAttribute(p,h):f.removeAttribute(p)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=Sh(r2e,{onClose:()=>u.close()});f.mount(d),s=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return ln(()=>{c()}),es(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(b(),ye(jt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),a2e=ut(l2e,[["__scopeId","data-v-21346738"]]);function c2e({client:e,authLogoRef:t}){const n=P(()=>e.authReady.value),s=P(()=>e.initialized.value&&!n.value),o="/login",i=Q(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ke(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return fn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function u2e({running:e,showAuthGate:t}){const{t:n}=Et(),s=["◐","◓","◑","◒"],o=Q(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ke(e,c=>{c?r():l()},{immediate:!0});const a=P(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});EE(()=>{typeof document<"u"&&(document.title=a.value)}),fn(()=>{l()})}const HM=Q(typeof window>"u"?0:window.innerWidth);let Bf=0,up=!1;function kv(){HM.value=window.innerWidth}function d2e(){up||typeof window>"u"||(window.addEventListener("resize",kv),up=!0,kv())}function f2e(){!up||typeof window>"u"||(window.removeEventListener("resize",kv),up=!1)}function WM(e,t,n){return Math.max(t,e-n)}function bv(e,t,n){return Math.min(n,Math.max(t,e))}function zM(){return ln(()=>{Bf+=1,d2e()}),es(()=>{Bf=Math.max(0,Bf-1),Bf===0&&f2e()}),{viewportWidth:HM}}const h2e="kimi-web.file-preview-width",Xa=320;function p2e({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=zM(),i=P(()=>Math.max(0,o.value-t.value)),r=P(()=>WM(i.value,Xa,Xa));function l(fe){return bv(Math.round(fe),Xa,r.value)}function a(){return l(i.value/2)}const c=P(()=>a()),u=Q(c.value),d=P(()=>bv(u.value,Xa,r.value)),f=Q(null),p=P(()=>{const fe=f.value;if(!fe)return null;const se=e.turns.value.find(ge=>ge.id===fe.turnId)?.blocks?.[fe.blockIndex];return se?.kind==="thinking"?se.thinking:null}),h=P(()=>p.value!==null);function m(fe){const j=f.value;if(j&&j.turnId===fe.turnId&&j.blockIndex===fe.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=fe}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=Q(null),g=P(()=>{const fe=k.value;if(!fe)return null;const j=e.turns.value.find(se=>se.id===fe.turnId);return j?.role==="compaction"&&j.text?j.text:null}),v=P(()=>g.value!==null);function y(fe){if(k.value?.turnId===fe.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=fe}function A(){k.value=null,n.value==="compaction"&&(n.value=null)}const L=Q(null);function $(fe){const j=e.activeAppTasks.value,se=j.find(ue=>ue.id===fe)??j.find(ue=>ue.parentToolCallId===fe);if(se)return se.id;const ge=j.filter(ue=>ue.kind==="subagent"&&!ue.parentToolCallId);if(ge.length===1)return ge[0].id}const x=P(()=>{const fe=L.value;if(!fe)return null;const j=e.activeAppTasks.value.find(se=>se.id===fe.subagentId);return j?Jhe(j):null}),E=P(()=>x.value!==null);function N(fe){const j=$(fe);if(j){if(L.value?.subagentId===j){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:j},n.value="agent"}}function F(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Q(null),T=P(()=>{const fe=S.value;if(!fe)return null;const j=jH(e.turns.value,fe);return j?{id:fe,title:pa(j.name),path:UH(j.arg),lines:j.status==="error"?null:Y3(j),output:j.output}:null}),R=P(()=>T.value!==null);function O(fe){if(n.value==="toolDiff"&&S.value===fe){D();return}n.value="toolDiff",S.value=fe}function D(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const W=Q("list"),z=Q(null);function V(){if(n.value==="diff"){U();return}n.value="diff",W.value="list",z.value=null,e.loadGitStatus(e.activeSessionId.value)}function U(){n.value==="diff"&&(n.value=null),W.value="list",z.value=null,e.clearFileDiff()}async function re(fe){W.value="detail",z.value=fe,await e.loadFileDiff(fe)}async function ae(fe){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,fe):await e.openSideChat(fe),n.value="btw"}function te(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function Z(){n.value==="btw"&&(n.value=null)}const ne=P(()=>e.sideChatVisible.value),ke=P(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||ne.value)),Se=Q(!1),Ye=Q({});function ve(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function Y(fe){if(fe)switch(fe.kind){case"thinking":f.value={turnId:fe.turnId,blockIndex:fe.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:fe.turnId},n.value="compaction";break;case"agent":L.value={subagentId:fe.subagentId},n.value="agent";break;case"toolDiff":S.value=fe.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ce(){return n.value==="thinking"&&h.value?(_(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&R.value?(D(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(U(),!0):n.value==="btw"?(te(),!0):!1}return Ke(e.activeSessionId,(fe,j)=>{if(j){const se=ve();se?Ye.value[j]=se:delete Ye.value[j]}s(),_(),A(),F(),D(),U(),Z(),fe&&Y(Ye.value[fe])}),{PREVIEW_WIDTH_KEY:h2e,PREVIEW_MIN:Xa,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:p,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:E,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:T,toolDiffVisible:R,openToolDiff:O,closeToolDiff:D,detailDiffMode:W,detailDiffPath:z,openDiffDetail:V,closeDiffDetail:U,selectDiffFile:re,btwVisible:ne,openSideChatTab:ae,closeSideChat:te,hideSideChatPanel:Z,sidePanelVisible:ke,panelDragging:Se,closeOpenSidePanel:ce}}const m2e=$t.sidebarWidth,SC=$t.sidebarCollapsed,CC=270,V0=170,g2e=480,v2e=320;function y2e(e={}){const{viewportWidth:t}=zM(),n=Q(CC),s=Q(!1),o=Q(!1),i=P(()=>{const u=v2e+(YC(e.previewOpen)?Xa:0);return Math.min(g2e,WM(t.value,V0,u))}),r=P(()=>bv(n.value,V0,i.value));function l(){try{s.value=Qn(SC)==="true"}catch{s.value=!1}}function a(){try{ts(SC,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:m2e,SIDEBAR_DEFAULT:CC,SIDEBAR_MIN:V0,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function k2e({client:e,detailTarget:t}){const{t:n}=Et(),s=Q(null),o=Q(null),i=Q(!1),r=Q(null),l=Q(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=P(()=>{const $=l.value;return $?e.getFileDownloadUrl($):null}),f=P(()=>s.value!==null);function p($){return $.length>1?$.replace(/\/+$/,""):$}function h($){const x=[];for(const E of $.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){x.pop();continue}x.push(E)}return x.join("/")}function m($){const x=$.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(e.status.value.cwd);if(x.startsWith("/")){if(!E||x!==E&&!x.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===E?"":x.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=h(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=h(x);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function _($){const x=s.value;if(t.value==="file"&&x&&x.path===$.path&&x.line===$.line){y();return}const E=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=$,l.value=null;const N=m($.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if(E!==a)return;F?o.value={...F,path:F.path||N.path}:o.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(F){if(E!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function k($){return/^data:([^;,]+)/i.exec($)?.[1]}function g($){if($.kind!=="image")return;const x=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const E={path:$.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:$.mimeType??k($.url)??"image/*",isBinary:!0,size:$.bytes??0};$.fileId?(i.value=!0,o.value=E,ft().getFileBlob($.fileId).then(N=>{if(x===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(N),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{x===a&&(o.value&&(o.value={...o.value,sourceUrl:$.url}),i.value=!1)})):(i.value=!1,o.value={...E,sourceUrl:$.url})}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ke(t,($,x)=>{x==="file"&&$!=="file"&&v()});function A(){const $=o.value?.path??s.value?.path;$&&e.openWorkspaceFile($,s.value?.line)}function L(){const $=o.value?.path??s.value?.path;$&&e.revealWorkspaceFile($)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:_,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:A,revealPreviewFile:L}}const b2e=640,x2e=`(max-width: ${b2e}px)`;function _2e(){const e=Q(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(x2e);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),fn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),fn(()=>t.removeListener(n))),e}const w2e={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},S2e={class:"server-auth-card"},C2e={class:"server-auth-body"},A2e={class:"server-auth-foot"},M2e=qe({__name:"ServerAuthDialog",setup(e){const t=Q(""),n=Q(null),s=Q(!1);ln(()=>{pt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,H5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(b(),I("div",w2e,[w("div",S2e,[l[1]||(l[1]=w("div",{class:"server-auth-head"},[w("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),w("p",{class:"server-auth-hint"},[Ge(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),Ge("). ")])],-1)),w("div",C2e,[ie(sa,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:s.value,onKeydown:i},null,8,["modelValue","disabled"])]),w("div",A2e,[ie(Ft,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Ee(()=>[Ge(B(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),E2e=ut(M2e,[["__scopeId","data-v-82150ea4"]]),T2e=["aria-label"],N2e=qe({__name:"InternalBuildBanner",setup(e){const{t}=Et(),n=TR;return(s,o)=>C(n)?(b(),I("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=w("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[w("path",{d:"M8 2 14 13H2L8 2Z"}),w("path",{d:"M8 6v3.5"}),w("path",{d:"M8 11.5h.01"})],-1)),w("span",null,B(C(t)("app.internalBuildBanner")),1)],8,T2e)):le("",!0)}}),I2e=ut(N2e,[["__scopeId","data-v-166b3735"]]),$2e={class:"app-shell"},L2e={key:1,class:"auth-page"},F2e={class:"auth-page-inner"},O2e={class:"auth-page-copy"},R2e=["aria-label","aria-hidden"],B2e=qe({__name:"App",setup(e){const t=tse(),n=Q(!t);let s=null;const o=Ek(),i=P(()=>!o.dangerousBypassAuth.value&&n.value);An("resolveImage",o.resolveImageUrl),An("resolveSwarmMembers",rt=>o.swarmMembersByToolCallId.value.get(rt)??[]);const{t:r}=Et(),l=Ai(),a=_2e(),c=Q(!1),u=Q(!1),d=P(()=>{const rt=o.activeSessionId.value;return o.sessions.value.find(xe=>xe.id===rt)?.title??""}),f=P(()=>o.visibleWorkspace.value?.sessionCount??0),p=P(()=>o.activity.value!=="idle"),h=Q(null),{showAuthGate:m,blinkAuthLogo:_}=c2e({client:o,authLogoRef:h});u2e({running:p,showAuthGate:m});function k(rt){const xe=o.status.value.modelId??o.status.value.model??"",Le=o.models.value.find(lt=>lt.id===xe||lt.model===xe||lt.displayName===o.status.value.model),we=nk(Le),X=aa(Le,rt),me=we.indexOf(X),je=we[(me+1)%we.length]??we[0]??"off";return sk(Le,je)}const g=Q(!o.onboarded.value);function v(){o.setOnboarded(!0),g.value=!1}function y(){g.value=!0}ln(()=>{o.load(),Ye(),document.addEventListener("keydown",A,!0),s=sse(()=>{n.value=!0,o.clearDangerousBypassAuth()})}),fn(()=>{document.removeEventListener("keydown",A,!0),s!==null&&(s(),s=null)});function A(rt){rt.key==="Escape"&&(hs.value||ds()&&(rt.stopPropagation(),rt.preventDefault()))}const L=Q(null),$=Q(!1);Ke(o.activeSessionId,()=>{$.value=!0,pt(()=>{$.value=!1})});const{previewTarget:x,previewFile:E,previewLoading:N,previewError:F,previewDownloadUrl:S,previewExternalActions:T,openFilePreview:R,openMediaPreview:O,closeFilePreview:D,openPreviewInEditor:W,revealPreviewFile:z}=k2e({client:o,detailTarget:L}),V=P(()=>L.value!==null),{SIDEBAR_WIDTH_KEY:U,SIDEBAR_DEFAULT:re,SIDEBAR_MIN:ae,sidebarMax:te,sessionColWidth:Z,sidebarCollapsed:ne,sidebarDragging:ke,sideWidth:Se,loadSidebarCollapsed:Ye,toggleSidebarCollapse:ve}=y2e({previewOpen:V}),{PREVIEW_WIDTH_KEY:Y,PREVIEW_MIN:ce,previewDefaultWidth:fe,previewMax:j,previewWidth:se,previewPanelWidth:ge,thinkingPanelText:ue,thinkingVisible:pe,openThinkingPanel:q,closeThinkingPanel:J,compactionPanelText:he,compactionPanelVisible:Te,openCompactionPanel:Ie,closeCompactionPanel:Oe,agentPanelMember:de,openAgentPanel:$e,closeAgentPanel:Qe,toolDiffTarget:tt,openToolDiff:vt,closeToolDiff:wt,detailDiffMode:xt,detailDiffPath:Rt,openDiffDetail:yt,closeDiffDetail:nn,selectDiffFile:xn,btwVisible:ns,openSideChatTab:Wt,closeSideChat:_n,sidePanelVisible:gn,panelDragging:ot,closeOpenSidePanel:ds}=p2e({client:o,sideWidth:Se,detailTarget:L,closeFilePreview:D}),ys=Q(null),fs=Q(!1),Xe=Q(!1),Ze=Q(!1),Mt=Q(!1),Dt=Q(!1),zt=Q(!1),wn=Q(null),Rn=Q(null),hs=P(()=>Ka.value>0||fs.value||Xe.value||Ze.value||Mt.value||Dt.value||zt.value||g.value||c.value||u.value),ss=Q(!1),sn=Q(!1),Lt=Q(!1),Vs=Q(!1),an=Q(!1);async function So(){ss.value=!0,sn.value=!1,fs.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{sn.value=!0}finally{ss.value=!1}}async function Co(){Lt.value=!0,Vs.value=!1,Xe.value=!0;try{await o.loadProviders()}catch{Vs.value=!0}finally{Lt.value=!1}}function Rs(){Ze.value=!0}async function fi(rt){fs.value=!1,await co(rt)}async function co(rt){await o.setModel(rt)&&rt!==o.defaultModel.value&&o.updateConfig({defaultModel:rt})}async function jo(rt){await o.addProvider(rt)}async function Ot(rt){await o.deleteProvider(rt)}async function Bs(rt){await o.refreshProvider(rt)}async function qn(rt){an.value=!0;try{await o.updateConfig(rt)&&await o.checkAuth()}finally{an.value=!1}}async function Cs(){return o.startOAuthLogin()}async function On(){return o.pollOAuthLogin()}async function Hn(){return o.cancelOAuthLogin()}async function hi(){Ze.value=!1,await o.checkAuth(),await o.load()}async function Xn(rt){await o.undo(1),await pt(),ys.value?.loadComposerForEdit(rt.text,rt.images)}function qo(rt){if(rt==="/compact"||rt.startsWith("/compact ")){o.compact(rt.slice(8).trim()||void 0);return}if(rt==="/swarm"||rt.startsWith("/swarm ")){const xe=rt.slice(6).trim();xe==="on"?o.setSwarmMode(!0):xe==="off"?o.setSwarmMode(!1):xe?(o.setSwarmMode(!0),o.sendPrompt(xe)):o.toggleSwarmMode();return}if(rt==="/goal"||rt.startsWith("/goal ")){const xe=rt.slice(5).trim();xe==="pause"||xe==="resume"||xe==="cancel"?o.controlGoal(xe):xe?o.createGoal(xe):o.toggleGoalMode();return}if(rt==="/btw"||rt.startsWith("/btw ")){const xe=rt.slice(4).trim();!xe&&o.sideChatVisible.value?_n():Wt(xe||void 0);return}switch(rt){case"/new":case"/clear":Bn();break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const xe=o.permission.value,Le=xe==="manual"?"auto":xe==="auto"?"yolo":"manual";o.setPermission(Le);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(k(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":Dt.value=!0;break;case"/model":So();break;case"/provider":break;case"/login":Rs();break;default:{const xe=rt.indexOf(" "),Le=Hoe((xe===-1?rt:rt.slice(0,xe)).slice(1)),we=xe===-1?void 0:rt.slice(xe+1).trim()||void 0;if(!Le)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Le,we):o.activateSkill(Le,we);break}}}function Ks(rt){o.unqueue(rt)}function Mi(rt){o.unqueue(rt)}function Ao(rt){o.reorderQueue(rt.from,rt.to)}async function Vn(rt){const xe=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&xe){await o.startSessionAndSendPrompt(xe,rt.text,rt.attachments);return}if(!o.activeSessionId.value&&!xe){wn.value=rt,Mt.value=!0;return}o.sendPrompt(rt.text,rt.attachments)}async function Vo(rt){if(Rn.value=null,!await o.addWorkspaceByPath(rt)){Rn.value=r("workspace.addFailed");return}Mt.value=!1;const Le=wn.value;wn.value=null;const we=o.activeWorkspaceId.value;Le&&we&&await o.startSessionAndSendPrompt(we,Le.text,Le.attachments)}function ji(){wn.value=null,Rn.value=null,Mt.value=!1}function Ko(){pt(()=>{ys.value?.focusComposer()})}function Bn(){const rt=o.activeWorkspaceId.value;rt?o.openWorkspaceDraft(rt):o.clearActiveSession(),Ko()}function Kn(rt){o.openWorkspaceDraft(rt),Ko()}function Mo(rt){rt&&window.open(rt,"_blank","noopener")}return(rt,xe)=>(b(),I("div",$2e,[i.value?(b(),ye(E2e,{key:0})):le("",!0),C(m)?(b(),I("section",L2e,[w("div",F2e,[(b(),I("svg",{ref_key:"authLogoRef",ref:h,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:xe[0]||(xe[0]=bt(()=>{},["prevent"])),onClick:xe[1]||(xe[1]=(...Le)=>C(_)&&C(_)(...Le))},[...xe[96]||(xe[96]=[Hv('<defs data-v-88bcc9de><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-88bcc9de><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-88bcc9de></rect><g class="ch-eyes" fill="#000" data-v-88bcc9de><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-88bcc9de></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-88bcc9de></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-88bcc9de></rect>',2)])],544)),w("div",O2e,[w("h1",null,B(C(r)("app.authPageTitle")),1),w("p",null,B(C(r)("app.authPageMessage")),1)]),ie(Ft,{class:"auth-page-btn",variant:"primary",onClick:Rs},{default:Ee(()=>[ie(Ve,{name:"log-in",size:"md"}),w("span",null,B(C(r)("app.authPageLogin")),1)]),_:1})])])):(b(),I("div",{key:2,class:De(["app",{mobile:C(a),"sidebar-collapsed":C(ne)&&!C(a),"macos-desktop":C(pc)}]),style:qt({"--preview-w":C(ge)+"px"})},[C(a)?(b(),ye(Pve,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:p.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:xe[18]||(xe[18]=Le=>c.value=!0),onOpenSettings:xe[19]||(xe[19]=Le=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(b(),I(Be,{key:0},[ie(GR,{collapsed:C(ne),dragging:C(ke),"col-width":C(Se),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,onSelect:xe[2]||(xe[2]=Le=>C(o).selectSession(Le)),onCreate:Bn,onCreateInWorkspace:xe[3]||(xe[3]=Le=>Kn(Le)),onSelectWorkspace:xe[4]||(xe[4]=Le=>C(o).openWorkspace(Le)),onAddWorkspace:xe[5]||(xe[5]=Le=>Mt.value=!0),onRename:xe[6]||(xe[6]=(Le,we)=>C(o).renameSession(Le,we)),onArchive:xe[7]||(xe[7]=Le=>C(o).archiveSession(Le)),onFork:xe[8]||(xe[8]=Le=>C(o).forkSession(Le)),onRenameWorkspace:xe[9]||(xe[9]=(Le,we)=>C(o).renameWorkspace(Le,we)),onDeleteWorkspace:xe[10]||(xe[10]=Le=>C(o).deleteWorkspace(Le)),onReorderWorkspaces:xe[11]||(xe[11]=Le=>C(o).reorderWorkspaces(Le)),onSetWorkspaceSortMode:xe[12]||(xe[12]=Le=>C(o).setWorkspaceSortMode(Le)),onLoadMoreSessions:xe[13]||(xe[13]=Le=>void C(o).loadMoreSessions(Le)),onLoadAllSessions:xe[14]||(xe[14]=Le=>void C(o).loadAllSessions()),onOpenSettings:xe[15]||(xe[15]=Le=>zt.value=!0),onCollapse:C(ve)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),Tn(ie(Tx,{class:"side-handle","storage-key":C(U),"default-width":C(re),min:C(ae),max:C(te),"onUpdate:width":xe[16]||(xe[16]=Le=>Z.value=Le),"onUpdate:dragging":xe[17]||(xe[17]=Le=>ke.value=Le)},null,8,["storage-key","default-width","min","max"]),[[oi,!C(ne)]])],64)),ie(tce,{ref_key:"conversationPaneRef",ref:ys,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:p.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,sending:C(o).isSending.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:xe[20]||(xe[20]=Le=>C(yt)()),onSelectWorkspace:xe[21]||(xe[21]=Le=>Kn(Le)),onAddWorkspace:xe[22]||(xe[22]=Le=>Mt.value=!0),onOpenPr:Mo,onSubmit:xe[23]||(xe[23]=Le=>Vn(Le)),onSteer:xe[24]||(xe[24]=Le=>C(o).steerPrompt(Le.text,Le.attachments)),onApproval:xe[25]||(xe[25]=(Le,we)=>C(o).respondApproval(Le,we)),onCancelTask:xe[26]||(xe[26]=Le=>C(o).cancelTask(Le)),onAnswer:xe[27]||(xe[27]=(Le,we)=>C(o).respondQuestion(Le,we)),onDismiss:xe[28]||(xe[28]=Le=>C(o).dismissQuestion(Le)),onCommand:qo,onInterrupt:xe[29]||(xe[29]=Le=>C(o).abortCurrentPrompt()),onUnqueue:Ks,onEditQueued:Mi,onReorderQueue:Ao,onSetPermission:xe[30]||(xe[30]=Le=>C(o).setPermission(Le)),onSetThinking:xe[31]||(xe[31]=Le=>C(o).setThinking(Le)),onTogglePlan:xe[32]||(xe[32]=Le=>C(o).togglePlanMode()),onToggleSwarm:xe[33]||(xe[33]=Le=>C(o).toggleSwarmMode()),onToggleGoal:xe[34]||(xe[34]=Le=>C(o).toggleGoalMode()),onCreateGoal:xe[35]||(xe[35]=Le=>C(o).createGoal(Le)),onControlGoal:xe[36]||(xe[36]=Le=>C(o).controlGoal(Le)),onRefreshGitStatus:xe[37]||(xe[37]=Le=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:xe[38]||(xe[38]=(Le,we)=>C(o).renameSession(Le,we)),onForkSession:xe[39]||(xe[39]=Le=>C(o).forkSession(Le)),onArchiveSession:xe[40]||(xe[40]=Le=>C(o).archiveSession(Le)),onCompact:xe[41]||(xe[41]=Le=>C(o).compact()),onPickModel:xe[42]||(xe[42]=Le=>So()),onSelectModel:xe[43]||(xe[43]=Le=>co(Le)),onOpenFile:xe[44]||(xe[44]=Le=>C(R)(Le)),onOpenMedia:xe[45]||(xe[45]=Le=>C(O)(Le)),onOpenThinking:xe[46]||(xe[46]=Le=>C(q)(Le)),onOpenCompaction:xe[47]||(xe[47]=Le=>C(Ie)(Le)),onOpenAgent:xe[48]||(xe[48]=Le=>C($e)(Le)),onOpenToolDiff:xe[49]||(xe[49]=Le=>C(vt)(Le)),onEditMessage:Xn},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","queued","search-files","upload-image","sending","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(a)&&(C(pc)||C(ne))?(b(),ye(Nn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(ne)?C(r)("sidebar.expandSidebar"):C(r)("sidebar.collapseSidebar"),onClick:C(ve)},{default:Ee(()=>[ie(Ve,{name:C(ne)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):le("",!0),C(gn)&&!C(a)?(b(),ye(Tx,{key:3,class:"preview-handle","storage-key":C(Y),"default-width":C(fe),min:C(ce),max:C(j),reverse:"","aria-label":C(r)("layout.resizePreviewAria"),"onUpdate:width":xe[50]||(xe[50]=Le=>se.value=Le),"onUpdate:dragging":xe[51]||(xe[51]=Le=>ot.value=Le)},null,8,["storage-key","default-width","min","max","aria-label"])):le("",!0),!C(a)||C(gn)?(b(),I("aside",{key:4,class:De(["global-preview",{open:C(gn),mobile:C(a),"no-anim":C(ot)||$.value}]),role:"complementary","aria-label":C(r)("layout.detailPanelAria"),"aria-hidden":!C(gn)},[L.value==="thinking"&&C(pe)?(b(),ye(cC,{key:0,text:C(ue)??"",onClose:C(J)},null,8,["text","onClose"])):L.value==="compaction"&&C(Te)?(b(),ye(cC,{key:1,text:C(he)??"",subtitle:C(r)("conversation.summaryTitle"),onClose:C(Oe)},null,8,["text","subtitle","onClose"])):L.value==="agent"&&C(de)?(b(),ye(_ue,{key:2,member:C(de),onClose:C(Qe)},null,8,["member","onClose"])):L.value==="btw"&&C(ns)?(b(),ye(Uue,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:xe[52]||(xe[52]=Le=>C(o).sendSideChatPrompt(Le)),onClose:C(_n)},null,8,["turns","running","sending","onClose"])):L.value==="diff"?(b(),ye(vde,{key:4,mode:C(xt),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(xn),onBack:xe[53]||(xe[53]=Le=>{xt.value="list",Rt.value=null,C(o).clearFileDiff()}),onClose:C(nn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):L.value==="toolDiff"&&C(tt)?(b(),ye(Oue,{key:5,target:C(tt),onClose:C(wt)},null,8,["target","onClose"])):L.value==="file"?(b(),ye(sue,{key:6,file:C(E),loading:C(N),error:C(F),line:C(x)?.line,"download-url":C(S),closable:"","external-actions":C(T),"open-file":C(R),onClose:C(D),onOpenExternal:C(W),onReveal:C(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):le("",!0)],10,R2e)):le("",!0),ie(I2e,{class:"internal-build-fab"}),fs.value?(b(),ye(Rde,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:ss.value,unavailable:sn.value,onSelect:xe[54]||(xe[54]=Le=>fi(Le)),onToggleStar:xe[55]||(xe[55]=Le=>C(o).toggleStarModel(Le)),onClose:xe[56]||(xe[56]=Le=>fs.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):le("",!0),zt.value?(b(),ye(Tge,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":an.value,"server-version":C(o).serverVersion.value,onSetColorScheme:xe[57]||(xe[57]=Le=>C(o).setColorScheme(Le)),onSetAccent:xe[58]||(xe[58]=Le=>C(o).setAccent(Le)),onSetUiFontSize:xe[59]||(xe[59]=Le=>C(o).setUiFontSize(Le)),onSetNotify:xe[60]||(xe[60]=Le=>C(o).setNotifyOnComplete(Le)),onSetNotifyQuestion:xe[61]||(xe[61]=Le=>C(o).setNotifyOnQuestion(Le)),onSetNotifyApproval:xe[62]||(xe[62]=Le=>C(o).setNotifyOnApproval(Le)),onSetSound:xe[63]||(xe[63]=Le=>C(o).setSoundOnComplete(Le)),onSetConversationToc:xe[64]||(xe[64]=Le=>C(o).setConversationToc(Le)),onUpdateConfig:xe[65]||(xe[65]=Le=>qn(Le)),onLogin:xe[66]||(xe[66]=()=>{zt.value=!1,Rs()}),onLogout:C(o).logout,onOpenOnboarding:xe[67]||(xe[67]=()=>{zt.value=!1,y()}),onOpenProviders:xe[68]||(xe[68]=()=>{zt.value=!1,Co()}),onClose:xe[69]||(xe[69]=Le=>zt.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):le("",!0),Xe.value?(b(),ye(lfe,{key:7,providers:C(o).providers.value,loading:Lt.value,unavailable:Vs.value,onAdd:xe[70]||(xe[70]=Le=>jo(Le)),onRefresh:xe[71]||(xe[71]=Le=>Bs(Le)),onDelete:xe[72]||(xe[72]=Le=>Ot(Le)),onOpenLogin:xe[73]||(xe[73]=()=>{Xe.value=!1,Rs()}),onClose:xe[74]||(xe[74]=Le=>Xe.value=!1)},null,8,["providers","loading","unavailable"])):le("",!0),Dt.value?(b(),ye(yve,{key:8,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:xe[75]||(xe[75]=Le=>Dt.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):le("",!0),Mt.value?(b(),ye(nve,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:Rn.value,onAdd:xe[76]||(xe[76]=Le=>Vo(Le)),onClose:ji},null,8,["browse-fs","get-fs-home","default-path","error"])):le("",!0),ie(cl,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?le("",!0):(b(),ye($ke,{key:0}))]),_:1}),g.value&&!C(m)?(b(),ye(Mke,{key:10,onComplete:v,onSkip:v})):le("",!0),ie(Nve,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(b(),ye(a2e,{key:11})):le("",!0),ie(rve),C(a)?(b(),ye(aye,{key:12,modelValue:c.value,"onUpdate:modelValue":xe[77]||(xe[77]=Le=>c.value=Le),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:xe[78]||(xe[78]=Le=>C(o).selectSession(Le)),onCreate:Bn,onCreateInWorkspace:xe[79]||(xe[79]=Le=>Kn(Le)),onAddWorkspace:xe[80]||(xe[80]=Le=>Mt.value=!0),onRename:xe[81]||(xe[81]=(Le,we)=>C(o).renameSession(Le,we)),onArchive:xe[82]||(xe[82]=Le=>C(o).archiveSession(Le)),onDeleteWorkspace:xe[83]||(xe[83]=Le=>C(o).deleteWorkspace(Le)),onLoadMore:xe[84]||(xe[84]=Le=>void C(o).loadMoreSessions(Le))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):le("",!0),C(a)?(b(),ye(mke,{key:13,modelValue:u.value,"onUpdate:modelValue":xe[85]||(xe[85]=Le=>u.value=Le),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:xe[86]||(xe[86]=Le=>So()),onSetThinking:xe[87]||(xe[87]=Le=>C(o).setThinking(Le)),onTogglePlan:xe[88]||(xe[88]=Le=>C(o).togglePlanMode()),onToggleSwarm:xe[89]||(xe[89]=Le=>C(o).toggleSwarmMode()),onSetPermission:xe[90]||(xe[90]=Le=>C(o).setPermission(Le)),onSetColorScheme:xe[91]||(xe[91]=Le=>C(o).setColorScheme(Le)),onSetUiFontSize:xe[92]||(xe[92]=Le=>C(o).setUiFontSize(Le)),onSetConversationToc:xe[93]||(xe[93]=Le=>C(o).setConversationToc(Le)),onLogin:xe[94]||(xe[94]=()=>{u.value=!1,Rs()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):le("",!0)],6)),Ze.value?(b(),ye(Bfe,{key:3,"on-start-o-auth-login":Cs,"on-poll-o-auth-login":On,"on-cancel-o-auth-login":Hn,onSuccess:hi,onClose:xe[95]||(xe[95]=Le=>Ze.value=!1)})):le("",!0)]))}}),D2e=ut(B2e,[["__scopeId","data-v-88bcc9de"]]);Yne();Sh(D2e).use(yn).mount("#app");export{q8 as $,Fv as A,OE as B,rs as C,Bbe as D,$C as E,Be as F,Hv as G,Ge as H,ie as I,pE as J,abe as K,ki as L,qe as M,l9 as N,fbe as O,hbe as P,gbe as Q,rh as R,fc as S,Ap as T,pbe as U,zv as V,dbe as W,Pbe as X,mbe as Y,$be as Z,H2e as _,l4 as a,$s as a$,Os as a0,wv as a1,G2e as a2,Tv as a3,IT as a4,dn as a5,$c as a6,ebe as a7,zbe as a8,obe as a9,f4 as aA,VE as aB,XE as aC,ln as aD,QE as aE,ZE as aF,Sv as aG,YE as aH,fn as aI,Iv as aJ,kE as aK,b as aL,o9 as aM,X2e as aN,An as aO,ZC as aP,Q2e as aQ,dh as aR,Ss as aS,ah as aT,Q as aU,Abe as aV,w9 as aW,nt as aX,In as aY,eT as aZ,cbe as a_,lbe as aa,rbe as ab,ibe as ac,Ebe as ad,Ube as ae,Ut as af,BT as ag,Sp as ah,nl as ai,br as aj,Jn as ak,Mbe as al,Oo as am,al as an,mt as ao,kbe as ap,bbe as aq,pn as ar,pt as as,zT as at,De as au,P2e as av,qt as aw,qE as ax,GE as ay,es as az,Z2e as b,ZX as b$,Obe as b0,Vu as b1,vh as b2,Lbe as b3,ll as b4,uE as b5,z2e as b6,fa as b7,AE as b8,Fbe as b9,ao as bA,oi as bB,DT as bC,Nbe as bD,Ke as bE,EE as bF,tbe as bG,TE as bH,_be as bI,Ee as bJ,vbe as bK,Tn as bL,bi as bM,Tbe as bN,bt as bO,J2e as bP,hn as bQ,eo as bR,Jbe as bS,PJ as bT,l5 as bU,txe as bV,pX as bW,Hy as bX,exe as bY,Hg as bZ,lxe as b_,W2e as ba,B as bb,Df as bc,ube as bd,Xt as be,q2e as bf,j2e as bg,YC as bh,Cbe as bi,U2e as bj,C as bk,bd as bl,Wbe as bm,Dbe as bn,c9 as bo,nbe as bp,wbe as bq,ME as br,Hbe as bs,ybe as bt,sbe as bu,r4 as bv,wh as bw,y9 as bx,X4 as by,ug as bz,Ibe as c,YX as c0,By as c1,GX as c2,Zbe as c3,lX as c4,Ybe as c5,Zh as c6,Vbe as c7,KX as c8,t5 as c9,rxe as ca,Kbe as cb,cxe as cc,Vg as cd,oc as ce,jg as cf,uxe as cg,axe as ch,Xbe as ci,$o as cj,Gbe as ck,Qbe as cl,gX as cm,ixe as cn,qg as co,Ug as cp,oxe as cq,qbe as cr,sxe as cs,nxe as ct,Ve as cu,jbe as cv,ut as cw,Sbe as d,sl as e,V2e as f,cl as g,f9 as h,K2e as i,Y2e as j,ui as k,vd as l,vs as m,gp as n,xr as o,Rbe as p,P as q,Sh as r,ye as s,le as t,I as u,w as v,_T as w,xbe as x,xT as y,S9 as z};