@jait/gateway 0.1.483 → 0.1.484
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channels/whatsapp/connector.d.ts +3 -1
- package/dist/channels/whatsapp/connector.d.ts.map +1 -1
- package/dist/channels/whatsapp/connector.js +6 -5
- package/dist/channels/whatsapp/connector.js.map +1 -1
- package/package.json +1 -1
- package/web-dist/assets/{_basePickBy-Cv8sLHtL.js → _basePickBy-DyIN4qve.js} +1 -1
- package/web-dist/assets/{_baseUniq-Bawo1VN_.js → _baseUniq-nuNp_ZDG.js} +1 -1
- package/web-dist/assets/{arc-CsWiIjaF.js → arc-DIrGvMOS.js} +1 -1
- package/web-dist/assets/{architectureDiagram-2XIMDMQ5-DvM3nhXv.js → architectureDiagram-2XIMDMQ5-DXqVqRgD.js} +1 -1
- package/web-dist/assets/{blockDiagram-WCTKOSBZ-Ct8phQmq.js → blockDiagram-WCTKOSBZ-DwtfBpBB.js} +1 -1
- package/web-dist/assets/{c4Diagram-IC4MRINW-Ctsv3MNN.js → c4Diagram-IC4MRINW-D6W2i2Ca.js} +1 -1
- package/web-dist/assets/channel-Br156KjP.js +1 -0
- package/web-dist/assets/{chunk-4BX2VUAB-BuHFHRlg.js → chunk-4BX2VUAB-DiFJ-rdO.js} +1 -1
- package/web-dist/assets/{chunk-55IACEB6-DqOE-dU6.js → chunk-55IACEB6-BaQ2J5qV.js} +1 -1
- package/web-dist/assets/{chunk-FMBD7UC4-F3EzdA6G.js → chunk-FMBD7UC4-CKpbFa6r.js} +1 -1
- package/web-dist/assets/{chunk-JSJVCQXG-B4UV-S0n.js → chunk-JSJVCQXG-C9iT3S_G.js} +1 -1
- package/web-dist/assets/{chunk-KX2RTZJC-D5SG8B2I.js → chunk-KX2RTZJC-BXw8-zUX.js} +1 -1
- package/web-dist/assets/{chunk-NQ4KR5QH-BjX57Tk0.js → chunk-NQ4KR5QH-DYC_22M_.js} +1 -1
- package/web-dist/assets/{chunk-QZHKN3VN-DdelFc9a.js → chunk-QZHKN3VN-D0VM1fXz.js} +1 -1
- package/web-dist/assets/{chunk-WL4C6EOR-DjtSivly.js → chunk-WL4C6EOR-BdTDfszd.js} +1 -1
- package/web-dist/assets/classDiagram-VBA2DB6C-K4_5k-1u.js +1 -0
- package/web-dist/assets/classDiagram-v2-RAHNMMFH-K4_5k-1u.js +1 -0
- package/web-dist/assets/clone-BzDoXm8a.js +1 -0
- package/web-dist/assets/{cose-bilkent-S5V4N54A-CuBfMENm.js → cose-bilkent-S5V4N54A-DS1ZVVu1.js} +1 -1
- package/web-dist/assets/{dagre-KLK3FWXG-BV32d-IF.js → dagre-KLK3FWXG-B3D0kfsZ.js} +1 -1
- package/web-dist/assets/{diagram-E7M64L7V-CGJYQZ3c.js → diagram-E7M64L7V-Dx9vKa0I.js} +1 -1
- package/web-dist/assets/{diagram-IFDJBPK2-D0vGFqqJ.js → diagram-IFDJBPK2-BRrYTTMU.js} +1 -1
- package/web-dist/assets/{diagram-P4PSJMXO-DTsy2wXx.js → diagram-P4PSJMXO-BnKTNbr0.js} +1 -1
- package/web-dist/assets/{erDiagram-INFDFZHY-CqPAX40F.js → erDiagram-INFDFZHY-BVTmzkaD.js} +1 -1
- package/web-dist/assets/{flowDiagram-PKNHOUZH-Cg249OU-.js → flowDiagram-PKNHOUZH-Dmx06hxo.js} +1 -1
- package/web-dist/assets/{ganttDiagram-A5KZAMGK-41jyehKD.js → ganttDiagram-A5KZAMGK-C42lw8sD.js} +1 -1
- package/web-dist/assets/{gitGraphDiagram-K3NZZRJ6-D-ky6MFq.js → gitGraphDiagram-K3NZZRJ6-edx9tuIF.js} +1 -1
- package/web-dist/assets/{graph-Bvno7jDH.js → graph-CHSFefEi.js} +1 -1
- package/web-dist/assets/{index-DgGQx1pV.css → index-BOcrDDn1.css} +1 -1
- package/web-dist/assets/{index-C_ItXddk.js → index-Crcb3fxD.js} +1 -1
- package/web-dist/assets/{index-_Uc2smUO.js → index-DMwDdyzl.js} +5 -5
- package/web-dist/assets/{index-CHmFQMfN.js → index-F9jIjXpV.js} +1 -1
- package/web-dist/assets/{infoDiagram-LFFYTUFH-CWQwI929.js → infoDiagram-LFFYTUFH-DHZVpOBK.js} +1 -1
- package/web-dist/assets/{ishikawaDiagram-PHBUUO56-H90Z4rtm.js → ishikawaDiagram-PHBUUO56-DUECtdZX.js} +1 -1
- package/web-dist/assets/{journeyDiagram-4ABVD52K-CqbOmGkV.js → journeyDiagram-4ABVD52K-DsJZfSyN.js} +1 -1
- package/web-dist/assets/{kanban-definition-K7BYSVSG-CmY4ZO-b.js → kanban-definition-K7BYSVSG-BufyvHP-.js} +1 -1
- package/web-dist/assets/{layout-UeuDuzK6.js → layout-CU3LULB2.js} +1 -1
- package/web-dist/assets/{linear-DaPqut5S.js → linear-BEer2r-q.js} +1 -1
- package/web-dist/assets/{mindmap-definition-YRQLILUH-CIksWrmx.js → mindmap-definition-YRQLILUH-C0_OllT-.js} +1 -1
- package/web-dist/assets/{pieDiagram-SKSYHLDU-BEgcziNg.js → pieDiagram-SKSYHLDU-B7ePcbjv.js} +1 -1
- package/web-dist/assets/{quadrantDiagram-337W2JSQ-DdwCORyV.js → quadrantDiagram-337W2JSQ-DjCvFqay.js} +1 -1
- package/web-dist/assets/{requirementDiagram-Z7DCOOCP-D1NUPX9d.js → requirementDiagram-Z7DCOOCP-BUP0LpDa.js} +1 -1
- package/web-dist/assets/{sankeyDiagram-WA2Y5GQK-DAYv6MPr.js → sankeyDiagram-WA2Y5GQK-D0S2AsyJ.js} +1 -1
- package/web-dist/assets/{sequenceDiagram-2WXFIKYE-gdGy2y-o.js → sequenceDiagram-2WXFIKYE-DL_pX6qe.js} +1 -1
- package/web-dist/assets/{stateDiagram-RAJIS63D-KFK7beMU.js → stateDiagram-RAJIS63D-DnbTcmJ8.js} +1 -1
- package/web-dist/assets/stateDiagram-v2-FVOUBMTO-DYiFxPL4.js +1 -0
- package/web-dist/assets/{timeline-definition-YZTLITO2-B3WxE2Cq.js → timeline-definition-YZTLITO2-C5ZkP-QO.js} +1 -1
- package/web-dist/assets/{treemap-KZPCXAKY-fRGEMfkq.js → treemap-KZPCXAKY-DbqXjUBz.js} +1 -1
- package/web-dist/assets/{vennDiagram-LZ73GAT5-DjTtoKR3.js → vennDiagram-LZ73GAT5-C4VkcwHn.js} +1 -1
- package/web-dist/assets/{xychartDiagram-JWTSCODW-CRNkc08r.js → xychartDiagram-JWTSCODW-RqBcb5lT.js} +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/assets/channel-BujblkgT.js +0 -1
- package/web-dist/assets/classDiagram-VBA2DB6C-Bu9UkybU.js +0 -1
- package/web-dist/assets/classDiagram-v2-RAHNMMFH-Bu9UkybU.js +0 -1
- package/web-dist/assets/clone--2ciFQ3q.js +0 -1
- package/web-dist/assets/stateDiagram-v2-FVOUBMTO-DfDTrxg2.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-B3D0kfsZ.js","./graph-CHSFefEi.js","./_baseUniq-nuNp_ZDG.js","./layout-CU3LULB2.js","./_basePickBy-DyIN4qve.js","./clone-BzDoXm8a.js","./cose-bilkent-S5V4N54A-DS1ZVVu1.js","./cytoscape.esm-BQaXIfA_.js","./c4Diagram-IC4MRINW-D6W2i2Ca.js","./chunk-JSJVCQXG-C9iT3S_G.js","./flowDiagram-PKNHOUZH-Dmx06hxo.js","./chunk-FMBD7UC4-CKpbFa6r.js","./chunk-55IACEB6-BaQ2J5qV.js","./chunk-KX2RTZJC-BXw8-zUX.js","./channel-Br156KjP.js","./erDiagram-INFDFZHY-BVTmzkaD.js","./gitGraphDiagram-K3NZZRJ6-edx9tuIF.js","./chunk-4BX2VUAB-DiFJ-rdO.js","./chunk-QZHKN3VN-D0VM1fXz.js","./treemap-KZPCXAKY-DbqXjUBz.js","./ganttDiagram-A5KZAMGK-C42lw8sD.js","./linear-BEer2r-q.js","./defaultLocale-DX6XiGOO.js","./infoDiagram-LFFYTUFH-DHZVpOBK.js","./pieDiagram-SKSYHLDU-B7ePcbjv.js","./arc-DIrGvMOS.js","./quadrantDiagram-337W2JSQ-DjCvFqay.js","./xychartDiagram-JWTSCODW-RqBcb5lT.js","./requirementDiagram-Z7DCOOCP-BUP0LpDa.js","./sequenceDiagram-2WXFIKYE-DL_pX6qe.js","./classDiagram-VBA2DB6C-K4_5k-1u.js","./chunk-WL4C6EOR-BdTDfszd.js","./classDiagram-v2-RAHNMMFH-K4_5k-1u.js","./stateDiagram-RAJIS63D-DnbTcmJ8.js","./chunk-NQ4KR5QH-DYC_22M_.js","./stateDiagram-v2-FVOUBMTO-DYiFxPL4.js","./journeyDiagram-4ABVD52K-DsJZfSyN.js","./timeline-definition-YZTLITO2-C5ZkP-QO.js","./mindmap-definition-YRQLILUH-C0_OllT-.js","./kanban-definition-K7BYSVSG-BufyvHP-.js","./diagram-P4PSJMXO-BnKTNbr0.js","./diagram-IFDJBPK2-BRrYTTMU.js","./blockDiagram-WCTKOSBZ-DwtfBpBB.js","./architectureDiagram-2XIMDMQ5-DXqVqRgD.js","./diagram-E7M64L7V-Dx9vKa0I.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Ffe=Object.defineProperty;var Hfe=(e,r,n)=>r in e?Ffe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var Ke=(e,r,n)=>Hfe(e,typeof r!="symbol"?r+"":r,n);function Wfe(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 a=Object.getOwnPropertyDescriptor(i,s);a&&Object.defineProperty(e,s,a.get?a:{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 a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function my(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bxt(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 X6={exports:{}},Cb={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -934,7 +934,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
934
934
|
monaco.config({ paths: { vs: '...' } })
|
|
935
935
|
|
|
936
936
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
937
|
-
`},hF=$$e(z$e)(Qee),F$e={config:I$e},H$e=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(a,o){return o(a)},s)}};function ete(e,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&e[n]&&Object.assign(r[n],ete(e[n],r[n]))}),cF(cF({},e),r)}var W$e={type:"cancelation",msg:"operation is manually canceled"};function LE(e){var r=!1,n=new Promise(function(i,s){e.then(function(a){return r?s(W$e):i(a)}),e.catch(s)});return n.cancel=function(){return r=!0},n}var U$e=["monaco"],V$e=P$e.create({config:L$e,isInitialized:!1,resolve:null,reject:null,monaco:null}),tte=g$e(V$e,2),uk=tte[0],CN=tte[1];function q$e(e){var r=F$e.config(e),n=r.monaco,i=p$e(r,U$e);CN(function(s){return{config:ete(s.config,i),monaco:n}})}function G$e(){var e=uk(function(r){var n=r.monaco,i=r.isInitialized,s=r.resolve;return{monaco:n,isInitialized:i,resolve:s}});if(!e.isInitialized){if(CN({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),LE($E);if(window.monaco&&window.monaco.editor)return rte(window.monaco),e.resolve(window.monaco),LE($E);H$e(K$e,X$e)(J$e)}return LE($E)}function K$e(e){return document.body.appendChild(e)}function Y$e(e){var r=document.createElement("script");return e&&(r.src=e),r}function X$e(e){var r=uk(function(i){var s=i.config,a=i.reject;return{config:s,reject:a}}),n=Y$e("".concat(r.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=r.reject,n}function J$e(){var e=uk(function(n){var i=n.config,s=n.resolve,a=n.reject;return{config:i,resolve:s,reject:a}}),r=window.require;r.config(e.config),r(["vs/editor/editor.main"],function(n){var i=n.m||n;rte(i),e.resolve(i)},function(n){e.reject(n)})}function rte(e){uk().monaco||CN({monaco:e})}function Z$e(){return uk(function(e){var r=e.monaco;return r})}var $E=new Promise(function(e,r){return CN({resolve:e,reject:r})}),jN={config:q$e,init:G$e,__getMonacoInstance:Z$e};const nte=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"}')),Q$e=Object.freeze(Object.defineProperty({__proto__:null,default:nte},Symbol.toStringTag,{value:"Module"})),eDe=["editor theme","vscode theme","monaco theme","workbench colors"],DE=new Set,Ww="dark-plus",fF=new WeakSet,pF=nte,tDe={"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"},rDe={base:"vs-dark",inherit:!1,rules:[...ste(pF.tokenColors??[]),...cDe()],colors:{...ate(pF.colors??{}),...tDe}};function nDe(){return eDe}function ite(e){var r,n;(n=(r=e==null?void 0:e.editor)==null?void 0:r.defineTheme)==null||n.call(r,Ww,rDe)}function iDe(e){!e||typeof e!="object"||fF.has(e)||(fF.add(e),Promise.all([rt(()=>import("./index-C_ItXddk.js"),[],import.meta.url),rt(()=>import("./index-CHmFQMfN.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(h=>h.id))??[]);for(const h of["javascript","typescript","json","css","html","markdown","python","yaml","diff"])s.has(h)||((d=i==null?void 0:i.register)==null||d.call(i,{id:h}),s.add(h));const a=await n({themes:["dark-plus"],langs:["javascript","typescript","jsx","tsx","json","css","html","markdown","python","yaml","diff"]});r(a,e),ite(e);const o=e.editor;typeof document<"u"&&document.documentElement.dataset.monacoTheme===Ww&&((u=o==null?void 0:o.setTheme)==null||u.call(o,Ww))}).catch(r=>{console.error("Failed to initialize Shiki Monaco Dark Plus theme:",r)}))}function sDe(e){var o;const r=aDe(e.text),n=ate(r.colors??{}),i=dDe(r,n),s=((o=r.name)==null?void 0:o.trim())||e.sourceLabel.trim()||"Imported Theme",a=`jait-vscode-${vDe(s)}-${e.id}`;return{id:e.id,name:s,sourceLabel:e.sourceLabel,importedAt:e.importedAt??new Date().toISOString(),colorMode:i,monacoThemeName:a,monacoThemeData:{base:i==="dark"?"vs-dark":"vs",inherit:!0,rules:ste(r.tokenColors??[]),colors:n},cssVariables:uDe(n),rawColors:n,hasInclude:typeof r.include=="string"&&r.include.trim().length>0}}function aDe(e){const r=yDe(gDe(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 oDe(e,r){var n;!r||!((n=e==null?void 0:e.editor)!=null&&n.defineTheme)||e.editor.defineTheme(r.monacoThemeName,r.monacoThemeData)}function lDe(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 DE)r.style.removeProperty(n);if(DE.clear(),!!e.theme)for(const[n,i]of Object.entries(e.theme.cssVariables))r.style.setProperty(n,i),DE.add(n)}function ste(e){var n;const r=[];for(const i of e){const s=i.settings??{},a=hDe(i.scope);if(a.length===0)continue;const o=gF(s.foreground),l=gF(s.background),d=((n=s.fontStyle)==null?void 0:n.trim())||void 0;for(const u of a)r.push({token:u,foreground:o,background:l,fontStyle:d})}return r}function cDe(){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 uDe(e){const r={},n=li(e,["editor.background","sideBar.background","panel.background"]),i=li(e,["editor.foreground","foreground"]),s=li(e,["sideBar.background","panel.background","editorWidget.background"]),a=li(e,["panel.background","tab.inactiveBackground","editorGroupHeader.tabsBackground"]),o=li(e,["list.hoverBackground","tab.activeBackground","editor.lineHighlightBackground"]),l=li(e,["button.background","focusBorder","textLink.foreground"]),d=li(e,["widget.border","panel.border","sideBar.border","contrastBorder"]);$i(r,"--background",n),$i(r,"--foreground",i),$i(r,"--card",s),$i(r,"--card-foreground",li(e,["sideBar.foreground","foreground"])??i),$i(r,"--popover",li(e,["editorWidget.background","panel.background"])??s),$i(r,"--popover-foreground",li(e,["editorWidget.foreground","foreground"])??i),$i(r,"--primary",l),$i(r,"--primary-foreground",mF(l)),$i(r,"--secondary",li(e,["tab.inactiveBackground","panel.background"])??a),$i(r,"--secondary-foreground",li(e,["tab.inactiveForeground","foreground"])??i),$i(r,"--muted",a),$i(r,"--muted-foreground",li(e,["descriptionForeground","input.placeholderForeground","disabledForeground"])),$i(r,"--accent",o),$i(r,"--accent-foreground",li(e,["list.activeSelectionForeground","foreground"])??i),$i(r,"--destructive",li(e,["inputValidation.errorBackground","errorForeground","list.errorForeground"])),$i(r,"--destructive-foreground",mF(li(e,["inputValidation.errorBackground","errorForeground"]))),$i(r,"--border",d),$i(r,"--input",li(e,["input.background","editorWidget.background","dropdown.background"])??d),$i(r,"--ring",li(e,["focusBorder","button.background","textLink.foreground"])??l),$i(r,"--scrollbar-track",li(e,["editor.background","sideBar.background","panel.background"])??n),$i(r,"--scrollbar-thumb",li(e,["scrollbarSlider.background","scrollbar.shadow"])),$i(r,"--scrollbar-thumb-hover",li(e,["scrollbarSlider.hoverBackground","scrollbarSlider.activeBackground","scrollbarSlider.background"])),$i(r,"--toast-bg",li(e,["notifications.background","editorWidget.background","panel.background"])??s,!0),$i(r,"--toast-border",li(e,["notifications.border","widget.border","panel.border"])??d,!0),$i(r,"--toast-success-accent",li(e,["testing.iconPassed","terminal.ansiGreen"])),$i(r,"--toast-info-accent",li(e,["textLink.foreground","focusBorder"])??l),$i(r,"--toast-warning-accent",li(e,["editorWarning.foreground","terminal.ansiYellow"])),$i(r,"--toast-error-accent",li(e,["editorError.foreground","terminal.ansiRed"]));const u=li(e,["editorGroupHeader.tabsBackground","tab.inactiveBackground","sideBar.background"]);u&&(r["--tab-bg"]=u);const h=li(e,["activityBarBadge.background","button.background","focusBorder"]),f=li(e,["textLink.foreground","terminal.ansiBlue"]),g=li(e,["editorWarning.foreground","terminal.ansiYellow"]),v=li(e,["terminal.ansiMagenta","badge.background"]);return h&&(r["--ctx-system"]=h),f&&(r["--ctx-history"]=f),g&&(r["--ctx-tool-results"]=g),v&&(r["--ctx-tools"]=v),r}function $i(e,r,n,i=!1){if(!n)return;const s=fDe(n,i);s&&(e[r]=s)}function mF(e){const r=G9(e);return r?(.2126*r.r+.7152*r.g+.0722*r.b)/255>.55?"0 0% 7%":"0 0% 100%":null}function dDe(e,r){if(e.type==="light"||e.type==="hc-light")return"light";if(e.type==="dark"||e.type==="hc-dark")return"dark";const n=G9(r["editor.background"]??r["sideBar.background"]??"");return n&&(.2126*n.r+.7152*n.g+.0722*n.b)/255>.55?"light":"dark"}function ate(e){const r={};for(const[n,i]of Object.entries(e))typeof i=="string"&&i.trim()&&(r[n]=i.trim());return r}function hDe(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 gF(e){if(!e)return;const r=e.trim();if(r.startsWith("#"))return ote(r).slice(1)}function li(e,r){for(const n of r){const i=e[n];if(typeof i=="string"&&i.trim())return i.trim()}return null}function fDe(e,r=!1){const n=G9(e);if(!n)return null;const i=n.r/255,s=n.g/255,a=n.b/255,o=Math.max(i,s,a),l=Math.min(i,s,a),d=o-l,u=(o+l)/2;let h=0;d!==0&&(o===i?h=(s-a)/d%6:o===s?h=(a-i)/d+2:h=(i-s)/d+4,h*=60),h<0&&(h+=360);const f=d===0?0:d/(1-Math.abs(2*u-1)),g=`${Math.round(h)} ${Math.round(f*100)}% ${Math.round(u*100)}%`;return r&&n.a<1?`${g} / ${Number(n.a.toFixed(3))}`:g}function G9(e){if(!e)return null;const r=e.trim();if(!r)return null;if(r.startsWith("#"))return pDe(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=IE(i[0]),a=IE(i[1]),o=IE(i[2]),l=i[3]==null?1:mDe(i[3]);return s==null||a==null||o==null||l==null?null:{r:s,g:a,b:o,a:l}}function pDe(e){const r=ote(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 IE(e){if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,-1));return Number.isFinite(n)?yF(Math.round(n/100*255)):null}const r=Number.parseFloat(e);return Number.isFinite(r)?yF(Math.round(r)):null}function mDe(e){const r=Number.parseFloat(e);return Number.isFinite(r)?Math.max(0,Math.min(1,r)):null}function yF(e){return Math.max(0,Math.min(255,e))}function ote(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 gDe(e){let r="",n=!1,i=!1,s=!1,a=!1;for(let o=0;o<e.length;o+=1){const l=e[o],d=e[o+1];if(i){l===`
|
|
937
|
+
`},hF=$$e(z$e)(Qee),F$e={config:I$e},H$e=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(a,o){return o(a)},s)}};function ete(e,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&e[n]&&Object.assign(r[n],ete(e[n],r[n]))}),cF(cF({},e),r)}var W$e={type:"cancelation",msg:"operation is manually canceled"};function LE(e){var r=!1,n=new Promise(function(i,s){e.then(function(a){return r?s(W$e):i(a)}),e.catch(s)});return n.cancel=function(){return r=!0},n}var U$e=["monaco"],V$e=P$e.create({config:L$e,isInitialized:!1,resolve:null,reject:null,monaco:null}),tte=g$e(V$e,2),uk=tte[0],CN=tte[1];function q$e(e){var r=F$e.config(e),n=r.monaco,i=p$e(r,U$e);CN(function(s){return{config:ete(s.config,i),monaco:n}})}function G$e(){var e=uk(function(r){var n=r.monaco,i=r.isInitialized,s=r.resolve;return{monaco:n,isInitialized:i,resolve:s}});if(!e.isInitialized){if(CN({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),LE($E);if(window.monaco&&window.monaco.editor)return rte(window.monaco),e.resolve(window.monaco),LE($E);H$e(K$e,X$e)(J$e)}return LE($E)}function K$e(e){return document.body.appendChild(e)}function Y$e(e){var r=document.createElement("script");return e&&(r.src=e),r}function X$e(e){var r=uk(function(i){var s=i.config,a=i.reject;return{config:s,reject:a}}),n=Y$e("".concat(r.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=r.reject,n}function J$e(){var e=uk(function(n){var i=n.config,s=n.resolve,a=n.reject;return{config:i,resolve:s,reject:a}}),r=window.require;r.config(e.config),r(["vs/editor/editor.main"],function(n){var i=n.m||n;rte(i),e.resolve(i)},function(n){e.reject(n)})}function rte(e){uk().monaco||CN({monaco:e})}function Z$e(){return uk(function(e){var r=e.monaco;return r})}var $E=new Promise(function(e,r){return CN({resolve:e,reject:r})}),jN={config:q$e,init:G$e,__getMonacoInstance:Z$e};const nte=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"}')),Q$e=Object.freeze(Object.defineProperty({__proto__:null,default:nte},Symbol.toStringTag,{value:"Module"})),eDe=["editor theme","vscode theme","monaco theme","workbench colors"],DE=new Set,Ww="dark-plus",fF=new WeakSet,pF=nte,tDe={"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"},rDe={base:"vs-dark",inherit:!1,rules:[...ste(pF.tokenColors??[]),...cDe()],colors:{...ate(pF.colors??{}),...tDe}};function nDe(){return eDe}function ite(e){var r,n;(n=(r=e==null?void 0:e.editor)==null?void 0:r.defineTheme)==null||n.call(r,Ww,rDe)}function iDe(e){!e||typeof e!="object"||fF.has(e)||(fF.add(e),Promise.all([rt(()=>import("./index-Crcb3fxD.js"),[],import.meta.url),rt(()=>import("./index-F9jIjXpV.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(h=>h.id))??[]);for(const h of["javascript","typescript","json","css","html","markdown","python","yaml","diff"])s.has(h)||((d=i==null?void 0:i.register)==null||d.call(i,{id:h}),s.add(h));const a=await n({themes:["dark-plus"],langs:["javascript","typescript","jsx","tsx","json","css","html","markdown","python","yaml","diff"]});r(a,e),ite(e);const o=e.editor;typeof document<"u"&&document.documentElement.dataset.monacoTheme===Ww&&((u=o==null?void 0:o.setTheme)==null||u.call(o,Ww))}).catch(r=>{console.error("Failed to initialize Shiki Monaco Dark Plus theme:",r)}))}function sDe(e){var o;const r=aDe(e.text),n=ate(r.colors??{}),i=dDe(r,n),s=((o=r.name)==null?void 0:o.trim())||e.sourceLabel.trim()||"Imported Theme",a=`jait-vscode-${vDe(s)}-${e.id}`;return{id:e.id,name:s,sourceLabel:e.sourceLabel,importedAt:e.importedAt??new Date().toISOString(),colorMode:i,monacoThemeName:a,monacoThemeData:{base:i==="dark"?"vs-dark":"vs",inherit:!0,rules:ste(r.tokenColors??[]),colors:n},cssVariables:uDe(n),rawColors:n,hasInclude:typeof r.include=="string"&&r.include.trim().length>0}}function aDe(e){const r=yDe(gDe(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 oDe(e,r){var n;!r||!((n=e==null?void 0:e.editor)!=null&&n.defineTheme)||e.editor.defineTheme(r.monacoThemeName,r.monacoThemeData)}function lDe(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 DE)r.style.removeProperty(n);if(DE.clear(),!!e.theme)for(const[n,i]of Object.entries(e.theme.cssVariables))r.style.setProperty(n,i),DE.add(n)}function ste(e){var n;const r=[];for(const i of e){const s=i.settings??{},a=hDe(i.scope);if(a.length===0)continue;const o=gF(s.foreground),l=gF(s.background),d=((n=s.fontStyle)==null?void 0:n.trim())||void 0;for(const u of a)r.push({token:u,foreground:o,background:l,fontStyle:d})}return r}function cDe(){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 uDe(e){const r={},n=li(e,["editor.background","sideBar.background","panel.background"]),i=li(e,["editor.foreground","foreground"]),s=li(e,["sideBar.background","panel.background","editorWidget.background"]),a=li(e,["panel.background","tab.inactiveBackground","editorGroupHeader.tabsBackground"]),o=li(e,["list.hoverBackground","tab.activeBackground","editor.lineHighlightBackground"]),l=li(e,["button.background","focusBorder","textLink.foreground"]),d=li(e,["widget.border","panel.border","sideBar.border","contrastBorder"]);$i(r,"--background",n),$i(r,"--foreground",i),$i(r,"--card",s),$i(r,"--card-foreground",li(e,["sideBar.foreground","foreground"])??i),$i(r,"--popover",li(e,["editorWidget.background","panel.background"])??s),$i(r,"--popover-foreground",li(e,["editorWidget.foreground","foreground"])??i),$i(r,"--primary",l),$i(r,"--primary-foreground",mF(l)),$i(r,"--secondary",li(e,["tab.inactiveBackground","panel.background"])??a),$i(r,"--secondary-foreground",li(e,["tab.inactiveForeground","foreground"])??i),$i(r,"--muted",a),$i(r,"--muted-foreground",li(e,["descriptionForeground","input.placeholderForeground","disabledForeground"])),$i(r,"--accent",o),$i(r,"--accent-foreground",li(e,["list.activeSelectionForeground","foreground"])??i),$i(r,"--destructive",li(e,["inputValidation.errorBackground","errorForeground","list.errorForeground"])),$i(r,"--destructive-foreground",mF(li(e,["inputValidation.errorBackground","errorForeground"]))),$i(r,"--border",d),$i(r,"--input",li(e,["input.background","editorWidget.background","dropdown.background"])??d),$i(r,"--ring",li(e,["focusBorder","button.background","textLink.foreground"])??l),$i(r,"--scrollbar-track",li(e,["editor.background","sideBar.background","panel.background"])??n),$i(r,"--scrollbar-thumb",li(e,["scrollbarSlider.background","scrollbar.shadow"])),$i(r,"--scrollbar-thumb-hover",li(e,["scrollbarSlider.hoverBackground","scrollbarSlider.activeBackground","scrollbarSlider.background"])),$i(r,"--toast-bg",li(e,["notifications.background","editorWidget.background","panel.background"])??s,!0),$i(r,"--toast-border",li(e,["notifications.border","widget.border","panel.border"])??d,!0),$i(r,"--toast-success-accent",li(e,["testing.iconPassed","terminal.ansiGreen"])),$i(r,"--toast-info-accent",li(e,["textLink.foreground","focusBorder"])??l),$i(r,"--toast-warning-accent",li(e,["editorWarning.foreground","terminal.ansiYellow"])),$i(r,"--toast-error-accent",li(e,["editorError.foreground","terminal.ansiRed"]));const u=li(e,["editorGroupHeader.tabsBackground","tab.inactiveBackground","sideBar.background"]);u&&(r["--tab-bg"]=u);const h=li(e,["activityBarBadge.background","button.background","focusBorder"]),f=li(e,["textLink.foreground","terminal.ansiBlue"]),g=li(e,["editorWarning.foreground","terminal.ansiYellow"]),v=li(e,["terminal.ansiMagenta","badge.background"]);return h&&(r["--ctx-system"]=h),f&&(r["--ctx-history"]=f),g&&(r["--ctx-tool-results"]=g),v&&(r["--ctx-tools"]=v),r}function $i(e,r,n,i=!1){if(!n)return;const s=fDe(n,i);s&&(e[r]=s)}function mF(e){const r=G9(e);return r?(.2126*r.r+.7152*r.g+.0722*r.b)/255>.55?"0 0% 7%":"0 0% 100%":null}function dDe(e,r){if(e.type==="light"||e.type==="hc-light")return"light";if(e.type==="dark"||e.type==="hc-dark")return"dark";const n=G9(r["editor.background"]??r["sideBar.background"]??"");return n&&(.2126*n.r+.7152*n.g+.0722*n.b)/255>.55?"light":"dark"}function ate(e){const r={};for(const[n,i]of Object.entries(e))typeof i=="string"&&i.trim()&&(r[n]=i.trim());return r}function hDe(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 gF(e){if(!e)return;const r=e.trim();if(r.startsWith("#"))return ote(r).slice(1)}function li(e,r){for(const n of r){const i=e[n];if(typeof i=="string"&&i.trim())return i.trim()}return null}function fDe(e,r=!1){const n=G9(e);if(!n)return null;const i=n.r/255,s=n.g/255,a=n.b/255,o=Math.max(i,s,a),l=Math.min(i,s,a),d=o-l,u=(o+l)/2;let h=0;d!==0&&(o===i?h=(s-a)/d%6:o===s?h=(a-i)/d+2:h=(i-s)/d+4,h*=60),h<0&&(h+=360);const f=d===0?0:d/(1-Math.abs(2*u-1)),g=`${Math.round(h)} ${Math.round(f*100)}% ${Math.round(u*100)}%`;return r&&n.a<1?`${g} / ${Number(n.a.toFixed(3))}`:g}function G9(e){if(!e)return null;const r=e.trim();if(!r)return null;if(r.startsWith("#"))return pDe(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=IE(i[0]),a=IE(i[1]),o=IE(i[2]),l=i[3]==null?1:mDe(i[3]);return s==null||a==null||o==null||l==null?null:{r:s,g:a,b:o,a:l}}function pDe(e){const r=ote(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 IE(e){if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,-1));return Number.isFinite(n)?yF(Math.round(n/100*255)):null}const r=Number.parseFloat(e);return Number.isFinite(r)?yF(Math.round(r)):null}function mDe(e){const r=Number.parseFloat(e);return Number.isFinite(r)?Math.max(0,Math.min(1,r)):null}function yF(e){return Math.max(0,Math.min(255,e))}function ote(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 gDe(e){let r="",n=!1,i=!1,s=!1,a=!1;for(let o=0;o<e.length;o+=1){const l=e[o],d=e[o+1];if(i){l===`
|
|
938
938
|
`&&(i=!1,r+=l);continue}if(s){l==="*"&&d==="/"&&(s=!1,o+=1);continue}if(n){r+=l,a?a=!1:l==="\\"?a=!0:l==='"'&&(n=!1);continue}if(l==='"'){n=!0,r+=l;continue}if(l==="/"&&d==="/"){i=!0,o+=1;continue}if(l==="/"&&d==="*"){s=!0,o+=1;continue}r+=l}return r}function yDe(e){return e.replace(/,\s*([}\]])/g,"$1")}function vDe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"theme"}function vF(){if(typeof document>"u")return"vs";const e=document.documentElement;return e.dataset.monacoTheme??(e.classList.contains("dark")?Ww:"vs")}function dk(){const[e,r]=y.useState(vF);return y.useEffect(()=>{if(typeof document>"u")return;const n=document.documentElement,i=()=>r(vF());i();const s=new MutationObserver(i);return s.observe(n,{attributes:!0,attributeFilter:["class","data-monaco-theme"]}),()=>s.disconnect()},[]),e}const K9="jait:vscode-theme-store",h5=new Set;let nh=cte(),xF=!1;function lte(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function cte(){const e=lte();if(!e)return{importedThemes:[],activeThemeId:null};let r=null;try{r=e.getItem(K9)}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(a=>!!(a&&typeof a.id=="string"&&typeof a.monacoThemeName=="string")):[],s=typeof n.activeThemeId=="string"?n.activeThemeId:null;return{importedThemes:i,activeThemeId:i.some(a=>a.id===s)?s:null}}catch{return{importedThemes:[],activeThemeId:null}}}function Y9(e){nh=e;const r=lte();if(r)try{r.setItem(K9,JSON.stringify(e))}catch{}for(const n of h5)n()}function xDe(e){return!xF&&typeof window<"u"&&(xF=!0,window.addEventListener("storage",r=>{if(r.key===K9){nh=cte();for(const n of h5)n()}})),h5.add(e),()=>h5.delete(e)}function bF(){return nh}function ute(){const e=y.useSyncExternalStore(xDe,bF,bF);return{...e,activeTheme:e.importedThemes.find(r=>r.id===e.activeThemeId)??null}}function dte(){return nh.importedThemes.find(e=>e.id===nh.activeThemeId)??null}function bDe(e,r){const n=`${Date.now().toString(36)}-${SDe(e+r)}`,i=sDe({id:n,sourceLabel:e,text:r});return Y9({importedThemes:[...nh.importedThemes.filter(s=>s.id!==n),i],activeThemeId:n}),i}function wj(e){Y9({...nh,activeThemeId:e&&nh.importedThemes.some(r=>r.id===e)?e:null})}function _De(e){Y9({importedThemes:nh.importedThemes.filter(r=>r.id!==e),activeThemeId:nh.activeThemeId===e?null:nh.activeThemeId})}function wDe(e){ite(e);const r=dte();r?oDe(e,r):iDe(e)}function vc(e,r){var n,i;wDe(e),r&&((i=(n=e==null?void 0:e.editor)==null?void 0:n.setTheme)==null||i.call(n,r))}function SDe(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 M1(e,r){return Math.max(1,e||r||1)}function Uw({original:e,modified:r,language:n,modelKey:i,className:s,editorClassName:a,renderSideBySide:o=!1,emptyMessage:l="Files are identical.",options:d}){const u=y.useRef(null),h=y.useRef(null),f=y.useRef(null),g=y.useRef(null),v=y.useRef({original:null,modified:null}),[b,_]=y.useState(!1),[S,w]=y.useState([]),[C,j]=y.useState(0),E=dk(),A=y.useRef(E);y.useEffect(()=>{A.current=E},[E]);const N=y.useMemo(()=>`inmemory://jait-diff/${encodeURIComponent(i??`${n}:${e.length}:${r.length}`)}`,[n,i,r.length,e.length]),R=y.useMemo(()=>({readOnly:!0,renderSideBySide:o,minimap:{enabled:!1},"semanticHighlighting.enabled":!0,fontSize:13,automaticLayout:!0,scrollBeyondLastLine:!1,renderOverviewRuler:!0,ignoreTrimWhitespace:!1,...d}),[d,o]),B=y.useCallback(()=>{var I;const z=h.current;if(!z)return;const W=((I=z.getLineChanges)==null?void 0:I.call(z))??[];w(W.map(O=>({originalStartLineNumber:O.originalStartLineNumber,originalEndLineNumber:O.originalEndLineNumber,modifiedStartLineNumber:O.modifiedStartLineNumber,modifiedEndLineNumber:O.modifiedEndLineNumber})))},[]);y.useEffect(()=>{let z=!1;const W=jN.init();return W.then(I=>{if(z||!u.current)return;f.current=I,vc(I,A.current);const O=I.editor.createDiffEditor(u.current,{automaticLayout:!0,...R});h.current=O,g.current=O.onDidUpdateDiff(()=>B()),_(!0),B()}).catch(I=>{!z&&(I==null?void 0:I.type)!=="cancelation"&&console.error("Monaco initialization: error:",I)}),()=>{var D,P,$,V,K,F;z=!0,(D=g.current)==null||D.dispose(),g.current=null;const I=h.current,O=v.current;try{I==null||I.setModel(null)}catch{}(P=I==null?void 0:I.dispose)==null||P.call(I),(V=($=O.original)==null?void 0:$.dispose)==null||V.call($),(F=(K=O.modified)==null?void 0:K.dispose)==null||F.call(K),v.current={original:null,modified:null},h.current=null,f.current=null,_(!1),W.cancel()}},[B]),y.useEffect(()=>{j(0)},[e,r,n]),y.useEffect(()=>{var V,K;const z=h.current,W=f.current;if(!b||!z||!W)return;const I=v.current,O=W.Uri.parse(`${N}.original`),D=W.Uri.parse(`${N}.modified`);(V=W.editor.getModel(O))==null||V.dispose(),(K=W.editor.getModel(D))==null||K.dispose();const P=W.editor.createModel(e,n,O),$=W.editor.createModel(r,n,D);return z.setModel({original:P,modified:$}),v.current={original:P,modified:$},B(),()=>{var F,U,Q,q;try{z.setModel(null)}catch{}(U=(F=I.original)==null?void 0:F.dispose)==null||U.call(F),(q=(Q=I.modified)==null?void 0:Q.dispose)==null||q.call(Q),P.dispose(),$.dispose(),(v.current.original===P||v.current.modified===$)&&(v.current={original:null,modified:null})}},[b,n,N,r,e,B]),y.useEffect(()=>{const z=f.current;z&&vc(z,E)},[E]),y.useEffect(()=>{var z,W;(W=(z=h.current)==null?void 0:z.updateOptions)==null||W.call(z,R)},[R]),y.useEffect(()=>{S.length!==0&&j(z=>Math.min(z,S.length-1))},[S]),y.useEffect(()=>{const z=h.current;if(!z||S.length===0)return;const W=S[C];if(!W)return;const I=z.getModifiedEditor(),O=z.getOriginalEditor();try{W.modifiedStartLineNumber>0||W.modifiedEndLineNumber>0?I.revealLineInCenter(M1(W.modifiedStartLineNumber,W.modifiedEndLineNumber)):O.revealLineInCenter(M1(W.originalStartLineNumber,W.originalEndLineNumber))}catch{}},[C,S]),y.useEffect(()=>{const z=h.current,W=f.current;if(!z||!W||S.length===0)return;const I=S[C];if(!I)return;const O=[];(I.originalStartLineNumber>0||I.originalEndLineNumber>0)&&O.push({editor:z.getOriginalEditor(),range:new W.Range(M1(I.originalStartLineNumber,I.originalEndLineNumber),1,M1(I.originalEndLineNumber,I.originalStartLineNumber),1)}),(I.modifiedStartLineNumber>0||I.modifiedEndLineNumber>0)&&O.push({editor:z.getModifiedEditor(),range:new W.Range(M1(I.modifiedStartLineNumber,I.modifiedEndLineNumber),1,M1(I.modifiedEndLineNumber,I.modifiedStartLineNumber),1)});const D=O.map(({editor:P,range:$})=>P.deltaDecorations([],[{range:$,options:{isWholeLine:!0,className:"diff-change-active"}}]));return()=>{var P;for(let $=0;$<O.length;$++)try{(P=O[$])==null||P.editor.deltaDecorations(D[$]??[],[])}catch{}}},[C,S]);const G=y.useCallback(()=>{j(z=>Math.max(z-1,0))},[]),H=y.useCallback(()=>{j(z=>Math.min(z+1,S.length-1))},[S.length]);return c.jsxs("div",{className:Ae("relative min-h-0",s),children:[c.jsx("div",{className:Ae("h-full min-h-0",a),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..."}),S.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(we,{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:G,disabled:C===0,title:"Previous change",children:c.jsx(yR,{className:"h-5 w-5"})}),c.jsxs("span",{className:"text-center font-medium tabular-nums text-2xs text-muted-foreground",children:[C+1,"/",S.length]}),c.jsx(we,{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:H,disabled:C===S.length-1,title:"Next change",children:c.jsx(Dl,{className:"h-5 w-5"})})]}),S.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:`
|
|
939
939
|
.diff-change-active { outline: 1px solid rgba(99, 102, 241, 0.5); outline-offset: -1px; }
|
|
940
940
|
`})]})}var kDe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},BE=kDe,CDe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},jDe=CDe;function NDe({children:e}){return Bt.createElement("div",{style:jDe.container},e)}var TDe=NDe,EDe=TDe;function ADe({width:e,height:r,isEditorReady:n,loading:i,_ref:s,className:a,wrapperProps:o}){return Bt.createElement("section",{style:{...BE.wrapper,width:e,height:r},...o},!n&&Bt.createElement(EDe,null,i),Bt.createElement("div",{ref:s,style:{...BE.fullWidth,...!n&&BE.hide},className:a}))}var ODe=ADe,hte=y.memo(ODe);function MDe(e){y.useEffect(e,[])}var fte=MDe;function RDe(e,r,n=!0){let i=y.useRef(!0);y.useEffect(i.current||!n?()=>{i.current=!1}:e,r)}var Yc=RDe;function u2(){}function Z1(e,r,n,i){return PDe(e,i)||LDe(e,r,n,i)}function PDe(e,r){return e.editor.getModel(pte(e,r))}function LDe(e,r,n,i){return e.editor.createModel(r,n,i?pte(e,i):void 0)}function pte(e,r){return e.Uri.parse(r)}function $De({original:e,modified:r,language:n,originalLanguage:i,modifiedLanguage:s,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:d=!1,theme:u="light",loading:h="Loading...",options:f={},height:g="100%",width:v="100%",className:b,wrapperProps:_={},beforeMount:S=u2,onMount:w=u2}){let[C,j]=y.useState(!1),[E,A]=y.useState(!0),N=y.useRef(null),R=y.useRef(null),B=y.useRef(null),G=y.useRef(w),H=y.useRef(S),z=y.useRef(!1);fte(()=>{let D=jN.init();return D.then(P=>(R.current=P)&&A(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>N.current?O():D.cancel()}),Yc(()=>{if(N.current&&R.current){let D=N.current.getOriginalEditor(),P=Z1(R.current,e||"",i||n||"text",a||"");P!==D.getModel()&&D.setModel(P)}},[a],C),Yc(()=>{if(N.current&&R.current){let D=N.current.getModifiedEditor(),P=Z1(R.current,r||"",s||n||"text",o||"");P!==D.getModel()&&D.setModel(P)}},[o],C),Yc(()=>{let D=N.current.getModifiedEditor();D.getOption(R.current.editor.EditorOption.readOnly)?D.setValue(r||""):r!==D.getValue()&&(D.executeEdits("",[{range:D.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),D.pushUndoStop())},[r],C),Yc(()=>{var D,P;(P=(D=N.current)==null?void 0:D.getModel())==null||P.original.setValue(e||"")},[e],C),Yc(()=>{let{original:D,modified:P}=N.current.getModel();R.current.editor.setModelLanguage(D,i||n||"text"),R.current.editor.setModelLanguage(P,s||n||"text")},[n,i,s],C),Yc(()=>{var D;(D=R.current)==null||D.editor.setTheme(u)},[u],C),Yc(()=>{var D;(D=N.current)==null||D.updateOptions(f)},[f],C);let W=y.useCallback(()=>{var $;if(!R.current)return;H.current(R.current);let D=Z1(R.current,e||"",i||n||"text",a||""),P=Z1(R.current,r||"",s||n||"text",o||"");($=N.current)==null||$.setModel({original:D,modified:P})},[n,r,s,e,i,a,o]),I=y.useCallback(()=>{var D;!z.current&&B.current&&(N.current=R.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...f}),W(),(D=R.current)==null||D.editor.setTheme(u),j(!0),z.current=!0)},[f,u,W]);y.useEffect(()=>{C&&G.current(N.current,R.current)},[C]),y.useEffect(()=>{!E&&!C&&I()},[E,C,I]);function O(){var P,$,V,K;let D=(P=N.current)==null?void 0:P.getModel();l||(($=D==null?void 0:D.original)==null||$.dispose()),d||((V=D==null?void 0:D.modified)==null||V.dispose()),(K=N.current)==null||K.dispose()}return Bt.createElement(hte,{width:v,height:g,isEditorReady:C,loading:h,_ref:B,className:b,wrapperProps:_})}var DDe=$De,IDe=y.memo(DDe);function BDe(e){let r=y.useRef();return y.useEffect(()=>{r.current=e},[e]),r.current}var zDe=BDe,i3=new Map;function FDe({defaultValue:e,defaultLanguage:r,defaultPath:n,value:i,language:s,path:a,theme:o="light",line:l,loading:d="Loading...",options:u={},overrideServices:h={},saveViewState:f=!0,keepCurrentModel:g=!1,width:v="100%",height:b="100%",className:_,wrapperProps:S={},beforeMount:w=u2,onMount:C=u2,onChange:j,onValidate:E=u2}){let[A,N]=y.useState(!1),[R,B]=y.useState(!0),G=y.useRef(null),H=y.useRef(null),z=y.useRef(null),W=y.useRef(C),I=y.useRef(w),O=y.useRef(),D=y.useRef(i),P=zDe(a),$=y.useRef(!1),V=y.useRef(!1);fte(()=>{let U=jN.init();return U.then(Q=>(G.current=Q)&&B(!1)).catch(Q=>(Q==null?void 0:Q.type)!=="cancelation"&&console.error("Monaco initialization: error:",Q)),()=>H.current?F():U.cancel()}),Yc(()=>{var Q,q,te,ee;let U=Z1(G.current,e||i||"",r||s||"",a||n||"");U!==((Q=H.current)==null?void 0:Q.getModel())&&(f&&i3.set(P,(q=H.current)==null?void 0:q.saveViewState()),(te=H.current)==null||te.setModel(U),f&&((ee=H.current)==null||ee.restoreViewState(i3.get(a))))},[a],A),Yc(()=>{var U;(U=H.current)==null||U.updateOptions(u)},[u],A),Yc(()=>{!H.current||i===void 0||(H.current.getOption(G.current.editor.EditorOption.readOnly)?H.current.setValue(i):i!==H.current.getValue()&&(V.current=!0,H.current.executeEdits("",[{range:H.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),H.current.pushUndoStop(),V.current=!1))},[i],A),Yc(()=>{var Q,q;let U=(Q=H.current)==null?void 0:Q.getModel();U&&s&&((q=G.current)==null||q.editor.setModelLanguage(U,s))},[s],A),Yc(()=>{var U;l!==void 0&&((U=H.current)==null||U.revealLine(l))},[l],A),Yc(()=>{var U;(U=G.current)==null||U.editor.setTheme(o)},[o],A);let K=y.useCallback(()=>{var U;if(!(!z.current||!G.current)&&!$.current){I.current(G.current);let Q=a||n,q=Z1(G.current,i||e||"",r||s||"",Q||"");H.current=(U=G.current)==null?void 0:U.editor.create(z.current,{model:q,automaticLayout:!0,...u},h),f&&H.current.restoreViewState(i3.get(Q)),G.current.editor.setTheme(o),l!==void 0&&H.current.revealLine(l),N(!0),$.current=!0}},[e,r,n,i,s,a,u,h,f,o,l]);y.useEffect(()=>{A&&W.current(H.current,G.current)},[A]),y.useEffect(()=>{!R&&!A&&K()},[R,A,K]),D.current=i,y.useEffect(()=>{var U,Q;A&&j&&((U=O.current)==null||U.dispose(),O.current=(Q=H.current)==null?void 0:Q.onDidChangeModelContent(q=>{V.current||j(H.current.getValue(),q)}))},[A,j]),y.useEffect(()=>{if(A){let U=G.current.editor.onDidChangeMarkers(Q=>{var te;let q=(te=H.current.getModel())==null?void 0:te.uri;if(q&&Q.find(ee=>ee.path===q.path)){let ee=G.current.editor.getModelMarkers({resource:q});E==null||E(ee)}});return()=>{U==null||U.dispose()}}return()=>{}},[A,E]);function F(){var U,Q;(U=O.current)==null||U.dispose(),g?f&&i3.set(a,H.current.saveViewState()):(Q=H.current.getModel())==null||Q.dispose(),H.current.dispose()}return Bt.createElement(hte,{width:v,height:b,isEditorReady:A,loading:d,_ref:z,className:_,wrapperProps:S})}var HDe=FDe,WDe=y.memo(HDe),hk=WDe;const UDe=qn();function VDe(){return Gm()}function qDe(e=!1){const r={};e&&(r["Content-Type"]="application/json");const n=VDe();return n&&(r.Authorization=`Bearer ${n}`),r}async function Yi(e,r){const n=await fetch(`${UDe}/api/git/${e}`,{method:"POST",headers:qDe(!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 $s={status(e,r){return Yi("status",{cwd:e,...r?{branch:r}:{}})},listBranches(e){return Yi("branches",{cwd:e})},pull(e){return Yi("pull",{cwd:e})},sync(e){return Yi("sync",{cwd:e})},fetch(e,r=!1){return Yi("fetch",{cwd:e,all:r})},runStackedAction(e,r,n){return Yi("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 Yi("checkout",{cwd:e,branch:r})},createBranch(e,r,n){return Yi("create-branch",{cwd:e,branch:r,baseBranch:n})},discard(e,r){return Yi("discard",{cwd:e,paths:r})},stage(e,r){return Yi("stage",{cwd:e,paths:r})},unstage(e,r){return Yi("unstage",{cwd:e,paths:r})},init(e){return Yi("init",{cwd:e})},diff(e){return Yi("diff",{cwd:e})},diffStats(e,r,n){return Yi("diff-stats",{cwd:e,...r?{baseBranch:r}:{},...n?{branch:n}:{}})},fileDiffs(e,r,n){return Yi("file-diffs",{cwd:e,...r?{baseBranch:r}:{},...n?{branch:n}:{}}).then(i=>i.files)},createWorktree(e,r,n,i){return Yi("create-worktree",{cwd:e,baseBranch:r,newBranch:n,...i?{path:i}:{}})},removeWorktree(e,r,n=!1){return Yi("remove-worktree",{cwd:e,path:r,force:n})},ghStatus(e){return Yi("gh-status",{...e?{cwd:e}:{}})},ghAuth(e,r){return Yi("gh-auth",{token:e,...r?{cwd:r}:{}})},forgeStatus(e,r){return Yi("forge-status",{...e?{cwd:e}:{},...r?{remoteUrl:r}:{}})},forgeAuth(e,r,n){return Yi("forge-auth",{token:e,...r?{cwd:r}:{},...n?{remoteUrl:n}:{}})},forgePrChecks(e,r,n){return Yi("forge-pr-checks",{cwd:e,branch:r,...n?{remoteUrl:n}:{}})},identity(e){return Yi("identity",{cwd:e})},setIdentity(e,r,n){return Yi("identity",{cwd:e,name:r,email:n})},prChecks(e,r){return Yi("pr-checks",{cwd:e,branch:r})},generateCommitMessage(e,r,n){return Yi("generate-commit-message",{cwd:e,...r?{provider:r}:{},...n?{model:n}:{}})}};var mte=Object.defineProperty,X=(e,r)=>mte(e,"name",{value:r,configurable:!0}),GDe=(e,r)=>{for(var n in r)mte(e,n,{get:r[n],enumerable:!0})},tp={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Mt={trace:X((...e)=>{},"trace"),debug:X((...e)=>{},"debug"),info:X((...e)=>{},"info"),warn:X((...e)=>{},"warn"),error:X((...e)=>{},"error"),fatal:X((...e)=>{},"fatal")},X9=X(function(e="fatal"){let r=tp.fatal;typeof e=="string"?e.toLowerCase()in tp&&(r=tp[e]):typeof e=="number"&&(r=e),Mt.trace=()=>{},Mt.debug=()=>{},Mt.info=()=>{},Mt.warn=()=>{},Mt.error=()=>{},Mt.fatal=()=>{},r<=tp.fatal&&(Mt.fatal=console.error?console.error.bind(console,Pu("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Pu("FATAL"))),r<=tp.error&&(Mt.error=console.error?console.error.bind(console,Pu("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Pu("ERROR"))),r<=tp.warn&&(Mt.warn=console.warn?console.warn.bind(console,Pu("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Pu("WARN"))),r<=tp.info&&(Mt.info=console.info?console.info.bind(console,Pu("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Pu("INFO"))),r<=tp.debug&&(Mt.debug=console.debug?console.debug.bind(console,Pu("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Pu("DEBUG"))),r<=tp.trace&&(Mt.trace=console.debug?console.debug.bind(console,Pu("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Pu("TRACE")))},"setLogLevel"),Pu=X(e=>`%c${dAe().format("ss.SSS")} : ${e} : `,"format");const f5={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,a=2*n-s;switch(i){case"r":return f5.hue2rgb(a,s,e+1/3)*255;case"g":return f5.hue2rgb(a,s,e)*255;case"b":return f5.hue2rgb(a,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),a=Math.min(e,r,n),o=(s+a)/2;if(i==="l")return o*100;if(s===a)return 0;const l=s-a,d=o>.5?l/(2-s-a):l/(s+a);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}}},KDe={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},YDe={dec2hex:e=>{const r=Math.round(e).toString(16);return r.length>1?r:`0${r}`}},Sn={channel:f5,lang:KDe,unit:YDe},$m={};for(let e=0;e<=255;e++)$m[e]=Sn.unit.dec2hex(e);const Yo={ALL:0,RGB:1,HSL:2};class XDe{constructor(){this.type=Yo.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=Yo.ALL}is(r){return this.type===r}}class JDe{constructor(r,n){this.color=n,this.changed=!1,this.data=r,this.type=new XDe}set(r,n){return this.color=n,this.changed=!1,this.data=r,this.type.type=Yo.ALL,this}_ensureHSL(){const r=this.data,{h:n,s:i,l:s}=r;n===void 0&&(r.h=Sn.channel.rgb2hsl(r,"h")),i===void 0&&(r.s=Sn.channel.rgb2hsl(r,"s")),s===void 0&&(r.l=Sn.channel.rgb2hsl(r,"l"))}_ensureRGB(){const r=this.data,{r:n,g:i,b:s}=r;n===void 0&&(r.r=Sn.channel.hsl2rgb(r,"r")),i===void 0&&(r.g=Sn.channel.hsl2rgb(r,"g")),s===void 0&&(r.b=Sn.channel.hsl2rgb(r,"b"))}get r(){const r=this.data,n=r.r;return!this.type.is(Yo.HSL)&&n!==void 0?n:(this._ensureHSL(),Sn.channel.hsl2rgb(r,"r"))}get g(){const r=this.data,n=r.g;return!this.type.is(Yo.HSL)&&n!==void 0?n:(this._ensureHSL(),Sn.channel.hsl2rgb(r,"g"))}get b(){const r=this.data,n=r.b;return!this.type.is(Yo.HSL)&&n!==void 0?n:(this._ensureHSL(),Sn.channel.hsl2rgb(r,"b"))}get h(){const r=this.data,n=r.h;return!this.type.is(Yo.RGB)&&n!==void 0?n:(this._ensureRGB(),Sn.channel.rgb2hsl(r,"h"))}get s(){const r=this.data,n=r.s;return!this.type.is(Yo.RGB)&&n!==void 0?n:(this._ensureRGB(),Sn.channel.rgb2hsl(r,"s"))}get l(){const r=this.data,n=r.l;return!this.type.is(Yo.RGB)&&n!==void 0?n:(this._ensureRGB(),Sn.channel.rgb2hsl(r,"l"))}get a(){return this.data.a}set r(r){this.type.set(Yo.RGB),this.changed=!0,this.data.r=r}set g(r){this.type.set(Yo.RGB),this.changed=!0,this.data.g=r}set b(r){this.type.set(Yo.RGB),this.changed=!0,this.data.b=r}set h(r){this.type.set(Yo.HSL),this.changed=!0,this.data.h=r}set s(r){this.type.set(Yo.HSL),this.changed=!0,this.data.s=r}set l(r){this.type.set(Yo.HSL),this.changed=!0,this.data.l=r}set a(r){this.changed=!0,this.data.a=r}}const NN=new JDe({r:0,g:0,b:0,a:0},"transparent"),hv={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const r=e.match(hv.re);if(!r)return;const n=r[1],i=parseInt(n,16),s=n.length,a=s%4===0,o=s>4,l=o?1:17,d=o?8:4,u=a?0:-1,h=o?255:15;return NN.set({r:(i>>d*(u+3)&h)*l,g:(i>>d*(u+2)&h)*l,b:(i>>d*(u+1)&h)*l,a:a?(i&h)*l/255:1},e)},stringify:e=>{const{r,g:n,b:i,a:s}=e;return s<1?`#${$m[Math.round(r)]}${$m[Math.round(n)]}${$m[Math.round(i)]}${$m[Math.round(s*255)]}`:`#${$m[Math.round(r)]}${$m[Math.round(n)]}${$m[Math.round(i)]}`}},M0={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(M0.hueRe);if(r){const[,n,i]=r;switch(i){case"grad":return Sn.channel.clamp.h(parseFloat(n)*.9);case"rad":return Sn.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return Sn.channel.clamp.h(parseFloat(n)*360)}}return Sn.channel.clamp.h(parseFloat(e))},parse:e=>{const r=e.charCodeAt(0);if(r!==104&&r!==72)return;const n=e.match(M0.re);if(!n)return;const[,i,s,a,o,l]=n;return NN.set({h:M0._hue2deg(i),s:Sn.channel.clamp.s(parseFloat(s)),l:Sn.channel.clamp.l(parseFloat(a)),a:o?Sn.channel.clamp.a(l?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:r,s:n,l:i,a:s}=e;return s<1?`hsla(${Sn.lang.round(r)}, ${Sn.lang.round(n)}%, ${Sn.lang.round(i)}%, ${s})`:`hsl(${Sn.lang.round(r)}, ${Sn.lang.round(n)}%, ${Sn.lang.round(i)}%)`}},d2={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=d2.colors[e];if(r)return hv.parse(r)},stringify:e=>{const r=hv.stringify(e);for(const n in d2.colors)if(d2.colors[n]===r)return n}},M_={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(M_.re);if(!n)return;const[,i,s,a,o,l,d,u,h]=n;return NN.set({r:Sn.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:Sn.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:Sn.channel.clamp.b(d?parseFloat(l)*2.55:parseFloat(l)),a:u?Sn.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},e)},stringify:e=>{const{r,g:n,b:i,a:s}=e;return s<1?`rgba(${Sn.lang.round(r)}, ${Sn.lang.round(n)}, ${Sn.lang.round(i)}, ${Sn.lang.round(s)})`:`rgb(${Sn.lang.round(r)}, ${Sn.lang.round(n)}, ${Sn.lang.round(i)})`}},pf={format:{keyword:d2,hex:hv,rgb:M_,rgba:M_,hsl:M0,hsla:M0},parse:e=>{if(typeof e!="string")return e;const r=hv.parse(e)||M_.parse(e)||M0.parse(e)||d2.parse(e);if(r)return r;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Yo.HSL)||e.data.r===void 0?M0.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?M_.stringify(e):hv.stringify(e)},gte=(e,r)=>{const n=pf.parse(e);for(const i in r)n[i]=Sn.channel.clamp[i](r[i]);return pf.stringify(n)},h2=(e,r,n=0,i=1)=>{if(typeof e!="number")return gte(e,{a:r});const s=NN.set({r:Sn.channel.clamp.r(e),g:Sn.channel.clamp.g(r),b:Sn.channel.clamp.b(n),a:Sn.channel.clamp.a(i)});return pf.stringify(s)},ZDe=e=>{const{r,g:n,b:i}=pf.parse(e),s=.2126*Sn.channel.toLinear(r)+.7152*Sn.channel.toLinear(n)+.0722*Sn.channel.toLinear(i);return Sn.lang.round(s)},QDe=e=>ZDe(e)>=.5,fk=e=>!QDe(e),yte=(e,r,n)=>{const i=pf.parse(e),s=i[r],a=Sn.channel.clamp[r](s+n);return s!==a&&(i[r]=a),pf.stringify(i)},kr=(e,r)=>yte(e,"l",r),Kr=(e,r)=>yte(e,"l",-r),Ie=(e,r)=>{const n=pf.parse(e),i={};for(const s in r)r[s]&&(i[s]=n[s]+r[s]);return gte(e,i)},eIe=(e,r,n=50)=>{const{r:i,g:s,b:a,a:o}=pf.parse(e),{r:l,g:d,b:u,a:h}=pf.parse(r),f=n/100,g=f*2-1,v=o-h,_=((g*v===-1?g:(g+v)/(1+g*v))+1)/2,S=1-_,w=i*_+l*S,C=s*_+d*S,j=a*_+u*S,E=o*f+h*(1-f);return h2(w,C,j,E)},ar=(e,r=100)=>{const n=pf.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,eIe(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:vte,setPrototypeOf:_F,isFrozen:tIe,getPrototypeOf:rIe,getOwnPropertyDescriptor:nIe}=Object;let{freeze:Ll,seal:ad,create:p5}=Object,{apply:lO,construct:cO}=typeof Reflect<"u"&&Reflect;Ll||(Ll=function(r){return r});ad||(ad=function(r){return r});lO||(lO=function(r,n){for(var i=arguments.length,s=new Array(i>2?i-2:0),a=2;a<i;a++)s[a-2]=arguments[a];return r.apply(n,s)});cO||(cO=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 s3=$l(Array.prototype.forEach),iIe=$l(Array.prototype.lastIndexOf),wF=$l(Array.prototype.pop),zb=$l(Array.prototype.push),sIe=$l(Array.prototype.splice),m5=$l(String.prototype.toLowerCase),zE=$l(String.prototype.toString),FE=$l(String.prototype.match),Fb=$l(String.prototype.replace),aIe=$l(String.prototype.indexOf),oIe=$l(String.prototype.trim),Gc=$l(Object.prototype.hasOwnProperty),kl=$l(RegExp.prototype.test),Hb=lIe(TypeError);function $l(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 lO(e,r,i)}}function lIe(e){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return cO(e,n)}}function Fn(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m5;_F&&_F(e,null);let i=r.length;for(;i--;){let s=r[i];if(typeof s=="string"){const a=n(s);a!==s&&(tIe(r)||(r[i]=a),s=a)}e[s]=!0}return e}function cIe(e){for(let r=0;r<e.length;r++)Gc(e,r)||(e[r]=null);return e}function qh(e){const r=p5(null);for(const[n,i]of vte(e))Gc(e,n)&&(Array.isArray(i)?r[n]=cIe(i):i&&typeof i=="object"&&i.constructor===Object?r[n]=qh(i):r[n]=i);return r}function Wb(e,r){for(;e!==null;){const i=nIe(e,r);if(i){if(i.get)return $l(i.get);if(typeof i.value=="function")return $l(i.value)}e=rIe(e)}function n(){return null}return n}const SF=Ll(["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"]),HE=Ll(["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"]),WE=Ll(["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"]),uIe=Ll(["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"]),UE=Ll(["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"]),dIe=Ll(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kF=Ll(["#text"]),CF=Ll(["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"]),VE=Ll(["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"]),jF=Ll(["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"]),a3=Ll(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hIe=ad(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fIe=ad(/<%[\w\W]*|[\w\W]*%>/gm),pIe=ad(/\$\{[\w\W]*/gm),mIe=ad(/^data-[\-\w.\u00B7-\uFFFF]+$/),gIe=ad(/^aria-[\-\w]+$/),xte=ad(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yIe=ad(/^(?:\w+script|data):/i),vIe=ad(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bte=ad(/^html$/i),xIe=ad(/^[a-z][.\w]*(-[.\w]+)+$/i);var NF=Object.freeze({__proto__:null,ARIA_ATTR:gIe,ATTR_WHITESPACE:vIe,CUSTOM_ELEMENT:xIe,DATA_ATTR:mIe,DOCTYPE_NAME:bte,ERB_EXPR:fIe,IS_ALLOWED_URI:xte,IS_SCRIPT_OR_DATA:yIe,MUSTACHE_EXPR:hIe,TMPLIT_EXPR:pIe});const Ub={element:1,text:3,progressingInstruction:7,comment:8,document:9},bIe=function(){return typeof window>"u"?null:window},_Ie=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 a="dompurify"+(i?"#"+i:"");try{return r.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},TF=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function _te(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bIe();const r=Et=>_te(Et);if(r.version="3.3.2",r.removed=[],!e||!e.document||e.document.nodeType!==Ub.document||!e.Element)return r.isSupported=!1,r;let{document:n}=e;const i=n,s=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:l,Element:d,NodeFilter:u,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:g,trustedTypes:v}=e,b=d.prototype,_=Wb(b,"cloneNode"),S=Wb(b,"remove"),w=Wb(b,"nextSibling"),C=Wb(b,"childNodes"),j=Wb(b,"parentNode");if(typeof o=="function"){const Et=n.createElement("template");Et.content&&Et.content.ownerDocument&&(n=Et.content.ownerDocument)}let E,A="";const{implementation:N,createNodeIterator:R,createDocumentFragment:B,getElementsByTagName:G}=n,{importNode:H}=i;let z=TF();r.isSupported=typeof vte=="function"&&typeof j=="function"&&N&&N.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:W,ERB_EXPR:I,TMPLIT_EXPR:O,DATA_ATTR:D,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:K}=NF;let{IS_ALLOWED_URI:F}=NF,U=null;const Q=Fn({},[...SF,...HE,...WE,...UE,...kF]);let q=null;const te=Fn({},[...CF,...VE,...jF,...a3]);let ee=Object.seal(p5(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}})),se=null,ae=null;const re=Object.seal(p5(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let fe=!0,me=!0,_e=!1,ge=!0,Ve=!1,le=!0,it=!1,Xe=!1,xt=!1,Pt=!1,Ht=!1,Kt=!1,tr=!0,ht=!1;const Ye="user-content-";let dt=!0,At=!1,Te={},Oe=null;const Je=Fn({},["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 ct=null;const bt=Fn({},["audio","video","img","source","image","track"]);let zt=null;const sr=Fn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pe="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",be="http://www.w3.org/1999/xhtml";let Fe=be,nt=!1,Ue=null;const $t=Fn({},[Pe,Ne,be],zE);let Ot=Fn({},["mi","mo","mn","ms","mtext"]),Yt=Fn({},["annotation-xml"]);const rr=Fn({},["title","style","font","a","script"]);let or=null;const ke=["application/xhtml+xml","text/html"],at="text/html";let Ze=null,Rt=null;const ze=n.createElement("form"),mt=function(de){return de instanceof RegExp||de instanceof Function},yt=function(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rt&&Rt===de)){if((!de||typeof de!="object")&&(de={}),de=qh(de),or=ke.indexOf(de.PARSER_MEDIA_TYPE)===-1?at:de.PARSER_MEDIA_TYPE,Ze=or==="application/xhtml+xml"?zE:m5,U=Gc(de,"ALLOWED_TAGS")?Fn({},de.ALLOWED_TAGS,Ze):Q,q=Gc(de,"ALLOWED_ATTR")?Fn({},de.ALLOWED_ATTR,Ze):te,Ue=Gc(de,"ALLOWED_NAMESPACES")?Fn({},de.ALLOWED_NAMESPACES,zE):$t,zt=Gc(de,"ADD_URI_SAFE_ATTR")?Fn(qh(sr),de.ADD_URI_SAFE_ATTR,Ze):sr,ct=Gc(de,"ADD_DATA_URI_TAGS")?Fn(qh(bt),de.ADD_DATA_URI_TAGS,Ze):bt,Oe=Gc(de,"FORBID_CONTENTS")?Fn({},de.FORBID_CONTENTS,Ze):Je,se=Gc(de,"FORBID_TAGS")?Fn({},de.FORBID_TAGS,Ze):qh({}),ae=Gc(de,"FORBID_ATTR")?Fn({},de.FORBID_ATTR,Ze):qh({}),Te=Gc(de,"USE_PROFILES")?de.USE_PROFILES:!1,fe=de.ALLOW_ARIA_ATTR!==!1,me=de.ALLOW_DATA_ATTR!==!1,_e=de.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=de.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ve=de.SAFE_FOR_TEMPLATES||!1,le=de.SAFE_FOR_XML!==!1,it=de.WHOLE_DOCUMENT||!1,Pt=de.RETURN_DOM||!1,Ht=de.RETURN_DOM_FRAGMENT||!1,Kt=de.RETURN_TRUSTED_TYPE||!1,xt=de.FORCE_BODY||!1,tr=de.SANITIZE_DOM!==!1,ht=de.SANITIZE_NAMED_PROPS||!1,dt=de.KEEP_CONTENT!==!1,At=de.IN_PLACE||!1,F=de.ALLOWED_URI_REGEXP||xte,Fe=de.NAMESPACE||be,Ot=de.MATHML_TEXT_INTEGRATION_POINTS||Ot,Yt=de.HTML_INTEGRATION_POINTS||Yt,ee=de.CUSTOM_ELEMENT_HANDLING||{},de.CUSTOM_ELEMENT_HANDLING&&mt(de.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=de.CUSTOM_ELEMENT_HANDLING.tagNameCheck),de.CUSTOM_ELEMENT_HANDLING&&mt(de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),de.CUSTOM_ELEMENT_HANDLING&&typeof de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ve&&(me=!1),Ht&&(Pt=!0),Te&&(U=Fn({},kF),q=p5(null),Te.html===!0&&(Fn(U,SF),Fn(q,CF)),Te.svg===!0&&(Fn(U,HE),Fn(q,VE),Fn(q,a3)),Te.svgFilters===!0&&(Fn(U,WE),Fn(q,VE),Fn(q,a3)),Te.mathMl===!0&&(Fn(U,UE),Fn(q,jF),Fn(q,a3))),Gc(de,"ADD_TAGS")||(re.tagCheck=null),Gc(de,"ADD_ATTR")||(re.attributeCheck=null),de.ADD_TAGS&&(typeof de.ADD_TAGS=="function"?re.tagCheck=de.ADD_TAGS:(U===Q&&(U=qh(U)),Fn(U,de.ADD_TAGS,Ze))),de.ADD_ATTR&&(typeof de.ADD_ATTR=="function"?re.attributeCheck=de.ADD_ATTR:(q===te&&(q=qh(q)),Fn(q,de.ADD_ATTR,Ze))),de.ADD_URI_SAFE_ATTR&&Fn(zt,de.ADD_URI_SAFE_ATTR,Ze),de.FORBID_CONTENTS&&(Oe===Je&&(Oe=qh(Oe)),Fn(Oe,de.FORBID_CONTENTS,Ze)),de.ADD_FORBID_CONTENTS&&(Oe===Je&&(Oe=qh(Oe)),Fn(Oe,de.ADD_FORBID_CONTENTS,Ze)),dt&&(U["#text"]=!0),it&&Fn(U,["html","head","body"]),U.table&&(Fn(U,["tbody"]),delete se.tbody),de.TRUSTED_TYPES_POLICY){if(typeof de.TRUSTED_TYPES_POLICY.createHTML!="function")throw Hb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof de.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Hb('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=de.TRUSTED_TYPES_POLICY,A=E.createHTML("")}else E===void 0&&(E=_Ie(v,s)),E!==null&&typeof A=="string"&&(A=E.createHTML(""));Ll&&Ll(de),Rt=de}},Gt=Fn({},[...HE,...WE,...uIe]),qe=Fn({},[...UE,...dIe]),$e=function(de){let oe=j(de);(!oe||!oe.tagName)&&(oe={namespaceURI:Fe,tagName:"template"});const Me=m5(de.tagName),st=m5(oe.tagName);return Ue[de.namespaceURI]?de.namespaceURI===Ne?oe.namespaceURI===be?Me==="svg":oe.namespaceURI===Pe?Me==="svg"&&(st==="annotation-xml"||Ot[st]):!!Gt[Me]:de.namespaceURI===Pe?oe.namespaceURI===be?Me==="math":oe.namespaceURI===Ne?Me==="math"&&Yt[st]:!!qe[Me]:de.namespaceURI===be?oe.namespaceURI===Ne&&!Yt[st]||oe.namespaceURI===Pe&&!Ot[st]?!1:!qe[Me]&&(rr[Me]||!Gt[Me]):!!(or==="application/xhtml+xml"&&Ue[de.namespaceURI]):!1},ft=function(de){zb(r.removed,{element:de});try{j(de).removeChild(de)}catch{S(de)}},vt=function(de,oe){try{zb(r.removed,{attribute:oe.getAttributeNode(de),from:oe})}catch{zb(r.removed,{attribute:null,from:oe})}if(oe.removeAttribute(de),de==="is")if(Pt||Ht)try{ft(oe)}catch{}else try{oe.setAttribute(de,"")}catch{}},gt=function(de){let oe=null,Me=null;if(xt)de="<remove></remove>"+de;else{const jt=FE(de,/^[\r\n\t ]+/);Me=jt&&jt[0]}or==="application/xhtml+xml"&&Fe===be&&(de='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+de+"</body></html>");const st=E?E.createHTML(de):de;if(Fe===be)try{oe=new g().parseFromString(st,or)}catch{}if(!oe||!oe.documentElement){oe=N.createDocument(Fe,"template",null);try{oe.documentElement.innerHTML=nt?A:st}catch{}}const kt=oe.body||oe.documentElement;return de&&Me&&kt.insertBefore(n.createTextNode(Me),kt.childNodes[0]||null),Fe===be?G.call(oe,it?"html":"body")[0]:it?oe.documentElement:kt},$r=function(de){return R.call(de.ownerDocument||de,de,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},mr=function(de){return de instanceof f&&(typeof de.nodeName!="string"||typeof de.textContent!="string"||typeof de.removeChild!="function"||!(de.attributes instanceof h)||typeof de.removeAttribute!="function"||typeof de.setAttribute!="function"||typeof de.namespaceURI!="string"||typeof de.insertBefore!="function"||typeof de.hasChildNodes!="function")},Ur=function(de){return typeof l=="function"&&de instanceof l};function Xt(Et,de,oe){s3(Et,Me=>{Me.call(r,de,oe,Rt)})}const Si=function(de){let oe=null;if(Xt(z.beforeSanitizeElements,de,null),mr(de))return ft(de),!0;const Me=Ze(de.nodeName);if(Xt(z.uponSanitizeElement,de,{tagName:Me,allowedTags:U}),le&&de.hasChildNodes()&&!Ur(de.firstElementChild)&&kl(/<[/\w!]/g,de.innerHTML)&&kl(/<[/\w!]/g,de.textContent)||de.nodeType===Ub.progressingInstruction||le&&de.nodeType===Ub.comment&&kl(/<[/\w]/g,de.data))return ft(de),!0;if(!(re.tagCheck instanceof Function&&re.tagCheck(Me))&&(!U[Me]||se[Me])){if(!se[Me]&&jn(Me)&&(ee.tagNameCheck instanceof RegExp&&kl(ee.tagNameCheck,Me)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Me)))return!1;if(dt&&!Oe[Me]){const st=j(de)||de.parentNode,kt=C(de)||de.childNodes;if(kt&&st){const jt=kt.length;for(let Qr=jt-1;Qr>=0;--Qr){const dn=_(kt[Qr],!0);dn.__removalCount=(de.__removalCount||0)+1,st.insertBefore(dn,w(de))}}}return ft(de),!0}return de instanceof d&&!$e(de)||(Me==="noscript"||Me==="noembed"||Me==="noframes")&&kl(/<\/no(script|embed|frames)/i,de.innerHTML)?(ft(de),!0):(Ve&&de.nodeType===Ub.text&&(oe=de.textContent,s3([W,I,O],st=>{oe=Fb(oe,st," ")}),de.textContent!==oe&&(zb(r.removed,{element:de.cloneNode()}),de.textContent=oe)),Xt(z.afterSanitizeElements,de,null),!1)},un=function(de,oe,Me){if(ae[oe]||tr&&(oe==="id"||oe==="name")&&(Me in n||Me in ze))return!1;if(!(me&&!ae[oe]&&kl(D,oe))){if(!(fe&&kl(P,oe))){if(!(re.attributeCheck instanceof Function&&re.attributeCheck(oe,de))){if(!q[oe]||ae[oe]){if(!(jn(de)&&(ee.tagNameCheck instanceof RegExp&&kl(ee.tagNameCheck,de)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(de))&&(ee.attributeNameCheck instanceof RegExp&&kl(ee.attributeNameCheck,oe)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(oe,de))||oe==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&kl(ee.tagNameCheck,Me)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Me))))return!1}else if(!zt[oe]){if(!kl(F,Fb(Me,V,""))){if(!((oe==="src"||oe==="xlink:href"||oe==="href")&&de!=="script"&&aIe(Me,"data:")===0&&ct[de])){if(!(_e&&!kl($,Fb(Me,V,"")))){if(Me)return!1}}}}}}}return!0},jn=function(de){return de!=="annotation-xml"&&FE(de,K)},Yr=function(de){Xt(z.beforeSanitizeAttributes,de,null);const{attributes:oe}=de;if(!oe||mr(de))return;const Me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let st=oe.length;for(;st--;){const kt=oe[st],{name:jt,namespaceURI:Qr,value:dn}=kt,Nr=Ze(jt),On=dn;let Gn=jt==="value"?On:oIe(On);if(Me.attrName=Nr,Me.attrValue=Gn,Me.keepAttr=!0,Me.forceKeepAttr=void 0,Xt(z.uponSanitizeAttribute,de,Me),Gn=Me.attrValue,ht&&(Nr==="id"||Nr==="name")&&(vt(jt,de),Gn=Ye+Gn),le&&kl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Gn)){vt(jt,de);continue}if(Nr==="attributename"&&FE(Gn,"href")){vt(jt,de);continue}if(Me.forceKeepAttr)continue;if(!Me.keepAttr){vt(jt,de);continue}if(!ge&&kl(/\/>/i,Gn)){vt(jt,de);continue}Ve&&s3([W,I,O],Kn=>{Gn=Fb(Gn,Kn," ")});const lr=Ze(de.nodeName);if(!un(lr,Nr,Gn)){vt(jt,de);continue}if(E&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Qr)switch(v.getAttributeType(lr,Nr)){case"TrustedHTML":{Gn=E.createHTML(Gn);break}case"TrustedScriptURL":{Gn=E.createScriptURL(Gn);break}}if(Gn!==On)try{Qr?de.setAttributeNS(Qr,jt,Gn):de.setAttribute(jt,Gn),mr(de)?ft(de):wF(r.removed)}catch{vt(jt,de)}}Xt(z.afterSanitizeAttributes,de,null)},Nn=function Et(de){let oe=null;const Me=$r(de);for(Xt(z.beforeSanitizeShadowDOM,de,null);oe=Me.nextNode();)Xt(z.uponSanitizeShadowNode,oe,null),Si(oe),Yr(oe),oe.content instanceof a&&Et(oe.content);Xt(z.afterSanitizeShadowDOM,de,null)};return r.sanitize=function(Et){let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=null,Me=null,st=null,kt=null;if(nt=!Et,nt&&(Et="<!-->"),typeof Et!="string"&&!Ur(Et))if(typeof Et.toString=="function"){if(Et=Et.toString(),typeof Et!="string")throw Hb("dirty is not a string, aborting")}else throw Hb("toString is not a function");if(!r.isSupported)return Et;if(Xe||yt(de),r.removed=[],typeof Et=="string"&&(At=!1),At){if(Et.nodeName){const dn=Ze(Et.nodeName);if(!U[dn]||se[dn])throw Hb("root node is forbidden and cannot be sanitized in-place")}}else if(Et instanceof l)oe=gt("<!---->"),Me=oe.ownerDocument.importNode(Et,!0),Me.nodeType===Ub.element&&Me.nodeName==="BODY"||Me.nodeName==="HTML"?oe=Me:oe.appendChild(Me);else{if(!Pt&&!Ve&&!it&&Et.indexOf("<")===-1)return E&&Kt?E.createHTML(Et):Et;if(oe=gt(Et),!oe)return Pt?null:Kt?A:""}oe&&xt&&ft(oe.firstChild);const jt=$r(At?Et:oe);for(;st=jt.nextNode();)Si(st),Yr(st),st.content instanceof a&&Nn(st.content);if(At)return Et;if(Pt){if(Ht)for(kt=B.call(oe.ownerDocument);oe.firstChild;)kt.appendChild(oe.firstChild);else kt=oe;return(q.shadowroot||q.shadowrootmode)&&(kt=H.call(i,kt,!0)),kt}let Qr=it?oe.outerHTML:oe.innerHTML;return it&&U["!doctype"]&&oe.ownerDocument&&oe.ownerDocument.doctype&&oe.ownerDocument.doctype.name&&kl(bte,oe.ownerDocument.doctype.name)&&(Qr="<!DOCTYPE "+oe.ownerDocument.doctype.name+`>
|
|
@@ -1179,8 +1179,8 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
1179
1179
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,a=Math.abs(i-n.x),o=e.width/2;let l=n.x<r.x?o-a:o+a;const d=e.height/2,u=Math.abs(r.y-n.y),h=Math.abs(r.x-n.x);if(Math.abs(s-r.y)*o>Math.abs(i-r.x)*d){let f=n.y<r.y?r.y-d-s:s-d-r.y;l=h*f/u;const g={x:n.x<r.x?n.x+l:n.x-h+l,y:n.y<r.y?n.y+u-f:n.y-u+f};return l===0&&(g.x=r.x,g.y=r.y),h===0&&(g.x=r.x),u===0&&(g.y=r.y),Mt.debug(`abc89 top/bottom calc, Q ${u}, q ${f}, R ${h}, r ${l}`,g),g}else{n.x<r.x?l=r.x-o-i:l=i-o-r.x;let f=u*l/h,g=n.x<r.x?n.x+h-l:n.x-h+l,v=n.y<r.y?n.y+f:n.y-f;return Mt.debug(`sides calc abc89, Q ${u}, q ${f}, R ${h}, r ${l}`,{_x:g,_y:v}),l===0&&(g=r.x,v=r.y),h===0&&(g=r.x),u===0&&(v=r.y),{x:g,y:v}}},"intersection"),XH=X((e,r)=>{Mt.warn("abc88 cutPathAtIntersect",e,r);let n=[],i=e[0],s=!1;return e.forEach(a=>{if(Mt.info("abc88 checking point",a,r),!zYe(r,a)&&!s){const o=FYe(r,i,a);Mt.debug("abc88 inside",a,i,o),Mt.debug("abc88 intersection",o,r);let l=!1;n.forEach(d=>{l=l||d.x===o.x&&d.y===o.y}),n.some(d=>d.x===o.x&&d.y===o.y)?Mt.warn("abc88 no intersect",o,n):n.push(o),s=!0}else Mt.warn("abc88 outside",a,i),i=a,s||n.push(a)}),Mt.debug("returning points",n),n},"cutPathAtIntersect");function Hae(e){const r=[],n=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],a=e[i],o=e[i+1];(s.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-s.y)>5||s.y===a.y&&a.x===o.x&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-o.y)>5)&&(r.push(a),n.push(i))}return{cornerPoints:r,cornerPointPositions:n}}X(Hae,"extractCornerPoints");var JH=X(function(e,r,n){const i=r.x-e.x,s=r.y-e.y,a=Math.sqrt(i*i+s*s),o=n/a;return{x:r.x-o*i,y:r.y-o*s}},"findAdjacentPoint"),HYe=X(function(e){const{cornerPointPositions:r}=Hae(e),n=[];for(let i=0;i<e.length;i++)if(r.includes(i)){const s=e[i-1],a=e[i+1],o=e[i],l=JH(s,o,5),d=JH(a,o,5),u=d.x-l.x,h=d.y-l.y;n.push(l);const f=Math.sqrt(2)*2;let g={x:o.x,y:o.y};if(Math.abs(a.x-s.x)>10&&Math.abs(a.y-s.y)>=10){Mt.debug("Corner point fixing",Math.abs(a.x-s.x),Math.abs(a.y-s.y));const v=5;o.x===l.x?g={x:u<0?l.x-v+f:l.x+v-f,y:h<0?l.y-f:l.y+f}:g={x:u<0?l.x-f:l.x+f,y:h<0?l.y-v+f:l.y+v-f}}else Mt.debug("Corner point skipping fixing",Math.abs(a.x-s.x),Math.abs(a.y-s.y));n.push(g,d)}else n.push(e[i]);return n},"fixCorners"),WYe=X((e,r,n)=>{const i=e-r-n,s=2,a=2,o=s+a,l=Math.floor(i/o),d=Array(l).fill(`${s} ${a}`).join(" ");return`0 ${r} ${d} ${n}`},"generateDashArray"),UYe=X(function(e,r,n,i,s,a,o,l=!1){var P;const{handDrawnSeed:d}=gi();let u=r.points,h=!1;const f=s;var g=a;const v=[];for(const $ in r.cssCompiledStyles)Hie($)||v.push(r.cssCompiledStyles[$]);Mt.debug("UIO intersect check",r.points,g.x,f.x),g.intersect&&f.intersect&&!l&&(u=u.slice(1,r.points.length-1),u.unshift(f.intersect(u[0])),Mt.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&&(Mt.info("to cluster abc88",n.get(r.toCluster)),u=XH(r.points,n.get(r.toCluster).node),h=!0),r.fromCluster&&(Mt.debug("from cluster abc88",n.get(r.fromCluster),JSON.stringify(u,null,2)),u=XH(u.reverse(),n.get(r.fromCluster).node).reverse(),h=!0);let _=u.filter($=>!Number.isNaN($.y));const S=DYe(r.curve);S!=="rounded"&&(_=HYe(_));let w=m2;switch(S){case"linear":w=m2;break;case"basis":w=CO;break;case"cardinal":w=wre;break;case"bumpX":w=yre;break;case"bumpY":w=vre;break;case"catmullRom":w=kre;break;case"monotoneX":w=Are;break;case"monotoneY":w=Ore;break;case"natural":w=Rre;break;case"step":w=Pre;break;case"stepAfter":w=$re;break;case"stepBefore":w=Lre;break;case"rounded":w=m2;break;default:w=CO}const{x:C,y:j}=zUe(r),E=gWe().x(C).y(j).curve(w);let A;switch(r.thickness){case"normal":A="edge-thickness-normal";break;case"thick":A="edge-thickness-thick";break;case"invisible":A="edge-thickness-invisible";break;default:A="edge-thickness-normal"}switch(r.pattern){case"solid":A+=" edge-pattern-solid";break;case"dotted":A+=" edge-pattern-dotted";break;case"dashed":A+=" edge-pattern-dashed";break;default:A+=" edge-pattern-solid"}let N,R=S==="rounded"?Wae(Uae(_,r),5):E(_);const B=Array.isArray(r.style)?r.style:[r.style];let G=B.find($=>$==null?void 0:$.startsWith("stroke:")),H="";r.animate&&(H="edge-animation-fast"),r.animation&&(H="edge-animation-"+r.animation);let z=!1;if(r.look==="handDrawn"){const $=Or.svg(e);Object.assign([],_);const V=$.path(R,{roughness:.3,seed:d});A+=" transition",N=tn(V).select("path").attr("id",r.id).attr("class"," "+A+(r.classes?" "+r.classes:"")+(H?" "+H:"")).attr("style",B?B.reduce((F,U)=>F+";"+U,""):"");let K=N.attr("d");N.attr("d",K),e.node().appendChild(N.node())}else{const $=v.join(";"),V=B?B.reduce((te,ee)=>te+ee+";",""):"",K=($?$+";"+V+";":V)+";"+(B?B.reduce((te,ee)=>te+";"+ee,""):"");N=e.append("path").attr("d",R).attr("id",r.id).attr("class"," "+A+(r.classes?" "+r.classes:"")+(H?" "+H:"")).attr("style",K),G=(P=K.match(/stroke:([^;]+)/))==null?void 0:P[1],z=r.animate===!0||!!r.animation||$.includes("animation");const F=N.node(),U=typeof F.getTotalLength=="function"?F.getTotalLength():0,Q=hH[r.arrowTypeStart]||0,q=hH[r.arrowTypeEnd]||0;if(r.look==="neo"&&!z){const ee=`stroke-dasharray: ${r.pattern==="dotted"||r.pattern==="dashed"?WYe(U,Q,q):`0 ${Q} ${U-Q-q} ${q}`}; stroke-dashoffset: 0;`;N.attr("style",ee+N.attr("style"))}}N.attr("data-edge",!0),N.attr("data-et","edge"),N.attr("data-id",r.id),N.attr("data-points",b),r.showPoints&&_.forEach($=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",$.x).attr("cy",$.y)});let W="";(gi().flowchart.arrowMarkerAbsolute||gi().state.arrowMarkerAbsolute)&&(W=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,W=W.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Mt.info("arrowTypeStart",r.arrowTypeStart),Mt.info("arrowTypeEnd",r.arrowTypeEnd),LYe(N,r,W,o,i,G);const I=Math.floor(u.length/2),O=u[I];Gd.isLabelCoordinateInPath(O,N.attr("d"))||(h=!0);let D={};return h&&(D.updatedPath=u),D.originalPath=r.points,D},"insertEdge");function Wae(e,r){if(e.length<2)return"";let n="";const i=e.length,s=1e-5;for(let a=0;a<i;a++){const o=e[a],l=e[a-1],d=e[a+1];if(a===0)n+=`M${o.x},${o.y}`;else if(a===i-1)n+=`L${o.x},${o.y}`;else{const u=o.x-l.x,h=o.y-l.y,f=d.x-o.x,g=d.y-o.y,v=Math.hypot(u,h),b=Math.hypot(f,g);if(v<s||b<s){n+=`L${o.x},${o.y}`;continue}const _=u/v,S=h/v,w=f/b,C=g/b,j=_*w+S*C,E=Math.max(-1,Math.min(1,j)),A=Math.acos(E);if(A<s||Math.abs(Math.PI-A)<s){n+=`L${o.x},${o.y}`;continue}const N=Math.min(r/Math.sin(A/2),v/2,b/2),R=o.x-_*N,B=o.y-S*N,G=o.x+w*N,H=o.y+C*N;n+=`L${R},${B}`,n+=`Q${o.x},${o.y} ${G},${H}`}}return n}X(Wae,"generateRoundedPath");function QO(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}}X(QO,"calculateDeltaAndAngle");function Uae(e,r){const n=e.map(s=>({...s}));if(e.length>=2&&Xo[r.arrowTypeStart]){const s=Xo[r.arrowTypeStart],a=e[0],o=e[1],{angle:l}=QO(a,o),d=s*Math.cos(l),u=s*Math.sin(l);n[0].x=a.x+d,n[0].y=a.y+u}const i=e.length;if(i>=2&&Xo[r.arrowTypeEnd]){const s=Xo[r.arrowTypeEnd],a=e[i-1],o=e[i-2],{angle:l}=QO(o,a),d=s*Math.cos(l),u=s*Math.sin(l);n[i-1].x=a.x-d,n[i-1].y=a.y-u}return n}X(Uae,"applyMarkerOffsetsToPoints");var VYe=X((e,r,n,i)=>{r.forEach(s=>{oXe[s](e,n,i)})},"insertMarkers"),qYe=X((e,r,n)=>{Mt.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"),GYe=X((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"),KYe=X((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"),YYe=X((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"),XYe=X((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"),JYe=X((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"),ZYe=X((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"),QYe=X((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"),eXe=X((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"),tXe=X((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"),rXe=X((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"),nXe=X((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"),iXe=X((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"),sXe=X((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
|
|
1180
1180
|
L20,10
|
|
1181
1181
|
M20,10
|
|
1182
|
-
L0,20`)},"requirement_arrow"),aXe=X((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"),oXe={extension:qYe,composition:GYe,aggregation:KYe,dependency:YYe,lollipop:XYe,point:JYe,circle:ZYe,cross:QYe,barb:eXe,only_one:tXe,zero_or_one:rXe,one_or_more:nXe,zero_or_more:iXe,requirement_arrow:sXe,requirement_contains:aXe},lXe=VYe,cXe={common:mk,getConfig:nl,insertCluster:mYe,insertEdge:UYe,insertEdgeLabel:IYe,insertMarkers:lXe,insertNode:Fae,interpolateToCurve:AP,labelHelper:ln,log:Mt,positionEdgeLabel:BYe},iS={},Vae=X(e=>{for(const r of e)iS[r.name]=r},"registerLayoutLoaders"),uXe=X(()=>{Vae([{name:"dagre",loader:X(async()=>await rt(()=>import("./dagre-KLK3FWXG-
|
|
1183
|
-
`);const i=MWe(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),Dte(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"),coe={draw:DJe},IJe=coe,BJe={db:{},renderer:coe,parser:{parse:X(()=>{},"parse")}},zJe=BJe,uoe="flowchart-elk",FJe=X((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"),HJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-
|
|
1182
|
+
L0,20`)},"requirement_arrow"),aXe=X((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"),oXe={extension:qYe,composition:GYe,aggregation:KYe,dependency:YYe,lollipop:XYe,point:JYe,circle:ZYe,cross:QYe,barb:eXe,only_one:tXe,zero_or_one:rXe,one_or_more:nXe,zero_or_more:iXe,requirement_arrow:sXe,requirement_contains:aXe},lXe=VYe,cXe={common:mk,getConfig:nl,insertCluster:mYe,insertEdge:UYe,insertEdgeLabel:IYe,insertMarkers:lXe,insertNode:Fae,interpolateToCurve:AP,labelHelper:ln,log:Mt,positionEdgeLabel:BYe},iS={},Vae=X(e=>{for(const r of e)iS[r.name]=r},"registerLayoutLoaders"),uXe=X(()=>{Vae([{name:"dagre",loader:X(async()=>await rt(()=>import("./dagre-KLK3FWXG-B3D0kfsZ.js"),__vite__mapDeps([47,48,49,50,51,52]),import.meta.url),"loader")},{name:"cose-bilkent",loader:X(async()=>await rt(()=>import("./cose-bilkent-S5V4N54A-DS1ZVVu1.js"),__vite__mapDeps([53,54]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");uXe();var vbt=X(async(e,r)=>{if(!(e.layoutAlgorithm in iS))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=iS[e.layoutAlgorithm];return(await n.loader()).render(e,r,cXe,{algorithm:n.algorithm})},"render"),xbt=X((e="",{fallback:r="dagre"}={})=>{if(e in iS)return e;if(r in iS)return Mt.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"),dXe=_ie(Object.keys,Object),hXe=Object.prototype,fXe=hXe.hasOwnProperty;function pXe(e){if(!FN(e))return dXe(e);var r=[];for(var n in Object(e))fXe.call(e,n)&&n!="constructor"&&r.push(n);return r}var e7=jy(gh,"DataView"),t7=jy(gh,"Promise"),r7=jy(gh,"Set"),n7=jy(gh,"WeakMap"),ZH="[object Map]",mXe="[object Object]",QH="[object Promise]",eW="[object Set]",tW="[object WeakMap]",rW="[object DataView]",gXe=Cy(e7),yXe=Cy(rS),vXe=Cy(t7),xXe=Cy(r7),bXe=Cy(n7),S0=ky;(e7&&S0(new e7(new ArrayBuffer(1)))!=rW||rS&&S0(new rS)!=ZH||t7&&S0(t7.resolve())!=QH||r7&&S0(new r7)!=eW||n7&&S0(new n7)!=tW)&&(S0=function(e){var r=ky(e),n=r==mXe?e.constructor:void 0,i=n?Cy(n):"";if(i)switch(i){case gXe:return rW;case yXe:return ZH;case vXe:return QH;case xXe:return eW;case bXe:return tW}return r});var _Xe="[object Map]",wXe="[object Set]",SXe=Object.prototype,kXe=SXe.hasOwnProperty;function nW(e){if(e==null)return!0;if(HN(e)&&(qj(e)||typeof e=="string"||typeof e.splice=="function"||TP(e)||EP(e)||Vj(e)))return!e.length;var r=S0(e);if(r==_Xe||r==wXe)return!e.size;if(FN(e))return!pXe(e).length;for(var n in e)if(kXe.call(e,n))return!1;return!0}var qae="c4",CXe=X(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),jXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./c4Diagram-IC4MRINW-D6W2i2Ca.js");return{diagram:r}},__vite__mapDeps([55,56]),import.meta.url);return{id:qae,diagram:e}},"loader"),NXe={id:qae,detector:CXe,loader:jXe},TXe=NXe,Gae="flowchart",EXe=X((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"),AXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-Dmx06hxo.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Gae,diagram:e}},"loader"),OXe={id:Gae,detector:EXe,loader:AXe},MXe=OXe,Kae="flowchart-v2",RXe=X((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"),PXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-Dmx06hxo.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Kae,diagram:e}},"loader"),LXe={id:Kae,detector:RXe,loader:PXe},$Xe=LXe,Yae="er",DXe=X(e=>/^\s*erDiagram/.test(e),"detector"),IXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./erDiagram-INFDFZHY-BVTmzkaD.js");return{diagram:r}},__vite__mapDeps([62,59,60,61]),import.meta.url);return{id:Yae,diagram:e}},"loader"),BXe={id:Yae,detector:DXe,loader:IXe},zXe=BXe,Xae="gitGraph",FXe=X(e=>/^\s*gitGraph/.test(e),"detector"),HXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./gitGraphDiagram-K3NZZRJ6-edx9tuIF.js");return{diagram:r}},__vite__mapDeps([63,64,65,66,49,51,52]),import.meta.url);return{id:Xae,diagram:e}},"loader"),WXe={id:Xae,detector:FXe,loader:HXe},UXe=WXe,Jae="gantt",VXe=X(e=>/^\s*gantt/.test(e),"detector"),qXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./ganttDiagram-A5KZAMGK-C42lw8sD.js");return{diagram:r}},__vite__mapDeps([67,68,69]),import.meta.url);return{id:Jae,diagram:e}},"loader"),GXe={id:Jae,detector:VXe,loader:qXe},KXe=GXe,Zae="info",YXe=X(e=>/^\s*info/.test(e),"detector"),XXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./infoDiagram-LFFYTUFH-DHZVpOBK.js");return{diagram:r}},__vite__mapDeps([70,66,49,51,52]),import.meta.url);return{id:Zae,diagram:e}},"loader"),JXe={id:Zae,detector:YXe,loader:XXe},Qae="pie",ZXe=X(e=>/^\s*pie/.test(e),"detector"),QXe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./pieDiagram-SKSYHLDU-B7ePcbjv.js");return{diagram:r}},__vite__mapDeps([71,64,66,49,51,52,72]),import.meta.url);return{id:Qae,diagram:e}},"loader"),eJe={id:Qae,detector:ZXe,loader:QXe},eoe="quadrantChart",tJe=X(e=>/^\s*quadrantChart/.test(e),"detector"),rJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./quadrantDiagram-337W2JSQ-DjCvFqay.js");return{diagram:r}},__vite__mapDeps([73,68,69]),import.meta.url);return{id:eoe,diagram:e}},"loader"),nJe={id:eoe,detector:tJe,loader:rJe},iJe=nJe,toe="xychart",sJe=X(e=>/^\s*xychart(-beta)?/.test(e),"detector"),aJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./xychartDiagram-JWTSCODW-RqBcb5lT.js");return{diagram:r}},__vite__mapDeps([74,68,69]),import.meta.url);return{id:toe,diagram:e}},"loader"),oJe={id:toe,detector:sJe,loader:aJe},lJe=oJe,roe="requirement",cJe=X(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),uJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./requirementDiagram-Z7DCOOCP-BUP0LpDa.js");return{diagram:r}},__vite__mapDeps([75,59,60]),import.meta.url);return{id:roe,diagram:e}},"loader"),dJe={id:roe,detector:cJe,loader:uJe},hJe=dJe,noe="sequence",fJe=X(e=>/^\s*sequenceDiagram/.test(e),"detector"),pJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./sequenceDiagram-2WXFIKYE-DL_pX6qe.js");return{diagram:r}},__vite__mapDeps([76,56,65]),import.meta.url);return{id:noe,diagram:e}},"loader"),mJe={id:noe,detector:fJe,loader:pJe},gJe=mJe,ioe="class",yJe=X((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"),vJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./classDiagram-VBA2DB6C-K4_5k-1u.js");return{diagram:r}},__vite__mapDeps([77,78,58,56,59,60]),import.meta.url);return{id:ioe,diagram:e}},"loader"),xJe={id:ioe,detector:yJe,loader:vJe},bJe=xJe,soe="classDiagram",_Je=X((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"),wJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./classDiagram-v2-RAHNMMFH-K4_5k-1u.js");return{diagram:r}},__vite__mapDeps([79,78,58,56,59,60]),import.meta.url);return{id:soe,diagram:e}},"loader"),SJe={id:soe,detector:_Je,loader:wJe},kJe=SJe,aoe="state",CJe=X((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"),jJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./stateDiagram-RAJIS63D-DnbTcmJ8.js");return{diagram:r}},__vite__mapDeps([80,81,59,60,48,49,50,51]),import.meta.url);return{id:aoe,diagram:e}},"loader"),NJe={id:aoe,detector:CJe,loader:jJe},TJe=NJe,ooe="stateDiagram",EJe=X((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"),AJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./stateDiagram-v2-FVOUBMTO-DYiFxPL4.js");return{diagram:r}},__vite__mapDeps([82,81,59,60]),import.meta.url);return{id:ooe,diagram:e}},"loader"),OJe={id:ooe,detector:EJe,loader:AJe},MJe=OJe,loe="journey",RJe=X(e=>/^\s*journey/.test(e),"detector"),PJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./journeyDiagram-4ABVD52K-DsJZfSyN.js");return{diagram:r}},__vite__mapDeps([83,58,56,72]),import.meta.url);return{id:loe,diagram:e}},"loader"),LJe={id:loe,detector:RJe,loader:PJe},$Je=LJe,DJe=X((e,r,n)=>{Mt.debug(`rendering svg for syntax error
|
|
1183
|
+
`);const i=MWe(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),Dte(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"),coe={draw:DJe},IJe=coe,BJe={db:{},renderer:coe,parser:{parse:X(()=>{},"parse")}},zJe=BJe,uoe="flowchart-elk",FJe=X((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"),HJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-Dmx06hxo.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:uoe,diagram:e}},"loader"),WJe={id:uoe,detector:FJe,loader:HJe},UJe=WJe,doe="timeline",VJe=X(e=>/^\s*timeline/.test(e),"detector"),qJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./timeline-definition-YZTLITO2-C5ZkP-QO.js");return{diagram:r}},__vite__mapDeps([84,72]),import.meta.url);return{id:doe,diagram:e}},"loader"),GJe={id:doe,detector:VJe,loader:qJe},KJe=GJe,hoe="mindmap",YJe=X(e=>/^\s*mindmap/.test(e),"detector"),XJe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./mindmap-definition-YRQLILUH-C0_OllT-.js");return{diagram:r}},__vite__mapDeps([85,59,60]),import.meta.url);return{id:hoe,diagram:e}},"loader"),JJe={id:hoe,detector:YJe,loader:XJe},ZJe=JJe,foe="kanban",QJe=X(e=>/^\s*kanban/.test(e),"detector"),eZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./kanban-definition-K7BYSVSG-BufyvHP-.js");return{diagram:r}},__vite__mapDeps([86,58]),import.meta.url);return{id:foe,diagram:e}},"loader"),tZe={id:foe,detector:QJe,loader:eZe},rZe=tZe,poe="sankey",nZe=X(e=>/^\s*sankey(-beta)?/.test(e),"detector"),iZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./sankeyDiagram-WA2Y5GQK-D0S2AsyJ.js");return{diagram:r}},[],import.meta.url);return{id:poe,diagram:e}},"loader"),sZe={id:poe,detector:nZe,loader:iZe},aZe=sZe,moe="packet",oZe=X(e=>/^\s*packet(-beta)?/.test(e),"detector"),lZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./diagram-P4PSJMXO-BnKTNbr0.js");return{diagram:r}},__vite__mapDeps([87,64,66,49,51,52]),import.meta.url);return{id:moe,diagram:e}},"loader"),cZe={id:moe,detector:oZe,loader:lZe},goe="radar",uZe=X(e=>/^\s*radar-beta/.test(e),"detector"),dZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./diagram-IFDJBPK2-BRrYTTMU.js");return{diagram:r}},__vite__mapDeps([88,64,66,49,51,52]),import.meta.url);return{id:goe,diagram:e}},"loader"),hZe={id:goe,detector:uZe,loader:dZe},yoe="block",fZe=X(e=>/^\s*block(-beta)?/.test(e),"detector"),pZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./blockDiagram-WCTKOSBZ-DwtfBpBB.js");return{diagram:r}},__vite__mapDeps([89,58,52,49,48,61]),import.meta.url);return{id:yoe,diagram:e}},"loader"),mZe={id:yoe,detector:fZe,loader:pZe},gZe=mZe,voe="architecture",yZe=X(e=>/^\s*architecture/.test(e),"detector"),vZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./architectureDiagram-2XIMDMQ5-DXqVqRgD.js");return{diagram:r}},__vite__mapDeps([90,64,66,49,51,52,54]),import.meta.url);return{id:voe,diagram:e}},"loader"),xZe={id:voe,detector:yZe,loader:vZe},bZe=xZe,xoe="ishikawa",_Ze=X(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),wZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./ishikawaDiagram-PHBUUO56-DUECtdZX.js");return{diagram:r}},[],import.meta.url);return{id:xoe,diagram:e}},"loader"),SZe={id:xoe,detector:_Ze,loader:wZe},boe="venn",kZe=X(e=>/^\s*venn-beta/.test(e),"detector"),CZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./vennDiagram-LZ73GAT5-C4VkcwHn.js");return{diagram:r}},[],import.meta.url);return{id:boe,diagram:e}},"loader"),jZe={id:boe,detector:kZe,loader:CZe},NZe=jZe,_oe="treemap",TZe=X(e=>/^\s*treemap/.test(e),"detector"),EZe=X(async()=>{const{diagram:e}=await rt(async()=>{const{diagram:r}=await import("./diagram-E7M64L7V-Dx9vKa0I.js");return{diagram:r}},__vite__mapDeps([91,60,64,66,49,51,52,69]),import.meta.url);return{id:_oe,diagram:e}},"loader"),AZe={id:_oe,detector:TZe,loader:EZe},iW=!1,XN=X(()=>{iW||(iW=!0,Nj("error",zJe,e=>e.toLowerCase().trim()==="error"),Nj("---",{db:{clear:X(()=>{},"clear")},styles:{},renderer:{draw:X(()=>{},"draw")},parser:{parse:X(()=>{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:X(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),uO(UJe,ZJe,bZe),uO(TXe,rZe,kJe,bJe,zXe,KXe,JXe,eJe,hJe,gJe,$Xe,MXe,KJe,UXe,MJe,TJe,$Je,iJe,aZe,cZe,lJe,gZe,hZe,SZe,AZe,NZe))},"addDiagrams"),OZe=X(async()=>{Mt.debug("Loading registered diagrams");const r=(await Promise.allSettled(Object.entries(ry).map(async([n,{detector:i,loader:s}])=>{if(s)try{pO(n)}catch{try{const{diagram:a,id:o}=await s();Nj(o,a,i)}catch(a){throw Mt.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete ry[n],a}}}))).filter(n=>n.status==="rejected");if(r.length>0){Mt.error(`Failed to load ${r.length} external diagrams`);for(const n of r)Mt.error(n);throw new Error(`Failed to load ${r.length} external diagrams`)}},"loadRegisteredDiagrams"),MZe="graphics-document document";function woe(e,r){e.attr("role",MZe),r!==""&&e.attr("aria-roledescription",r)}X(woe,"setA11yDiagramInfo");function Soe(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)}}}X(Soe,"addSVGa11yTitleDescription");var q0,i7=(q0=class{constructor(r,n,i,s,a){this.type=r,this.text=n,this.db=i,this.parser=s,this.renderer=a}static async fromText(r,n={}){var u,h;const i=nl(),s=J9(r,i);r=LGe(r)+`
|
|
1184
1184
|
`;try{pO(s)}catch{const f=SIe(s);if(!f)throw new Ste(`Diagram ${s} not found.`);const{id:g,diagram:v}=await f();Nj(g,v)}const{db:a,parser:o,renderer:l,init:d}=pO(s);return o.parser&&(o.parser.yy=a),(u=a.clear)==null||u.call(a),d==null||d(i),n.title&&((h=a.setDiagramTitle)==null||h.call(a,n.title)),await o.parse(r),new q0(s,r,a,o,l)}async render(r,n){await this.renderer.draw(this.text,r,n,this)}getParser(){return this.parser}getType(){return this.type}},X(q0,"Diagram"),q0),sW=[],RZe=X(()=>{sW.forEach(e=>{e()}),sW=[]},"attachFunctions"),PZe=X(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function koe(e){const r=e.match(wte);if(!r)return{text:e,metadata:{}};let n=BUe(r[1],{schema:IUe})??{};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}}X(koe,"extractFrontMatter");var LZe=X(e=>e.replace(/\r\n?/g,`
|
|
1185
1185
|
`).replace(/<(\w+)([^>]*)>/g,(r,n,i)=>"<"+n+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),$Ze=X(e=>{const{text:r,metadata:n}=koe(e),{displayMode:i,title:s,config:a={}}=n;return i&&(a.gantt||(a.gantt={}),a.gantt.displayMode=i),{title:s,config:a,text:r}},"processFrontmatter"),DZe=X(e=>{const r=Gd.detectInit(e)??{},n=Gd.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:wGe(e),directive:r}},"processDirectives");function JP(e){const r=LZe(e),n=$Ze(r),i=DZe(n.text),s=LP(n.config,i.directive);return e=PZe(i.text),{code:e,title:n.title,config:s}}X(JP,"preprocessDiagram");function Coe(e){const r=new TextEncoder().encode(e),n=Array.from(r,i=>String.fromCodePoint(i)).join("");return btoa(n)}X(Coe,"toBase64");var IZe=5e4,BZe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",zZe="sandbox",FZe="loose",HZe="http://www.w3.org/2000/svg",WZe="http://www.w3.org/1999/xlink",UZe="http://www.w3.org/1999/xhtml",VZe="100%",qZe="100%",GZe="border:0;margin:0;",KZe="margin:0",YZe="allow-top-navigation-by-user-activation allow-popups",XZe='The "iframe" tag is not supported by your browser.',JZe=["foreignobject"],ZZe=["dominant-baseline"];function ZP(e){const r=JP(e);return Cj(),BIe(r.config??{}),r}X(ZP,"processAndSetConfigs");async function joe(e,r){XN();try{const{code:n,config:i}=ZP(e);return{diagramType:(await Toe(n)).type,config:i}}catch(n){if(r!=null&&r.suppressErrors)return!1;throw n}}X(joe,"parse");var aW=X((e,r,n=[])=>`
|
|
1186
1186
|
.${e} ${r} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),QZe=X((e,r=new Map)=>{let n="";if(e.themeCSS!==void 0&&(n+=`
|
|
@@ -1227,7 +1227,7 @@ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
|
|
|
1227
1227
|
`);navigator.clipboard.writeText(S),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 S=n.current;if(!S)return;const w=S.scrollHeight-S.scrollTop-S.clientHeight<40;s(w)},[]);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:a,onChange:S=>o(S.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(we,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:b,title:"Copy all events",children:l?c.jsx(gs,{className:"h-3 w-3 text-green-400"}):c.jsx(hc,{className:"h-3 w-3"})}),c.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:nrt,children:c.jsx(Rl,{className:"h-3 w-3"})}),c.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:e,children:c.jsx(Xn,{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(S=>{const w=g[S.index],C=new Date(w.ts).toISOString().slice(11,23),j=srt[w.type]??"text-zinc-400",E=w.raw.length>120,A=u.has(w.id),N=E&&!A?w.raw.slice(0,120)+"…":w.raw;return c.jsxs("div",{"data-index":S.index,ref:v.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${S.start}px)`},className:Ae("flex gap-2 px-2 hover:bg-zinc-800/50 leading-tight cursor-pointer select-none",A?"items-start py-1 bg-zinc-800/30":"items-center"),onClick:()=>f(w.id),children:[c.jsx("span",{className:"text-zinc-600 shrink-0 w-20",style:{minHeight:g8},children:C}),c.jsx("span",{className:Ae("shrink-0 w-28 text-right",j),style:{minHeight:g8},children:w.type}),c.jsxs("span",{className:Ae("text-zinc-400 min-w-0",A?"break-all whitespace-pre-wrap":"truncate"),children:[N,E&&!A&&c.jsx("span",{className:"text-zinc-600 ml-1",children:"▸"})]})]},w.id)})})}),!i&&c.jsx("div",{className:"absolute bottom-2 right-4",children:c.jsx(we,{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(gY,{className:"h-3 w-3"})})})]})}function ort(e,r=[]){let n=[];function i(a,o){const l=y.createContext(o),d=n.length;n=[...n,o];const u=f=>{var w;const{scope:g,children:v,...b}=f,_=((w=g==null?void 0:g[e])==null?void 0:w[d])||l,S=y.useMemo(()=>b,Object.values(b));return c.jsx(_.Provider,{value:S,children:v})};u.displayName=a+"Provider";function h(f,g){var _;const v=((_=g==null?void 0:g[e])==null?void 0:_[d])||l,b=y.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,h]}const s=()=>{const a=n.map(o=>y.createContext(o));return function(l){const d=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return s.scopeName=e,[i,lrt(s,...r)]}function lrt(...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(a){const o=i.reduce((l,{useScope:d,scopeName:u})=>{const f=d(a)[`__scope${u}`];return{...l,...f}},{});return y.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}function wle(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 crt(e){const r=urt(e),n=y.forwardRef((i,s)=>{const{children:a,...o}=i,l=y.Children.toArray(a),d=l.find(hrt);if(d){const u=d.props.children,h=l.map(f=>f===d?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:f);return c.jsx(r,{...o,ref:s,children:y.isValidElement(u)?y.cloneElement(u,void 0,h):null})}return c.jsx(r,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function urt(e){const r=y.forwardRef((n,i)=>{const{children:s,...a}=n;if(y.isValidElement(s)){const o=prt(s),l=frt(a,s.props);return s.type!==y.Fragment&&(l.ref=i?va(i,o):o),y.cloneElement(s,l)}return y.Children.count(s)>1?y.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var drt=Symbol("radix.slottable");function hrt(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===drt}function frt(e,r){const n={...r};for(const i in r){const s=e[i],a=r[i];/^on[A-Z]/.test(i)?s&&a?n[i]=(...l)=>{const d=a(...l);return s(...l),d}:s&&(n[i]=s):i==="style"?n[i]={...s,...a}:i==="className"&&(n[i]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function prt(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 mrt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sle=mrt.reduce((e,r)=>{const n=crt(`Primitive.${r}`),i=y.forwardRef((s,a)=>{const{asChild:o,...l}=s,d=o?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:a})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),e6="Switch",[grt]=ort(e6),[yrt,vrt]=grt(e6),kle=y.forwardRef((e,r)=>{const{__scopeSwitch:n,name:i,checked:s,defaultChecked:a,required:o,disabled:l,value:d="on",onCheckedChange:u,form:h,...f}=e,[g,v]=y.useState(null),b=ui(r,j=>v(j)),_=y.useRef(!1),S=g?h||!!g.closest("form"):!0,[w,C]=Cp({prop:s,defaultProp:a??!1,onChange:u,caller:e6});return c.jsxs(yrt,{scope:n,checked:w,disabled:l,children:[c.jsx(Sle.button,{type:"button",role:"switch","aria-checked":w,"aria-required":o,"data-state":Tle(w),"data-disabled":l?"":void 0,disabled:l,value:d,...f,ref:b,onClick:vr(e.onClick,j=>{C(E=>!E),S&&(_.current=j.isPropagationStopped(),_.current||j.stopPropagation())})}),S&&c.jsx(Nle,{control:g,bubbles:!_.current,name:i,value:d,checked:w,required:o,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});kle.displayName=e6;var Cle="SwitchThumb",jle=y.forwardRef((e,r)=>{const{__scopeSwitch:n,...i}=e,s=vrt(Cle,n);return c.jsx(Sle.span,{"data-state":Tle(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r})});jle.displayName=Cle;var xrt="SwitchBubbleInput",Nle=y.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:i=!0,...s},a)=>{const o=y.useRef(null),l=ui(o,a),d=wle(n),u=tX(r);return y.useEffect(()=>{const h=o.current;if(!h)return;const f=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(f,"checked").set;if(d!==n&&v){const b=new Event("click",{bubbles:i});v.call(h,n),h.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}})});Nle.displayName=xrt;function Tle(e){return e?"checked":"unchecked"}var Ele=kle,brt=jle;const gf=y.forwardRef(({className:e,...r},n)=>c.jsx(Ele,{className:Ae("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(brt,{className:Ae("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")})}));gf.displayName=Ele.displayName;const w7=[{label:"Every minute",value:"* * * * *",description:"Runs every minute"},{label:"Every 5 minutes",value:"*/5 * * * *",description:"Runs every 5 minutes"},{label:"Every 15 minutes",value:"*/15 * * * *",description:"Runs every 15 minutes"},{label:"Every 30 minutes",value:"*/30 * * * *",description:"Runs every 30 minutes"},{label:"Hourly",value:"0 * * * *",description:"Runs at the start of every hour"},{label:"Every 2 hours",value:"0 */2 * * *",description:"Runs every 2 hours"},{label:"Daily at midnight",value:"0 0 * * *",description:"Runs at 00:00 every day"},{label:"Daily at 9am",value:"0 9 * * *",description:"Runs at 09:00 every day"},{label:"Daily at 6pm",value:"0 18 * * *",description:"Runs at 18:00 every day"},{label:"Weekly (Sunday)",value:"0 0 * * 0",description:"Runs at midnight every Sunday"},{label:"Weekly (Monday)",value:"0 9 * * 1",description:"Runs at 9am every Monday"},{label:"Monthly",value:"0 0 1 * *",description:"Runs at midnight on the 1st of each month"}];function t6(e){return e.trim().split(/\s+/).join(" ")}function Qc(e){if(!/^\d+$/.test(e))return null;const r=Number.parseInt(e,10);return Number.isNaN(r)?null:r}function Ale(e){const r=t6(e),n=r.split(" ");if(n.length!==5)return r;const[i,s,a,o,l]=n,d=w7.find(h=>h.value===r);if(d)return d.description;const u=[];if(i==="*"&&s==="*"?u.push("Every minute"):i.startsWith("*/")?u.push(`Every ${i.slice(2)} minutes`):s==="*"?u.push(`At minute ${i} of every hour`):i==="0"?u.push(`At ${s}:00`):u.push(`At ${s}:${i.padStart(2,"0")}`),l!=="*"){const h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=Qc(l);f!==null&&f>=0&&f<=6&&u.push(`on ${h[f]}`)}if(a!=="*"&&u.push(`on day ${a}`),o!=="*"){const h=["","January","February","March","April","May","June","July","August","September","October","November","December"],f=Qc(o);f!==null&&f>=1&&f<=12&&u.push(`in ${h[f]}`)}return u.join(" ")}function Ole(e){const r=t6(e).split(" ");if(r.length!==5)return{valid:!1,error:"Cron expression must have 5 parts (minute hour day month weekday)"};const[n,i,s,a,o]=r,l=[{name:"minute",value:n,min:0,max:59},{name:"hour",value:i,min:0,max:23},{name:"day",value:s,min:1,max:31},{name:"month",value:a,min:1,max:12},{name:"weekday",value:o,min:0,max:6}];for(const d of l)if(!_rt(d.value,d.min,d.max))return{valid:!1,error:`Invalid ${d.name}: ${d.value}`};return{valid:!0}}function _rt(e,r,n){if(e==="*")return!0;if(e.startsWith("*/")){const s=Qc(e.slice(2));return s!==null&&s>0&&s<=n}if(e.includes("-")){const s=e.split("-");if(s.length!==2)return!1;const a=Qc(s[0]??""),o=Qc(s[1]??"");return a!==null&&o!==null&&a>=r&&o<=n&&a<=o}if(e.includes(","))return e.split(",").every(s=>{const a=Qc(s);return a!==null&&a>=r&&a<=n});const i=Qc(e);return i!==null&&i>=r&&i<=n}function wrt(e){try{if(!Ole(e).valid)return null;const r=new Date,n=t6(e).split(" "),[i,s]=n;if(i==="*"&&s==="*"){const a=new Date(r);return a.setMinutes(r.getMinutes()+1,0,0),a}if(i.startsWith("*/")){const a=Qc(i.slice(2));if(a===null||a<=0)return null;const o=new Date(r),l=Math.ceil(r.getMinutes()/a)*a;return l>=60?(o.setHours(o.getHours()+1),o.setMinutes(l%60)):o.setMinutes(l),o.setSeconds(0),o.setMilliseconds(0),o<=r&&o.setMinutes(o.getMinutes()+a),o}if(i!=="*"&&s==="*"){const a=Qc(i);if(a===null)return null;const o=new Date(r);return o.setMinutes(a,0,0),o<=r&&o.setHours(o.getHours()+1),o}if(i!=="*"&&s.startsWith("*/")){const a=Qc(i),o=Qc(s.slice(2));if(a===null||o===null||o<=0)return null;const l=new Date(r);l.setMinutes(a,0,0);const d=r.getHours(),u=d%o;let h=u===0?d:d+(o-u);return l.setHours(h),l<=r&&(h+=o,l.setHours(h)),l}if(i!=="*"&&s!=="*"){const a=Qc(i),o=Qc(s);if(a===null||o===null)return null;const l=new Date(r);return l.setHours(o),l.setMinutes(a),l.setSeconds(0),l.setMilliseconds(0),l<=r&&l.setDate(l.getDate()+1),l}return null}catch{return null}}function Srt(e){const r=new Date,n=e.getTime()-r.getTime();if(n<6e4)return"now";const i=Math.floor(n/6e4);if(i<60)return`in ${i}m`;const s=Math.floor(n/36e5);return s<24?`in ${s}h`:`in ${Math.floor(n/864e5)}d`}function krt({job:e,recentRun:r,onToggle:n,onTrigger:i,onDelete:s,onEdit:a,onViewHistory:o,isLoading:l=!1}){const[d,u]=y.useState(!1),[h,f]=y.useState(!1),g=async S=>{u(!0);try{await n(e.id,S)}finally{u(!1)}},v=async()=>{f(!0);try{await i(e.id)}finally{f(!1)}},b=e.enabled?wrt(e.cron_expression):null,_={agent_task:"Agent Task",system_job:"System Job"};return c.jsxs(Zr,{"data-testid":`job-card-${e.id}`,className:Ae("transition-opacity",l&&"opacity-50",!e.enabled&&"opacity-75"),children:[c.jsx(xle,{className:"space-y-3 pb-3",children:c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.job_type==="agent_task"&&e.model&&e.provider&&c.jsx(vj,{provider:e.provider,model:e.model,size:32}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(ble,{className:"truncate text-base md:text-lg",children:e.name}),c.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[c.jsx(Ar,{variant:e.job_type==="agent_task"?"default":"secondary",children:_[e.job_type]}),e.provider&&c.jsx(Ar,{variant:"outline",className:"text-xs",children:e.provider})]})]})]}),c.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-muted/20 px-3 py-2 md:min-w-[92px] md:justify-end md:border-0 md:bg-transparent md:p-0",children:[c.jsx("span",{className:"text-xs text-muted-foreground md:hidden",children:e.enabled?"Enabled":"Paused"}),c.jsx(gf,{checked:e.enabled,onCheckedChange:g,disabled:d})]})]})}),c.jsxs(Kc,{className:"space-y-3 pt-0",children:[c.jsxs("div",{className:"flex flex-col gap-1 text-sm text-muted-foreground md:flex-row md:items-center md:gap-2",children:[c.jsx(vg,{className:"h-4 w-4"}),c.jsx("span",{className:"break-all font-mono",children:e.cron_expression}),c.jsxs("span",{className:"text-xs md:text-xs",children:["(",Ale(e.cron_expression),")"]})]}),b&&c.jsxs("div",{className:"text-sm text-muted-foreground",children:["Next run: ",b.toLocaleString()," (",Srt(b),")"]}),e.prompt&&c.jsxs("div",{className:"line-clamp-2 text-sm italic text-muted-foreground",children:['"',e.prompt,'"']}),r&&c.jsxs("div",{className:"flex flex-col gap-1 text-sm md:flex-row md:items-center md:gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[r.status==="completed"&&c.jsxs(c.Fragment,{children:[c.jsx(ia,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Last run succeeded"})]}),r.status==="failed"&&c.jsxs(c.Fragment,{children:[c.jsx(na,{className:"h-4 w-4 text-red-500"}),c.jsx("span",{className:"text-red-600 dark:text-red-400",children:"Last run failed"})]}),r.status==="running"&&c.jsxs(c.Fragment,{children:[c.jsx(Ft,{className:"h-4 w-4 animate-spin text-blue-500"}),c.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"Running now..."})]})]}),r.started_at&&c.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(r.started_at).toLocaleString()})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t pt-3 md:grid-cols-[minmax(0,1fr)_auto_auto_auto] md:items-center",children:[c.jsxs(we,{variant:"outline",size:"sm",onClick:v,disabled:h||!e.enabled,"data-testid":`job-trigger-${e.id}`,className:"w-full md:justify-self-start",children:[h?c.jsx(Ft,{className:"h-4 w-4 mr-1 animate-spin"}):c.jsx(US,{className:"h-4 w-4 mr-1"}),"Run Now"]}),c.jsxs(we,{variant:"ghost",size:"sm",onClick:()=>o(e),"data-testid":`job-history-${e.id}`,className:"w-full md:w-auto",children:[c.jsx(V5,{className:"h-4 w-4 mr-1"}),c.jsx("span",{className:"md:hidden lg:inline",children:"History"})]}),c.jsx(we,{variant:"ghost",size:"icon",onClick:()=>a(e),"aria-label":`Edit job ${e.name}`,"data-testid":`job-edit-${e.id}`,className:"h-8 w-full md:w-8",children:c.jsx(kve,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"icon",onClick:()=>s(e.id),className:"h-8 w-full text-destructive hover:bg-destructive/10 hover:text-destructive md:w-8","aria-label":`Delete job ${e.name}`,"data-testid":`job-delete-${e.id}`,children:c.jsx(Rl,{className:"h-4 w-4"})})]})]})]})}function rU(e,[r,n]){return Math.min(n,Math.max(r,e))}function Crt(e,r=[]){let n=[];function i(a,o){const l=y.createContext(o),d=n.length;n=[...n,o];const u=f=>{var w;const{scope:g,children:v,...b}=f,_=((w=g==null?void 0:g[e])==null?void 0:w[d])||l,S=y.useMemo(()=>b,Object.values(b));return c.jsx(_.Provider,{value:S,children:v})};u.displayName=a+"Provider";function h(f,g){var _;const v=((_=g==null?void 0:g[e])==null?void 0:_[d])||l,b=y.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,h]}const s=()=>{const a=n.map(o=>y.createContext(o));return function(l){const d=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return s.scopeName=e,[i,jrt(s,...r)]}function jrt(...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(a){const o=i.reduce((l,{useScope:d,scopeName:u})=>{const f=d(a)[`__scope${u}`];return{...l,...f}},{});return y.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}function Mle(e){const r=Nrt(e),n=y.forwardRef((i,s)=>{const{children:a,...o}=i,l=y.Children.toArray(a),d=l.find(Ert);if(d){const u=d.props.children,h=l.map(f=>f===d?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:f);return c.jsx(r,{...o,ref:s,children:y.isValidElement(u)?y.cloneElement(u,void 0,h):null})}return c.jsx(r,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function Nrt(e){const r=y.forwardRef((n,i)=>{const{children:s,...a}=n;if(y.isValidElement(s)){const o=Ort(s),l=Art(a,s.props);return s.type!==y.Fragment&&(l.ref=i?va(i,o):o),y.cloneElement(s,l)}return y.Children.count(s)>1?y.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Trt=Symbol("radix.slottable");function Ert(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Trt}function Art(e,r){const n={...r};for(const i in r){const s=e[i],a=r[i];/^on[A-Z]/.test(i)?s&&a?n[i]=(...l)=>{const d=a(...l);return s(...l),d}:s&&(n[i]=s):i==="style"?n[i]={...s,...a}:i==="className"&&(n[i]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function Ort(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 Mrt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],uu=Mrt.reduce((e,r)=>{const n=Mle(`Primitive.${r}`),i=y.forwardRef((s,a)=>{const{asChild:o,...l}=s,d=o?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:a})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{});function Rrt(e){const r=Prt(e),n=y.forwardRef((i,s)=>{const{children:a,...o}=i,l=y.Children.toArray(a),d=l.find($rt);if(d){const u=d.props.children,h=l.map(f=>f===d?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:f);return c.jsx(r,{...o,ref:s,children:y.isValidElement(u)?y.cloneElement(u,void 0,h):null})}return c.jsx(r,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function Prt(e){const r=y.forwardRef((n,i)=>{const{children:s,...a}=n;if(y.isValidElement(s)){const o=Irt(s),l=Drt(a,s.props);return s.type!==y.Fragment&&(l.ref=i?va(i,o):o),y.cloneElement(s,l)}return y.Children.count(s)>1?y.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Lrt=Symbol("radix.slottable");function $rt(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lrt}function Drt(e,r){const n={...r};for(const i in r){const s=e[i],a=r[i];/^on[A-Z]/.test(i)?s&&a?n[i]=(...l)=>{const d=a(...l);return s(...l),d}:s&&(n[i]=s):i==="style"?n[i]={...s,...a}:i==="className"&&(n[i]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function Irt(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 Brt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zrt=Brt.reduce((e,r)=>{const n=Rrt(`Primitive.${r}`),i=y.forwardRef((s,a)=>{const{asChild:o,...l}=s,d=o?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:a})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),Rle=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Frt="VisuallyHidden",Hrt=y.forwardRef((e,r)=>c.jsx(zrt.span,{...e,ref:r,style:{...Rle,...e.style}}));Hrt.displayName=Frt;var Wrt=[" ","Enter","ArrowUp","ArrowDown"],Urt=[" ","Enter"],cy="Select",[r6,n6,Vrt]=jR(cy),[gx]=Crt(cy,[Vrt,nx]),i6=nx(),[qrt,jg]=gx(cy),[Grt,Krt]=gx(cy),Ple=e=>{const{__scopeSelect:r,children:n,open:i,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:d,dir:u,name:h,autoComplete:f,disabled:g,required:v,form:b}=e,_=i6(r),[S,w]=y.useState(null),[C,j]=y.useState(null),[E,A]=y.useState(!1),N=V4(u),[R,B]=Cp({prop:i,defaultProp:s??!1,onChange:a,caller:cy}),[G,H]=Cp({prop:o,defaultProp:l,onChange:d,caller:cy}),z=y.useRef(null),W=S?b||!!S.closest("form"):!0,[I,O]=y.useState(new Set),D=Array.from(I).map(P=>P.props.value).join(";");return c.jsx(LR,{..._,children:c.jsxs(qrt,{required:v,scope:r,trigger:S,onTriggerChange:w,valueNode:C,onValueNodeChange:j,valueNodeHasChildren:E,onValueNodeHasChildrenChange:A,contentId:Zu(),value:G,onValueChange:H,open:R,onOpenChange:B,dir:N,triggerPointerDownPosRef:z,disabled:g,children:[c.jsx(r6.Provider,{scope:r,children:c.jsx(Grt,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(P=>{O($=>new Set($).add(P))},[]),onNativeOptionRemove:y.useCallback(P=>{O($=>{const V=new Set($);return V.delete(P),V})},[]),children:n})}),W?c.jsxs(ice,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:f,value:G,onChange:P=>H(P.target.value),disabled:g,form:b,children:[G===void 0?c.jsx("option",{value:""}):null,Array.from(I)]},D):null]})})};Ple.displayName=cy;var Lle="SelectTrigger",$le=y.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:i=!1,...s}=e,a=i6(n),o=jg(Lle,n),l=o.disabled||i,d=ui(r,o.onTriggerChange),u=n6(n),h=y.useRef("touch"),[f,g,v]=ace(_=>{const S=u().filter(j=>!j.disabled),w=S.find(j=>j.value===o.value),C=oce(S,_,w);C!==void 0&&o.onValueChange(C.value)}),b=_=>{l||(o.onOpenChange(!0),v()),_&&(o.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return c.jsx(X4,{asChild:!0,...a,children:c.jsx(uu.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sce(o.value)?"":void 0,...s,ref:d,onClick:vr(s.onClick,_=>{_.currentTarget.focus(),h.current!=="mouse"&&b(_)}),onPointerDown:vr(s.onPointerDown,_=>{h.current=_.pointerType;const S=_.target;S.hasPointerCapture(_.pointerId)&&S.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(b(_),_.preventDefault())}),onKeyDown:vr(s.onKeyDown,_=>{const S=f.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&g(_.key),!(S&&_.key===" ")&&Wrt.includes(_.key)&&(b(),_.preventDefault())})})})});$le.displayName=Lle;var Dle="SelectValue",Ile=y.forwardRef((e,r)=>{const{__scopeSelect:n,className:i,style:s,children:a,placeholder:o="",...l}=e,d=jg(Dle,n),{onValueNodeHasChildrenChange:u}=d,h=a!==void 0,f=ui(r,d.onValueNodeChange);return ya(()=>{u(h)},[u,h]),c.jsx(uu.span,{...l,ref:f,style:{pointerEvents:"none"},children:sce(d.value)?c.jsx(c.Fragment,{children:o}):a})});Ile.displayName=Dle;var Yrt="SelectIcon",Ble=y.forwardRef((e,r)=>{const{__scopeSelect:n,children:i,...s}=e;return c.jsx(uu.span,{"aria-hidden":!0,...s,ref:r,children:i||"▼"})});Ble.displayName=Yrt;var Xrt="SelectPortal",zle=e=>c.jsx(FS,{asChild:!0,...e});zle.displayName=Xrt;var uy="SelectContent",Fle=y.forwardRef((e,r)=>{const n=jg(uy,e.__scopeSelect),[i,s]=y.useState();if(ya(()=>{s(new DocumentFragment)},[]),!n.open){const a=i;return a?gy.createPortal(c.jsx(Hle,{scope:e.__scopeSelect,children:c.jsx(r6.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),a):null}return c.jsx(Wle,{...e,ref:r})});Fle.displayName=uy;var Bd=10,[Hle,Ng]=gx(uy),Jrt="SelectContentImpl",Zrt=Mle("SelectContent.RemoveScroll"),Wle=y.forwardRef((e,r)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:d,align:u,alignOffset:h,arrowPadding:f,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:_,avoidCollisions:S,...w}=e,C=jg(uy,n),[j,E]=y.useState(null),[A,N]=y.useState(null),R=ui(r,ae=>E(ae)),[B,G]=y.useState(null),[H,z]=y.useState(null),W=n6(n),[I,O]=y.useState(!1),D=y.useRef(!1);y.useEffect(()=>{if(j)return z4(j)},[j]),I4();const P=y.useCallback(ae=>{const[re,...fe]=W().map(ge=>ge.ref.current),[me]=fe.slice(-1),_e=document.activeElement;for(const ge of ae)if(ge===_e||(ge==null||ge.scrollIntoView({block:"nearest"}),ge===re&&A&&(A.scrollTop=0),ge===me&&A&&(A.scrollTop=A.scrollHeight),ge==null||ge.focus(),document.activeElement!==_e))return},[W,A]),$=y.useCallback(()=>P([B,j]),[P,B,j]);y.useEffect(()=>{I&&$()},[I,$]);const{onOpenChange:V,triggerPointerDownPosRef:K}=C;y.useEffect(()=>{if(j){let ae={x:0,y:0};const re=me=>{var _e,ge;ae={x:Math.abs(Math.round(me.pageX)-(((_e=K.current)==null?void 0:_e.x)??0)),y:Math.abs(Math.round(me.pageY)-(((ge=K.current)==null?void 0:ge.y)??0))}},fe=me=>{ae.x<=10&&ae.y<=10?me.preventDefault():j.contains(me.target)||V(!1),document.removeEventListener("pointermove",re),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",fe,{capture:!0})}}},[j,V,K]),y.useEffect(()=>{const ae=()=>V(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[V]);const[F,U]=ace(ae=>{const re=W().filter(_e=>!_e.disabled),fe=re.find(_e=>_e.ref.current===document.activeElement),me=oce(re,ae,fe);me&&setTimeout(()=>me.ref.current.focus())}),Q=y.useCallback((ae,re,fe)=>{const me=!D.current&&!fe;(C.value!==void 0&&C.value===re||me)&&(G(ae),me&&(D.current=!0))},[C.value]),q=y.useCallback(()=>j==null?void 0:j.focus(),[j]),te=y.useCallback((ae,re,fe)=>{const me=!D.current&&!fe;(C.value!==void 0&&C.value===re||me)&&z(ae)},[C.value]),ee=i==="popper"?S7:Ule,se=ee===S7?{side:l,sideOffset:d,align:u,alignOffset:h,arrowPadding:f,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:_,avoidCollisions:S}:{};return c.jsx(Hle,{scope:n,content:j,viewport:A,onViewportChange:N,itemRefCallback:Q,selectedItem:B,onItemLeave:q,itemTextRefCallback:te,focusSelectedItem:$,selectedItemText:H,position:i,isPositioned:I,searchRef:F,children:c.jsx(WS,{as:Zrt,allowPinchZoom:!0,children:c.jsx(zS,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:vr(s,ae=>{var re;(re=C.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:c.jsx(BS,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:c.jsx(ee,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...w,...se,onPlaced:()=>O(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:vr(w.onKeyDown,ae=>{const re=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!re&&ae.key.length===1&&U(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let me=W().filter(_e=>!_e.disabled).map(_e=>_e.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const _e=ae.target,ge=me.indexOf(_e);me=me.slice(ge+1)}setTimeout(()=>P(me)),ae.preventDefault()}})})})})})})});Wle.displayName=Jrt;var Qrt="SelectItemAlignedPosition",Ule=y.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:i,...s}=e,a=jg(uy,n),o=Ng(uy,n),[l,d]=y.useState(null),[u,h]=y.useState(null),f=ui(r,R=>h(R)),g=n6(n),v=y.useRef(!1),b=y.useRef(!0),{viewport:_,selectedItem:S,selectedItemText:w,focusSelectedItem:C}=o,j=y.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&_&&S&&w){const R=a.trigger.getBoundingClientRect(),B=u.getBoundingClientRect(),G=a.valueNode.getBoundingClientRect(),H=w.getBoundingClientRect();if(a.dir!=="rtl"){const _e=H.left-B.left,ge=G.left-_e,Ve=R.left-ge,le=R.width+Ve,it=Math.max(le,B.width),Xe=window.innerWidth-Bd,xt=rU(ge,[Bd,Math.max(Bd,Xe-it)]);l.style.minWidth=le+"px",l.style.left=xt+"px"}else{const _e=B.right-H.right,ge=window.innerWidth-G.right-_e,Ve=window.innerWidth-R.right-ge,le=R.width+Ve,it=Math.max(le,B.width),Xe=window.innerWidth-Bd,xt=rU(ge,[Bd,Math.max(Bd,Xe-it)]);l.style.minWidth=le+"px",l.style.right=xt+"px"}const z=g(),W=window.innerHeight-Bd*2,I=_.scrollHeight,O=window.getComputedStyle(u),D=parseInt(O.borderTopWidth,10),P=parseInt(O.paddingTop,10),$=parseInt(O.borderBottomWidth,10),V=parseInt(O.paddingBottom,10),K=D+P+I+V+$,F=Math.min(S.offsetHeight*5,K),U=window.getComputedStyle(_),Q=parseInt(U.paddingTop,10),q=parseInt(U.paddingBottom,10),te=R.top+R.height/2-Bd,ee=W-te,se=S.offsetHeight/2,ae=S.offsetTop+se,re=D+P+ae,fe=K-re;if(re<=te){const _e=z.length>0&&S===z[z.length-1].ref.current;l.style.bottom="0px";const ge=u.clientHeight-_.offsetTop-_.offsetHeight,Ve=Math.max(ee,se+(_e?q:0)+ge+$),le=re+Ve;l.style.height=le+"px"}else{const _e=z.length>0&&S===z[0].ref.current;l.style.top="0px";const Ve=Math.max(te,D+_.offsetTop+(_e?Q:0)+se)+fe;l.style.height=Ve+"px",_.scrollTop=re-te+_.offsetTop}l.style.margin=`${Bd}px 0`,l.style.minHeight=F+"px",l.style.maxHeight=W+"px",i==null||i(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,u,_,S,w,a.dir,i]);ya(()=>j(),[j]);const[E,A]=y.useState();ya(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const N=y.useCallback(R=>{R&&b.current===!0&&(j(),C==null||C(),b.current=!1)},[j,C]);return c.jsx(tnt,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:N,children:c.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:c.jsx(uu.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Ule.displayName=Qrt;var ent="SelectPopperPosition",S7=y.forwardRef((e,r)=>{const{__scopeSelect:n,align:i="start",collisionPadding:s=Bd,...a}=e,o=i6(n);return c.jsx($R,{...o,...a,ref:r,align:i,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});S7.displayName=ent;var[tnt,nL]=gx(uy,{}),k7="SelectViewport",Vle=y.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:i,...s}=e,a=Ng(k7,n),o=nL(k7,n),l=ui(r,a.onViewportChange),d=y.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),c.jsx(r6.Slot,{scope:n,children:c.jsx(uu.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:vr(s.onScroll,u=>{const h=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&f){const v=Math.abs(d.current-h.scrollTop);if(v>0){const b=window.innerHeight-Bd*2,_=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),w=Math.max(_,S);if(w<b){const C=w+v,j=Math.min(b,C),E=C-j;f.style.height=j+"px",f.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,f.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});Vle.displayName=k7;var qle="SelectGroup",[rnt,nnt]=gx(qle),int=y.forwardRef((e,r)=>{const{__scopeSelect:n,...i}=e,s=Zu();return c.jsx(rnt,{scope:n,id:s,children:c.jsx(uu.div,{role:"group","aria-labelledby":s,...i,ref:r})})});int.displayName=qle;var Gle="SelectLabel",Kle=y.forwardRef((e,r)=>{const{__scopeSelect:n,...i}=e,s=nnt(Gle,n);return c.jsx(uu.div,{id:s.id,...i,ref:r})});Kle.displayName=Gle;var l4="SelectItem",[snt,Yle]=gx(l4),Xle=y.forwardRef((e,r)=>{const{__scopeSelect:n,value:i,disabled:s=!1,textValue:a,...o}=e,l=jg(l4,n),d=Ng(l4,n),u=l.value===i,[h,f]=y.useState(a??""),[g,v]=y.useState(!1),b=ui(r,C=>{var j;return(j=d.itemRefCallback)==null?void 0:j.call(d,C,i,s)}),_=Zu(),S=y.useRef("touch"),w=()=>{s||(l.onValueChange(i),l.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(snt,{scope:n,value:i,disabled:s,textId:_,isSelected:u,onItemTextChange:y.useCallback(C=>{f(j=>j||((C==null?void 0:C.textContent)??"").trim())},[]),children:c.jsx(r6.ItemSlot,{scope:n,value:i,disabled:s,textValue:h,children:c.jsx(uu.div,{role:"option","aria-labelledby":_,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:b,onFocus:vr(o.onFocus,()=>v(!0)),onBlur:vr(o.onBlur,()=>v(!1)),onClick:vr(o.onClick,()=>{S.current!=="mouse"&&w()}),onPointerUp:vr(o.onPointerUp,()=>{S.current==="mouse"&&w()}),onPointerDown:vr(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:vr(o.onPointerMove,C=>{var j;S.current=C.pointerType,s?(j=d.onItemLeave)==null||j.call(d):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:vr(o.onPointerLeave,C=>{var j;C.currentTarget===document.activeElement&&((j=d.onItemLeave)==null||j.call(d))}),onKeyDown:vr(o.onKeyDown,C=>{var E;((E=d.searchRef)==null?void 0:E.current)!==""&&C.key===" "||(Urt.includes(C.key)&&w(),C.key===" "&&C.preventDefault())})})})})});Xle.displayName=l4;var F_="SelectItemText",Jle=y.forwardRef((e,r)=>{const{__scopeSelect:n,className:i,style:s,...a}=e,o=jg(F_,n),l=Ng(F_,n),d=Yle(F_,n),u=Krt(F_,n),[h,f]=y.useState(null),g=ui(r,w=>f(w),d.onItemTextChange,w=>{var C;return(C=l.itemTextRefCallback)==null?void 0:C.call(l,w,d.value,d.disabled)}),v=h==null?void 0:h.textContent,b=y.useMemo(()=>c.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:_,onNativeOptionRemove:S}=u;return ya(()=>(_(b),()=>S(b)),[_,S,b]),c.jsxs(c.Fragment,{children:[c.jsx(uu.span,{id:d.textId,...a,ref:g}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?gy.createPortal(a.children,o.valueNode):null]})});Jle.displayName=F_;var Zle="SelectItemIndicator",Qle=y.forwardRef((e,r)=>{const{__scopeSelect:n,...i}=e;return Yle(Zle,n).isSelected?c.jsx(uu.span,{"aria-hidden":!0,...i,ref:r}):null});Qle.displayName=Zle;var C7="SelectScrollUpButton",ece=y.forwardRef((e,r)=>{const n=Ng(C7,e.__scopeSelect),i=nL(C7,e.__scopeSelect),[s,a]=y.useState(!1),o=ui(r,i.onScrollButtonChange);return ya(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=d.scrollTop>0;a(u)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?c.jsx(rce,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});ece.displayName=C7;var j7="SelectScrollDownButton",tce=y.forwardRef((e,r)=>{const n=Ng(j7,e.__scopeSelect),i=nL(j7,e.__scopeSelect),[s,a]=y.useState(!1),o=ui(r,i.onScrollButtonChange);return ya(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<u;a(h)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?c.jsx(rce,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});tce.displayName=j7;var rce=y.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:i,...s}=e,a=Ng("SelectScrollButton",n),o=y.useRef(null),l=n6(n),d=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),ya(()=>{var h;const u=l().find(f=>f.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),c.jsx(uu.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:vr(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(i,50))}),onPointerMove:vr(s.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(i,50))}),onPointerLeave:vr(s.onPointerLeave,()=>{d()})})}),ant="SelectSeparator",nce=y.forwardRef((e,r)=>{const{__scopeSelect:n,...i}=e;return c.jsx(uu.div,{"aria-hidden":!0,...i,ref:r})});nce.displayName=ant;var N7="SelectArrow",ont=y.forwardRef((e,r)=>{const{__scopeSelect:n,...i}=e,s=i6(n),a=jg(N7,n),o=Ng(N7,n);return a.open&&o.position==="popper"?c.jsx(DR,{...s,...i,ref:r}):null});ont.displayName=N7;var lnt="SelectBubbleInput",ice=y.forwardRef(({__scopeSelect:e,value:r,...n},i)=>{const s=y.useRef(null),a=ui(i,s),o=wle(r);return y.useEffect(()=>{const l=s.current;if(!l)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==r&&h){const f=new Event("change",{bubbles:!0});h.call(l,r),l.dispatchEvent(f)}},[o,r]),c.jsx(uu.select,{...n,style:{...Rle,...n.style},ref:a,defaultValue:r})});ice.displayName=lnt;function sce(e){return e===""||e===void 0}function ace(e){const r=lh(e),n=y.useRef(""),i=y.useRef(0),s=y.useCallback(o=>{const l=n.current+o;r(l),(function d(u){n.current=u,window.clearTimeout(i.current),u!==""&&(i.current=window.setTimeout(()=>d(""),1e3))})(l)},[r]),a=y.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,s,a]}function oce(e,r,n){const s=r.length>1&&Array.from(r).every(u=>u===r[0])?r[0]:r,a=n?e.indexOf(n):-1;let o=cnt(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const d=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function cnt(e,r){return e.map((n,i)=>e[(r+i)%e.length])}var unt=Ple,lce=$le,dnt=Ile,hnt=Ble,fnt=zle,cce=Fle,pnt=Vle,uce=Kle,dce=Xle,mnt=Jle,gnt=Qle,hce=ece,fce=tce,pce=nce;const sh=unt,ah=dnt,ed=y.forwardRef(({className:e,children:r,...n},i)=>c.jsxs(lce,{ref:i,className:Ae("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-lg border border-input bg-background/90 px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring/60 focus:ring-offset-2 focus:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,c.jsx(hnt,{asChild:!0,children:c.jsx(Dl,{className:"h-4 w-4 opacity-50"})})]}));ed.displayName=lce.displayName;const mce=y.forwardRef(({className:e,...r},n)=>c.jsx(hce,{ref:n,className:Ae("flex cursor-default items-center justify-center py-1",e),...r,children:c.jsx(yR,{className:"h-4 w-4"})}));mce.displayName=hce.displayName;const gce=y.forwardRef(({className:e,...r},n)=>c.jsx(fce,{ref:n,className:Ae("flex cursor-default items-center justify-center py-1",e),...r,children:c.jsx(Dl,{className:"h-4 w-4"})}));gce.displayName=fce.displayName;const td=y.forwardRef(({className:e,children:r,position:n="popper",...i},s)=>c.jsx(fnt,{children:c.jsxs(cce,{ref:s,className:Ae("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-xl border border-border/70 bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...i,children:[c.jsx(mce,{}),c.jsx(pnt,{className:Ae("p-1",n==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),c.jsx(gce,{})]})}));td.displayName=cce.displayName;const ynt=y.forwardRef(({className:e,...r},n)=>c.jsx(uce,{ref:n,className:Ae("px-2 py-1.5 text-sm font-semibold",e),...r}));ynt.displayName=uce.displayName;const Ls=y.forwardRef(({className:e,children:r,...n},i)=>c.jsxs(dce,{ref:i,className:Ae("relative flex w-full cursor-default select-none items-center rounded-md py-2 pl-2.5 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(gnt,{children:c.jsx(gs,{className:"h-4 w-4"})})}),c.jsx(mnt,{children:r})]}));Ls.displayName=dce.displayName;const vnt=y.forwardRef(({className:e,...r},n)=>c.jsx(pce,{ref:n,className:Ae("-mx-1 my-1 h-px bg-muted",e),...r}));vnt.displayName=pce.displayName;const Nm=qn();class iL{getToken(){return Gm()}getHeaders(r=!1){const n={};r&&(n["Content-Type"]="application/json");const i=this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}async listJobsPage(r=1,n=20,i=!0){const s=new URLSearchParams({page:r.toString(),size:n.toString(),include_disabled:i.toString()}),a=await fetch(`${Nm}/api/jobs?${s}`,{headers:this.getHeaders()});if(!a.ok)throw new Error(`Failed to list jobs: ${a.statusText}`);const o=await a.json();if(Array.isArray(o))return{items:o,total:o.length,page:1,size:o.length};const l=o&&typeof o=="object"?o:{},d=Array.isArray(l.items)?l.items:[],u=typeof l.total=="number"?l.total:d.length,h=typeof l.page=="number"?l.page:r,f=typeof l.size=="number"?l.size:n;return{items:d,total:u,page:h,size:f}}async listJobs(r=1,n=100,i=!0){return(await this.listJobsPage(r,n,i)).items}async getJob(r){const n=await fetch(`${Nm}/api/jobs/${r}`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get job: ${n.statusText}`);return n.json()}async createJob(r){const n=await fetch(`${Nm}/api/jobs`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(r)});if(!n.ok){const i=await n.json().catch(()=>({detail:n.statusText}));throw new Error(i.detail||"Failed to create job")}return n.json()}async updateJob(r,n){const i=await fetch(`${Nm}/api/jobs/${r}`,{method:"PATCH",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok){const s=await i.json().catch(()=>({detail:i.statusText}));throw new Error(s.detail||"Failed to update job")}return i.json()}async deleteJob(r){const n=await fetch(`${Nm}/api/jobs/${r}`,{method:"DELETE",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to delete job: ${n.statusText}`)}async triggerJob(r){const n=await fetch(`${Nm}/api/jobs/${r}/trigger`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})});if(!n.ok){const i=await n.json().catch(()=>({detail:n.statusText}));throw new Error(i.detail||`Failed to trigger job: ${n.statusText}`)}return n.json()}async getJobRuns(r,n=20,i=1){const s=new URLSearchParams({page:i.toString(),size:n.toString()}),a=await fetch(`${Nm}/api/jobs/${r}/runs?${s}`,{headers:this.getHeaders()});if(!a.ok)throw new Error(`Failed to get job runs: ${a.statusText}`);const o=await a.json();return Array.isArray(o)?o:o.items??[]}async getAvailableProviders(){const r=await fetch(`${Nm}/api/jobs/providers/available`,{headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to get providers: ${r.statusText}`);const n=await r.json();return n.providers&&!Array.isArray(n.providers)?n.providers:n}}const j3=new iL;function xnt({isOpen:e,onClose:r,onCreated:n,editJob:i,onUpdated:s}){const[a,o]=y.useState(!1),[l,d]=y.useState(null),[u,h]=y.useState({}),[f,g]=y.useState(""),[v,b]=y.useState("agent_task"),[_,S]=y.useState("0 * * * *"),[w,C]=y.useState(""),[j,E]=y.useState(!1),[A,N]=y.useState(!0),[R,B]=y.useState(""),[G,H]=y.useState(""),[z,W]=y.useState(""),[I,O]=y.useState(""),[D,P]=y.useState("");y.useEffect(()=>{j3.getAvailableProviders().then(h).catch(console.error)},[]);const $=U=>{if(g(U.name),b(U.job_type),S(U.cron_expression),N(U.enabled),B(U.provider||""),H(U.model||""),W(U.prompt||""),U.job_type==="system_job"){const te=U.payload&&typeof U.payload=="object"?U.payload:void 0,ee=typeof(te==null?void 0:te.command)=="string"?te.command:void 0,se=typeof U.tool_name=="string"?U.tool_name:"";O(ee||se);const ae=te==null?void 0:te.args;if(ae&&typeof ae=="object")try{P(JSON.stringify(ae,null,2))}catch{P("")}else P("")}else P(""),O("");const Q=(U.cron_expression||"").trim(),q=w7.some(te=>te.value===Q);E(!q),C(q?"":Q)};y.useEffect(()=>{if(i){$(i);let U=!1;return j3.getJob(i.id).then(Q=>{U||$(Q)}).catch(()=>{}),()=>{U=!0}}else g(""),b("agent_task"),S("0 * * * *"),C(""),E(!1),N(!0),B(""),H(""),W(""),O(""),P("")},[i,e]);const V=j?w:_,K=Ole(V),F=async U=>{if(U.preventDefault(),d(null),!K.valid){d(K.error||"Invalid cron expression");return}const Q=t6(V),q={name:f,job_type:v,cron_expression:Q,enabled:A};if(v==="agent_task"){if(!R||!G||!z){d("Provider, model, and prompt are required for agent tasks");return}q.provider=R,q.model=G,q.prompt=z}else{if(!I){d("Command is required for system jobs");return}const te={command:I};if(D)try{te.args=JSON.parse(D)}catch{d("Args must be valid JSON");return}q.payload=te}o(!0);try{if(i){const te=await j3.updateJob(i.id,q);s==null||s(te)}else{const te=await j3.createJob(q);n(te)}r()}catch(te){d(te instanceof Error?te.message:"Failed to save job")}finally{o(!1)}};return e?c.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/50 sm:items-center",children:c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-job-dialog-title","data-testid":"create-job-dialog",className:"h-[92dvh] w-full overflow-y-auto border border-border bg-background text-foreground shadow-xl sm:h-auto sm:max-h-[90vh] sm:max-w-2xl sm:rounded-lg",children:[c.jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3 sm:p-4",children:[c.jsx("h2",{id:"create-job-dialog-title",className:"text-lg font-semibold sm:text-xl",children:i?"Edit Job":"Create New Job"}),c.jsx(we,{variant:"ghost",size:"sm",onClick:r,"aria-label":"Close dialog",children:c.jsx(Xn,{className:"h-5 w-5"})})]}),c.jsxs("form",{onSubmit:F,className:"space-y-5 p-4 sm:space-y-6",children:[c.jsxs(Y0,{value:v,onValueChange:U=>b(U),children:[c.jsxs(ag,{className:"grid h-auto w-full grid-cols-2",children:[c.jsx(Qs,{value:"agent_task",children:"Agent Task"}),c.jsx(Qs,{value:"system_job",children:"System Job"})]}),c.jsxs(ea,{value:"agent_task",className:"space-y-4 mt-4",children:[c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"provider",children:"Provider"}),c.jsxs(sh,{value:R,onValueChange:U=>{B(U),H("")},children:[c.jsx(ed,{"data-testid":"provider-select",children:c.jsx(ah,{placeholder:"Select provider"})}),c.jsx(td,{children:Object.entries(u).map(([U,Q])=>c.jsx(Ls,{value:U,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vj,{provider:U,size:20}),c.jsx("span",{children:Q.name})]})},U))})]})]}),R&&u[R]&&c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"model",children:"Model"}),c.jsxs(sh,{value:G,onValueChange:H,children:[c.jsx(ed,{"data-testid":"model-select",children:c.jsx(ah,{placeholder:"Select model"})}),c.jsx(td,{children:u[R].models.map(U=>c.jsx(Ls,{value:U,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vj,{provider:R,model:U,size:20}),c.jsx("span",{children:U})]})},U))})]})]}),c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"prompt",children:"Prompt"}),c.jsx(Ep,{id:"prompt",value:z,onChange:U=>W(U.target.value),placeholder:"What should the agent do?",rows:4})]})]}),c.jsxs(ea,{value:"system_job",className:"space-y-4 mt-4",children:[c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"command",children:"Command"}),c.jsx(Ln,{id:"command",value:I,onChange:U=>O(U.target.value),placeholder:"e.g., cleanup_old_files"})]}),c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"args",children:"Arguments (JSON)"}),c.jsx(Ep,{id:"args",value:D,onChange:U=>P(U.target.value),placeholder:'{"days": 30}',rows:3})]})]})]}),c.jsxs("div",{className:"border-t pt-4 space-y-4",children:[c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"name",children:"Job Name"}),c.jsx(Ln,{id:"name",value:f,onChange:U=>g(U.target.value),placeholder:"My scheduled job",required:!0})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx(mi,{children:"Schedule"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(mi,{htmlFor:"custom-schedule",className:"text-sm text-muted-foreground",children:"Custom"}),c.jsx(gf,{id:"custom-schedule",checked:j,onCheckedChange:E})]})]}),j?c.jsxs("div",{children:[c.jsx(Ln,{value:w,onChange:U=>C(U.target.value),placeholder:"* * * * *",className:K.valid?"":"border-red-500"}),w&&c.jsx("p",{className:`text-sm mt-1 ${K.valid?"text-muted-foreground":"text-red-500"}`,children:K.valid?Ale(w):K.error})]}):c.jsxs(sh,{value:_,onValueChange:S,children:[c.jsx(ed,{"data-testid":"schedule-select",children:c.jsx(ah,{})}),c.jsx(td,{children:w7.map(U=>c.jsx(Ls,{value:U.value,children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:U.label}),c.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:U.value})]})},U.value))})]})]}),c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"enabled",children:"Enabled"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Job will run according to schedule"})]}),c.jsx(gf,{id:"enabled",checked:A,onCheckedChange:N})]})]}),l&&c.jsxs("div",{className:"flex items-center gap-2 text-destructive text-sm bg-destructive/10 p-3 rounded-md",children:[c.jsx(na,{className:"h-4 w-4"}),l]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 border-t pt-4 sm:flex sm:justify-end",children:[c.jsx(we,{type:"button",variant:"outline",onClick:r,className:"w-full sm:w-auto",children:"Cancel"}),c.jsxs(we,{type:"submit",disabled:a,className:"w-full sm:w-auto",children:[a&&c.jsx(Ft,{className:"h-4 w-4 mr-2 animate-spin"}),i?"Save Changes":"Create Job"]})]})]})]})}):null}const bnt=new iL;function _nt({job:e,isOpen:r,onClose:n}){const[i,s]=y.useState([]),[a,o]=y.useState(!1),[l,d]=y.useState(null),u=async()=>{if(e){o(!0),d(null);try{const v=await bnt.getJobRuns(e.id,50);s(v)}catch(v){d(v instanceof Error?v.message:"Failed to load history")}finally{o(!1)}}};if(y.useEffect(()=>{r&&e&&u()},[r,e==null?void 0:e.id]),!r||!e)return null;const h=v=>{switch(v){case"completed":return c.jsx(ia,{className:"h-4 w-4 text-green-500"});case"failed":return c.jsx(na,{className:"h-4 w-4 text-red-500"});case"running":return c.jsx(Ft,{className:"h-4 w-4 text-blue-500 animate-spin"});case"pending":return c.jsx(vg,{className:"h-4 w-4 text-yellow-500"});default:return null}},f=v=>{const b={completed:"default",failed:"destructive",running:"secondary",pending:"outline"};return c.jsx(Ar,{variant:b[v]||"outline",children:v})},g=(v,b)=>{if(!b)return"—";const _=new Date(v),w=new Date(b).getTime()-_.getTime();return w<1e3?`${w}ms`:w<6e4?`${(w/1e3).toFixed(1)}s`:`${(w/6e4).toFixed(1)}m`};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/50 sm:items-center",children:c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"job-history-dialog-title","data-testid":"job-history-dialog",className:"flex h-[92dvh] w-full flex-col overflow-hidden border border-border bg-background text-foreground shadow-xl sm:h-auto sm:max-h-[90vh] sm:max-w-3xl sm:rounded-lg",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 border-b px-4 py-3 sm:p-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{id:"job-history-dialog-title",className:"text-lg font-semibold sm:text-xl",children:"Job History"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:e.name})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(we,{variant:"outline",size:"sm",onClick:u,disabled:a,children:c.jsx(Js,{className:`h-4 w-4 ${a?"animate-spin":""}`})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:n,"aria-label":"Close history dialog",children:c.jsx(Xn,{className:"h-5 w-5"})})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[l&&c.jsxs("div",{className:"flex items-center gap-2 text-destructive text-sm bg-destructive/10 p-3 rounded-md mb-4",children:[c.jsx(na,{className:"h-4 w-4"}),l]}),a&&i.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Ft,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.length===0?c.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No runs yet. This job hasn't been executed."}):c.jsx("div",{className:"space-y-3",children:i.map(v=>c.jsxs("div",{className:"border border-border rounded-lg p-4 hover:bg-muted/40 transition-colors",children:[c.jsxs("div",{className:"mb-2 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h(v.status),f(v.status),v.triggered_by&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["by ",v.triggered_by]})]}),c.jsxs("div",{className:"text-sm text-muted-foreground",children:["Duration: ",g(v.started_at,v.completed_at)]})]}),c.jsxs("div",{className:"mb-2 text-sm text-muted-foreground",children:[c.jsx("span",{className:"font-medium",children:"Started:"})," ",v.started_at?new Date(v.started_at).toLocaleString():"Not started",v.completed_at&&c.jsxs(c.Fragment,{children:[" → ",c.jsx("span",{className:"font-medium",children:"Completed:"})," ",new Date(v.completed_at).toLocaleString()]})]}),v.status==="completed"&&v.result&&c.jsxs("details",{className:"mt-2",children:[c.jsx("summary",{className:"text-sm text-green-600 dark:text-green-400 cursor-pointer hover:underline",children:"View result"}),c.jsx("pre",{className:"mt-2 p-2 bg-muted rounded text-xs overflow-x-auto",children:typeof v.result=="string"?v.result:JSON.stringify(v.result,null,2)})]}),v.status==="failed"&&v.error&&c.jsxs("div",{className:"mt-2 p-2 bg-destructive/10 rounded text-sm text-destructive",children:[c.jsx("strong",{children:"Error:"})," ",v.error]})]},v.id))})]})]})})}const n_=new iL,wnt=20,Snt=[10,20,50,100];function knt(){const e=bg(),[r,n]=y.useState([]),[i,s]=y.useState({}),[a,o]=y.useState(0),[l,d]=y.useState(1),[u,h]=y.useState(wnt),[f,g]=y.useState(!0),[v,b]=y.useState(null),[_,S]=y.useState(!1),[w,C]=y.useState(null),[j,E]=y.useState(null),A=y.useCallback(async($,V)=>{g(!0),b(null);try{const K=await n_.listJobsPage($,V,!0);n(K.items),o(K.total),d(K.page),h(K.size);const F={};await Promise.all(K.items.map(async U=>{try{const Q=await n_.getJobRuns(U.id,1);F[U.id]=Q[0]||null}catch{F[U.id]=null}})),s(U=>({...U,...F}))}catch(K){b(K instanceof Error?K.message:"Failed to load jobs")}finally{g(!1)}},[]);y.useEffect(()=>{A(l,u)},[A,l,u]);const N=async($,V)=>{try{const K=await n_.updateJob($,{enabled:V});n(F=>F.map(U=>U.id===$?K:U))}catch(K){b(K instanceof Error?K.message:"Failed to update job")}},R=async $=>{try{const V=await n_.triggerJob($);s(K=>({...K,[$]:V}))}catch(V){b(V instanceof Error?V.message:"Failed to trigger job")}},B=async $=>{if(await e({title:"Delete job",description:"Are you sure you want to delete this job?",confirmLabel:"Delete",variant:"destructive"}))try{await n_.deleteJob($);const K=Math.max(0,a-1),F=Math.max(1,Math.ceil(K/u)),U=Math.min(l,F);d(U),await A(U,u)}catch(K){b(K instanceof Error?K.message:"Failed to delete job")}},G=$=>{d(1),A(1,u),S(!1)},H=$=>{n(V=>V.map(K=>K.id===$.id?$:K)),C(null)},z=Math.max(1,Math.ceil(a/u)),W=a===0?0:(l-1)*u+1,I=Math.min(a,l*u),O=r.filter($=>$.enabled).length,D=r.filter($=>$.job_type==="agent_task").length,P=r.filter($=>$.job_type==="system_job").length;return c.jsxs("div",{className:"container mx-auto max-w-6xl px-3 py-4 sm:px-4 sm:py-6",children:[c.jsxs("div",{className:"mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h1",{className:"flex items-center gap-2 text-xl font-bold sm:text-2xl",children:[c.jsx(i2,{className:"h-6 w-6"}),"Scheduled Jobs"]}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground sm:text-base",children:"Manage your automated tasks and agent schedules"})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[c.jsxs(we,{variant:"outline",onClick:()=>void A(l,u),disabled:f,className:"w-full sm:w-auto",children:[c.jsx(Js,{className:`h-4 w-4 mr-2 ${f?"animate-spin":""}`}),"Refresh"]}),c.jsxs(we,{onClick:()=>S(!0),className:"w-full sm:w-auto",children:[c.jsx(Zs,{className:"h-4 w-4 mr-2"}),"New Job"]})]})]}),c.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:items-center sm:gap-4",children:[c.jsxs(Ar,{variant:"outline",className:"justify-center px-3 py-1 text-xs sm:text-sm",children:[a," total"]}),c.jsxs(Ar,{variant:"default",className:"justify-center px-3 py-1 text-xs sm:text-sm",children:[O," enabled on page"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center px-3 py-1 text-xs sm:text-sm",children:[D," agent tasks on page"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center px-3 py-1 text-xs sm:text-sm",children:[P," system jobs on page"]})]}),v&&c.jsxs("div",{className:"flex items-center gap-2 text-destructive text-sm bg-destructive/10 p-3 rounded-md mb-4",children:[c.jsx(na,{className:"h-4 w-4"}),v,c.jsx(we,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>b(null),children:"Dismiss"})]}),f&&r.length===0?c.jsx("div",{className:"flex items-center justify-center py-24",children:c.jsx(Ft,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):r.length===0?c.jsxs("div",{className:"rounded-lg border-2 border-dashed px-4 py-16 text-center sm:py-24",children:[c.jsx(i2,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),c.jsx("h3",{className:"text-lg font-medium mb-2",children:"No scheduled jobs yet"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:"Create your first job to automate tasks or schedule agent prompts"}),c.jsxs(we,{onClick:()=>S(!0),children:[c.jsx(Zs,{className:"h-4 w-4 mr-2"}),"Create Your First Job"]})]}):c.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:r.map($=>c.jsx(krt,{job:$,recentRun:i[$.id],onToggle:N,onTrigger:R,onDelete:B,onEdit:C,onViewHistory:E},$.id))}),c.jsxs("div",{className:"mt-6 flex flex-col gap-3 border-t pt-4 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",W,"–",I," of ",a]}),c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[c.jsx("label",{className:"text-sm text-muted-foreground",htmlFor:"jobs-page-size",children:"Per page"}),c.jsx("select",{id:"jobs-page-size",className:"h-9 rounded-md border bg-background px-2 text-sm",value:u,onChange:$=>{const V=Number.parseInt($.target.value,10);!Number.isFinite(V)||V<=0||(d(1),h(V))},children:Snt.map($=>c.jsx("option",{value:$,children:$},$))}),c.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2 sm:flex sm:items-center",children:[c.jsxs(we,{variant:"outline",size:"sm",disabled:l<=1||f,onClick:()=>d($=>Math.max(1,$-1)),className:"w-full",children:[c.jsx(Tv,{className:"h-4 w-4 mr-1"}),"Prev"]}),c.jsxs("span",{className:"text-center text-sm text-muted-foreground tabular-nums",children:["Page ",l," / ",z]}),c.jsxs(we,{variant:"outline",size:"sm",disabled:l>=z||f,onClick:()=>d($=>Math.min(z,$+1)),className:"w-full",children:["Next",c.jsx(js,{className:"h-4 w-4 ml-1"})]})]})]})]}),c.jsx(xnt,{isOpen:_||!!w,onClose:()=>{S(!1),C(null)},onCreated:G,editJob:w,onUpdated:H}),c.jsx(_nt,{job:j,isOpen:!!j,onClose:()=>E(null)})]})}const T7="jait.todo.selected-repo.v1";function nU(e){const r=e.trim().replace(/\\/g,"/").replace(/\/+$/,"");return/^[A-Za-z]:\//.test(r)?r.toLowerCase():r}function iU(e){if(e&&typeof e=="object"&&!Array.isArray(e)){const r=e;return{repoId:typeof r.repoId=="string"&&r.repoId.trim()?r.repoId.trim():null,localPath:typeof r.localPath=="string"&&r.localPath.trim()?r.localPath.trim():null}}return typeof e=="string"?{repoId:e.trim()||null,localPath:null}:{repoId:null,localPath:null}}function Cnt(e){try{return iU(JSON.parse(e))}catch{return iU(e)}}function jnt(){var e;if(typeof window>"u")return{repoId:null,localPath:null};try{const r=(e=window.localStorage.getItem(T7))==null?void 0:e.trim();return r?Cnt(r):{repoId:null,localPath:null}}catch{return{repoId:null,localPath:null}}}function Nnt(e,r){if(!(typeof window>"u"))try{const n=(e==null?void 0:e.trim())||null;if(!n){window.localStorage.removeItem(T7);return}window.localStorage.setItem(T7,JSON.stringify({repoId:n,localPath:(r==null?void 0:r.trim())||null}))}catch{}}function Tnt(e,r,n=jnt()){var i;if(e.length===0)return r;if(n.repoId&&e.some(s=>s.id===n.repoId))return n.repoId;if(n.localPath){const s=nU(n.localPath),a=e.find(o=>nU(o.localPath)===s);if(a)return a.id}return r&&e.some(s=>s.id===r)?r:((i=e[0])==null?void 0:i.id)??null}function Ent(e){return`[${e}] Generating title…`}function Ant({repo:e,providerId:r,runtimeMode:n,model:i,workingDirectory:s,branch:a}){return{title:Ent(e.name),providerId:r,runtimeMode:n,...i?{model:i}:{},kind:"delivery",workingDirectory:s,branch:a,prBaseBranch:e.defaultBranch}}function Ont(e,r){return{message:r.message,titleTask:r.message,titlePrefix:`[${e}] `}}function sU(e){return!!e&&/[\p{L}\p{N}]/u.test(e)}function Mnt(e){return e==="'"||e==="’"}function Rnt(e){var r;return((r=e.match(/[\p{L}\p{N}'’]+$/u))==null?void 0:r[0])??""}function E7(e){return e.replace(/\s+/g," ").trim()}function Pnt(e,r,n){if(n>=3)return!0;const i=e[e.length-n-1],s=r[n];if(n===2&&sU(i)&&s&&!sU(s)&&!/\s/.test(s))return!0;const a=Rnt(e);return n===1&&a.length===1&&Mnt(s)}function Lnt(e,r){const n=Math.min(e.length,r.length,240);for(let i=n;i>0;i--)if(Pnt(e,r,i)&&e.endsWith(r.slice(0,i)))return i;return 0}function yce(e,r){const n=E7(e),i=E7(r);if(!i)return n;if(!n)return i;if(n.endsWith(i))return n;if(i.startsWith(n))return i;const s=Lnt(n,i);return s>0?`${n}${i.slice(s)}`.trim():`${n} ${i}`}const vce="jait.todo.order.v1",xce="jait.todo.filters.v1",N3=8,y8=[{value:"open",label:"Open"},{value:"in_progress",label:"In progress"},{value:"done",label:"Done"}],i_=[{value:"low",label:"Low"},{value:"normal",label:"Normal"},{value:"high",label:"High"}];function $0(e){switch(e){case"done":return{label:"Done",iconClassName:"text-emerald-500",itemClassName:"border-emerald-500/20 bg-emerald-500/[0.04]"};case"in_progress":return{label:"In progress",iconClassName:"text-sky-500",itemClassName:"border-sky-500/20 bg-sky-500/[0.035]"};case"open":default:return{label:"Open",iconClassName:"text-muted-foreground",itemClassName:"bg-card/40"}}}function bce(e){switch(e){case"high":return"text-amber-500";case"low":return"text-muted-foreground/70";case"normal":default:return"text-primary/70"}}function H_({status:e,className:r}){const n=$0(e);return e==="done"?c.jsx(ia,{className:Ae("h-5 w-5",n.iconClassName,r)}):e==="in_progress"?c.jsx(xY,{className:Ae("h-5 w-5",n.iconClassName,r)}):c.jsx(vR,{className:Ae("h-5 w-5",n.iconClassName,r)})}function aU({priority:e,className:r}){return c.jsx(_Y,{className:Ae("h-4 w-4",bce(e),r)})}function g0({label:e,children:r}){return c.jsxs(_n,{children:[c.jsx(fn,{asChild:!0,children:r}),c.jsx(pn,{children:e})]})}function _ce(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(vce)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(r=>typeof r[0]=="string"&&Array.isArray(r[1])&&r[1].every(n=>typeof n=="string")))}catch{return{}}}function oU(e,r){if(!(typeof window>"u"||!e))try{const n=_ce();n[e]=r.map(i=>i.id),window.localStorage.setItem(vce,JSON.stringify(n))}catch{}}function $nt(e,r){const n=_ce()[e];if(!(n!=null&&n.length))return r;const i=new Map(n.map((a,o)=>[a,o])),s=new Map(r.map((a,o)=>[a.id,o]));return[...r].sort((a,o)=>{const l=i.get(a.id),d=i.get(o.id);return l!=null&&d!=null?l-d:l!=null?-1:d!=null?1:(s.get(a.id)??0)-(s.get(o.id)??0)})}function Dnt(){return{search:"",tags:[],savedTagFilters:[]}}function wce(e){return Array.isArray(e)?e.flatMap(r=>{if(!r||typeof r!="object")return[];const n=r,i=mc(Array.isArray(n.tags)?n.tags.filter(o=>typeof o=="string"):[]);if(i.length===0)return[];const s=typeof n.name=="string"&&n.name.trim()?n.name.trim():i.join(" + ");return[{id:typeof n.id=="string"&&n.id.trim()?n.id.trim():i.join("|"),name:s,tags:i}]}).slice(0,24):[]}function Sce(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(xce)??"{}");if(!e||typeof e!="object"||Array.isArray(e))return{};const r=Object.entries(e).flatMap(([n,i])=>{if(!i||typeof i!="object"||Array.isArray(i))return[];const s=i;return[[n,{search:typeof s.search=="string"?s.search:"",tags:mc(Array.isArray(s.tags)?s.tags.filter(a=>typeof a=="string"):[]),savedTagFilters:wce(s.savedTagFilters)}]]});return Object.fromEntries(r)}catch{return{}}}function Int(e){return Sce()[e]??Dnt()}function Bnt(e,r){if(!(typeof window>"u"||!e))try{const n=Sce();n[e]={search:r.search,tags:mc(r.tags),savedTagFilters:wce(r.savedTagFilters)},window.localStorage.setItem(xce,JSON.stringify(n))}catch{}}function lU(e,r,n,i){const s=e.findIndex(d=>d.id===r);if(s<0)return e;const a=[...e],[o]=a.splice(s,1);if(!o)return e;if(n==null)return a.push(o),a;const l=a.findIndex(d=>d.id===n);return l<0?e:(a.splice(l+(i==="after"?1:0),0,o),a)}function cU(){if(!(typeof window>"u"))try{const e=window.AudioContext||window.webkitAudioContext;if(!e)return;const r=new e,n=r.currentTime,i=r.createGain();i.gain.setValueAtTime(1e-4,n),i.gain.exponentialRampToValueAtTime(.08,n+.012),i.gain.exponentialRampToValueAtTime(1e-4,n+.34),i.connect(r.destination);for(const[s,a]of[660,880].entries()){const o=r.createOscillator();o.type="sine",o.frequency.setValueAtTime(a,n+s*.08),o.connect(i),o.start(n+s*.08),o.stop(n+.22+s*.08)}window.setTimeout(()=>void r.close(),450)}catch{}}function znt({todo:e}){const r=$0(e.status);return c.jsxs("div",{className:Ae("flex items-start gap-2 rounded-lg border bg-background px-3 py-2 text-sm shadow-2xl ring-1 ring-primary/10",r.itemClassName),children:[c.jsx(H4,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}),c.jsx(H_,{status:e.status,className:"mt-0.5 shrink-0"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[11px] font-medium uppercase text-muted-foreground",children:[c.jsx("span",{children:r.label}),c.jsx(_Y,{className:Ae("h-3 w-3",bce(e.priority))}),c.jsx("span",{children:e.priority})]}),c.jsx("span",{className:Ae("whitespace-pre-wrap break-words text-foreground",e.status==="done"&&"text-muted-foreground line-through"),children:e.message})]})]})}function w2(e){if(Array.isArray(e))return e;if(!e)return[];try{const r=JSON.parse(e);return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return e.split(",").map(r=>r.trim()).filter(Boolean)}}function Fnt(e){return[...new Set(e.split(",").map(r=>r.trim().toLowerCase()).filter(Boolean))]}function mc(e){return[...new Set(e.map(r=>r.trim().toLowerCase()).filter(Boolean))]}function N5(e){const r=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),i=`${e.getDate()}`.padStart(2,"0");return`${r}-${n}-${i}`}function kce(e){return new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(e)}function Cce(e){if(!e)return null;const[r,n,i]=e.split("-").map(Number);return!r||!n||!i?null:new Date(r,n-1,i)}function yv(e){const r=Cce(e);return r?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(r):"No due date"}function jce(e){if(!e)return"";const r=new Date(e);return Number.isNaN(r.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(r)}function uU(e,r){const n=mc(e).sort(),i=mc(r).sort();return n.length===i.length&&n.every((s,a)=>s===i[a])}function Hnt(e){if(!e)return[];try{const r=JSON.parse(e);return Array.isArray(r)?r.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;if(typeof i.completedAt!="string")return[];const s=i.previousStatus==="open"||i.previousStatus==="in_progress"||i.previousStatus==="done"?i.previousStatus:null;return[{completedAt:i.completedAt,previousStatus:s}]}):[]}catch{return[]}}function Wnt(e){const r=$0(e.status),n=w2(e.tags);return[e.message,r.label,e.status,e.priority,e.dueDate,yv(e.dueDate),n.join(" "),e.sourceThreadTitle,e.createdAt,e.updatedAt,e.completedAt,jce(e.completedAt)].filter(Boolean).join(" ").toLowerCase()}function Unt(e,r){const n=r.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return!0;const i=Wnt(e);return n.every(s=>i.includes(s))}function Vnt(e){return e.flatMap(r=>{const n=w2(r.tags),i=Hnt(r.completionHistory);return(i.length>0?i:r.completedAt?[{completedAt:r.completedAt,previousStatus:null}]:[]).map(a=>({...a,todoId:r.id,message:r.message,tags:n}))}).sort((r,n)=>new Date(n.completedAt).getTime()-new Date(r.completedAt).getTime())}function qnt(e){return[...e].sort((r,n)=>{const i=r.status==="done",s=n.status==="done";return i!==s?i?1:-1:0})}function Nce(e){const r=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(r);return n.setDate(r.getDate()-r.getDay()),Array.from({length:42},(i,s)=>{const a=new Date(n);return a.setDate(n.getDate()+s),a})}function A7({value:e,onChange:r,placeholder:n="Add date",className:i,iconOnly:s=!1}){const a=Cce(e),[o,l]=y.useState(!1),[d,u]=y.useState(()=>a??new Date),h=f=>{r(f),l(!1)};return y.useEffect(()=>{a&&u(a)},[a==null?void 0:a.getTime()]),c.jsxs(M9,{open:o,onOpenChange:l,children:[c.jsx(R9,{asChild:!0,children:c.jsxs(we,{type:"button",variant:"outline",className:Ae(s?"h-8 w-8 justify-center px-0":"h-10 w-full justify-start gap-2 px-3 text-left font-normal",!e&&"text-muted-foreground",i),title:e?`Due ${yv(e)}`:n,"aria-label":e?`Due ${yv(e)}`:n,children:[c.jsx(gR,{className:"h-4 w-4 shrink-0"}),!s&&c.jsx("span",{className:"truncate",children:e?yv(e):n})]})}),c.jsxs(P9,{align:"start",className:"w-[19rem] p-3",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[c.jsx(we,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u(new Date(d.getFullYear(),d.getMonth()-1,1)),"aria-label":"Previous month",children:c.jsx(Tv,{className:"h-4 w-4"})}),c.jsx("div",{className:"text-sm font-medium",children:kce(d)}),c.jsx(we,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u(new Date(d.getFullYear(),d.getMonth()+1,1)),"aria-label":"Next month",children:c.jsx(js,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"grid grid-cols-7 gap-1 text-center text-[11px] font-medium text-muted-foreground",children:["S","M","T","W","T","F","S"].map((f,g)=>c.jsx("div",{className:"py-1",children:f},`${f}-${g}`))}),c.jsx("div",{className:"grid grid-cols-7 gap-1",children:Nce(d).map(f=>{const g=N5(f),v=e===g,b=g===N5(new Date),_=f.getMonth()!==d.getMonth();return c.jsx(we,{type:"button",variant:v?"secondary":"ghost",size:"icon",className:Ae("h-8 w-8 rounded-md text-xs font-normal",_&&"text-muted-foreground/55",b&&!v&&"border border-border"),onClick:()=>h(g),children:f.getDate()},g)})}),c.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 border-t pt-3",children:[c.jsx(we,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs",onClick:()=>h(N5(new Date)),children:"Today"}),c.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs",onClick:()=>h(null),children:[c.jsx(Xn,{className:"mr-1 h-3.5 w-3.5"}),"Clear"]})]})]})]})}function Gnt({value:e,onChange:r,className:n,iconOnly:i=!1}){const[s,a]=y.useState(!!e);return y.useEffect(()=>{e&&a(!0)},[e]),s?c.jsx(A7,{value:e,onChange:o=>{r(o),o||a(!1)},className:n,iconOnly:i}):c.jsxs(we,{type:"button",variant:"outline",className:Ae(i?"h-8 w-8 justify-center px-0 text-muted-foreground":"h-10 justify-start gap-2 text-muted-foreground",n),onClick:()=>a(!0),title:"Add date","aria-label":"Add date",children:[c.jsx(gR,{className:"h-4 w-4"}),!i&&"Add date"]})}function I1({value:e,onChange:r,options:n,placeholder:i,disabled:s,className:a,triggerLabel:o,triggerIcon:l}){var u;const d=((u=n.find(h=>h.value===e))==null?void 0:u.label)??i??e;return c.jsxs(sh,{value:e,onValueChange:h=>r(h),disabled:s,children:[c.jsx(ed,{className:a,title:o?`${o}: ${d}`:d,"aria-label":o?`${o}: ${d}`:d,children:l||c.jsx(ah,{placeholder:i})}),c.jsx(td,{children:n.map(h=>c.jsx(Ls,{value:h.value,children:h.label},h.value))})]})}function T3({value:e,onChange:r,placeholder:n="Add tag...",commitOnBlur:i=!1,className:s,inputClassName:a}){const[o,l]=y.useState(""),d=mc(e),u=()=>{const f=Fnt(o);f.length!==0&&(r(mc([...d,...f])),l(""))},h=f=>{r(d.filter(g=>g!==f))};return c.jsxs("div",{className:Ae("flex min-h-10 w-full flex-wrap items-center gap-1.5 rounded-lg border border-input bg-background/90 px-2 py-1.5 shadow-sm focus-within:ring-2 focus-within:ring-ring/60 focus-within:ring-offset-2 focus-within:ring-offset-background",s),children:[d.map(f=>c.jsxs(Ar,{variant:"secondary",className:"h-6 gap-1 rounded-md px-2 text-xs",children:[c.jsx("span",{children:f}),c.jsx("button",{type:"button",className:"-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-foreground/10 hover:text-foreground",onClick:()=>h(f),"aria-label":`Remove ${f} tag`,children:c.jsx(Xn,{className:"h-3 w-3"})})]},f)),c.jsx("input",{value:o,onChange:f=>{const g=f.target.value;if(g.includes(",")){const v=g.split(","),b=v.pop()??"",_=mc([...d,...v]);(_.length!==d.length||_.some((S,w)=>S!==d[w]))&&r(_),l(b.trimStart());return}l(g)},onKeyDown:f=>{f.key==="Enter"||f.key===","?(f.preventDefault(),u()):f.key==="Backspace"&&!o&&d.length>0&&(f.preventDefault(),r(d.slice(0,-1)))},onBlur:()=>{i&&u()},className:Ae("h-6 min-w-28 flex-1 bg-transparent px-1 text-sm outline-none placeholder:text-muted-foreground",a),placeholder:d.length===0?n:""})]})}function Knt({provider:e="jait",model:r=null,runtimeMode:n="full-access",onVoiceInput:i,voiceRecording:s=!1,voiceTranscribing:a=!1,onVoiceStop:o}){var de;const[l,d]=y.useState([]),[u,h]=y.useState(""),[f,g]=y.useState([]),[v,b]=y.useState("list"),[_,S]=y.useState("all"),[w,C]=y.useState(""),[j,E]=y.useState([]),[A,N]=y.useState([]),[R,B]=y.useState(null),[G,H]=y.useState(()=>new Date),[z,W]=y.useState(""),[I,O]=y.useState("open"),[D,P]=y.useState("normal"),[$,V]=y.useState(null),[K,F]=y.useState([]),[U,Q]=y.useState(()=>new Set),[q,te]=y.useState([]),[ee,se]=y.useState("normal"),[ae,re]=y.useState(null),[fe,me]=y.useState(!0),[_e,ge]=y.useState(!1),[Ve,le]=y.useState(!1),[it,Xe]=y.useState(()=>new Set),[xt,Pt]=y.useState(null),[Ht,Kt]=y.useState(!1),[tr,ht]=y.useState(0),Ye=y.useRef(null),dt=y.useRef(null),[At,Te]=y.useState(null),[Oe,Je]=y.useState(null),[ct,bt]=y.useState(null),zt=y.useCallback(async()=>{const oe=await pr.listRepos();d(oe),h(Me=>Tnt(oe,Me)??"")},[]),sr=y.useCallback(async oe=>{if(!oe){g([]),me(!1);return}me(!0),Pt(null);try{g($nt(oe,await pr.listJaitTodos(oe)))}catch(Me){Pt(Me instanceof Error?Me.message:"Failed to load todo list")}finally{me(!1)}},[]);y.useEffect(()=>{(async()=>{me(!0),Pt(null);try{await zt()}catch(oe){Pt(oe instanceof Error?oe.message:"Failed to load repositories"),me(!1)}})()},[zt]),y.useEffect(()=>{sr(u)},[sr,u]),y.useEffect(()=>{if(!u){C(""),E([]),N([]),B(null),Q(new Set);return}const oe=Int(u);C(oe.search),E(oe.tags),N(oe.savedTagFilters),B(u),Q(new Set)},[u]),y.useEffect(()=>{!u||R!==u||Bnt(u,{search:w,tags:j,savedTagFilters:A})},[R,w,u,A,j]);const Pe=y.useMemo(()=>qnt(f.filter(oe=>{if(_!=="all"&&oe.status!==_)return!1;const Me=w2(oe.tags);return!(j.length>0&&!j.every(st=>Me.includes(st))||!Unt(oe,w))})),[w,_,j,f]),Ne=y.useMemo(()=>({open:f.filter(oe=>oe.status==="open").length,inProgress:f.filter(oe=>oe.status==="in_progress").length,done:f.filter(oe=>oe.status==="done").length}),[f]),be=l.find(oe=>oe.id===u),Fe=y.useMemo(()=>l.map(oe=>({value:oe.id,label:oe.name})),[l]),nt=y.useMemo(()=>f.filter(oe=>U.has(oe.id)),[U,f]),Ue=y.useMemo(()=>Pe.filter(oe=>U.has(oe.id)).length,[Pe,U]),$t=Pe.length>0&&Ue===Pe.length,Ot=A.find(oe=>uU(oe.tags,j))??null,Yt=y.useMemo(()=>Vnt(f),[f]),rr=Math.max(1,Math.ceil(Yt.length/N3)),or=Yt.slice(tr*N3,tr*N3+N3);y.useEffect(()=>{ht(oe=>Math.min(oe,rr-1))},[rr]),y.useEffect(()=>{Q(oe=>{const Me=new Set(f.map(kt=>kt.id)),st=new Set([...oe].filter(kt=>Me.has(kt)));return st.size===oe.size?oe:st})},[f]);const ke=y.useCallback(oe=>{h(oe);const Me=l.find(st=>st.id===oe);Nnt(oe,(Me==null?void 0:Me.localPath)??null)},[l]);y.useEffect(()=>{if(fe||!be||v!=="list")return;const oe=window.requestAnimationFrame(()=>{var Me,st;(Me=Ye.current)==null||Me.focus(),(st=Ye.current)==null||st.select()});return()=>window.cancelAnimationFrame(oe)},[fe,v,be==null?void 0:be.id]);const at=y.useCallback(async()=>{const oe=z.trim();if(!(!u||!oe)){ge(!0),Pt(null);try{const Me=await pr.createJaitTodo(u,{message:oe,status:I,priority:D,dueDate:$,tags:K});g(st=>{const kt=[Me,...st];return oU(u,kt),kt}),W(""),O("open"),P("normal"),V(null),F([]),window.requestAnimationFrame(()=>{var st;return(st=Ye.current)==null?void 0:st.focus()})}catch(Me){Pt(Me instanceof Error?Me.message:"Failed to add todo")}finally{ge(!1)}}},[$,z,D,I,K,u]),Ze=y.useCallback(oe=>{oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),at())},[at]),Rt=y.useCallback(()=>{i==null||i({onTranscript:oe=>{W(Me=>yce(Me,oe)),window.requestAnimationFrame(()=>{const Me=Ye.current;Me&&(Me.focus(),Me.selectionStart=Me.value.length,Me.selectionEnd=Me.value.length,Me.scrollTop=Me.scrollHeight)})}})},[i]),ze=y.useCallback(()=>{if(s){o==null||o();return}Rt()},[Rt,o,s]),mt=async(oe,Me)=>{g(st=>st.map(kt=>kt.id===oe.id?{...kt,...Me,tags:Me.tags?JSON.stringify(Me.tags):kt.tags}:kt));try{const st=await pr.updateJaitTodo(oe.id,Me);g(kt=>kt.map(jt=>jt.id===oe.id?st:jt))}catch(st){Pt(st instanceof Error?st.message:"Failed to update todo"),sr(u)}},yt=async(oe,Me)=>{oe.status!=="done"&&Me==="done"&&cU(),await mt(oe,{status:Me})},Gt=async oe=>{const Me=f;g(st=>st.filter(kt=>kt.id!==oe)),Q(st=>{const kt=new Set(st);return kt.delete(oe),kt});try{await pr.deleteJaitTodo(oe)}catch(st){g(Me),Pt(st instanceof Error?st.message:"Failed to remove todo")}},qe=y.useCallback((oe,Me)=>{Q(st=>{const kt=new Set(st);return Me?kt.add(oe):kt.delete(oe),kt})},[]),$e=y.useCallback(oe=>{Q(Me=>{const st=new Set(Me);for(const kt of Pe)oe?st.add(kt.id):st.delete(kt.id);return st})},[Pe]),ft=y.useCallback(()=>{const oe=mc(j);if(oe.length===0)return;const Me=oe.join("|");N(st=>st.some(kt=>kt.id===Me||uU(kt.tags,oe))?st:[...st,{id:Me,name:oe.join(" + "),tags:oe}])},[j]),vt=y.useCallback(()=>{Ot&&N(oe=>oe.filter(Me=>Me.id!==Ot.id))},[Ot]),gt=async(oe,Me)=>{if(nt.length!==0){le(!0),Pt(null);try{const st=await Promise.all(nt.map(jt=>pr.updateJaitTodo(jt.id,oe(jt)))),kt=new Map(st.map(jt=>[jt.id,jt]));g(jt=>jt.map(Qr=>kt.get(Qr.id)??Qr))}catch(st){Pt(st instanceof Error?st.message:Me),sr(u)}finally{le(!1)}}},$r=async oe=>{oe==="done"&&nt.some(Me=>Me.status!=="done")&&cU(),await gt(()=>({status:oe}),"Failed to update selected todo statuses")},mr=async oe=>{await gt(()=>({priority:oe}),"Failed to update selected todo priorities")},Ur=async oe=>{await gt(()=>({dueDate:oe}),"Failed to update selected todo due dates")},Xt=async()=>{const oe=mc(q);oe.length!==0&&(await gt(Me=>({tags:mc([...w2(Me.tags),...oe])}),"Failed to update selected todo tags"),te([]))},Si=async()=>{if(nt.length===0)return;const oe=f,Me=new Set(nt.map(st=>st.id));g(st=>st.filter(kt=>!Me.has(kt.id))),Q(new Set),le(!0),Pt(null);try{await Promise.all([...Me].map(st=>pr.deleteJaitTodo(st)))}catch(st){g(oe),Pt(st instanceof Error?st.message:"Failed to remove selected todos")}finally{le(!1)}},un=async oe=>{if(!(!be||it.has(oe.id))){Xe(Me=>new Set(Me).add(oe.id)),Pt(null);try{const Me=`jait/${Math.random().toString(16).slice(2,10)}`,st=be.defaultBranch;let kt;try{kt=(await $s.createWorktree(be.localPath,st,Me)).path}catch{try{await $s.createBranch(be.localPath,Me,st)}catch{}}const jt=await pr.createThread(Ant({repo:be,providerId:e,runtimeMode:n,model:r,workingDirectory:kt??be.localPath,branch:Me}));await pr.startThread(jt.id,Ont(be.name,oe)),oe.status!=="done"&&await mt(oe,{status:"in_progress"})}catch(Me){Pt(Me instanceof Error?Me.message:"Failed to run todo as thread")}finally{Xe(Me=>{const st=new Set(Me);return st.delete(oe.id),st})}}},jn=y.useMemo(()=>{const oe=new Map;for(const Me of Pe)Me.dueDate&&oe.set(Me.dueDate,[...oe.get(Me.dueDate)??[],Me]);return oe},[Pe]);y.useEffect(()=>{if(At&&!Pe.some(oe=>oe.id===At)){Te(null),Je(null),bt(null);return}Oe!=null&&Oe.targetId&&!Pe.some(oe=>oe.id===Oe.targetId)&&Je(At?{targetId:At,placement:"before"}:null)},[At,Oe,Pe]),y.useEffect(()=>{var Qr;if(!At||!ct)return;document.body.style.cursor="grabbing",document.body.style.userSelect="none",document.body.style.touchAction="none";const oe=dn=>{var lr;const On=Array.from(document.querySelectorAll("[data-todo-id]")).filter(Kn=>Kn.dataset.todoId&&Kn.dataset.todoId!==At);if(On.length===0){Je({targetId:null,placement:"after"});return}for(const Kn of On){const dl=Kn.dataset.todoId;if(!dl)continue;const Qn=Kn.getBoundingClientRect();if(dn<Qn.top+Qn.height/2){Je({targetId:dl,placement:"before"});return}}const Gn=((lr=On[On.length-1])==null?void 0:lr.dataset.todoId)??null;Je(Gn?{targetId:Gn,placement:"after"}:{targetId:null,placement:"after"})},Me=dn=>{var On,Gn;if(dn&&dn.pointerId!==ct.pointerId)return;Oe&&Oe.targetId!==At&&g(lr=>{const Kn=lU(lr,At,Oe.targetId,Oe.placement);return Kn===lr?lr:(oU(u,Kn),Kn)});const Nr=dt.current;(On=Nr==null?void 0:Nr.hasPointerCapture)!=null&&On.call(Nr,ct.pointerId)&&((Gn=Nr.releasePointerCapture)==null||Gn.call(Nr,ct.pointerId)),dt.current=null,Te(null),Je(null),bt(null)},st=dn=>{dn.pointerId===ct.pointerId&&(bt(Nr=>Nr&&{...Nr,x:dn.clientX,y:dn.clientY}),oe(dn.clientY))},kt=()=>Me(),jt=()=>Me();return window.addEventListener("pointermove",st),window.addEventListener("pointerup",Me),window.addEventListener("pointercancel",Me),window.addEventListener("blur",jt),(Qr=dt.current)==null||Qr.addEventListener("lostpointercapture",kt),()=>{var dn;document.body.style.cursor="",document.body.style.userSelect="",document.body.style.touchAction="",window.removeEventListener("pointermove",st),window.removeEventListener("pointerup",Me),window.removeEventListener("pointercancel",Me),window.removeEventListener("blur",jt),(dn=dt.current)==null||dn.removeEventListener("lostpointercapture",kt)}},[ct,At,Oe,u]);const Yr=y.useCallback((oe,Me)=>{var jt;if(Me.button!==0&&Me.pointerType!=="touch"&&Me.pointerType!=="pen")return;Me.preventDefault();const st=Me.currentTarget.closest("[data-todo-id]");if(!st)return;dt.current=st,(jt=st.setPointerCapture)==null||jt.call(st,Me.pointerId);const kt=st.getBoundingClientRect();Te(oe),Je({targetId:oe,placement:"before"}),bt({id:oe,pointerId:Me.pointerId,x:Me.clientX,y:Me.clientY,offsetX:Me.clientX-kt.left,offsetY:Me.clientY-kt.top,width:kt.width,height:kt.height})},[]),Nn=At&&Oe&&(Oe.targetId!==At||Oe.placement==="after")?lU(Pe,At,Oe.targetId,Oe.placement):Pe,Et=ct?Nn.find(oe=>oe.id===ct.id):null;return c.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col gap-4 px-3 py-4 sm:px-4 sm:py-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h1",{className:"flex items-center gap-2 text-xl font-bold sm:text-2xl",children:[c.jsx(Vm,{className:"h-6 w-6"}),"Todo"]}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Global repo follow-up work, saved from agents or added directly here."})]}),c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[c.jsxs(sh,{value:u||void 0,onValueChange:ke,disabled:l.length===0,children:[c.jsx(ed,{className:"h-10 min-w-56",children:c.jsx(ah,{placeholder:"Select repository"})}),c.jsx(td,{children:Fe.map(oe=>c.jsx(Ls,{value:oe.value,children:oe.label},oe.value))})]}),c.jsxs(we,{variant:"outline",onClick:()=>void sr(u),disabled:fe||!u,children:[c.jsx(Js,{className:Ae("mr-2 h-4 w-4",fe&&"animate-spin")}),"Refresh"]}),c.jsxs(we,{variant:"outline",onClick:()=>Kt(!0),disabled:Yt.length===0,children:[c.jsx(V5,{className:"mr-2 h-4 w-4"}),"History",Yt.length>0&&c.jsx(Ar,{variant:"secondary",className:"ml-1 px-1.5",children:Yt.length})]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap",children:[c.jsxs(Ar,{variant:"outline",className:"justify-center gap-1.5 px-3 py-1",children:[c.jsx(Vm,{className:"h-3.5 w-3.5 text-primary/70"}),f.length," total"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center gap-1.5 px-3 py-1",children:[c.jsx(vR,{className:"h-3.5 w-3.5 text-muted-foreground"}),Ne.open," open"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center gap-1.5 px-3 py-1",children:[c.jsx(xY,{className:"h-3.5 w-3.5 text-sky-500"}),Ne.inProgress," active"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center gap-1.5 px-3 py-1",children:[c.jsx(ia,{className:"h-3.5 w-3.5 text-emerald-500"}),Ne.done," done"]})]}),xt&&c.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:[c.jsx(na,{className:"h-4 w-4"}),xt,c.jsx(we,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>Pt(null),children:"Dismiss"})]}),c.jsx("div",{className:"rounded-lg border p-3",children:c.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start",children:[c.jsxs("div",{className:"min-w-0 flex-1 rounded-lg border border-input bg-background/90 shadow-sm focus-within:ring-2 focus-within:ring-ring/60 focus-within:ring-offset-2 focus-within:ring-offset-background",children:[c.jsx(Ep,{ref:Ye,value:z,onChange:oe=>W(oe.target.value),onKeyDown:Ze,placeholder:"Add a future agent prompt or repo task...",className:"min-h-20 resize-y border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0"}),c.jsx(T3,{value:K,onChange:F,placeholder:"Add tags...",className:"min-h-9 rounded-none rounded-b-lg border-x-0 border-b-0 border-t bg-transparent px-2 py-1 shadow-none focus-within:ring-0 focus-within:ring-offset-0",inputClassName:"text-xs"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1 text-xs text-muted-foreground lg:w-auto lg:flex-nowrap",children:[c.jsx(g0,{label:`Status: ${$0(I).label}`,children:c.jsx(I1,{value:I,onChange:O,options:y8,triggerLabel:"Status",triggerIcon:c.jsx(H_,{status:I,className:"h-4 w-4"}),className:"h-8 w-8 justify-center rounded-md border-transparent bg-transparent px-0 text-muted-foreground shadow-none hover:bg-accent hover:text-foreground focus:ring-1 focus:ring-ring/50 focus:ring-offset-0 [&>svg:last-child]:hidden"})}),c.jsx(g0,{label:`Priority: ${((de=i_.find(oe=>oe.value===D))==null?void 0:de.label)??D}`,children:c.jsx(I1,{value:D,onChange:P,options:i_,triggerLabel:"Priority",triggerIcon:c.jsx(aU,{priority:D}),className:"h-8 w-8 justify-center rounded-md border-transparent bg-transparent px-0 text-muted-foreground shadow-none hover:bg-accent hover:text-foreground focus:ring-1 focus:ring-ring/50 focus:ring-offset-0 [&>svg:last-child]:hidden"})}),c.jsx(g0,{label:$?`Due ${yv($)}`:"Add date",children:c.jsx(Gnt,{value:$,onChange:V,iconOnly:!0,className:"rounded-md border-transparent bg-transparent text-muted-foreground shadow-none hover:bg-accent hover:text-foreground focus:ring-1 focus:ring-ring/50 focus:ring-offset-0"})}),i&&c.jsx(g0,{label:s?"Stop dictation":a?"Transcribing...":"Dictate todo",children:c.jsx(we,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:ze,disabled:a&&!s,"aria-label":s?"Stop todo dictation":"Dictate todo",children:a?c.jsx(Ft,{className:"h-4 w-4 animate-spin"}):s?c.jsx(s2,{className:"h-4 w-4"}):c.jsx(N0,{className:"h-4 w-4"})})}),c.jsxs(we,{onClick:()=>void at(),disabled:_e||!u||!z.trim(),size:"sm",children:[_e?c.jsx(Ft,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(Zs,{className:"mr-2 h-4 w-4"}),"Add"]})]})]})}),c.jsxs("div",{className:"grid gap-3 rounded-lg border p-3",children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(14rem,1fr)_11rem_minmax(14rem,1fr)_13rem_auto]",children:[c.jsxs("div",{className:"relative",children:[c.jsx(rl,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:w,onChange:oe=>C(oe.target.value),placeholder:"Search todo metadata...",className:"h-10 pl-9"})]}),c.jsx(I1,{value:_,onChange:S,options:[{value:"all",label:"All statuses"},...y8],className:"h-10"}),c.jsx(T3,{value:j,onChange:oe=>E(mc(oe)),placeholder:"Filter tags...",className:"min-h-10"}),c.jsxs(sh,{value:(Ot==null?void 0:Ot.id)??"custom",onValueChange:oe=>{if(oe==="custom"){E([]);return}const Me=A.find(st=>st.id===oe);Me&&E(Me.tags)},children:[c.jsx(ed,{className:"h-10",children:c.jsx(ah,{placeholder:"Saved filters"})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"custom",children:"Unsaved filter"}),A.map(oe=>c.jsx(Ls,{value:oe.id,children:oe.name},oe.id))]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(we,{variant:"outline",size:"icon",className:"h-10 w-10",onClick:ft,disabled:j.length===0||!!Ot,"aria-label":"Save tag filter",children:c.jsx(P2,{className:"h-4 w-4"})}),c.jsx(we,{variant:"outline",size:"icon",className:"h-10 w-10",onClick:vt,disabled:!Ot,"aria-label":"Delete saved tag filter",children:c.jsx(Rl,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[c.jsxs(Ar,{variant:"outline",className:"gap-1.5",children:[c.jsx(V0e,{className:"h-3.5 w-3.5"}),A.length," saved"]}),c.jsxs("span",{children:[Pe.length," shown"]}),(w||j.length>0||_!=="all")&&c.jsxs(we,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{C(""),E([]),S("all")},children:[c.jsx(Xn,{className:"mr-1 h-3.5 w-3.5"}),"Clear"]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex",children:[c.jsxs(we,{variant:v==="list"?"secondary":"outline",onClick:()=>b("list"),children:[c.jsx(Vm,{className:"mr-2 h-4 w-4"}),"List"]}),c.jsxs(we,{variant:v==="calendar"?"secondary":"outline",onClick:()=>b("calendar"),children:[c.jsx(gR,{className:"mr-2 h-4 w-4"}),"Calendar"]})]})]})]}),nt.length>0&&c.jsxs("div",{className:"grid gap-3 rounded-lg border p-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs(Ar,{variant:"secondary",children:[nt.length," selected"]}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>void $r("open"),disabled:Ve,children:"Open"}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>void $r("in_progress"),disabled:Ve,children:"In progress"}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>void $r("done"),disabled:Ve,children:"Done"}),c.jsx(I1,{value:ee,onChange:oe=>{se(oe),mr(oe)},options:i_,className:"h-9 w-32"}),c.jsx(A7,{value:ae,onChange:oe=>{re(oe),Ur(oe)},placeholder:"Due date",className:"h-9 w-36"}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>void Ur(null),disabled:Ve,children:"Clear date"})]}),c.jsxs("div",{className:"grid gap-2 md:grid-cols-[minmax(14rem,1fr)_auto_auto]",children:[c.jsx(T3,{value:q,onChange:te,placeholder:"Add tags to selected...",className:"min-h-9"}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void Xt(),disabled:Ve||q.length===0,children:[c.jsx(Zs,{className:"mr-2 h-4 w-4"}),"Add tags"]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void Si(),disabled:Ve,children:[Ve?c.jsx(Ft,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(Rl,{className:"mr-2 h-4 w-4"}),"Remove"]})]})]}),c.jsx(Pl,{open:Ht,onOpenChange:Kt,children:c.jsxs(al,{className:"max-h-[85vh] max-w-2xl overflow-hidden p-0",children:[c.jsxs(xc,{className:"border-b px-4 py-3",children:[c.jsxs(ol,{className:"flex items-center gap-2 text-base",children:[c.jsx(V5,{className:"h-4 w-4 text-muted-foreground"}),"Completion history"]}),c.jsxs(id,{children:[Yt.length," completed event",Yt.length===1?"":"s"]})]}),c.jsx("div",{className:"grid max-h-[56vh] gap-2 overflow-y-auto px-4 py-3",children:or.map(oe=>c.jsxs("div",{className:"min-w-0 rounded-md border bg-card/40 px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[c.jsx(ia,{className:"h-3.5 w-3.5 text-emerald-500"}),c.jsx("span",{children:jce(oe.completedAt)}),oe.previousStatus&&c.jsxs("span",{children:["from ",$0(oe.previousStatus).label]})]}),c.jsx("div",{className:"mt-1 text-sm",children:oe.message}),oe.tags.length>0&&c.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:oe.tags.slice(0,6).map(Me=>c.jsx(Ar,{variant:"secondary",className:"h-5 rounded px-1.5 text-[11px]",children:Me},Me))})]},`${oe.todoId}-${oe.completedAt}`))}),c.jsxs(xg,{className:"flex-row items-center justify-between border-t px-4 py-3 sm:justify-between sm:space-x-0",children:[c.jsxs("div",{className:"text-xs text-muted-foreground",children:["Page ",tr+1," of ",rr]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>ht(oe=>Math.max(0,oe-1)),disabled:tr===0,children:[c.jsx(Tv,{className:"mr-1 h-4 w-4"}),"Prev"]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>ht(oe=>Math.min(rr-1,oe+1)),disabled:tr>=rr-1,children:["Next",c.jsx(js,{className:"ml-1 h-4 w-4"})]})]})]})]})}),fe&&f.length===0?c.jsx("div",{className:"flex items-center justify-center py-24",children:c.jsx(Ft,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):be?v==="calendar"?c.jsxs("div",{className:"rounded-lg border",children:[c.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>H(new Date(G.getFullYear(),G.getMonth()-1,1)),children:[c.jsx(Tv,{className:"mr-1 h-4 w-4"}),"Prev"]}),c.jsx("div",{className:"font-medium",children:kce(G)}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>H(new Date(G.getFullYear(),G.getMonth()+1,1)),children:["Next",c.jsx(js,{className:"ml-1 h-4 w-4"})]})]}),c.jsx("div",{className:"grid grid-cols-7 border-b text-center text-xs text-muted-foreground",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(oe=>c.jsx("div",{className:"py-2",children:oe},oe))}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-7",children:Nce(G).map(oe=>{const Me=N5(oe),st=jn.get(Me)??[],kt=oe.getMonth()!==G.getMonth();return c.jsxs("div",{className:"min-h-32 border-b p-2 sm:border-r [&:nth-child(7n)]:border-r-0",children:[c.jsx("div",{className:Ae("mb-2 text-xs font-medium",kt&&"text-muted-foreground"),children:oe.getDate()}),c.jsx("div",{className:"space-y-1",children:st.map(jt=>{const Qr=$0(jt.status);return c.jsxs("button",{className:Ae("flex w-full items-start gap-1.5 rounded-md border px-2 py-1 text-left text-xs hover:bg-accent",Qr.itemClassName),onClick:()=>void yt(jt,jt.status==="done"?"open":"done"),children:[c.jsx(H_,{status:jt.status,className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:jt.status==="done"?"line-through text-muted-foreground":"",children:jt.message})]},jt.id)})})]},Me)})})]}):Pe.length===0?c.jsxs("div",{className:"rounded-lg border-2 border-dashed px-4 py-16 text-center",children:[c.jsx(Ave,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground"}),c.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No todo items match"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Change filters or add the first repo-wide item."})]}):c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border bg-card/40 px-3 py-2 text-sm text-muted-foreground",children:[c.jsxs("label",{className:"inline-flex items-center gap-2",children:[c.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input",checked:$t,onChange:oe=>$e(oe.target.checked)}),c.jsx("span",{children:Ue>0?`${Ue} selected in view`:"Select visible"})]}),c.jsxs("span",{children:[Nn.length," item",Nn.length===1?"":"s"]})]}),Nn.map(oe=>{var dn;const Me=w2(oe.tags),st=$0(oe.status),kt=it.has(oe.id),jt=!!(At&&(Oe==null?void 0:Oe.targetId)===oe.id&&Oe.placement==="before"&&At!==oe.id),Qr=!!(At&&(Oe==null?void 0:Oe.targetId)===oe.id&&Oe.placement==="after"&&At!==oe.id);return c.jsxs("div",{className:"space-y-3",children:[jt&&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-todo-id":oe.id,className:Ae("group rounded-lg border p-2 transition-all duration-150 ease-out sm:p-3",st.itemClassName,At&&"touch-none",At===oe.id&&"border-dashed border-primary/35 bg-primary/5 opacity-0"),children:[c.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("input",{"data-no-drag":"true",type:"checkbox",className:"h-4 w-4 rounded border-input",checked:U.has(oe.id),onChange:Nr=>qe(oe.id,Nr.target.checked),"aria-label":"Select todo"}),c.jsx("div",{className:"shrink-0 cursor-grab touch-none rounded p-0.5 text-muted-foreground transition-colors hover:bg-foreground/10 hover:text-foreground active:cursor-grabbing",title:"Drag to reorder","aria-label":"Drag to reorder",onPointerDown:Nr=>Yr(oe.id,Nr),children:c.jsx(H4,{className:"h-4 w-4"})}),c.jsx("button",{className:"h-6 w-6 shrink-0 rounded text-muted-foreground hover:text-foreground",onClick:()=>void yt(oe,oe.status==="done"?"open":"done"),"aria-label":"Toggle todo status",children:c.jsx(H_,{status:oe.status})})]}),c.jsxs("div",{className:"min-w-0 flex-1 rounded-lg border border-input bg-background/90 shadow-sm focus-within:ring-2 focus-within:ring-ring/60 focus-within:ring-offset-2 focus-within:ring-offset-background",children:[c.jsx(Ep,{className:Ae("min-h-20 resize-y border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",oe.status==="done"&&"text-muted-foreground line-through"),defaultValue:oe.message,onBlur:Nr=>{const On=Nr.target.value.trim();On&&On!==oe.message&&mt(oe,{message:On})}}),c.jsx(T3,{value:Me,onChange:Nr=>{const On=mc(Nr);JSON.stringify(On)!==JSON.stringify(mc(Me))&&mt(oe,{tags:On})},placeholder:"Add tags...",commitOnBlur:!0,className:"min-h-9 rounded-none rounded-b-lg border-x-0 border-b-0 border-t bg-transparent px-2 py-1 shadow-none focus-within:ring-0 focus-within:ring-offset-0",inputClassName:"text-xs"})]}),c.jsxs("div",{className:"grid w-[4.25rem] grid-cols-2 gap-0.5 text-xs text-muted-foreground",children:[c.jsx(g0,{label:`Status: ${st.label}`,children:c.jsx(I1,{value:oe.status,onChange:Nr=>void yt(oe,Nr),options:y8,triggerLabel:"Status",triggerIcon:c.jsx(H_,{status:oe.status,className:"h-4 w-4"}),className:"h-8 w-8 justify-center rounded-md border-transparent bg-transparent px-0 text-muted-foreground shadow-none hover:bg-accent hover:text-foreground focus:ring-1 focus:ring-ring/50 focus:ring-offset-0 [&>svg:last-child]:hidden"})}),c.jsx(g0,{label:`Priority: ${((dn=i_.find(Nr=>Nr.value===oe.priority))==null?void 0:dn.label)??oe.priority}`,children:c.jsx(I1,{value:oe.priority,onChange:Nr=>void mt(oe,{priority:Nr}),options:i_,triggerLabel:"Priority",triggerIcon:c.jsx(aU,{priority:oe.priority}),className:"h-8 w-8 justify-center rounded-md border-transparent bg-transparent px-0 text-muted-foreground shadow-none hover:bg-accent hover:text-foreground focus:ring-1 focus:ring-ring/50 focus:ring-offset-0 [&>svg:last-child]:hidden"})}),c.jsx(g0,{label:oe.dueDate?`Due ${yv(oe.dueDate)}`:"Date",children:c.jsx(A7,{value:oe.dueDate??null,onChange:Nr=>void mt(oe,{dueDate:Nr}),placeholder:"Date",iconOnly:!0,className:"rounded-md border-transparent bg-transparent text-muted-foreground shadow-none hover:bg-accent hover:text-foreground focus:ring-1 focus:ring-ring/50 focus:ring-offset-0"})}),c.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void un(oe),disabled:kt||!be,title:"Run todo as thread","aria-label":"Run todo as thread",children:kt?c.jsx(Ft,{className:"h-4 w-4 animate-spin"}):c.jsx(US,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void Gt(oe.id),"aria-label":"Remove todo",children:c.jsx(Rl,{className:"h-4 w-4"})})]})]}),c.jsx("div",{className:"mt-2 flex justify-end",children:oe.sourceThreadTitle&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["Suggested by `",oe.sourceThreadTitle,"`"]})})]}),Qr&&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))]"})})]},oe.id)}),ct&&Et&&c.jsx("div",{className:"pointer-events-none fixed z-50",style:{left:`${ct.x-ct.offsetX}px`,top:`${ct.y-ct.offsetY}px`,width:`${ct.width}px`,minHeight:`${ct.height}px`},children:c.jsx("div",{className:"scale-[1.01] opacity-95",children:c.jsx(znt,{todo:Et})})})]}):c.jsx("div",{className:"rounded-lg border-2 border-dashed px-4 py-16 text-center text-sm text-muted-foreground",children:"Add a repository in manager mode before creating todo items."})]})}var Ynt="Separator",dU="horizontal",Xnt=["horizontal","vertical"],Tce=y.forwardRef((e,r)=>{const{decorative:n,orientation:i=dU,...s}=e,a=Jnt(i)?i:dU,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return c.jsx(VS.div,{"data-orientation":a,...l,...s,ref:r})});Tce.displayName=Ynt;function Jnt(e){return Xnt.includes(e)}var Ece=Tce;const T5=y.forwardRef(({className:e,orientation:r="horizontal",decorative:n=!0,...i},s)=>c.jsx(Ece,{ref:s,decorative:n,orientation:r,className:Ae("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...i}));T5.displayName=Ece.displayName;function Znt(e){if(Array.isArray(e))return e;if(!e)return[];try{const r=JSON.parse(e);return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return e.split(",").map(r=>r.trim()).filter(Boolean)}}function Qnt(e){return[...new Set(e.split(",").map(r=>r.trim().toLowerCase()).filter(Boolean))]}function s_(e){if(!e)return"No activity";const r=new Date(e);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(r)}function eit(){const[e,r]=y.useState(null),[n,i]=y.useState("active"),[s,a]=y.useState("all"),[o,l]=y.useState(""),[d,u]=y.useState(""),[h,f]=y.useState("none"),[g,v]=y.useState([]),[b,_]=y.useState(""),[S,w]=y.useState(""),[C,j]=y.useState(""),[E,A]=y.useState(!0),[N,R]=y.useState(!1),[B,G]=y.useState(!1),[H,z]=y.useState(null),W=y.useCallback(async()=>{A(!0),z(null);try{r(await pr.getRemindersSnapshot({status:n,limit:200})),v(await pr.listUserSecrets())}catch(ee){z(ee instanceof Error?ee.message:"Failed to load memory")}finally{A(!1)}},[n]);y.useEffect(()=>{W()},[W]);const I=(e==null?void 0:e.projects)??[],O=y.useMemo(()=>{const ee=(e==null?void 0:e.reminders)??[];return s==="all"?ee:ee.filter(se=>se.projectId===s)},[e==null?void 0:e.reminders,s]),D=(e==null?void 0:e.threads)??[],P=y.useMemo(()=>new Map(I.map(ee=>[ee.id,ee])),[I]),$=y.useMemo(()=>{const ee=new Map;for(const se of I)for(const ae of se.sessions)ee.set(ae.id,{name:ae.name,projectId:ae.projectId});return ee},[I]),V=y.useMemo(()=>({reminders:(e==null?void 0:e.reminders.length)??0,projects:I.length,sessions:I.reduce((ee,se)=>ee+se.sessions.length,0),threads:D.length}),[e==null?void 0:e.reminders.length,D.length,I]),K=async()=>{const ee=o.trim();if(ee){R(!0),z(null);try{const se=await pr.createReminder({content:ee,projectId:h==="none"?null:h,tags:Qnt(d),sourceType:"user",sourceSurface:"web"});r(ae=>ae&&{...ae,reminders:[se,...ae.reminders]}),l(""),u("")}catch(se){z(se instanceof Error?se.message:"Failed to add memory")}finally{R(!1)}}},F=async(ee,se)=>{r(ae=>ae&&{...ae,reminders:ae.reminders.map(re=>re.id===ee.id?{...re,...se,tags:se.tags?JSON.stringify(se.tags):re.tags}:re)});try{const ae=await pr.updateReminder(ee.id,se);r(re=>re&&{...re,reminders:re.reminders.map(fe=>fe.id===ee.id?ae:fe)})}catch(ae){z(ae instanceof Error?ae.message:"Failed to update memory"),W()}},U=async ee=>{const se=e;r(ae=>ae&&{...ae,reminders:ae.reminders.filter(re=>re.id!==ee)});try{await pr.deleteReminder(ee)}catch(ae){r(se),z(ae instanceof Error?ae.message:"Failed to delete memory")}},Q=async()=>{const ee=b.trim(),se=S.trim();if(!(!ee||!se||!C)){R(!0),z(null);try{const ae=await pr.createUserSecret({type:"ssh-password",key:se,label:ee,value:C});v(re=>[ae,...re.filter(fe=>fe.id!==ae.id)]),_(""),w(""),j("")}catch(ae){z(ae instanceof Error?ae.message:"Failed to save secret")}finally{R(!1)}}},q=async ee=>{const se=g;v(ae=>ae.filter(re=>re.id!==ee));try{await pr.deleteUserSecret(ee)}catch(ae){v(se),z(ae instanceof Error?ae.message:"Failed to delete secret")}},te=async()=>{z(null);try{const ee=await pr.exportMemoryMarkdown({status:n,projectId:s,limit:500});await navigator.clipboard.writeText(ee),G(!0),window.setTimeout(()=>G(!1),1400)}catch(ee){z(ee instanceof Error?ee.message:"Failed to copy memory export")}};return c.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col gap-4 px-3 py-4 sm:px-4 sm:py-6",children:[c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h1",{className:"flex items-center gap-2 text-xl font-bold sm:text-2xl",children:[c.jsx(Zo,{className:"h-6 w-6"}),"Memory"]}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-readable memory with project chat history and completed thread context."})]}),c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[c.jsxs(sh,{value:n,onValueChange:ee=>i(ee),children:[c.jsx(ed,{className:"h-10 w-full sm:w-40",children:c.jsx(ah,{})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"active",children:"Active"}),c.jsx(Ls,{value:"archived",children:"Archived"}),c.jsx(Ls,{value:"all",children:"All"})]})]}),c.jsxs(we,{variant:"outline",onClick:()=>void W(),disabled:E,children:[c.jsx(Js,{className:Ae("mr-2 h-4 w-4",E&&"animate-spin")}),"Refresh"]}),c.jsxs(we,{variant:"outline",onClick:()=>void te(),children:[c.jsx(hc,{className:"mr-2 h-4 w-4"}),B?"Copied":"Copy Markdown"]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap",children:[c.jsxs(Ar,{variant:"outline",className:"justify-center px-3 py-1",children:[V.reminders," memories"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center px-3 py-1",children:[V.projects," projects"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center px-3 py-1",children:[V.sessions," chats"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center px-3 py-1",children:[V.threads," threads"]}),c.jsxs(Ar,{variant:"secondary",className:"justify-center px-3 py-1",children:[g.length," secrets"]})]}),H&&c.jsx(Zr,{className:"border-destructive/30 bg-destructive/10 shadow-none",children:c.jsxs(Kc,{className:"flex items-center gap-2 p-3 text-sm text-destructive",children:[c.jsx(na,{className:"h-4 w-4 shrink-0"}),c.jsx("span",{className:"min-w-0 flex-1",children:H}),c.jsx(we,{variant:"ghost",size:"sm",className:"shrink-0",onClick:()=>z(null),children:"Dismiss"})]})}),c.jsx(Zr,{children:c.jsxs(Kc,{className:"grid gap-3 p-3 lg:grid-cols-[minmax(0,1fr)_220px_220px_auto] lg:items-end",children:[c.jsxs("div",{className:"min-w-0 space-y-2",children:[c.jsx(mi,{htmlFor:"new-reminder-content",children:"Memory"}),c.jsx(Ep,{id:"new-reminder-content",value:o,onChange:ee=>l(ee.target.value),placeholder:"Add agent-readable memory...",className:"min-h-20 lg:min-h-10"})]}),c.jsxs("div",{className:"min-w-0 space-y-2",children:[c.jsx(mi,{children:"Project"}),c.jsxs(sh,{value:h,onValueChange:f,children:[c.jsx(ed,{className:"h-10",children:c.jsx(ah,{placeholder:"Project"})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"none",children:"No project"}),I.map(ee=>c.jsx(Ls,{value:ee.id,children:ee.title||ee.rootPath||"Untitled project"},ee.id))]})]})]}),c.jsxs("div",{className:"min-w-0 space-y-2",children:[c.jsx(mi,{htmlFor:"new-reminder-tags",children:"Tags"}),c.jsx(Ln,{id:"new-reminder-tags",value:d,onChange:ee=>u(ee.target.value),placeholder:"tags, comma separated"})]}),c.jsxs(we,{onClick:()=>void K(),disabled:N||!o.trim(),className:"lg:self-end",children:[N?c.jsx(Ft,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(Zs,{className:"mr-2 h-4 w-4"}),"Add"]})]})}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_420px]",children:[c.jsxs("div",{className:"min-w-0 space-y-3",children:[c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-normal text-muted-foreground",children:"Memory List"}),c.jsxs(sh,{value:s,onValueChange:a,children:[c.jsx(ed,{className:"h-10 w-full sm:w-64",children:c.jsx(ah,{})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"all",children:"All projects"}),I.map(ee=>c.jsx(Ls,{value:ee.id,children:ee.title||ee.rootPath||"Untitled project"},ee.id))]})]})]}),E&&!e?c.jsx("div",{className:"flex items-center justify-center py-24",children:c.jsx(Ft,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):O.length===0?c.jsx(Zr,{className:"border-2 border-dashed shadow-none",children:c.jsxs(Kc,{className:"px-4 py-16 text-center",children:[c.jsx(Zo,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground"}),c.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No memory matches"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Change filters or add the first memory entry."})]})}):O.map(ee=>{const se=ee.projectId?P.get(ee.projectId):null,ae=ee.sessionId?$.get(ee.sessionId):null,re=Znt(ee.tags),fe=`${ee.sourceType}:${ee.sourceId||"none"}@${ee.sourceSurface}`;return c.jsx(Zr,{children:c.jsxs(Kc,{className:"p-3",children:[c.jsx(Ep,{className:"min-h-20",defaultValue:ee.content,onBlur:me=>{const _e=me.target.value.trim();_e&&_e!==ee.content&&F(ee,{content:_e})}}),c.jsxs("div",{className:"mt-3 flex flex-col gap-2 text-xs text-muted-foreground sm:flex-row sm:flex-wrap sm:items-center",children:[c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(Vve,{className:"h-3.5 w-3.5"}),se?se.title||se.rootPath||"Project":"Global memory"]}),ae&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(Kd,{className:"h-3.5 w-3.5"}),ae.name||"Chat"]}),c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:fe,children:[c.jsx(Kd,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"truncate",children:fe})]}),c.jsxs("span",{className:"inline-flex items-center gap-1",title:"Usage count",children:[c.jsx(M0e,{className:"h-3.5 w-3.5"}),ee.usageCount??0," uses"]}),c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(UD,{className:"h-3.5 w-3.5"}),"Updated ",s_(ee.updatedAt)]}),c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(UD,{className:"h-3.5 w-3.5"}),"Retrieved ",s_(ee.lastRetrievedAt)]})]}),re.length>0&&c.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:re.map(me=>c.jsx(Ar,{variant:"secondary",className:"rounded-md",children:me},me))}),c.jsx(T5,{className:"my-3"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void F(ee,{status:ee.status==="active"?"archived":"active"}),children:[ee.status==="active"?c.jsx(mR,{className:"mr-2 h-4 w-4"}):c.jsx(ia,{className:"mr-2 h-4 w-4"}),ee.status==="active"?"Archive":"Restore"]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void U(ee.id),children:[c.jsx(Rl,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})},ee.id)})]}),c.jsx("div",{className:"min-w-0",children:c.jsxs(Y0,{defaultValue:"projects",className:"min-w-0",children:[c.jsxs(ag,{className:"grid w-full grid-cols-3",children:[c.jsx(Qs,{value:"projects",children:"Projects"}),c.jsx(Qs,{value:"threads",children:"Threads"}),c.jsx(Qs,{value:"secrets",children:"Secrets"})]}),c.jsx(ea,{value:"projects",className:"mt-3",children:c.jsx(Jc,{className:"max-h-[42rem] pr-1",children:c.jsxs("div",{className:"space-y-2",children:[I.map(ee=>c.jsx(Zr,{children:c.jsxs(Kc,{className:"p-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-medium",children:ee.title||ee.rootPath||"Untitled project"}),c.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ee.rootPath||ee.nodeId||"No path"})]}),c.jsx(Ar,{variant:"outline",className:"shrink-0",children:ee.reminderCount})]}),c.jsx(T5,{className:"my-3"}),c.jsxs("div",{className:"space-y-1.5",children:[ee.sessions.slice(0,6).map(se=>c.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[c.jsx("span",{className:"min-w-0 truncate",children:se.name||"Chat"}),c.jsx("span",{className:"shrink-0 text-muted-foreground",children:s_(se.lastActiveAt)})]},se.id)),ee.sessions.length===0&&c.jsx("div",{className:"text-xs text-muted-foreground",children:"No chats yet"})]})]})},ee.id)),I.length===0&&c.jsx(Zr,{className:"border-2 border-dashed shadow-none",children:c.jsx(Kc,{className:"p-6 text-center text-sm text-muted-foreground",children:"No projects yet"})})]})})}),c.jsx(ea,{value:"threads",className:"mt-3",children:c.jsx(Jc,{className:"max-h-[42rem] pr-1",children:c.jsxs("div",{className:"space-y-2",children:[D.slice(0,12).map(ee=>c.jsx(Zr,{children:c.jsx(Kc,{className:"p-3",children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-medium",children:ee.title}),c.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[ee.providerId," · ",s_(ee.updatedAt)]})]}),c.jsx(Ar,{variant:ee.status==="completed"?"secondary":"outline",className:"shrink-0",children:ee.status})]})})},ee.id)),D.length===0&&c.jsx(Zr,{className:"border-2 border-dashed shadow-none",children:c.jsx(Kc,{className:"p-6 text-center text-sm text-muted-foreground",children:"No past threads yet"})})]})})}),c.jsx(ea,{value:"secrets",className:"mt-3",children:c.jsx(Zr,{children:c.jsxs(Kc,{className:"space-y-3 p-3",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(Ln,{value:b,onChange:ee=>_(ee.target.value),placeholder:"Label"}),c.jsx(Ln,{value:S,onChange:ee=>w(ee.target.value),placeholder:"SSH key, for example jakob@192.168.178.53:22"}),c.jsx(Ln,{type:"password",value:C,onChange:ee=>j(ee.target.value),placeholder:"Password"}),c.jsxs(we,{onClick:()=>void Q(),disabled:N||!b.trim()||!S.trim()||!C,children:[N?c.jsx(Ft,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(o1e,{className:"mr-2 h-4 w-4"}),"Save Secret"]})]}),c.jsx(T5,{}),c.jsx(Jc,{className:"max-h-[30rem] pr-1",children:c.jsxs("div",{className:"space-y-2",children:[g.map(ee=>c.jsx(Zr,{children:c.jsx(Kc,{className:"p-3",children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-medium",children:ee.label}),c.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[ee.type," · ",ee.key]}),c.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["Last used ",s_(ee.lastUsedAt)]})]}),c.jsx(we,{variant:"ghost",size:"sm",className:"shrink-0",onClick:()=>void q(ee.id),children:c.jsx(Rl,{className:"h-4 w-4"})})]})})},ee.id)),g.length===0&&c.jsx(Zr,{className:"border-2 border-dashed shadow-none",children:c.jsx(Kc,{className:"p-6 text-center text-sm text-muted-foreground",children:"No saved secrets"})})]})})]})})})]})})]})]})}function hU({status:e}){switch(e){case"A":case"?":return c.jsx(e5,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"D":return c.jsx(zye,{className:"h-3.5 w-3.5 text-red-500 shrink-0"});case"R":return c.jsx($ye,{className:"h-3.5 w-3.5 text-blue-500 shrink-0"});default:return c.jsx(bY,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"})}}function fU(e){switch(e){case"A":return"Added";case"?":return"Untracked";case"D":return"Deleted";case"R":return"Renamed";default:return"Modified"}}function tit({cwd:e,baseBranch:r,branch:n,onClose:i}){const[s,a]=y.useState([]),[o,l]=y.useState(!0),[d,u]=y.useState(0),[h,f]=y.useState(()=>typeof window<"u"&&window.innerWidth<960);y.useEffect(()=>{let _=!1;return l(!0),$s.fileDiffs(e,r,n).then(S=>{_||(a(S),u(0))}).catch(()=>{_||a([])}).finally(()=>{_||l(!1)}),()=>{_=!0}},[r,n,e]),y.useEffect(()=>{const _=()=>f(window.innerWidth<960);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const g=s[d]??null,v=g?b2(g.path):"plaintext",b=y.useCallback(_=>{_.key==="Escape"?i():_.key==="ArrowDown"||_.key==="j"?(_.preventDefault(),u(S=>Math.min(S+1,s.length-1))):(_.key==="ArrowUp"||_.key==="k")&&(_.preventDefault(),u(S=>Math.max(S-1,0)))},[i,s.length]);return c.jsx("div",{className:"fixed inset-0 z-[100] bg-background/80 backdrop-blur-sm flex items-center justify-center p-4",onKeyDown:b,tabIndex:-1,children:c.jsxs("div",{className:"bg-popover border rounded-lg shadow-xl w-full max-w-6xl h-[85vh] flex flex-col",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(bY,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("h3",{className:"text-sm font-medium",children:"Changes"}),!o&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.length," file",s.length!==1?"s":""," changed"]})]}),c.jsx(we,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:i,children:c.jsx(Xn,{className:"h-4 w-4"})})]}),o?c.jsx("div",{className:"flex-1 flex items-center justify-center",children:c.jsx(Ft,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):s.length===0?c.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No changes detected."}):c.jsxs("div",{className:Ae("flex-1 flex min-h-0",h&&"flex-col"),children:[c.jsxs("div",{className:Ae("border-r flex flex-col shrink-0 bg-muted/20",h?"w-full border-r-0 border-b max-h-40":"w-56"),children:[c.jsx("div",{className:"px-3 py-2 border-b",children:c.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Files"})}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:s.map((_,S)=>c.jsxs("button",{className:Ae("flex items-center gap-2 w-full px-3 py-1.5 text-left text-xs hover:bg-accent/50 transition-colors",S===d&&"bg-accent"),onClick:()=>u(S),title:`${_.path} (${fU(_.status)})`,children:[c.jsx(hU,{status:_.status}),c.jsx("span",{className:"truncate font-mono",children:_.path.split(/[/\\]/).pop()})]},_.path))})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b bg-muted/10 shrink-0",children:[c.jsx(hU,{status:(g==null?void 0:g.status)??"M"}),c.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate",children:g==null?void 0:g.path}),c.jsx("span",{className:Ae("text-2xs px-1.5 py-0.5 rounded font-medium",(g==null?void 0:g.status)==="A"||(g==null?void 0:g.status)==="?"?"bg-green-500/10 text-green-500":(g==null?void 0:g.status)==="D"?"bg-red-500/10 text-red-500":"bg-yellow-500/10 text-yellow-500"),children:fU((g==null?void 0:g.status)??"M")})]}),c.jsx("div",{className:"flex-1 min-h-0",children:g&&c.jsx(Uw,{original:g.original,modified:g.modified,language:v,modelKey:g.path,className:"h-full",editorClassName:"h-full",renderSideBySide:!h,options:{readOnly:!0,minimap:{enabled:!1},renderOverviewRuler:!0,ignoreTrimWhitespace:!1,enableSplitViewResizing:!0}},g.path)})]})]})]})})}const pU={github:{placeholder:"ghp_... or github_pat_...",createUrl:"https://github.com/settings/tokens/new?scopes=repo,read:org,workflow&description=Jait+CLI",createLabel:"Create a GitHub token",scopes:"repo, read:org, and workflow",cliName:"gh",cliUrl:"https://cli.github.com"},gitlab:{placeholder:"glpat-...",createUrl:"https://gitlab.com/-/user_settings/personal_access_tokens",createLabel:"Create a GitLab token",scopes:"api and write_repository",cliName:"glab",cliUrl:"https://gitlab.com/gitlab-org/cli"},gitea:{placeholder:"your-gitea-token",createUrl:"",createLabel:"Create a token in your Gitea settings",scopes:"repo access",cliName:"tea",cliUrl:"https://gitea.com/gitea/tea"},"azure-devops":{placeholder:"your-azure-devops-pat",createUrl:"https://dev.azure.com/_usersSettings/tokens",createLabel:"Create an Azure DevOps PAT",scopes:"Code (Read & Write)",cliName:"az",cliUrl:"https://learn.microsoft.com/en-us/cli/azure/install-azure-cli"},bitbucket:{placeholder:"your-bitbucket-app-password",createUrl:"https://bitbucket.org/account/settings/app-passwords/",createLabel:"Create a Bitbucket app password",scopes:"Repositories (Read/Write) and Pull Requests (Read/Write)"}};function rit({open:e,onOpenChange:r,cwd:n,remoteUrl:i,onReady:s}){const[a,o]=y.useState("checking"),[l,d]=y.useState(null),[u,h]=y.useState(""),[f,g]=y.useState(null),v=(l==null?void 0:l.provider)??"github",b=(l==null?void 0:l.forgeName)??"Git Forge",_=pU[v]??pU.github,S=y.useCallback(async()=>{o("checking"),g(null);try{const j=await $s.forgeStatus(n,i);d(j),!j.installed&&!j.authenticated?o("not-installed"):j.authenticated?o("success"):o("not-authenticated")}catch(j){g(j instanceof Error?j.message:"Failed to check forge status"),o("error")}},[n,i]);y.useEffect(()=>{e&&(S(),h(""))},[e,S]);const w=y.useCallback(async()=>{if(u.trim()){o("authenticating"),g(null);try{const j=await $s.forgeAuth(u.trim(),n,i);j.ok?(d(E=>E&&{...E,authenticated:!0,username:j.username}),o("success"),h("")):(g(j.error??"Authentication failed — check your token permissions."),o("not-authenticated"))}catch(j){g(j instanceof Error?j.message:"Authentication failed"),o("not-authenticated")}}},[u,n,i]),C=y.useCallback(()=>{r(!1),s==null||s()},[r,s]);return c.jsx(Pl,{open:e,onOpenChange:r,children:c.jsxs(al,{className:"max-w-md",children:[c.jsxs(xc,{children:[c.jsxs(ol,{children:[b," Setup"]}),c.jsxs(id,{children:["Pull request creation requires authentication with ",b,"."]})]}),a==="checking"&&c.jsxs("div",{className:"flex items-center gap-3 py-4",children:[c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",b," status…"]})]}),(a==="not-installed"||a==="not-authenticated")&&c.jsxs("div",{className:"space-y-4 py-2",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(ch,{className:`h-5 w-5 mt-0.5 shrink-0 ${a==="not-installed"?"text-red-500":"text-amber-500"}`}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-sm font-medium",children:a==="not-installed"?`${b} CLI not detected`:`${b} is not authenticated`}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Paste a Personal Access Token with ",_.scopes," scope to sign in."]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(mi,{htmlFor:"forge-token",className:"text-xs",children:"Personal Access Token"}),c.jsx(Ln,{id:"forge-token",type:"password",placeholder:_.placeholder,value:u,onChange:j=>h(j.target.value),onKeyDown:j=>{j.key==="Enter"&&w()},autoFocus:!0}),c.jsxs("p",{className:"text-2xs text-muted-foreground",children:[_.createUrl?c.jsx("a",{href:_.createUrl,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:_.createLabel}):c.jsx("span",{children:_.createLabel})," ","with ",c.jsx("code",{className:"text-2xs",children:_.scopes})," permissions."]})]}),a==="not-installed"&&_.cliName&&_.cliUrl&&c.jsxs("p",{className:"text-2xs text-muted-foreground",children:["Optionally install the ",c.jsx("code",{className:"text-2xs",children:_.cliName})," CLI:"," ",c.jsx("a",{href:_.cliUrl,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:_.cliUrl})]}),f&&c.jsx("p",{className:"text-xs text-red-500",children:f})]}),a==="authenticating"&&c.jsxs("div",{className:"flex items-center gap-3 py-4",children:[c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Authenticating with ",b,"…"]})]}),a==="success"&&c.jsxs("div",{className:"flex items-start gap-3 py-4",children:[c.jsx(ia,{className:"h-5 w-5 text-green-500 mt-0.5 shrink-0"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("p",{className:"text-sm font-medium",children:["Authenticated",l!=null&&l.username?` as ${l.username}`:""," on ",b]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"You can now create pull requests."})]})]}),a==="error"&&c.jsxs("div",{className:"flex items-start gap-3 py-4",children:[c.jsx(ch,{className:"h-5 w-5 text-red-500 mt-0.5 shrink-0"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-sm font-medium",children:"Something went wrong"}),f&&c.jsx("p",{className:"text-xs text-muted-foreground",children:f})]})]}),c.jsxs(xg,{children:[(a==="not-installed"||a==="not-authenticated"||a==="error")&&c.jsxs(c.Fragment,{children:[a==="error"&&c.jsx(we,{variant:"outline",size:"sm",onClick:()=>void S(),children:"Re-check"}),c.jsx(we,{size:"sm",disabled:!u.trim(),onClick:()=>void w(),children:"Sign in"})]}),a==="success"&&c.jsx(we,{size:"sm",onClick:C,children:"Continue"})]})]})})}const nit=rit;function Ace(e,r,n,i){return e?r==="creating"||r==="open"||r==="merged"||r==="closed"||i!=null&&i.branch&&i.branch!==e?!0:n==="completed"?!((i==null?void 0:i.branch)===e&&i.hasWorkingTreeChanges):!1:!1}function mU(e,r,n,i,s){return r?Ace(r,n,i,s)?{baseBranch:e,branch:r}:{baseBranch:e}:{}}function iit(e){return e!=="creating"}function gU(e,r,n){return e==null||r==null||n==null?null:{insertions:r,deletions:n,hasChanges:e>0}}function sit(e,r,n){return e?e.hasWorkingTreeChanges||!(n==="merged"||n==="closed")?!0:!!r:!1}function ait({hasRepository:e,threadKind:r,threadStatus:n,threadBranch:i,prUrl:s,prState:a}){return!e||r!=="delivery"?!1:!!(i||n==="completed"||s||a==="creating"||a==="open")}function oit({insertions:e,deletions:r}){return c.jsxs("span",{className:"inline-flex items-center gap-1 font-medium tabular-nums",children:[c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["+",e]}),c.jsxs("span",{className:"text-red-600 dark:text-red-400",children:["-",r]})]})}function sL({threadId:e,cwd:r,branch:n,baseBranch:i,threadTitle:s,prUrl:a,prState:o,threadStatus:l,threadKind:d="delivery",showStatusBadge:u=!0,changeFiles:h,changeInsertions:f,changeDeletions:g}){var fe;const v=ax(),b=gU(h,f,g),[_,S]=y.useState(!1),[w,C]=y.useState(!1),[j,E]=y.useState(!1),[A,N]=y.useState(null),[R,B]=y.useState(()=>b),G=y.useRef(!1),H=y.useRef(!1),[z,W]=y.useState(a?{url:a,kind:"created"}:null);y.useEffect(()=>{W(me=>a?{url:a,kind:"created"}:(me==null?void 0:me.kind)==="create"?me:null)},[a]),y.useEffect(()=>{let me=!1;return iit(o)?((async()=>{try{const ge=await $s.status(r,n??void 0);if(me)return;N(ge);const Ve=gU(h,f,g);if(Ve){B(Ve);return}const le=mU(i,n,o,l,ge),it=n?await $s.diffStats(r,le.baseBranch,le.branch).catch(()=>null):null;if(me)return;if(it){B({insertions:it.insertions,deletions:it.deletions,hasChanges:it.hasChanges});return}if(n){B(null);return}B({insertions:ge.index.insertions+ge.workingTree.insertions,deletions:ge.index.deletions+ge.workingTree.deletions,hasChanges:ge.hasWorkingTreeChanges})}catch{me||(N(null),B(null))}})(),()=>{me=!0}):void 0},[i,n,g,h,f,r,o,a,l]);const[I,O]=y.useState(null),D=y.useRef(null);y.useEffect(()=>{if(!n||!a||o==="merged"||o==="closed"){O(null),D.current&&(clearInterval(D.current),D.current=null);return}const me=async()=>{try{const _e=await $s.prChecks(r,n);if(!_e||_e.length===0){O(null);return}const ge=_e.some(le=>le.conclusion==="failure"||le.conclusion==="cancelled"),Ve=_e.some(le=>le.state==="PENDING"||le.state==="QUEUED"||le.state==="IN_PROGRESS"||!le.conclusion);O(ge?"failing":Ve?"pending":"passing")}catch{}};return me(),D.current=setInterval(me,15e3),()=>{D.current&&(clearInterval(D.current),D.current=null)}},[n,r,a,o]);const P=z??(a?{url:a,kind:"created"}:null)??((fe=A==null?void 0:A.pr)!=null&&fe.url?{url:A.pr.url,kind:"created"}:null),$=o==="creating"&&(P==null?void 0:P.kind)==="created"?"open":o,V=Ace(n,$,l,A),K=mU(i,n,$,l,A),F=$==="creating",U=b??R,Q=V?!!(U!=null&&U.hasChanges):sit(A,n,$),q=F&&!P?"Creating PR...":P?P.kind==="created"?"Open PR":"Open PR Page":"Create Pull Request",te=F&&!P?"Creating pull request":P?q:"Create pull request",ee=d==="delivery"&&(P!=null||l==="completed"),se=_||F,ae=y.useCallback(async()=>{if(P){window.open(P.url,"_blank");return}if(l!=="completed"){Pn.error("Thread not completed",{description:"Finish the thread before creating a pull request."});return}if(d!=="delivery"){Pn.error("PR creation unavailable",{description:"Delegation threads are helper workers and do not create pull requests."});return}if(S(!0),!H.current)try{if((await $s.status(r)).prProvider==="github"){const _e=await $s.ghStatus(r);if(!_e.installed||!_e.authenticated){S(!1),G.current=!0,E(!0);return}}}catch{}H.current=!1;try{const me=s.replace(/^\[.*?\]\s*/,""),_e=await pr.createPullRequest(e,{commitMessage:me,baseBranch:i}),ge=_e.result;_e.pushFailed?_e.resumed?Pn.info("Push failed — thread resumed",{description:"The agent is investigating the push failure and will fix the issue."}):Pn.error("Push failed",{description:_e.error??"Git push failed. Re-open the thread to fix the issue."}):ge.pr.url?W({url:ge.pr.url,kind:"created"}):ge.push.createPrUrl&&W({url:ge.push.createPrUrl,kind:"create"})}catch(me){Pn.error("Failed",{description:me instanceof Error?me.message:"Unknown error"})}finally{S(!1)}},[i,r,e,d,l,s,P]),re=y.useCallback(()=>{G.current&&(G.current=!1,H.current=!0,ae())},[ae]);return c.jsxs(c.Fragment,{children:[c.jsx(nit,{open:j,onOpenChange:E,cwd:r,onReady:re}),c.jsxs("div",{className:"inline-flex items-center gap-1",children:[Q&&U&&c.jsxs(we,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-xs sm:h-6 sm:text-2xs",onClick:()=>C(!0),title:"View changes","aria-label":`View changes: +${U.insertions} -${U.deletions}`,children:[c.jsx(oit,{insertions:U.insertions,deletions:U.deletions}),!v&&"Changes"]}),c.jsxs(we,{variant:"ghost",size:"sm",className:"h-7 min-w-8 gap-1 px-2 text-xs sm:h-6 sm:min-w-7 sm:text-2xs",disabled:se||!ee,onClick:ae,title:d!=="delivery"?"Delegation threads do not create pull requests.":!P&&l!=="completed"?"Finish the thread before creating a pull request.":te,"aria-label":te,children:[se?c.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin sm:h-3 sm:w-3"}):c.jsx(Jye,{className:"h-3.5 w-3.5 sm:h-3 sm:w-3"}),!v&&q]}),u&&P&&c.jsx(Ar,{variant:"outline",className:`h-5 px-1.5 text-2xs font-medium ${$==="merged"?"border-purple-500/40 text-purple-700 bg-purple-500/10 dark:text-purple-300 dark:bg-purple-500/20 dark:border-purple-400/40":$==="closed"?"border-red-500/40 text-red-700 bg-red-500/10 dark:text-red-300 dark:bg-red-500/20 dark:border-red-400/40":$==="creating"?"border-amber-500/40 text-amber-700 bg-amber-500/10 dark:text-amber-300 dark:bg-amber-500/20 dark:border-amber-400/40":P.kind==="created"?"border-green-500/40 text-green-700 dark:text-green-300 dark:border-green-400/40":"border-amber-500/40 text-amber-700 dark:text-amber-300 dark:border-amber-400/40"}`,children:$==="merged"?"PR merged":$==="closed"?"PR closed":$==="creating"?"PR creating":P.kind==="created"?"PR open":"PR ready to open"}),u&&(P==null?void 0:P.kind)==="created"&&$==="open"&&I&&c.jsxs(Ar,{variant:"outline",className:`h-5 px-1.5 text-2xs font-medium inline-flex items-center gap-0.5 ${I==="failing"?"border-red-500/40 text-red-700 bg-red-500/10 dark:text-red-300 dark:bg-red-500/20 dark:border-red-400/40":I==="pending"?"border-amber-500/40 text-amber-700 bg-amber-500/10 dark:text-amber-300 dark:bg-amber-500/20 dark:border-amber-400/40":"border-green-500/40 text-green-700 bg-green-500/10 dark:text-green-300 dark:bg-green-500/20 dark:border-green-400/40"}`,children:[I==="failing"?c.jsx(ch,{className:"h-3 w-3"}):I==="pending"?c.jsx(vg,{className:"h-3 w-3"}):c.jsx(ia,{className:"h-3 w-3"}),I==="failing"?"Checks failing":I==="pending"?"Checks pending":"Checks passed"]})]}),w&&c.jsx(tit,{cwd:r,baseBranch:K.baseBranch,branch:K.branch,onClose:()=>C(!1)})]})}const lit={bundled:"bg-sky-500/10 text-sky-600",user:"bg-amber-500/10 text-amber-600",project:"bg-emerald-500/10 text-emerald-600",plugin:"bg-fuchsia-500/10 text-fuchsia-600"},cit=[{pattern:/\b(debug|bug|troubleshoot|fix)\b/i,icon:yA},{pattern:/\b(review|audit|security|secure|vuln)\b/i,icon:x1e},{pattern:/\b(test|qa|spec)\b/i,icon:Rve},{pattern:/\b(perf|performance|optimi[sz]e|latency|profil)\b/i,icon:vA},{pattern:/\b(arch|design|system|topology|diagram)\b/i,icon:dc},{pattern:/\b(research|investigate|search|explore)\b/i,icon:rl},{pattern:/\b(data|analysis|analytics|report)\b/i,icon:vA},{pattern:/\b(code|generate|scaffold|tool|workflow)\b/i,icon:kR}];function uit(e){const r=`${e.id} ${e.name} ${e.description}`,n=cit.find(({pattern:i})=>i.test(r));return{icon:(n==null?void 0:n.icon)??H0e,className:lit[e.source]}}function dit(e){return e.open&&!e.attemptedLoad&&e.skillsLength===0&&!e.loading}const hit=qn();function fit({token:e,threadId:r,selectedSkillIds:n}){const[i,s]=y.useState(!1),[a,o]=y.useState([]),[l,d]=y.useState(!1),[u,h]=y.useState(null),[f,g]=y.useState(!1),[v,b]=y.useState(!1),_=y.useCallback(async()=>{d(!0),h(null);try{const A={};e&&(A.Authorization=`Bearer ${e}`);const N=await fetch(`${hit}/api/skills`,{headers:A});if(!N.ok)throw new Error(`Failed to load skills (HTTP ${N.status})`);const R=await N.json();o(R)}catch(A){h(A instanceof Error?A.message:"Failed to load skills")}finally{d(!1),g(!0)}},[e]);y.useEffect(()=>{dit({open:i,attemptedLoad:f,skillsLength:a.length,loading:l})&&_()},[f,_,l,i,a.length]);const S=y.useMemo(()=>a.filter(A=>A.enabled),[a]),w=n??S.map(A=>A.id),C=n===null,j=y.useCallback(async A=>{b(!0);try{await pr.updateThread(r,{skillIds:A})}finally{b(!1)}},[r]),E=y.useCallback(async(A,N)=>{const R=N?[...new Set([...w,A])]:w.filter(B=>B!==A);await j(R)},[w,j]);return c.jsxs(M9,{open:i,onOpenChange:s,children:[c.jsx(R9,{asChild:!0,children:c.jsxs(we,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-[10px] text-muted-foreground",children:[c.jsx(u1e,{className:"h-3 w-3"}),C?"Skills:auto":`Skills:${(n==null?void 0:n.length)??0}`]})}),c.jsxs(P9,{align:"end",className:"w-80 space-y-3 p-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium",children:"Thread skills"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:C?"Uses globally enabled skills.":"Uses only pinned skills for this thread."})]}),C?c.jsx(Ar,{variant:"secondary",className:"text-[10px]",children:"global"}):c.jsx(Ar,{variant:"outline",className:"text-[10px]",children:"custom"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(we,{size:"sm",variant:C?"secondary":"outline",className:"h-7 text-xs",disabled:v,onClick:()=>void j(null),children:"Global"}),c.jsx(we,{size:"sm",variant:!C&&((n==null?void 0:n.length)??0)===0?"secondary":"outline",className:"h-7 text-xs",disabled:v,onClick:()=>void j([]),children:"None"})]}),l?c.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted-foreground",children:[c.jsx(Ft,{className:"h-4 w-4 animate-spin"}),"Loading skills..."]}):u?c.jsxs("div",{className:"space-y-3 rounded-lg border border-destructive/50 bg-destructive/5 p-3",children:[c.jsxs("div",{className:"flex items-start gap-2 text-sm text-destructive",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsx("span",{children:u})]}),c.jsx(we,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>{g(!1),_()},children:"Retry"})]}):S.length===0?c.jsx("div",{className:"rounded-lg border border-dashed p-4 text-xs text-muted-foreground",children:"No enabled skills. Install/enable ClawHub skills in Settings."}):c.jsx("div",{className:"max-h-64 space-y-2 overflow-y-auto pr-1",children:S.map(A=>{const N=w.includes(A.id),R=uit(A),B=R.icon;return c.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-2.5",children:[c.jsx("div",{className:`mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md ${R.className}`,children:c.jsx(B,{className:"h-3.5 w-3.5"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate text-sm font-medium",children:A.name}),c.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:A.description})]}),c.jsx(gf,{checked:N,disabled:v||C,onCheckedChange:G=>{E(A.id,G)}})]},A.id)})})]})]})}function pit({open:e,onOpenChange:r,repoId:n,repoName:i}){const s=bg(),[a,o]=y.useState(""),[l,d]=y.useState(""),[u,h]=y.useState(!1),[f,g]=y.useState(!1),[v,b]=y.useState(!1),[_,S]=y.useState(null),w=a!==l,C=dk();y.useEffect(()=>{if(!e||!n)return;let R=!1;return h(!0),S(null),pr.getRepoStrategy(n).then(B=>{R||(o(B),d(B))}).catch(B=>{R||S(B instanceof Error?B.message:"Failed to load strategy")}).finally(()=>{R||h(!1)}),()=>{R=!0}},[e,n]);const j=y.useCallback(async()=>{g(!0),S(null);try{const R=await pr.updateRepoStrategy(n,a);d(R),o(R)}catch(R){S(R instanceof Error?R.message:"Failed to save strategy")}finally{g(!1)}},[n,a]),E=y.useCallback(async()=>{b(!0),S(null);try{const R=await pr.generateRepoStrategy(n);R&&o(R)}catch(R){S(R instanceof Error?R.message:"Failed to generate strategy")}finally{b(!1)}},[n]),A=y.useCallback(()=>{o(l)},[l]),N=y.useCallback(R=>{if(R||!w){r(R);return}(async()=>await s({title:"Discard changes",description:"You have unsaved changes. Discard them?",confirmLabel:"Discard",variant:"destructive"})&&r(!1))()},[s,w,r]);return c.jsx(Pl,{open:e,onOpenChange:N,children:c.jsxs(al,{className:"flex max-h-[85vh] w-full max-w-3xl flex-col gap-0 overflow-hidden p-0",children:[c.jsx(xc,{className:"shrink-0 border-b px-4 py-3",children:c.jsxs(ol,{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{children:"Strategy"}),c.jsx("span",{className:"text-muted-foreground",children:"—"}),c.jsx("span",{className:"font-normal text-muted-foreground",children:i}),w&&c.jsx("span",{className:"ml-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-2xs text-amber-600 dark:text-amber-400",children:"unsaved"})]})}),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u?c.jsx("div",{className:"flex flex-1 items-center justify-center py-12",children:c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):c.jsxs("div",{className:"relative min-h-0 flex-1",children:[c.jsx(hk,{height:"55vh",language:"markdown",beforeMount:R=>vc(R,C),theme:C,value:a,onChange:R=>o(R??""),options:{minimap:{enabled:!1},"semanticHighlighting.enabled":!0,lineNumbers:"off",wordWrap:"on",fontSize:13,padding:{top:12,bottom:12},scrollBeyondLastLine:!1,renderLineHighlight:"none",overviewRulerLanes:0,folding:!0,tabSize:2}}),!a.trim()&&c.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center px-8 text-center",children:c.jsxs("div",{className:"max-w-md space-y-2",children:[c.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Add repository guidance for your agents"}),c.jsxs("p",{className:"text-xs leading-5 text-muted-foreground/80",children:["This works like a ",c.jsx("code",{children:"CLAUDE.md"})," or ",c.jsx("code",{children:"AGENTS.md"})," file: describe build commands, test workflow, code conventions, and repo-specific rules."]})]})})]}),_&&c.jsx("div",{className:"border-t bg-destructive/5 px-4 py-2 text-xs text-destructive",children:_})]}),c.jsx(xg,{className:"shrink-0 border-t px-4 py-3",children:c.jsxs("div",{className:"flex w-full items-center justify-between",children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(we,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",disabled:v||u,onClick:E,children:[v?c.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):c.jsx(L2,{className:"h-3.5 w-3.5"}),"Generate template"]}),w&&c.jsxs(we,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs",onClick:A,children:[c.jsx(NY,{className:"h-3.5 w-3.5"}),"Reset"]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(we,{variant:"ghost",size:"sm",className:"text-xs",onClick:()=>r(!1),children:"Cancel"}),c.jsxs(we,{size:"sm",className:"gap-1.5 text-xs",disabled:!w||f||u,onClick:j,children:[f?c.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):c.jsx(P2,{className:"h-3.5 w-3.5"}),"Save"]})]})]})})]})})}const mit={proposed:{label:"Proposed",color:"text-blue-600 dark:text-blue-400",bg:"bg-blue-500/10"},approved:{label:"Ready",color:"text-green-600 dark:text-green-400",bg:"bg-green-500/10"},running:{label:"Running",color:"text-amber-600 dark:text-amber-400",bg:"bg-amber-500/10"},completed:{label:"Done",color:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-500/10"},skipped:{label:"Skipped",color:"text-muted-foreground",bg:"bg-muted/50"}};function git({status:e}){const r=mit[e];return c.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-2xs font-medium ${r.color} ${r.bg}`,children:r.label})}function yit({open:e,onOpenChange:r,repoId:n,repoName:i,defaultBranch:s,repoLocalPath:a,provider:o,model:l,onStartThread:d}){const u=bg(),[h,f]=y.useState([]),[g,v]=y.useState(null),[b,_]=y.useState(!1),[S,w]=y.useState(!1),[C,j]=y.useState(null),[E,A]=y.useState(""),[N,R]=y.useState(new Set),[B,G]=y.useState(null),[H,z]=y.useState(""),[W,I]=y.useState(""),O=h.find(re=>re.id===g)??h[0]??null;y.useEffect(()=>{if(!e||!n)return;let re=!1;return _(!0),j(null),pr.listPlans(n).then(fe=>{re||(f(fe),fe.length>0&&!g&&v(fe[0].id))}).catch(fe=>{re||j(fe instanceof Error?fe.message:"Failed to load plans")}).finally(()=>{re||_(!1)}),()=>{re=!0}},[e,n]);const D=y.useCallback(async()=>{j(null);try{const re=await pr.createPlan(n,{title:"New Plan"});f(fe=>[re,...fe]),v(re.id)}catch(re){j(re instanceof Error?re.message:"Failed to create plan")}},[n]),P=y.useCallback(async()=>{if(O){w(!0),j(null);try{const re=await pr.generatePlanTasks(O.id,{prompt:E||void 0,provider:o,model:o==="jait"?null:l??null});f(fe=>fe.map(me=>me.id===re.plan.id?re.plan:me)),A("")}catch(re){j(re instanceof Error?re.message:"Failed to generate tasks")}finally{w(!1)}}},[O,E,l,o]),$=y.useCallback(async(re,fe)=>{if(!O)return;const me=O.tasks.map(_e=>_e.id===re?{..._e,status:fe}:_e);try{const _e=await pr.updatePlan(O.id,{tasks:me});f(ge=>ge.map(Ve=>Ve.id===_e.id?_e:Ve))}catch(_e){j(_e instanceof Error?_e.message:"Failed to update task")}},[O]),V=y.useCallback(async re=>{if(!O)return;const fe=O.tasks.filter(me=>me.id!==re);try{const me=await pr.updatePlan(O.id,{tasks:fe});f(_e=>_e.map(ge=>ge.id===me.id?me:ge))}catch(me){j(me instanceof Error?me.message:"Failed to remove task")}},[O]),K=y.useCallback(async()=>{if(!O||!B)return;const re=O.tasks.map(fe=>fe.id===B?{...fe,title:H,description:W}:fe);try{const fe=await pr.updatePlan(O.id,{tasks:re});f(me=>me.map(_e=>_e.id===fe.id?fe:_e)),G(null)}catch(fe){j(fe instanceof Error?fe.message:"Failed to save task")}},[O,B,H,W]),F=y.useCallback(async re=>{if(O){j(null);try{await pr.startPlanTask(O.id,re.id),d(re,O,{name:i,localPath:a,defaultBranch:s}),f(fe=>fe.map(me=>me.id===O.id?{...me,tasks:me.tasks.map(_e=>_e.id===re.id?{..._e,status:"running"}:_e)}:me))}catch(fe){j(fe instanceof Error?fe.message:"Failed to start task")}}},[O,i,a,s,d]),U=y.useCallback(async()=>{if(!O)return;j(null);const re=O.tasks.filter(me=>me.status==="approved"||me.status==="proposed");if(re.length===0){j("No tasks to start. Approve some tasks first, or generate new ones.");return}const fe=O.tasks.map(me=>me.status==="proposed"?{...me,status:"approved"}:me);try{const me=await pr.updatePlan(O.id,{tasks:fe,status:"active"});f(_e=>_e.map(ge=>ge.id===me.id?me:ge))}catch{}for(const me of re)try{d(me,O,{name:i,localPath:a,defaultBranch:s}),f(_e=>_e.map(ge=>ge.id===O.id?{...ge,tasks:ge.tasks.map(Ve=>Ve.id===me.id?{...Ve,status:"running"}:Ve)}:ge)),await new Promise(_e=>setTimeout(_e,500))}catch{}},[O,i,a,s,d]),Q=y.useCallback(async()=>{if(!(!O||!await u({title:"Delete plan",description:`Delete plan "${O.title}"?`,confirmLabel:"Delete",variant:"destructive"})))try{await pr.deletePlan(O.id),f(fe=>fe.filter(me=>me.id!==O.id)),v(null)}catch(fe){j(fe instanceof Error?fe.message:"Failed to delete plan")}},[O,u]),q=re=>{R(fe=>{const me=new Set(fe);return me.has(re)?me.delete(re):me.add(re),me})},te=re=>{G(re.id),z(re.title),I(re.description),R(fe=>new Set(fe).add(re.id))},ee=(O==null?void 0:O.tasks.filter(re=>re.status==="approved"||re.status==="proposed").length)??0,se=(O==null?void 0:O.tasks.filter(re=>re.status==="completed").length)??0,ae=(O==null?void 0:O.tasks.length)??0;return c.jsx(Pl,{open:e,onOpenChange:r,children:c.jsxs(al,{className:"flex max-h-[85vh] w-full max-w-2xl flex-col gap-0 overflow-hidden p-0",children:[c.jsx(xc,{className:"shrink-0 border-b px-4 py-3",children:c.jsxs(ol,{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{children:"Plans"}),c.jsx("span",{className:"text-muted-foreground",children:"—"}),c.jsx("span",{className:"font-normal text-muted-foreground",children:i}),O&&ae>0&&c.jsxs("span",{className:"ml-auto text-2xs text-muted-foreground",children:[se,"/",ae," done"]})]})}),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[b?c.jsx("div",{className:"flex flex-1 items-center justify-center py-12",children:c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):O?c.jsxs(c.Fragment,{children:[h.length>1&&c.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-2",children:[c.jsx("select",{className:"flex-1 rounded border bg-transparent px-2 py-1 text-xs",value:O.id,onChange:re=>v(re.target.value),children:h.map(re=>c.jsxs("option",{value:re.id,children:[re.title," (",re.tasks.length," tasks)"]},re.id))}),c.jsx(we,{variant:"ghost",size:"sm",className:"h-6 px-2 text-2xs",onClick:D,children:c.jsx(Zs,{className:"h-3 w-3"})})]}),c.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-2",children:[c.jsx(Ln,{placeholder:"Describe what you want to accomplish…",className:"h-8 flex-1 text-xs",value:E,onChange:re=>A(re.target.value),onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),P())}}),c.jsxs(we,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:S,onClick:()=>void P(),children:[S?c.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):c.jsx(L2,{className:"h-3.5 w-3.5"}),"Generate"]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:O.tasks.length===0?c.jsx("div",{className:"flex flex-col items-center justify-center gap-2 py-8",children:c.jsx("p",{className:"text-xs text-muted-foreground",children:"No tasks yet. Use the prompt above to generate tasks, or add them manually."})}):c.jsx("div",{className:"divide-y",children:O.tasks.map(re=>{const fe=N.has(re.id),me=B===re.id,_e=re.status==="proposed"||re.status==="approved",ge=re.status==="proposed"||re.status==="approved";return c.jsxs("div",{className:"px-4 py-2.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground hover:text-foreground",onClick:()=>q(re.id),children:fe?c.jsx(Dl,{className:"h-3.5 w-3.5"}):c.jsx(js,{className:"h-3.5 w-3.5"})}),c.jsx(git,{status:re.status}),me?c.jsx(Ln,{className:"h-6 flex-1 text-xs",value:H,onChange:Ve=>z(Ve.target.value),onKeyDown:Ve=>{Ve.key==="Enter"&&K(),Ve.key==="Escape"&&G(null)},autoFocus:!0}):c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c.jsx("span",{className:`min-w-0 flex-1 truncate text-xs ${re.status==="skipped"?"line-through text-muted-foreground":"font-medium"}`,children:re.title}),re.skillCandidate&&c.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-medium text-violet-600 dark:text-violet-400",children:"skill"})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[_e&&c.jsx("button",{type:"button",title:"Start thread",className:"rounded p-1 text-green-600 hover:bg-green-500/10 dark:text-green-400",onClick:()=>void F(re),children:c.jsx(US,{className:"h-3.5 w-3.5",fill:"currentColor"})}),re.status==="proposed"&&c.jsx("button",{type:"button",title:"Approve",className:"rounded p-1 text-green-600 hover:bg-green-500/10 dark:text-green-400",onClick:()=>void $(re.id,"approved"),children:c.jsx(gs,{className:"h-3.5 w-3.5"})}),ge&&c.jsx("button",{type:"button",title:"Skip",className:"rounded p-1 text-muted-foreground hover:bg-muted",onClick:()=>void $(re.id,"skipped"),children:c.jsx(bve,{className:"h-3.5 w-3.5"})}),!me&&(re.status==="proposed"||re.status==="approved")&&c.jsx("button",{type:"button",title:"Edit",className:"rounded p-1 text-muted-foreground hover:bg-muted",onClick:()=>te(re),children:c.jsx(SR,{className:"h-3 w-3"})}),me&&c.jsx("button",{type:"button",title:"Save",className:"rounded p-1 text-green-600 hover:bg-green-500/10",onClick:()=>void K(),children:c.jsx(gs,{className:"h-3.5 w-3.5"})}),(re.status==="proposed"||re.status==="approved"||re.status==="skipped")&&c.jsx("button",{type:"button",title:"Remove",className:"rounded p-1 text-muted-foreground hover:text-destructive",onClick:()=>void V(re.id),children:c.jsx(Rl,{className:"h-3 w-3"})})]})]}),fe&&c.jsxs("div",{className:"mt-2 pl-6",children:[me?c.jsx("textarea",{className:"w-full rounded border bg-transparent px-2 py-1.5 text-xs leading-relaxed focus:outline-none focus:ring-1 focus:ring-primary",rows:4,value:W,onChange:Ve=>I(Ve.target.value)}):c.jsx("p",{className:"whitespace-pre-wrap text-xs leading-relaxed text-muted-foreground",children:re.description||"No description."}),re.threadId&&c.jsxs("p",{className:"mt-1 text-2xs text-muted-foreground",children:["Thread: ",c.jsx("code",{className:"rounded bg-muted px-1",children:re.threadId.slice(-8)})]}),(re.skillCandidate||re.skillRationale||re.skillTitle)&&c.jsxs("div",{className:"mt-2 rounded-md border border-violet-500/20 bg-violet-500/5 px-2 py-1.5 text-[10px] text-muted-foreground",children:[c.jsxs("p",{children:["Skill eval: ",re.skillCandidate?"yes":"no",re.skillTitle?` · ${re.skillTitle}`:""]}),re.skillRationale&&c.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:re.skillRationale})]})]})]},re.id)})})})]}):c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 py-12",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"No plans yet for this repository."}),c.jsxs(we,{size:"sm",className:"gap-1.5 text-xs",onClick:D,children:[c.jsx(Zs,{className:"h-3.5 w-3.5"}),"Create plan"]})]}),C&&c.jsx("div",{className:"border-t bg-destructive/5 px-4 py-2 text-xs text-destructive",children:C})]}),c.jsx(xg,{className:"shrink-0 border-t px-4 py-3",children:c.jsxs("div",{className:"flex w-full items-center justify-between",children:[c.jsxs("div",{className:"flex gap-2",children:[!O&&c.jsxs(we,{size:"sm",className:"gap-1.5 text-xs",onClick:D,children:[c.jsx(Zs,{className:"h-3.5 w-3.5"}),"New plan"]}),O&&c.jsxs(we,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-destructive hover:text-destructive",onClick:()=>void Q(),children:[c.jsx(Rl,{className:"h-3.5 w-3.5"}),"Delete plan"]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(we,{variant:"ghost",size:"sm",className:"text-xs",onClick:()=>r(!1),children:"Close"}),O&&ee>0&&c.jsxs(we,{size:"sm",className:"gap-1.5 text-xs",onClick:()=>void U(),children:[c.jsx(cye,{className:"h-3.5 w-3.5"}),"Start all (",ee,")"]})]})]})})]})})}function vit(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;return typeof r.id!="string"||typeof r.scope!="string"||r.scope!=="project"&&r.scope!=="contact"?null:{id:r.id,scope:r.scope,source:typeof r.source=="string"?r.source:"",sourceType:typeof r.sourceType=="string"?r.sourceType:void 0,sourceId:typeof r.sourceId=="string"?r.sourceId:void 0,sourceSurface:typeof r.sourceSurface=="string"?r.sourceSurface:void 0,updatedAt:typeof r.updatedAt=="string"?r.updatedAt:"",content:typeof r.content=="string"?r.content:""}}function v8(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function O7(e){const r=e.memory&&typeof e.memory=="object"&&!Array.isArray(e.memory)?e.memory:null,n=Array.isArray(r==null?void 0:r.retrieved)?r.retrieved.map(vit).filter(s=>!!s):[],i=r?{query:typeof r.query=="string"?r.query:"",retrieved:n,injectedIds:v8(r.injectedIds),ignoredIds:v8(r.ignoredIds),savedIds:v8(r.savedIds)}:void 0;return{provider:String(e.provider??"jait"),model:typeof e.model=="string"?e.model:void 0,rounds:Array.isArray(e.rounds)?e.rounds:[],note:typeof e.note=="string"?e.note:void 0,...i?{memory:i}:{}}}function qv(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Ys(e){return typeof e=="string"&&e.trim()?e:null}function Oce(e){if(typeof e!="string")return null;try{const r=JSON.parse(e);return qv(r)}catch{return null}}function W_(...e){const r={};for(const n of e)if(n)for(const[i,s]of Object.entries(n))s!=null&&s!==""&&(r[i]=s);return r}function x8(e,r){const n=qv(e.args),i=qv(e.data),s=Oce(e.message),a=r.replace("_","."),o=W_(i,s);return Object.keys(n??{}).length>0?W_(o,n):a==="edit"||a.startsWith("file.")?W_(o,{path:Ys(e.path)??Ys(e.file)??Ys(e.name)??Ys(i==null?void 0:i.path)??Ys(i==null?void 0:i.file)??"",search:e.search??(i==null?void 0:i.search),replace:e.replace??(i==null?void 0:i.replace),content:e.content??(i==null?void 0:i.content)}):a==="web"||a.startsWith("web.")||a.startsWith("browser.")?W_(o,{url:Ys(e.url)??Ys(i==null?void 0:i.url)??Ys(i==null?void 0:i.finalUrl)??"",query:Ys(e.query)??Ys(e.name)??Ys(i==null?void 0:i.query)??"",content:e.content??(i==null?void 0:i.content)}):o}function xit(e,r){const n=Ys(e.message)??Ys(e.output)??Ys(e.content)??Ys(e.text)??Ys(e.summary);if(n)return n;const i=qv(e.data),s=Ys(i==null?void 0:i.message)??Ys(i==null?void 0:i.output)??Ys(i==null?void 0:i.content)??Ys(i==null?void 0:i.text)??Ys(i==null?void 0:i.summary);return s||r}function bit(e){const r=[];let n=null,i=[];const s=new Map;let a=[];function o(){a.length>0&&(i.push({type:"toolGroup",callIds:[...a]}),a=[])}function l(){n&&(o(),i.length>0&&(n.segments=[...i]),r.push(n),n=null,i=[])}function d(u){return(!n||n.role!=="assistant")&&(l(),n={id:u,role:"assistant",content:"",toolCalls:[]},i=[]),n}for(const u of e){const h=u.payload??{};switch(u.kind){case"message":{const f=h.role,g=typeof h.content=="string"?h.content:u.summary,v=Array.isArray(h.referencedFiles)?h.referencedFiles.flatMap(_=>{if(!_||typeof _!="object")return[];const S=typeof _.path=="string"?_.path:null,w=typeof _.name=="string"?_.name:null;return S&&w?[{path:S,name:w}]:[]}):void 0,b=mj(h.displaySegments);if(f==="user")l(),r.push({id:u.id,role:"user",content:g,displayContent:b.length>0?J0(b):g,referencedFiles:v,displaySegments:b.length>0?b:void 0});else{const _=d(u.id);o();const S=g??"";S&&(_.content+=(_.content?`
|
|
1228
1228
|
`:"")+S,i.push({type:"text",content:S}))}break}case"tool.start":{const f=d(u.id),g=h.callId??u.id,v=h.tool??"unknown";if(s.has(g))break;const b={callId:g,parentCallId:h.parentCallId,tool:v,args:nu(v,x8(h,v)),status:"running",startedAt:new Date(u.createdAt).getTime()};f.toolCalls=f.toolCalls??[],f.toolCalls.push(b),s.set(g,b),a.push(g);break}case"tool.output":{const f=h.callId;if(f&&s.has(f)){const g=s.get(f);g.streamingOutput=(g.streamingOutput??"")+(h.content??"")}break}case"tool.result":case"tool.error":{const f=h.callId,g=h.tool??"unknown",v=typeof h.ok=="boolean"?h.ok:u.kind==="tool.result",b=xit(h,u.summary),_=h.data!==void 0?h.data:Oce(h.message);let S=f?s.get(f):void 0;if(!S){const w=d(u.id),C=f??u.id;S={callId:C,parentCallId:h.parentCallId,tool:g,args:nu(g,x8(h,g),qv(_)??void 0),status:v?"success":"error",startedAt:new Date(u.createdAt).getTime()},w.toolCalls=w.toolCalls??[],w.toolCalls.push(S),s.set(C,S),a.push(C)}S.args=nu(S.tool,W_(S.args,x8(h,g)),qv(_)??void 0),S.parentCallId=S.parentCallId??h.parentCallId,S.status=v?"success":"error",S.result={ok:v,message:b,..._!==void 0?{data:_}:{}},S.completedAt=new Date(u.createdAt).getTime();break}case"tool.approval":{const f=d(u.id),g=h.requestId??u.id,v={callId:g,parentCallId:h.parentCallId,tool:h.tool??"unknown",args:nu(String(h.tool??"unknown"),h.args??{}),status:"pending",startedAt:new Date(u.createdAt).getTime()};f.toolCalls=f.toolCalls??[],f.toolCalls.push(v),s.set(g,v),a.push(g);break}case"skill.active":{const f=d(u.id),g=Array.isArray(h.names)?h.names.join(", "):"unknown",v=Array.isArray(h.skills)?h.skills:[],b=u.id,_={callId:b,parentCallId:h.parentCallId,tool:"skill",args:{skills:v.map(S=>S.name).join(", ")},status:"success",startedAt:new Date(u.createdAt).getTime(),completedAt:new Date(u.createdAt).getTime(),result:{ok:!0,message:`Using skills: ${g}`}};f.toolCalls=f.toolCalls??[],f.toolCalls.push(_),s.set(b,_),a.push(b);break}case"context_flow":{const f=O7(h),g=n;if(g&&g.role==="assistant")g.contextFlow=f;else for(let v=r.length-1;v>=0;v--){const b=r[v];if(b&&b.role==="assistant"){b.contextFlow=f;break}}break}case"session":{l();break}case"error":{const f=d(u.id);o();const g=`**Error:** ${u.summary}`;f.content+=(f.content?`
|
|
1229
1229
|
`:"")+g,i.push({type:"text",content:g});break}case"thinking":{const f=typeof h.content=="string"?h.content:typeof h.text=="string"?h.text:typeof h.message=="string"?h.message:u.summary;if(f){const g=d(u.id);o(),g.thinking=(g.thinking??"")+f;const v=i[i.length-1];(v==null?void 0:v.type)==="thinking"?v.content+=f:i.push({type:"thinking",content:f})}break}default:{const g=(typeof h.content=="string"?h.content:typeof h.text=="string"?h.text:typeof h.message=="string"?h.message:null)??(u.kind==="activity"?u.summary:null);if(h.role==="user"&&g)l(),r.push({id:u.id,role:"user",content:g});else if(g){const b=d(u.id);o(),b.content+=(b.content?`
|
|
1230
|
-
`:"")+g,i.push({type:"text",content:g})}break}}}return l(),r}const yU=qn(),vU={core:{variant:"default",label:"core"},standard:{variant:"secondary",label:"standard"},external:{variant:"warning",label:"external"}},xU=["meta","terminal","filesystem","os","agent","browser","web","surfaces","scheduler","memory","voice","screen","gateway","external"];function _it({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(!1),[l,d]=y.useState(null),[u,h]=y.useState("");y.useEffect(()=>{if(!e)return;let S=!1;return(async()=>{try{const w=await fetch(`${yU}/api/auth/settings/tools`,{headers:{Authorization:`Bearer ${e}`}});if(!S)if(w.ok){const C=await w.json();n(C.tools)}else d(`Failed to load tools (${w.status})`)}catch{S||d("Failed to load tools")}finally{S||s(!1)}})(),()=>{S=!0}},[e]);const f=y.useCallback(async(S,w)=>{if(e){n(C=>C.map(j=>j.name===S?{...j,enabled:w}:j)),o(!0),d(null);try{const C=r.map(E=>E.name===S?{...E,enabled:w}:E).filter(E=>!E.enabled&&!E.locked).map(E=>E.name);if(!(await fetch(`${yU}/api/auth/settings/tools`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({disabled_tools:C})})).ok)throw new Error("Failed to save")}catch{n(C=>C.map(j=>j.name===S?{...j,enabled:!w}:j)),d("Failed to update tool setting")}finally{o(!1)}}},[e,r]),g=new Map,v=u.trim().toLowerCase();for(const S of r){if(v&&!`${S.name} ${S.description} ${S.category}`.toLowerCase().includes(v))continue;const w=S.category;g.has(w)||g.set(w,[]),g.get(w).push(S)}const b=[...g.keys()].sort((S,w)=>{const C=xU.indexOf(S),j=xU.indexOf(w);return(C===-1?999:C)-(j===-1?999:j)}),_={total:r.length,enabled:r.filter(S=>S.enabled).length,core:r.filter(S=>S.tier==="core").length,standard:r.filter(S=>S.tier==="standard").length,external:r.filter(S=>S.tier==="external").length};return i?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."})}):c.jsxs(Zr,{className:"p-5 space-y-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:"Tools"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage which tools are available to the AI agent. Core tools are always enabled. Standard tools can be toggled. External (MCP) tools are discovered on demand."})]}),c.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(W4,{className:"h-3.5 w-3.5"}),_.core," core"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(kR,{className:"h-3.5 w-3.5"}),_.standard," standard"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(R2,{className:"h-3.5 w-3.5"}),_.external," external"]}),c.jsxs("span",{className:"ml-auto",children:[_.enabled,"/",_.total," enabled"]})]}),c.jsxs("div",{className:"relative",children:[c.jsx(rl,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Ln,{placeholder:"Filter tools...",value:u,onChange:S=>h(S.target.value),className:"pl-9"})]}),l&&c.jsx("p",{className:"text-sm text-destructive",children:l}),c.jsxs("div",{className:"space-y-5",children:[b.map(S=>{const w=g.get(S);return c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide mb-2",children:S}),c.jsx("div",{className:"space-y-1",children:w.map(C=>{const j=vU[C.tier]??vU.standard;return c.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded-md hover:bg-muted/50 transition-colors",children:[c.jsx(gf,{checked:C.enabled,onCheckedChange:E=>{f(C.name,E)},disabled:C.locked||a,"aria-label":`Toggle ${C.name}`}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-mono text-sm font-medium",children:C.name}),c.jsx(Ar,{variant:j.variant,className:"text-2xs px-1.5 py-0",children:j.label}),C.source==="mcp"&&c.jsx(Ar,{variant:"outline",className:"text-2xs px-1.5 py-0",children:"MCP"})]}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.name)})})]},S)}),b.length===0&&c.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:v?"No tools match your filter.":"No tools available."})]})]})}const U_=qn(),wit={installed:{variant:"secondary",label:"installed"},enabled:{variant:"default",label:"enabled"},disabled:{variant:"outline",label:"disabled"},error:{variant:"destructive",label:"error"}};function Mce(e){return y.useCallback(()=>{const r={};return e&&(r.Authorization=`Bearer ${e}`),r},[e])}function Sit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),[l,d]=y.useState(""),[u,h]=y.useState(null),f=Mce(e),g=y.useCallback(async()=>{s(!0),o(null);try{const C=await fetch(`${U_}/api/plugins`,{headers:f()});if(!C.ok)throw new Error(`Failed to load extensions (HTTP ${C.status})`);const j=await C.json();n(j)}catch(C){o(C instanceof Error?C.message:"Failed to load extensions")}finally{s(!1)}},[f]);y.useEffect(()=>{g()},[g]);const v=y.useCallback(async(C,j)=>{h(C);try{const E=j?"enable":"disable",A=await fetch(`${U_}/api/plugins/${encodeURIComponent(C)}/${E}`,{method:"POST",headers:f()});if(!A.ok){const N=await A.json().catch(()=>({}));throw new Error(N.error??`Failed to ${E} (HTTP ${A.status})`)}await g()}catch(E){o(E instanceof Error?E.message:"Action failed")}finally{h(null)}},[f,g]),b=y.useCallback(async C=>{h(C);try{const j=await fetch(`${U_}/api/plugins/${encodeURIComponent(C)}`,{method:"DELETE",headers:f()});if(!j.ok){const E=await j.json().catch(()=>({}));throw new Error(E.error??`Failed to uninstall (HTTP ${j.status})`)}await g()}catch(j){o(j instanceof Error?j.message:"Action failed")}finally{h(null)}},[f,g]),_=y.useCallback(async()=>{s(!0);try{const C=await fetch(`${U_}/api/plugins/scan`,{method:"POST",headers:f()});if(!C.ok)throw new Error(`Scan failed (HTTP ${C.status})`);const j=await C.json();n(j)}catch(C){o(C instanceof Error?C.message:"Scan failed")}finally{s(!1)}},[f]),S=l.toLowerCase(),w=r.filter(C=>S?C.id.toLowerCase().includes(S)||C.displayName.toLowerCase().includes(S)||(C.description??"").toLowerCase().includes(S)||(C.author??"").toLowerCase().includes(S):!0);return i&&r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading extensions..."})}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(rl,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:l,onChange:C=>d(C.target.value),placeholder:"Filter extensions...",className:"pl-9"})]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void _(),disabled:i,children:[c.jsx(Js,{className:`mr-1.5 h-3.5 w-3.5 ${i?"animate-spin":""}`}),"Scan"]})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),w.length===0&&!i&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(R2,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:r.length===0?"No extensions installed. Drop plugin folders into ~/.jait/extensions/ and click Scan.":"No extensions match your filter."})]}),w.map(C=>{const j=wit[C.status],E=C.status==="enabled",A=u===C.id;return c.jsxs(Zr,{className:"flex items-start gap-4 p-4",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(R2,{className:"h-5 w-5 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:C.displayName}),c.jsx(Ar,{variant:j.variant,className:"text-2xs",children:j.label}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",C.version]})]}),C.description&&c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:C.description}),C.author&&c.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["by ",C.author]}),C.error&&c.jsx("p",{className:"mt-1 text-xs text-destructive",children:C.error}),c.jsx("p",{className:"mt-0.5 text-2xs text-muted-foreground/60 font-mono",children:C.id})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx(gf,{checked:E,disabled:A,onCheckedChange:N=>void v(C.id,N),"aria-label":E?"Disable":"Enable"}),c.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",disabled:A,onClick:()=>void b(C.id),title:"Uninstall",children:c.jsx(Rl,{className:"h-4 w-4"})})]})]},C.id)})]})}function kit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),l=Mce(e),d=y.useCallback(async()=>{s(!0),o(null);try{const u=await fetch(`${U_}/api/store/packages?limit=50`,{headers:l()});if(!u.ok)throw new Error(`Failed to browse ClawHub (HTTP ${u.status})`);const h=await u.json();n(h.items??[])}catch(u){o(u instanceof Error?u.message:"Failed to load marketplace")}finally{s(!1)}},[l]);return y.useEffect(()=>{d()},[d]),c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Zr,{className:"bg-muted/30 p-4 text-sm text-muted-foreground",children:["Browse OpenClaw plugins on"," ",c.jsx("a",{href:"https://clawhub.ai/plugins",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"ClawHub"}),". To install, download the plugin and place it in"," ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.jait/extensions/"}),", then click Scan on the Installed tab."]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),i&&r.length===0&&c.jsxs(Zr,{className:"flex items-center justify-center gap-2 p-8",children:[c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading from ClawHub..."})]}),!i&&r.length===0&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(R2,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"No packages available."})]}),r.map((u,h)=>{const f=u.displayName??u.name??"Unknown",g=u.description??"",v=u.type??"plugin";return c.jsxs(Zr,{className:"flex items-start gap-3 p-4",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(R2,{className:"h-4 w-4 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:f}),u.version&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",u.version]}),c.jsx(Ar,{variant:"outline",className:"text-2xs",children:v})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:g}),u.author&&c.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["by @",u.author]})]}),c.jsx("a",{href:`https://clawhub.ai/plugins/${encodeURIComponent(u.name??"")}`,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(we,{variant:"outline",size:"sm",className:"h-7 text-xs",children:[c.jsx(jp,{className:"mr-1 h-3 w-3"}),"View"]})})]},u.name??h)})]})}function Cit({token:e}){return c.jsxs(Y0,{defaultValue:"installed",className:"space-y-4",children:[c.jsxs(Zr,{className:"space-y-3 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:"Extensions"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Manage plugins and extensions. Browse the"," ",c.jsx("a",{href:"https://clawhub.ai/plugins",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"ClawHub"})," ","marketplace or drop plugins into"," ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.jait/extensions/"}),"."]})]}),c.jsxs(ag,{children:[c.jsx(Qs,{value:"installed",children:"Installed"}),c.jsx(Qs,{value:"marketplace",children:"Marketplace"})]})]}),c.jsx(ea,{value:"installed",className:"mt-0 space-y-4",children:c.jsx(Sit,{token:e})}),c.jsx(ea,{value:"marketplace",className:"mt-0 space-y-4",children:c.jsx(kit,{token:e})})]})}const S2=qn();function bU(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}const _U={bundled:{variant:"default",label:"bundled"},user:{variant:"secondary",label:"user"},project:{variant:"outline",label:"project"},plugin:{variant:"secondary",label:"plugin"}};function Rce(e){return y.useCallback(()=>{const r={"Content-Type":"application/json"};return e&&(r.Authorization=`Bearer ${e}`),r},[e])}function jit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),[l,d]=y.useState(""),[u,h]=y.useState(null),[f,g]=y.useState(null),v=Rce(e),b=y.useCallback(async()=>{s(!0),o(null);try{const j=await fetch(`${S2}/api/skills`,{headers:v()});if(!j.ok)throw new Error(`Failed to load skills (HTTP ${j.status})`);const E=await j.json();n(E)}catch(j){o(j instanceof Error?j.message:"Failed to load skills")}finally{s(!1)}},[v]);y.useEffect(()=>{b()},[b]);const _=y.useCallback(async(j,E)=>{h(j);try{const A=await fetch(`${S2}/api/skills/${encodeURIComponent(j)}`,{method:"PATCH",headers:v(),body:JSON.stringify({enabled:E})});if(!A.ok)throw new Error(`Failed to update skill (HTTP ${A.status})`);n(N=>N.map(R=>R.id===j?{...R,enabled:E}:R))}catch(A){o(A instanceof Error?A.message:"Action failed")}finally{h(null)}},[v]),S=y.useCallback(async j=>{g(j),o(null);try{const E=await fetch(`${S2}/api/skills/${encodeURIComponent(j)}/install-tool`,{method:"POST",headers:v(),body:JSON.stringify({})}),A=await E.json().catch(()=>({}));if(!E.ok)throw new Error(A.error??`Install failed (HTTP ${E.status})`);const N=A.skill;N?n(R=>R.map(B=>B.id===j?N:B)):await b()}catch(E){o(E instanceof Error?E.message:"Install failed")}finally{g(null)}},[v,b]),w=l.toLowerCase(),C=r.filter(j=>w?j.id.toLowerCase().includes(w)||j.name.toLowerCase().includes(w)||j.description.toLowerCase().includes(w)||j.source.includes(w):!0);return i&&r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading skills..."})}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx(rl,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:l,onChange:j=>d(j.target.value),placeholder:"Filter installed skills...",className:"pl-9"})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),C.length===0&&!i&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(W5,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:r.length===0?"No skills discovered. Install from the Marketplace or create a SKILL.md in ~/.jait/skills/.":"No skills match your filter."})]}),C.map(j=>{var N;const E=_U[j.source]??_U.user,A=u===j.id;return c.jsxs(Zr,{className:"flex items-start gap-3 p-4",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(W5,{className:"h-4 w-4 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:j.name}),c.jsx(Ar,{variant:E.variant,className:"text-2xs",children:E.label})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:j.description}),c.jsx("p",{className:"mt-0.5 text-2xs text-muted-foreground/60 font-mono truncate",children:j.filePath}),j.missingTools&&j.missingTools.length>0&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"flex items-center gap-1 text-2xs text-amber-600 dark:text-amber-500",children:[c.jsx(na,{className:"h-3 w-3"}),"Needs: ",j.missingTools.join(", ")]}),j.install&&j.install.length>0&&c.jsxs(we,{size:"sm",variant:"outline",disabled:f===j.id,onClick:()=>void S(j.id),className:"h-6 text-2xs",children:[f===j.id?c.jsx(Ft,{className:"mr-1 h-3 w-3 animate-spin"}):c.jsx(gp,{className:"mr-1 h-3 w-3"}),((N=j.install[0])==null?void 0:N.label)??"Install tool"]})]})]}),c.jsx(gf,{checked:j.enabled,disabled:A,onCheckedChange:R=>void _(j.id,R),"aria-label":j.enabled?"Disable":"Enable",className:"shrink-0"})]},j.id)})]})}function Nit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),[l,d]=y.useState(""),[u,h]=y.useState("tool workflow agent"),[f,g]=y.useState(null),v=y.useRef(null),b=Rce(e),_=y.useCallback(async(C,j)=>{s(!0),o(null);try{const E=new URLSearchParams;C?E.set("q",C):E.set("sort",j??"tool workflow agent"),E.set("limit","25");const A=await fetch(`${S2}/api/store/skills?${E}`,{headers:b()});if(!A.ok)throw new Error(`Failed to browse ClawHub (HTTP ${A.status})`);const N=await A.json();n(N.results??[])}catch(E){o(E instanceof Error?E.message:"Failed to load marketplace")}finally{s(!1)}},[b]);y.useEffect(()=>{_(void 0,u)},[_,u]);const S=y.useCallback(C=>{d(C),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{_(C||void 0,u)},400)},[_,u]),w=y.useCallback(async C=>{g(C),o(null);try{const j=await fetch(`${S2}/api/store/skills/${encodeURIComponent(C)}/install`,{method:"POST",headers:b(),body:JSON.stringify({})});if(!j.ok){const E=await j.json().catch(()=>({}));throw new Error(E.error??`Install failed (HTTP ${j.status})`)}n(E=>E.map(A=>A.slug===C?{...A,installed:!0}:A))}catch(j){o(j instanceof Error?j.message:"Install failed")}finally{g(null)}},[b]);return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(rl,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:l,onChange:C=>S(C.target.value),placeholder:"Search ClawHub skills...",className:"pl-9"})]}),c.jsxs("select",{value:u,onChange:C=>h(C.target.value),className:"h-9 rounded-md border bg-background px-3 text-sm",children:[c.jsx("option",{value:"tool workflow agent",children:"Popular"}),c.jsx("option",{value:"memory learning self-improving",children:"Memory"}),c.jsx("option",{value:"search web browser automation",children:"Search"}),c.jsx("option",{value:"git github code development",children:"Development"}),c.jsx("option",{value:"calendar slack obsidian productivity",children:"Productivity"})]})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),i&&r.length===0&&c.jsxs(Zr,{className:"flex items-center justify-center gap-2 p-8",children:[c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading from ClawHub..."})]}),!i&&r.length===0&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(rl,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:l?"No skills match your search.":"No skills available."})]}),r.map(C=>{var z,W,I;const j=C.slug??"",E=C.displayName??j,A=C.summary??"",N=((z=C.latestVersion)==null?void 0:z.version)??C.version??"",R=((W=C.stats)==null?void 0:W.stars)??0,B=((I=C.stats)==null?void 0:I.downloads)??0,G=C.installed===!0,H=f===j;return c.jsxs(Zr,{className:"flex items-start gap-3 p-4",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(W5,{className:"h-4 w-4 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:E}),N&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",N]})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:A}),c.jsxs("div",{className:"mt-1 flex items-center gap-3 text-xs text-muted-foreground",children:[R>0&&c.jsxs("span",{className:"flex items-center gap-0.5",children:[c.jsx(Nve,{className:"h-3 w-3"}),bU(R)]}),B>0&&c.jsxs("span",{className:"flex items-center gap-0.5",children:[c.jsx(gp,{className:"h-3 w-3"}),bU(B)]}),c.jsxs("a",{href:`https://clawhub.ai/skills?focus=search&q=${encodeURIComponent(j)}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-0.5 hover:text-foreground",children:[c.jsx(jp,{className:"h-3 w-3"}),"ClawHub"]})]})]}),c.jsx("div",{className:"shrink-0",children:G?c.jsxs(Ar,{variant:"secondary",className:"flex items-center gap-1 text-2xs",children:[c.jsx(gs,{className:"h-3 w-3"}),"Installed"]}):c.jsxs(we,{size:"sm",variant:"outline",disabled:H,onClick:()=>void w(j),className:"h-7 text-xs",children:[H?c.jsx(Ft,{className:"mr-1 h-3 w-3 animate-spin"}):c.jsx(gp,{className:"mr-1 h-3 w-3"}),"Install"]})})]},j)})]})}function Tit({token:e}){return c.jsxs(Y0,{defaultValue:"installed",className:"space-y-4",children:[c.jsxs(Zr,{className:"space-y-3 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:"Skills"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Specialized instruction sets that teach the AI how to use specific tools and workflows. Install from"," ",c.jsx("a",{href:"https://clawhub.ai/skills",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"ClawHub"})," ","or place SKILL.md files in"," ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.jait/skills/"}),"."]})]}),c.jsxs(ag,{children:[c.jsx(Qs,{value:"installed",children:"Installed"}),c.jsx(Qs,{value:"marketplace",children:"Marketplace"})]})]}),c.jsx(ea,{value:"installed",className:"mt-0 space-y-4",children:c.jsx(jit,{token:e})}),c.jsx(ea,{value:"marketplace",className:"mt-0 space-y-4",children:c.jsx(Nit,{token:e})})]})}const V_=qn();function q_(e){return e?{Authorization:`Bearer ${e}`}:{}}const Eit={stopped:{label:"Disconnected",variant:"outline"},connecting:{label:"Connecting…",variant:"secondary"},qr:{label:"Scan QR to link",variant:"secondary"},connected:{label:"Connected",variant:"default"},error:{label:"Error",variant:"destructive"}};function Ait(e){return e.id==="whatsapp"?"Link your WhatsApp so the assistant can reply to messages. Scan the QR with WhatsApp Linked devices.":e.id==="msteams"?"Connect a Microsoft Teams bot so the assistant can reply to Teams conversations.":"Connect this messaging channel so the assistant can reply through it."}function Oit({token:e,channel:r,onChanged:n}){const[i,s]=y.useState(!1),[a,o]=y.useState(null),[l,d]=y.useState(r.qr),[u,h]=y.useState(r.status),[f,g]=y.useState(),[v,b]=y.useState((r.config.allowedSenders??[]).join(", ")),[_,S]=y.useState(!!r.config.respondToAll),w=y.useRef(null),C=y.useCallback(()=>{w.current&&(clearInterval(w.current),w.current=null)},[]);y.useEffect(()=>{if(u!=="qr"&&u!=="connecting"){C();return}if(!w.current)return w.current=setInterval(async()=>{try{const B=await fetch(`${V_}/api/channels/${r.id}/status`,{headers:q_(e)});if(!B.ok)return;const G=await B.json();h(G.status),d(G.qr),g(G.error),G.status==="connected"&&(C(),n()),G.status==="error"&&C()}catch{}},2e3),C},[u,r.id,e,C,n]),y.useEffect(()=>()=>C(),[C]);const j=y.useCallback(async()=>{s(!0),o(null);try{const B=await fetch(`${V_}/api/channels/${r.id}/start`,{method:"POST",headers:q_(e)}),G=await B.json().catch(()=>({}));if(!B.ok)throw new Error(G.error??`Failed to start (HTTP ${B.status})`);h(G.status??"connecting"),d(G.qr??null)}catch(B){o(B instanceof Error?B.message:"Failed to start")}finally{s(!1)}},[r.id,e]),E=y.useCallback(async()=>{s(!0),o(null);try{const B=await fetch(`${V_}/api/channels/${r.id}/stop`,{method:"POST",headers:q_(e)});if(!B.ok)throw new Error(`Failed to stop (HTTP ${B.status})`);h("stopped"),d(null),C()}catch(B){o(B instanceof Error?B.message:"Failed to stop")}finally{s(!1)}},[r.id,e,C]),A=y.useCallback(async()=>{s(!0),o(null);try{const B=v.split(",").map(H=>H.trim()).filter(Boolean),G=await fetch(`${V_}/api/channels/${r.id}/config`,{method:"PATCH",headers:{...q_(e),"Content-Type":"application/json"},body:JSON.stringify({allowedSenders:B,respondToAll:_})});if(!G.ok)throw new Error(`Failed to save (HTTP ${G.status})`)}catch(B){o(B instanceof Error?B.message:"Failed to save")}finally{s(!1)}},[v,_,r.id,e]),N=Eit[u],R=u==="qr";return c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:c.jsx(C1e,{className:"h-5 w-5"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:r.label}),c.jsx(Ar,{variant:N.variant,className:"text-2xs",children:N.label})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:Ait(r)})]}),c.jsx("div",{className:"shrink-0",children:u==="connected"?c.jsxs(we,{size:"sm",variant:"outline",disabled:i,onClick:()=>void E(),className:"h-8 text-xs",children:[i?c.jsx(Ft,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):c.jsx(tve,{className:"mr-1 h-3.5 w-3.5"}),"Disconnect"]}):c.jsxs(we,{size:"sm",disabled:i,onClick:()=>void j(),className:"h-8 text-xs",children:[i?c.jsx(Ft,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):c.jsx(jY,{className:"mr-1 h-3.5 w-3.5"}),u==="qr"||u==="connecting"?"Restart":"Connect"]})})]}),(a||f)&&c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsx("span",{children:a??f})]}),R&&c.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border bg-muted/30 p-5",children:[l?c.jsx("img",{src:l,alt:`${r.label} link QR code`,className:"h-56 w-56 rounded bg-white p-2"}):c.jsx("div",{className:"flex h-56 w-56 items-center justify-center",children:c.jsx(Ft,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),c.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(Js,{className:"h-3 w-3"})," QR refreshes automatically — scan it with your phone."]})]}),u==="connected"&&c.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-emerald-500/40 bg-emerald-500/5 p-3 text-sm text-emerald-700 dark:text-emerald-400",children:[c.jsx(ia,{className:"h-4 w-4"})," Linked. The assistant will reply based on the rules below."]}),c.jsxs("div",{className:"space-y-3 border-t pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium",children:"Respond to everyone"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"When off, replies only to your self-chat and the allowed numbers below."})]}),c.jsx(gf,{checked:_,onCheckedChange:S})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium",children:"Allowed senders"}),c.jsx(Ln,{value:v,onChange:B=>b(B.target.value),placeholder:"e.g. +49170…, +1202… (comma-separated, blank = self-chat only)"})]}),c.jsx(we,{size:"sm",variant:"outline",disabled:i,onClick:()=>void A(),className:"h-8 text-xs",children:"Save rules"})]})]})}function Mit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),l=y.useCallback(async()=>{s(!0),o(null);try{const d=await fetch(`${V_}/api/channels`,{headers:q_(e)});if(!d.ok)throw new Error(`Failed to load channels (HTTP ${d.status})`);n(await d.json())}catch(d){o(d instanceof Error?d.message:"Failed to load channels")}finally{s(!1)}},[e]);return y.useEffect(()=>{l()},[l]),c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Zr,{className:"space-y-1 p-5",children:[c.jsx("h2",{className:"text-base font-medium",children:"Channels"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect external messaging apps so your assistant can chat through them."})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),i&&r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading channels…"})}):r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"No channel extensions are enabled. Enable one in Extensions, then connect it here."})}):r.map(d=>c.jsx(Oit,{token:e,channel:d,onChanged:l},d.id))]})}function Rit({events:e}){return c.jsx(Jc,{className:"h-full w-full",children:c.jsx("div",{className:"p-4 space-y-2",children:e.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity yet."}):e.map(r=>c.jsxs("div",{className:"rounded-md border p-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("p",{className:"text-sm font-medium",children:r.title}),c.jsx("span",{className:"text-xs text-muted-foreground",children:r.source})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r.detail})]},r.id))})})}function a_(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Pit(e,r){const n=r.trim();if(!n)return a_(e);const i=e.toLowerCase(),s=n.toLowerCase();let a=0,o=i.indexOf(s);if(o===-1)return a_(e);let l="";for(;o!==-1;){o>a&&(l+=a_(e.slice(a,o)));const d=o+n.length;l+=`<mark class="rounded bg-yellow-200/80 px-0.5 text-inherit dark:bg-yellow-500/30">${a_(e.slice(o,d))}</mark>`,a=d,o=i.indexOf(s,a)}return a<e.length&&(l+=a_(e.slice(a))),l}var yx="Perplexity",Lit=.75,$it=.2,Pce="#22B8CD",Dit=Pce,Iit="#000",Bit=.75;function oS(e){"@babel/helpers - typeof";return oS=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},oS(e)}var zit=["size","style"];function wU(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 b8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?wU(Object(n),!0).forEach(function(i){Fit(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Fit(e,r,n){return r=Hit(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Hit(e){var r=Wit(e,"string");return oS(r)=="symbol"?r:String(r)}function Wit(e,r){if(oS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(oS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Uit(e,r){if(e==null)return{};var n=Vit(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Vit(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var aL=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Uit(e,zit);return c.jsxs("svg",b8(b8({fill:"currentColor",fillRule:"evenodd",height:n,style:b8({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:yx}),c.jsx("path",{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"})]}))});function lS(e){"@babel/helpers - typeof";return lS=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},lS(e)}function SU(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 qit(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?SU(Object(n),!0).forEach(function(i){Git(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Git(e,r,n){return r=Kit(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Kit(e){var r=Yit(e,"string");return lS(r)=="symbol"?r:String(r)}function Yit(e,r){if(lS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(lS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Xit(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Jit=y.memo(function(e){var r=Object.assign({},(Xit(e),e));return c.jsx(_c,qit({Icon:aL,"aria-label":yx,background:Dit,color:Iit,iconMultiple:Bit},r))});function cS(e){"@babel/helpers - typeof";return cS=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},cS(e)}var Zit=["size","style"];function kU(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 _8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?kU(Object(n),!0).forEach(function(i){Qit(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Qit(e,r,n){return r=est(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function est(e){var r=tst(e,"string");return cS(r)=="symbol"?r:String(r)}function tst(e,r){if(cS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(cS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function rst(e,r){if(e==null)return{};var n=nst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function nst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Lce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=rst(e,Zit);return c.jsxs("svg",_8(_8({height:n,style:_8({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:yx}),c.jsx("path",{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z",fill:"#22B8CD",fillRule:"nonzero"})]}))});function uS(e){"@babel/helpers - typeof";return uS=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},uS(e)}var ist=["size","style"];function CU(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 w8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?CU(Object(n),!0).forEach(function(i){sst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function sst(e,r,n){return r=ast(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ast(e){var r=ost(e,"string");return uS(r)=="symbol"?r:String(r)}function ost(e,r){if(uS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(uS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function lst(e,r){if(e==null)return{};var n=cst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function cst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var $ce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=lst(e,ist);return c.jsxs("svg",w8(w8({fill:"currentColor",fillRule:"evenodd",height:n,style:w8({flex:"none",lineHeight:1},i),viewBox:"0 0 117 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:yx}),c.jsx("path",{d:"M38.542 5.218h1.151V7.59h-1.49c-1.167 0-2.036.281-2.612.843-.575.563-.863 1.485-.863 2.768v7.773h-2.351V5.271h2.351v2.187c0 .123.062.185.184.185.069 0 .121-.017.157-.053a.58.58 0 00.104-.211c.453-1.44 1.577-2.16 3.371-2.16h-.002zm15.36 2.938c.617 1.098.928 2.42.928 3.966 0 1.545-.309 2.867-.928 3.965-.62 1.098-1.42 1.92-2.404 2.464a6.446 6.446 0 01-3.174.817c-2.23 0-3.797-.896-4.703-2.688-.069-.14-.157-.211-.262-.211-.105 0-.157.052-.157.158v7.352h-2.351V5.271h2.351v2.345c0 .106.052.159.157.159.105 0 .191-.07.262-.211.906-1.793 2.473-2.689 4.703-2.689 1.132 0 2.19.272 3.174.817.984.545 1.785 1.366 2.404 2.464zm-1.424 3.966c0-1.617-.43-2.877-1.292-3.781-.862-.904-1.998-1.357-3.41-1.357-1.413 0-2.548.453-3.41 1.357-.863.905-1.179 2.166-1.179 3.78 0 1.616.316 2.878 1.178 3.782.863.905 2 1.356 3.41 1.356 1.411 0 2.549-.453 3.411-1.356.862-.904 1.292-2.166 1.292-3.781zM15.05 8.177c.618 1.098.928 2.42.928 3.965 0 1.546-.308 2.868-.928 3.966-.619 1.098-1.42 1.919-2.403 2.464a6.448 6.448 0 01-3.175.817c-2.23 0-3.797-.896-4.702-2.688-.07-.14-.158-.212-.262-.212-.105 0-.158.053-.158.159V24H2V5.292h2.351v2.345c0 .106.053.159.158.159.104 0 .19-.07.261-.212.906-1.792 2.473-2.688 4.703-2.688 1.132 0 2.19.272 3.175.817.983.545 1.784 1.366 2.403 2.464h-.002zm-1.423 3.965c0-1.616-.43-2.877-1.293-3.78-.862-.904-1.998-1.357-3.41-1.357-1.412 0-2.548.453-3.41 1.357-.862.905-1.178 2.165-1.178 3.78 0 1.615.316 2.878 1.178 3.781.862.906 1.998 1.357 3.41 1.357 1.412 0 2.548-.453 3.41-1.357.863-.903 1.293-2.166 1.293-3.78zm14.422 2.481h2.482c-.33 1.283-1.006 2.395-2.023 3.334-1.02.94-2.479 1.41-4.378 1.41-1.429 0-2.686-.295-3.775-.884a6.13 6.13 0 01-2.521-2.516c-.593-1.089-.889-2.372-.889-3.847 0-1.476.288-2.758.863-3.847.574-1.089 1.38-1.928 2.417-2.517 1.036-.588 2.25-.883 3.644-.883 1.393 0 2.547.29 3.514.87.968.58 1.69 1.349 2.168 2.305.48.959.719 2.008.719 3.15v1.58H19.427c.086 1.37.544 2.46 1.37 3.268.828.807 1.939 1.213 3.332 1.213 1.132 0 2-.232 2.6-.698.601-.466 1.04-1.111 1.32-1.938zm-8.595-3.82h8.204c0-1.194-.305-2.13-.914-2.807-.61-.676-1.568-1.015-2.874-1.015-1.22 0-2.217.33-2.99.988-.775.659-1.25 1.604-1.424 2.832l-.002.002zm37.238 8.17h2.352V0H56.69v18.974-.002zM89.316 3.774h2.747V.81h-2.747v2.966zm9.688 13.156c-.426.043-.684.066-.77.066a.39.39 0 01-.289-.106.395.395 0 01-.104-.29c0-.087.022-.348.065-.778.043-.43.066-1.094.066-1.988V7.279h3.354l-.66-2.008h-2.692v-3.69h-2.352v3.688h-2.557v2.008h2.557v7.214c0 1.512.367 2.636 1.098 3.374.732.737 1.846 1.107 3.345 1.107h1.83v-2.107h-.915c-.889 0-1.547.022-1.974.066h-.002zm13.759-11.662l-3.893 11.498c-.053.141-.135.326-.402.326-.268 0-.35-.185-.402-.326l-3.893-11.498h-2.398l4.508 13.703h1.594a.81.81 0 01.235.026c.053.017.096.06.131.133.07.105.06.264-.026.473l-.731 2.002c-.105.264-.305.396-.6.396-.106 0-.349-.023-.732-.066a13.71 13.71 0 00-1.49-.066h-1.907v2.107h2.508c1.463 0 2.344-.25 3.102-.75.757-.5 1.345-1.383 1.764-2.65L115 5.795v-.526h-2.237v.001zm-31.127 5.113L77.953 5.27h-2.588v.527l4.415 5.93-5.382 6.72v.526h2.64l4.285-5.507 3.998 5.507h2.535v-.526l-4.677-6.324 5.07-6.298v-.553h-2.64l-3.971 5.113-.002-.002zm7.931 8.59h2.351v-13.7h-2.35v13.702-.002zm-15.062-4.349c-.331 1.283-1.006 2.395-2.024 3.334-1.02.94-2.479 1.41-4.377 1.41-1.43 0-2.686-.295-3.775-.884a6.13 6.13 0 01-2.522-2.516c-.593-1.089-.888-2.372-.888-3.847 0-1.476.288-2.758.862-3.847.574-1.089 1.38-1.928 2.417-2.517 1.036-.588 2.25-.883 3.644-.883 1.394 0 2.547.29 3.515.87.967.58 1.689 1.349 2.168 2.305.479.959.718 2.008.718 3.15v1.58H63.401c.086 1.37.544 2.46 1.371 3.268.827.807 1.938 1.213 3.332 1.213 1.132 0 2-.232 2.6-.698.6-.466 1.04-1.111 1.319-1.938h2.482zm-11.078-3.82h8.205c0-1.194-.305-2.13-.915-2.807-.61-.676-1.568-1.015-2.873-1.015-1.22 0-2.217.33-2.991.988-.775.659-1.25 1.604-1.424 2.832l-.002.002z"})]}))});function dS(e){"@babel/helpers - typeof";return dS=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},dS(e)}var ust=["type"];function jU(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 dst(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?jU(Object(n),!0).forEach(function(i){hst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function hst(e,r,n){return r=fst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function fst(e){var r=pst(e,"string");return dS(r)=="symbol"?r:String(r)}function pst(e,r){if(dS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(dS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function mst(e,r){if(e==null)return{};var n=gst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function gst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var yst=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=mst(e,ust),s=n==="color"?Lce:aL;return c.jsx(wc,dst({Icon:s,Text:$ce,"aria-label":yx,spaceMultiple:$it,textMultiple:Lit},i))}),Ey=aL;Ey.Color=Lce;Ey.Text=$ce;Ey.Combine=yst;Ey.Avatar=Jit;Ey.colorPrimary=Pce;Ey.title=yx;var Ck="OpenRouter",vst=1,xst=.4,oL="#6566F1",bst=oL,_st="#fff",wst=.75;function hS(e){"@babel/helpers - typeof";return hS=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},hS(e)}var Sst=["size","style"];function NU(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 S8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?NU(Object(n),!0).forEach(function(i){kst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function kst(e,r,n){return r=Cst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Cst(e){var r=jst(e,"string");return hS(r)=="symbol"?r:String(r)}function jst(e,r){if(hS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(hS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Nst(e,r){if(e==null)return{};var n=Tst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Tst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var lL=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Nst(e,Sst);return c.jsxs("svg",S8(S8({fill:"currentColor",fillRule:"evenodd",height:n,style:S8({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:Ck}),c.jsx("path",{d:"M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"})]}))});function fS(e){"@babel/helpers - typeof";return fS=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},fS(e)}function TU(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 Est(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?TU(Object(n),!0).forEach(function(i){Ast(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Ast(e,r,n){return r=Ost(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Ost(e){var r=Mst(e,"string");return fS(r)=="symbol"?r:String(r)}function Mst(e,r){if(fS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(fS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Rst(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Pst=y.memo(function(e){var r=Object.assign({},(Rst(e),e));return c.jsx(_c,Est({Icon:lL,"aria-label":Ck,background:bst,color:_st,iconMultiple:wst},r))});function pS(e){"@babel/helpers - typeof";return pS=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},pS(e)}var Lst=["size","style"];function EU(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 k8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?EU(Object(n),!0).forEach(function(i){$st(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function $st(e,r,n){return r=Dst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Dst(e){var r=Ist(e,"string");return pS(r)=="symbol"?r:String(r)}function Ist(e,r){if(pS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(pS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Bst(e,r){if(e==null)return{};var n=zst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function zst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Bst(e,Lst);return c.jsxs("svg",k8(k8({fill:"currentColor",fillRule:"evenodd",height:n,style:k8({flex:"none",lineHeight:1},i),viewBox:"0 0 143 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Ck}),c.jsx("path",{d:"M9.623 2c1.46 0 2.763.35 3.91 1.05 1.149.699 2.053 1.7 2.714 3.002.66 1.303.991 2.861.991 4.675 0 1.814-.33 3.372-.991 4.675-.66 1.302-1.565 2.303-2.713 3.003-1.148.7-2.452 1.049-3.91 1.049-1.465 0-2.772-.35-3.92-1.05-1.148-.699-2.052-1.701-2.713-3.007-.66-1.305-.991-2.862-.991-4.67 0-1.814.33-3.372.991-4.675.66-1.302 1.565-2.303 2.713-3.003C6.852 2.35 8.16 2 9.624 2zm0 2.34c-.974 0-1.844.244-2.61.734-.765.489-1.37 1.208-1.813 2.156-.443.949-.664 2.114-.664 3.497s.221 2.548.664 3.497c.444.948 1.048 1.667 1.813 2.156.766.49 1.636.735 2.61.735.97 0 1.838-.245 2.606-.735.768-.489 1.374-1.208 1.817-2.156.443-.949.665-2.114.665-3.497s-.222-2.548-.665-3.497c-.443-.948-1.049-1.667-1.817-2.156-.768-.49-1.637-.735-2.606-.735zm16.32 1.974c1.024 0 1.938.26 2.742.78s1.436 1.269 1.896 2.248c.46.979.69 2.156.69 3.534 0 1.377-.23 2.556-.686 3.538-.457.981-1.085 1.736-1.883 2.264-.799.529-1.71.793-2.734.793-.771 0-1.4-.13-1.887-.39-.488-.26-.869-.564-1.144-.913a6.908 6.908 0 01-.636-.929h-.149V24h-2.47V6.48h2.412v2.065h.207c.143-.265.35-.572.62-.92.27-.349.643-.655 1.123-.917.479-.263 1.112-.394 1.9-.394zm-.528 2.107c-.716 0-1.32.185-1.813.556-.493.37-.866.887-1.12 1.55-.253.665-.38 1.439-.38 2.324 0 .896.13 1.68.389 2.356.259.674.633 1.201 1.123 1.58s1.09.568 1.8.568c.738 0 1.355-.198 1.85-.593.496-.395.872-.933 1.128-1.613.256-.68.384-1.447.384-2.298 0-.84-.125-1.596-.376-2.265-.25-.67-.625-1.197-1.123-1.584-.498-.388-1.12-.581-1.862-.581zm13.387-2.107c.716 0 1.41.119 2.082.356a5.037 5.037 0 011.809 1.12c.534.51.955 1.169 1.263 1.979.309.81.463 1.793.463 2.949v.88l-9.016-.001.002.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.26 1.364.539.313 1.17.469 1.89.469.469 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.281-.271.496-.606.644-1.004l2.338.423a4.247 4.247 0 01-1.004 1.813c-.482.517-1.084.918-1.808 1.203-.725.284-1.549.427-2.474.427-1.25 0-2.325-.27-3.225-.809-.9-.54-1.594-1.3-2.082-2.281-.487-.982-.73-2.134-.73-3.455 0-1.306.243-2.456.73-3.451.488-.996 1.17-1.773 2.049-2.331.878-.559 1.906-.838 3.084-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.593c0-.653-.132-1.232-.397-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.034-.44-1.673-.44zm10.29 3.293v7.566H46.64V6.48h2.37v2.074h.158a3.63 3.63 0 011.375-1.626c.625-.41 1.413-.614 2.366-.614.864 0 1.622.18 2.271.543.65.362 1.154.9 1.512 1.614.358.713.537 1.595.537 2.646v8.105h-2.47v-7.806c0-.924-.24-1.647-.718-2.17-.48-.522-1.137-.784-1.974-.784-.573 0-1.081.125-1.524.374a2.65 2.65 0 00-1.05 1.09c-.255.479-.383 1.055-.383 1.73zm17.122-9.424c1.31 0 2.4.227 3.266.68.868.454 1.516 1.08 1.945 1.88.43.799.645 1.72.645 2.766 0 1.04-.216 1.954-.649 2.742-.432.788-1.082 1.4-1.949 1.837a5.1 5.1 0 01-.501.22l3.743 6.865h-2.907l-3.436-6.43h-3.634v6.43h-2.552V2.232h6.029zm-.273 2.199h-3.204v6.155h3.237c.826 0 1.5-.119 2.02-.357s.901-.583 1.144-1.037c.242-.453.363-.998.363-1.634 0-.641-.122-1.197-.367-1.667-.246-.47-.628-.831-1.148-1.083-.52-.252-1.202-.377-2.045-.377zM79.66 6.314c1.19 0 2.227.273 3.114.821.886.548 1.575 1.316 2.065 2.306s.735 2.146.735 3.468c0 1.316-.245 2.466-.735 3.45-.49.985-1.179 1.751-2.065 2.299-.887.547-1.924.82-3.114.82s-2.227-.273-3.113-.82c-.887-.548-1.575-1.314-2.065-2.298-.49-.985-.735-2.135-.735-3.451 0-1.322.245-2.478.735-3.468.49-.99 1.178-1.758 2.065-2.306.886-.548 1.924-.821 3.113-.821zm.008 2.074c-.776 0-1.419.207-1.928.622-.51.415-.887.963-1.132 1.646a6.602 6.602 0 00-.367 2.244c0 .819.122 1.568.367 2.249.245.68.623 1.225 1.132 1.634.51.41 1.152.614 1.928.614.771 0 1.41-.205 1.917-.614.506-.41.882-.954 1.127-1.634.245-.68.367-1.43.367-2.249 0-.813-.122-1.56-.367-2.244-.245-.683-.62-1.231-1.127-1.646-.507-.415-1.146-.622-1.917-.622zm16.164 5.55V6.48h2.477v12.742h-2.428v-2.207h-.132a3.956 3.956 0 01-1.4 1.697c-.641.45-1.438.676-2.391.676-.815 0-1.535-.181-2.16-.544-.625-.362-1.115-.9-1.47-1.613-.355-.714-.533-1.596-.533-2.647V6.48h2.47v7.806c0 .868.24 1.56.718 2.074.48.514 1.102.771 1.867.771.462 0 .924-.116 1.383-.348.46-.232.843-.584 1.148-1.054.306-.47.456-1.067.45-1.792zm8.58-10.511v3.052h2.602v1.992h-2.602v7.01c0 .48.072.841.215 1.082.144.24.33.404.558.49.228.085.478.128.747.128.199 0 .372-.014.52-.041l.348-.067.446 2.05a4.42 4.42 0 01-.612.17c-.264.057-.594.09-.99.095a4.331 4.331 0 01-1.818-.349 3.12 3.12 0 01-1.362-1.128c-.347-.509-.52-1.148-.52-1.916l-.002-7.525h-1.857V6.48h1.857l.001-3.053h2.47zm9.961 2.887c.716 0 1.41.119 2.081.356a5.037 5.037 0 011.81 1.12c.533.51.954 1.169 1.263 1.979.308.81.462 1.793.462 2.949v.88l-9.016-.001.003.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.259 1.364.54.313 1.17.469 1.891.469.468 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.28-.271.495-.606.644-1.004l2.337.423a4.247 4.247 0 01-1.003 1.813c-.482.517-1.085.918-1.809 1.203-.724.284-1.548.427-2.473.427-1.25 0-2.325-.27-3.226-.809-.9-.54-1.594-1.3-2.08-2.281-.488-.982-.732-2.134-.732-3.455 0-1.306.244-2.456.731-3.451.487-.996 1.17-1.773 2.048-2.331.879-.559 1.907-.838 3.085-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.592c0-.653-.132-1.232-.396-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.035-.44-1.673-.44zm7.821 10.859V6.48h2.387v2.024h.132a3.092 3.092 0 011.227-1.622 3.485 3.485 0 011.994-.593l.396.01.153.006c.212.011.379.025.5.042v2.372c-.1-.027-.275-.059-.529-.095a5.4 5.4 0 00-.76-.054c-.583 0-1.102.123-1.556.37a2.799 2.799 0 00-1.078 1.02 2.79 2.79 0 00-.397 1.48v7.782h-2.469z"})]}))});function mS(e){"@babel/helpers - typeof";return mS=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},mS(e)}var Fst=["type","iconProps"];function AU(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 OU(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?AU(Object(n),!0).forEach(function(i){Hst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Hst(e,r,n){return r=Wst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Wst(e){var r=Ust(e,"string");return mS(r)=="symbol"?r:String(r)}function Ust(e,r){if(mS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(mS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Vst(e,r){if(e==null)return{};var n=qst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function qst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Gst=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=e.iconProps,s=Vst(e,Fst);return c.jsx(wc,OU({Icon:lL,Text:Dce,"aria-label":Ck,iconProps:OU({color:n==="color"?oL:void 0},i),spaceMultiple:xst,textMultiple:vst},s))}),vx=lL;vx.Text=Dce;vx.Combine=Gst;vx.Avatar=Pst;vx.colorPrimary=oL;vx.title=Ck;var jk="Grok",Kst=.75,Yst=.25,Ice="#fff",Xst=Ice,Jst="#000",Zst=.65;function gS(e){"@babel/helpers - typeof";return gS=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},gS(e)}var Qst=["size","style"];function MU(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 C8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?MU(Object(n),!0).forEach(function(i){eat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function eat(e,r,n){return r=tat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function tat(e){var r=rat(e,"string");return gS(r)=="symbol"?r:String(r)}function rat(e,r){if(gS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(gS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function nat(e,r){if(e==null)return{};var n=iat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function iat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Bce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=nat(e,Qst);return c.jsxs("svg",C8(C8({fill:"currentColor",fillRule:"evenodd",height:n,style:C8({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:jk}),c.jsx("path",{d:"M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"})]}))});function yS(e){"@babel/helpers - typeof";return yS=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},yS(e)}function RU(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 sat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?RU(Object(n),!0).forEach(function(i){aat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function aat(e,r,n){return r=oat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function oat(e){var r=lat(e,"string");return yS(r)=="symbol"?r:String(r)}function lat(e,r){if(yS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(yS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function cat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var zce=y.memo(function(e){var r=Object.assign({},(cat(e),e));return c.jsx(_c,sat({Icon:Bce,"aria-label":jk,background:Xst,color:Jst,iconMultiple:Zst},r))});function vS(e){"@babel/helpers - typeof";return vS=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},vS(e)}var uat=["size","style"];function PU(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 j8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?PU(Object(n),!0).forEach(function(i){dat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function dat(e,r,n){return r=hat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function hat(e){var r=fat(e,"string");return vS(r)=="symbol"?r:String(r)}function fat(e,r){if(vS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(vS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function pat(e,r){if(e==null)return{};var n=mat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function mat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Fce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=pat(e,uat);return c.jsxs("svg",j8(j8({fill:"currentColor",fillRule:"evenodd",height:n,style:j8({flex:"none",lineHeight:1},i),viewBox:"0 0 41 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:jk}),c.jsx("path",{d:"M36.867 2h2.577v20h-2.577V2zM23.875 2h2.717l7.759 20H31.55l-2.101-5.574h-8.571L18.777 22h-2.69l7.788-20zm4.79 12.185l-3.53-9.272-3.473 9.272h7.003zM7.35 14.381L2.504 7.518h2.857l3.446 5.126 3.585-5.126h2.605l-4.762 6.835L15.501 22h-2.829l-3.977-5.854L4.689 22H2l5.35-7.619z"})]}))});function xS(e){"@babel/helpers - typeof";return xS=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},xS(e)}function LU(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 gat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?LU(Object(n),!0).forEach(function(i){yat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function yat(e,r,n){return r=vat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function vat(e){var r=xat(e,"string");return xS(r)=="symbol"?r:String(r)}function xat(e,r){if(xS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(xS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function bat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var _at=y.memo(function(e){var r=Object.assign({},(bat(e),e));return c.jsx(wc,gat({Icon:zce,Text:Fce,"aria-label":jk,iconProps:{shape:"square"},spaceMultiple:Yst,textMultiple:Kst},r))}),xx=Bce;xx.Text=Fce;xx.Combine=_at;xx.Avatar=zce;xx.colorPrimary=Ice;xx.title=jk;var Nk="MoonshotAI",wat=.75,Sat=.4,Hce="#16191E",kat=Hce,Cat="#fff",jat=.75;function bS(e){"@babel/helpers - typeof";return bS=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},bS(e)}var Nat=["size","style"];function $U(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 N8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?$U(Object(n),!0).forEach(function(i){Tat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$U(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Tat(e,r,n){return r=Eat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Eat(e){var r=Aat(e,"string");return bS(r)=="symbol"?r:String(r)}function Aat(e,r){if(bS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(bS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Oat(e,r){if(e==null)return{};var n=Mat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Mat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var cL=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Oat(e,Nat);return c.jsxs("svg",N8(N8({fill:"currentColor",fillRule:"evenodd",height:n,style:N8({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:Nk}),c.jsx("path",{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"})]}))});function _S(e){"@babel/helpers - typeof";return _S=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},_S(e)}function DU(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 Rat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?DU(Object(n),!0).forEach(function(i){Pat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Pat(e,r,n){return r=Lat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Lat(e){var r=$at(e,"string");return _S(r)=="symbol"?r:String(r)}function $at(e,r){if(_S(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(_S(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Dat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Iat=y.memo(function(e){var r=Object.assign({},(Dat(e),e));return c.jsx(_c,Rat({Icon:cL,"aria-label":Nk,background:kat,color:Cat,iconMultiple:jat},r))});function wS(e){"@babel/helpers - typeof";return wS=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},wS(e)}var Bat=["size","style"];function IU(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 T8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?IU(Object(n),!0).forEach(function(i){zat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function zat(e,r,n){return r=Fat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Fat(e){var r=Hat(e,"string");return wS(r)=="symbol"?r:String(r)}function Hat(e,r){if(wS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(wS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Wat(e,r){if(e==null)return{};var n=Uat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Uat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Wce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Wat(e,Bat);return c.jsxs("svg",T8(T8({fill:"currentColor",fillRule:"evenodd",height:n,style:T8({flex:"none",lineHeight:1},i),viewBox:"0 0 171 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Nk}),c.jsx("path",{d:"M165.484 2H169v19.507h-3.516V2zm-35.707 0v5.26h3.186v3.507h-3.186v10.74h-3.516v-10.74h-2.966V7.26h2.966V2h3.516zm-24.598 11.023v8.498h-3.345v-8.804c.008-2.1-2.109-2.895-3.109-2.895l-.064.001c-1.073.026-3.521.694-3.54 3.863v7.835h-3.468V2.014L95.14 2v6.918c1.228-1.986 3.93-2.243 4.755-2.243.926 0 1.768.155 2.525.465.757.31 1.378.783 1.864 1.42.413.54.665 1.096.757 1.667.092.571.138 1.503.138 2.796zM89.29 9.507l-2.362 2.41c-2.911-2.41-6.647-2.136-7.196-.93-.55 1.205 2.444 1.484 4.734 1.98l.634.146c1.731.408 4.603 1.274 4.52 4.12-.11 3.78-4.23 4.767-6.867 4.767-2.637 0-5.933-1.808-7.636-3.342l2.527-2.63c2.582 2.63 7.142 2.958 7.856 1.534.714-1.425-1.263-1.48-4.834-1.973-3.175-.438-4.837-2.85-4.813-4.13.034-1.843 1.543-4.85 6.31-4.886 3.227-.025 5.425.961 7.127 2.934zm-22.617.386l-.033.001c-1.905.083-3.443 1.453-3.458 3.746v7.867h-3.83V7.185h3.702v2.061l.088-.12c.591-.8 2.07-2.555 4.796-2.523 2.675.032 5.696 1.95 5.696 5.17v9.734H69.69v-8.813c-.01-2.197-2.102-2.824-3.016-2.8zm-33.14-3.29c4.247 0 7.69 3.434 7.69 7.671s-3.443 7.671-7.69 7.671c-4.248 0-7.692-3.434-7.692-7.671s3.444-7.671 7.691-7.671zm0 3.726a3.95 3.95 0 00-3.956 3.945 3.95 3.95 0 003.955 3.945 3.95 3.95 0 003.956-3.945 3.95 3.95 0 00-3.956-3.945zm16.7-3.726c4.247 0 7.69 3.434 7.69 7.671s-3.443 7.671-7.69 7.671c-4.248 0-7.692-3.434-7.692-7.671s3.444-7.671 7.691-7.671zm0 3.726a3.95 3.95 0 00-3.956 3.945 3.95 3.95 0 003.955 3.945 3.95 3.95 0 003.956-3.945 3.95 3.95 0 00-3.956-3.945zm64.382-3.726c4.248 0 7.69 3.434 7.69 7.671s-3.442 7.671-7.69 7.671c-4.247 0-7.69-3.434-7.69-7.671s3.443-7.671 7.69-7.671zm0 3.726a3.95 3.95 0 00-3.955 3.945 3.95 3.95 0 003.955 3.945 3.95 3.95 0 003.955-3.945 3.95 3.95 0 00-3.955-3.945zM2 21.616V2l10.987 7.89L23.919 2v19.616h-3.79V9.452l-7.17 5.26-7.169-5.26v12.164H2zM153.344 2l10.492 19.507h-4.138l-1.833-3.288h-5.235l-1.789-3.46-3.632 6.748h-4.358L153.344 2zm0 8.11l-2.478 4.602h5.044l-2.566-4.602z"})]}))});function SS(e){"@babel/helpers - typeof";return SS=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},SS(e)}function BU(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 Vat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?BU(Object(n),!0).forEach(function(i){qat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function qat(e,r,n){return r=Gat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Gat(e){var r=Kat(e,"string");return SS(r)=="symbol"?r:String(r)}function Kat(e,r){if(SS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(SS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Yat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Xat=y.memo(function(e){var r=Object.assign({},(Yat(e),e));return c.jsx(wc,Vat({Icon:cL,Text:Wce,"aria-label":Nk,spaceMultiple:Sat,textMultiple:wat},r))}),bx=cL;bx.Text=Wce;bx.Combine=Xat;bx.Avatar=Iat;bx.colorPrimary=Hce;bx.title=Nk;var _x="Kimi",Jat=.7,Zat=.25,Uce="#000",Qat=Uce,eot="#fff",tot=.6;function kS(e){"@babel/helpers - typeof";return kS=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},kS(e)}var rot=["size","style"];function zU(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 E8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?zU(Object(n),!0).forEach(function(i){not(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function not(e,r,n){return r=iot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function iot(e){var r=sot(e,"string");return kS(r)=="symbol"?r:String(r)}function sot(e,r){if(kS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(kS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function aot(e,r){if(e==null)return{};var n=oot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function oot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Vce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=aot(e,rot);return c.jsxs("svg",E8(E8({height:n,style:E8({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:_x}),c.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z",fill:"#1783FF"}),c.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z",fill:"#fff"})]}))});function CS(e){"@babel/helpers - typeof";return CS=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},CS(e)}function FU(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 lot(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?FU(Object(n),!0).forEach(function(i){cot(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function cot(e,r,n){return r=uot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function uot(e){var r=dot(e,"string");return CS(r)=="symbol"?r:String(r)}function dot(e,r){if(CS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(CS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function hot(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var qce=y.memo(function(e){var r=Object.assign({},(hot(e),e));return c.jsx(_c,lot({Icon:Vce,"aria-label":_x,background:Qat,color:eot,iconMultiple:tot},r))});function jS(e){"@babel/helpers - typeof";return jS=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},jS(e)}var fot=["size","style"];function HU(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 A8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?HU(Object(n),!0).forEach(function(i){pot(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function pot(e,r,n){return r=mot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function mot(e){var r=got(e,"string");return jS(r)=="symbol"?r:String(r)}function got(e,r){if(jS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(jS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function yot(e,r){if(e==null)return{};var n=vot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function vot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Gce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=yot(e,fot);return c.jsxs("svg",A8(A8({fill:"currentColor",fillRule:"evenodd",height:n,style:A8({flex:"none",lineHeight:1},i),viewBox:"0 0 64 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:_x}),c.jsx("path",{d:"M24.353 21.58c0 .232.188.42.42.42h2.69a.42.42 0 00.42-.42V2.42a.42.42 0 00-.42-.42h-2.69a.42.42 0 00-.42.42v19.16zM58.47 21.58c0 .232.188.42.42.42h2.691a.42.42 0 00.419-.42V2.42a.42.42 0 00-.419-.42H58.89a.42.42 0 00-.42.42v19.16zM47.786 2a.42.42 0 00-.408.32L43.4 18.633c-.066.267-.38.267-.444 0L38.976 2.32A.417.417 0 0038.57 2H31.83a.418.418 0 00-.418.42v19.16c0 .232.188.42.42.42h2.988c.231 0 .419-.182.419-.414V5.471c0-.322.378-.389.454-.079l3.974 16.288a.42.42 0 00.407.32h6.208a.42.42 0 00.407-.32L50.66 5.394c.076-.31.455-.243.455.079V21.58c0 .231.187.419.419.419h2.987a.42.42 0 00.42-.42V2.42a.42.42 0 00-.42-.42h-6.735zM11.55 11.273l8.115-8.565A.42.42 0 0019.36 2h-3.776a.42.42 0 00-.298.124l-9.303 9.39c-.144.146-.357.016-.357-.218V2.42a.42.42 0 00-.42-.42H2.42a.42.42 0 00-.42.42v19.16c0 .232.188.42.42.42h2.786a.42.42 0 00.42-.42v-3.82c0-.085.03-.166.081-.219l2.87-2.931c.07-.07.166-.081.243-.029l7.678 5.816c1.123.778 2.552 1.288 3.861 1.5a.403.403 0 00.464-.404v-3.461c0-.206-.15-.38-.35-.423-.76-.164-1.604-.474-2.244-.918l-6.647-4.953c-.138-.095-.155-.34-.033-.465z"})]}))});function NS(e){"@babel/helpers - typeof";return NS=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},NS(e)}var xot=["iconProps"];function WU(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 UU(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?WU(Object(n),!0).forEach(function(i){bot(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function bot(e,r,n){return r=_ot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _ot(e){var r=wot(e,"string");return NS(r)=="symbol"?r:String(r)}function wot(e,r){if(NS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(NS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Sot(e,r){if(e==null)return{};var n=kot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function kot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Cot=y.memo(function(e){var r=e.iconProps,n=Sot(e,xot);return c.jsx(wc,UU({Icon:qce,Text:Gce,"aria-label":_x,iconProps:UU({shape:"square"},r),spaceMultiple:Zat,textMultiple:Jat},n))});function TS(e){"@babel/helpers - typeof";return TS=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},TS(e)}var jot=["size","style"];function VU(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 O8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?VU(Object(n),!0).forEach(function(i){Not(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Not(e,r,n){return r=Tot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Tot(e){var r=Eot(e,"string");return TS(r)=="symbol"?r:String(r)}function Eot(e,r){if(TS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(TS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Aot(e,r){if(e==null)return{};var n=Oot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Oot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Mot=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Aot(e,jot);return c.jsxs("svg",O8(O8({fill:"currentColor",fillRule:"evenodd",height:n,style:O8({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:_x}),c.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),c.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]}))}),Ay=Mot;Ay.Color=Vce;Ay.Text=Gce;Ay.Combine=Cot;Ay.Avatar=qce;Ay.colorPrimary=Uce;Ay.title=_x;const Kce=[{label:"OpenAI / Jait",fields:["OPENAI_API_KEY","OPENAI_BASE_URL","OPENAI_MODEL","OPENAI_TRANSCRIBE_MODEL","OPENAI_WEB_SEARCH_MODEL"]},{label:"Ollama",fields:["OLLAMA_URL","OLLAMA_MODEL"]},{label:"Perplexity",fields:["PERPLEXITY_API_KEY","PERPLEXITY_MODEL","PERPLEXITY_OPENROUTER_MODEL"]},{label:"OpenRouter",fields:["OPENROUTER_API_KEY"]},{label:"xAI / Grok",fields:["XAI_API_KEY","GROK_MODEL"]},{label:"Google Gemini",fields:["GEMINI_API_KEY","GEMINI_MODEL"]},{label:"Moonshot / Kimi",fields:["MOONSHOT_API_KEY","KIMI_BASE_URL","KIMI_MODEL"]},{label:"Brave Search",fields:["BRAVE_API_KEY"]},{label:"Speech / Home Assistant",fields:["WHISPER_URL","HA_URL","HA_TOKEN","HA_STT_ENTITY","ELEVENLABS_API_KEY","ELEVENLABS_STT_MODEL","ELEVENLABS_STT_URL","ELEVENLABS_LANGUAGE_CODE"]}],qU=Kce.flatMap(e=>e.fields),Rot={OPENAI:fs,PERPLEXITY:Ey,OPENROUTER:vx,XAI:xx,GEMINI:Ap,ELEVENLABS:CY,MOONSHOT:bx,KIMI:Ay,GROK:Sy,OLLAMA:wy,HA:wY};function Pot(e){const r=e.split("_")[0];return Rot[r]??null}function Lot(e){return e.endsWith("_KEY")||e.endsWith("_URL")}const $ot=qn(),GU={jait:"Jait",codex:"Codex","claude-code":"Claude Code"};function Dot(e){const r=e.auth;return e.id==="jait"||!r?!1:r.login||r.logout||r.authenticated!==null}function Iot({username:e,token:r,apiKeys:n,onSaveApiKeys:i,sttProvider:s,onSttProviderChange:a,jaitBackend:o,onJaitBackendChange:l,onClearArchive:d,onClearArchivedProjects:u,onFetchArchivedProjects:h,onRestoreProject:f,activityEvents:g,updateInfo:v,updateChecking:b,onCheckUpdate:_,onApplyUpdate:S,updateApplying:w,platform:C}){const[j,E]=y.useState(n),[A,N]=y.useState(!1),[R,B]=y.useState(!1),[G,H]=y.useState(!1),[z,W]=y.useState([]),[I,O]=y.useState(!1),[D,P]=y.useState(null),[$,V]=y.useState(null),[K,F]=y.useState(null),[U,Q]=y.useState({}),[q,te]=y.useState({}),[ee,se]=y.useState([]),[ae,re]=y.useState(!1),[fe,me]=y.useState(null),[_e,ge]=y.useState("general"),[Ve,le]=y.useState(""),it=y.useRef(null),{importedThemes:Xe,activeTheme:xt}=ute(),[Pt,Ht]=y.useState(!1),[Kt,tr]=y.useState(null);y.useEffect(()=>{var $e;C!=="electron"||!(($e=window.jaitDesktop)!=null&&$e.getInfo)||window.jaitDesktop.getInfo().then(ft=>{ft.appVersion&&tr(ft.appVersion)})},[C]),y.useEffect(()=>{var $e;C!=="electron"||!(($e=window.jaitDesktop)!=null&&$e.getSetting)||window.jaitDesktop.getSetting("closeOnWindowClose",!1).then(ft=>{Ht(ft===!0)})},[C]),y.useEffect(()=>{E(n)},[n]);const ht=qU.some($e=>(j[$e]??"")!==(n[$e]??"")),Ye=y.useCallback(async()=>{if(r){re(!0);try{const{providers:$e}=await pr.listProvidersFresh();se($e.filter(Dot))}catch{se([])}finally{re(!1)}}},[r]);y.useEffect(()=>{Ye()},[Ye]);const dt=async $e=>{var vt;const ft=((vt=ee.find(gt=>gt.id===$e))==null?void 0:vt.name)??GU[$e]??$e;me($e),F(null),V(null);try{const gt=await pr.logoutProvider($e);V(gt.message||`${ft} logout completed.`),await Ye()}catch(gt){F(gt instanceof Error?gt.message:`Failed to log out from ${ft}.`)}finally{me(null)}},At=y.useCallback(()=>{E(n),V(null),F(null)},[n]);y.useEffect(()=>{if(!r)return;let $e=!1;return(async()=>{try{const ft=await fetch(`${$ot}/api/auth/settings/env-status`,{headers:{Authorization:`Bearer ${r}`}});if(ft.ok&&!$e){const vt=await ft.json();Q(vt.env_set)}}catch{}})(),()=>{$e=!0}},[r]);const Te=y.useCallback($e=>{te(ft=>({...ft,[$e]:!ft[$e]}))},[]),Oe=async()=>{N(!0),F(null),V(null);try{await i(j),V("API keys saved.")}catch($e){F($e instanceof Error?$e.message:"Failed to save API keys")}finally{N(!1)}},Je=async()=>{B(!0),F(null),V(null);try{const $e=await d();V(`Cleared ${$e} archived session(s).`)}catch($e){F($e instanceof Error?$e.message:"Failed to clear archive")}finally{B(!1)}},ct=async()=>{H(!0),F(null),V(null);try{const $e=await u();W([]),V(`Cleared ${$e} archived project(s).`)}catch($e){F($e instanceof Error?$e.message:"Failed to clear archived projects")}finally{H(!1)}},bt=y.useCallback(async()=>{O(!0);try{const $e=await h();W($e)}finally{O(!1)}},[h]),zt=async $e=>{P($e);try{await f($e)?(W(vt=>vt.filter(gt=>gt.id!==$e)),V("Project restored.")):F("Failed to restore project.")}catch{F("Failed to restore project.")}finally{P(null)}},sr=y.useCallback(async $e=>{var vt;const ft=(vt=$e.target.files)==null?void 0:vt[0];if($e.target.value="",!!ft){F(null),V(null);try{const gt=bDe(ft.name,await ft.text());V(gt.hasInclude?`Imported theme "${gt.name}". Relative "include" files are not resolved yet.`:`Imported theme "${gt.name}".`)}catch(gt){F(gt instanceof Error?gt.message:"Failed to import theme")}}},[]);function Pe($e){var gt;const ft=!!((gt=j[$e])!=null&>.trim()),vt=!!U[$e];return ft?c.jsx(Ar,{variant:"default",className:"text-2xs px-1.5 py-0",children:"user"}):vt?c.jsx(Ar,{variant:"success",className:"text-2xs px-1.5 py-0",children:".env"}):c.jsx(Ar,{variant:"outline",className:"text-2xs px-1.5 py-0 text-muted-foreground",children:"empty"})}const Ne=Ve.trim().toLowerCase(),be=(...$e)=>!Ne||$e.some(ft=>ft==null?void 0:ft.toLowerCase().includes(Ne)),Fe=$e=>c.jsx("span",{dangerouslySetInnerHTML:{__html:Pit($e,Ve)}}),nt=be("software update version gateway desktop release download install",v==null?void 0:v.currentVersion,v==null?void 0:v.latestVersion,Kt),Ue=C==="electron"&&be("desktop tray close window quit minimize app",Kt),$t=C!=="web"&&be("gateway connection url domain ip server host network",qn()),Ot=be("session archive archived clear delete messages history"),Yt=be("project archive archived clear delete projects remove"),rr=be("jait backend provider openai openrouter model api llm",o),or=be("provider accounts login logout codex claude gemini opencode copilot authentication",...ee.map($e=>{var ft;return`${$e.name} ${((ft=$e.auth)==null?void 0:ft.detail)??""}`})),ke=be("speech stt input microphone whisper wyoming home assistant transcription gpt openai elevenlabs scribe",s,j.WHISPER_URL,j.HA_URL,j.HA_TOKEN,j.HA_STT_ENTITY,j.OPENAI_TRANSCRIBE_MODEL,j.ELEVENLABS_API_KEY,j.ELEVENLABS_STT_MODEL,j.ELEVENLABS_STT_URL,j.ELEVENLABS_LANGUAGE_CODE),at=qU.filter($e=>be($e,$e.replaceAll("_"," "),j[$e])),Ze=be("tools permissions mcp core standard external toggle meta terminal filesystem os agent browser web surfaces scheduler memory voice screen gateway"),Rt=be("activity recent messages terminal sessions feed history"),ze=be("extensions plugins store install uninstall enable disable"),mt=be("skills instructions prompts specialized workflows SKILL.md"),yt=be("channels whatsapp messaging connect link qr inbound outbound"),Gt=be(...nDe(),"import json token colors workbench sidebar tabs"),qe=c.jsx(Zr,{className:"p-5",children:c.jsxs("p",{className:"text-sm text-muted-foreground",children:["No settings match ",c.jsx("span",{className:"font-medium text-foreground",children:Ve}),"."]})});return c.jsxs("div",{className:"mx-auto w-full max-w-5xl space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-end md:justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Settings"}),c.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Signed in as ",c.jsx("span",{className:"font-medium text-foreground",children:e})]})]}),c.jsxs("div",{className:"relative w-full md:max-w-sm",children:[c.jsx(rl,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:Ve,onChange:$e=>le($e.target.value),placeholder:"Search settings...",className:"pl-9"})]})]}),c.jsxs(Y0,{value:_e,onValueChange:$e=>ge($e),className:"space-y-4",children:[c.jsxs(ag,{className:"flex h-auto w-full flex-wrap justify-start gap-1 rounded-xl bg-muted/70 p-1",children:[c.jsx(Qs,{value:"general",className:"flex-1 sm:flex-none",children:"General"}),c.jsx(Qs,{value:"api",className:"flex-1 sm:flex-none",children:"API"}),c.jsx(Qs,{value:"tools",className:"flex-1 sm:flex-none",children:"Tools"}),c.jsx(Qs,{value:"extensions",className:"flex-1 sm:flex-none",children:"Extensions"}),c.jsx(Qs,{value:"skills",className:"flex-1 sm:flex-none",children:"Skills"}),c.jsx(Qs,{value:"channels",className:"flex-1 sm:flex-none",children:"Channels"}),c.jsx(Qs,{value:"activity",className:"flex-1 sm:flex-none",children:"Activity"})]}),c.jsxs(ea,{value:"general",className:"space-y-6",children:[nt&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"flex items-center gap-2 text-base font-medium",children:[c.jsx(vY,{className:"h-4 w-4"}),Fe("Software Update")]}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:[v?c.jsxs(c.Fragment,{children:["Gateway ",c.jsxs("span",{className:"font-mono font-medium text-foreground",children:["v",v.currentVersion]})]}):"Check for the latest Jait version.",Kt&&c.jsxs(c.Fragment,{children:[" · Desktop app ",c.jsxs("span",{className:"font-mono font-medium text-foreground",children:["v",Kt]})]})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs(we,{variant:"outline",size:"sm",onClick:_,disabled:b||w,children:[b?c.jsx(Ft,{className:"mr-1.5 h-4 w-4 animate-spin"}):null,b?"Checking...":"Check for updates"]}),(v==null?void 0:v.hasUpdate)&&c.jsxs(c.Fragment,{children:[c.jsxs(we,{size:"sm",onClick:S,disabled:w,children:[w?c.jsx(Ft,{className:"mr-1.5 h-4 w-4 animate-spin"}):c.jsx(gp,{className:"mr-1.5 h-4 w-4"}),w?"Updating...":`Update gateway to v${v.latestVersion}`]}),C==="electron"?c.jsxs(we,{size:"sm",variant:"outline",onClick:async()=>{const $e=window.jaitDesktop;(await $e.checkForUpdate()).updateAvailable&&(await $e.downloadUpdate(),await $e.installUpdate())},children:[c.jsx(gp,{className:"mr-1.5 h-4 w-4"}),"Update desktop app"]}):C!=="web"&&c.jsx(we,{size:"sm",variant:"outline",asChild:!0,children:c.jsxs("a",{href:"https://github.com/Widev-e-U/Jait/releases/latest",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(gp,{className:"mr-1.5 h-4 w-4"}),"Download latest APK"]})})]})]}),v&&!v.hasUpdate&&c.jsxs("p",{className:"flex items-center gap-1.5 text-sm text-green-600 dark:text-green-400",children:[c.jsx(ia,{className:"h-3.5 w-3.5"}),"You're on the latest version."]}),(v==null?void 0:v.hasUpdate)&&c.jsxs("p",{className:"flex items-center gap-1.5 text-sm text-amber-600 dark:text-amber-400",children:[c.jsx(na,{className:"h-3.5 w-3.5"}),"Version ",v.latestVersion," is available",C!=="web"?" — download from jait.dev":"","."]})]}),Gt&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Editor theme")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Import a VS Code theme JSON file and apply its Monaco token colors plus a mapped shell palette."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("input",{ref:it,type:"file",accept:".json,application/json",className:"hidden",onChange:$e=>{sr($e)}}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>{var $e;return($e=it.current)==null?void 0:$e.click()},children:"Import theme JSON"}),c.jsx(we,{variant:"ghost",size:"sm",disabled:!xt,onClick:()=>wj(null),children:"Use built-in theme"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Imported themes stay local to this device. The quick light/system/dark toggle falls back to the built-in theme set."}),Xe.length>0?c.jsx("div",{className:"space-y-2",children:Xe.map($e=>{const ft=(xt==null?void 0:xt.id)===$e.id;return c.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"truncate text-sm font-medium",children:$e.name}),c.jsx(Ar,{variant:ft?"default":"outline",className:"h-5 px-1.5 text-2xs",children:ft?"active":$e.colorMode})]}),c.jsx("p",{className:"truncate text-xs text-muted-foreground",children:$e.sourceLabel})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[!ft&&c.jsx(we,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>wj($e.id),children:"Apply"}),c.jsx(we,{variant:"ghost",size:"sm",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:()=>_De($e.id),children:"Remove"})]})]},$e.id)})}):c.jsx("p",{className:"text-sm text-muted-foreground",children:"No imported themes yet."})]}),Ue&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Desktop")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Settings specific to the desktop application."})]}),c.jsxs("div",{className:"flex max-w-md items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"close-on-window-close",children:"Quit on window close"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"When off, closing the window minimizes Jait to the system tray."})]}),c.jsx(gf,{id:"close-on-window-close",checked:Pt,onCheckedChange:$e=>{var ft;Ht($e),(ft=window.jaitDesktop)==null||ft.setSetting("closeOnWindowClose",$e)}})]})]}),$t&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Gateway connection")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Desktop and mobile clients can connect to a different Jait gateway."})]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current gateway: ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:qn()})]})]}),Ot&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Session archive")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Permanently remove archived sessions and their messages from your account."})]}),c.jsx("div",{children:c.jsx(we,{variant:"destructive",onClick:()=>{Je()},disabled:R,children:R?"Clearing...":"Clear archived sessions"})})]}),Yt&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Project archive")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Restore or permanently remove archived projects and their sessions."})]}),c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[c.jsx(we,{className:"w-full sm:w-auto",variant:"outline",onClick:()=>{bt()},disabled:I,children:I?c.jsxs(c.Fragment,{children:[c.jsx(Ft,{className:"mr-2 h-3.5 w-3.5 animate-spin"})," Loading..."]}):"Show archived projects"}),c.jsx(we,{className:"w-full sm:w-auto",variant:"destructive",onClick:()=>{ct()},disabled:G,children:G?"Clearing...":"Clear all archived"})]}),z.length>0&&c.jsx("div",{className:"space-y-2",children:z.map($e=>c.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(xR,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-medium truncate",children:$e.title||$e.rootPath||$e.id}),$e.rootPath&&$e.title&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:$e.rootPath})]})]}),c.jsxs(we,{variant:"outline",size:"sm",className:"shrink-0 h-7 text-xs",onClick:()=>{zt($e.id)},disabled:D===$e.id,children:[D===$e.id?c.jsx(Ft,{className:"mr-1.5 h-3 w-3 animate-spin"}):c.jsx(P0e,{className:"mr-1.5 h-3 w-3"}),"Restore"]})]},$e.id))})]}),rr&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Jait LLM Backend")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose which API backend the Jait provider uses for model inference."})]}),c.jsxs("div",{className:"max-w-sm",children:[c.jsx(mi,{htmlFor:"jait-backend",className:"mb-1.5 block",children:"Backend provider"}),c.jsxs(sh,{value:o,onValueChange:$e=>{l($e)},children:[c.jsx(ed,{id:"jait-backend",children:c.jsx(ah,{placeholder:"Select backend"})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"openai",children:"OpenAI (direct)"}),c.jsx(Ls,{value:"openrouter",children:"OpenRouter"}),c.jsx(Ls,{value:"ollama",children:"Ollama (local)"})]})]}),c.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:o==="openrouter"?"Models will be fetched from OpenRouter. Set your OPENROUTER_API_KEY in the API tab.":o==="ollama"?"Models will be fetched from your local Ollama instance. Set OLLAMA_URL in the API tab if not running on localhost:11434.":"Uses your OPENAI_API_KEY and OPENAI_BASE_URL."})]})]}),or&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Provider accounts")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage CLI provider sessions. Login is started from the provider picker; logout is handled here."})]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>{Ye()},disabled:ae,children:[ae?c.jsx(Ft,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):c.jsx(Js,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})]}),c.jsx("div",{className:"space-y-2",children:ee.length===0&&!ae?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No provider account actions are available on this gateway."}):ee.map($e=>{const ft=$e.auth,vt=$e.id,gt=(ft==null?void 0:ft.authenticated)===!0,$r=(ft==null?void 0:ft.authenticated)===!1,mr=fe===vt;return c.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border px-3 py-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("p",{className:"text-sm font-medium",children:GU[vt]??$e.name}),c.jsx(Ar,{variant:gt?"success":"outline",className:"text-2xs",children:gt?"signed in":(ft==null?void 0:ft.authenticated)===!1?"signed out":"unknown"})]}),(ft==null?void 0:ft.detail)&&c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:ft.detail})]}),(ft==null?void 0:ft.logout)&&c.jsxs(we,{className:"w-full sm:w-auto",variant:"outline",size:"sm",onClick:()=>{dt(vt)},disabled:mr||fe!==null||$r,children:[mr?c.jsx(Ft,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):c.jsx(xA,{className:"mr-1.5 h-3.5 w-3.5"}),"Logout"]})]},$e.id)})})]}),ke&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Spracheingabe (Speech-to-Text)")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Wähle aus, wie gesprochene Sprache in Text umgewandelt wird, bevor sie als Nachricht gesendet wird."})]}),c.jsxs("div",{className:"max-w-sm",children:[c.jsx(mi,{htmlFor:"stt-provider",className:"mb-1.5 block",children:"STT-Anbieter"}),c.jsxs(sh,{value:s,onValueChange:$e=>{a($e)},children:[c.jsx(ed,{id:"stt-provider",children:c.jsx(ah,{placeholder:"STT-Anbieter wählen"})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"whisper",children:"Faster Whisper (lokal)"}),c.jsx(Ls,{value:"gpt",children:"GPT (OpenAI)"}),c.jsx(Ls,{value:"elevenlabs",children:"ElevenLabs Scribe"}),c.jsx(Ls,{value:"wyoming",children:"Wyoming / Whisper (Home Assistant)"})]})]})]}),s==="whisper"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uses a local Faster Whisper server for free, offline transcription. Start the server with ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"python whisper-server/server.py"})," from the gateway package. Optionally set ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"WHISPER_URL"})," in API keys below (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"http://localhost:8178"}),")."]})}),s==="wyoming"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configure your Home Assistant Wyoming/Whisper STT integration. Set these values in the API keys section below: ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"HA_URL"}),", ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"HA_TOKEN"}),", and optionally ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"HA_STT_ENTITY"})," (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"stt.faster_whisper"}),")."]})}),s==="gpt"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uses OpenAI audio transcription. Set ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"OPENAI_API_KEY"})," and optionally ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"OPENAI_TRANSCRIBE_MODEL"})," (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"gpt-4o-mini-transcribe"}),")."]})}),s==="elevenlabs"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uses ElevenLabs Speech to Text. Set ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"ELEVENLABS_API_KEY"})," and optionally ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"ELEVENLABS_STT_MODEL"})," (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"scribe_v2"}),") and ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"ELEVENLABS_LANGUAGE_CODE"}),"."]})})]}),!Gt&&!nt&&!Ue&&!$t&&!Ot&&!Yt&&!rr&&!or&&!ke&&qe]}),c.jsx(ea,{value:"api",className:"space-y-6 pb-20",children:at.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Values stored here are user-specific and override environment defaults for your account."}),Kce.map($e=>{const ft=$e.fields.filter(gt=>at.includes(gt));if(ft.length===0)return null;const vt=Pot(ft[0]);return c.jsx(nk,{defaultOpen:!1,children:c.jsxs(Zr,{className:"p-0 overflow-hidden",children:[c.jsxs(ik,{className:"flex w-full items-center gap-2 px-5 py-3.5 text-left hover:bg-muted/50 transition-colors group",children:[c.jsx(js,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),vt?c.jsx(vt,{size:16,className:"text-muted-foreground"}):c.jsx(CY,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:Fe($e.label)})]}),c.jsx(sk,{children:c.jsx("div",{className:"grid gap-4 px-5 pb-5 md:grid-cols-2",children:ft.map(gt=>{const $r=Lot(gt),mr=!!q[gt];return c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(mi,{htmlFor:`api-${gt}`,className:"font-mono text-xs",children:Fe(gt)}),Pe(gt)]}),c.jsxs("div",{className:"relative",children:[c.jsx(Ln,{id:`api-${gt}`,type:$r&&!mr?"password":"text",value:j[gt]??"",onChange:Ur=>{E(Xt=>({...Xt,[gt]:Ur.target.value}))},placeholder:U[gt]?"(set via .env)":"(empty)",className:$r?"pr-9":""}),$r&&c.jsx("button",{type:"button",className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>Te(gt),tabIndex:-1,"aria-label":mr?"Hide value":"Show value",children:mr?c.jsx(Hd,{className:"h-4 w-4"}):c.jsx(tf,{className:"h-4 w-4"})})]})]},gt)})})})]})},$e.label)}),c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-30 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:c.jsxs("div",{className:"mx-auto flex max-w-5xl items-center gap-3 px-4 py-3 sm:px-6",children:[c.jsx(we,{onClick:()=>{Oe()},disabled:A||!ht,children:A?"Saving...":"Save API settings"}),c.jsx(we,{variant:"ghost",onClick:At,disabled:!ht,children:"Discard"}),$&&c.jsx("span",{className:"text-sm text-muted-foreground",children:$}),K&&c.jsx("span",{className:"text-sm text-destructive",children:K})]})})]}):qe}),c.jsx(ea,{value:"tools",className:"space-y-6",children:Ze?c.jsx(_it,{token:r}):qe}),c.jsx(ea,{value:"extensions",className:"space-y-6",children:ze?c.jsx(Cit,{token:r}):qe}),c.jsx(ea,{value:"skills",className:"space-y-6",children:mt?c.jsx(Tit,{token:r}):qe}),c.jsx(ea,{value:"channels",className:"space-y-6",children:yt?c.jsx(Mit,{token:r}):qe}),c.jsxs(ea,{value:"activity",className:"space-y-6",children:[Rt&&g&&g.length>0&&c.jsxs(Zr,{className:"p-5 space-y-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Recent activity")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Recent chat messages and terminal sessions."})]}),c.jsx(Rit,{events:g})]}),Rt&&(!g||g.length===0)&&c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"No recent activity yet."})}),!Rt&&qe]})]})]})}function Bot(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,a,o,l=[],d=!0,u=!1;try{if(a=(n=n.call(e)).next,r===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(i=a.call(n)).done)&&(l.push(i.value),l.length!==r);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function zot(e,r,n){return r=Kot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function KU(e,r){return Wot(e)||Bot(e,r)||Yce(e,r)||qot()}function Fot(e){return Hot(e)||Uot(e)||Yce(e)||Vot()}function Hot(e){if(Array.isArray(e))return M7(e)}function Wot(e){if(Array.isArray(e))return e}function Uot(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yce(e,r){if(e){if(typeof e=="string")return M7(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 M7(e,r)}}function M7(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 Vot(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1230
|
+
`:"")+g,i.push({type:"text",content:g})}break}}}return l(),r}const yU=qn(),vU={core:{variant:"default",label:"core"},standard:{variant:"secondary",label:"standard"},external:{variant:"warning",label:"external"}},xU=["meta","terminal","filesystem","os","agent","browser","web","surfaces","scheduler","memory","voice","screen","gateway","external"];function _it({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(!1),[l,d]=y.useState(null),[u,h]=y.useState("");y.useEffect(()=>{if(!e)return;let S=!1;return(async()=>{try{const w=await fetch(`${yU}/api/auth/settings/tools`,{headers:{Authorization:`Bearer ${e}`}});if(!S)if(w.ok){const C=await w.json();n(C.tools)}else d(`Failed to load tools (${w.status})`)}catch{S||d("Failed to load tools")}finally{S||s(!1)}})(),()=>{S=!0}},[e]);const f=y.useCallback(async(S,w)=>{if(e){n(C=>C.map(j=>j.name===S?{...j,enabled:w}:j)),o(!0),d(null);try{const C=r.map(E=>E.name===S?{...E,enabled:w}:E).filter(E=>!E.enabled&&!E.locked).map(E=>E.name);if(!(await fetch(`${yU}/api/auth/settings/tools`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({disabled_tools:C})})).ok)throw new Error("Failed to save")}catch{n(C=>C.map(j=>j.name===S?{...j,enabled:!w}:j)),d("Failed to update tool setting")}finally{o(!1)}}},[e,r]),g=new Map,v=u.trim().toLowerCase();for(const S of r){if(v&&!`${S.name} ${S.description} ${S.category}`.toLowerCase().includes(v))continue;const w=S.category;g.has(w)||g.set(w,[]),g.get(w).push(S)}const b=[...g.keys()].sort((S,w)=>{const C=xU.indexOf(S),j=xU.indexOf(w);return(C===-1?999:C)-(j===-1?999:j)}),_={total:r.length,enabled:r.filter(S=>S.enabled).length,core:r.filter(S=>S.tier==="core").length,standard:r.filter(S=>S.tier==="standard").length,external:r.filter(S=>S.tier==="external").length};return i?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."})}):c.jsxs(Zr,{className:"p-5 space-y-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:"Tools"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage which tools are available to the AI agent. Core tools are always enabled. Standard tools can be toggled. External (MCP) tools are discovered on demand."})]}),c.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(W4,{className:"h-3.5 w-3.5"}),_.core," core"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(kR,{className:"h-3.5 w-3.5"}),_.standard," standard"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(R2,{className:"h-3.5 w-3.5"}),_.external," external"]}),c.jsxs("span",{className:"ml-auto",children:[_.enabled,"/",_.total," enabled"]})]}),c.jsxs("div",{className:"relative",children:[c.jsx(rl,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Ln,{placeholder:"Filter tools...",value:u,onChange:S=>h(S.target.value),className:"pl-9"})]}),l&&c.jsx("p",{className:"text-sm text-destructive",children:l}),c.jsxs("div",{className:"space-y-5",children:[b.map(S=>{const w=g.get(S);return c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide mb-2",children:S}),c.jsx("div",{className:"space-y-1",children:w.map(C=>{const j=vU[C.tier]??vU.standard;return c.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded-md hover:bg-muted/50 transition-colors",children:[c.jsx(gf,{checked:C.enabled,onCheckedChange:E=>{f(C.name,E)},disabled:C.locked||a,"aria-label":`Toggle ${C.name}`}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-mono text-sm font-medium",children:C.name}),c.jsx(Ar,{variant:j.variant,className:"text-2xs px-1.5 py-0",children:j.label}),C.source==="mcp"&&c.jsx(Ar,{variant:"outline",className:"text-2xs px-1.5 py-0",children:"MCP"})]}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.name)})})]},S)}),b.length===0&&c.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:v?"No tools match your filter.":"No tools available."})]})]})}const U_=qn(),wit={installed:{variant:"secondary",label:"installed"},enabled:{variant:"default",label:"enabled"},disabled:{variant:"outline",label:"disabled"},error:{variant:"destructive",label:"error"}};function Mce(e){return y.useCallback(()=>{const r={};return e&&(r.Authorization=`Bearer ${e}`),r},[e])}function Sit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),[l,d]=y.useState(""),[u,h]=y.useState(null),f=Mce(e),g=y.useCallback(async()=>{s(!0),o(null);try{const C=await fetch(`${U_}/api/plugins`,{headers:f()});if(!C.ok)throw new Error(`Failed to load extensions (HTTP ${C.status})`);const j=await C.json();n(j)}catch(C){o(C instanceof Error?C.message:"Failed to load extensions")}finally{s(!1)}},[f]);y.useEffect(()=>{g()},[g]);const v=y.useCallback(async(C,j)=>{h(C);try{const E=j?"enable":"disable",A=await fetch(`${U_}/api/plugins/${encodeURIComponent(C)}/${E}`,{method:"POST",headers:f()});if(!A.ok){const N=await A.json().catch(()=>({}));throw new Error(N.error??`Failed to ${E} (HTTP ${A.status})`)}await g()}catch(E){o(E instanceof Error?E.message:"Action failed")}finally{h(null)}},[f,g]),b=y.useCallback(async C=>{h(C);try{const j=await fetch(`${U_}/api/plugins/${encodeURIComponent(C)}`,{method:"DELETE",headers:f()});if(!j.ok){const E=await j.json().catch(()=>({}));throw new Error(E.error??`Failed to uninstall (HTTP ${j.status})`)}await g()}catch(j){o(j instanceof Error?j.message:"Action failed")}finally{h(null)}},[f,g]),_=y.useCallback(async()=>{s(!0);try{const C=await fetch(`${U_}/api/plugins/scan`,{method:"POST",headers:f()});if(!C.ok)throw new Error(`Scan failed (HTTP ${C.status})`);const j=await C.json();n(j)}catch(C){o(C instanceof Error?C.message:"Scan failed")}finally{s(!1)}},[f]),S=l.toLowerCase(),w=r.filter(C=>S?C.id.toLowerCase().includes(S)||C.displayName.toLowerCase().includes(S)||(C.description??"").toLowerCase().includes(S)||(C.author??"").toLowerCase().includes(S):!0);return i&&r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading extensions..."})}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(rl,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:l,onChange:C=>d(C.target.value),placeholder:"Filter extensions...",className:"pl-9"})]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void _(),disabled:i,children:[c.jsx(Js,{className:`mr-1.5 h-3.5 w-3.5 ${i?"animate-spin":""}`}),"Scan"]})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),w.length===0&&!i&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(R2,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:r.length===0?"No extensions installed. Drop plugin folders into ~/.jait/extensions/ and click Scan.":"No extensions match your filter."})]}),w.map(C=>{const j=wit[C.status],E=C.status==="enabled",A=u===C.id;return c.jsxs(Zr,{className:"flex items-start gap-4 p-4",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(R2,{className:"h-5 w-5 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:C.displayName}),c.jsx(Ar,{variant:j.variant,className:"text-2xs",children:j.label}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",C.version]})]}),C.description&&c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:C.description}),C.author&&c.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["by ",C.author]}),C.error&&c.jsx("p",{className:"mt-1 text-xs text-destructive",children:C.error}),c.jsx("p",{className:"mt-0.5 text-2xs text-muted-foreground/60 font-mono",children:C.id})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx(gf,{checked:E,disabled:A,onCheckedChange:N=>void v(C.id,N),"aria-label":E?"Disable":"Enable"}),c.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",disabled:A,onClick:()=>void b(C.id),title:"Uninstall",children:c.jsx(Rl,{className:"h-4 w-4"})})]})]},C.id)})]})}function kit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),l=Mce(e),d=y.useCallback(async()=>{s(!0),o(null);try{const u=await fetch(`${U_}/api/store/packages?limit=50`,{headers:l()});if(!u.ok)throw new Error(`Failed to browse ClawHub (HTTP ${u.status})`);const h=await u.json();n(h.items??[])}catch(u){o(u instanceof Error?u.message:"Failed to load marketplace")}finally{s(!1)}},[l]);return y.useEffect(()=>{d()},[d]),c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Zr,{className:"bg-muted/30 p-4 text-sm text-muted-foreground",children:["Browse OpenClaw plugins on"," ",c.jsx("a",{href:"https://clawhub.ai/plugins",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"ClawHub"}),". To install, download the plugin and place it in"," ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.jait/extensions/"}),", then click Scan on the Installed tab."]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),i&&r.length===0&&c.jsxs(Zr,{className:"flex items-center justify-center gap-2 p-8",children:[c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading from ClawHub..."})]}),!i&&r.length===0&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(R2,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"No packages available."})]}),r.map((u,h)=>{const f=u.displayName??u.name??"Unknown",g=u.description??"",v=u.type??"plugin";return c.jsxs(Zr,{className:"flex items-start gap-3 p-4",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(R2,{className:"h-4 w-4 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:f}),u.version&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",u.version]}),c.jsx(Ar,{variant:"outline",className:"text-2xs",children:v})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:g}),u.author&&c.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["by @",u.author]})]}),c.jsx("a",{href:`https://clawhub.ai/plugins/${encodeURIComponent(u.name??"")}`,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(we,{variant:"outline",size:"sm",className:"h-7 text-xs",children:[c.jsx(jp,{className:"mr-1 h-3 w-3"}),"View"]})})]},u.name??h)})]})}function Cit({token:e}){return c.jsxs(Y0,{defaultValue:"installed",className:"space-y-4",children:[c.jsxs(Zr,{className:"space-y-3 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:"Extensions"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Manage plugins and extensions. Browse the"," ",c.jsx("a",{href:"https://clawhub.ai/plugins",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"ClawHub"})," ","marketplace or drop plugins into"," ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.jait/extensions/"}),"."]})]}),c.jsxs(ag,{children:[c.jsx(Qs,{value:"installed",children:"Installed"}),c.jsx(Qs,{value:"marketplace",children:"Marketplace"})]})]}),c.jsx(ea,{value:"installed",className:"mt-0 space-y-4",children:c.jsx(Sit,{token:e})}),c.jsx(ea,{value:"marketplace",className:"mt-0 space-y-4",children:c.jsx(kit,{token:e})})]})}const S2=qn();function bU(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}const _U={bundled:{variant:"default",label:"bundled"},user:{variant:"secondary",label:"user"},project:{variant:"outline",label:"project"},plugin:{variant:"secondary",label:"plugin"}};function Rce(e){return y.useCallback(()=>{const r={"Content-Type":"application/json"};return e&&(r.Authorization=`Bearer ${e}`),r},[e])}function jit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),[l,d]=y.useState(""),[u,h]=y.useState(null),[f,g]=y.useState(null),v=Rce(e),b=y.useCallback(async()=>{s(!0),o(null);try{const j=await fetch(`${S2}/api/skills`,{headers:v()});if(!j.ok)throw new Error(`Failed to load skills (HTTP ${j.status})`);const E=await j.json();n(E)}catch(j){o(j instanceof Error?j.message:"Failed to load skills")}finally{s(!1)}},[v]);y.useEffect(()=>{b()},[b]);const _=y.useCallback(async(j,E)=>{h(j);try{const A=await fetch(`${S2}/api/skills/${encodeURIComponent(j)}`,{method:"PATCH",headers:v(),body:JSON.stringify({enabled:E})});if(!A.ok)throw new Error(`Failed to update skill (HTTP ${A.status})`);n(N=>N.map(R=>R.id===j?{...R,enabled:E}:R))}catch(A){o(A instanceof Error?A.message:"Action failed")}finally{h(null)}},[v]),S=y.useCallback(async j=>{g(j),o(null);try{const E=await fetch(`${S2}/api/skills/${encodeURIComponent(j)}/install-tool`,{method:"POST",headers:v(),body:JSON.stringify({})}),A=await E.json().catch(()=>({}));if(!E.ok)throw new Error(A.error??`Install failed (HTTP ${E.status})`);const N=A.skill;N?n(R=>R.map(B=>B.id===j?N:B)):await b()}catch(E){o(E instanceof Error?E.message:"Install failed")}finally{g(null)}},[v,b]),w=l.toLowerCase(),C=r.filter(j=>w?j.id.toLowerCase().includes(w)||j.name.toLowerCase().includes(w)||j.description.toLowerCase().includes(w)||j.source.includes(w):!0);return i&&r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading skills..."})}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx(rl,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:l,onChange:j=>d(j.target.value),placeholder:"Filter installed skills...",className:"pl-9"})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),C.length===0&&!i&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(W5,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:r.length===0?"No skills discovered. Install from the Marketplace or create a SKILL.md in ~/.jait/skills/.":"No skills match your filter."})]}),C.map(j=>{var N;const E=_U[j.source]??_U.user,A=u===j.id;return c.jsxs(Zr,{className:"flex items-start gap-3 p-4",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(W5,{className:"h-4 w-4 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:j.name}),c.jsx(Ar,{variant:E.variant,className:"text-2xs",children:E.label})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:j.description}),c.jsx("p",{className:"mt-0.5 text-2xs text-muted-foreground/60 font-mono truncate",children:j.filePath}),j.missingTools&&j.missingTools.length>0&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"flex items-center gap-1 text-2xs text-amber-600 dark:text-amber-500",children:[c.jsx(na,{className:"h-3 w-3"}),"Needs: ",j.missingTools.join(", ")]}),j.install&&j.install.length>0&&c.jsxs(we,{size:"sm",variant:"outline",disabled:f===j.id,onClick:()=>void S(j.id),className:"h-6 text-2xs",children:[f===j.id?c.jsx(Ft,{className:"mr-1 h-3 w-3 animate-spin"}):c.jsx(gp,{className:"mr-1 h-3 w-3"}),((N=j.install[0])==null?void 0:N.label)??"Install tool"]})]})]}),c.jsx(gf,{checked:j.enabled,disabled:A,onCheckedChange:R=>void _(j.id,R),"aria-label":j.enabled?"Disable":"Enable",className:"shrink-0"})]},j.id)})]})}function Nit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),[l,d]=y.useState(""),[u,h]=y.useState("tool workflow agent"),[f,g]=y.useState(null),v=y.useRef(null),b=Rce(e),_=y.useCallback(async(C,j)=>{s(!0),o(null);try{const E=new URLSearchParams;C?E.set("q",C):E.set("sort",j??"tool workflow agent"),E.set("limit","25");const A=await fetch(`${S2}/api/store/skills?${E}`,{headers:b()});if(!A.ok)throw new Error(`Failed to browse ClawHub (HTTP ${A.status})`);const N=await A.json();n(N.results??[])}catch(E){o(E instanceof Error?E.message:"Failed to load marketplace")}finally{s(!1)}},[b]);y.useEffect(()=>{_(void 0,u)},[_,u]);const S=y.useCallback(C=>{d(C),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{_(C||void 0,u)},400)},[_,u]),w=y.useCallback(async C=>{g(C),o(null);try{const j=await fetch(`${S2}/api/store/skills/${encodeURIComponent(C)}/install`,{method:"POST",headers:b(),body:JSON.stringify({})});if(!j.ok){const E=await j.json().catch(()=>({}));throw new Error(E.error??`Install failed (HTTP ${j.status})`)}n(E=>E.map(A=>A.slug===C?{...A,installed:!0}:A))}catch(j){o(j instanceof Error?j.message:"Install failed")}finally{g(null)}},[b]);return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(rl,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:l,onChange:C=>S(C.target.value),placeholder:"Search ClawHub skills...",className:"pl-9"})]}),c.jsxs("select",{value:u,onChange:C=>h(C.target.value),className:"h-9 rounded-md border bg-background px-3 text-sm",children:[c.jsx("option",{value:"tool workflow agent",children:"Popular"}),c.jsx("option",{value:"memory learning self-improving",children:"Memory"}),c.jsx("option",{value:"search web browser automation",children:"Search"}),c.jsx("option",{value:"git github code development",children:"Development"}),c.jsx("option",{value:"calendar slack obsidian productivity",children:"Productivity"})]})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),i&&r.length===0&&c.jsxs(Zr,{className:"flex items-center justify-center gap-2 p-8",children:[c.jsx(Ft,{className:"h-5 w-5 animate-spin text-muted-foreground"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading from ClawHub..."})]}),!i&&r.length===0&&c.jsxs(Zr,{className:"p-8 text-center",children:[c.jsx(rl,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:l?"No skills match your search.":"No skills available."})]}),r.map(C=>{var z,W,I;const j=C.slug??"",E=C.displayName??j,A=C.summary??"",N=((z=C.latestVersion)==null?void 0:z.version)??C.version??"",R=((W=C.stats)==null?void 0:W.stars)??0,B=((I=C.stats)==null?void 0:I.downloads)??0,G=C.installed===!0,H=f===j;return c.jsxs(Zr,{className:"flex items-start gap-3 p-4",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:c.jsx(W5,{className:"h-4 w-4 text-muted-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:E}),N&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",N]})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground line-clamp-2",children:A}),c.jsxs("div",{className:"mt-1 flex items-center gap-3 text-xs text-muted-foreground",children:[R>0&&c.jsxs("span",{className:"flex items-center gap-0.5",children:[c.jsx(Nve,{className:"h-3 w-3"}),bU(R)]}),B>0&&c.jsxs("span",{className:"flex items-center gap-0.5",children:[c.jsx(gp,{className:"h-3 w-3"}),bU(B)]}),c.jsxs("a",{href:`https://clawhub.ai/skills?focus=search&q=${encodeURIComponent(j)}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-0.5 hover:text-foreground",children:[c.jsx(jp,{className:"h-3 w-3"}),"ClawHub"]})]})]}),c.jsx("div",{className:"shrink-0",children:G?c.jsxs(Ar,{variant:"secondary",className:"flex items-center gap-1 text-2xs",children:[c.jsx(gs,{className:"h-3 w-3"}),"Installed"]}):c.jsxs(we,{size:"sm",variant:"outline",disabled:H,onClick:()=>void w(j),className:"h-7 text-xs",children:[H?c.jsx(Ft,{className:"mr-1 h-3 w-3 animate-spin"}):c.jsx(gp,{className:"mr-1 h-3 w-3"}),"Install"]})})]},j)})]})}function Tit({token:e}){return c.jsxs(Y0,{defaultValue:"installed",className:"space-y-4",children:[c.jsxs(Zr,{className:"space-y-3 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:"Skills"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Specialized instruction sets that teach the AI how to use specific tools and workflows. Install from"," ",c.jsx("a",{href:"https://clawhub.ai/skills",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"ClawHub"})," ","or place SKILL.md files in"," ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.jait/skills/"}),"."]})]}),c.jsxs(ag,{children:[c.jsx(Qs,{value:"installed",children:"Installed"}),c.jsx(Qs,{value:"marketplace",children:"Marketplace"})]})]}),c.jsx(ea,{value:"installed",className:"mt-0 space-y-4",children:c.jsx(jit,{token:e})}),c.jsx(ea,{value:"marketplace",className:"mt-0 space-y-4",children:c.jsx(Nit,{token:e})})]})}const V_=qn();function q_(e){return e?{Authorization:`Bearer ${e}`}:{}}const Eit={stopped:{label:"Disconnected",variant:"outline"},connecting:{label:"Connecting…",variant:"secondary"},qr:{label:"Scan QR to link",variant:"secondary"},connected:{label:"Connected",variant:"default"},error:{label:"Error",variant:"destructive"}};function Ait(e){return e.id==="whatsapp"?"Link your WhatsApp so the assistant can reply to messages. Scan the QR with WhatsApp Linked devices.":e.id==="msteams"?"Connect a Microsoft Teams bot so the assistant can reply to Teams conversations.":"Connect this messaging channel so the assistant can reply through it."}function Oit({token:e,channel:r,onChanged:n}){const[i,s]=y.useState(!1),[a,o]=y.useState(null),[l,d]=y.useState(r.qr),[u,h]=y.useState(r.status),[f,g]=y.useState(),[v,b]=y.useState((r.config.allowedSenders??[]).join(", ")),[_,S]=y.useState(!!r.config.respondToAll),w=y.useRef(null),C=y.useCallback(()=>{w.current&&(clearInterval(w.current),w.current=null)},[]);y.useEffect(()=>{if(u!=="qr"&&u!=="connecting"){C();return}if(!w.current)return w.current=setInterval(async()=>{try{const B=await fetch(`${V_}/api/channels/${r.id}/status`,{headers:q_(e)});if(!B.ok)return;const G=await B.json();h(G.status),d(G.qr),g(G.error),G.status==="connected"&&(C(),n()),G.status==="error"&&C()}catch{}},2e3),C},[u,r.id,e,C,n]),y.useEffect(()=>()=>C(),[C]);const j=y.useCallback(async()=>{s(!0),o(null);try{const B=await fetch(`${V_}/api/channels/${r.id}/start`,{method:"POST",headers:q_(e)}),G=await B.json().catch(()=>({}));if(!B.ok)throw new Error(G.error??`Failed to start (HTTP ${B.status})`);h(G.status??"connecting"),d(G.qr??null)}catch(B){o(B instanceof Error?B.message:"Failed to start")}finally{s(!1)}},[r.id,e]),E=y.useCallback(async()=>{s(!0),o(null);try{const B=await fetch(`${V_}/api/channels/${r.id}/stop`,{method:"POST",headers:q_(e)});if(!B.ok)throw new Error(`Failed to stop (HTTP ${B.status})`);h("stopped"),d(null),C()}catch(B){o(B instanceof Error?B.message:"Failed to stop")}finally{s(!1)}},[r.id,e,C]),A=y.useCallback(async()=>{s(!0),o(null);try{const B=v.split(",").map(H=>H.trim()).filter(Boolean),G=await fetch(`${V_}/api/channels/${r.id}/config`,{method:"PATCH",headers:{...q_(e),"Content-Type":"application/json"},body:JSON.stringify({allowedSenders:B,respondToAll:_})});if(!G.ok)throw new Error(`Failed to save (HTTP ${G.status})`)}catch(B){o(B instanceof Error?B.message:"Failed to save")}finally{s(!1)}},[v,_,r.id,e]),N=Eit[u],R=u==="qr";return c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:c.jsx(C1e,{className:"h-5 w-5"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:r.label}),c.jsx(Ar,{variant:N.variant,className:"text-2xs",children:N.label})]}),c.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:Ait(r)})]}),c.jsx("div",{className:"shrink-0",children:u==="connected"?c.jsxs(we,{size:"sm",variant:"outline",disabled:i,onClick:()=>void E(),className:"h-8 text-xs",children:[i?c.jsx(Ft,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):c.jsx(tve,{className:"mr-1 h-3.5 w-3.5"}),"Disconnect"]}):c.jsxs(we,{size:"sm",disabled:i,onClick:()=>void j(),className:"h-8 text-xs",children:[i?c.jsx(Ft,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):c.jsx(jY,{className:"mr-1 h-3.5 w-3.5"}),u==="qr"||u==="connecting"?"Restart":"Connect"]})})]}),(a||f)&&c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsx("span",{children:a??f})]}),R&&c.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border bg-muted/30 p-5",children:[l?c.jsx("img",{src:l,alt:`${r.label} link QR code`,className:"h-72 w-72 rounded bg-white p-2 [image-rendering:pixelated]"}):c.jsx("div",{className:"flex h-72 w-72 items-center justify-center",children:c.jsx(Ft,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),c.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(Js,{className:"h-3 w-3"})," QR refreshes automatically — scan it with your phone."]})]}),u==="connected"&&c.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-emerald-500/40 bg-emerald-500/5 p-3 text-sm text-emerald-700 dark:text-emerald-400",children:[c.jsx(ia,{className:"h-4 w-4"})," Linked. The assistant will reply based on the rules below."]}),c.jsxs("div",{className:"space-y-3 border-t pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium",children:"Respond to everyone"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"When off, replies only to your self-chat and the allowed numbers below."})]}),c.jsx(gf,{checked:_,onCheckedChange:S})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium",children:"Allowed senders"}),c.jsx(Ln,{value:v,onChange:B=>b(B.target.value),placeholder:"e.g. +49170…, +1202… (comma-separated, blank = self-chat only)"})]}),c.jsx(we,{size:"sm",variant:"outline",disabled:i,onClick:()=>void A(),className:"h-8 text-xs",children:"Save rules"})]})]})}function Mit({token:e}){const[r,n]=y.useState([]),[i,s]=y.useState(!0),[a,o]=y.useState(null),l=y.useCallback(async()=>{s(!0),o(null);try{const d=await fetch(`${V_}/api/channels`,{headers:q_(e)});if(!d.ok)throw new Error(`Failed to load channels (HTTP ${d.status})`);n(await d.json())}catch(d){o(d instanceof Error?d.message:"Failed to load channels")}finally{s(!1)}},[e]);return y.useEffect(()=>{l()},[l]),c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Zr,{className:"space-y-1 p-5",children:[c.jsx("h2",{className:"text-base font-medium",children:"Channels"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect external messaging apps so your assistant can chat through them."})]}),a&&c.jsxs(Zr,{className:"flex items-start gap-2 border-destructive/50 bg-destructive/5 p-4",children:[c.jsx(na,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),c.jsx("p",{className:"text-sm text-destructive",children:a})]}),i&&r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading channels…"})}):r.length===0?c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"No channel extensions are enabled. Enable one in Extensions, then connect it here."})}):r.map(d=>c.jsx(Oit,{token:e,channel:d,onChanged:l},d.id))]})}function Rit({events:e}){return c.jsx(Jc,{className:"h-full w-full",children:c.jsx("div",{className:"p-4 space-y-2",children:e.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity yet."}):e.map(r=>c.jsxs("div",{className:"rounded-md border p-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("p",{className:"text-sm font-medium",children:r.title}),c.jsx("span",{className:"text-xs text-muted-foreground",children:r.source})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r.detail})]},r.id))})})}function a_(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Pit(e,r){const n=r.trim();if(!n)return a_(e);const i=e.toLowerCase(),s=n.toLowerCase();let a=0,o=i.indexOf(s);if(o===-1)return a_(e);let l="";for(;o!==-1;){o>a&&(l+=a_(e.slice(a,o)));const d=o+n.length;l+=`<mark class="rounded bg-yellow-200/80 px-0.5 text-inherit dark:bg-yellow-500/30">${a_(e.slice(o,d))}</mark>`,a=d,o=i.indexOf(s,a)}return a<e.length&&(l+=a_(e.slice(a))),l}var yx="Perplexity",Lit=.75,$it=.2,Pce="#22B8CD",Dit=Pce,Iit="#000",Bit=.75;function oS(e){"@babel/helpers - typeof";return oS=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},oS(e)}var zit=["size","style"];function wU(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 b8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?wU(Object(n),!0).forEach(function(i){Fit(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Fit(e,r,n){return r=Hit(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Hit(e){var r=Wit(e,"string");return oS(r)=="symbol"?r:String(r)}function Wit(e,r){if(oS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(oS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Uit(e,r){if(e==null)return{};var n=Vit(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Vit(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var aL=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Uit(e,zit);return c.jsxs("svg",b8(b8({fill:"currentColor",fillRule:"evenodd",height:n,style:b8({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:yx}),c.jsx("path",{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"})]}))});function lS(e){"@babel/helpers - typeof";return lS=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},lS(e)}function SU(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 qit(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?SU(Object(n),!0).forEach(function(i){Git(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Git(e,r,n){return r=Kit(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Kit(e){var r=Yit(e,"string");return lS(r)=="symbol"?r:String(r)}function Yit(e,r){if(lS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(lS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Xit(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Jit=y.memo(function(e){var r=Object.assign({},(Xit(e),e));return c.jsx(_c,qit({Icon:aL,"aria-label":yx,background:Dit,color:Iit,iconMultiple:Bit},r))});function cS(e){"@babel/helpers - typeof";return cS=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},cS(e)}var Zit=["size","style"];function kU(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 _8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?kU(Object(n),!0).forEach(function(i){Qit(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Qit(e,r,n){return r=est(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function est(e){var r=tst(e,"string");return cS(r)=="symbol"?r:String(r)}function tst(e,r){if(cS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(cS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function rst(e,r){if(e==null)return{};var n=nst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function nst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Lce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=rst(e,Zit);return c.jsxs("svg",_8(_8({height:n,style:_8({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:yx}),c.jsx("path",{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z",fill:"#22B8CD",fillRule:"nonzero"})]}))});function uS(e){"@babel/helpers - typeof";return uS=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},uS(e)}var ist=["size","style"];function CU(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 w8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?CU(Object(n),!0).forEach(function(i){sst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function sst(e,r,n){return r=ast(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ast(e){var r=ost(e,"string");return uS(r)=="symbol"?r:String(r)}function ost(e,r){if(uS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(uS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function lst(e,r){if(e==null)return{};var n=cst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function cst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var $ce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=lst(e,ist);return c.jsxs("svg",w8(w8({fill:"currentColor",fillRule:"evenodd",height:n,style:w8({flex:"none",lineHeight:1},i),viewBox:"0 0 117 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:yx}),c.jsx("path",{d:"M38.542 5.218h1.151V7.59h-1.49c-1.167 0-2.036.281-2.612.843-.575.563-.863 1.485-.863 2.768v7.773h-2.351V5.271h2.351v2.187c0 .123.062.185.184.185.069 0 .121-.017.157-.053a.58.58 0 00.104-.211c.453-1.44 1.577-2.16 3.371-2.16h-.002zm15.36 2.938c.617 1.098.928 2.42.928 3.966 0 1.545-.309 2.867-.928 3.965-.62 1.098-1.42 1.92-2.404 2.464a6.446 6.446 0 01-3.174.817c-2.23 0-3.797-.896-4.703-2.688-.069-.14-.157-.211-.262-.211-.105 0-.157.052-.157.158v7.352h-2.351V5.271h2.351v2.345c0 .106.052.159.157.159.105 0 .191-.07.262-.211.906-1.793 2.473-2.689 4.703-2.689 1.132 0 2.19.272 3.174.817.984.545 1.785 1.366 2.404 2.464zm-1.424 3.966c0-1.617-.43-2.877-1.292-3.781-.862-.904-1.998-1.357-3.41-1.357-1.413 0-2.548.453-3.41 1.357-.863.905-1.179 2.166-1.179 3.78 0 1.616.316 2.878 1.178 3.782.863.905 2 1.356 3.41 1.356 1.411 0 2.549-.453 3.411-1.356.862-.904 1.292-2.166 1.292-3.781zM15.05 8.177c.618 1.098.928 2.42.928 3.965 0 1.546-.308 2.868-.928 3.966-.619 1.098-1.42 1.919-2.403 2.464a6.448 6.448 0 01-3.175.817c-2.23 0-3.797-.896-4.702-2.688-.07-.14-.158-.212-.262-.212-.105 0-.158.053-.158.159V24H2V5.292h2.351v2.345c0 .106.053.159.158.159.104 0 .19-.07.261-.212.906-1.792 2.473-2.688 4.703-2.688 1.132 0 2.19.272 3.175.817.983.545 1.784 1.366 2.403 2.464h-.002zm-1.423 3.965c0-1.616-.43-2.877-1.293-3.78-.862-.904-1.998-1.357-3.41-1.357-1.412 0-2.548.453-3.41 1.357-.862.905-1.178 2.165-1.178 3.78 0 1.615.316 2.878 1.178 3.781.862.906 1.998 1.357 3.41 1.357 1.412 0 2.548-.453 3.41-1.357.863-.903 1.293-2.166 1.293-3.78zm14.422 2.481h2.482c-.33 1.283-1.006 2.395-2.023 3.334-1.02.94-2.479 1.41-4.378 1.41-1.429 0-2.686-.295-3.775-.884a6.13 6.13 0 01-2.521-2.516c-.593-1.089-.889-2.372-.889-3.847 0-1.476.288-2.758.863-3.847.574-1.089 1.38-1.928 2.417-2.517 1.036-.588 2.25-.883 3.644-.883 1.393 0 2.547.29 3.514.87.968.58 1.69 1.349 2.168 2.305.48.959.719 2.008.719 3.15v1.58H19.427c.086 1.37.544 2.46 1.37 3.268.828.807 1.939 1.213 3.332 1.213 1.132 0 2-.232 2.6-.698.601-.466 1.04-1.111 1.32-1.938zm-8.595-3.82h8.204c0-1.194-.305-2.13-.914-2.807-.61-.676-1.568-1.015-2.874-1.015-1.22 0-2.217.33-2.99.988-.775.659-1.25 1.604-1.424 2.832l-.002.002zm37.238 8.17h2.352V0H56.69v18.974-.002zM89.316 3.774h2.747V.81h-2.747v2.966zm9.688 13.156c-.426.043-.684.066-.77.066a.39.39 0 01-.289-.106.395.395 0 01-.104-.29c0-.087.022-.348.065-.778.043-.43.066-1.094.066-1.988V7.279h3.354l-.66-2.008h-2.692v-3.69h-2.352v3.688h-2.557v2.008h2.557v7.214c0 1.512.367 2.636 1.098 3.374.732.737 1.846 1.107 3.345 1.107h1.83v-2.107h-.915c-.889 0-1.547.022-1.974.066h-.002zm13.759-11.662l-3.893 11.498c-.053.141-.135.326-.402.326-.268 0-.35-.185-.402-.326l-3.893-11.498h-2.398l4.508 13.703h1.594a.81.81 0 01.235.026c.053.017.096.06.131.133.07.105.06.264-.026.473l-.731 2.002c-.105.264-.305.396-.6.396-.106 0-.349-.023-.732-.066a13.71 13.71 0 00-1.49-.066h-1.907v2.107h2.508c1.463 0 2.344-.25 3.102-.75.757-.5 1.345-1.383 1.764-2.65L115 5.795v-.526h-2.237v.001zm-31.127 5.113L77.953 5.27h-2.588v.527l4.415 5.93-5.382 6.72v.526h2.64l4.285-5.507 3.998 5.507h2.535v-.526l-4.677-6.324 5.07-6.298v-.553h-2.64l-3.971 5.113-.002-.002zm7.931 8.59h2.351v-13.7h-2.35v13.702-.002zm-15.062-4.349c-.331 1.283-1.006 2.395-2.024 3.334-1.02.94-2.479 1.41-4.377 1.41-1.43 0-2.686-.295-3.775-.884a6.13 6.13 0 01-2.522-2.516c-.593-1.089-.888-2.372-.888-3.847 0-1.476.288-2.758.862-3.847.574-1.089 1.38-1.928 2.417-2.517 1.036-.588 2.25-.883 3.644-.883 1.394 0 2.547.29 3.515.87.967.58 1.689 1.349 2.168 2.305.479.959.718 2.008.718 3.15v1.58H63.401c.086 1.37.544 2.46 1.371 3.268.827.807 1.938 1.213 3.332 1.213 1.132 0 2-.232 2.6-.698.6-.466 1.04-1.111 1.319-1.938h2.482zm-11.078-3.82h8.205c0-1.194-.305-2.13-.915-2.807-.61-.676-1.568-1.015-2.873-1.015-1.22 0-2.217.33-2.991.988-.775.659-1.25 1.604-1.424 2.832l-.002.002z"})]}))});function dS(e){"@babel/helpers - typeof";return dS=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},dS(e)}var ust=["type"];function jU(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 dst(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?jU(Object(n),!0).forEach(function(i){hst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function hst(e,r,n){return r=fst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function fst(e){var r=pst(e,"string");return dS(r)=="symbol"?r:String(r)}function pst(e,r){if(dS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(dS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function mst(e,r){if(e==null)return{};var n=gst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function gst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var yst=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=mst(e,ust),s=n==="color"?Lce:aL;return c.jsx(wc,dst({Icon:s,Text:$ce,"aria-label":yx,spaceMultiple:$it,textMultiple:Lit},i))}),Ey=aL;Ey.Color=Lce;Ey.Text=$ce;Ey.Combine=yst;Ey.Avatar=Jit;Ey.colorPrimary=Pce;Ey.title=yx;var Ck="OpenRouter",vst=1,xst=.4,oL="#6566F1",bst=oL,_st="#fff",wst=.75;function hS(e){"@babel/helpers - typeof";return hS=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},hS(e)}var Sst=["size","style"];function NU(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 S8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?NU(Object(n),!0).forEach(function(i){kst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function kst(e,r,n){return r=Cst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Cst(e){var r=jst(e,"string");return hS(r)=="symbol"?r:String(r)}function jst(e,r){if(hS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(hS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Nst(e,r){if(e==null)return{};var n=Tst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Tst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var lL=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Nst(e,Sst);return c.jsxs("svg",S8(S8({fill:"currentColor",fillRule:"evenodd",height:n,style:S8({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:Ck}),c.jsx("path",{d:"M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"})]}))});function fS(e){"@babel/helpers - typeof";return fS=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},fS(e)}function TU(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 Est(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?TU(Object(n),!0).forEach(function(i){Ast(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Ast(e,r,n){return r=Ost(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Ost(e){var r=Mst(e,"string");return fS(r)=="symbol"?r:String(r)}function Mst(e,r){if(fS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(fS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Rst(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Pst=y.memo(function(e){var r=Object.assign({},(Rst(e),e));return c.jsx(_c,Est({Icon:lL,"aria-label":Ck,background:bst,color:_st,iconMultiple:wst},r))});function pS(e){"@babel/helpers - typeof";return pS=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},pS(e)}var Lst=["size","style"];function EU(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 k8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?EU(Object(n),!0).forEach(function(i){$st(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function $st(e,r,n){return r=Dst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Dst(e){var r=Ist(e,"string");return pS(r)=="symbol"?r:String(r)}function Ist(e,r){if(pS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(pS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Bst(e,r){if(e==null)return{};var n=zst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function zst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Bst(e,Lst);return c.jsxs("svg",k8(k8({fill:"currentColor",fillRule:"evenodd",height:n,style:k8({flex:"none",lineHeight:1},i),viewBox:"0 0 143 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Ck}),c.jsx("path",{d:"M9.623 2c1.46 0 2.763.35 3.91 1.05 1.149.699 2.053 1.7 2.714 3.002.66 1.303.991 2.861.991 4.675 0 1.814-.33 3.372-.991 4.675-.66 1.302-1.565 2.303-2.713 3.003-1.148.7-2.452 1.049-3.91 1.049-1.465 0-2.772-.35-3.92-1.05-1.148-.699-2.052-1.701-2.713-3.007-.66-1.305-.991-2.862-.991-4.67 0-1.814.33-3.372.991-4.675.66-1.302 1.565-2.303 2.713-3.003C6.852 2.35 8.16 2 9.624 2zm0 2.34c-.974 0-1.844.244-2.61.734-.765.489-1.37 1.208-1.813 2.156-.443.949-.664 2.114-.664 3.497s.221 2.548.664 3.497c.444.948 1.048 1.667 1.813 2.156.766.49 1.636.735 2.61.735.97 0 1.838-.245 2.606-.735.768-.489 1.374-1.208 1.817-2.156.443-.949.665-2.114.665-3.497s-.222-2.548-.665-3.497c-.443-.948-1.049-1.667-1.817-2.156-.768-.49-1.637-.735-2.606-.735zm16.32 1.974c1.024 0 1.938.26 2.742.78s1.436 1.269 1.896 2.248c.46.979.69 2.156.69 3.534 0 1.377-.23 2.556-.686 3.538-.457.981-1.085 1.736-1.883 2.264-.799.529-1.71.793-2.734.793-.771 0-1.4-.13-1.887-.39-.488-.26-.869-.564-1.144-.913a6.908 6.908 0 01-.636-.929h-.149V24h-2.47V6.48h2.412v2.065h.207c.143-.265.35-.572.62-.92.27-.349.643-.655 1.123-.917.479-.263 1.112-.394 1.9-.394zm-.528 2.107c-.716 0-1.32.185-1.813.556-.493.37-.866.887-1.12 1.55-.253.665-.38 1.439-.38 2.324 0 .896.13 1.68.389 2.356.259.674.633 1.201 1.123 1.58s1.09.568 1.8.568c.738 0 1.355-.198 1.85-.593.496-.395.872-.933 1.128-1.613.256-.68.384-1.447.384-2.298 0-.84-.125-1.596-.376-2.265-.25-.67-.625-1.197-1.123-1.584-.498-.388-1.12-.581-1.862-.581zm13.387-2.107c.716 0 1.41.119 2.082.356a5.037 5.037 0 011.809 1.12c.534.51.955 1.169 1.263 1.979.309.81.463 1.793.463 2.949v.88l-9.016-.001.002.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.26 1.364.539.313 1.17.469 1.89.469.469 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.281-.271.496-.606.644-1.004l2.338.423a4.247 4.247 0 01-1.004 1.813c-.482.517-1.084.918-1.808 1.203-.725.284-1.549.427-2.474.427-1.25 0-2.325-.27-3.225-.809-.9-.54-1.594-1.3-2.082-2.281-.487-.982-.73-2.134-.73-3.455 0-1.306.243-2.456.73-3.451.488-.996 1.17-1.773 2.049-2.331.878-.559 1.906-.838 3.084-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.593c0-.653-.132-1.232-.397-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.034-.44-1.673-.44zm10.29 3.293v7.566H46.64V6.48h2.37v2.074h.158a3.63 3.63 0 011.375-1.626c.625-.41 1.413-.614 2.366-.614.864 0 1.622.18 2.271.543.65.362 1.154.9 1.512 1.614.358.713.537 1.595.537 2.646v8.105h-2.47v-7.806c0-.924-.24-1.647-.718-2.17-.48-.522-1.137-.784-1.974-.784-.573 0-1.081.125-1.524.374a2.65 2.65 0 00-1.05 1.09c-.255.479-.383 1.055-.383 1.73zm17.122-9.424c1.31 0 2.4.227 3.266.68.868.454 1.516 1.08 1.945 1.88.43.799.645 1.72.645 2.766 0 1.04-.216 1.954-.649 2.742-.432.788-1.082 1.4-1.949 1.837a5.1 5.1 0 01-.501.22l3.743 6.865h-2.907l-3.436-6.43h-3.634v6.43h-2.552V2.232h6.029zm-.273 2.199h-3.204v6.155h3.237c.826 0 1.5-.119 2.02-.357s.901-.583 1.144-1.037c.242-.453.363-.998.363-1.634 0-.641-.122-1.197-.367-1.667-.246-.47-.628-.831-1.148-1.083-.52-.252-1.202-.377-2.045-.377zM79.66 6.314c1.19 0 2.227.273 3.114.821.886.548 1.575 1.316 2.065 2.306s.735 2.146.735 3.468c0 1.316-.245 2.466-.735 3.45-.49.985-1.179 1.751-2.065 2.299-.887.547-1.924.82-3.114.82s-2.227-.273-3.113-.82c-.887-.548-1.575-1.314-2.065-2.298-.49-.985-.735-2.135-.735-3.451 0-1.322.245-2.478.735-3.468.49-.99 1.178-1.758 2.065-2.306.886-.548 1.924-.821 3.113-.821zm.008 2.074c-.776 0-1.419.207-1.928.622-.51.415-.887.963-1.132 1.646a6.602 6.602 0 00-.367 2.244c0 .819.122 1.568.367 2.249.245.68.623 1.225 1.132 1.634.51.41 1.152.614 1.928.614.771 0 1.41-.205 1.917-.614.506-.41.882-.954 1.127-1.634.245-.68.367-1.43.367-2.249 0-.813-.122-1.56-.367-2.244-.245-.683-.62-1.231-1.127-1.646-.507-.415-1.146-.622-1.917-.622zm16.164 5.55V6.48h2.477v12.742h-2.428v-2.207h-.132a3.956 3.956 0 01-1.4 1.697c-.641.45-1.438.676-2.391.676-.815 0-1.535-.181-2.16-.544-.625-.362-1.115-.9-1.47-1.613-.355-.714-.533-1.596-.533-2.647V6.48h2.47v7.806c0 .868.24 1.56.718 2.074.48.514 1.102.771 1.867.771.462 0 .924-.116 1.383-.348.46-.232.843-.584 1.148-1.054.306-.47.456-1.067.45-1.792zm8.58-10.511v3.052h2.602v1.992h-2.602v7.01c0 .48.072.841.215 1.082.144.24.33.404.558.49.228.085.478.128.747.128.199 0 .372-.014.52-.041l.348-.067.446 2.05a4.42 4.42 0 01-.612.17c-.264.057-.594.09-.99.095a4.331 4.331 0 01-1.818-.349 3.12 3.12 0 01-1.362-1.128c-.347-.509-.52-1.148-.52-1.916l-.002-7.525h-1.857V6.48h1.857l.001-3.053h2.47zm9.961 2.887c.716 0 1.41.119 2.081.356a5.037 5.037 0 011.81 1.12c.533.51.954 1.169 1.263 1.979.308.81.462 1.793.462 2.949v.88l-9.016-.001.003.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.259 1.364.54.313 1.17.469 1.891.469.468 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.28-.271.495-.606.644-1.004l2.337.423a4.247 4.247 0 01-1.003 1.813c-.482.517-1.085.918-1.809 1.203-.724.284-1.548.427-2.473.427-1.25 0-2.325-.27-3.226-.809-.9-.54-1.594-1.3-2.08-2.281-.488-.982-.732-2.134-.732-3.455 0-1.306.244-2.456.731-3.451.487-.996 1.17-1.773 2.048-2.331.879-.559 1.907-.838 3.085-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.592c0-.653-.132-1.232-.396-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.035-.44-1.673-.44zm7.821 10.859V6.48h2.387v2.024h.132a3.092 3.092 0 011.227-1.622 3.485 3.485 0 011.994-.593l.396.01.153.006c.212.011.379.025.5.042v2.372c-.1-.027-.275-.059-.529-.095a5.4 5.4 0 00-.76-.054c-.583 0-1.102.123-1.556.37a2.799 2.799 0 00-1.078 1.02 2.79 2.79 0 00-.397 1.48v7.782h-2.469z"})]}))});function mS(e){"@babel/helpers - typeof";return mS=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},mS(e)}var Fst=["type","iconProps"];function AU(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 OU(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?AU(Object(n),!0).forEach(function(i){Hst(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Hst(e,r,n){return r=Wst(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Wst(e){var r=Ust(e,"string");return mS(r)=="symbol"?r:String(r)}function Ust(e,r){if(mS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(mS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Vst(e,r){if(e==null)return{};var n=qst(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function qst(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Gst=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=e.iconProps,s=Vst(e,Fst);return c.jsx(wc,OU({Icon:lL,Text:Dce,"aria-label":Ck,iconProps:OU({color:n==="color"?oL:void 0},i),spaceMultiple:xst,textMultiple:vst},s))}),vx=lL;vx.Text=Dce;vx.Combine=Gst;vx.Avatar=Pst;vx.colorPrimary=oL;vx.title=Ck;var jk="Grok",Kst=.75,Yst=.25,Ice="#fff",Xst=Ice,Jst="#000",Zst=.65;function gS(e){"@babel/helpers - typeof";return gS=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},gS(e)}var Qst=["size","style"];function MU(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 C8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?MU(Object(n),!0).forEach(function(i){eat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function eat(e,r,n){return r=tat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function tat(e){var r=rat(e,"string");return gS(r)=="symbol"?r:String(r)}function rat(e,r){if(gS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(gS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function nat(e,r){if(e==null)return{};var n=iat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function iat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Bce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=nat(e,Qst);return c.jsxs("svg",C8(C8({fill:"currentColor",fillRule:"evenodd",height:n,style:C8({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:jk}),c.jsx("path",{d:"M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"})]}))});function yS(e){"@babel/helpers - typeof";return yS=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},yS(e)}function RU(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 sat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?RU(Object(n),!0).forEach(function(i){aat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function aat(e,r,n){return r=oat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function oat(e){var r=lat(e,"string");return yS(r)=="symbol"?r:String(r)}function lat(e,r){if(yS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(yS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function cat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var zce=y.memo(function(e){var r=Object.assign({},(cat(e),e));return c.jsx(_c,sat({Icon:Bce,"aria-label":jk,background:Xst,color:Jst,iconMultiple:Zst},r))});function vS(e){"@babel/helpers - typeof";return vS=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},vS(e)}var uat=["size","style"];function PU(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 j8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?PU(Object(n),!0).forEach(function(i){dat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function dat(e,r,n){return r=hat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function hat(e){var r=fat(e,"string");return vS(r)=="symbol"?r:String(r)}function fat(e,r){if(vS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(vS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function pat(e,r){if(e==null)return{};var n=mat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function mat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Fce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=pat(e,uat);return c.jsxs("svg",j8(j8({fill:"currentColor",fillRule:"evenodd",height:n,style:j8({flex:"none",lineHeight:1},i),viewBox:"0 0 41 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:jk}),c.jsx("path",{d:"M36.867 2h2.577v20h-2.577V2zM23.875 2h2.717l7.759 20H31.55l-2.101-5.574h-8.571L18.777 22h-2.69l7.788-20zm4.79 12.185l-3.53-9.272-3.473 9.272h7.003zM7.35 14.381L2.504 7.518h2.857l3.446 5.126 3.585-5.126h2.605l-4.762 6.835L15.501 22h-2.829l-3.977-5.854L4.689 22H2l5.35-7.619z"})]}))});function xS(e){"@babel/helpers - typeof";return xS=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},xS(e)}function LU(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 gat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?LU(Object(n),!0).forEach(function(i){yat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function yat(e,r,n){return r=vat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function vat(e){var r=xat(e,"string");return xS(r)=="symbol"?r:String(r)}function xat(e,r){if(xS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(xS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function bat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var _at=y.memo(function(e){var r=Object.assign({},(bat(e),e));return c.jsx(wc,gat({Icon:zce,Text:Fce,"aria-label":jk,iconProps:{shape:"square"},spaceMultiple:Yst,textMultiple:Kst},r))}),xx=Bce;xx.Text=Fce;xx.Combine=_at;xx.Avatar=zce;xx.colorPrimary=Ice;xx.title=jk;var Nk="MoonshotAI",wat=.75,Sat=.4,Hce="#16191E",kat=Hce,Cat="#fff",jat=.75;function bS(e){"@babel/helpers - typeof";return bS=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},bS(e)}var Nat=["size","style"];function $U(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 N8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?$U(Object(n),!0).forEach(function(i){Tat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$U(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Tat(e,r,n){return r=Eat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Eat(e){var r=Aat(e,"string");return bS(r)=="symbol"?r:String(r)}function Aat(e,r){if(bS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(bS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Oat(e,r){if(e==null)return{};var n=Mat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Mat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var cL=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Oat(e,Nat);return c.jsxs("svg",N8(N8({fill:"currentColor",fillRule:"evenodd",height:n,style:N8({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:Nk}),c.jsx("path",{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"})]}))});function _S(e){"@babel/helpers - typeof";return _S=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},_S(e)}function DU(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 Rat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?DU(Object(n),!0).forEach(function(i){Pat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Pat(e,r,n){return r=Lat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Lat(e){var r=$at(e,"string");return _S(r)=="symbol"?r:String(r)}function $at(e,r){if(_S(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(_S(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Dat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Iat=y.memo(function(e){var r=Object.assign({},(Dat(e),e));return c.jsx(_c,Rat({Icon:cL,"aria-label":Nk,background:kat,color:Cat,iconMultiple:jat},r))});function wS(e){"@babel/helpers - typeof";return wS=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},wS(e)}var Bat=["size","style"];function IU(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 T8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?IU(Object(n),!0).forEach(function(i){zat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function zat(e,r,n){return r=Fat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Fat(e){var r=Hat(e,"string");return wS(r)=="symbol"?r:String(r)}function Hat(e,r){if(wS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(wS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Wat(e,r){if(e==null)return{};var n=Uat(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Uat(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Wce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Wat(e,Bat);return c.jsxs("svg",T8(T8({fill:"currentColor",fillRule:"evenodd",height:n,style:T8({flex:"none",lineHeight:1},i),viewBox:"0 0 171 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Nk}),c.jsx("path",{d:"M165.484 2H169v19.507h-3.516V2zm-35.707 0v5.26h3.186v3.507h-3.186v10.74h-3.516v-10.74h-2.966V7.26h2.966V2h3.516zm-24.598 11.023v8.498h-3.345v-8.804c.008-2.1-2.109-2.895-3.109-2.895l-.064.001c-1.073.026-3.521.694-3.54 3.863v7.835h-3.468V2.014L95.14 2v6.918c1.228-1.986 3.93-2.243 4.755-2.243.926 0 1.768.155 2.525.465.757.31 1.378.783 1.864 1.42.413.54.665 1.096.757 1.667.092.571.138 1.503.138 2.796zM89.29 9.507l-2.362 2.41c-2.911-2.41-6.647-2.136-7.196-.93-.55 1.205 2.444 1.484 4.734 1.98l.634.146c1.731.408 4.603 1.274 4.52 4.12-.11 3.78-4.23 4.767-6.867 4.767-2.637 0-5.933-1.808-7.636-3.342l2.527-2.63c2.582 2.63 7.142 2.958 7.856 1.534.714-1.425-1.263-1.48-4.834-1.973-3.175-.438-4.837-2.85-4.813-4.13.034-1.843 1.543-4.85 6.31-4.886 3.227-.025 5.425.961 7.127 2.934zm-22.617.386l-.033.001c-1.905.083-3.443 1.453-3.458 3.746v7.867h-3.83V7.185h3.702v2.061l.088-.12c.591-.8 2.07-2.555 4.796-2.523 2.675.032 5.696 1.95 5.696 5.17v9.734H69.69v-8.813c-.01-2.197-2.102-2.824-3.016-2.8zm-33.14-3.29c4.247 0 7.69 3.434 7.69 7.671s-3.443 7.671-7.69 7.671c-4.248 0-7.692-3.434-7.692-7.671s3.444-7.671 7.691-7.671zm0 3.726a3.95 3.95 0 00-3.956 3.945 3.95 3.95 0 003.955 3.945 3.95 3.95 0 003.956-3.945 3.95 3.95 0 00-3.956-3.945zm16.7-3.726c4.247 0 7.69 3.434 7.69 7.671s-3.443 7.671-7.69 7.671c-4.248 0-7.692-3.434-7.692-7.671s3.444-7.671 7.691-7.671zm0 3.726a3.95 3.95 0 00-3.956 3.945 3.95 3.95 0 003.955 3.945 3.95 3.95 0 003.956-3.945 3.95 3.95 0 00-3.956-3.945zm64.382-3.726c4.248 0 7.69 3.434 7.69 7.671s-3.442 7.671-7.69 7.671c-4.247 0-7.69-3.434-7.69-7.671s3.443-7.671 7.69-7.671zm0 3.726a3.95 3.95 0 00-3.955 3.945 3.95 3.95 0 003.955 3.945 3.95 3.95 0 003.955-3.945 3.95 3.95 0 00-3.955-3.945zM2 21.616V2l10.987 7.89L23.919 2v19.616h-3.79V9.452l-7.17 5.26-7.169-5.26v12.164H2zM153.344 2l10.492 19.507h-4.138l-1.833-3.288h-5.235l-1.789-3.46-3.632 6.748h-4.358L153.344 2zm0 8.11l-2.478 4.602h5.044l-2.566-4.602z"})]}))});function SS(e){"@babel/helpers - typeof";return SS=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},SS(e)}function BU(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 Vat(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?BU(Object(n),!0).forEach(function(i){qat(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function qat(e,r,n){return r=Gat(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Gat(e){var r=Kat(e,"string");return SS(r)=="symbol"?r:String(r)}function Kat(e,r){if(SS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(SS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Yat(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var Xat=y.memo(function(e){var r=Object.assign({},(Yat(e),e));return c.jsx(wc,Vat({Icon:cL,Text:Wce,"aria-label":Nk,spaceMultiple:Sat,textMultiple:wat},r))}),bx=cL;bx.Text=Wce;bx.Combine=Xat;bx.Avatar=Iat;bx.colorPrimary=Hce;bx.title=Nk;var _x="Kimi",Jat=.7,Zat=.25,Uce="#000",Qat=Uce,eot="#fff",tot=.6;function kS(e){"@babel/helpers - typeof";return kS=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},kS(e)}var rot=["size","style"];function zU(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 E8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?zU(Object(n),!0).forEach(function(i){not(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function not(e,r,n){return r=iot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function iot(e){var r=sot(e,"string");return kS(r)=="symbol"?r:String(r)}function sot(e,r){if(kS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(kS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function aot(e,r){if(e==null)return{};var n=oot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function oot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Vce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=aot(e,rot);return c.jsxs("svg",E8(E8({height:n,style:E8({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:_x}),c.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z",fill:"#1783FF"}),c.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z",fill:"#fff"})]}))});function CS(e){"@babel/helpers - typeof";return CS=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},CS(e)}function FU(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 lot(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?FU(Object(n),!0).forEach(function(i){cot(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function cot(e,r,n){return r=uot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function uot(e){var r=dot(e,"string");return CS(r)=="symbol"?r:String(r)}function dot(e,r){if(CS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(CS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function hot(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var qce=y.memo(function(e){var r=Object.assign({},(hot(e),e));return c.jsx(_c,lot({Icon:Vce,"aria-label":_x,background:Qat,color:eot,iconMultiple:tot},r))});function jS(e){"@babel/helpers - typeof";return jS=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},jS(e)}var fot=["size","style"];function HU(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 A8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?HU(Object(n),!0).forEach(function(i){pot(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function pot(e,r,n){return r=mot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function mot(e){var r=got(e,"string");return jS(r)=="symbol"?r:String(r)}function got(e,r){if(jS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(jS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function yot(e,r){if(e==null)return{};var n=vot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function vot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Gce=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=yot(e,fot);return c.jsxs("svg",A8(A8({fill:"currentColor",fillRule:"evenodd",height:n,style:A8({flex:"none",lineHeight:1},i),viewBox:"0 0 64 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:_x}),c.jsx("path",{d:"M24.353 21.58c0 .232.188.42.42.42h2.69a.42.42 0 00.42-.42V2.42a.42.42 0 00-.42-.42h-2.69a.42.42 0 00-.42.42v19.16zM58.47 21.58c0 .232.188.42.42.42h2.691a.42.42 0 00.419-.42V2.42a.42.42 0 00-.419-.42H58.89a.42.42 0 00-.42.42v19.16zM47.786 2a.42.42 0 00-.408.32L43.4 18.633c-.066.267-.38.267-.444 0L38.976 2.32A.417.417 0 0038.57 2H31.83a.418.418 0 00-.418.42v19.16c0 .232.188.42.42.42h2.988c.231 0 .419-.182.419-.414V5.471c0-.322.378-.389.454-.079l3.974 16.288a.42.42 0 00.407.32h6.208a.42.42 0 00.407-.32L50.66 5.394c.076-.31.455-.243.455.079V21.58c0 .231.187.419.419.419h2.987a.42.42 0 00.42-.42V2.42a.42.42 0 00-.42-.42h-6.735zM11.55 11.273l8.115-8.565A.42.42 0 0019.36 2h-3.776a.42.42 0 00-.298.124l-9.303 9.39c-.144.146-.357.016-.357-.218V2.42a.42.42 0 00-.42-.42H2.42a.42.42 0 00-.42.42v19.16c0 .232.188.42.42.42h2.786a.42.42 0 00.42-.42v-3.82c0-.085.03-.166.081-.219l2.87-2.931c.07-.07.166-.081.243-.029l7.678 5.816c1.123.778 2.552 1.288 3.861 1.5a.403.403 0 00.464-.404v-3.461c0-.206-.15-.38-.35-.423-.76-.164-1.604-.474-2.244-.918l-6.647-4.953c-.138-.095-.155-.34-.033-.465z"})]}))});function NS(e){"@babel/helpers - typeof";return NS=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},NS(e)}var xot=["iconProps"];function WU(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 UU(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?WU(Object(n),!0).forEach(function(i){bot(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function bot(e,r,n){return r=_ot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _ot(e){var r=wot(e,"string");return NS(r)=="symbol"?r:String(r)}function wot(e,r){if(NS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(NS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Sot(e,r){if(e==null)return{};var n=kot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function kot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Cot=y.memo(function(e){var r=e.iconProps,n=Sot(e,xot);return c.jsx(wc,UU({Icon:qce,Text:Gce,"aria-label":_x,iconProps:UU({shape:"square"},r),spaceMultiple:Zat,textMultiple:Jat},n))});function TS(e){"@babel/helpers - typeof";return TS=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},TS(e)}var jot=["size","style"];function VU(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 O8(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?VU(Object(n),!0).forEach(function(i){Not(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VU(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Not(e,r,n){return r=Tot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Tot(e){var r=Eot(e,"string");return TS(r)=="symbol"?r:String(r)}function Eot(e,r){if(TS(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(TS(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Aot(e,r){if(e==null)return{};var n=Oot(e,r),i,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)i=a[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Oot(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Mot=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=Aot(e,jot);return c.jsxs("svg",O8(O8({fill:"currentColor",fillRule:"evenodd",height:n,style:O8({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:_x}),c.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),c.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]}))}),Ay=Mot;Ay.Color=Vce;Ay.Text=Gce;Ay.Combine=Cot;Ay.Avatar=qce;Ay.colorPrimary=Uce;Ay.title=_x;const Kce=[{label:"OpenAI / Jait",fields:["OPENAI_API_KEY","OPENAI_BASE_URL","OPENAI_MODEL","OPENAI_TRANSCRIBE_MODEL","OPENAI_WEB_SEARCH_MODEL"]},{label:"Ollama",fields:["OLLAMA_URL","OLLAMA_MODEL"]},{label:"Perplexity",fields:["PERPLEXITY_API_KEY","PERPLEXITY_MODEL","PERPLEXITY_OPENROUTER_MODEL"]},{label:"OpenRouter",fields:["OPENROUTER_API_KEY"]},{label:"xAI / Grok",fields:["XAI_API_KEY","GROK_MODEL"]},{label:"Google Gemini",fields:["GEMINI_API_KEY","GEMINI_MODEL"]},{label:"Moonshot / Kimi",fields:["MOONSHOT_API_KEY","KIMI_BASE_URL","KIMI_MODEL"]},{label:"Brave Search",fields:["BRAVE_API_KEY"]},{label:"Speech / Home Assistant",fields:["WHISPER_URL","HA_URL","HA_TOKEN","HA_STT_ENTITY","ELEVENLABS_API_KEY","ELEVENLABS_STT_MODEL","ELEVENLABS_STT_URL","ELEVENLABS_LANGUAGE_CODE"]}],qU=Kce.flatMap(e=>e.fields),Rot={OPENAI:fs,PERPLEXITY:Ey,OPENROUTER:vx,XAI:xx,GEMINI:Ap,ELEVENLABS:CY,MOONSHOT:bx,KIMI:Ay,GROK:Sy,OLLAMA:wy,HA:wY};function Pot(e){const r=e.split("_")[0];return Rot[r]??null}function Lot(e){return e.endsWith("_KEY")||e.endsWith("_URL")}const $ot=qn(),GU={jait:"Jait",codex:"Codex","claude-code":"Claude Code"};function Dot(e){const r=e.auth;return e.id==="jait"||!r?!1:r.login||r.logout||r.authenticated!==null}function Iot({username:e,token:r,apiKeys:n,onSaveApiKeys:i,sttProvider:s,onSttProviderChange:a,jaitBackend:o,onJaitBackendChange:l,onClearArchive:d,onClearArchivedProjects:u,onFetchArchivedProjects:h,onRestoreProject:f,activityEvents:g,updateInfo:v,updateChecking:b,onCheckUpdate:_,onApplyUpdate:S,updateApplying:w,platform:C}){const[j,E]=y.useState(n),[A,N]=y.useState(!1),[R,B]=y.useState(!1),[G,H]=y.useState(!1),[z,W]=y.useState([]),[I,O]=y.useState(!1),[D,P]=y.useState(null),[$,V]=y.useState(null),[K,F]=y.useState(null),[U,Q]=y.useState({}),[q,te]=y.useState({}),[ee,se]=y.useState([]),[ae,re]=y.useState(!1),[fe,me]=y.useState(null),[_e,ge]=y.useState("general"),[Ve,le]=y.useState(""),it=y.useRef(null),{importedThemes:Xe,activeTheme:xt}=ute(),[Pt,Ht]=y.useState(!1),[Kt,tr]=y.useState(null);y.useEffect(()=>{var $e;C!=="electron"||!(($e=window.jaitDesktop)!=null&&$e.getInfo)||window.jaitDesktop.getInfo().then(ft=>{ft.appVersion&&tr(ft.appVersion)})},[C]),y.useEffect(()=>{var $e;C!=="electron"||!(($e=window.jaitDesktop)!=null&&$e.getSetting)||window.jaitDesktop.getSetting("closeOnWindowClose",!1).then(ft=>{Ht(ft===!0)})},[C]),y.useEffect(()=>{E(n)},[n]);const ht=qU.some($e=>(j[$e]??"")!==(n[$e]??"")),Ye=y.useCallback(async()=>{if(r){re(!0);try{const{providers:$e}=await pr.listProvidersFresh();se($e.filter(Dot))}catch{se([])}finally{re(!1)}}},[r]);y.useEffect(()=>{Ye()},[Ye]);const dt=async $e=>{var vt;const ft=((vt=ee.find(gt=>gt.id===$e))==null?void 0:vt.name)??GU[$e]??$e;me($e),F(null),V(null);try{const gt=await pr.logoutProvider($e);V(gt.message||`${ft} logout completed.`),await Ye()}catch(gt){F(gt instanceof Error?gt.message:`Failed to log out from ${ft}.`)}finally{me(null)}},At=y.useCallback(()=>{E(n),V(null),F(null)},[n]);y.useEffect(()=>{if(!r)return;let $e=!1;return(async()=>{try{const ft=await fetch(`${$ot}/api/auth/settings/env-status`,{headers:{Authorization:`Bearer ${r}`}});if(ft.ok&&!$e){const vt=await ft.json();Q(vt.env_set)}}catch{}})(),()=>{$e=!0}},[r]);const Te=y.useCallback($e=>{te(ft=>({...ft,[$e]:!ft[$e]}))},[]),Oe=async()=>{N(!0),F(null),V(null);try{await i(j),V("API keys saved.")}catch($e){F($e instanceof Error?$e.message:"Failed to save API keys")}finally{N(!1)}},Je=async()=>{B(!0),F(null),V(null);try{const $e=await d();V(`Cleared ${$e} archived session(s).`)}catch($e){F($e instanceof Error?$e.message:"Failed to clear archive")}finally{B(!1)}},ct=async()=>{H(!0),F(null),V(null);try{const $e=await u();W([]),V(`Cleared ${$e} archived project(s).`)}catch($e){F($e instanceof Error?$e.message:"Failed to clear archived projects")}finally{H(!1)}},bt=y.useCallback(async()=>{O(!0);try{const $e=await h();W($e)}finally{O(!1)}},[h]),zt=async $e=>{P($e);try{await f($e)?(W(vt=>vt.filter(gt=>gt.id!==$e)),V("Project restored.")):F("Failed to restore project.")}catch{F("Failed to restore project.")}finally{P(null)}},sr=y.useCallback(async $e=>{var vt;const ft=(vt=$e.target.files)==null?void 0:vt[0];if($e.target.value="",!!ft){F(null),V(null);try{const gt=bDe(ft.name,await ft.text());V(gt.hasInclude?`Imported theme "${gt.name}". Relative "include" files are not resolved yet.`:`Imported theme "${gt.name}".`)}catch(gt){F(gt instanceof Error?gt.message:"Failed to import theme")}}},[]);function Pe($e){var gt;const ft=!!((gt=j[$e])!=null&>.trim()),vt=!!U[$e];return ft?c.jsx(Ar,{variant:"default",className:"text-2xs px-1.5 py-0",children:"user"}):vt?c.jsx(Ar,{variant:"success",className:"text-2xs px-1.5 py-0",children:".env"}):c.jsx(Ar,{variant:"outline",className:"text-2xs px-1.5 py-0 text-muted-foreground",children:"empty"})}const Ne=Ve.trim().toLowerCase(),be=(...$e)=>!Ne||$e.some(ft=>ft==null?void 0:ft.toLowerCase().includes(Ne)),Fe=$e=>c.jsx("span",{dangerouslySetInnerHTML:{__html:Pit($e,Ve)}}),nt=be("software update version gateway desktop release download install",v==null?void 0:v.currentVersion,v==null?void 0:v.latestVersion,Kt),Ue=C==="electron"&&be("desktop tray close window quit minimize app",Kt),$t=C!=="web"&&be("gateway connection url domain ip server host network",qn()),Ot=be("session archive archived clear delete messages history"),Yt=be("project archive archived clear delete projects remove"),rr=be("jait backend provider openai openrouter model api llm",o),or=be("provider accounts login logout codex claude gemini opencode copilot authentication",...ee.map($e=>{var ft;return`${$e.name} ${((ft=$e.auth)==null?void 0:ft.detail)??""}`})),ke=be("speech stt input microphone whisper wyoming home assistant transcription gpt openai elevenlabs scribe",s,j.WHISPER_URL,j.HA_URL,j.HA_TOKEN,j.HA_STT_ENTITY,j.OPENAI_TRANSCRIBE_MODEL,j.ELEVENLABS_API_KEY,j.ELEVENLABS_STT_MODEL,j.ELEVENLABS_STT_URL,j.ELEVENLABS_LANGUAGE_CODE),at=qU.filter($e=>be($e,$e.replaceAll("_"," "),j[$e])),Ze=be("tools permissions mcp core standard external toggle meta terminal filesystem os agent browser web surfaces scheduler memory voice screen gateway"),Rt=be("activity recent messages terminal sessions feed history"),ze=be("extensions plugins store install uninstall enable disable"),mt=be("skills instructions prompts specialized workflows SKILL.md"),yt=be("channels whatsapp messaging connect link qr inbound outbound"),Gt=be(...nDe(),"import json token colors workbench sidebar tabs"),qe=c.jsx(Zr,{className:"p-5",children:c.jsxs("p",{className:"text-sm text-muted-foreground",children:["No settings match ",c.jsx("span",{className:"font-medium text-foreground",children:Ve}),"."]})});return c.jsxs("div",{className:"mx-auto w-full max-w-5xl space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-end md:justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Settings"}),c.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Signed in as ",c.jsx("span",{className:"font-medium text-foreground",children:e})]})]}),c.jsxs("div",{className:"relative w-full md:max-w-sm",children:[c.jsx(rl,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ln,{value:Ve,onChange:$e=>le($e.target.value),placeholder:"Search settings...",className:"pl-9"})]})]}),c.jsxs(Y0,{value:_e,onValueChange:$e=>ge($e),className:"space-y-4",children:[c.jsxs(ag,{className:"flex h-auto w-full flex-wrap justify-start gap-1 rounded-xl bg-muted/70 p-1",children:[c.jsx(Qs,{value:"general",className:"flex-1 sm:flex-none",children:"General"}),c.jsx(Qs,{value:"api",className:"flex-1 sm:flex-none",children:"API"}),c.jsx(Qs,{value:"tools",className:"flex-1 sm:flex-none",children:"Tools"}),c.jsx(Qs,{value:"extensions",className:"flex-1 sm:flex-none",children:"Extensions"}),c.jsx(Qs,{value:"skills",className:"flex-1 sm:flex-none",children:"Skills"}),c.jsx(Qs,{value:"channels",className:"flex-1 sm:flex-none",children:"Channels"}),c.jsx(Qs,{value:"activity",className:"flex-1 sm:flex-none",children:"Activity"})]}),c.jsxs(ea,{value:"general",className:"space-y-6",children:[nt&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"flex items-center gap-2 text-base font-medium",children:[c.jsx(vY,{className:"h-4 w-4"}),Fe("Software Update")]}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:[v?c.jsxs(c.Fragment,{children:["Gateway ",c.jsxs("span",{className:"font-mono font-medium text-foreground",children:["v",v.currentVersion]})]}):"Check for the latest Jait version.",Kt&&c.jsxs(c.Fragment,{children:[" · Desktop app ",c.jsxs("span",{className:"font-mono font-medium text-foreground",children:["v",Kt]})]})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs(we,{variant:"outline",size:"sm",onClick:_,disabled:b||w,children:[b?c.jsx(Ft,{className:"mr-1.5 h-4 w-4 animate-spin"}):null,b?"Checking...":"Check for updates"]}),(v==null?void 0:v.hasUpdate)&&c.jsxs(c.Fragment,{children:[c.jsxs(we,{size:"sm",onClick:S,disabled:w,children:[w?c.jsx(Ft,{className:"mr-1.5 h-4 w-4 animate-spin"}):c.jsx(gp,{className:"mr-1.5 h-4 w-4"}),w?"Updating...":`Update gateway to v${v.latestVersion}`]}),C==="electron"?c.jsxs(we,{size:"sm",variant:"outline",onClick:async()=>{const $e=window.jaitDesktop;(await $e.checkForUpdate()).updateAvailable&&(await $e.downloadUpdate(),await $e.installUpdate())},children:[c.jsx(gp,{className:"mr-1.5 h-4 w-4"}),"Update desktop app"]}):C!=="web"&&c.jsx(we,{size:"sm",variant:"outline",asChild:!0,children:c.jsxs("a",{href:"https://github.com/Widev-e-U/Jait/releases/latest",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(gp,{className:"mr-1.5 h-4 w-4"}),"Download latest APK"]})})]})]}),v&&!v.hasUpdate&&c.jsxs("p",{className:"flex items-center gap-1.5 text-sm text-green-600 dark:text-green-400",children:[c.jsx(ia,{className:"h-3.5 w-3.5"}),"You're on the latest version."]}),(v==null?void 0:v.hasUpdate)&&c.jsxs("p",{className:"flex items-center gap-1.5 text-sm text-amber-600 dark:text-amber-400",children:[c.jsx(na,{className:"h-3.5 w-3.5"}),"Version ",v.latestVersion," is available",C!=="web"?" — download from jait.dev":"","."]})]}),Gt&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Editor theme")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Import a VS Code theme JSON file and apply its Monaco token colors plus a mapped shell palette."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("input",{ref:it,type:"file",accept:".json,application/json",className:"hidden",onChange:$e=>{sr($e)}}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>{var $e;return($e=it.current)==null?void 0:$e.click()},children:"Import theme JSON"}),c.jsx(we,{variant:"ghost",size:"sm",disabled:!xt,onClick:()=>wj(null),children:"Use built-in theme"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Imported themes stay local to this device. The quick light/system/dark toggle falls back to the built-in theme set."}),Xe.length>0?c.jsx("div",{className:"space-y-2",children:Xe.map($e=>{const ft=(xt==null?void 0:xt.id)===$e.id;return c.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"truncate text-sm font-medium",children:$e.name}),c.jsx(Ar,{variant:ft?"default":"outline",className:"h-5 px-1.5 text-2xs",children:ft?"active":$e.colorMode})]}),c.jsx("p",{className:"truncate text-xs text-muted-foreground",children:$e.sourceLabel})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[!ft&&c.jsx(we,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>wj($e.id),children:"Apply"}),c.jsx(we,{variant:"ghost",size:"sm",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:()=>_De($e.id),children:"Remove"})]})]},$e.id)})}):c.jsx("p",{className:"text-sm text-muted-foreground",children:"No imported themes yet."})]}),Ue&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Desktop")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Settings specific to the desktop application."})]}),c.jsxs("div",{className:"flex max-w-md items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx(mi,{htmlFor:"close-on-window-close",children:"Quit on window close"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"When off, closing the window minimizes Jait to the system tray."})]}),c.jsx(gf,{id:"close-on-window-close",checked:Pt,onCheckedChange:$e=>{var ft;Ht($e),(ft=window.jaitDesktop)==null||ft.setSetting("closeOnWindowClose",$e)}})]})]}),$t&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Gateway connection")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Desktop and mobile clients can connect to a different Jait gateway."})]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current gateway: ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:qn()})]})]}),Ot&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Session archive")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Permanently remove archived sessions and their messages from your account."})]}),c.jsx("div",{children:c.jsx(we,{variant:"destructive",onClick:()=>{Je()},disabled:R,children:R?"Clearing...":"Clear archived sessions"})})]}),Yt&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Project archive")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Restore or permanently remove archived projects and their sessions."})]}),c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[c.jsx(we,{className:"w-full sm:w-auto",variant:"outline",onClick:()=>{bt()},disabled:I,children:I?c.jsxs(c.Fragment,{children:[c.jsx(Ft,{className:"mr-2 h-3.5 w-3.5 animate-spin"})," Loading..."]}):"Show archived projects"}),c.jsx(we,{className:"w-full sm:w-auto",variant:"destructive",onClick:()=>{ct()},disabled:G,children:G?"Clearing...":"Clear all archived"})]}),z.length>0&&c.jsx("div",{className:"space-y-2",children:z.map($e=>c.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(xR,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-medium truncate",children:$e.title||$e.rootPath||$e.id}),$e.rootPath&&$e.title&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:$e.rootPath})]})]}),c.jsxs(we,{variant:"outline",size:"sm",className:"shrink-0 h-7 text-xs",onClick:()=>{zt($e.id)},disabled:D===$e.id,children:[D===$e.id?c.jsx(Ft,{className:"mr-1.5 h-3 w-3 animate-spin"}):c.jsx(P0e,{className:"mr-1.5 h-3 w-3"}),"Restore"]})]},$e.id))})]}),rr&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Jait LLM Backend")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose which API backend the Jait provider uses for model inference."})]}),c.jsxs("div",{className:"max-w-sm",children:[c.jsx(mi,{htmlFor:"jait-backend",className:"mb-1.5 block",children:"Backend provider"}),c.jsxs(sh,{value:o,onValueChange:$e=>{l($e)},children:[c.jsx(ed,{id:"jait-backend",children:c.jsx(ah,{placeholder:"Select backend"})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"openai",children:"OpenAI (direct)"}),c.jsx(Ls,{value:"openrouter",children:"OpenRouter"}),c.jsx(Ls,{value:"ollama",children:"Ollama (local)"})]})]}),c.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:o==="openrouter"?"Models will be fetched from OpenRouter. Set your OPENROUTER_API_KEY in the API tab.":o==="ollama"?"Models will be fetched from your local Ollama instance. Set OLLAMA_URL in the API tab if not running on localhost:11434.":"Uses your OPENAI_API_KEY and OPENAI_BASE_URL."})]})]}),or&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Provider accounts")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage CLI provider sessions. Login is started from the provider picker; logout is handled here."})]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>{Ye()},disabled:ae,children:[ae?c.jsx(Ft,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):c.jsx(Js,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})]}),c.jsx("div",{className:"space-y-2",children:ee.length===0&&!ae?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No provider account actions are available on this gateway."}):ee.map($e=>{const ft=$e.auth,vt=$e.id,gt=(ft==null?void 0:ft.authenticated)===!0,$r=(ft==null?void 0:ft.authenticated)===!1,mr=fe===vt;return c.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border px-3 py-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("p",{className:"text-sm font-medium",children:GU[vt]??$e.name}),c.jsx(Ar,{variant:gt?"success":"outline",className:"text-2xs",children:gt?"signed in":(ft==null?void 0:ft.authenticated)===!1?"signed out":"unknown"})]}),(ft==null?void 0:ft.detail)&&c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:ft.detail})]}),(ft==null?void 0:ft.logout)&&c.jsxs(we,{className:"w-full sm:w-auto",variant:"outline",size:"sm",onClick:()=>{dt(vt)},disabled:mr||fe!==null||$r,children:[mr?c.jsx(Ft,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):c.jsx(xA,{className:"mr-1.5 h-3.5 w-3.5"}),"Logout"]})]},$e.id)})})]}),ke&&c.jsxs(Zr,{className:"space-y-4 p-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Spracheingabe (Speech-to-Text)")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Wähle aus, wie gesprochene Sprache in Text umgewandelt wird, bevor sie als Nachricht gesendet wird."})]}),c.jsxs("div",{className:"max-w-sm",children:[c.jsx(mi,{htmlFor:"stt-provider",className:"mb-1.5 block",children:"STT-Anbieter"}),c.jsxs(sh,{value:s,onValueChange:$e=>{a($e)},children:[c.jsx(ed,{id:"stt-provider",children:c.jsx(ah,{placeholder:"STT-Anbieter wählen"})}),c.jsxs(td,{children:[c.jsx(Ls,{value:"whisper",children:"Faster Whisper (lokal)"}),c.jsx(Ls,{value:"gpt",children:"GPT (OpenAI)"}),c.jsx(Ls,{value:"elevenlabs",children:"ElevenLabs Scribe"}),c.jsx(Ls,{value:"wyoming",children:"Wyoming / Whisper (Home Assistant)"})]})]})]}),s==="whisper"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uses a local Faster Whisper server for free, offline transcription. Start the server with ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"python whisper-server/server.py"})," from the gateway package. Optionally set ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"WHISPER_URL"})," in API keys below (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"http://localhost:8178"}),")."]})}),s==="wyoming"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configure your Home Assistant Wyoming/Whisper STT integration. Set these values in the API keys section below: ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"HA_URL"}),", ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"HA_TOKEN"}),", and optionally ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"HA_STT_ENTITY"})," (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"stt.faster_whisper"}),")."]})}),s==="gpt"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uses OpenAI audio transcription. Set ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"OPENAI_API_KEY"})," and optionally ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"OPENAI_TRANSCRIBE_MODEL"})," (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"gpt-4o-mini-transcribe"}),")."]})}),s==="elevenlabs"&&c.jsx("div",{className:"max-w-sm space-y-3 border-l-2 border-primary/20 pl-4",children:c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uses ElevenLabs Speech to Text. Set ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"ELEVENLABS_API_KEY"})," and optionally ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"ELEVENLABS_STT_MODEL"})," (defaults to ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"scribe_v2"}),") and ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-2xs",children:"ELEVENLABS_LANGUAGE_CODE"}),"."]})})]}),!Gt&&!nt&&!Ue&&!$t&&!Ot&&!Yt&&!rr&&!or&&!ke&&qe]}),c.jsx(ea,{value:"api",className:"space-y-6 pb-20",children:at.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Values stored here are user-specific and override environment defaults for your account."}),Kce.map($e=>{const ft=$e.fields.filter(gt=>at.includes(gt));if(ft.length===0)return null;const vt=Pot(ft[0]);return c.jsx(nk,{defaultOpen:!1,children:c.jsxs(Zr,{className:"p-0 overflow-hidden",children:[c.jsxs(ik,{className:"flex w-full items-center gap-2 px-5 py-3.5 text-left hover:bg-muted/50 transition-colors group",children:[c.jsx(js,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),vt?c.jsx(vt,{size:16,className:"text-muted-foreground"}):c.jsx(CY,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:Fe($e.label)})]}),c.jsx(sk,{children:c.jsx("div",{className:"grid gap-4 px-5 pb-5 md:grid-cols-2",children:ft.map(gt=>{const $r=Lot(gt),mr=!!q[gt];return c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(mi,{htmlFor:`api-${gt}`,className:"font-mono text-xs",children:Fe(gt)}),Pe(gt)]}),c.jsxs("div",{className:"relative",children:[c.jsx(Ln,{id:`api-${gt}`,type:$r&&!mr?"password":"text",value:j[gt]??"",onChange:Ur=>{E(Xt=>({...Xt,[gt]:Ur.target.value}))},placeholder:U[gt]?"(set via .env)":"(empty)",className:$r?"pr-9":""}),$r&&c.jsx("button",{type:"button",className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>Te(gt),tabIndex:-1,"aria-label":mr?"Hide value":"Show value",children:mr?c.jsx(Hd,{className:"h-4 w-4"}):c.jsx(tf,{className:"h-4 w-4"})})]})]},gt)})})})]})},$e.label)}),c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-30 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:c.jsxs("div",{className:"mx-auto flex max-w-5xl items-center gap-3 px-4 py-3 sm:px-6",children:[c.jsx(we,{onClick:()=>{Oe()},disabled:A||!ht,children:A?"Saving...":"Save API settings"}),c.jsx(we,{variant:"ghost",onClick:At,disabled:!ht,children:"Discard"}),$&&c.jsx("span",{className:"text-sm text-muted-foreground",children:$}),K&&c.jsx("span",{className:"text-sm text-destructive",children:K})]})})]}):qe}),c.jsx(ea,{value:"tools",className:"space-y-6",children:Ze?c.jsx(_it,{token:r}):qe}),c.jsx(ea,{value:"extensions",className:"space-y-6",children:ze?c.jsx(Cit,{token:r}):qe}),c.jsx(ea,{value:"skills",className:"space-y-6",children:mt?c.jsx(Tit,{token:r}):qe}),c.jsx(ea,{value:"channels",className:"space-y-6",children:yt?c.jsx(Mit,{token:r}):qe}),c.jsxs(ea,{value:"activity",className:"space-y-6",children:[Rt&&g&&g.length>0&&c.jsxs(Zr,{className:"p-5 space-y-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-medium",children:Fe("Recent activity")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Recent chat messages and terminal sessions."})]}),c.jsx(Rit,{events:g})]}),Rt&&(!g||g.length===0)&&c.jsx(Zr,{className:"p-5",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"No recent activity yet."})}),!Rt&&qe]})]})]})}function Bot(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,a,o,l=[],d=!0,u=!1;try{if(a=(n=n.call(e)).next,r===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(i=a.call(n)).done)&&(l.push(i.value),l.length!==r);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function zot(e,r,n){return r=Kot(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function KU(e,r){return Wot(e)||Bot(e,r)||Yce(e,r)||qot()}function Fot(e){return Hot(e)||Uot(e)||Yce(e)||Vot()}function Hot(e){if(Array.isArray(e))return M7(e)}function Wot(e){if(Array.isArray(e))return e}function Uot(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yce(e,r){if(e){if(typeof e=="string")return M7(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 M7(e,r)}}function M7(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 Vot(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1231
1231
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qot(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1232
1232
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Got(e,r){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Kot(e){var r=Got(e,"string");return typeof r=="symbol"?r:String(r)}var Yot=function(r,n){var i=new Set(n);return Object.assign.apply(Object,[{}].concat(Fot(Object.entries(r).filter(function(s){var a=KU(s,1),o=a[0];return!i.has(o)}).map(function(s){var a=KU(s,2),o=a[0],l=a[1];return zot({},o,l)}))))};function R7(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=Array(r);n<r;n++)i[n]=e[n];return i}function Xot(e){if(Array.isArray(e))return e}function Jot(e){if(Array.isArray(e))return R7(e)}function Zot(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qot(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,a,o,l=[],d=!0,u=!1;try{if(a=(n=n.call(e)).next,r!==0)for(;!(d=(i=a.call(n)).done)&&(l.push(i.value),l.length!==r);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function elt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1233
1233
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tlt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|