@aalis/plugin-webui-client 0.11.1 → 0.11.2
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/assets/{AuthorityPage-D3c_GhYg.js → AuthorityPage-BKfFvBWU.js} +1 -1
- package/dist/assets/{DynamicPage-B5APLJwu.js → DynamicPage-1fMN_fFH.js} +1 -1
- package/dist/assets/{FilesPage-BYyEd_Xb.js → FilesPage-TnRIpbLe.js} +1 -1
- package/dist/assets/{MarketplacePage-DXmX9rkf.js → MarketplacePage-ncAn1gdt.js} +1 -1
- package/dist/assets/{PlatformPage-D8vZKsvZ.js → PlatformPage-D47Tlyot.js} +1 -1
- package/dist/assets/PluginConfigPage-iTmGGHZb.js +23 -0
- package/dist/assets/SchemaForm-BcYxH5r1.js +1 -0
- package/dist/assets/{SessionsPage-CYFjpcjv.js → SessionsPage-BsoBBLVX.js} +1 -1
- package/dist/assets/{arc-CClRoqMj.js → arc-C8FYpW_k.js} +1 -1
- package/dist/assets/{architectureDiagram-3BPJPVTR-B0b6Rywx.js → architectureDiagram-3BPJPVTR-CAv5Isoe.js} +1 -1
- package/dist/assets/{blockDiagram-GPEHLZMM-DipJsGay.js → blockDiagram-GPEHLZMM-BMkkS1CP.js} +1 -1
- package/dist/assets/{c4Diagram-AAUBKEIU-BNmshTOF.js → c4Diagram-AAUBKEIU-Cv1li0XO.js} +1 -1
- package/dist/assets/channel-BO20buBp.js +1 -0
- package/dist/assets/{chunk-2J33WTMH-BsV69ANT.js → chunk-2J33WTMH-COYrBuB8.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-CPyTKCGx.js → chunk-4BX2VUAB-Bv5A4tpJ.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-C6vq6z-8.js → chunk-55IACEB6-CJ9T8Wtu.js} +1 -1
- package/dist/assets/{chunk-727SXJPM-DY5QI4An.js → chunk-727SXJPM-CtzK3fFt.js} +1 -1
- package/dist/assets/{chunk-AQP2D5EJ-EW0y4bga.js → chunk-AQP2D5EJ-C-UnOi2J.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-Bq1b7ZFm.js → chunk-FMBD7UC4-9CNqmsuy.js} +1 -1
- package/dist/assets/{chunk-ND2GUHAM-C-4E9LgY.js → chunk-ND2GUHAM-B9JC5LqN.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-Cggh32SU.js → chunk-QZHKN3VN-BR2ggXBl.js} +1 -1
- package/dist/assets/classDiagram-4FO5ZUOK-BOHWB_6U.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-BOHWB_6U.js +1 -0
- package/dist/assets/{clock-cMoARLnL.js → clock-RQMz9x7Y.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-C2aXl7NK.js → cose-bilkent-S5V4N54A-964iBL_P.js} +1 -1
- package/dist/assets/{dagre-BM42HDAG-DsE9mxP1.js → dagre-BM42HDAG-D-dsmkCS.js} +1 -1
- package/dist/assets/{diagram-2AECGRRQ-Cf9NZrCh.js → diagram-2AECGRRQ-WNDRTsOY.js} +1 -1
- package/dist/assets/{diagram-5GNKFQAL-BSz3SaT4.js → diagram-5GNKFQAL-CY61CWjO.js} +1 -1
- package/dist/assets/{diagram-KO2AKTUF-LKkBjvQa.js → diagram-KO2AKTUF-DqhL26LE.js} +1 -1
- package/dist/assets/{diagram-LMA3HP47-v-hSdx7w.js → diagram-LMA3HP47-DxDG5PxW.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-B5GTKRKU.js → diagram-OG6HWLK6-Dx_wiA_a.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-B2dZ6G20.js → erDiagram-TEJ5UH35-C4xALfST.js} +1 -1
- package/dist/assets/{flowDiagram-I6XJVG4X-mjVJSamX.js → flowDiagram-I6XJVG4X-Di3HNDco.js} +1 -1
- package/dist/assets/{ganttDiagram-6RSMTGT7-DSB_yERs.js → ganttDiagram-6RSMTGT7-HcIheWs9.js} +1 -1
- package/dist/assets/{gitGraphDiagram-PVQCEYII-B4kiZGq7.js → gitGraphDiagram-PVQCEYII-CqR1wNgT.js} +1 -1
- package/dist/assets/{globe-wo3CIehr.js → globe-DkMTwfDx.js} +1 -1
- package/dist/assets/{index-DvV80Yu7.js → index-C6kOarnb.js} +3 -3
- package/dist/assets/{infoDiagram-5YYISTIA-XfWMHpBx.js → infoDiagram-5YYISTIA-BL-ae21L.js} +1 -1
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-BhftoIFL.js → ishikawaDiagram-YF4QCWOH-BfwsZs9I.js} +1 -1
- package/dist/assets/{journeyDiagram-JHISSGLW-BdPhXJS9.js → journeyDiagram-JHISSGLW-CP8pImA1.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-DP9dT66v.js → kanban-definition-UN3LZRKU-BNKqyzBh.js} +1 -1
- package/dist/assets/{linear-BY9Cpx0t.js → linear-CtHUgwwf.js} +1 -1
- package/dist/assets/{mermaid.core-DfVdcmTH.js → mermaid.core-DX1iGORO.js} +4 -4
- package/dist/assets/{mindmap-definition-RKZ34NQL-k2Cztpqe.js → mindmap-definition-RKZ34NQL-Ctio0c-a.js} +1 -1
- package/dist/assets/{pieDiagram-4H26LBE5-D5-0D-FK.js → pieDiagram-4H26LBE5-CDcJO30o.js} +1 -1
- package/dist/assets/{quadrantDiagram-W4KKPZXB-w2-y8vBx.js → quadrantDiagram-W4KKPZXB-DXF4SFSU.js} +1 -1
- package/dist/assets/{requirementDiagram-4Y6WPE33-D9jaSbpQ.js → requirementDiagram-4Y6WPE33-BgOuPsQu.js} +1 -1
- package/dist/assets/{sankeyDiagram-5OEKKPKP-BGBVb173.js → sankeyDiagram-5OEKKPKP-CLHPzDc9.js} +1 -1
- package/dist/assets/{sequenceDiagram-3UESZ5HK-BOKbRyZK.js → sequenceDiagram-3UESZ5HK-D6uVPJgk.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-DxRi0tDI.js → stateDiagram-AJRCARHV-DD-H-KUD.js} +1 -1
- package/dist/assets/{stateDiagram-v2-BHNVJYJU-BxVQEu32.js → stateDiagram-v2-BHNVJYJU-DBaAUEk1.js} +1 -1
- package/dist/assets/{timeline-definition-PNZ67QCA-fa76cb2Y.js → timeline-definition-PNZ67QCA-DcHy_22Q.js} +1 -1
- package/dist/assets/{vennDiagram-CIIHVFJN-Cfu9ZGNx.js → vennDiagram-CIIHVFJN-Bsy9pahQ.js} +1 -1
- package/dist/assets/{wardley-L42UT6IY-C7UmKZUS.js → wardley-L42UT6IY-CzWIZXfj.js} +1 -1
- package/dist/assets/{wardleyDiagram-YWT4CUSO-HGHaCD-i.js → wardleyDiagram-YWT4CUSO-DG6xHRb_.js} +1 -1
- package/dist/assets/{xychartDiagram-2RQKCTM6-Dn8PxDor.js → xychartDiagram-2RQKCTM6-Co4crWuM.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/PluginConfigPage-DIn8fL_h.js +0 -23
- package/dist/assets/SchemaForm-YVQZ6Keg.js +0 -1
- package/dist/assets/channel-BwqmVsV7.js +0 -1
- package/dist/assets/classDiagram-4FO5ZUOK-a3IT83pw.js +0 -1
- package/dist/assets/classDiagram-v2-Q7XG4LA2-a3IT83pw.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as e}from"./react-vendor-BPQixOLZ.js";import{c as _,p as B,W as xe}from"./index-
|
|
1
|
+
import{r as o,j as e}from"./react-vendor-BPQixOLZ.js";import{c as _,p as B,W as xe}from"./index-C6kOarnb.js";import{C as ve}from"./clock-RQMz9x7Y.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,j as e,R as W,a as tt}from"./react-vendor-BPQixOLZ.js";import{c as me,a as ge,p as D,S as nt,W as st}from"./index-
|
|
1
|
+
import{r as d,j as e,R as W,a as tt}from"./react-vendor-BPQixOLZ.js";import{c as me,a as ge,p as D,S as nt,W as st}from"./index-C6kOarnb.js";import{S as rt}from"./SchemaForm-BcYxH5r1.js";import{c as $e}from"./cytoscape.esm-LDYqcvCF.js";import{f as at}from"./cytoscape-fcose-DXAQNCkb.js";import{G as ot}from"./globe-DkMTwfDx.js";import{C as it}from"./clock-RQMz9x7Y.js";import{M as lt,r as dt,a as ct}from"./markdown-B2G8c9k5.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as e}from"./react-vendor-BPQixOLZ.js";import{c as k,a as j,C as O,f as U,F as A,g as J,D as K,h as V,X as G}from"./index-
|
|
1
|
+
import{r as i,j as e}from"./react-vendor-BPQixOLZ.js";import{c as k,a as j,C as O,f as U,F as A,g as J,D as K,h as V,X as G}from"./index-C6kOarnb.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s,r}from"./react-vendor-BPQixOLZ.js";import{c as oe,a as g,T as V,D as de}from"./index-
|
|
1
|
+
import{j as s,r}from"./react-vendor-BPQixOLZ.js";import{c as oe,a as g,T as V,D as de}from"./index-C6kOarnb.js";import{u as me}from"./ConfirmDialog-DbV-E1Nd.js";import{C as ue}from"./clock-RQMz9x7Y.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,j as e}from"./react-vendor-BPQixOLZ.js";import{c as p,a as h}from"./index-
|
|
1
|
+
import{r as c,j as e}from"./react-vendor-BPQixOLZ.js";import{c as p,a as h}from"./index-C6kOarnb.js";import{G as x}from"./globe-DkMTwfDx.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{r as d,j as e}from"./react-vendor-BPQixOLZ.js";import{c as q,a as k,T as Ae}from"./index-C6kOarnb.js";import{b as H,S as Se,f as ke,u as Re}from"./SchemaForm-BcYxH5r1.js";import{u as Je}from"./ConfirmDialog-DbV-E1Nd.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
|
|
2
|
+
* @license lucide-react v1.7.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ge=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Ke=q("link-2",Ge);/**
|
|
7
|
+
* @license lucide-react v1.7.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ze=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],He=q("loader-circle",Ze);/**
|
|
12
|
+
* @license lucide-react v1.7.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const We=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Qe=q("radio",We);/**
|
|
17
|
+
* @license lucide-react v1.7.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Xe=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Ye=q("workflow",Xe);function W({label:u,value:r,depth:x=0,secret:M,description:N,defaultValue:v}){const[$,L]=d.useState(x<1);if(Array.isArray(r))return r.length===0?e.jsxs("div",{className:"config-item",style:{paddingLeft:x*12},children:[e.jsxs("span",{className:"key",children:[e.jsx("code",{className:"field-key",children:u}),N&&e.jsxs("span",{className:"field-hint",children:[" / ",N]})]}),e.jsx("span",{className:"val",children:"(空)"})]}):e.jsxs("div",{className:"config-nested",style:{paddingLeft:x*12},children:[e.jsxs("div",{className:"config-nested-header",onClick:()=>L(g=>!g),children:[e.jsx("span",{className:`config-block-toggle ${$?"open":""}`,children:"▶"}),e.jsxs("span",{className:"key",children:[e.jsx("code",{className:"field-key",children:u}),N&&e.jsxs("span",{className:"field-hint",children:[" / ",N]})]}),e.jsxs("span",{className:"config-nested-count",children:[r.length," 项"]})]}),$&&e.jsx("div",{className:"config-nested-body",children:r.map((g,j)=>e.jsx(W,{label:`#${j+1}`,value:g,depth:x+1,secret:M},j))})]});if(r==null||typeof r!="object"){const g=M||typeof r=="string"&&/(apiKey|password|secret|token)(?![a-zA-Z])/i.test(u),j=r==null,C=j&&v!==void 0&&v!==null,S=j?C?typeof v=="object"?JSON.stringify(v):String(v):"-":String(r),P=g&&S.length>4?S.slice(0,4)+"••••••":S;return e.jsxs("div",{className:"config-item",style:{paddingLeft:x*12},children:[e.jsxs("span",{className:"key",children:[e.jsx("code",{className:"field-key",children:u}),N&&e.jsxs("span",{className:"field-hint",children:[" / ",N]})]}),e.jsxs("span",{className:"val",title:g?"••••••":S,children:[P,C&&e.jsx("span",{className:"field-hint",children:" (默认)"})]})]})}const b=Object.entries(r);return e.jsxs("div",{className:"config-nested",style:{paddingLeft:x*12},children:[e.jsxs("div",{className:"config-nested-header",onClick:()=>L(g=>!g),children:[e.jsx("span",{className:`config-block-toggle ${$?"open":""}`,children:"▶"}),e.jsx("span",{className:"key",children:u}),e.jsxs("span",{className:"config-nested-count",children:[b.length," 项"]})]}),$&&e.jsx("div",{className:"config-nested-body",children:b.map(([g,j])=>e.jsx(W,{label:g,value:j,depth:x+1,secret:M},g))})]})}function cs({plugins:u,config:r,onRefresh:x,onConfigSaved:M,onRestart:N}){const{confirm:v,dialog:$}=Je(),[L,b]=d.useState(new Set),g=d.useRef(u),[j,C]=d.useState(null),[S,P]=d.useState({}),[Q,B]=d.useState({}),[D,X]=d.useState({}),[F,Y]=d.useState(void 0),[V,ee]=d.useState(null),[se,ne]=d.useState(!1),[Ce,we]=d.useState(new Set),[U,ae]=d.useState(""),[$e,Le]=d.useState(new Set),[te,A]=d.useState(null),[R,J]=d.useState("");d.useEffect(()=>{g.current!==u&&L.size>0&&b(new Set),g.current=u},[u,L]);const T=s=>b(t=>new Set(t).add(s)),w=s=>L.has(s),p=s=>{ee(s),setTimeout(()=>ee(null),2500)},Oe=async s=>{if(s.core)return;T(s.instanceId);const t=s.state==="disabled"?"enable":"disable",i=await k(`/api/plugins/${encodeURIComponent(s.instanceId)}/${t}`,{method:"POST"});i.ok?(p(`${s.instanceId} 已${t==="enable"?"启用":"禁用"}`),x()):(p(i.error??"未知错误"),b(l=>{const m=new Set(l);return m.delete(s.instanceId),m}))},Ie=s=>{const t=s.config??{};s.configSchema?B(H(s.configSchema,t)):P(ke(t)),C(s.instanceId)},ie=d.useCallback(async s=>{if(!D[s])try{const t=await k(`/api/models/${encodeURIComponent(s)}`),i=t.providers&&t.providers.length>0?t.providers.map(l=>({label:`${l.provider} / ${l.model}`,value:l.value})):(t.models??[]).map(l=>({label:l,value:l}));X(l=>({...l,[s]:i}))}catch{X(t=>({...t,[s]:[]}))}},[D]),ce=d.useCallback(async()=>{if(!F)try{const s=await k("/api/llm-providers");Y(s.providers??[])}catch{Y([])}},[F]),le=s=>{const t=s.defaultConfig??{};s.configSchema?B(H(s.configSchema,t)):P(ke(t))},oe=async(s,t)=>{const i=t?Q:Re(S);T(s);const l=await k(`/api/plugins/${encodeURIComponent(s)}/config`,{method:"PUT",body:JSON.stringify({config:i})});if(l.error){p(l.error),b(m=>{const _=new Set(m);return _.delete(s),_});return}p(`${s} 配置已更新,正在重载…`),C(null),x()},re=async s=>{const t=R.trim();if(!t)return;T(s);const i=await k(`/api/plugins/${encodeURIComponent(s)}/instances`,{method:"POST",body:JSON.stringify({suffix:t})});i.ok?(p(`已创建实例 ${i.instanceId}`),A(null),J(""),x()):(p(i.error??"创建失败"),b(l=>{const m=new Set(l);return m.delete(s),m}))},Me=async s=>{if(!await v({title:`删除实例「${s}」`,body:"该实例的配置将一并移除。",confirmLabel:"删除",danger:!0}))return;T(s);const i=await k(`/api/plugins/${encodeURIComponent(s)}/instance`,{method:"DELETE"});i.ok?(p(`已删除实例 ${s}`),x()):(p(i.error??"删除失败"),b(l=>{const m=new Set(l);return m.delete(s),m}))},Pe=async s=>{if(!await v({title:`卸载插件「${s.displayName??s.name}」`,body:`${s.name}
|
|
22
|
+
|
|
23
|
+
将删除其代码目录并清除残留配置。不可恢复,但可从插件市场重新安装。`,confirmLabel:"卸载",danger:!0}))return;T(s.instanceId);const i=await k("/api/marketplace/uninstall",{method:"POST",body:JSON.stringify({name:s.name})});i.ok?(p(i.message??`${s.name} 已卸载`),x()):(p(i.error??"卸载失败"),b(l=>{const m=new Set(l);return m.delete(s.instanceId),m}))},Te=s=>s.instanceId!==s.name,ze={active:"运行中",disabled:"已禁用",pending:"等待中",disposed:"已释放",error:"运行错误"},Ee={active:"active",disabled:"disposed",pending:"pending",error:"error"},De=s=>{we(t=>{const i=new Set(t);return i.has(s)?i.delete(s):i.add(s),i})},[de,G]=d.useState(!1),[me,he]=d.useState({}),O=r&&r._schema?r._schema:void 0;d.useEffect(()=>{r&&O&&he(H(O,r))},[r,O]);const Fe=async()=>{ne(!0);const s=await k("/api/config",{method:"PUT",body:JSON.stringify(me)});ne(!1),s.ok?(G(!1),M(),s.restart?N():p("全局配置已保存")):p(s.error??"未知错误")};return e.jsxs("div",{className:"page-content page-plugin-config",children:[$,V&&e.jsx("div",{className:"toast",children:V}),e.jsxs("div",{className:"config-header-row",children:[e.jsx("div",{className:"section-label",style:{marginBottom:0},children:"全局配置"}),e.jsx("div",{style:{display:"flex",gap:6},children:de?e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"btn btn-primary btn-sm",onClick:Fe,disabled:se,children:se?"保存中...":"保存"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>G(!1),children:"取消"})]}):e.jsx("button",{className:"btn btn-sm",onClick:()=>G(!0),children:"编辑"})})]}),r&&O&&e.jsx("div",{className:"config-block",style:{marginTop:8,marginBottom:20},children:e.jsx("div",{className:"config-block-body",style:{paddingTop:10},children:de?e.jsx(Se,{schema:O,draft:me,onChange:he,modelCache:D,onFetchModels:ie,llmProviders:F,onFetchLLMProviders:ce}):e.jsx(e.Fragment,{children:Object.entries(O).map(([s,t])=>{const i=r[s],l=t,m=l.description||l.label;return e.jsxs("div",{className:"config-item",children:[e.jsxs("span",{className:"key",children:[e.jsx("code",{className:"field-key",children:s}),m&&e.jsxs("span",{className:"field-hint",children:[" / ",m]})]}),e.jsx("span",{className:"val",children:l.type==="boolean"?i?"✓ 开启":"✗ 关闭":i===""||i==null?"(空)":String(i)})]},s)})})})}),e.jsx("div",{className:"section-label",style:{marginBottom:0},children:"插件管理"}),e.jsxs("div",{className:"plugin-search-row",children:[e.jsx("input",{className:"plugin-search-input",placeholder:"搜索插件 / 工具名 / 指令名...",value:U,onChange:s=>ae(s.target.value)}),U&&e.jsx("button",{className:"plugin-search-clear",onClick:()=>ae(""),children:"✕"})]}),u.length===0&&e.jsx("div",{className:"empty-hint",children:"无插件"}),(()=>{const s=U.toLowerCase(),t=s?u.filter(c=>c.name.toLowerCase().includes(s)||c.instanceId.toLowerCase().includes(s)||c.displayName&&c.displayName.toLowerCase().includes(s)||c.provides.some(o=>o.toLowerCase().includes(s))||(c.tools??[]).some(o=>o.toLowerCase().includes(s))||(c.commands??[]).some(o=>o.toLowerCase().includes(s))):u,i={},l=["系统","LLM 模型","智能体","存储","嵌入模型","向量存储","工具","界面","适配器","自动化","其他"];for(const c of t){const o=c.name,y=c.core?"系统":/^(@aalis\/)?plugin-(openai|deepseek|ollama)$/.test(o)?"LLM 模型":/^(@aalis\/)?plugin-agent/.test(o)||/^(@aalis\/)?plugin-persona$/.test(o)?"智能体":/^(@aalis\/)?plugin-memory-/.test(o)?"存储":/^(@aalis\/)?plugin-embedding-/.test(o)?"嵌入模型":/^(@aalis\/)?plugin-vectorstore-/.test(o)?"向量存储":/^(@aalis\/)?plugin-(tool-|tools-|websearch-)/.test(o)?"工具":/^(@aalis\/)?plugin-(webui-|cli)/.test(o)?"界面":/^(@aalis\/)?plugin-adapter-/.test(o)?"适配器":/^(@aalis\/)?plugin-(scheduler|skills)$/.test(o)?"自动化":/^(@aalis\/)?plugin-(commands|authority)$/.test(o)?"系统":"其他";i[c.instanceId]=y}const m=new Map;for(const c of l)m.set(c,[]);for(const c of t){const o=i[c.instanceId]||"其他";m.get(o).push(c)}const _=c=>{Le(o=>{const y=new Set(o);return y.has(c)?y.delete(c):y.add(c),y})};return Array.from(m.entries()).filter(([,c])=>c.length>0).map(([c,o])=>{const y=$e.has(c);return e.jsxs("div",{className:"plugin-category",children:[e.jsxs("div",{className:"plugin-category-header",onClick:()=>_(c),children:[e.jsx("span",{className:`config-block-toggle ${y?"":"open"}`,children:"▶"}),e.jsx("span",{className:"plugin-category-name",children:c}),e.jsx("span",{className:"plugin-category-count",children:o.length})]}),!y&&o.map(n=>{var ue,xe,pe,be,je,ye,Ne;const f=n.instanceId,_e=j===f,z=Ce.has(f),I=Te(n),ge=I?f.slice(n.name.length+1):void 0,fe=n.extends&&(((ue=n.extends.events)==null?void 0:ue.length)||((xe=n.extends.hooks)==null?void 0:xe.length)||n.extends.mixins&&Object.keys(n.extends.mixins).length),K=fe||n.config&&Object.keys(n.config).length>0||!!n.configSchema,Z=!!n.configSchema;return e.jsxs("div",{className:`plugin-card ${n.state==="disabled"?"disabled":""} ${n.state==="error"?"errored":""}`,style:{position:"relative"},children:[w(f)&&e.jsxs("div",{className:"plugin-reload-overlay",children:[e.jsx(He,{size:20,className:"plugin-reload-spinner"}),e.jsx("span",{children:"重载中…"})]}),e.jsxs("div",{className:"plugin-card-header",children:[e.jsxs("div",{className:"plugin-card-info",style:{cursor:K?"pointer":"default"},onClick:()=>K&&De(f),children:[K&&e.jsx("span",{className:`config-block-toggle ${z?"open":""}`,children:"▶"}),e.jsxs("span",{className:"plugin-card-name",children:[n.displayName??n.name,n.displayName&&e.jsx("span",{className:"plugin-card-module-name",children:n.name}),ge&&e.jsxs("span",{className:"plugin-instance-suffix",children:[":",ge]})]}),e.jsx("span",{className:`badge ${Ee[n.state]??"pending"}`,children:ze[n.state]??n.state}),n.core&&e.jsx("span",{className:"badge core-badge",children:"核心"}),n.reusable&&!I&&e.jsx("span",{className:"badge",style:{background:"#7c5cfc",color:"#fff",fontSize:10},children:"多实例"}),n.provides.length>0&&e.jsx("span",{className:"plugin-provides-inline",children:n.provides.map(a=>e.jsx("span",{className:"provides-chip",children:a},a))})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[I&&e.jsx("button",{className:"btn btn-sm",style:{color:"#e55",fontSize:11},onClick:()=>Me(f),disabled:w(f),children:"删除"}),!I&&e.jsx("button",{className:"btn btn-sm",style:{color:"#e55",fontSize:11},onClick:()=>Pe(n),disabled:w(f),title:"卸载插件(删包 + 清配置)",children:"卸载"}),n.reusable&&!I&&e.jsx("button",{className:"btn btn-sm",style:{fontSize:11},onClick:()=>{A(te===n.name?null:n.name),J("")},children:"+ 实例"}),e.jsxs("label",{className:`toggle-switch ${n.core?"core-locked":""}`,children:[e.jsx("input",{type:"checkbox",checked:n.state!=="disabled",onChange:()=>Oe(n),disabled:n.core||w(f)}),e.jsx("span",{className:"toggle-slider"})]})]})]}),te===n.name&&!I&&e.jsxs("div",{className:"plugin-new-instance-row",style:{display:"flex",gap:6,padding:"6px 12px",alignItems:"center"},children:[e.jsxs("span",{style:{fontSize:12,opacity:.7},children:[n.name,":"]}),e.jsx("input",{style:{flex:1,fontSize:12},className:"plugin-search-input",placeholder:"输入实例后缀(如 vision)",value:R,onChange:a=>J(a.target.value),onKeyDown:a=>a.key==="Enter"&&re(n.name)}),e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>re(n.name),disabled:!R.trim()||w(n.name),children:"创建"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>A(null),children:"取消"})]}),n.state==="error"&&n.error&&e.jsxs("div",{className:"plugin-error-msg",children:[e.jsx(Ae,{size:14})," ",n.error]}),z&&n.provides.length>0&&e.jsx("div",{className:"plugin-card-provides",children:n.provides.map(a=>e.jsx("span",{className:"tool-chip",children:a},a))}),z&&((((pe=n.requiredServices)==null?void 0:pe.length)??0)>0||(((be=n.optionalServices)==null?void 0:be.length)??0)>0||(((je=n.capabilities)==null?void 0:je.length)??0)>0)&&e.jsxs("div",{className:"plugin-card-caps",children:[(n.requiredServices??[]).map(a=>e.jsxs("span",{className:"cap-chip dep-required",title:"必需依赖的服务",children:["需 ",a]},`req-${a}`)),(n.optionalServices??[]).map(a=>e.jsxs("span",{className:"cap-chip dep-optional",title:"可选依赖的服务",children:["可选 ",a]},`opt-${a}`)),(n.capabilities??[]).map(a=>e.jsx("span",{className:`cap-chip ${a==="safety:dangerous"?"cap-danger":"cap-sensitive"}`,title:"触达的敏感能力",children:a==="safety:dangerous"?"⚠ 高危操作":a},`cap-${a}`))]}),z&&fe&&e.jsxs("div",{className:"plugin-card-extends",children:[e.jsx("span",{className:"extends-label",children:"扩展 Core:"}),(ye=n.extends.events)==null?void 0:ye.map(a=>e.jsxs("span",{className:"extends-chip event",children:[e.jsx(Qe,{size:12})," ",a]},`e-${a}`)),(Ne=n.extends.hooks)==null?void 0:Ne.map(a=>e.jsxs("span",{className:"extends-chip hook",children:[e.jsx(Ye,{size:12})," ",a]},`h-${a}`)),n.extends.mixins&&Object.entries(n.extends.mixins).map(([a,E])=>E.map(h=>e.jsxs("span",{className:"extends-chip mixin",children:[e.jsx(Ke,{size:12})," ctx.",h,"()"]},`m-${a}-${h}`)))]}),z&&(n.config&&Object.keys(n.config).length>0||Z)&&e.jsx("div",{className:"plugin-card-config",children:_e?Z?e.jsxs(e.Fragment,{children:[e.jsx(Se,{schema:n.configSchema,draft:Q,onChange:B,modelCache:D,onFetchModels:ie,llmProviders:F,onFetchLLMProviders:ce}),e.jsxs("div",{className:"config-edit-actions",children:[e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>oe(f,!0),disabled:w(f),children:"保存"}),n.defaultConfig&&Object.keys(n.defaultConfig).length>0&&e.jsx("button",{className:"btn btn-warn btn-sm",onClick:()=>le(n),children:"恢复默认"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>C(null),children:"取消"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"config-edit-form",children:Object.keys(S).map(a=>e.jsxs("div",{className:"config-edit-row",children:[e.jsx("label",{className:"config-edit-label",children:a}),e.jsx("input",{className:"config-edit-input",type:/(apiKey|password|secret|token)(?![a-zA-Z])/i.test(a)?"password":"text",value:S[a],onChange:E=>P(h=>({...h,[a]:E.target.value}))})]},a))}),e.jsxs("div",{className:"config-edit-actions",children:[e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>oe(f,!1),disabled:w(f),children:"保存"}),n.defaultConfig&&Object.keys(n.defaultConfig).length>0&&e.jsx("button",{className:"btn btn-warn btn-sm",onClick:()=>le(n),children:"恢复默认"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>C(null),children:"取消"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"config-block-body",style:{paddingTop:6},children:(Z?Object.keys(n.configSchema).map(a=>[a,n.config[a]]):Object.entries(n.config)).map(([a,E])=>{var ve;const h=(ve=n.configSchema)==null?void 0:ve[a],qe=h&&"secret"in h?h.secret:void 0,Be=h&&"description"in h?h.description:h&&"label"in h?h.label:void 0,Ue=h&&"default"in h?h.default:void 0;return e.jsx(W,{label:a,value:E,secret:qe,description:Be,defaultValue:Ue},a)})}),e.jsx("button",{className:"btn btn-sm",onClick:()=>Ie(n),children:"编辑配置"})]})})]},f)})]},c)})})()]})}export{cs as PluginConfigPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as S}from"./react-vendor-BPQixOLZ.js";function I({value:s,onChange:d,className:a}){const o=s==null||s===""?"":String(s),[t,i]=S.useState(o),x=S.useRef(o);return S.useEffect(()=>{const r=s==null||s===""?"":String(s);if(r!==x.current){x.current=r;const n=t===""?"":Number(t);if(String(n)!==t)return;i(r)}},[s]),e.jsx("input",{className:a,type:"text",inputMode:"decimal",value:t,onChange:r=>{const n=r.target.value;i(n),n===""||n==="-"?d(void 0):(!n.endsWith(".")&&!n.endsWith("0")&&!isNaN(Number(n))||!n.endsWith(".")&&!isNaN(Number(n)))&&d(Number(n))},onBlur:r=>{const n=r.target.value;if(n===""||n==="-")d(void 0),i("");else{const y=Number(n);isNaN(y)?i(x.current):(d(y),x.current=String(y))}}})}function k(s,d=""){const a={};for(const[o,t]of Object.entries(s)){const i=d?`${d}.${o}`:o;t&&typeof t=="object"&&!Array.isArray(t)?Object.assign(a,k(t,i)):a[i]=t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}return a}function E(s){const d={};for(const[a,o]of Object.entries(s)){const t=a.split(".");let i=d;for(let r=0;r<t.length-1;r++)(!(t[r]in i)||typeof i[t[r]]!="object")&&(i[t[r]]={}),i=i[t[r]];const x=t[t.length-1];try{i[x]=JSON.parse(o)}catch{i[x]=o}}return d}function w(s){return"type"in s&&s.type!=="array"}function A(s){return"type"in s&&s.type==="array"}function K(s,d){const a={};for(const[o,t]of Object.entries(s))if(A(t)){const i=d[o];a[o]=Array.isArray(i)?i:t.default??[]}else if(w(t))a[o]=d[o]??t.default??(t.type==="number"?void 0:t.type==="boolean"?!1:t.type==="multiselect"?[]:"");else{const i={},x=d[o]??{};for(const[r,n]of Object.entries(t.fields))i[r]=x[r]??n.default??(n.type==="number"?void 0:n.type==="boolean"?!1:n.type==="multiselect"?[]:"");a[o]=i}for(const[o,t]of Object.entries(d))o in a||(a[o]=t);return a}function z({value:s,onChange:d,llmProviders:a,onFetchLLMProviders:o}){S.useEffect(()=>{a||o()},[]);const t=s&&typeof s=="object"?s:{},i=t.provider??"",x=t.model??"",r=i&&x?`${i}/${x}`:"",[n,y]=S.useState("idle"),[m,p]=S.useState(""),b=async()=>{if(i){y("loading"),p("刷新中…");try{const c=await fetch(`/api/llm-providers/${encodeURIComponent(i)}/refresh`,{method:"POST"}),u=await c.json().catch(()=>({}));if(!c.ok){y("error"),p((u==null?void 0:u.error)??`HTTP ${c.status}`);return}o();const f=Array.isArray(u.added)?u.added.length:0,g=Array.isArray(u.removed)?u.removed.length:0;y("ok"),p(f||g?`+${f} / -${g}`:`共 ${u.total??0} 个`),setTimeout(()=>y("idle"),3e3)}catch(c){y("error"),p(c.message)}}},j=[];for(const c of a??[]){const u=c.label??c.contextId;for(const f of c.models){const g=f.capabilities.length>0?` [${f.capabilities.join(",")}]`:"";j.push({key:`${c.contextId}/${f.id}`,provider:c.contextId,model:f.id,label:`${u} / ${f.id}${g}`})}}return r&&!j.some(c=>c.key===r)&&j.unshift({key:r,provider:i,model:x,label:`${i} / ${x} (已离线)`}),e.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[e.jsxs("select",{className:"config-edit-input",style:{flex:"1 1 320px",minWidth:0},value:r,onChange:c=>{const u=c.target.value;if(!u){d(void 0);return}const f=j.find(g=>g.key===u);f&&d({provider:f.provider,model:f.model})},children:[e.jsx("option",{value:"",children:"— 继承默认 —"}),j.map(c=>e.jsx("option",{value:c.key,children:c.label},c.key))]}),e.jsx("button",{type:"button",className:"config-edit-btn",style:{fontSize:11,padding:"2px 8px"},onClick:b,disabled:!i||n==="loading",title:i?`重新探测 ${i} 的远端模型列表(仅对动态发现型 provider 如 Ollama 生效)`:"先选模型后才能刷新对应 provider",children:n==="loading"?"⟳":"⟳ 刷新"}),m&&e.jsx("span",{style:{fontSize:11,color:n==="error"?"#c62828":n==="ok"?"#2e7d32":"#666"},children:m})]})}function $({field:s,fieldKey:d,value:a,onChange:o,modelCache:t,onFetchModels:i,llmProviders:x,onFetchLLMProviders:r}){var y;if(s.type==="boolean")return e.jsxs("label",{className:"config-edit-label",style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("input",{type:"checkbox",checked:!!a,onChange:m=>o(m.target.checked)}),s.label]});if(s.type==="multiselect"){const m=Array.isArray(a)?a:[],p=s.dynamicOptions,b=p?t[p]:void 0;S.useEffect(()=>{p&&!t[p]&&i(p)},[p]);const j=s.options??[],c=b??[],u=[...j];for(const l of c)u.some(N=>String(N.value)===String(l.value))||u.push(l);for(const l of m)u.some(N=>String(N.value)===l)||u.push({label:l,value:l});const f=l=>{const N=m.includes(l)?m.filter(O=>O!==l):[...m,l];o(N)},[g,v]=S.useState(""),h=()=>{const l=g.replace(/^[\r\n\t]+|[\r\n\t]+$/g,"");l&&!m.includes(l)&&o([...m,l]),v("")};return e.jsxs("div",{className:"multiselect-group",children:[u.map(l=>e.jsxs("label",{className:"multiselect-item",children:[e.jsx("input",{type:"checkbox",checked:m.includes(String(l.value)),onChange:()=>f(String(l.value))}),l.label]},String(l.value))),s.allowCustom&&e.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[e.jsx("input",{className:"config-edit-input",style:{flex:1,fontSize:12},type:"text",placeholder:"手动输入...",value:g,onChange:l=>v(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),h())}}),e.jsx("button",{className:"config-edit-btn",style:{fontSize:11,padding:"2px 8px"},onClick:h,children:"添加"})]})]})}if(s.type==="llm-ref")return e.jsx(z,{value:a,onChange:o,llmProviders:x,onFetchLLMProviders:r});if(s.type==="select"||s.type==="string"&&((y=s.options)!=null&&y.length||s.dynamicOptions)){const m=s.dynamicOptions,p=m?t[m]:void 0;S.useEffect(()=>{m&&!t[m]&&i(m)},[m]);const b=s.options??[],j=p??[],c=[...b];for(const f of j)c.some(g=>String(g.value)===String(f.value))||c.push(f);const u=String(a??"");return u&&!c.some(f=>String(f.value)===u)&&c.unshift({label:u,value:u}),e.jsxs("select",{className:"config-edit-input",value:u,onChange:f=>o(f.target.value),children:[c.length===0&&e.jsx("option",{value:"",children:"加载中..."}),c.map(f=>e.jsx("option",{value:String(f.value),children:f.label},String(f.value)))]})}if(s.type==="number")return e.jsx(I,{className:"config-edit-input",value:a,onChange:o});if(s.type==="textarea")return e.jsx("textarea",{className:"config-edit-input config-textarea",value:String(a??""),onChange:m=>o(m.target.value),rows:3});const n=s.secret||/(apiKey|password|secret|token)(?![a-zA-Z])/i.test(d);return e.jsx("input",{className:"config-edit-input",type:n?"password":"text",value:String(a??""),onChange:m=>o(m.target.value)})}function L({schema:s,draft:d,onChange:a,modelCache:o,onFetchModels:t,llmProviders:i,onFetchLLMProviders:x}){return e.jsx("div",{className:"config-edit-form",children:Object.entries(s).map(([r,n])=>{if(w(n)){const p=n.description||n.label;return e.jsxs("div",{className:"config-edit-row",children:[e.jsxs("label",{className:"config-edit-label",title:n.description,children:[e.jsx("code",{className:"field-key",children:r}),p&&e.jsxs("span",{className:"field-hint",children:[" / ",p]}),n.required&&e.jsx("span",{style:{color:"#ef4444",marginLeft:2},children:"*"})]}),e.jsx($,{field:n,fieldKey:r,value:d[r],onChange:b=>a({...d,[r]:b}),modelCache:o,onFetchModels:t,llmProviders:i,onFetchLLMProviders:x??(()=>{})})]},r)}if(A(n)){const p=Array.isArray(d[r])?d[r]:[],b=g=>a({...d,[r]:g}),j=n.items??{};n.items||console.warn(`[SchemaForm] 数组字段 "${r}" 缺少 items 定义,添加按钮将创建空对象`);const c=()=>{const g={};for(const[v,h]of Object.entries(j))h.default!==void 0?g[v]=h.default:h.required&&(g[v]=h.type==="number"?0:h.type==="boolean"?!1:"");b([...p,g])},u=g=>{b(p.filter((v,h)=>h!==g))},f=(g,v,h)=>{const l=p.map((N,O)=>O===g?{...N,[v]:h}:N);b(l)};return e.jsxs("div",{className:"config-edit-group",children:[e.jsxs("div",{className:"config-edit-group-label",style:{display:"flex",alignItems:"center",gap:8},children:[n.label,e.jsx("button",{className:"config-edit-btn",style:{fontSize:12,padding:"2px 8px"},onClick:c,children:"+ 添加"})]}),n.description&&e.jsx("span",{className:"config-edit-hint",style:{marginBottom:8,display:"block"},children:n.description}),p.length===0&&e.jsx("div",{style:{color:"#888",fontSize:13,padding:"4px 0"},children:'暂无条目,点击"添加"新建'}),p.map((g,v)=>e.jsxs("div",{className:"config-edit-array-item",style:{border:"1px solid var(--border, #333)",borderRadius:6,padding:"8px 12px",marginBottom:8,position:"relative"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[e.jsxs("span",{style:{fontSize:12,color:"#888"},children:["#",v+1]}),e.jsx("button",{className:"config-edit-btn",style:{fontSize:11,padding:"1px 6px",color:"#ef4444"},onClick:()=>u(v),children:"删除"})]}),Object.entries(j).map(([h,l])=>{const N=l.description||l.label;return e.jsxs("div",{className:"config-edit-row",children:[e.jsxs("label",{className:"config-edit-label",title:l.description,children:[e.jsx("code",{className:"field-key",children:h}),N&&e.jsxs("span",{className:"field-hint",children:[" / ",N]}),l.required&&e.jsx("span",{style:{color:"#ef4444",marginLeft:2},children:"*"})]}),e.jsx($,{field:l,fieldKey:h,value:g[h],onChange:O=>f(v,h,O),modelCache:o,onFetchModels:t,llmProviders:i,onFetchLLMProviders:x??(()=>{})})]},h)})]},v))]},r)}const y=n,m=d[r]??{};return e.jsxs("div",{className:"config-edit-group",children:[y.label&&e.jsx("div",{className:"config-edit-group-label",children:y.label}),y.description&&e.jsx("span",{className:"config-edit-hint",style:{marginBottom:8,display:"block"},children:y.description}),Object.entries(y.fields).map(([p,b])=>{const j=b.description||b.label;return e.jsxs("div",{className:"config-edit-row",children:[e.jsxs("label",{className:"config-edit-label",title:b.description,children:[e.jsx("code",{className:"field-key",children:p}),j&&e.jsxs("span",{className:"field-hint",children:[" / ",j]}),b.required&&e.jsx("span",{style:{color:"#ef4444",marginLeft:2},children:"*"})]}),e.jsx($,{field:b,fieldKey:p,value:m[p],onChange:c=>a({...d,[r]:{...m,[p]:c}}),modelCache:o,onFetchModels:t,llmProviders:i,onFetchLLMProviders:x??(()=>{})})]},p)})]},r)})})}export{L as S,K as b,k as f,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as e}from"./react-vendor-BPQixOLZ.js";import{p as w,b as xe,B as V,M as _,R,d as z,e as B,W as ge}from"./index-DvV80Yu7.js";import{M as F}from"./markdown-B2G8c9k5.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";function pe(s,x){const[N,l]=u.useState({segments:[],isStreaming:!1,done:!1}),o=u.useRef(null),d=!!(s&&(x==="active"||x==="waiting"));u.useEffect(()=>{if(!d||!s){l({segments:[],isStreaming:!1,done:!1});return}const v=location.protocol==="https:"?"wss:":"ws:",c=new WebSocket(`${v}//${location.host}/ws`);return o.current=c,c.onopen=()=>{c.send(JSON.stringify({type:"subscribe_session",sessionId:s}))},c.onmessage=m=>{try{const n=JSON.parse(m.data);if(n.type==="stream_resume"){let j=[];if(Array.isArray(n.segments)&&n.segments.length>0)j=n.segments;else{const p=n.reasoningContent??"",y=n.content??"";p&&j.push({type:"reasoning_text",content:p}),y&&j.push({type:"text",content:y})}l({segments:j,isStreaming:!n.done,done:!!n.done})}else n.type==="stream"?n.done?l(j=>({...j,isStreaming:!1,done:!0})):l(j=>{const p=[...j.segments],y=(C,$)=>{const S=p[p.length-1];S&&S.type===C?p[p.length-1]={type:C,content:S.content+$}:p.push({type:C,content:$})};return n.reasoningDelta&&y("reasoning_text",n.reasoningDelta),n.contentDelta&&y("text",n.contentDelta),{...j,segments:p,isStreaming:!0}}):n.type==="tool_call"?l(j=>{const p=[...j.segments];if(n.toolPhase==="start")p.push({type:"tool_call",name:n.toolName,args:n.toolArgs??{},startTime:Date.now()});else if(n.toolPhase==="end"&&n.toolResult!==void 0){const y=p.findLastIndex(C=>C.type==="tool_call"&&C.name===n.toolName&&C.result==null);if(y>=0){const C=p[y];p[y]={...C,result:n.toolResult,endTime:Date.now()}}}return{...j,segments:p,isStreaming:!0}}):n.type==="message"&&l(j=>({...j,done:!0,isStreaming:!1}))}catch{}},c.onclose=()=>{o.current=null},()=>{c.close(),o.current=null}},[s,d]);const a=u.useCallback(()=>{l({segments:[],isStreaming:!1,done:!1})},[]);return[N,a]}const Y={active:"进行中",waiting:"等待中",completed:"已完成",error:"错误",archived:"已归档"},q={active:"#4caf50",waiting:"#ff9800",completed:"#2196f3",error:"#f44336",archived:"#888"};function X(s,x){return s?s.length>x?s.slice(0,x)+"…":s:""}function M(s){return new Date(s).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Q(s){const x=[];for(const N of s)x.push(N.session.id),x.push(...Q(N.children));return x}function je({config:s,resolvedConfig:x,inheritedConfig:N,options:l,onSave:o,onCancel:d}){var T,A;const[a,v]=u.useState({...s}),c=x||{},m=N||{},n=(t,g)=>{v(f=>({...f,[t]:g}))},j=t=>{var g,f;return(g=a.enabledToolGroups)!=null&&g.includes(t)?"explicit":(f=m.enabledToolGroups)!=null&&f.includes(t)&&!a.enabledToolGroups?"inherited":"off"},p=t=>{if(j(t)==="inherited"){const f=[...m.enabledToolGroups||[]];n("enabledToolGroups",f.filter(E=>E!==t))}else{const f=a.enabledToolGroups||m.enabledToolGroups||[],E=f.includes(t)?f.filter(I=>I!==t):[...f,t];n("enabledToolGroups",E.length>0?E:void 0)}},y=()=>{v(t=>{const{enabledToolGroups:g,...f}=t;return f})};if(!l)return e.jsx("div",{className:"session-config-editor",children:e.jsx("span",{className:"session-config-loading",children:"加载配置选项…"})});const C=(t,g)=>!a[t]&&g?` (继承: ${g})`:"",$=(T=a.llm)!=null&&T.provider&&((A=a.llm)!=null&&A.model)?`${a.llm.provider}/${a.llm.model}`:"",S=l.models.filter(t=>!!t.provider).map(t=>({key:`${t.provider}/${t.id}`,provider:t.provider,model:t.id,label:`${t.provider} / ${t.id}${t.capabilities.length>0?` [${t.capabilities.join(",")}]`:""}`}));$&&!S.some(t=>t.key===$)&&S.unshift({key:$,provider:a.llm.provider,model:a.llm.model,label:`${a.llm.provider} / ${a.llm.model} (已离线)`});const b=m.llm?`${m.llm.provider} / ${m.llm.model}`:void 0;return e.jsxs("div",{className:"session-config-editor",onClick:t=>t.stopPropagation(),children:[e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["模型",!a.llm&&b?` (继承: ${b})`:""]}),e.jsxs("select",{value:$,onChange:t=>{const g=t.target.value;if(!g){n("llm",void 0);return}const f=S.find(E=>E.key===g);f&&n("llm",{provider:f.provider,model:f.model})},children:[e.jsx("option",{value:"",children:b?`继承 (${b})`:"继承默认"}),S.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["人设",C("persona",m.persona)]}),e.jsxs("select",{value:a.persona||"",onChange:t=>n("persona",t.target.value||void 0),children:[e.jsx("option",{value:"",children:m.persona?`继承 (${m.persona})`:"继承默认"}),l.personas.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),l.toolGroups.length>0&&e.jsxs("div",{className:"session-config-field",children:[e.jsxs("span",{children:["工具分组",a.enabledToolGroups?"":" (继承)"]}),e.jsxs("div",{className:"session-config-chips",children:[l.toolGroups.map(t=>{const g=j(t.name);return e.jsx("button",{className:`session-config-chip ${g==="explicit"?"active":g==="inherited"?"active inherited":""}`,onClick:()=>p(t.name),title:`${t.name}${g==="inherited"?" (继承)":g==="explicit"?" (已覆盖)":""}`,children:t.label||t.name},t.name)}),a.enabledToolGroups&&e.jsx("button",{className:"session-config-chip reset",onClick:y,title:"恢复为继承",children:"↺ 重置"})]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"额外提示"}),e.jsx("textarea",{rows:2,value:a.systemPromptExtra||"",onChange:t=>n("systemPromptExtra",t.target.value||void 0),placeholder:"追加到系统提示之后…"})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"工具迭代上限"}),e.jsx("input",{type:"number",min:0,max:50,value:a.maxToolIterations??"",onChange:t=>n("maxToolIterations",t.target.value?Number(t.target.value):void 0),placeholder:m.maxToolIterations?`继承 (${m.maxToolIterations})`:"默认"})]}),e.jsxs("div",{className:"session-config-toggles",children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.disableOutputFormat??c.disableOutputFormat??!1,onChange:t=>n("disableOutputFormat",t.target.checked||void 0)}),e.jsxs("span",{children:["禁用结构化输出",a.disableOutputFormat===void 0&&m.disableOutputFormat?" (继承)":""]})]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.clientSideJsonRendering??c.clientSideJsonRendering??!1,onChange:t=>n("clientSideJsonRendering",t.target.checked||void 0)}),e.jsxs("span",{children:["客户端 JSON 渲染",a.clientSideJsonRendering===void 0&&m.clientSideJsonRendering?" (继承)":""]})]})]}),e.jsxs("div",{className:"session-config-actions",children:[e.jsx("button",{className:"session-config-btn save",onClick:()=>o(a),children:"保存"}),e.jsx("button",{className:"session-config-btn cancel",onClick:d,children:"取消"})]})]})}function Se({pluginName:s,activeSessionId:x,onSwitchSession:N,onStartNewChat:l,refreshSignal:o}){const[d,a]=u.useState([]),[v,c]=u.useState(null),[m,n]=u.useState(null),[j,p]=u.useState(!1),[y,C]=u.useState(null),[$,S]=u.useState(!1),[b,T]=u.useState(new Set),[A,t]=u.useState(null),[g,f]=u.useState(""),[E,I]=u.useState(null),[G,r]=u.useState(null),[L,K]=u.useState(null),[W,O]=u.useState(null),[U,h]=u.useState(null),P=u.useCallback(()=>{w(s,"getSessionTree").then(i=>{Array.isArray(i)&&a(i)}).catch(()=>C("无法加载会话树"))},[s]);u.useEffect(()=>{P();const i=setInterval(P,3e4);return()=>clearInterval(i)},[P]),u.useEffect(()=>{o&&(P(),G&&Promise.all([w(s,"getResolvedConfig",{sessionId:G,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:G,platform:"webui"})]).then(([i,k])=>{i&&O(i),k&&h(k)}).catch(()=>{}))},[o]);const H=u.useCallback(i=>{c(i),p(!0),w(s,"getSessionDetail",{id:i}).then(k=>n(k)).catch(()=>n(null)).finally(()=>p(!1))},[s]),se=async()=>{try{await w(s,"createSession",{}),P()}catch{}},te=async i=>{try{await w(s,"createSession",{parentId:i}),P()}catch{}},ne=async i=>{if(!g.trim()){t(null);return}try{await w(s,"renameSession",{id:i,title:g.trim()}),P()}catch{}t(null)},le=async i=>{try{await w(s,"archiveSession",{id:i}),P()}catch{}},ie=async i=>{try{const k=i===x;await w(s,"deleteSession",{id:i}),P(),v===i&&(c(null),n(null)),k&&l&&l()}catch{}I(null)},ae=async i=>{if(G===i){r(null),O(null),h(null);return}r(i),O(null),h(null);try{const[k,D,J]=await Promise.all([L?Promise.resolve(L):w(s,"getConfigOptions"),w(s,"getResolvedConfig",{sessionId:i,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:i,platform:"webui"})]);k&&!L&&K(k),D&&O(D),J&&h(J)}catch{}},re=async(i,k)=>{try{await w(s,"updateSessionConfig",{id:i,config:k}),P(),r(null)}catch(D){const J=D instanceof Error?D.message:String(D);alert(`保存会话配置失败:${J}`)}},ce=i=>{T(k=>{const D=new Set(k);return D.has(i)?D.delete(i):D.add(i),D})},oe=()=>{const i=Q(d);T(new Set(i))},de=()=>T(new Set),he=async()=>{if(b.size!==0)try{await w(s,"batchArchive",{ids:[...b]}),T(new Set),P()}catch{}},me=async()=>{if(b.size!==0&&confirm(`确认删除选中的 ${b.size} 个会话?此操作不可恢复。`))try{await w(s,"batchDelete",{ids:[...b]}),T(new Set),v&&b.has(v)&&(c(null),n(null)),P()}catch{}},ue=()=>{S(!1),T(new Set)};return y?e.jsx("div",{className:"tree-page-error",children:y}):e.jsxs("div",{className:"session-tree-page",children:[e.jsxs("div",{className:"tree-visual-panel",children:[e.jsxs("div",{className:"tree-visual-header",children:[e.jsx("h3",{children:"会话"}),e.jsx("div",{className:"tree-header-actions",children:$?e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-batch-btn",onClick:oe,title:"全选",children:"全选"}),e.jsx("button",{className:"tree-batch-btn",onClick:de,title:"取消全选",children:"取消"}),e.jsxs("button",{className:"tree-batch-btn archive",onClick:he,disabled:b.size===0,children:["归档 (",b.size,")"]}),e.jsxs("button",{className:"tree-batch-btn danger",onClick:me,disabled:b.size===0,children:["删除 (",b.size,")"]}),e.jsx("button",{className:"tree-batch-btn",onClick:ue,children:"退出批量"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-action-btn",onClick:se,title:"新建会话",children:"+"}),e.jsx("button",{className:"tree-action-btn",onClick:()=>S(!0),title:"批量管理",children:"☐"}),e.jsx("button",{className:"tree-refresh-btn",onClick:P,children:"⟳"})]})})]}),e.jsx("div",{className:"tree-visual-body",children:d.length===0?e.jsx("div",{className:"tree-empty",children:"暂无会话"}):d.map(i=>e.jsx(Z,{node:i,selectedId:v,activeSessionId:x,onSelect:H,depth:0,batchMode:$,selected:b,onToggleSelect:ce,onCreateChild:te,onRename:(k,D)=>{t(k),f(D)},onArchive:le,onDelete:k=>I(k),onOpenConfig:ae,editingId:A,editTitle:g,onEditTitleChange:f,onCommitRename:ne,onCancelEdit:()=>t(null),configEditingId:G,configOptions:L,resolvedConfig:W,inheritedConfig:U,onSaveConfig:re,onCancelConfig:()=>r(null)},i.session.id))})]}),e.jsx("div",{className:"tree-detail-panel",children:v?j?e.jsx("div",{className:"tree-detail-placeholder",children:"加载中…"}):m?e.jsx(fe,{detail:m,onSwitchSession:N,onRefresh:()=>H(m.session.id)}):e.jsx("div",{className:"tree-detail-placeholder",children:"无法加载会话信息"}):e.jsx("div",{className:"tree-detail-placeholder tree-detail-placeholder-idle",children:"点击会话节点查看详情"})}),E&&e.jsx("div",{className:"delete-confirm-overlay",onClick:()=>I(null),children:e.jsxs("div",{className:"delete-confirm-dialog",onClick:i=>i.stopPropagation(),children:[e.jsx("p",{children:"确定要删除此会话吗?子会话也会被一并删除,此操作无法撤销。"}),e.jsxs("div",{className:"delete-confirm-actions",children:[e.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>ie(E),children:"删除"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>I(null),children:"取消"})]})]})})]})}function Z({node:s,selectedId:x,activeSessionId:N,onSelect:l,depth:o,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}){const[I,G]=u.useState(!0),r=s.session,L=s.children.length>0,K=r.id===x,W=r.id===N,O=y===r.id,U=a.has(r.id);return e.jsxs("div",{className:"tree-node-group",children:[e.jsxs("div",{className:`tree-node ${K?"selected":""} ${W?"active-chat":""} status-${r.status}`,style:{marginLeft:o*24},onClick:()=>d?v(r.id):l(r.id),children:[d&&e.jsx("input",{type:"checkbox",className:"tree-node-checkbox",checked:U,onChange:()=>v(r.id),onClick:h=>h.stopPropagation()}),e.jsx("button",{className:"tree-node-toggle",onClick:h=>{h.stopPropagation(),G(!I)},style:{visibility:L?"visible":"hidden"},children:I?"▾":"▸"}),e.jsx("span",{className:"tree-node-status",style:{background:q[r.status]||"#888"}}),e.jsx("div",{className:"tree-node-info",children:O?e.jsx("input",{className:"tree-node-rename-input",value:C,onChange:h=>$(h.target.value),onBlur:()=>S(r.id),onKeyDown:h=>{h.key==="Enter"&&S(r.id),h.key==="Escape"&&b()},onClick:h=>h.stopPropagation(),autoFocus:!0}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"tree-node-title",children:r.title||r.name}),e.jsxs("span",{className:"tree-node-meta",children:[Y[r.status]||r.status,r.createdBy&&r.createdBy!=="user"&&` · ${r.createdBy}`,` · ${M(r.createdAt)}`]})]})}),L&&e.jsx("span",{className:"tree-node-badge",children:s.children.length}),!d&&e.jsxs("div",{className:"tree-node-actions",onClick:h=>h.stopPropagation(),children:[e.jsx("button",{className:"tree-node-action-btn",title:"新建子会话",onClick:()=>c(r.id),children:"➕"}),e.jsx("button",{className:"tree-node-action-btn",title:"配置",onClick:()=>p(r.id),children:"⚙"}),e.jsx("button",{className:"tree-node-action-btn",title:"重命名",onClick:()=>m(r.id,r.title||r.name),children:"✎"}),r.status==="active"&&e.jsx("button",{className:"tree-node-action-btn",title:"归档",onClick:()=>n(r.id),children:"▪"}),e.jsx("button",{className:"tree-node-action-btn danger",title:"删除",onClick:()=>j(r.id),children:"✕"})]})]}),T===r.id&&e.jsx("div",{style:{marginLeft:o*24+24},children:e.jsx(je,{config:r.config||{},resolvedConfig:t,inheritedConfig:g,options:A,onSave:h=>f(r.id,h),onCancel:E})}),L&&I&&e.jsx("div",{className:"tree-node-children",children:s.children.map(h=>e.jsxs("div",{className:"tree-child-wrapper",children:[h.session.inputContext&&e.jsxs("div",{className:"tree-flow-label",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↓"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.inputContext,80)})]}),e.jsx(Z,{node:h,selectedId:x,activeSessionId:N,onSelect:l,depth:o+1,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}),h.session.result&&e.jsxs("div",{className:"tree-flow-label result",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↑"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.result,80)})]})]},h.session.id))})]})}function fe({detail:s,onSwitchSession:x,onRefresh:N}){const l=s.session,o=xe(s.messages),[d,a]=pe(l.id,l.status);return u.useEffect(()=>{d.done&&(a(),N==null||N())},[d.done,a,N]),e.jsxs("div",{className:"session-detail",children:[e.jsxs("div",{className:"session-detail-header",children:[e.jsx("h3",{children:l.title||l.name}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[x&&e.jsx("button",{className:"btn btn-sm btn-primary",onClick:()=>x(l.id),children:"进入对话"}),e.jsx("span",{className:"session-detail-status",style:{color:q[l.status]},children:Y[l.status]})]})]}),e.jsxs("div",{className:"session-detail-meta",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"ID:"})," ",l.id]}),e.jsxs("div",{children:[e.jsx("strong",{children:"创建时间:"})," ",new Date(l.createdAt).toLocaleString("zh-CN")]}),l.parentId&&e.jsxs("div",{children:[e.jsx("strong",{children:"父会话:"})," ",l.parentId]}),l.createdBy&&e.jsxs("div",{children:[e.jsx("strong",{children:"创建者:"})," ",l.createdBy]}),l.children.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"子会话数:"})," ",l.children.length]})]}),l.inputContext&&e.jsxs("div",{className:"session-detail-context",children:[e.jsx("div",{className:"context-label",children:"来自父会话的指令"}),e.jsx("div",{className:"context-content",children:l.inputContext})]}),l.result&&e.jsxs("div",{className:"session-detail-result",children:[e.jsx("div",{className:"context-label",children:"给父会话的结果"}),e.jsx("div",{className:"context-content",children:l.result})]}),e.jsxs("div",{className:"session-detail-messages",children:[e.jsxs("h4",{children:["消息记录 (",s.messages.length,")"]}),o.length===0&&!d.isStreaming?e.jsx("div",{className:"no-messages",children:"暂无消息记录"}):e.jsxs("div",{className:"message-list",children:[o.map((v,c)=>e.jsx(ve,{msg:v},c)),d.isStreaming&&d.segments.length>0&&e.jsxs("div",{className:"detail-message assistant streaming",children:[e.jsxs("div",{className:"detail-msg-role",children:["助手 ",e.jsx("span",{className:"streaming-indicator",children:"●"})]}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:(()=>{const v=[];let c=0;for(;c<d.segments.length;){const m=d.segments[c];if(m.type==="reasoning_text"){let n="";for(;c<d.segments.length&&d.segments[c].type==="reasoning_text";)n+=d.segments[c].content,c++;n&&v.push(e.jsxs("details",{className:"thinking-block",open:!0,children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(n)})})]},`r-${c}`));continue}v.push(e.jsx(ee,{seg:m},c)),c++}return v})()})]})]})]})]})}function ee({seg:s}){return s.type==="text"||s.type==="reasoning_text"?s.content?e.jsx("div",{className:"detail-text-segment",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}):null:e.jsxs("details",{className:"tool-call-block",children:[e.jsxs("summary",{className:"tool-call-summary",children:[e.jsx(ge,{size:14})," ",s.name,s.result==null?" …":""]}),e.jsxs("div",{className:"tool-call-content",children:[e.jsxs("div",{className:"tool-call-args",children:[e.jsx("strong",{children:"参数"}),e.jsx("pre",{children:JSON.stringify(s.args,null,2)})]}),s.result!=null&&e.jsxs("div",{className:"tool-call-result",children:[e.jsx("strong",{children:"结果"}),e.jsx("pre",{children:s.result})]})]})]})}function ve({msg:s}){const x=s.role==="user"?"用户":"助手";if(s.role==="user")return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content",children:s.content}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]});if(s.role==="assistant"&&s.segments&&s.segments.length>0){const l=[];let o=0;for(;o<s.segments.length;){const d=s.segments[o];if(d.type==="reasoning_text"){let a="";for(;o<s.segments.length&&s.segments[o].type==="reasoning_text";)a+=s.segments[o].content,o++;a&&l.push(e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(a)})})]},`r-${o}`));continue}l.push(e.jsx(ee,{seg:d},o)),o++}return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:l}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}const N=s.role==="assistant"&&s.reasoningContent?e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.reasoningContent)})})]}):null;return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),N,e.jsx("div",{className:"detail-msg-content detail-msg-md",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}export{Se as SessionsPage};
|
|
1
|
+
import{r as u,j as e}from"./react-vendor-BPQixOLZ.js";import{p as w,b as xe,B as V,M as _,R,d as z,e as B,W as ge}from"./index-C6kOarnb.js";import{M as F}from"./markdown-B2G8c9k5.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";function pe(s,x){const[N,l]=u.useState({segments:[],isStreaming:!1,done:!1}),o=u.useRef(null),d=!!(s&&(x==="active"||x==="waiting"));u.useEffect(()=>{if(!d||!s){l({segments:[],isStreaming:!1,done:!1});return}const v=location.protocol==="https:"?"wss:":"ws:",c=new WebSocket(`${v}//${location.host}/ws`);return o.current=c,c.onopen=()=>{c.send(JSON.stringify({type:"subscribe_session",sessionId:s}))},c.onmessage=m=>{try{const n=JSON.parse(m.data);if(n.type==="stream_resume"){let j=[];if(Array.isArray(n.segments)&&n.segments.length>0)j=n.segments;else{const p=n.reasoningContent??"",y=n.content??"";p&&j.push({type:"reasoning_text",content:p}),y&&j.push({type:"text",content:y})}l({segments:j,isStreaming:!n.done,done:!!n.done})}else n.type==="stream"?n.done?l(j=>({...j,isStreaming:!1,done:!0})):l(j=>{const p=[...j.segments],y=(C,$)=>{const S=p[p.length-1];S&&S.type===C?p[p.length-1]={type:C,content:S.content+$}:p.push({type:C,content:$})};return n.reasoningDelta&&y("reasoning_text",n.reasoningDelta),n.contentDelta&&y("text",n.contentDelta),{...j,segments:p,isStreaming:!0}}):n.type==="tool_call"?l(j=>{const p=[...j.segments];if(n.toolPhase==="start")p.push({type:"tool_call",name:n.toolName,args:n.toolArgs??{},startTime:Date.now()});else if(n.toolPhase==="end"&&n.toolResult!==void 0){const y=p.findLastIndex(C=>C.type==="tool_call"&&C.name===n.toolName&&C.result==null);if(y>=0){const C=p[y];p[y]={...C,result:n.toolResult,endTime:Date.now()}}}return{...j,segments:p,isStreaming:!0}}):n.type==="message"&&l(j=>({...j,done:!0,isStreaming:!1}))}catch{}},c.onclose=()=>{o.current=null},()=>{c.close(),o.current=null}},[s,d]);const a=u.useCallback(()=>{l({segments:[],isStreaming:!1,done:!1})},[]);return[N,a]}const Y={active:"进行中",waiting:"等待中",completed:"已完成",error:"错误",archived:"已归档"},q={active:"#4caf50",waiting:"#ff9800",completed:"#2196f3",error:"#f44336",archived:"#888"};function X(s,x){return s?s.length>x?s.slice(0,x)+"…":s:""}function M(s){return new Date(s).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Q(s){const x=[];for(const N of s)x.push(N.session.id),x.push(...Q(N.children));return x}function je({config:s,resolvedConfig:x,inheritedConfig:N,options:l,onSave:o,onCancel:d}){var T,A;const[a,v]=u.useState({...s}),c=x||{},m=N||{},n=(t,g)=>{v(f=>({...f,[t]:g}))},j=t=>{var g,f;return(g=a.enabledToolGroups)!=null&&g.includes(t)?"explicit":(f=m.enabledToolGroups)!=null&&f.includes(t)&&!a.enabledToolGroups?"inherited":"off"},p=t=>{if(j(t)==="inherited"){const f=[...m.enabledToolGroups||[]];n("enabledToolGroups",f.filter(E=>E!==t))}else{const f=a.enabledToolGroups||m.enabledToolGroups||[],E=f.includes(t)?f.filter(I=>I!==t):[...f,t];n("enabledToolGroups",E.length>0?E:void 0)}},y=()=>{v(t=>{const{enabledToolGroups:g,...f}=t;return f})};if(!l)return e.jsx("div",{className:"session-config-editor",children:e.jsx("span",{className:"session-config-loading",children:"加载配置选项…"})});const C=(t,g)=>!a[t]&&g?` (继承: ${g})`:"",$=(T=a.llm)!=null&&T.provider&&((A=a.llm)!=null&&A.model)?`${a.llm.provider}/${a.llm.model}`:"",S=l.models.filter(t=>!!t.provider).map(t=>({key:`${t.provider}/${t.id}`,provider:t.provider,model:t.id,label:`${t.provider} / ${t.id}${t.capabilities.length>0?` [${t.capabilities.join(",")}]`:""}`}));$&&!S.some(t=>t.key===$)&&S.unshift({key:$,provider:a.llm.provider,model:a.llm.model,label:`${a.llm.provider} / ${a.llm.model} (已离线)`});const b=m.llm?`${m.llm.provider} / ${m.llm.model}`:void 0;return e.jsxs("div",{className:"session-config-editor",onClick:t=>t.stopPropagation(),children:[e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["模型",!a.llm&&b?` (继承: ${b})`:""]}),e.jsxs("select",{value:$,onChange:t=>{const g=t.target.value;if(!g){n("llm",void 0);return}const f=S.find(E=>E.key===g);f&&n("llm",{provider:f.provider,model:f.model})},children:[e.jsx("option",{value:"",children:b?`继承 (${b})`:"继承默认"}),S.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["人设",C("persona",m.persona)]}),e.jsxs("select",{value:a.persona||"",onChange:t=>n("persona",t.target.value||void 0),children:[e.jsx("option",{value:"",children:m.persona?`继承 (${m.persona})`:"继承默认"}),l.personas.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),l.toolGroups.length>0&&e.jsxs("div",{className:"session-config-field",children:[e.jsxs("span",{children:["工具分组",a.enabledToolGroups?"":" (继承)"]}),e.jsxs("div",{className:"session-config-chips",children:[l.toolGroups.map(t=>{const g=j(t.name);return e.jsx("button",{className:`session-config-chip ${g==="explicit"?"active":g==="inherited"?"active inherited":""}`,onClick:()=>p(t.name),title:`${t.name}${g==="inherited"?" (继承)":g==="explicit"?" (已覆盖)":""}`,children:t.label||t.name},t.name)}),a.enabledToolGroups&&e.jsx("button",{className:"session-config-chip reset",onClick:y,title:"恢复为继承",children:"↺ 重置"})]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"额外提示"}),e.jsx("textarea",{rows:2,value:a.systemPromptExtra||"",onChange:t=>n("systemPromptExtra",t.target.value||void 0),placeholder:"追加到系统提示之后…"})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"工具迭代上限"}),e.jsx("input",{type:"number",min:0,max:50,value:a.maxToolIterations??"",onChange:t=>n("maxToolIterations",t.target.value?Number(t.target.value):void 0),placeholder:m.maxToolIterations?`继承 (${m.maxToolIterations})`:"默认"})]}),e.jsxs("div",{className:"session-config-toggles",children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.disableOutputFormat??c.disableOutputFormat??!1,onChange:t=>n("disableOutputFormat",t.target.checked||void 0)}),e.jsxs("span",{children:["禁用结构化输出",a.disableOutputFormat===void 0&&m.disableOutputFormat?" (继承)":""]})]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.clientSideJsonRendering??c.clientSideJsonRendering??!1,onChange:t=>n("clientSideJsonRendering",t.target.checked||void 0)}),e.jsxs("span",{children:["客户端 JSON 渲染",a.clientSideJsonRendering===void 0&&m.clientSideJsonRendering?" (继承)":""]})]})]}),e.jsxs("div",{className:"session-config-actions",children:[e.jsx("button",{className:"session-config-btn save",onClick:()=>o(a),children:"保存"}),e.jsx("button",{className:"session-config-btn cancel",onClick:d,children:"取消"})]})]})}function Se({pluginName:s,activeSessionId:x,onSwitchSession:N,onStartNewChat:l,refreshSignal:o}){const[d,a]=u.useState([]),[v,c]=u.useState(null),[m,n]=u.useState(null),[j,p]=u.useState(!1),[y,C]=u.useState(null),[$,S]=u.useState(!1),[b,T]=u.useState(new Set),[A,t]=u.useState(null),[g,f]=u.useState(""),[E,I]=u.useState(null),[G,r]=u.useState(null),[L,K]=u.useState(null),[W,O]=u.useState(null),[U,h]=u.useState(null),P=u.useCallback(()=>{w(s,"getSessionTree").then(i=>{Array.isArray(i)&&a(i)}).catch(()=>C("无法加载会话树"))},[s]);u.useEffect(()=>{P();const i=setInterval(P,3e4);return()=>clearInterval(i)},[P]),u.useEffect(()=>{o&&(P(),G&&Promise.all([w(s,"getResolvedConfig",{sessionId:G,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:G,platform:"webui"})]).then(([i,k])=>{i&&O(i),k&&h(k)}).catch(()=>{}))},[o]);const H=u.useCallback(i=>{c(i),p(!0),w(s,"getSessionDetail",{id:i}).then(k=>n(k)).catch(()=>n(null)).finally(()=>p(!1))},[s]),se=async()=>{try{await w(s,"createSession",{}),P()}catch{}},te=async i=>{try{await w(s,"createSession",{parentId:i}),P()}catch{}},ne=async i=>{if(!g.trim()){t(null);return}try{await w(s,"renameSession",{id:i,title:g.trim()}),P()}catch{}t(null)},le=async i=>{try{await w(s,"archiveSession",{id:i}),P()}catch{}},ie=async i=>{try{const k=i===x;await w(s,"deleteSession",{id:i}),P(),v===i&&(c(null),n(null)),k&&l&&l()}catch{}I(null)},ae=async i=>{if(G===i){r(null),O(null),h(null);return}r(i),O(null),h(null);try{const[k,D,J]=await Promise.all([L?Promise.resolve(L):w(s,"getConfigOptions"),w(s,"getResolvedConfig",{sessionId:i,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:i,platform:"webui"})]);k&&!L&&K(k),D&&O(D),J&&h(J)}catch{}},re=async(i,k)=>{try{await w(s,"updateSessionConfig",{id:i,config:k}),P(),r(null)}catch(D){const J=D instanceof Error?D.message:String(D);alert(`保存会话配置失败:${J}`)}},ce=i=>{T(k=>{const D=new Set(k);return D.has(i)?D.delete(i):D.add(i),D})},oe=()=>{const i=Q(d);T(new Set(i))},de=()=>T(new Set),he=async()=>{if(b.size!==0)try{await w(s,"batchArchive",{ids:[...b]}),T(new Set),P()}catch{}},me=async()=>{if(b.size!==0&&confirm(`确认删除选中的 ${b.size} 个会话?此操作不可恢复。`))try{await w(s,"batchDelete",{ids:[...b]}),T(new Set),v&&b.has(v)&&(c(null),n(null)),P()}catch{}},ue=()=>{S(!1),T(new Set)};return y?e.jsx("div",{className:"tree-page-error",children:y}):e.jsxs("div",{className:"session-tree-page",children:[e.jsxs("div",{className:"tree-visual-panel",children:[e.jsxs("div",{className:"tree-visual-header",children:[e.jsx("h3",{children:"会话"}),e.jsx("div",{className:"tree-header-actions",children:$?e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-batch-btn",onClick:oe,title:"全选",children:"全选"}),e.jsx("button",{className:"tree-batch-btn",onClick:de,title:"取消全选",children:"取消"}),e.jsxs("button",{className:"tree-batch-btn archive",onClick:he,disabled:b.size===0,children:["归档 (",b.size,")"]}),e.jsxs("button",{className:"tree-batch-btn danger",onClick:me,disabled:b.size===0,children:["删除 (",b.size,")"]}),e.jsx("button",{className:"tree-batch-btn",onClick:ue,children:"退出批量"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-action-btn",onClick:se,title:"新建会话",children:"+"}),e.jsx("button",{className:"tree-action-btn",onClick:()=>S(!0),title:"批量管理",children:"☐"}),e.jsx("button",{className:"tree-refresh-btn",onClick:P,children:"⟳"})]})})]}),e.jsx("div",{className:"tree-visual-body",children:d.length===0?e.jsx("div",{className:"tree-empty",children:"暂无会话"}):d.map(i=>e.jsx(Z,{node:i,selectedId:v,activeSessionId:x,onSelect:H,depth:0,batchMode:$,selected:b,onToggleSelect:ce,onCreateChild:te,onRename:(k,D)=>{t(k),f(D)},onArchive:le,onDelete:k=>I(k),onOpenConfig:ae,editingId:A,editTitle:g,onEditTitleChange:f,onCommitRename:ne,onCancelEdit:()=>t(null),configEditingId:G,configOptions:L,resolvedConfig:W,inheritedConfig:U,onSaveConfig:re,onCancelConfig:()=>r(null)},i.session.id))})]}),e.jsx("div",{className:"tree-detail-panel",children:v?j?e.jsx("div",{className:"tree-detail-placeholder",children:"加载中…"}):m?e.jsx(fe,{detail:m,onSwitchSession:N,onRefresh:()=>H(m.session.id)}):e.jsx("div",{className:"tree-detail-placeholder",children:"无法加载会话信息"}):e.jsx("div",{className:"tree-detail-placeholder tree-detail-placeholder-idle",children:"点击会话节点查看详情"})}),E&&e.jsx("div",{className:"delete-confirm-overlay",onClick:()=>I(null),children:e.jsxs("div",{className:"delete-confirm-dialog",onClick:i=>i.stopPropagation(),children:[e.jsx("p",{children:"确定要删除此会话吗?子会话也会被一并删除,此操作无法撤销。"}),e.jsxs("div",{className:"delete-confirm-actions",children:[e.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>ie(E),children:"删除"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>I(null),children:"取消"})]})]})})]})}function Z({node:s,selectedId:x,activeSessionId:N,onSelect:l,depth:o,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}){const[I,G]=u.useState(!0),r=s.session,L=s.children.length>0,K=r.id===x,W=r.id===N,O=y===r.id,U=a.has(r.id);return e.jsxs("div",{className:"tree-node-group",children:[e.jsxs("div",{className:`tree-node ${K?"selected":""} ${W?"active-chat":""} status-${r.status}`,style:{marginLeft:o*24},onClick:()=>d?v(r.id):l(r.id),children:[d&&e.jsx("input",{type:"checkbox",className:"tree-node-checkbox",checked:U,onChange:()=>v(r.id),onClick:h=>h.stopPropagation()}),e.jsx("button",{className:"tree-node-toggle",onClick:h=>{h.stopPropagation(),G(!I)},style:{visibility:L?"visible":"hidden"},children:I?"▾":"▸"}),e.jsx("span",{className:"tree-node-status",style:{background:q[r.status]||"#888"}}),e.jsx("div",{className:"tree-node-info",children:O?e.jsx("input",{className:"tree-node-rename-input",value:C,onChange:h=>$(h.target.value),onBlur:()=>S(r.id),onKeyDown:h=>{h.key==="Enter"&&S(r.id),h.key==="Escape"&&b()},onClick:h=>h.stopPropagation(),autoFocus:!0}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"tree-node-title",children:r.title||r.name}),e.jsxs("span",{className:"tree-node-meta",children:[Y[r.status]||r.status,r.createdBy&&r.createdBy!=="user"&&` · ${r.createdBy}`,` · ${M(r.createdAt)}`]})]})}),L&&e.jsx("span",{className:"tree-node-badge",children:s.children.length}),!d&&e.jsxs("div",{className:"tree-node-actions",onClick:h=>h.stopPropagation(),children:[e.jsx("button",{className:"tree-node-action-btn",title:"新建子会话",onClick:()=>c(r.id),children:"➕"}),e.jsx("button",{className:"tree-node-action-btn",title:"配置",onClick:()=>p(r.id),children:"⚙"}),e.jsx("button",{className:"tree-node-action-btn",title:"重命名",onClick:()=>m(r.id,r.title||r.name),children:"✎"}),r.status==="active"&&e.jsx("button",{className:"tree-node-action-btn",title:"归档",onClick:()=>n(r.id),children:"▪"}),e.jsx("button",{className:"tree-node-action-btn danger",title:"删除",onClick:()=>j(r.id),children:"✕"})]})]}),T===r.id&&e.jsx("div",{style:{marginLeft:o*24+24},children:e.jsx(je,{config:r.config||{},resolvedConfig:t,inheritedConfig:g,options:A,onSave:h=>f(r.id,h),onCancel:E})}),L&&I&&e.jsx("div",{className:"tree-node-children",children:s.children.map(h=>e.jsxs("div",{className:"tree-child-wrapper",children:[h.session.inputContext&&e.jsxs("div",{className:"tree-flow-label",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↓"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.inputContext,80)})]}),e.jsx(Z,{node:h,selectedId:x,activeSessionId:N,onSelect:l,depth:o+1,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}),h.session.result&&e.jsxs("div",{className:"tree-flow-label result",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↑"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.result,80)})]})]},h.session.id))})]})}function fe({detail:s,onSwitchSession:x,onRefresh:N}){const l=s.session,o=xe(s.messages),[d,a]=pe(l.id,l.status);return u.useEffect(()=>{d.done&&(a(),N==null||N())},[d.done,a,N]),e.jsxs("div",{className:"session-detail",children:[e.jsxs("div",{className:"session-detail-header",children:[e.jsx("h3",{children:l.title||l.name}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[x&&e.jsx("button",{className:"btn btn-sm btn-primary",onClick:()=>x(l.id),children:"进入对话"}),e.jsx("span",{className:"session-detail-status",style:{color:q[l.status]},children:Y[l.status]})]})]}),e.jsxs("div",{className:"session-detail-meta",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"ID:"})," ",l.id]}),e.jsxs("div",{children:[e.jsx("strong",{children:"创建时间:"})," ",new Date(l.createdAt).toLocaleString("zh-CN")]}),l.parentId&&e.jsxs("div",{children:[e.jsx("strong",{children:"父会话:"})," ",l.parentId]}),l.createdBy&&e.jsxs("div",{children:[e.jsx("strong",{children:"创建者:"})," ",l.createdBy]}),l.children.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"子会话数:"})," ",l.children.length]})]}),l.inputContext&&e.jsxs("div",{className:"session-detail-context",children:[e.jsx("div",{className:"context-label",children:"来自父会话的指令"}),e.jsx("div",{className:"context-content",children:l.inputContext})]}),l.result&&e.jsxs("div",{className:"session-detail-result",children:[e.jsx("div",{className:"context-label",children:"给父会话的结果"}),e.jsx("div",{className:"context-content",children:l.result})]}),e.jsxs("div",{className:"session-detail-messages",children:[e.jsxs("h4",{children:["消息记录 (",s.messages.length,")"]}),o.length===0&&!d.isStreaming?e.jsx("div",{className:"no-messages",children:"暂无消息记录"}):e.jsxs("div",{className:"message-list",children:[o.map((v,c)=>e.jsx(ve,{msg:v},c)),d.isStreaming&&d.segments.length>0&&e.jsxs("div",{className:"detail-message assistant streaming",children:[e.jsxs("div",{className:"detail-msg-role",children:["助手 ",e.jsx("span",{className:"streaming-indicator",children:"●"})]}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:(()=>{const v=[];let c=0;for(;c<d.segments.length;){const m=d.segments[c];if(m.type==="reasoning_text"){let n="";for(;c<d.segments.length&&d.segments[c].type==="reasoning_text";)n+=d.segments[c].content,c++;n&&v.push(e.jsxs("details",{className:"thinking-block",open:!0,children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(n)})})]},`r-${c}`));continue}v.push(e.jsx(ee,{seg:m},c)),c++}return v})()})]})]})]})]})}function ee({seg:s}){return s.type==="text"||s.type==="reasoning_text"?s.content?e.jsx("div",{className:"detail-text-segment",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}):null:e.jsxs("details",{className:"tool-call-block",children:[e.jsxs("summary",{className:"tool-call-summary",children:[e.jsx(ge,{size:14})," ",s.name,s.result==null?" …":""]}),e.jsxs("div",{className:"tool-call-content",children:[e.jsxs("div",{className:"tool-call-args",children:[e.jsx("strong",{children:"参数"}),e.jsx("pre",{children:JSON.stringify(s.args,null,2)})]}),s.result!=null&&e.jsxs("div",{className:"tool-call-result",children:[e.jsx("strong",{children:"结果"}),e.jsx("pre",{children:s.result})]})]})]})}function ve({msg:s}){const x=s.role==="user"?"用户":"助手";if(s.role==="user")return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content",children:s.content}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]});if(s.role==="assistant"&&s.segments&&s.segments.length>0){const l=[];let o=0;for(;o<s.segments.length;){const d=s.segments[o];if(d.type==="reasoning_text"){let a="";for(;o<s.segments.length&&s.segments[o].type==="reasoning_text";)a+=s.segments[o].content,o++;a&&l.push(e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(a)})})]},`r-${o}`));continue}l.push(e.jsx(ee,{seg:d},o)),o++}return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:l}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}const N=s.role==="assistant"&&s.reasoningContent?e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.reasoningContent)})})]}):null;return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),N,e.jsx("div",{className:"detail-msg-content detail-msg-md",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}export{Se as SessionsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core-
|
|
1
|
+
import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core-DX1iGORO.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as f,I as ht,Y as gt,l as K,b as ut,a as pt,p as mt,q as yt,g as wt,s as kt,z as xt,F as bt,D as vt,G as $t,c as J,ak as Z,al as N,i as Et,d as St,x as Dt,am as Tt,an as At}from"./mermaid.core-
|
|
1
|
+
import{_ as f,I as ht,Y as gt,l as K,b as ut,a as pt,p as mt,q as yt,g as wt,s as kt,z as xt,F as bt,D as vt,G as $t,c as J,ak as Z,al as N,i as Et,d as St,x as Dt,am as Tt,an as At}from"./mermaid.core-DX1iGORO.js";import{p as Ct}from"./chunk-4BX2VUAB-Bv5A4tpJ.js";import{p as Bt}from"./wardley-L42UT6IY-CzWIZXfj.js";import{c as tt}from"./cytoscape.esm-LDYqcvCF.js";import{f as It}from"./cytoscape-fcose-DXAQNCkb.js";import"./index-C6kOarnb.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var W={L:"left",R:"right",T:"top",B:"bottom"},Q={L:f(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:f(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:f(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:f(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")},X={L:f((e,t)=>e-t+2,"L"),R:f((e,t)=>e-2,"R"),T:f((e,t)=>e-t+2,"T"),B:f((e,t)=>e-2,"B")},Lt=f(function(e){return T(e)?e==="L"?"R":"L":e==="T"?"B":"T"},"getOppositeArchitectureDirection"),U=f(function(e){const t=e;return t==="L"||t==="R"||t==="T"||t==="B"},"isArchitectureDirection"),T=f(function(e){const t=e;return t==="L"||t==="R"},"isArchitectureDirectionX"),z=f(function(e){const t=e;return t==="T"||t==="B"},"isArchitectureDirectionY"),V=f(function(e,t){const i=T(e)&&z(t),r=z(e)&&T(t);return i||r},"isArchitectureDirectionXY"),jt=f(function(e){const t=e[0],i=e[1],r=T(t)&&z(i),n=z(t)&&T(i);return r||n},"isArchitecturePairXY"),zt=f(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),_=f(function(e,t){const i=`${e}${t}`;return zt(i)?i:void 0},"getArchitectureDirectionPair"),Ft=f(function([e,t],i){const r=i[0],n=i[1];return T(r)?z(n)?[e+(r==="L"?-1:1),t+(n==="T"?1:-1)]:[e+(r==="L"?-1:1),t]:T(n)?[e+(n==="L"?1:-1),t+(r==="T"?1:-1)]:[e,t+(r==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Pt=f(function(e){return e==="LT"||e==="TL"?[1,1]:e==="BL"||e==="LB"?[1,-1]:e==="BR"||e==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Yt=f(function(e,t){return V(e,t)?"bend":T(e)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Rt=f(function(e){return e.type==="service"},"isArchitectureService"),Xt=f(function(e){return e.type==="junction"},"isArchitectureJunction"),et=f(e=>e.data(),"edgeData"),P=f(e=>e.data(),"nodeData"),Ot=$t.architecture,Y,it=(Y=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=ut,this.getAccTitle=pt,this.setDiagramTitle=mt,this.getDiagramTitle=yt,this.getAccDescription=wt,this.setAccDescription=kt,this.clear()}setDiagramId(t){this.diagramId=t}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",xt()}addService({id:t,icon:i,in:r,title:n,iconText:c}){if(this.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:i,iconText:c,title:n,edges:[],in:r}}getServices(){return Object.values(this.nodes).filter(Rt)}addJunction({id:t,in:i}){if(this.registeredIds[t]!==void 0)throw new Error(`The junction id [${t}] is already in use by another ${this.registeredIds[t]}`);if(i!==void 0){if(t===i)throw new Error(`The junction [${t}] cannot be placed within itself`);if(this.registeredIds[i]===void 0)throw new Error(`The junction [${t}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[i]==="node")throw new Error(`The junction [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:i}}getJunctions(){return Object.values(this.nodes).filter(Xt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:i,in:r,title:n}){var c,u,d;if(((c=this.registeredIds)==null?void 0:c[t])!==void 0)throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(((u=this.registeredIds)==null?void 0:u[r])===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(((d=this.registeredIds)==null?void 0:d[r])==="node")throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:i,title:n,in:r}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:i,lhsDir:r,rhsDir:n,lhsInto:c,rhsInto:u,lhsGroup:d,rhsGroup:l,title:s}){if(!U(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`);if(!U(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(n)}`);if(this.nodes[t]===void 0&&this.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[i]===void 0&&this.groups[i]===void 0)throw new Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);const o=this.nodes[t].in,a=this.nodes[i].in;if(d&&o&&a&&o==a)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&o&&a&&o==a)throw new Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:t,lhsDir:r,lhsInto:c,lhsGroup:d,rhsId:i,rhsDir:n,rhsInto:u,rhsGroup:l,title:s};this.edges.push(g),this.nodes[t]&&this.nodes[i]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[i].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const t={},i=Object.entries(this.nodes).reduce((l,[s,o])=>(l[s]=o.edges.reduce((a,g)=>{var p,k;const h=(p=this.getNode(g.lhsId))==null?void 0:p.in,y=(k=this.getNode(g.rhsId))==null?void 0:k.in;if(h&&y&&h!==y){const w=Yt(g.lhsDir,g.rhsDir);w!=="bend"&&(t[h]??(t[h]={}),t[h][y]=w,t[y]??(t[y]={}),t[y][h]=w)}if(g.lhsId===s){const w=_(g.lhsDir,g.rhsDir);w&&(a[w]=g.rhsId)}else{const w=_(g.rhsDir,g.lhsDir);w&&(a[w]=g.lhsId)}return a},{}),l),{}),r=Object.keys(i)[0],n={[r]:1},c=Object.keys(i).reduce((l,s)=>s===r?l:{...l,[s]:1},{}),u=f(l=>{const s={[l]:[0,0]},o=[l];for(;o.length>0;){const a=o.shift();if(a){n[a]=1,delete c[a];const g=i[a],[h,y]=s[a];Object.entries(g).forEach(([p,k])=>{n[k]||(s[k]=Ft([h,y],p),o.push(k))})}}return s},"BFS"),d=[u(r)];for(;Object.keys(c).length>0;)d.push(u(Object.keys(c)[0]));this.dataStructures={adjList:i,spatialMaps:d,groupAlignments:t}}return this.dataStructures}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}getConfig(){return bt({...Ot,...vt().architecture})}getConfigField(t){return this.getConfig()[t]}},f(Y,"ArchitectureDB"),Y),Mt=f((e,t)=>{Ct(e,t),e.groups.map(i=>t.addGroup(i)),e.services.map(i=>t.addService({...i,type:"service"})),e.junctions.map(i=>t.addJunction({...i,type:"junction"})),e.edges.map(i=>t.addEdge(i))},"populateDb"),rt={parser:{yy:void 0},parse:f(async e=>{var r;const t=await Bt("architecture",e);K.debug(t);const i=(r=rt.parser)==null?void 0:r.yy;if(!(i instanceof it))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mt(t,i)},"parse")},Gt=f(e=>`
|
|
2
2
|
.edge {
|
|
3
3
|
stroke-width: ${e.archEdgeWidth};
|
|
4
4
|
stroke: ${e.archEdgeColor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Te}from"./chunk-FMBD7UC4-Bq1b7ZFm.js";import{ar as De,as as Gt,at as Ne,au as Zt,av as jt,aw as qt,ax as Jt,ay as wt,az as Qt,aA as $t,aB as te,aC as ee,aD as re,aE as ae,aF as Ie,aG as Ce,aH as Be,aI as Oe,aJ as Re,aK as Ae,aL as ze,aM as Me,aN as Pe,aO as Fe,aP as We,_ as d,D as ct,d as O,e as Ye,l as v,z as He,B as Ke,aQ as Ue,R as Xe,S as Ve,c as M,O as Ge,aR as H,ak as _t,aS as at,aT as Ze,u as st,k as je,aU as qe,i as Rt,aV as At,aW as Je}from"./mermaid.core-DfVdcmTH.js";import{G as Qe}from"./graph-CAnANduQ.js";import{c as $e}from"./channel-BwqmVsV7.js";import"./index-DvV80Yu7.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";function tr(e){return Array.isArray(e)}function er(e){if(De(e))return e;const t=Gt(e);if(!rr(e))return{};if(tr(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ne(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t===Zt)return new ArrayBuffer(e.byteLength);if(t===jt){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t===qt||t===Jt||t===wt){const s=e.constructor,i=new s(e.valueOf());return t===wt?sr(i,e):xt(i,e),i}if(t===Qt)return new Date(Number(e));if(t===$t){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t===te)return Object(Symbol.prototype.valueOf.call(e));if(t===ee){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t===re){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t===ae){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ir(a,e),xt(a,e),ar(a,e),a}function rr(e){switch(Gt(e)){case ae:case We:case Zt:case jt:case qt:case Qt:case Fe:case Pe:case Me:case ze:case Ae:case ee:case Jt:case Re:case $t:case re:case wt:case te:case Oe:case Be:case Ce:case Ie:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function ar(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s<a.length;s++){const i=a[s];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function sr(e,t){const a=t.valueOf().length;for(const s in t)Object.hasOwn(t,s)&&(Number.isNaN(Number(s))||Number(s)>=a)&&(e[s]=t[s])}function ir(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var mt=(function(){var e=d(function(N,x,p,f){for(p=p||{},f=N.length;f--;p[N[f]]=x);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],g=[8,10,21,28,29,30,31,39,43,46],y=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],m=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(x,p,f,S,E,o,k){var h=o.length-1;switch(E){case 4:S.getLogger().debug("Rule: separator (NL) ");break;case 5:S.getLogger().debug("Rule: separator (Space) ");break;case 6:S.getLogger().debug("Rule: separator (EOF) ");break;case 7:S.getLogger().debug("Rule: hierarchy: ",o[h-1]),S.setHierarchy(o[h-1]);break;case 8:S.getLogger().debug("Stop NL ");break;case 9:S.getLogger().debug("Stop EOF ");break;case 10:S.getLogger().debug("Stop NL2 ");break;case 11:S.getLogger().debug("Stop EOF2 ");break;case 12:S.getLogger().debug("Rule: statement: ",o[h]),typeof o[h].length=="number"?this.$=o[h]:this.$=[o[h]];break;case 13:S.getLogger().debug("Rule: statement #2: ",o[h-1]),this.$=[o[h-1]].concat(o[h]);break;case 14:S.getLogger().debug("Rule: link: ",o[h],x),this.$={edgeTypeStr:o[h],label:""};break;case 15:S.getLogger().debug("Rule: LABEL link: ",o[h-3],o[h-1],o[h]),this.$={edgeTypeStr:o[h],label:o[h-1]};break;case 18:const T=parseInt(o[h]),D=S.generateId();this.$={id:D,type:"space",label:"",width:T,children:[]};break;case 23:S.getLogger().debug("Rule: (nodeStatement link node) ",o[h-2],o[h-1],o[h]," typestr: ",o[h-1].edgeTypeStr);const U=S.edgeStrToEdgeData(o[h-1].edgeTypeStr),F=S.edgeStrToEdgeStartData(o[h-1].edgeTypeStr),J=S.edgeStrToThickness(o[h-1].edgeTypeStr),B=S.edgeStrToPattern(o[h-1].edgeTypeStr);this.$=[{id:o[h-2].id,label:o[h-2].label,type:o[h-2].type,directions:o[h-2].directions},{id:o[h-2].id+"-"+o[h].id,start:o[h-2].id,end:o[h].id,label:o[h-1].label,type:"edge",thickness:J,pattern:B,directions:o[h].directions,arrowTypeEnd:U,arrowTypeStart:F},{id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions}];break;case 24:S.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[h-1],o[h]),this.$={id:o[h-1].id,label:o[h-1].label,type:S.typeStr2Type(o[h-1].typeStr),directions:o[h-1].directions,widthInColumns:parseInt(o[h],10)};break;case 25:S.getLogger().debug("Rule: nodeStatement (node) ",o[h]),this.$={id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions,widthInColumns:1};break;case 26:S.getLogger().debug("APA123",this?this:"na"),S.getLogger().debug("COLUMNS: ",o[h]),this.$={type:"column-setting",columns:o[h]==="auto"?-1:parseInt(o[h])};break;case 27:S.getLogger().debug("Rule: id-block statement : ",o[h-2],o[h-1]),S.generateId(),this.$={...o[h-2],type:"composite",children:o[h-1]};break;case 28:S.getLogger().debug("Rule: blockStatement : ",o[h-2],o[h-1],o[h]);const Y=S.generateId();this.$={id:Y,type:"composite",label:"",children:o[h-1]};break;case 29:S.getLogger().debug("Rule: node (NODE_ID separator): ",o[h]),this.$={id:o[h]};break;case 30:S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[h-1],o[h]),this.$={id:o[h-1],label:o[h].label,typeStr:o[h].typeStr,directions:o[h].directions};break;case 31:S.getLogger().debug("Rule: dirList: ",o[h]),this.$=[o[h]];break;case 32:S.getLogger().debug("Rule: dirList: ",o[h-1],o[h]),this.$=[o[h-1]].concat(o[h]);break;case 33:S.getLogger().debug("Rule: nodeShapeNLabel: ",o[h-2],o[h-1],o[h]),this.$={typeStr:o[h-2]+o[h],label:o[h-1]};break;case 34:S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[h-3],o[h-2]," #3:",o[h-1],o[h]),this.$={typeStr:o[h-3]+o[h],label:o[h-2],directions:o[h-1]};break;case 35:case 36:this.$={type:"classDef",id:o[h-1].trim(),css:o[h].trim()};break;case 37:this.$={type:"applyClass",id:o[h-1].trim(),styleClass:o[h].trim()};break;case 38:this.$={type:"applyStyles",id:o[h-1].trim(),stylesStr:o[h].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(g,[2,16],{14:22,15:y,16:w}),e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(b,[2,25],{27:[1,25]}),e(g,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(m,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:y,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(m,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(g,[2,28]),e(g,[2,35]),e(g,[2,36]),e(g,[2,37]),e(g,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(g,[2,27]),e(m,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(m,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(x,p){if(p.recoverable)this.trace(x);else{var f=new Error(x);throw f.hash=p,f}},"parseError"),parse:d(function(x){var p=this,f=[0],S=[],E=[null],o=[],k=this.table,h="",T=0,D=0,U=2,F=1,J=o.slice.call(arguments,1),B=Object.create(this.lexer),Y={yy:{}};for(var et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,et)&&(Y.yy[et]=this.yy[et]);B.setInput(x,Y.yy),Y.yy.lexer=B,Y.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var rt=B.yylloc;o.push(rt);var _e=B.options&&B.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ke(X){f.length=f.length-2*X,E.length=E.length-X,o.length=o.length-X}d(ke,"popStack");function Bt(){var X;return X=S.pop()||B.lex()||F,typeof X!="number"&&(X instanceof Array&&(S=X,X=S.pop()),X=p.symbols_[X]||X),X}d(Bt,"lex");for(var K,$,G,ft,tt={},lt,Q,Ot,ot;;){if($=f[f.length-1],this.defaultActions[$]?G=this.defaultActions[$]:((K===null||typeof K>"u")&&(K=Bt()),G=k[$]&&k[$][K]),typeof G>"u"||!G.length||!G[0]){var yt="";ot=[];for(lt in k[$])this.terminals_[lt]&<>U&&ot.push("'"+this.terminals_[lt]+"'");B.showPosition?yt="Parse error on line "+(T+1)+`:
|
|
1
|
+
import{g as Te}from"./chunk-FMBD7UC4-9CNqmsuy.js";import{ar as De,as as Gt,at as Ne,au as Zt,av as jt,aw as qt,ax as Jt,ay as wt,az as Qt,aA as $t,aB as te,aC as ee,aD as re,aE as ae,aF as Ie,aG as Ce,aH as Be,aI as Oe,aJ as Re,aK as Ae,aL as ze,aM as Me,aN as Pe,aO as Fe,aP as We,_ as d,D as ct,d as O,e as Ye,l as v,z as He,B as Ke,aQ as Ue,R as Xe,S as Ve,c as M,O as Ge,aR as H,ak as _t,aS as at,aT as Ze,u as st,k as je,aU as qe,i as Rt,aV as At,aW as Je}from"./mermaid.core-DX1iGORO.js";import{G as Qe}from"./graph-CAnANduQ.js";import{c as $e}from"./channel-BO20buBp.js";import"./index-C6kOarnb.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";function tr(e){return Array.isArray(e)}function er(e){if(De(e))return e;const t=Gt(e);if(!rr(e))return{};if(tr(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ne(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t===Zt)return new ArrayBuffer(e.byteLength);if(t===jt){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t===qt||t===Jt||t===wt){const s=e.constructor,i=new s(e.valueOf());return t===wt?sr(i,e):xt(i,e),i}if(t===Qt)return new Date(Number(e));if(t===$t){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t===te)return Object(Symbol.prototype.valueOf.call(e));if(t===ee){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t===re){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t===ae){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ir(a,e),xt(a,e),ar(a,e),a}function rr(e){switch(Gt(e)){case ae:case We:case Zt:case jt:case qt:case Qt:case Fe:case Pe:case Me:case ze:case Ae:case ee:case Jt:case Re:case $t:case re:case wt:case te:case Oe:case Be:case Ce:case Ie:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function ar(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s<a.length;s++){const i=a[s];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function sr(e,t){const a=t.valueOf().length;for(const s in t)Object.hasOwn(t,s)&&(Number.isNaN(Number(s))||Number(s)>=a)&&(e[s]=t[s])}function ir(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var mt=(function(){var e=d(function(N,x,p,f){for(p=p||{},f=N.length;f--;p[N[f]]=x);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],g=[8,10,21,28,29,30,31,39,43,46],y=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],m=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(x,p,f,S,E,o,k){var h=o.length-1;switch(E){case 4:S.getLogger().debug("Rule: separator (NL) ");break;case 5:S.getLogger().debug("Rule: separator (Space) ");break;case 6:S.getLogger().debug("Rule: separator (EOF) ");break;case 7:S.getLogger().debug("Rule: hierarchy: ",o[h-1]),S.setHierarchy(o[h-1]);break;case 8:S.getLogger().debug("Stop NL ");break;case 9:S.getLogger().debug("Stop EOF ");break;case 10:S.getLogger().debug("Stop NL2 ");break;case 11:S.getLogger().debug("Stop EOF2 ");break;case 12:S.getLogger().debug("Rule: statement: ",o[h]),typeof o[h].length=="number"?this.$=o[h]:this.$=[o[h]];break;case 13:S.getLogger().debug("Rule: statement #2: ",o[h-1]),this.$=[o[h-1]].concat(o[h]);break;case 14:S.getLogger().debug("Rule: link: ",o[h],x),this.$={edgeTypeStr:o[h],label:""};break;case 15:S.getLogger().debug("Rule: LABEL link: ",o[h-3],o[h-1],o[h]),this.$={edgeTypeStr:o[h],label:o[h-1]};break;case 18:const T=parseInt(o[h]),D=S.generateId();this.$={id:D,type:"space",label:"",width:T,children:[]};break;case 23:S.getLogger().debug("Rule: (nodeStatement link node) ",o[h-2],o[h-1],o[h]," typestr: ",o[h-1].edgeTypeStr);const U=S.edgeStrToEdgeData(o[h-1].edgeTypeStr),F=S.edgeStrToEdgeStartData(o[h-1].edgeTypeStr),J=S.edgeStrToThickness(o[h-1].edgeTypeStr),B=S.edgeStrToPattern(o[h-1].edgeTypeStr);this.$=[{id:o[h-2].id,label:o[h-2].label,type:o[h-2].type,directions:o[h-2].directions},{id:o[h-2].id+"-"+o[h].id,start:o[h-2].id,end:o[h].id,label:o[h-1].label,type:"edge",thickness:J,pattern:B,directions:o[h].directions,arrowTypeEnd:U,arrowTypeStart:F},{id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions}];break;case 24:S.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[h-1],o[h]),this.$={id:o[h-1].id,label:o[h-1].label,type:S.typeStr2Type(o[h-1].typeStr),directions:o[h-1].directions,widthInColumns:parseInt(o[h],10)};break;case 25:S.getLogger().debug("Rule: nodeStatement (node) ",o[h]),this.$={id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions,widthInColumns:1};break;case 26:S.getLogger().debug("APA123",this?this:"na"),S.getLogger().debug("COLUMNS: ",o[h]),this.$={type:"column-setting",columns:o[h]==="auto"?-1:parseInt(o[h])};break;case 27:S.getLogger().debug("Rule: id-block statement : ",o[h-2],o[h-1]),S.generateId(),this.$={...o[h-2],type:"composite",children:o[h-1]};break;case 28:S.getLogger().debug("Rule: blockStatement : ",o[h-2],o[h-1],o[h]);const Y=S.generateId();this.$={id:Y,type:"composite",label:"",children:o[h-1]};break;case 29:S.getLogger().debug("Rule: node (NODE_ID separator): ",o[h]),this.$={id:o[h]};break;case 30:S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[h-1],o[h]),this.$={id:o[h-1],label:o[h].label,typeStr:o[h].typeStr,directions:o[h].directions};break;case 31:S.getLogger().debug("Rule: dirList: ",o[h]),this.$=[o[h]];break;case 32:S.getLogger().debug("Rule: dirList: ",o[h-1],o[h]),this.$=[o[h-1]].concat(o[h]);break;case 33:S.getLogger().debug("Rule: nodeShapeNLabel: ",o[h-2],o[h-1],o[h]),this.$={typeStr:o[h-2]+o[h],label:o[h-1]};break;case 34:S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[h-3],o[h-2]," #3:",o[h-1],o[h]),this.$={typeStr:o[h-3]+o[h],label:o[h-2],directions:o[h-1]};break;case 35:case 36:this.$={type:"classDef",id:o[h-1].trim(),css:o[h].trim()};break;case 37:this.$={type:"applyClass",id:o[h-1].trim(),styleClass:o[h].trim()};break;case 38:this.$={type:"applyStyles",id:o[h-1].trim(),stylesStr:o[h].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(g,[2,16],{14:22,15:y,16:w}),e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(b,[2,25],{27:[1,25]}),e(g,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(m,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:y,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(m,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(g,[2,28]),e(g,[2,35]),e(g,[2,36]),e(g,[2,37]),e(g,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(g,[2,27]),e(m,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(m,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(x,p){if(p.recoverable)this.trace(x);else{var f=new Error(x);throw f.hash=p,f}},"parseError"),parse:d(function(x){var p=this,f=[0],S=[],E=[null],o=[],k=this.table,h="",T=0,D=0,U=2,F=1,J=o.slice.call(arguments,1),B=Object.create(this.lexer),Y={yy:{}};for(var et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,et)&&(Y.yy[et]=this.yy[et]);B.setInput(x,Y.yy),Y.yy.lexer=B,Y.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var rt=B.yylloc;o.push(rt);var _e=B.options&&B.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ke(X){f.length=f.length-2*X,E.length=E.length-X,o.length=o.length-X}d(ke,"popStack");function Bt(){var X;return X=S.pop()||B.lex()||F,typeof X!="number"&&(X instanceof Array&&(S=X,X=S.pop()),X=p.symbols_[X]||X),X}d(Bt,"lex");for(var K,$,G,ft,tt={},lt,Q,Ot,ot;;){if($=f[f.length-1],this.defaultActions[$]?G=this.defaultActions[$]:((K===null||typeof K>"u")&&(K=Bt()),G=k[$]&&k[$][K]),typeof G>"u"||!G.length||!G[0]){var yt="";ot=[];for(lt in k[$])this.terminals_[lt]&<>U&&ot.push("'"+this.terminals_[lt]+"'");B.showPosition?yt="Parse error on line "+(T+1)+`:
|
|
2
2
|
`+B.showPosition()+`
|
|
3
3
|
Expecting `+ot.join(", ")+", got '"+(this.terminals_[K]||K)+"'":yt="Parse error on line "+(T+1)+": Unexpected "+(K==F?"end of input":"'"+(this.terminals_[K]||K)+"'"),this.parseError(yt,{text:B.match,token:this.terminals_[K]||K,line:B.yylineno,loc:rt,expected:ot})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+K);switch(G[0]){case 1:f.push(K),E.push(B.yytext),o.push(B.yylloc),f.push(G[1]),K=null,D=B.yyleng,h=B.yytext,T=B.yylineno,rt=B.yylloc;break;case 2:if(Q=this.productions_[G[1]][1],tt.$=E[E.length-Q],tt._$={first_line:o[o.length-(Q||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Q||1)].first_column,last_column:o[o.length-1].last_column},_e&&(tt._$.range=[o[o.length-(Q||1)].range[0],o[o.length-1].range[1]]),ft=this.performAction.apply(tt,[h,D,T,Y.yy,G[1],E,o].concat(J)),typeof ft<"u")return ft;Q&&(f=f.slice(0,-1*Q*2),E=E.slice(0,-1*Q),o=o.slice(0,-1*Q)),f.push(this.productions_[G[1]][0]),E.push(tt.$),o.push(tt._$),Ot=k[f[f.length-2]][f[f.length-1]],f.push(Ot);break;case 3:return!0}}return!0},"parse")},C=(function(){var N={EOF:1,parseError:d(function(p,f){if(this.yy.parser)this.yy.parser.parseError(p,f);else throw new Error(p)},"parseError"),setInput:d(function(x,p){return this.yy=p||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var p=x.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:d(function(x){var p=x.length,f=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===S.length?this.yylloc.first_column:0)+S[S.length-f.length].length-f[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(x){this.unput(this.match.slice(x))},"less"),pastInput:d(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var x=this.pastInput(),p=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Se,d as De}from"./chunk-ND2GUHAM-C-4E9LgY.js";import{s as Pe,g as Be,a as Ie,b as Me,_ as y,c as Bt,d as jt,l as de,e as Le,f as Ne,h as Tt,i as ge,j as Ye,w as je,k as $t,m as fe}from"./mermaid.core-DfVdcmTH.js";import"./index-DvV80Yu7.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var Ft=(function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,W,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`:
|
|
1
|
+
import{g as Se,d as De}from"./chunk-ND2GUHAM-B9JC5LqN.js";import{s as Pe,g as Be,a as Ie,b as Me,_ as y,c as Bt,d as jt,l as de,e as Le,f as Ne,h as Tt,i as ge,j as Ye,w as je,k as $t,m as fe}from"./mermaid.core-DX1iGORO.js";import"./index-C6kOarnb.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var Ft=(function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,W,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,oe=D.yyleng,p=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[p,oe,Et,At.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ai as o,aj as n}from"./mermaid.core-DX1iGORO.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,e as w,l as x}from"./mermaid.core-
|
|
1
|
+
import{_ as a,e as w,l as x}from"./mermaid.core-DX1iGORO.js";var d=a((e,t,i,o)=>{e.attr("class",i);const{width:r,height:h,x:n,y:c}=u(e,t);w(e,h,r,o);const s=l(n,c,r,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{var o;const i=((o=e.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,o,r)=>`${e-r} ${t-r} ${i} ${o}`,"createViewBox");export{d as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as l}from"./mermaid.core-
|
|
1
|
+
import{_ as l}from"./mermaid.core-DX1iGORO.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,d as o}from"./mermaid.core-
|
|
1
|
+
import{_ as a,d as o}from"./mermaid.core-DX1iGORO.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
|