@tianshu-ai/tianshu 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/web/dist/assets/{bundle-web-B8lu_A6P.js → bundle-web-pJFROy5N.js} +1 -1
- package/packages/web/dist/assets/{index-SRJ7BmtX.js → index-Tr4SrI1Y.js} +3 -3
- package/packages/web/dist/index.html +1 -1
- package/plugins/workforce-studio/dist/solution-tree.js +3 -1
- package/plugins/workforce-studio/dist/solution-tree.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BVBpGdXr.js","assets/rolldown-runtime-QTnfLwEv.js","assets/html-C8UlPnhE.js","assets/javascript-CUt1pgmJ.js","assets/css-DJp_X0uY.js","assets/angular-ts-BfdufMKP.js","assets/scss-DdSxiZKl.js","assets/astro-JKRPP03v.js","assets/json-qhed-kSA.js","assets/typescript-DOu2WMV5.js","assets/postcss-BXeXVLqQ.js","assets/tsx-5Eka4NBX.js","assets/blade-DA8yMPsw.js","assets/html-derivative-CY6NRz-J.js","assets/xml-DIqSwXR3.js","assets/java-CGc3VwQr.js","assets/sql-DNssxck8.js","assets/c-Wt1voDr2.js","assets/coffee-CThvmt4R.js","assets/cpp-C5WNSHb9.js","assets/regexp-Omp9DhTb.js","assets/glsl-Dv5r7kPw.js","assets/graphql-CcFwQwm0.js","assets/jsx-CY6oMTks.js","assets/haml-Bg4I2hiD.js","assets/handlebars-DnwbnL5R.js","assets/yaml-rwi0_p6S.js","assets/http-CoW620Fi.js","assets/shellscript-CLZ0U2zV.js","assets/hurl-CSSETujw.js","assets/csv-Dx-8-gkx.js","assets/jinja-CD-Z-FLd.js","assets/jison-imPNup1l.js","assets/julia-CjffhBEM.js","assets/python-gzcpVVnB.js","assets/r-Dzep-lPg.js","assets/marko-DvhNOisQ.js","assets/less-DVTAwKKz.js","assets/mdc-CazklSAj.js","assets/markdown-BYOwaDjH.js","assets/php-CBqsN0ai.js","assets/pug-C5hz5LQ7.js","assets/svelte-DOdLCIlh.js","assets/ts-tags-Ca73dJJY.js","assets/vue-Bfx0ffIq.js","assets/vue-html-BeluIYX0.js","assets/vue-vine-DGUAbOCX.js","assets/stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,i as r,n as i,o as a,r as o,s,t as c}from"./index-SRJ7BmtX.js";var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.prototype.hasOwnProperty,p=(e,t)=>{let n={};for(var r in e)l(n,r,{get:e[r],enumerable:!0});return t||l(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=d(t),a=0,o=i.length,s;a<o;a++)s=i[a],!f.call(e,s)&&s!==n&&l(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=u(t,s))||r.enumerable});return e},h=(e,t,n)=>(m(e,t,`default`),n&&m(n,t,`default`)),g=e({createOnigurumaEngine:()=>Se,getDefaultWasmLoader:()=>xe,loadWasm:()=>he,setDefaultWasmLoader:()=>be}),_=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ee(){return 2147483648}function te(){return typeof performance<`u`?performance.now():Date.now()}var ne=(e,t)=>e+(t-e%t)%t;async function re(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=ee();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,ne(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:te,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var ie=Object.defineProperty,ae=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>ae(e,typeof t==`symbol`?t:t+``,n),y=null;function oe(e){throw new _(e.UTF8ToString(e.getLastOnigError()))}var se=class e{constructor(t){v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16Value`),v(this,`utf8Value`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},b=class e{constructor(t){if(v(this,`id`,++e.LAST_ID),v(this,`_onigBinding`),v(this,`content`),v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`),v(this,`ptr`),!y)throw new _(`Must invoke loadWasm first.`);this._onigBinding=y,this.content=t;let n=new se(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=y.omalloc(1e4),e._sharedPtrInUse=!0,y.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(y)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};v(b,`LAST_ID`,0),v(b,`_sharedPtr`,0),v(b,`_sharedPtrInUse`,!1);var ce=b,le=class{constructor(e){if(v(this,`_onigBinding`),v(this,`_ptr`),!y)throw new _(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new se(e[r]);t[r]=i.createString(y),n[r]=i.utf8Length}let r=y.omalloc(4*e.length);y.HEAPU32.set(t,r/4);let i=y.omalloc(4*e.length);y.HEAPU32.set(n,i/4);let a=y.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)y.ofree(t[n]);y.ofree(i),y.ofree(r),a===0&&oe(y),this._onigBinding=y,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new ce(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function ue(e){return typeof e.instantiator==`function`}function de(e){return typeof e.default==`function`}function fe(e){return e.data!==void 0}function pe(e){return typeof Response<`u`&&e instanceof Response}function me(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var x;function he(e){if(x)return x;async function t(){y=await re(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),ue(n)?n=await n.instantiator(t):de(n)?n=await n.default(t):(fe(n)&&(n=n.data),pe(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await _e(n)(t):await ve(n)(t):me(n)||n instanceof WebAssembly.Module?n=await ge(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ge(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return x=t(),x}function ge(e){return t=>WebAssembly.instantiate(e,t)}function _e(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ve(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var ye;function be(e){ye=e}function xe(){return ye}async function Se(e){return e&&await he(e),{createScanner(e){return new le(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new ce(e)}}}var Ce=p({});h(Ce,g);var we=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>n(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>n(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>n(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>n(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>n(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>n(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>n(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>n(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>n(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>n(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>n(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>n(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>n(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>n(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>n(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>n(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>n(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>n(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>n(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>n(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>n(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>n(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>n(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>n(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>n(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>n(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>n(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>n(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>n(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>n(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>n(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>n(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>n(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>n(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>n(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>n(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>n(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>n(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>n(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>n(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>n(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>n(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>n(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>n(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>n(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>n(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>n(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>n(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>n(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>n(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>n(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>n(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),S=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Te(e){return Ee(e)}function Ee(e){return Array.isArray(e)?De(e):e instanceof RegExp?e:typeof e==`object`?Oe(e):e}function De(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ee(e[n]);return t}function Oe(e){let t={};for(let n in e)t[n]=Ee(e[n]);return t}function ke(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ae(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ae(e.substring(0,e.length-1)):e.substr(~t+1)}var je=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,C=class{static hasCaptures(e){return e===null?!1:(je.lastIndex=0,je.test(e))}static replaceCaptures(e,t,n){return e.replace(je,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Me(e,t){return e<t?-1:+(e>t)}function Ne(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Me(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Pe(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Fe(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ie=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},w=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ve(e),t)}static createFromParsedTheme(e,t){return Ue(e,t)}_cachedMatchRoot=new Ie(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Re(e.parent,t.parentScopes));return n?new Be(n.fontStyle,n.foreground,n.background):null}},Le=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Re(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!ze(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ze(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Be=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ve(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&Pe(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Pe(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new He(l,u,e,o,s,c)}}return n}var He=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},T=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(T||{});function Ue(e,t){e.sort((e,t)=>{let n=Me(e.scope,t.scope);return n!==0||(n=Ne(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new We(t),o=new Be(n,a.getId(r),a.getId(i)),s=new qe(new Ke(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new w(a,o,s)}var We=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Ge=Object.freeze([]),Ke=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Ge,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},qe=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Ke.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Ne(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ke(e,t,n,r,i))}},E=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Ye(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Je(e){return e}function Ye(e){return e}function D(e,t){let n=[],r=Ze(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Xe(i)){let e=[];do e.push(i),i=r.next();while(Xe(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Xe(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ze(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Qe(e){typeof e.dispose==`function`&&e.dispose()}var O=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},$e=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},et=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},tt=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new O(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new et;for(let n of e)nt(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof O){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function nt(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof O?k({baseGrammar:a,selfGrammar:i},r):rt(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new O(e))}function rt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];A([r],t,n)}}function k(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&A(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&A(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function A(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ke({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&A(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=lt(i);switch(a.kind){case 0:k({...t,selfGrammar:t.baseGrammar},n);break;case 1:k(t,n);break;case 2:rt(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?rt(a.ruleName,i,n):k(i,n)}else a.kind===4?n.add(new $e(a.scopeName,a.ruleName)):n.add(new O(a.scopeName));break}}}var it=class{kind=0},at=class{kind=1},ot=class{constructor(e){this.ruleName=e}kind=2},st=class{constructor(e){this.scopeName=e}kind=3},ct=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function lt(e){if(e===`$base`)return new it;if(e===`$self`)return new at;let t=e.indexOf(`#`);return t===-1?new st(e):t===0?new ot(e.substring(1)):new ct(e.substring(0,t),e.substring(t+1))}var ut=/\\(\d+)/,dt=/\\(\d+)/g,ft=-1,pt=-2;function mt(e){return e}function ht(e){return e}var j=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=C.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=C.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ae(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:C.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:C.replaceCaptures(this._contentName,e,t)}},gt=class extends j{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},_t=class extends j{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new N(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vt=class extends j{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yt=class extends j{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this._end=new N(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},M=class extends j{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new N(o,pt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new P,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},bt=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new gt(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new _t(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ke({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new vt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new M(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new yt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=lt(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof vt||e instanceof yt||e instanceof M)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},N=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=ut.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return dt.lastIndex=0,this.source.replace(dt,(e,t)=>Fe(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},P=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new xt(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new xt(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xt=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
2
|
+
import{n as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,i as r,n as i,o as a,r as o,s,t as c}from"./index-Tr4SrI1Y.js";var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.prototype.hasOwnProperty,p=(e,t)=>{let n={};for(var r in e)l(n,r,{get:e[r],enumerable:!0});return t||l(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=d(t),a=0,o=i.length,s;a<o;a++)s=i[a],!f.call(e,s)&&s!==n&&l(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=u(t,s))||r.enumerable});return e},h=(e,t,n)=>(m(e,t,`default`),n&&m(n,t,`default`)),g=e({createOnigurumaEngine:()=>Se,getDefaultWasmLoader:()=>xe,loadWasm:()=>he,setDefaultWasmLoader:()=>be}),_=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ee(){return 2147483648}function te(){return typeof performance<`u`?performance.now():Date.now()}var ne=(e,t)=>e+(t-e%t)%t;async function re(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=ee();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,ne(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:te,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var ie=Object.defineProperty,ae=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>ae(e,typeof t==`symbol`?t:t+``,n),y=null;function oe(e){throw new _(e.UTF8ToString(e.getLastOnigError()))}var se=class e{constructor(t){v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16Value`),v(this,`utf8Value`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},b=class e{constructor(t){if(v(this,`id`,++e.LAST_ID),v(this,`_onigBinding`),v(this,`content`),v(this,`utf16Length`),v(this,`utf8Length`),v(this,`utf16OffsetToUtf8`),v(this,`utf8OffsetToUtf16`),v(this,`ptr`),!y)throw new _(`Must invoke loadWasm first.`);this._onigBinding=y,this.content=t;let n=new se(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=y.omalloc(1e4),e._sharedPtrInUse=!0,y.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(y)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};v(b,`LAST_ID`,0),v(b,`_sharedPtr`,0),v(b,`_sharedPtrInUse`,!1);var ce=b,le=class{constructor(e){if(v(this,`_onigBinding`),v(this,`_ptr`),!y)throw new _(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new se(e[r]);t[r]=i.createString(y),n[r]=i.utf8Length}let r=y.omalloc(4*e.length);y.HEAPU32.set(t,r/4);let i=y.omalloc(4*e.length);y.HEAPU32.set(n,i/4);let a=y.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)y.ofree(t[n]);y.ofree(i),y.ofree(r),a===0&&oe(y),this._onigBinding=y,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new ce(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function ue(e){return typeof e.instantiator==`function`}function de(e){return typeof e.default==`function`}function fe(e){return e.data!==void 0}function pe(e){return typeof Response<`u`&&e instanceof Response}function me(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var x;function he(e){if(x)return x;async function t(){y=await re(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),ue(n)?n=await n.instantiator(t):de(n)?n=await n.default(t):(fe(n)&&(n=n.data),pe(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await _e(n)(t):await ve(n)(t):me(n)||n instanceof WebAssembly.Module?n=await ge(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ge(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return x=t(),x}function ge(e){return t=>WebAssembly.instantiate(e,t)}function _e(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ve(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var ye;function be(e){ye=e}function xe(){return ye}async function Se(e){return e&&await he(e),{createScanner(e){return new le(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new ce(e)}}}var Ce=p({});h(Ce,g);var we=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>n(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>n(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>n(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>n(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>n(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>n(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>n(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>n(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>n(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>n(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>n(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>n(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>n(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>n(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>n(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>n(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>n(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>n(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>n(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>n(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>n(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>n(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>n(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>n(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>n(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>n(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>n(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>n(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>n(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>n(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>n(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>n(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>n(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>n(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>n(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>n(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>n(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>n(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>n(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>n(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>n(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>n(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>n(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>n(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>n(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>n(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>n(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>n(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>n(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>n(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>n(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>n(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>n(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>n(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>n(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>n(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>n(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),S=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Te(e){return Ee(e)}function Ee(e){return Array.isArray(e)?De(e):e instanceof RegExp?e:typeof e==`object`?Oe(e):e}function De(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ee(e[n]);return t}function Oe(e){let t={};for(let n in e)t[n]=Ee(e[n]);return t}function ke(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ae(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ae(e.substring(0,e.length-1)):e.substr(~t+1)}var je=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,C=class{static hasCaptures(e){return e===null?!1:(je.lastIndex=0,je.test(e))}static replaceCaptures(e,t,n){return e.replace(je,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Me(e,t){return e<t?-1:+(e>t)}function Ne(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Me(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Pe(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Fe(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ie=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},w=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ve(e),t)}static createFromParsedTheme(e,t){return Ue(e,t)}_cachedMatchRoot=new Ie(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Re(e.parent,t.parentScopes));return n?new Be(n.fontStyle,n.foreground,n.background):null}},Le=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Re(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!ze(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ze(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Be=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ve(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&Pe(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Pe(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new He(l,u,e,o,s,c)}}return n}var He=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},T=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(T||{});function Ue(e,t){e.sort((e,t)=>{let n=Me(e.scope,t.scope);return n!==0||(n=Ne(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new We(t),o=new Be(n,a.getId(r),a.getId(i)),s=new qe(new Ke(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new w(a,o,s)}var We=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Ge=Object.freeze([]),Ke=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Ge,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},qe=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Ke.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Ne(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ke(e,t,n,r,i))}},E=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Ye(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Je(e){return e}function Ye(e){return e}function D(e,t){let n=[],r=Ze(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Xe(i)){let e=[];do e.push(i),i=r.next();while(Xe(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Xe(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ze(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Qe(e){typeof e.dispose==`function`&&e.dispose()}var O=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},$e=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},et=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},tt=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new O(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new et;for(let n of e)nt(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof O){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function nt(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof O?k({baseGrammar:a,selfGrammar:i},r):rt(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new O(e))}function rt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];A([r],t,n)}}function k(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&A(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&A(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function A(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ke({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&A(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=lt(i);switch(a.kind){case 0:k({...t,selfGrammar:t.baseGrammar},n);break;case 1:k(t,n);break;case 2:rt(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?rt(a.ruleName,i,n):k(i,n)}else a.kind===4?n.add(new $e(a.scopeName,a.ruleName)):n.add(new O(a.scopeName));break}}}var it=class{kind=0},at=class{kind=1},ot=class{constructor(e){this.ruleName=e}kind=2},st=class{constructor(e){this.scopeName=e}kind=3},ct=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function lt(e){if(e===`$base`)return new it;if(e===`$self`)return new at;let t=e.indexOf(`#`);return t===-1?new st(e):t===0?new ot(e.substring(1)):new ct(e.substring(0,t),e.substring(t+1))}var ut=/\\(\d+)/,dt=/\\(\d+)/g,ft=-1,pt=-2;function mt(e){return e}function ht(e){return e}var j=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=C.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=C.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ae(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:C.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:C.replaceCaptures(this._contentName,e,t)}},gt=class extends j{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},_t=class extends j{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new N(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vt=class extends j{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new P,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yt=class extends j{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this._end=new N(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},M=class extends j{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new N(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new N(o,pt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new P;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new P,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},bt=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new gt(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new _t(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ke({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new vt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new M(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new yt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=lt(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof vt||e instanceof yt||e instanceof M)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},N=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=ut.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return dt.lastIndex=0,this.source.replace(dt,(e,t)=>Fe(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},P=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new xt(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new xt(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xt=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
3
3
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},St=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ct=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new St(e,8),this._embeddedLanguagesMatcher=new wt(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new St(0,0);_getBasicScopeAttributes=new Ie(e=>new St(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},wt=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Fe(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Tt=!1,Et=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Dt(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Ot(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Et(i,!0);f()}return new Et(i,!1);function f(){let o=kt(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===ft){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),F(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof yt){let r=o;F(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof M){let r=o;F(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(F(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Ot(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof M&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Nt(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==pt){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),F(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function kt(e,t,n,r,i,a){let o=At(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=jt(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function At(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Mt(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function jt(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Mt(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Mt(e,t,n,r,i){return Tt?{ruleScanner:e.compile(t,n),findOptions:Pt(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Nt(e,t,n,r,i){return Tt?{ruleScanner:e.compileWhile(t,n),findOptions:Pt(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Pt(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function F(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Dt(e,p,n&&d.start===0,d.start,f,i,!1,0),Qe(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Ft(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Ft=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function It(e,t,n,r,i,a,o,s){return new zt(e,t,n,r,i,a,o,s)}function Lt(e,t,n,r,i){let a=D(t,I),o=bt.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function I(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Rt(t[r],e))return n=r+1,!0;return!1})}function Rt(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var zt=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ct(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Bt(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=D(e,I);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Lt(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Lt(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(mt(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[ht(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Bt(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=bt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Vt.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=E.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?L.createRootAndLookUpScopeName(a,r,this):L.createRoot(`unknown`,r),t=new Vt(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
4
4
|
`;let a=this.createOnigString(e),o=a.content.length,s=new Ut(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Dt(this,a,i,0,t,s,!0,r);return Qe(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Bt(e,t){return e=Te(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var L=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Le.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Le(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Le(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),E.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Vt=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?L.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:ht(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=L.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,mt(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,L.fromExtension(r,n.contentNameScopesList))}},Ht=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):D(e,I).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>D(e,I).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Ut=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=E.set(n,0,Je(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=E.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Wt=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,It(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Gt=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Wt(w.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(w.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Ht(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new tt(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Kt=Vt.NULL;function R(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function z(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function qt(e){return Array.isArray(e)?e:[e]}async function Jt(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function B(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Yt(e){return e===`ansi`||B(e)}function V(e){return e===`none`}function Xt(e){return V(e)}var Zt=/(\r?\n)/g;function H(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Zt),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Qt={light:`#333333`,dark:`#bbbbbb`},$t={light:`#fffffe`,dark:`#1e1e1e`},en=`__shiki_resolved`;function tn(e){if(e?.[en])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Qt.light:Qt.dark,n||=t.type===`light`?$t.light:$t.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,en,{enumerable:!1,writable:!1,value:!0}),t}async function nn(e){return[...new Set((await Promise.all(e.filter(e=>!Yt(e)).map(async e=>await Jt(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function rn(e){return(await Promise.all(e.map(async e=>Xt(e)?null:tn(await Jt(e))))).filter(e=>!!e)}function an(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new S(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var on=class extends Gt{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tn(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=w.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=an(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new S(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},sn=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},U=0;function cn(e){U+=1,e.warnings!==!1&&U>=10&&U%10==0&&console.warn(`[Shiki] ${U} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new S("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(tn),i=new on(new sn(e.engine,n),r,n,e.langAlias),a;function o(t){return an(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new S(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new S(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await nn(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await rn(e))}function g(){if(t)throw new S(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--U)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function ln(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([rn(e.themes||[]),nn(e.langs||[]),e.engine]);return cn({...e,themes:t,langs:n,engine:r})}var un=new WeakMap;function W(e,t){un.set(e,t)}function G(e){return un.get(e)}var K=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(qt(n).map(e=>[e,Kt])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return dn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function dn(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function fn(e,t){if(!(e instanceof K))throw new S(`Invalid grammar state`);return e.getInternalStack(t)}var pn=/,/,mn=/ /;function hn(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(B(e.resolveLangAlias(n.lang||`text`))||V(r))return H(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return _n(t,o,i,a,n)}function gn(...e){if(e.length===2)return G(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(B(i)||V(a))throw new S(`Plain language does not have grammar state`);if(i===`ansi`)throw new S(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new K(vn(n,c,o,s,r).stateStack,c.name,o.name)}function _n(e,t,n,r,i){let a=vn(e,t,n,r,i),o=new K(a.stateStack,t.name,n.name);return W(a.tokens,o),a.tokens}function vn(e,t,n,r,i){let a=R(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=H(e),l=i.grammarState?fn(i.grammarState,n.name)??Kt:i.grammarContextCode==null?Kt:vn(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),ee=_.tokens.length/2;for(let e=0;e<ee;e++){let t=_.tokens[2*e],o=e+1<ee?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=z(r[E.getForeground(s)],a),l=E.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(pn).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(mn))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?yn(t.scopes):bn(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function yn(e){return e.map(e=>({scopeName:e}))}function bn(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Cn(e,i,t.slice(0,r))}}return n}function xn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Sn(e,t,n){if(!xn(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)xn(e[r],n[i])&&--r,--i;return r===-1}function Cn(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Sn(e,t,n)){r.push(a);break}return r}function wn(e,t,n,r=hn){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:G(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Tn(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new K(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&W(s,c),s}function Tn(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var En=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Dn={}.hasOwnProperty;function On(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Dn.call(t,e)){let n=String(t[e]);i=Dn.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var kn=/["&'<>`]/g,An=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,jn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Mn=/[|\\{}()[\]^$+*?.]/g,Nn=new WeakMap;function Pn(e,t){if(e=e.replace(t.subset?Fn(t.subset):kn,r),t.subset||t.escapeOnly)return e;return e.replace(An,n).replace(jn,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Fn(e){let t=Nn.get(e);return t||(t=In(e),Nn.set(e,t)),t}function In(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Mn,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Ln=/[\dA-Fa-f]/;function Rn(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Ln.test(String.fromCharCode(t))?r:r+`;`}var zn=/\d/;function Bn(e,t,n){let r=`&#`+String(e);return n&&t&&!zn.test(String.fromCharCode(t))?r:r+`;`}var Vn=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Hn={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Un=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Wn={}.hasOwnProperty,Gn={},q;for(q in Hn)Wn.call(Hn,q)&&(Gn[Hn[q]]=q);var Kn=/[^\dA-Za-z]/;function qn(e,t,n,r){let i=String.fromCharCode(e);if(Wn.call(Gn,i)){let e=Gn[i],a=`&`+e;return n&&Vn.includes(e)&&!Un.includes(e)&&(!r||t&&t!==61&&Kn.test(String.fromCharCode(t)))?a:a+`;`}return``}function Jn(e,t,n){let r=Rn(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=qn(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Bn(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function J(e,t){return Pn(e,Object.assign({format:Jn},t))}var Yn=/^>|^->|<!--|-->|--!>|<!-$/g,Xn=[`>`],Zn=[`<`,`>`];function Qn(e,t,n,r){return r.settings.bogusComments?`<?`+J(e.value,Object.assign({},r.settings.characterReferences,{subset:Xn}))+`>`:`<!--`+e.value.replace(Yn,i)+`-->`;function i(e){return J(e,Object.assign({},r.settings.characterReferences,{subset:Zn}))}}function $n(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var Y=nr(1),er=nr(-1),tr=[];function nr(e){return t;function t(t,n,r){let i=t?t.children:tr,o=(n||0)+e,s=i[o];if(!r)for(;s&&a(s);)o+=e,s=i[o];return s}}var rr={}.hasOwnProperty;function ir(e){return t;function t(t,n,r){return rr.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ar=ir({body:cr,caption:or,colgroup:or,dd:fr,dt:dr,head:or,html:sr,li:ur,optgroup:mr,option:hr,p:lr,rp:pr,rt:pr,tbody:_r,td:br,tfoot:vr,th:br,thead:gr,tr:yr});function or(e,t,n){let r=Y(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&a(r.value.charAt(0)))}function sr(e,t,n){let r=Y(n,t);return!r||r.type!==`comment`}function cr(e,t,n){let r=Y(n,t);return!r||r.type!==`comment`}function lr(e,t,n){let r=Y(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function ur(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`li`}function dr(e,t,n){let r=Y(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function fr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function pr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function mr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function hr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function gr(e,t,n){let r=Y(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function _r(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function vr(e,t,n){return!Y(n,t)}function yr(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function br(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var xr=ir({body:wr,colgroup:Tr,head:Cr,html:Sr,tbody:Er});function Sr(e){let t=Y(e,-1);return!t||t.type!==`comment`}function Cr(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function wr(e){let t=Y(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&a(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function Tr(e,t,n){let r=er(n,t),i=Y(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&ar(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Er(e,t,n){let r=er(n,t),i=Y(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&ar(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var X={name:[[`
|
|
5
5
|
\f\r &/=>`.split(``),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-web-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-web-pJFROy5N.js","assets/rolldown-runtime-QTnfLwEv.js","assets/papaparse.min-BQRX_pWo.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{n as e,r as t,t as n}from"./rolldown-runtime-QTnfLwEv.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},k={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=k,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,O)}catch(e){O(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),i=n(((e,t)=>{t.exports=r()})),a=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=ee,D=function(){ne.postMessage(null)}}else D=function(){_(ee,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),c=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function be(e){e.memoizedState!==null&&pe(_e,e);var t=me.current,n=Yd(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function xe(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),ap._currentValue=ce)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -36,7 +36,7 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
36
36
|
Minimum version required to store current data is: `+c+`.
|
|
37
37
|
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),FI=n((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),II=n((e=>{var t=FI();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),LI=n((e=>{var t=FI();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
|
|
38
38
|
`;return typeof a==`function`&&a(null,p),p}})),RI=t(n((e=>{var t=dI(),n=PI(),r=II(),i=LI();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),1),zI=`/api/p/wechat`;async function BI(e,t){return fetch(`${zI}${e}`,{credentials:`include`,headers:{"Content-Type":`application/json`,...t?.headers??{}},...t})}function VI({status:e,detail:t}){let n={running:{label:`Connected`,tone:`bg-success/10 text-success border-success/30`},starting:{label:`Starting`,tone:`bg-warning/10 text-warning border-warning/30`},idle:{label:`Idle`,tone:`bg-bg-hover text-fg-muted border-border-default`},stopped:{label:`Stopped`,tone:`bg-bg-hover text-fg-muted border-border-default`},error:{label:`Error`,tone:`bg-danger/10 text-danger border-danger/30`}}[e];return(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] ${n.tone}`,title:t??void 0,children:[e===`starting`&&(0,J.jsx)(q,{className:`h-3 w-3 animate-spin`}),n.label]})}function HI({onClose:e,onBound:t}){let{Modal:n}=mF(),[r,i]=(0,d.useState)(`model`),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)([]),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(``),v=(0,d.useRef)({cancelled:!1});(0,d.useEffect)(()=>((async()=>{try{let e=await(await fetch(`/api/models`,{credentials:`include`})).json(),t=(e.models??[]).map(e=>({id:e.id,displayName:e.displayName??e.label??e.id}));p(t),h(e.defaultModel??null),_(e.defaultModel??t[0]?.id??``)}catch{}})(),()=>{v.current.cancelled=!0}),[]);let y=(0,d.useCallback)(async()=>{i(`loading`);try{let e=await BI(`/login/start`,{method:`POST`,body:`{}`}),t=await e.json();if(!e.ok||!t.ok){c(t.error??`HTTP ${e.status}`),i(`error`);return}o(t),i(`qr`)}catch(e){c(e instanceof Error?e.message:String(e)),i(`error`)}},[]);return(0,d.useEffect)(()=>{if(r!==`qr`||!a)return;v.current={cancelled:!1};let e=v.current;return(async()=>{for(;!e.cancelled;)try{let t=await BI(`/login/poll`,{method:`POST`,body:JSON.stringify({qrcode:a.qrcode,modelId:g||void 0})}),n=await t.json();if(e.cancelled)return;if(!t.ok||!n.ok){c(n.error??`HTTP ${t.status}`),i(`error`);return}if(n.scanned&&n.binding){u(n.binding),i(`scanned`);return}await UI(1e3)}catch(t){if(e.cancelled)return;c(t instanceof Error?t.message:String(t)),i(`error`);return}})(),()=>{e.cancelled=!0}},[r,a]),(0,d.useEffect)(()=>{if(r!==`scanned`)return;t();let n=setTimeout(e,1500);return()=>clearTimeout(n)},[r,t,e]),(0,J.jsx)(n,{isOpen:!0,onClose:e,title:`Add WeChat account`,size:`sm`,children:(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-6`,children:[r===`model`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`text-sm text-fg-muted`,children:`Choose which model this WeChat account routes to:`}),(0,J.jsxs)(`select`,{value:g,onChange:e=>_(e.target.value),className:`w-full max-w-sm rounded-md border border-border-default bg-bg-elevated px-3 py-2 text-sm text-fg-default`,children:[f.length===0&&(0,J.jsx)(`option`,{value:``,children:`(no models registered)`}),f.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[e.displayName,m===e.id?` (default)`:``]},e.id))]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>void y(),disabled:f.length===0||!g,className:`mt-2 inline-flex items-center gap-1.5 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-fg-on-accent hover:bg-accent-hover disabled:opacity-50`,children:`Continue → Scan QR`}),(0,J.jsx)(`div`,{className:`text-[11px] text-fg-fainter`,children:`You can change the model later by re-scanning.`})]}),r===`loading`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(q,{className:`h-6 w-6 animate-spin text-fg-faint`}),(0,J.jsx)(`div`,{className:`text-sm text-fg-muted`,children:`Requesting QR code…`})]}),r===`qr`&&a&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`text-sm text-fg-muted`,children:`Scan with WeChat to authorise`}),(0,J.jsx)(WI,{value:a.qrCodeImageUrl}),(0,J.jsx)(`div`,{className:`text-[11px] text-fg-faint`,children:`Open WeChat → Scan → Confirm`}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-fg-fainter`,children:[(0,J.jsx)(q,{className:`h-3 w-3 animate-spin`}),`waiting for scan…`]})]}),r===`scanned`&&l&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ql,{className:`h-10 w-10 text-success`}),(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg-default`,children:`Connected`}),(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:l.displayName??l.config.username??`WeChat account`})]}),r===`error`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(AP,{className:`h-10 w-10 text-danger`}),(0,J.jsx)(`div`,{className:`text-sm text-fg-default`,children:`Login failed`}),(0,J.jsx)(`div`,{className:`max-w-xs break-words text-xs text-fg-muted`,children:s})]})]})})}function UI(e){return new Promise(t=>setTimeout(t,e))}function WI({value:e}){let t=(0,d.useId)(),n=(0,d.useRef)(null),[r,i]=(0,d.useState)(null);return(0,d.useEffect)(()=>{let t=!1,r=n.current;if(r)return i(null),RI.toCanvas(r,e,{width:224,margin:2,color:{dark:`#000000`,light:`#ffffff`},errorCorrectionLevel:`M`}).catch(e=>{t||i(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e]),r?(0,J.jsxs)(`div`,{className:`flex h-56 w-56 items-center justify-center rounded-md border border-danger/30 bg-danger/10 p-3 text-center text-xs text-danger`,children:[`QR render failed: `,r]}):(0,J.jsx)(`canvas`,{ref:n,"aria-label":`WeChat login QR`,id:`wechat-qr-${t}`,className:`h-56 w-56 rounded-md border border-border-default bg-white p-2`})}function GI(e){let[t,n]=(0,d.useState)(null),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),{setViewingSession:s}=yF(),c=(0,d.useCallback)(async()=>{try{let e=await BI(`/bindings`),t=await e.json();if(!e.ok||!t.ok){i(t.error??`HTTP ${e.status}`);return}i(null),n(t.bindings??[])}catch(e){i(e instanceof Error?e.message:String(e))}},[]);(0,d.useEffect)(()=>{c()},[c]);let l=(0,d.useCallback)(async e=>{if(confirm(`Disconnect this WeChat account from tianshu? Existing chat history with this account will be deleted too.`))try{let t=await BI(`/bindings/${encodeURIComponent(e)}`,{method:`DELETE`});if(!t.ok){i((await t.json().catch(()=>({}))).error??`HTTP ${t.status}`);return}s(null),await c()}catch(e){i(e instanceof Error?e.message:String(e))}},[c,s]);return(0,J.jsxs)(`div`,{className:`mx-auto max-w-3xl px-6 py-6 text-fg-default`,children:[(0,J.jsxs)(`header`,{className:`mb-6 flex items-center justify-between border-b border-border-subtle pb-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(Fx,{className:`h-6 w-6 text-success`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-lg font-semibold`,children:`WeChat`}),(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:`Connect your WeChat so direct messages route to your agent.`})]})]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>void c(),className:`rounded p-1.5 text-fg-muted hover:bg-bg-hover hover:text-fg-default`,title:`Refresh`,children:(0,J.jsx)(GT,{className:`h-4 w-4`})})]}),r&&(0,J.jsx)(`div`,{className:`mb-4 rounded-md border border-danger/30 bg-danger/10 px-3 py-2 text-sm text-danger`,children:r}),t===null?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,J.jsx)(q,{className:`h-4 w-4 animate-spin`}),`Loading…`]}):t.length===0?(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-border-default px-6 py-10 text-center`,children:[(0,J.jsx)(Fx,{className:`mx-auto mb-3 h-8 w-8 text-fg-fainter`}),(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg-default`,children:`No WeChat connected`}),(0,J.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:`Scan a QR with the WeChat app to start routing your direct messages through tianshu.`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`mt-4 inline-flex items-center gap-1.5 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-fg-on-accent hover:bg-accent-hover`,children:`Connect WeChat`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,J.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`One account connected. Re-scan to switch model or refresh the token.`}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>o(!0),className:`inline-flex items-center gap-1.5 rounded-md border border-border-default px-2.5 py-1 text-[11px] text-fg-muted hover:bg-bg-hover hover:text-fg-default`,children:[(0,J.jsx)(GT,{className:`h-3 w-3`}),`Re-scan`]})]}),(0,J.jsx)(`ul`,{className:`space-y-2`,children:t.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-border-subtle bg-bg-elevated px-4 py-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg-default`,children:e.displayName??e.config.username??`WeChat account`}),(0,J.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[11px] text-fg-faint`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:e.id}),(0,J.jsx)(VI,{status:e.status,detail:e.statusDetail}),typeof e.config.modelId==`string`&&e.config.modelId&&(0,J.jsx)(`span`,{className:`rounded bg-bg-hover px-1 py-px font-mono text-[10px] text-fg-muted`,title:`Model this binding routes inbound DMs to`,children:String(e.config.modelId)}),(0,J.jsxs)(`span`,{children:[`· bound `,new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>void l(e.id),className:`rounded p-1.5 text-fg-muted hover:bg-danger/10 hover:text-danger`,title:`Disconnect`,children:(0,J.jsx)(pM,{className:`h-4 w-4`})})]},e.id))})]}),a&&(0,J.jsx)(HI,{onClose:()=>o(!1),onBound:()=>void c()})]})}function KI(e){let[t,n]=(0,d.useState)(null),{viewingSessionId:r,setViewingSession:i}=yF(),a=(0,d.useCallback)(async()=>{try{let e=await(await BI(`/sessions`)).json();e.ok&&n(e.sessions??[])}catch{}},[]);if((0,d.useEffect)(()=>{a();let e=SF(`channel_session_changed`,e=>{e.channelId===`wechat`&&a()}),t=setInterval(()=>void a(),3e4);return()=>{e(),clearInterval(t)}},[a]),t===null||t.length===0)return null;function o(e){if(!e)return`(untitled)`;let t=e.match(/^([^:]+):(dm|group):(.+)$/);if(!t)return e;let n=t[3].length>18?`${t[3].slice(0,16)}…`:t[3];return`${t[2]===`dm`?`DM`:`群`} · ${n}`}return(0,J.jsx)(J.Fragment,{children:t.map(e=>{let t=e.id===r;return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left transition-colors ${t?`bg-bg-hover text-fg-default border border-border-default`:`text-fg-muted hover:bg-bg-hover hover:text-fg-default border border-transparent`}`,title:e.title??e.channelChatId,children:[(0,J.jsx)(`span`,{className:`flex-shrink-0 rounded bg-success/15 px-1 py-px text-[9px] uppercase tracking-wider text-success`,children:`wechat`}),(0,J.jsx)(`span`,{className:`flex-1 truncate text-xs`,children:o(e.title)}),t&&(0,J.jsx)(`span`,{className:`text-[9px] uppercase tracking-wider text-fg-faint`,children:`active`})]},e.id)})})}var qI={components:{WeChatAdminPage:GI,WeChatSidebarSection:KI}};qI.components;function JI(){let[e,t]=(0,d.useState)([]),[n,r]=(0,d.useState)([]),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(!1),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(()=>new Set),_=(0,d.useCallback)(e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[v,y]=(0,d.useState)(null),b=(0,d.useCallback)(async(e,n)=>{y(e),f(null);try{let r=await fetch(`/api/p/workboard/agents/${encodeURIComponent(e)}/enabled`,{method:`PATCH`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:!n})});if(!r.ok){let t=await r.text().catch(()=>``);f(`PATCH /agents/${e}/enabled → HTTP ${r.status}${t?`: `+t:``}`);return}t(t=>t.map(t=>t.id===e?{...t,enabled:!n}:t))}catch(e){f(e instanceof Error?e.message:String(e))}finally{y(null)}},[]),x=(0,d.useCallback)(async()=>{l(!0),f(null);try{let[e,n,i]=await Promise.all([fetch(`/api/p/workboard/agents`,{credentials:`include`}),fetch(`/api/tools`,{credentials:`include`}),fetch(`/api/skills`,{credentials:`include`})]);if(!e.ok){f(`GET /agents → HTTP ${e.status}`);return}let o=await e.json();t(o.agents),r(o.kinds),n.ok&&a((await n.json()).tools??[]),i.ok&&s((await i.json()).skills??[])}catch(e){f(e instanceof Error?e.message:String(e))}finally{l(!1)}},[]);(0,d.useEffect)(()=>{x()},[x]);let S=e=>n.find(t=>t.id===e)?.displayName??e,C=e=>`tenant-config:///workers/${e.builtinKey??e.id}/`;return(0,J.jsxs)(`div`,{className:`mx-auto max-w-5xl p-6`,children:[(0,J.jsxs)(`div`,{className:`mb-4 rounded-md border border-amber-900/40 bg-amber-950/30 px-3 py-2 text-[12px] leading-relaxed text-amber-200/90`,children:[(0,J.jsx)(`div`,{className:`font-semibold text-amber-100`,children:`Read-only listing — edit on disk`}),(0,J.jsxs)(`p`,{className:`mt-1 text-amber-200/70`,children:[`Worker config lives at`,` `,(0,J.jsx)(`code`,{className:`rounded bg-amber-950/60 px-1 py-0.5 text-amber-100`,children:`_tenant/config/workers/<slug>/`}),`. Each worker is a directory with`,` `,(0,J.jsx)(`code`,{className:`text-amber-100`,children:`agent.json`}),` and an optional`,` `,(0,J.jsx)(`code`,{className:`text-amber-100`,children:`SOUL.md`}),` /`,` `,(0,J.jsx)(`code`,{className:`text-amber-100`,children:`skills/`}),`. Edit the files directly, or ask the chat agent to do it via`,` `,(0,J.jsx)(`code`,{className:`text-amber-100`,children:`tenant_config_write`}),`. Pool picks up changes on next activate; a fs watcher follow-up will make this live.`]})]}),(0,J.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold text-fg-default`,children:[(0,J.jsx)(Es,{size:18,className:`text-brand-400`}),`Worker agents`]}),(0,J.jsx)(`p`,{className:`mt-1 max-w-3xl text-[12px] leading-relaxed text-fg-faint`,children:`Inventory the workboard pool currently sees. Filesystem rows shadow same-slug DB rows; legacy DB rows still present here haven't been edited or aren't yet picked up by the merger.`})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>m(!0),className:`flex items-center gap-1 rounded-md border border-border-default px-2.5 py-1.5 text-[12px] text-fg-muted hover:bg-bg-raised`,title:`Edit pool concurrency caps and worker type defaults`,children:[(0,J.jsx)(vD,{size:12}),`Configure`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void x(),disabled:c,className:`flex items-center gap-1 rounded-md border border-border-default px-2.5 py-1.5 text-[12px] text-fg-muted hover:bg-bg-raised disabled:opacity-50`,title:`Reload`,children:[(0,J.jsx)(GT,{size:12,className:c?`animate-spin`:``}),`Reload`]})]})]}),(0,J.jsx)($I,{open:p,onClose:()=>m(!1)}),u&&(0,J.jsx)(`div`,{className:`mb-4 rounded-md border border-red-900/40 bg-red-950/40 px-3 py-2 text-[12px] text-red-300`,children:u}),(0,J.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-border-subtle`,children:(0,J.jsxs)(`table`,{className:`min-w-full divide-y divide-gray-800 text-[12px]`,children:[(0,J.jsx)(`thead`,{className:`bg-bg-elevated/60 text-[11px] font-semibold uppercase tracking-wide text-fg-muted`,children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{className:`px-3 py-2 text-left`,children:`State`}),(0,J.jsx)(`th`,{className:`px-3 py-2 text-left`,children:`Name`}),(0,J.jsx)(`th`,{className:`px-3 py-2 text-left`,children:`Kind`}),(0,J.jsx)(`th`,{className:`px-3 py-2 text-left`,children:`Source`}),(0,J.jsx)(`th`,{className:`px-3 py-2 text-left`,children:`Model`}),(0,J.jsx)(`th`,{className:`px-3 py-2 text-left`,children:`Slug`})]})}),(0,J.jsx)(`tbody`,{className:`divide-y divide-gray-800`,children:e.length===0?(0,J.jsx)(`tr`,{children:(0,J.jsx)(`td`,{colSpan:6,className:`px-3 py-8 text-center text-fg-faint`,children:c?`Loading…`:`No worker agents.`})}):e.flatMap(e=>{let t=h.has(e.id);return[(0,J.jsxs)(`tr`,{className:`cursor-pointer hover:bg-bg-elevated/40`,onClick:()=>_(e.id),children:[(0,J.jsx)(`td`,{className:`px-3 py-2`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t?(0,J.jsx)(Al,{size:12,className:`text-fg-faint`}):(0,J.jsx)(Pl,{size:12,className:`text-fg-faint`}),(0,J.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":e.enabled,disabled:v===e.id,onClick:t=>{t.stopPropagation(),b(e.id,e.enabled)},className:`relative inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border transition-colors ${e.enabled?`border-emerald-500/60 bg-emerald-500/80 hover:bg-emerald-500`:`border-border-default bg-bg-hover hover:bg-border-strong`} disabled:cursor-not-allowed disabled:opacity-50`,title:e.enabled?`Enabled — click to disable. The pool will stop claiming new tasks for this agent.`:`Disabled — click to enable. The pool will resume claiming tasks.`,children:[(0,J.jsxs)(`span`,{className:`sr-only`,children:[e.enabled?`Disable`:`Enable`,` `,e.name]}),(0,J.jsx)(`span`,{className:`pointer-events-none inline-block h-3 w-3 transform rounded-full bg-white shadow transition-transform ${e.enabled?`translate-x-3`:`translate-x-0.5`}`})]})]})}),(0,J.jsxs)(`td`,{className:`px-3 py-2`,children:[(0,J.jsx)(`div`,{className:`font-medium text-fg-default`,children:e.name}),e.description&&(0,J.jsx)(`div`,{className:`text-[11px] text-fg-faint`,children:e.description})]}),(0,J.jsx)(`td`,{className:`px-3 py-2`,children:(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1.5 py-0.5 text-[11px] text-fg-muted`,children:S(e.kind)})}),(0,J.jsx)(`td`,{className:`px-3 py-2`,children:e.source===`builtin`?(0,J.jsx)(`span`,{className:`rounded bg-indigo-950 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-indigo-300`,children:`builtin`}):(0,J.jsx)(`span`,{className:`rounded bg-bg-raised px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-fg-muted`,children:`user`})}),(0,J.jsx)(`td`,{className:`px-3 py-2 font-mono text-[11px] text-fg-muted`,children:e.modelId??`—`}),(0,J.jsx)(`td`,{className:`px-3 py-2 font-mono text-[11px] text-fg-faint`,children:e.builtinKey??e.id})]},`${e.id}-row`),t?(0,J.jsx)(`tr`,{className:`bg-bg-base`,children:(0,J.jsx)(`td`,{colSpan:6,className:`px-3 pb-4 pt-1`,children:(0,J.jsx)(ZI,{agent:e,slotUri:C(e),toolCatalog:i,skillCatalog:o})})},`${e.id}-detail`):null]})})]})})]})}var YI=new Set([`task_list`,`task_create`,`task_update`,`task_move`,`task_delete`,`task_get_history`]);function XI(e,t,n){return e?{kind:`explicit`,items:(n?e.filter(e=>!YI.has(e)):[...e]).sort()}:t===null?{kind:`unknown`}:{kind:`effective`,items:t.map(e=>e.name).filter(e=>n?!YI.has(e):!0).sort()}}function ZI({agent:e,slotUri:t,toolCatalog:n,skillCatalog:r}){let i=(0,d.useMemo)(()=>XI(e.toolsAllow,n,!0),[e.toolsAllow,n]),a=(0,d.useMemo)(()=>{if(e.effectiveSkills){let t=[...e.effectiveSkills].sort();return e.skills?{kind:`explicit`,items:t}:{kind:`effective`,items:t}}return XI(e.skills,r,!1)},[e.effectiveSkills,e.skills,r]);return(0,J.jsxs)(`div`,{className:`mt-1 space-y-3 rounded-md border border-border-subtle bg-bg-elevated/40 p-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] text-fg-faint`,children:[(0,J.jsxs)(`span`,{children:[`slot:`,` `,(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1.5 py-0.5 text-fg-muted`,children:t})]}),e.modelId&&(0,J.jsxs)(`span`,{children:[`model:`,` `,(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1.5 py-0.5 text-fg-muted`,children:e.modelId})]})]}),(0,J.jsx)(QI,{title:`Allowed tools`,data:i}),(0,J.jsx)(QI,{title:`Allowed skills`,data:a}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-wide text-fg-muted`,children:`System prompt (SOUL.md)`}),e.systemPrompt?(0,J.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap rounded bg-bg-base p-2 text-[11px] leading-relaxed text-fg-muted`,children:e.systemPrompt}):(0,J.jsx)(`div`,{className:`text-[11px] italic text-fg-faint`,children:`(none — worker uses the kind default)`})]})]})}function QI({title:e,data:t}){let n=null;return t.kind===`explicit`?n=(0,J.jsx)(`span`,{className:`rounded bg-emerald-950 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-success`,title:`agent.json declared this list explicitly`,children:`explicit`}):t.kind===`effective`&&(n=(0,J.jsx)(`span`,{className:`rounded bg-amber-950 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-warning`,title:`agent.json has no allow-list — worker sees every entry below`,children:`effective (no restriction)`})),(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wide text-fg-muted`,children:e}),t.kind!==`unknown`&&(0,J.jsx)(`span`,{className:`rounded bg-bg-raised px-1.5 py-0.5 text-[10px] text-fg-muted`,children:t.items.length}),n]}),t.kind===`unknown`?(0,J.jsx)(`div`,{className:`text-[11px] italic text-fg-faint`,children:`(catalog not loaded — reload the page)`}):t.items.length===0?(0,J.jsx)(`div`,{className:`text-[11px] italic text-fg-faint`,children:`(empty list — worker can call nothing)`}):(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.items.map(e=>(0,J.jsx)(`code`,{className:`rounded bg-bg-raised px-1.5 py-0.5 text-[11px] text-fg-muted`,children:e},e))})]})}function $I({open:e,onClose:t}){return e?(0,J.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-6`,onClick:t,children:(0,J.jsxs)(`div`,{className:`flex max-h-[85vh] w-full max-w-lg flex-col overflow-hidden rounded-lg border border-border-subtle bg-bg-base shadow-2xl`,onClick:e=>e.stopPropagation(),children:[(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-border-subtle px-4 py-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg-default`,children:`Workboard configuration`}),(0,J.jsx)(`div`,{className:`mt-0.5 text-[11px] text-fg-faint`,children:`Pool caps apply on the next run acquire. Worker type defaults (echo / llm) re-activate the plugin so changes take effect on the next request.`})]}),(0,J.jsx)(`button`,{type:`button`,onClick:t,className:`rounded p-1 text-fg-muted hover:bg-bg-raised hover:text-fg-default`,"aria-label":`Close configure dialog`,children:(0,J.jsx)(AP,{size:14})})]}),(0,J.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 pt-3 [&>div>div>div:last-child]:sticky [&>div>div>div:last-child]:bottom-0 [&>div>div>div:last-child]:z-10 [&>div>div>div:last-child]:-mx-4 [&>div>div>div:last-child]:px-4 [&>div>div>div:last-child]:pb-3 [&>div>div>div:last-child]:bg-bg-base [&>div>div>div:last-child]:shadow-[0_-8px_8px_-8px_rgba(0,0,0,0.4)] `,children:(0,J.jsx)(uF,{pluginId:`workboard`})})]})}):null}var eL=`/api/p/workboard`,tL=`***`,nL=[{status:`ready`,label:`Ready`,color:`border-indigo-500/40 bg-indigo-500/5`,dot:`bg-indigo-400`},{status:`in_progress`,label:`In progress`,color:`border-amber-500/40 bg-amber-500/5`,dot:`bg-amber-400 animate-pulse`},{status:`done`,label:`Done`,color:`border-emerald-500/40 bg-emerald-500/5`,dot:`bg-emerald-400`}];async function rL(e){let t=await fetch(e,{credentials:`include`});if(!t.ok)throw Error(`${t.status} ${t.statusText}`);return await t.json()}async function iL(e,t,n=`POST`){let r={method:n,credentials:`include`};n!==`DELETE`&&(r.headers={"Content-Type":`application/json`},r.body=JSON.stringify(t??{}));let i=await fetch(e,r);if(!i.ok){let e=`${i.status} ${i.statusText}`;try{let t=await i.json();t.error&&(e+=` (${t.error})`)}catch{}throw Error(e)}if(i.status!==204)return await i.json()}function aL(e){if(!e)return``;let t=Date.now()-e;return t<6e4?`just now`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function oL(e,t){let n=e=>{let n=0;return t.includes(`ready`)&&(n+=e.ready),t.includes(`in_progress`)&&(n+=e.inProgress),t.includes(`done`)&&(n+=e.done),n},r=e.map(e=>({key:e.project,label:e.project,count:n(e)})).filter(e=>e.count>0),i=r.filter(e=>e.key!==tL).sort((e,t)=>e.label.localeCompare(t.label)),a=r.filter(e=>e.key===tL);return[...i,...a.map(e=>({...e,label:`Inbox`}))]}function sL(e){let[t,n]=(0,d.useState)(null),[r,i]=(0,d.useState)([]),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(()=>new Map),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),m=(0,d.useRef)(null),h=(0,d.useCallback)(async()=>{try{let t=new URLSearchParams;e.includeArchived&&t.set(`include_aborted`,`1`);let r=[rL(t.toString().length===0?`${eL}/tasks`:`${eL}/tasks?${t.toString()}`),rL(`${eL}/projects`),rL(`${eL}/agents`)];e.withWorker&&r.push(rL(`${eL}/workers/status`));let a=await Promise.all(r);n(a[0].tasks),i(a[1].projects);let s=a[2].agents;c(new Map(s.map(e=>[e.id,e.name]))),e.withWorker&&o(a[3]),u(null)}catch(e){u(e instanceof Error?e.message:String(e))}},[e.includeArchived,e.withWorker]);(0,d.useEffect)(()=>{h();let e=window.setInterval(()=>void h(),3e3);return()=>window.clearInterval(e)},[h]);let g=(0,d.useCallback)(async(e,t)=>{n(n=>n&&n.map(n=>n.id===e?{...n,status:t}:n)),p(e);try{await iL(`${eL}/tasks/${e}`,{status:t},`PATCH`)}catch(e){u(e instanceof Error?e.message:String(e))}finally{p(null),await h()}},[h]);return{tasks:t,projects:r,worker:a,agentNames:s,error:l,busyId:f,reload:h,moveTask:g,addTaskInColumn:(0,d.useCallback)(async(e,t)=>{try{let n=e.project&&e.project!==tL?e.project:void 0,r=(await iL(`${eL}/tasks`,{tasks:[{title:e.title,status:t,project:n,priority:e.priority||0,workerRole:e.workerRole||null,description:e.description||null}]}))?.results?.[0];if(r&&!r.ok)throw Error(r.error??`create_failed`);await h()}catch(e){u(e instanceof Error?e.message:String(e))}},[h]),patchTask:(0,d.useCallback)(async(e,t)=>{p(e);try{await iL(`${eL}/tasks/${e}`,t,`PATCH`)}catch(e){u(e instanceof Error?e.message:String(e))}finally{p(null),await h()}},[h]),deleteTask:(0,d.useCallback)(async e=>{p(e);try{let t=(await iL(`${eL}/tasks/delete`,{ids:[e]}))?.results?.[0];if(t&&!t.ok)throw Error(t.error??`delete_failed`)}catch(e){u(e instanceof Error?e.message:String(e))}finally{p(null),await h()}},[h]),bindDrag:(0,d.useCallback)(()=>({onDragStart:(e,t)=>{m.current=t,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t)},onDragEnd:()=>{m.current=null},onDrop:(e,n)=>{let r=m.current||e.dataTransfer.getData(`text/plain`);if(!r)return;let i=(t??[]).find(e=>e.id===r);!i||i.status===n||g(r,n)}}),[t,g])}}function cL(e){let t=sL({includeArchived:!1,withWorker:!1}),[n,r]=(0,d.useState)(``),i=(0,d.useMemo)(()=>t.tasks?n?t.tasks.filter(e=>(e.project||tL)===n):t.tasks:null,[t.tasks,n]),a=(0,d.useMemo)(()=>oL(t.projects,[`ready`,`in_progress`,`done`]),[t.projects]),o=t.bindDrag();return(0,J.jsxs)(`div`,{className:`flex flex-col h-full bg-bg-base text-fg-default`,children:[(0,J.jsxs)(`header`,{className:`flex items-center justify-between px-3 py-2 border-b border-border-subtle flex-shrink-0`,children:[(0,J.jsxs)(`h2`,{className:`flex items-center gap-1.5 font-semibold text-sm`,children:[(0,J.jsx)(Uv,{className:`w-4 h-4`}),` Tasks`]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>void t.reload(),className:`text-[10px] uppercase tracking-wide text-fg-muted hover:text-fg-default`,children:`Refresh`})]}),a.length>1&&(0,J.jsx)(EL,{chips:a,active:n,onPick:r}),t.error&&(0,J.jsx)(`div`,{className:`px-3 py-1.5 text-[10px] bg-red-900/40 border-b border-red-800 text-red-100 flex-shrink-0`,children:t.error}),(0,J.jsx)(`div`,{className:`flex-1 overflow-x-auto overflow-y-hidden`,children:t.tasks===null?(0,J.jsx)(`div`,{className:`flex items-center justify-center text-fg-faint py-8 h-full`,children:(0,J.jsx)(q,{className:`w-4 h-4 animate-spin`})}):(0,J.jsx)(`div`,{className:`flex gap-1.5 p-2 h-full items-stretch`,children:nL.map(e=>(0,J.jsx)(lL,{column:e,tasks:(i??[]).filter(t=>t.status===e.status).sort((t,n)=>e.status===`done`?n.createdAt-t.createdAt:t.createdAt-n.createdAt),busyId:t.busyId,compact:!0,onAddTask:r=>void t.addTaskInColumn({...r,project:r.project??n},e.status),projects:t.projects,workerRoles:SL,agentNames:t.agentNames,allTasks:t.tasks??[],onPatchTask:t.patchTask,onDragStart:o.onDragStart,onDragEnd:o.onDragEnd,onDrop:o.onDrop},e.status))})})]})}function lL({column:e,tasks:t,allTasks:n,busyId:r,compact:i,onAddTask:a,onPatchTask:o,projects:s,workerRoles:c,agentNames:l,onDragStart:u,onDragEnd:f,onDrop:p}){let[m,h]=(0,d.useState)(!1),[g,_]=(0,d.useState)(!1);return(0,J.jsxs)(`div`,{className:`flex flex-col flex-1 min-w-[160px] rounded-lg border transition-colors ${g?`border-blue-500/60 bg-bg-elevated/80`:e.color}`,onDragOver:e=>{e.preventDefault(),_(!0)},onDragLeave:()=>_(!1),onDrop:t=>{t.preventDefault(),_(!1),p(t,e.status)},children:[(0,J.jsxs)(`header`,{className:`px-2 py-1.5 border-b border-border-subtle/60 flex items-center gap-1.5 sticky top-0`,children:[(0,J.jsx)(`span`,{className:`w-2 h-2 rounded-full ${e.dot}`}),(0,J.jsx)(`span`,{className:`${i?`text-[11px]`:`text-xs`} font-medium`,children:e.label}),(0,J.jsx)(`span`,{className:`ml-auto ${i?`text-[10px]`:`text-[11px]`} text-fg-faint`,children:t.length}),e.status===`ready`&&(0,J.jsx)(`button`,{type:`button`,title:`Add task`,onClick:()=>h(!0),className:`p-0.5 text-fg-fainter hover:text-fg-default rounded`,children:(0,J.jsx)(Gw,{className:`w-3 h-3`})})]}),(0,J.jsxs)(`ul`,{className:`flex-1 overflow-y-auto p-1.5 space-y-1.5 min-h-[40px]`,children:[t.map(e=>(0,J.jsx)(dL,{task:e,meta:uL(e,n),busy:r===e.id,compact:i,agentNames:l,onDragStart:u,onDragEnd:f,onPatch:o},e.id)),m&&(0,J.jsx)(CL,{projects:s,workerRoles:c,allTasks:n,onSubmit:e=>{a(e),h(!1)},onCancel:()=>h(!1)}),!m&&t.length===0&&(0,J.jsx)(`li`,{className:`text-center text-[10px] text-fg-fainter py-3 ${e.status===`ready`?`cursor-pointer hover:text-fg-muted`:``}`,onClick:e.status===`ready`?()=>h(!0):void 0,children:e.status===`ready`?`empty - click to add`:`empty`})]})]})}function uL(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[],i=[];for(let t of e.dependsOn??[]){let e=n.get(t);e&&(r.push(e),e.status!==`done`&&i.push(e))}let a=(e.dependsOn?.length??0)-r.length;return{deps:r,pendingDeps:i,blocked:e.status===`ready`&&(i.length>0||a>0)}}function dL({task:e,meta:t,busy:n,compact:r,agentNames:i,onDragStart:a,onDragEnd:o,onPatch:s}){let[c,l]=(0,d.useState)(!1),u=!!e.description?.trim()||!!e.resultSummary?.trim()||t.deps.length>0||!!e.sessionId||e.status===`in_progress`;return(0,J.jsxs)(`li`,{draggable:!0,onDragStart:t=>{t.currentTarget.style.opacity=`0.4`,a(t,e.id)},onDragEnd:e=>{e.currentTarget.style.opacity=`1`,o()},onClick:e=>{e.stopPropagation(),u&&l(e=>!e)},className:`rounded border bg-bg-elevated/60 hover:border-border-default ${t.blocked?`border-indigo-500/40`:`border-border-subtle`} ${u?`cursor-pointer`:`cursor-grab`} ${n?`opacity-60`:``}`,children:[(0,J.jsxs)(`div`,{className:`px-2 py-1.5 flex items-start gap-1.5`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[(0,J.jsx)(`span`,{className:`${r?`text-[11.5px]`:`text-xs`} font-medium text-fg-default break-words`,children:e.title}),e.priority>0&&(0,J.jsxs)(`span`,{className:`text-[9px] px-1 rounded bg-amber-900/50 text-amber-100`,children:[`p`,e.priority]}),e.workerAgentId&&(0,J.jsxs)(`span`,{className:`text-[9px] px-1 rounded bg-indigo-900/50 text-indigo-100`,title:`Assigned to ${e.workerAgentId} (slug)`,children:[`@`,i.get(e.workerAgentId)??e.workerAgentId]}),!e.workerAgentId&&e.workerRole&&(0,J.jsx)(`span`,{className:`text-[9px] px-1 rounded bg-bg-raised text-fg-muted`,title:`Legacy: dispatched by kind, not pinned to a slug`,children:e.workerRole}),e.project&&e.project!==tL&&(0,J.jsxs)(`span`,{className:`text-[9px] px-1 rounded bg-bg-raised text-fg-muted`,children:[`#`,e.project]}),(e.dependsOn?.length??0)>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] px-1 rounded border ${t.blocked?`text-indigo-200 bg-indigo-500/15 border-indigo-500/40`:`text-fg-muted bg-bg-hover/30 border-border-default`}`,title:t.blocked?`Waiting on: ${t.pendingDeps.map(e=>e.title).join(`, `)}`:`${t.deps.length} dependenc${t.deps.length===1?`y`:`ies`} satisfied`,children:[t.blocked?(0,J.jsx)(mb,{className:`w-2.5 h-2.5`}):(0,J.jsx)(Ly,{className:`w-2.5 h-2.5`}),t.blocked?`${t.pendingDeps.length}/${e.dependsOn.length}`:e.dependsOn.length]})]}),(e.labels??[]).includes(`awaiting-intervention`)&&(0,J.jsxs)(`div`,{className:`mt-1 flex items-start gap-1 rounded border border-rose-500/50 bg-rose-500/10 px-1.5 py-1 text-[10px] text-danger`,title:e.interventionReason??e.failureReason??``,onClick:e=>e.stopPropagation(),children:[(0,J.jsx)(SM,{className:`w-3 h-3 mt-px shrink-0`}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1 break-words line-clamp-3`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`awaiting intervention`}),e.interventionAt?` (${jL(e.interventionAt)})`:``,e.interventionReason??e.failureReason?`: ${e.interventionReason??e.failureReason}`:``]}),(0,J.jsx)(`button`,{type:`button`,disabled:n,onClick:t=>{t.stopPropagation(),s(e.id,{labels:(e.labels??[]).filter(e=>e!==`awaiting-intervention`&&e!==`stalled`),attempts:0,failureReason:null,interventionReason:null,interventionAt:null})},className:`shrink-0 rounded border border-rose-500/40 px-1 py-px text-[9.5px] font-medium text-rose-100 hover:bg-rose-500/20 disabled:opacity-50`,children:`Retry`})]}),(e.labels??[]).includes(`stalled`)&&(0,J.jsxs)(`div`,{className:`mt-1 flex items-start gap-1 rounded border border-orange-500/40 bg-orange-500/5 px-1.5 py-1 text-[10px] text-orange-200`,title:e.failureReason??``,onClick:e=>e.stopPropagation(),children:[(0,J.jsx)(SM,{className:`w-3 h-3 mt-px shrink-0`}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1 break-words line-clamp-3`,children:[`stalled`,(e.attempts??0)>0?` after ${e.attempts} attempts`:``,e.failureReason?`: ${e.failureReason}`:``]}),(0,J.jsx)(`button`,{type:`button`,disabled:n,onClick:t=>{t.stopPropagation(),s(e.id,{labels:(e.labels??[]).filter(e=>e!==`stalled`),attempts:0,failureReason:null})},className:`shrink-0 rounded border border-orange-500/40 px-1 py-px text-[9.5px] font-medium text-orange-100 hover:bg-orange-500/15 disabled:opacity-50`,children:`Retry`})]}),(e.labels??[]).includes(`draft`)&&(0,J.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,onClick:e=>e.stopPropagation(),children:[(0,J.jsx)(`span`,{className:`inline-block rounded border border-yellow-500/40 bg-yellow-500/5 px-1.5 py-px text-[10px] text-yellow-200`,children:`draft - pool will skip`}),(0,J.jsx)(`button`,{type:`button`,disabled:n,onClick:t=>{t.stopPropagation(),s(e.id,{labels:(e.labels??[]).filter(e=>e!==`draft`)})},className:`rounded border border-yellow-500/40 px-1 py-px text-[9.5px] font-medium text-yellow-100 hover:bg-yellow-500/15 disabled:opacity-50`,children:`Publish`})]}),e.description&&!c&&(0,J.jsx)(`div`,{className:`text-[10.5px] text-fg-muted mt-0.5 line-clamp-2 whitespace-pre-line`,children:e.description}),e.resultSummary&&!c&&(0,J.jsxs)(`div`,{className:`${r?`text-[10px]`:`text-[10.5px]`} text-success/90 mt-0.5 italic line-clamp-2 whitespace-pre-line`,children:[`→ `,e.resultSummary]}),(0,J.jsxs)(`div`,{className:`text-[9.5px] text-fg-faint mt-0.5 flex items-center gap-1`,children:[(0,J.jsx)(fd,{className:`w-2.5 h-2.5`}),aL(e.endedAt??e.startedAt??e.createdAt)]})]}),u&&(0,J.jsx)(Al,{className:`w-3 h-3 mt-0.5 text-fg-faint shrink-0 transition-transform ${c?`rotate-180`:``}`}),n&&(0,J.jsx)(q,{className:`w-3 h-3 animate-spin text-fg-muted`})]}),c&&(0,J.jsxs)(`div`,{className:`px-2 pb-2 pt-0 border-t border-border-subtle/60 space-y-1.5`,onClick:e=>e.stopPropagation(),children:[e.description&&(0,J.jsx)(bL,{label:`Description`,children:(0,J.jsx)(`div`,{className:`text-[10.5px] text-fg-muted whitespace-pre-line break-words max-h-48 overflow-y-auto`,children:e.description})}),e.resultSummary&&(0,J.jsx)(bL,{label:`Result`,children:(0,J.jsxs)(`div`,{className:`text-[10.5px] text-success italic whitespace-pre-line break-words max-h-48 overflow-y-auto`,children:[`→ `,e.resultSummary]})}),e.resultFiles.length>0&&(0,J.jsx)(bL,{label:`Files (${e.resultFiles.length})`,children:(0,J.jsx)(`ul`,{className:`space-y-0.5`,children:e.resultFiles.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(xL,{path:e})},e))})}),t.deps.length>0&&(0,J.jsx)(bL,{label:`Depends on`,children:(0,J.jsx)(`ul`,{className:`space-y-0.5`,children:t.deps.map(e=>(0,J.jsxs)(`li`,{className:`text-[10px] flex items-center gap-1`,children:[e.status===`done`?(0,J.jsx)(Ql,{className:`w-2.5 h-2.5 text-success shrink-0`}):(0,J.jsx)(mb,{className:`w-2.5 h-2.5 text-indigo-400 shrink-0`}),(0,J.jsx)(`span`,{className:`truncate ${e.status===`done`?`text-fg-muted line-through`:`text-indigo-200`}`,children:e.title}),(0,J.jsx)(`span`,{className:`ml-auto text-[9px] text-fg-fainter shrink-0`,children:e.status.replace(`_`,` `)})]},e.id))})}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-0 text-[9.5px] text-fg-faint pt-1`,children:[(0,J.jsxs)(`div`,{children:[`Created`,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:new Date(e.createdAt).toLocaleString()})]}),e.startedAt&&(0,J.jsxs)(`div`,{children:[`Started`,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:new Date(e.startedAt).toLocaleString()})]}),e.endedAt&&(0,J.jsxs)(`div`,{children:[`Ended`,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:new Date(e.endedAt).toLocaleString()})]})]}),(0,J.jsx)(fL,{task:e})]})]})}function fL({task:e}){let[t,n]=(0,d.useState)(!1);return e.status===`in_progress`||e.sessionId?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`pt-1`,children:(0,J.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),n(!0)},className:`inline-flex items-center gap-1.5 rounded border border-border-default px-1.5 py-0.5 text-[10px] text-fg-muted hover:border-border-strong hover:bg-bg-raised`,children:[(0,J.jsx)($E,{className:`w-3 h-3`}),`View transcript`,e.status===`in_progress`&&(0,J.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,J.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-amber-400 animate-pulse`}),`live`]})]})}),t&&(0,J.jsx)(pL,{task:e,onClose:()=>n(!1)})]}):null}function pL({task:e,onClose:t}){let{Modal:n}=mF(),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=(0,d.useRef)(null),p=(0,d.useRef)(!0),m=(0,d.useCallback)(async()=>{if(e.id){o(!0);try{let t=await rL(`${eL}/tasks/${e.id}/history`);i(t.entries??[]),u(t.sessionId??null),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}},[e.id]);(0,d.useEffect)(()=>{m()},[m]),(0,d.useEffect)(()=>{if(e.status!==`in_progress`)return;let t=setInterval(()=>void m(),3e3);return()=>clearInterval(t)},[e.status,m]),(0,d.useEffect)(()=>{if(!p.current)return;let e=f.current;e&&(e.scrollTop=e.scrollHeight)},[r]);let h=e=>{let t=e.currentTarget;p.current=t.scrollHeight-t.scrollTop-t.clientHeight<80},g=(0,d.useMemo)(()=>mL(r??[]),[r]);return(0,J.jsx)(n,{isOpen:!0,onClose:t,title:e.title,size:`lg`,className:`bg-bg-base`,children:(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,onDragStart:e=>e.stopPropagation(),children:[(0,J.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border-subtle px-4 py-2 text-[10px] text-fg-faint`,children:[(0,J.jsx)($E,{className:`h-3.5 w-3.5 text-fg-faint`}),(0,J.jsx)(`span`,{children:`worker transcript`}),l&&(0,J.jsxs)(`span`,{className:`font-mono text-fg-fainter`,children:[`· `,l]}),e.status===`in_progress`&&(0,J.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[`·`,(0,J.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-amber-400`}),`tailing`]}),(0,J.jsx)(`div`,{className:`ml-auto`,children:(0,J.jsx)(`button`,{type:`button`,onClick:()=>void m(),disabled:a,className:`rounded p-1 text-fg-muted hover:bg-bg-raised hover:text-fg-default disabled:opacity-50`,title:`Refresh`,children:(0,J.jsx)(GT,{className:`h-3.5 w-3.5 ${a?`animate-spin`:``}`})})})]}),(0,J.jsxs)(`div`,{ref:f,onScroll:h,className:`flex-1 space-y-3 overflow-y-auto p-4`,children:[s&&(0,J.jsx)(`div`,{className:`rounded border border-rose-700/40 bg-rose-950/30 px-3 py-2 text-xs text-danger`,children:s}),r===null&&a&&(0,J.jsx)(`div`,{className:`text-xs italic text-fg-faint`,children:`Loading…`}),r!==null&&g.length===0&&!a&&(0,J.jsx)(`div`,{className:`text-xs italic text-fg-faint`,children:e.sessionId?`No messages yet.`:`Worker hasn't started yet.`}),g.map(e=>(0,J.jsx)(hL,{row:e},e.id))]})]})})}function mL(e){let t=new Map;for(let n of e)n.role===`tool`&&n.toolResult?.callId&&t.set(n.toolResult.callId,n.toolResult);let n=[];for(let r of e){if(r.role===`tool`)continue;let e=(r.toolCalls??[]).map(e=>({call:e,result:t.get(e.callId)}));n.push({id:r.id,createdAt:r.createdAt,role:r.role===`user`?`user`:r.role===`assistant`?`assistant`:`system`,text:r.text,calls:e})}return n}function hL({row:e}){let t=e.role===`user`;return(0,J.jsx)(`div`,{className:t?`flex justify-end`:`flex justify-start`,children:(0,J.jsxs)(`div`,{className:`flex max-w-[85%] flex-col ${t?`items-end`:`items-start`}`,children:[(0,J.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-fg-faint`,children:[t?(0,J.jsx)(vN,{className:`h-3 w-3`}):(0,J.jsx)(Es,{className:`h-3 w-3 text-link`}),(0,J.jsx)(`span`,{children:t?`you`:e.role}),(0,J.jsx)(`span`,{className:`text-fg-fainter`,children:`·`}),(0,J.jsx)(`span`,{className:`text-fg-fainter`,children:new Date(e.createdAt).toLocaleTimeString()})]}),e.text&&(0,J.jsx)(`div`,{className:`whitespace-pre-line break-words rounded-lg border px-3 py-2 text-[13px] leading-relaxed ${t?`border-brand-400/30 bg-brand-500/10 text-fg-default`:`border-border-subtle bg-bg-elevated/60 text-fg-default`}`,children:e.text}),e.calls.length>0&&(0,J.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-1 ${t?`items-end`:`items-start`}`,children:e.calls.map((e,t)=>(0,J.jsx)(gL,{...e},e.call.callId||`c${t}`))})]})})}function gL({call:e,result:t}){let[n,r]=(0,d.useState)(!1),i=!t,a=!!t&&t.ok===!1;return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>!i&&r(e=>!e),className:`flex select-none items-center gap-1.5 py-0.5 text-xs ${i?`cursor-default text-fg-faint`:`cursor-pointer text-fg-faint hover:text-fg-muted`}`,children:[i?(0,J.jsx)(q,{className:`h-3 w-3 animate-spin text-warning`}):a?(0,J.jsx)(Mu,{className:`h-3 w-3 text-rose-400/70`}):(0,J.jsx)(Ql,{className:`h-3 w-3 text-emerald-500/60`}),(0,J.jsx)(`code`,{className:`font-mono text-[12px] text-link`,children:e.toolName}),(0,J.jsx)(`span`,{className:`font-mono text-[11px] text-fg-fainter`,children:_L(e.argsJson)}),i?(0,J.jsx)(`span`,{className:`text-[11px] text-fg-fainter`,children:`running…`}):n?(0,J.jsx)(Al,{className:`h-3 w-3 text-fg-fainter`}):(0,J.jsx)(Pl,{className:`h-3 w-3 text-fg-fainter`})]}),n&&t&&(0,J.jsx)(`pre`,{className:`mt-1 max-h-64 max-w-2xl overflow-auto whitespace-pre-wrap break-all rounded-md border px-3 py-2 text-[11px] ${a?`border-rose-700/40 bg-rose-950/30 text-danger`:`border-border-subtle/60 bg-bg-elevated/60 text-fg-muted`}`,children:yL(t.text||`(empty)`,4e3)})]})}function _L(e){if(!e)return`()`;let t;try{t=JSON.parse(e)}catch{return e.length>60?`(${e.slice(0,57)}…)`:`(${e})`}if(!t||typeof t!=`object`)return`(${e})`;let n=t,r=Object.keys(n);return r.length===0?`()`:r.slice(0,3).map(e=>`${e}=${vL(n[e])}`).join(` `)}function vL(e){return typeof e==`string`?e.length>40?`"${e.slice(0,37)}…"`:`"${e}"`:typeof e==`number`||typeof e==`boolean`||e==null?String(e):JSON.stringify(e).slice(0,40)}function yL(e,t){return e.length<=t?e:e.slice(0,t-1)+`
|
|
39
|
-
…(truncated)`}function bL({label:e,children:t}){return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-fg-faint mb-0.5`,children:e}),t]})}function xL({path:e}){let t=dF(),n=e.replace(/^workspace:\/\/+/,`/`),r=n.split(`/`).filter(Boolean).pop()||n;return(0,J.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),t(n)},className:`inline-flex items-center gap-1 max-w-full text-[10.5px] font-mono text-success hover:underline truncate`,title:n,children:[(0,J.jsx)(qm,{className:`w-3 h-3 shrink-0 opacity-70`}),(0,J.jsx)(`span`,{className:`truncate`,children:r})]})}var SL=[`echo`,`qianliyan`,`luban`,`xihe`,`nvwa`];function CL({projects:e,workerRoles:t,allTasks:n,onSubmit:r,onCancel:i}){let[a,o]=(0,d.useState)(``),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(0),[m,h]=(0,d.useState)(``),[g,_]=(0,d.useState)([]),[v,y]=(0,d.useState)(!1),b=(0,d.useRef)(null);(0,d.useEffect)(()=>{b.current?.focus()},[]);let x=()=>{let e=a.trim();if(!e){i();return}r({title:e,description:s.trim()||void 0,project:l.trim()||void 0,priority:f||void 0,workerRole:m.trim()||void 0,dependsOn:g.length>0?g:void 0})};return(0,J.jsxs)(`li`,{className:`rounded border border-blue-500/50 bg-bg-elevated/70 p-1.5 space-y-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(`input`,{ref:b,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),x()):e.key===`Escape`&&i())},placeholder:`Task title...`,className:`flex-1 min-w-0 bg-bg-raised border border-border-default rounded px-2 py-1 text-[11.5px] text-fg-default outline-none focus:border-blue-500`}),(0,J.jsx)(`button`,{type:`button`,title:v?`Less`:`More fields`,onClick:()=>y(e=>!e),className:`p-0.5 text-fg-faint hover:text-fg-default`,children:(0,J.jsx)(Al,{className:`w-3 h-3 transition-transform ${v?`rotate-180`:``}`})}),(0,J.jsx)(`button`,{type:`button`,onClick:i,className:`p-0.5 text-fg-faint hover:text-fg-default`,title:`Cancel`,children:(0,J.jsx)(AP,{className:`w-3 h-3`})})]}),v&&(0,J.jsxs)(`div`,{className:`space-y-2 pt-0.5`,children:[(0,J.jsx)(wL,{label:`Description`,children:(0,J.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),placeholder:`Optional notes for the worker...`,rows:2,className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500 resize-y`})}),(0,J.jsx)(wL,{label:`Project`,children:(0,J.jsx)(`input`,{list:`workboard-add-projects`,value:l,onChange:e=>u(e.target.value),placeholder:`inbox`,className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`})}),(0,J.jsxs)(`div`,{className:`grid grid-cols-[1fr_72px] gap-2`,children:[(0,J.jsx)(wL,{label:`Worker`,children:(0,J.jsx)(`input`,{list:`workboard-add-roles`,value:m,onChange:e=>h(e.target.value),placeholder:`any`,className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`})}),(0,J.jsx)(wL,{label:`Priority`,children:(0,J.jsx)(`input`,{type:`number`,value:f,onChange:e=>p(Number(e.target.value)||0),className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`})})]}),(0,J.jsx)(wL,{label:`Depends on`,children:(0,J.jsx)(TL,{value:g,onChange:_,candidates:n,project:l})}),(0,J.jsx)(`datalist`,{id:`workboard-add-roles`,children:t.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsx)(`datalist`,{id:`workboard-add-projects`,children:e.map(e=>(0,J.jsx)(`option`,{value:e.project},e.project))})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 pt-1`,children:[(0,J.jsx)(`span`,{className:`text-[9.5px] text-fg-fainter truncate`,children:v?`Enter saves`:`Enter · Esc cancel`}),(0,J.jsx)(`button`,{type:`button`,onClick:x,disabled:!a.trim(),className:`ml-auto px-2.5 py-0.5 text-[10.5px] rounded bg-blue-700 hover:bg-blue-600 text-white disabled:opacity-50 disabled:cursor-not-allowed`,children:`Add`})]})]})}function wL({label:e,children:t}){return(0,J.jsxs)(`label`,{className:`block`,children:[(0,J.jsx)(`span`,{className:`block text-[9px] uppercase tracking-wide text-fg-faint mb-0.5`,children:e}),t]})}function TL({value:e,onChange:t,candidates:n,project:r,excludeId:i}){let a=(0,d.useMemo)(()=>new Map(n.map(e=>[e.id,e])),[n]),o=(0,d.useMemo)(()=>{let t=(r??``).trim();return n.filter(n=>n.id===i||e.includes(n.id)?!1:t?t===tL?!n.project||n.project===tL:n.project===t:!0)},[n,r,e,i]),s=n=>t(e.filter(e=>e!==n)),c=n=>{!n||e.includes(n)||t([...e,n])};return(0,J.jsxs)(`div`,{className:`space-y-1`,children:[e.length>0&&(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.map(e=>{let t=a.get(e),n=t?t.title:`${e.slice(0,6)}... (deleted)`,r=t?.status===`done`;return(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded border ${r?`text-success bg-success/10 border-success/30`:`text-indigo-200 bg-indigo-500/15 border-indigo-500/40`}`,title:t?`${t.status} · ${t.id}`:e,children:[r?(0,J.jsx)(Ql,{className:`w-2.5 h-2.5`}):(0,J.jsx)(mb,{className:`w-2.5 h-2.5`}),(0,J.jsx)(`span`,{className:`truncate max-w-[140px]`,children:n}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`text-fg-muted hover:text-fg-default`,title:`Remove`,children:(0,J.jsx)(AP,{className:`w-2.5 h-2.5`})})]},e)})}),(0,J.jsxs)(`select`,{value:``,onChange:e=>{e.target.value&&(c(e.target.value),e.target.value=``)},className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`,children:[(0,J.jsx)(`option`,{value:``,children:o.length===0?e.length===0?`(no other tasks)`:`(no more candidates)`:`Add prerequisite...`}),o.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[`[`,e.status,`] `,e.title]},e.id))]})]})}function EL({chips:e,active:t,onPick:n,showAll:r,rightExtras:i}){return(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1.5 border-b border-border-subtle bg-bg-base/40 overflow-x-auto scrollbar-none flex-shrink-0`,children:[r&&(0,J.jsx)(DL,{active:!t,label:`All`,count:e.reduce((e,t)=>e+t.count,0),onClick:()=>n(``)}),e.map(e=>(0,J.jsx)(DL,{active:t===e.key,label:e.label,count:e.count,onClick:()=>n(t===e.key?``:e.key)},e.key||`all`)),i]})}function DL({active:e,label:t,count:n,onClick:r}){return(0,J.jsxs)(`button`,{onClick:r,className:[`shrink-0 inline-flex items-center gap-1 rounded-full text-[11px] transition-colors px-2.5 py-0.5`,e?`bg-blue-500/20 border border-blue-400/50 text-blue-200`:`text-fg-muted hover:text-fg-default hover:bg-bg-raised/60 border border-transparent`].join(` `),children:[(0,J.jsx)(`span`,{children:t}),(0,J.jsx)(`span`,{className:e?`text-blue-300/80`:`text-fg-fainter`,children:n})]})}function OL(e){let[t,n]=(0,d.useState)(null),r=(0,d.useCallback)(async()=>{try{n(await rL(`${eL}/workers/status`))}catch{n(null)}},[]);(0,d.useEffect)(()=>{r();let e=window.setInterval(()=>void r(),5e3);return()=>window.clearInterval(e)},[r]);let i=t?.workers??[],a=i.filter(e=>e.busy).length;return(0,J.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,J.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,J.jsx)(MP,{size:14,className:`flex-shrink-0 text-fg-fainter`}),(0,J.jsx)(`span`,{className:`flex-1 text-sm font-medium text-fg-muted`,children:`Workers`}),(0,J.jsxs)(`span`,{className:`rounded bg-bg-raised px-1.5 py-0.5 text-[9px] text-fg-fainter`,children:[a,`/`,i.length,` busy`]})]}),(0,J.jsx)(`div`,{className:`space-y-1.5`,children:i.length===0?(0,J.jsx)(`div`,{className:`text-[10px] text-fg-fainter px-1`,children:`No workers running. Toggle echo on under Settings → Plugins → Workboard.`}):i.map(e=>(0,J.jsx)(kL,{name:e.name,kind:e.kind,busy:e.busy},e.agentId))})]})}function kL({name:e,kind:t,busy:n}){let r=AL(t);return(0,J.jsxs)(`div`,{className:`flex cursor-default items-center gap-2 rounded py-0.5 pl-1 hover:bg-bg-hover/30`,title:`Agent: ${e}\nWorker type: ${t}`,children:[(0,J.jsx)(`span`,{className:`w-5 flex-shrink-0 text-center text-base`,children:r}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`div`,{className:`truncate text-xs font-medium text-fg-default`,children:e}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:`truncate rounded bg-bg-raised/80 px-1 py-px font-mono text-[9px] font-semibold uppercase tracking-wide text-fg-muted`,children:t}),(0,J.jsx)(`span`,{className:`rounded px-1 py-px text-[9px] ${n?`bg-blue-900/40 text-blue-100 border border-blue-700`:`bg-bg-raised/60 text-fg-fainter`}`,children:n?`busy`:`idle`})]})]})]})}function AL(e){return e===`echo`?`🔁`:`⚙️`}function jL(e){let t=Math.max(0,Date.now()-e),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}var ML={components:{WorkboardPanel:cL,WorkersSidebarSection:OL,WorkerAgentsPage:JI}};ML.components;var NL=`/api/p/workforce-studio`;async function PL(e,t){let n=await fetch(`${NL}${e}`,{credentials:`include`,headers:{"Content-Type":`application/json`},...t}),r=await n.json();if(!r.ok)throw Error(r.error||`HTTP ${n.status}`);return r}function FL(e){let t={executionBias:null,replyStyle:null,userOnboarding:null};for(let n of e)n.overrideKey&&n.overridden&&(t[n.overrideKey]=n.text);return t}function IL(e){return e.filter(e=>e.customFragmentId).map(e=>({id:e.customFragmentId,title:e.title,body:e.text}))}function LL(e,t,n){let r={};for(let i of e){let e=n[i.slug]?.blocks.find(e=>e.overrideKey===`executionBias`);r[i.slug]={name:i.name,description:i.description,modelId:i.modelId,enabled:i.enabled,soul:t[i.slug]??``,executionBias:e?.overridden?e.text:null,skillsDeny:new Set,toolsDeny:new Set}}return r}function RL(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function zL(e,t,n){let{spec:r}=e,[i,a]=(0,d.useState)(r.name),[o,s]=(0,d.useState)(r.description),[c,l]=(0,d.useState)(e.tenantPrompt??``),[u,f]=(0,d.useState)(()=>new Set(r.mainAgent.skillsDeny)),[p,m]=(0,d.useState)(()=>new Set(r.mainAgent.toolsDeny??[])),[h,g]=(0,d.useState)(()=>FL(e.mainBlocks)),[_,v]=(0,d.useState)(()=>IL(e.mainBlocks)),[y,b]=(0,d.useState)(()=>LL(r.workers,e.workerPrompts,e.workerViews)),[x,S]=(0,d.useState)(()=>new Set(r.plugins.enabled)),[C,w]=(0,d.useState)(null),[T,E]=(0,d.useState)(!1),[ee,D]=(0,d.useState)(!1),[te,ne]=(0,d.useState)(null),re=(0,d.useCallback)(()=>ne(null),[]);(0,d.useEffect)(()=>{S(new Set(r.plugins.enabled))},[r.slug,r.plugins.enabled]),(0,d.useEffect)(()=>{b(LL(r.workers,e.workerPrompts,e.workerViews))},[r.slug,r.workers,e.workerPrompts,e.workerViews]),(0,d.useEffect)(()=>{a(r.name),s(r.description),l(e.tenantPrompt??``),f(new Set(r.mainAgent.skillsDeny)),m(new Set(r.mainAgent.toolsDeny??[])),g(FL(e.mainBlocks)),v(IL(e.mainBlocks)),w(null)},[r.slug,r.name,r.description,e.tenantPrompt,e.mainBlocks,r.mainAgent.skillsDeny,r.mainAgent.toolsDeny]);let ie=(0,d.useCallback)(async()=>{E(!0);try{w((await PL(`/solutions/${encodeURIComponent(r.slug)}/diff?against=reality`)).diff)}finally{E(!1)}},[r.slug]),ae=(0,d.useCallback)(()=>{D(!0)},[]),oe=(0,d.useCallback)(()=>{D(!1)},[]),se=(0,d.useCallback)(async()=>{D(!1),E(!0);try{let e=await PL(`/solutions/${encodeURIComponent(r.slug)}/activate`,{method:`POST`});ne({kind:`success`,text:`“${r.name}” is now the active solution. Workers updated: ${e.appliedWorkers.length}. Takes effect on the next agent turn.`}),n?.()}catch(e){ne({kind:`error`,text:`Activate failed: ${e instanceof Error?e.message:String(e)}`})}finally{E(!1)}},[r.slug,r.name,n]);return{name:i,setName:a,description:o,setDescription:s,tenantPrompt:c,setTenantPrompt:l,skillsDeny:u,setSkillsDeny:f,toolsDeny:p,setToolsDeny:m,overrides:h,setOverrides:g,fragments:_,setFragments:v,workerEdits:y,setWorkerEdits:b,pluginsEnabled:x,setPluginsEnabled:S,diff:C,setDiff:w,busy:T,runDiff:ie,save:(0,d.useCallback)(async()=>{E(!0);try{let n={slug:r.slug,name:i,description:o,plugins:{enabled:[...x].sort()},mainAgent:{tenantPrompt:c.trim().length>0?c:null,skillsAllow:null,skillsDeny:[...u].sort(),toolsAllow:null,toolsDeny:[...p].sort(),overrides:{executionBias:h.executionBias,replyStyle:h.replyStyle,userOnboarding:h.userOnboarding},customFragments:_.map(e=>({id:e.id,title:e.title,body:e.body}))},workers:r.workers.map(t=>{let n=y[t.slug],r=e.workerViews[t.slug];if(!n||!r)return{slug:t.slug,kind:t.kind,name:t.name,description:t.description,modelId:t.modelId,enabled:t.enabled,systemPrompt:e.workerPrompts[t.slug]??null,toolsAllow:t.toolsAllow,skillsAllow:t.skillsAllow,overrides:{executionBias:null},source:t.source};let i=(e,t)=>e.filter(e=>!t.has(e.name)).map(e=>e.name).sort();return{slug:t.slug,kind:t.kind,name:n.name,description:n.description,modelId:n.modelId,enabled:n.enabled,systemPrompt:n.soul.trim().length>0?n.soul:null,toolsAllow:i(r.availableTools,n.toolsDeny),skillsAllow:i(r.availableSkills,n.skillsDeny),overrides:{executionBias:n.executionBias&&n.executionBias.trim().length>0?n.executionBias:null},source:t.source}})};await PL(`/solutions/save`,{method:`POST`,body:JSON.stringify(n)}),t()}finally{E(!1)}},[r,i,o,e,c,u,p,h,_,y,x,t]),activatePending:ee,requestActivate:ae,confirmActivate:se,cancelActivate:oe,notice:te,clearNotice:re}}var BL={executionBias:{icon:`⚙`,label:`Execution bias`},replyStyle:{icon:`💬`,label:`Reply style`},userOnboarding:{icon:`👋`,label:`User onboarding`}};function VL(e,t,n){let{spec:r}=e,i=[];if(i.push({id:`root`,label:t.name||r.name,icon:`📦`,depth:0}),i.push({id:`plugins`,label:`Plugins`,icon:`🧩`,depth:1,count:`${t.pluginsEnabled.size}/${e.availablePlugins.length}`}),i.push({id:`main`,label:`Main agent`,icon:`🤖`,depth:1,expandable:!0}),n.has(`main`)){i.push({id:`main:tenant-prompt`,label:`Tenant prompt`,icon:`📝`,depth:2});for(let e of Object.keys(BL)){let n=BL[e],r=t.overrides[e]!==null;i.push({id:`main:override:${e}`,label:n.label,icon:n.icon,depth:2,badge:r?{kind:`overridden`,text:`overridden`}:void 0})}for(let e of t.fragments)i.push({id:`main:fragment:${e.id}`,label:`Custom: ${e.title||`untitled`}`,icon:`➕`,depth:2});i.push({id:`main:tools`,label:`Tools`,icon:`🔧`,depth:2,count:`${e.availableTools.length}`,badge:HL(t.toolsDeny.size)}),i.push({id:`main:skills`,label:`Skills`,icon:`📚`,depth:2,count:`${e.availableSkills.length}`,badge:HL(t.skillsDeny.size)})}if(i.push({id:`workers`,label:`Workers`,icon:`👥`,depth:1,count:`${r.workers.length}`,expandable:!0}),n.has(`workers`))for(let a of r.workers){let r=t.workerEdits[a.slug],o=e.workerViews[a.slug],s=r?!r.enabled:!a.enabled,c=`worker:${a.slug}`;if(i.push({id:c,label:r?.name||a.name,icon:UL(a.kind),depth:1,excluded:s,expandable:!0,badge:s?{kind:`excluded`,text:`excluded`}:void 0}),n.has(c)){i.push({id:`${c}:soul`,label:`SOUL.md`,icon:`📝`,depth:2});let e=!!r&&r.executionBias!==null;i.push({id:`${c}:override:executionBias`,label:`Execution bias`,icon:`⚙`,depth:2,badge:e?{kind:`overridden`,text:`overridden`}:void 0}),i.push({id:`${c}:tools`,label:`Tools`,icon:`🔧`,depth:2,count:o?`${o.availableTools.length}`:void 0,badge:HL(r?.toolsDeny.size??0)}),i.push({id:`${c}:skills`,label:`Skills`,icon:`📚`,depth:2,count:o?`${o.availableSkills.length}`:void 0,badge:HL(r?.skillsDeny.size??0)})}}return i}function HL(e){return e>0?{kind:`excluded`,text:String(e)}:void 0}function UL(e){let t=e.toLowerCase();return t.includes(`research`)?`🔎`:t.includes(`cod`)||t.includes(`dev`)?`💻`:t.includes(`review`)?`📋`:`🤖`}function WL(e){let t=new Set([`main`,`workers`]);for(let n of e.spec.workers)t.add(`worker:${n.slug}`);return t}function GL({detail:e,edits:t,expanded:n,onToggleExpand:r,selected:i,onSelect:a}){return(0,J.jsx)(`div`,{className:`py-2`,children:VL(e,t,n).map(e=>(0,J.jsx)(KL,{node:e,isSelected:i===e.id,isExpanded:n.has(e.id),onToggleExpand:r,onSelect:a},e.id))})}function KL({node:e,isSelected:t,isExpanded:n,onToggleExpand:r,onSelect:i}){let a=e.depth===0?`pl-2`:e.depth===1?`pl-5`:`pl-9`,o=e.id===`root`;return(0,J.jsxs)(`div`,{className:`flex w-full items-center gap-1 border-l-2 ${a} pr-2 py-1 text-xs whitespace-nowrap ${t?`border-info-fg bg-bg-raised`:`border-transparent hover:bg-bg-raised`}`,children:[e.expandable?(0,J.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),r(e.id)},className:`flex size-5 shrink-0 items-center justify-center rounded text-fg-muted hover:bg-bg-base hover:text-fg-default`,"aria-label":n?`Collapse`:`Expand`,children:n?(0,J.jsx)(Al,{className:`size-3.5`}):(0,J.jsx)(Pl,{className:`size-3.5`})}):(0,J.jsx)(`span`,{className:`size-5 shrink-0`}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{e.expandable&&!n&&r(e.id),i(e.id)},className:`flex flex-1 items-center gap-1.5 text-left`,children:[(0,J.jsx)(`span`,{className:`w-4 text-center opacity-80`,children:e.icon}),(0,J.jsx)(`span`,{className:`${o?`font-semibold`:``} ${e.excluded?`text-fg-muted line-through`:``}`,children:e.label}),e.count?(0,J.jsx)(`span`,{className:`text-[10px] text-fg-muted`,children:e.count}):null,e.badge?(0,J.jsx)(qL,{badge:e.badge}):null]})]})}function qL({badge:e}){return(0,J.jsx)(`span`,{className:`ml-auto rounded-full px-1.5 py-0.5 text-[9px] font-medium ${e.kind===`overridden`?`bg-warning-fg/15 text-warning-fg`:e.kind===`excluded`?`bg-danger-fg/15 text-danger-fg`:`bg-fg-muted/15 text-fg-muted`}`,children:e.text})}var JL={executionBias:`Execution bias`,replyStyle:`Reply style`,userOnboarding:`User onboarding`};function YL({selected:e,detail:t,edits:n,onSelect:r}){let i=t.isCurrent;return e===`root`||e===`main`?(0,J.jsx)(QL,{detail:t,edits:n,onSelect:r}):e===`plugins`?(0,J.jsx)($L,{detail:t,edits:n}):e===`main:tenant-prompt`?(0,J.jsx)(eR,{edits:n,isCurrent:i}):e.startsWith(`main:override:`)?(0,J.jsx)(tR,{okey:e.slice(14),detail:t,edits:n,isCurrent:i}):e.startsWith(`main:fragment:`)?(0,J.jsx)(nR,{fragmentId:e.slice(14),edits:n,isCurrent:i}):e===`main:tools`?(0,J.jsx)(XL,{title:`🔧 Tools`,sub:`Tools available to the main agent. Plugin / host tools are locked in; exclude tenant-owned tools you don't want.`,children:(0,J.jsx)(sR,{title:`Tools`,options:t.availableTools,excluded:n.toolsDeny,disabled:i,onToggle:e=>n.setToolsDeny(t=>RL(t,e))})}):e===`main:skills`?(0,J.jsx)(XL,{title:`📚 Skills`,sub:`Skills available to the main agent. Plugin / host skills are locked in; exclude tenant-owned skills you don't want.`,children:(0,J.jsx)(sR,{title:`Skills`,options:t.availableSkills,excluded:n.skillsDeny,disabled:i,onToggle:e=>n.setSkillsDeny(t=>RL(t,e))})}):e===`workers`?(0,J.jsx)(rR,{detail:t,edits:n}):e.startsWith(`worker:`)?(0,J.jsx)(iR,{selected:e,detail:t,edits:n}):(0,J.jsx)(XL,{title:`—`,sub:`Select a node from the Explorer.`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`Nothing selected.`})})}function XL({title:e,sub:t,children:n}){return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:e}),t?(0,J.jsx)(`div`,{className:`mb-4 mt-1 text-xs text-fg-muted`,children:t}):null,(0,J.jsx)(`div`,{className:`flex flex-col gap-3`,children:n})]})}function ZL({label:e,children:t}){return(0,J.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-fg-muted`,children:e}),t]})}function QL({detail:e,edits:t,onSelect:n}){let{spec:r,isCurrent:i}=e;return(0,J.jsxs)(XL,{title:`📦 ${t.name||r.name}`,sub:r.extractedFrom?`Extracted from tenant ${r.extractedFrom.tenantId} · v${r.extractedFrom.tianshuVersion}`:`Hand-authored solution.`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsx)(ZL,{label:`Name`,children:(0,J.jsx)(`input`,{value:t.name,disabled:i,onChange:e=>t.setName(e.target.value),className:`w-full rounded border border-border-subtle bg-bg-base px-2 py-1 text-xs disabled:opacity-60`})}),(0,J.jsx)(ZL,{label:`Description`,children:(0,J.jsx)(`input`,{value:t.description,disabled:i,onChange:e=>t.setDescription(e.target.value),className:`w-full rounded border border-border-subtle bg-bg-base px-2 py-1 text-xs disabled:opacity-60`})})]}),(0,J.jsxs)(`div`,{className:`rounded border border-info-fg/30 bg-info-fg/5 px-3 py-2 text-[11px] text-info-fg`,children:[(0,J.jsx)(`strong`,{children:`Save`}),` writes this solution to disk (no runtime effect). `,(0,J.jsx)(`strong`,{children:`Apply`}),` writes it into the running system — main-agent prompt / skills / tools + worker files take effect on the next agent turn. Plugin enable/disable is not applied in this phase.`]}),i?null:(0,J.jsx)(`button`,{type:`button`,onClick:()=>{let e=`frag-${Date.now()}`;t.setFragments(t=>[...t,{id:e,title:`Custom fragment`,body:``}]),n(`main:fragment:${e}`)},className:`self-start rounded-md border border-dashed border-border-subtle px-3 py-1.5 text-xs text-fg-muted hover:border-fg-muted hover:text-fg-default`,children:`+ Add custom fragment`}),i?(0,J.jsxs)(`div`,{className:`rounded border border-info-fg/30 bg-info-fg/5 px-3 py-2 text-[11px] text-info-fg`,children:[`This is the live `,(0,J.jsx)(`strong`,{children:`Current`}),` mirror — read-only. Click `,(0,J.jsx)(`strong`,{children:`Extract`}),` in the Solutions list to create an editable named solution.`]}):null]})}function $L({detail:e,edits:t}){let n=e.isCurrent;return(0,J.jsx)(XL,{title:`🧩 Plugins`,sub:`Which plugins this solution activates. Plugins decide what tools, skills and prompt fragments the rest of the solution can use.`,children:(0,J.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.availablePlugins.map(e=>{let r=t.pluginsEnabled.has(e.id);return(0,J.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 text-xs`,children:[(0,J.jsx)(`span`,{className:r?`font-medium`:`text-fg-muted line-through`,children:e.displayName}),(0,J.jsx)(`code`,{className:`text-[10px] text-fg-muted`,children:e.id}),(0,J.jsx)(oR,{origin:e.origin}),e.state===`active`?null:(0,J.jsx)(`span`,{className:`rounded bg-danger-fg/10 px-1.5 py-0.5 text-[10px] text-danger-fg`,children:e.state}),(0,J.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>t.setPluginsEnabled(t=>RL(t,e.id)),className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${r?`border-border-subtle bg-bg-elevated text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`:`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`}`,title:r?`Included — click to exclude from this solution.`:`Excluded — click to include.`,children:r?`Exclude`:`Include`})]},e.id)})})})}function eR({edits:e,isCurrent:t}){return(0,J.jsx)(XL,{title:`📝 Tenant prompt`,sub:`The main-agent prompt text for this solution.`,children:(0,J.jsx)(`textarea`,{value:e.tenantPrompt,disabled:t,onChange:t=>e.setTenantPrompt(t.target.value),rows:18,placeholder:t?``:`Main-agent prompt text for this solution. Leave empty for none.`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`})})}function tR({okey:e,detail:t,edits:n,isCurrent:r}){let i=t.mainBlocks.find(t=>t.overrideKey===e),a=n.overrides[e],o=a!=null,s=i?.defaultText??i?.text??``,c=t=>n.setOverrides(n=>({...n,[e]:t}));return(0,J.jsxs)(XL,{title:`⚙ ${JL[e]}`,sub:`Host-provided block. Override it for this solution, or keep the host default.`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[10px] font-medium ${o?`bg-warning-fg/15 text-warning-fg`:`bg-fg-muted/15 text-fg-muted`}`,children:o?`overridden`:`host default`}),r?null:o?(0,J.jsx)(`button`,{type:`button`,onClick:()=>c(null),className:`rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Reset to host default`}):(0,J.jsx)(`button`,{type:`button`,onClick:()=>c(s),className:`rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Override…`})]}),o?(0,J.jsx)(`textarea`,{value:a??``,disabled:r,onChange:e=>c(e.target.value),rows:16,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`}):(0,J.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded border border-border-subtle bg-bg-elevated p-2 font-mono text-[11px] leading-snug`,children:s})]})}function nR({fragmentId:e,edits:t,isCurrent:n}){let r=t.fragments.find(t=>t.id===e);if(!r)return(0,J.jsx)(XL,{title:`➕ Custom fragment`,sub:`This fragment was removed.`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`Fragment not found.`})});let i=n=>t.setFragments(t=>t.map(t=>t.id===e?{...t,...n}:t));return(0,J.jsxs)(XL,{title:`➕ Custom fragment`,sub:`Extra text injected into the main-agent prompt.`,children:[(0,J.jsx)(ZL,{label:`Title`,children:(0,J.jsx)(`input`,{value:r.title,disabled:n,onChange:e=>i({title:e.target.value}),placeholder:`Fragment title`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 text-xs disabled:opacity-60`})}),(0,J.jsx)(`textarea`,{value:r.body,disabled:n,onChange:e=>i({body:e.target.value}),rows:14,placeholder:`Fragment text injected into the main agent prompt…`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`}),n?null:(0,J.jsx)(`button`,{type:`button`,onClick:()=>t.setFragments(t=>t.filter(t=>t.id!==e)),className:`self-start rounded border border-danger-fg/40 px-2 py-0.5 text-[10px] text-danger-fg hover:bg-danger-fg/5`,children:`Remove fragment`})]})}function rR({detail:e,edits:t}){let{spec:n}=e,r=e.isCurrent;return(0,J.jsx)(XL,{title:`👥 Workers`,sub:`Include or exclude a worker here; expand it in the Explorer to edit its prompt / tools / skills. Excluded workers are dropped from the applied solution.`,children:(0,J.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[n.workers.map(e=>{let n=t.workerEdits[e.slug],i=n?!n.enabled:!e.enabled;return(0,J.jsxs)(`li`,{className:`flex items-center gap-2 rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 text-xs`,children:[(0,J.jsx)(`span`,{className:`font-medium ${i?`text-fg-muted line-through`:``}`,children:n?.name||e.name}),(0,J.jsx)(`code`,{className:`text-[10px] text-fg-muted`,children:e.slug}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-muted`,children:e.kind}),(0,J.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>{let n=t.workerEdits[e.slug];n&&t.setWorkerEdits(t=>({...t,[e.slug]:{...n,enabled:!n.enabled}}))},className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${i?`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`:`border-border-subtle bg-bg-raised text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`}`,title:i?`Excluded from this solution — click to include.`:`Included — click to exclude this worker from the solution.`,children:i?`Include`:`Exclude`})]},e.slug)}),n.workers.length===0?(0,J.jsx)(`li`,{className:`text-xs text-fg-muted`,children:`No workers.`}):null]})})}function iR({selected:e,detail:t,edits:n}){let r=t.isCurrent,[i,a]=aR(e.slice(7)),o=t.spec.workers.find(e=>e.slug===i),s=t.workerViews[i],c=n.workerEdits[i];if(!o||!s||!c)return(0,J.jsx)(XL,{title:`Worker`,sub:`Worker not found.`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`No such worker.`})});let l=e=>n.setWorkerEdits(t=>({...t,[i]:{...c,...e}})),u=!c.enabled;if(a===`soul`)return(0,J.jsx)(XL,{title:`📝 ${c.name} — SOUL.md`,sub:`The worker's persona + rules.`,children:(0,J.jsx)(`textarea`,{value:c.soul,disabled:r,onChange:e=>l({soul:e.target.value}),rows:18,placeholder:r?``:`Worker SOUL.md — the worker's persona + rules.`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`})});if(a===`override:executionBias`){let e=s.blocks.find(e=>e.overrideKey===`executionBias`),t=e?.defaultText??e?.text??``,n=c.executionBias!==null&&c.executionBias!==void 0;return(0,J.jsx)(XL,{title:`⚙ ${c.name} — Execution bias`,sub:`Host behaviour rules for this worker. Override to replace them just for this worker; reset to fall back to the host default.`,children:(0,J.jsxs)(`div`,{className:`rounded border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs`,children:[(0,J.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[10px] font-medium ${n?`bg-warning-fg/15 text-warning-fg`:`bg-fg-muted/15 text-fg-muted`}`,children:n?`overridden`:`host default`}),r?null:n?(0,J.jsx)(`button`,{type:`button`,onClick:()=>l({executionBias:null}),className:`ml-auto rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Reset to host default`}):(0,J.jsx)(`button`,{type:`button`,onClick:()=>l({executionBias:t}),className:`ml-auto rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Override…`})]}),n?(0,J.jsx)(`textarea`,{value:c.executionBias??``,disabled:r,onChange:e=>l({executionBias:e.target.value}),rows:14,className:`w-full border-t border-border-subtle bg-bg-base px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`}):(0,J.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap break-words border-t border-border-subtle bg-bg-base p-2 font-mono text-[11px] leading-snug`,children:t})]})})}return a===`tools`?(0,J.jsx)(XL,{title:`🔧 ${c.name} — Tools`,sub:`Tools this worker may use.`,children:(0,J.jsx)(sR,{title:`Tools`,options:s.availableTools,excluded:c.toolsDeny,disabled:r,onToggle:e=>l({toolsDeny:RL(c.toolsDeny,e)})})}):a===`skills`?(0,J.jsx)(XL,{title:`📚 ${c.name} — Skills`,sub:`Skills this worker may use.`,children:(0,J.jsx)(sR,{title:`Skills`,options:s.availableSkills,excluded:c.skillsDeny,disabled:r,onToggle:e=>l({skillsDeny:RL(c.skillsDeny,e)})})}):(0,J.jsxs)(XL,{title:`${u?`📋`:`🤖`} ${c.name}`,sub:`Worker fields. Expand sub-nodes in the Explorer for SOUL, tools, and skills.`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`code`,{className:`text-[10px] text-fg-muted`,children:o.slug}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-muted`,children:o.kind}),(0,J.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>l({enabled:!c.enabled}),className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${u?`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`:`border-border-subtle bg-bg-elevated text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`}`,title:u?`Excluded from this solution — click to include.`:`Included — click to exclude this worker from the solution.`,children:u?`Include`:`Exclude`})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsx)(ZL,{label:`Name`,children:(0,J.jsx)(`input`,{value:c.name,disabled:r,onChange:e=>l({name:e.target.value}),className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 text-xs disabled:opacity-60`})}),(0,J.jsx)(ZL,{label:`Model id (empty = default)`,children:(0,J.jsx)(`input`,{value:c.modelId??``,disabled:r,onChange:e=>l({modelId:e.target.value.trim().length>0?e.target.value:null}),className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 font-mono text-xs disabled:opacity-60`})}),(0,J.jsx)(ZL,{label:`Description`,children:(0,J.jsx)(`input`,{value:c.description??``,disabled:r,onChange:e=>l({description:e.target.value.trim().length>0?e.target.value:null}),className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 text-xs disabled:opacity-60`})})]})]})}function aR(e){let t=e.indexOf(`:`);return t===-1?[e,void 0]:[e.slice(0,t),e.slice(t+1)]}function oR({origin:e}){let{label:t,className:n}={core:{label:`core`,className:`bg-info-fg/10 text-info-fg`},"builtin-plugin":{label:`built-in`,className:`bg-success-fg/10 text-success-fg`},"tenant-plugin":{label:`tenant plugin`,className:`bg-warning-fg/10 text-warning-fg`},host:{label:`host`,className:`bg-info-fg/10 text-info-fg`},workspace:{label:`workspace`,className:`bg-warning-fg/10 text-warning-fg`},tenant:{label:`tenant`,className:`bg-warning-fg/10 text-warning-fg`}}[e];return(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${n}`,children:t})}function sR({title:e,options:t,excluded:n,disabled:r,onToggle:i}){let a=t.filter(e=>!e.locked&&n.has(e.name)).length,o=new Map;for(let e of t){let t=e.pluginId||lR(e.origin),n=o.get(t);n?n.push(e):o.set(t,[e])}let s=[...o.keys()].sort((e,t)=>{let n=e=>e===`core`||e===`host`?0:1;return n(e)===n(t)?e.localeCompare(t):n(e)-n(t)});return(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border-subtle`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 bg-bg-elevated px-3 py-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-semibold`,children:e}),(0,J.jsx)(`span`,{className:`text-[11px] text-fg-muted`,children:t.length}),a>0?(0,J.jsxs)(`span`,{className:`ml-auto rounded-full bg-danger-fg/10 px-2 py-0.5 text-[10px] font-medium text-danger-fg`,children:[a,` excluded`]}):null]}),(0,J.jsxs)(`div`,{className:`max-h-[60vh] overflow-auto bg-bg-base`,children:[s.map(e=>{let t=o.get(e);return(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center gap-2 bg-bg-base/95 px-3 pb-1 pt-2 backdrop-blur`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-semibold text-fg-default`,children:uR(e)}),(0,J.jsx)(`span`,{className:`rounded-full bg-fg-muted/10 px-1.5 text-[10px] text-fg-muted`,children:t.length})]}),(0,J.jsx)(`ul`,{className:`px-1.5 pb-1`,children:t.map(e=>(0,J.jsx)(cR,{option:e,isExcluded:n.has(e.name),disabled:r,onToggle:i},e.name))})]},e)}),t.length===0?(0,J.jsx)(`div`,{className:`px-3 py-3 text-xs text-fg-muted`,children:`None.`}):null]})]})}function cR({option:e,isExcluded:t,disabled:n,onToggle:r}){return(0,J.jsxs)(`li`,{className:`group flex items-center gap-2 rounded px-2 py-1 ${e.locked?``:`hover:bg-bg-elevated`}`,children:[(0,J.jsx)(`code`,{className:`font-mono text-[11px] ${t?`text-fg-muted line-through`:e.locked?`text-fg-muted`:`text-fg-default`}`,children:e.name}),e.locked?(0,J.jsx)(`span`,{className:`ml-auto`,title:`Contributed by a plugin or the host — always included.`,children:(0,J.jsx)(mb,{className:`size-3 text-fg-muted/50`,"aria-label":`locked`})}):(0,J.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>r(e.name),className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${t?`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`:`border-border-subtle bg-bg-elevated text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`}`,title:t?`Currently excluded — click to include again.`:`Currently included — click to exclude from this solution.`,children:t?`Include`:`Exclude`})]})}function lR(e){return e===`core`?`core`:`host`}function uR(e){return e===`core`?`Core`:e===`host`?`Host`:e}function dR({selected:e,detail:t,edits:n}){return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(fR,{title:`Inspector`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-default`,children:pR(e,t,n)})}),(0,J.jsx)(fR,{title:`Diff vs reality`,children:n.diff===null?(0,J.jsx)(`button`,{type:`button`,onClick:()=>void n.runDiff(),disabled:n.busy,className:`rounded border border-border-subtle px-2 py-1 text-[11px] hover:bg-bg-raised disabled:opacity-50`,children:`Compute diff`}):n.diff.entries.length===0?(0,J.jsx)(`div`,{className:`text-[11px] text-fg-muted`,children:`No differences — solution matches reality.`}):(0,J.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:n.diff.entries.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-1.5 py-0.5 font-mono text-[11px]`,children:[(0,J.jsx)(`span`,{className:`rounded px-1 text-[9px] ${e.op===`add`?`bg-success-fg/15 text-success-fg`:e.op===`remove`?`bg-danger-fg/15 text-danger-fg`:`bg-warning-fg/15 text-warning-fg`}`,children:e.op===`add`?`add`:e.op===`remove`?`rem`:`chg`}),(0,J.jsx)(`code`,{className:`truncate`,children:e.path})]},e.path))})}),(0,J.jsx)(fR,{title:`Rendered preview`,children:(0,J.jsx)(`pre`,{className:`max-h-[40vh] overflow-auto whitespace-pre-wrap break-words rounded border border-border-subtle bg-bg-base p-2.5 font-mono text-[11px] leading-relaxed text-fg-muted`,children:mR(e,t,n)||`—`})})]})}function fR({title:e,children:t}){return(0,J.jsxs)(`div`,{className:`border-b border-border-subtle px-3.5 py-3`,children:[(0,J.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-fg-muted`,children:e}),t]})}function pR(e,t,n){if(e===`plugins`)return`Plugin set drives the available tools (${t.availableTools.length}), skills (${t.availableSkills.length}) and prompt fragments below. ${n.pluginsEnabled.size} of ${t.availablePlugins.length} enabled.`;if(e===`root`||e===`main`)return`Main agent: ${t.mainBlocks.length} prompt blocks, ${t.availableTools.length} tools, ${t.availableSkills.length} skills, ${t.spec.workers.length} workers.`;if(e===`main:tenant-prompt`)return`The tenant prompt is the editable body of the main-agent system prompt for this solution.`;if(e.startsWith(`main:override:`)){let t=e.slice(14);return n.overrides[t]===null?`Using the host default. Override it to customise this block for the solution.`:`Overridden for this solution. The host default is replaced by your text below.`}if(e.startsWith(`main:fragment:`))return`A custom prompt fragment appended to the main-agent prompt.`;if(e===`main:tools`)return`${t.availableTools.length} tools available · ${n.toolsDeny.size} excluded.`;if(e===`main:skills`)return`${t.availableSkills.length} skills available · ${n.skillsDeny.size} excluded.`;if(e===`workers`){let e=t.spec.workers.filter(e=>{let t=n.workerEdits[e.slug];return t?!t.enabled:!e.enabled}).length;return`${t.spec.workers.length} workers · ${e} excluded.`}if(e.startsWith(`worker:`)){let r=e.slice(7),i=r.includes(`:`)?r.slice(0,r.indexOf(`:`)):r,a=t.workerViews[i],o=n.workerEdits[i];if(a&&o){let e=!o.enabled;return`${o.name}${e?` (excluded)`:``}: ${a.availableTools.length} tools, ${a.availableSkills.length} skills. ${o.toolsDeny.size+o.skillsDeny.size} excluded.`}return`Worker node.`}return`Select a node to inspect.`}function mR(e,t,n){if(e===`main:tenant-prompt`)return n.tenantPrompt;if(e.startsWith(`main:override:`)){let r=e.slice(14),i=n.overrides[r];if(i!=null)return i;let a=t.mainBlocks.find(e=>e.overrideKey===r);return a?.defaultText??a?.text??``}if(e.startsWith(`main:fragment:`)){let t=e.slice(14);return n.fragments.find(e=>e.id===t)?.body??``}if(e===`root`||e===`main`)return t.mainBlocks.map(e=>e.kind===`tenant-prompt`?n.tenantPrompt:e.overrideKey?n.overrides[e.overrideKey]??e.defaultText??e.text:e.customFragmentId?n.fragments.find(t=>t.id===e.customFragmentId)?.body??e.text:e.text).filter(e=>e&&e.trim().length>0).join(`
|
|
39
|
+
…(truncated)`}function bL({label:e,children:t}){return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-fg-faint mb-0.5`,children:e}),t]})}function xL({path:e}){let t=dF(),n=e.replace(/^workspace:\/\/+/,`/`),r=n.split(`/`).filter(Boolean).pop()||n;return(0,J.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),t(n)},className:`inline-flex items-center gap-1 max-w-full text-[10.5px] font-mono text-success hover:underline truncate`,title:n,children:[(0,J.jsx)(qm,{className:`w-3 h-3 shrink-0 opacity-70`}),(0,J.jsx)(`span`,{className:`truncate`,children:r})]})}var SL=[`echo`,`qianliyan`,`luban`,`xihe`,`nvwa`];function CL({projects:e,workerRoles:t,allTasks:n,onSubmit:r,onCancel:i}){let[a,o]=(0,d.useState)(``),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(0),[m,h]=(0,d.useState)(``),[g,_]=(0,d.useState)([]),[v,y]=(0,d.useState)(!1),b=(0,d.useRef)(null);(0,d.useEffect)(()=>{b.current?.focus()},[]);let x=()=>{let e=a.trim();if(!e){i();return}r({title:e,description:s.trim()||void 0,project:l.trim()||void 0,priority:f||void 0,workerRole:m.trim()||void 0,dependsOn:g.length>0?g:void 0})};return(0,J.jsxs)(`li`,{className:`rounded border border-blue-500/50 bg-bg-elevated/70 p-1.5 space-y-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(`input`,{ref:b,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),x()):e.key===`Escape`&&i())},placeholder:`Task title...`,className:`flex-1 min-w-0 bg-bg-raised border border-border-default rounded px-2 py-1 text-[11.5px] text-fg-default outline-none focus:border-blue-500`}),(0,J.jsx)(`button`,{type:`button`,title:v?`Less`:`More fields`,onClick:()=>y(e=>!e),className:`p-0.5 text-fg-faint hover:text-fg-default`,children:(0,J.jsx)(Al,{className:`w-3 h-3 transition-transform ${v?`rotate-180`:``}`})}),(0,J.jsx)(`button`,{type:`button`,onClick:i,className:`p-0.5 text-fg-faint hover:text-fg-default`,title:`Cancel`,children:(0,J.jsx)(AP,{className:`w-3 h-3`})})]}),v&&(0,J.jsxs)(`div`,{className:`space-y-2 pt-0.5`,children:[(0,J.jsx)(wL,{label:`Description`,children:(0,J.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),placeholder:`Optional notes for the worker...`,rows:2,className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500 resize-y`})}),(0,J.jsx)(wL,{label:`Project`,children:(0,J.jsx)(`input`,{list:`workboard-add-projects`,value:l,onChange:e=>u(e.target.value),placeholder:`inbox`,className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`})}),(0,J.jsxs)(`div`,{className:`grid grid-cols-[1fr_72px] gap-2`,children:[(0,J.jsx)(wL,{label:`Worker`,children:(0,J.jsx)(`input`,{list:`workboard-add-roles`,value:m,onChange:e=>h(e.target.value),placeholder:`any`,className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`})}),(0,J.jsx)(wL,{label:`Priority`,children:(0,J.jsx)(`input`,{type:`number`,value:f,onChange:e=>p(Number(e.target.value)||0),className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`})})]}),(0,J.jsx)(wL,{label:`Depends on`,children:(0,J.jsx)(TL,{value:g,onChange:_,candidates:n,project:l})}),(0,J.jsx)(`datalist`,{id:`workboard-add-roles`,children:t.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsx)(`datalist`,{id:`workboard-add-projects`,children:e.map(e=>(0,J.jsx)(`option`,{value:e.project},e.project))})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 pt-1`,children:[(0,J.jsx)(`span`,{className:`text-[9.5px] text-fg-fainter truncate`,children:v?`Enter saves`:`Enter · Esc cancel`}),(0,J.jsx)(`button`,{type:`button`,onClick:x,disabled:!a.trim(),className:`ml-auto px-2.5 py-0.5 text-[10.5px] rounded bg-blue-700 hover:bg-blue-600 text-white disabled:opacity-50 disabled:cursor-not-allowed`,children:`Add`})]})]})}function wL({label:e,children:t}){return(0,J.jsxs)(`label`,{className:`block`,children:[(0,J.jsx)(`span`,{className:`block text-[9px] uppercase tracking-wide text-fg-faint mb-0.5`,children:e}),t]})}function TL({value:e,onChange:t,candidates:n,project:r,excludeId:i}){let a=(0,d.useMemo)(()=>new Map(n.map(e=>[e.id,e])),[n]),o=(0,d.useMemo)(()=>{let t=(r??``).trim();return n.filter(n=>n.id===i||e.includes(n.id)?!1:t?t===tL?!n.project||n.project===tL:n.project===t:!0)},[n,r,e,i]),s=n=>t(e.filter(e=>e!==n)),c=n=>{!n||e.includes(n)||t([...e,n])};return(0,J.jsxs)(`div`,{className:`space-y-1`,children:[e.length>0&&(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.map(e=>{let t=a.get(e),n=t?t.title:`${e.slice(0,6)}... (deleted)`,r=t?.status===`done`;return(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded border ${r?`text-success bg-success/10 border-success/30`:`text-indigo-200 bg-indigo-500/15 border-indigo-500/40`}`,title:t?`${t.status} · ${t.id}`:e,children:[r?(0,J.jsx)(Ql,{className:`w-2.5 h-2.5`}):(0,J.jsx)(mb,{className:`w-2.5 h-2.5`}),(0,J.jsx)(`span`,{className:`truncate max-w-[140px]`,children:n}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`text-fg-muted hover:text-fg-default`,title:`Remove`,children:(0,J.jsx)(AP,{className:`w-2.5 h-2.5`})})]},e)})}),(0,J.jsxs)(`select`,{value:``,onChange:e=>{e.target.value&&(c(e.target.value),e.target.value=``)},className:`w-full bg-bg-raised border border-border-default rounded px-2 py-1 text-[11px] text-fg-default outline-none focus:border-blue-500`,children:[(0,J.jsx)(`option`,{value:``,children:o.length===0?e.length===0?`(no other tasks)`:`(no more candidates)`:`Add prerequisite...`}),o.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[`[`,e.status,`] `,e.title]},e.id))]})]})}function EL({chips:e,active:t,onPick:n,showAll:r,rightExtras:i}){return(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1.5 border-b border-border-subtle bg-bg-base/40 overflow-x-auto scrollbar-none flex-shrink-0`,children:[r&&(0,J.jsx)(DL,{active:!t,label:`All`,count:e.reduce((e,t)=>e+t.count,0),onClick:()=>n(``)}),e.map(e=>(0,J.jsx)(DL,{active:t===e.key,label:e.label,count:e.count,onClick:()=>n(t===e.key?``:e.key)},e.key||`all`)),i]})}function DL({active:e,label:t,count:n,onClick:r}){return(0,J.jsxs)(`button`,{onClick:r,className:[`shrink-0 inline-flex items-center gap-1 rounded-full text-[11px] transition-colors px-2.5 py-0.5`,e?`bg-blue-500/20 border border-blue-400/50 text-blue-200`:`text-fg-muted hover:text-fg-default hover:bg-bg-raised/60 border border-transparent`].join(` `),children:[(0,J.jsx)(`span`,{children:t}),(0,J.jsx)(`span`,{className:e?`text-blue-300/80`:`text-fg-fainter`,children:n})]})}function OL(e){let[t,n]=(0,d.useState)(null),r=(0,d.useCallback)(async()=>{try{n(await rL(`${eL}/workers/status`))}catch{n(null)}},[]);(0,d.useEffect)(()=>{r();let e=window.setInterval(()=>void r(),5e3);return()=>window.clearInterval(e)},[r]);let i=t?.workers??[],a=i.filter(e=>e.busy).length;return(0,J.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,J.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,J.jsx)(MP,{size:14,className:`flex-shrink-0 text-fg-fainter`}),(0,J.jsx)(`span`,{className:`flex-1 text-sm font-medium text-fg-muted`,children:`Workers`}),(0,J.jsxs)(`span`,{className:`rounded bg-bg-raised px-1.5 py-0.5 text-[9px] text-fg-fainter`,children:[a,`/`,i.length,` busy`]})]}),(0,J.jsx)(`div`,{className:`space-y-1.5`,children:i.length===0?(0,J.jsx)(`div`,{className:`text-[10px] text-fg-fainter px-1`,children:`No workers running. Toggle echo on under Settings → Plugins → Workboard.`}):i.map(e=>(0,J.jsx)(kL,{name:e.name,kind:e.kind,busy:e.busy},e.agentId))})]})}function kL({name:e,kind:t,busy:n}){let r=AL(t);return(0,J.jsxs)(`div`,{className:`flex cursor-default items-center gap-2 rounded py-0.5 pl-1 hover:bg-bg-hover/30`,title:`Agent: ${e}\nWorker type: ${t}`,children:[(0,J.jsx)(`span`,{className:`w-5 flex-shrink-0 text-center text-base`,children:r}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`div`,{className:`truncate text-xs font-medium text-fg-default`,children:e}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:`truncate rounded bg-bg-raised/80 px-1 py-px font-mono text-[9px] font-semibold uppercase tracking-wide text-fg-muted`,children:t}),(0,J.jsx)(`span`,{className:`rounded px-1 py-px text-[9px] ${n?`bg-blue-900/40 text-blue-100 border border-blue-700`:`bg-bg-raised/60 text-fg-fainter`}`,children:n?`busy`:`idle`})]})]})]})}function AL(e){return e===`echo`?`🔁`:`⚙️`}function jL(e){let t=Math.max(0,Date.now()-e),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}var ML={components:{WorkboardPanel:cL,WorkersSidebarSection:OL,WorkerAgentsPage:JI}};ML.components;var NL=`/api/p/workforce-studio`;async function PL(e,t){let n=await fetch(`${NL}${e}`,{credentials:`include`,headers:{"Content-Type":`application/json`},...t}),r=await n.json();if(!r.ok)throw Error(r.error||`HTTP ${n.status}`);return r}function FL(e){let t={executionBias:null,replyStyle:null,userOnboarding:null};for(let n of e)n.overrideKey&&n.overridden&&(t[n.overrideKey]=n.text);return t}function IL(e){return e.filter(e=>e.customFragmentId).map(e=>({id:e.customFragmentId,title:e.title,body:e.text}))}function LL(e,t,n){let r={};for(let i of e){let e=n[i.slug]?.blocks.find(e=>e.overrideKey===`executionBias`);r[i.slug]={name:i.name,description:i.description,modelId:i.modelId,enabled:i.enabled,soul:t[i.slug]??``,executionBias:e?.overridden?e.text:null,skillsDeny:new Set,toolsDeny:new Set}}return r}function RL(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function zL(e,t,n){let{spec:r}=e,[i,a]=(0,d.useState)(r.name),[o,s]=(0,d.useState)(r.description),[c,l]=(0,d.useState)(e.tenantPrompt??``),[u,f]=(0,d.useState)(()=>new Set(r.mainAgent.skillsDeny)),[p,m]=(0,d.useState)(()=>new Set(r.mainAgent.toolsDeny??[])),[h,g]=(0,d.useState)(()=>FL(e.mainBlocks)),[_,v]=(0,d.useState)(()=>IL(e.mainBlocks)),[y,b]=(0,d.useState)(()=>LL(r.workers,e.workerPrompts,e.workerViews)),[x,S]=(0,d.useState)(()=>new Set(r.plugins.enabled)),[C,w]=(0,d.useState)(null),[T,E]=(0,d.useState)(!1),[ee,D]=(0,d.useState)(!1),[te,ne]=(0,d.useState)(null),re=(0,d.useCallback)(()=>ne(null),[]);(0,d.useEffect)(()=>{S(new Set(r.plugins.enabled))},[r.slug,r.plugins.enabled]),(0,d.useEffect)(()=>{b(LL(r.workers,e.workerPrompts,e.workerViews))},[r.slug,r.workers,e.workerPrompts,e.workerViews]),(0,d.useEffect)(()=>{a(r.name),s(r.description),l(e.tenantPrompt??``),f(new Set(r.mainAgent.skillsDeny)),m(new Set(r.mainAgent.toolsDeny??[])),g(FL(e.mainBlocks)),v(IL(e.mainBlocks)),w(null)},[r.slug,r.name,r.description,e.tenantPrompt,e.mainBlocks,r.mainAgent.skillsDeny,r.mainAgent.toolsDeny]);let ie=(0,d.useCallback)(async()=>{E(!0);try{w((await PL(`/solutions/${encodeURIComponent(r.slug)}/diff?against=reality`)).diff)}finally{E(!1)}},[r.slug]),ae=(0,d.useCallback)(()=>{D(!0)},[]),oe=(0,d.useCallback)(()=>{D(!1)},[]),se=(0,d.useCallback)(async()=>{D(!1),E(!0);try{let e=await PL(`/solutions/${encodeURIComponent(r.slug)}/activate`,{method:`POST`});ne({kind:`success`,text:`“${r.name}” is now the active solution. Workers updated: ${e.appliedWorkers.length}. Takes effect on the next agent turn.`}),n?.()}catch(e){ne({kind:`error`,text:`Activate failed: ${e instanceof Error?e.message:String(e)}`})}finally{E(!1)}},[r.slug,r.name,n]);return{name:i,setName:a,description:o,setDescription:s,tenantPrompt:c,setTenantPrompt:l,skillsDeny:u,setSkillsDeny:f,toolsDeny:p,setToolsDeny:m,overrides:h,setOverrides:g,fragments:_,setFragments:v,workerEdits:y,setWorkerEdits:b,pluginsEnabled:x,setPluginsEnabled:S,diff:C,setDiff:w,busy:T,runDiff:ie,save:(0,d.useCallback)(async()=>{E(!0);try{let n={slug:r.slug,name:i,description:o,plugins:{enabled:[...x].sort()},mainAgent:{tenantPrompt:c.trim().length>0?c:null,skillsAllow:null,skillsDeny:[...u].sort(),toolsAllow:null,toolsDeny:[...p].sort(),overrides:{executionBias:h.executionBias,replyStyle:h.replyStyle,userOnboarding:h.userOnboarding},customFragments:_.map(e=>({id:e.id,title:e.title,body:e.body}))},workers:r.workers.map(t=>{let n=y[t.slug],r=e.workerViews[t.slug];if(!n||!r)return{slug:t.slug,kind:t.kind,name:t.name,description:t.description,modelId:t.modelId,enabled:t.enabled,systemPrompt:e.workerPrompts[t.slug]??null,toolsAllow:t.toolsAllow,skillsAllow:t.skillsAllow,overrides:{executionBias:null},source:t.source};let i=(e,t)=>e.filter(e=>!t.has(e.name)).map(e=>e.name).sort();return{slug:t.slug,kind:t.kind,name:n.name,description:n.description,modelId:n.modelId,enabled:n.enabled,systemPrompt:n.soul.trim().length>0?n.soul:null,toolsAllow:i(r.availableTools,n.toolsDeny),skillsAllow:i(r.availableSkills,n.skillsDeny),overrides:{executionBias:n.executionBias&&n.executionBias.trim().length>0?n.executionBias:null},source:t.source}})};await PL(`/solutions/save`,{method:`POST`,body:JSON.stringify(n)}),t()}finally{E(!1)}},[r,i,o,e,c,u,p,h,_,y,x,t]),activatePending:ee,requestActivate:ae,confirmActivate:se,cancelActivate:oe,notice:te,clearNotice:re}}var BL={executionBias:{icon:`⚙`,label:`Execution bias`},replyStyle:{icon:`💬`,label:`Reply style`},userOnboarding:{icon:`👋`,label:`User onboarding`}};function VL(e,t,n){let{spec:r}=e,i=[];if(i.push({id:`root`,label:t.name||r.name,icon:`📦`,depth:0}),i.push({id:`plugins`,label:`Plugins`,icon:`🧩`,depth:1,count:`${t.pluginsEnabled.size}/${e.availablePlugins.length}`}),i.push({id:`main`,label:`Main agent`,icon:`🤖`,depth:1,expandable:!0}),n.has(`main`)){i.push({id:`main:tenant-prompt`,label:`Tenant prompt`,icon:`📝`,depth:2});for(let e of Object.keys(BL)){let n=BL[e],r=t.overrides[e]!==null;i.push({id:`main:override:${e}`,label:n.label,icon:n.icon,depth:2,badge:r?{kind:`overridden`,text:`overridden`}:void 0})}for(let e of t.fragments)i.push({id:`main:fragment:${e.id}`,label:`Custom: ${e.title||`untitled`}`,icon:`➕`,depth:2});i.push({id:`main:tools`,label:`Tools`,icon:`🔧`,depth:2,count:`${e.availableTools.length}`,badge:HL(t.toolsDeny.size)}),i.push({id:`main:skills`,label:`Skills`,icon:`📚`,depth:2,count:`${e.availableSkills.length}`,badge:HL(t.skillsDeny.size)})}if(i.push({id:`workers`,label:`Workers`,icon:`👥`,depth:1,count:`${r.workers.length}`,expandable:!0}),n.has(`workers`))for(let a of r.workers){let r=t.workerEdits[a.slug],o=e.workerViews[a.slug],s=r?!r.enabled:!a.enabled,c=`worker:${a.slug}`;if(i.push({id:c,label:r?.name||a.name,icon:UL(a.kind),depth:1,excluded:s,expandable:!0,badge:s?{kind:`excluded`,text:`excluded`}:void 0}),n.has(c)){i.push({id:`${c}:soul`,label:`SOUL.md`,icon:`📝`,depth:2});let e=!!r&&r.executionBias!==null;i.push({id:`${c}:override:executionBias`,label:`Execution bias`,icon:`⚙`,depth:2,badge:e?{kind:`overridden`,text:`overridden`}:void 0}),i.push({id:`${c}:tools`,label:`Tools`,icon:`🔧`,depth:2,count:o?`${o.availableTools.length}`:void 0,badge:HL(r?.toolsDeny.size??0)}),i.push({id:`${c}:skills`,label:`Skills`,icon:`📚`,depth:2,count:o?`${o.availableSkills.length}`:void 0,badge:HL(r?.skillsDeny.size??0)})}}return i}function HL(e){return e>0?{kind:`excluded`,text:String(e)}:void 0}function UL(e){let t=e.toLowerCase();return t.includes(`research`)?`🔎`:t.includes(`cod`)||t.includes(`dev`)?`💻`:t.includes(`review`)?`📋`:`🤖`}function WL(e){let t=new Set([`main`,`workers`]);for(let n of e.spec.workers)t.add(`worker:${n.slug}`);return t}function GL({detail:e,edits:t,expanded:n,onToggleExpand:r,selected:i,onSelect:a}){return(0,J.jsx)(`div`,{className:`py-2`,children:VL(e,t,n).map(e=>(0,J.jsx)(KL,{node:e,isSelected:i===e.id,isExpanded:n.has(e.id),onToggleExpand:r,onSelect:a},e.id))})}function KL({node:e,isSelected:t,isExpanded:n,onToggleExpand:r,onSelect:i}){let a=e.depth===0?`pl-2`:e.depth===1?`pl-5`:`pl-9`,o=e.id===`root`;return(0,J.jsxs)(`div`,{className:`flex w-full items-center gap-1 border-l-2 ${a} pr-2 py-1 text-xs whitespace-nowrap ${t?`border-info-fg bg-info-fg/10`:`border-transparent hover:bg-bg-hover`}`,children:[e.expandable?(0,J.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),r(e.id)},className:`flex size-5 shrink-0 items-center justify-center rounded text-fg-muted hover:bg-bg-base hover:text-fg-default`,"aria-label":n?`Collapse`:`Expand`,children:n?(0,J.jsx)(Al,{className:`size-3.5`}):(0,J.jsx)(Pl,{className:`size-3.5`})}):(0,J.jsx)(`span`,{className:`size-5 shrink-0`}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{e.expandable&&!n&&r(e.id),i(e.id)},className:`flex flex-1 items-center gap-1.5 text-left`,children:[(0,J.jsx)(`span`,{className:`w-4 text-center opacity-80`,children:e.icon}),(0,J.jsx)(`span`,{className:`${o?`font-semibold`:``} ${e.excluded?`text-fg-muted line-through`:``}`,children:e.label}),e.count?(0,J.jsx)(`span`,{className:`text-[10px] text-fg-muted`,children:e.count}):null,e.badge?(0,J.jsx)(qL,{badge:e.badge}):null]})]})}function qL({badge:e}){return(0,J.jsx)(`span`,{className:`ml-auto rounded-full px-1.5 py-0.5 text-[9px] font-medium ${e.kind===`overridden`?`bg-warning-fg/15 text-warning-fg`:e.kind===`excluded`?`bg-danger-fg/15 text-danger-fg`:`bg-fg-muted/15 text-fg-muted`}`,children:e.text})}var JL={executionBias:`Execution bias`,replyStyle:`Reply style`,userOnboarding:`User onboarding`};function YL({selected:e,detail:t,edits:n,onSelect:r}){let i=t.isCurrent;return e===`root`||e===`main`?(0,J.jsx)(QL,{detail:t,edits:n,onSelect:r}):e===`plugins`?(0,J.jsx)($L,{detail:t,edits:n}):e===`main:tenant-prompt`?(0,J.jsx)(eR,{edits:n,isCurrent:i}):e.startsWith(`main:override:`)?(0,J.jsx)(tR,{okey:e.slice(14),detail:t,edits:n,isCurrent:i}):e.startsWith(`main:fragment:`)?(0,J.jsx)(nR,{fragmentId:e.slice(14),edits:n,isCurrent:i}):e===`main:tools`?(0,J.jsx)(XL,{title:`🔧 Tools`,sub:`Tools available to the main agent. Plugin / host tools are locked in; exclude tenant-owned tools you don't want.`,children:(0,J.jsx)(sR,{title:`Tools`,options:t.availableTools,excluded:n.toolsDeny,disabled:i,onToggle:e=>n.setToolsDeny(t=>RL(t,e))})}):e===`main:skills`?(0,J.jsx)(XL,{title:`📚 Skills`,sub:`Skills available to the main agent. Plugin / host skills are locked in; exclude tenant-owned skills you don't want.`,children:(0,J.jsx)(sR,{title:`Skills`,options:t.availableSkills,excluded:n.skillsDeny,disabled:i,onToggle:e=>n.setSkillsDeny(t=>RL(t,e))})}):e===`workers`?(0,J.jsx)(rR,{detail:t,edits:n}):e.startsWith(`worker:`)?(0,J.jsx)(iR,{selected:e,detail:t,edits:n}):(0,J.jsx)(XL,{title:`—`,sub:`Select a node from the Explorer.`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`Nothing selected.`})})}function XL({title:e,sub:t,children:n}){return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:e}),t?(0,J.jsx)(`div`,{className:`mb-4 mt-1 text-xs text-fg-muted`,children:t}):null,(0,J.jsx)(`div`,{className:`flex flex-col gap-3`,children:n})]})}function ZL({label:e,children:t}){return(0,J.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-fg-muted`,children:e}),t]})}function QL({detail:e,edits:t,onSelect:n}){let{spec:r,isCurrent:i}=e;return(0,J.jsxs)(XL,{title:`📦 ${t.name||r.name}`,sub:r.extractedFrom?`Extracted from tenant ${r.extractedFrom.tenantId} · v${r.extractedFrom.tianshuVersion}`:`Hand-authored solution.`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsx)(ZL,{label:`Name`,children:(0,J.jsx)(`input`,{value:t.name,disabled:i,onChange:e=>t.setName(e.target.value),className:`w-full rounded border border-border-subtle bg-bg-base px-2 py-1 text-xs disabled:opacity-60`})}),(0,J.jsx)(ZL,{label:`Description`,children:(0,J.jsx)(`input`,{value:t.description,disabled:i,onChange:e=>t.setDescription(e.target.value),className:`w-full rounded border border-border-subtle bg-bg-base px-2 py-1 text-xs disabled:opacity-60`})})]}),(0,J.jsxs)(`div`,{className:`rounded border border-info-fg/30 bg-info-fg/5 px-3 py-2 text-[11px] text-info-fg`,children:[(0,J.jsx)(`strong`,{children:`Save`}),` writes this solution to disk (no runtime effect). `,(0,J.jsx)(`strong`,{children:`Apply`}),` writes it into the running system — main-agent prompt / skills / tools + worker files take effect on the next agent turn. Plugin enable/disable is not applied in this phase.`]}),i?null:(0,J.jsx)(`button`,{type:`button`,onClick:()=>{let e=`frag-${Date.now()}`;t.setFragments(t=>[...t,{id:e,title:`Custom fragment`,body:``}]),n(`main:fragment:${e}`)},className:`self-start rounded-md border border-dashed border-border-subtle px-3 py-1.5 text-xs text-fg-muted hover:border-fg-muted hover:text-fg-default`,children:`+ Add custom fragment`}),i?(0,J.jsxs)(`div`,{className:`rounded border border-info-fg/30 bg-info-fg/5 px-3 py-2 text-[11px] text-info-fg`,children:[`This is the live `,(0,J.jsx)(`strong`,{children:`Current`}),` mirror — read-only. Click `,(0,J.jsx)(`strong`,{children:`Extract`}),` in the Solutions list to create an editable named solution.`]}):null]})}function $L({detail:e,edits:t}){let n=e.isCurrent;return(0,J.jsx)(XL,{title:`🧩 Plugins`,sub:`Which plugins this solution activates. Plugins decide what tools, skills and prompt fragments the rest of the solution can use.`,children:(0,J.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.availablePlugins.map(e=>{let r=t.pluginsEnabled.has(e.id);return(0,J.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 text-xs`,children:[(0,J.jsx)(`span`,{className:r?`font-medium`:`text-fg-muted line-through`,children:e.displayName}),(0,J.jsx)(`code`,{className:`text-[10px] text-fg-muted`,children:e.id}),(0,J.jsx)(oR,{origin:e.origin}),e.state===`active`?null:(0,J.jsx)(`span`,{className:`rounded bg-danger-fg/10 px-1.5 py-0.5 text-[10px] text-danger-fg`,children:e.state}),(0,J.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>t.setPluginsEnabled(t=>RL(t,e.id)),className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${r?`border-border-subtle bg-bg-elevated text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`:`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`}`,title:r?`Included — click to exclude from this solution.`:`Excluded — click to include.`,children:r?`Exclude`:`Include`})]},e.id)})})})}function eR({edits:e,isCurrent:t}){return(0,J.jsx)(XL,{title:`📝 Tenant prompt`,sub:`The main-agent prompt text for this solution.`,children:(0,J.jsx)(`textarea`,{value:e.tenantPrompt,disabled:t,onChange:t=>e.setTenantPrompt(t.target.value),rows:18,placeholder:t?``:`Main-agent prompt text for this solution. Leave empty for none.`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`})})}function tR({okey:e,detail:t,edits:n,isCurrent:r}){let i=t.mainBlocks.find(t=>t.overrideKey===e),a=n.overrides[e],o=a!=null,s=i?.defaultText??i?.text??``,c=t=>n.setOverrides(n=>({...n,[e]:t}));return(0,J.jsxs)(XL,{title:`⚙ ${JL[e]}`,sub:`Host-provided block. Override it for this solution, or keep the host default.`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[10px] font-medium ${o?`bg-warning-fg/15 text-warning-fg`:`bg-fg-muted/15 text-fg-muted`}`,children:o?`overridden`:`host default`}),r?null:o?(0,J.jsx)(`button`,{type:`button`,onClick:()=>c(null),className:`rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Reset to host default`}):(0,J.jsx)(`button`,{type:`button`,onClick:()=>c(s),className:`rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Override…`})]}),o?(0,J.jsx)(`textarea`,{value:a??``,disabled:r,onChange:e=>c(e.target.value),rows:16,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`}):(0,J.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded border border-border-subtle bg-bg-elevated p-2 font-mono text-[11px] leading-snug`,children:s})]})}function nR({fragmentId:e,edits:t,isCurrent:n}){let r=t.fragments.find(t=>t.id===e);if(!r)return(0,J.jsx)(XL,{title:`➕ Custom fragment`,sub:`This fragment was removed.`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`Fragment not found.`})});let i=n=>t.setFragments(t=>t.map(t=>t.id===e?{...t,...n}:t));return(0,J.jsxs)(XL,{title:`➕ Custom fragment`,sub:`Extra text injected into the main-agent prompt.`,children:[(0,J.jsx)(ZL,{label:`Title`,children:(0,J.jsx)(`input`,{value:r.title,disabled:n,onChange:e=>i({title:e.target.value}),placeholder:`Fragment title`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 text-xs disabled:opacity-60`})}),(0,J.jsx)(`textarea`,{value:r.body,disabled:n,onChange:e=>i({body:e.target.value}),rows:14,placeholder:`Fragment text injected into the main agent prompt…`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`}),n?null:(0,J.jsx)(`button`,{type:`button`,onClick:()=>t.setFragments(t=>t.filter(t=>t.id!==e)),className:`self-start rounded border border-danger-fg/40 px-2 py-0.5 text-[10px] text-danger-fg hover:bg-danger-fg/5`,children:`Remove fragment`})]})}function rR({detail:e,edits:t}){let{spec:n}=e,r=e.isCurrent;return(0,J.jsx)(XL,{title:`👥 Workers`,sub:`Include or exclude a worker here; expand it in the Explorer to edit its prompt / tools / skills. Excluded workers are dropped from the applied solution.`,children:(0,J.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[n.workers.map(e=>{let n=t.workerEdits[e.slug],i=n?!n.enabled:!e.enabled;return(0,J.jsxs)(`li`,{className:`flex items-center gap-2 rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 text-xs`,children:[(0,J.jsx)(`span`,{className:`font-medium ${i?`text-fg-muted line-through`:``}`,children:n?.name||e.name}),(0,J.jsx)(`code`,{className:`text-[10px] text-fg-muted`,children:e.slug}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-muted`,children:e.kind}),(0,J.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>{let n=t.workerEdits[e.slug];n&&t.setWorkerEdits(t=>({...t,[e.slug]:{...n,enabled:!n.enabled}}))},className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${i?`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`:`border-border-subtle bg-bg-raised text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`}`,title:i?`Excluded from this solution — click to include.`:`Included — click to exclude this worker from the solution.`,children:i?`Include`:`Exclude`})]},e.slug)}),n.workers.length===0?(0,J.jsx)(`li`,{className:`text-xs text-fg-muted`,children:`No workers.`}):null]})})}function iR({selected:e,detail:t,edits:n}){let r=t.isCurrent,[i,a]=aR(e.slice(7)),o=t.spec.workers.find(e=>e.slug===i),s=t.workerViews[i],c=n.workerEdits[i];if(!o||!s||!c)return(0,J.jsx)(XL,{title:`Worker`,sub:`Worker not found.`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`No such worker.`})});let l=e=>n.setWorkerEdits(t=>({...t,[i]:{...c,...e}})),u=!c.enabled;if(a===`soul`)return(0,J.jsx)(XL,{title:`📝 ${c.name} — SOUL.md`,sub:`The worker's persona + rules.`,children:(0,J.jsx)(`textarea`,{value:c.soul,disabled:r,onChange:e=>l({soul:e.target.value}),rows:18,placeholder:r?``:`Worker SOUL.md — the worker's persona + rules.`,className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`})});if(a===`override:executionBias`){let e=s.blocks.find(e=>e.overrideKey===`executionBias`),t=e?.defaultText??e?.text??``,n=c.executionBias!==null&&c.executionBias!==void 0;return(0,J.jsx)(XL,{title:`⚙ ${c.name} — Execution bias`,sub:`Host behaviour rules for this worker. Override to replace them just for this worker; reset to fall back to the host default.`,children:(0,J.jsxs)(`div`,{className:`rounded border border-border-subtle bg-bg-elevated`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs`,children:[(0,J.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[10px] font-medium ${n?`bg-warning-fg/15 text-warning-fg`:`bg-fg-muted/15 text-fg-muted`}`,children:n?`overridden`:`host default`}),r?null:n?(0,J.jsx)(`button`,{type:`button`,onClick:()=>l({executionBias:null}),className:`ml-auto rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Reset to host default`}):(0,J.jsx)(`button`,{type:`button`,onClick:()=>l({executionBias:t}),className:`ml-auto rounded border border-border-subtle px-2 py-0.5 text-[10px] hover:bg-bg-raised`,children:`Override…`})]}),n?(0,J.jsx)(`textarea`,{value:c.executionBias??``,disabled:r,onChange:e=>l({executionBias:e.target.value}),rows:14,className:`w-full border-t border-border-subtle bg-bg-base px-2 py-1.5 font-mono text-[11px] leading-snug disabled:opacity-60`}):(0,J.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap break-words border-t border-border-subtle bg-bg-base p-2 font-mono text-[11px] leading-snug`,children:t})]})})}return a===`tools`?(0,J.jsx)(XL,{title:`🔧 ${c.name} — Tools`,sub:`Tools this worker may use.`,children:(0,J.jsx)(sR,{title:`Tools`,options:s.availableTools,excluded:c.toolsDeny,disabled:r,onToggle:e=>l({toolsDeny:RL(c.toolsDeny,e)})})}):a===`skills`?(0,J.jsx)(XL,{title:`📚 ${c.name} — Skills`,sub:`Skills this worker may use.`,children:(0,J.jsx)(sR,{title:`Skills`,options:s.availableSkills,excluded:c.skillsDeny,disabled:r,onToggle:e=>l({skillsDeny:RL(c.skillsDeny,e)})})}):(0,J.jsxs)(XL,{title:`${u?`📋`:`🤖`} ${c.name}`,sub:`Worker fields. Expand sub-nodes in the Explorer for SOUL, tools, and skills.`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`code`,{className:`text-[10px] text-fg-muted`,children:o.slug}),(0,J.jsx)(`span`,{className:`text-[10px] text-fg-muted`,children:o.kind}),(0,J.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>l({enabled:!c.enabled}),className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${u?`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`:`border-border-subtle bg-bg-elevated text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`}`,title:u?`Excluded from this solution — click to include.`:`Included — click to exclude this worker from the solution.`,children:u?`Include`:`Exclude`})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsx)(ZL,{label:`Name`,children:(0,J.jsx)(`input`,{value:c.name,disabled:r,onChange:e=>l({name:e.target.value}),className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 text-xs disabled:opacity-60`})}),(0,J.jsx)(ZL,{label:`Model id (empty = default)`,children:(0,J.jsx)(`input`,{value:c.modelId??``,disabled:r,onChange:e=>l({modelId:e.target.value.trim().length>0?e.target.value:null}),className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 font-mono text-xs disabled:opacity-60`})}),(0,J.jsx)(ZL,{label:`Description`,children:(0,J.jsx)(`input`,{value:c.description??``,disabled:r,onChange:e=>l({description:e.target.value.trim().length>0?e.target.value:null}),className:`w-full rounded border border-border-subtle bg-bg-elevated px-2 py-1 text-xs disabled:opacity-60`})})]})]})}function aR(e){let t=e.indexOf(`:`);return t===-1?[e,void 0]:[e.slice(0,t),e.slice(t+1)]}function oR({origin:e}){let{label:t,className:n}={core:{label:`core`,className:`bg-info-fg/10 text-info-fg`},"builtin-plugin":{label:`built-in`,className:`bg-success-fg/10 text-success-fg`},"tenant-plugin":{label:`tenant plugin`,className:`bg-warning-fg/10 text-warning-fg`},host:{label:`host`,className:`bg-info-fg/10 text-info-fg`},workspace:{label:`workspace`,className:`bg-warning-fg/10 text-warning-fg`},tenant:{label:`tenant`,className:`bg-warning-fg/10 text-warning-fg`}}[e];return(0,J.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${n}`,children:t})}function sR({title:e,options:t,excluded:n,disabled:r,onToggle:i}){let a=t.filter(e=>!e.locked&&n.has(e.name)).length,o=new Map;for(let e of t){let t=e.pluginId||lR(e.origin),n=o.get(t);n?n.push(e):o.set(t,[e])}let s=[...o.keys()].sort((e,t)=>{let n=e=>e===`core`||e===`host`?0:1;return n(e)===n(t)?e.localeCompare(t):n(e)-n(t)});return(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border-subtle`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 bg-bg-elevated px-3 py-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-semibold`,children:e}),(0,J.jsx)(`span`,{className:`text-[11px] text-fg-muted`,children:t.length}),a>0?(0,J.jsxs)(`span`,{className:`ml-auto rounded-full bg-danger-fg/10 px-2 py-0.5 text-[10px] font-medium text-danger-fg`,children:[a,` excluded`]}):null]}),(0,J.jsxs)(`div`,{className:`max-h-[60vh] overflow-auto bg-bg-base`,children:[s.map(e=>{let t=o.get(e);return(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center gap-2 bg-bg-base/95 px-3 pb-1 pt-2 backdrop-blur`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-semibold text-fg-default`,children:uR(e)}),(0,J.jsx)(`span`,{className:`rounded-full bg-fg-muted/10 px-1.5 text-[10px] text-fg-muted`,children:t.length})]}),(0,J.jsx)(`ul`,{className:`px-1.5 pb-1`,children:t.map(e=>(0,J.jsx)(cR,{option:e,isExcluded:n.has(e.name),disabled:r,onToggle:i},e.name))})]},e)}),t.length===0?(0,J.jsx)(`div`,{className:`px-3 py-3 text-xs text-fg-muted`,children:`None.`}):null]})]})}function cR({option:e,isExcluded:t,disabled:n,onToggle:r}){return(0,J.jsxs)(`li`,{className:`group flex items-center gap-2 rounded px-2 py-1 ${e.locked?``:`hover:bg-bg-elevated`}`,children:[(0,J.jsx)(`code`,{className:`font-mono text-[11px] ${t?`text-fg-muted line-through`:e.locked?`text-fg-muted`:`text-fg-default`}`,children:e.name}),e.locked?(0,J.jsx)(`span`,{className:`ml-auto`,title:`Contributed by a plugin or the host — always included.`,children:(0,J.jsx)(mb,{className:`size-3 text-fg-muted/50`,"aria-label":`locked`})}):(0,J.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>r(e.name),className:`ml-auto rounded-md border px-2 py-0.5 text-[10px] font-medium shadow-sm transition-colors active:translate-y-px disabled:opacity-50 ${t?`border-success-fg/40 bg-success-fg/10 text-success-fg hover:bg-success-fg/20`:`border-border-subtle bg-bg-elevated text-fg-default hover:border-danger-fg/40 hover:bg-danger-fg/10 hover:text-danger-fg`}`,title:t?`Currently excluded — click to include again.`:`Currently included — click to exclude from this solution.`,children:t?`Include`:`Exclude`})]})}function lR(e){return e===`core`?`core`:`host`}function uR(e){return e===`core`?`Core`:e===`host`?`Host`:e}function dR({selected:e,detail:t,edits:n}){return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(fR,{title:`Inspector`,children:(0,J.jsx)(`div`,{className:`text-xs text-fg-default`,children:pR(e,t,n)})}),(0,J.jsx)(fR,{title:`Diff vs reality`,children:n.diff===null?(0,J.jsx)(`button`,{type:`button`,onClick:()=>void n.runDiff(),disabled:n.busy,className:`rounded border border-border-subtle px-2 py-1 text-[11px] hover:bg-bg-raised disabled:opacity-50`,children:`Compute diff`}):n.diff.entries.length===0?(0,J.jsx)(`div`,{className:`text-[11px] text-fg-muted`,children:`No differences — solution matches reality.`}):(0,J.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:n.diff.entries.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-1.5 py-0.5 font-mono text-[11px]`,children:[(0,J.jsx)(`span`,{className:`rounded px-1 text-[9px] ${e.op===`add`?`bg-success-fg/15 text-success-fg`:e.op===`remove`?`bg-danger-fg/15 text-danger-fg`:`bg-warning-fg/15 text-warning-fg`}`,children:e.op===`add`?`add`:e.op===`remove`?`rem`:`chg`}),(0,J.jsx)(`code`,{className:`truncate`,children:e.path})]},e.path))})}),(0,J.jsx)(fR,{title:`Rendered preview`,children:(0,J.jsx)(`pre`,{className:`max-h-[40vh] overflow-auto whitespace-pre-wrap break-words rounded border border-border-subtle bg-bg-base p-2.5 font-mono text-[11px] leading-relaxed text-fg-muted`,children:mR(e,t,n)||`—`})})]})}function fR({title:e,children:t}){return(0,J.jsxs)(`div`,{className:`border-b border-border-subtle px-3.5 py-3`,children:[(0,J.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-fg-muted`,children:e}),t]})}function pR(e,t,n){if(e===`plugins`)return`Plugin set drives the available tools (${t.availableTools.length}), skills (${t.availableSkills.length}) and prompt fragments below. ${n.pluginsEnabled.size} of ${t.availablePlugins.length} enabled.`;if(e===`root`||e===`main`)return`Main agent: ${t.mainBlocks.length} prompt blocks, ${t.availableTools.length} tools, ${t.availableSkills.length} skills, ${t.spec.workers.length} workers.`;if(e===`main:tenant-prompt`)return`The tenant prompt is the editable body of the main-agent system prompt for this solution.`;if(e.startsWith(`main:override:`)){let t=e.slice(14);return n.overrides[t]===null?`Using the host default. Override it to customise this block for the solution.`:`Overridden for this solution. The host default is replaced by your text below.`}if(e.startsWith(`main:fragment:`))return`A custom prompt fragment appended to the main-agent prompt.`;if(e===`main:tools`)return`${t.availableTools.length} tools available · ${n.toolsDeny.size} excluded.`;if(e===`main:skills`)return`${t.availableSkills.length} skills available · ${n.skillsDeny.size} excluded.`;if(e===`workers`){let e=t.spec.workers.filter(e=>{let t=n.workerEdits[e.slug];return t?!t.enabled:!e.enabled}).length;return`${t.spec.workers.length} workers · ${e} excluded.`}if(e.startsWith(`worker:`)){let r=e.slice(7),i=r.includes(`:`)?r.slice(0,r.indexOf(`:`)):r,a=t.workerViews[i],o=n.workerEdits[i];if(a&&o){let e=!o.enabled;return`${o.name}${e?` (excluded)`:``}: ${a.availableTools.length} tools, ${a.availableSkills.length} skills. ${o.toolsDeny.size+o.skillsDeny.size} excluded.`}return`Worker node.`}return`Select a node to inspect.`}function mR(e,t,n){if(e===`main:tenant-prompt`)return n.tenantPrompt;if(e.startsWith(`main:override:`)){let r=e.slice(14),i=n.overrides[r];if(i!=null)return i;let a=t.mainBlocks.find(e=>e.overrideKey===r);return a?.defaultText??a?.text??``}if(e.startsWith(`main:fragment:`)){let t=e.slice(14);return n.fragments.find(e=>e.id===t)?.body??``}if(e===`root`||e===`main`)return t.mainBlocks.map(e=>e.kind===`tenant-prompt`?n.tenantPrompt:e.overrideKey?n.overrides[e.overrideKey]??e.defaultText??e.text:e.customFragmentId?n.fragments.find(t=>t.id===e.customFragmentId)?.body??e.text:e.text).filter(e=>e&&e.trim().length>0).join(`
|
|
40
40
|
|
|
41
41
|
`);if(e.startsWith(`worker:`)){let r=e.slice(7),i=r.indexOf(`:`),a=i===-1?r:r.slice(0,i),o=i===-1?void 0:r.slice(i+1),s=t.workerViews[a],c=n.workerEdits[a];if(!s||!c)return``;if(o===`soul`)return c.soul;if(o===`override:executionBias`){let e=s.blocks.find(e=>e.overrideKey===`executionBias`);return c.executionBias===null?e?.defaultText??e?.text??``:c.executionBias}return o===`tools`||o===`skills`?``:s.blocks.map(e=>e.kind===`worker-soul`?c.soul:e.overrideKey===`executionBias`&&c.executionBias!==null?c.executionBias:e.text).filter(e=>e&&e.trim().length>0).join(`
|
|
42
42
|
|
|
@@ -69,7 +69,7 @@ Minimum version required to store current data is: `+c+`.
|
|
|
69
69
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
70
70
|
`,...a.current()});return/^[\t ]/.test(l)&&(l=iY(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}uY.peek=dY;function uY(e){return e.value||``}function dY(){return`<`}fY.peek=pY;function fY(e,t,n,r){let i=tY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function pY(){return`!`}mY.peek=hY;function mY(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function hY(){return`!`}gY.peek=_Y;function gY(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function _Y(){return"`"}function vY(e,t){let n=qH(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yY.peek=bY;function yY(e,t,n,r){let i=tY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(vY(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function bY(e,t,n){return vY(e,n)?`<`:`[`}xY.peek=SY;function xY(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function SY(){return`[`}function CY(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wY(e){let t=CY(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function TY(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function EY(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function DY(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?TY(n):CY(n),s=e.ordered?o===`.`?`)`:`.`:wY(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),EY(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function OY(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function kY(e,t,n,r){let i=OY(n),a=n.bulletCurrent||CY(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function AY(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var jY=oK([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function MY(e,t,n,r){return(e.children.some(function(e){return jY(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function NY(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}PY.peek=FY;function PY(e,t,n,r){let i=NY(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=aY(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=iY(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=aY(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+iY(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function FY(e,t,n){return n.options.strong||`*`}function IY(e,t,n,r){return n.safe(e.value,r)}function LY(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function RY(e,t,n){let r=(EY(n)+(n.options.ruleSpaces?` `:``)).repeat(LY(n));return n.options.ruleSpaces?r.slice(0,-1):r}var zY={blockquote:GJ,break:YJ,code:$J,definition:nY,emphasis:oY,hardBreak:YJ,heading:lY,html:uY,image:fY,imageReference:mY,inlineCode:gY,link:yY,linkReference:xY,list:DY,listItem:kY,paragraph:AY,root:MY,strong:PY,text:IY,thematicBreak:RY};function BY(){return{enter:{table:VY,tableData:GY,tableHeader:GY,tableRow:UY},exit:{codeText:KY,table:HY,tableData:WY,tableHeader:WY,tableRow:WY}}}function VY(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function HY(e){this.exit(e),this.data.inTable=void 0}function UY(e){this.enter({type:`tableRow`,children:[]},e)}function WY(e){this.exit(e)}function GY(e){this.enter({type:`tableCell`,children:[]},e)}function KY(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qY));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qY(e,t){return t===`|`?t:e}function JY(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
71
71
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
72
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return HJ(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=zY.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function YY(){return{exit:{taskListCheckValueChecked:ZY,taskListCheckValueUnchecked:ZY,paragraph:QY}}}function XY(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:$Y}}}function ZY(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function QY(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function $Y(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=zY.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function eX(){return[oJ(),AJ(),FJ(),BY(),YY()]}function tX(e){return{extensions:[sJ(),jJ(e),IJ(),JY(e),XY()]}}var nX={tokenize:gX,partial:!0},rX={tokenize:_X,partial:!0},iX={tokenize:vX,partial:!0},aX={tokenize:yX,partial:!0},oX={tokenize:bX,partial:!0},sX={name:`wwwAutolink`,tokenize:mX,previous:xX},cX={name:`protocolAutolink`,tokenize:hX,previous:SX},lX={name:`emailAutolink`,tokenize:pX,previous:CX},uX={};function dX(){return{text:uX}}for(var fX=48;fX<123;)uX[fX]=lX,fX++,fX===58?fX=65:fX===91&&(fX=97);uX[43]=lX,uX[45]=lX,uX[46]=lX,uX[95]=lX,uX[72]=[lX,cX],uX[104]=[lX,cX],uX[87]=[lX,sX],uX[119]=[lX,sX];function pX(e,t,n){let r=this,i,a;return o;function o(t){return!wX(t)||!CX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wX(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oX,u,l)(t):t===45||t===95||iU(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&rU(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mX(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nX,e.attempt(rX,e.attempt(iX,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hX(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SX.call(r,r.previous)&&!TX(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(rU(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||oU(t)||uU(t)||fU(t)||dU(t)?n(t):e.attempt(rX,e.attempt(iX,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gX(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _X(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aX,c,s)(t):t===null||uU(t)||fU(t)||t!==45&&dU(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vX(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aX,t,a)(o):o===null||uU(o)||fU(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yX(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||uU(o)||fU(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||uU(e)||fU(e)?t(e):r(e)}function a(e){return rU(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):rU(t)?(e.consume(t),o):n(t)}}function bX(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return iU(e)?n(e):t(e)}}function xX(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||uU(e)}function SX(e){return!rU(e)}function CX(e){return!(e===47||wX(e))}function wX(e){return e===43||e===45||e===46||e===95||iU(e)}function TX(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var EX={tokenize:PX,partial:!0};function DX(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jX,continuation:{tokenize:MX},exit:NX}},text:{91:{name:`gfmFootnoteCall`,tokenize:AX},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:OX,resolveTo:kX}}}}function OX(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=dW(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kX(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function AX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||uU(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(dW(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return uU(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||uU(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=dW(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return uU(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function MX(e,t,n){return e.check(OU,t,e.attempt(EX,t,n))}function NX(e){e.exit(`gfmFootnoteDefinition`)}function PX(e,t,n){let r=this;return $(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function FX(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&ZH(o,o.length,0,xU(s,e.slice(r+1,n),t)),ZH(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),ZH(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=bU(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=bU(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var IX=class{constructor(){this.map=[]}add(e,t,n){LX(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function LX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function RX(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zX(){return{flow:{null:{name:`table`,tokenize:BX,resolveAll:VX}}}}function BX(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?$(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||uU(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Q(t)?$(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Q(t)?$(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Q(t)?$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):Q(n)?$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||uU(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function VX(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new IX;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(UX(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=HX(f,t,o,i,n,d)):(o[0]=o[1],d=HX(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&UX(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=RX(t.events,n))}return e}function HX(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},WX(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=WX(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=WX(t.events,n[2]),a=WX(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},WX(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function UX(e,t,n,r,i){let a=[],o=WX(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function WX(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var GX={name:`tasklistCheck`,tokenize:qX};function KX(){return{text:{91:GX}}}function qX(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return uU(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):Q(r)?e.check({tokenize:JX},t,n)(r):n(r)}}function JX(e,t,n){return $(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function YX(e){return eU([dX(),DX(),FX(e),zX(),KX()])}var XX={};function ZX(e){let t=this,n=e||XX,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(YX(n)),a.push(eX()),o.push(tX(n))}function QX(e){if(!e||e.startsWith(`data:`)||/^https?:\/\//i.test(e))return e;let t=e.match(/^workspace:\/\/\/(.*)$/);if(t||=e.match(/^workspace:\/\/(.*)$/),!t)return e;let n=t[1]??``,r=n.startsWith(`/`)?n:`/`+n;return`/api/p/files/raw?path=${encodeURIComponent(r)}`}function $X(e){return e&&QX(e)}function eZ(e){let{src:t,alt:n,...r}=e;return(0,J.jsx)(`img`,{src:t,alt:n??``,loading:`lazy`,className:`my-2 max-h-96 max-w-full rounded-lg border border-border-default/50`,...r})}var tZ={img:eZ},nZ=`prose prose-sm max-w-none text-[14px] leading-relaxed`;function rZ({children:e,className:t=``,noProse:n=!1}){let r=`${nZ}${$R(e=>e.resolved===`dark`)?` prose-invert`:``}`;return(0,J.jsx)(`div`,{className:n?t:`${r} ${t}`.trim(),children:(0,J.jsx)(qq,{remarkPlugins:[ZX],urlTransform:$X,components:tZ,children:e})})}var iZ=null;async function aZ(){return iZ||=(async()=>{let{createHighlighter:e}=await _(async()=>{let{createHighlighter:e}=await import(`./bundle-web-B8lu_A6P.js`);return{createHighlighter:e}},__vite__mapDeps([0,1]));return await e({themes:[`github-dark`,`github-light`],langs:[`plaintext`]})})(),iZ}var oZ={sh:`bash`,bash:`bash`,zsh:`bash`,h:`c`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,kt:`kotlin`,yml:`yaml`,htm:`html`,conf:`ini`},sZ=new Set(`ts.tsx.js.jsx.mjs.cjs.py.rb.php.go.rs.java.kt.swift.scala.c.cpp.cc.cxx.h.hpp.cs.m.mm.sh.bash.zsh.fish.ps1.json.yaml.yml.toml.ini.conf.xml.css.scss.sass.less.html.htm.sql.graphql.proto.lua.perl.pl.dockerfile.makefile`.split(`.`));function cZ(e){let t=e.toLowerCase();if(t===`dockerfile`||t.endsWith(`/dockerfile`))return`docker`;if(t===`makefile`||t.endsWith(`/makefile`))return`makefile`;let n=t.lastIndexOf(`.`);if(n<0)return null;let r=t.slice(n+1);return sZ.has(r)?oZ[r]??r:null}function lZ({code:e,lang:t,className:n=``}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(!1),o=$R(e=>e.resolved===`light`?`github-light`:`github-dark`);(0,d.useEffect)(()=>(a.current=!1,(async()=>{try{let n=await aZ();n.getLoadedLanguages().includes(t)||await n.loadLanguage(t);let r=n.codeToHtml(e,{lang:t,theme:o});a.current||i(r)}catch(e){console.warn(`[CodeBlock] highlight failed (${t}): ${e instanceof Error?e.message:String(e)}`)}})(),()=>{a.current=!0}),[e,t,o]);let s=(0,d.useMemo)(()=>{if(e.length===0)return 1;let t=e.split(`
|
|
72
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return HJ(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=zY.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function YY(){return{exit:{taskListCheckValueChecked:ZY,taskListCheckValueUnchecked:ZY,paragraph:QY}}}function XY(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:$Y}}}function ZY(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function QY(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function $Y(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=zY.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function eX(){return[oJ(),AJ(),FJ(),BY(),YY()]}function tX(e){return{extensions:[sJ(),jJ(e),IJ(),JY(e),XY()]}}var nX={tokenize:gX,partial:!0},rX={tokenize:_X,partial:!0},iX={tokenize:vX,partial:!0},aX={tokenize:yX,partial:!0},oX={tokenize:bX,partial:!0},sX={name:`wwwAutolink`,tokenize:mX,previous:xX},cX={name:`protocolAutolink`,tokenize:hX,previous:SX},lX={name:`emailAutolink`,tokenize:pX,previous:CX},uX={};function dX(){return{text:uX}}for(var fX=48;fX<123;)uX[fX]=lX,fX++,fX===58?fX=65:fX===91&&(fX=97);uX[43]=lX,uX[45]=lX,uX[46]=lX,uX[95]=lX,uX[72]=[lX,cX],uX[104]=[lX,cX],uX[87]=[lX,sX],uX[119]=[lX,sX];function pX(e,t,n){let r=this,i,a;return o;function o(t){return!wX(t)||!CX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wX(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oX,u,l)(t):t===45||t===95||iU(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&rU(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mX(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xX.call(r,r.previous)||TX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nX,e.attempt(rX,e.attempt(iX,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hX(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SX.call(r,r.previous)&&!TX(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(rU(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||oU(t)||uU(t)||fU(t)||dU(t)?n(t):e.attempt(rX,e.attempt(iX,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gX(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _X(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aX,c,s)(t):t===null||uU(t)||fU(t)||t!==45&&dU(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vX(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aX,t,a)(o):o===null||uU(o)||fU(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yX(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||uU(o)||fU(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||uU(e)||fU(e)?t(e):r(e)}function a(e){return rU(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):rU(t)?(e.consume(t),o):n(t)}}function bX(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return iU(e)?n(e):t(e)}}function xX(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||uU(e)}function SX(e){return!rU(e)}function CX(e){return!(e===47||wX(e))}function wX(e){return e===43||e===45||e===46||e===95||iU(e)}function TX(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var EX={tokenize:PX,partial:!0};function DX(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jX,continuation:{tokenize:MX},exit:NX}},text:{91:{name:`gfmFootnoteCall`,tokenize:AX},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:OX,resolveTo:kX}}}}function OX(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=dW(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kX(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function AX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||uU(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(dW(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return uU(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jX(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||uU(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=dW(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return uU(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function MX(e,t,n){return e.check(OU,t,e.attempt(EX,t,n))}function NX(e){e.exit(`gfmFootnoteDefinition`)}function PX(e,t,n){let r=this;return $(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function FX(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&ZH(o,o.length,0,xU(s,e.slice(r+1,n),t)),ZH(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),ZH(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=bU(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=bU(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var IX=class{constructor(){this.map=[]}add(e,t,n){LX(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function LX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function RX(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zX(){return{flow:{null:{name:`table`,tokenize:BX,resolveAll:VX}}}}function BX(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?$(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||uU(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Q(t)?$(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Q(t)?$(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Q(t)?$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):Q(n)?$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||uU(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function VX(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new IX;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(UX(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=HX(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=HX(f,t,o,i,n,d)):(o[0]=o[1],d=HX(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&UX(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=RX(t.events,n))}return e}function HX(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},WX(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=WX(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=WX(t.events,n[2]),a=WX(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},WX(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function UX(e,t,n,r,i){let a=[],o=WX(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function WX(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var GX={name:`tasklistCheck`,tokenize:qX};function KX(){return{text:{91:GX}}}function qX(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return uU(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):Q(r)?e.check({tokenize:JX},t,n)(r):n(r)}}function JX(e,t,n){return $(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function YX(e){return eU([dX(),DX(),FX(e),zX(),KX()])}var XX={};function ZX(e){let t=this,n=e||XX,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(YX(n)),a.push(eX()),o.push(tX(n))}function QX(e){if(!e||e.startsWith(`data:`)||/^https?:\/\//i.test(e))return e;let t=e.match(/^workspace:\/\/\/(.*)$/);if(t||=e.match(/^workspace:\/\/(.*)$/),!t)return e;let n=t[1]??``,r=n.startsWith(`/`)?n:`/`+n;return`/api/p/files/raw?path=${encodeURIComponent(r)}`}function $X(e){return e&&QX(e)}function eZ(e){let{src:t,alt:n,...r}=e;return(0,J.jsx)(`img`,{src:t,alt:n??``,loading:`lazy`,className:`my-2 max-h-96 max-w-full rounded-lg border border-border-default/50`,...r})}var tZ={img:eZ},nZ=`prose prose-sm max-w-none text-[14px] leading-relaxed`;function rZ({children:e,className:t=``,noProse:n=!1}){let r=`${nZ}${$R(e=>e.resolved===`dark`)?` prose-invert`:``}`;return(0,J.jsx)(`div`,{className:n?t:`${r} ${t}`.trim(),children:(0,J.jsx)(qq,{remarkPlugins:[ZX],urlTransform:$X,components:tZ,children:e})})}var iZ=null;async function aZ(){return iZ||=(async()=>{let{createHighlighter:e}=await _(async()=>{let{createHighlighter:e}=await import(`./bundle-web-pJFROy5N.js`);return{createHighlighter:e}},__vite__mapDeps([0,1]));return await e({themes:[`github-dark`,`github-light`],langs:[`plaintext`]})})(),iZ}var oZ={sh:`bash`,bash:`bash`,zsh:`bash`,h:`c`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,kt:`kotlin`,yml:`yaml`,htm:`html`,conf:`ini`},sZ=new Set(`ts.tsx.js.jsx.mjs.cjs.py.rb.php.go.rs.java.kt.swift.scala.c.cpp.cc.cxx.h.hpp.cs.m.mm.sh.bash.zsh.fish.ps1.json.yaml.yml.toml.ini.conf.xml.css.scss.sass.less.html.htm.sql.graphql.proto.lua.perl.pl.dockerfile.makefile`.split(`.`));function cZ(e){let t=e.toLowerCase();if(t===`dockerfile`||t.endsWith(`/dockerfile`))return`docker`;if(t===`makefile`||t.endsWith(`/makefile`))return`makefile`;let n=t.lastIndexOf(`.`);if(n<0)return null;let r=t.slice(n+1);return sZ.has(r)?oZ[r]??r:null}function lZ({code:e,lang:t,className:n=``}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(!1),o=$R(e=>e.resolved===`light`?`github-light`:`github-dark`);(0,d.useEffect)(()=>(a.current=!1,(async()=>{try{let n=await aZ();n.getLoadedLanguages().includes(t)||await n.loadLanguage(t);let r=n.codeToHtml(e,{lang:t,theme:o});a.current||i(r)}catch(e){console.warn(`[CodeBlock] highlight failed (${t}): ${e instanceof Error?e.message:String(e)}`)}})(),()=>{a.current=!0}),[e,t,o]);let s=(0,d.useMemo)(()=>{if(e.length===0)return 1;let t=e.split(`
|
|
73
73
|
`).length;return Math.max(1,e.endsWith(`
|
|
74
74
|
`)?t-1:t)},[e]);return(0,J.jsxs)(`div`,{className:`group relative ${n}`,children:[(0,J.jsx)(uZ,{text:e}),(0,J.jsxs)(`div`,{className:`flex`,children:[(0,J.jsx)(`pre`,{"aria-hidden":!0,className:`select-none border-r border-border-subtle bg-bg-base px-3 py-3 text-right font-mono text-[12px] leading-[1.6] text-fg-fainter`,children:Array.from({length:s},(e,t)=>t+1).join(`
|
|
75
75
|
`)}),(0,J.jsx)(`div`,{className:`min-w-0 flex-1 overflow-auto`,children:r?(0,J.jsx)(`div`,{className:`shiki-host font-mono text-[12px] leading-[1.6]`,dangerouslySetInnerHTML:{__html:r}}):(0,J.jsx)(`pre`,{className:`whitespace-pre px-3 py-3 font-mono text-[12px] leading-[1.6] text-fg-default`,children:e})})]})]})}function uZ({text:e}){let[t,n]=(0,d.useState)(!1);return(0,J.jsx)(`button`,{type:`button`,className:`absolute right-2 top-2 z-10 rounded-md border border-border-subtle/80 bg-bg-elevated/80 p-1.5 text-fg-muted opacity-0 backdrop-blur transition-opacity hover:bg-bg-raised group-hover:opacity-100`,title:t?`Copied`:`Copy`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)}).catch(()=>{})},children:t?(0,J.jsx)(xl,{size:14}):(0,J.jsx)(df,{size:14})})}function dZ({html:e,className:t=``,initialMode:n=`render`}){let[r,i]=(0,d.useState)(n);return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col ${t}`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-1 border-b border-border-subtle bg-bg-base/50 px-3 py-1.5`,children:(0,J.jsx)(fZ,{mode:r,onChange:i})}),r===`render`?(0,J.jsx)(`iframe`,{srcDoc:e,sandbox:`allow-scripts allow-popups allow-forms allow-modals`,className:`min-h-0 w-full flex-1 border-0 bg-white`,title:`HTML preview`},e.slice(0,64)+e.length):(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,J.jsx)(lZ,{code:e,lang:`html`})})]})}function fZ({mode:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`inline-flex rounded-md border border-border-subtle bg-bg-elevated/60 p-0.5 text-[11px] text-fg-muted`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`render`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`render`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`Live preview`,children:[(0,J.jsx)(Xp,{size:12}),(0,J.jsx)(`span`,{children:`Render`})]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`source`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`source`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`View source`,children:[(0,J.jsx)(Ld,{size:12}),(0,J.jsx)(`span`,{children:`Source`})]})]})}function pZ({src:e,title:t=`PDF preview`,className:n=``}){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col ${n}`,children:(0,J.jsx)(`iframe`,{src:e,title:t,className:`h-full w-full border-0 bg-white`})})}function mZ({src:e,className:t=``}){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-black ${t}`,children:(0,J.jsx)(`video`,{src:e,controls:!0,className:`max-h-full max-w-full`,children:(0,J.jsx)(`track`,{kind:`captions`})})})}function hZ({src:e,className:t=``}){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-bg-base p-6 ${t}`,children:(0,J.jsx)(`audio`,{src:e,controls:!0,className:`w-full max-w-2xl`,children:(0,J.jsx)(`track`,{kind:`captions`})})})}var gZ=`.svg`;function _Z({src:e,filename:t,svgSource:n,className:r=``}){let i=!!t&&t.toLowerCase().endsWith(gZ),[a,o]=(0,d.useState)(`render`);return!i||!n?(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-bg-base ${r}`,children:(0,J.jsx)(`img`,{src:e,alt:t??`image`,className:`max-h-full max-w-full object-contain`})}):(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col ${r}`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-1 border-b border-border-subtle bg-bg-base/50 px-3 py-1.5`,children:(0,J.jsx)(vZ,{mode:a,onChange:o})}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:a===`render`?(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center bg-bg-base`,children:(0,J.jsx)(`img`,{src:e,alt:t??`image`,className:`max-h-full max-w-full object-contain`})}):(0,J.jsx)(lZ,{code:n,lang:`xml`})})]})}function vZ({mode:e,onChange:t}){return(0,J.jsxs)(`div`,{className:`inline-flex rounded-md border border-border-subtle bg-bg-elevated/60 p-0.5 text-[11px] text-fg-muted`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`render`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`render`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`Render`,children:[(0,J.jsx)(Xp,{size:12}),(0,J.jsx)(`span`,{children:`Render`})]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t(`source`),className:`flex items-center gap-1 rounded px-2 py-0.5 transition-colors ${e===`source`?`bg-bg-raised text-fg-default`:`hover:bg-bg-raised/60 hover:text-fg-default`}`,title:`View source`,children:[(0,J.jsx)(Ld,{size:12}),(0,J.jsx)(`span`,{children:`Source`})]})]})}var yZ=1e3;function bZ({content:e,delimiter:n=`,`,className:r=``}){let[i,a]=(0,d.useState)(null);(0,d.useEffect)(()=>{let r=!1;return(async()=>{try{let i=(await _(async()=>{let{default:e}=await import(`./papaparse.min-BQRX_pWo.js`).then(e=>t(e.default,1));return{default:e}},__vite__mapDeps([2,1]))).default.parse(e,{delimiter:n,skipEmptyLines:!0});if(r)return;let o=i.data;if(o.length===0){a({headers:[],rows:[],totalRows:0});return}let s=o[0];a({headers:s,rows:o.slice(1,1001),totalRows:o.length-1,error:i.errors[0]?.message})}catch(e){r||a({headers:[],rows:[],totalRows:0,error:e instanceof Error?e.message:String(e)})}})(),()=>{r=!0}},[e,n]);let o=(0,d.useMemo)(()=>{if(!i)return[];let e=i.headers.length;return i.rows.map(t=>{if(t.length>=e)return t;let n=t.slice();for(;n.length<e;)n.push(``);return n})},[i]);if(!i)return(0,J.jsx)(`div`,{className:`p-4 text-sm text-fg-faint ${r}`,children:`Parsing table…`});if(i.error&&i.rows.length===0)return(0,J.jsxs)(`div`,{className:`p-4 text-sm text-danger ${r}`,children:[`Failed to parse table: `,i.error]});if(i.headers.length===0&&i.rows.length===0)return(0,J.jsx)(`div`,{className:`p-4 text-sm text-fg-faint ${r}`,children:`No rows.`});let s=i.totalRows>yZ;return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col ${r}`,children:[s&&(0,J.jsxs)(`div`,{className:`mx-3 mt-3 rounded border border-amber-900/40 bg-amber-950/30 px-2 py-1 text-[11px] text-amber-200`,children:[`Showing first `,yZ.toLocaleString(),` of`,` `,i.totalRows.toLocaleString(),` data rows. Download the file to inspect the rest.`]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,J.jsxs)(`table`,{className:`border-collapse text-[12px]`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsx)(`tr`,{className:`bg-bg-elevated text-fg-muted`,children:i.headers.map((e,t)=>(0,J.jsx)(`th`,{className:`sticky top-0 z-10 border-b border-border-default bg-bg-elevated px-2 py-1.5 text-left font-medium`,children:e||`Col ${t+1}`},t))})}),(0,J.jsx)(`tbody`,{children:o.map((e,t)=>(0,J.jsx)(`tr`,{className:`border-b border-border-subtle hover:bg-bg-elevated/40`,children:e.map((e,t)=>(0,J.jsx)(`td`,{className:`max-w-[28rem] truncate border-r border-border-subtle px-2 py-1 text-fg-muted`,title:e,children:e},t))},t))})]})})]})}var xZ=new Set([`md`,`markdown`]),SZ=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`]),CZ=new Set([`mp4`,`webm`,`ogv`,`mov`,`m4v`,`mkv`]),wZ=new Set([`mp3`,`wav`,`ogg`,`flac`,`m4a`,`aac`,`opus`]);function TZ(e){if(!e)return``;let t=e.lastIndexOf(`.`);return t<0?``:e.slice(t+1).toLowerCase()}function EZ(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function DZ({content:e,mimeType:t,filename:n,binary:r,loading:i,error:a,sizeBytes:o,rawUrl:s,className:c=``}){if(i)return(0,J.jsx)(`div`,{className:`flex h-32 items-center justify-center ${c}`,children:(0,J.jsx)(q,{size:20,className:`animate-spin text-fg-faint`})});if(a)return(0,J.jsx)(`div`,{className:`p-6 text-center text-sm text-danger ${c}`,children:a});let l=TZ(n),u=t&&t.startsWith(`image/`)||SZ.has(l),d=l===`pdf`||t===`application/pdf`,f=t&&t.startsWith(`video/`)||CZ.has(l),p=t&&t.startsWith(`audio/`)||wZ.has(l);if((u||d||f||p)&&s){if(u)return(0,J.jsx)(_Z,{src:s,filename:n,svgSource:(l===`svg`||t===`image/svg+xml`)&&e?e:void 0,className:c});if(d)return(0,J.jsx)(pZ,{src:s,title:n,className:c});if(f)return(0,J.jsx)(mZ,{src:s,className:c});if(p)return(0,J.jsx)(hZ,{src:s,className:c})}if(new Set([`doc`,`docx`,`dot`,`dotx`,`xls`,`xlsx`,`xlsm`,`xlsb`,`ppt`,`pptx`,`pps`,`ppsx`,`odt`,`ods`,`odp`,`odg`,`rtf`]).has(l))return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-8 text-center ${c}`,children:[(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg-default`,children:`Office preview is coming soon`}),(0,J.jsxs)(`div`,{className:`max-w-md text-[12px] leading-relaxed text-fg-faint`,children:[`In-browser rendering for`,` `,(0,J.jsxs)(`code`,{className:`font-mono text-fg-muted`,children:[`.`,l]}),` files needs a server-side LibreOffice pass that hasn't shipped yet. Use the`,` `,(0,J.jsx)(`span`,{className:`text-fg-muted`,children:`Download`}),` button above to open this file in your local Office / LibreOffice / Pages.`]}),o!=null&&(0,J.jsx)(`div`,{className:`text-[11px] text-fg-fainter`,children:EZ(o)})]});if(r&&!u)return(0,J.jsxs)(`div`,{className:`p-6 text-center text-sm text-fg-faint ${c}`,children:[`Binary file`,o==null?``:` (${EZ(o)})`,`. No preview available.`]});if(e==null)return(0,J.jsx)(`div`,{className:`p-6 text-center text-sm text-fg-faint ${c}`,children:`No content.`});if(l===`csv`||t===`text/csv`)return(0,J.jsx)(bZ,{content:e,delimiter:`,`,className:c});if(l===`tsv`||t===`text/tab-separated-values`)return(0,J.jsx)(bZ,{content:e,delimiter:`\\t`,className:c});if(xZ.has(l)||t===`text/markdown`||t===`text/x-markdown`)return(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4 ${c}`,children:(0,J.jsx)(rZ,{children:e})});if(l===`html`||l===`htm`)return(0,J.jsx)(dZ,{html:e,className:c});let m=n?cZ(n):null;return m?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto ${c}`,children:(0,J.jsx)(lZ,{code:e,lang:m})}):(0,J.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-all p-4 font-mono text-xs text-fg-default ${c}`,children:e})}kB(),tz(),aF(Gz),lF(RB),pF({Modal:hV,MarkdownBlock:rZ,DocumentViewer:DZ}),gF(()=>({mode:$R(e=>e.mode),resolved:$R(e=>e.resolved),setMode:$R(e=>e.setMode)})),vF(()=>({viewingSessionId:A(e=>e.viewingSessionId),setViewingSession:A(e=>e.selectSession)})),xF({subscribe:(e,t)=>sr.on(e,t)??(()=>{})}),globalThis.__tianshuPluginSdkOpenFile__||sF({open:e=>{let t=e.replace(/^workspace:\/\/+/,`/`),n=`/api/p/files/raw?path=${encodeURIComponent(t)}`;window.open(n,`_blank`,`noopener`)}});var OZ=document.getElementById(`root`);if(!OZ)throw Error(`#root not found`);p.createRoot(OZ).render((0,J.jsx)(d.StrictMode,{children:(0,J.jsx)(fV,{})}));export{QV as a,_ as c,nH as i,rH as n,SV as o,tH as r,gV as s,Qq as t};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Tianshu — AI agent platform</title>
|
|
7
7
|
<meta name="description" content="An open AI agent platform with a sidecar browser. Built in public." />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Tr4SrI1Y.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-BWBwAfvE.css">
|
|
11
11
|
</head>
|
|
@@ -178,7 +178,9 @@ export function SolutionTree({ detail, edits, expanded, onToggleExpand, selected
|
|
|
178
178
|
function TreeRow({ node, isSelected, isExpanded, onToggleExpand, onSelect, }) {
|
|
179
179
|
const pad = node.depth === 0 ? "pl-2" : node.depth === 1 ? "pl-5" : "pl-9";
|
|
180
180
|
const isRoot = node.id === "root";
|
|
181
|
-
return (_jsxs("div", { className: `flex w-full items-center gap-1 border-l-2 ${pad} pr-2 py-1 text-xs whitespace-nowrap ${isSelected
|
|
181
|
+
return (_jsxs("div", { className: `flex w-full items-center gap-1 border-l-2 ${pad} pr-2 py-1 text-xs whitespace-nowrap ${isSelected
|
|
182
|
+
? "border-info-fg bg-info-fg/10"
|
|
183
|
+
: "border-transparent hover:bg-bg-hover"}`, children: [node.expandable ? (_jsx("button", { type: "button", onClick: (e) => {
|
|
182
184
|
e.stopPropagation();
|
|
183
185
|
onToggleExpand(node.id);
|
|
184
186
|
}, className: "flex size-5 shrink-0 items-center justify-center rounded text-fg-muted hover:bg-bg-base hover:text-fg-default", "aria-label": isExpanded ? "Collapse" : "Expand", children: isExpanded ? (_jsx(ChevronDown, { className: "size-3.5" })) : (_jsx(ChevronRight, { className: "size-3.5" })) })) : (_jsx("span", { className: "size-5 shrink-0" })), _jsxs("button", { type: "button", onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solution-tree.js","sourceRoot":"","sources":["../src/solution-tree.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA8BzD,MAAM,aAAa,GAAyD;IAC1E,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACrD,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE;IAChD,cAAc,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE;CACzD,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,MAAsB,EACtB,KAAoB,EACpB,QAAqB;IAErB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxB,MAAM,KAAK,GAAe,EAAE,CAAC;IAE7B,OAAO;IACP,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI;QAC9B,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;KACT,CAAC,CAAC;IAEH,UAAU;IACV,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,IAAI,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE;KACxE,CAAC,CAAC;IAEH,kDAAkD;IAClD,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,oBAAoB;YACxB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,CAAC;SACT,CAAC,CAAC;QACH,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAkB,EAAE,CAAC;YAC9D,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;YACjD,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,iBAAiB,GAAG,EAAE;gBAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,CAAC;gBACR,KAAK,EAAE,UAAU;oBACf,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;oBAC5C,CAAC,CAAC,SAAS;aACd,CAAC,CAAC;QACL,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,iBAAiB,CAAC,CAAC,EAAE,EAAE;gBAC3B,KAAK,EAAE,WAAW,CAAC,CAAC,KAAK,IAAI,UAAU,EAAE;gBACzC,IAAI,EAAE,GAAG;gBACT,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,YAAY;YAChB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE;YACxC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3C,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,GAAG,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE;YACzC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC;IAED,6BAA6B;IAC7B,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAC/B,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACpC,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACxC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC7C,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,GAAG;gBACP,KAAK,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI;gBACxB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;gBACxB,KAAK,EAAE,CAAC;gBACR,QAAQ;gBACR,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS;aACrE,CAAC,CAAC;YACH,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtB,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,OAAO;oBACjB,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,CAAC;iBACT,CAAC,CAAC;gBACH,qDAAqD;gBACrD,0DAA0D;gBAC1D,yDAAyD;gBACzD,qDAAqD;gBACrD,0DAA0D;gBAC1D,0DAA0D;gBAC1D,YAAY;gBACZ,MAAM,YAAY,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,KAAK,IAAI,CAAC;gBACrD,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,yBAAyB;oBACnC,KAAK,EAAE,gBAAgB;oBACvB,IAAI,EAAE,GAAG;oBACT,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,YAAY;wBACjB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;wBAC5C,CAAC,CAAC,SAAS;iBACd,CAAC,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,QAAQ;oBAClB,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;oBACzD,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,CAAC;iBAC7C,CAAC,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,SAAS;oBACnB,KAAK,EAAE,QAAQ;oBACf,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;oBAC1D,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,CAAC;iBAC9C,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CACpB,CAAS;IAET,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7B,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,aAAa,CAAC,MAAsB;IAClD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACjD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO;QAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,mEAAmE;AAEnE,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,EACN,KAAK,EACL,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,QAAQ,GAQT;IACC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjD,OAAO,CACL,cAAK,SAAS,EAAC,MAAM,YAClB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,KAAC,OAAO,IAEN,IAAI,EAAE,CAAC,EACP,UAAU,EAAE,QAAQ,KAAK,CAAC,CAAC,EAAE,EAC7B,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,IALb,CAAC,CAAC,EAAE,CAMT,CACH,CAAC,GACE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,EACf,IAAI,EACJ,UAAU,EACV,UAAU,EACV,cAAc,EACd,QAAQ,GAOT;IACC,MAAM,GAAG,GACP,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC;IAClC,OAAO,CACL,eACE,SAAS,EAAE,6CAA6C,GAAG,wCACzD,UAAU,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"solution-tree.js","sourceRoot":"","sources":["../src/solution-tree.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA8BzD,MAAM,aAAa,GAAyD;IAC1E,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACrD,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE;IAChD,cAAc,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE;CACzD,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,MAAsB,EACtB,KAAoB,EACpB,QAAqB;IAErB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxB,MAAM,KAAK,GAAe,EAAE,CAAC;IAE7B,OAAO;IACP,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI;QAC9B,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;KACT,CAAC,CAAC;IAEH,UAAU;IACV,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,IAAI,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE;KACxE,CAAC,CAAC;IAEH,kDAAkD;IAClD,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,oBAAoB;YACxB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,CAAC;SACT,CAAC,CAAC;QACH,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAkB,EAAE,CAAC;YAC9D,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;YACjD,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,iBAAiB,GAAG,EAAE;gBAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,CAAC;gBACR,KAAK,EAAE,UAAU;oBACf,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;oBAC5C,CAAC,CAAC,SAAS;aACd,CAAC,CAAC;QACL,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,iBAAiB,CAAC,CAAC,EAAE,EAAE;gBAC3B,KAAK,EAAE,WAAW,CAAC,CAAC,KAAK,IAAI,UAAU,EAAE;gBACzC,IAAI,EAAE,GAAG;gBACT,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,YAAY;YAChB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE;YACxC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3C,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,GAAG,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE;YACzC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC;IAED,6BAA6B;IAC7B,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAC/B,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACpC,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACxC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC7C,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,GAAG;gBACP,KAAK,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI;gBACxB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;gBACxB,KAAK,EAAE,CAAC;gBACR,QAAQ;gBACR,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS;aACrE,CAAC,CAAC;YACH,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtB,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,OAAO;oBACjB,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,CAAC;iBACT,CAAC,CAAC;gBACH,qDAAqD;gBACrD,0DAA0D;gBAC1D,yDAAyD;gBACzD,qDAAqD;gBACrD,0DAA0D;gBAC1D,0DAA0D;gBAC1D,YAAY;gBACZ,MAAM,YAAY,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,KAAK,IAAI,CAAC;gBACrD,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,yBAAyB;oBACnC,KAAK,EAAE,gBAAgB;oBACvB,IAAI,EAAE,GAAG;oBACT,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,YAAY;wBACjB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;wBAC5C,CAAC,CAAC,SAAS;iBACd,CAAC,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,QAAQ;oBAClB,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;oBACzD,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,CAAC;iBAC7C,CAAC,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC;oBACT,EAAE,EAAE,GAAG,GAAG,SAAS;oBACnB,KAAK,EAAE,QAAQ;oBACf,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;oBAC1D,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,CAAC;iBAC9C,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CACpB,CAAS;IAET,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7B,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,aAAa,CAAC,MAAsB;IAClD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACjD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO;QAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,mEAAmE;AAEnE,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,EACN,KAAK,EACL,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,QAAQ,GAQT;IACC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjD,OAAO,CACL,cAAK,SAAS,EAAC,MAAM,YAClB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,KAAC,OAAO,IAEN,IAAI,EAAE,CAAC,EACP,UAAU,EAAE,QAAQ,KAAK,CAAC,CAAC,EAAE,EAC7B,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,IALb,CAAC,CAAC,EAAE,CAMT,CACH,CAAC,GACE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,EACf,IAAI,EACJ,UAAU,EACV,UAAU,EACV,cAAc,EACd,QAAQ,GAOT;IACC,MAAM,GAAG,GACP,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC;IAClC,OAAO,CACL,eACE,SAAS,EAAE,6CAA6C,GAAG,wCACzD,UAAU;YACR,CAAC,CAAC,8BAA8B;YAChC,CAAC,CAAC,sCACN,EAAE,aAKD,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CACjB,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,eAAe,EAAE,CAAC;oBACpB,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC1B,CAAC,EACD,SAAS,EAAC,+GAA+G,gBAC7G,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,YAE7C,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,WAAW,IAAC,SAAS,EAAC,UAAU,GAAG,CACrC,CAAC,CAAC,CAAC,CACF,KAAC,YAAY,IAAC,SAAS,EAAC,UAAU,GAAG,CACtC,GACM,CACV,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,iBAAiB,GAAG,CACrC,EACD,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU;wBAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACpB,CAAC,EACD,SAAS,EAAC,4CAA4C,aAEtD,eAAM,SAAS,EAAC,4BAA4B,YAAE,IAAI,CAAC,IAAI,GAAQ,EAC/D,eACE,SAAS,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,IACzC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EACjD,EAAE,YAED,IAAI,CAAC,KAAK,GACN,EACN,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,eAAM,SAAS,EAAC,2BAA2B,YAAE,IAAI,CAAC,KAAK,GAAQ,CAChE,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,IAC9C,IACL,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,EACjB,KAAK,GAGN;IACC,MAAM,GAAG,GACP,KAAK,CAAC,IAAI,KAAK,YAAY;QACzB,CAAC,CAAC,kCAAkC;QACpC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU;YACzB,CAAC,CAAC,gCAAgC;YAClC,CAAC,CAAC,8BAA8B,CAAC;IACvC,OAAO,CACL,eACE,SAAS,EAAE,6DAA6D,GAAG,EAAE,YAE5E,KAAK,CAAC,IAAI,GACN,CACR,CAAC;AACJ,CAAC"}
|