@jait/gateway 0.1.414 → 0.1.415
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/web-dist/assets/{_basePickBy-BY3j0pLu.js → _basePickBy-Vej0n7ts.js} +1 -1
- package/web-dist/assets/{_baseUniq-BBKXdVtW.js → _baseUniq-IJ0sJU1m.js} +1 -1
- package/web-dist/assets/{arc-DNJNlKJa.js → arc-BeHu1aOb.js} +1 -1
- package/web-dist/assets/{architectureDiagram-2XIMDMQ5-DgvlzCLX.js → architectureDiagram-2XIMDMQ5-Bp6z5ps0.js} +1 -1
- package/web-dist/assets/{blockDiagram-WCTKOSBZ-LIk_pKGv.js → blockDiagram-WCTKOSBZ-Cx_zzsRg.js} +1 -1
- package/web-dist/assets/{c4Diagram-IC4MRINW-Dd9l5l1P.js → c4Diagram-IC4MRINW-DUa0YpGC.js} +1 -1
- package/web-dist/assets/channel-Dd_6YMtj.js +1 -0
- package/web-dist/assets/{chunk-4BX2VUAB-CxecMpnr.js → chunk-4BX2VUAB-tpj87VmD.js} +1 -1
- package/web-dist/assets/{chunk-55IACEB6-iXe2sYvx.js → chunk-55IACEB6-B_ZFHP09.js} +1 -1
- package/web-dist/assets/{chunk-FMBD7UC4-SRiAxXsq.js → chunk-FMBD7UC4-CTvcgmSZ.js} +1 -1
- package/web-dist/assets/{chunk-JSJVCQXG-DhsSNEw_.js → chunk-JSJVCQXG-B7h9KpNR.js} +1 -1
- package/web-dist/assets/{chunk-KX2RTZJC-CYISO9K3.js → chunk-KX2RTZJC-D9Vq1pQV.js} +1 -1
- package/web-dist/assets/{chunk-NQ4KR5QH-D9PfPLCM.js → chunk-NQ4KR5QH-C7aaLWfv.js} +1 -1
- package/web-dist/assets/{chunk-QZHKN3VN-BeUfD_Us.js → chunk-QZHKN3VN-DL14VDvc.js} +1 -1
- package/web-dist/assets/{chunk-WL4C6EOR-CChE5ckt.js → chunk-WL4C6EOR-Dj9yLTN_.js} +1 -1
- package/web-dist/assets/classDiagram-VBA2DB6C-DGa9Vmq1.js +1 -0
- package/web-dist/assets/classDiagram-v2-RAHNMMFH-DGa9Vmq1.js +1 -0
- package/web-dist/assets/clone-BZHgrnhF.js +1 -0
- package/web-dist/assets/{cose-bilkent-S5V4N54A-Dx5SmdOo.js → cose-bilkent-S5V4N54A-BWtWPOzl.js} +1 -1
- package/web-dist/assets/{dagre-KLK3FWXG-DEwOQO7w.js → dagre-KLK3FWXG-BGfWBJVo.js} +1 -1
- package/web-dist/assets/{diagram-E7M64L7V-Do6ZcaTW.js → diagram-E7M64L7V-Cke9c3vx.js} +1 -1
- package/web-dist/assets/{diagram-IFDJBPK2-DorJcAX1.js → diagram-IFDJBPK2-BRRl8D9K.js} +1 -1
- package/web-dist/assets/{diagram-P4PSJMXO-BC1D-fCW.js → diagram-P4PSJMXO-BuZo-ISM.js} +1 -1
- package/web-dist/assets/{erDiagram-INFDFZHY-CP0mSVaQ.js → erDiagram-INFDFZHY-Plok75TS.js} +1 -1
- package/web-dist/assets/{flowDiagram-PKNHOUZH-DizSRtGj.js → flowDiagram-PKNHOUZH-DrTFnv1o.js} +1 -1
- package/web-dist/assets/{ganttDiagram-A5KZAMGK-DCG3RnO6.js → ganttDiagram-A5KZAMGK-lbd5t50L.js} +1 -1
- package/web-dist/assets/{gitGraphDiagram-K3NZZRJ6-FaXWKyXz.js → gitGraphDiagram-K3NZZRJ6-4bqi_Grw.js} +1 -1
- package/web-dist/assets/{graph--TtVwd7t.js → graph-BJxBQW7G.js} +1 -1
- package/web-dist/assets/{index-B2q-RZL4.js → index-BGe0OrqB.js} +1 -1
- package/web-dist/assets/{index-CCQbeCpx.js → index-D-Q3NBqs.js} +1 -1
- package/web-dist/assets/{index-DLM62Alw.js → index-DT-yEdLN.js} +5 -5
- package/web-dist/assets/{infoDiagram-LFFYTUFH-Dv0alkoh.js → infoDiagram-LFFYTUFH-mOUWUKTg.js} +1 -1
- package/web-dist/assets/{ishikawaDiagram-PHBUUO56-C6dqReRm.js → ishikawaDiagram-PHBUUO56-C-ISusUx.js} +1 -1
- package/web-dist/assets/{journeyDiagram-4ABVD52K-CqGp9as4.js → journeyDiagram-4ABVD52K-znHcSODe.js} +1 -1
- package/web-dist/assets/{kanban-definition-K7BYSVSG-DcY31-Uk.js → kanban-definition-K7BYSVSG-B9ekOJxL.js} +1 -1
- package/web-dist/assets/{layout-DeDqdHtL.js → layout-B_RPzsC2.js} +1 -1
- package/web-dist/assets/{linear-Dndn1mXM.js → linear-DZLBRrsE.js} +1 -1
- package/web-dist/assets/{mindmap-definition-YRQLILUH-pUyhhY_g.js → mindmap-definition-YRQLILUH-D3XCkmFm.js} +1 -1
- package/web-dist/assets/{pieDiagram-SKSYHLDU-0ld0kqTd.js → pieDiagram-SKSYHLDU-B2rKp15l.js} +1 -1
- package/web-dist/assets/{quadrantDiagram-337W2JSQ-CyGZ_o1t.js → quadrantDiagram-337W2JSQ-B3DzAIDT.js} +1 -1
- package/web-dist/assets/{requirementDiagram-Z7DCOOCP-nRggwrRJ.js → requirementDiagram-Z7DCOOCP-C4aT5lvg.js} +1 -1
- package/web-dist/assets/{sankeyDiagram-WA2Y5GQK-CuWIu-UB.js → sankeyDiagram-WA2Y5GQK-CwdIKXWh.js} +1 -1
- package/web-dist/assets/{sequenceDiagram-2WXFIKYE-CF1317GT.js → sequenceDiagram-2WXFIKYE-C85lQ8Bt.js} +1 -1
- package/web-dist/assets/{stateDiagram-RAJIS63D-DfI7H3Ui.js → stateDiagram-RAJIS63D-C6gFkSrw.js} +1 -1
- package/web-dist/assets/stateDiagram-v2-FVOUBMTO-BsX0KLYS.js +1 -0
- package/web-dist/assets/{timeline-definition-YZTLITO2-Dh7f4001.js → timeline-definition-YZTLITO2-B6sQ4e6y.js} +1 -1
- package/web-dist/assets/{treemap-KZPCXAKY-DbkPp1H7.js → treemap-KZPCXAKY-DqwxJSZi.js} +1 -1
- package/web-dist/assets/{vennDiagram-LZ73GAT5-BiY_0fvU.js → vennDiagram-LZ73GAT5-BkJxDniY.js} +1 -1
- package/web-dist/assets/{xychartDiagram-JWTSCODW-DEU3Uvdf.js → xychartDiagram-JWTSCODW-BbHdBYjX.js} +1 -1
- package/web-dist/index.html +1 -1
- package/web-dist/assets/channel-CNnC30Rt.js +0 -1
- package/web-dist/assets/classDiagram-VBA2DB6C-CZRuAChC.js +0 -1
- package/web-dist/assets/classDiagram-v2-RAHNMMFH-CZRuAChC.js +0 -1
- package/web-dist/assets/clone-CfXgw5ZL.js +0 -1
- package/web-dist/assets/stateDiagram-v2-FVOUBMTO-BIB1nAmv.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./astro-HNnZUWAn.js","./json-Cp-IABpG.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-BjGOyj-B.js","./html-derivative-DlHx6ybY.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-BLtJtn59.js","./coffee-Ch7k5sss.js","./cpp-CofmeUqb.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./c-BIGW1oBm.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./haml-D5jkg6IW.js","./handlebars-BpdQsYii.js","./yaml-Buea-lGh.js","./http-jrhK8wxY.js","./shellscript-Yzrsuije.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-CxzCAyBv.js","./python-B6aJPvgy.js","./r-Dspwwk_N.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-DTYItulj.js","./markdown-Cvjx9yec.js","./php-R6g_5hLQ.js","./pug-DKIMFp6K.js","./svelte-Cy7k_4gC.js","./ts-tags-DQrlYJgV.js","./vue-D2xRrEX4.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js","./dagre-KLK3FWXG-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./astro-HNnZUWAn.js","./json-Cp-IABpG.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-BjGOyj-B.js","./html-derivative-DlHx6ybY.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-BLtJtn59.js","./coffee-Ch7k5sss.js","./cpp-CofmeUqb.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./c-BIGW1oBm.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./haml-D5jkg6IW.js","./handlebars-BpdQsYii.js","./yaml-Buea-lGh.js","./http-jrhK8wxY.js","./shellscript-Yzrsuije.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-CxzCAyBv.js","./python-B6aJPvgy.js","./r-Dspwwk_N.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-DTYItulj.js","./markdown-Cvjx9yec.js","./php-R6g_5hLQ.js","./pug-DKIMFp6K.js","./svelte-Cy7k_4gC.js","./ts-tags-DQrlYJgV.js","./vue-D2xRrEX4.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js","./dagre-KLK3FWXG-BGfWBJVo.js","./graph-BJxBQW7G.js","./_baseUniq-IJ0sJU1m.js","./layout-B_RPzsC2.js","./_basePickBy-Vej0n7ts.js","./clone-BZHgrnhF.js","./cose-bilkent-S5V4N54A-BWtWPOzl.js","./cytoscape.esm-BQaXIfA_.js","./c4Diagram-IC4MRINW-DUa0YpGC.js","./chunk-JSJVCQXG-B7h9KpNR.js","./flowDiagram-PKNHOUZH-DrTFnv1o.js","./chunk-FMBD7UC4-CTvcgmSZ.js","./chunk-55IACEB6-B_ZFHP09.js","./chunk-KX2RTZJC-D9Vq1pQV.js","./channel-Dd_6YMtj.js","./erDiagram-INFDFZHY-Plok75TS.js","./gitGraphDiagram-K3NZZRJ6-4bqi_Grw.js","./chunk-4BX2VUAB-tpj87VmD.js","./chunk-QZHKN3VN-DL14VDvc.js","./treemap-KZPCXAKY-DqwxJSZi.js","./ganttDiagram-A5KZAMGK-lbd5t50L.js","./linear-DZLBRrsE.js","./defaultLocale-DX6XiGOO.js","./infoDiagram-LFFYTUFH-mOUWUKTg.js","./pieDiagram-SKSYHLDU-B2rKp15l.js","./arc-BeHu1aOb.js","./quadrantDiagram-337W2JSQ-B3DzAIDT.js","./xychartDiagram-JWTSCODW-BbHdBYjX.js","./requirementDiagram-Z7DCOOCP-C4aT5lvg.js","./sequenceDiagram-2WXFIKYE-C85lQ8Bt.js","./classDiagram-VBA2DB6C-DGa9Vmq1.js","./chunk-WL4C6EOR-Dj9yLTN_.js","./classDiagram-v2-RAHNMMFH-DGa9Vmq1.js","./stateDiagram-RAJIS63D-C6gFkSrw.js","./chunk-NQ4KR5QH-C7aaLWfv.js","./stateDiagram-v2-FVOUBMTO-BsX0KLYS.js","./journeyDiagram-4ABVD52K-znHcSODe.js","./timeline-definition-YZTLITO2-B6sQ4e6y.js","./mindmap-definition-YRQLILUH-D3XCkmFm.js","./kanban-definition-K7BYSVSG-B9ekOJxL.js","./diagram-P4PSJMXO-BuZo-ISM.js","./diagram-IFDJBPK2-BRRl8D9K.js","./blockDiagram-WCTKOSBZ-Cx_zzsRg.js","./architectureDiagram-2XIMDMQ5-Bp6z5ps0.js","./diagram-E7M64L7V-Cke9c3vx.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Jde=Object.defineProperty;var Qde=(e,r,n)=>r in e?Jde(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var He=(e,r,n)=>Qde(e,typeof r!="symbol"?r+"":r,n);function ehe(e,r){for(var n=0;n<r.length;n++){const i=r[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(i,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function K0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function G0t(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var r=e.default;if(typeof r=="function"){var n=function i(){return this instanceof i?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};n.prototype=r.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),n}var sN={exports:{}},nb={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -874,7 +874,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
874
874
|
monaco.config({ paths: { vs: '...' } })
|
|
875
875
|
|
|
876
876
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
877
|
-
`},wB=xOe(SOe)(pQ),kOe={config:_Oe},COe=function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return function(s){return n.reduceRight(function(o,a){return a(o)},s)}};function mQ(e,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&e[n]&&Object.assign(r[n],mQ(e[n],r[n]))}),xB(xB({},e),r)}var jOe={type:"cancelation",msg:"operation is manually canceled"};function ST(e){var r=!1,n=new Promise(function(i,s){e.then(function(o){return r?s(jOe):i(o)}),e.catch(s)});return n.cancel=function(){return r=!0},n}var NOe=["monaco"],TOe=yOe.create({config:vOe,isInitialized:!1,resolve:null,reject:null,monaco:null}),gQ=QAe(TOe,2),NS=gQ[0],Oj=gQ[1];function EOe(e){var r=kOe.config(e),n=r.monaco,i=ZAe(r,NOe);Oj(function(s){return{config:mQ(s.config,i),monaco:n}})}function AOe(){var e=NS(function(r){var n=r.monaco,i=r.isInitialized,s=r.resolve;return{monaco:n,isInitialized:i,resolve:s}});if(!e.isInitialized){if(Oj({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ST(kT);if(window.monaco&&window.monaco.editor)return yQ(window.monaco),e.resolve(window.monaco),ST(kT);COe(OOe,MOe)(POe)}return ST(kT)}function OOe(e){return document.body.appendChild(e)}function ROe(e){var r=document.createElement("script");return e&&(r.src=e),r}function MOe(e){var r=NS(function(i){var s=i.config,o=i.reject;return{config:s,reject:o}}),n=ROe("".concat(r.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=r.reject,n}function POe(){var e=NS(function(n){var i=n.config,s=n.resolve,o=n.reject;return{config:i,resolve:s,reject:o}}),r=window.require;r.config(e.config),r(["vs/editor/editor.main"],function(n){var i=n.m||n;yQ(i),e.resolve(i)},function(n){e.reject(n)})}function yQ(e){NS().monaco||Oj({monaco:e})}function LOe(){return NS(function(e){var r=e.monaco;return r})}var kT=new Promise(function(e,r){return Oj({resolve:e,reject:r})}),BM={config:EOe,init:AOe,__getMonacoInstance:LOe};const vQ=Object.freeze(JSON.parse('{"colors":{"actionBar.toggledBackground":"#383a49","activityBarBadge.background":"#007ACC","checkbox.border":"#6B6B6B","editor.background":"#1E1E1E","editor.foreground":"#D4D4D4","editor.inactiveSelectionBackground":"#3A3D41","editor.selectionHighlightBackground":"#ADD6FF26","editorIndentGuide.activeBackground1":"#707070","editorIndentGuide.background1":"#404040","input.placeholderForeground":"#A6A6A6","list.activeSelectionIconForeground":"#FFF","list.dropBackground":"#383B3D","menu.background":"#252526","menu.border":"#454545","menu.foreground":"#CCCCCC","menu.selectionBackground":"#0078d4","menu.separatorBackground":"#454545","ports.iconRunningProcessForeground":"#369432","sideBarSectionHeader.background":"#0000","sideBarSectionHeader.border":"#ccc3","sideBarTitle.foreground":"#BBBBBB","statusBarItem.remoteBackground":"#16825D","statusBarItem.remoteForeground":"#FFF","tab.lastPinnedBorder":"#ccc3","tab.selectedBackground":"#222222","tab.selectedForeground":"#ffffffa0","terminal.inactiveSelectionBackground":"#3A3D41","widget.border":"#303031"},"displayName":"Dark Plus","name":"dark-plus","semanticHighlighting":true,"semanticTokenColors":{"customLiteral":"#DCDCAA","newOperator":"#C586C0","numberLiteral":"#b5cea8","stringLiteral":"#ce9178"},"tokenColors":[{"scope":["meta.embedded","source.groovy.embedded","string meta.image.inline.markdown","variable.legacy.builtin.python"],"settings":{"foreground":"#D4D4D4"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":"strong","settings":{"fontStyle":"bold"}},{"scope":"header","settings":{"foreground":"#000080"}},{"scope":"comment","settings":{"foreground":"#6A9955"}},{"scope":"constant.language","settings":{"foreground":"#569cd6"}},{"scope":["constant.numeric","variable.other.enummember","keyword.operator.plus.exponent","keyword.operator.minus.exponent"],"settings":{"foreground":"#b5cea8"}},{"scope":"constant.regexp","settings":{"foreground":"#646695"}},{"scope":"entity.name.tag","settings":{"foreground":"#569cd6"}},{"scope":["entity.name.tag.css","entity.name.tag.less"],"settings":{"foreground":"#d7ba7d"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#9cdcfe"}},{"scope":["entity.other.attribute-name.class.css","source.css entity.other.attribute-name.class","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.parent.less","source.css entity.other.attribute-name.pseudo-class","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.scss"],"settings":{"foreground":"#d7ba7d"}},{"scope":"invalid","settings":{"foreground":"#f44747"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#569cd6"}},{"scope":"markup.heading","settings":{"fontStyle":"bold","foreground":"#569cd6"}},{"scope":"markup.italic","settings":{"fontStyle":"italic"}},{"scope":"markup.strikethrough","settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inserted","settings":{"foreground":"#b5cea8"}},{"scope":"markup.deleted","settings":{"foreground":"#ce9178"}},{"scope":"markup.changed","settings":{"foreground":"#569cd6"}},{"scope":"punctuation.definition.quote.begin.markdown","settings":{"foreground":"#6A9955"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#6796e6"}},{"scope":"markup.inline.raw","settings":{"foreground":"#ce9178"}},{"scope":"punctuation.definition.tag","settings":{"foreground":"#808080"}},{"scope":["meta.preprocessor","entity.name.function.preprocessor"],"settings":{"foreground":"#569cd6"}},{"scope":"meta.preprocessor.string","settings":{"foreground":"#ce9178"}},{"scope":"meta.preprocessor.numeric","settings":{"foreground":"#b5cea8"}},{"scope":"meta.structure.dictionary.key.python","settings":{"foreground":"#9cdcfe"}},{"scope":"meta.diff.header","settings":{"foreground":"#569cd6"}},{"scope":"storage","settings":{"foreground":"#569cd6"}},{"scope":"storage.type","settings":{"foreground":"#569cd6"}},{"scope":["storage.modifier","keyword.operator.noexcept"],"settings":{"foreground":"#569cd6"}},{"scope":["string","meta.embedded.assembly"],"settings":{"foreground":"#ce9178"}},{"scope":"string.tag","settings":{"foreground":"#ce9178"}},{"scope":"string.value","settings":{"foreground":"#ce9178"}},{"scope":"string.regexp","settings":{"foreground":"#d16969"}},{"scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#569cd6"}},{"scope":["meta.template.expression"],"settings":{"foreground":"#d4d4d4"}},{"scope":["support.type.vendored.property-name","support.type.property-name","source.css variable","source.coffee.embedded"],"settings":{"foreground":"#9cdcfe"}},{"scope":"keyword","settings":{"foreground":"#569cd6"}},{"scope":"keyword.control","settings":{"foreground":"#569cd6"}},{"scope":"keyword.operator","settings":{"foreground":"#d4d4d4"}},{"scope":["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.alignof","keyword.operator.typeid","keyword.operator.alignas","keyword.operator.instanceof","keyword.operator.logical.python","keyword.operator.wordlike"],"settings":{"foreground":"#569cd6"}},{"scope":"keyword.other.unit","settings":{"foreground":"#b5cea8"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#569cd6"}},{"scope":"support.function.git-rebase","settings":{"foreground":"#9cdcfe"}},{"scope":"constant.sha.git-rebase","settings":{"foreground":"#b5cea8"}},{"scope":["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],"settings":{"foreground":"#d4d4d4"}},{"scope":"variable.language","settings":{"foreground":"#569cd6"}},{"scope":["entity.name.function","support.function","support.constant.handlebars","source.powershell variable.other.member","entity.name.operator.custom-literal"],"settings":{"foreground":"#DCDCAA"}},{"scope":["support.class","support.type","entity.name.type","entity.name.namespace","entity.other.attribute","entity.name.scope-resolution","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],"settings":{"foreground":"#4EC9B0"}},{"scope":["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class","punctuation.separator.namespace.ruby"],"settings":{"foreground":"#4EC9B0"}},{"scope":["keyword.control","source.cpp keyword.operator.new","keyword.operator.delete","keyword.other.using","keyword.other.directive.using","keyword.other.operator","entity.name.operator"],"settings":{"foreground":"#C586C0"}},{"scope":["variable","meta.definition.variable.name","support.variable","entity.name.variable","constant.other.placeholder"],"settings":{"foreground":"#9CDCFE"}},{"scope":["variable.other.constant","variable.other.enummember"],"settings":{"foreground":"#4FC1FF"}},{"scope":["meta.object-literal.key"],"settings":{"foreground":"#9CDCFE"}},{"scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#CE9178"}},{"scope":["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],"settings":{"foreground":"#CE9178"}},{"scope":["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],"settings":{"foreground":"#d16969"}},{"scope":["keyword.operator.or.regexp","keyword.control.anchor.regexp"],"settings":{"foreground":"#DCDCAA"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#d7ba7d"}},{"scope":["constant.character","constant.other.option"],"settings":{"foreground":"#569cd6"}},{"scope":"constant.character.escape","settings":{"foreground":"#d7ba7d"}},{"scope":"entity.name.label","settings":{"foreground":"#C8C8C8"}}],"type":"dark"}')),$Oe=Object.freeze(Object.defineProperty({__proto__:null,default:vQ},Symbol.toStringTag,{value:"Module"})),DOe=["editor theme","vscode theme","monaco theme","workbench colors"],CT=new Set,R2="dark-plus",SB=new WeakSet,kB=vQ,IOe={"editor.background":"#0B0C0E","editorGutter.background":"#0B0C0E","editorStickyScroll.background":"#0B0C0E","editorStickyScrollGutter.background":"#0B0C0E","minimap.background":"#0B0C0E","editor.lineHighlightBackground":"#151922","editorWidget.background":"#16181D","editorHoverWidget.background":"#16181D","editorWidget.border":"#363B44","editorHoverWidget.border":"#363B44","editorGroupHeader.tabsBackground":"#0B0C0E"},BOe={base:"vs-dark",inherit:!1,rules:[...bQ(kB.tokenColors??[]),...qOe()],colors:{..._Q(kB.colors??{}),...IOe}};function zOe(){return DOe}function xQ(e){var r,n;(n=(r=e==null?void 0:e.editor)==null?void 0:r.defineTheme)==null||n.call(r,R2,BOe)}function FOe(e){!e||typeof e!="object"||SB.has(e)||(SB.add(e),Promise.all([Ye(()=>import("./index-B2q-RZL4.js"),[],import.meta.url),Ye(()=>import("./index-CCQbeCpx.js"),[],import.meta.url)]).then(async([{shikiToMonaco:r},{createHighlighter:n}])=>{var l,d,u;const i=e.languages,s=new Set(((l=i==null?void 0:i.getLanguages)==null?void 0:l.call(i).map(f=>f.id))??[]);for(const f of["javascript","typescript","json","css","html","markdown","python","yaml","diff"])s.has(f)||((d=i==null?void 0:i.register)==null||d.call(i,{id:f}),s.add(f));const o=await n({themes:["dark-plus"],langs:["javascript","typescript","jsx","tsx","json","css","html","markdown","python","yaml","diff"]});r(o,e),xQ(e);const a=e.editor;typeof document<"u"&&document.documentElement.dataset.monacoTheme===R2&&((u=a==null?void 0:a.setTheme)==null||u.call(a,R2))}).catch(r=>{console.error("Failed to initialize Shiki Monaco Dark Plus theme:",r)}))}function HOe(e){var a;const r=WOe(e.text),n=_Q(r.colors??{}),i=KOe(r,n),s=((a=r.name)==null?void 0:a.trim())||e.sourceLabel.trim()||"Imported Theme",o=`jait-vscode-${t7e(s)}-${e.id}`;return{id:e.id,name:s,sourceLabel:e.sourceLabel,importedAt:e.importedAt??new Date().toISOString(),colorMode:i,monacoThemeName:o,monacoThemeData:{base:i==="dark"?"vs-dark":"vs",inherit:!0,rules:bQ(r.tokenColors??[]),colors:n},cssVariables:GOe(n),rawColors:n,hasInclude:typeof r.include=="string"&&r.include.trim().length>0}}function WOe(e){const r=e7e(QOe(e)),n=JSON.parse(r);if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Theme file must contain a JSON object.");return n}function UOe(e,r){var n;!r||!((n=e==null?void 0:e.editor)!=null&&n.defineTheme)||e.editor.defineTheme(r.monacoThemeName,r.monacoThemeData)}function VOe(e){if(typeof document>"u")return;const r=document.documentElement;r.classList.toggle("dark",e.colorMode==="dark"),r.dataset.monacoTheme=e.monacoThemeName;for(const n of CT)r.style.removeProperty(n);if(CT.clear(),!!e.theme)for(const[n,i]of Object.entries(e.theme.cssVariables))r.style.setProperty(n,i),CT.add(n)}function bQ(e){var n;const r=[];for(const i of e){const s=i.settings??{},o=YOe(i.scope);if(o.length===0)continue;const a=jB(s.foreground),l=jB(s.background),d=((n=s.fontStyle)==null?void 0:n.trim())||void 0;for(const u of o)r.push({token:u,foreground:a,background:l,fontStyle:d})}return r}function qOe(){return[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"F44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"comment",foreground:"6A9955"},{token:"constant",foreground:"569CD6"},{token:"number",foreground:"B5CEA8"},{token:"regexp",foreground:"D16969"},{token:"string",foreground:"CE9178"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.operator",foreground:"D4D4D4"},{token:"keyword.operator.new",foreground:"C586C0"},{token:"operator",foreground:"D4D4D4"},{token:"type",foreground:"4EC9B0"},{token:"type.identifier",foreground:"4EC9B0"},{token:"class",foreground:"4EC9B0"},{token:"interface",foreground:"4EC9B0"},{token:"enum",foreground:"4EC9B0"},{token:"namespace",foreground:"4EC9B0"},{token:"identifier",foreground:"9CDCFE"},{token:"identifier.function",foreground:"DCDCAA"},{token:"function",foreground:"DCDCAA"},{token:"member",foreground:"DCDCAA"},{token:"method",foreground:"DCDCAA"},{token:"property",foreground:"9CDCFE"},{token:"variable",foreground:"9CDCFE"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"parameter",foreground:"9CDCFE"},{token:"delimiter",foreground:"D4D4D4"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"}]}function GOe(e){const r={},n=ri(e,["editor.background","sideBar.background","panel.background"]),i=ri(e,["editor.foreground","foreground"]),s=ri(e,["sideBar.background","panel.background","editorWidget.background"]),o=ri(e,["panel.background","tab.inactiveBackground","editorGroupHeader.tabsBackground"]),a=ri(e,["list.hoverBackground","tab.activeBackground","editor.lineHighlightBackground"]),l=ri(e,["button.background","focusBorder","textLink.foreground"]),d=ri(e,["widget.border","panel.border","sideBar.border","contrastBorder"]);bi(r,"--background",n),bi(r,"--foreground",i),bi(r,"--card",s),bi(r,"--card-foreground",ri(e,["sideBar.foreground","foreground"])??i),bi(r,"--popover",ri(e,["editorWidget.background","panel.background"])??s),bi(r,"--popover-foreground",ri(e,["editorWidget.foreground","foreground"])??i),bi(r,"--primary",l),bi(r,"--primary-foreground",CB(l)),bi(r,"--secondary",ri(e,["tab.inactiveBackground","panel.background"])??o),bi(r,"--secondary-foreground",ri(e,["tab.inactiveForeground","foreground"])??i),bi(r,"--muted",o),bi(r,"--muted-foreground",ri(e,["descriptionForeground","input.placeholderForeground","disabledForeground"])),bi(r,"--accent",a),bi(r,"--accent-foreground",ri(e,["list.activeSelectionForeground","foreground"])??i),bi(r,"--destructive",ri(e,["inputValidation.errorBackground","errorForeground","list.errorForeground"])),bi(r,"--destructive-foreground",CB(ri(e,["inputValidation.errorBackground","errorForeground"]))),bi(r,"--border",d),bi(r,"--input",ri(e,["input.background","editorWidget.background","dropdown.background"])??d),bi(r,"--ring",ri(e,["focusBorder","button.background","textLink.foreground"])??l),bi(r,"--scrollbar-track",ri(e,["editor.background","sideBar.background","panel.background"])??n),bi(r,"--scrollbar-thumb",ri(e,["scrollbarSlider.background","scrollbar.shadow"])),bi(r,"--scrollbar-thumb-hover",ri(e,["scrollbarSlider.hoverBackground","scrollbarSlider.activeBackground","scrollbarSlider.background"])),bi(r,"--toast-bg",ri(e,["notifications.background","editorWidget.background","panel.background"])??s,!0),bi(r,"--toast-border",ri(e,["notifications.border","widget.border","panel.border"])??d,!0),bi(r,"--toast-success-accent",ri(e,["testing.iconPassed","terminal.ansiGreen"])),bi(r,"--toast-info-accent",ri(e,["textLink.foreground","focusBorder"])??l),bi(r,"--toast-warning-accent",ri(e,["editorWarning.foreground","terminal.ansiYellow"])),bi(r,"--toast-error-accent",ri(e,["editorError.foreground","terminal.ansiRed"]));const u=ri(e,["editorGroupHeader.tabsBackground","tab.inactiveBackground","sideBar.background"]);u&&(r["--tab-bg"]=u);const f=ri(e,["activityBarBadge.background","button.background","focusBorder"]),p=ri(e,["textLink.foreground","terminal.ansiBlue"]),g=ri(e,["editorWarning.foreground","terminal.ansiYellow"]),v=ri(e,["terminal.ansiMagenta","badge.background"]);return f&&(r["--ctx-system"]=f),p&&(r["--ctx-history"]=p),g&&(r["--ctx-tool-results"]=g),v&&(r["--ctx-tools"]=v),r}function bi(e,r,n,i=!1){if(!n)return;const s=XOe(n,i);s&&(e[r]=s)}function CB(e){const r=zM(e);return r?(.2126*r.r+.7152*r.g+.0722*r.b)/255>.55?"0 0% 7%":"0 0% 100%":null}function KOe(e,r){if(e.type==="light"||e.type==="hc-light")return"light";if(e.type==="dark"||e.type==="hc-dark")return"dark";const n=zM(r["editor.background"]??r["sideBar.background"]??"");return n&&(.2126*n.r+.7152*n.g+.0722*n.b)/255>.55?"light":"dark"}function _Q(e){const r={};for(const[n,i]of Object.entries(e))typeof i=="string"&&i.trim()&&(r[n]=i.trim());return r}function YOe(e){return Array.isArray(e)?e.flatMap(r=>r.split(",")).map(r=>r.trim()).filter(Boolean):typeof e!="string"?[]:e.split(",").map(r=>r.trim()).filter(Boolean)}function jB(e){if(!e)return;const r=e.trim();if(r.startsWith("#"))return wQ(r).slice(1)}function ri(e,r){for(const n of r){const i=e[n];if(typeof i=="string"&&i.trim())return i.trim()}return null}function XOe(e,r=!1){const n=zM(e);if(!n)return null;const i=n.r/255,s=n.g/255,o=n.b/255,a=Math.max(i,s,o),l=Math.min(i,s,o),d=a-l,u=(a+l)/2;let f=0;d!==0&&(a===i?f=(s-o)/d%6:a===s?f=(o-i)/d+2:f=(i-s)/d+4,f*=60),f<0&&(f+=360);const p=d===0?0:d/(1-Math.abs(2*u-1)),g=`${Math.round(f)} ${Math.round(p*100)}% ${Math.round(u*100)}%`;return r&&n.a<1?`${g} / ${Number(n.a.toFixed(3))}`:g}function zM(e){if(!e)return null;const r=e.trim();if(!r)return null;if(r.startsWith("#"))return ZOe(r);const n=r.match(/^rgba?\(([^)]+)\)$/i);if(!n)return null;const i=n[1].split(",").map(d=>d.trim());if(i.length<3)return null;const s=jT(i[0]),o=jT(i[1]),a=jT(i[2]),l=i[3]==null?1:JOe(i[3]);return s==null||o==null||a==null||l==null?null:{r:s,g:o,b:a,a:l}}function ZOe(e){const r=wQ(e).slice(1);return r.length===6?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:1}:r.length===8?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:Number.parseInt(r.slice(6,8),16)/255}:null}function jT(e){if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,-1));return Number.isFinite(n)?NB(Math.round(n/100*255)):null}const r=Number.parseFloat(e);return Number.isFinite(r)?NB(Math.round(r)):null}function JOe(e){const r=Number.parseFloat(e);return Number.isFinite(r)?Math.max(0,Math.min(1,r)):null}function NB(e){return Math.max(0,Math.min(255,e))}function wQ(e){const r=e.trim().slice(1);return r.length===3||r.length===4?`#${r.split("").map(n=>`${n}${n}`).join("").toLowerCase()}`:`#${r.toLowerCase()}`}function QOe(e){let r="",n=!1,i=!1,s=!1,o=!1;for(let a=0;a<e.length;a+=1){const l=e[a],d=e[a+1];if(i){l===`
|
|
877
|
+
`},wB=xOe(SOe)(pQ),kOe={config:_Oe},COe=function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return function(s){return n.reduceRight(function(o,a){return a(o)},s)}};function mQ(e,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&e[n]&&Object.assign(r[n],mQ(e[n],r[n]))}),xB(xB({},e),r)}var jOe={type:"cancelation",msg:"operation is manually canceled"};function ST(e){var r=!1,n=new Promise(function(i,s){e.then(function(o){return r?s(jOe):i(o)}),e.catch(s)});return n.cancel=function(){return r=!0},n}var NOe=["monaco"],TOe=yOe.create({config:vOe,isInitialized:!1,resolve:null,reject:null,monaco:null}),gQ=QAe(TOe,2),NS=gQ[0],Oj=gQ[1];function EOe(e){var r=kOe.config(e),n=r.monaco,i=ZAe(r,NOe);Oj(function(s){return{config:mQ(s.config,i),monaco:n}})}function AOe(){var e=NS(function(r){var n=r.monaco,i=r.isInitialized,s=r.resolve;return{monaco:n,isInitialized:i,resolve:s}});if(!e.isInitialized){if(Oj({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ST(kT);if(window.monaco&&window.monaco.editor)return yQ(window.monaco),e.resolve(window.monaco),ST(kT);COe(OOe,MOe)(POe)}return ST(kT)}function OOe(e){return document.body.appendChild(e)}function ROe(e){var r=document.createElement("script");return e&&(r.src=e),r}function MOe(e){var r=NS(function(i){var s=i.config,o=i.reject;return{config:s,reject:o}}),n=ROe("".concat(r.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=r.reject,n}function POe(){var e=NS(function(n){var i=n.config,s=n.resolve,o=n.reject;return{config:i,resolve:s,reject:o}}),r=window.require;r.config(e.config),r(["vs/editor/editor.main"],function(n){var i=n.m||n;yQ(i),e.resolve(i)},function(n){e.reject(n)})}function yQ(e){NS().monaco||Oj({monaco:e})}function LOe(){return NS(function(e){var r=e.monaco;return r})}var kT=new Promise(function(e,r){return Oj({resolve:e,reject:r})}),BM={config:EOe,init:AOe,__getMonacoInstance:LOe};const vQ=Object.freeze(JSON.parse('{"colors":{"actionBar.toggledBackground":"#383a49","activityBarBadge.background":"#007ACC","checkbox.border":"#6B6B6B","editor.background":"#1E1E1E","editor.foreground":"#D4D4D4","editor.inactiveSelectionBackground":"#3A3D41","editor.selectionHighlightBackground":"#ADD6FF26","editorIndentGuide.activeBackground1":"#707070","editorIndentGuide.background1":"#404040","input.placeholderForeground":"#A6A6A6","list.activeSelectionIconForeground":"#FFF","list.dropBackground":"#383B3D","menu.background":"#252526","menu.border":"#454545","menu.foreground":"#CCCCCC","menu.selectionBackground":"#0078d4","menu.separatorBackground":"#454545","ports.iconRunningProcessForeground":"#369432","sideBarSectionHeader.background":"#0000","sideBarSectionHeader.border":"#ccc3","sideBarTitle.foreground":"#BBBBBB","statusBarItem.remoteBackground":"#16825D","statusBarItem.remoteForeground":"#FFF","tab.lastPinnedBorder":"#ccc3","tab.selectedBackground":"#222222","tab.selectedForeground":"#ffffffa0","terminal.inactiveSelectionBackground":"#3A3D41","widget.border":"#303031"},"displayName":"Dark Plus","name":"dark-plus","semanticHighlighting":true,"semanticTokenColors":{"customLiteral":"#DCDCAA","newOperator":"#C586C0","numberLiteral":"#b5cea8","stringLiteral":"#ce9178"},"tokenColors":[{"scope":["meta.embedded","source.groovy.embedded","string meta.image.inline.markdown","variable.legacy.builtin.python"],"settings":{"foreground":"#D4D4D4"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":"strong","settings":{"fontStyle":"bold"}},{"scope":"header","settings":{"foreground":"#000080"}},{"scope":"comment","settings":{"foreground":"#6A9955"}},{"scope":"constant.language","settings":{"foreground":"#569cd6"}},{"scope":["constant.numeric","variable.other.enummember","keyword.operator.plus.exponent","keyword.operator.minus.exponent"],"settings":{"foreground":"#b5cea8"}},{"scope":"constant.regexp","settings":{"foreground":"#646695"}},{"scope":"entity.name.tag","settings":{"foreground":"#569cd6"}},{"scope":["entity.name.tag.css","entity.name.tag.less"],"settings":{"foreground":"#d7ba7d"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#9cdcfe"}},{"scope":["entity.other.attribute-name.class.css","source.css entity.other.attribute-name.class","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.parent.less","source.css entity.other.attribute-name.pseudo-class","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.scss"],"settings":{"foreground":"#d7ba7d"}},{"scope":"invalid","settings":{"foreground":"#f44747"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#569cd6"}},{"scope":"markup.heading","settings":{"fontStyle":"bold","foreground":"#569cd6"}},{"scope":"markup.italic","settings":{"fontStyle":"italic"}},{"scope":"markup.strikethrough","settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inserted","settings":{"foreground":"#b5cea8"}},{"scope":"markup.deleted","settings":{"foreground":"#ce9178"}},{"scope":"markup.changed","settings":{"foreground":"#569cd6"}},{"scope":"punctuation.definition.quote.begin.markdown","settings":{"foreground":"#6A9955"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#6796e6"}},{"scope":"markup.inline.raw","settings":{"foreground":"#ce9178"}},{"scope":"punctuation.definition.tag","settings":{"foreground":"#808080"}},{"scope":["meta.preprocessor","entity.name.function.preprocessor"],"settings":{"foreground":"#569cd6"}},{"scope":"meta.preprocessor.string","settings":{"foreground":"#ce9178"}},{"scope":"meta.preprocessor.numeric","settings":{"foreground":"#b5cea8"}},{"scope":"meta.structure.dictionary.key.python","settings":{"foreground":"#9cdcfe"}},{"scope":"meta.diff.header","settings":{"foreground":"#569cd6"}},{"scope":"storage","settings":{"foreground":"#569cd6"}},{"scope":"storage.type","settings":{"foreground":"#569cd6"}},{"scope":["storage.modifier","keyword.operator.noexcept"],"settings":{"foreground":"#569cd6"}},{"scope":["string","meta.embedded.assembly"],"settings":{"foreground":"#ce9178"}},{"scope":"string.tag","settings":{"foreground":"#ce9178"}},{"scope":"string.value","settings":{"foreground":"#ce9178"}},{"scope":"string.regexp","settings":{"foreground":"#d16969"}},{"scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#569cd6"}},{"scope":["meta.template.expression"],"settings":{"foreground":"#d4d4d4"}},{"scope":["support.type.vendored.property-name","support.type.property-name","source.css variable","source.coffee.embedded"],"settings":{"foreground":"#9cdcfe"}},{"scope":"keyword","settings":{"foreground":"#569cd6"}},{"scope":"keyword.control","settings":{"foreground":"#569cd6"}},{"scope":"keyword.operator","settings":{"foreground":"#d4d4d4"}},{"scope":["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.alignof","keyword.operator.typeid","keyword.operator.alignas","keyword.operator.instanceof","keyword.operator.logical.python","keyword.operator.wordlike"],"settings":{"foreground":"#569cd6"}},{"scope":"keyword.other.unit","settings":{"foreground":"#b5cea8"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#569cd6"}},{"scope":"support.function.git-rebase","settings":{"foreground":"#9cdcfe"}},{"scope":"constant.sha.git-rebase","settings":{"foreground":"#b5cea8"}},{"scope":["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],"settings":{"foreground":"#d4d4d4"}},{"scope":"variable.language","settings":{"foreground":"#569cd6"}},{"scope":["entity.name.function","support.function","support.constant.handlebars","source.powershell variable.other.member","entity.name.operator.custom-literal"],"settings":{"foreground":"#DCDCAA"}},{"scope":["support.class","support.type","entity.name.type","entity.name.namespace","entity.other.attribute","entity.name.scope-resolution","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],"settings":{"foreground":"#4EC9B0"}},{"scope":["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class","punctuation.separator.namespace.ruby"],"settings":{"foreground":"#4EC9B0"}},{"scope":["keyword.control","source.cpp keyword.operator.new","keyword.operator.delete","keyword.other.using","keyword.other.directive.using","keyword.other.operator","entity.name.operator"],"settings":{"foreground":"#C586C0"}},{"scope":["variable","meta.definition.variable.name","support.variable","entity.name.variable","constant.other.placeholder"],"settings":{"foreground":"#9CDCFE"}},{"scope":["variable.other.constant","variable.other.enummember"],"settings":{"foreground":"#4FC1FF"}},{"scope":["meta.object-literal.key"],"settings":{"foreground":"#9CDCFE"}},{"scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#CE9178"}},{"scope":["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],"settings":{"foreground":"#CE9178"}},{"scope":["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],"settings":{"foreground":"#d16969"}},{"scope":["keyword.operator.or.regexp","keyword.control.anchor.regexp"],"settings":{"foreground":"#DCDCAA"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#d7ba7d"}},{"scope":["constant.character","constant.other.option"],"settings":{"foreground":"#569cd6"}},{"scope":"constant.character.escape","settings":{"foreground":"#d7ba7d"}},{"scope":"entity.name.label","settings":{"foreground":"#C8C8C8"}}],"type":"dark"}')),$Oe=Object.freeze(Object.defineProperty({__proto__:null,default:vQ},Symbol.toStringTag,{value:"Module"})),DOe=["editor theme","vscode theme","monaco theme","workbench colors"],CT=new Set,R2="dark-plus",SB=new WeakSet,kB=vQ,IOe={"editor.background":"#0B0C0E","editorGutter.background":"#0B0C0E","editorStickyScroll.background":"#0B0C0E","editorStickyScrollGutter.background":"#0B0C0E","minimap.background":"#0B0C0E","editor.lineHighlightBackground":"#151922","editorWidget.background":"#16181D","editorHoverWidget.background":"#16181D","editorWidget.border":"#363B44","editorHoverWidget.border":"#363B44","editorGroupHeader.tabsBackground":"#0B0C0E"},BOe={base:"vs-dark",inherit:!1,rules:[...bQ(kB.tokenColors??[]),...qOe()],colors:{..._Q(kB.colors??{}),...IOe}};function zOe(){return DOe}function xQ(e){var r,n;(n=(r=e==null?void 0:e.editor)==null?void 0:r.defineTheme)==null||n.call(r,R2,BOe)}function FOe(e){!e||typeof e!="object"||SB.has(e)||(SB.add(e),Promise.all([Ye(()=>import("./index-BGe0OrqB.js"),[],import.meta.url),Ye(()=>import("./index-D-Q3NBqs.js"),[],import.meta.url)]).then(async([{shikiToMonaco:r},{createHighlighter:n}])=>{var l,d,u;const i=e.languages,s=new Set(((l=i==null?void 0:i.getLanguages)==null?void 0:l.call(i).map(f=>f.id))??[]);for(const f of["javascript","typescript","json","css","html","markdown","python","yaml","diff"])s.has(f)||((d=i==null?void 0:i.register)==null||d.call(i,{id:f}),s.add(f));const o=await n({themes:["dark-plus"],langs:["javascript","typescript","jsx","tsx","json","css","html","markdown","python","yaml","diff"]});r(o,e),xQ(e);const a=e.editor;typeof document<"u"&&document.documentElement.dataset.monacoTheme===R2&&((u=a==null?void 0:a.setTheme)==null||u.call(a,R2))}).catch(r=>{console.error("Failed to initialize Shiki Monaco Dark Plus theme:",r)}))}function HOe(e){var a;const r=WOe(e.text),n=_Q(r.colors??{}),i=KOe(r,n),s=((a=r.name)==null?void 0:a.trim())||e.sourceLabel.trim()||"Imported Theme",o=`jait-vscode-${t7e(s)}-${e.id}`;return{id:e.id,name:s,sourceLabel:e.sourceLabel,importedAt:e.importedAt??new Date().toISOString(),colorMode:i,monacoThemeName:o,monacoThemeData:{base:i==="dark"?"vs-dark":"vs",inherit:!0,rules:bQ(r.tokenColors??[]),colors:n},cssVariables:GOe(n),rawColors:n,hasInclude:typeof r.include=="string"&&r.include.trim().length>0}}function WOe(e){const r=e7e(QOe(e)),n=JSON.parse(r);if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Theme file must contain a JSON object.");return n}function UOe(e,r){var n;!r||!((n=e==null?void 0:e.editor)!=null&&n.defineTheme)||e.editor.defineTheme(r.monacoThemeName,r.monacoThemeData)}function VOe(e){if(typeof document>"u")return;const r=document.documentElement;r.classList.toggle("dark",e.colorMode==="dark"),r.dataset.monacoTheme=e.monacoThemeName;for(const n of CT)r.style.removeProperty(n);if(CT.clear(),!!e.theme)for(const[n,i]of Object.entries(e.theme.cssVariables))r.style.setProperty(n,i),CT.add(n)}function bQ(e){var n;const r=[];for(const i of e){const s=i.settings??{},o=YOe(i.scope);if(o.length===0)continue;const a=jB(s.foreground),l=jB(s.background),d=((n=s.fontStyle)==null?void 0:n.trim())||void 0;for(const u of o)r.push({token:u,foreground:a,background:l,fontStyle:d})}return r}function qOe(){return[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"F44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"comment",foreground:"6A9955"},{token:"constant",foreground:"569CD6"},{token:"number",foreground:"B5CEA8"},{token:"regexp",foreground:"D16969"},{token:"string",foreground:"CE9178"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.operator",foreground:"D4D4D4"},{token:"keyword.operator.new",foreground:"C586C0"},{token:"operator",foreground:"D4D4D4"},{token:"type",foreground:"4EC9B0"},{token:"type.identifier",foreground:"4EC9B0"},{token:"class",foreground:"4EC9B0"},{token:"interface",foreground:"4EC9B0"},{token:"enum",foreground:"4EC9B0"},{token:"namespace",foreground:"4EC9B0"},{token:"identifier",foreground:"9CDCFE"},{token:"identifier.function",foreground:"DCDCAA"},{token:"function",foreground:"DCDCAA"},{token:"member",foreground:"DCDCAA"},{token:"method",foreground:"DCDCAA"},{token:"property",foreground:"9CDCFE"},{token:"variable",foreground:"9CDCFE"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"parameter",foreground:"9CDCFE"},{token:"delimiter",foreground:"D4D4D4"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"}]}function GOe(e){const r={},n=ri(e,["editor.background","sideBar.background","panel.background"]),i=ri(e,["editor.foreground","foreground"]),s=ri(e,["sideBar.background","panel.background","editorWidget.background"]),o=ri(e,["panel.background","tab.inactiveBackground","editorGroupHeader.tabsBackground"]),a=ri(e,["list.hoverBackground","tab.activeBackground","editor.lineHighlightBackground"]),l=ri(e,["button.background","focusBorder","textLink.foreground"]),d=ri(e,["widget.border","panel.border","sideBar.border","contrastBorder"]);bi(r,"--background",n),bi(r,"--foreground",i),bi(r,"--card",s),bi(r,"--card-foreground",ri(e,["sideBar.foreground","foreground"])??i),bi(r,"--popover",ri(e,["editorWidget.background","panel.background"])??s),bi(r,"--popover-foreground",ri(e,["editorWidget.foreground","foreground"])??i),bi(r,"--primary",l),bi(r,"--primary-foreground",CB(l)),bi(r,"--secondary",ri(e,["tab.inactiveBackground","panel.background"])??o),bi(r,"--secondary-foreground",ri(e,["tab.inactiveForeground","foreground"])??i),bi(r,"--muted",o),bi(r,"--muted-foreground",ri(e,["descriptionForeground","input.placeholderForeground","disabledForeground"])),bi(r,"--accent",a),bi(r,"--accent-foreground",ri(e,["list.activeSelectionForeground","foreground"])??i),bi(r,"--destructive",ri(e,["inputValidation.errorBackground","errorForeground","list.errorForeground"])),bi(r,"--destructive-foreground",CB(ri(e,["inputValidation.errorBackground","errorForeground"]))),bi(r,"--border",d),bi(r,"--input",ri(e,["input.background","editorWidget.background","dropdown.background"])??d),bi(r,"--ring",ri(e,["focusBorder","button.background","textLink.foreground"])??l),bi(r,"--scrollbar-track",ri(e,["editor.background","sideBar.background","panel.background"])??n),bi(r,"--scrollbar-thumb",ri(e,["scrollbarSlider.background","scrollbar.shadow"])),bi(r,"--scrollbar-thumb-hover",ri(e,["scrollbarSlider.hoverBackground","scrollbarSlider.activeBackground","scrollbarSlider.background"])),bi(r,"--toast-bg",ri(e,["notifications.background","editorWidget.background","panel.background"])??s,!0),bi(r,"--toast-border",ri(e,["notifications.border","widget.border","panel.border"])??d,!0),bi(r,"--toast-success-accent",ri(e,["testing.iconPassed","terminal.ansiGreen"])),bi(r,"--toast-info-accent",ri(e,["textLink.foreground","focusBorder"])??l),bi(r,"--toast-warning-accent",ri(e,["editorWarning.foreground","terminal.ansiYellow"])),bi(r,"--toast-error-accent",ri(e,["editorError.foreground","terminal.ansiRed"]));const u=ri(e,["editorGroupHeader.tabsBackground","tab.inactiveBackground","sideBar.background"]);u&&(r["--tab-bg"]=u);const f=ri(e,["activityBarBadge.background","button.background","focusBorder"]),p=ri(e,["textLink.foreground","terminal.ansiBlue"]),g=ri(e,["editorWarning.foreground","terminal.ansiYellow"]),v=ri(e,["terminal.ansiMagenta","badge.background"]);return f&&(r["--ctx-system"]=f),p&&(r["--ctx-history"]=p),g&&(r["--ctx-tool-results"]=g),v&&(r["--ctx-tools"]=v),r}function bi(e,r,n,i=!1){if(!n)return;const s=XOe(n,i);s&&(e[r]=s)}function CB(e){const r=zM(e);return r?(.2126*r.r+.7152*r.g+.0722*r.b)/255>.55?"0 0% 7%":"0 0% 100%":null}function KOe(e,r){if(e.type==="light"||e.type==="hc-light")return"light";if(e.type==="dark"||e.type==="hc-dark")return"dark";const n=zM(r["editor.background"]??r["sideBar.background"]??"");return n&&(.2126*n.r+.7152*n.g+.0722*n.b)/255>.55?"light":"dark"}function _Q(e){const r={};for(const[n,i]of Object.entries(e))typeof i=="string"&&i.trim()&&(r[n]=i.trim());return r}function YOe(e){return Array.isArray(e)?e.flatMap(r=>r.split(",")).map(r=>r.trim()).filter(Boolean):typeof e!="string"?[]:e.split(",").map(r=>r.trim()).filter(Boolean)}function jB(e){if(!e)return;const r=e.trim();if(r.startsWith("#"))return wQ(r).slice(1)}function ri(e,r){for(const n of r){const i=e[n];if(typeof i=="string"&&i.trim())return i.trim()}return null}function XOe(e,r=!1){const n=zM(e);if(!n)return null;const i=n.r/255,s=n.g/255,o=n.b/255,a=Math.max(i,s,o),l=Math.min(i,s,o),d=a-l,u=(a+l)/2;let f=0;d!==0&&(a===i?f=(s-o)/d%6:a===s?f=(o-i)/d+2:f=(i-s)/d+4,f*=60),f<0&&(f+=360);const p=d===0?0:d/(1-Math.abs(2*u-1)),g=`${Math.round(f)} ${Math.round(p*100)}% ${Math.round(u*100)}%`;return r&&n.a<1?`${g} / ${Number(n.a.toFixed(3))}`:g}function zM(e){if(!e)return null;const r=e.trim();if(!r)return null;if(r.startsWith("#"))return ZOe(r);const n=r.match(/^rgba?\(([^)]+)\)$/i);if(!n)return null;const i=n[1].split(",").map(d=>d.trim());if(i.length<3)return null;const s=jT(i[0]),o=jT(i[1]),a=jT(i[2]),l=i[3]==null?1:JOe(i[3]);return s==null||o==null||a==null||l==null?null:{r:s,g:o,b:a,a:l}}function ZOe(e){const r=wQ(e).slice(1);return r.length===6?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:1}:r.length===8?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:Number.parseInt(r.slice(6,8),16)/255}:null}function jT(e){if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,-1));return Number.isFinite(n)?NB(Math.round(n/100*255)):null}const r=Number.parseFloat(e);return Number.isFinite(r)?NB(Math.round(r)):null}function JOe(e){const r=Number.parseFloat(e);return Number.isFinite(r)?Math.max(0,Math.min(1,r)):null}function NB(e){return Math.max(0,Math.min(255,e))}function wQ(e){const r=e.trim().slice(1);return r.length===3||r.length===4?`#${r.split("").map(n=>`${n}${n}`).join("").toLowerCase()}`:`#${r.toLowerCase()}`}function QOe(e){let r="",n=!1,i=!1,s=!1,o=!1;for(let a=0;a<e.length;a+=1){const l=e[a],d=e[a+1];if(i){l===`
|
|
878
878
|
`&&(i=!1,r+=l);continue}if(s){l==="*"&&d==="/"&&(s=!1,a+=1);continue}if(n){r+=l,o?o=!1:l==="\\"?o=!0:l==='"'&&(n=!1);continue}if(l==='"'){n=!0,r+=l;continue}if(l==="/"&&d==="/"){i=!0,a+=1;continue}if(l==="/"&&d==="*"){s=!0,a+=1;continue}r+=l}return r}function e7e(e){return e.replace(/,\s*([}\]])/g,"$1")}function t7e(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"theme"}function TB(){if(typeof document>"u")return"vs";const e=document.documentElement;return e.dataset.monacoTheme??(e.classList.contains("dark")?R2:"vs")}function Rj(){const[e,r]=y.useState(TB);return y.useEffect(()=>{if(typeof document>"u")return;const n=document.documentElement,i=()=>r(TB());i();const s=new MutationObserver(i);return s.observe(n,{attributes:!0,attributeFilter:["class","data-monaco-theme"]}),()=>s.disconnect()},[]),e}const FM="jait:vscode-theme-store",w3=new Set;let Dd=kQ(),EB=!1;function SQ(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function kQ(){const e=SQ();if(!e)return{importedThemes:[],activeThemeId:null};let r=null;try{r=e.getItem(FM)}catch{return{importedThemes:[],activeThemeId:null}}if(!r)return{importedThemes:[],activeThemeId:null};try{const n=JSON.parse(r),i=Array.isArray(n.importedThemes)?n.importedThemes.filter(o=>!!(o&&typeof o.id=="string"&&typeof o.monacoThemeName=="string")):[],s=typeof n.activeThemeId=="string"?n.activeThemeId:null;return{importedThemes:i,activeThemeId:i.some(o=>o.id===s)?s:null}}catch{return{importedThemes:[],activeThemeId:null}}}function HM(e){Dd=e;const r=SQ();if(r)try{r.setItem(FM,JSON.stringify(e))}catch{}for(const n of w3)n()}function r7e(e){return!EB&&typeof window<"u"&&(EB=!0,window.addEventListener("storage",r=>{if(r.key===FM){Dd=kQ();for(const n of w3)n()}})),w3.add(e),()=>w3.delete(e)}function AB(){return Dd}function CQ(){const e=y.useSyncExternalStore(r7e,AB,AB);return{...e,activeTheme:e.importedThemes.find(r=>r.id===e.activeThemeId)??null}}function jQ(){return Dd.importedThemes.find(e=>e.id===Dd.activeThemeId)??null}function n7e(e,r){const n=`${Date.now().toString(36)}-${o7e(e+r)}`,i=HOe({id:n,sourceLabel:e,text:r});return HM({importedThemes:[...Dd.importedThemes.filter(s=>s.id!==n),i],activeThemeId:n}),i}function C5(e){HM({...Dd,activeThemeId:e&&Dd.importedThemes.some(r=>r.id===e)?e:null})}function i7e(e){HM({importedThemes:Dd.importedThemes.filter(r=>r.id!==e),activeThemeId:Dd.activeThemeId===e?null:Dd.activeThemeId})}function s7e(e){xQ(e);const r=jQ();r?UOe(e,r):FOe(e)}function Pu(e,r){var n,i;s7e(e),r&&((i=(n=e==null?void 0:e.editor)==null?void 0:n.setTheme)==null||i.call(n,r))}function o7e(e){let r=0;for(let n=0;n<e.length;n+=1)r=(r<<5)-r+e.charCodeAt(n)|0;return Math.abs(r).toString(36)}function f1(e,r){return Math.max(1,e||r||1)}function M2({original:e,modified:r,language:n,modelKey:i,className:s,editorClassName:o,renderSideBySide:a=!1,emptyMessage:l="Files are identical.",options:d}){const u=y.useRef(null),f=y.useRef(null),p=y.useRef(null),g=y.useRef(null),v=y.useRef({original:null,modified:null}),[b,_]=y.useState(!1),[k,S]=y.useState([]),[C,j]=y.useState(0),E=Rj(),T=y.useRef(E);y.useEffect(()=>{T.current=E},[E]);const A=y.useMemo(()=>`inmemory://jait-diff/${encodeURIComponent(i??`${n}:${e.length}:${r.length}`)}`,[n,i,r.length,e.length]),M=y.useMemo(()=>({readOnly:!0,renderSideBySide:a,minimap:{enabled:!1},"semanticHighlighting.enabled":!0,fontSize:13,automaticLayout:!0,scrollBeyondLastLine:!1,renderOverviewRuler:!0,ignoreTrimWhitespace:!1,...d}),[d,a]),z=y.useCallback(()=>{var H;const W=f.current;if(!W)return;const U=((H=W.getLineChanges)==null?void 0:H.call(W))??[];S(U.map(R=>({originalStartLineNumber:R.originalStartLineNumber,originalEndLineNumber:R.originalEndLineNumber,modifiedStartLineNumber:R.modifiedStartLineNumber,modifiedEndLineNumber:R.modifiedEndLineNumber})))},[]);y.useEffect(()=>{let W=!1;const U=BM.init();return U.then(H=>{if(W||!u.current)return;p.current=H,Pu(H,T.current);const R=H.editor.createDiffEditor(u.current,{automaticLayout:!0,...M});f.current=R,g.current=R.onDidUpdateDiff(()=>z()),_(!0),z()}).catch(H=>{!W&&(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)}),()=>{var B,L,I,q,X,F;W=!0,(B=g.current)==null||B.dispose(),g.current=null;const H=f.current,R=v.current;try{H==null||H.setModel(null)}catch{}(L=H==null?void 0:H.dispose)==null||L.call(H),(q=(I=R.original)==null?void 0:I.dispose)==null||q.call(I),(F=(X=R.modified)==null?void 0:X.dispose)==null||F.call(X),v.current={original:null,modified:null},f.current=null,p.current=null,_(!1),U.cancel()}},[z]),y.useEffect(()=>{j(0)},[e,r,n]),y.useEffect(()=>{var q,X;const W=f.current,U=p.current;if(!b||!W||!U)return;const H=v.current,R=U.Uri.parse(`${A}.original`),B=U.Uri.parse(`${A}.modified`);(q=U.editor.getModel(R))==null||q.dispose(),(X=U.editor.getModel(B))==null||X.dispose();const L=U.editor.createModel(e,n,R),I=U.editor.createModel(r,n,B);return W.setModel({original:L,modified:I}),v.current={original:L,modified:I},z(),()=>{var F,G,Q,V;try{W.setModel(null)}catch{}(G=(F=H.original)==null?void 0:F.dispose)==null||G.call(F),(V=(Q=H.modified)==null?void 0:Q.dispose)==null||V.call(Q),L.dispose(),I.dispose(),(v.current.original===L||v.current.modified===I)&&(v.current={original:null,modified:null})}},[b,n,A,r,e,z]),y.useEffect(()=>{const W=p.current;W&&Pu(W,E)},[E]),y.useEffect(()=>{var W,U;(U=(W=f.current)==null?void 0:W.updateOptions)==null||U.call(W,M)},[M]),y.useEffect(()=>{k.length!==0&&j(W=>Math.min(W,k.length-1))},[k]),y.useEffect(()=>{const W=f.current;if(!W||k.length===0)return;const U=k[C];if(!U)return;const H=W.getModifiedEditor(),R=W.getOriginalEditor();try{U.modifiedStartLineNumber>0||U.modifiedEndLineNumber>0?H.revealLineInCenter(f1(U.modifiedStartLineNumber,U.modifiedEndLineNumber)):R.revealLineInCenter(f1(U.originalStartLineNumber,U.originalEndLineNumber))}catch{}},[C,k]),y.useEffect(()=>{const W=f.current,U=p.current;if(!W||!U||k.length===0)return;const H=k[C];if(!H)return;const R=[];(H.originalStartLineNumber>0||H.originalEndLineNumber>0)&&R.push({editor:W.getOriginalEditor(),range:new U.Range(f1(H.originalStartLineNumber,H.originalEndLineNumber),1,f1(H.originalEndLineNumber,H.originalStartLineNumber),1)}),(H.modifiedStartLineNumber>0||H.modifiedEndLineNumber>0)&&R.push({editor:W.getModifiedEditor(),range:new U.Range(f1(H.modifiedStartLineNumber,H.modifiedEndLineNumber),1,f1(H.modifiedEndLineNumber,H.modifiedStartLineNumber),1)});const B=R.map(({editor:L,range:I})=>L.deltaDecorations([],[{range:I,options:{isWholeLine:!0,className:"diff-change-active"}}]));return()=>{var L;for(let I=0;I<R.length;I++)try{(L=R[I])==null||L.editor.deltaDecorations(B[I]??[],[])}catch{}}},[C,k]);const $=y.useCallback(()=>{j(W=>Math.max(W-1,0))},[]),D=y.useCallback(()=>{j(W=>Math.min(W+1,k.length-1))},[k.length]);return c.jsxs("div",{className:Le("relative min-h-0",s),children:[c.jsx("div",{className:Le("h-full min-h-0",o),children:c.jsx("div",{ref:u,className:"h-full min-h-0"})}),!b&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:"Loading diff..."}),k.length>1&&c.jsxs("div",{className:"absolute right-3 top-1/2 z-10 flex -translate-y-1/2 flex-col gap-1.5",children:[c.jsx(Se,{size:"sm",variant:"secondary",className:"h-9 w-9 rounded-full border bg-background/90 p-0 shadow-lg backdrop-blur-sm hover:bg-background",onClick:$,disabled:C===0,title:"Previous change",children:c.jsx(xR,{className:"h-5 w-5"})}),c.jsxs("span",{className:"text-center font-medium tabular-nums text-2xs text-muted-foreground",children:[C+1,"/",k.length]}),c.jsx(Se,{size:"sm",variant:"secondary",className:"h-9 w-9 rounded-full border bg-background/90 p-0 shadow-lg backdrop-blur-sm hover:bg-background",onClick:D,disabled:C===k.length-1,title:"Next change",children:c.jsx(kl,{className:"h-5 w-5"})})]}),k.length===0&&e===r&&b&&c.jsx("div",{className:"pointer-events-none absolute inset-x-3 bottom-3 rounded-md border bg-background/90 px-3 py-2 text-center text-xs text-muted-foreground shadow-sm",children:l}),c.jsx("style",{children:`
|
|
879
879
|
.diff-change-active { outline: 1px solid rgba(99, 102, 241, 0.5); outline-offset: -1px; }
|
|
880
880
|
`})]})}var a7e={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},NT=a7e,l7e={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},c7e=l7e;function u7e({children:e}){return Pt.createElement("div",{style:c7e.container},e)}var d7e=u7e,h7e=d7e;function f7e({width:e,height:r,isEditorReady:n,loading:i,_ref:s,className:o,wrapperProps:a}){return Pt.createElement("section",{style:{...NT.wrapper,width:e,height:r},...a},!n&&Pt.createElement(h7e,null,i),Pt.createElement("div",{ref:s,style:{...NT.fullWidth,...!n&&NT.hide},className:o}))}var p7e=f7e,NQ=y.memo(p7e);function m7e(e){y.useEffect(e,[])}var TQ=m7e;function g7e(e,r,n=!0){let i=y.useRef(!0);y.useEffect(i.current||!n?()=>{i.current=!1}:e,r)}var Oc=g7e;function L_(){}function R1(e,r,n,i){return y7e(e,i)||v7e(e,r,n,i)}function y7e(e,r){return e.editor.getModel(EQ(e,r))}function v7e(e,r,n,i){return e.editor.createModel(r,n,i?EQ(e,i):void 0)}function EQ(e,r){return e.Uri.parse(r)}function x7e({original:e,modified:r,language:n,originalLanguage:i,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:d=!1,theme:u="light",loading:f="Loading...",options:p={},height:g="100%",width:v="100%",className:b,wrapperProps:_={},beforeMount:k=L_,onMount:S=L_}){let[C,j]=y.useState(!1),[E,T]=y.useState(!0),A=y.useRef(null),M=y.useRef(null),z=y.useRef(null),$=y.useRef(S),D=y.useRef(k),W=y.useRef(!1);TQ(()=>{let B=BM.init();return B.then(L=>(M.current=L)&&T(!1)).catch(L=>(L==null?void 0:L.type)!=="cancelation"&&console.error("Monaco initialization: error:",L)),()=>A.current?R():B.cancel()}),Oc(()=>{if(A.current&&M.current){let B=A.current.getOriginalEditor(),L=R1(M.current,e||"",i||n||"text",o||"");L!==B.getModel()&&B.setModel(L)}},[o],C),Oc(()=>{if(A.current&&M.current){let B=A.current.getModifiedEditor(),L=R1(M.current,r||"",s||n||"text",a||"");L!==B.getModel()&&B.setModel(L)}},[a],C),Oc(()=>{let B=A.current.getModifiedEditor();B.getOption(M.current.editor.EditorOption.readOnly)?B.setValue(r||""):r!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[r],C),Oc(()=>{var B,L;(L=(B=A.current)==null?void 0:B.getModel())==null||L.original.setValue(e||"")},[e],C),Oc(()=>{let{original:B,modified:L}=A.current.getModel();M.current.editor.setModelLanguage(B,i||n||"text"),M.current.editor.setModelLanguage(L,s||n||"text")},[n,i,s],C),Oc(()=>{var B;(B=M.current)==null||B.editor.setTheme(u)},[u],C),Oc(()=>{var B;(B=A.current)==null||B.updateOptions(p)},[p],C);let U=y.useCallback(()=>{var I;if(!M.current)return;D.current(M.current);let B=R1(M.current,e||"",i||n||"text",o||""),L=R1(M.current,r||"",s||n||"text",a||"");(I=A.current)==null||I.setModel({original:B,modified:L})},[n,r,s,e,i,o,a]),H=y.useCallback(()=>{var B;!W.current&&z.current&&(A.current=M.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...p}),U(),(B=M.current)==null||B.editor.setTheme(u),j(!0),W.current=!0)},[p,u,U]);y.useEffect(()=>{C&&$.current(A.current,M.current)},[C]),y.useEffect(()=>{!E&&!C&&H()},[E,C,H]);function R(){var L,I,q,X;let B=(L=A.current)==null?void 0:L.getModel();l||((I=B==null?void 0:B.original)==null||I.dispose()),d||((q=B==null?void 0:B.modified)==null||q.dispose()),(X=A.current)==null||X.dispose()}return Pt.createElement(NQ,{width:v,height:g,isEditorReady:C,loading:f,_ref:z,className:b,wrapperProps:_})}var b7e=x7e,_7e=y.memo(b7e);function w7e(e){let r=y.useRef();return y.useEffect(()=>{r.current=e},[e]),r.current}var S7e=w7e,yC=new Map;function k7e({defaultValue:e,defaultLanguage:r,defaultPath:n,value:i,language:s,path:o,theme:a="light",line:l,loading:d="Loading...",options:u={},overrideServices:f={},saveViewState:p=!0,keepCurrentModel:g=!1,width:v="100%",height:b="100%",className:_,wrapperProps:k={},beforeMount:S=L_,onMount:C=L_,onChange:j,onValidate:E=L_}){let[T,A]=y.useState(!1),[M,z]=y.useState(!0),$=y.useRef(null),D=y.useRef(null),W=y.useRef(null),U=y.useRef(C),H=y.useRef(S),R=y.useRef(),B=y.useRef(i),L=S7e(o),I=y.useRef(!1),q=y.useRef(!1);TQ(()=>{let G=BM.init();return G.then(Q=>($.current=Q)&&z(!1)).catch(Q=>(Q==null?void 0:Q.type)!=="cancelation"&&console.error("Monaco initialization: error:",Q)),()=>D.current?F():G.cancel()}),Oc(()=>{var Q,V,ee,ie;let G=R1($.current,e||i||"",r||s||"",o||n||"");G!==((Q=D.current)==null?void 0:Q.getModel())&&(p&&yC.set(L,(V=D.current)==null?void 0:V.saveViewState()),(ee=D.current)==null||ee.setModel(G),p&&((ie=D.current)==null||ie.restoreViewState(yC.get(o))))},[o],T),Oc(()=>{var G;(G=D.current)==null||G.updateOptions(u)},[u],T),Oc(()=>{!D.current||i===void 0||(D.current.getOption($.current.editor.EditorOption.readOnly)?D.current.setValue(i):i!==D.current.getValue()&&(q.current=!0,D.current.executeEdits("",[{range:D.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),D.current.pushUndoStop(),q.current=!1))},[i],T),Oc(()=>{var Q,V;let G=(Q=D.current)==null?void 0:Q.getModel();G&&s&&((V=$.current)==null||V.editor.setModelLanguage(G,s))},[s],T),Oc(()=>{var G;l!==void 0&&((G=D.current)==null||G.revealLine(l))},[l],T),Oc(()=>{var G;(G=$.current)==null||G.editor.setTheme(a)},[a],T);let X=y.useCallback(()=>{var G;if(!(!W.current||!$.current)&&!I.current){H.current($.current);let Q=o||n,V=R1($.current,i||e||"",r||s||"",Q||"");D.current=(G=$.current)==null?void 0:G.editor.create(W.current,{model:V,automaticLayout:!0,...u},f),p&&D.current.restoreViewState(yC.get(Q)),$.current.editor.setTheme(a),l!==void 0&&D.current.revealLine(l),A(!0),I.current=!0}},[e,r,n,i,s,o,u,f,p,a,l]);y.useEffect(()=>{T&&U.current(D.current,$.current)},[T]),y.useEffect(()=>{!M&&!T&&X()},[M,T,X]),B.current=i,y.useEffect(()=>{var G,Q;T&&j&&((G=R.current)==null||G.dispose(),R.current=(Q=D.current)==null?void 0:Q.onDidChangeModelContent(V=>{q.current||j(D.current.getValue(),V)}))},[T,j]),y.useEffect(()=>{if(T){let G=$.current.editor.onDidChangeMarkers(Q=>{var ee;let V=(ee=D.current.getModel())==null?void 0:ee.uri;if(V&&Q.find(ie=>ie.path===V.path)){let ie=$.current.editor.getModelMarkers({resource:V});E==null||E(ie)}});return()=>{G==null||G.dispose()}}return()=>{}},[T,E]);function F(){var G,Q;(G=R.current)==null||G.dispose(),g?p&&yC.set(o,D.current.saveViewState()):(Q=D.current.getModel())==null||Q.dispose(),D.current.dispose()}return Pt.createElement(NQ,{width:v,height:b,isEditorReady:T,loading:d,_ref:W,className:_,wrapperProps:k})}var C7e=k7e,j7e=y.memo(C7e),Mj=j7e;const N7e=Un();function T7e(){return w0()}function E7e(e=!1){const r={};e&&(r["Content-Type"]="application/json");const n=T7e();return n&&(r.Authorization=`Bearer ${n}`),r}async function Di(e,r){const n=await fetch(`${N7e}/api/git/${e}`,{method:"POST",headers:E7e(!0),body:JSON.stringify(r)});if(!n.ok){const i=await n.json().catch(()=>({}));throw new Error(i.error||`Git ${e} failed: ${n.statusText}`)}return n.json()}const Xs={status(e,r){return Di("status",{cwd:e,...r?{branch:r}:{}})},listBranches(e){return Di("branches",{cwd:e})},pull(e){return Di("pull",{cwd:e})},sync(e){return Di("sync",{cwd:e})},fetch(e,r=!1){return Di("fetch",{cwd:e,all:r})},runStackedAction(e,r,n){return Di("run-stacked-action",{cwd:e,action:r,...n!=null&&n.commitMessage?{commitMessage:n.commitMessage}:{},...n!=null&&n.featureBranch?{featureBranch:!0}:{},...n!=null&&n.baseBranch?{baseBranch:n.baseBranch}:{}})},checkout(e,r){return Di("checkout",{cwd:e,branch:r})},createBranch(e,r,n){return Di("create-branch",{cwd:e,branch:r,baseBranch:n})},discard(e,r){return Di("discard",{cwd:e,paths:r})},stage(e,r){return Di("stage",{cwd:e,paths:r})},unstage(e,r){return Di("unstage",{cwd:e,paths:r})},init(e){return Di("init",{cwd:e})},diff(e){return Di("diff",{cwd:e})},diffStats(e,r,n){return Di("diff-stats",{cwd:e,...r?{baseBranch:r}:{},...n?{branch:n}:{}})},fileDiffs(e,r,n){return Di("file-diffs",{cwd:e,...r?{baseBranch:r}:{},...n?{branch:n}:{}}).then(i=>i.files)},createWorktree(e,r,n,i){return Di("create-worktree",{cwd:e,baseBranch:r,newBranch:n,...i?{path:i}:{}})},removeWorktree(e,r,n=!1){return Di("remove-worktree",{cwd:e,path:r,force:n})},ghStatus(e){return Di("gh-status",{...e?{cwd:e}:{}})},ghAuth(e,r){return Di("gh-auth",{token:e,...r?{cwd:r}:{}})},forgeStatus(e,r){return Di("forge-status",{...e?{cwd:e}:{},...r?{remoteUrl:r}:{}})},forgeAuth(e,r,n){return Di("forge-auth",{token:e,...r?{cwd:r}:{},...n?{remoteUrl:n}:{}})},forgePrChecks(e,r,n){return Di("forge-pr-checks",{cwd:e,branch:r,...n?{remoteUrl:n}:{}})},identity(e){return Di("identity",{cwd:e})},setIdentity(e,r,n){return Di("identity",{cwd:e,name:r,email:n})},prChecks(e,r){return Di("pr-checks",{cwd:e,branch:r})},generateCommitMessage(e,r,n){return Di("generate-commit-message",{cwd:e,...r?{provider:r}:{},...n?{model:n}:{}})}};var AQ=Object.defineProperty,Y=(e,r)=>AQ(e,"name",{value:r,configurable:!0}),A7e=(e,r)=>{for(var n in r)AQ(e,n,{get:r[n],enumerable:!0})},Mf={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},St={trace:Y((...e)=>{},"trace"),debug:Y((...e)=>{},"debug"),info:Y((...e)=>{},"info"),warn:Y((...e)=>{},"warn"),error:Y((...e)=>{},"error"),fatal:Y((...e)=>{},"fatal")},WM=Y(function(e="fatal"){let r=Mf.fatal;typeof e=="string"?e.toLowerCase()in Mf&&(r=Mf[e]):typeof e=="number"&&(r=e),St.trace=()=>{},St.debug=()=>{},St.info=()=>{},St.warn=()=>{},St.error=()=>{},St.fatal=()=>{},r<=Mf.fatal&&(St.fatal=console.error?console.error.bind(console,gu("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",gu("FATAL"))),r<=Mf.error&&(St.error=console.error?console.error.bind(console,gu("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",gu("ERROR"))),r<=Mf.warn&&(St.warn=console.warn?console.warn.bind(console,gu("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",gu("WARN"))),r<=Mf.info&&(St.info=console.info?console.info.bind(console,gu("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",gu("INFO"))),r<=Mf.debug&&(St.debug=console.debug?console.debug.bind(console,gu("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",gu("DEBUG"))),r<=Mf.trace&&(St.trace=console.debug?console.debug.bind(console,gu("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",gu("TRACE")))},"setLogLevel"),gu=Y(e=>`%c${iEe().format("ss.SSS")} : ${e} : `,"format");const S3={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const r=e/255;return e>.03928?Math.pow((r+.055)/1.055,2.4):r/12.92},hue2rgb:(e,r,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(r-e)*6*n:n<1/2?r:n<2/3?e+(r-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:r,l:n},i)=>{if(!r)return n*2.55;e/=360,r/=100,n/=100;const s=n<.5?n*(1+r):n+r-n*r,o=2*n-s;switch(i){case"r":return S3.hue2rgb(o,s,e+1/3)*255;case"g":return S3.hue2rgb(o,s,e)*255;case"b":return S3.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:r,b:n},i)=>{e/=255,r/=255,n/=255;const s=Math.max(e,r,n),o=Math.min(e,r,n),a=(s+o)/2;if(i==="l")return a*100;if(s===o)return 0;const l=s-o,d=a>.5?l/(2-s-o):l/(s+o);if(i==="s")return d*100;switch(s){case e:return((r-n)/l+(r<n?6:0))*60;case r:return((n-e)/l+2)*60;case n:return((e-r)/l+4)*60;default:return-1}}},O7e={clamp:(e,r,n)=>r>n?Math.min(r,Math.max(n,e)):Math.min(n,Math.max(r,e)),round:e=>Math.round(e*1e10)/1e10},R7e={dec2hex:e=>{const r=Math.round(e).toString(16);return r.length>1?r:`0${r}`}},an={channel:S3,lang:O7e,unit:R7e},Sm={};for(let e=0;e<=255;e++)Sm[e]=an.unit.dec2hex(e);const Pa={ALL:0,RGB:1,HSL:2};class M7e{constructor(){this.type=Pa.ALL}get(){return this.type}set(r){if(this.type&&this.type!==r)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=r}reset(){this.type=Pa.ALL}is(r){return this.type===r}}class P7e{constructor(r,n){this.color=n,this.changed=!1,this.data=r,this.type=new M7e}set(r,n){return this.color=n,this.changed=!1,this.data=r,this.type.type=Pa.ALL,this}_ensureHSL(){const r=this.data,{h:n,s:i,l:s}=r;n===void 0&&(r.h=an.channel.rgb2hsl(r,"h")),i===void 0&&(r.s=an.channel.rgb2hsl(r,"s")),s===void 0&&(r.l=an.channel.rgb2hsl(r,"l"))}_ensureRGB(){const r=this.data,{r:n,g:i,b:s}=r;n===void 0&&(r.r=an.channel.hsl2rgb(r,"r")),i===void 0&&(r.g=an.channel.hsl2rgb(r,"g")),s===void 0&&(r.b=an.channel.hsl2rgb(r,"b"))}get r(){const r=this.data,n=r.r;return!this.type.is(Pa.HSL)&&n!==void 0?n:(this._ensureHSL(),an.channel.hsl2rgb(r,"r"))}get g(){const r=this.data,n=r.g;return!this.type.is(Pa.HSL)&&n!==void 0?n:(this._ensureHSL(),an.channel.hsl2rgb(r,"g"))}get b(){const r=this.data,n=r.b;return!this.type.is(Pa.HSL)&&n!==void 0?n:(this._ensureHSL(),an.channel.hsl2rgb(r,"b"))}get h(){const r=this.data,n=r.h;return!this.type.is(Pa.RGB)&&n!==void 0?n:(this._ensureRGB(),an.channel.rgb2hsl(r,"h"))}get s(){const r=this.data,n=r.s;return!this.type.is(Pa.RGB)&&n!==void 0?n:(this._ensureRGB(),an.channel.rgb2hsl(r,"s"))}get l(){const r=this.data,n=r.l;return!this.type.is(Pa.RGB)&&n!==void 0?n:(this._ensureRGB(),an.channel.rgb2hsl(r,"l"))}get a(){return this.data.a}set r(r){this.type.set(Pa.RGB),this.changed=!0,this.data.r=r}set g(r){this.type.set(Pa.RGB),this.changed=!0,this.data.g=r}set b(r){this.type.set(Pa.RGB),this.changed=!0,this.data.b=r}set h(r){this.type.set(Pa.HSL),this.changed=!0,this.data.h=r}set s(r){this.type.set(Pa.HSL),this.changed=!0,this.data.s=r}set l(r){this.type.set(Pa.HSL),this.changed=!0,this.data.l=r}set a(r){this.changed=!0,this.data.a=r}}const Pj=new P7e({r:0,g:0,b:0,a:0},"transparent"),W1={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const r=e.match(W1.re);if(!r)return;const n=r[1],i=parseInt(n,16),s=n.length,o=s%4===0,a=s>4,l=a?1:17,d=a?8:4,u=o?0:-1,f=a?255:15;return Pj.set({r:(i>>d*(u+3)&f)*l,g:(i>>d*(u+2)&f)*l,b:(i>>d*(u+1)&f)*l,a:o?(i&f)*l/255:1},e)},stringify:e=>{const{r,g:n,b:i,a:s}=e;return s<1?`#${Sm[Math.round(r)]}${Sm[Math.round(n)]}${Sm[Math.round(i)]}${Sm[Math.round(s*255)]}`:`#${Sm[Math.round(r)]}${Sm[Math.round(n)]}${Sm[Math.round(i)]}`}},p0={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const r=e.match(p0.hueRe);if(r){const[,n,i]=r;switch(i){case"grad":return an.channel.clamp.h(parseFloat(n)*.9);case"rad":return an.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return an.channel.clamp.h(parseFloat(n)*360)}}return an.channel.clamp.h(parseFloat(e))},parse:e=>{const r=e.charCodeAt(0);if(r!==104&&r!==72)return;const n=e.match(p0.re);if(!n)return;const[,i,s,o,a,l]=n;return Pj.set({h:p0._hue2deg(i),s:an.channel.clamp.s(parseFloat(s)),l:an.channel.clamp.l(parseFloat(o)),a:a?an.channel.clamp.a(l?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:r,s:n,l:i,a:s}=e;return s<1?`hsla(${an.lang.round(r)}, ${an.lang.round(n)}%, ${an.lang.round(i)}%, ${s})`:`hsl(${an.lang.round(r)}, ${an.lang.round(n)}%, ${an.lang.round(i)}%)`}},$_={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const r=$_.colors[e];if(r)return W1.parse(r)},stringify:e=>{const r=W1.stringify(e);for(const n in $_.colors)if($_.colors[n]===r)return n}},a_={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const r=e.charCodeAt(0);if(r!==114&&r!==82)return;const n=e.match(a_.re);if(!n)return;const[,i,s,o,a,l,d,u,f]=n;return Pj.set({r:an.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:an.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:an.channel.clamp.b(d?parseFloat(l)*2.55:parseFloat(l)),a:u?an.channel.clamp.a(f?parseFloat(u)/100:parseFloat(u)):1},e)},stringify:e=>{const{r,g:n,b:i,a:s}=e;return s<1?`rgba(${an.lang.round(r)}, ${an.lang.round(n)}, ${an.lang.round(i)}, ${an.lang.round(s)})`:`rgb(${an.lang.round(r)}, ${an.lang.round(n)}, ${an.lang.round(i)})`}},qh={format:{keyword:$_,hex:W1,rgb:a_,rgba:a_,hsl:p0,hsla:p0},parse:e=>{if(typeof e!="string")return e;const r=W1.parse(e)||a_.parse(e)||p0.parse(e)||$_.parse(e);if(r)return r;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Pa.HSL)||e.data.r===void 0?p0.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?a_.stringify(e):W1.stringify(e)},OQ=(e,r)=>{const n=qh.parse(e);for(const i in r)n[i]=an.channel.clamp[i](r[i]);return qh.stringify(n)},D_=(e,r,n=0,i=1)=>{if(typeof e!="number")return OQ(e,{a:r});const s=Pj.set({r:an.channel.clamp.r(e),g:an.channel.clamp.g(r),b:an.channel.clamp.b(n),a:an.channel.clamp.a(i)});return qh.stringify(s)},L7e=e=>{const{r,g:n,b:i}=qh.parse(e),s=.2126*an.channel.toLinear(r)+.7152*an.channel.toLinear(n)+.0722*an.channel.toLinear(i);return an.lang.round(s)},$7e=e=>L7e(e)>=.5,TS=e=>!$7e(e),RQ=(e,r,n)=>{const i=qh.parse(e),s=i[r],o=an.channel.clamp[r](s+n);return s!==o&&(i[r]=o),qh.stringify(i)},yr=(e,r)=>RQ(e,"l",r),Hr=(e,r)=>RQ(e,"l",-r),Oe=(e,r)=>{const n=qh.parse(e),i={};for(const s in r)r[s]&&(i[s]=n[s]+r[s]);return OQ(e,i)},D7e=(e,r,n=50)=>{const{r:i,g:s,b:o,a}=qh.parse(e),{r:l,g:d,b:u,a:f}=qh.parse(r),p=n/100,g=p*2-1,v=a-f,_=((g*v===-1?g:(g+v)/(1+g*v))+1)/2,k=1-_,S=i*_+l*k,C=s*_+d*k,j=o*_+u*k,E=a*p+f*(1-p);return D_(S,C,j,E)},Jt=(e,r=100)=>{const n=qh.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,D7e(n,e,r)};/*! @license DOMPurify 3.3.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.2/LICENSE */const{entries:MQ,setPrototypeOf:OB,isFrozen:I7e,getPrototypeOf:B7e,getOwnPropertyDescriptor:z7e}=Object;let{freeze:wl,seal:Bu,create:k3}=Object,{apply:gA,construct:yA}=typeof Reflect<"u"&&Reflect;wl||(wl=function(r){return r});Bu||(Bu=function(r){return r});gA||(gA=function(r,n){for(var i=arguments.length,s=new Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];return r.apply(n,s)});yA||(yA=function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return new r(...i)});const vC=Sl(Array.prototype.forEach),F7e=Sl(Array.prototype.lastIndexOf),RB=Sl(Array.prototype.pop),yb=Sl(Array.prototype.push),H7e=Sl(Array.prototype.splice),C3=Sl(String.prototype.toLowerCase),TT=Sl(String.prototype.toString),ET=Sl(String.prototype.match),vb=Sl(String.prototype.replace),W7e=Sl(String.prototype.indexOf),U7e=Sl(String.prototype.trim),Ac=Sl(Object.prototype.hasOwnProperty),ul=Sl(RegExp.prototype.test),xb=V7e(TypeError);function Sl(e){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return gA(e,r,i)}}function V7e(e){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return yA(e,n)}}function Mn(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:C3;OB&&OB(e,null);let i=r.length;for(;i--;){let s=r[i];if(typeof s=="string"){const o=n(s);o!==s&&(I7e(r)||(r[i]=o),s=o)}e[s]=!0}return e}function q7e(e){for(let r=0;r<e.length;r++)Ac(e,r)||(e[r]=null);return e}function wh(e){const r=k3(null);for(const[n,i]of MQ(e))Ac(e,n)&&(Array.isArray(i)?r[n]=q7e(i):i&&typeof i=="object"&&i.constructor===Object?r[n]=wh(i):r[n]=i);return r}function bb(e,r){for(;e!==null;){const i=z7e(e,r);if(i){if(i.get)return Sl(i.get);if(typeof i.value=="function")return Sl(i.value)}e=B7e(e)}function n(){return null}return n}const MB=wl(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),AT=wl(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),OT=wl(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),G7e=wl(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),RT=wl(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),K7e=wl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),PB=wl(["#text"]),LB=wl(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),MT=wl(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$B=wl(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xC=wl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y7e=Bu(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X7e=Bu(/<%[\w\W]*|[\w\W]*%>/gm),Z7e=Bu(/\$\{[\w\W]*/gm),J7e=Bu(/^data-[\-\w.\u00B7-\uFFFF]+$/),Q7e=Bu(/^aria-[\-\w]+$/),PQ=Bu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eRe=Bu(/^(?:\w+script|data):/i),tRe=Bu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),LQ=Bu(/^html$/i),rRe=Bu(/^[a-z][.\w]*(-[.\w]+)+$/i);var DB=Object.freeze({__proto__:null,ARIA_ATTR:Q7e,ATTR_WHITESPACE:tRe,CUSTOM_ELEMENT:rRe,DATA_ATTR:J7e,DOCTYPE_NAME:LQ,ERB_EXPR:X7e,IS_ALLOWED_URI:PQ,IS_SCRIPT_OR_DATA:eRe,MUSTACHE_EXPR:Y7e,TMPLIT_EXPR:Z7e});const _b={element:1,text:3,progressingInstruction:7,comment:8,document:9},nRe=function(){return typeof window>"u"?null:window},iRe=function(r,n){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(i=n.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return r.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},IB=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function $Q(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nRe();const r=_t=>$Q(_t);if(r.version="3.3.2",r.removed=[],!e||!e.document||e.document.nodeType!==_b.document||!e.Element)return r.isSupported=!1,r;let{document:n}=e;const i=n,s=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:l,Element:d,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:g,trustedTypes:v}=e,b=d.prototype,_=bb(b,"cloneNode"),k=bb(b,"remove"),S=bb(b,"nextSibling"),C=bb(b,"childNodes"),j=bb(b,"parentNode");if(typeof a=="function"){const _t=n.createElement("template");_t.content&&_t.content.ownerDocument&&(n=_t.content.ownerDocument)}let E,T="";const{implementation:A,createNodeIterator:M,createDocumentFragment:z,getElementsByTagName:$}=n,{importNode:D}=i;let W=IB();r.isSupported=typeof MQ=="function"&&typeof j=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:U,ERB_EXPR:H,TMPLIT_EXPR:R,DATA_ATTR:B,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:X}=DB;let{IS_ALLOWED_URI:F}=DB,G=null;const Q=Mn({},[...MB,...AT,...OT,...RT,...PB]);let V=null;const ee=Mn({},[...LB,...MT,...$B,...xC]);let ie=Object.seal(k3(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),le=null,he=null;const re=Object.seal(k3(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ne=!0,fe=!0,we=!1,pe=!0,et=!1,ae=!0,rt=!1,Je=!1,$e=!1,Ne=!1,Xe=!1,gt=!1,zt=!0,Mt=!1;const Wt="user-content-";let nr=!0,ar=!1,Me={},ve=null;const Ie=Mn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const nt=Mn({},["audio","video","img","source","image","track"]);let ke=null;const Ce=Mn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",wt="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml";let Ue=Be,jt=!1,Qe=null;const Lt=Mn({},[Fe,wt,Be],TT);let Ot=Mn({},["mi","mo","mn","ms","mtext"]),st=Mn({},["annotation-xml"]);const ft=Mn({},["title","style","font","a","script"]);let Nt=null;const ct=["application/xhtml+xml","text/html"],Rt="text/html";let bt=null,Yt=null;const dt=n.createElement("form"),Ut=function(ye){return ye instanceof RegExp||ye instanceof Function},tr=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Yt&&Yt===ye)){if((!ye||typeof ye!="object")&&(ye={}),ye=wh(ye),Nt=ct.indexOf(ye.PARSER_MEDIA_TYPE)===-1?Rt:ye.PARSER_MEDIA_TYPE,bt=Nt==="application/xhtml+xml"?TT:C3,G=Ac(ye,"ALLOWED_TAGS")?Mn({},ye.ALLOWED_TAGS,bt):Q,V=Ac(ye,"ALLOWED_ATTR")?Mn({},ye.ALLOWED_ATTR,bt):ee,Qe=Ac(ye,"ALLOWED_NAMESPACES")?Mn({},ye.ALLOWED_NAMESPACES,TT):Lt,ke=Ac(ye,"ADD_URI_SAFE_ATTR")?Mn(wh(Ce),ye.ADD_URI_SAFE_ATTR,bt):Ce,Ve=Ac(ye,"ADD_DATA_URI_TAGS")?Mn(wh(nt),ye.ADD_DATA_URI_TAGS,bt):nt,ve=Ac(ye,"FORBID_CONTENTS")?Mn({},ye.FORBID_CONTENTS,bt):Ie,le=Ac(ye,"FORBID_TAGS")?Mn({},ye.FORBID_TAGS,bt):wh({}),he=Ac(ye,"FORBID_ATTR")?Mn({},ye.FORBID_ATTR,bt):wh({}),Me=Ac(ye,"USE_PROFILES")?ye.USE_PROFILES:!1,ne=ye.ALLOW_ARIA_ATTR!==!1,fe=ye.ALLOW_DATA_ATTR!==!1,we=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,et=ye.SAFE_FOR_TEMPLATES||!1,ae=ye.SAFE_FOR_XML!==!1,rt=ye.WHOLE_DOCUMENT||!1,Ne=ye.RETURN_DOM||!1,Xe=ye.RETURN_DOM_FRAGMENT||!1,gt=ye.RETURN_TRUSTED_TYPE||!1,$e=ye.FORCE_BODY||!1,zt=ye.SANITIZE_DOM!==!1,Mt=ye.SANITIZE_NAMED_PROPS||!1,nr=ye.KEEP_CONTENT!==!1,ar=ye.IN_PLACE||!1,F=ye.ALLOWED_URI_REGEXP||PQ,Ue=ye.NAMESPACE||Be,Ot=ye.MATHML_TEXT_INTEGRATION_POINTS||Ot,st=ye.HTML_INTEGRATION_POINTS||st,ie=ye.CUSTOM_ELEMENT_HANDLING||{},ye.CUSTOM_ELEMENT_HANDLING&&Ut(ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ie.tagNameCheck=ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&Ut(ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ie.attributeNameCheck=ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&typeof ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),et&&(fe=!1),Xe&&(Ne=!0),Me&&(G=Mn({},PB),V=k3(null),Me.html===!0&&(Mn(G,MB),Mn(V,LB)),Me.svg===!0&&(Mn(G,AT),Mn(V,MT),Mn(V,xC)),Me.svgFilters===!0&&(Mn(G,OT),Mn(V,MT),Mn(V,xC)),Me.mathMl===!0&&(Mn(G,RT),Mn(V,$B),Mn(V,xC))),Ac(ye,"ADD_TAGS")||(re.tagCheck=null),Ac(ye,"ADD_ATTR")||(re.attributeCheck=null),ye.ADD_TAGS&&(typeof ye.ADD_TAGS=="function"?re.tagCheck=ye.ADD_TAGS:(G===Q&&(G=wh(G)),Mn(G,ye.ADD_TAGS,bt))),ye.ADD_ATTR&&(typeof ye.ADD_ATTR=="function"?re.attributeCheck=ye.ADD_ATTR:(V===ee&&(V=wh(V)),Mn(V,ye.ADD_ATTR,bt))),ye.ADD_URI_SAFE_ATTR&&Mn(ke,ye.ADD_URI_SAFE_ATTR,bt),ye.FORBID_CONTENTS&&(ve===Ie&&(ve=wh(ve)),Mn(ve,ye.FORBID_CONTENTS,bt)),ye.ADD_FORBID_CONTENTS&&(ve===Ie&&(ve=wh(ve)),Mn(ve,ye.ADD_FORBID_CONTENTS,bt)),nr&&(G["#text"]=!0),rt&&Mn(G,["html","head","body"]),G.table&&(Mn(G,["tbody"]),delete le.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw xb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xb('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=ye.TRUSTED_TYPES_POLICY,T=E.createHTML("")}else E===void 0&&(E=iRe(v,s)),E!==null&&typeof T=="string"&&(T=E.createHTML(""));wl&&wl(ye),Yt=ye}},un=Mn({},[...AT,...OT,...G7e]),be=Mn({},[...RT,...K7e]),Dt=function(ye){let kt=j(ye);(!kt||!kt.tagName)&&(kt={namespaceURI:Ue,tagName:"template"});const rr=C3(ye.tagName),Rr=C3(kt.tagName);return Qe[ye.namespaceURI]?ye.namespaceURI===wt?kt.namespaceURI===Be?rr==="svg":kt.namespaceURI===Fe?rr==="svg"&&(Rr==="annotation-xml"||Ot[Rr]):!!un[rr]:ye.namespaceURI===Fe?kt.namespaceURI===Be?rr==="math":kt.namespaceURI===wt?rr==="math"&&st[Rr]:!!be[rr]:ye.namespaceURI===Be?kt.namespaceURI===wt&&!st[Rr]||kt.namespaceURI===Fe&&!Ot[Rr]?!1:!be[rr]&&(ft[rr]||!un[rr]):!!(Nt==="application/xhtml+xml"&&Qe[ye.namespaceURI]):!1},Xt=function(ye){yb(r.removed,{element:ye});try{j(ye).removeChild(ye)}catch{k(ye)}},Ft=function(ye,kt){try{yb(r.removed,{attribute:kt.getAttributeNode(ye),from:kt})}catch{yb(r.removed,{attribute:null,from:kt})}if(kt.removeAttribute(ye),ye==="is")if(Ne||Xe)try{Xt(kt)}catch{}else try{kt.setAttribute(ye,"")}catch{}},hr=function(ye){let kt=null,rr=null;if($e)ye="<remove></remove>"+ye;else{const nn=ET(ye,/^[\r\n\t ]+/);rr=nn&&nn[0]}Nt==="application/xhtml+xml"&&Ue===Be&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");const Rr=E?E.createHTML(ye):ye;if(Ue===Be)try{kt=new g().parseFromString(Rr,Nt)}catch{}if(!kt||!kt.documentElement){kt=A.createDocument(Ue,"template",null);try{kt.documentElement.innerHTML=jt?T:Rr}catch{}}const Mr=kt.body||kt.documentElement;return ye&&rr&&Mr.insertBefore(n.createTextNode(rr),Mr.childNodes[0]||null),Ue===Be?$.call(kt,rt?"html":"body")[0]:rt?kt.documentElement:Mr},xn=function(ye){return M.call(ye.ownerDocument||ye,ye,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},sr=function(ye){return ye instanceof p&&(typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||!(ye.attributes instanceof f)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function")},ht=function(ye){return typeof l=="function"&&ye instanceof l};function lt(_t,ye,kt){vC(_t,rr=>{rr.call(r,ye,kt,Yt)})}const Cn=function(ye){let kt=null;if(lt(W.beforeSanitizeElements,ye,null),sr(ye))return Xt(ye),!0;const rr=bt(ye.nodeName);if(lt(W.uponSanitizeElement,ye,{tagName:rr,allowedTags:G}),ae&&ye.hasChildNodes()&&!ht(ye.firstElementChild)&&ul(/<[/\w!]/g,ye.innerHTML)&&ul(/<[/\w!]/g,ye.textContent)||ye.nodeType===_b.progressingInstruction||ae&&ye.nodeType===_b.comment&&ul(/<[/\w]/g,ye.data))return Xt(ye),!0;if(!(re.tagCheck instanceof Function&&re.tagCheck(rr))&&(!G[rr]||le[rr])){if(!le[rr]&&Oi(rr)&&(ie.tagNameCheck instanceof RegExp&&ul(ie.tagNameCheck,rr)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(rr)))return!1;if(nr&&!ve[rr]){const Rr=j(ye)||ye.parentNode,Mr=C(ye)||ye.childNodes;if(Mr&&Rr){const nn=Mr.length;for(let Ri=nn-1;Ri>=0;--Ri){const Pe=_(Mr[Ri],!0);Pe.__removalCount=(ye.__removalCount||0)+1,Rr.insertBefore(Pe,S(ye))}}}return Xt(ye),!0}return ye instanceof d&&!Dt(ye)||(rr==="noscript"||rr==="noembed"||rr==="noframes")&&ul(/<\/no(script|embed|frames)/i,ye.innerHTML)?(Xt(ye),!0):(et&&ye.nodeType===_b.text&&(kt=ye.textContent,vC([U,H,R],Rr=>{kt=vb(kt,Rr," ")}),ye.textContent!==kt&&(yb(r.removed,{element:ye.cloneNode()}),ye.textContent=kt)),lt(W.afterSanitizeElements,ye,null),!1)},Sr=function(ye,kt,rr){if(he[kt]||zt&&(kt==="id"||kt==="name")&&(rr in n||rr in dt))return!1;if(!(fe&&!he[kt]&&ul(B,kt))){if(!(ne&&ul(L,kt))){if(!(re.attributeCheck instanceof Function&&re.attributeCheck(kt,ye))){if(!V[kt]||he[kt]){if(!(Oi(ye)&&(ie.tagNameCheck instanceof RegExp&&ul(ie.tagNameCheck,ye)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(ye))&&(ie.attributeNameCheck instanceof RegExp&&ul(ie.attributeNameCheck,kt)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(kt,ye))||kt==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&ul(ie.tagNameCheck,rr)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(rr))))return!1}else if(!ke[kt]){if(!ul(F,vb(rr,q,""))){if(!((kt==="src"||kt==="xlink:href"||kt==="href")&&ye!=="script"&&W7e(rr,"data:")===0&&Ve[ye])){if(!(we&&!ul(I,vb(rr,q,"")))){if(rr)return!1}}}}}}}return!0},Oi=function(ye){return ye!=="annotation-xml"&&ET(ye,X)},zi=function(ye){lt(W.beforeSanitizeAttributes,ye,null);const{attributes:kt}=ye;if(!kt||sr(ye))return;const rr={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let Rr=kt.length;for(;Rr--;){const Mr=kt[Rr],{name:nn,namespaceURI:Ri,value:Pe}=Mr,tt=bt(nn),It=Pe;let dr=nn==="value"?It:U7e(It);if(rr.attrName=tt,rr.attrValue=dr,rr.keepAttr=!0,rr.forceKeepAttr=void 0,lt(W.uponSanitizeAttribute,ye,rr),dr=rr.attrValue,Mt&&(tt==="id"||tt==="name")&&(Ft(nn,ye),dr=Wt+dr),ae&&ul(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,dr)){Ft(nn,ye);continue}if(tt==="attributename"&&ET(dr,"href")){Ft(nn,ye);continue}if(rr.forceKeepAttr)continue;if(!rr.keepAttr){Ft(nn,ye);continue}if(!pe&&ul(/\/>/i,dr)){Ft(nn,ye);continue}et&&vC([U,H,R],Wr=>{dr=vb(dr,Wr," ")});const yt=bt(ye.nodeName);if(!Sr(yt,tt,dr)){Ft(nn,ye);continue}if(E&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Ri)switch(v.getAttributeType(yt,tt)){case"TrustedHTML":{dr=E.createHTML(dr);break}case"TrustedScriptURL":{dr=E.createScriptURL(dr);break}}if(dr!==It)try{Ri?ye.setAttributeNS(Ri,nn,dr):ye.setAttribute(nn,dr),sr(ye)?Xt(ye):RB(r.removed)}catch{Ft(nn,ye)}}lt(W.afterSanitizeAttributes,ye,null)},_o=function _t(ye){let kt=null;const rr=xn(ye);for(lt(W.beforeSanitizeShadowDOM,ye,null);kt=rr.nextNode();)lt(W.uponSanitizeShadowNode,kt,null),Cn(kt),zi(kt),kt.content instanceof o&&_t(kt.content);lt(W.afterSanitizeShadowDOM,ye,null)};return r.sanitize=function(_t){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},kt=null,rr=null,Rr=null,Mr=null;if(jt=!_t,jt&&(_t="<!-->"),typeof _t!="string"&&!ht(_t))if(typeof _t.toString=="function"){if(_t=_t.toString(),typeof _t!="string")throw xb("dirty is not a string, aborting")}else throw xb("toString is not a function");if(!r.isSupported)return _t;if(Je||tr(ye),r.removed=[],typeof _t=="string"&&(ar=!1),ar){if(_t.nodeName){const Pe=bt(_t.nodeName);if(!G[Pe]||le[Pe])throw xb("root node is forbidden and cannot be sanitized in-place")}}else if(_t instanceof l)kt=hr("<!---->"),rr=kt.ownerDocument.importNode(_t,!0),rr.nodeType===_b.element&&rr.nodeName==="BODY"||rr.nodeName==="HTML"?kt=rr:kt.appendChild(rr);else{if(!Ne&&!et&&!rt&&_t.indexOf("<")===-1)return E&>?E.createHTML(_t):_t;if(kt=hr(_t),!kt)return Ne?null:gt?T:""}kt&&$e&&Xt(kt.firstChild);const nn=xn(ar?_t:kt);for(;Rr=nn.nextNode();)Cn(Rr),zi(Rr),Rr.content instanceof o&&_o(Rr.content);if(ar)return _t;if(Ne){if(Xe)for(Mr=z.call(kt.ownerDocument);kt.firstChild;)Mr.appendChild(kt.firstChild);else Mr=kt;return(V.shadowroot||V.shadowrootmode)&&(Mr=D.call(i,Mr,!0)),Mr}let Ri=rt?kt.outerHTML:kt.innerHTML;return rt&&G["!doctype"]&&kt.ownerDocument&&kt.ownerDocument.doctype&&kt.ownerDocument.doctype.name&&ul(LQ,kt.ownerDocument.doctype.name)&&(Ri="<!DOCTYPE "+kt.ownerDocument.doctype.name+`>
|
|
@@ -1119,8 +1119,8 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
1119
1119
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,o=Math.abs(i-n.x),a=e.width/2;let l=n.x<r.x?a-o:a+o;const d=e.height/2,u=Math.abs(r.y-n.y),f=Math.abs(r.x-n.x);if(Math.abs(s-r.y)*a>Math.abs(i-r.x)*d){let p=n.y<r.y?r.y-d-s:s-d-r.y;l=f*p/u;const g={x:n.x<r.x?n.x+l:n.x-f+l,y:n.y<r.y?n.y+u-p:n.y-u+p};return l===0&&(g.x=r.x,g.y=r.y),f===0&&(g.x=r.x),u===0&&(g.y=r.y),St.debug(`abc89 top/bottom calc, Q ${u}, q ${p}, R ${f}, r ${l}`,g),g}else{n.x<r.x?l=r.x-a-i:l=i-a-r.x;let p=u*l/f,g=n.x<r.x?n.x+f-l:n.x-f+l,v=n.y<r.y?n.y+p:n.y-p;return St.debug(`sides calc abc89, Q ${u}, q ${p}, R ${f}, r ${l}`,{_x:g,_y:v}),l===0&&(g=r.x,v=r.y),f===0&&(g=r.x),u===0&&(v=r.y),{x:g,y:v}}},"intersection"),oF=Y((e,r)=>{St.warn("abc88 cutPathAtIntersect",e,r);let n=[],i=e[0],s=!1;return e.forEach(o=>{if(St.info("abc88 checking point",o,r),!SHe(r,o)&&!s){const a=kHe(r,i,o);St.debug("abc88 inside",o,i,a),St.debug("abc88 intersection",a,r);let l=!1;n.forEach(d=>{l=l||d.x===a.x&&d.y===a.y}),n.some(d=>d.x===a.x&&d.y===a.y)?St.warn("abc88 no intersect",a,n):n.push(a),s=!0}else St.warn("abc88 outside",o,i),i=o,s||n.push(o)}),St.debug("returning points",n),n},"cutPathAtIntersect");function nse(e){const r=[],n=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],o=e[i],a=e[i+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(r.push(o),n.push(i))}return{cornerPoints:r,cornerPointPositions:n}}Y(nse,"extractCornerPoints");var aF=Y(function(e,r,n){const i=r.x-e.x,s=r.y-e.y,o=Math.sqrt(i*i+s*s),a=n/o;return{x:r.x-a*i,y:r.y-a*s}},"findAdjacentPoint"),CHe=Y(function(e){const{cornerPointPositions:r}=nse(e),n=[];for(let i=0;i<e.length;i++)if(r.includes(i)){const s=e[i-1],o=e[i+1],a=e[i],l=aF(s,a,5),d=aF(o,a,5),u=d.x-l.x,f=d.y-l.y;n.push(l);const p=Math.sqrt(2)*2;let g={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){St.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const v=5;a.x===l.x?g={x:u<0?l.x-v+p:l.x+v-p,y:f<0?l.y-p:l.y+p}:g={x:u<0?l.x-p:l.x+p,y:f<0?l.y-v+p:l.y+v-p}}else St.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));n.push(g,d)}else n.push(e[i]);return n},"fixCorners"),jHe=Y((e,r,n)=>{const i=e-r-n,s=2,o=2,a=s+o,l=Math.floor(i/a),d=Array(l).fill(`${s} ${o}`).join(" ");return`0 ${r} ${d} ${n}`},"generateDashArray"),NHe=Y(function(e,r,n,i,s,o,a,l=!1){var L;const{handDrawnSeed:d}=ci();let u=r.points,f=!1;const p=s;var g=o;const v=[];for(const I in r.cssCompiledStyles)nne(I)||v.push(r.cssCompiledStyles[I]);St.debug("UIO intersect check",r.points,g.x,p.x),g.intersect&&p.intersect&&!l&&(u=u.slice(1,r.points.length-1),u.unshift(p.intersect(u[0])),St.debug("Last point UIO",r.start,"-->",r.end,u[u.length-1],g,g.intersect(u[u.length-1])),u.push(g.intersect(u[u.length-1])));const b=btoa(JSON.stringify(u));r.toCluster&&(St.info("to cluster abc88",n.get(r.toCluster)),u=oF(r.points,n.get(r.toCluster).node),f=!0),r.fromCluster&&(St.debug("from cluster abc88",n.get(r.fromCluster),JSON.stringify(u,null,2)),u=oF(u.reverse(),n.get(r.fromCluster).node).reverse(),f=!0);let _=u.filter(I=>!Number.isNaN(I.y));const k=bHe(r.curve);k!=="rounded"&&(_=CHe(_));let S=z_;switch(k){case"linear":S=z_;break;case"basis":S=MA;break;case"cardinal":S=Dee;break;case"bumpX":S=Ree;break;case"bumpY":S=Mee;break;case"catmullRom":S=Bee;break;case"monotoneX":S=Vee;break;case"monotoneY":S=qee;break;case"natural":S=Kee;break;case"step":S=Yee;break;case"stepAfter":S=Zee;break;case"stepBefore":S=Xee;break;case"rounded":S=z_;break;default:S=MA}const{x:C,y:j}=SDe(r),E=QLe().x(C).y(j).curve(S);let T;switch(r.thickness){case"normal":T="edge-thickness-normal";break;case"thick":T="edge-thickness-thick";break;case"invisible":T="edge-thickness-invisible";break;default:T="edge-thickness-normal"}switch(r.pattern){case"solid":T+=" edge-pattern-solid";break;case"dotted":T+=" edge-pattern-dotted";break;case"dashed":T+=" edge-pattern-dashed";break;default:T+=" edge-pattern-solid"}let A,M=k==="rounded"?ise(sse(_,r),5):E(_);const z=Array.isArray(r.style)?r.style:[r.style];let $=z.find(I=>I==null?void 0:I.startsWith("stroke:")),D="";r.animate&&(D="edge-animation-fast"),r.animation&&(D="edge-animation-"+r.animation);let W=!1;if(r.look==="handDrawn"){const I=wr.svg(e);Object.assign([],_);const q=I.path(M,{roughness:.3,seed:d});T+=" transition",A=qr(q).select("path").attr("id",r.id).attr("class"," "+T+(r.classes?" "+r.classes:"")+(D?" "+D:"")).attr("style",z?z.reduce((F,G)=>F+";"+G,""):"");let X=A.attr("d");A.attr("d",X),e.node().appendChild(A.node())}else{const I=v.join(";"),q=z?z.reduce((ee,ie)=>ee+ie+";",""):"",X=(I?I+";"+q+";":q)+";"+(z?z.reduce((ee,ie)=>ee+";"+ie,""):"");A=e.append("path").attr("d",M).attr("id",r.id).attr("class"," "+T+(r.classes?" "+r.classes:"")+(D?" "+D:"")).attr("style",X),$=(L=X.match(/stroke:([^;]+)/))==null?void 0:L[1],W=r.animate===!0||!!r.animation||I.includes("animation");const F=A.node(),G=typeof F.getTotalLength=="function"?F.getTotalLength():0,Q=wz[r.arrowTypeStart]||0,V=wz[r.arrowTypeEnd]||0;if(r.look==="neo"&&!W){const ie=`stroke-dasharray: ${r.pattern==="dotted"||r.pattern==="dashed"?jHe(G,Q,V):`0 ${Q} ${G-Q-V} ${V}`}; stroke-dashoffset: 0;`;A.attr("style",ie+A.attr("style"))}}A.attr("data-edge",!0),A.attr("data-et","edge"),A.attr("data-id",r.id),A.attr("data-points",b),r.showPoints&&_.forEach(I=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",I.x).attr("cy",I.y)});let U="";(ci().flowchart.arrowMarkerAbsolute||ci().state.arrowMarkerAbsolute)&&(U=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,U=U.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),St.info("arrowTypeStart",r.arrowTypeStart),St.info("arrowTypeEnd",r.arrowTypeEnd),vHe(A,r,U,a,i,$);const H=Math.floor(u.length/2),R=u[H];jd.isLabelCoordinateInPath(R,A.attr("d"))||(f=!0);let B={};return f&&(B.updatedPath=u),B.originalPath=r.points,B},"insertEdge");function ise(e,r){if(e.length<2)return"";let n="";const i=e.length,s=1e-5;for(let o=0;o<i;o++){const a=e[o],l=e[o-1],d=e[o+1];if(o===0)n+=`M${a.x},${a.y}`;else if(o===i-1)n+=`L${a.x},${a.y}`;else{const u=a.x-l.x,f=a.y-l.y,p=d.x-a.x,g=d.y-a.y,v=Math.hypot(u,f),b=Math.hypot(p,g);if(v<s||b<s){n+=`L${a.x},${a.y}`;continue}const _=u/v,k=f/v,S=p/b,C=g/b,j=_*S+k*C,E=Math.max(-1,Math.min(1,j)),T=Math.acos(E);if(T<s||Math.abs(Math.PI-T)<s){n+=`L${a.x},${a.y}`;continue}const A=Math.min(r/Math.sin(T/2),v/2,b/2),M=a.x-_*A,z=a.y-k*A,$=a.x+S*A,D=a.y+C*A;n+=`L${M},${z}`,n+=`Q${a.x},${a.y} ${$},${D}`}}return n}Y(ise,"generateRoundedPath");function aO(e,r){if(!e||!r)return{angle:0,deltaX:0,deltaY:0};const n=r.x-e.x,i=r.y-e.y;return{angle:Math.atan2(i,n),deltaX:n,deltaY:i}}Y(aO,"calculateDeltaAndAngle");function sse(e,r){const n=e.map(s=>({...s}));if(e.length>=2&&La[r.arrowTypeStart]){const s=La[r.arrowTypeStart],o=e[0],a=e[1],{angle:l}=aO(o,a),d=s*Math.cos(l),u=s*Math.sin(l);n[0].x=o.x+d,n[0].y=o.y+u}const i=e.length;if(i>=2&&La[r.arrowTypeEnd]){const s=La[r.arrowTypeEnd],o=e[i-1],a=e[i-2],{angle:l}=aO(a,o),d=s*Math.cos(l),u=s*Math.sin(l);n[i-1].x=o.x-d,n[i-1].y=o.y-u}return n}Y(sse,"applyMarkerOffsetsToPoints");var THe=Y((e,r,n,i)=>{r.forEach(s=>{UHe[s](e,n,i)})},"insertMarkers"),EHe=Y((e,r,n)=>{St.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+r+"-extensionStart").attr("class","marker extension "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-extensionEnd").attr("class","marker extension "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),AHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-compositionStart").attr("class","marker composition "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-compositionEnd").attr("class","marker composition "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),OHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-aggregationStart").attr("class","marker aggregation "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-aggregationEnd").attr("class","marker aggregation "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),RHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-dependencyStart").attr("class","marker dependency "+r).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-dependencyEnd").attr("class","marker dependency "+r).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),MHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-lollipopStart").attr("class","marker lollipop "+r).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+r+"-lollipopEnd").attr("class","marker lollipop "+r).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),PHe=Y((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-pointEnd").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-pointStart").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),LHe=Y((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-circleEnd").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-circleStart").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),$He=Y((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-crossEnd").attr("class","marker cross "+r).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-crossStart").attr("class","marker cross "+r).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),DHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),IHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-onlyOneStart").attr("class","marker onlyOne "+r).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",n+"_"+r+"-onlyOneEnd").attr("class","marker onlyOne "+r).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),BHe=Y((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrOneStart").attr("class","marker zeroOrOne "+r).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+r).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),zHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-oneOrMoreStart").attr("class","marker oneOrMore "+r).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",n+"_"+r+"-oneOrMoreEnd").attr("class","marker oneOrMore "+r).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),FHe=Y((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+r).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+r).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),HHe=Y((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
1120
1120
|
L20,10
|
|
1121
1121
|
M20,10
|
|
1122
|
-
L0,20`)},"requirement_arrow"),WHe=Y((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),UHe={extension:EHe,composition:AHe,aggregation:OHe,dependency:RHe,lollipop:MHe,point:PHe,circle:LHe,cross:$He,barb:DHe,only_one:IHe,zero_or_one:BHe,one_or_more:zHe,zero_or_more:FHe,requirement_arrow:HHe,requirement_contains:WHe},VHe=THe,qHe={common:AS,getConfig:Fa,insertCluster:JFe,insertEdge:NHe,insertEdgeLabel:_He,insertMarkers:VHe,insertNode:rse,interpolateToCurve:S9,labelHelper:Qr,log:St,positionEdgeLabel:wHe},G2={},ose=Y(e=>{for(const r of e)G2[r.name]=r},"registerLayoutLoaders"),GHe=Y(()=>{ose([{name:"dagre",loader:Y(async()=>await Ye(()=>import("./dagre-KLK3FWXG-
|
|
1123
|
-
`);const i=m$e(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),JQ(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),kse={draw:bUe},_Ue=kse,wUe={db:{},renderer:kse,parser:{parse:Y(()=>{},"parse")}},SUe=wUe,Cse="flowchart-elk",kUe=Y((e,r={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(r.layout="elk",!0):!1},"detector"),CUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-
|
|
1122
|
+
L0,20`)},"requirement_arrow"),WHe=Y((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),UHe={extension:EHe,composition:AHe,aggregation:OHe,dependency:RHe,lollipop:MHe,point:PHe,circle:LHe,cross:$He,barb:DHe,only_one:IHe,zero_or_one:BHe,one_or_more:zHe,zero_or_more:FHe,requirement_arrow:HHe,requirement_contains:WHe},VHe=THe,qHe={common:AS,getConfig:Fa,insertCluster:JFe,insertEdge:NHe,insertEdgeLabel:_He,insertMarkers:VHe,insertNode:rse,interpolateToCurve:S9,labelHelper:Qr,log:St,positionEdgeLabel:wHe},G2={},ose=Y(e=>{for(const r of e)G2[r.name]=r},"registerLayoutLoaders"),GHe=Y(()=>{ose([{name:"dagre",loader:Y(async()=>await Ye(()=>import("./dagre-KLK3FWXG-BGfWBJVo.js"),__vite__mapDeps([47,48,49,50,51,52]),import.meta.url),"loader")},{name:"cose-bilkent",loader:Y(async()=>await Ye(()=>import("./cose-bilkent-S5V4N54A-BWtWPOzl.js"),__vite__mapDeps([53,54]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");GHe();var Vyt=Y(async(e,r)=>{if(!(e.layoutAlgorithm in G2))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=G2[e.layoutAlgorithm];return(await n.loader()).render(e,r,qHe,{algorithm:n.algorithm})},"render"),qyt=Y((e="",{fallback:r="dagre"}={})=>{if(e in G2)return e;if(r in G2)return St.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Both layout algorithms ${e} and ${r} are not registered.`)},"getRegisteredLayoutAlgorithm"),KHe=$re(Object.keys,Object),YHe=Object.prototype,XHe=YHe.hasOwnProperty;function ZHe(e){if(!Kj(e))return KHe(e);var r=[];for(var n in Object(e))XHe.call(e,n)&&n!="constructor"&&r.push(n);return r}var lO=sy(Gd,"DataView"),cO=sy(Gd,"Promise"),uO=sy(Gd,"Set"),dO=sy(Gd,"WeakMap"),lF="[object Map]",JHe="[object Object]",cF="[object Promise]",uF="[object Set]",dF="[object WeakMap]",hF="[object DataView]",QHe=iy(lO),eWe=iy(V2),tWe=iy(cO),rWe=iy(uO),nWe=iy(dO),o0=ny;(lO&&o0(new lO(new ArrayBuffer(1)))!=hF||V2&&o0(new V2)!=lF||cO&&o0(cO.resolve())!=cF||uO&&o0(new uO)!=uF||dO&&o0(new dO)!=dF)&&(o0=function(e){var r=ny(e),n=r==JHe?e.constructor:void 0,i=n?iy(n):"";if(i)switch(i){case QHe:return hF;case eWe:return lF;case tWe:return cF;case rWe:return uF;case nWe:return dF}return r});var iWe="[object Map]",sWe="[object Set]",oWe=Object.prototype,aWe=oWe.hasOwnProperty;function fF(e){if(e==null)return!0;if(Yj(e)&&(Y5(e)||typeof e=="string"||typeof e.splice=="function"||_9(e)||w9(e)||K5(e)))return!e.length;var r=o0(e);if(r==iWe||r==sWe)return!e.size;if(Kj(e))return!ZHe(e).length;for(var n in e)if(aWe.call(e,n))return!1;return!0}var ase="c4",lWe=Y(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),cWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./c4Diagram-IC4MRINW-DUa0YpGC.js");return{diagram:r}},__vite__mapDeps([55,56]),import.meta.url);return{id:ase,diagram:e}},"loader"),uWe={id:ase,detector:lWe,loader:cWe},dWe=uWe,lse="flowchart",hWe=Y((e,r)=>{var n,i;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),fWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-DrTFnv1o.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:lse,diagram:e}},"loader"),pWe={id:lse,detector:hWe,loader:fWe},mWe=pWe,cse="flowchart-v2",gWe=Y((e,r)=>{var n,i,s;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"?!1:(((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(r.layout="elk"),/^\s*graph/.test(e)&&((s=r==null?void 0:r.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),yWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-DrTFnv1o.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:cse,diagram:e}},"loader"),vWe={id:cse,detector:gWe,loader:yWe},xWe=vWe,use="er",bWe=Y(e=>/^\s*erDiagram/.test(e),"detector"),_We=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./erDiagram-INFDFZHY-Plok75TS.js");return{diagram:r}},__vite__mapDeps([62,59,60,61]),import.meta.url);return{id:use,diagram:e}},"loader"),wWe={id:use,detector:bWe,loader:_We},SWe=wWe,dse="gitGraph",kWe=Y(e=>/^\s*gitGraph/.test(e),"detector"),CWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./gitGraphDiagram-K3NZZRJ6-4bqi_Grw.js");return{diagram:r}},__vite__mapDeps([63,64,65,66,49,51,52]),import.meta.url);return{id:dse,diagram:e}},"loader"),jWe={id:dse,detector:kWe,loader:CWe},NWe=jWe,hse="gantt",TWe=Y(e=>/^\s*gantt/.test(e),"detector"),EWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./ganttDiagram-A5KZAMGK-lbd5t50L.js");return{diagram:r}},__vite__mapDeps([67,68,69]),import.meta.url);return{id:hse,diagram:e}},"loader"),AWe={id:hse,detector:TWe,loader:EWe},OWe=AWe,fse="info",RWe=Y(e=>/^\s*info/.test(e),"detector"),MWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./infoDiagram-LFFYTUFH-mOUWUKTg.js");return{diagram:r}},__vite__mapDeps([70,66,49,51,52]),import.meta.url);return{id:fse,diagram:e}},"loader"),PWe={id:fse,detector:RWe,loader:MWe},pse="pie",LWe=Y(e=>/^\s*pie/.test(e),"detector"),$We=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./pieDiagram-SKSYHLDU-B2rKp15l.js");return{diagram:r}},__vite__mapDeps([71,64,66,49,51,52,72]),import.meta.url);return{id:pse,diagram:e}},"loader"),DWe={id:pse,detector:LWe,loader:$We},mse="quadrantChart",IWe=Y(e=>/^\s*quadrantChart/.test(e),"detector"),BWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./quadrantDiagram-337W2JSQ-B3DzAIDT.js");return{diagram:r}},__vite__mapDeps([73,68,69]),import.meta.url);return{id:mse,diagram:e}},"loader"),zWe={id:mse,detector:IWe,loader:BWe},FWe=zWe,gse="xychart",HWe=Y(e=>/^\s*xychart(-beta)?/.test(e),"detector"),WWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./xychartDiagram-JWTSCODW-BbHdBYjX.js");return{diagram:r}},__vite__mapDeps([74,68,69]),import.meta.url);return{id:gse,diagram:e}},"loader"),UWe={id:gse,detector:HWe,loader:WWe},VWe=UWe,yse="requirement",qWe=Y(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),GWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./requirementDiagram-Z7DCOOCP-C4aT5lvg.js");return{diagram:r}},__vite__mapDeps([75,59,60]),import.meta.url);return{id:yse,diagram:e}},"loader"),KWe={id:yse,detector:qWe,loader:GWe},YWe=KWe,vse="sequence",XWe=Y(e=>/^\s*sequenceDiagram/.test(e),"detector"),ZWe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./sequenceDiagram-2WXFIKYE-C85lQ8Bt.js");return{diagram:r}},__vite__mapDeps([76,56,65]),import.meta.url);return{id:vse,diagram:e}},"loader"),JWe={id:vse,detector:XWe,loader:ZWe},QWe=JWe,xse="class",eUe=Y((e,r)=>{var n;return((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),tUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./classDiagram-VBA2DB6C-DGa9Vmq1.js");return{diagram:r}},__vite__mapDeps([77,78,58,56,59,60]),import.meta.url);return{id:xse,diagram:e}},"loader"),rUe={id:xse,detector:eUe,loader:tUe},nUe=rUe,bse="classDiagram",iUe=Y((e,r)=>{var n;return/^\s*classDiagram/.test(e)&&((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),sUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./classDiagram-v2-RAHNMMFH-DGa9Vmq1.js");return{diagram:r}},__vite__mapDeps([79,78,58,56,59,60]),import.meta.url);return{id:bse,diagram:e}},"loader"),oUe={id:bse,detector:iUe,loader:sUe},aUe=oUe,_se="state",lUe=Y((e,r)=>{var n;return((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),cUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./stateDiagram-RAJIS63D-C6gFkSrw.js");return{diagram:r}},__vite__mapDeps([80,81,59,60,48,49,50,51]),import.meta.url);return{id:_se,diagram:e}},"loader"),uUe={id:_se,detector:lUe,loader:cUe},dUe=uUe,wse="stateDiagram",hUe=Y((e,r)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},"detector"),fUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./stateDiagram-v2-FVOUBMTO-BsX0KLYS.js");return{diagram:r}},__vite__mapDeps([82,81,59,60]),import.meta.url);return{id:wse,diagram:e}},"loader"),pUe={id:wse,detector:hUe,loader:fUe},mUe=pUe,Sse="journey",gUe=Y(e=>/^\s*journey/.test(e),"detector"),yUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./journeyDiagram-4ABVD52K-znHcSODe.js");return{diagram:r}},__vite__mapDeps([83,58,56,72]),import.meta.url);return{id:Sse,diagram:e}},"loader"),vUe={id:Sse,detector:gUe,loader:yUe},xUe=vUe,bUe=Y((e,r,n)=>{St.debug(`rendering svg for syntax error
|
|
1123
|
+
`);const i=m$e(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),JQ(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),kse={draw:bUe},_Ue=kse,wUe={db:{},renderer:kse,parser:{parse:Y(()=>{},"parse")}},SUe=wUe,Cse="flowchart-elk",kUe=Y((e,r={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(r.layout="elk",!0):!1},"detector"),CUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-DrTFnv1o.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Cse,diagram:e}},"loader"),jUe={id:Cse,detector:kUe,loader:CUe},NUe=jUe,jse="timeline",TUe=Y(e=>/^\s*timeline/.test(e),"detector"),EUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./timeline-definition-YZTLITO2-B6sQ4e6y.js");return{diagram:r}},__vite__mapDeps([84,72]),import.meta.url);return{id:jse,diagram:e}},"loader"),AUe={id:jse,detector:TUe,loader:EUe},OUe=AUe,Nse="mindmap",RUe=Y(e=>/^\s*mindmap/.test(e),"detector"),MUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./mindmap-definition-YRQLILUH-D3XCkmFm.js");return{diagram:r}},__vite__mapDeps([85,59,60]),import.meta.url);return{id:Nse,diagram:e}},"loader"),PUe={id:Nse,detector:RUe,loader:MUe},LUe=PUe,Tse="kanban",$Ue=Y(e=>/^\s*kanban/.test(e),"detector"),DUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./kanban-definition-K7BYSVSG-B9ekOJxL.js");return{diagram:r}},__vite__mapDeps([86,58]),import.meta.url);return{id:Tse,diagram:e}},"loader"),IUe={id:Tse,detector:$Ue,loader:DUe},BUe=IUe,Ese="sankey",zUe=Y(e=>/^\s*sankey(-beta)?/.test(e),"detector"),FUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./sankeyDiagram-WA2Y5GQK-CwdIKXWh.js");return{diagram:r}},[],import.meta.url);return{id:Ese,diagram:e}},"loader"),HUe={id:Ese,detector:zUe,loader:FUe},WUe=HUe,Ase="packet",UUe=Y(e=>/^\s*packet(-beta)?/.test(e),"detector"),VUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./diagram-P4PSJMXO-BuZo-ISM.js");return{diagram:r}},__vite__mapDeps([87,64,66,49,51,52]),import.meta.url);return{id:Ase,diagram:e}},"loader"),qUe={id:Ase,detector:UUe,loader:VUe},Ose="radar",GUe=Y(e=>/^\s*radar-beta/.test(e),"detector"),KUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./diagram-IFDJBPK2-BRRl8D9K.js");return{diagram:r}},__vite__mapDeps([88,64,66,49,51,52]),import.meta.url);return{id:Ose,diagram:e}},"loader"),YUe={id:Ose,detector:GUe,loader:KUe},Rse="block",XUe=Y(e=>/^\s*block(-beta)?/.test(e),"detector"),ZUe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./blockDiagram-WCTKOSBZ-Cx_zzsRg.js");return{diagram:r}},__vite__mapDeps([89,58,52,49,48,61]),import.meta.url);return{id:Rse,diagram:e}},"loader"),JUe={id:Rse,detector:XUe,loader:ZUe},QUe=JUe,Mse="architecture",eVe=Y(e=>/^\s*architecture/.test(e),"detector"),tVe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./architectureDiagram-2XIMDMQ5-Bp6z5ps0.js");return{diagram:r}},__vite__mapDeps([90,64,66,49,51,52,54]),import.meta.url);return{id:Mse,diagram:e}},"loader"),rVe={id:Mse,detector:eVe,loader:tVe},nVe=rVe,Pse="ishikawa",iVe=Y(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),sVe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./ishikawaDiagram-PHBUUO56-C-ISusUx.js");return{diagram:r}},[],import.meta.url);return{id:Pse,diagram:e}},"loader"),oVe={id:Pse,detector:iVe,loader:sVe},Lse="venn",aVe=Y(e=>/^\s*venn-beta/.test(e),"detector"),lVe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./vennDiagram-LZ73GAT5-BkJxDniY.js");return{diagram:r}},[],import.meta.url);return{id:Lse,diagram:e}},"loader"),cVe={id:Lse,detector:aVe,loader:lVe},uVe=cVe,$se="treemap",dVe=Y(e=>/^\s*treemap/.test(e),"detector"),hVe=Y(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:r}=await import("./diagram-E7M64L7V-Cke9c3vx.js");return{diagram:r}},__vite__mapDeps([91,60,64,66,49,51,52,69]),import.meta.url);return{id:$se,diagram:e}},"loader"),fVe={id:$se,detector:dVe,loader:hVe},pF=!1,n6=Y(()=>{pF||(pF=!0,A5("error",SUe,e=>e.toLowerCase().trim()==="error"),A5("---",{db:{clear:Y(()=>{},"clear")},styles:{},renderer:{draw:Y(()=>{},"draw")},parser:{parse:Y(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:Y(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),vA(NUe,LUe,nVe),vA(dWe,BUe,aUe,nUe,SWe,OWe,PWe,DWe,YWe,QWe,xWe,mWe,OUe,NWe,mUe,dUe,xUe,FWe,WUe,qUe,VWe,QUe,YUe,oVe,fVe,uVe))},"addDiagrams"),pVe=Y(async()=>{St.debug("Loading registered diagrams");const r=(await Promise.allSettled(Object.entries(M0).map(async([n,{detector:i,loader:s}])=>{if(s)try{wA(n)}catch{try{const{diagram:o,id:a}=await s();A5(a,o,i)}catch(o){throw St.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete M0[n],o}}}))).filter(n=>n.status==="rejected");if(r.length>0){St.error(`Failed to load ${r.length} external diagrams`);for(const n of r)St.error(n);throw new Error(`Failed to load ${r.length} external diagrams`)}},"loadRegisteredDiagrams"),mVe="graphics-document document";function Dse(e,r){e.attr("role",mVe),r!==""&&e.attr("aria-roledescription",r)}Y(Dse,"setA11yDiagramInfo");function Ise(e,r,n,i){if(e.insert!==void 0){if(n){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(n)}if(r){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(r)}}}Y(Ise,"addSVGa11yTitleDescription");var N0,hO=(N0=class{constructor(r,n,i,s,o){this.type=r,this.text=n,this.db=i,this.parser=s,this.renderer=o}static async fromText(r,n={}){var u,f;const i=Fa(),s=UM(r,i);r=vze(r)+`
|
|
1124
1124
|
`;try{wA(s)}catch{const p=oRe(s);if(!p)throw new IQ(`Diagram ${s} not found.`);const{id:g,diagram:v}=await p();A5(g,v)}const{db:o,parser:a,renderer:l,init:d}=wA(s);return a.parser&&(a.parser.yy=o),(u=o.clear)==null||u.call(o),d==null||d(i),n.title&&((f=o.setDiagramTitle)==null||f.call(o,n.title)),await a.parse(r),new N0(s,r,o,a,l)}async render(r,n){await this.renderer.draw(this.text,r,n,this)}getParser(){return this.parser}getType(){return this.type}},Y(N0,"Diagram"),N0),mF=[],gVe=Y(()=>{mF.forEach(e=>{e()}),mF=[]},"attachFunctions"),yVe=Y(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Bse(e){const r=e.match(DQ);if(!r)return{text:e,metadata:{}};let n=wDe(r[1],{schema:_De})??{};n=typeof n=="object"&&!Array.isArray(n)?n:{};const i={};return n.displayMode&&(i.displayMode=n.displayMode.toString()),n.title&&(i.title=n.title.toString()),n.config&&(i.config=n.config),{text:e.slice(r[0].length),metadata:i}}Y(Bse,"extractFrontMatter");var vVe=Y(e=>e.replace(/\r\n?/g,`
|
|
1125
1125
|
`).replace(/<(\w+)([^>]*)>/g,(r,n,i)=>"<"+n+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),xVe=Y(e=>{const{text:r,metadata:n}=Bse(e),{displayMode:i,title:s,config:o={}}=n;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:s,config:o,text:r}},"processFrontmatter"),bVe=Y(e=>{const r=jd.detectInit(e)??{},n=jd.detectDirective(e,"wrap");return Array.isArray(n)?r.wrap=n.some(({type:i})=>i==="wrap"):(n==null?void 0:n.type)==="wrap"&&(r.wrap=!0),{text:sze(e),directive:r}},"processDirectives");function U9(e){const r=vVe(e),n=xVe(r),i=bVe(n.text),s=T9(n.config,i.directive);return e=yVe(i.text),{code:e,title:n.title,config:s}}Y(U9,"preprocessDiagram");function zse(e){const r=new TextEncoder().encode(e),n=Array.from(r,i=>String.fromCodePoint(i)).join("");return btoa(n)}Y(zse,"toBase64");var _Ve=5e4,wVe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",SVe="sandbox",kVe="loose",CVe="http://www.w3.org/2000/svg",jVe="http://www.w3.org/1999/xlink",NVe="http://www.w3.org/1999/xhtml",TVe="100%",EVe="100%",AVe="border:0;margin:0;",OVe="margin:0",RVe="allow-top-navigation-by-user-activation allow-popups",MVe='The "iframe" tag is not supported by your browser.',PVe=["foreignobject"],LVe=["dominant-baseline"];function V9(e){const r=U9(e);return T5(),wRe(r.config??{}),r}Y(V9,"processAndSetConfigs");async function Fse(e,r){n6();try{const{code:n,config:i}=V9(e);return{diagramType:(await Wse(n)).type,config:i}}catch(n){if(r!=null&&r.suppressErrors)return!1;throw n}}Y(Fse,"parse");var gF=Y((e,r,n=[])=>`
|
|
1126
1126
|
.${e} ${r} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),$Ve=Y((e,r=new Map)=>{let n="";if(e.themeCSS!==void 0&&(n+=`
|
|
@@ -1156,7 +1156,7 @@ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
|
|
|
1156
1156
|
`).trim():"",d=s>=0?r.slice(s+1).map(p=>p.trim()).filter(Boolean):[];return c.jsxs("div",{className:"space-y-2 rounded-md border bg-muted/20 p-3 text-xs",children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-semibold text-foreground/90",children:"Browser snapshot"}),i?c.jsx("div",{className:"text-muted-foreground",children:i}):null,n?c.jsx("div",{className:"font-mono text-xs break-all",children:n}):null]}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-xs uppercase tracking-wide text-muted-foreground",children:"Text"}),c.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded bg-background p-2 font-mono text-xs leading-5",children:l||"(no textual content)"})]}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-xs uppercase tracking-wide text-muted-foreground",children:"Interactive elements"}),d.length?c.jsx("ul",{className:"max-h-40 space-y-1 overflow-auto rounded bg-background p-2 font-mono text-xs",children:d.map((p,g)=>c.jsx("li",{className:"break-all",children:p},`${p}-${g}`))}):c.jsx("div",{className:"rounded bg-background p-2 text-muted-foreground",children:"No interactive elements found."})]})]})}function uGe({path:e}){const[r,n]=y.useState(!1),[i,s]=y.useState(!1),o=e.trim(),a=roe(o)??`${Un()}/api/browser/screenshot?path=${encodeURIComponent(o)}`;return c.jsxs("div",{className:"space-y-2 rounded-md bg-muted/30 p-3 text-xs",children:[c.jsxs("div",{className:"text-xs text-muted-foreground",children:["Screenshot path: ",c.jsx("span",{className:"font-mono break-all",children:o})]}),c.jsxs("div",{className:"group relative overflow-hidden rounded-md bg-background/90 ring-1 ring-inset ring-border/35",children:[c.jsx("img",{src:a,alt:"Browser screenshot",className:"max-h-80 w-full cursor-pointer object-contain transition-opacity group-hover:opacity-80",onLoad:()=>n(!0),onError:()=>n(!1),onClick:()=>r&&s(!0)}),r&&c.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:c.jsx("span",{className:"rounded-full bg-black/60 px-3 py-1.5 text-xs font-medium text-white",children:"Click to expand"})})]}),!r&&c.jsx("div",{className:"rounded bg-background p-2 text-muted-foreground",children:"Preview unavailable in browser. Open the screenshot path directly from the host environment."}),i&&c.jsx(Fc,{open:!0,onOpenChange:l=>!l&&s(!1),children:c.jsx(Ql,{className:"max-w-[90vw] max-h-[90vh] p-2",showCloseButton:!0,children:c.jsx("img",{src:a,alt:"Browser screenshot",className:"max-h-[85vh] w-full object-contain"})})})]})}function L3(e){var i;const r=typeof e.args.terminalId=="string"?e.args.terminalId:null;if(r)return r;const n=(i=e.result)==null?void 0:i.data;if(n&&typeof n=="object"){const s=n,o=typeof s.terminalId=="string"?s.terminalId:null;if(o)return o;const a=typeof s.id=="string"?s.id:null;if(a)return a;const l=typeof s.surfaceId=="string"?s.surfaceId:null;if(l)return l}return null}function dGe(e){var n;const r=Ga(e.tool);if(r==="surfaces.start"){if(e.args.type==="terminal")return L3(e)!==null;const i=(n=e.result)==null?void 0:n.data;return i&&typeof i=="object"&&i.type==="terminal"?L3(e)!==null:!1}return r==="execute"||r.startsWith("terminal.")?L3(e)!==null:!1}function doe(e){if(!e)return null;const r=e.match(/"command"\s*:\s*"((?:[^"\\]|\\.)*)/);return r?r[1].replace(/\\n/g,`
|
|
1157
1157
|
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\"):null}function ku(e,r){if(!e)return null;const n=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`"${n}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`),s=e.match(i);return s?s[1].replace(/\\n/g,`
|
|
1158
1158
|
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\"):null}function hoe(e){if(!e)return null;const r=ku(e,"url")??ku(e,"uri")??ku(e,"href")??ku(e,"query")??ku(e,"q");if(r)return Jf(r)??r;const n=ku(e,"type"),i=ku(e,"action");return n==="webSearch"||i==="webSearch"?"web search":n==="fetch"||i==="fetch"?"website":null}function hGe({tool:e,streamingArgs:r}){const n=Ga(e),i=aoe[n],s=n.startsWith("terminal."),o=s?doe(r):null,a=n==="web"||n==="web.search"||n==="web.fetch"||n==="browser.search"||n==="browser.fetch",l=a?hoe(r):null;return i&&s&&o?c.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1.5 text-foreground",children:[c.jsx("span",{className:"shrink-0 text-xs text-emerald-500 dark:text-emerald-400 font-mono",children:"$"}),c.jsx("code",{className:"min-w-0 truncate text-xs font-mono",children:o}),c.jsx("span",{className:"inline-block w-1 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):i&&a&&l?c.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1.5 text-foreground",children:[c.jsxs("span",{children:[i.label,":"]}),c.jsx("code",{className:"min-w-0 truncate text-xs font-mono",children:l}),c.jsx("span",{className:"inline-block w-1 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):i?c.jsxs("span",{className:"text-blue-400",children:[i.label,c.jsx("span",{className:"inline-block w-1 h-3 bg-blue-400 animate-pulse ml-1 align-text-bottom"})]}):e?c.jsxs("span",{className:"text-blue-400",children:[c.jsx("code",{className:"text-xs font-mono",children:e}),c.jsx("span",{className:"inline-block w-1 h-3 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):c.jsx("span",{className:"text-muted-foreground",children:"Preparing..."})}function fGe({tool:e,streamingArgs:r,scrollRef:n}){const i=Ga(e),s=i.startsWith("terminal."),o=s?doe(r):null,a=i==="web"||i==="web.search"||i==="web.fetch"||i==="browser.search"||i==="browser.fetch",l=a?hoe(r):null;if(s&&o)return c.jsxs("pre",{ref:n,className:Le("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-foreground"),children:[c.jsx("span",{className:"text-emerald-400",children:"$ "}),o,c.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]});if(a&&l){const d=i==="web.search"||i==="browser.search"?"Searching":"Fetching";return c.jsx("div",{className:Le("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(er,{className:"h-3 w-3 animate-spin text-blue-400"}),c.jsxs("span",{children:[d," ",l,"..."]})]})})}if(i==="memory.save"){const d=ku(r,"scope")??"memory",u=ku(r,"content");return c.jsxs("div",{className:Le("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(er,{className:"h-3 w-3 animate-spin text-blue-400"}),c.jsxs("span",{children:["Saving memory (",d,")..."]})]}),u?c.jsxs("div",{className:"mt-1 opacity-80",children:['"',Nd(u,120),'"']}):null]})}if(i==="cron.add"){const d=ku(r,"name"),u=ku(r,"cron"),f=ku(r,"toolName");return c.jsxs("div",{className:Le("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(er,{className:"h-3 w-3 animate-spin text-blue-400"}),c.jsxs("span",{children:["Creating cron job",d?`: ${d}`:"..."]})]}),(u||f)&&c.jsxs("div",{className:"mt-1 opacity-80",children:[u?`schedule ${u}`:"",u&&f?" • ":"",f?`tool ${f}`:""]})]})}return r?c.jsxs("pre",{ref:n,className:Le("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-36 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-muted-foreground"),children:[r,c.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):c.jsx("div",{className:Le("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(er,{className:"h-3 w-3 animate-spin text-blue-400"}),c.jsx("span",{children:"Preparing..."})]})})}function foe(e){const r=new Map,n=new Set,i=new Map(e.map(s=>[s.callId,s]));for(const s of e){if(!s.parentCallId||!i.has(s.parentCallId))continue;const o=r.get(s.parentCallId)??[];r.set(s.parentCallId,[...o,s]),n.add(s.callId)}for(let s=0;s<e.length;s++){const o=e[s];if(Ga(o.tool)!=="agent")continue;const a=[];for(let l=s+1;l<e.length;l++){const d=e[l];if(n.has(d.callId))continue;const u=o.status==="running"||o.status==="pending",f=o.completedAt!=null&&d.startedAt<=o.completedAt;if(u||f)a.push(d),n.add(d.callId);else break}if(a.length>0){const l=r.get(o.callId)??[];r.set(o.callId,[...l,...a])}}return{childMap:r,parentSet:n}}function poe(e){return e==="browserScreenshot"}function moe(e){var o,a;const r=Ga(e.tool),n=(o=e.result)!=null&&o.data&&typeof e.result.data=="object"?e.result.data:void 0,i=$c(r,e.args,n),s=soe(r,i,n,(a=e.result)==null?void 0:a.message);return poe(ooe({tool:r,args:i,status:e.status,displayOutput:uoe(e.result,r)||e.streamingOutput||"",snapshotText:typeof(n==null?void 0:n.snapshot)=="string"?n.snapshot:null,screenshotPath:s}))}function pGe({path:e,onOpenDiff:r,disabled:n}){const i=G9(e),s=!!r&&!n,o=c.jsxs(c.Fragment,{children:[c.jsx(Ro,{filename:i,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"max-w-[220px] truncate",children:i})]});return s?c.jsx("span",{role:"button",tabIndex:0,className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground transition-colors hover:bg-muted cursor-pointer",title:`Open diff for ${e}`,onClick:a=>{a.preventDefault(),a.stopPropagation(),r(e)},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),a.stopPropagation(),r(e))},children:o}):c.jsx("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground",title:e,children:o})}function mGe({call:e,childCalls:r,onOpenTerminal:n,onOpenDiff:i,inlineSecretPrompt:s,renderInlineSecretPrompt:o,hideTopConnector:a=!1,hideBottomConnector:l=!1}){var ae,rt,Je,$e,Ne,Xe,gt,zt,Mt;const d=moe(e),[u,f]=y.useState(e.status==="running"||e.status==="pending"||d),[p,g]=y.useState(()=>Date.now()),v=y.useRef(e.status),b=Ga(e.tool),_=(ae=e.result)!=null&&ae.data&&typeof e.result.data=="object"?e.result.data:void 0,k=$c(b,e.args,_),S=b==="mcp-tool"?s6(k,_):null,C=S?qqe(S.title):null,j=loe(b),E=(C==null?void 0:C.icon)??j.icon,T=(C==null?void 0:C.color)??j.color,A=Jqe(b,k,_,(rt=e.result)==null?void 0:rt.message),M=SO(b,k),$=uoe(e.result,b)||e.streamingOutput||"",D=typeof(_==null?void 0:_.snapshot)=="string"?_.snapshot:null,W=soe(b,k,_,(Je=e.result)==null?void 0:Je.message),U=b.startsWith("terminal.")||b==="execute",H=aGe(e),R=dGe(e),B=R?L3(e):null,L=sGe(b,k),I=s??(o==null?void 0:o(e))??null,q=I!=null,X=e.status==="pending",F=((Ne=wO(b,k,_,($e=e.result)==null?void 0:$e.message))==null?void 0:Ne.trim())??"",G=!!F&&Yqe(b),Q=zF($),V=zF(e.streamingArgs),ee=ooe({tool:b,args:k,status:e.status,displayOutput:$,snapshotText:D,screenshotPath:W}),ie=poe(ee),le=ee==="terminal"?!0:ee!=="none"&&!ie,he=e.status==="pending"||e.status==="running"?er:e.status==="success"?_l:Uh,re=e.status==="pending"?"text-blue-400":e.status==="running"?"text-muted-foreground":e.status==="success"?"text-green-500":"text-red-500";y.useEffect(()=>{const Wt=v.current;!ie&&(Wt==="running"||Wt==="pending")&&e.status!=="running"&&e.status!=="pending"&&f(!1),(e.status==="pending"||e.status==="running"||ie)&&f(!0),v.current=e.status},[e.status,ie]),y.useEffect(()=>{var Wt;b!=="web"&&b!=="web.search"&&b!=="web.fetch"&&b!=="browser.search"&&b!=="browser.fetch"||console.debug("[tool-call-card:web]",{tool:e.tool,normalizedTool:b,callId:e.callId,status:e.status,rawArgs:e.args,normalizedArgs:k,resultMessage:(Wt=e.result)==null?void 0:Wt.message,resultData:_,streamingArgs:e.streamingArgs})},[e.args,e.callId,(Xe=e.result)==null?void 0:Xe.message,e.status,e.streamingArgs,e.tool,k,b,_]),y.useEffect(()=>{if(e.status!=="running"&&e.status!=="pending")return;const Wt=window.setInterval(()=>g(Date.now()),250);return()=>window.clearInterval(Wt)},[e.status]);const ne=Vqe(b,k,_,(gt=e.result)==null?void 0:gt.message),we=e.status==="running"||e.status==="pending"?ne.running:ne.done,pe=c.jsxs(c.Fragment,{children:[c.jsx(he,{className:Le("h-4 w-4 shrink-0",re,(e.status==="running"||e.status==="pending")&&"animate-spin")}),c.jsx("span",{className:"flex-1 truncate text-[13px] font-medium text-muted-foreground",children:X?c.jsx(hGe,{tool:e.tool,streamingArgs:e.streamingArgs}):U?c.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1.5 text-foreground",children:[c.jsx("span",{className:"shrink-0 text-xs text-emerald-500 dark:text-emerald-400 font-mono",children:"$"}),c.jsx("code",{className:"min-w-0 truncate text-xs font-mono",title:A,children:A})]}):G?c.jsxs("span",{className:"inline-flex min-w-0 max-w-full items-center gap-2",children:[c.jsxs("span",{children:[we,":"]}),c.jsx(pGe,{path:F,onOpenDiff:i,disabled:e.status!=="success"})]}):S&&(S.title||S.details)?c.jsxs("span",{className:"inline-flex min-w-0 max-w-full items-center gap-2",children:[c.jsxs("span",{children:[we,":"]}),c.jsxs("span",{className:"min-w-0 truncate",children:[S.title?c.jsx("code",{className:"text-[11px] font-mono",children:S.title}):null,S.title&&S.details?c.jsx("span",{className:"text-muted-foreground",children:" • "}):null,S.details?c.jsx("span",{className:"text-xs text-muted-foreground",children:S.details}):null]})]}):c.jsxs("span",{children:[we,": ",c.jsx("code",{className:"text-[11px] font-mono",children:A})]})}),c.jsx("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:c.jsx(CO,{startedAt:e.startedAt,completedAt:e.completedAt,now:p})}),M&&c.jsx("span",{className:"rounded border border-blue-500/25 bg-blue-500/10 px-1.5 py-0.5 text-2xs font-semibold tabular-nums text-blue-500 shrink-0",children:M}),H&&c.jsx("span",{className:Le("rounded border px-1.5 py-0.5 text-2xs font-semibold uppercase tracking-wide shrink-0",H.className),children:H.label})]}),et=ee==="pending"?c.jsx(fGe,{tool:e.tool,streamingArgs:e.streamingArgs,scrollRef:V}):ee==="terminal"?c.jsxs("pre",{ref:Q,className:Le("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-foreground",e.result&&!e.result.ok&&"text-red-500 dark:text-red-400"),children:[!$&&e.status!=="running"&&c.jsxs("span",{className:"text-muted-foreground",children:[c.jsx("span",{className:"text-emerald-500 dark:text-emerald-400",children:"$ "}),A]}),$,e.status==="running"&&!$&&c.jsx("span",{className:"text-muted-foreground",children:"Running..."}),e.status==="running"&&c.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-foreground animate-pulse ml-0.5 align-text-bottom"})]}):ee==="browserSnapshot"?c.jsx(cGe,{snapshot:D}):ee==="browserScreenshot"?c.jsx(uGe,{path:W}):ee==="subagent"?r&&r.length>0?c.jsxs("div",{className:"rounded-lg border border-purple-500/20 bg-purple-500/[0.03] text-xs",children:[(e.status==="running"||e.status==="pending")&&r.length>0&&c.jsxs("div",{className:"flex items-center justify-end gap-2 border-b border-purple-500/15 px-3 py-2 text-xs text-muted-foreground",children:[c.jsx(er,{className:"h-3 w-3 animate-spin text-purple-500"}),c.jsxs("span",{children:[r.length," tool",r.length!==1?"s":""]})]}),(e.status==="running"||e.status==="pending")&&r.length===0&&c.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Agent is working..."}),c.jsx("div",{className:"divide-y divide-border/30",children:r.map(Wt=>c.jsx(Qf,{call:Wt,onOpenTerminal:n,onOpenDiff:i,renderInlineSecretPrompt:o},Wt.callId))}),((zt=e.result)==null?void 0:zt.message)&&(e.status==="success"||e.status==="error")&&c.jsxs("div",{className:"border-t border-purple-500/15 px-3 py-2",children:[c.jsx("div",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Result"}),c.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-background/60 p-2 font-mono text-xs leading-5",children:e.result.message})]})]}):c.jsx(lGe,{data:_??{},message:(Mt=e.result)==null?void 0:Mt.message,status:e.status}):ee==="editDiff"?c.jsx($qe,{filePath:String(k.path??""),oldText:b==="file.patch"||b==="edit"&&k.search!=null?String(k.search??""):void 0,newText:b==="file.patch"||b==="edit"&&k.replace!=null?String(k.replace??""):void 0,writtenContent:b==="file.write"||b==="edit"&&k.content!=null?String(k.content??""):void 0,isNewFile:b==="file.write"}):ee==="output"?c.jsxs("pre",{className:Le("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-foreground",e.result&&!e.result.ok&&"text-red-500 dark:text-red-400"),children:[$,e.status==="running"&&c.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-foreground animate-pulse ml-0.5 align-text-bottom"})]}):ee==="runningHint"?c.jsxs("div",{className:Le("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(er,{className:"h-3 w-3 animate-spin"}),c.jsx("span",{children:L})]}),c.jsxs("div",{className:"mt-1 text-xs opacity-75",children:["Elapsed: ",c.jsx(CO,{startedAt:e.startedAt,completedAt:e.completedAt,now:p})]})]}):null;return c.jsxs(wS,{open:le?u:!1,onOpenChange:f,children:[c.jsxs("div",{className:"relative pl-7",children:[!a&&c.jsx("span",{className:"absolute left-[10.5px] top-0 h-6 w-px bg-border/60",style:{maskImage:"linear-gradient(to bottom, transparent 0 22px, #000 22px 100%)"},"aria-hidden":"true"}),!l&&c.jsx("span",{className:"absolute left-[10.5px] top-0 bottom-0 w-px bg-border/60",style:{maskImage:"linear-gradient(to bottom, #000 0 5px, transparent 5px 23px, #000 23px 100%)"},"aria-hidden":"true"}),l&&!a&&c.jsx("span",{className:"absolute left-[10.5px] top-0 bottom-0 w-px bg-border/60",style:{maskImage:"linear-gradient(to bottom, #000 0 5px, transparent 5px 100%)"},"aria-hidden":"true"}),c.jsx("div",{className:"absolute left-[5px] top-[9px] z-10 flex h-3 w-3 items-center justify-center",children:c.jsx(E,{className:Le("h-3 w-3 shrink-0",T)})}),c.jsx("div",{className:"group pb-1",children:c.jsxs("div",{className:"flex items-center gap-2 rounded-sm px-1 py-1.5 transition-colors hover:bg-muted/20",children:[le?c.jsxs(SS,{className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[c.jsx(Js,{className:Le("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-200",u&&"rotate-90")}),pe]}):c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[c.jsx("span",{className:"h-3 w-3 shrink-0"}),pe]}),R&&n&&c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:Wt=>{Wt.preventDefault(),Wt.stopPropagation(),n(B)},children:c.jsx(np,{className:"h-3.5 w-3.5"})})}),c.jsx(fn,{side:"top",children:"Open terminal"})]}),ee==="editDiff"&&i&&e.status==="success"&&F&&c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:Wt=>{Wt.preventDefault(),Wt.stopPropagation(),i(F)},children:c.jsx(np,{className:"h-3.5 w-3.5"})})}),c.jsx(fn,{side:"top",children:"Open diff in editor"})]})]})})]}),le&&c.jsx(kS,{children:c.jsx("div",{className:"ml-7 mr-3 mb-2 border-l border-border/40 pl-4",children:et})}),ie&&c.jsx("div",{className:"ml-7 mr-3 mb-2 border-l border-border/40 pl-4",children:et}),q&&c.jsx("div",{className:"ml-7 mr-3 mb-2 border-l border-border/40 pl-4",children:c.jsx("div",{className:"rounded-lg border border-yellow-500/25 bg-yellow-500/[0.04] p-3",children:I})})]})}const Qf=y.memo(mGe);Qf.displayName="ToolCallCard";const goe=3,q1=6;function gGe(e,r){if(!r||e.some(moe))return!1;const n=e.filter(i=>i.status!=="running"&&i.status!=="pending");return n.length>=goe&&n.length===e.length}function yGe({calls:e,collapsible:r,onOpenTerminal:n,onOpenDiff:i,renderInlineSecretPrompt:s}){const[o,a]=y.useState(!1),[l,d]=y.useState(()=>!gGe(e,r)),u=y.useRef(!1),{childMap:f,parentSet:p}=y.useMemo(()=>foe(e),[e]),g=y.useMemo(()=>e.filter($=>!p.has($.callId)),[e,p]),v=g.filter($=>$.status==="running"||$.status==="pending"),b=g.filter($=>$.status!=="running"&&$.status!=="pending"),_=v.length===0&&b.length>0,k=r&&_&&b.length>=goe;if(y.useEffect(()=>{k&&!u.current&&d(!1),u.current=_},[_,k]),e.length===0)return null;const S=b.filter($=>$.status==="success").length,C=b.filter($=>$.status==="error").length,j=coe(b);if(k&&!l)return c.jsx("div",{className:"my-2",children:c.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-muted-foreground transition-colors hover:bg-muted/35",children:[c.jsx(Js,{className:"h-3.5 w-3.5 shrink-0"}),c.jsx(j,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsx("span",{className:"font-medium",children:kO(b)}),S>0&&c.jsxs("span",{className:"inline-flex items-center gap-0.5 text-green-500",children:[c.jsx(_l,{className:"h-3 w-3"})," ",S]}),C>0&&c.jsxs("span",{className:"inline-flex items-center gap-0.5 text-red-500",children:[c.jsx(Uh,{className:"h-3 w-3"})," ",C]})]})});const E=!o&&b.length>q1,T=E?b.length-q1:0,A=E?b.slice(-q1):b,M=E?b.slice(0,T).filter($=>$.status==="success").length:0,z=T-M;return c.jsxs("div",{className:"my-2",children:[k&&c.jsxs("button",{type:"button",onClick:()=>d(!1),className:"mb-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted/35",children:[c.jsx(Js,{className:"h-3 w-3 rotate-90 transition-transform"}),c.jsxs("span",{children:["Collapse ",kO(b)]})]}),E&&c.jsxs("button",{type:"button",onClick:()=>a(!0),className:"mb-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted/35",children:[c.jsx(Js,{className:"h-3 w-3"}),c.jsxs("span",{children:[T," earlier tool call",T!==1?"s":"",M>0&&c.jsxs("span",{className:"text-green-500 ml-1",children:["(",M," passed)"]}),z>0&&c.jsxs("span",{className:"text-red-500 ml-1",children:["(",z," failed)"]})]})]}),o&&b.slice(0,T).map(($,D,W)=>c.jsx(Qf,{call:$,childCalls:f.get($.callId),onOpenTerminal:n,onOpenDiff:i,renderInlineSecretPrompt:s,hideTopConnector:D===0,hideBottomConnector:D===W.length-1&&A.length===0&&v.length===0},$.callId)),A.map(($,D)=>c.jsx(Qf,{call:$,childCalls:f.get($.callId),onOpenTerminal:n,onOpenDiff:i,renderInlineSecretPrompt:s,hideTopConnector:o?!1:D===0,hideBottomConnector:D===A.length-1&&v.length===0},$.callId)),v.map(($,D)=>c.jsx(Qf,{call:$,childCalls:f.get($.callId),onOpenTerminal:n,onOpenDiff:i,renderInlineSecretPrompt:s,hideTopConnector:b.length===0&&D===0,hideBottomConnector:D===v.length-1},$.callId))]})}function yoe(e,r){if(e===r)return!0;if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0}const jO=y.memo(yGe,(e,r)=>e.onOpenTerminal===r.onOpenTerminal&&e.onOpenDiff===r.onOpenDiff&&e.renderInlineSecretPrompt===r.renderInlineSecretPrompt&&e.collapsible===r.collapsible&&yoe(e.calls,r.calls));jO.displayName="ToolCallGroup";function HF(e,r){return r?!1:e.length>0&&e.every(n=>n.status!=="running"&&n.status!=="pending")}function vGe({provider:e,calls:r,isStreaming:n,onOpenTerminal:i,onOpenDiff:s,renderInlineSecretPrompt:o}){const[a,l]=y.useState(()=>!HF(r,n)),[d,u]=y.useState(!1),[f,p]=y.useState(()=>Date.now()),g=y.useRef(!HF(r,n)),v=!!n||r.some(H=>H.status==="running"||H.status==="pending"),b=r.filter(H=>H.status==="success").length,_=r.filter(H=>H.status==="error").length,k=r.length>0?Math.min(...r.map(H=>H.startedAt)):Date.now(),S=!v&&r.length>0?Math.max(...r.map(H=>H.completedAt??H.startedAt)):void 0,C=coe(r),{childMap:j,parentSet:E}=y.useMemo(()=>foe(r),[r]),T=y.useMemo(()=>r.filter(H=>!E.has(H.callId)),[r,E]),A=T.filter(H=>H.status==="running"||H.status==="pending"),M=T.filter(H=>H.status!=="running"&&H.status!=="pending"),z=!d&&M.length>q1,$=z?M.length-q1:0,D=z?M.slice(-q1):M,W=z?M.slice(0,$).filter(H=>H.status==="success").length:0,U=$-W;return y.useEffect(()=>{g.current&&!v&&r.length>0&&l(!1),g.current=v},[v,r.length]),y.useEffect(()=>{if(!v)return;const H=window.setInterval(()=>p(Date.now()),250);return()=>window.clearInterval(H)},[v]),r.length===0?null:c.jsx(wS,{open:a,onOpenChange:l,children:c.jsxs("div",{className:"my-2",children:[c.jsxs(SS,{className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-muted/35",children:[c.jsx(Js,{className:Le("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",a&&"rotate-90")}),v?c.jsx(er,{className:"h-4 w-4 shrink-0 text-muted-foreground animate-spin"}):c.jsx(C,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:kO(r)}),c.jsxs("div",{className:"flex items-center gap-2 ml-auto text-xs text-muted-foreground tabular-nums shrink-0",children:[!v&&_>0&&c.jsxs("span",{className:"text-red-500",children:[_," failed"]}),c.jsx(CO,{startedAt:k,completedAt:S,now:f})]}),!v&&_===0&&b>0&&c.jsx(_l,{className:"h-3.5 w-3.5 shrink-0 text-green-500"}),!v&&_>0&&c.jsx(Uh,{className:"h-3.5 w-3.5 shrink-0 text-red-500"})]}),c.jsx(kS,{children:c.jsxs("div",{className:"mt-1",children:[z&&c.jsxs("button",{type:"button",onClick:()=>u(!0),className:"mb-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted/35",children:[c.jsx(Js,{className:"h-3 w-3"}),c.jsxs("span",{children:[$," earlier tool call",$!==1?"s":"",W>0&&c.jsxs("span",{className:"text-green-500 ml-1",children:["(",W," passed)"]}),U>0&&c.jsxs("span",{className:"text-red-500 ml-1",children:["(",U," failed)"]})]})]}),d&&M.slice(0,$).map((H,R,B)=>c.jsx(Qf,{call:H,childCalls:j.get(H.callId),onOpenTerminal:i,onOpenDiff:s,renderInlineSecretPrompt:o,hideTopConnector:R===0,hideBottomConnector:R===B.length-1&&D.length===0&&A.length===0},H.callId)),D.map((H,R)=>c.jsx(Qf,{call:H,childCalls:j.get(H.callId),onOpenTerminal:i,onOpenDiff:s,renderInlineSecretPrompt:o,hideTopConnector:d?!1:R===0,hideBottomConnector:R===D.length-1&&A.length===0},H.callId)),A.map((H,R)=>c.jsx(Qf,{call:H,childCalls:j.get(H.callId),onOpenTerminal:i,onOpenDiff:s,renderInlineSecretPrompt:o,hideTopConnector:M.length===0&&R===0,hideBottomConnector:R===A.length-1},H.callId))]})})]})})}const NO=y.memo(vGe,(e,r)=>e.provider===r.provider&&e.isStreaming===r.isStreaming&&e.onOpenTerminal===r.onOpenTerminal&&e.onOpenDiff===r.onOpenDiff&&e.renderInlineSecretPrompt===r.renderInlineSecretPrompt&&yoe(e.calls,r.calls));NO.displayName="AgentToolCallWrapper";function WF(e){switch(e){case"system":return"border-red-500/35 bg-red-500/10 text-red-700 dark:text-red-300";case"user":return"border-blue-500/35 bg-blue-500/10 text-blue-700 dark:text-blue-300";case"assistant":return"border-emerald-500/35 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300";case"tool":return"border-amber-500/35 bg-amber-500/10 text-amber-700 dark:text-amber-300";default:return"border-border bg-muted text-muted-foreground"}}function ep(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function xGe(e){return"content"in e?ep(e.content):ep(e)}function bGe(e){return(Array.isArray(e.tool_calls)?e.tool_calls:Array.isArray(e.toolCalls)?e.toolCalls:[]).map((n,i)=>{const s=n&&typeof n=="object"?n:{},o=s.function&&typeof s.function=="object"?s.function:{};return{id:ep(s.id||s.call_id||s.tool_call_id||`tool-call-${i+1}`),name:ep(o.name||s.name||s.tool||"tool"),args:ep(o.arguments||s.arguments||s.args||{})}})}function _Ge(e,r){const n=e&&typeof e=="object"?e:{},i=n.function&&typeof n.function=="object"?n.function:{};return{name:ep(i.name||n.name||`tool_${r+1}`),description:typeof i.description=="string"?i.description:typeof n.description=="string"?n.description:void 0,raw:e}}function voe(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function jm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function UF({badge:e,meta:r,preview:n,children:i,tone:s="default",defaultOpen:o=!1,onOpenChange:a}){const[l,d]=y.useState(o);return c.jsx(wS,{open:l,onOpenChange:u=>{d(u),a==null||a()},children:c.jsxs("div",{className:Le("rounded-md border p-3",s==="assistant"?"border-emerald-500/25 bg-emerald-500/10":"border-border/80 bg-background"),children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsxs(SS,{className:"mt-0.5 rounded-sm p-0.5 text-muted-foreground transition-colors hover:bg-background/70 hover:text-foreground",children:[c.jsx(Js,{className:Le("h-4 w-4 transition-transform",l&&"rotate-90")}),c.jsx("span",{className:"sr-only",children:l?"Collapse section":"Expand section"})]}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[e,r]}),n?c.jsx("div",{className:"mt-1 text-xs text-muted-foreground/70",children:n}):null]})]}),c.jsx(kS,{className:"pl-6",children:c.jsx("div",{className:"pt-3",children:i})})]})})}function wGe({flow:e}){const r=e.rounds;if(!r.some(p=>p.metrics))return null;let i=0,s=0,o=0,a=0,l,d=0,u=0;for(const p of r){const g=p.metrics;g&&(i+=g.durationMs,g.promptTokens&&(s+=g.promptTokens),g.completionTokens&&(o+=g.completionTokens),g.totalTokens&&(a+=g.totalTokens),g.tokensPerSecond&&g.completionTokens&&(d+=g.tokensPerSecond*g.completionTokens,u+=g.completionTokens),g.contextUsage&&(l=g.contextUsage))}const f=u>0?Math.round(d/u*10)/10:void 0;return c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(ng,{className:"h-3 w-3"}),"Total Duration"]}),c.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:voe(i)}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.length," round",r.length!==1?"s":""]})]}),c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(N8,{className:"h-3 w-3"}),"Tokens"]}),c.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:a>0?jm(a):s+o>0?jm(s+o):"—"}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[s>0?`${jm(s)} in`:"",s>0&&o>0?" · ":"",o>0?`${jm(o)} out`:"",s===0&&o===0?"estimated":""]})]}),c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(aK,{className:"h-3 w-3"}),"Speed"]}),c.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:f?`${f} tok/s`:"—"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"completion tokens/sec"})]}),c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(Tge,{className:"h-3 w-3"}),"Context Window"]}),l?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:[Math.round(l.ratio*100),"%"]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[jm(l.total)," / ",jm(l.limit)," tokens",l.pruned?" (pruned)":""]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:"—"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"no data"})]})]})]})}function SGe({metrics:e}){return e?c.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[c.jsx("span",{title:"LLM request duration",children:voe(e.durationMs)}),e.promptTokens!=null&&c.jsxs("span",{title:"Prompt tokens",children:[jm(e.promptTokens)," prompt"]}),e.completionTokens!=null&&c.jsxs("span",{title:"Completion tokens",children:[jm(e.completionTokens)," completion"]}),e.tokensPerSecond!=null&&c.jsxs("span",{title:"Completion tokens per second",className:"font-medium text-foreground/80",children:[e.tokensPerSecond," tok/s"]}),e.contextUsage&&c.jsxs("span",{title:"Context window utilisation",children:["ctx ",Math.round(e.contextUsage.ratio*100),"%",e.contextUsage.pruned?" (pruned)":""]})]}):null}function kGe(e,r){const n=[];if(!e)return r?[{id:"assistant-response",kind:"response",content:r}]:n;e.rounds.some(i=>i.metrics)&&n.push({id:"summary",kind:"summary",flow:e});for(const i of e.rounds){const s=Array.isArray(i.messages)?i.messages:[],o=Array.isArray(i.tools)?i.tools.map(_Ge):[];n.push({id:`round-${i.round}`,kind:"round",round:i,messageCount:s.length,toolCount:o.length}),s.forEach((a,l)=>{const d=a&&typeof a=="object"?a:{content:a};n.push({id:`round-${i.round}-message-${l}`,kind:"message",roundNumber:i.round,index:l,role:ep(d.role||"message"),content:xGe(d),raw:a,toolCalls:bGe(d)})}),o.length>0&&n.push({id:`round-${i.round}-tools`,kind:"tools",roundNumber:i.round,tools:o})}return r&&n.push({id:"assistant-response",kind:"response",content:r}),n}function CGe({row:e,onExpandChange:r}){if(e.kind==="summary")return c.jsx(wGe,{flow:e.flow});if(e.kind==="round")return c.jsxs("div",{className:"min-w-0 overflow-hidden rounded-md border border-border bg-background px-3 py-2",children:[c.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"rounded-md bg-foreground px-2 py-1 text-xs font-semibold text-background",children:["Round ",e.round.round]}),c.jsx("span",{className:"min-w-0 break-words text-xs text-muted-foreground",children:e.round.model}),c.jsx("span",{className:"min-w-0 break-words text-xs text-muted-foreground",children:new Date(e.round.createdAt).toLocaleString()})]}),c.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap gap-2 text-xs text-muted-foreground",children:[c.jsxs("span",{children:[e.messageCount," messages sent"]}),c.jsxs("span",{children:[e.toolCount," tool schemas available"]}),e.round.tool_choice?c.jsxs("span",{className:"min-w-0 break-words",children:["tool_choice: ",e.round.tool_choice]}):null]}),c.jsx(SGe,{metrics:e.round.metrics})]});if(e.kind==="tools")return c.jsxs("div",{className:"relative ml-2 sm:ml-4 border-l border-border pl-2 sm:pl-4",children:[c.jsx("div",{className:"absolute -left-1.5 top-3 h-3 w-3 rounded-full border border-border bg-background"}),c.jsxs("div",{className:"rounded-md border border-border/80 bg-muted/25 p-3",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-medium text-foreground",children:[c.jsx(jR,{className:"h-3.5 w-3.5"}),"Tools offered to model in round ",e.roundNumber]}),c.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:e.tools.map(i=>c.jsxs("details",{className:"rounded-md border border-border/70 bg-background/70 p-2",children:[c.jsx("summary",{className:"cursor-pointer text-xs font-medium text-foreground",children:i.name}),i.description?c.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:i.description}):null,c.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/40 p-2 font-mono text-xs leading-5",children:ep(i.raw)})]},i.name))})]})]});if(e.kind==="response")return c.jsxs("div",{className:"relative ml-2 sm:ml-4 border-l border-border pl-2 sm:pl-4",children:[c.jsx("div",{className:"absolute -left-1.5 top-3 h-3 w-3 rounded-full border border-emerald-500/40 bg-background"}),c.jsx(UF,{tone:"assistant",defaultOpen:!1,onOpenChange:r,badge:c.jsx("span",{className:Le("rounded-md border px-2 py-0.5 text-xs font-semibold",WF("assistant")),children:"assistant response"}),meta:c.jsx("span",{className:"text-xs text-muted-foreground",children:"rendered chat answer"}),preview:c.jsx("span",{className:"block truncate",children:e.content||"(empty response)"}),children:c.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-background/70 p-3 font-mono text-xs leading-5 text-foreground [overflow-wrap:anywhere]",children:e.content||"(empty response)"})})]});const n=e.content?e.content.length>80?e.content.slice(0,80)+"...":e.content:"(empty content)";return c.jsxs("div",{className:"relative ml-2 sm:ml-4 border-l border-border pl-2 sm:pl-4",children:[c.jsx("div",{className:"absolute -left-1.5 top-3 h-3 w-3 rounded-full border border-border bg-background"}),c.jsxs(UF,{defaultOpen:!1,onOpenChange:r,badge:c.jsx("span",{className:Le("rounded-md border px-2 py-0.5 text-xs font-semibold",WF(e.role)),children:e.role}),meta:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-xs text-muted-foreground",children:["round ",e.roundNumber," / message ",e.index+1]}),e.toolCalls.length>0?c.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:[e.toolCalls.length," tool call",e.toolCalls.length!==1?"s":""]}):null]}),preview:c.jsx("span",{className:"block truncate",children:n}),children:[c.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/35 p-3 font-mono text-xs leading-5 text-foreground [overflow-wrap:anywhere]",children:e.content||"(empty content)"}),e.toolCalls.length>0?c.jsx("div",{className:"mt-3 space-y-2",children:e.toolCalls.map(i=>c.jsxs("details",{className:"rounded-md border border-amber-500/25 bg-amber-500/10 p-2",children:[c.jsxs("summary",{className:"cursor-pointer text-xs font-medium text-amber-800 dark:text-amber-200",children:["Tool call: ",i.name," ",c.jsxs("span",{className:"font-normal text-muted-foreground",children:["(",i.id,")"]})]}),c.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-background/70 p-2 font-mono text-xs leading-5",children:i.args||"{}"})]},i.id))}):null,c.jsxs("details",{className:"mt-2",children:[c.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:"Raw message JSON"}),c.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/35 p-2 font-mono text-xs leading-5",children:ep(e.raw)})]})]})]})}function jGe({open:e,onOpenChange:r,contextFlow:n,responseContent:i}){const[s,o]=y.useState("trace"),[a,l]=y.useState(!1),d=y.useRef(null),u=y.useMemo(()=>kGe(n,i),[n,i]),f=y.useMemo(()=>n?JSON.stringify(n,null,2):"",[n]),p=KR({count:u.length,getScrollElement:()=>d.current,estimateSize:b=>{const _=u[b];return _?_.kind==="summary"?110:_.kind==="round"?120:_.kind==="tools"?Math.min(420,110+_.tools.length*72):_.kind==="response"?72:52:120},overscan:5,enabled:e&&s==="trace"});y.useEffect(()=>{if(!e||s!=="trace")return;const b=window.requestAnimationFrame(()=>{p.measure()});return()=>window.cancelAnimationFrame(b)},[e,s,u.length,p]);const g=async()=>{f&&(await navigator.clipboard.writeText(f),l(!0),window.setTimeout(()=>l(!1),1200))},v=()=>{window.requestAnimationFrame(()=>{p.measure()})};return c.jsx(Fc,{open:e,onOpenChange:r,children:c.jsxs(Ql,{showCloseButton:!1,className:"grid h-[95vh] w-[calc(100dvw-1rem)] max-w-[1200px] grid-rows-[auto_minmax(0,1fr)] overflow-hidden p-0 sm:h-[85vh] sm:w-[96vw]",children:[c.jsx(Du,{className:"border-b px-3 py-2",children:c.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx(ec,{className:"truncate text-sm font-semibold",children:"LLM Context Flow"}),c.jsx(Vh,{className:"truncate text-xs",children:n?`${n.provider}${n.model?` / ${n.model}`:""} · ${n.rounds.length} round${n.rounds.length===1?"":"s"}`:"No context snapshot available"})]}),c.jsxs("div",{className:"-my-1 flex shrink-0 items-center gap-1 p-1",children:[c.jsx(Se,{type:"button",variant:s==="trace"?"default":"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>o("trace"),children:"Trace"}),c.jsx(Se,{type:"button",variant:s==="raw"?"default":"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>o("raw"),children:"Raw"}),c.jsxs(Se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:g,disabled:!f,children:[a?c.jsx(ys,{className:"h-3 w-3 sm:mr-1"}):c.jsx(Rc,{className:"h-3 w-3 sm:mr-1"}),c.jsx("span",{className:"hidden sm:inline",children:a?"Copied":"Copy"}),c.jsx("span",{className:"sr-only",children:a?"Copied":"Copy raw trace"})]}),c.jsxs(WG,{className:"ml-1 rounded-sm p-1 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[c.jsx(ni,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}),s==="trace"?c.jsxs("div",{className:"min-h-0 px-3 pb-3 pt-2",children:[n!=null&&n.note?c.jsx("p",{className:"mb-2 rounded-md border border-border/70 bg-muted/40 px-2.5 py-1.5 text-xs text-muted-foreground",children:n.note}):null,u.length>0?c.jsx("div",{ref:d,className:"h-full min-h-0 overflow-auto pr-2",children:c.jsx("div",{className:"relative w-full",style:{height:`${p.getTotalSize()}px`},children:p.getVirtualItems().map(b=>{const _=u[b.index];return _?c.jsx("div",{"data-index":b.index,ref:p.measureElement,className:"absolute left-0 top-0 w-full pb-3",style:{transform:`translateY(${b.start}px)`},children:c.jsx(CGe,{row:_,onExpandChange:v})},_.id):null})})}):c.jsxs("div",{className:"flex h-full items-center justify-center rounded-md border border-dashed border-border text-sm text-muted-foreground",children:[c.jsx(Om,{className:"mr-2 h-4 w-4"}),"No context snapshot is available for this message."]})]}):c.jsx("div",{className:"min-h-0 overflow-auto px-3 pb-3 pt-2",children:c.jsx("pre",{className:"min-h-full whitespace-pre-wrap break-words rounded-md border border-border/70 bg-muted/35 p-3 font-mono text-xs leading-relaxed text-foreground [overflow-wrap:anywhere]",children:f||"No context snapshot is available for this message."})})]})})}const TO=/^[A-Za-z]:[\\/]/,NGe=/^\//;function VF(e){return e.replace(/\\/g,"/").replace(/\/+$/,"")}function TGe(e){const r=e.pathname||"/",n=/^\/[A-Za-z]:\//.test(r)?r.slice(1):r;return!e.hostname||e.hostname==="localhost"?n:`//${e.hostname}${n}`}function xoe(e){return TO.test(e)||NGe.test(e)}function boe(e,r){const n=e.replace(/\\/g,"/");if(!n||n==="/")return!1;if(/^L\d+(?:C\d+)?$/i.test(r))return!0;const i=n.split("/").pop()??"";return/\.[A-Za-z0-9]+(?::\d+(?::\d+)?)?$/.test(i)}function EGe(e,r){if(r)return null;const n=e.replace(/\\/g,"/"),i=n.lastIndexOf("/"),o=(i>=0?n.slice(i+1):n).match(/^(.*?):(\d+)(?::(\d+))?$/);if(!o)return null;const a=i>=0?`${e.slice(0,i+1)}${o[1]??""}`:o[1]??"";if(!xoe(a)||!boe(a,`L${o[2]}`))return null;const l={path:a,line:Number.parseInt(o[2],10)};return o[3]&&(l.column=Number.parseInt(o[3],10)),l}function AGe(e){if(!e)return null;const r=e.trim();if(!r)return null;let n=r,i="";try{const d=new URL(r);if(d.protocol==="http:"||d.protocol==="https:"){if(n=d.pathname,i=d.hash.startsWith("#")?d.hash.slice(1):d.hash,!boe(n,i))return null}else if(d.protocol==="file:")n=TGe(d),i=d.hash.startsWith("#")?d.hash.slice(1):d.hash;else{const u=r.indexOf("#");u>=0&&(n=r.slice(0,u),i=r.slice(u+1))}}catch{const d=r.indexOf("#");d>=0&&(n=r.slice(0,d),i=r.slice(d+1))}let s;try{s=decodeURIComponent(n)}catch{return null}const o=EGe(s,i);if(o)return o;if(!xoe(s))return null;const a={path:s},l=i.match(/^L(\d+)(?:C(\d+))?$/i);return l&&(a.line=Number.parseInt(l[1],10),l[2]&&(a.column=Number.parseInt(l[2],10))),a}function qF(e,r){if(!r)return!1;const n=VF(e),i=VF(r);if(!n||!i)return!1;const s=TO.test(n)?n.toLowerCase():n,o=TO.test(i)?i.toLowerCase():i;return s===o||s.startsWith(`${o}/`)}function OGe(e){return e.content.length>0||e.userDisplayText.length>0||e.userDisplaySegments.length>0||e.imageAttachmentCount>0}const RGe=3;function GF(e,r){return!!(e&&e!=="jait"&&r.length>=RGe)}const KF=/<pre[^>]*><code>([\s\S]*)<\/code><\/pre>/;function YF(){return c.jsx("span",{className:"inline-flex items-center gap-1",children:[0,1,2].map(e=>c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-pulse",style:{animationDelay:`${e*160}ms`}},e))})}function MGe(e){const r=e.toLowerCase();return!r||r==="text"||r==="plain"?"txt":r==="shell"||r==="sh"?"bash":r}function PGe({code:e,language:r,className:n}){const[i,s]=y.useState(null);return y.useEffect(()=>{let o=!1;const a=setTimeout(()=>{(async()=>{var f,p;const d=document.documentElement.classList.contains("dark")?"github-dark":"github-light",u=MGe(r);try{const g=await $I(e,{lang:u,theme:d});if(o)return;s(((f=g.match(KF))==null?void 0:f[1])??null)}catch{try{const g=await $I(e,{lang:"txt",theme:d});if(o)return;s(((p=g.match(KF))==null?void 0:p[1])??null)}catch{o||s(null)}}})()},150);return()=>{o=!0,clearTimeout(a)}},[e,r]),i?c.jsx("code",{className:Le(n,"whitespace-pre"),dangerouslySetInnerHTML:{__html:i}}):c.jsx("code",{className:Le(n,"whitespace-pre"),children:e})}function _oe(e){return"prose dark:prose-invert max-w-none break-words [overflow-wrap:anywhere] prose-pre:bg-muted prose-pre:border prose-pre:max-w-full prose-pre:overflow-x-auto prose-code:before:content-none prose-code:after:content-none prose-p:leading-relaxed [font-size:0.9rem]"}function LGe(e){const r=e.replace(/\\/g,"/"),n=r.split("/");return n[n.length-1]??r}function $Ge({href:e,target:r,onOpenPath:n}){const i=LGe(r.path),s=r.line?`L${r.line}${r.column?`:${r.column}`:""}`:null;return c.jsxs("a",{href:e,className:Le("not-prose inline-flex max-w-full items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 align-middle text-xs font-medium leading-none text-foreground no-underline transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),title:r.path,onClick:o=>{o.preventDefault(),n(r.path,r.line,r.column)},children:[c.jsx(Ro,{filename:i,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"max-w-[220px] truncate",children:i}),s?c.jsx("span",{className:"shrink-0 rounded bg-background/80 px-1 py-0.5 text-2xs text-muted-foreground",children:s}):null]})}function woe(e){return{pre:({children:r})=>c.jsx(c.Fragment,{children:r}),code:({node:r,className:n,children:i,ref:s,...o})=>{var l,d;if(!(((l=r==null?void 0:r.position)==null?void 0:l.start.line)===((d=r==null?void 0:r.position)==null?void 0:d.end.line)&&!n)){const u=typeof n=="string"&&n.replace(/^language-/,"").split(" ")[0]||"text",f=String(i??"").replace(/\n$/,"");return c.jsxs(QNe,{code:f,language:u,children:[c.jsxs(eTe,{children:[c.jsx(tTe,{children:c.jsx(rTe,{children:u})}),c.jsx(nTe,{children:c.jsx(iTe,{})})]}),c.jsx("div",{className:"overflow-x-auto px-3 py-2 text-sm",children:c.jsx(PGe,{code:f,language:u,className:n})})]})}return c.jsx("code",{className:Le("not-prose inline-flex max-w-full items-baseline rounded-md border border-border/70 bg-muted/45 px-2 py-1 align-middle font-mono text-xs font-medium leading-[1.2] text-foreground","shadow-[inset_0_1px_0_hsl(var(--background)/0.55)]"),...o,children:c.jsx("span",{className:"max-w-[32rem] truncate sm:max-w-[40rem]",children:i})})},a:({href:r,ref:n,...i})=>{if(!e)return c.jsx("a",{href:r,...i,children:i.children});const s=AGe(r);return s?c.jsx($Ge,{href:r,target:s,onOpenPath:e}):c.jsx("a",{href:r,...i,children:i.children})},img:({src:r,alt:n,ref:i,...s})=>{const o=typeof r=="string"?roe(r):null;return o?c.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:"not-prose block overflow-hidden rounded-xl border border-border/60 bg-muted/20 no-underline",children:c.jsx("img",{src:o,alt:n??"Chat image",loading:"lazy",className:"max-h-[28rem] w-full object-contain bg-background/80",...s})}):c.jsx("span",{className:"inline-flex rounded-md border border-dashed border-border/70 px-2 py-1 text-xs text-muted-foreground",children:"image unavailable"})}}}function DGe({content:e,compact:r,onOpenPath:n}){const i=y.useMemo(()=>woe(n),[n]);return c.jsx("div",{className:_oe(),children:c.jsx(EZ,{remarkPlugins:[AZ],components:i,children:e})})}function IGe({content:e,compact:r,onOpenPath:n}){const i=y.useMemo(()=>woe(n),[n]),s=({blockMatch:a})=>c.jsx(EZ,{remarkPlugins:[AZ],components:i,children:a.output}),{blockMatches:o}=U3e({llmOutput:e,blocks:[],fallbackBlock:{component:s,lookBack:M3e()},isStreamFinished:!1});return c.jsx("div",{className:_oe(),children:o.map((a,l)=>{const d=a.block.component;return c.jsx(d,{blockMatch:a},l)})})}const EO=y.memo(function({content:r,compact:n,isStreaming:i,preferLlmUi:s,onOpenPath:o}){return s&&i?c.jsx(IGe,{content:r,compact:n,onOpenPath:o}):c.jsx(DGe,{content:r,compact:n,onOpenPath:o})});EO.displayName="AssistantMarkdown";function BGe({messageId:e,messageIndex:r,messageFromEnd:n,role:i,content:s,contextFlow:o,displayContent:a,referencedFiles:l,displaySegments:d,attachments:u,thinking:f,thinkingDuration:p,toolCalls:g,segments:v,isStreaming:b,compact:_,preferLlmUi:k,provider:S,onOpenTerminal:C,renderInlineSecretPrompt:j,onEditMessage:E,editComposer:T,onOpenPath:A,onOpenDiff:M}){const z=i==="user",{userDisplayText:$,userDisplaySegments:D}=y.useMemo(()=>{if(!z)return{userDisplayText:s,userDisplaySegments:[]};if(d!=null&&d.length)return{userDisplayText:uv(d),userDisplaySegments:d};if(a){const Ce=x5(a,l);return{userDisplayText:a,userDisplaySegments:Ce}}const ke=SJ(s);return{userDisplayText:ke.text,userDisplaySegments:ke.displaySegments}},[z,s,a,l,d]),[W,U]=y.useState(!1),[H,R]=y.useState(!1),[B,L]=y.useState(!1),[I,q]=y.useState(!1),[X,F]=y.useState(!1),[G,Q]=y.useState(!1),[V,ee]=y.useState(""),[ie,le]=y.useState([]),[he,re]=y.useState(null),[ne,fe]=y.useState(null),we=y.useMemo(()=>{if(!z)return[];const ke=$s(ne??D).flatMap(Ce=>Ce.type==="image"?[{name:Ce.name,mimeType:Ce.mimeType,data:Ce.data,preview:`data:${Ce.mimeType};base64,${Ce.data}`}]:[]);return ke.length>0?ke:u??[]},[u,z,ne,D]),pe=z&&OGe({content:s,userDisplayText:he??$,userDisplaySegments:ne??D,imageAttachmentCount:we.length}),et=y.useRef(null),ae=y.useRef(null),rt=y.useRef(null);y.useEffect(()=>()=>{et.current!==null&&window.clearTimeout(et.current)},[]),y.useEffect(()=>{B||(ee($),le(D))},[B,D,$]),y.useEffect(()=>{if(!ne&&he==null)return;const ke=he===$,Ce=ne===D||JSON.stringify(ne??[])===JSON.stringify(D);ke&&Ce&&(re(null),fe(null))},[ne,he,D,$]),y.useEffect(()=>{var Ce;if(!B){q(!1);return}const ke=window.requestAnimationFrame(()=>{q(!0)});return(Ce=rt.current)==null||Ce.focus(),()=>window.cancelAnimationFrame(ke)},[B]);const Je=()=>{var Ce;const ke=[];if(g&&g.length>0)for(const Fe of g){const wt=Fe.tool.replace(/_/g,"."),Be=Object.entries(Fe.args).filter(([,Qe])=>Qe!=null&&Qe!=="").map(([Qe,Lt])=>`${Qe}: ${typeof Lt=="string"?Lt:JSON.stringify(Lt)}`).join(", "),Ue=Fe.status==="success"?"✓":Fe.status==="error"?"✗":"…",jt=Fe.completedAt&&Fe.startedAt?`${((Fe.completedAt-Fe.startedAt)/1e3).toFixed(1)}s`:"";if(ke.push(`[${Ue} ${wt}] ${Be}`),(Ce=Fe.result)!=null&&Ce.message){const Qe=Fe.result.message.length>500?Fe.result.message.slice(0,500)+"…":Fe.result.message;ke.push(Qe)}jt&&ke.push(`Duration: ${jt}`),ke.push("")}return s&&ke.push(z?kJ(D)||$:s),ke.join(`
|
|
1159
|
-
`).trim()},$e=async()=>{const ke=Je();if(!ke)return;const Ce=z?CJ(D):null;try{Ce&&typeof ClipboardItem<"u"&&navigator.clipboard.write?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([ke],{type:"text/plain"}),[v5]:new Blob([Ce],{type:v5})})]):await navigator.clipboard.writeText(ke)}catch{const Fe=document.createElement("textarea");Fe.value=ke,Fe.style.position="fixed",Fe.style.opacity="0",document.body.appendChild(Fe),Fe.focus(),Fe.select(),document.execCommand("copy"),document.body.removeChild(Fe)}U(!0),et.current!==null&&window.clearTimeout(et.current),et.current=window.setTimeout(()=>U(!1),1200)},Ne=z&&!!e&&!!E,Xe=Ne,gt=b&&!f&&!(typeof s=="string"?s:"").trim(),zt=z||!b,Mt=y.useCallback(()=>{!Ne||X||(ee($),le(D),L(!0))},[Ne,X,D,$]),Wt=y.useCallback(()=>{ee($),le(D),L(!1)},[D,$]),nr=()=>{var Ce;!Ne||B||typeof window<"u"&&(Ce=window.getSelection())!=null&&Ce.toString().trim()||Mt()},ar=y.useCallback(async(ke,Ce)=>{if(!Ne||!e||!E||X)return;const Fe=OTe(ke??V,Ce??ie,D);if(Fe){re(Fe.text),fe(Fe.displaySegments),L(!1),F(!0);try{await E(e,Fe.text,r,n,{referencedFiles:Fe.referencedFiles,displaySegments:Fe.displaySegments})}catch(wt){throw re(null),fe(null),L(!0),wt}finally{F(!1)}}},[Ne,V,ie,X,e,n,r,E]),Me=async(ke,Ce)=>{if(!Ne||!e||!E)return;const Fe=ke.trim();Fe&&await E(e,Fe,r,n,{referencedFiles:(Ce??D).filter(wt=>wt.type==="file").map(wt=>({path:wt.path,name:wt.name})),displaySegments:Ce??D})},ve=async()=>{if(Xe){R(!0);try{await Me($,D)}finally{R(!1)}}},Ie=ke=>B||!zt||!s?null:c.jsx("div",{className:Le("absolute z-10 rounded-full border border-border/70 bg-background p-1","right-1 bottom-[.25rem]","opacity-0 transition-opacity group-hover/message:opacity-100 focus-within:opacity-100","touch-device:opacity-80",W&&"opacity-100"),children:c.jsxs(oTe,{children:[Ne?c.jsx(dC,{onClick:Mt,"aria-label":"Edit message",tooltip:"Edit message",className:"h-6 w-6",children:c.jsx(kR,{className:"h-3.5 w-3.5"})}):null,Xe?c.jsx(dC,{onClick:Ce=>{Ce.preventDefault(),Ce.stopPropagation(),ve()},disabled:H,"aria-label":"Retry from this message",tooltip:"Retry from this message",className:"h-6 w-6",children:c.jsx(iK,{className:Le("h-3.5 w-3.5",H&&"animate-spin")})}):null,!z&&o?c.jsx(dC,{onClick:Ce=>{Ce.preventDefault(),Ce.stopPropagation(),Q(!0)},"aria-label":"View LLM context",tooltip:"View LLM context",className:"h-6 w-6",children:c.jsx(Ah,{className:"h-3.5 w-3.5"})}):null,c.jsx(dC,{onClick:$e,"aria-label":W?"Copied":"Copy message",tooltip:W?"Copied":"Copy message",className:"h-6 w-6",children:W?c.jsx(ys,{className:"h-3.5 w-3.5"}):c.jsx(Rc,{className:"h-3.5 w-3.5"})})]})}),Ve=z?null:Ie(),nt=!z&&(v==null?void 0:v.some(ke=>ke.type==="thinking"&&ke.content.trim()));return c.jsxs(c.Fragment,{children:[c.jsx(sTe,{from:i,className:Le(_?"py-2":"py-4"),children:c.jsxs("div",{className:Le("min-w-0 max-w-[85%] space-y-2",z&&"order-1"),children:[!z&&f&&!nt&&c.jsx(WI,{content:f,isStreaming:!!b&&!s,duration:p}),!z&&v&&v.length>0?c.jsxs("div",{className:"relative min-w-0 max-w-full select-text break-words [overflow-wrap:anywhere]",children:[v.map((ke,Ce)=>{if(ke.type==="toolGroup"){const Fe=(g??[]).filter(Be=>ke.callIds.includes(Be.callId)),wt=v.slice(Ce+1).some(Be=>Be.type==="text"&&typeof Be.content=="string"&&Be.content.trim());return Fe.length>0?GF(S,Fe)?c.jsx(NO,{provider:S,calls:Fe,isStreaming:!!b&&Ce===v.length-1,onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j},`tg-${Ce}`):c.jsx(jO,{calls:Fe,collapsible:wt,onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j},`tg-${Ce}`):null}return ke.type==="thinking"?ke.content.trim()?c.jsx(WI,{content:ke.content,isStreaming:!!b&&Ce===v.length-1,duration:p},`th-${Ce}`):null:typeof ke.content=="string"&&ke.content.trim()?c.jsx(sT,{"data-message-from":"assistant",className:"max-w-full bg-card/78",children:c.jsx(EO,{content:ke.content,compact:_,isStreaming:!!b&&Ce===v.length-1,preferLlmUi:k,onOpenPath:A})},`ts-${Ce}`):null}),b&&!s&&!v.some(ke=>ke.type==="text"&&typeof ke.content=="string"&&ke.content.trim())&&c.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:c.jsx(YF,{})}),Ve]}):c.jsxs(c.Fragment,{children:[g&&g.length>0&&(GF(S,g)?c.jsx(NO,{provider:S,calls:g,isStreaming:b,onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j}):c.jsx(jO,{calls:g,collapsible:S!=="jait",onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j})),pe||s?z?B?c.jsx("div",{className:"w-full max-w-3xl",onClick:ke=>ke.stopPropagation(),children:c.jsx("div",{className:Le("space-y-3 origin-bottom transition-all duration-150 ease-out",I?"translate-y-0 opacity-100":"translate-y-2 opacity-0"),children:c.jsx(s_,{ref:rt,draftStateKey:`edit:${e??"user-message"}`,value:V,segments:ie,onChange:ke=>{var Ce;ee(ke),le(((Ce=rt.current)==null?void 0:Ce.getSegments())??[])},onSubmit:(ke,Ce,Fe)=>{const wt=Fe??[],Be=uv(wt)||V;le(wt),ar(Be,wt)},disabled:X,controlsDisabled:X,placeholder:"Edit message...",onVoiceInput:T==null?void 0:T.onVoiceInput,voiceRecording:T==null?void 0:T.voiceRecording,voiceLevels:T==null?void 0:T.voiceLevels,voiceTranscribing:T==null?void 0:T.voiceTranscribing,onVoiceStop:T==null?void 0:T.onVoiceStop,mode:T==null?void 0:T.mode,onModeChange:T==null?void 0:T.onModeChange,provider:T==null?void 0:T.provider,onProviderChange:T==null?void 0:T.onProviderChange,responseStyle:T==null?void 0:T.responseStyle,onResponseStyleChange:T==null?void 0:T.onResponseStyleChange,providerRuntimeMode:T==null?void 0:T.providerRuntimeMode,onProviderRuntimeModeChange:T==null?void 0:T.onProviderRuntimeModeChange,cliModel:T==null?void 0:T.cliModel,onCliModelChange:T==null?void 0:T.onCliModelChange,sessionInfo:T==null?void 0:T.sessionInfo,workspaceNodeId:T==null?void 0:T.workspaceNodeId,availableFiles:(T==null?void 0:T.availableFiles)??dv(D),onSearchFiles:T==null?void 0:T.onSearchFiles,workspaceOpen:(T==null?void 0:T.workspaceOpen)??dv(D).length>0,footerTrailingContent:c.jsx(Se,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-lg",onClick:Wt,disabled:X,"aria-label":"Cancel editing message",title:"Cancel editing",children:c.jsx(ni,{className:"h-3.5 w-3.5"})}),className:"rounded-lg border-primary/20 bg-primary/[0.08] dark:!bg-primary/[0.08] shadow-none [&_.text-muted-foreground]:text-muted-foreground [&>div]:!bg-transparent [&_[contenteditable='true']]:!bg-transparent"},`edit-${e??"user-message"}`)})}):c.jsxs("div",{className:"relative w-fit max-w-full",children:[c.jsx(sT,{ref:ae,"data-message-from":"user",className:Le("min-w-0 rounded-lg bg-muted px-4 py-3 break-words [overflow-wrap:anywhere]",Ne&&!B&&"cursor-text transition-colors hover:bg-muted/80","leading-relaxed [font-size:0.9rem]"),onClick:nr,title:Ne&&!B?"Click to edit message":void 0,children:c.jsxs("div",{className:"min-w-0 space-y-3",children:[c.jsx("div",{className:"min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:(ne??D).length>0?(ne??D).map((ke,Ce)=>ke.type==="text"?c.jsx("span",{children:ke.text},`text-${Ce}`):ke.type==="file"?c.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:ke.path,children:[c.jsx(Ro,{filename:ke.name,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"max-w-[180px] truncate",children:ke.lineRange?`${ke.name}:${y2(ke.lineRange).replace(/^lines? /,"")}`:ke.name})]},`${ke.path}-${Ce}`):ke.type==="workspace"?c.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:ke.path,children:[c.jsx(jj,{name:ke.name,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"max-w-[180px] truncate",children:ke.name})]},`${ke.path}-${Ce}`):ke.type==="terminal"?c.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:ke.workspaceRoot?`${ke.terminalId} · ${ke.workspaceRoot}`:ke.terminalId,children:[c.jsx("span",{className:"inline-flex h-3.5 w-3.5 items-center justify-center rounded-sm bg-muted-foreground/15 text-2xs font-bold uppercase text-muted-foreground",children:"T"}),c.jsx("span",{className:"max-w-[180px] truncate",children:ke.lineRange?`${ke.name}:${y2(ke.lineRange).replace(/^lines? /,"")}`:ke.name})]},`${ke.terminalId}-${Ce}`):null):he??$}),we.length>0&&c.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:we.map((ke,Ce)=>{const Fe=ke.preview??`data:${ke.mimeType};base64,${ke.data}`;return c.jsxs(Fc,{children:[c.jsx(Yye,{asChild:!0,children:c.jsxs("button",{type:"button",className:"group block overflow-hidden rounded-lg border border-primary/10 bg-background/65 text-left transition-colors hover:border-primary/25 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","aria-label":`Expand image ${ke.name}`,children:[c.jsxs("span",{className:"relative block",children:[c.jsx("img",{src:Fe,alt:ke.name,className:"max-h-72 w-full object-cover transition-opacity group-hover:opacity-85"}),c.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:c.jsx("span",{className:"rounded-full bg-black/65 px-3 py-1.5 text-xs font-medium text-white",children:"Click to expand"})})]}),c.jsx("span",{className:"block truncate border-t border-border/60 px-2 py-1 text-xs text-muted-foreground",children:ke.name})]})}),c.jsxs(Ql,{className:"max-h-[92vh] max-w-[96vw] gap-2 overflow-hidden p-2",showCloseButton:!0,children:[c.jsx(ec,{className:"mr-8 truncate px-1 text-sm font-medium",children:ke.name}),c.jsx("img",{src:Fe,alt:ke.name,className:"max-h-[82vh] w-full object-contain"})]})]},`${ke.name}-${Ce}`)})})]})}),Ie()]}):c.jsxs("div",{className:"relative min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:[c.jsx(sT,{"data-message-from":"assistant",className:"min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:c.jsx(EO,{content:s,compact:_,isStreaming:b,preferLlmUi:k,onOpenPath:A})}),Ve]}):gt?c.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:c.jsx(YF,{})}):null]})]})}),c.jsx(jGe,{open:G,onOpenChange:Q,contextFlow:o,responseContent:s})]})}const AO=y.memo(BGe,(e,r)=>{const{messageFromEnd:n,messageIndex:i,...s}=e,{messageFromEnd:o,messageIndex:a,...l}=r,d=Object.keys(l);return d.length===Object.keys(s).length&&d.every(u=>Object.is(s[u],l[u]))});AO.displayName="Message";function zGe(e){if(!(e!=null&&e.metadata))return{};try{const r=JSON.parse(e.metadata);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function Soe(e){const r=zGe(e),n=r.repositoryId??r.repoId;return typeof n=="string"&&n.trim()?n.trim():null}function XF(e,r){const n=Soe(e);return n?r.find(i=>i.id===n)??null:null}function FGe(e,r){return!e||e==="gateway"?!1:!r.has(e)}function ZF(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function HGe({platform:e}){switch(e){case"windows":case"macos":case"linux":return c.jsx(za,{className:"h-2.5 w-2.5"});case"android":case"ios":return c.jsx(Y4,{className:"h-2.5 w-2.5"});default:return c.jsx(wi,{className:"h-2.5 w-2.5"})}}function WGe({workspaces:e,personalSessions:r=[],activeWorkspaceId:n,activeSessionId:i,loading:s=!1,hasMoreWorkspaces:o=!1,showFewerWorkspaces:a=!1,onSelectWorkspace:l,onSelectPersonalSession:d,onNewPersonalSession:u,onCreateWorkspace:f,onRemoveWorkspace:p,onChangeDirectory:g,onAssignRepository:v,onShowMore:b,onShowFewer:_,sessionInfo:k,nodes:S=[],repositories:C=[]}){const j=y.useMemo(()=>new Set(S.filter($=>!$.isGateway).map($=>$.id)),[S]),[E,T]=y.useState(""),A=E.trim().toLowerCase(),M=y.useMemo(()=>A?e.filter($=>{const D=XF($,C),W=$.nodeId&&$.nodeId!=="gateway"?S.find(H=>H.id===$.nodeId):null;return[$.title,$.rootPath,D==null?void 0:D.name,W==null?void 0:W.name,...$.sessions.flatMap(H=>[H.name,H.workspacePath])].some(H=>H==null?void 0:H.toLowerCase().includes(A))}):e,[S,A,C,e]),z=y.useMemo(()=>A?r.filter($=>[$.name,$.workspacePath].some(D=>D==null?void 0:D.toLowerCase().includes(A))):r,[A,r]);return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"flex h-[35px] shrink-0 items-center gap-2 px-2.5 border-b",children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-md bg-muted/60 px-2 py-1",children:[c.jsx(bl,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsx("input",{type:"search",value:E,onChange:$=>T($.target.value),placeholder:"Search chats and workspaces","aria-label":"Search chats and workspaces",className:"min-w-0 flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground"})]}),c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:f,children:c.jsx(Io,{className:"h-3.5 w-3.5"})})}),c.jsx(fn,{side:"right",children:"New workspace"})]})]}),s?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(er,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex max-h-[50%] min-h-0 shrink-0 flex-col border-b",children:[c.jsx("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:c.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Workspaces"})}),c.jsx(Oh,{className:"min-h-0 flex-1",children:c.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[e.length===0&&c.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No workspaces yet.",c.jsx("br",{}),c.jsx("button",{onClick:f,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Choose workspace folder"})]}),e.length>0&&M.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No matching workspaces."}),M.map($=>{const D=$.id===n,W=$.nodeId&&$.nodeId!=="gateway"?S.find(R=>R.id===$.nodeId):null,U=FGe($.nodeId,j),H=XF($,C);return c.jsxs("div",{className:`group grid w-full grid-cols-[auto,minmax(0,1fr),auto] items-start gap-1.5 px-1.5 py-1.5 text-sm transition-colors ${U||D?"cursor-default":"cursor-pointer"} ${D?"rounded-md bg-secondary/70":U?"opacity-50":"hover:rounded-md hover:bg-muted/40"}`,draggable:!!$.rootPath,onDragStart:R=>{if(!$.rootPath){R.preventDefault();return}R.dataTransfer.effectAllowed="copy",R.dataTransfer.setData(hQ,JSON.stringify(RAe($.rootPath,$.title||void 0)))},onClick:()=>{!U&&!D&&l($.id)},children:[D?c.jsx(Dh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"}):c.jsx(bR,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsxs("div",{className:"min-w-0 overflow-hidden",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[c.jsx("span",{className:"min-w-0 truncate text-xs font-medium",children:$.title||"Untitled Workspace"}),H&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-2xs text-muted-foreground",children:"·"}),c.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-2xs text-muted-foreground",children:[c.jsx(Kf,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"truncate",children:H.name})]})]})]}),c.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden text-2xs text-muted-foreground",children:[c.jsx("span",{className:"min-w-0 truncate",children:$.rootPath||"No folder linked"}),c.jsx("span",{className:"shrink-0",children:"·"}),c.jsx("span",{className:"shrink-0",children:ZF($.lastActiveAt)})]}),U&&c.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-2xs text-orange-500",children:[c.jsx(zye,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"truncate",children:"Node offline"})]}),W&&!U&&c.jsx("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs",children:c.jsxs("span",{className:"inline-flex max-w-full items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-muted-foreground",children:[c.jsx(HGe,{platform:W.platform}),c.jsx("span",{className:"truncate max-w-[80px]",children:W.name})]})}),D&&k&&c.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs text-blue-500",children:[c.jsx("span",{className:"truncate",children:k.provider}),c.jsx("span",{className:"shrink-0 text-muted-foreground",children:"·"}),c.jsx(za,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"truncate",children:k.isRemote&&k.remoteNode?k.remoteNode.nodeName:"Gateway"})]})]}),c.jsxs("div",{className:"flex shrink-0 self-start gap-0.5",children:[v&&c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon","aria-label":H?`Repository: ${H.name}`:"Assign repository",disabled:!$.rootPath,className:`h-5.5 w-5.5 shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100 ${H?"text-primary hover:text-primary":"text-muted-foreground hover:text-foreground"}`,onClick:R=>{R.stopPropagation(),v($.id)},children:c.jsx(Kf,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:H?`Repository: ${H.name}`:"Assign repository"})]}),c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon","aria-label":"Change directory",className:"h-5.5 w-5.5 shrink-0 opacity-100 text-muted-foreground transition-opacity hover:text-foreground sm:opacity-0 sm:group-hover:opacity-100",onClick:R=>{R.stopPropagation(),g($.id)},children:c.jsx(Gge,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:"Change directory"})]}),c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon","aria-label":"Archive workspace",className:"h-5.5 w-5.5 shrink-0 opacity-100 text-muted-foreground transition-opacity hover:text-destructive sm:opacity-0 sm:group-hover:opacity-100",onClick:R=>{R.stopPropagation(),p($.id)},children:c.jsx(VG,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:"Archive workspace"})]})]})]},$.id)}),!A&&o&&b&&c.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:b,children:"Show more workspaces"}),!A&&a&&_&&c.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:_,children:"Show fewer workspaces"})]})})]}),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:[c.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Personal chats"}),u&&c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:u,children:c.jsx(Io,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:"New personal chat"})]})]}),c.jsx(Oh,{className:"min-h-0 flex-1",children:c.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[r.length===0&&c.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No personal chats yet.",u&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsx("button",{onClick:u,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Start a chat"})]})]}),r.length>0&&z.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No matching personal chats."}),z.map($=>{const D=n===null&&$.id===i;return c.jsxs("div",{className:`group flex items-center gap-1.5 rounded-md px-1.5 py-1 transition-colors text-sm ${D?"bg-secondary/70 cursor-default":"cursor-pointer hover:bg-muted/40"}`,onClick:()=>{!D&&d&&d($.id)},children:[c.jsx(Om,{className:`h-3.5 w-3.5 shrink-0 ${D?"text-primary":"text-muted-foreground"}`}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-xs font-medium",children:$.name||"Personal chat"}),c.jsx("div",{className:"text-2xs text-muted-foreground",children:ZF($.lastActiveAt??$.createdAt)})]})]},$.id)})]})})]})]})]})}function UGe(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function VGe({sessions:e,activeSessionId:r,workspaceTitle:n,onSelectSession:i,onNewSession:s,onOpenChange:o,showTitle:a=!0,triggerLabel:l=null}){const[d,u]=y.useState(!1),f=e.find(g=>g.id===r)??e[0]??null,p=g=>{u(g),o==null||o(g)};return c.jsxs("div",{className:a?"flex min-w-0 flex-1 items-center justify-between gap-1.5":"flex items-center gap-1.5",children:[a?c.jsx("span",{className:"min-w-0 truncate text-sm font-semibold leading-tight",children:f!=null&&f.name&&f.name!=="New Chat"?f.name:""}):null,c.jsxs(Au,{open:d,onOpenChange:p,children:[c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Ou,{asChild:!0,children:c.jsxs(Se,{variant:"ghost",size:l?"sm":"icon",className:l?"h-7 shrink-0 rounded-md px-2 text-xs text-muted-foreground hover:text-foreground":"h-6 w-6 shrink-0 rounded-md text-muted-foreground hover:text-foreground",children:[c.jsx(JG,{className:"h-3.5 w-3.5"}),l?c.jsx("span",{children:l}):null]})})}),c.jsx(fn,{side:"bottom",children:l??"Sessions"})]}),c.jsxs(Lc,{align:"start",className:"w-[min(28rem,calc(100vw-1rem))] p-0",children:[c.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-medium",children:"Sessions"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:n||"Current workspace"})]}),c.jsxs(Se,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>{s(),u(!1)},children:[c.jsx(N0e,{className:"mr-1 h-3 w-3"}),"New chat"]})]}),c.jsx("div",{className:"max-h-[min(28rem,70vh)] overflow-y-auto p-2",children:e.length===0?c.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No sessions yet."}):c.jsx("div",{className:"space-y-0.5",children:e.map(g=>{const v=g.id===r;return c.jsxs("button",{type:"button",className:`flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors ${v?"bg-secondary text-secondary-foreground":"hover:bg-muted/50"}`,onClick:()=>{i(g.id),u(!1)},children:[v?c.jsx(ys,{className:"mt-0.5 h-3 w-3 shrink-0 text-primary"}):c.jsx("span",{className:"mt-1 h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"truncate text-xs font-medium",children:g.name||"Untitled"}),g.status==="archived"&&c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-1.5 py-0 text-2xs text-muted-foreground",children:[c.jsx(VG,{className:"h-2.5 w-2.5"}),"Archived"]})]}),c.jsx("div",{className:"text-2xs text-muted-foreground",children:UGe(g.lastActiveAt)})]})]},g.id)})})})]})]})]})}function qGe({suggestions:e,onSelect:r,className:n}){return c.jsx("div",{className:Le("flex flex-wrap gap-2 justify-center",n),children:e.map(i=>c.jsx("button",{onClick:()=>r(i),className:"px-4 py-2 text-sm rounded-full border bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:i},i))})}const GGe=H4("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium leading-4 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400"}},defaultVariants:{variant:"default"}});function pn({className:e,variant:r,...n}){return c.jsx("div",{className:Le(GGe({variant:r}),e),...n})}const $n=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("rounded-xl border border-border/70 bg-card text-card-foreground shadow-sm",e),...r}));$n.displayName="Card";const koe=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("flex flex-col space-y-1.5 p-6",e),...r}));koe.displayName="CardHeader";const Coe=y.forwardRef(({className:e,...r},n)=>c.jsx("h3",{ref:n,className:Le("font-semibold leading-none tracking-tight",e),...r}));Coe.displayName="CardTitle";const KGe=y.forwardRef(({className:e,...r},n)=>c.jsx("p",{ref:n,className:Le("text-sm text-muted-foreground",e),...r}));KGe.displayName="CardDescription";const joe=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("p-6 pt-0",e),...r}));joe.displayName="CardContent";const YGe=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("flex items-center p-6 pt-0",e),...r}));YGe.displayName="CardFooter";const XGe={pending:{icon:ng,label:"Pending",color:"text-muted-foreground"},approved:{icon:er,label:"Running",color:"text-blue-500"},rejected:{icon:ni,label:"Rejected",color:"text-destructive"},executed:{icon:_l,label:"Done",color:"text-green-500"},failed:{icon:Ba,label:"Failed",color:"text-destructive"}};function ZGe({action:e,expanded:r,onToggle:n}){const i=XGe[e.status],s=i.icon;return c.jsxs("div",{className:"border rounded-md",children:[c.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full px-3 py-2.5 text-left hover:bg-muted/50 transition-colors",onClick:n,children:[c.jsx(s,{className:Le("h-4 w-4 shrink-0",i.color,e.status==="approved"&&"animate-spin")}),c.jsxs("span",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"font-mono text-sm font-medium",children:e.tool}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["Step ",e.order+1]})]}),c.jsx(pn,{variant:"outline",className:"text-2xs px-1.5 py-0",children:i.label}),r?c.jsx(kl,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(Js,{className:"h-4 w-4 text-muted-foreground"})]}),r&&c.jsxs("div",{className:"px-3 pb-3 pt-1 border-t bg-muted/30",children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),c.jsx("pre",{className:"text-xs bg-background rounded p-2 overflow-x-auto max-h-48",children:JSON.stringify(e.args,null,2)}),e.result&&c.jsx("div",{className:Le("mt-2 text-xs rounded p-2",e.result.ok?"bg-green-500/10 text-green-700 dark:text-green-400":"bg-destructive/10 text-destructive"),children:e.result.message})]})]})}function JGe({plan:e,onApprove:r,onReject:n,isExecuting:i,className:s}){const[o,a]=y.useState(new Set),l=g=>{a(v=>{const b=new Set(v);return b.has(g)?b.delete(g):b.add(g),b})},d=e.actions.filter(g=>g.status==="pending").length,u=e.actions.filter(g=>g.status==="executed").length,f=e.actions.filter(g=>g.status==="failed").length,p=d===0;return c.jsxs($n,{className:Le("p-4 space-y-3",s),children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[c.jsx(QGe,{className:"h-4 w-4"}),"Plan",c.jsxs(pn,{variant:"secondary",className:"text-2xs px-1.5 py-0",children:[e.actions.length," step",e.actions.length!==1?"s":""]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.summary})]}),p&&c.jsx(pn,{variant:f>0?"destructive":"success",className:"shrink-0",children:f>0?`${f} failed`:"Complete"})]}),c.jsx("div",{className:"space-y-1.5",children:e.actions.map(g=>c.jsx(ZGe,{action:g,expanded:o.has(g.id),onToggle:()=>l(g.id)},g.id))}),d>0&&c.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[c.jsx(Se,{size:"sm",onClick:()=>r(),disabled:i,children:i?c.jsxs(c.Fragment,{children:[c.jsx(er,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Executing..."]}):c.jsxs(c.Fragment,{children:[c.jsx(G4,{className:"h-3.5 w-3.5 mr-1.5"}),"Execute all (",d,")"]})}),c.jsxs(Se,{size:"sm",variant:"outline",onClick:n,disabled:i,children:[c.jsx(ni,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]}),p&&!i&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:[u>0&&`${u} action${u!==1?"s":""} executed.`,f>0&&` ${f} failed.`]})]})}function QGe({className:e}){return c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[c.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),c.jsx("path",{d:"M12 11h4"}),c.jsx("path",{d:"M12 16h4"}),c.jsx("path",{d:"M8 11h.01"}),c.jsx("path",{d:"M8 16h.01"})]})}function eKe(e){return e.find(r=>r.status==="in-progress")??null}function Noe(e){return e.length>0&&e.every(r=>r.status==="completed")}function tKe(e){const r=eKe(e),n=Noe(e);return{headerLabel:r?r.title:n?"All tasks completed":"Tasks",showHeaderSpinner:!!r,showHeaderCompleted:!r&&n}}function QT({items:e,className:r,onClear:n}){const[i,s]=y.useState(!1),o=y.useMemo(()=>Noe(e),[e]),a=y.useMemo(()=>tKe(e),[e]);if(e.length===0)return null;const l=e.filter(g=>g.status==="completed").length,d=e.length,u=d>0?Math.round(l/d*100):0,f=i?"Tasks":a.headerLabel,p=o?"bg-green-500":"bg-primary";return c.jsxs("div",{className:Le("rounded-lg border bg-muted/30 p-3 space-y-2",r),children:[c.jsxs("button",{type:"button",onClick:()=>s(g=>!g),className:"flex items-center gap-2 w-full text-left",children:[c.jsx(kl,{className:Le("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-200",!i&&"-rotate-90")}),!i&&a.showHeaderSpinner&&c.jsx(er,{className:"h-3.5 w-3.5 shrink-0 text-primary animate-spin"}),!i&&a.showHeaderCompleted&&c.jsx(_l,{className:"h-3.5 w-3.5 shrink-0 text-green-500"}),c.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-foreground",children:f}),c.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:c.jsx("div",{className:Le("h-full rounded-full transition-all duration-300",p),style:{width:`${u}%`}})}),c.jsxs("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[l,"/",d]}),n&&c.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),n()},className:"shrink-0 p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:"Clear todo list",children:c.jsx(ni,{className:"h-3 w-3"})})]}),i&&c.jsx("div",{className:"space-y-1",children:e.map(g=>c.jsxs("div",{className:Le("flex items-start gap-2 text-xs py-0.5",g.status==="completed"&&"text-muted-foreground"),children:[g.status==="completed"?c.jsx(_l,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-green-500"}):g.status==="in-progress"?c.jsx(er,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary animate-spin"}):c.jsx(yge,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-muted-foreground/50"}),c.jsx("span",{className:Le("flex-1 min-w-0",g.status==="completed"&&"line-through"),children:g.title})]},g.id))})]})}function rKe({files:e,onAccept:r,onReject:n,onAcceptAll:i,onRejectAll:s,onFileClick:o,className:a}){const l=y.useRef(null),[d,u]=y.useState(!1),[f,p]=y.useState(!1);if(y.useEffect(()=>{const C=l.current;if(!C||typeof ResizeObserver>"u")return;const j=()=>{u(C.clientWidth<560)};j();const E=new ResizeObserver(()=>j());return E.observe(C),()=>E.disconnect()},[]),e.length===0)return null;const g=e.filter(C=>C.state==="undecided").length,v=e.reduce((C,j)=>C+(j.insertions??0),0),b=e.reduce((C,j)=>C+(j.deletions??0),0),_=e.some(C=>C.insertions!==void 0||C.deletions!==void 0),k=_?null:`${e.length} ${e.length===1?"file":"files"}`,S=({insertions:C,deletions:j})=>c.jsxs("span",{className:"shrink-0 whitespace-nowrap text-2xs tabular-nums",children:[c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["+",C]}),c.jsxs("span",{className:"ml-1 text-red-600 dark:text-red-400",children:["-",j]})]});return c.jsxs("div",{ref:l,className:Le("overflow-hidden rounded-lg border bg-muted/30",a),children:[c.jsxs("div",{className:Le("flex items-center justify-between gap-2 bg-muted/20 px-3 py-2",f&&"border-b"),children:[c.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-1.5 text-left",onClick:()=>p(C=>!C),"aria-expanded":f,children:[c.jsx(Js,{className:Le("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",f&&"rotate-90")}),c.jsx(Gl,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"truncate text-xs font-medium",children:f?`Files changed (${e.length})`:"Files changed"}),!f&&_&&c.jsx(S,{insertions:v,deletions:b}),!f&&k&&c.jsx("span",{className:"shrink-0 whitespace-nowrap text-2xs tabular-nums text-muted-foreground",children:k}),f&&g>0&&c.jsxs("span",{className:"shrink-0 text-2xs text-amber-500 dark:text-amber-400",children:[g," pending"]})]}),f&&g>0&&c.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[c.jsxs(Se,{size:d?"icon":"sm",variant:"ghost",className:Le("h-6 shrink-0 text-xs",d?"w-6 p-0":"px-2"),onClick:i,title:"Keep all","aria-label":"Keep all",children:[c.jsx(ys,{className:Le("h-3 w-3 shrink-0",!d&&"mr-1")}),!d&&"Keep all"]}),c.jsxs(Se,{size:d?"icon":"sm",variant:"ghost",className:Le("h-6 shrink-0 text-xs",d?"w-6 p-0":"px-2"),onClick:s,title:"Undo all","aria-label":"Undo all",children:[c.jsx(Mh,{className:Le("h-3 w-3 shrink-0",!d&&"mr-1")}),!d&&"Undo all"]})]})]}),f&&c.jsx("div",{className:"divide-y",children:e.map(C=>c.jsxs("div",{className:Le("flex items-center gap-2 px-3 py-1.5 text-xs",C.state==="accepted"&&"bg-green-500/5",C.state==="rejected"&&"bg-red-500/5 text-muted-foreground"),children:[c.jsx(Ro,{filename:C.name,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("button",{type:"button",className:Le("min-w-0 flex-1 truncate text-left hover:underline cursor-pointer",C.state==="rejected"&&"line-through"),title:`Review diff for ${C.path}`,onClick:()=>o==null?void 0:o(C.path),children:C.path}),_&&c.jsx(S,{insertions:C.insertions??0,deletions:C.deletions??0}),C.state==="undecided"&&c.jsxs("div",{className:"ml-auto flex items-center gap-0.5 shrink-0",children:[c.jsx("button",{type:"button",className:"p-1 rounded hover:bg-primary/10 text-primary transition-colors",onClick:()=>o==null?void 0:o(C.path),title:"Review changes",children:c.jsx(np,{className:"h-3 w-3"})}),c.jsx("button",{type:"button",className:"p-1 rounded hover:bg-green-500/20 text-green-600 dark:text-green-400 transition-colors",onClick:()=>r==null?void 0:r(C.path),title:"Keep all changes",children:c.jsx(ys,{className:"h-3 w-3"})}),c.jsx("button",{type:"button",className:"p-1 rounded hover:bg-red-500/20 text-red-600 dark:text-red-400 transition-colors",onClick:()=>n==null?void 0:n(C.path),title:"Undo all changes",children:c.jsx(Mh,{className:"h-3 w-3"})})]}),C.state==="accepted"&&c.jsx("span",{className:"text-2xs text-green-600 dark:text-green-400 shrink-0",children:"Kept"}),C.state==="rejected"&&c.jsx("span",{className:"text-2xs text-red-500 shrink-0",children:"Undone"})]},C.path))})]})}function nKe(e,r,n,i){const s=e.findIndex(d=>d.id===r);if(s<0)return e;const o=[...e],[a]=o.splice(s,1);if(!a)return e;if(n==null)return o.push(a),o;const l=o.findIndex(d=>d.id===n);return l<0?e:(o.splice(l+(i==="after"?1:0),0,a),o)}function iKe({item:e,index:r}){return c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background px-3 py-2 text-sm shadow-2xl ring-1 ring-primary/10",children:[c.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:r===0?c.jsx(_R,{className:"h-3.5 w-3.5 text-primary"}):c.jsx(Js,{className:"h-3.5 w-3.5 text-muted-foreground"})}),c.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:c.jsx(ZG,{className:"h-3.5 w-3.5"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[r===0?c.jsx("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-primary/70",children:"Next"}):c.jsxs("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:["Queued #",r+1]}),c.jsx("span",{className:"whitespace-pre-wrap break-words text-foreground",children:e.displayContent??e.content})]})]})}function sKe({item:e,index:r,onRemove:n,onEdit:i,onReorder:s,onSendToParallelThread:o,dragActive:a,dropBefore:l,dropAfter:d,onDragStart:u}){const[f,p]=y.useState(!1),[g,v]=y.useState(!0),[b,_]=y.useState(e.displayContent??e.content),k=y.useRef(null),S=f||!a;y.useEffect(()=>{if(f){const T=k.current;T&&(T.focus(),T.setSelectionRange(T.value.length,T.value.length))}},[f]),y.useEffect(()=>{f||_(e.displayContent??e.content)},[e.content,e.displayContent,f]);const C=y.useCallback(()=>{const T=b.trim(),A=e.displayContent??e.content;T&&T!==A&&(i==null||i(e.id,T)),p(!1)},[b,e.content,e.displayContent,e.id,i]),j=y.useCallback(()=>{_(e.displayContent??e.content),p(!1)},[e.content,e.displayContent]),E=y.useCallback(T=>{T.key==="Enter"&&!T.shiftKey?(T.preventDefault(),C()):T.key==="Escape"&&j()},[C,j]);return c.jsxs(c.Fragment,{children:[l&&c.jsx("div",{className:"relative h-0",children:c.jsx("div",{className:"absolute inset-x-2 -top-px h-0.5 rounded-full bg-primary shadow-[0_0_0_1px_hsl(var(--background))]"})}),c.jsxs("div",{"data-queue-id":e.id,className:Le("group flex cursor-grab touch-none items-start gap-2 rounded-lg border border-border/40 bg-muted/50 px-3 py-2 text-sm transition-all duration-150 ease-out hover:bg-muted/70 active:cursor-grabbing",a&&"border-dashed border-primary/35 bg-primary/5 opacity-0"),onPointerDown:T=>{f||!s||T.target.closest('button, textarea, input, a, [data-no-drag="true"]')||u==null||u(e.id,T)},children:[c.jsx("button",{type:"button","data-no-drag":"true",className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground hover:bg-foreground/10 hover:text-foreground transition-colors",onClick:()=>v(T=>!T),"aria-label":g?"Expand queued message":"Collapse queued message",title:g?"Expand queued message":"Collapse queued message",children:g?c.jsx(Js,{className:"h-3.5 w-3.5"}):r===0?c.jsx(_R,{className:"h-3.5 w-3.5 text-primary"}):c.jsx(kl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s&&!f&&c.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground cursor-grab active:cursor-grabbing touch-none",title:"Drag to reorder","aria-label":"Drag to reorder",children:c.jsx(ZG,{className:"h-3.5 w-3.5"})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[r===0&&!f&&c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-primary/70 block mb-0.5",children:"Next"}),r>0&&!f&&c.jsxs("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground block mb-0.5",children:["Queued #",r+1]}),f?c.jsx("textarea",{ref:k,value:b,onChange:T=>_(T.target.value),onKeyDown:E,onBlur:C,rows:Math.min(b.split(`
|
|
1159
|
+
`).trim()},$e=async()=>{const ke=Je();if(!ke)return;const Ce=z?CJ(D):null;try{Ce&&typeof ClipboardItem<"u"&&navigator.clipboard.write?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([ke],{type:"text/plain"}),[v5]:new Blob([Ce],{type:v5})})]):await navigator.clipboard.writeText(ke)}catch{const Fe=document.createElement("textarea");Fe.value=ke,Fe.style.position="fixed",Fe.style.opacity="0",document.body.appendChild(Fe),Fe.focus(),Fe.select(),document.execCommand("copy"),document.body.removeChild(Fe)}U(!0),et.current!==null&&window.clearTimeout(et.current),et.current=window.setTimeout(()=>U(!1),1200)},Ne=z&&!!e&&!!E,Xe=Ne,gt=b&&!f&&!(typeof s=="string"?s:"").trim(),zt=z||!b,Mt=y.useCallback(()=>{!Ne||X||(ee($),le(D),L(!0))},[Ne,X,D,$]),Wt=y.useCallback(()=>{ee($),le(D),L(!1)},[D,$]),nr=()=>{var Ce;!Ne||B||typeof window<"u"&&(Ce=window.getSelection())!=null&&Ce.toString().trim()||Mt()},ar=y.useCallback(async(ke,Ce)=>{if(!Ne||!e||!E||X)return;const Fe=OTe(ke??V,Ce??ie,D);if(Fe){re(Fe.text),fe(Fe.displaySegments),L(!1),F(!0);try{await E(e,Fe.text,r,n,{referencedFiles:Fe.referencedFiles,displaySegments:Fe.displaySegments})}catch(wt){throw re(null),fe(null),L(!0),wt}finally{F(!1)}}},[Ne,V,ie,X,e,n,r,E]),Me=async(ke,Ce)=>{if(!Ne||!e||!E)return;const Fe=ke.trim();Fe&&await E(e,Fe,r,n,{referencedFiles:(Ce??D).filter(wt=>wt.type==="file").map(wt=>({path:wt.path,name:wt.name})),displaySegments:Ce??D})},ve=async()=>{if(Xe){R(!0);try{await Me($,D)}finally{R(!1)}}},Ie=ke=>B||!zt||!s?null:c.jsx("div",{className:Le("absolute z-10 rounded-full border border-border/70 bg-background p-1","right-1 bottom-[.25rem]","opacity-0 transition-opacity group-hover/message:opacity-100 focus-within:opacity-100","touch-device:opacity-80",W&&"opacity-100"),children:c.jsxs(oTe,{children:[Ne?c.jsx(dC,{onClick:Mt,"aria-label":"Edit message",tooltip:"Edit message",className:"h-6 w-6",children:c.jsx(kR,{className:"h-3.5 w-3.5"})}):null,Xe?c.jsx(dC,{onClick:Ce=>{Ce.preventDefault(),Ce.stopPropagation(),ve()},disabled:H,"aria-label":"Retry from this message",tooltip:"Retry from this message",className:"h-6 w-6",children:c.jsx(iK,{className:Le("h-3.5 w-3.5",H&&"animate-spin")})}):null,!z&&o?c.jsx(dC,{onClick:Ce=>{Ce.preventDefault(),Ce.stopPropagation(),Q(!0)},"aria-label":"View LLM context",tooltip:"View LLM context",className:"h-6 w-6",children:c.jsx(Ah,{className:"h-3.5 w-3.5"})}):null,c.jsx(dC,{onClick:$e,"aria-label":W?"Copied":"Copy message",tooltip:W?"Copied":"Copy message",className:"h-6 w-6",children:W?c.jsx(ys,{className:"h-3.5 w-3.5"}):c.jsx(Rc,{className:"h-3.5 w-3.5"})})]})}),Ve=z?null:Ie(),nt=!z&&(v==null?void 0:v.some(ke=>ke.type==="thinking"&&ke.content.trim()));return c.jsxs(c.Fragment,{children:[c.jsx(sTe,{from:i,className:Le(_?"py-2":"py-4"),children:c.jsxs("div",{className:Le("min-w-0 max-w-[85%] space-y-2",z&&"order-1"),children:[!z&&f&&!nt&&c.jsx(WI,{content:f,isStreaming:!!b&&!s,duration:p}),!z&&v&&v.length>0?c.jsxs("div",{className:"relative min-w-0 max-w-full select-text break-words [overflow-wrap:anywhere]",children:[v.map((ke,Ce)=>{if(ke.type==="toolGroup"){const Fe=(g??[]).filter(Be=>ke.callIds.includes(Be.callId)),wt=v.slice(Ce+1).some(Be=>Be.type==="text"&&typeof Be.content=="string"&&Be.content.trim());return Fe.length>0?GF(S,Fe)?c.jsx(NO,{provider:S,calls:Fe,isStreaming:!!b&&Ce===v.length-1,onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j},`tg-${Ce}`):c.jsx(jO,{calls:Fe,collapsible:wt,onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j},`tg-${Ce}`):null}return ke.type==="thinking"?ke.content.trim()?c.jsx(WI,{content:ke.content,isStreaming:!!b&&Ce===v.length-1,duration:p},`th-${Ce}`):null:typeof ke.content=="string"&&ke.content.trim()?c.jsx(sT,{"data-message-from":"assistant",className:"max-w-full bg-card/78",children:c.jsx(EO,{content:ke.content,compact:_,isStreaming:!!b&&Ce===v.length-1,preferLlmUi:k,onOpenPath:A})},`ts-${Ce}`):null}),b&&!s&&!v.some(ke=>ke.type==="text"&&typeof ke.content=="string"&&ke.content.trim())&&c.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:c.jsx(YF,{})}),Ve]}):c.jsxs(c.Fragment,{children:[g&&g.length>0&&(GF(S,g)?c.jsx(NO,{provider:S,calls:g,isStreaming:b,onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j}):c.jsx(jO,{calls:g,collapsible:S!=="jait",onOpenTerminal:C,onOpenDiff:M,renderInlineSecretPrompt:j})),pe||s?z?B?c.jsx("div",{className:"w-full max-w-3xl",onClick:ke=>ke.stopPropagation(),children:c.jsx("div",{className:Le("space-y-3 origin-bottom transition-all duration-150 ease-out",I?"translate-y-0 opacity-100":"translate-y-2 opacity-0"),children:c.jsx(s_,{ref:rt,draftStateKey:`edit:${e??"user-message"}`,value:V,segments:ie,onChange:ke=>{var Ce;ee(ke),le(((Ce=rt.current)==null?void 0:Ce.getSegments())??[])},onSubmit:(ke,Ce,Fe)=>{const wt=Fe??[],Be=uv(wt)||V;le(wt),ar(Be,wt)},disabled:X,controlsDisabled:X,placeholder:"Edit message...",onVoiceInput:T==null?void 0:T.onVoiceInput,voiceRecording:T==null?void 0:T.voiceRecording,voiceLevels:T==null?void 0:T.voiceLevels,voiceTranscribing:T==null?void 0:T.voiceTranscribing,onVoiceStop:T==null?void 0:T.onVoiceStop,mode:T==null?void 0:T.mode,onModeChange:T==null?void 0:T.onModeChange,provider:T==null?void 0:T.provider,onProviderChange:T==null?void 0:T.onProviderChange,responseStyle:T==null?void 0:T.responseStyle,onResponseStyleChange:T==null?void 0:T.onResponseStyleChange,providerRuntimeMode:T==null?void 0:T.providerRuntimeMode,onProviderRuntimeModeChange:T==null?void 0:T.onProviderRuntimeModeChange,cliModel:T==null?void 0:T.cliModel,onCliModelChange:T==null?void 0:T.onCliModelChange,sessionInfo:T==null?void 0:T.sessionInfo,workspaceNodeId:T==null?void 0:T.workspaceNodeId,availableFiles:(T==null?void 0:T.availableFiles)??dv(D),onSearchFiles:T==null?void 0:T.onSearchFiles,workspaceOpen:(T==null?void 0:T.workspaceOpen)??dv(D).length>0,footerTrailingContent:c.jsx(Se,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-lg",onClick:Wt,disabled:X,"aria-label":"Cancel editing message",title:"Cancel editing",children:c.jsx(ni,{className:"h-3.5 w-3.5"})}),className:"rounded-lg border-primary/20 bg-primary/[0.08] dark:!bg-primary/[0.08] shadow-none [&_.text-muted-foreground]:text-muted-foreground [&>div]:!bg-transparent [&_[contenteditable='true']]:!bg-transparent"},`edit-${e??"user-message"}`)})}):c.jsxs("div",{className:"relative w-fit max-w-full",children:[c.jsx(sT,{ref:ae,"data-message-from":"user",className:Le("min-w-0 rounded-lg bg-muted px-4 py-3 break-words [overflow-wrap:anywhere]",Ne&&!B&&"cursor-text transition-colors hover:bg-muted/80","leading-relaxed [font-size:0.9rem]"),onClick:nr,title:Ne&&!B?"Click to edit message":void 0,children:c.jsxs("div",{className:"min-w-0 space-y-3",children:[c.jsx("div",{className:"min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:(ne??D).length>0?(ne??D).map((ke,Ce)=>ke.type==="text"?c.jsx("span",{children:ke.text},`text-${Ce}`):ke.type==="file"?c.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:ke.path,children:[c.jsx(Ro,{filename:ke.name,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"max-w-[180px] truncate",children:ke.lineRange?`${ke.name}:${y2(ke.lineRange).replace(/^lines? /,"")}`:ke.name})]},`${ke.path}-${Ce}`):ke.type==="workspace"?c.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:ke.path,children:[c.jsx(jj,{name:ke.name,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"max-w-[180px] truncate",children:ke.name})]},`${ke.path}-${Ce}`):ke.type==="terminal"?c.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:ke.workspaceRoot?`${ke.terminalId} · ${ke.workspaceRoot}`:ke.terminalId,children:[c.jsx("span",{className:"inline-flex h-3.5 w-3.5 items-center justify-center rounded-sm bg-muted-foreground/15 text-2xs font-bold uppercase text-muted-foreground",children:"T"}),c.jsx("span",{className:"max-w-[180px] truncate",children:ke.lineRange?`${ke.name}:${y2(ke.lineRange).replace(/^lines? /,"")}`:ke.name})]},`${ke.terminalId}-${Ce}`):null):he??$}),we.length>0&&c.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:we.map((ke,Ce)=>{const Fe=ke.preview??`data:${ke.mimeType};base64,${ke.data}`;return c.jsxs(Fc,{children:[c.jsx(Yye,{asChild:!0,children:c.jsxs("button",{type:"button",className:"group block overflow-hidden rounded-lg border border-primary/10 bg-background/65 text-left transition-colors hover:border-primary/25 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","aria-label":`Expand image ${ke.name}`,children:[c.jsxs("span",{className:"relative block",children:[c.jsx("img",{src:Fe,alt:ke.name,className:"max-h-72 w-full object-cover transition-opacity group-hover:opacity-85"}),c.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:c.jsx("span",{className:"rounded-full bg-black/65 px-3 py-1.5 text-xs font-medium text-white",children:"Click to expand"})})]}),c.jsx("span",{className:"block truncate border-t border-border/60 px-2 py-1 text-xs text-muted-foreground",children:ke.name})]})}),c.jsxs(Ql,{className:"max-h-[92vh] max-w-[96vw] gap-2 overflow-hidden p-2",showCloseButton:!0,children:[c.jsx(ec,{className:"mr-8 truncate px-1 text-sm font-medium",children:ke.name}),c.jsx("img",{src:Fe,alt:ke.name,className:"max-h-[82vh] w-full object-contain"})]})]},`${ke.name}-${Ce}`)})})]})}),Ie()]}):c.jsxs("div",{className:"relative min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:[c.jsx(sT,{"data-message-from":"assistant",className:"min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:c.jsx(EO,{content:s,compact:_,isStreaming:b,preferLlmUi:k,onOpenPath:A})}),Ve]}):gt?c.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:c.jsx(YF,{})}):null]})]})}),c.jsx(jGe,{open:G,onOpenChange:Q,contextFlow:o,responseContent:s})]})}const AO=y.memo(BGe,(e,r)=>{const{messageFromEnd:n,messageIndex:i,...s}=e,{messageFromEnd:o,messageIndex:a,...l}=r,d=Object.keys(l);return d.length===Object.keys(s).length&&d.every(u=>Object.is(s[u],l[u]))});AO.displayName="Message";function zGe(e){if(!(e!=null&&e.metadata))return{};try{const r=JSON.parse(e.metadata);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function Soe(e){const r=zGe(e),n=r.repositoryId??r.repoId;return typeof n=="string"&&n.trim()?n.trim():null}function XF(e,r){const n=Soe(e);return n?r.find(i=>i.id===n)??null:null}function FGe(e,r){return!e||e==="gateway"?!1:!r.has(e)}function ZF(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function HGe({platform:e}){switch(e){case"windows":case"macos":case"linux":return c.jsx(za,{className:"h-2.5 w-2.5"});case"android":case"ios":return c.jsx(Y4,{className:"h-2.5 w-2.5"});default:return c.jsx(wi,{className:"h-2.5 w-2.5"})}}function WGe({workspaces:e,personalSessions:r=[],activeWorkspaceId:n,activeSessionId:i,loading:s=!1,hasMoreWorkspaces:o=!1,showFewerWorkspaces:a=!1,onSelectWorkspace:l,onSelectPersonalSession:d,onNewPersonalSession:u,onCreateWorkspace:f,onRemoveWorkspace:p,onChangeDirectory:g,onAssignRepository:v,onShowMore:b,onShowFewer:_,sessionInfo:k,nodes:S=[],repositories:C=[]}){const j=y.useMemo(()=>new Set(S.filter($=>!$.isGateway).map($=>$.id)),[S]),[E,T]=y.useState(""),A=E.trim().toLowerCase(),M=y.useMemo(()=>A?e.filter($=>{const D=XF($,C),W=$.nodeId&&$.nodeId!=="gateway"?S.find(H=>H.id===$.nodeId):null;return[$.title,$.rootPath,D==null?void 0:D.name,W==null?void 0:W.name,...$.sessions.flatMap(H=>[H.name,H.workspacePath])].some(H=>H==null?void 0:H.toLowerCase().includes(A))}):e,[S,A,C,e]),z=y.useMemo(()=>A?r.filter($=>[$.name,$.workspacePath].some(D=>D==null?void 0:D.toLowerCase().includes(A))):r,[A,r]);return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"flex h-[35px] shrink-0 items-center gap-2 px-2.5 border-b",children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-md bg-muted/60 px-2 py-1",children:[c.jsx(bl,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsx("input",{type:"search",value:E,onChange:$=>T($.target.value),placeholder:"Search chats and workspaces","aria-label":"Search chats and workspaces",className:"min-w-0 flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground"})]}),c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:f,children:c.jsx(Io,{className:"h-3.5 w-3.5"})})}),c.jsx(fn,{side:"right",children:"New workspace"})]})]}),s?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(er,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex max-h-[50%] min-h-0 shrink-0 flex-col border-b",children:[c.jsx("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:c.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Workspaces"})}),c.jsx(Oh,{className:"min-h-0 flex-1",children:c.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[e.length===0&&c.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No workspaces yet.",c.jsx("br",{}),c.jsx("button",{onClick:f,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Choose workspace folder"})]}),e.length>0&&M.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No matching workspaces."}),M.map($=>{const D=$.id===n,W=$.nodeId&&$.nodeId!=="gateway"?S.find(R=>R.id===$.nodeId):null,U=FGe($.nodeId,j),H=XF($,C);return c.jsxs("div",{className:`group grid w-full grid-cols-[auto,minmax(0,1fr),auto] items-start gap-1.5 px-1.5 py-1.5 text-sm transition-colors ${U||D?"cursor-default":"cursor-pointer"} ${D?"rounded-md bg-secondary/70":U?"opacity-50":"hover:rounded-md hover:bg-muted/40"}`,draggable:!!$.rootPath,onDragStart:R=>{if(!$.rootPath){R.preventDefault();return}R.dataTransfer.effectAllowed="copy",R.dataTransfer.setData(hQ,JSON.stringify(RAe($.rootPath,$.title||void 0)))},onClick:()=>{!U&&!D&&l($.id)},children:[D?c.jsx(Dh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"}):c.jsx(bR,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsxs("div",{className:"min-w-0 overflow-hidden",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[c.jsx("span",{className:"min-w-0 truncate text-xs font-medium",children:$.title||"Untitled Workspace"}),H&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-2xs text-muted-foreground",children:"·"}),c.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-2xs text-muted-foreground",children:[c.jsx(Kf,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"truncate",children:H.name})]})]})]}),c.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden text-2xs text-muted-foreground",children:[c.jsx("span",{className:"min-w-0 truncate",children:$.rootPath||"No folder linked"}),c.jsx("span",{className:"shrink-0",children:"·"}),c.jsx("span",{className:"shrink-0",children:ZF($.lastActiveAt)})]}),U&&c.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-2xs text-orange-500",children:[c.jsx(zye,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"truncate",children:"Node offline"})]}),W&&!U&&c.jsx("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs",children:c.jsxs("span",{className:"inline-flex max-w-full items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-muted-foreground",children:[c.jsx(HGe,{platform:W.platform}),c.jsx("span",{className:"truncate max-w-[80px]",children:W.name})]})}),D&&k&&c.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs text-blue-500",children:[c.jsx("span",{className:"truncate",children:k.provider}),c.jsx("span",{className:"shrink-0 text-muted-foreground",children:"·"}),c.jsx(za,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"truncate",children:k.isRemote&&k.remoteNode?k.remoteNode.nodeName:"Gateway"})]})]}),c.jsxs("div",{className:"flex shrink-0 self-start gap-0.5",children:[v&&c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon","aria-label":H?`Repository: ${H.name}`:"Assign repository",disabled:!$.rootPath,className:`h-5.5 w-5.5 shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100 ${H?"text-primary hover:text-primary":"text-muted-foreground hover:text-foreground"}`,onClick:R=>{R.stopPropagation(),v($.id)},children:c.jsx(Kf,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:H?`Repository: ${H.name}`:"Assign repository"})]}),c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon","aria-label":"Change directory",className:"h-5.5 w-5.5 shrink-0 opacity-100 text-muted-foreground transition-opacity hover:text-foreground sm:opacity-0 sm:group-hover:opacity-100",onClick:R=>{R.stopPropagation(),g($.id)},children:c.jsx(Gge,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:"Change directory"})]}),c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon","aria-label":"Archive workspace",className:"h-5.5 w-5.5 shrink-0 opacity-100 text-muted-foreground transition-opacity hover:text-destructive sm:opacity-0 sm:group-hover:opacity-100",onClick:R=>{R.stopPropagation(),p($.id)},children:c.jsx(VG,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:"Archive workspace"})]})]})]},$.id)}),!A&&o&&b&&c.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:b,children:"Show more workspaces"}),!A&&a&&_&&c.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:_,children:"Show fewer workspaces"})]})})]}),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:[c.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Personal chats"}),u&&c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:u,children:c.jsx(Io,{className:"h-3 w-3"})})}),c.jsx(fn,{side:"right",children:"New personal chat"})]})]}),c.jsx(Oh,{className:"min-h-0 flex-1",children:c.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[r.length===0&&c.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No personal chats yet.",u&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsx("button",{onClick:u,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Start a chat"})]})]}),r.length>0&&z.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No matching personal chats."}),z.map($=>{const D=n===null&&$.id===i;return c.jsxs("div",{className:`group flex items-center gap-1.5 rounded-md px-1.5 py-1 transition-colors text-sm ${D?"bg-secondary/70 cursor-default":"cursor-pointer hover:bg-muted/40"}`,onClick:()=>{!D&&d&&d($.id)},children:[c.jsx(Om,{className:`h-3.5 w-3.5 shrink-0 ${D?"text-primary":"text-muted-foreground"}`}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-xs font-medium",children:$.name||"Personal chat"}),c.jsx("div",{className:"text-2xs text-muted-foreground",children:ZF($.lastActiveAt??$.createdAt)})]})]},$.id)})]})})]})]})]})}function UGe(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function VGe({sessions:e,activeSessionId:r,workspaceTitle:n,onSelectSession:i,onNewSession:s,onOpenChange:o,showTitle:a=!0,triggerLabel:l=null}){const[d,u]=y.useState(!1),f=e.find(g=>g.id===r)??e[0]??null,p=g=>{u(g),o==null||o(g)};return c.jsxs("div",{className:a?"flex min-w-0 flex-1 items-center justify-between gap-1.5":"flex items-center gap-1.5",children:[a?c.jsx("span",{className:"min-w-0 truncate text-sm font-semibold leading-tight",children:f!=null&&f.name&&f.name!=="New Chat"?f.name:""}):null,c.jsxs(Au,{open:d,onOpenChange:p,children:[c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsx(Ou,{asChild:!0,children:c.jsxs(Se,{variant:"ghost",size:l?"sm":"icon",className:l?"h-7 shrink-0 rounded-md px-2 text-xs text-muted-foreground hover:text-foreground":"h-6 w-6 shrink-0 rounded-md text-muted-foreground hover:text-foreground",children:[c.jsx(JG,{className:"h-3.5 w-3.5"}),l?c.jsx("span",{children:l}):null]})})}),c.jsx(fn,{side:"bottom",children:l??"Sessions"})]}),c.jsxs(Lc,{align:"start",className:"w-[min(28rem,calc(100vw-1rem))] p-0",children:[c.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-medium",children:"Sessions"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:n||"Current workspace"})]}),c.jsxs(Se,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>{s(),u(!1)},children:[c.jsx(N0e,{className:"mr-1 h-3 w-3"}),"New chat"]})]}),c.jsx("div",{className:"max-h-[min(28rem,70vh)] overflow-y-auto p-2",children:e.length===0?c.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No sessions yet."}):c.jsx("div",{className:"space-y-0.5",children:e.map(g=>{const v=g.id===r;return c.jsxs("button",{type:"button",className:`flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors ${v?"bg-secondary text-secondary-foreground":"hover:bg-muted/50"}`,onClick:()=>{i(g.id),u(!1)},children:[v?c.jsx(ys,{className:"mt-0.5 h-3 w-3 shrink-0 text-primary"}):c.jsx("span",{className:"mt-1 h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"truncate text-xs font-medium",children:g.name||"Untitled"}),g.status==="archived"&&c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-1.5 py-0 text-2xs text-muted-foreground",children:[c.jsx(VG,{className:"h-2.5 w-2.5"}),"Archived"]})]}),c.jsx("div",{className:"text-2xs text-muted-foreground",children:UGe(g.lastActiveAt)})]})]},g.id)})})})]})]})]})}function qGe({suggestions:e,onSelect:r,className:n}){return c.jsx("div",{className:Le("flex flex-wrap gap-2 justify-center",n),children:e.map(i=>c.jsx("button",{onClick:()=>r(i),className:"px-4 py-2 text-sm rounded-full border bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:i},i))})}const GGe=H4("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium leading-4 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400"}},defaultVariants:{variant:"default"}});function pn({className:e,variant:r,...n}){return c.jsx("div",{className:Le(GGe({variant:r}),e),...n})}const $n=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("rounded-xl border border-border/70 bg-card text-card-foreground shadow-sm",e),...r}));$n.displayName="Card";const koe=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("flex flex-col space-y-1.5 p-6",e),...r}));koe.displayName="CardHeader";const Coe=y.forwardRef(({className:e,...r},n)=>c.jsx("h3",{ref:n,className:Le("font-semibold leading-none tracking-tight",e),...r}));Coe.displayName="CardTitle";const KGe=y.forwardRef(({className:e,...r},n)=>c.jsx("p",{ref:n,className:Le("text-sm text-muted-foreground",e),...r}));KGe.displayName="CardDescription";const joe=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("p-6 pt-0",e),...r}));joe.displayName="CardContent";const YGe=y.forwardRef(({className:e,...r},n)=>c.jsx("div",{ref:n,className:Le("flex items-center p-6 pt-0",e),...r}));YGe.displayName="CardFooter";const XGe={pending:{icon:ng,label:"Pending",color:"text-muted-foreground"},approved:{icon:er,label:"Running",color:"text-blue-500"},rejected:{icon:ni,label:"Rejected",color:"text-destructive"},executed:{icon:_l,label:"Done",color:"text-green-500"},failed:{icon:Ba,label:"Failed",color:"text-destructive"}};function ZGe({action:e,expanded:r,onToggle:n}){const i=XGe[e.status],s=i.icon;return c.jsxs("div",{className:"border rounded-md",children:[c.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full px-3 py-2.5 text-left hover:bg-muted/50 transition-colors",onClick:n,children:[c.jsx(s,{className:Le("h-4 w-4 shrink-0",i.color,e.status==="approved"&&"animate-spin")}),c.jsxs("span",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"font-mono text-sm font-medium",children:e.tool}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["Step ",e.order+1]})]}),c.jsx(pn,{variant:"outline",className:"text-2xs px-1.5 py-0",children:i.label}),r?c.jsx(kl,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(Js,{className:"h-4 w-4 text-muted-foreground"})]}),r&&c.jsxs("div",{className:"px-3 pb-3 pt-1 border-t bg-muted/30",children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),c.jsx("pre",{className:"text-xs bg-background rounded p-2 overflow-x-auto max-h-48",children:JSON.stringify(e.args,null,2)}),e.result&&c.jsx("div",{className:Le("mt-2 text-xs rounded p-2",e.result.ok?"bg-green-500/10 text-green-700 dark:text-green-400":"bg-destructive/10 text-destructive"),children:e.result.message})]})]})}function JGe({plan:e,onApprove:r,onReject:n,isExecuting:i,className:s}){const[o,a]=y.useState(new Set),l=g=>{a(v=>{const b=new Set(v);return b.has(g)?b.delete(g):b.add(g),b})},d=e.actions.filter(g=>g.status==="pending").length,u=e.actions.filter(g=>g.status==="executed").length,f=e.actions.filter(g=>g.status==="failed").length,p=d===0;return c.jsxs($n,{className:Le("p-4 space-y-3",s),children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[c.jsx(QGe,{className:"h-4 w-4"}),"Plan",c.jsxs(pn,{variant:"secondary",className:"text-2xs px-1.5 py-0",children:[e.actions.length," step",e.actions.length!==1?"s":""]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.summary})]}),p&&c.jsx(pn,{variant:f>0?"destructive":"success",className:"shrink-0",children:f>0?`${f} failed`:"Complete"})]}),c.jsx("div",{className:"space-y-1.5",children:e.actions.map(g=>c.jsx(ZGe,{action:g,expanded:o.has(g.id),onToggle:()=>l(g.id)},g.id))}),d>0&&c.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[c.jsx(Se,{size:"sm",onClick:()=>r(),disabled:i,children:i?c.jsxs(c.Fragment,{children:[c.jsx(er,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Executing..."]}):c.jsxs(c.Fragment,{children:[c.jsx(G4,{className:"h-3.5 w-3.5 mr-1.5"}),"Execute all (",d,")"]})}),c.jsxs(Se,{size:"sm",variant:"outline",onClick:n,disabled:i,children:[c.jsx(ni,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]}),p&&!i&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:[u>0&&`${u} action${u!==1?"s":""} executed.`,f>0&&` ${f} failed.`]})]})}function QGe({className:e}){return c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[c.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),c.jsx("path",{d:"M12 11h4"}),c.jsx("path",{d:"M12 16h4"}),c.jsx("path",{d:"M8 11h.01"}),c.jsx("path",{d:"M8 16h.01"})]})}function eKe(e){return e.find(r=>r.status==="in-progress")??null}function Noe(e){return e.length>0&&e.every(r=>r.status==="completed")}function tKe(e){const r=eKe(e),n=Noe(e);return{headerLabel:r?r.title:n?"All tasks completed":"Tasks",showHeaderSpinner:!!r,showHeaderCompleted:!r&&n}}function QT({items:e,className:r,onClear:n}){const[i,s]=y.useState(!1),o=y.useMemo(()=>Noe(e),[e]),a=y.useMemo(()=>tKe(e),[e]);if(e.length===0)return null;const l=e.filter(g=>g.status==="completed").length,d=e.length,u=d>0?Math.round(l/d*100):0,f=i?"Tasks":a.headerLabel,p=o?"bg-green-500":"bg-primary";return c.jsxs("div",{className:Le("rounded-lg border bg-muted/30 p-3 space-y-2",r),children:[c.jsxs("button",{type:"button",onClick:()=>s(g=>!g),className:"flex items-center gap-2 w-full text-left",children:[c.jsx(kl,{className:Le("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-200",!i&&"-rotate-90")}),!i&&a.showHeaderSpinner&&c.jsx(er,{className:"h-3.5 w-3.5 shrink-0 text-primary animate-spin"}),!i&&a.showHeaderCompleted&&c.jsx(_l,{className:"h-3.5 w-3.5 shrink-0 text-green-500"}),c.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-foreground",children:f}),c.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:c.jsx("div",{className:Le("h-full rounded-full transition-all duration-300",p),style:{width:`${u}%`}})}),c.jsxs("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[l,"/",d]}),n&&c.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),n()},className:"shrink-0 p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:"Clear todo list",children:c.jsx(ni,{className:"h-3 w-3"})})]}),i&&c.jsx("div",{className:"space-y-1",children:e.map(g=>c.jsxs("div",{className:Le("flex items-start gap-2 text-xs py-0.5",g.status==="completed"&&"text-muted-foreground"),children:[g.status==="completed"?c.jsx(_l,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-green-500"}):g.status==="in-progress"?c.jsx(er,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary animate-spin"}):c.jsx(yge,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-muted-foreground/50"}),c.jsx("span",{className:Le("flex-1 min-w-0",g.status==="completed"&&"line-through"),children:g.title})]},g.id))})]})}function rKe({files:e,onAccept:r,onReject:n,onAcceptAll:i,onRejectAll:s,onFileClick:o,className:a}){const l=y.useRef(null),[d,u]=y.useState(!1),[f,p]=y.useState(!1);if(y.useEffect(()=>{const C=l.current;if(!C||typeof ResizeObserver>"u")return;const j=()=>{u(C.clientWidth<560)};j();const E=new ResizeObserver(()=>j());return E.observe(C),()=>E.disconnect()},[]),e.length===0)return null;const g=e.filter(C=>C.state==="undecided").length,v=e.reduce((C,j)=>C+(j.insertions??0),0),b=e.reduce((C,j)=>C+(j.deletions??0),0),_=e.some(C=>C.insertions!==void 0||C.deletions!==void 0),k=_?null:`${e.length} ${e.length===1?"file":"files"}`,S=({insertions:C,deletions:j})=>c.jsxs("span",{className:"shrink-0 whitespace-nowrap text-2xs tabular-nums",children:[c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["+",C]}),c.jsxs("span",{className:"ml-1 text-red-600 dark:text-red-400",children:["-",j]})]});return c.jsxs("div",{ref:l,className:Le("overflow-hidden rounded-lg border bg-muted/30",a),children:[c.jsxs("div",{className:Le("flex items-center justify-between gap-2 bg-muted/20 px-3 py-2",f&&"border-b"),children:[c.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-1.5 text-left",onClick:()=>p(C=>!C),"aria-expanded":f,children:[c.jsx(Js,{className:Le("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",f&&"rotate-90")}),c.jsx(Gl,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"truncate text-xs font-medium",children:"Files changed"}),_&&c.jsx(S,{insertions:v,deletions:b}),k&&c.jsx("span",{className:"shrink-0 whitespace-nowrap text-2xs tabular-nums text-muted-foreground",children:k}),f&&g>0&&c.jsxs("span",{className:"shrink-0 text-2xs text-amber-500 dark:text-amber-400",children:[g," pending"]})]}),g>0&&c.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[c.jsxs(Se,{size:d?"icon":"sm",variant:"ghost",className:Le("h-6 shrink-0 text-xs",d?"w-6 p-0":"px-2"),onClick:i,title:"Keep all","aria-label":"Keep all",children:[c.jsx(ys,{className:Le("h-3 w-3 shrink-0",!d&&"mr-1")}),!d&&"Keep all"]}),c.jsxs(Se,{size:d?"icon":"sm",variant:"ghost",className:Le("h-6 shrink-0 text-xs",d?"w-6 p-0":"px-2"),onClick:s,title:"Undo all","aria-label":"Undo all",children:[c.jsx(Mh,{className:Le("h-3 w-3 shrink-0",!d&&"mr-1")}),!d&&"Undo all"]})]})]}),f&&c.jsx("div",{className:"divide-y",children:e.map(C=>c.jsxs("div",{className:Le("flex items-center gap-2 px-3 py-1.5 text-xs",C.state==="accepted"&&"bg-green-500/5",C.state==="rejected"&&"bg-red-500/5 text-muted-foreground"),children:[c.jsx(Ro,{filename:C.name,className:"h-3.5 w-3.5 shrink-0"}),c.jsx("button",{type:"button",className:Le("min-w-0 flex-1 truncate text-left hover:underline cursor-pointer",C.state==="rejected"&&"line-through"),title:`Review diff for ${C.path}`,onClick:()=>o==null?void 0:o(C.path),children:C.path}),_&&c.jsx(S,{insertions:C.insertions??0,deletions:C.deletions??0}),C.state==="undecided"&&c.jsxs("div",{className:"ml-auto flex items-center gap-0.5 shrink-0",children:[c.jsx("button",{type:"button",className:"p-1 rounded hover:bg-primary/10 text-primary transition-colors",onClick:()=>o==null?void 0:o(C.path),title:"Review changes",children:c.jsx(np,{className:"h-3 w-3"})}),c.jsx("button",{type:"button",className:"p-1 rounded hover:bg-green-500/20 text-green-600 dark:text-green-400 transition-colors",onClick:()=>r==null?void 0:r(C.path),title:"Keep all changes",children:c.jsx(ys,{className:"h-3 w-3"})}),c.jsx("button",{type:"button",className:"p-1 rounded hover:bg-red-500/20 text-red-600 dark:text-red-400 transition-colors",onClick:()=>n==null?void 0:n(C.path),title:"Undo all changes",children:c.jsx(Mh,{className:"h-3 w-3"})})]}),C.state==="accepted"&&c.jsx("span",{className:"text-2xs text-green-600 dark:text-green-400 shrink-0",children:"Kept"}),C.state==="rejected"&&c.jsx("span",{className:"text-2xs text-red-500 shrink-0",children:"Undone"})]},C.path))})]})}function nKe(e,r,n,i){const s=e.findIndex(d=>d.id===r);if(s<0)return e;const o=[...e],[a]=o.splice(s,1);if(!a)return e;if(n==null)return o.push(a),o;const l=o.findIndex(d=>d.id===n);return l<0?e:(o.splice(l+(i==="after"?1:0),0,a),o)}function iKe({item:e,index:r}){return c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background px-3 py-2 text-sm shadow-2xl ring-1 ring-primary/10",children:[c.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:r===0?c.jsx(_R,{className:"h-3.5 w-3.5 text-primary"}):c.jsx(Js,{className:"h-3.5 w-3.5 text-muted-foreground"})}),c.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:c.jsx(ZG,{className:"h-3.5 w-3.5"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[r===0?c.jsx("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-primary/70",children:"Next"}):c.jsxs("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:["Queued #",r+1]}),c.jsx("span",{className:"whitespace-pre-wrap break-words text-foreground",children:e.displayContent??e.content})]})]})}function sKe({item:e,index:r,onRemove:n,onEdit:i,onReorder:s,onSendToParallelThread:o,dragActive:a,dropBefore:l,dropAfter:d,onDragStart:u}){const[f,p]=y.useState(!1),[g,v]=y.useState(!0),[b,_]=y.useState(e.displayContent??e.content),k=y.useRef(null),S=f||!a;y.useEffect(()=>{if(f){const T=k.current;T&&(T.focus(),T.setSelectionRange(T.value.length,T.value.length))}},[f]),y.useEffect(()=>{f||_(e.displayContent??e.content)},[e.content,e.displayContent,f]);const C=y.useCallback(()=>{const T=b.trim(),A=e.displayContent??e.content;T&&T!==A&&(i==null||i(e.id,T)),p(!1)},[b,e.content,e.displayContent,e.id,i]),j=y.useCallback(()=>{_(e.displayContent??e.content),p(!1)},[e.content,e.displayContent]),E=y.useCallback(T=>{T.key==="Enter"&&!T.shiftKey?(T.preventDefault(),C()):T.key==="Escape"&&j()},[C,j]);return c.jsxs(c.Fragment,{children:[l&&c.jsx("div",{className:"relative h-0",children:c.jsx("div",{className:"absolute inset-x-2 -top-px h-0.5 rounded-full bg-primary shadow-[0_0_0_1px_hsl(var(--background))]"})}),c.jsxs("div",{"data-queue-id":e.id,className:Le("group flex cursor-grab touch-none items-start gap-2 rounded-lg border border-border/40 bg-muted/50 px-3 py-2 text-sm transition-all duration-150 ease-out hover:bg-muted/70 active:cursor-grabbing",a&&"border-dashed border-primary/35 bg-primary/5 opacity-0"),onPointerDown:T=>{f||!s||T.target.closest('button, textarea, input, a, [data-no-drag="true"]')||u==null||u(e.id,T)},children:[c.jsx("button",{type:"button","data-no-drag":"true",className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground hover:bg-foreground/10 hover:text-foreground transition-colors",onClick:()=>v(T=>!T),"aria-label":g?"Expand queued message":"Collapse queued message",title:g?"Expand queued message":"Collapse queued message",children:g?c.jsx(Js,{className:"h-3.5 w-3.5"}):r===0?c.jsx(_R,{className:"h-3.5 w-3.5 text-primary"}):c.jsx(kl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s&&!f&&c.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground cursor-grab active:cursor-grabbing touch-none",title:"Drag to reorder","aria-label":"Drag to reorder",children:c.jsx(ZG,{className:"h-3.5 w-3.5"})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[r===0&&!f&&c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-primary/70 block mb-0.5",children:"Next"}),r>0&&!f&&c.jsxs("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground block mb-0.5",children:["Queued #",r+1]}),f?c.jsx("textarea",{ref:k,value:b,onChange:T=>_(T.target.value),onKeyDown:E,onBlur:C,rows:Math.min(b.split(`
|
|
1160
1160
|
`).length,5),className:"w-full resize-none rounded border border-primary/30 bg-background px-2 py-1 text-sm outline-none focus:border-primary focus:ring-1 focus:ring-primary/20"}):g?c.jsx("span",{className:"block truncate text-foreground",children:e.displayContent??e.content}):c.jsx("span",{className:"whitespace-pre-wrap break-words text-foreground",children:e.displayContent??e.content})]}),c.jsx("div",{className:Le("mt-0.5 flex shrink-0 items-center gap-0.5 transition-opacity",S?"opacity-0 group-hover:opacity-100":"opacity-0"),children:f?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-primary/10 text-primary transition-colors",onClick:C,title:"Save",children:c.jsx(ys,{className:"h-3.5 w-3.5"})}),c.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-foreground/10 text-muted-foreground transition-colors",onClick:j,title:"Cancel",children:c.jsx(ni,{className:"h-3.5 w-3.5"})})]}):c.jsxs(c.Fragment,{children:[i&&c.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-foreground/10 text-muted-foreground transition-colors",onClick:()=>p(!0),title:"Edit message",children:c.jsx(kR,{className:"h-3 w-3"})}),o&&c.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-primary/10 text-muted-foreground hover:text-primary transition-colors",onClick:()=>o(e.id),title:"Send to parallel thread",children:c.jsx(Kf,{className:"h-3 w-3"})}),c.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",onClick:()=>n==null?void 0:n(e.id),title:"Remove from queue",children:c.jsx(ni,{className:"h-3.5 w-3.5"})})]})})]}),d&&c.jsx("div",{className:"relative h-0",children:c.jsx("div",{className:"absolute inset-x-2 -top-px h-0.5 rounded-full bg-primary shadow-[0_0_0_1px_hsl(var(--background))]"})})]})}function JF({items:e,onRemove:r,onEdit:n,onReorder:i,onSendToParallelThread:s,className:o}){const a=y.useRef(null),l=y.useRef(null),[d,u]=y.useState(null),[f,p]=y.useState(null),[g,v]=y.useState(null);y.useEffect(()=>{if(d&&!e.some(C=>C.id===d)){u(null),p(null),v(null);return}f!=null&&f.targetId&&!e.some(C=>C.id===f.targetId)&&p(d?{targetId:d,placement:"before"}:null)},[d,f,e]),y.useEffect(()=>{var M;if(!d||!g)return;document.body.style.cursor="grabbing",document.body.style.userSelect="none",document.body.style.touchAction="none";const C=(z,$)=>{var H,R;const D=Array.from(((H=a.current)==null?void 0:H.querySelectorAll("[data-queue-id]"))??[]);if(D.length===0){p(null);return}const W=D.filter(B=>B.dataset.queueId&&B.dataset.queueId!==d);if(W.length===0){p({targetId:null,placement:"after"});return}for(const B of W){const L=B.dataset.queueId;if(!L)continue;const I=B.getBoundingClientRect(),q=I.top+I.height/2;if($<q){p({targetId:L,placement:"before"});return}}const U=((R=W[W.length-1])==null?void 0:R.dataset.queueId)??null;p(U?{targetId:U,placement:"after"}:{targetId:null,placement:"after"})},j=z=>{z.pointerId===g.pointerId&&(v($=>$&&{...$,x:z.clientX,y:z.clientY}),C(z.clientX,z.clientY))},E=z=>{var D,W;if(z&&z.pointerId!==g.pointerId)return;d&&f&&f.targetId!==d&&(i==null||i(d,f.targetId,f.placement));const $=l.current;(D=$==null?void 0:$.hasPointerCapture)!=null&&D.call($,g.pointerId)&&((W=$.releasePointerCapture)==null||W.call($,g.pointerId)),l.current=null,u(null),p(null),v(null)},T=()=>{E()},A=()=>{E()};return window.addEventListener("pointermove",j),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E),window.addEventListener("blur",A),(M=l.current)==null||M.addEventListener("lostpointercapture",T),()=>{var z;document.body.style.cursor="",document.body.style.userSelect="",document.body.style.touchAction="",window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E),window.removeEventListener("blur",A),(z=l.current)==null||z.removeEventListener("lostpointercapture",T)}},[g,d,f,i]);const b=y.useCallback((C,j)=>{var A;if(!i||j.button!==0&&j.pointerType!=="touch"&&j.pointerType!=="pen")return;j.preventDefault();const E=j.currentTarget.closest("[data-queue-id]");if(!E)return;l.current=E,(A=E.setPointerCapture)==null||A.call(E,j.pointerId);const T=E.getBoundingClientRect();u(C),p({targetId:C,placement:"before"}),v({id:C,pointerId:j.pointerId,x:j.clientX,y:j.clientY,offsetX:j.clientX-T.left,offsetY:j.clientY-T.top,width:T.width,height:T.height})},[i]);if(e.length===0)return null;const _=d&&f&&(f.targetId!==d||f.placement==="after")?nKe(e,d,f.targetId,f.placement):e,k=g?_.findIndex(C=>C.id===g.id):-1,S=k>=0?_[k]:null;return c.jsxs("div",{ref:a,className:Le("space-y-1.5",o),children:[c.jsx("div",{className:"flex items-center gap-1.5 px-0.5",children:c.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[e.length," queued message",e.length!==1?"s":""]})}),_.map((C,j)=>c.jsx(sKe,{item:C,index:j,onRemove:r,onEdit:n,onReorder:i,onSendToParallelThread:s,dragActive:d===C.id,dropBefore:!!(d&&(f==null?void 0:f.targetId)===C.id&&f.placement==="before"&&d!==C.id),dropAfter:!!(d&&(f==null?void 0:f.targetId)===C.id&&f.placement==="after"&&d!==C.id),onDragStart:b},C.id)),g&&S&&c.jsx("div",{className:"pointer-events-none fixed z-50",style:{left:`${g.x-g.offsetX}px`,top:`${g.y-g.offsetY}px`,width:`${g.width}px`,minHeight:`${g.height}px`},children:c.jsx("div",{className:"scale-[1.01] opacity-95",children:c.jsx(iKe,{item:S,index:k})})})]})}function oKe({usage:e}){const[r,n]=y.useState(!1),i=e&&e.limit>0?Math.round(e.ratio*100):0,s=y.useMemo(()=>{if(!e||e.total===0)return[];const g=e.total;return[{label:"System",tokens:e.system,pct:Math.round(e.system/g*100),color:"var(--ctx-system)"},{label:"History",tokens:e.history,pct:Math.round(e.history/g*100),color:"var(--ctx-history)"},{label:"Tool Results",tokens:e.toolResults,pct:Math.round(e.toolResults/g*100),color:"var(--ctx-tool-results)"},{label:"Tools",tokens:e.tools,pct:Math.round(e.tools/g*100),color:"var(--ctx-tools)"}].filter(v=>v.tokens>0)},[e]),o=22,a=3,l=(o-a)/2,d=2*Math.PI*l,u=y.useMemo(()=>{if(!e||e.limit<=0)return[];const g=[];let v=0;for(const b of s){const k=b.tokens/e.limit*d;g.push({offset:v,length:k,color:b.color}),v+=k}return g},[s,e,d]),f=i>=90?"text-red-500":i>=75?"text-amber-500":"text-emerald-500",p=g=>g>=1e3?`${(g/1e3).toFixed(1)}k`:String(g);return!e||e.limit<=0?null:c.jsxs(c.Fragment,{children:[c.jsxs(gn,{children:[c.jsx(hn,{asChild:!0,children:c.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex items-center gap-1.5 px-1.5 py-1 rounded-md hover:bg-muted/50 cursor-pointer transition-colors",children:[c.jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,className:`-rotate-90 ${f}`,children:[c.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:"currentColor",strokeWidth:a,opacity:.15}),u.map((g,v)=>c.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:g.color,strokeWidth:a,strokeDasharray:`${g.length} ${d-g.length}`,strokeDashoffset:-g.offset,strokeLinecap:"round",opacity:.85},v))]}),c.jsxs("span",{className:"text-2xs tabular-nums text-muted-foreground",children:[i,"%"]})]})}),c.jsx(fn,{side:"bottom",className:"max-w-[220px] bg-popover text-popover-foreground border shadow-md",children:c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs font-medium",children:[c.jsx("span",{children:"Context Window"}),c.jsxs("span",{className:"tabular-nums",children:[p(e.total)," / ",p(e.limit)]})]}),c.jsx("div",{className:"w-full h-1.5 rounded-full bg-muted overflow-hidden",children:c.jsx("div",{className:`h-full rounded-full transition-all ${i>=90?"bg-red-500":i>=75?"bg-amber-500":"bg-emerald-500"}`,style:{width:`${Math.min(i,100)}%`}})}),c.jsx("div",{className:"space-y-0.5",children:s.map(g=>c.jsxs("div",{className:"flex items-center justify-between text-xs",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:g.color}}),c.jsx("span",{className:"text-muted-foreground",children:g.label})]}),c.jsxs("span",{className:"tabular-nums text-muted-foreground",children:[g.pct,"%"]})]},g.label))}),e.pruned&&c.jsx("div",{className:"text-2xs text-amber-500 pt-0.5 border-t border-border",children:"Old messages pruned to fit context"})]})})]}),c.jsx(Fc,{open:r,onOpenChange:n,children:c.jsxs(Ql,{className:"max-w-sm",children:[c.jsxs(Du,{children:[c.jsx(ec,{className:"text-sm",children:"Context Window Breakdown"}),c.jsxs(Vh,{className:"text-xs",children:[p(e.total)," / ",p(e.limit)," tokens used (",i,"%)"]})]}),c.jsxs("div",{className:"space-y-3 pt-1",children:[c.jsx("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:c.jsx("div",{className:`h-full rounded-full transition-all ${i>=90?"bg-red-500":i>=75?"bg-amber-500":"bg-emerald-500"}`,style:{width:`${Math.min(i,100)}%`}})}),c.jsx("div",{className:"space-y-2",children:s.map(g=>c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full",style:{backgroundColor:g.color}}),c.jsx("span",{children:g.label})]}),c.jsxs("div",{className:"text-muted-foreground tabular-nums",children:[c.jsx("span",{className:"font-medium text-foreground",children:p(g.tokens)})," ",c.jsxs("span",{className:"text-xs",children:["(",g.pct,"%)"]})]})]},g.label))}),e.pruned&&c.jsx("div",{className:"rounded-md border border-amber-500/20 bg-amber-500/5 p-2 text-xs text-amber-600",children:"Older messages were pruned to fit within the context window limit."})]})]})})]})}const N1=Un(),aKe=ry();function lKe(e){const[r,n]=y.useState([]),i=y.useRef(async()=>{}),s=y.useRef(e);s.current=e;const o=y.useCallback(async()=>{try{const u=e?`${N1}/api/consent/pending/${e}`:`${N1}/api/consent/pending`,p=await(await fetch(u)).json();n(p.requests)}catch{}},[e]);i.current=o,y.useEffect(()=>{o()},[o]),y.useEffect(()=>{let u=!1;const f=new WebSocket(aKe);return f.onmessage=p=>{if(!u)try{const g=JSON.parse(p.data);if(g.type==="consent.required"){const v=g.payload,b=s.current;(!b||v.sessionId===b)&&n(_=>[..._,v])}if(g.type==="consent.resolved"){const v=g.payload;n(b=>b.filter(_=>_.id!==v.requestId))}}catch{}},f.onopen=()=>{u||i.current()},()=>{if(u=!0,f.onopen=()=>{try{f.close()}catch{}},f.onmessage=null,f.onerror=null,f.onclose=null,f.readyState===WebSocket.OPEN)try{f.close()}catch{}}},[]);const a=y.useCallback(async u=>{try{await fetch(`${N1}/api/consent/${u}/approve`,{method:"POST"}),n(f=>f.filter(p=>p.id!==u))}catch{}},[]),l=y.useCallback(async(u,f)=>{try{await fetch(`${N1}/api/consent/${u}/reject`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:f})}),n(p=>p.filter(g=>g.id!==u))}catch{}},[]),d=y.useCallback(async(u,f)=>{try{const g=await(await fetch(`${N1}/api/consent/pending/${u}/approve-all`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:f})})).json(),v=new Set(g.requestIds??[]);return v.size>0?n(b=>b.filter(_=>!v.has(_.id))):n(b=>b.filter(_=>_.sessionId!==u)),!0}catch{return!1}},[]);return{queue:r,approve:a,reject:l,approveAllForSession:d,refresh:o}}function cKe(){const[e,r]=y.useState(null),n=y.useCallback(async()=>{try{const s=await(await fetch(`${N1}/api/consent/policy`)).json();r(s)}catch{r(null)}},[]);return y.useEffect(()=>{n()},[n]),{policy:e,refresh:n}}function QF({risk:e}){const r={low:"bg-green-500/10 text-green-600 dark:text-green-400",medium:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",high:"bg-red-500/10 text-red-600 dark:text-red-400"},i={low:K4,medium:oK,high:A8}[e];return c.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${r[e]}`,children:[c.jsx(i,{className:"h-3 w-3"}),e]})}function eH({level:e}){const r={none:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",once:"bg-blue-500/10 text-blue-600 dark:text-blue-400",always:"bg-amber-500/10 text-amber-700 dark:text-amber-300",dangerous:"bg-red-500/10 text-red-600 dark:text-red-400"};return c.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${r[e]}`,children:e})}function tH({expiresAt:e}){const[r,n]=y.useState("");return y.useEffect(()=>{const i=()=>{const o=new Date(e).getTime()-Date.now();if(o<=0){n("expired");return}const a=Math.ceil(o/1e3);a>60?n(`${Math.ceil(a/60)}m`):n(`${a}s`)};i();const s=setInterval(i,1e3);return()=>clearInterval(s)},[e]),c.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[c.jsx(ng,{className:"h-3 w-3"}),r]})}function rH({toolName:e}){return e.startsWith("terminal.")?c.jsx(Bo,{className:"h-4 w-4"}):e.startsWith("file.")?c.jsx(Gl,{className:"h-4 w-4"}):c.jsx(tK,{className:"h-4 w-4"})}function uKe({preview:e,toolName:r}){const n=e.command,i=e.path,s=e.content;return n?c.jsxs("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed overflow-x-auto",children:[c.jsx("span",{className:"text-muted-foreground",children:"$ "}),n]}):i?c.jsxs("div",{className:"rounded-md bg-muted p-3 text-xs leading-relaxed overflow-x-auto",children:[c.jsxs("div",{className:"text-muted-foreground mb-1",children:[r,": ",i]}),s&&c.jsx("pre",{className:"font-mono whitespace-pre-wrap",children:s.length>500?s.slice(0,500)+"...":s})]}):c.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed overflow-x-auto",children:JSON.stringify(e,null,2)})}function dKe({request:e,onApprove:r,onReject:n,compact:i=!1}){const[s,o]=y.useState(!1),a=async()=>{o(!0),r(e.id)},l=async()=>{o(!0),n(e.id)};return i?c.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg border bg-card",children:[c.jsx(rH,{toolName:e.toolName}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs font-medium truncate",children:e.toolName}),c.jsx(QF,{risk:e.risk}),c.jsx(eH,{level:e.policy.consentLevel}),c.jsx(tH,{expiresAt:e.expiresAt})]}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:e.summary})]}),c.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c.jsxs("button",{onClick:a,disabled:s,className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-medium bg-green-500/10 text-green-600 dark:text-green-400 hover:bg-green-500/20 disabled:opacity-50 transition-colors",children:[c.jsx(Y$,{className:"h-3 w-3"}),"Approve"]}),c.jsxs("button",{onClick:l,disabled:s,className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-medium bg-red-500/10 text-red-600 dark:text-red-400 hover:bg-red-500/20 disabled:opacity-50 transition-colors",children:[c.jsx(A8,{className:"h-3 w-3"}),"Reject"]})]})]}):c.jsxs("div",{className:"rounded-lg border bg-card shadow-sm overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-muted/30",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(rH,{toolName:e.toolName}),c.jsx("span",{className:"text-sm font-medium",children:e.toolName}),c.jsx(QF,{risk:e.risk}),c.jsx(eH,{level:e.policy.consentLevel})]}),c.jsx(tH,{expiresAt:e.expiresAt})]}),c.jsxs("div",{className:"p-4 space-y-3",children:[c.jsx("p",{className:"text-sm text-foreground",children:e.summary}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:e.policy.description}),!e.policy.knownTool&&c.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:"Unknown tool: blocked behind dangerous consent until added to the active profile."})]}),c.jsx(uKe,{preview:e.preview,toolName:e.toolName})]}),c.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t bg-muted/20",children:[c.jsxs("button",{onClick:l,disabled:s,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-xs font-medium bg-red-500/10 text-red-600 dark:text-red-400 hover:bg-red-500/20 disabled:opacity-50 transition-colors",children:[c.jsx(A8,{className:"h-3.5 w-3.5"}),"Reject"]}),c.jsxs("button",{onClick:a,disabled:s,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-xs font-medium bg-green-500/10 text-green-600 dark:text-green-400 hover:bg-green-500/20 disabled:opacity-50 transition-colors",children:[c.jsx(Y$,{className:"h-3.5 w-3.5"}),"Approve"]})]})]})}function hKe({status:e}){const r={running:{icon:er,label:"Running",color:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},"awaiting-approval":{icon:oK,label:"Awaiting Approval",color:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"},"needs-input":{icon:ng,label:"Needs Input",color:"bg-orange-500/10 text-orange-600 dark:text-orange-400"},completed:{icon:_l,label:"Completed",color:"bg-green-500/10 text-green-600 dark:text-green-400"},failed:{icon:Uh,label:"Failed",color:"bg-red-500/10 text-red-600 dark:text-red-400"}},{icon:n,label:i,color:s}=r[e];return c.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${s}`,children:[c.jsx(n,{className:`h-3 w-3 ${e==="running"?"animate-spin":""}`}),i]})}function fKe({className:e="",compact:r=!1,sessionId:n,onApproveAllEnabled:i}){const{queue:s,approve:o,reject:a,approveAllForSession:l}=lKe(n),{policy:d}=cKe(),[u,f]=y.useState(!1),p=y.useMemo(()=>n?s.filter(v=>v.sessionId===n):s,[s,n]),g=async()=>{if(!n||u)return;f(!0),await l(n)&&(i==null||i()),f(!1)};return p.length===0?null:c.jsxs("div",{className:`space-y-2 ${e}`,children:[c.jsxs("div",{className:"flex items-center justify-between px-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(hKe,{status:"awaiting-approval"}),c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.length," pending ",p.length===1?"request":"requests"]}),d&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["Profile: ",c.jsx("span",{className:"font-medium text-foreground",children:d.activeProfileName??"custom"})," ","• ",d.toolCount," configured tools • unknown tools require dangerous consent"]})]})]}),n&&p.length>0&&c.jsx("button",{onClick:g,disabled:u,className:"text-xs text-green-600 hover:text-green-500 dark:text-green-400 dark:hover:text-green-300 disabled:opacity-50 disabled:cursor-not-allowed",children:u?"Approving...":"Approve all in this session"})]}),c.jsx("div",{className:"space-y-2",children:p.map(v=>c.jsx(dKe,{request:v,onApprove:o,onReject:a,compact:r},v.id))})]})}const nH=5e3;let pKe=0,P1=[],c4=new Set;function eE(e,r){P1.push({id:pKe++,ts:Date.now(),type:e,raw:r}),P1.length>nH&&(P1=P1.slice(-nH)),c4.forEach(n=>n())}function mKe(){P1=[],c4.forEach(e=>e())}function gKe(){const[,e]=y.useState(0);return y.useEffect(()=>{const r=()=>e(n=>n+1);return c4.add(r),()=>{c4.delete(r)}},[]),P1}const yKe={request:"text-orange-400",token:"text-gray-400",tool_call_delta:"text-blue-400",tool_start:"text-yellow-400",tool_output:"text-green-400",tool_result:"text-emerald-400",thinking:"text-purple-400",done:"text-gray-500",error:"text-red-400"},tE=20;function vKe({onClose:e}){const r=gKe(),n=y.useRef(null),[i,s]=y.useState(!0),[o,a]=y.useState(""),[l,d]=y.useState(!1),[u,f]=y.useState(new Set),p=y.useCallback(k=>{f(S=>{const C=new Set(S);return C.has(k)?C.delete(k):C.add(k),C})},[]),g=o?r.filter(k=>k.type.includes(o)||k.raw.includes(o)):r,v=KR({count:g.length,getScrollElement:()=>n.current,estimateSize:()=>tE,overscan:30}),b=()=>{const k=g.map(S=>`${new Date(S.ts).toISOString().slice(11,23)} ${S.type} ${S.raw}`).join(`
|
|
1161
1161
|
`);navigator.clipboard.writeText(k),d(!0),setTimeout(()=>d(!1),1500)};y.useEffect(()=>{i&&g.length>0&&v.scrollToIndex(g.length-1,{align:"end"})},[g.length,i]);const _=y.useCallback(()=>{const k=n.current;if(!k)return;const S=k.scrollHeight-k.scrollTop-k.clientHeight<40;s(S)},[]);return c.jsxs("div",{className:"flex flex-col h-full bg-[#0d1117] text-[#c9d1d9] text-xs font-mono",children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-zinc-700/60 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"SSE Debug"}),c.jsxs("span",{className:"text-2xs text-zinc-500",children:[g.length,"/",r.length]})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"text",placeholder:"Filter...",value:o,onChange:k=>a(k.target.value),className:"h-5 w-28 px-1.5 text-2xs rounded bg-zinc-800 border border-zinc-700 text-zinc-300 placeholder-zinc-500 focus:outline-none focus:border-blue-500"}),c.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:b,title:"Copy all events",children:l?c.jsx(ys,{className:"h-3 w-3 text-green-400"}):c.jsx(Rc,{className:"h-3 w-3"})}),c.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:mKe,children:c.jsx(Ih,{className:"h-3 w-3"})}),c.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:e,children:c.jsx(ni,{className:"h-3 w-3"})})]})]}),c.jsx("div",{ref:n,onScroll:_,className:"flex-1 overflow-y-auto overflow-x-hidden",children:c.jsx("div",{style:{height:`${v.getTotalSize()}px`,position:"relative",width:"100%"},children:v.getVirtualItems().map(k=>{const S=g[k.index],C=new Date(S.ts).toISOString().slice(11,23),j=yKe[S.type]??"text-zinc-400",E=S.raw.length>120,T=u.has(S.id),A=E&&!T?S.raw.slice(0,120)+"…":S.raw;return c.jsxs("div",{"data-index":k.index,ref:v.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${k.start}px)`},className:Le("flex gap-2 px-2 hover:bg-zinc-800/50 leading-tight cursor-pointer select-none",T?"items-start py-1 bg-zinc-800/30":"items-center"),onClick:()=>p(S.id),children:[c.jsx("span",{className:"text-zinc-600 shrink-0 w-20",style:{minHeight:tE},children:C}),c.jsx("span",{className:Le("shrink-0 w-28 text-right",j),style:{minHeight:tE},children:S.type}),c.jsxs("span",{className:Le("text-zinc-400 min-w-0",T?"break-all whitespace-pre-wrap":"truncate"),children:[A,E&&!T&&c.jsx("span",{className:"text-zinc-600 ml-1",children:"▸"})]})]},S.id)})})}),!i&&c.jsx("div",{className:"absolute bottom-2 right-4",children:c.jsx(Se,{variant:"outline",size:"icon",className:"h-6 w-6 rounded-full bg-zinc-800 border-zinc-600",onClick:()=>{s(!0),v.scrollToIndex(g.length-1,{align:"end"})},children:c.jsx(qG,{className:"h-3 w-3"})})})]})}function xKe(e,r=[]){let n=[];function i(o,a){const l=y.createContext(a),d=n.length;n=[...n,a];const u=p=>{var S;const{scope:g,children:v,...b}=p,_=((S=g==null?void 0:g[e])==null?void 0:S[d])||l,k=y.useMemo(()=>b,Object.values(b));return c.jsx(_.Provider,{value:k,children:v})};u.displayName=o+"Provider";function f(p,g){var _;const v=((_=g==null?void 0:g[e])==null?void 0:_[d])||l,b=y.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[u,f]}const s=()=>{const o=n.map(a=>y.createContext(a));return function(l){const d=(l==null?void 0:l[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return s.scopeName=e,[i,bKe(s,...r)]}function bKe(...e){const r=e[0];if(e.length===1)return r;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=i.reduce((l,{useScope:d,scopeName:u})=>{const p=d(o)[`__scope${u}`];return{...l,...p}},{});return y.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};return n.scopeName=r.scopeName,n}function Toe(e){const r=y.useRef({value:e,previous:e});return y.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}function _Ke(e){const r=wKe(e),n=y.forwardRef((i,s)=>{const{children:o,...a}=i,l=y.Children.toArray(o),d=l.find(kKe);if(d){const u=d.props.children,f=l.map(p=>p===d?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:p);return c.jsx(r,{...a,ref:s,children:y.isValidElement(u)?y.cloneElement(u,void 0,f):null})}return c.jsx(r,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function wKe(e){const r=y.forwardRef((n,i)=>{const{children:s,...o}=n;if(y.isValidElement(s)){const a=jKe(s),l=CKe(o,s.props);return s.type!==y.Fragment&&(l.ref=i?eo(i,a):a),y.cloneElement(s,l)}return y.Children.count(s)>1?y.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var SKe=Symbol("radix.slottable");function kKe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SKe}function CKe(e,r){const n={...r};for(const i in r){const s=e[i],o=r[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...l)=>{const d=o(...l);return s(...l),d}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function jKe(e){var i,s;let r=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var NKe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Eoe=NKe.reduce((e,r)=>{const n=_Ke(`Primitive.${r}`),i=y.forwardRef((s,o)=>{const{asChild:a,...l}=s,d=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:o})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),o6="Switch",[TKe]=xKe(o6),[EKe,AKe]=TKe(o6),Aoe=y.forwardRef((e,r)=>{const{__scopeSwitch:n,name:i,checked:s,defaultChecked:o,required:a,disabled:l,value:d="on",onCheckedChange:u,form:f,...p}=e,[g,v]=y.useState(null),b=si(r,j=>v(j)),_=y.useRef(!1),k=g?f||!!g.closest("form"):!0,[S,C]=rp({prop:s,defaultProp:o??!1,onChange:u,caller:o6});return c.jsxs(EKe,{scope:n,checked:S,disabled:l,children:[c.jsx(Eoe.button,{type:"button",role:"switch","aria-checked":S,"aria-required":a,"data-state":Poe(S),"data-disabled":l?"":void 0,disabled:l,value:d,...p,ref:b,onClick:pr(e.onClick,j=>{C(E=>!E),k&&(_.current=j.isPropagationStopped(),_.current||j.stopPropagation())})}),k&&c.jsx(Moe,{control:g,bubbles:!_.current,name:i,value:d,checked:S,required:a,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});Aoe.displayName=o6;var Ooe="SwitchThumb",Roe=y.forwardRef((e,r)=>{const{__scopeSwitch:n,...i}=e,s=AKe(Ooe,n);return c.jsx(Eoe.span,{"data-state":Poe(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r})});Roe.displayName=Ooe;var OKe="SwitchBubbleInput",Moe=y.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:i=!0,...s},o)=>{const a=y.useRef(null),l=si(a,o),d=Toe(n),u=RK(r);return y.useEffect(()=>{const f=a.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&v){const b=new Event("click",{bubbles:i});v.call(f,n),f.dispatchEvent(b)}},[d,n,i]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Moe.displayName=OKe;function Poe(e){return e?"checked":"unchecked"}var Loe=Aoe,RKe=Roe;const lp=y.forwardRef(({className:e,...r},n)=>c.jsx(Loe,{className:Le("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:c.jsx(RKe,{className:Le("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));lp.displayName=Loe.displayName;var zS="Ollama",MKe=.6,PKe=.1,$oe="#fff",LKe=$oe,$Ke="#000",DKe=.75;function K2(e){"@babel/helpers - typeof";return K2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},K2(e)}var IKe=["size","style"];function iH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function rE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?iH(Object(n),!0).forEach(function(i){BKe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function BKe(e,r,n){return r=zKe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function zKe(e){var r=FKe(e,"string");return K2(r)=="symbol"?r:String(r)}function FKe(e,r){if(K2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(K2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function HKe(e,r){if(e==null)return{};var n=WKe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function WKe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var K9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=HKe(e,IKe);return c.jsxs("svg",rE(rE({fill:"currentColor",fillRule:"evenodd",height:n,style:rE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:zS}),c.jsx("path",{d:"M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"})]}))});function Y2(e){"@babel/helpers - typeof";return Y2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Y2(e)}function sH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function UKe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?sH(Object(n),!0).forEach(function(i){VKe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function VKe(e,r,n){return r=qKe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function qKe(e){var r=GKe(e,"string");return Y2(r)=="symbol"?r:String(r)}function GKe(e,r){if(Y2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(Y2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function KKe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var YKe=y.memo(function(e){var r=Object.assign({},(KKe(e),e));return c.jsx(rc,UKe({Icon:K9,"aria-label":zS,background:LKe,color:$Ke,iconMultiple:DKe},r))});function X2(e){"@babel/helpers - typeof";return X2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},X2(e)}var XKe=["size","style"];function oH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function nE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?oH(Object(n),!0).forEach(function(i){ZKe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function ZKe(e,r,n){return r=JKe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function JKe(e){var r=QKe(e,"string");return X2(r)=="symbol"?r:String(r)}function QKe(e,r){if(X2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(X2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function eYe(e,r){if(e==null)return{};var n=tYe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function tYe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Doe=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=eYe(e,XKe);return c.jsxs("svg",nE(nE({fill:"currentColor",fillRule:"evenodd",height:n,style:nE({flex:"none",lineHeight:1},i),viewBox:"0 0 87 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:zS}),c.jsx("path",{d:"M11.333 2c-2.959 0-5.272.943-6.94 2.884C2.78 6.717 2 9.09 2 12.027c0 2.911.78 5.283 2.394 7.116C6.06 21.03 8.374 22 11.333 22c2.931 0 5.244-.943 6.939-2.83 1.614-1.806 2.42-4.178 2.42-7.143s-.806-5.364-2.42-7.17C16.577 2.943 14.264 2 11.332 2zm0 2.776c1.99 0 3.523.62 4.599 1.914 1.049 1.294 1.587 3.073 1.587 5.337s-.538 4.016-1.587 5.283c-1.076 1.267-2.609 1.914-4.6 1.914-1.99 0-3.55-.674-4.625-1.995-1.05-1.294-1.56-3.019-1.56-5.202 0-2.21.51-3.935 1.56-5.23 1.102-1.347 2.636-2.02 4.626-2.02zM22.979 2v19.623h3.066V2h-3.066zm6.159 0v19.623h3.066V2h-3.066zm12.21 5.31c-1.775 0-3.173.296-4.195.943-1.21.701-1.964 1.833-2.26 3.37l3.04.242c.161-.728.564-1.267 1.156-1.617.511-.323 1.184-.458 2.044-.458 1.99 0 2.986.89 2.986 2.722v.54l-3.04.08c-2.044.054-3.63.485-4.76 1.294-1.237.835-1.829 2.048-1.829 3.612 0 1.159.43 2.102 1.29 2.857.835.728 1.964 1.105 3.417 1.105 1.21 0 2.259-.216 3.146-.62.78-.377 1.453-.89 1.99-1.59v1.833h2.852v-8.895c0-1.698-.43-2.992-1.291-3.882-.969-1.024-2.502-1.536-4.546-1.536zm2.77 7.951v.701c0 1.078-.43 1.968-1.237 2.669-.806.674-1.802 1.024-2.985 1.024-.672 0-1.21-.189-1.64-.512-.431-.324-.62-.728-.62-1.213 0-1.614 1.129-2.473 3.41-2.58l3.073-.089zM56.572 7.31c-1.344 0-2.609.593-3.765 1.806V7.687H49.74v13.936h3.066v-8.356c0-.917.269-1.725.807-2.372.538-.7 1.237-1.024 2.125-1.024 1.828 0 2.743 1.05 2.743 3.18v8.572h3.066v-8.518c0-1.024.242-1.806.78-2.372.511-.593 1.13-.862 1.883-.862 1.075 0 1.829.242 2.313.754.457.486.699 1.294.699 2.4v8.598h3.066v-9.138c0-1.536-.484-2.776-1.398-3.746-.969-.97-2.152-1.429-3.578-1.429-.941 0-1.72.162-2.34.485-.699.324-1.371.917-2.017 1.78-.887-1.51-2.34-2.265-4.384-2.265zm22.593 0c-1.775 0-3.174.296-4.196.943-1.21.701-1.963 1.833-2.26 3.37l3.04.242c.161-.728.565-1.267 1.156-1.617.511-.323 1.184-.458 2.044-.458 1.99 0 2.986.89 2.986 2.722v.54l-3.04.08c-2.043.054-3.63.485-4.76 1.294-1.237.835-1.829 2.048-1.829 3.612 0 1.159.43 2.102 1.291 2.857.834.728 1.964 1.105 3.416 1.105 1.21 0 2.26-.216 3.147-.62.78-.377 1.452-.89 1.99-1.59v1.833H85v-8.895c0-1.698-.43-2.992-1.291-3.882-.968-1.024-2.501-1.536-4.545-1.536zm2.77 7.951v.701c0 1.078-.43 1.968-1.237 2.669-.807.674-1.802 1.024-2.986 1.024-.672 0-1.21-.189-1.64-.512-.43-.324-.619-.728-.619-1.213 0-1.614 1.128-2.473 3.41-2.58l3.072-.089z"})]}))});function Z2(e){"@babel/helpers - typeof";return Z2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Z2(e)}function aH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function rYe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?aH(Object(n),!0).forEach(function(i){nYe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function nYe(e,r,n){return r=iYe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function iYe(e){var r=sYe(e,"string");return Z2(r)=="symbol"?r:String(r)}function sYe(e,r){if(Z2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(Z2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function oYe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var aYe=y.memo(function(e){var r=Object.assign({},(oYe(e),e));return c.jsx(nc,rYe({Icon:K9,Text:Doe,"aria-label":zS,spaceMultiple:PKe,textMultiple:MKe},r))}),ay=K9;ay.Text=Doe;ay.Combine=aYe;ay.Avatar=YKe;ay.colorPrimary=$oe;ay.title=zS;var z0="Qwen",lYe=.7,cYe=.2,Ioe="#615ced",uYe="linear-gradient(to right, #6336E7, #6F69F7)",dYe=Ioe,hYe="#fff",fYe=.75;function J2(e){"@babel/helpers - typeof";return J2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},J2(e)}var pYe=["size","style"];function lH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function iE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?lH(Object(n),!0).forEach(function(i){mYe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function mYe(e,r,n){return r=gYe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function gYe(e){var r=yYe(e,"string");return J2(r)=="symbol"?r:String(r)}function yYe(e,r){if(J2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(J2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function vYe(e,r){if(e==null)return{};var n=xYe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function xYe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Y9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=vYe(e,pYe);return c.jsxs("svg",iE(iE({fill:"currentColor",fillRule:"evenodd",height:n,style:iE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:z0}),c.jsx("path",{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"})]}))});function Q2(e){"@babel/helpers - typeof";return Q2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Q2(e)}function cH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function bYe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?cH(Object(n),!0).forEach(function(i){_Ye(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function _Ye(e,r,n){return r=wYe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function wYe(e){var r=SYe(e,"string");return Q2(r)=="symbol"?r:String(r)}function SYe(e,r){if(Q2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(Q2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function kYe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var CYe=y.memo(function(e){var r=Object.assign({},(kYe(e),e));return c.jsx(rc,bYe({Icon:Y9,"aria-label":z0,background:dYe,color:hYe,iconMultiple:fYe},r))}),jYe=function(r){var n="lobe-icons-".concat(LJ(r),"-fill");return y.useMemo(function(){return{fill:"url(#".concat(n,")"),id:n}},[r])},X9=function(r,n){return y.useMemo(function(){var i=Array.from({length:n},function(s,o){var a="lobe-icons-".concat(LJ(r),"-fill-").concat(o);return{fill:"url(#".concat(a,")"),id:a}});return i},[r,n])};function ew(e){"@babel/helpers - typeof";return ew=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ew(e)}var NYe=["size","style"];function uH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function sE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?uH(Object(n),!0).forEach(function(i){TYe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function TYe(e,r,n){return r=EYe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function EYe(e){var r=AYe(e,"string");return ew(r)=="symbol"?r:String(r)}function AYe(e,r){if(ew(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(ew(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function OYe(e,r){if(e==null)return{};var n=RYe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function RYe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Boe=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=OYe(e,NYe),o=jYe(z0),a=o.id,l=o.fill;return c.jsxs("svg",sE(sE({height:n,style:sE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:z0}),c.jsx("path",{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z",fill:l,fillRule:"nonzero"}),c.jsx("defs",{children:c.jsxs("linearGradient",{id:a,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:".84"}),c.jsx("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:".84"})]})})]}))});function tw(e){"@babel/helpers - typeof";return tw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},tw(e)}var MYe=["size","style"];function dH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function oE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?dH(Object(n),!0).forEach(function(i){PYe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function PYe(e,r,n){return r=LYe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function LYe(e){var r=$Ye(e,"string");return tw(r)=="symbol"?r:String(r)}function $Ye(e,r){if(tw(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(tw(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function DYe(e,r){if(e==null)return{};var n=IYe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function IYe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var zoe=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=DYe(e,MYe);return c.jsxs("svg",oE(oE({fill:"currentColor",fillRule:"evenodd",height:n,style:oE({flex:"none",lineHeight:1},i),viewBox:"0 0 75 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:z0}),c.jsx("path",{d:"M11.425 14.13h3.642l1.529 1.795a7.89 7.89 0 002.166-2.832 8.36 8.36 0 00.771-3.562c0-2.03-.624-3.664-1.874-4.905-1.24-1.25-2.884-1.874-4.931-1.874-1.028 0-1.99.186-2.885.558A6.99 6.99 0 007.45 4.932 8.576 8.576 0 005.656 7.67a8.354 8.354 0 00-.625 3.19c0 2.003.611 3.643 1.834 4.919 1.223 1.276 2.779 1.914 4.666 1.914.39 0 .793-.031 1.21-.093.425-.062.868-.16 1.329-.293l-2.645-3.177zM18.07 22l-2.127-2.46c-.753.293-1.48.51-2.18.652a9.84 9.84 0 01-2.073.226c-2.97 0-5.326-.85-7.072-2.552C2.873 16.164 2 13.865 2 10.966c0-1.577.28-3.052.837-4.426a10.148 10.148 0 012.406-3.576A10.427 10.427 0 018.713.758C10.025.253 11.429 0 12.927 0c2.915 0 5.25.86 7.005 2.579 1.755 1.72 2.632 4.01 2.632 6.872 0 1.764-.354 3.399-1.063 4.905a10.156 10.156 0 01-3.031 3.776L21.714 22H18.07zm5.743-14.675h2.884l2.047 6.433.054.16c.248.789.38 1.373.399 1.755.097-.302.221-.62.372-.958.16-.345.354-.713.585-1.103l4.227-7.218 2.06 7.43c.08.275.146.559.2.851.053.293.097.63.133 1.01.132-.372.265-.708.398-1.01.142-.3.28-.562.412-.784l3.816-6.567h3.243L36.097 20.71l-2.127-7.045a8.683 8.683 0 01-.213-.798 17.846 17.846 0 01-.146-.97 69.17 69.17 0 01-.519 1.063c-.15.302-.265.514-.345.638l-4.28 7.112-4.653-13.385zm24.392 4.785h6.5c-.026-.85-.292-1.52-.797-2.007-.496-.497-1.166-.745-2.008-.745-.957 0-1.768.248-2.432.745-.665.496-1.086 1.165-1.263 2.007zm6.34 3.948l2.061 1.608c-.735.966-1.533 1.67-2.392 2.114-.86.443-1.848.665-2.965.665-1.87 0-3.38-.563-4.533-1.689-1.152-1.134-1.728-2.623-1.728-4.466 0-2.162.66-3.935 1.98-5.317 1.33-1.391 3.018-2.087 5.066-2.087 1.71 0 3.07.532 4.08 1.595 1.02 1.055 1.53 2.473 1.53 4.254 0 .15-.01.345-.027.585-.01.23-.027.51-.054.837h-9.61c0 1.143.288 2.056.864 2.738.576.674 1.342 1.01 2.3 1.01.664 0 1.293-.159 1.887-.478a4.633 4.633 0 001.542-1.369zm14.317 3.868l.957-7.244c.018-.133.031-.27.04-.412.009-.151.013-.368.013-.652 0-.824-.2-1.453-.598-1.887-.399-.444-.98-.665-1.741-.665-1.188 0-2.118.385-2.792 1.156-.673.763-1.112 1.937-1.316 3.523l-.797 6.181H59.77l1.661-12.601h2.752l-.213 1.515c.727-.664 1.476-1.156 2.247-1.475a6.5 6.5 0 012.486-.479c1.293 0 2.3.341 3.017 1.024.727.673 1.09 1.622 1.09 2.845 0 .31-.018.673-.053 1.09-.036.407-.089.886-.16 1.435l-.877 6.647h-2.858z"})]}))});function rw(e){"@babel/helpers - typeof";return rw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},rw(e)}var BYe=["type","extraStyle"];function hH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function fH(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?hH(Object(n),!0).forEach(function(i){zYe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function zYe(e,r,n){return r=FYe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function FYe(e){var r=HYe(e,"string");return rw(r)=="symbol"?r:String(r)}function HYe(e,r){if(rw(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(rw(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function WYe(e,r){if(e==null)return{};var n=UYe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function UYe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var VYe=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=e.extraStyle,s=WYe(e,BYe),o=n==="color"?Boe:Y9;return c.jsx(nc,fH({Icon:o,Text:zoe,"aria-label":z0,extraStyle:fH({fontWeight:500},i),spaceMultiple:cYe,textMultiple:lYe},s))}),Rd=Y9;Rd.Color=Boe;Rd.Text=zoe;Rd.Combine=VYe;Rd.Avatar=CYe;Rd.colorPrimary=Ioe;Rd.colorGradient=uYe;Rd.title=z0;var Kh="Meta",qYe=.75,GYe=.2,KYe="#1d65c1",Foe="linear-gradient(45deg, #007FF8, #0668E1, #007FF8)",YYe=Foe,XYe="#fff",ZYe=.75;function nw(e){"@babel/helpers - typeof";return nw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},nw(e)}var JYe=["size","style"];function pH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function aE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?pH(Object(n),!0).forEach(function(i){QYe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function QYe(e,r,n){return r=eXe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function eXe(e){var r=tXe(e,"string");return nw(r)=="symbol"?r:String(r)}function tXe(e,r){if(nw(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(nw(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function rXe(e,r){if(e==null)return{};var n=nXe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function nXe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Z9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=rXe(e,JYe);return c.jsxs("svg",aE(aE({fill:"currentColor",fillRule:"evenodd",height:n,style:aE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Kh}),c.jsx("path",{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"})]}))});function iw(e){"@babel/helpers - typeof";return iw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},iw(e)}function mH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function iXe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?mH(Object(n),!0).forEach(function(i){sXe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function sXe(e,r,n){return r=oXe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function oXe(e){var r=aXe(e,"string");return iw(r)=="symbol"?r:String(r)}function aXe(e,r){if(iw(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(iw(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function lXe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var cXe=y.memo(function(e){var r=Object.assign({},(lXe(e),e));return c.jsx(rc,iXe({Icon:Z9,"aria-label":Kh,background:YYe,color:XYe,iconMultiple:ZYe},r))});function sw(e){"@babel/helpers - typeof";return sw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},sw(e)}var uXe=["size","style"];function gH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function lE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?gH(Object(n),!0).forEach(function(i){dXe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function dXe(e,r,n){return r=hXe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function hXe(e){var r=fXe(e,"string");return sw(r)=="symbol"?r:String(r)}function fXe(e,r){if(sw(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(sw(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function pXe(e,r){return vXe(e)||yXe(e,r)||gXe(e,r)||mXe()}function mXe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1162
1162
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gXe(e,r){if(e){if(typeof e=="string")return yH(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yH(e,r)}}function yH(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=new Array(r);n<r;n++)i[n]=e[n];return i}function yXe(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,o,a,l=[],d=!0,u=!1;try{if(o=(n=n.call(e)).next,r!==0)for(;!(d=(i=o.call(n)).done)&&(l.push(i.value),l.length!==r);d=!0);}catch(f){u=!0,s=f}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function vXe(e){if(Array.isArray(e))return e}function xXe(e,r){if(e==null)return{};var n=bXe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function bXe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var _Xe=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=xXe(e,uXe),o=X9("".concat(Kh,"-brand"),13),a=pXe(o,13),l=a[0],d=a[1],u=a[2],f=a[3],p=a[4],g=a[5],v=a[6],b=a[7],_=a[8],k=a[9],S=a[10],C=a[11],j=a[12];return c.jsxs("svg",lE(lE({fill:"currentColor",fillRule:"evenodd",height:n,style:lE({flex:"none",lineHeight:1},i),viewBox:"0 0 103 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Kh}),c.jsx("path",{d:"M38.337 2.641h3.752l6.38 11.57 6.38-11.57h3.671v19.011H55.46V7.082l-5.594 10.09h-2.872l-5.595-10.09v14.57h-3.06V2.642zm30.058 19.353c-1.418 0-2.664-.314-3.739-.944a6.594 6.594 0 01-2.513-2.614c-.6-1.113-.9-2.39-.9-3.829 0-1.457.293-2.748.88-3.87.587-1.123 1.402-2 2.445-2.635 1.043-.633 2.242-.95 3.596-.95 1.346 0 2.504.319 3.475.957.97.638 1.718 1.532 2.242 2.682.523 1.15.785 2.499.785 4.047v.842h-10.39c.19 1.159.658 2.07 1.403 2.736.745.665 1.686.998 2.824.998.912 0 1.698-.136 2.357-.407a5.997 5.997 0 001.856-1.236l1.625 1.996c-1.616 1.485-3.599 2.227-5.946 2.227zm2.235-11.278c-.642-.656-1.481-.984-2.52-.984-1.011 0-1.858.335-2.54 1.005-.681.67-1.113 1.57-1.293 2.702h7.45c-.09-1.159-.456-2.066-1.097-2.723zm7.748-.712h-2.817V7.492h2.817V3.337h2.953v4.155h4.28v2.512h-4.28v6.369c0 1.059.18 1.815.542 2.267.36.453.98.68 1.855.68.389 0 .718-.016.99-.048l.426-.056c.15-.022.305-.046.467-.073v2.485a8.876 8.876 0 01-2.452.34c-3.187 0-4.781-1.748-4.781-5.242v-6.722zM101 21.654h-2.899v-1.982a5.24 5.24 0 01-1.964 1.718c-.795.403-1.698.604-2.71.604-1.245 0-2.35-.319-3.311-.957-.962-.638-1.718-1.517-2.269-2.635-.55-1.118-.826-2.396-.826-3.836 0-1.448.28-2.73.84-3.843.56-1.113 1.334-1.987 2.323-2.62.989-.634 2.124-.951 3.406-.951.967 0 1.834.188 2.601.563a5.145 5.145 0 011.91 1.596V7.49H101v14.164zm-2.953-9.206c-.316-.806-.815-1.442-1.497-1.908-.682-.466-1.47-.7-2.363-.7-1.265 0-2.272.426-3.021 1.277-.75.851-1.125 2-1.124 3.45 0 1.457.36 2.611 1.083 3.462.722.851 1.702 1.276 2.94 1.276.911 0 1.724-.235 2.438-.706a3.987 3.987 0 001.544-1.9v-4.251z"}),c.jsx("path",{d:"M8.627 0h-.029l-.04 3.27.028-.001c2.146 0 3.81 1.696 7.43 7.807l.22.372.014.024 2.026-3.047-.014-.023a60.949 60.949 0 00-1.374-2.146 35.014 35.014 0 00-1.47-2.036C13.026 1.165 11.024 0 8.628 0z",fill:l.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M8.598 0C6.19.013 4.062 1.573 2.525 3.961a5.44 5.44 0 00-.013.021l2.82 1.54.015-.022c.897-1.354 2.014-2.218 3.211-2.23l.027-.001L8.627 0h-.03z",fill:d.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M2.525 3.963l-.013.02C1.502 5.56.749 7.494.342 9.58l-.005.027 3.17.75c0-.01.002-.018.004-.028.339-1.833.984-3.533 1.822-4.806l.013-.02-2.82-1.54z",fill:u.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M3.511 10.33L.342 9.582l-.005.027A18.541 18.541 0 000 13.09v.028l3.25.292v-.029a15.728 15.728 0 01.262-3.05z",fill:f.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M3.349 14.422a6.822 6.822 0 01-.099-1.017v-.028L0 13.085v.031a11.105 11.105 0 00.183 2.064l3.17-.731a5.131 5.131 0 01-.004-.027z",fill:p.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M4.09 16.112c-.354-.387-.605-.945-.736-1.659l-.005-.027-3.171.731.005.027c.24 1.262.71 2.313 1.383 3.108l.018.022 2.524-2.181a2.635 2.635 0 01-.019-.02z",fill:g.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M15.484 9.067a399.491 399.491 0 00-3.069 4.781c-2.545 4-3.426 4.897-4.843 4.897-.591 0-1.085-.211-1.464-.615a2.313 2.313 0 01-.019-.02l-2.523 2.18.018.021C4.514 21.397 5.825 22 7.448 22c2.456 0 4.222-1.16 7.361-6.662l2.21-3.913a51.6 51.6 0 00-1.535-2.358z",fill:"#0082FB"}),c.jsx("path",{d:"M16.89 2.432a19.722 19.722 0 00-1.471 1.79c.472.604.96 1.281 1.47 2.038.6-.93 1.16-1.682 1.71-2.258l.019-.02-1.728-1.55z",fill:v.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M28.166 4.142C26.834 2.792 25.245 2 23.546 2c-1.79 0-3.297.984-4.656 2.43a6.451 6.451 0 00-.02.02L20.6 6l.019-.021c.895-.934 1.762-1.4 2.722-1.4 1.034 0 2.001.488 2.84 1.343l.019.02 1.987-1.78-.02-.02z",fill:"#0082FB"}),c.jsx("path",{d:"M30.019 12.656c-.075-4.333-1.588-8.207-3.833-10.495l-.02-.02-1.987 1.78.02.02c1.689 1.74 2.848 4.975 2.953 8.714v.028l2.867.001v-.028z",fill:b.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M30.02 12.687l-.001-.028h-2.867v.027c.005.176.008.352.008.53 0 1.02-.152 1.843-.461 2.438l-.014.027 2.137 2.228.016-.024c.776-1.2 1.183-2.868 1.183-4.89 0-.103 0-.205-.002-.308z",fill:_.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M26.7 15.65l-.015.026c-.267.502-.649.836-1.147.982l.974 3.079a4.372 4.372 0 00.547-.229 4.45 4.45 0 001.709-1.522 4.18 4.18 0 00.055-.081l.015-.025-2.139-2.23z",fill:k.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M24.917 16.742c-.327 0-.615-.049-.897-.175l-.998 3.151c.56.192 1.16.279 1.826.279.615 0 1.179-.092 1.69-.27l-.974-3.077c-.21.063-.428.094-.647.092z",fill:S.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M22.92 15.667l-.018-.021-2.296 2.393.02.02c.797.853 1.56 1.382 2.423 1.672l.997-3.15c-.364-.156-.716-.44-1.125-.914z",fill:C.fill,transform:"translate(2 2)"}),c.jsx("path",{d:"M22.902 15.643c-.688-.802-1.54-2.139-2.88-4.3l-1.746-2.92-.014-.023-2.026 3.046.014.024 1.237 2.087c1.2 2.012 2.177 3.467 3.12 4.48l.019.02 2.295-2.392a2.945 2.945 0 01-.019-.022z",fill:j.fill,transform:"translate(2 2)"}),c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:l.id,x1:"75.904%",x2:"33.275%",y1:"89.153%",y2:"23.044%",children:[c.jsx("stop",{offset:".06%",stopColor:"#0867DF"}),c.jsx("stop",{offset:"45.39%",stopColor:"#0668E1"}),c.jsx("stop",{offset:"100%",stopColor:"#0064E0"})]}),c.jsxs("linearGradient",{id:d.id,x1:"21.67%",x2:"97.068%",y1:"75.837%",y2:"24.022%",children:[c.jsx("stop",{offset:"13.23%",stopColor:"#0064DF"}),c.jsx("stop",{offset:"99.88%",stopColor:"#0064E0"})]}),c.jsxs("linearGradient",{id:u.id,x1:"38.247%",x2:"60.91%",y1:"89.127%",y2:"16.131%",children:[c.jsx("stop",{offset:"1.47%",stopColor:"#0072EC"}),c.jsx("stop",{offset:"68.81%",stopColor:"#0064DF"})]}),c.jsxs("linearGradient",{id:f.id,x1:"47.027%",x2:"52.153%",y1:"90.19%",y2:"15.745%",children:[c.jsx("stop",{offset:"7.31%",stopColor:"#007CF6"}),c.jsx("stop",{offset:"99.43%",stopColor:"#0072EC"})]}),c.jsxs("linearGradient",{id:p.id,x1:"52.155%",x2:"47.591%",y1:"58.289%",y2:"37.023%",children:[c.jsx("stop",{offset:"7.31%",stopColor:"#007FF9"}),c.jsx("stop",{offset:"100%",stopColor:"#007CF6"})]}),c.jsxs("linearGradient",{id:g.id,x1:"37.689%",x2:"61.961%",y1:"12.556%",y2:"63.605%",children:[c.jsx("stop",{offset:"7.31%",stopColor:"#007FF9"}),c.jsx("stop",{offset:"100%",stopColor:"#0082FB"})]}),c.jsxs("linearGradient",{id:v.id,x1:"42.496%",x2:"59.964%",y1:"56.072%",y2:"27.099%",children:[c.jsx("stop",{offset:"0%",stopColor:"#007FF8"}),c.jsx("stop",{offset:"100%",stopColor:"#0082FB"})]}),c.jsxs("linearGradient",{id:b.id,x1:"43.753%",x2:"57.613%",y1:"6.235%",y2:"98.514%",children:[c.jsx("stop",{offset:"0%",stopColor:"#0082FB"}),c.jsx("stop",{offset:"99.95%",stopColor:"#0081FA"})]}),c.jsxs("linearGradient",{id:_.id,x1:"60.07%",x2:"39.865%",y1:"4.661%",y2:"69.077%",children:[c.jsx("stop",{offset:"6.19%",stopColor:"#0081FA"}),c.jsx("stop",{offset:"100%",stopColor:"#0080F9"})]}),c.jsxs("linearGradient",{id:k.id,x1:"30.254%",x2:"61.097%",y1:"59.32%",y2:"33.244%",children:[c.jsx("stop",{offset:"0%",stopColor:"#027AF3"}),c.jsx("stop",{offset:"100%",stopColor:"#0080F9"})]}),c.jsxs("linearGradient",{id:S.id,x1:"20.433%",x2:"82.112%",y1:"50.001%",y2:"50.001%",children:[c.jsx("stop",{offset:"0%",stopColor:"#0377EF"}),c.jsx("stop",{offset:"99.94%",stopColor:"#0279F1"})]}),c.jsxs("linearGradient",{id:C.id,x1:"40.289%",x2:"72.427%",y1:"35.298%",y2:"57.811%",children:[c.jsx("stop",{offset:".19%",stopColor:"#0471E9"}),c.jsx("stop",{offset:"100%",stopColor:"#0377EF"})]}),c.jsxs("linearGradient",{id:j.id,x1:"32.228%",x2:"68.028%",y1:"19.719%",y2:"84.908%",children:[c.jsx("stop",{offset:"27.65%",stopColor:"#0867DF"}),c.jsx("stop",{offset:"100%",stopColor:"#0471E9"})]})]})]}))});function ow(e){"@babel/helpers - typeof";return ow=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ow(e)}var wXe=["size","style"];function vH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function cE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?vH(Object(n),!0).forEach(function(i){SXe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function SXe(e,r,n){return r=kXe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function kXe(e){var r=CXe(e,"string");return ow(r)=="symbol"?r:String(r)}function CXe(e,r){if(ow(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(ow(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function jXe(e,r){if(e==null)return{};var n=NXe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function NXe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var TXe=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=jXe(e,wXe);return c.jsxs("svg",cE(cE({fill:"currentColor",fillRule:"evenodd",height:n,style:cE({flex:"none",lineHeight:1},i),viewBox:"0 0 103 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Kh}),c.jsx("path",{d:"M38.337 2.641h3.752l6.38 11.57 6.38-11.57h3.671v19.011H55.46V7.082l-5.594 10.09h-2.872l-5.595-10.09v14.57h-3.06V2.642zm30.058 19.353c-1.418 0-2.664-.314-3.739-.944a6.594 6.594 0 01-2.513-2.614c-.6-1.113-.9-2.39-.9-3.829 0-1.457.293-2.748.88-3.87.587-1.123 1.402-2 2.445-2.635 1.043-.633 2.242-.95 3.596-.95 1.346 0 2.504.319 3.475.957.97.638 1.718 1.532 2.242 2.682.523 1.15.785 2.499.785 4.047v.842h-10.39c.19 1.159.658 2.07 1.403 2.736.745.665 1.686.998 2.824.998.912 0 1.698-.136 2.357-.407a5.997 5.997 0 001.856-1.236l1.625 1.996c-1.616 1.485-3.599 2.227-5.946 2.227zm2.235-11.278c-.642-.656-1.481-.984-2.52-.984-1.011 0-1.858.335-2.54 1.005-.681.67-1.113 1.57-1.293 2.702h7.45c-.09-1.159-.456-2.066-1.097-2.723zm7.748-.712h-2.817V7.492h2.817V3.337h2.953v4.155h4.28v2.512h-4.28v6.369c0 1.059.18 1.815.542 2.267.36.453.98.68 1.855.68.389 0 .718-.016.99-.048l.426-.056c.15-.022.305-.046.467-.073v2.485a8.88 8.88 0 01-2.452.34c-3.187 0-4.781-1.748-4.781-5.242v-6.722zM101 21.654h-2.899v-1.982a5.24 5.24 0 01-1.964 1.718c-.795.403-1.698.604-2.71.604-1.245 0-2.35-.319-3.311-.957-.962-.638-1.718-1.517-2.269-2.635-.55-1.118-.826-2.396-.826-3.836 0-1.448.28-2.73.84-3.843.56-1.113 1.334-1.987 2.323-2.62.989-.634 2.124-.951 3.406-.951.967 0 1.834.188 2.601.563a5.145 5.145 0 011.91 1.596V7.49H101v14.164zm-2.953-9.206c-.316-.806-.815-1.442-1.497-1.908-.682-.466-1.47-.7-2.363-.7-1.265 0-2.272.426-3.021 1.277-.75.851-1.125 2-1.124 3.45 0 1.457.36 2.611 1.083 3.462.722.851 1.702 1.276 2.94 1.276.911 0 1.724-.235 2.438-.706a3.987 3.987 0 001.544-1.9v-4.251zM10.627 2c2.396 0 4.398 1.165 6.792 4.22.375-.507.758-.99 1.153-1.438l.318-.352C20.249 2.984 21.755 2 23.546 2c1.604 0 3.11.706 4.395 1.92l.245.24c2.173 2.215 3.66 5.914 3.821 10.078l.012.446.002.311c0 1.896-.358 3.48-1.042 4.66l-.157.254-.134.19a4.45 4.45 0 01-1.629 1.41l-.17.08a4.372 4.372 0 01-.377.148c-.505.17-1.06.26-1.664.26-.656 0-1.246-.084-1.8-.27-.784-.26-1.485-.72-2.206-1.443l-.236-.245c-.942-1.015-1.92-2.47-3.119-4.482l-1.472-2.481c-.171-.29-.338-.57-.5-.839l-.497-.812-2.209 3.913-.377.652-.373.623C11.374 21.023 9.701 22 7.449 22c-1.528 0-2.78-.534-3.696-1.501l-.187-.207c-.617-.729-1.063-1.673-1.318-2.797l-.07-.338a10.856 10.856 0 01-.17-1.61L2 15.084c.002-.97.08-1.941.235-2.902l.107-.603C2.72 9.643 3.396 7.837 4.3 6.327l.226-.366c1.482-2.303 3.514-3.836 5.816-3.954L10.627 2zm.114 3.272l-.183-.003c-1.13.012-2.19.784-3.06 2.01l-.153.222-.012.022c-.774 1.175-1.383 2.714-1.738 4.386l-.089.448c-.17.93-.257 1.873-.259 2.818l.003.235c.005.224.022.45.05.675l.054.364c.117.639.328 1.15.621 1.528l.113.133.02.02c.379.404.873.615 1.464.615 1.348 0 2.21-.811 4.482-4.333l2.286-3.578 1.144-1.767-.25-.354c-1.744-2.429-2.965-3.32-4.34-3.432l-.153-.009zm12.599-.693l-.204.007c-.88.062-1.687.526-2.518 1.393l-.02.023c-.549.576-1.11 1.329-1.71 2.258.352.52.715 1.082 1.09 1.683l.298.48 1.746 2.92.748 1.2.527.83c.607.946 1.085 1.641 1.5 2.146l.124.146c.358.416.672.686.989.852l.108.051c.284.125.572.174.899.174.22.002.437-.03.647-.092.43-.132.774-.409 1.03-.815l.106-.185.087-.181c.25-.576.373-1.336.373-2.253l-.002-.266-.006-.292c-.102-3.612-1.185-6.752-2.78-8.53l-.193-.206c-.838-.855-1.805-1.343-2.84-1.343z"})]}))});function aw(e){"@babel/helpers - typeof";return aw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},aw(e)}var EXe=["size","style"];function xH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function uE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?xH(Object(n),!0).forEach(function(i){AXe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function AXe(e,r,n){return r=OXe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function OXe(e){var r=RXe(e,"string");return aw(r)=="symbol"?r:String(r)}function RXe(e,r){if(aw(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(aw(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function MXe(e,r){return DXe(e)||$Xe(e,r)||LXe(e,r)||PXe()}function PXe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|