@nextclaw/ui 0.15.4 → 0.15.5
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/CHANGELOG.md +17 -0
- package/dist/assets/abnfDiagram-VRR7QNED-BYpK0F5F.js +1 -0
- package/dist/assets/{aiden0z-pptx-renderer.es-Bd99vut2.js → aiden0z-pptx-renderer.es-D87ywFdC.js} +1 -1
- package/dist/assets/{api-BOXOrpcJ.js → api-IlX_CbwU.js} +2 -2
- package/dist/assets/app-presenter-provider-Bbl_MVbg.js +106 -0
- package/dist/assets/{appearance-settings-page-fLIJbx1C.js → appearance-settings-page-80fLa4-9.js} +1 -1
- package/dist/assets/arc-DFELHWM2.js +1 -0
- package/dist/assets/architecture-TIHT7OUA-ClwVFq-K.js +1 -0
- package/dist/assets/architectureDiagram-ZJ3FMSHR-CvRhdovL.js +36 -0
- package/dist/assets/array-BqYdCIE6.js +1 -0
- package/dist/assets/blockDiagram-677ZJIJ3-DVYNkbR_.js +132 -0
- package/dist/assets/{book-open-DWUjS6aW.js → book-open-CN7Shpij.js} +1 -1
- package/dist/assets/c4Diagram-LMCZKHZV-B1w-iwRe.js +10 -0
- package/dist/assets/channel-BEHOSFc5.js +1 -0
- package/dist/assets/{channels-list-page-CvCTJraa.js → channels-list-page-R7M6pzp6.js} +1 -1
- package/dist/assets/{chat-page-B42UUIFR.js → chat-page-152YuwfU.js} +1 -1
- package/dist/assets/chunk-2Q5K7J3B-DrIhesSX.js +1 -0
- package/dist/assets/chunk-32BRIVSS-kG3lg0bC.js +1 -0
- package/dist/assets/chunk-52WLFC77-BLeB7iGk.js +10 -0
- package/dist/assets/chunk-5FCAYU7R-BQga1Rr7.js +1 -0
- package/dist/assets/chunk-5HE753X5-DU81hkcF.js +1 -0
- package/dist/assets/chunk-5JV3BV7I-C2bAx0m7.js +1 -0
- package/dist/assets/chunk-5TONJI2A-BExIIgWY.js +2 -0
- package/dist/assets/chunk-5VM5RSS4-C3XB05yh.js +15 -0
- package/dist/assets/chunk-7BUUIJ7U-JiyRtrGu.js +1 -0
- package/dist/assets/chunk-BIQX33UG-BZRV20pI.js +1 -0
- package/dist/assets/chunk-C7G6YPKG-AsyDSQ9j.js +1 -0
- package/dist/assets/chunk-CQNSW5MT-iN-fiXVA.js +1 -0
- package/dist/assets/chunk-CYSBUYHQ-DhC_TRzI.js +1 -0
- package/dist/assets/chunk-EMLP6XTP-QFLK8R6d.js +1 -0
- package/dist/assets/chunk-EX3LRPZG-DzUwhkCz.js +231 -0
- package/dist/assets/chunk-FWX5IMBZ-DFelpZBy.js +2 -0
- package/dist/assets/chunk-HOUHSVGY-BMPwFEwN.js +1 -0
- package/dist/assets/chunk-ICXQ74PX-DH8NJMok.js +2 -0
- package/dist/assets/chunk-JG7HCLWE-D-95AsO4.js +2 -0
- package/dist/assets/chunk-JWPE2WC7-DIaTv8kx.js +1 -0
- package/dist/assets/chunk-KEIR6QF5-A3jEqwzn.js +161 -0
- package/dist/assets/chunk-MOJQB5TN-BPFLzWgj.js +88 -0
- package/dist/assets/chunk-MOZMSUNE-DR_fzxG0.js +1 -0
- package/dist/assets/chunk-OGEWGWER-TIcEoPPH.js +1 -0
- package/dist/assets/chunk-OSBZ3O6U-BALNvSfG.js +1 -0
- package/dist/assets/chunk-PUDLZKDR-I-EXhf_k.js +156 -0
- package/dist/assets/chunk-Q4XR5HBZ-uvIGstBS.js +70 -0
- package/dist/assets/chunk-QBLGF6JB-r-TjLdxa.js +1 -0
- package/dist/assets/chunk-R7FJI6CG-N-1LDgvy.js +1 -0
- package/dist/assets/chunk-RYQCIY6F-jxNASx65.js +1 -0
- package/dist/assets/chunk-U6XO7XAA-Cphbuc7q.js +2 -0
- package/dist/assets/chunk-V7JOEXUC-BLEuBf1s.js +206 -0
- package/dist/assets/chunk-VAUOI2AC-Dpcz6BhT.js +1 -0
- package/dist/assets/chunk-VR4S4FIN-BAUbR0ke.js +1 -0
- package/dist/assets/chunk-WYO6CB5R-Do6SJrnY.js +127 -0
- package/dist/assets/chunk-XXDRQBXY-C2QjjwYX.js +1 -0
- package/dist/assets/chunk-Y2CYZVJY-BGrd8tLy.js +1 -0
- package/dist/assets/chunk-YOTPTUD7-CQqvMTCr.js +1 -0
- package/dist/assets/chunk-ZGVPDNZ5-B7kWWaXv.js +62 -0
- package/dist/assets/chunk-ZIRB5QZD-DTU0cDNh.js +32 -0
- package/dist/assets/classDiagram-OUVF2IWQ-DESMaY3_.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-DwOlByYH.js +1 -0
- package/dist/assets/{config-split-page-DBgt9S8b.js → config-split-page-BlfvfmTm.js} +1 -1
- package/dist/assets/{confirm-dialog-GSXIvoRU.js → confirm-dialog-Dt8Kdbgp.js} +1 -1
- package/dist/assets/cose-bilkent-JH36ORCC-B9LrtV-q.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-CzjeeOq9.js +1 -0
- package/dist/assets/cynefinDiagram-TSTJHNR4-BfjvW4su.js +62 -0
- package/dist/assets/cytoscape.esm-CRW8q92n.js +321 -0
- package/dist/assets/dagre-DkiXZKkL.js +1 -0
- package/dist/assets/dagre-VKFMJZFB-B1pQKQSY.js +4 -0
- package/dist/assets/defaultLocale-Cdv9x6q7.js +1 -0
- package/dist/assets/{desktop-update-config-7bmNeWIC.js → desktop-update-config-DreMJu9z.js} +1 -1
- package/dist/assets/diagram-FQU43EPY-cB4EZdaP.js +3 -0
- package/dist/assets/diagram-G47NLZAW-CtW8im1B.js +24 -0
- package/dist/assets/diagram-NH7WQ7WH-BDCtrCCm.js +24 -0
- package/dist/assets/diagram-OA4YK3LP-DEMJ42Gt.js +30 -0
- package/dist/assets/diagram-WEI45ONY-CdCcxSYU.js +41 -0
- package/dist/assets/{dist-DC7f4TJH.js → dist-D5ycbwCo.js} +1 -1
- package/dist/assets/dist-dw-gAfM_.js +1 -0
- package/dist/assets/{doc-browser-D0monHjG.js → doc-browser-C9u7N9vH.js} +1 -1
- package/dist/assets/doc-browser-DJQ5XPsi2.js +1 -0
- package/dist/assets/{doc-browser-context-CGwEOhBy.js → doc-browser-context-CCdW9TJf.js} +1 -1
- package/dist/assets/{docx-preview-eFH9DRsS.js → docx-preview-zis3U0Fa.js} +1 -1
- package/dist/assets/{download-DiP9zx-J.js → download-CyPgglKr.js} +1 -1
- package/dist/assets/ebnfDiagram-CCIWWBDH-DBZETBwE.js +1 -0
- package/dist/assets/erDiagram-Q63AITRT-y2zDXprP.js +85 -0
- package/dist/assets/eventmodeling-45OFAUF4-C38BqG8w.js +1 -0
- package/dist/assets/{external-link-C6ZeSPef.js → external-link-BahW1sl3.js} +1 -1
- package/dist/assets/{eye-suvKmtwn.js → eye-D8gGXMkD.js} +1 -1
- package/dist/assets/flowDiagram-23GEKE2U-BoKk8RRq.js +1 -0
- package/dist/assets/{folder-CMELbQGG.js → folder-DGWqFDvE.js} +1 -1
- package/dist/assets/{form-actions-CUAzpNe_.js → form-actions-D2imZLnU.js} +1 -1
- package/dist/assets/ganttDiagram-NO4QXBWP-D2DP344e.js +292 -0
- package/dist/assets/gitGraph-TEB2WS4Q-IsQHHJuS.js +1 -0
- package/dist/assets/gitGraphDiagram-IHSO6WYX-D37uiwA2.js +106 -0
- package/dist/assets/graphlib-BcNFQr5y.js +1 -0
- package/dist/assets/index-0av6WO9-.css +1 -0
- package/dist/assets/index-CT0iYlxV.js +2 -0
- package/dist/assets/info-DKCQHKI2-ofy2qlHI.js +1 -0
- package/dist/assets/infoDiagram-FWYZ7A6U-CG-WAIRi.js +2 -0
- package/dist/assets/init-D8TjIqfm.js +1 -0
- package/dist/assets/ishikawaDiagram-FXEZZL3T-WeCTnW0f.js +70 -0
- package/dist/assets/journeyDiagram-5HDEW3XC-DUFBW9Td.js +139 -0
- package/dist/assets/kanban-definition-HUTT4EX6-B0lxgMpg.js +89 -0
- package/dist/assets/katex-wEmrEFTg.js +257 -0
- package/dist/assets/line-B78frP_c.js +1 -0
- package/dist/assets/linear-C6lVEcb2.js +1 -0
- package/dist/assets/loader-circle-DtKek-qG.js +1 -0
- package/dist/assets/{logo-badge-Cu5UGH_4.js → logo-badge-CuPetu-v.js} +1 -1
- package/dist/assets/map-Bdri5UL5.js +1 -0
- package/dist/assets/mcp-marketplace-page-4qMwFDpz.js +1 -0
- package/dist/assets/{mcp-marketplace-page-BUzHDwW6.js → mcp-marketplace-page-BbxN5aZF.js} +1 -1
- package/dist/assets/mermaid-parser.core-Cue18vLo.js +4 -0
- package/dist/assets/mermaid.core-CXwWRh5i.js +11 -0
- package/dist/assets/mindmap-definition-LN4V7U3C-CFxz0P0-.js +96 -0
- package/dist/assets/{model-config-page-CWP6pyBm.js → model-config-page-DiJcvBML.js} +1 -1
- package/dist/assets/ordinal-Cbd8t4LB.js +1 -0
- package/dist/assets/packet-7NZHBO7P-Rfopfa1o.js +1 -0
- package/dist/assets/path-DzBnMI1r.js +1 -0
- package/dist/assets/pegDiagram-2B236MQR-B_Qt9zyT.js +1 -0
- package/dist/assets/pie-RZYD4A2V-CJR1xKEv.js +1 -0
- package/dist/assets/pieDiagram-ENE6RG2P-CRQdSuwS.js +39 -0
- package/dist/assets/plus-BwgE-Zwf.js +1 -0
- package/dist/assets/{popover-DImguRok.js → popover-Btp7KVc3.js} +1 -1
- package/dist/assets/preload-helper-D4M6sveU.js +1 -0
- package/dist/assets/{provider-scoped-model-input-CE7p4SbJ.js → provider-scoped-model-input-DZMtoAJG.js} +1 -1
- package/dist/assets/{providers-config-page-BKPo8SjH.js → providers-config-page-DfiWveEF.js} +1 -1
- package/dist/assets/quadrantDiagram-ABIIQ3AL-D5kPpttq.js +7 -0
- package/dist/assets/radar-I7S5WNFK-CDg8Z-1r.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-BHnNmjxO.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-DGtNcusW.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-BRFtsQmm.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-Bj5IypCA.js +1 -0
- package/dist/assets/railroadDiagram-RFXS5EU6-DGh_TGlQ.js +1 -0
- package/dist/assets/{react-5sjAT_6d.js → react-BY-U3h3t.js} +1 -1
- package/dist/assets/{refresh-cw-CHLBzWWj.js → refresh-cw-Cme5qFej.js} +1 -1
- package/dist/assets/remote-BaVECEZw.js +1 -0
- package/dist/assets/requirementDiagram-TGXJPOKE-EmFph0H_.js +84 -0
- package/dist/assets/rotate-cw-CMRZxIkH.js +1 -0
- package/dist/assets/rough.esm-wJ1d3nQl.js +1 -0
- package/dist/assets/{runtime-config-page-1Axv4QGu.js → runtime-config-page-wygwvMB4.js} +1 -1
- package/dist/assets/sankeyDiagram-HTMAVEWB-BXWB5Ugi.js +40 -0
- package/dist/assets/{save-BABzyrjB.js → save-DNg2yJTS.js} +1 -1
- package/dist/assets/{search-BTqxG3ZG.js → search-3ykfrAFt.js} +1 -1
- package/dist/assets/{search-config-page-BkKKmxmS.js → search-config-page-DrVKa_Ls.js} +1 -1
- package/dist/assets/{secrets-config-page-CWJMyu-k.js → secrets-config-page-B39uQ5kF.js} +1 -1
- package/dist/assets/security-config-BPzet76z.js +1 -0
- package/dist/assets/{select-TYZDBNmq.js → select-B5EecXJt.js} +1 -1
- package/dist/assets/sequenceDiagram-DBY2YBRQ-ClKnO7v0.js +162 -0
- package/dist/assets/{setting-row-DR23Z_5I.js → setting-row-Qv1Ps79v.js} +1 -1
- package/dist/assets/{settings-2-D8WWcBnw.js → settings-2-D-3um9Az.js} +1 -1
- package/dist/assets/sizeCapture-X5ZJPWSS-DSo-t5ou.js +1 -0
- package/dist/assets/{skeleton-CloHeg0S.js → skeleton-BgkzQd4U.js} +1 -1
- package/dist/assets/src-Dad2ZbCt.js +1 -0
- package/dist/assets/stateDiagram-2N3HPSRC-BvAalBfz.js +1 -0
- package/dist/assets/stateDiagram-v2-6OUMAXLB-CfMU38yc.js +1 -0
- package/dist/assets/swimlanes-5IMT3BWC-DdVqVa1a.js +2 -0
- package/dist/assets/swimlanesDiagram-G3AALYLV-D9Zb9X57.js +8 -0
- package/dist/assets/{tabs-CX-ckWoo.js → tabs-BVD8gp3y.js} +1 -1
- package/dist/assets/{tag-chip-mCc23Rhb.js → tag-chip-0qn-f3Bo.js} +1 -1
- package/dist/assets/timeline-definition-FHXFAJF6-D4ar8IQY.js +120 -0
- package/dist/assets/{trash-2-SAW1Z4Po.js → trash-2-cnsMppRC.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-Uy7M0WvH.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-BJfGV7KX.js +1 -0
- package/dist/assets/{use-config-BucdaK23.js → use-config-D6yx0lb0.js} +1 -1
- package/dist/assets/{use-confirm-dialog-C95F6sT1.js → use-confirm-dialog-C_o0eQeH.js} +1 -1
- package/dist/assets/{use-viewport-layout-C6m3Nte7.js → use-viewport-layout-BWav4KCL.js} +1 -1
- package/dist/assets/vennDiagram-L72KCM5P-CDXJ_i3p.js +34 -0
- package/dist/assets/wardley-OPB4EBWU-q263iF3K.js +1 -0
- package/dist/assets/wardleyDiagram-EHGQE667-D-dSuT_7.js +78 -0
- package/dist/assets/x-B3o1dWR5.js +1 -0
- package/dist/assets/xychartDiagram-FW5EYKEG-C9JCzsZF.js +7 -0
- package/dist/index.html +33 -32
- package/package.json +5 -5
- package/src/features/chat/components/chat-popover-content.tsx +1 -26
- package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +1 -0
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +28 -11
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +43 -0
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +14 -10
- package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +51 -0
- package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +61 -21
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +42 -10
- package/src/features/chat/features/message/components/chat-inline-file-preview.tsx +80 -0
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +55 -60
- package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +2 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +22 -24
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +2 -1
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +6 -17
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +41 -19
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +5 -1
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +5 -1
- package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +104 -3
- package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +83 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +4 -1
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +96 -25
- package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +25 -0
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +5 -1
- package/src/features/chat/managers/chat-session-list.manager.ts +1 -0
- package/src/features/chat/managers/chat-thread.manager.ts +15 -37
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +9 -0
- package/src/features/chat/stores/chat-thread.store.ts +16 -36
- package/src/features/chat/types/chat-input-bar.types.ts +2 -0
- package/src/shared/components/common/__tests__/brand-header.test.tsx +17 -7
- package/src/shared/components/common/brand-header.tsx +34 -34
- package/src/shared/hooks/use-server-path-read.ts +10 -5
- package/src/shared/lib/api/types.ts +3 -3
- package/src/shared/lib/api/utils/server-path.utils.ts +1 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +8 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +8 -0
- package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +1 -4
- package/src/shared/lib/session-project/workspace-file-breadcrumb.utils.ts +1 -18
- package/dist/assets/app-presenter-provider-CkHLbvZQ.js +0 -106
- package/dist/assets/doc-browser-CgdoLUT92.js +0 -1
- package/dist/assets/index-BFeNDQ4R.css +0 -1
- package/dist/assets/index-D_6U-M94.js +0 -2
- package/dist/assets/loader-circle-tYHStefV.js +0 -1
- package/dist/assets/mcp-marketplace-page-ohUAdfqJ.js +0 -1
- package/dist/assets/plus-tywizkeY.js +0 -1
- package/dist/assets/remote-DXJryUxB.js +0 -1
- package/dist/assets/rotate-cw-BefO5brU.js +0 -1
- package/dist/assets/security-config-DeQUIXfi.js +0 -1
- package/dist/assets/x-DtCPHwCu.js +0 -1
- package/src/features/chat/components/__tests__/chat-popover-content.test.tsx +0 -41
- package/src/features/chat/components/layout/__tests__/chat-sidebar-utility-menu.test.tsx +0 -55
- /package/dist/assets/{config-hints-fDrYfl0l.js → config-hints-LxG80Uj5.js} +0 -0
- /package/dist/assets/{host-capabilities-zZvY9U63.js → host-capabilities-CFbAfrrA.js} +0 -0
- /package/dist/assets/{jszip.min-Das2IAnb.js → jszip.min-CP5uPNQa.js} +0 -0
- /package/dist/assets/{middleware-BLMHv9YF.js → middleware-CAXxl-af.js} +0 -0
- /package/dist/assets/{provider-models-C_yOh6DE.js → provider-models-BoUhFo9R.js} +0 -0
- /package/dist/assets/{xlsx-B6zVt1RK.js → xlsx-DUqJhg5u.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{h as t,p as n,r,u as i}from"./react-5sjAT_6d.js";import{$ as a,A as o,C as s,D as c,F as l,I as u,L as d,M as f,N as p,O as m,P as h,R as g,S as ee,_t as _,c as v,ct as y,d as b,gt as te,ht as x,it as ne,j as re,k as ie,l as S,lt as C,n as w,o as T,rt as E,s as D,tt as O}from"./app-presenter-provider-CkHLbvZQ.js";import{Ht as k,Kt as ae,Mt as A,Nt as j,Pt as M,Vt as N,ft as oe,zt as se}from"./api-BOXOrpcJ.js";import{c as ce}from"./dist-DC7f4TJH.js";import{i as P,r as le,t as ue}from"./popover-DImguRok.js";import{a as F,i as I,n as L,o as R,r as z,s as B}from"./confirm-dialog-GSXIvoRU.js";import{C as de,a as fe,i as pe,n as me,r as he,t as ge}from"./select-TYZDBNmq.js";import{t as _e}from"./provider-scoped-model-input-CE7p4SbJ.js";import{a as ve,t as ye}from"./use-confirm-dialog-C95F6sT1.js";import{n as be,t as xe}from"./settings-2-D8WWcBnw.js";import{t as Se}from"./eye-suvKmtwn.js";import{t as Ce}from"./use-viewport-layout-C6m3Nte7.js";import{t as V}from"./plus-tywizkeY.js";import{n as H}from"./skeleton-CloHeg0S.js";import{t as we}from"./trash-2-SAW1Z4Po.js";import{n as Te}from"./provider-models-C_yOh6DE.js";import{t as Ee}from"./tag-chip-mCc23Rhb.js";import{t as De}from"./index-D_6U-M94.js";import{l as U,t as W,u as G}from"./use-config-BucdaK23.js";var Oe=ce(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),K=e(t(),1),q=n(),J=new Intl.NumberFormat;function ke({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:i,defaultRuntimeLabel:a,onOpenChange:s,onEdit:c}){if(!e)return null;let l=Y(e.model,t?.model),u=Ae({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:i,defaultRuntimeLabel:a}),d=X(e.contextTokens,t?.contextTokens??2e5),f=X(e.reservedContextTokens,t?.reservedContextTokens),p=X(e.maxToolIterations,t?.maxToolIterations??1e3),m=Y(e.thinkingDefault,t?.thinkingDefault??`off`),h=Me(e.runtimeConfig??e.engineConfig,t?.engineConfig),g=Me(e.models,t?.models);return(0,q.jsx)(L,{open:e!==null,onOpenChange:s,children:(0,q.jsxs)(z,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-white p-0 sm:max-h-[720px] sm:max-w-2xl`,children:[(0,q.jsx)(`div`,{className:`shrink-0 px-5 pb-3 pt-5`,children:(0,q.jsx)(R,{className:`text-left`,children:(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,q.jsx)(o,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-10 w-10 shrink-0`}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(B,{className:`truncate text-base`,children:e.displayName?.trim()||e.id}),(0,q.jsxs)(I,{className:`truncate text-xs`,children:[`@`,e.id]})]})]})})}),(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-5 py-3`,children:[(0,q.jsxs)(Z,{icon:C,title:r(`agentsDetailsIdentitySection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldDisplayName`),value:e.displayName?.trim()||e.id}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldId`),value:e.id,mono:!0}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldDescription`),value:e.description?.trim()||r(`agentsDetailsEmptyValue`),wide:!0}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldWorkspace`),value:e.workspace??r(`agentsDetailsUnsetValue`),mono:!0,wide:!0})]}),(0,q.jsxs)(Z,{icon:H,title:r(`agentsDetailsRuntimeSection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldModel`),value:l.value,source:l.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldRuntime`),value:u.value,source:u.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldRuntimeConfig`),value:h.value,source:h.source,mono:!0,prewrap:!0})]}),(0,q.jsxs)(Z,{icon:Oe,title:r(`agentsDetailsContextSection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldContextTokens`),value:d.value,source:d.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldReservedContextTokens`),value:f.value,source:f.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldMaxToolIterations`),value:p.value,source:p.source})]}),(0,q.jsxs)(Z,{icon:y,title:r(`agentsDetailsBehaviorSection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldThinkingDefault`),value:m.value,source:m.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldModelOverrides`),value:g.value,source:g.source,mono:!0,prewrap:!0}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldAvatar`),value:e.avatar??r(`agentsDetailsUnsetValue`),mono:!0})]})]}),(0,q.jsxs)(F,{className:`shrink-0 px-5 pb-4 pt-2`,children:[(0,q.jsx)(k,{type:`button`,variant:`ghost`,onClick:()=>s(!1),children:r(`cancel`)}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`px-4`,onClick:()=>c(e),children:[(0,q.jsx)(O,{className:`mr-2 h-4 w-4`}),r(`agentsDetailsEditAction`)]})]})]})})}function Y(e,t){let n=e?.trim();return n?{value:n,source:`override`}:{value:t?.trim()||r(`agentsDetailsUnsetValue`),source:`default`}}function X(e,t){return typeof e==`number`?{value:J.format(e),source:`override`}:{value:typeof t==`number`?J.format(t):r(`agentsDetailsUnsetValue`),source:`default`}}function Ae(e){let{agent:t,defaults:n,runtimeOptions:r,defaultRuntime:i,defaultRuntimeLabel:a}=e,o=t.runtime?.trim()||t.engine?.trim();if(o)return{value:je(o,r,a),source:`override`};let s=n?.engine?.trim()||i;return{value:s?je(s,r,a):a,source:`default`}}function je(e,t,n){let r=f(e);return r?t.find(e=>e.value===r)?.label??h(r):n}function Me(e,t){return Ne(e)?{value:JSON.stringify(e,null,2),source:`override`}:{value:Ne(t)?JSON.stringify(t,null,2):r(`agentsDetailsUnsetValue`),source:`default`}}function Ne(e){return!!(e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length>0)}function Z(e){let{icon:t,title:n,children:r}=e;return(0,q.jsxs)(`section`,{className:`space-y-2 border-t border-gray-100 pt-3 first:border-t-0 first:pt-0`,children:[(0,q.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold leading-5 text-gray-900`,children:[(0,q.jsx)(t,{className:`h-3.5 w-3.5 text-gray-400`}),n]}),(0,q.jsx)(`dl`,{className:`grid min-w-0 gap-x-6 gap-y-2.5 pl-5 sm:grid-cols-2`,children:r})]})}function Q(e){let{label:t,value:n,source:r,mono:a=!1,prewrap:o=!1,wide:s=!1}=e,c=o&&n.trim().startsWith(`{`),l=a&&(!o||c);return(0,q.jsxs)(`div`,{className:i(`grid min-w-0 grid-cols-[10rem_minmax(0,1fr)] items-baseline gap-x-2`,(s||c)&&`sm:col-span-2`),children:[(0,q.jsx)(`dt`,{className:`flex min-w-0 items-baseline leading-5`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-gray-500`,children:t})}),(0,q.jsxs)(`dd`,{className:i(`min-w-0 break-words text-xs leading-5 text-gray-900`,c?`max-h-28 overflow-auto whitespace-pre-wrap rounded bg-gray-50/70 px-2 py-1.5 text-left`:``),children:[(0,q.jsx)(`span`,{className:l?`font-mono`:void 0,children:n}),r?(0,q.jsx)(Pe,{source:r}):null]})]})}function Pe({source:e}){return(0,q.jsxs)(`span`,{className:i(`ml-1 whitespace-nowrap text-xs font-normal leading-5`,e===`override`?`text-blue-500`:`text-gray-400`),children:[`(`,r(e===`override`?`agentsDetailsAgentOverride`:`agentsDetailsInheritedDefault`),`)`]})}function Fe({form:e,disabled:t=!1,onChange:n}){return(0,q.jsxs)(`details`,{className:`group rounded-2xl border border-gray-200 bg-white`,children:[(0,q.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-gray-800 [&::-webkit-details-marker]:hidden`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(xe,{className:`h-4 w-4 shrink-0 text-gray-400`}),(0,q.jsx)(`span`,{className:`truncate`,children:r(`agentsAdvancedConfigToggle`)})]}),(0,q.jsx)(de,{className:`h-4 w-4 shrink-0 text-gray-400 transition-transform group-open:rotate-180`})]}),(0,q.jsxs)(`div`,{className:`space-y-4 border-t border-gray-100 px-4 py-4`,children:[(0,q.jsx)(`p`,{className:`text-xs leading-5 text-gray-500`,children:r(`agentsAdvancedConfigDescription`)}),(0,q.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(0,q.jsx)(Ie,{label:r(`agentsAdvancedContextTokensLabel`),value:e.contextTokens,min:1e3,step:1e3,disabled:t,onChange:e=>n({contextTokens:e})})})]})]})}function Ie(e){let{label:t,value:n,min:i,step:a,disabled:o,onChange:s}=e;return(0,q.jsxs)(`label`,{className:`space-y-2 text-sm font-medium text-gray-700`,children:[(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(N,{type:`number`,min:i,step:a,value:n,disabled:o,placeholder:r(`agentsAdvancedInheritPlaceholder`),"aria-label":t,onChange:e=>s(e.target.value)})]})}function Le(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:Re(e.contextTokens)}}function Re(e){return typeof e==`number`?String(e):``}var ze=K.forwardRef(({className:e,...t},n)=>(0,q.jsx)(`textarea`,{className:i(`flex min-h-28 w-full rounded-xl border border-border/75 bg-card px-3.5 py-2.5 text-sm text-foreground placeholder:text-muted-foreground/55 placeholder:font-normal transition-colors focus:outline-none focus:ring-0 focus:border-border disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));ze.displayName=`Textarea`;function Be(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=f(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:h(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function Ve({value:e,disabled:t=!1,runtimeOptions:n,defaultRuntime:i,onChange:a}){let o=e.trim()?f(e):``,s=Be({runtimeOptions:n,currentRuntime:e}),c=s.find(e=>e.value===o)??null,l=c?.reasonMessage?.trim()||(c?.ready===!1?r(`agentsRuntimeUnavailableHelp`):``);return(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsxs)(ge,{value:o||i,onValueChange:e=>a(e===i?``:e),disabled:t,children:[(0,q.jsx)(pe,{"aria-label":r(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,q.jsx)(fe,{placeholder:r(`agentsRuntimeSelectPlaceholder`)})}),(0,q.jsx)(me,{className:`rounded-xl`,children:s.map(e=>(0,q.jsx)(he,{value:e.value,disabled:e.ready===!1&&e.value!==o,className:`rounded-lg`,children:e.label},e.value))})]}),l?(0,q.jsx)(`p`,{className:`text-xs text-gray-500`,children:l}):null]})}function He({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,q.jsx)(L,{open:e!==null,onOpenChange:a,children:e?(0,q.jsx)(Ue,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function Ue(e){let{agent:t,pending:n,providerCatalog:i,runtimeOptions:a,defaultRuntime:o,onOpenChange:s,onSubmit:c}=e,[l,u]=(0,K.useState)(Le(t));return(0,q.jsxs)(z,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-[linear-gradient(180deg,#fff9f1_0%,#ffffff_24%)] p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,q.jsx)(`div`,{className:`shrink-0 border-b border-[#f0e2c8] px-6 py-6`,children:(0,q.jsxs)(R,{className:`text-left`,children:[(0,q.jsx)(B,{children:r(`agentsEditDialogTitle`)}),(0,q.jsx)(I,{children:r(`agentsEditDialogDescription`)})]})}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(ve,{tone:`warning`,title:r(`agentsEditHomeReadonly`),description:r(`agentsEditHomeReadonlyHint`),children:(0,q.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,q.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,q.jsx)(N,{value:l.displayName,onChange:e=>u(t=>({...t,displayName:e.target.value})),placeholder:r(`agentsFormNamePlaceholder`)}),(0,q.jsx)(ze,{value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),placeholder:r(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,q.jsx)(N,{value:l.avatar,onChange:e=>u(t=>({...t,avatar:e.target.value})),placeholder:r(`agentsFormAvatarPlaceholder`)}),(0,q.jsx)(_e,{value:l.model,onChange:e=>u(t=>({...t,model:e})),providerCatalog:i,disabled:n,className:`md:col-span-2`}),(0,q.jsx)(Ve,{value:l.runtime,onChange:e=>u(t=>({...t,runtime:e})),runtimeOptions:a,defaultRuntime:o,disabled:n})]}),(0,q.jsx)(Fe,{form:l,disabled:n,onChange:e=>u(t=>({...t,...e}))})]})}),(0,q.jsxs)(F,{className:`shrink-0 border-t border-[#f1e7d4] px-6 py-5`,children:[(0,q.jsx)(k,{type:`button`,variant:`ghost`,onClick:()=>s(!1),disabled:n,children:r(`cancel`)}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>c(t.id,l),disabled:n,children:[(0,q.jsx)(O,{className:`mr-2 h-4 w-4`}),r(`agentsEditSaveAction`)]})]})]})}var We=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function Ge(e,t){let n=e.trim();if(!n)return null;let i=Number(n);if(!Number.isFinite(i))throw Error(r(`agentsAdvancedInvalidNumberError`));return Math.max(t,Math.trunc(i))}function Ke(e){return{displayName:e.displayName,description:e.description,avatar:e.avatar,model:e.model,...e.runtime.trim()?{runtime:e.runtime.trim()}:{runtime:``},contextTokens:Ge(e.contextTokens,1e3)}}function qe(e){let{agentCount:t,onCreate:n}=e;return(0,q.jsxs)(`section`,{className:`flex flex-col gap-3 border-b border-gray-200 pb-4 sm:flex-row sm:items-end sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-xl font-semibold text-gray-950`,children:r(`agentsHeroEyebrow`)}),(0,q.jsx)(`span`,{className:`rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs font-medium text-gray-500`,children:t})]}),(0,q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-gray-500`,children:r(`agentsHeroDescription`)})]}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:n,children:[(0,q.jsx)(V,{className:`mr-2 h-4 w-4`}),r(`agentsCreateButton`)]})]})}function $(e){let{icon:t,label:n,disabled:r=!1,destructive:a=!1,onClick:o}=e;return(0,q.jsxs)(`button`,{type:`button`,className:i(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,a?`text-destructive hover:bg-destructive/10`:`text-gray-700 hover:bg-gray-100`),onClick:o,disabled:r,children:[(0,q.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,q.jsx)(`span`,{children:n})]})}function Je(e){let{agent:t,runtimeOptions:n,defaultRuntimeLabel:i,updatePending:s,deletePending:c,onStartChat:l,onView:u,onEdit:d,onDelete:p}=e,m=t.runtime?.trim()||t.engine?.trim()||``,g=m?n.find(e=>e.value===f(m))?.label??h(m):i;return(0,q.jsx)(j,{className:`group overflow-hidden border border-gray-200 bg-white shadow-none transition-colors duration-200 hover:border-gray-300`,children:(0,q.jsxs)(M,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,q.jsx)(o,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-950`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,q.jsxs)(Ee,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,q.jsx)(a,{className:`h-3 w-3`}),r(`agentsCardBuiltInTag`)]}):null]}),(0,q.jsxs)(`div`,{className:`truncate text-xs text-gray-400`,children:[`@`,t.id]})]})]}),(0,q.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":r(`agentsCardStartChat`),title:r(`agentsCardStartChat`),onClick:l,children:(0,q.jsx)(E,{className:`h-4 w-4`})}),(0,q.jsxs)(ue,{children:[(0,q.jsx)(P,{asChild:!0,children:(0,q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":r(`chatSessionMoreActions`),title:r(`chatSessionMoreActions`),children:(0,q.jsx)(be,{className:`h-4 w-4`})})}),(0,q.jsxs)(le,{align:`end`,className:`w-44 p-1.5`,children:[(0,q.jsx)($,{icon:Se,label:r(`agentsViewDetailsAction`),onClick:u}),(0,q.jsx)($,{icon:O,label:r(`agentsEditAction`),onClick:d,disabled:s}),t.builtIn?null:(0,q.jsx)($,{icon:we,label:r(`agentsRemoveAction`),onClick:p,disabled:c,destructive:!0})]})]})]}),(0,q.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-gray-600`,children:t.description?.trim()||(t.builtIn?r(`agentsCardBuiltInSummary`):r(`agentsCardCustomSummary`))}),(0,q.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-gray-100 pt-2 text-xs text-gray-500`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(H,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:g})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(ne,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function Ye(){let e=g(),t=w(),n=te(),i=c(),a=W(),o=G(),s=U(),l=T(),u=ie(),d=m(),[ee,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),b=(0,K.useMemo)(()=>i.data?.agents??[],[i.data?.agents]),x=(0,K.useMemo)(()=>[...b].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[b]),ne=(0,K.useMemo)(()=>Te({config:a.data,providersView:o.data,templatesView:s.data,onlyConfigured:!0}),[a.data,o.data,s.data]),S=(0,K.useMemo)(()=>re(l.data?.options??[]),[l.data?.options]),E=(0,K.useMemo)(()=>f(l.data?.defaultType??`native`),[l.data?.defaultType]),D=(0,K.useMemo)(()=>S.find(e=>e.value===E)?.label??h(E),[E,S]),O=a.data?.agents.defaults,A=e=>{_(e)},N=e=>{y(e)},oe=async(e,t)=>{let n;try{n=Ke(t)}catch(e){ae.error(e instanceof Error?e.message:r(`agentsAdvancedParseFailed`));return}await u.mutateAsync({agentId:e,data:n}),y(null)},ce=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,p(t,E))},P=()=>{n(`/chat`),t.chatDraftIntentManager.requestDraft(We)};return(0,q.jsxs)(se,{className:`space-y-5`,children:[(0,q.jsx)(qe,{agentCount:b.length,onCreate:P}),(0,q.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:i.isLoading?(0,q.jsx)(j,{className:`md:col-span-2 xl:col-span-3 border-dashed border-[#d9dce3] bg-white/70`,children:(0,q.jsx)(M,{className:`py-14 text-center text-sm text-gray-500`,children:r(`agentsLoading`)})}):x.length===0?(0,q.jsx)(j,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-[#d9dce3] bg-[linear-gradient(135deg,#fff7ea_0%,#f4fbff_100%)]`,children:(0,q.jsxs)(M,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,q.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-white/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,q.jsx)(C,{className:`h-8 w-8 text-[#d39a3b]`})}),(0,q.jsx)(`div`,{className:`text-lg font-semibold text-[#2f2212]`,children:r(`agentsEmpty`)}),(0,q.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-[#78644d]`,children:r(`agentsEmptyDescription`)}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:P,children:[(0,q.jsx)(V,{className:`mr-2 h-4 w-4`}),r(`agentsCreateButton`)]})]})}):x.map(e=>(0,q.jsx)(Je,{agent:e,runtimeOptions:S,defaultRuntimeLabel:D,updatePending:u.isPending,deletePending:d.isPending,onStartChat:()=>ce(e),onView:()=>A(e),onEdit:()=>N(e),onDelete:()=>d.mutate({agentId:e.id})},e.id))}),(0,q.jsx)(ke,{agent:ee,defaults:O,runtimeOptions:S,defaultRuntime:E,defaultRuntimeLabel:D,onOpenChange:e=>{e||_(null)},onEdit:e=>{_(null),y(e)}}),(0,q.jsx)(He,{agent:v,pending:u.isPending,providerCatalog:ne,runtimeOptions:S,defaultRuntime:E,onOpenChange:e=>{!e&&!u.isPending&&y(null)},onSubmit:oe})]})}function Xe(e){let{view:t,routeSessionKey:n,syncRouteSessionSelection:r}=e;(0,K.useEffect)(()=>{r({isChatView:t===`chat`,routeSessionKey:n})},[n,r,t])}function Ze({view:e,confirmDialog:t}){let{isMobile:n}=Ce();return(0,q.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,q.jsx)(S,{}),e===`chat`?n?(0,q.jsx)(b,{}):(0,q.jsx)(ee,{}):(0,q.jsx)(`section`,{className:`flex-1 min-h-0 overflow-hidden bg-background`,children:e===`cron`?(0,q.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1120px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,q.jsx)(s,{})})}):e===`agents`?(0,q.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1180px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,q.jsx)(Ye,{})})}):(0,q.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,q.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-[min(1120px,100%)] flex-col px-4 py-4 sm:px-6 sm:py-5`,children:(0,q.jsx)(De,{forcedType:`skills`})})})}),t]})}function Qe(e){let t=g(),n=W(),r=G(),i=U(),a=u({limit:200}),o=T(),s=e.sessionKey?.trim()||`draft-session`,c=l({sessionId:s});(0,K.useEffect)(()=>{t.chatQueryManager.syncSnapshot({configQuery:n,providersQuery:r,providerTemplatesQuery:i,sessionsQuery:a,sessionTypesQuery:o,sessionSkillsSessionId:s,sessionSkillsQuery:c})},[n,t.chatQueryManager,r,s,c,a,o,i])}function $e(){let e=g();(0,K.useEffect)(()=>oe.eventBus.on(A.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function et(){let{sessionId:e}=_(),t=(0,K.useMemo)(()=>v(e),[e]);return{routeSessionKey:t,sessionKey:t??void 0}}function tt(){let e=g(),{confirm:t,ConfirmDialog:n}=ye(),r=x(),i=te();return(0,K.useEffect)(()=>{e.chatUiManager.syncState({pathname:r.pathname}),e.chatUiManager.bindActions({navigate:i,confirm:t})},[t,r.pathname,i,e]),(0,q.jsx)(n,{})}function nt({view:e}){let t=w();return(0,q.jsx)(d,{presenter:(0,K.useMemo)(()=>new D(t),[t]),children:(0,q.jsx)(rt,{view:e})})}function rt({view:e}){let t=g(),n=tt(),{routeSessionKey:r,sessionKey:i}=et();return Qe({sessionKey:i??null}),Xe({view:e,routeSessionKey:r,syncRouteSessionSelection:t.chatSessionListManager.syncRouteSessionSelection}),$e(),(0,q.jsx)(Ze,{view:e,confirmDialog:n})}function it({view:e}){return(0,q.jsx)(nt,{view:e})}export{it as ChatPage};
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{h as t,p as n,r,u as i}from"./react-BY-U3h3t.js";import{$ as a,A as o,C as s,D as c,F as l,I as u,L as d,M as f,N as p,O as m,P as h,R as g,S as ee,_t as _,c as v,ct as y,d as b,gt as te,ht as x,it as ne,j as re,k as ie,l as S,lt as C,n as w,o as T,rt as E,s as D,tt as O}from"./app-presenter-provider-Bbl_MVbg.js";import{Ht as k,Kt as ae,Mt as A,Nt as j,Pt as M,Vt as N,ft as oe,zt as se}from"./api-IlX_CbwU.js";import{c as ce}from"./dist-D5ycbwCo.js";import{i as P,r as le,t as ue}from"./popover-Btp7KVc3.js";import{a as F,i as I,n as L,o as R,r as z,s as B}from"./confirm-dialog-Dt8Kdbgp.js";import{C as de,a as fe,i as pe,n as me,r as he,t as ge}from"./select-B5EecXJt.js";import{t as _e}from"./provider-scoped-model-input-DZMtoAJG.js";import{a as ve,t as ye}from"./use-confirm-dialog-C_o0eQeH.js";import{n as be,t as xe}from"./settings-2-D-3um9Az.js";import{t as Se}from"./eye-D8gGXMkD.js";import{t as Ce}from"./use-viewport-layout-BWav4KCL.js";import{t as V}from"./plus-BwgE-Zwf.js";import{n as H}from"./skeleton-BgkzQd4U.js";import{t as we}from"./trash-2-cnsMppRC.js";import{n as Te}from"./provider-models-BoUhFo9R.js";import{t as Ee}from"./tag-chip-0qn-f3Bo.js";import{t as De}from"./index-CT0iYlxV.js";import{l as U,t as W,u as G}from"./use-config-D6yx0lb0.js";var Oe=ce(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),K=e(t(),1),q=n(),J=new Intl.NumberFormat;function ke({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:i,defaultRuntimeLabel:a,onOpenChange:s,onEdit:c}){if(!e)return null;let l=Y(e.model,t?.model),u=Ae({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:i,defaultRuntimeLabel:a}),d=X(e.contextTokens,t?.contextTokens??2e5),f=X(e.reservedContextTokens,t?.reservedContextTokens),p=X(e.maxToolIterations,t?.maxToolIterations??1e3),m=Y(e.thinkingDefault,t?.thinkingDefault??`off`),h=Me(e.runtimeConfig??e.engineConfig,t?.engineConfig),g=Me(e.models,t?.models);return(0,q.jsx)(L,{open:e!==null,onOpenChange:s,children:(0,q.jsxs)(z,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-white p-0 sm:max-h-[720px] sm:max-w-2xl`,children:[(0,q.jsx)(`div`,{className:`shrink-0 px-5 pb-3 pt-5`,children:(0,q.jsx)(R,{className:`text-left`,children:(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,q.jsx)(o,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-10 w-10 shrink-0`}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(B,{className:`truncate text-base`,children:e.displayName?.trim()||e.id}),(0,q.jsxs)(I,{className:`truncate text-xs`,children:[`@`,e.id]})]})]})})}),(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-5 py-3`,children:[(0,q.jsxs)(Z,{icon:C,title:r(`agentsDetailsIdentitySection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldDisplayName`),value:e.displayName?.trim()||e.id}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldId`),value:e.id,mono:!0}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldDescription`),value:e.description?.trim()||r(`agentsDetailsEmptyValue`),wide:!0}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldWorkspace`),value:e.workspace??r(`agentsDetailsUnsetValue`),mono:!0,wide:!0})]}),(0,q.jsxs)(Z,{icon:H,title:r(`agentsDetailsRuntimeSection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldModel`),value:l.value,source:l.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldRuntime`),value:u.value,source:u.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldRuntimeConfig`),value:h.value,source:h.source,mono:!0,prewrap:!0})]}),(0,q.jsxs)(Z,{icon:Oe,title:r(`agentsDetailsContextSection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldContextTokens`),value:d.value,source:d.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldReservedContextTokens`),value:f.value,source:f.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldMaxToolIterations`),value:p.value,source:p.source})]}),(0,q.jsxs)(Z,{icon:y,title:r(`agentsDetailsBehaviorSection`),children:[(0,q.jsx)(Q,{label:r(`agentsDetailsFieldThinkingDefault`),value:m.value,source:m.source}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldModelOverrides`),value:g.value,source:g.source,mono:!0,prewrap:!0}),(0,q.jsx)(Q,{label:r(`agentsDetailsFieldAvatar`),value:e.avatar??r(`agentsDetailsUnsetValue`),mono:!0})]})]}),(0,q.jsxs)(F,{className:`shrink-0 px-5 pb-4 pt-2`,children:[(0,q.jsx)(k,{type:`button`,variant:`ghost`,onClick:()=>s(!1),children:r(`cancel`)}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`px-4`,onClick:()=>c(e),children:[(0,q.jsx)(O,{className:`mr-2 h-4 w-4`}),r(`agentsDetailsEditAction`)]})]})]})})}function Y(e,t){let n=e?.trim();return n?{value:n,source:`override`}:{value:t?.trim()||r(`agentsDetailsUnsetValue`),source:`default`}}function X(e,t){return typeof e==`number`?{value:J.format(e),source:`override`}:{value:typeof t==`number`?J.format(t):r(`agentsDetailsUnsetValue`),source:`default`}}function Ae(e){let{agent:t,defaults:n,runtimeOptions:r,defaultRuntime:i,defaultRuntimeLabel:a}=e,o=t.runtime?.trim()||t.engine?.trim();if(o)return{value:je(o,r,a),source:`override`};let s=n?.engine?.trim()||i;return{value:s?je(s,r,a):a,source:`default`}}function je(e,t,n){let r=f(e);return r?t.find(e=>e.value===r)?.label??h(r):n}function Me(e,t){return Ne(e)?{value:JSON.stringify(e,null,2),source:`override`}:{value:Ne(t)?JSON.stringify(t,null,2):r(`agentsDetailsUnsetValue`),source:`default`}}function Ne(e){return!!(e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length>0)}function Z(e){let{icon:t,title:n,children:r}=e;return(0,q.jsxs)(`section`,{className:`space-y-2 border-t border-gray-100 pt-3 first:border-t-0 first:pt-0`,children:[(0,q.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold leading-5 text-gray-900`,children:[(0,q.jsx)(t,{className:`h-3.5 w-3.5 text-gray-400`}),n]}),(0,q.jsx)(`dl`,{className:`grid min-w-0 gap-x-6 gap-y-2.5 pl-5 sm:grid-cols-2`,children:r})]})}function Q(e){let{label:t,value:n,source:r,mono:a=!1,prewrap:o=!1,wide:s=!1}=e,c=o&&n.trim().startsWith(`{`),l=a&&(!o||c);return(0,q.jsxs)(`div`,{className:i(`grid min-w-0 grid-cols-[10rem_minmax(0,1fr)] items-baseline gap-x-2`,(s||c)&&`sm:col-span-2`),children:[(0,q.jsx)(`dt`,{className:`flex min-w-0 items-baseline leading-5`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-gray-500`,children:t})}),(0,q.jsxs)(`dd`,{className:i(`min-w-0 break-words text-xs leading-5 text-gray-900`,c?`max-h-28 overflow-auto whitespace-pre-wrap rounded bg-gray-50/70 px-2 py-1.5 text-left`:``),children:[(0,q.jsx)(`span`,{className:l?`font-mono`:void 0,children:n}),r?(0,q.jsx)(Pe,{source:r}):null]})]})}function Pe({source:e}){return(0,q.jsxs)(`span`,{className:i(`ml-1 whitespace-nowrap text-xs font-normal leading-5`,e===`override`?`text-blue-500`:`text-gray-400`),children:[`(`,r(e===`override`?`agentsDetailsAgentOverride`:`agentsDetailsInheritedDefault`),`)`]})}function Fe({form:e,disabled:t=!1,onChange:n}){return(0,q.jsxs)(`details`,{className:`group rounded-2xl border border-gray-200 bg-white`,children:[(0,q.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-gray-800 [&::-webkit-details-marker]:hidden`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(xe,{className:`h-4 w-4 shrink-0 text-gray-400`}),(0,q.jsx)(`span`,{className:`truncate`,children:r(`agentsAdvancedConfigToggle`)})]}),(0,q.jsx)(de,{className:`h-4 w-4 shrink-0 text-gray-400 transition-transform group-open:rotate-180`})]}),(0,q.jsxs)(`div`,{className:`space-y-4 border-t border-gray-100 px-4 py-4`,children:[(0,q.jsx)(`p`,{className:`text-xs leading-5 text-gray-500`,children:r(`agentsAdvancedConfigDescription`)}),(0,q.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(0,q.jsx)(Ie,{label:r(`agentsAdvancedContextTokensLabel`),value:e.contextTokens,min:1e3,step:1e3,disabled:t,onChange:e=>n({contextTokens:e})})})]})]})}function Ie(e){let{label:t,value:n,min:i,step:a,disabled:o,onChange:s}=e;return(0,q.jsxs)(`label`,{className:`space-y-2 text-sm font-medium text-gray-700`,children:[(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(N,{type:`number`,min:i,step:a,value:n,disabled:o,placeholder:r(`agentsAdvancedInheritPlaceholder`),"aria-label":t,onChange:e=>s(e.target.value)})]})}function Le(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:Re(e.contextTokens)}}function Re(e){return typeof e==`number`?String(e):``}var ze=K.forwardRef(({className:e,...t},n)=>(0,q.jsx)(`textarea`,{className:i(`flex min-h-28 w-full rounded-xl border border-border/75 bg-card px-3.5 py-2.5 text-sm text-foreground placeholder:text-muted-foreground/55 placeholder:font-normal transition-colors focus:outline-none focus:ring-0 focus:border-border disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));ze.displayName=`Textarea`;function Be(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=f(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:h(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function Ve({value:e,disabled:t=!1,runtimeOptions:n,defaultRuntime:i,onChange:a}){let o=e.trim()?f(e):``,s=Be({runtimeOptions:n,currentRuntime:e}),c=s.find(e=>e.value===o)??null,l=c?.reasonMessage?.trim()||(c?.ready===!1?r(`agentsRuntimeUnavailableHelp`):``);return(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsxs)(ge,{value:o||i,onValueChange:e=>a(e===i?``:e),disabled:t,children:[(0,q.jsx)(pe,{"aria-label":r(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,q.jsx)(fe,{placeholder:r(`agentsRuntimeSelectPlaceholder`)})}),(0,q.jsx)(me,{className:`rounded-xl`,children:s.map(e=>(0,q.jsx)(he,{value:e.value,disabled:e.ready===!1&&e.value!==o,className:`rounded-lg`,children:e.label},e.value))})]}),l?(0,q.jsx)(`p`,{className:`text-xs text-gray-500`,children:l}):null]})}function He({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,q.jsx)(L,{open:e!==null,onOpenChange:a,children:e?(0,q.jsx)(Ue,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function Ue(e){let{agent:t,pending:n,providerCatalog:i,runtimeOptions:a,defaultRuntime:o,onOpenChange:s,onSubmit:c}=e,[l,u]=(0,K.useState)(Le(t));return(0,q.jsxs)(z,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-[linear-gradient(180deg,#fff9f1_0%,#ffffff_24%)] p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,q.jsx)(`div`,{className:`shrink-0 border-b border-[#f0e2c8] px-6 py-6`,children:(0,q.jsxs)(R,{className:`text-left`,children:[(0,q.jsx)(B,{children:r(`agentsEditDialogTitle`)}),(0,q.jsx)(I,{children:r(`agentsEditDialogDescription`)})]})}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(ve,{tone:`warning`,title:r(`agentsEditHomeReadonly`),description:r(`agentsEditHomeReadonlyHint`),children:(0,q.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,q.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,q.jsx)(N,{value:l.displayName,onChange:e=>u(t=>({...t,displayName:e.target.value})),placeholder:r(`agentsFormNamePlaceholder`)}),(0,q.jsx)(ze,{value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),placeholder:r(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,q.jsx)(N,{value:l.avatar,onChange:e=>u(t=>({...t,avatar:e.target.value})),placeholder:r(`agentsFormAvatarPlaceholder`)}),(0,q.jsx)(_e,{value:l.model,onChange:e=>u(t=>({...t,model:e})),providerCatalog:i,disabled:n,className:`md:col-span-2`}),(0,q.jsx)(Ve,{value:l.runtime,onChange:e=>u(t=>({...t,runtime:e})),runtimeOptions:a,defaultRuntime:o,disabled:n})]}),(0,q.jsx)(Fe,{form:l,disabled:n,onChange:e=>u(t=>({...t,...e}))})]})}),(0,q.jsxs)(F,{className:`shrink-0 border-t border-[#f1e7d4] px-6 py-5`,children:[(0,q.jsx)(k,{type:`button`,variant:`ghost`,onClick:()=>s(!1),disabled:n,children:r(`cancel`)}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>c(t.id,l),disabled:n,children:[(0,q.jsx)(O,{className:`mr-2 h-4 w-4`}),r(`agentsEditSaveAction`)]})]})]})}var We=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function Ge(e,t){let n=e.trim();if(!n)return null;let i=Number(n);if(!Number.isFinite(i))throw Error(r(`agentsAdvancedInvalidNumberError`));return Math.max(t,Math.trunc(i))}function Ke(e){return{displayName:e.displayName,description:e.description,avatar:e.avatar,model:e.model,...e.runtime.trim()?{runtime:e.runtime.trim()}:{runtime:``},contextTokens:Ge(e.contextTokens,1e3)}}function qe(e){let{agentCount:t,onCreate:n}=e;return(0,q.jsxs)(`section`,{className:`flex flex-col gap-3 border-b border-gray-200 pb-4 sm:flex-row sm:items-end sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-xl font-semibold text-gray-950`,children:r(`agentsHeroEyebrow`)}),(0,q.jsx)(`span`,{className:`rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs font-medium text-gray-500`,children:t})]}),(0,q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-gray-500`,children:r(`agentsHeroDescription`)})]}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:n,children:[(0,q.jsx)(V,{className:`mr-2 h-4 w-4`}),r(`agentsCreateButton`)]})]})}function $(e){let{icon:t,label:n,disabled:r=!1,destructive:a=!1,onClick:o}=e;return(0,q.jsxs)(`button`,{type:`button`,className:i(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,a?`text-destructive hover:bg-destructive/10`:`text-gray-700 hover:bg-gray-100`),onClick:o,disabled:r,children:[(0,q.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,q.jsx)(`span`,{children:n})]})}function Je(e){let{agent:t,runtimeOptions:n,defaultRuntimeLabel:i,updatePending:s,deletePending:c,onStartChat:l,onView:u,onEdit:d,onDelete:p}=e,m=t.runtime?.trim()||t.engine?.trim()||``,g=m?n.find(e=>e.value===f(m))?.label??h(m):i;return(0,q.jsx)(j,{className:`group overflow-hidden border border-gray-200 bg-white shadow-none transition-colors duration-200 hover:border-gray-300`,children:(0,q.jsxs)(M,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,q.jsx)(o,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-950`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,q.jsxs)(Ee,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,q.jsx)(a,{className:`h-3 w-3`}),r(`agentsCardBuiltInTag`)]}):null]}),(0,q.jsxs)(`div`,{className:`truncate text-xs text-gray-400`,children:[`@`,t.id]})]})]}),(0,q.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":r(`agentsCardStartChat`),title:r(`agentsCardStartChat`),onClick:l,children:(0,q.jsx)(E,{className:`h-4 w-4`})}),(0,q.jsxs)(ue,{children:[(0,q.jsx)(P,{asChild:!0,children:(0,q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":r(`chatSessionMoreActions`),title:r(`chatSessionMoreActions`),children:(0,q.jsx)(be,{className:`h-4 w-4`})})}),(0,q.jsxs)(le,{align:`end`,className:`w-44 p-1.5`,children:[(0,q.jsx)($,{icon:Se,label:r(`agentsViewDetailsAction`),onClick:u}),(0,q.jsx)($,{icon:O,label:r(`agentsEditAction`),onClick:d,disabled:s}),t.builtIn?null:(0,q.jsx)($,{icon:we,label:r(`agentsRemoveAction`),onClick:p,disabled:c,destructive:!0})]})]})]}),(0,q.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-gray-600`,children:t.description?.trim()||(t.builtIn?r(`agentsCardBuiltInSummary`):r(`agentsCardCustomSummary`))}),(0,q.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-gray-100 pt-2 text-xs text-gray-500`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(H,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:g})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(ne,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function Ye(){let e=g(),t=w(),n=te(),i=c(),a=W(),o=G(),s=U(),l=T(),u=ie(),d=m(),[ee,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),b=(0,K.useMemo)(()=>i.data?.agents??[],[i.data?.agents]),x=(0,K.useMemo)(()=>[...b].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[b]),ne=(0,K.useMemo)(()=>Te({config:a.data,providersView:o.data,templatesView:s.data,onlyConfigured:!0}),[a.data,o.data,s.data]),S=(0,K.useMemo)(()=>re(l.data?.options??[]),[l.data?.options]),E=(0,K.useMemo)(()=>f(l.data?.defaultType??`native`),[l.data?.defaultType]),D=(0,K.useMemo)(()=>S.find(e=>e.value===E)?.label??h(E),[E,S]),O=a.data?.agents.defaults,A=e=>{_(e)},N=e=>{y(e)},oe=async(e,t)=>{let n;try{n=Ke(t)}catch(e){ae.error(e instanceof Error?e.message:r(`agentsAdvancedParseFailed`));return}await u.mutateAsync({agentId:e,data:n}),y(null)},ce=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,p(t,E))},P=()=>{n(`/chat`),t.chatDraftIntentManager.requestDraft(We)};return(0,q.jsxs)(se,{className:`space-y-5`,children:[(0,q.jsx)(qe,{agentCount:b.length,onCreate:P}),(0,q.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:i.isLoading?(0,q.jsx)(j,{className:`md:col-span-2 xl:col-span-3 border-dashed border-[#d9dce3] bg-white/70`,children:(0,q.jsx)(M,{className:`py-14 text-center text-sm text-gray-500`,children:r(`agentsLoading`)})}):x.length===0?(0,q.jsx)(j,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-[#d9dce3] bg-[linear-gradient(135deg,#fff7ea_0%,#f4fbff_100%)]`,children:(0,q.jsxs)(M,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,q.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-white/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,q.jsx)(C,{className:`h-8 w-8 text-[#d39a3b]`})}),(0,q.jsx)(`div`,{className:`text-lg font-semibold text-[#2f2212]`,children:r(`agentsEmpty`)}),(0,q.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-[#78644d]`,children:r(`agentsEmptyDescription`)}),(0,q.jsxs)(k,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:P,children:[(0,q.jsx)(V,{className:`mr-2 h-4 w-4`}),r(`agentsCreateButton`)]})]})}):x.map(e=>(0,q.jsx)(Je,{agent:e,runtimeOptions:S,defaultRuntimeLabel:D,updatePending:u.isPending,deletePending:d.isPending,onStartChat:()=>ce(e),onView:()=>A(e),onEdit:()=>N(e),onDelete:()=>d.mutate({agentId:e.id})},e.id))}),(0,q.jsx)(ke,{agent:ee,defaults:O,runtimeOptions:S,defaultRuntime:E,defaultRuntimeLabel:D,onOpenChange:e=>{e||_(null)},onEdit:e=>{_(null),y(e)}}),(0,q.jsx)(He,{agent:v,pending:u.isPending,providerCatalog:ne,runtimeOptions:S,defaultRuntime:E,onOpenChange:e=>{!e&&!u.isPending&&y(null)},onSubmit:oe})]})}function Xe(e){let{view:t,routeSessionKey:n,syncRouteSessionSelection:r}=e;(0,K.useEffect)(()=>{r({isChatView:t===`chat`,routeSessionKey:n})},[n,r,t])}function Ze({view:e,confirmDialog:t}){let{isMobile:n}=Ce();return(0,q.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,q.jsx)(S,{}),e===`chat`?n?(0,q.jsx)(b,{}):(0,q.jsx)(ee,{}):(0,q.jsx)(`section`,{className:`flex-1 min-h-0 overflow-hidden bg-background`,children:e===`cron`?(0,q.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1120px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,q.jsx)(s,{})})}):e===`agents`?(0,q.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1180px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,q.jsx)(Ye,{})})}):(0,q.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,q.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-[min(1120px,100%)] flex-col px-4 py-4 sm:px-6 sm:py-5`,children:(0,q.jsx)(De,{forcedType:`skills`})})})}),t]})}function Qe(e){let t=g(),n=W(),r=G(),i=U(),a=u({limit:200}),o=T(),s=e.sessionKey?.trim()||`draft-session`,c=l({sessionId:s});(0,K.useEffect)(()=>{t.chatQueryManager.syncSnapshot({configQuery:n,providersQuery:r,providerTemplatesQuery:i,sessionsQuery:a,sessionTypesQuery:o,sessionSkillsSessionId:s,sessionSkillsQuery:c})},[n,t.chatQueryManager,r,s,c,a,o,i])}function $e(){let e=g();(0,K.useEffect)(()=>oe.eventBus.on(A.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function et(){let{sessionId:e}=_(),t=(0,K.useMemo)(()=>v(e),[e]);return{routeSessionKey:t,sessionKey:t??void 0}}function tt(){let e=g(),{confirm:t,ConfirmDialog:n}=ye(),r=x(),i=te();return(0,K.useEffect)(()=>{e.chatUiManager.syncState({pathname:r.pathname}),e.chatUiManager.bindActions({navigate:i,confirm:t})},[t,r.pathname,i,e]),(0,q.jsx)(n,{})}function nt({view:e}){let t=w();return(0,q.jsx)(d,{presenter:(0,K.useMemo)(()=>new D(t),[t]),children:(0,q.jsx)(rt,{view:e})})}function rt({view:e}){let t=g(),n=tt(),{routeSessionKey:r,sessionKey:i}=et();return Qe({sessionKey:i??null}),Xe({view:e,routeSessionKey:r,syncRouteSessionSelection:t.chatSessionListManager.syncRouteSessionSelection}),$e(),(0,q.jsx)(Ze,{view:e,confirmDialog:n})}function it({view:e}){return(0,q.jsx)(nt,{view:e})}export{it as ChatPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";var t=class{constructor(e){this.init=e,this.records=this.init()}static{e(this,`ImperativeState`)}reset(){this.records=this.init()}};export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{p as t}from"./src-Dad2ZbCt.js";import{j as n}from"./chunk-WYO6CB5R-Do6SJrnY.js";import{t as r}from"./dist-dw-gAfM_.js";var i=r(),a=e((e,t)=>{let n=e.append(`rect`);if(n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),t.name&&n.attr(`name`,t.name),t.rx&&n.attr(`rx`,t.rx),t.ry&&n.attr(`ry`,t.ry),t.attrs!==void 0)for(let e in t.attrs)n.attr(e,t.attrs[e]);return t.class&&n.attr(`class`,t.class),n},`drawRect`),o=e((e,t)=>{a(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:`rect`}).lower()},`drawBackgroundRect`),s=e((e,t)=>{let r=t.text.replace(n,` `),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.attr(`class`,`legend`),i.style(`text-anchor`,t.anchor),t.class&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.text(r),i},`drawText`),c=e((e,t,n,r)=>{let a=e.append(`image`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,o)},`drawImage`),l=e((e,t,n,r)=>{let a=e.append(`use`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,`#${o}`)},`drawEmbeddedImage`),u=e(()=>({x:0,y:0,width:100,height:100,fill:`#EDF2AE`,stroke:`#666`,anchor:`start`,rx:0,ry:0}),`getNoteRect`),d=e(()=>({x:0,y:0,width:100,height:100,"text-anchor":`start`,style:`#666`,textMargin:0,rx:0,ry:0,tspan:!0}),`getTextObj`),f=e(()=>{let e=t(`.mermaidTooltip`);return e.empty()&&(e=t(`body`).append(`div`).attr(`class`,`mermaidTooltip`).style(`opacity`,0).style(`position`,`absolute`).style(`text-align`,`center`).style(`max-width`,`200px`).style(`padding`,`2px`).style(`font-size`,`12px`).style(`background`,`#ffffde`).style(`border`,`1px solid #333`).style(`border-radius`,`2px`).style(`pointer-events`,`none`).style(`z-index`,`100`)),e},`createTooltip`);export{a,d as c,c as i,o as n,s as o,l as r,u as s,f as t};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{m as t,p as n}from"./src-Dad2ZbCt.js";import{T as r,b as i,x as a}from"./chunk-WYO6CB5R-Do6SJrnY.js";import{$ as o,J as s,K as c,Q as l,X as u,Y as d,Z as f,et as p,g as m,nt as h,q as g,rt as _,tt as v,u as y}from"./chunk-ICXQ74PX-DH8NJMok.js";import{t as b}from"./line-B78frP_c.js";import{n as x}from"./chunk-Q4XR5HBZ-uvIGstBS.js";import{i as S,n as ee,r as C,t as w}from"./chunk-7BUUIJ7U-JiyRtrGu.js";import{n as T}from"./chunk-OGEWGWER-TIcEoPPH.js";import{i as E,n as D}from"./chunk-C7G6YPKG-AsyDSQ9j.js";import{t as te}from"./rough.esm-wJ1d3nQl.js";import{r as O}from"./chunk-ZGVPDNZ5-B7kWWaXv.js";var ne=e((e,t,n,r,i,a=!1,o)=>{t.arrowTypeStart&&j(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&j(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),k={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},A=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],j=e((e,n,r,i,a,o,s=!1,c)=>{let l=k[r],u=l&&A.includes(l.type);if(!l){t.warn(`Unknown arrow type: ${r}`);return}let d=`${a}_${o}-${l.type}${n===`start`?`Start`:`End`}${s&&u?`-margin`:``}`;if(c&&c.trim()!==``){let t=`${d}_${c.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(t)){let e=document.getElementById(d);if(e){let n=e.cloneNode(!0);n.id=t,n.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,c),l.fill&&e.setAttribute(`fill`,c)}),e.parentNode?.appendChild(n)}}e.attr(`marker-${n}`,`url(${i}#${t})`)}else e.attr(`marker-${n}`,`url(${i}#${d})`)},`addEdgeMarker`),re=e(e=>typeof e==`string`?e:a()?.flowchart?.curve,`resolveEdgeCurveType`),M=new Map,N=new Map,P=e(()=>{M.clear(),N.clear()},`clear`),F=e(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),I=e(async(e,i)=>{let o=a(),s=r(o),{labelStyles:c}=E(i);i.labelStyle=c;let l=e.insert(`g`).attr(`class`,`edgeLabel`),u=l.insert(`g`).attr(`class`,`label`).attr(`data-id`,i.id),d=i.labelType===`markdown`,f=await x(e,i.label,{style:F(i.labelStyle),useHtmlLabels:s,addSvgBackground:!0,isNode:!1,markdown:d,width:void 0},o);u.node().appendChild(f),t.info(`abc82`,i,i.labelType);let p=f.getBBox(),m=p;if(s){let e=f.children[0],t=n(f);p=e.getBoundingClientRect(),m=p,t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=n(f).select(`text`).node();e&&typeof e.getBBox==`function`&&(m=e.getBBox())}u.attr(`transform`,w(m,s)),M.set(i.id,l),i.width=p.width,i.height=p.height;let h;if(i.startLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await O(r,i.startLabelLeft,F(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,w(o,s)),N.get(i.id)||N.set(i.id,{}),N.get(i.id).startLeft=t,L(h,i.startLabelLeft)}if(i.startLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await O(r,i.startLabelRight,F(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,w(o,s)),N.get(i.id)||N.set(i.id,{}),N.get(i.id).startRight=t,L(h,i.startLabelRight)}if(i.endLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await O(t,i.endLabelLeft,F(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,w(o,s)),N.get(i.id)||N.set(i.id,{}),N.get(i.id).endLeft=t,L(h,i.endLabelLeft)}if(i.endLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await O(t,i.endLabelRight,F(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,w(o,s)),N.get(i.id)||N.set(i.id,{}),N.get(i.id).endRight=t,L(h,i.endLabelRight)}return f},`insertEdgeLabel`);function L(e,t){r(a())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}e(L,`setTerminalWidth`);var R=e((e,n)=>{t.debug(`Moving label abc88 `,e.id,e.label,M.get(e.id),n);let r=n.updatedPath?n.updatedPath:n.originalPath,{subGraphTitleTotalMargin:i}=T(a());if(e.label){let a=M.get(e.id),o=e.x,s=e.y;if(r){let i=m.calcLabelPosition(r);t.debug(`Moving label `+e.label+` from (`,o,`,`,s,`) to (`,i.x,`,`,i.y,`) abc88`),n.updatedPath&&(o=i.x,s=i.y)}a.attr(`transform`,`translate(${o}, ${s+i/2})`)}if(e.startLabelLeft){let t=N.get(e.id).startLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.startLabelRight){let t=N.get(e.id).startRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelLeft){let t=N.get(e.id).endLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelRight){let t=N.get(e.id).endRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}},`positionEdgeLabel`),ie=e((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith(`-to-label`)||!Array.isArray(t)||t.length!==2)return t;let[n,r]=t,i=Math.abs(r.x-n.x),a=Math.abs(r.y-n.y);return i<.001||a<.001?t:a>=i?[n,{x:n.x,y:r.y},r]:[n,{x:r.x,y:n.y},r]},`orthogonalizeToLabelClippedPoints`),z=e((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),B=e((e,n,r)=>{t.debug(`intersection calc abc89:
|
|
2
|
+
outsidePoint: ${JSON.stringify(n)}
|
|
3
|
+
insidePoint : ${JSON.stringify(r)}
|
|
4
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2,c=r.x<n.x?s-o:s+o,l=e.height/2,u=Math.abs(n.y-r.y),d=Math.abs(n.x-r.x);if(Math.abs(a-n.y)*s>Math.abs(i-n.x)*l){let e=r.y<n.y?n.y-l-a:a-l-n.y;c=d*e/u;let i={x:r.x<n.x?r.x+c:r.x-d+c,y:r.y<n.y?r.y+u-e:r.y-u+e};return c===0&&(i.x=n.x,i.y=n.y),d===0&&(i.x=n.x),u===0&&(i.y=n.y),t.debug(`abc89 top/bottom calc, Q ${u}, q ${e}, R ${d}, r ${c}`,i),i}else{c=r.x<n.x?n.x-s-i:i-s-n.x;let e=u*c/d,a=r.x<n.x?r.x+d-c:r.x-d+c,o=r.y<n.y?r.y+e:r.y-e;return t.debug(`sides calc abc89, Q ${u}, q ${e}, R ${d}, r ${c}`,{_x:a,_y:o}),c===0&&(a=n.x,o=n.y),d===0&&(a=n.x),u===0&&(o=n.y),{x:a,y:o}}},`intersection`),V=e((e,n)=>{t.warn(`abc88 cutPathAtIntersect`,e,n);let r=[],i=e[0],a=!1;return e.forEach(e=>{if(t.info(`abc88 checking point`,e,n),!z(n,e)&&!a){let o=B(n,i,e);t.debug(`abc88 inside`,e,i,o),t.debug(`abc88 intersection`,o,n);let s=!1;r.forEach(e=>{s||=e.x===o.x&&e.y===o.y}),r.some(e=>e.x===o.x&&e.y===o.y)?t.warn(`abc88 no intersect`,o,r):r.push(o),a=!0}else t.warn(`abc88 outside`,e,i),i=e,a||r.push(e)}),t.debug(`returning points`,r),r},`cutPathAtIntersect`);function H(e){let t=[],n=[];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1];(i.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}e(H,`extractCornerPoints`);var U=e(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),ae=e(function(e){let{cornerPointPositions:n}=H(e),r=[];for(let i=0;i<e.length;i++)if(n.includes(i)){let n=e[i-1],a=e[i+1],o=e[i],s=U(n,o,5),c=U(a,o,5),l=c.x-s.x,u=c.y-s.y;r.push(s);let d=Math.sqrt(2)*2,f={x:o.x,y:o.y};Math.abs(a.x-n.x)>10&&Math.abs(a.y-n.y)>=10?(t.debug(`Corner point fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),f=o.x===s.x?{x:l<0?s.x-5+d:s.x+5-d,y:u<0?s.y-d:s.y+d}:{x:l<0?s.x-d:s.x+d,y:u<0?s.y-5+d:s.y+5-d}):t.debug(`Corner point skipping fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),r.push(f,c)}else r.push(e[i]);return r},`fixCorners`),oe=e((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(i).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),W=e(function(e,r,i,x,C,w,T,E=!1){if(!T)throw Error(`insertEdge: missing diagramId for edge "${r.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:O,layout:k}=a(),A=r.points,j=!1,M=C;var N=w;let P=[];for(let e in r.cssCompiledStyles)D(e)||P.push(r.cssCompiledStyles[e]);if(k===`swimlane`){if(N.intersect&&M.intersect&&Array.isArray(A)&&A.length>=2)if(A.length===2)A=[M.intersect(A[0]),N.intersect(A[1])];else{let e=A.slice(1,-1),t=e[0],n=e[e.length-1],r=.5,i=Math.abs(A[A.length-1].x-n.x)<r&&Math.abs(A[A.length-1].y-n.y)<r,a=M.intersect(t),o=i?n:N.intersect(n),s=Math.abs(o.x-n.x)<r&&Math.abs(o.y-n.y)<r,c=Math.abs(a.x-t.x)<r&&Math.abs(a.y-t.y)<r?[]:[a],l=s?[]:[o];A=[...c,...e,...l]}A=ie(r,A)}else N.intersect&&M.intersect&&!E&&(A=A.slice(1,r.points.length-1),A.unshift(M.intersect(A[0])),A.push(N.intersect(A[A.length-1])));let F=btoa(JSON.stringify(A));r.toCluster&&(t.info(`to cluster abc88`,i.get(r.toCluster)),A=V(r.points,i.get(r.toCluster).node),j=!0),r.fromCluster&&(t.debug(`from cluster abc88`,i.get(r.fromCluster),JSON.stringify(A,null,2)),A=V(A.reverse(),i.get(r.fromCluster).node).reverse(),j=!0);let I=A.filter(e=>!Number.isNaN(e.y)),L=re(r.curve);L!==`rounded`&&(I=ae(I));let R=_;switch(L){case`linear`:R=_;break;case`basis`:R=p;break;case`cardinal`:R=o;break;case`bumpX`:R=v;break;case`bumpY`:R=h;break;case`catmullRom`:R=l;break;case`monotoneX`:R=u;break;case`monotoneY`:R=f;break;case`natural`:R=d;break;case`step`:R=s;break;case`stepAfter`:R=c;break;case`stepBefore`:R=g;break;case`rounded`:R=_;break;default:R=p}let{x:z,y:B}=ee(r),H=b().x(z).y(B).curve(R),U;switch(r.thickness){case`normal`:U=`edge-thickness-normal`;break;case`thick`:U=`edge-thickness-thick`;break;case`invisible`:U=`edge-thickness-invisible`;break;default:U=`edge-thickness-normal`}switch(r.pattern){case`solid`:U+=` edge-pattern-solid`;break;case`dotted`:U+=` edge-pattern-dotted`;break;case`dashed`:U+=` edge-pattern-dashed`;break;default:U+=` edge-pattern-solid`}let W,K=L===`rounded`?G(q(I,r),5):H(I),J=Array.isArray(r.style)?r.style:[r.style],Y=J.find(e=>e?.startsWith(`stroke:`)),X=``;r.animate&&(X=`edge-animation-fast`),r.animation&&(X=`edge-animation-`+r.animation);let Z=!1;if(r.look===`handDrawn`){let t=te.svg(e);Object.assign([],I);let i=t.path(K,{roughness:.3,seed:O});U+=` transition`,W=n(i).select(`path`).attr(`id`,`${T}-${r.id}`).attr(`class`,` `+U+(r.classes?` `+r.classes:``)+(X?` `+X:``)).attr(`style`,J?J.reduce((e,t)=>e+`;`+t,``):``);let a=W.attr(`d`);W.attr(`d`,a),e.node().appendChild(W.node())}else{let t=P.join(`;`),n=J?J.reduce((e,t)=>e+t+`;`,``):``,i=(t?t+`;`+n+`;`:n)+`;`+(J?J.reduce((e,t)=>e+`;`+t,``):``);W=e.append(`path`).attr(`d`,K).attr(`id`,`${T}-${r.id}`).attr(`class`,` `+U+(r.classes?` `+r.classes:``)+(X?` `+X:``)).attr(`style`,i),Y=i.match(/stroke:([^;]+)/)?.[1],Z=r.animate===!0||!!r.animation||t.includes(`animation`);let a=W.node(),o=typeof a.getTotalLength==`function`?a.getTotalLength():0,s=S[r.arrowTypeStart]||0,c=S[r.arrowTypeEnd]||0;if(r.look===`neo`&&!Z){let e=`stroke-dasharray: ${r.pattern===`dotted`||r.pattern===`dashed`?oe(o,s,c):`0 ${s} ${o-s-c} ${c}`}; stroke-dashoffset: 0;`;W.attr(`style`,e+W.attr(`style`))}}W.attr(`data-edge`,!0),W.attr(`data-et`,`edge`),W.attr(`data-id`,r.id),W.attr(`data-points`,F),W.attr(`data-look`,y(r.look)),r.showPoints&&I.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let Q=``;(a().flowchart.arrowMarkerAbsolute||a().state.arrowMarkerAbsolute)&&(Q=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,Q=Q.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),t.info(`arrowTypeStart`,r.arrowTypeStart),t.info(`arrowTypeEnd`,r.arrowTypeEnd);let se=!Z&&r?.look===`neo`;ne(W,r,Q,T,x,se,Y);let ce=Math.floor(A.length/2),le=A[ce];m.isLabelCoordinateInPath(le,W.attr(`d`))||(j=!0);let $={};return j&&($.updatedPath=A),$.originalPath=r.points,$},`insertEdge`);function G(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a<r;a++){let o=e[a],s=e[a-1],c=e[a+1];if(a===0)n+=`M${o.x},${o.y}`;else if(a===r-1)n+=`L${o.x},${o.y}`;else{let e=o.x-s.x,r=o.y-s.y,a=c.x-o.x,l=c.y-o.y,u=Math.hypot(e,r),d=Math.hypot(a,l);if(u<i||d<i){n+=`L${o.x},${o.y}`;continue}let f=e/u,p=r/u,m=a/d,h=l/d,g=f*m+p*h,_=Math.acos(Math.max(-1,Math.min(1,g)));if(_<i||Math.abs(Math.PI-_)<i){n+=`L${o.x},${o.y}`;continue}let v=Math.min(t/Math.sin(_/2),u/2,d/2),y=o.x-f*v,b=o.y-p*v,x=o.x+m*v,S=o.y+h*v;n+=`L${y},${b}`,n+=`Q${o.x},${o.y} ${x},${S}`}}return n}e(G,`generateRoundedPath`);function K(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};let n=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,n),deltaX:n,deltaY:r}}e(K,`calculateDeltaAndAngle`);function q(e,t){let n=e.map(e=>({...e}));if(e.length>=2&&C[t.arrowTypeStart]){let r=C[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=K(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&C[t.arrowTypeEnd]){let i=C[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=K(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}e(q,`applyMarkerOffsetsToPoints`);var J=e((e,t,n,r)=>{t.forEach(t=>{Y[t](e,n,r)})},`insertMarkers`),Y={extension:e((e,n,r)=>{t.trace(`Making markers for `,r),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionStart`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd`).attr(`class`,`marker extension `+n).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,r+`_`+n+`-extensionStart-margin`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd-margin`).attr(`class`,`marker extension `+n).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:e((e,t,n)=>{let{themeVariables:r}=i(),{transitionColor:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${a}`)},`barbNeo`),only_one:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${a}`)},`only_one_neo`),zero_or_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),s.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),c.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${a}`)},`zero_or_one_neo`),one_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${a}`)},`one_or_more_neo`),zero_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),s.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),c.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${a}`)},`zero_or_more_neo`),requirement_arrow:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0
|
|
5
|
+
L20,10
|
|
6
|
+
M20,10
|
|
7
|
+
L0,20`)},`requirement_arrow`),requirement_contains:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${a}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0
|
|
8
|
+
L20,10
|
|
9
|
+
M20,10
|
|
10
|
+
L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);o.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),o.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),o.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),o.selectAll(`*`).attr(`stroke-width`,`${a}`)},`requirement_contains_neo`)},X=J;export{X as a,I as i,M as n,R as o,W as r,N as s,P as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,b as n,n as r,o as i,u as a,w as o,x as s}from"./chunk-KEIR6QF5-A3jEqwzn.js";var c=class extends r{static{s(this,`WardleyValueConverter`)}runCustomConverter(e,t,n){switch(e.name.toUpperCase()){case`LINK_LABEL`:return t.substring(1).trim();default:return}}},l={parser:{ValueConverter:s(()=>new c,`ValueConverter`)}};function u(r=i){let s=o(e(r),a),c=o(t({shared:s}),n,l);return s.ServiceRegistry.register(c),{shared:s,Wardley:c}}s(u,`createWardleyServices`);export{u as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,m as n,n as r,o as i,t as a,u as o,w as s,x as c}from"./chunk-KEIR6QF5-A3jEqwzn.js";var l=class extends a{static{c(this,`RailroadAbnfTokenBuilder`)}constructor(){super([`railroad-abnf-beta`])}},u=class extends r{static{c(this,`RailroadAbnfValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return e.slice(1,-1)}return r}runCustomConverter(e,t,n){if(e.name===`ABNF_STRING`)return t.slice(1,-1)}},d={parser:{TokenBuilder:c(()=>new l,`TokenBuilder`),ValueConverter:c(()=>new u,`ValueConverter`)}};function f(r=i){let a=s(e(r),o),c=s(t({shared:a}),n,d);return a.ServiceRegistry.register(c),{shared:a,RailroadAbnf:c}}c(f,`createRailroadAbnfServices`);export{f as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,i as n,o as r,s as i,t as a,u as o,w as s,x as c}from"./chunk-KEIR6QF5-A3jEqwzn.js";var l=class extends a{static{c(this,`EventModelingTokenBuilder`)}constructor(){super([`eventmodeling`])}},u=new Set([`cmd`,`command`]),d=new Set([`evt`,`event`]),f=new Set([`rmo`,`readmodel`]),p=new Set([`pcr`,`processor`]),m=new Set([`ui`]);function h(e){let t=e.validation.EventModelingValidator,n=e.validation.ValidationRegistry;if(n){let e={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};n.register(e,t)}}c(h,`registerValidationChecks`);var g=class{static{c(this,`EventModelingValidator`)}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(u.has(e.modelEntityType)?this.validateSources(e,new Set([...m,...p]),`command`,`ui or processor`,t):d.has(e.modelEntityType)?this.validateSources(e,u,`event`,`command`,t):f.has(e.modelEntityType)?this.validateSources(e,d,`read model`,`event`,t):p.has(e.modelEntityType)?this.validateSources(e,f,`processor`,`read model`,t):m.has(e.modelEntityType)&&this.validateSources(e,f,`ui`,`read model`,t))}validateSources(e,t,n,r,i){for(let a of e.sourceFrames){let o=a.ref;o!==void 0&&!t.has(o.modelEntityType)&&i(`error`,`A ${n} can only receive input from a ${r}, not from '${o.modelEntityType}'.`,{node:e,property:`sourceFrames`})}}},_={parser:{TokenBuilder:c(()=>new l,`TokenBuilder`),ValueConverter:c(()=>new n,`ValueConverter`)},validation:{EventModelingValidator:c(()=>new g,`EventModelingValidator`)}};function v(n=r){let a=s(e(n),o),c=s(t({shared:a}),i,_);return a.ServiceRegistry.register(c),h(c),{shared:a,EventModel:c}}c(v,`createEventModelingServices`);export{v as n,_ as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{C as e,S as t,g as n,n as r,o as i,t as a,u as o,w as s,x as c}from"./chunk-KEIR6QF5-A3jEqwzn.js";var l=class extends a{static{c(this,`RailroadTokenBuilder`)}constructor(){super([`railroad-beta`])}},u=c(e=>{let t=e.slice(1,-1),n=``;for(let e=0;e<t.length;e++){let r=t[e];if(r===`\\`&&e+1<t.length){e++;let r=t[e];switch(r){case`n`:n+=`
|
|
2
|
+
`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;default:n+=r}continue}n+=r}return n},`decodeEscapedString`),d=class extends r{static{c(this,`RailroadValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return u(e)}return r}runCustomConverter(e,t,n){if(e.name===`RR_STRING`)return u(t)}},f={parser:{TokenBuilder:c(()=>new l,`TokenBuilder`),ValueConverter:c(()=>new d,`ValueConverter`)}};function p(r=i){let a=s(e(r),o),c=s(t({shared:a}),n,f);return a.ServiceRegistry.register(c),{shared:a,Railroad:c}}c(p,`createRailroadServices`);export{p as n,f as t};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";var t=e(()=>`
|
|
2
|
+
/* Font Awesome icon styling - consolidated */
|
|
3
|
+
.label-icon {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
height: 1em;
|
|
6
|
+
overflow: visible;
|
|
7
|
+
vertical-align: -0.125em;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.node .label-icon path {
|
|
11
|
+
fill: currentColor;
|
|
12
|
+
stroke: revert;
|
|
13
|
+
stroke-width: revert;
|
|
14
|
+
}
|
|
15
|
+
`,`getIconStyles`);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";var t=e((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),n={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},r={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function i(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=a(e),t=a(t);let[n,r]=[e.x,e.y],[i,o]=[t.x,t.y],s=i-n,c=o-r;return{angle:Math.atan(c/s),deltaX:s,deltaY:c}}e(i,`calculateDeltaAndAngle`);var a=e(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),o=e(t=>({x:e(function(e,r,o){let s=0,c=a(o[0]).x<a(o[o.length-1]).x?`left`:`right`;if(r===0&&Object.hasOwn(n,t.arrowTypeStart)){let{angle:e,deltaX:r}=i(o[0],o[1]);s=n[t.arrowTypeStart]*Math.cos(e)*(r>=0?1:-1)}else if(r===o.length-1&&Object.hasOwn(n,t.arrowTypeEnd)){let{angle:e,deltaX:r}=i(o[o.length-1],o[o.length-2]);s=n[t.arrowTypeEnd]*Math.cos(e)*(r>=0?1:-1)}let l=Math.abs(a(e).x-a(o[o.length-1]).x),u=Math.abs(a(e).y-a(o[o.length-1]).y),d=Math.abs(a(e).x-a(o[0]).x),f=Math.abs(a(e).y-a(o[0]).y),p=n[t.arrowTypeStart],m=n[t.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`right`?-1:1,s-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`right`?-1:1,s+=e}return a(e).x+s},`x`),y:e(function(e,r,o){let s=0,c=a(o[0]).y<a(o[o.length-1]).y?`down`:`up`;if(r===0&&Object.hasOwn(n,t.arrowTypeStart)){let{angle:e,deltaY:r}=i(o[0],o[1]);s=n[t.arrowTypeStart]*Math.abs(Math.sin(e))*(r>=0?1:-1)}else if(r===o.length-1&&Object.hasOwn(n,t.arrowTypeEnd)){let{angle:e,deltaY:r}=i(o[o.length-1],o[o.length-2]);s=n[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(r>=0?1:-1)}let l=Math.abs(a(e).y-a(o[o.length-1]).y),u=Math.abs(a(e).x-a(o[o.length-1]).x),d=Math.abs(a(e).y-a(o[0]).y),f=Math.abs(a(e).x-a(o[0]).x),p=n[t.arrowTypeStart],m=n[t.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`up`?-1:1,s-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`up`?-1:1,s+=e}return a(e).y+s},`y`)}),`getLineFunctionsWithOffset`);export{r as i,o as n,n as r,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,i as n,l as r,o as i,t as a,u as o,w as s,x as c}from"./chunk-KEIR6QF5-A3jEqwzn.js";var l=class extends a{static{c(this,`InfoTokenBuilder`)}constructor(){super([`info`,`showInfo`])}},u={parser:{TokenBuilder:c(()=>new l,`TokenBuilder`),ValueConverter:c(()=>new n,`ValueConverter`)}};function d(n=i){let a=s(e(n),o),c=s(t({shared:a}),r,u);return a.ServiceRegistry.register(c),{shared:a,Info:c}}c(d,`createInfoServices`);export{d as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{x as t}from"./chunk-WYO6CB5R-Do6SJrnY.js";var n=e(e=>{let{handDrawnSeed:n}=t();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:n}},`solidStateFill`),r=e(e=>{let t=i([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},`compileStyles`),i=e(e=>{let t=new Map;return e.forEach(e=>{let[n,r]=e.split(`:`);t.set(n.trim(),r?.trim())}),t},`styles2Map`),a=e(e=>e===`color`||e===`font-size`||e===`font-family`||e===`font-weight`||e===`font-style`||e===`text-decoration`||e===`text-align`||e===`text-transform`||e===`line-height`||e===`letter-spacing`||e===`word-spacing`||e===`text-shadow`||e===`text-overflow`||e===`white-space`||e===`word-wrap`||e===`word-break`||e===`overflow-wrap`||e===`hyphens`,`isLabelStyle`),o=e(e=>{let{stylesArray:t}=r(e),n=[],i=[],o=[],s=[];return t.forEach(e=>{let t=e[0];a(t)?n.push(e.join(`:`)+` !important`):(i.push(e.join(`:`)+` !important`),t.includes(`stroke`)&&o.push(e.join(`:`)+` !important`),t===`fill`&&s.push(e.join(`:`)+` !important`))}),{labelStyles:n.join(`;`),nodeStyles:i.join(`;`),stylesArray:t,borderStyles:o,backgroundStyles:s}},`styles2String`),s=e((e,n)=>{let{themeVariables:i,handDrawnSeed:a}=t(),{nodeBorder:o,mainBkg:s}=i,{stylesMap:l}=r(e);return Object.assign({roughness:.7,fill:l.get(`fill`)||s,fillStyle:`hachure`,fillWeight:4,hachureGap:5.2,stroke:l.get(`stroke`)||o,seed:a,strokeWidth:l.get(`stroke-width`)?.replace(`px`,``)||1.3,fillLineDash:[0,0],strokeLineDash:c(l.get(`stroke-dasharray`))},n)},`userNodeOverrides`),c=e(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let e=isNaN(t[0])?0:t[0];return[e,e]}return[isNaN(t[0])?0:t[0],isNaN(t[1])?0:t[1]]},`getStrokeDashArray`);export{s as a,o as i,a as n,n as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,n,o as r,t as i,u as a,v as o,w as s,x as c}from"./chunk-KEIR6QF5-A3jEqwzn.js";var l=class extends n{static{c(this,`TreeViewValueConverter`)}runCustomConverter(e,t,n){if(e.name===`INDENTATION`)return t?.length||0;if(e.name===`QUOTED_NAME`)return t.substring(1,t.length-1);if(e.name===`BARE_NAME`)return t.replace(/[\t ]+$/,``);if(e.name===`CLASS_ANNOTATION`)return t.trim().substring(3).trim();if(e.name===`ICON_ANNOTATION`){let e=t.trim();return e.substring(5,e.length-1)}if(e.name===`DESC_ANNOTATION`)return t.trim().substring(2).trim()}},u=class extends i{static{c(this,`TreeViewTokenBuilder`)}constructor(){super([`treeView-beta`])}},d={parser:{TokenBuilder:c(()=>new u,`TokenBuilder`),ValueConverter:c(()=>new l,`ValueConverter`)}};function f(n=r){let i=s(e(n),a),c=s(t({shared:i}),o,d);return i.ServiceRegistry.register(c),{shared:i,TreeView:c}}c(f,`createTreeViewServices`);export{f as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,c as n,i as r,o as i,t as a,u as o,w as s,x as c}from"./chunk-KEIR6QF5-A3jEqwzn.js";var l=class extends a{static{c(this,`GitGraphTokenBuilder`)}constructor(){super([`gitGraph`])}},u={parser:{TokenBuilder:c(()=>new l,`TokenBuilder`),ValueConverter:c(()=>new r,`ValueConverter`)}};function d(r=i){let a=s(e(r),o),c=s(t({shared:a}),n,u);return a.ServiceRegistry.register(c),{shared:a,GitGraph:c}}c(d,`createGitGraphServices`);export{d as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,d as n,i as r,o as i,t as a,u as o,w as s,x as c}from"./chunk-KEIR6QF5-A3jEqwzn.js";var l=class extends a{static{c(this,`PacketTokenBuilder`)}constructor(){super([`packet`])}},u={parser:{TokenBuilder:c(()=>new l,`TokenBuilder`),ValueConverter:c(()=>new r,`ValueConverter`)}};function d(r=i){let a=s(e(r),o),c=s(t({shared:a}),n,u);return a.ServiceRegistry.register(c),{shared:a,Packet:c}}c(d,`createPacketServices`);export{d as n,u as t};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{m as t,p as n}from"./src-Dad2ZbCt.js";import{$ as r,H as i,K as a,U as o,a as s,s as c,v as l,w as u,x as d,y as f}from"./chunk-WYO6CB5R-Do6SJrnY.js";import{g as p,s as m}from"./chunk-ICXQ74PX-DH8NJMok.js";import{t as h}from"./chunk-32BRIVSS-kG3lg0bC.js";import{t as g}from"./chunk-XXDRQBXY-C2QjjwYX.js";import{t as _}from"./chunk-VR4S4FIN-BAUbR0ke.js";import{r as v}from"./chunk-FWX5IMBZ-DFelpZBy.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,7]),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(A,[2,11]),t(A,[2,12],{14:[1,40],15:[1,41]}),t(A,[2,16]),{18:[1,42]},t(A,[2,18],{20:[1,43]}),{23:[1,44]},t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(A,[2,28]),{34:[1,49]},{36:[1,50]},t(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(j,[2,44],{58:[1,56]}),t(j,[2,45],{58:[1,57]}),t(A,[2,38]),t(A,[2,39]),t(A,[2,40]),t(A,[2,41]),t(A,[2,6]),t(A,[2,13]),{13:58,24:f,57:k},t(A,[2,17]),t(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(A,[2,29]),t(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(A,[2,34]),t(A,[2,35]),t(A,[2,36]),t(A,[2,37]),t(j,[2,46]),t(j,[2,47]),t(A,[2,15]),t(A,[2,19]),t(M,a,{7:78}),t(A,[2,26]),t(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,32]),t(A,[2,33]),t(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};N.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(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
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(t,n,r,i){function a(){let e=n.yytext.indexOf(`%%`);if(e===0)return!1;if(e>0){let r=n.yytext.slice(0,e),i=n.yytext.slice(e);i&&t.lexer.unput(i),n.yytext=r}return!0}switch(e(a,`processId`),r){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return a()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+n.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return a()?(this.popState(),`ID`):void 0;case 66:return a()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return a()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function P(){this.yy={}}return e(P,`Parser`),P.prototype=N,N.Parser=P,new P})();y.parser=y;var b=y,x=`TB`,S=`TB`,C=`dir`,w=`state`,T=`root`,E=`relation`,D=`classDef`,O=`style`,k=`applyClass`,A=`default`,j=`divider`,M=`fill:none`,N=`fill: #333`,P=`c`,ee=`markdown`,F=`normal`,I=`rect`,L=`rectWithTitle`,te=`stateStart`,ne=`stateEnd`,R=`divider`,re=`roundedWithTitle`,ie=`note`,ae=`noteGroup`,z=`statediagram`,oe=`${z}-state`,B=`transition`,se=`note`,ce=`${B} note-edge`,le=`${z}-${se}`,ue=`${z}-cluster`,de=`${z}-cluster-alt`,V=`parent`,H=`note`,fe=`state`,U=`----`,pe=`${U}${H}`,W=`${U}${V}`,G=e((e,t=S)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),me={getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`),draw:e(async function(e,n,r,i){t.info(`REF0:`),t.info(`Drawing state diagram (v2)`,n);let{securityLevel:a,state:o,layout:s}=d();i.db.extract(i.db.getRootDocV2());let c=i.db.getData(),l=g(n,a);c.type=i.type,c.layoutAlgorithm=s,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,d().look===`neo`?c.markers=[`barbNeo`]:c.markers=[`barb`],c.diagramId=n,await v(c,l);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,n)=>{let r=typeof n==`string`?n:typeof n?.id==`string`?n.id:``,i=c.nodes.find(e=>e.id===r);if(!r){t.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(n));return}let a=l.node()?.querySelectorAll(`g.node, g.rough-node`),o;if(a?.forEach(e=>{let t=e.textContent?.trim();(e.id===i?.domId||t===r)&&(o=e)}),!o){t.warn(`⚠️ Could not find node matching text:`,r);return}let s=o.parentNode;if(!s){t.warn(`⚠️ Node has no parent, cannot wrap:`,r);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),o.setAttribute(`title`,t)}s.replaceChild(u,o),u.appendChild(o),t.info(`🔗 Wrapped node in <a> tag for:`,r,e.url)})}catch(e){t.error(`❌ Error injecting clickable links:`,e)}p.insertTitle(l,`statediagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),_(l,8,z,o?.useMaxWidth??!0)},`draw`),getDir:G},K=new Map,q=0;function J(e=``,t=0,n=``,r=U){return`${fe}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}e(J,`stateDomId`);var he=e((e,n,r,i,a,o,s,l)=>{t.trace(`items`,n),n.forEach(t=>{switch(t.stmt){case w:Z(e,t,r,i,a,o,s,l);break;case A:Z(e,t,r,i,a,o,s,l);break;case E:{Z(e,t.state1,r,i,a,o,s,l),Z(e,t.state2,r,i,a,o,s,l);let n=s===`neo`,u={id:`edge`+q,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:n?`arrow_barb_neo`:`arrow_barb`,style:M,labelStyle:``,label:c.sanitizeText(t.description??``,d()),arrowheadStyle:N,labelpos:P,labelType:ee,thickness:F,classes:B,look:s};a.push(u),q++}break}})},`setupDoc`),ge=e((e,t=S)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function Y(e,t,n){if(!t.id||t.id===`</join></fork>`||t.id===`</choice>`)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}e(Y,`insertOrUpdateNode`);function X(e){return e?.classes?.join(` `)??``}e(X,`getClassesFromDbInfo`);function _e(e){return e?.styles??[]}e(_e,`getStylesFromDbInfo`);var Z=e((e,n,r,i,a,o,s,l)=>{let u=n.id,f=r.get(u),p=X(f),m=_e(f),h=d();if(t.info(`dataFetcher parsedItem`,n,f,m),u!==`root`){let r=I;n.start===!0?r=te:n.start===!1&&(r=ne),n.type!==A&&(r=n.type),K.get(u)||K.set(u,{id:u,shape:r,description:c.sanitizeText(u,h),cssClasses:`${p} ${oe}`,cssStyles:m});let d=K.get(u);n.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(n.description)):d.description?.length&&d.description.length>0?(d.shape=L,d.description===u?d.description=[n.description]:d.description=[d.description,n.description]):(d.shape=I,d.description=n.description),d.description=c.sanitizeTextOrArray(d.description,h)),d.description?.length===1&&d.shape===L&&(d.type===`group`?d.shape=re:d.shape=I),!d.type&&n.doc&&(t.info(`Setting cluster for XCX`,u,ge(n)),d.type=`group`,d.isGroup=!0,d.dir=ge(n),d.explicitDir=n.doc.some(e=>e.stmt===`dir`),d.shape=n.type===j?R:re,d.cssClasses=`${d.cssClasses} ${ue} ${o?de:``}`);let f={labelStyle:``,shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:u,dir:d.dir,domId:J(u,q),type:d.type,isGroup:d.type===`group`,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(f.shape===R&&(f.label=``),e&&e.id!==`root`&&(t.trace(`Setting node `,u,` to be child of its parent `,e.id),f.parentId=e.id),f.centerLabel=!0,n.note){let e={labelStyle:``,shape:ie,label:n.note.text,labelType:`markdown`,cssClasses:le,cssStyles:[],cssCompiledStyles:[],id:u+pe+`-`+q,domId:J(u,q,H),type:d.type,isGroup:d.type===`group`,padding:h.flowchart?.padding,look:s,position:n.note.position},t=u+W,r={labelStyle:``,shape:ae,label:n.note.text,cssClasses:d.cssClasses,cssStyles:[],id:u+W,domId:J(u,q,V),type:`group`,isGroup:!0,padding:16,look:s,position:n.note.position};q++,r.id=t,e.parentId=t,Y(i,r,l),Y(i,e,l),Y(i,f,l);let o=u,c=e.id;n.note.position===`left of`&&(o=e.id,c=u),a.push({id:o+`-`+c,start:o,end:c,arrowhead:`none`,arrowTypeEnd:``,style:M,labelStyle:``,classes:ce,arrowheadStyle:N,labelpos:P,labelType:ee,thickness:F,look:s})}else Y(i,f,l)}n.doc&&(t.trace(`Adding nodes children `),he(n,n.doc,r,i,a,!o,s,l))},`dataFetcher`),ve=e(()=>{K.clear(),q=0},`reset`),Q={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},ye=e(()=>new Map,`newClassesList`),be=e(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=e(e=>JSON.parse(JSON.stringify(e)),`clone`),xe=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=ye(),this.documents={root:be()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=f,this.setAccTitle=o,this.getAccDescription=l,this.setAccDescription=i,this.setDiagramTitle=a,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{e(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case w:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case E:this.addRelation(t.state1,t.state2,t.description);break;case D:this.addStyleClass(t.id.trim(),t.classes);break;case O:this.handleStyleDef(t);break;case k:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip);break}let t=this.getStates(),n=d();ve(),Z(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){t.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===E){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===w&&(t.id===Q.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==T&&t.stmt!==w||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===j){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:w,id:m(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:T,stmt:T},{id:T,stmt:T,doc:this.rootDoc},!0),{id:T,doc:this.rootDoc}}addState(e,n=A,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){let u=e?.trim();if(!this.currentDocument.states.has(u))t.info(`Adding state `,u,i),this.currentDocument.states.set(u,{stmt:w,id:u,descriptions:[],type:n,doc:r,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.doc||=r,e.type||=n}if(i&&(t.info(`Setting state description`,u,i),(Array.isArray(i)?i:[i]).forEach(e=>this.addDescription(u,e.trim()))),a){let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.note=a,e.note.text=c.sanitizeText(e.note.text,d())}o&&(t.info(`Setting state classes`,u,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(u,e.trim()))),s&&(t.info(`Setting state styles`,u,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(u,e.trim()))),l&&(t.info(`Setting state styles`,u,s),(Array.isArray(l)?l:[l]).forEach(e=>this.setTextStyle(u,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:be()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=ye(),e||(this.links=new Map,s())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){t.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,n,r){this.links.set(e,{url:n,tooltip:r}),t.warn(`Adding link`,e,n,r)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Q.START_NODE?(this.startEndCount++,`${Q.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=A){return e===Q.START_NODE?Q.START_TYPE:t}endIdIfNeeded(e=``){return e===Q.END_NODE?(this.startEndCount++,`${Q.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=A){return e===Q.END_NODE?Q.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:c.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?c.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(c.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Q.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Q.COLOR_KEYWORD).exec(e)){let e=t.replace(Q.FILL_KEYWORD,Q.BG_FILL).replace(Q.COLOR_KEYWORD,Q.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(e){let t=h();n(e).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,e=>{let i=n(e.currentTarget),a=i.attr(`title`);if(a===null)return;let o=e.currentTarget?.getBoundingClientRect();t.transition().duration(200).style(`opacity`,`.9`),t.style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),t.html(r.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{t.transition().duration(500).style(`opacity`,0),n(e.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===C)}getDirection(){return this.getDirectionStatement()?.value??x}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:C,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:G(this.getRootDocV2())}}getConfig(){return d().state}},Se=e(e=>`
|
|
7
|
+
defs [id$="-barbEnd"] {
|
|
8
|
+
fill: ${e.transitionColor};
|
|
9
|
+
stroke: ${e.transitionColor};
|
|
10
|
+
}
|
|
11
|
+
g.stateGroup text {
|
|
12
|
+
fill: ${e.nodeBorder};
|
|
13
|
+
stroke: none;
|
|
14
|
+
font-size: 10px;
|
|
15
|
+
}
|
|
16
|
+
g.stateGroup text {
|
|
17
|
+
fill: ${e.textColor};
|
|
18
|
+
stroke: none;
|
|
19
|
+
font-size: 10px;
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
g.stateGroup .state-title {
|
|
23
|
+
font-weight: bolder;
|
|
24
|
+
fill: ${e.stateLabelColor};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
g.stateGroup rect {
|
|
28
|
+
fill: ${e.mainBkg};
|
|
29
|
+
stroke: ${e.nodeBorder};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
g.stateGroup line {
|
|
33
|
+
stroke: ${e.lineColor};
|
|
34
|
+
stroke-width: ${e.strokeWidth||1};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.transition {
|
|
38
|
+
stroke: ${e.transitionColor};
|
|
39
|
+
stroke-width: ${e.strokeWidth||1};
|
|
40
|
+
fill: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.stateGroup .composit {
|
|
44
|
+
fill: ${e.background};
|
|
45
|
+
border-bottom: 1px
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.stateGroup .alt-composit {
|
|
49
|
+
fill: #e0e0e0;
|
|
50
|
+
border-bottom: 1px
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.state-note {
|
|
54
|
+
stroke: ${e.noteBorderColor};
|
|
55
|
+
fill: ${e.noteBkgColor};
|
|
56
|
+
|
|
57
|
+
text {
|
|
58
|
+
fill: ${e.noteTextColor};
|
|
59
|
+
stroke: none;
|
|
60
|
+
font-size: 10px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.stateLabel .box {
|
|
65
|
+
stroke: none;
|
|
66
|
+
stroke-width: 0;
|
|
67
|
+
fill: ${e.mainBkg};
|
|
68
|
+
opacity: 0.5;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.edgeLabel .label rect {
|
|
72
|
+
fill: ${e.labelBackgroundColor};
|
|
73
|
+
opacity: 0.5;
|
|
74
|
+
}
|
|
75
|
+
.edgeLabel {
|
|
76
|
+
background-color: ${e.edgeLabelBackground};
|
|
77
|
+
p {
|
|
78
|
+
background-color: ${e.edgeLabelBackground};
|
|
79
|
+
}
|
|
80
|
+
rect {
|
|
81
|
+
opacity: 0.5;
|
|
82
|
+
background-color: ${e.edgeLabelBackground};
|
|
83
|
+
fill: ${e.edgeLabelBackground};
|
|
84
|
+
}
|
|
85
|
+
text-align: center;
|
|
86
|
+
}
|
|
87
|
+
.edgeLabel .label text {
|
|
88
|
+
fill: ${e.transitionLabelColor||e.tertiaryTextColor};
|
|
89
|
+
}
|
|
90
|
+
.label div .edgeLabel {
|
|
91
|
+
color: ${e.transitionLabelColor||e.tertiaryTextColor};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.stateLabel text {
|
|
95
|
+
fill: ${e.stateLabelColor};
|
|
96
|
+
font-size: 10px;
|
|
97
|
+
font-weight: bold;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.node circle.state-start {
|
|
101
|
+
fill: ${e.specialStateColor};
|
|
102
|
+
stroke: ${e.specialStateColor};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.node .fork-join {
|
|
106
|
+
fill: ${e.specialStateColor};
|
|
107
|
+
stroke: ${e.specialStateColor};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.node circle.state-end {
|
|
111
|
+
fill: ${e.innerEndBackground};
|
|
112
|
+
stroke: ${e.background};
|
|
113
|
+
stroke-width: 1.5
|
|
114
|
+
}
|
|
115
|
+
.end-state-inner {
|
|
116
|
+
fill: ${e.compositeBackground||e.background};
|
|
117
|
+
// stroke: ${e.background};
|
|
118
|
+
stroke-width: 1.5
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.node rect {
|
|
122
|
+
fill: ${e.stateBkg||e.mainBkg};
|
|
123
|
+
stroke: ${e.stateBorder||e.nodeBorder};
|
|
124
|
+
stroke-width: ${e.strokeWidth||1}px;
|
|
125
|
+
}
|
|
126
|
+
.node polygon {
|
|
127
|
+
fill: ${e.mainBkg};
|
|
128
|
+
stroke: ${e.stateBorder||e.nodeBorder};;
|
|
129
|
+
stroke-width: ${e.strokeWidth||1}px;
|
|
130
|
+
}
|
|
131
|
+
[id$="-barbEnd"] {
|
|
132
|
+
fill: ${e.lineColor};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.statediagram-cluster rect {
|
|
136
|
+
fill: ${e.compositeTitleBackground};
|
|
137
|
+
stroke: ${e.stateBorder||e.nodeBorder};
|
|
138
|
+
stroke-width: ${e.strokeWidth||1}px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.cluster-label, .nodeLabel {
|
|
142
|
+
color: ${e.stateLabelColor};
|
|
143
|
+
// line-height: 1;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.statediagram-cluster rect.outer {
|
|
147
|
+
rx: 5px;
|
|
148
|
+
ry: 5px;
|
|
149
|
+
}
|
|
150
|
+
.statediagram-state .divider {
|
|
151
|
+
stroke: ${e.stateBorder||e.nodeBorder};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.statediagram-state .title-state {
|
|
155
|
+
rx: 5px;
|
|
156
|
+
ry: 5px;
|
|
157
|
+
}
|
|
158
|
+
.statediagram-cluster.statediagram-cluster .inner {
|
|
159
|
+
fill: ${e.compositeBackground||e.background};
|
|
160
|
+
}
|
|
161
|
+
.statediagram-cluster.statediagram-cluster-alt .inner {
|
|
162
|
+
fill: ${e.altBackground?e.altBackground:`#efefef`};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.statediagram-cluster .inner {
|
|
166
|
+
rx:0;
|
|
167
|
+
ry:0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.statediagram-state rect.basic {
|
|
171
|
+
rx: 5px;
|
|
172
|
+
ry: 5px;
|
|
173
|
+
}
|
|
174
|
+
.statediagram-state rect.divider {
|
|
175
|
+
stroke-dasharray: 10,10;
|
|
176
|
+
fill: ${e.altBackground?e.altBackground:`#efefef`};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.note-edge {
|
|
180
|
+
stroke-dasharray: 5;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.statediagram-note rect {
|
|
184
|
+
fill: ${e.noteBkgColor};
|
|
185
|
+
stroke: ${e.noteBorderColor};
|
|
186
|
+
stroke-width: 1px;
|
|
187
|
+
rx: 0;
|
|
188
|
+
ry: 0;
|
|
189
|
+
}
|
|
190
|
+
.statediagram-note rect {
|
|
191
|
+
fill: ${e.noteBkgColor};
|
|
192
|
+
stroke: ${e.noteBorderColor};
|
|
193
|
+
stroke-width: 1px;
|
|
194
|
+
rx: 0;
|
|
195
|
+
ry: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.statediagram-note text {
|
|
199
|
+
fill: ${e.noteTextColor};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.statediagram-note .nodeLabel {
|
|
203
|
+
color: ${e.noteTextColor};
|
|
204
|
+
}
|
|
205
|
+
.statediagram .edgeLabel {
|
|
206
|
+
color: red; // ${e.noteTextColor};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
[id$="-dependencyStart"], [id$="-dependencyEnd"] {
|
|
210
|
+
fill: ${e.lineColor};
|
|
211
|
+
stroke: ${e.lineColor};
|
|
212
|
+
stroke-width: ${e.strokeWidth||1};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.statediagramTitleText {
|
|
216
|
+
text-anchor: middle;
|
|
217
|
+
font-size: 18px;
|
|
218
|
+
fill: ${e.textColor};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
[data-look="neo"].statediagram-cluster rect {
|
|
222
|
+
fill: ${e.mainBkg};
|
|
223
|
+
stroke: ${e.useGradient?`url(`+e.svgId+`-gradient)`:e.stateBorder||e.nodeBorder};
|
|
224
|
+
stroke-width: ${e.strokeWidth??1};
|
|
225
|
+
}
|
|
226
|
+
[data-look="neo"].statediagram-cluster rect.outer {
|
|
227
|
+
rx: ${e.radius}px;
|
|
228
|
+
ry: ${e.radius}px;
|
|
229
|
+
filter: ${e.dropShadow?e.dropShadow.replace(`url(#drop-shadow)`,`url(${e.svgId}-drop-shadow)`):`none`}
|
|
230
|
+
}
|
|
231
|
+
`,`getStyles`);export{Se as i,b as n,me as r,xe as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-VKFMJZFB-B1pQKQSY.js","assets/chunk-HOUHSVGY-BMPwFEwN.js","assets/src-Dad2ZbCt.js","assets/chunk-DseTPa7n.js","assets/chunk-Y2CYZVJY-BGrd8tLy.js","assets/chunk-WYO6CB5R-Do6SJrnY.js","assets/preload-helper-D4M6sveU.js","assets/chunk-ICXQ74PX-DH8NJMok.js","assets/dist-dw-gAfM_.js","assets/dagre-DkiXZKkL.js","assets/graphlib-BcNFQr5y.js","assets/map-Bdri5UL5.js","assets/chunk-RYQCIY6F-jxNASx65.js","assets/chunk-Q4XR5HBZ-uvIGstBS.js","assets/chunk-52WLFC77-BLeB7iGk.js","assets/line-B78frP_c.js","assets/path-DzBnMI1r.js","assets/array-BqYdCIE6.js","assets/chunk-7BUUIJ7U-JiyRtrGu.js","assets/chunk-C7G6YPKG-AsyDSQ9j.js","assets/chunk-OGEWGWER-TIcEoPPH.js","assets/chunk-ZGVPDNZ5-B7kWWaXv.js","assets/rough.esm-wJ1d3nQl.js","assets/swimlanes-5IMT3BWC-DdVqVa1a.js","assets/cose-bilkent-JH36ORCC-B9LrtV-q.js","assets/cytoscape.esm-CRW8q92n.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-D4M6sveU.js";import{n as t}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{m as n}from"./src-Dad2ZbCt.js";import{b as r,s as i}from"./chunk-WYO6CB5R-Do6SJrnY.js";import{d as a}from"./chunk-ICXQ74PX-DH8NJMok.js";import{a as o,i as s,s as c}from"./chunk-ZGVPDNZ5-B7kWWaXv.js";import{a as l,i as u,o as d,r as f}from"./chunk-52WLFC77-BLeB7iGk.js";var p={common:i,getConfig:r,insertCluster:s,insertEdge:f,insertEdgeLabel:u,insertMarkers:l,insertNode:o,interpolateToCurve:a,labelHelper:c,log:n,positionEdgeLabel:d},m={},h=t(e=>{for(let t of e)m[t.name]=t},`registerLayoutLoaders`);t(()=>{h([{name:`dagre`,loader:t(async()=>await e(()=>import(`./dagre-VKFMJZFB-B1pQKQSY.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])),`loader`)},{name:`swimlane`,loader:t(async()=>await e(()=>import(`./swimlanes-5IMT3BWC-DdVqVa1a.js`),__vite__mapDeps([23,6,1,2,3,4,5,7,8,10,12,11,13,14,15,16,17,18,19,20,21,22])),`loader`)},...[{name:`cose-bilkent`,loader:t(async()=>await e(()=>import(`./cose-bilkent-JH36ORCC-B9LrtV-q.js`),__vite__mapDeps([24,3,25,2,4])),`loader`)}]])},`registerDefaultLayoutLoaders`)();var g=t(async(e,t,n)=>{if(!(e.layoutAlgorithm in m))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let r=m[e.layoutAlgorithm],i=await r.loader(),{theme:a,themeVariables:o}=e.config,{useGradient:s,gradientStart:c,gradientStop:l}=o,u=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${u}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${a?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${u}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${a?.includes(`dark`)?`#FFFFFF`:`#000000`}`),s){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,c).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,l).attr(`stop-opacity`,1)}return i.render(e,t,p,{algorithm:r.algorithm},n)},`render`),_=t((e=``,{fallback:t=`dagre`}={})=>{if(e in m)return e;if(t in m)return n.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`);export{h as n,g as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{m as t}from"./src-Dad2ZbCt.js";import{b as n,z as r}from"./chunk-WYO6CB5R-Do6SJrnY.js";var i=Object.freeze({left:0,top:0,width:16,height:16}),a=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),o=Object.freeze({...i,...a}),s=Object.freeze({...o,body:``,hidden:!1}),c=Object.freeze({width:null,height:null}),l=Object.freeze({...c,...a}),u=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!d(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!d(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!d(e,n)?null:e}return null},d=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function f(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function p(e,t){let n=f(e,t);for(let r in s)r in a?r in e&&!(r in n)&&(n[r]=a[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function m(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function h(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=p(r[e]||i[e],a)}return o(t),n.forEach(o),p(e,a)}function g(e,t){if(e.icons[t])return h(e,t,[]);let n=m(e,[t])[t];return n?h(e,t,n):null}var _=/(-?[0-9.]*[0-9]+[0-9.]*)/g,v=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function y(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(_);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=v.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function b(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function x(e,t){return e?`<defs>`+e+`</defs>`+t:t}function S(e,t,n){let r=b(e);return x(r.defs,t+r.content+n)}var C=e=>e===`unset`||e===`undefined`||e===`none`;function w(e,t){let n={...o,...e},r={...l,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=S(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let s=r.width,c=r.height,u=i.width,d=i.height,f,p;s===null?(p=c===null?`1em`:c===`auto`?d:c,f=y(p,u/d)):(f=s===`auto`?u:s,p=c===null?y(f,d/u):c===`auto`?d:c);let m={},h=(e,t)=>{C(t)||(m[e]=t.toString())};h(`width`,f),h(`height`,p);let g=[i.left,i.top,u,d];return m.viewBox=g.join(` `),{attributes:m,viewBox:g,body:a}}var T=/\sid="(\S+)"/g,E=new Map;function D(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=E.get(e)||0;return E.set(e,t+1),t?`${e}${t}`:e}function O(e){let t=[],n;for(;n=T.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=D(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function k(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}var A={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},j=new Map,M=new Map,N=e(e=>{for(let n of e){if(!n.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(t.debug(`Registering icon pack:`,n.name),`loader`in n)M.set(n.name,n.loader);else if(`icons`in n)j.set(n.name,n.icons);else throw t.error(`Invalid icon loader:`,n),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),P=e(async(e,n)=>{let r=u(e,!0,n!==void 0);if(!r)throw Error(`Invalid icon name: ${e}`);let i=r.prefix||n;if(!i)throw Error(`Icon name must contain a prefix: ${e}`);let a=j.get(i);if(!a){let e=M.get(i);if(!e)throw Error(`Icon set not found: ${r.prefix}`);try{a={...await e(),prefix:i},j.set(i,a)}catch(e){throw t.error(e),Error(`Failed to load icon set: ${r.prefix}`)}}let o=g(a,r.name);if(!o)throw Error(`Icon not found: ${e}`);return o},`getRegisteredIconData`),F=e(async e=>{try{return await P(e),!0}catch{return!1}},`isIconAvailable`),I=e(async(e,i,a)=>{let o;try{o=await P(e,i?.fallbackPrefix)}catch(e){t.error(e),o=A}let s=w(o,i);return r(k(O(s.body),{...s.attributes,...a}),n())},`getIconSVG`);export{A as i,F as n,N as r,I as t};
|