@nextclaw/ui 0.15.4 → 0.15.6
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 +41 -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-Dyb5rgh0.js +13 -0
- package/dist/assets/app-presenter-provider-7jV0nPiL.js +106 -0
- package/dist/assets/{appearance-settings-page-fLIJbx1C.js → appearance-settings-page-DFm3BbEb.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-L6LCuqOr.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-DOaPKNJA.js} +2 -2
- package/dist/assets/{chat-page-B42UUIFR.js → chat-page-Cw9uDhD_.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-CqlqjnCK.js} +1 -1
- package/dist/assets/{confirm-dialog-GSXIvoRU.js → confirm-dialog-bAp8NU93.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-2SjMfCMl.js +1 -0
- 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-CrtbGLlh.js} +1 -1
- package/dist/assets/dist-dw-gAfM_.js +1 -0
- package/dist/assets/doc-browser-A5IRyDXQ2.js +1 -0
- package/dist/assets/{doc-browser-D0monHjG.js → doc-browser-BmnQa30-.js} +1 -1
- package/dist/assets/{doc-browser-context-CGwEOhBy.js → doc-browser-context-BlpUUFrR.js} +1 -1
- package/dist/assets/{docx-preview-eFH9DRsS.js → docx-preview-zis3U0Fa.js} +1 -1
- package/dist/assets/{download-DiP9zx-J.js → download-BhZZNXD8.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-B9Uoq5J7.js} +1 -1
- package/dist/assets/{eye-suvKmtwn.js → eye-K5knauEM.js} +1 -1
- package/dist/assets/flowDiagram-23GEKE2U-BoKk8RRq.js +1 -0
- package/dist/assets/{folder-CMELbQGG.js → folder-BIYZZWJv.js} +1 -1
- package/dist/assets/{form-actions-CUAzpNe_.js → form-actions-CKprWFeM.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-BVn702m4.css +1 -0
- package/dist/assets/index-CFxJ1Fkg.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-Bj2RMrCR.js +1 -0
- package/dist/assets/{logo-badge-Cu5UGH_4.js → logo-badge-BQ-XFZod.js} +1 -1
- package/dist/assets/map-Bdri5UL5.js +1 -0
- package/dist/assets/mcp-marketplace-page-BfA7A3n4.js +9 -0
- package/dist/assets/mcp-marketplace-page-CXHYO95j.js +1 -0
- 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-BbWbW_qM.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-TmFdwO3P.js +1 -0
- package/dist/assets/{popover-DImguRok.js → popover-CX9zFsuc.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-B-9_DtIP.js} +1 -1
- package/dist/assets/providers-config-page-xwIjGur2.js +1 -0
- 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-DsgudwpT.js} +1 -1
- package/dist/assets/{refresh-cw-CHLBzWWj.js → refresh-cw-kXdvbhFf.js} +1 -1
- package/dist/assets/remote-B9F2uCk9.js +1 -0
- package/dist/assets/requirementDiagram-TGXJPOKE-EmFph0H_.js +84 -0
- package/dist/assets/rotate-cw-DEc6aihr.js +1 -0
- package/dist/assets/rough.esm-wJ1d3nQl.js +1 -0
- package/dist/assets/runtime-config-page-DTsi7czJ.js +1 -0
- package/dist/assets/sankeyDiagram-HTMAVEWB-BXWB5Ugi.js +40 -0
- package/dist/assets/{save-BABzyrjB.js → save-C9qpz2_2.js} +1 -1
- package/dist/assets/{search-BTqxG3ZG.js → search-_kEi29qo.js} +1 -1
- package/dist/assets/{search-config-page-BkKKmxmS.js → search-config-page-H7ug8f4D.js} +1 -1
- package/dist/assets/{secrets-config-page-CWJMyu-k.js → secrets-config-page-C1_6rINu.js} +2 -2
- package/dist/assets/security-config-Cr2ERKLu.js +1 -0
- package/dist/assets/{select-TYZDBNmq.js → select-MJKhKAWR.js} +1 -1
- package/dist/assets/sequenceDiagram-DBY2YBRQ-ClKnO7v0.js +162 -0
- package/dist/assets/{setting-row-DR23Z_5I.js → setting-row-DA3tJuew.js} +1 -1
- package/dist/assets/{settings-2-D8WWcBnw.js → settings-2-D_y7zXJz.js} +1 -1
- package/dist/assets/sizeCapture-X5ZJPWSS-DSo-t5ou.js +1 -0
- package/dist/assets/{skeleton-CloHeg0S.js → skeleton-0uTLUhm9.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-h44XPocd.js} +1 -1
- package/dist/assets/{tag-chip-mCc23Rhb.js → tag-chip-bRZ04q3C.js} +1 -1
- package/dist/assets/timeline-definition-FHXFAJF6-D4ar8IQY.js +120 -0
- package/dist/assets/{trash-2-SAW1Z4Po.js → trash-2-BRpSE-Wt.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-CwDEAl6f.js +1 -0
- package/dist/assets/{use-confirm-dialog-C95F6sT1.js → use-confirm-dialog-BbnWw-8c.js} +1 -1
- package/dist/assets/{use-viewport-layout-C6m3Nte7.js → use-viewport-layout-CqgIMDQL.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-DdEDL6ju.js +1 -0
- package/dist/assets/xychartDiagram-FW5EYKEG-C9JCzsZF.js +7 -0
- package/dist/index.html +33 -32
- package/package.json +8 -8
- package/src/features/chat/components/chat-popover-content.tsx +1 -26
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +84 -1
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +13 -2
- package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +1 -0
- package/src/features/chat/components/layout/__tests__/chat-sidebar-test.utils.ts +22 -0
- package/src/features/chat/components/layout/__tests__/chat-sidebar.test.tsx +13 -24
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +16 -4
- package/src/features/chat/components/layout/chat-sidebar.tsx +38 -2
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +1 -0
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +52 -2
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +22 -0
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +36 -20
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-input-state.test.tsx +55 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-input-state.ts +12 -11
- package/src/features/chat/features/conversation/hooks/use-session-conversation-preference-actions.ts +94 -0
- package/src/features/chat/features/input/hooks/__tests__/use-chat-input-surface-state.test.tsx +37 -0
- package/src/features/chat/features/input/hooks/use-chat-input-surface-state.ts +140 -63
- package/src/features/chat/features/input/input-surface-plugins/__tests__/context-reference-plugin.test.ts +175 -0
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +66 -0
- package/src/features/chat/features/input/input-surface-plugins/chat-input-product-plugin-adapters.types.ts +8 -1
- package/src/features/chat/features/input/input-surface-plugins/context-reference-plugin.utils.ts +274 -0
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +18 -11
- package/src/features/chat/features/input/utils/__tests__/chat-composer-state.utils.test.ts +26 -0
- package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +50 -4
- package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +51 -0
- package/src/features/chat/features/input/utils/chat-composer-state.utils.ts +4 -10
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +29 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +66 -8
- package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +62 -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/ncp/hooks/__tests__/use-hydrated-ncp-agent.test.tsx +41 -3
- package/src/features/chat/features/project/components/__tests__/chat-project-create-dialog.test.tsx +67 -0
- package/src/features/chat/features/project/components/chat-project-create-dialog.tsx +203 -0
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +7 -7
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-project-dialog.test.tsx +47 -0
- package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +6 -3
- package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +3 -0
- package/src/features/chat/features/session/components/session-header/chat-session-project-dialog.tsx +3 -0
- package/src/features/chat/features/session/components/session-header/chat-session-switcher-groups.tsx +245 -0
- package/src/features/chat/features/session/components/session-header/chat-session-title-switcher.tsx +81 -127
- package/src/features/chat/features/session/utils/__tests__/chat-sidebar-session-groups.utils.test.ts +22 -0
- package/src/features/chat/features/session/utils/chat-run-metadata.utils.ts +6 -6
- package/src/features/chat/features/session/utils/chat-sidebar-session-groups.utils.ts +12 -1
- package/src/features/chat/features/welcome/components/chat-conversation-welcome.tsx +3 -0
- package/src/features/chat/features/welcome/components/chat-welcome.tsx +1 -0
- package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-project-options.utils.test.ts +20 -0
- package/src/features/chat/features/welcome/utils/chat-welcome-project-options.utils.ts +15 -2
- 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/pages/__tests__/ncp-chat-page.test.ts +23 -0
- 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/features/settings/components/config/provider-form.tsx +0 -4
- package/src/features/settings/utils/__tests__/provider-form-support.utils.test.ts +7 -9
- package/src/features/settings/utils/provider-form-model.utils.ts +0 -4
- package/src/features/system-status/hooks/use-current-version-release-notes-link.ts +33 -0
- package/src/features/system-status/index.ts +9 -0
- package/src/features/system-status/utils/update-release-notes.utils.ts +44 -3
- package/src/index.css +10 -16
- package/src/shared/components/common/__tests__/brand-header.test.tsx +127 -10
- package/src/shared/components/common/brand-header.tsx +142 -56
- package/src/shared/components/path-picker/__tests__/server-path-picker-dialog.test.tsx +288 -38
- package/src/shared/components/path-picker/server-path-picker-dialog.tsx +290 -199
- package/src/shared/components/path-picker/server-path-picker-directory-list.tsx +103 -0
- package/src/shared/components/path-picker/server-path-picker-footer.tsx +58 -0
- package/src/shared/components/path-picker/server-path-picker-locations.tsx +148 -0
- package/src/shared/components/path-picker/server-path-picker-navigation-bar.tsx +198 -0
- package/src/shared/components/path-picker/server-path-picker-new-folder.tsx +59 -0
- package/src/shared/components/path-picker/server-path-picker-toolbar.tsx +25 -0
- package/src/shared/hooks/use-projects.ts +28 -0
- package/src/shared/hooks/use-server-path-create-directory.ts +6 -0
- package/src/shared/hooks/use-server-path-read.ts +10 -5
- package/src/shared/hooks/use-server-path-search.ts +40 -0
- package/src/shared/lib/api/index.ts +1 -0
- package/src/shared/lib/api/projects/project.utils.ts +14 -0
- package/src/shared/lib/api/types.ts +30 -3
- package/src/shared/lib/api/utils/server-path.utils.ts +22 -1
- package/src/shared/lib/i18n/locales/en-US/chat.json +43 -2
- package/src/shared/lib/i18n/locales/en-US/core.json +2 -3
- package/src/shared/lib/i18n/locales/en-US/desktop-update.json +4 -0
- package/src/shared/lib/i18n/locales/en-US/path-picker.json +25 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +43 -2
- package/src/shared/lib/i18n/locales/zh-CN/core.json +2 -3
- package/src/shared/lib/i18n/locales/zh-CN/desktop-update.json +4 -0
- package/src/shared/lib/i18n/locales/zh-CN/path-picker.json +25 -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/api-BOXOrpcJ.js +0 -13
- package/dist/assets/app-presenter-provider-CkHLbvZQ.js +0 -106
- package/dist/assets/desktop-update-config-7bmNeWIC.js +0 -1
- 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-BUzHDwW6.js +0 -9
- package/dist/assets/mcp-marketplace-page-ohUAdfqJ.js +0 -1
- package/dist/assets/plus-tywizkeY.js +0 -1
- package/dist/assets/providers-config-page-BKPo8SjH.js +0 -1
- package/dist/assets/remote-DXJryUxB.js +0 -1
- package/dist/assets/rotate-cw-BefO5brU.js +0 -1
- package/dist/assets/runtime-config-page-1Axv4QGu.js +0 -1
- package/dist/assets/security-config-DeQUIXfi.js +0 -1
- package/dist/assets/use-config-BucdaK23.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/src/features/chat/features/input/input-surface-plugins/__tests__/panel-app-reference-plugin.test.ts +0 -77
- package/src/features/chat/features/input/input-surface-plugins/panel-app-reference-plugin.utils.ts +0 -144
- /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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/model-config-page-BbWbW_qM.js","assets/chunk-DseTPa7n.js","assets/api-Dyb5rgh0.js","assets/react-DsgudwpT.js","assets/book-open-L6LCuqOr.js","assets/dist-CrtbGLlh.js","assets/provider-scoped-model-input-B-9_DtIP.js","assets/select-MJKhKAWR.js","assets/popover-CX9zFsuc.js","assets/provider-models-BoUhFo9R.js","assets/folder-BIYZZWJv.js","assets/loader-circle-Bj2RMrCR.js","assets/skeleton-0uTLUhm9.js","assets/doc-browser-context-BlpUUFrR.js","assets/middleware-CAXxl-af.js","assets/form-actions-CKprWFeM.js","assets/use-config-CwDEAl6f.js","assets/config-hints-LxG80Uj5.js","assets/appearance-settings-page-DFm3BbEb.js","assets/app-presenter-provider-7jV0nPiL.js","assets/preload-helper-D4M6sveU.js","assets/confirm-dialog-bAp8NU93.js","assets/x-DdEDL6ju.js","assets/doc-browser-BmnQa30-.js","assets/search-_kEi29qo.js","assets/external-link-B9Uoq5J7.js","assets/plus-TmFdwO3P.js","assets/refresh-cw-kXdvbhFf.js","assets/use-confirm-dialog-BbnWw-8c.js","assets/download-BhZZNXD8.js","assets/eye-K5knauEM.js","assets/tabs-h44XPocd.js","assets/use-viewport-layout-CqgIMDQL.js","assets/trash-2-BRpSE-Wt.js","assets/logo-badge-BQ-XFZod.js","assets/host-capabilities-CFbAfrrA.js","assets/app-presenter-provider-D3BuuOyZ.css","assets/setting-row-DA3tJuew.js","assets/chat-page-Cw9uDhD_.js","assets/settings-2-D_y7zXJz.js","assets/tag-chip-bRZ04q3C.js","assets/search-config-page-H7ug8f4D.js","assets/config-split-page-CqlqjnCK.js","assets/providers-config-page-xwIjGur2.js","assets/channels-list-page-DOaPKNJA.js","assets/runtime-config-page-DTsi7czJ.js","assets/rotate-cw-DEc6aihr.js","assets/save-C9qpz2_2.js","assets/desktop-update-config-2SjMfCMl.js","assets/security-config-Cr2ERKLu.js","assets/secrets-config-page-C1_6rINu.js","assets/remote-B9F2uCk9.js","assets/mcp-marketplace-page-CXHYO95j.js","assets/mcp-marketplace-page-BfA7A3n4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,t}from"./chunk-DseTPa7n.js";import{h as n,m as r,p as i,r as a,u as o}from"./react-DsgudwpT.js";import{t as s}from"./preload-helper-D4M6sveU.js";import{B as c,E as l,T as u,_t as d,a as f,at as p,b as m,dt as h,f as g,ft as _,gt as v,h as y,ht as b,i as x,m as S,mt as C,ot as w,p as T,pt as E,r as D,st as O,t as k,u as ee,ut as te,v as ne,y as re,z as ie}from"./app-presenter-provider-7jV0nPiL.js";import{Cn as ae,En as oe,F as se,I as ce,L as le,Nt as ue,Ot as A,P as de,Pt as j,R as fe,Sn as M,Tn as pe,Wt as N,Zt as me,_n as P,an as he,bt as ge,cn as _e,dn as ve,fn as ye,gn as be,gt as F,hn as xe,in as I,ln as Se,m as L,mn as Ce,nn as we,on as Te,pn as Ee,rn as De,un as Oe,wn as ke,xn as Ae,yt as je,z as Me}from"./api-Dyb5rgh0.js";import{a as R,c as Ne,d as Pe,f as Fe,i as Ie,l as Le,n as Re,o as z,r as ze,s as B,u as V}from"./mcp-marketplace-page-BfA7A3n4.js";import{c as H}from"./dist-CrtbGLlh.js";import{n as Be}from"./search-_kEi29qo.js";import{a as Ve,c as He,o as U,s as Ue}from"./doc-browser-BmnQa30-.js";import{i as We,n as Ge,r as W,t as Ke}from"./use-confirm-dialog-BbnWw-8c.js";import{t as qe}from"./download-BhZZNXD8.js";import{t as Je}from"./external-link-B9Uoq5J7.js";import{i as Ye,r as Xe,t as Ze}from"./tabs-h44XPocd.js";import{t as Qe}from"./use-viewport-layout-CqgIMDQL.js";import{t as $e}from"./refresh-cw-kXdvbhFf.js";import{n as et}from"./skeleton-0uTLUhm9.js";import{t as tt}from"./trash-2-BRpSE-Wt.js";import{t as nt}from"./host-capabilities-CFbAfrrA.js";import{n as rt,t as it}from"./doc-browser-context-BlpUUFrR.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var at=t((e=>{var t=r();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}));function ot(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function st(e,t,n){let r=e.slice(0);return r[t]=n,r}var ct=class extends oe{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,M.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!pe(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(ot(e,n).forEach(e=>{e.destroy()}),ot(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=ke(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Ae(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=st(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&M.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},G=e(n(),1);function lt({queries:e,...t},n){let r=P(n),i=xe(),a=Ce(),o=G.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{_e(e),ve(e,a,r.getQueryCache().get(e.queryHash))}),Ee(a);let[s]=G.useState(()=>new ct(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;G.useSyncExternalStore(G.useCallback(e=>d?s.subscribe(M.batchCalls(e)):ae,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),G.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Oe(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&Oe(n,e)?Se(n,new Ae(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&ye({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}var ut=H(`BriefcaseBusiness`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),dt=H(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),ft=H(`Compass`,[[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),pt=H(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),mt=H(`PenLine`,[[`path`,{d:`M12 20h9`,key:`t2du7b`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`,key:`1ykcvy`}]]),ht=H(`SquareTerminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),gt=at();function K(e){return Array.from(new Set(e.map(e=>e.spec).filter(Boolean)))}function _t(e){let{request:t,result:n}=e,r=new Date().toISOString();return n.type===`skill`?{type:`skill`,spec:n.spec,id:t.skill??n.spec,label:t.skill??n.name??n.spec,source:`workspace`,installPath:t.installPath,installedAt:r}:{type:n.type,spec:n.spec,id:n.name??n.spec,label:n.name??n.spec,source:`marketplace`,origin:`marketplace`,enabled:t.enabled??!0,runtimeStatus:t.enabled===!1?`disabled`:`ready`,installedAt:r}}function q(e,t){let{id:n,spec:r}=t;return!!(r&&e.spec===r||n&&e.id===n)}function vt(e,t){return t??{type:e,total:0,specs:[],records:[]}}function yt(e){let{result:t,view:n}=e,r=vt(t.type,n),i=_t(e),a=r.records.findIndex(e=>q(e,{id:i.id,spec:i.spec})),o=[...r.records];return a>=0?o[a]={...o[a],...i}:o.unshift(i),{...r,type:t.type,records:o,specs:K(o),total:o.length}}function bt(e){let{request:t,result:n,view:r}=e,i=vt(n.type,r);if(n.action===`uninstall`||n.action===`remove`){let e=i.records.filter(e=>!q(e,{id:n.id,spec:t.spec}));return{...i,records:e,specs:K(e),total:e.length}}let a=i.records.map(e=>q(e,{id:n.id,spec:t.spec})?n.action===`disable`?{...e,enabled:!1,runtimeStatus:`disabled`}:n.action===`update`?{...e,installedAt:new Date().toISOString(),origin:e.origin??`marketplace`}:{...e,enabled:!0,runtimeStatus:`ready`}:e);return{...i,records:a,specs:K(a),total:a.length}}function xt(e){let t=Fe({queryKey:[`marketplace-items`,e],initialPageParam:1,queryFn:({pageParam:t})=>se({...e,page:t}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0,placeholderData:(t,n)=>{let r=n?.queryKey?.[1];if(!(!r||typeof r!=`object`||!r))return(`type`in r?r.type:void 0)===e.type&&St(r,e)?t:void 0},staleTime:15e3}),n=(0,G.useMemo)(()=>Pe(t.data),[t.data]);return{...t,data:n}}function St(e,t){return e.tag===t.tag&&e.scene===t.scene&&e.pageSize===t.pageSize}function Ct(e=!0){return Te({queryKey:[`marketplace-skill-scenes`],queryFn:le,enabled:e,staleTime:6e4})}function wt(e,t=!0){let n=lt({queries:e.map(e=>({queryKey:[`marketplace-skill-scene-count`,e.scene],queryFn:()=>se({type:`skill`,scene:e.scene,pageSize:1}),enabled:t&&typeof e.count!=`number`,staleTime:6e4}))});return(0,G.useMemo)(()=>{let t=new Map;return e.forEach((e,r)=>{let i=typeof e.count==`number`?e.count:n[r]?.data?.total;typeof i==`number`&&t.set(e.scene,i)}),t},[n,e])}function Tt(e){return Te({queryKey:[`marketplace-installed`,e],queryFn:()=>de(e),staleTime:1e4})}function Et(){let e=P();return he({mutationFn:e=>fe(e),onSuccess:(t,n)=>{e.setQueryData([`marketplace-installed`,t.type],e=>yt({view:e,request:n,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`}),I.success(t.message||a(`marketplaceInstallSuccessSkill`))},onError:e=>{I.error(e.message||a(`marketplaceInstallFailed`))}})}function Dt(){let e=P();return he({mutationFn:e=>Me(e),onSuccess:(t,n)=>{e.setQueryData([`marketplace-installed`,t.type],e=>bt({view:e,request:n,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`});let r=t.action===`enable`?a(`marketplaceEnableSuccess`):t.action===`disable`?a(`marketplaceDisableSuccess`):t.action===`update`?a(`marketplaceUpdateSuccess`):a(`marketplaceUninstallSuccess`);I.success(t.message||r)},onError:e=>{I.error(e.message||a(`marketplaceOperationFailed`))}})}var J=i(),Ot=[`bg-amber-600`,`bg-orange-500`,`bg-yellow-600`,`bg-emerald-600`,`bg-teal-600`,`bg-cyan-600`,`bg-stone-600`,`bg-rose-500`,`bg-violet-500`];function kt(e){let{name:t,fallback:n,className:r}=e,i=t||n,a=i.substring(0,2).toUpperCase();return(0,J.jsx)(`div`,{className:o(`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-sm font-semibold text-white`,At(i),r),children:a})}function At(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Ot[Math.abs(t)%Ot.length]}function jt({title:e,spec:t}){return(0,J.jsxs)(Ue,{delayDuration:400,children:[(0,J.jsxs)(Ve,{children:[(0,J.jsx)(He,{asChild:!0,children:(0,J.jsx)(`div`,{className:`truncate text-[14px] font-semibold leading-tight text-gray-950`,children:e})}),(0,J.jsx)(U,{className:`max-w-[300px] text-xs`,children:e})]}),(0,J.jsx)(`div`,{className:`mb-2 mt-1 flex min-w-0 items-center gap-1.5`,children:t?(0,J.jsxs)(Ve,{children:[(0,J.jsx)(He,{asChild:!0,children:(0,J.jsx)(`span`,{className:`max-w-full truncate text-[11px] font-mono leading-tight text-gray-400`,children:t})}),(0,J.jsx)(U,{className:`max-w-[300px] break-all font-mono text-xs`,children:t})]}):null})]})}function Mt(e){let{item:t,record:n,state:r,onInstall:i,onManage:s}=e,{isInstalling:c,canUpdate:l,canUninstall:u,busyAction:d}=r,f=!!d;return t&&!n||n&&(l||u)?(0,J.jsxs)(`div`,{className:o(`flex shrink-0 items-center justify-end gap-1.5 opacity-100 transition-opacity duration-150`,`md:pointer-events-none md:opacity-0`,`md:group-hover:pointer-events-auto md:group-hover:opacity-100`,`md:group-focus-within:pointer-events-auto md:group-focus-within:opacity-100`),children:[t&&!n&&(0,J.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),i(t)},disabled:c,className:`inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md bg-primary px-2 text-[11px] font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50`,children:[(0,J.jsx)(qe,{className:`h-3 w-3`}),a(c?`marketplaceInstalling`:`marketplaceInstall`)]}),n&&l&&(0,J.jsxs)(`button`,{disabled:f,onClick:e=>{e.stopPropagation(),s(`update`,n)},className:`inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md border border-blue-200/80 bg-white px-2 text-[11px] font-medium text-blue-600 transition-colors hover:border-blue-300 hover:bg-blue-50 disabled:opacity-50`,children:[(0,J.jsx)($e,{className:`h-3 w-3`}),a(d===`update`?`marketplaceUpdating`:`marketplaceUpdate`)]}),n&&u&&(0,J.jsxs)(`button`,{disabled:f,onClick:e=>{e.stopPropagation(),s(`uninstall`,n)},className:`inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md border border-gray-200/80 bg-white px-2 text-[11px] font-medium text-gray-500 transition-colors hover:border-rose-200 hover:bg-rose-50 hover:text-rose-600 disabled:opacity-50`,children:[(0,J.jsx)(tt,{className:`h-3 w-3`}),a(d===`uninstall`?`marketplaceRemoving`:`marketplaceUninstall`)]})]}):null}function Nt(e){let{record:t,disabled:n}=e;return t?(0,J.jsx)(`div`,{className:`flex h-5 w-5 shrink-0 items-center justify-end`,children:(0,J.jsx)(Pt,{disabled:n})}):null}function Pt(e){let{disabled:t}=e,n=a(t?`marketplaceDisabledStatus`:`marketplaceInstalledStatus`);return(0,J.jsx)(Ue,{delayDuration:300,children:(0,J.jsxs)(Ve,{children:[(0,J.jsx)(He,{asChild:!0,children:(0,J.jsx)(`span`,{"aria-label":n,className:o(`inline-flex h-5 w-5 items-center justify-center`,t?`text-gray-400`:`text-emerald-700`),children:t?(0,J.jsx)(O,{className:`h-4 w-4 opacity-40`}):(0,J.jsx)(O,{className:`h-4 w-4`})})}),(0,J.jsx)(U,{className:`text-xs`,children:n})]})})}function Ft(e){let{item:t,record:n,installState:r,manageState:i,onOpen:o,onInstall:s,onManage:c}=e,{language:l}=W(),u=z(l),d=t?.name??n?.label??n?.id??n?.spec??a(`marketplaceUnknownItem`),f=B(t?.summaryI18n,t?.summary,u)||(n?a(`marketplaceInstalledLocalSummary`):``),p=t?.install.spec??n?.spec??``,m=t?.tags??[],h=n?.id||n?.spec,g=h?i.actionsByTarget.get(h):void 0,_=n?.type===`skill`&&n.source===`workspace`,v=n?.type===`skill`&&n.origin===`marketplace`,y=n?n.enabled===!1||n.runtimeStatus===`disabled`:!1,b=t?.install.spec,x=typeof b==`string`&&r.installingSpecs.has(b);return(0,J.jsxs)(`article`,{onClick:o,className:`group flex h-full min-h-[156px] cursor-pointer flex-col rounded-xl border border-gray-200/60 bg-white p-3.5 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/60`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[(0,J.jsx)(kt,{name:d,fallback:p||a(`marketplaceTypeSkill`),className:`h-9 w-9 rounded-lg text-xs`}),(0,J.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:(0,J.jsx)(jt,{title:d,spec:p})}),(0,J.jsx)(Nt,{record:n,disabled:y})]}),(0,J.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`p`,{className:`line-clamp-2 text-left text-[12px] leading-relaxed text-gray-500`,children:f}),(0,J.jsxs)(`div`,{className:`mt-auto flex min-w-0 items-end justify-between gap-2 pt-2`,children:[(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,J.jsx)(It,{tags:m})}),(0,J.jsx)(Mt,{item:t,record:n,state:{isInstalling:x,canUpdate:v,canUninstall:_,busyAction:g},onInstall:s,onManage:c})]})]})]})}function It({tags:e}){let t=e.filter(Lt).slice(0,3);return t.length===0?null:(0,J.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-1.5 overflow-hidden`,children:t.map(e=>(0,J.jsx)(`span`,{className:`max-w-[104px] truncate rounded-md bg-gray-100 px-2 py-0.5 text-[11px] font-medium leading-5 text-gray-500`,children:e},e))})}function Lt(e){let t=e.trim().toLowerCase();return t.length>0&&t!==`skill`}function Rt({model:e,showTitle:t,operationState:n,scroll:r,actions:i}){let{scope:a,entries:s,header:c,status:l,emptyLabel:u,errorLabel:d}=e,{showSkeleton:f,isRefreshing:p,error:m}=l,{hasMore:h,loadingMore:g,sentinelRef:_}=r,{installState:v,manageState:y}=n,{onOpen:b,onInstall:x,onManage:S}=i;return(0,J.jsxs)(`section`,{className:o(`flex min-h-full flex-col`,t&&`gap-3`),children:[t&&(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`h3`,{className:`text-[14px] font-semibold text-gray-950`,children:c.title}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-gray-500`,children:[p&&(0,J.jsx)(`span`,{className:`font-medium text-primary`,children:c.refreshingLabel}),(0,J.jsx)(`span`,{children:c.summary})]})]}),m&&(0,J.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 p-4 text-sm text-rose-700`,children:[d,`: `,m.message]}),p&&(0,J.jsx)(`div`,{"data-testid":`marketplace-list-refreshing`,className:`h-0.5 overflow-hidden rounded-full bg-primary/10`,children:(0,J.jsx)(`div`,{className:`h-full w-1/3 animate-pulse rounded-full bg-primary`})}),(0,J.jsxs)(`div`,{"data-testid":f?`marketplace-list-skeleton`:void 0,className:o(`grid grid-cols-1 gap-2.5 md:grid-cols-2 xl:grid-cols-3`,f&&`min-h-0 flex-1 auto-rows-[156px] content-start`),children:[f&&(0,J.jsx)(V,{count:36}),!f&&!m&&s.map(e=>(0,J.jsx)(Ft,{item:e.item,record:e.record,installState:v,manageState:y,onOpen:()=>b(e.item,e.record),onInstall:x,onManage:S},e.key))]}),!f&&!m&&s.length===0&&(0,J.jsx)(`div`,{className:`py-8 text-center text-[13px] text-gray-500`,children:u}),a===`all`&&!f&&!m&&(0,J.jsx)(Le,{hasMore:h,loading:g,sentinelRef:_})]})}function zt(e){let{entry:t,language:n,localeFallbacks:r,installState:i,layout:s=`rail`,onOpen:c,onInstall:l}=e,{item:u,record:d}=t,f=B(u.summaryI18n,u.summary,r),p=u.install.spec,m=i.installingSpecs.has(p),h=!!d;return(0,J.jsxs)(`article`,{onClick:()=>c(t),className:o(`group flex min-h-[166px] cursor-pointer flex-col justify-between rounded-xl border border-gray-200/70 bg-white p-3 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/60`,s===`rail`?`w-[260px] shrink-0`:`w-full min-w-0`),children:[(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,J.jsxs)(`div`,{className:`mb-2.5 flex min-w-0 items-start gap-2.5`,children:[(0,J.jsx)(kt,{name:u.name,fallback:u.install.spec}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,J.jsx)(`div`,{className:`truncate text-[13px] font-semibold leading-tight text-gray-950`,children:u.name}),(0,J.jsx)(`div`,{className:`mt-0.5 truncate text-[11px] font-mono leading-tight text-gray-400`,children:Bt(u)})]})]}),(0,J.jsx)(`p`,{className:`line-clamp-2 text-[12px] leading-relaxed text-gray-500`,children:f}),(0,J.jsx)(Vt,{tags:u.tags})]}),(0,J.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 border-t border-gray-100 pt-2.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate text-[11px] text-gray-400`,children:Ut(u.updatedAt)}),h?(0,J.jsxs)(`span`,{className:`inline-flex h-7 items-center gap-1.5 text-[11px] font-semibold text-emerald-700`,children:[(0,J.jsx)(O,{className:`h-3.5 w-3.5`}),Wt({zh:`已安装`,en:`Installed`},n)]}):(0,J.jsxs)(`button`,{type:`button`,disabled:m,onClick:e=>{e.stopPropagation(),l(u)},className:`inline-flex h-7 items-center gap-1.5 rounded-md border border-gray-200 bg-white px-2 text-[11px] font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 disabled:opacity-50`,children:[(0,J.jsx)(qe,{className:`h-3.5 w-3.5`}),a(m?`marketplaceInstalling`:`marketplaceInstall`)]})]})]})}function Bt(e){return e.slug||e.install.spec}function Vt({tags:e}){let t=e.filter(Ht).slice(0,2);return t.length===0?null:(0,J.jsx)(`div`,{className:`mt-auto truncate pt-2 text-[11px] font-medium text-gray-400`,children:t.join(` / `)})}function Ht(e){let t=e.trim().toLowerCase();return t.length>0&&t!==`skill`}function Ut(e){return e.slice(0,10)||e}function Wt(e,t){return t.startsWith(`zh`)?e.zh:e.en}var Gt=[{scene:`development-debugging`,title:{zh:`开发与调试`,en:`Development`},summary:{zh:`代码审查、错误定位、架构分析与交付验证。`,en:`Review, debug, analyze, and verify delivery work.`},icon:ht,tone:`dark`,span:`md:col-span-2`},{scene:`office-collaboration`,title:{zh:`办公协作`,en:`Office Work`},summary:{zh:`连接文档、日历、会议、邮件和团队通信。`,en:`Connect docs, calendars, meetings, mail, and teams.`},icon:ut,tone:`green`,span:`md:col-span-2`},{scene:`writing-content`,title:{zh:`写作与内容`,en:`Writing`},summary:{zh:`把调研、写作、润色和发布组织成连续工作流。`,en:`Turn research, writing, polishing, and publishing into one flow.`},icon:mt,tone:`amber`,span:`md:col-span-2`},{scene:`browser-automation`,title:{zh:`浏览器自动化`,en:`Browser`},summary:{zh:`操作网页、捕获动态内容并验证真实用户路径。`,en:`Operate pages, capture dynamic content, and verify user paths.`},icon:p,tone:`blue`,span:`md:col-span-2`},{scene:`local-environment`,title:{zh:`本地环境`,en:`Local`},summary:{zh:`管理终端、文件、运行时和本地服务。`,en:`Manage shells, files, runtimes, and local services.`},icon:w,tone:`violet`,span:`md:col-span-1`},{scene:`social-platforms`,title:{zh:`社交平台`,en:`Social`},summary:{zh:`处理发布、互动、检索和内容分发。`,en:`Handle posting, interaction, search, and distribution.`},icon:pt,tone:`sky`,span:`md:col-span-1`},{scene:`nextclaw-official`,title:{zh:`NextClaw 官方`,en:`NextClaw Official`},summary:{zh:`优先查看由 NextClaw 维护的原生能力。`,en:`Browse native capabilities maintained by NextClaw.`},icon:et,tone:`teal`,span:`md:col-span-2`}],Kt={icon:et,tone:`dark`,span:`md:col-span-2`},qt={dark:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-stone-600 bg-stone-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},blue:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-cyan-600 bg-cyan-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},green:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-emerald-600 bg-emerald-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},amber:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-amber-600 bg-amber-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},violet:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-violet-500 bg-violet-500 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},sky:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-sky-500 bg-sky-500 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},teal:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-teal-600 bg-teal-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`}},Jt=`grid grid-cols-[repeat(auto-fill,minmax(240px,320px))] justify-start gap-3`;function Yt(e){let{entries:t,scenes:n,isScenesLoading:r,isItemsLoading:i,language:a,installState:o,onOpen:s,onInstall:c,onOpenScene:l}=e,u=z(a),d=[...t].sort((e,t)=>en(e.item,t.item)).slice(0,6);return(0,J.jsxs)(`div`,{className:`mb-4 space-y-5`,children:[(0,J.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,J.jsx)($t,{icon:ft,title:Y({zh:`场景`,en:`Scenes`},a),description:Y({zh:`按使用场景浏览适合的技能组合。`,en:`Browse skills by how you plan to use them.`},a)}),r?(0,J.jsx)(`div`,{"data-testid":`marketplace-scenes-skeleton`,className:`grid auto-rows-[104px] grid-cols-2 gap-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5`,children:(0,J.jsx)(V,{count:Gt.length})}):(0,J.jsx)(`div`,{className:`grid grid-cols-2 gap-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5`,children:n.map(e=>(0,J.jsx)(Xt,{scene:e,language:a,onSelect:l},e.scene))})]}),(i||d.length>0)&&(0,J.jsx)(Qt,{icon:dt,title:Y({zh:`最近更新`,en:`Recently updated`},a),description:Y({zh:`看看生态最近在补齐哪些能力。`,en:`See what the ecosystem has been improving lately.`},a),entries:d,language:a,localeFallbacks:u,isLoading:i,installState:o,onOpen:s,onInstall:c})]})}function Xt(e){let{scene:t,language:n,onSelect:r}=e,i=tn(t.scene),a=i.icon,s=qt[i.tone];return(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(t.scene),className:o(`group flex min-h-[74px] flex-col justify-center rounded-lg border px-3 py-2.5 text-left shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/70`,s.card),children:(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:o(`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border`,s.icon),children:(0,J.jsx)(a,{className:`h-3.5 w-3.5`})}),(0,J.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[13px] font-semibold text-gray-950`,children:nn(t,i,n)}),typeof t.count==`number`&&(0,J.jsx)(`span`,{className:`shrink-0 text-[11px] font-medium text-gray-400`,children:an(t.count,n)})]}),(0,J.jsx)(`p`,{className:o(`mt-1 line-clamp-1 text-[11px] leading-relaxed`,s.text),children:rn(t,i,n)})]})})}function Zt(e){let{scene:t,entries:n,isLoading:r,language:i,localeFallbacks:a,installState:s,onBack:c,onOpen:l,onInstall:u}=e,d=tn(t.scene),f=d.icon,p=qt[d.tone];return(0,J.jsxs)(`section`,{className:`flex min-h-full flex-col`,children:[(0,J.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-start gap-2.5`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:c,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900`,"aria-label":Y({zh:`返回`,en:`Back`},i),children:(0,J.jsx)(Be,{className:`h-4 w-4`})}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:o(`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border`,p.icon),children:(0,J.jsx)(f,{className:`h-4 w-4`})}),(0,J.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[15px] font-semibold text-gray-950`,children:nn(t,d,i)}),(0,J.jsx)(`span`,{className:`shrink-0 text-[11px] font-medium text-gray-400`,children:Y(r?{zh:`加载中`,en:`Loading`}:{zh:`${n.length} 个技能`,en:`${n.length} skills`},i)})]}),(0,J.jsx)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[12px] leading-relaxed text-gray-500`,children:rn(t,d,i)})})]})]}),r?(0,J.jsx)(`div`,{"data-testid":`marketplace-scene-skeleton`,className:o(Jt,`min-h-0 flex-1 auto-rows-[166px] content-start`),children:(0,J.jsx)(V,{count:24})}):n.length>0?(0,J.jsx)(`div`,{className:Jt,children:n.map(e=>(0,J.jsx)(zt,{entry:e,language:i,localeFallbacks:a,installState:s,layout:`grid`,onOpen:l,onInstall:u},e.item.id))}):(0,J.jsx)(`div`,{className:`rounded-lg border border-dashed border-gray-200 py-8 text-center text-[12px] text-gray-500`,children:Y({zh:`这个模块暂无技能。`,en:`No skills in this module yet.`},i)})]})}function Qt(e){let{icon:t,title:n,description:r,entries:i,language:a,localeFallbacks:o,isLoading:s,installState:c,onOpen:l,onInstall:u}=e;return(0,J.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,J.jsx)($t,{icon:t,title:n,description:r}),s?(0,J.jsx)(`div`,{"data-testid":`marketplace-recent-skeleton`,className:`-mx-1 grid auto-rows-[166px] grid-cols-[repeat(4,260px)] gap-2.5 overflow-hidden px-1 pb-1.5`,children:(0,J.jsx)(V,{count:4})}):(0,J.jsx)(`div`,{className:`-mx-1 flex gap-2.5 overflow-x-auto px-1 pb-1.5 custom-scrollbar`,children:i.map(e=>(0,J.jsx)(zt,{entry:e,language:a,localeFallbacks:o,installState:c,onOpen:l,onInstall:u},e.item.id))})]})}function $t({icon:e,title:t,description:n}){return(0,J.jsx)(`div`,{className:`flex items-end justify-between gap-4`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`h3`,{className:`flex items-center gap-2 text-[14px] font-semibold text-gray-950`,children:[(0,J.jsx)(e,{className:`h-4 w-4 text-primary`}),t]}),(0,J.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-relaxed text-gray-500`,children:n})]})})}function en(e,t){let n=Date.parse(e.updatedAt),r=Date.parse(t.updatedAt);return Number.isNaN(n)||Number.isNaN(r)?t.updatedAt.localeCompare(e.updatedAt):r-n}function Y(e,t){return t.startsWith(`zh`)?e.zh:e.en}function tn(e){return Gt.find(t=>t.scene===e)??{scene:e,...Kt}}function nn(e,t,n){return t.title?Y(t.title,n):e.title}function rn(e,t,n){return t.summary?Y(t.summary,n):e.description??e.scene}function an(e,t){return t.startsWith(`zh`)?`${e} 个技能`:`${e} skills`}function on({label:e,className:t,onClick:n}){return(0,J.jsxs)(`button`,{type:`button`,className:o(`inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-1.5 text-[13px] font-medium text-primary transition-colors hover:text-primary-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,t),onClick:n,children:[(0,J.jsx)(Je,{className:`h-3.5 w-3.5`}),e]})}var sn=`https://skillhub.cn/`;function cn(){return(0,J.jsx)(on,{label:a(`marketplaceExternalSkillSourceTitle`),onClick:()=>void nt.openExternalUrl(sn)})}function X(e){return(e??``).trim().toLowerCase()}function Z(e,t){let n=X(t);return n.length>0?`${e}:${n}`:``}function ln(e){let t=new Map;for(let n of e){let e=[n.install.spec,n.slug,n.id];for(let r of e){let e=Z(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function un(e){let t=new Map;for(let n of e){let e=[n.spec,n.id,n.label];for(let r of e){let e=Z(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function dn(e,t){let n=[e.install.spec,e.slug,e.id];for(let r of n){let n=Z(e.type,r);if(!n)continue;let i=t.get(n);if(i)return i}}function fn(e,t){return t.get(Z(e.type,e.spec))||t.get(Z(e.type,e.id))||t.get(Z(e.type,e.label))}function pn(e,t,n,r){let i=X(n);if(!i)return!0;let a=B(t?.summaryI18n,t?.summary,r);return[e.id,e.spec,e.label,t?.name,t?.slug,t?.summary,a,...t?.tags??[]].map(e=>X(e)).filter(Boolean).some(e=>e.includes(i))}function mn(e){let{items:t,installedRecordLookup:n,scene:r,forcedType:i,typeFilter:a,scope:o,searchText:s,query:c,showListSkeleton:l,hasCatalogError:u}=e,d=Ct(a===`skill`),f=(0,G.useMemo)(()=>d.data?.scenes??[],[d.data?.scenes]),p=wt(f,a===`skill`),m=(0,G.useMemo)(()=>f.map(e=>({...e,count:typeof e.count==`number`?e.count:p.get(e.scene)})),[p,f]),h=(0,G.useMemo)(()=>t.map(e=>({item:e,record:dn(e,n)})),[t,n]),g=(0,G.useMemo)(()=>{let e=r?.trim();if(e)return m.find(t=>t.scene===e)??{scene:e,title:e}},[r,m]),_=a===`skill`&&!!r?.trim(),v=a===`skill`&&o===`all`&&!s.trim()&&!c&&!_,y=l||t.length>=4,b=v&&!u&&y&&m.length===0&&d.isLoading;return{entries:h,scenes:m,selectedScene:g,sceneEntries:h,isSceneRoute:_,isScenesLoading:b,showShelves:v&&!u&&y&&(l||m.length>0||b),backPath:i?`/skills`:`/marketplace/skills`,pathPrefix:i?`/skills/scenes`:`/marketplace/skills/scenes`}}function hn(){let e=Et(),t=Dt(),{confirm:n,ConfirmDialog:r}=Ke(),[i,o]=(0,G.useState)(new Set),[s,c]=(0,G.useState)(new Map);return{installState:{installingSpecs:i},manageState:{actionsByTarget:s},handleInstall:async t=>{let n=t.install.spec;if(!i.has(n)){o(e=>new Set(e).add(n));try{await e.mutateAsync({type:t.type,spec:n,kind:t.install.kind,skill:t.slug,installPath:`skills/${t.slug}`})}catch{}finally{o(e=>{let t=new Set(e);return t.delete(n),t})}}},handleManage:async(e,r)=>{let i=e===`update`?r.catalogSlug||r.id||r.spec:r.id||r.spec;if(!(!i||s.has(i))&&!(e===`uninstall`&&!await n({title:`${a(`marketplaceUninstallTitle`)} ${i}?`,description:a(`marketplaceUninstallDescription`),confirmLabel:a(`marketplaceUninstall`),variant:`destructive`}))){c(t=>new Map(t).set(i,e));try{await t.mutateAsync({type:r.type,action:e,id:i,spec:r.spec})}finally{c(e=>{let t=new Map(e);return t.delete(i),t})}}},ConfirmDialog:r}}function gn(e){let t=rt(),n=(0,G.useRef)({byKey:new Map,seq:0});return{openItemDetail:async(r,i)=>{let o=r?.name??i?.label??i?.id??i?.spec??a(`marketplaceUnknownItem`),s=Ie(r?`skill`:`skill-local`,r?.slug??i?.id??i?.spec??o),c=r?`marketplace:${r.type}:${r.slug}`:`marketplace:${i?.type??`unknown`}:${i?.id??i?.spec??o}`,l=a(`marketplaceTypeSkill`);if(!r){R(t,{id:s,title:o,typeLabel:l,spec:i?.spec??`-`,status:`ready`,summary:a(`marketplaceInstalledLocalSummary`),metadataRaw:JSON.stringify(i??{},null,2),contentRaw:`-`});return}let u=n.current.seq+1;n.current.seq=u,n.current.byKey.set(c,u);let d=B(r.summaryI18n,r.summary,e);R(t,{id:s,title:o,typeLabel:l,spec:r.install.spec,status:`loading`,summary:d,tags:r.tags,author:r.author});try{let e=await ce(r.slug);if(n.current.byKey.get(c)!==u)return;R(t,{id:s,title:o,typeLabel:l,spec:r.install.spec,status:`ready`,summary:d,metadataRaw:e.metadataRaw,contentRaw:e.bodyRaw||e.raw,sourceUrl:e.sourceUrl,sourceLabel:`Source (${e.source})`,tags:r.tags,author:r.author},{activate:!1})}catch(e){if(n.current.byKey.get(c)!==u)return;R(t,{id:s,title:o,typeLabel:l,spec:r.install.spec,status:`error`,summary:d,metadataRaw:JSON.stringify({error:e instanceof Error?e.message:String(e)},null,2),contentRaw:a(`marketplaceOperationFailed`)},{activate:!1})}}}}function _n(e){let{scope:t,typeFilter:n,query:r,localeFallbacks:i,catalogView:o,installedView:s,isCatalogLoading:c,isCatalogFetching:l,isCatalogFetchingNextPage:u,catalogError:d,isInstalledLoading:f,installedError:p}=e,m=(0,G.useMemo)(()=>s?.records??[],[s?.records]),h=(0,G.useMemo)(()=>o?.items??[],[o?.items]),g=(0,G.useMemo)(()=>ln(h),[h]),_=(0,G.useMemo)(()=>un(m),[m]),v=(0,G.useMemo)(()=>m.filter(e=>e.type===n).map(e=>({key:`${e.type}:${e.spec}:${e.id??``}`,record:e,item:fn(e,g)})).filter(e=>pn(e.record,e.item,r,i)).sort((e,t)=>vn(e.record,t.record)),[m,n,g,r,i]),y=(0,G.useMemo)(()=>t===`installed`?v:h.map(e=>({key:e.id,item:e,record:dn(e,_)})),[h,v,_,t]),b=t===`all`&&c&&!o||t===`installed`&&f&&!s,x=t===`all`&&!b&&!!o&&l&&!u,S=t===`installed`?f&&!s?a(`loading`):`${v.length} ${a(`marketplaceInstalledSkillsCountSuffix`)}`:o?`${h.length} / ${o.total}`:a(`loading`),C=t===`all`&&d?d:t===`installed`&&p?p:void 0,w={scope:t,entries:y,header:{title:a(t===`installed`?`marketplaceSectionInstalledSkills`:`marketplaceAllSkills`),summary:S,refreshingLabel:a(`marketplaceRefreshingResults`)},status:{showSkeleton:b,isRefreshing:x,error:C},emptyLabel:a(t===`installed`?`marketplaceNoInstalledSkills`:`marketplaceNoSkills`),errorLabel:a(t===`installed`?`marketplaceErrorLoadingInstalledSkills`:`marketplaceErrorLoadingSkillsData`)};return{allItems:h,installedRecordLookup:_,installedTotal:s?.total??0,itemListView:w,showListSkeleton:b,isRefreshingList:x}}function vn(e,t){let n=Date.parse(e.installedAt??``),r=Date.parse(t.installedAt??``);return Number.isNaN(n)||Number.isNaN(r)||n===r?e.spec.localeCompare(t.spec):r-n}var yn=20;function bn({forcedType:e}={}){let t=v(),n=d(),{language:r}=W(),i=`skill`,o=(0,G.useMemo)(()=>z(r),[r]),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(``),[f,p]=(0,G.useState)(`all`),[m,h]=(0,G.useState)(`relevance`),{installState:g,manageState:_,handleInstall:y,handleManage:b,ConfirmDialog:x}=hn(),{openItemDetail:S}=gn(o);(0,G.useEffect)(()=>{let e=setTimeout(()=>{u(s.trim())},250);return()=>clearTimeout(e)},[s]);let C=Tt(i),w=i===`skill`?n.scene?.trim():void 0,T=xt({q:w?void 0:l||void 0,scene:w,type:i,sort:m,pageSize:yn}),{containerRef:E,sentinelRef:D}=Re({disabled:f!==`all`||T.isError||!T.hasNextPage||T.isFetchingNextPage,onLoadMore:()=>T.fetchNextPage(),watchValue:`${i}:${f}:${l}:${w??``}:${m}:${T.data?.loadedItems??0}:${T.data?.loadedPages??0}`});(0,G.useEffect)(()=>{let e=E.current;e&&typeof e.scrollTo==`function`&&e.scrollTo({top:0})},[E,l,w,f,m,i]);let O=_n({scope:f,typeFilter:i,query:l,localeFallbacks:o,catalogView:T.data,installedView:C.data,isCatalogLoading:T.isLoading,isCatalogFetching:T.isFetching,isCatalogFetchingNextPage:T.isFetchingNextPage,catalogError:T.isError?T.error:void 0,isInstalledLoading:C.isLoading,installedError:C.isError?C.error:void 0}),k=mn({items:O.allItems,installedRecordLookup:O.installedRecordLookup,scene:w,forcedType:e,typeFilter:i,scope:f,searchText:s,query:l,showListSkeleton:O.showListSkeleton,hasCatalogError:T.isError});return(0,J.jsxs)(me,{className:`flex h-full min-h-0 flex-col pb-0`,children:[!k.isSceneRoute&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`mb-3 flex items-start justify-between gap-3 border-b border-gray-200/60`,children:[(0,J.jsx)(Ze,{value:f,onValueChange:e=>p(e),children:(0,J.jsxs)(Xe,{className:`mb-0 h-auto flex-1 justify-start gap-6 rounded-none border-b-0 bg-transparent p-0 text-gray-500`,children:[(0,J.jsx)(Ye,{value:`all`,className:`rounded-none border-b-2 border-transparent bg-transparent px-0 pb-3 pt-0 shadow-none hover:bg-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-gray-950 data-[state=active]:shadow-none`,children:a(`marketplaceTabMarketplaceSkills`)}),(0,J.jsxs)(Ye,{value:`installed`,className:`gap-1.5 rounded-none border-b-2 border-transparent bg-transparent px-0 pb-3 pt-0 shadow-none hover:bg-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-gray-950 data-[state=active]:shadow-none`,children:[a(`marketplaceTabInstalledSkills`),(0,J.jsx)(`span`,{className:`text-[11px] font-medium text-gray-500`,children:O.installedTotal})]})]})}),(0,J.jsx)(cn,{})]}),(0,J.jsx)(Ne,{scope:f,searchText:s,isRefreshing:O.isRefreshingList,searchPlaceholder:a(`marketplaceSearchPlaceholderSkills`),sort:m,onSearchTextChange:c,onSortChange:h})]}),(0,J.jsx)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsxs)(`div`,{ref:E,className:`min-h-0 flex-1 overflow-y-auto custom-scrollbar pr-1`,"aria-busy":O.showListSkeleton||T.isFetchingNextPage,children:[k.isSceneRoute&&k.selectedScene&&(0,J.jsx)(Zt,{scene:k.selectedScene,entries:k.sceneEntries,isLoading:O.showListSkeleton,language:r,localeFallbacks:o,installState:g,onBack:()=>t(k.backPath),onOpen:e=>void S(e.item,e.record),onInstall:y}),k.isSceneRoute&&!O.showListSkeleton&&(0,J.jsx)(Le,{hasMore:!!T.hasNextPage,loading:T.isFetchingNextPage,sentinelRef:D}),k.showShelves&&(0,J.jsx)(Yt,{entries:k.entries,scenes:k.scenes,isScenesLoading:k.isScenesLoading,isItemsLoading:O.showListSkeleton,language:r,installState:g,onOpen:e=>void S(e.item,e.record),onInstall:y,onOpenScene:e=>t(`${k.pathPrefix}/${e}`)}),!k.isSceneRoute&&(0,J.jsx)(Rt,{model:O.itemListView,showTitle:k.showShelves||!O.showListSkeleton,operationState:{installState:g,manageState:_},scroll:{hasMore:!!T.hasNextPage,loadingMore:T.isFetchingNextPage,sentinelRef:D},actions:{onOpen:(e,t)=>void S(e,t),onInstall:y,onManage:b}})]})}),(0,J.jsx)(x,{})]})}var xn=`NextClaw`,Sn=[{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`runtimeUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function Cn(e,t){return e===t||e.startsWith(`${t}/`)}function wn(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of Sn)if(Cn(t,e))return a(n);return a(`settings`)}function Tn(e){let t=e.toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t===`::1`||t===`[::1]`||t.startsWith(`127.`)}function En(e){let t=e?.host.trim(),n=e?.hostname.trim(),r=e?.port.trim();return!t||!n?null:Tn(n)?r||null:t}function Dn(e,t){let n=En(t);return`${xn}${n?` ${n}`:``} - ${wn(e)}`}var On={...u,...ze};function kn({children:e,sideDockManager:t}){let{isOpen:n,mode:r}=rt();We();let{pathname:i}=b(),{language:a}=W(),{isMobile:o}=Qe(),s=S(),c=f(e=>e.isVisible);f(e=>e.pinnedItems);let l={getDockState:t.getDockState,pinTab:t.pinTab,unpinTab:t.unpinTab};return(0,G.useEffect)(()=>{document.title=Dn(i,window.location)},[i,a]),o&&s!==`win32`?(0,J.jsx)(T,{pathname:i,isDocBrowserOpen:n,docBrowserDockControls:l,docBrowserRenderers:On,topbarLeadingInset:s===`darwin`?`4.75rem`:void 0,children:e}):(0,J.jsx)(ee,{pathname:i,isMobileLayout:o,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:l,docBrowserRenderers:On,sideDock:c?(0,J.jsx)(x,{manager:t}):null,children:e})}function An({children:e}){let t=D();return(0,J.jsx)(it,{manager:t.docBrowserManager,children:(0,J.jsx)(kn,{sideDockManager:t.sideDockManager,children:e})})}function jn(){let{isMobile:e}=Qe();return e?(0,J.jsx)(g,{}):(0,J.jsx)(_,{to:`/model`,replace:!0})}function Mn(e){let t=e.trim().toLowerCase();return t?!t.startsWith(`skills`):!0}function Nn(e,t){t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function Pn(e,t){e&&Mn(t)&&e.invalidateQueries({queryKey:[`config`]}),Nn(e,t)}function Fn(e){let t=(0,G.useRef)(!1);(0,G.useEffect)(()=>{let n=F.eventBus.on(N.connectionOpen,()=>{j.handleConnectionRestored(),A.refreshAfterRealtimeReconnect(),t.current&&(t.current=!1,e?.invalidateQueries({queryKey:[`ncp-sessions`]}))}),r=F.eventBus.on(N.connectionClose,()=>{j.handleConnectionInterrupted(null),t.current=!0}),i=F.eventBus.on(N.connectionError,e=>{j.handleConnectionInterrupted(e?.message??null),t.current=!0}),a=F.eventBus.on(N.configUpdated,({path:t})=>{Pn(e,t)}),o=F.eventBus.on(N.runtimeUpdateSnapshot,e=>{A.reportSnapshot(e)}),s=F.eventBus.on(N.sessionRunStatus,t=>{L(e,{type:`session.run-status`,payload:t})}),c=F.eventBus.on(N.sessionSummaryUpsert,t=>{L(e,{type:`session.summary.upsert`,payload:t})}),l=F.eventBus.on(N.sessionSummaryDelete,t=>{L(e,{type:`session.summary.delete`,payload:t})}),u=F.eventBus.on(N.error,e=>{console.error(`Realtime transport error:`,e.message)});return()=>{n(),r(),i(),a(),o(),s(),c(),l(),u()}},[e])}var In=(0,G.lazy)(async()=>({default:(await s(async()=>{let{ModelConfigPage:e}=await import(`./model-config-page-BbWbW_qM.js`);return{ModelConfigPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))).ModelConfigPage})),Ln=(0,G.lazy)(async()=>({default:(await s(async()=>{let{AppearanceSettingsPage:e}=await import(`./appearance-settings-page-DFm3BbEb.js`);return{AppearanceSettingsPage:e}},__vite__mapDeps([18,19,1,20,5,3,7,21,8,2,22,23,24,25,26,27,13,14,4,28,29,30,10,31,32,11,12,33,34,35,9,36,37]))).AppearanceSettingsPage})),Q=(0,G.lazy)(async()=>({default:(await s(async()=>{let{ChatPage:e}=await import(`./chat-page-Cw9uDhD_.js`);return{ChatPage:e}},__vite__mapDeps([38,1,5,3,19,20,7,21,8,2,22,23,24,25,26,27,13,14,4,28,29,30,10,31,32,11,12,33,34,35,9,36,6,39,40,16]))).ChatPage})),Rn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{SearchConfigPage:e}=await import(`./search-config-page-H7ug8f4D.js`);return{SearchConfigPage:e}},__vite__mapDeps([41,1,7,5,3,2,24,25,32,14,42,15,16]))).SearchConfigPage})),zn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{ProvidersConfigPage:e}=await import(`./providers-config-page-xwIjGur2.js`);return{ProvidersConfigPage:e}},__vite__mapDeps([43,1,5,3,7,21,8,2,22,24,39,30,32,14,26,33,34,42,15,16,17,35,9]))).ProvidersConfigPage})),Bn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{ChannelsList:e}=await import(`./channels-list-page-DOaPKNJA.js`);return{ChannelsList:e}},__vite__mapDeps([44,1,5,3,7,2,24,4,25,31,32,14,11,22,34,42,40,15,16,17]))).ChannelsList})),Vn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{RuntimeConfig:e}=await import(`./runtime-config-page-DTsi7czJ.js`);return{RuntimeConfig:e}},__vite__mapDeps([45,1,19,20,5,3,7,21,8,2,22,23,24,25,26,27,13,14,4,28,29,30,10,31,32,11,12,33,34,35,9,36,46,47,37,15,16]))).RuntimeConfig})),Hn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-2SjMfCMl.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([48,7,1,5,3,2,29,25,27,46,35]))).DesktopUpdateConfig})),Un=(0,G.lazy)(async()=>({default:(await s(async()=>{let{SecurityConfig:e}=await import(`./security-config-Cr2ERKLu.js`);return{SecurityConfig:e}},__vite__mapDeps([49,2,1,3]))).SecurityConfig})),Wn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{SecretsConfigPage:e}=await import(`./secrets-config-page-C1_6rINu.js`);return{SecretsConfigPage:e}},__vite__mapDeps([50,1,7,5,3,2,26,47,33,15,16]))).SecretsConfigPage})),Gn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{RemoteAccessPage:e}=await import(`./remote-B9F2uCk9.js`);return{RemoteAccessPage:e}},__vite__mapDeps([51,19,1,20,5,3,7,21,8,2,22,23,24,25,26,27,13,14,4,28,29,30,10,31,32,11,12,33,34,35,9,36]))).RemoteAccessPage})),Kn=(0,G.lazy)(async()=>({default:(await s(async()=>{let{McpMarketplacePage:e}=await import(`./mcp-marketplace-page-CXHYO95j.js`);return{McpMarketplacePage:e}},__vite__mapDeps([52,53,1,5,3,7,21,8,2,22,28,23,24,25,26,27,13,14,11,12,40]))).McpMarketplacePage}));function qn(){return(0,J.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function Jn({children:e}){return(0,J.jsx)(G.Suspense,{fallback:(0,J.jsx)(qn,{}),children:e})}function $(e){return(0,J.jsx)(Jn,{children:e})}var Yn=[{path:`/chat/skills`,redirectTo:`/skills`},{path:`/chat/cron`,redirectTo:`/cron`},{path:`/chat/agents`,redirectTo:`/agents`},{path:`/chat/:sessionId?`,element:$((0,J.jsx)(Q,{view:`chat`}))},{path:`/agents`,element:$((0,J.jsx)(Q,{view:`agents`}))},{path:`/skills`,element:$((0,J.jsx)(Q,{view:`skills`}))},{path:`/skills/scenes/:scene`,element:$((0,J.jsx)(Q,{view:`skills`}))},{path:`/cron`,element:$((0,J.jsx)(Q,{view:`cron`}))},{path:`/appearance`,element:$((0,J.jsx)(Ln,{}))},{path:`/model`,element:$((0,J.jsx)(In,{}))},{path:`/search`,element:$((0,J.jsx)(Rn,{}))},{path:`/providers`,element:$((0,J.jsx)(zn,{}))},{path:`/channels`,element:$((0,J.jsx)(Bn,{}))},{path:`/runtime`,element:$((0,J.jsx)(Vn,{}))},{path:`/updates`,element:$((0,J.jsx)(Hn,{}))},{path:`/remote`,element:$((0,J.jsx)(Gn,{}))},{path:`/security`,element:$((0,J.jsx)(Un,{}))},{path:`/secrets`,element:$((0,J.jsx)(Wn,{}))},{path:`/language`,element:(0,J.jsx)(y,{})},{path:`/settings`,element:(0,J.jsx)(jn,{})},{path:`/marketplace/skills`,redirectTo:`/skills`},{path:`/marketplace`,redirectTo:`/skills`},{path:`/marketplace/mcp`,element:$((0,J.jsx)(Kn,{}))},{path:`/`,redirectTo:`/chat`},{path:`*`,redirectTo:`/chat`}];function Xn(e){return`redirectTo`in e?(0,J.jsx)(E,{path:e.path,element:(0,J.jsx)(_,{to:e.redirectTo,replace:!0})},e.path):(0,J.jsx)(E,{path:e.path,element:e.element},e.path)}function Zn(){return(0,J.jsx)(C,{children:Yn.map(Xn)})}function Qn(){return Fn(we),ue(),(0,G.useEffect)(()=>(A.start(),()=>{A.stop()}),[]),(0,J.jsxs)(k,{children:[(0,J.jsx)(An,{children:(0,J.jsx)(Zn,{})}),(0,J.jsx)(c,{}),(0,J.jsx)(l,{})]})}function $n(){let e=ge(),t=e.isError&&je(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,J.jsx)(Qn,{}):e.data?.enabled&&!e.data.authenticated?(0,J.jsx)(ie,{username:e.data.username}):(0,J.jsx)(Qn,{})}function er(){return(0,G.useEffect)(()=>{re()},[]),(0,J.jsxs)(be,{client:we,children:[(0,J.jsx)($n,{}),(0,J.jsx)(m,{}),(0,J.jsx)(De,{position:`top-right`,richColors:!0,offset:window.nextclawDesktop?.platform===`win32`?56:void 0,mobileOffset:window.nextclawDesktop?.platform===`win32`?56:void 0})]})}var tr=window.nextclawDesktop?.platform===`win32`?h:te;(0,gt.createRoot)(document.getElementById(`root`)).render((0,J.jsx)(G.StrictMode,{children:(0,J.jsx)(ne,{children:(0,J.jsx)(Ge,{children:(0,J.jsx)(tr,{children:(0,J.jsx)(er,{})})})})}));export{bn as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-A3jEqwzn.js";import{n as e}from"./chunk-BIQX33UG-BZRV20pI.js";export{e as createInfoServices};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{m as t}from"./src-Dad2ZbCt.js";import{c as n}from"./chunk-WYO6CB5R-Do6SJrnY.js";import{t as r}from"./chunk-VAUOI2AC-Dpcz6BhT.js";import{n as i}from"./mermaid-parser.core-Cue18vLo.js";var a={parse:e(async e=>{let n=await i(`info`,e);t.debug(n)},`parse`)},o={version:`11.16.0`},s={parser:a,db:{getVersion:e(()=>o.version,`getVersion`)},renderer:{draw:e((e,i,a)=>{t.debug(`rendering info diagram
|
|
2
|
+
`+e);let o=r(i);n(o,100,400,!0),o.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${a}`)},`draw`)}};export{s as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}export{e as t};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import"./src-Dad2ZbCt.js";import{H as t,K as n,U as r,a as i,c as a,s as o,v as s,w as c,x as l,y as u}from"./chunk-WYO6CB5R-Do6SJrnY.js";import{p as d}from"./chunk-ICXQ74PX-DH8NJMok.js";import{t as f}from"./chunk-VAUOI2AC-Dpcz6BhT.js";import{t as p}from"./rough.esm-wJ1d3nQl.js";var m=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,14],i=[1,12],a=[1,13],o=[6,7,8],s=[1,20],c=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`ISHIKAWA`,11:`EOF`,13:`SPACELIST`,14:`TEXT`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim());break}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:a},t(o,[2,3]),{1:[2,2]},t(o,[2,4]),t(o,[2,5]),{1:[2,6],6:r,12:15,13:i,14:a},{6:r,9:16,12:11,13:i,14:a},{6:s,7:c,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:c,10:22,11:l},{1:[2,7],6:r,12:15,13:i,14:a},t(d,[2,14],{7:f,11:p}),t(m,[2,8]),t(m,[2,9]),t(m,[2,10]),t(u,[2,15]),t(d,[2,13],{7:f,11:p}),t(m,[2,11]),t(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},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`)};h.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(e,t,n,r){switch(n){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}})();function g(){this.yy={}}return e(g,`Parser`),g.prototype=h,h.Parser=g,new g})();m.parser=m;var h=m,g=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,`IshikawaDB`)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,i()}getRoot(){return this.root}addNode(e,t){let r=o.sanitizeText(t,l());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],n(r);return}this.baseLevel??=e;let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();let a=this.stack[this.stack.length-1].node,s={text:r,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return u()}setAccTitle(e){r(e)}getAccDescription(){return s()}setAccDescription(e){t(e)}getDiagramTitle(){return c()}setDiagramTitle(e){n(e)}},_=14,v=250,y=30,b=60,x=5,S=82*Math.PI/180,C=Math.cos(S),w=Math.sin(S),T=e((e,t,n)=>{let r=e.node().getBBox(),i=r.width+t*2,o=r.height+t*2;a(e,o,i,n),e.attr(`viewBox`,`${r.x-t} ${r.y-t} ${i} ${o}`)},`applyPaddedViewBox`),E=e((e,t,n,r)=>{let i=r.db.getRoot();if(!i)return;let a=l(),{look:o,handDrawnSeed:s,themeVariables:c}=a,u=d(a.fontSize)[0]??_,m=o===`handDrawn`,h=i.children??[],g=a.ishikawa?.diagramPadding??20,y=a.ishikawa?.useMaxWidth??!1,b=f(t),x=b.append(`g`).attr(`class`,`ishikawa`),S=m?p.svg(b.node()):void 0,C=S?{roughSvg:S,seed:s??0,lineColor:c?.lineColor??`#333`,fillColor:c?.mainBkg??`#fff`}:void 0,w=`ishikawa-arrow-${t}`;m||x.append(`defs`).append(`marker`).attr(`id`,w).attr(`viewBox`,`0 0 10 10`).attr(`refX`,0).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 Z`).attr(`class`,`ishikawa-arrow`);let E=0,k=v,A=m?void 0:L(x,E,k,E,k,`ishikawa-spine`);if(O(x,E,k,i.text,u,C),!h.length){m&&L(x,E,k,E,k,`ishikawa-spine`,C),T(b,g,y);return}E-=20;let j=h.filter((e,t)=>t%2==0),N=h.filter((e,t)=>t%2==1),P=D(j),F=D(N),I=P.total+F.total,R=v,z=v;if(I>0){let e=v*2,t=v*.3;R=Math.max(t,e*(P.total/I)),z=Math.max(t,e*(F.total/I))}let B=u*2;R=Math.max(R,P.max*B),z=Math.max(z,F.max*B),k=Math.max(R,v),A&&A.attr(`y1`,k).attr(`y2`,k),x.select(`.ishikawa-head-group`).attr(`transform`,`translate(0,${k})`);let V=Math.ceil(h.length/2);for(let e=0;e<V;e++){let t=x.append(`g`).attr(`class`,`ishikawa-pair`);for(let[n,r,i]of[[h[e*2],-1,R],[h[e*2+1],1,z]])n&&M(t,n,E,k,r,i,u,C);E=t.selectAll(`text`).nodes().reduce((e,t)=>Math.min(e,t.getBBox().x),1/0)}if(m)L(x,E,k,0,k,`ishikawa-spine`,C);else{A.attr(`x1`,E);let e=`url(#${w})`;x.selectAll(`line.ishikawa-branch, line.ishikawa-sub-branch`).attr(`marker-start`,e)}T(b,g,y)},`draw`),D=e(t=>{let n=e(e=>e.children.reduce((e,t)=>e+1+n(t),0),`countDescendants`);return t.reduce((e,t)=>{let r=n(t);return e.total+=r,e.max=Math.max(e.max,r),e},{total:0,max:0})},`sideStats`),O=e((e,t,n,r,i,a)=>{let o=Math.max(6,Math.floor(110/(i*.6))),s=e.append(`g`).attr(`class`,`ishikawa-head-group`).attr(`transform`,`translate(${t},${n})`),c=F(s,P(r,o),0,0,`ishikawa-head-label`,`start`,i),l=c.node().getBBox(),u=Math.max(60,l.width+6),d=Math.max(40,l.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${u*2.4} 0 0 ${-d/2} Z`;if(a){let e=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-head`)}else s.insert(`path`,`:first-child`).attr(`class`,`ishikawa-head`).attr(`d`,f);c.attr(`transform`,`translate(${(u-l.width)/2-l.x+3},${-l.y-l.height/2})`)},`drawHead`),k=e((t,n)=>{let r=[],i=[],a=e((e,t,o)=>{let s=n===-1?[...e].reverse():e;for(let e of s){let n=r.length,s=e.children??[];r.push({depth:o,text:P(e.text,15),parentIndex:t,childCount:s.length}),o%2==0?(i.push(n),s.length&&a(s,n,o+1)):(s.length&&a(s,n,o+1),i.push(n))}},`walk`);return a(t,-1,2),{entries:r,yOrder:i}},`flattenTree`),A=e((e,t,n,r,i,a,o)=>{let s=e.append(`g`).attr(`class`,`ishikawa-label-group`),c=F(s,t,n,r+11*i,`ishikawa-label cause`,`middle`,a).node().getBBox();if(o){let e=o.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-label-box`)}else s.insert(`rect`,`:first-child`).attr(`class`,`ishikawa-label-box`).attr(`x`,c.x-20).attr(`y`,c.y-2).attr(`width`,c.width+40).attr(`height`,c.height+4)},`drawCauseLabel`),j=e((e,t,n,r,i,a)=>{let o=Math.sqrt(r*r+i*i);if(o===0)return;let s=r/o,c=i/o,l=-c*6,u=s*6,d=t,f=n,p=`M ${d} ${f} L ${d-s*6*2+l} ${f-c*6*2+u} L ${d-s*6*2-l} ${f-c*6*2-u} Z`,m=a.roughSvg.path(p,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:`solid`,stroke:a.lineColor,strokeWidth:1});e.append(()=>m)},`drawArrowMarker`),M=e((e,t,n,r,i,a,o,s)=>{let c=t.children??[],l=a*(c.length?1:.2),u=-C*l,d=w*l*i,f=n+u,p=r+d;if(L(e,n,r,f,p,`ishikawa-branch`,s),s&&j(e,n,r,n-f,r-p,s),A(e,t.text,f,p,i,o,s),!c.length)return;let{entries:m,yOrder:h}=k(c,i),g=m.length,_=Array(g);for(let[e,t]of h.entries())_[t]=r+d*((e+1)/(g+1));let v=new Map;v.set(-1,{x0:n,y0:r,x1:f,y1:p,childCount:c.length,childrenDrawn:0});let S=-C,T=w*i,E=i<0?`ishikawa-label up`:`ishikawa-label down`;for(let[t,n]of m.entries()){let r=_[t],i=v.get(n.parentIndex),a=e.append(`g`).attr(`class`,`ishikawa-sub-group`),c=0,l=0,u=0;if(n.depth%2==0){let e=i.y1-i.y0;c=I(i.x0,i.x1,e?(r-i.y0)/e:.5),l=r,u=c-(n.childCount>0?b+n.childCount*x:y),L(a,c,r,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,r,1,0,s),F(a,n.text,u,r,`ishikawa-label align`,`end`,o)}else{let e=i.childrenDrawn++;c=I(i.x0,i.x1,(i.childCount-e)/(i.childCount+1)),l=i.y0,u=c+S*((r-l)/T),L(a,c,l,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,l,c-u,l-r,s),F(a,n.text,u,r,E,`end`,o)}n.childCount>0&&v.set(t,{x0:c,y0:l,x1:u,y1:r,childCount:n.childCount,childrenDrawn:0})}},`drawBranch`),N=e(e=>e.split(/<br\s*\/?>|\n/),`splitLines`),P=e((e,t)=>{if(e.length<=t)return e;let n=[];for(let r of e.split(/\s+/)){let e=n.length-1;e>=0&&n[e].length+1+r.length<=t?n[e]+=` `+r:n.push(r)}return n.join(`
|
|
7
|
+
`)},`wrapText`),F=e((e,t,n,r,i,a,o)=>{let s=N(t),c=o*1.05,l=e.append(`text`).attr(`class`,i).attr(`text-anchor`,a).attr(`x`,n).attr(`y`,r-(s.length-1)*c/2);for(let[e,t]of s.entries())l.append(`tspan`).attr(`x`,n).attr(`dy`,e===0?0:c).text(t);return l},`drawMultilineText`),I=e((e,t,n)=>e+(t-e)*n,`lerp`),L=e((e,t,n,r,i,a,o)=>{if(o){let s=o.roughSvg.line(t,n,r,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});e.append(()=>s).attr(`class`,a);return}return e.append(`line`).attr(`class`,a).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i)},`drawLine`),R={parser:h,get db(){return new g},renderer:{draw:E},styles:e(e=>`
|
|
8
|
+
.ishikawa .ishikawa-spine,
|
|
9
|
+
.ishikawa .ishikawa-branch,
|
|
10
|
+
.ishikawa .ishikawa-sub-branch {
|
|
11
|
+
stroke: ${e.lineColor};
|
|
12
|
+
stroke-width: 2;
|
|
13
|
+
fill: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ishikawa .ishikawa-sub-branch {
|
|
17
|
+
stroke-width: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ishikawa .ishikawa-arrow {
|
|
21
|
+
fill: ${e.lineColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ishikawa .ishikawa-head {
|
|
25
|
+
fill: ${e.mainBkg};
|
|
26
|
+
stroke: ${e.lineColor};
|
|
27
|
+
stroke-width: 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ishikawa .ishikawa-label-box {
|
|
31
|
+
fill: ${e.mainBkg};
|
|
32
|
+
stroke: ${e.lineColor};
|
|
33
|
+
stroke-width: 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ishikawa text {
|
|
37
|
+
font-family: ${e.fontFamily};
|
|
38
|
+
font-size: ${e.fontSize};
|
|
39
|
+
fill: ${e.textColor};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ishikawa .ishikawa-head-label {
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
text-anchor: middle;
|
|
45
|
+
dominant-baseline: middle;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ishikawa .ishikawa-label {
|
|
50
|
+
text-anchor: end;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ishikawa .ishikawa-label.cause {
|
|
54
|
+
text-anchor: middle;
|
|
55
|
+
dominant-baseline: middle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ishikawa .ishikawa-label.align {
|
|
59
|
+
text-anchor: end;
|
|
60
|
+
dominant-baseline: middle;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ishikawa .ishikawa-label.up {
|
|
64
|
+
dominant-baseline: baseline;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ishikawa .ishikawa-label.down {
|
|
68
|
+
dominant-baseline: hanging;
|
|
69
|
+
}
|
|
70
|
+
`,`getStyles`)};export{R as diagram};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{p as t}from"./src-Dad2ZbCt.js";import{H as n,K as r,U as i,a,c as o,v as s,w as c,x as l,y as u}from"./chunk-WYO6CB5R-Do6SJrnY.js";import{t as d}from"./arc-DFELHWM2.js";import{t as f}from"./chunk-5VM5RSS4-C3XB05yh.js";import{a as p,n as m,o as h,s as g}from"./chunk-32BRIVSS-kG3lg0bC.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,11,12,14,16,17,18],r=[1,9],i=[1,10],a=[1,11],o=[1,12],s=[1,13],c=[1,14],l={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:15,11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,5]),t(n,[2,6]),t(n,[2,8]),{13:[1,16]},{15:[1,17]},t(n,[2,11]),t(n,[2,12]),{19:[1,18]},t(n,[2,4]),t(n,[2,9]),t(n,[2,10]),t(n,[2,13])],defaultActions:{},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`)};l.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(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin(`acc_title`),12;case 8:return this.popState(),`acc_title_value`;case 9:return this.begin(`acc_descr`),14;case 10:return this.popState(),`acc_descr_value`;case 11:this.begin(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 17;case 15:return 18;case 16:return 19;case 17:return`:`;case 18:return 6;case 19:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}})();function u(){this.yy={}}return e(u,`Parser`),u.prototype=l,l.Parser=u,new u})();_.parser=_;var v=_,y=``,b=[],x=[],S=[],C=e(function(){b.length=0,x.length=0,y=``,S.length=0,a()},`clear`),w=e(function(e){y=e,b.push(e)},`addSection`),T=e(function(){return b},`getSections`),E=e(function(){let e=A(),t=0;for(;!e&&t<100;)e=A(),t++;return x.push(...S),x},`getTasks`),D=e(function(){let e=[];return x.forEach(t=>{t.people&&e.push(...t.people)}),[...new Set(e)].sort()},`updateActors`),O=e(function(e,t){let n=t.substr(1).split(`:`),r=0,i=[];n.length===1?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(`,`));let a=i.map(e=>e.trim()),o={section:y,type:y,people:a,task:e,score:r};S.push(o)},`addTask`),k=e(function(e){let t={section:y,type:y,description:e,task:e,classes:[]};x.push(t)},`addTaskOrg`),A=e(function(){let t=e(function(e){return S[e].processed},`compileTask`),n=!0;for(let[e,r]of S.entries())t(e),n&&=r.processed;return n},`compileTasks`),j={getConfig:e(()=>l().journey,`getConfig`),clear:C,setDiagramTitle:r,getDiagramTitle:c,setAccTitle:i,getAccTitle:u,setAccDescription:n,getAccDescription:s,addSection:w,getSections:T,getTasks:E,addTask:O,addTaskOrg:k,getActors:e(function(){return D()},`getActors`)},M=e(e=>`.label {
|
|
7
|
+
font-family: ${e.fontFamily};
|
|
8
|
+
color: ${e.textColor};
|
|
9
|
+
}
|
|
10
|
+
.mouth {
|
|
11
|
+
stroke: #666;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
line {
|
|
15
|
+
stroke: ${e.textColor}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.legend {
|
|
19
|
+
fill: ${e.textColor};
|
|
20
|
+
font-family: ${e.fontFamily};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label text {
|
|
24
|
+
fill: #333;
|
|
25
|
+
}
|
|
26
|
+
.label {
|
|
27
|
+
color: ${e.textColor}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.face {
|
|
31
|
+
${e.faceColor?`fill: ${e.faceColor}`:`fill: #FFF8DC`};
|
|
32
|
+
stroke: #999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.node rect,
|
|
36
|
+
.node circle,
|
|
37
|
+
.node ellipse,
|
|
38
|
+
.node polygon,
|
|
39
|
+
.node path {
|
|
40
|
+
fill: ${e.mainBkg};
|
|
41
|
+
stroke: ${e.nodeBorder};
|
|
42
|
+
stroke-width: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.node .label {
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
.node.clickable {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.arrowheadPath {
|
|
53
|
+
fill: ${e.arrowheadColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edgePath .path {
|
|
57
|
+
stroke: ${e.lineColor};
|
|
58
|
+
stroke-width: 1.5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.flowchart-link {
|
|
62
|
+
stroke: ${e.lineColor};
|
|
63
|
+
fill: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.edgeLabel {
|
|
67
|
+
background-color: ${e.edgeLabelBackground};
|
|
68
|
+
rect {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cluster rect {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cluster text {
|
|
78
|
+
fill: ${e.titleColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.mermaidTooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
text-align: center;
|
|
84
|
+
max-width: 200px;
|
|
85
|
+
padding: 2px;
|
|
86
|
+
font-family: ${e.fontFamily};
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
background: ${e.tertiaryColor};
|
|
89
|
+
border: 1px solid ${e.border2};
|
|
90
|
+
border-radius: 2px;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
z-index: 100;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.task-type-0, .section-type-0 {
|
|
96
|
+
${e.fillType0?`fill: ${e.fillType0}`:``};
|
|
97
|
+
}
|
|
98
|
+
.task-type-1, .section-type-1 {
|
|
99
|
+
${e.fillType0?`fill: ${e.fillType1}`:``};
|
|
100
|
+
}
|
|
101
|
+
.task-type-2, .section-type-2 {
|
|
102
|
+
${e.fillType0?`fill: ${e.fillType2}`:``};
|
|
103
|
+
}
|
|
104
|
+
.task-type-3, .section-type-3 {
|
|
105
|
+
${e.fillType0?`fill: ${e.fillType3}`:``};
|
|
106
|
+
}
|
|
107
|
+
.task-type-4, .section-type-4 {
|
|
108
|
+
${e.fillType0?`fill: ${e.fillType4}`:``};
|
|
109
|
+
}
|
|
110
|
+
.task-type-5, .section-type-5 {
|
|
111
|
+
${e.fillType0?`fill: ${e.fillType5}`:``};
|
|
112
|
+
}
|
|
113
|
+
.task-type-6, .section-type-6 {
|
|
114
|
+
${e.fillType0?`fill: ${e.fillType6}`:``};
|
|
115
|
+
}
|
|
116
|
+
.task-type-7, .section-type-7 {
|
|
117
|
+
${e.fillType0?`fill: ${e.fillType7}`:``};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.actor-0 {
|
|
121
|
+
${e.actor0?`fill: ${e.actor0}`:``};
|
|
122
|
+
}
|
|
123
|
+
.actor-1 {
|
|
124
|
+
${e.actor1?`fill: ${e.actor1}`:``};
|
|
125
|
+
}
|
|
126
|
+
.actor-2 {
|
|
127
|
+
${e.actor2?`fill: ${e.actor2}`:``};
|
|
128
|
+
}
|
|
129
|
+
.actor-3 {
|
|
130
|
+
${e.actor3?`fill: ${e.actor3}`:``};
|
|
131
|
+
}
|
|
132
|
+
.actor-4 {
|
|
133
|
+
${e.actor4?`fill: ${e.actor4}`:``};
|
|
134
|
+
}
|
|
135
|
+
.actor-5 {
|
|
136
|
+
${e.actor5?`fill: ${e.actor5}`:``};
|
|
137
|
+
}
|
|
138
|
+
${f()}
|
|
139
|
+
`,`getStyles`),N=e(function(e,t){return p(e,t)},`drawRect`),P=e(function(t,n){let r=t.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=t.append(`g`);i.append(`circle`).attr(`cx`,n.cx-15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=d().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}e(a,`smile`);function o(e){let t=d().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}e(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return e(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),F=e(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),I=e(function(e,t){return h(e,t)},`drawText`),L=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,I(t,n)},`drawLabel`),R=e(function(e,t,n){let r=e.append(`g`),i=g();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,N(r,i),H(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),z=-1,B=e(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);z++,a.append(`line`).attr(`id`,r+`-task`+z).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),P(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=g();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,N(a,o);let s=t.x+14;t.people.forEach(e=>{let n=t.actors[e].color;F(a,{cx:s,cy:t.y,r:7,fill:n,stroke:`#000`,title:e,pos:t.actors[e].position}),s+=10}),H(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),V=e(function(e,t){m(e,t)},`drawBackgroundRect`),H=(function(){function t(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}e(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}e(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return e(i,`_setTextAttrs`),function(e){return e.textPlacement===`fo`?r:e.textPlacement===`old`?t:n}})(),U={drawRect:N,drawCircle:F,drawSection:R,drawText:I,drawLabel:L,drawTask:B,drawBackgroundRect:V,initGraphics:e(function(e,t){z=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`)},W=e(function(e){Object.keys(e).forEach(function(t){J[t]=e[t]})},`setConf`),G={},K=0;function q(e){let t=l().journey,n=t.maxLabelWidth;K=0;let r=60;Object.keys(G).forEach(i=>{let a=G[i].color,o={cx:20,cy:r,r:7,fill:a,stroke:`#000`,pos:G[i].position};U.drawCircle(e,o);let s=e.append(`text`).attr(`visibility`,`hidden`).text(i),c=s.node().getBoundingClientRect().width;s.remove();let l=[];if(c<=n)l=[i];else{let t=i.split(` `),r=``;s=e.append(`text`).attr(`visibility`,`hidden`),t.forEach(e=>{let t=r?`${r} ${e}`:e;if(s.text(t),s.node().getBoundingClientRect().width>n){if(r&&l.push(r),r=e,s.text(e),s.node().getBoundingClientRect().width>n){let t=``;for(let r of e)t+=r,s.text(t+`-`),s.node().getBoundingClientRect().width>n&&(l.push(t.slice(0,-1)+`-`),t=r);r=t}}else r=t}),r&&l.push(r),s.remove()}l.forEach((n,i)=>{let a={x:40,y:r+7+i*20,fill:`#666`,text:n,textMargin:t.boxTextMargin??5},o=U.drawText(e,a).node().getBoundingClientRect().width;o>K&&o>t.leftMargin-o&&(K=o)}),r+=Math.max(20,l.length*20)})}e(q,`drawActorLegend`);var J=l().journey,Y=0,ee=e(function(e,n,r,i){let a=l(),s=a.journey.titleColor,c=a.journey.titleFontSize,u=a.journey.titleFontFamily,d=a.securityLevel,f;d===`sandbox`&&(f=t(`#i`+n));let p=t(d===`sandbox`?f.nodes()[0].contentDocument.body:`body`);X.init();let m=p.select(`#`+n);U.initGraphics(m,n);let h=i.db.getTasks(),g=i.db.getDiagramTitle(),_=i.db.getActors();for(let e in G)delete G[e];let v=0;_.forEach(e=>{G[e]={color:J.actorColours[v%J.actorColours.length],position:v},v++}),q(m),Y=J.leftMargin+K,X.insert(0,0,Y,Object.keys(G).length*50),te(m,h,0,n);let y=X.getBounds();g&&m.append(`text`).text(g).attr(`x`,Y).attr(`font-size`,c).attr(`font-weight`,`bold`).attr(`y`,25).attr(`fill`,s).attr(`font-family`,u);let b=y.stopy-y.starty+2*J.diagramMarginY,x=Y+y.stopx+2*J.diagramMarginX;o(m,b,x,J.useMaxWidth),m.append(`line`).attr(`x1`,Y).attr(`y1`,J.height*4).attr(`x2`,x-Y-4).attr(`y2`,J.height*4).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#`+n+`-arrowhead)`);let S=g?70:0;m.attr(`viewBox`,`${y.startx} -25 ${x} ${b+S}`),m.attr(`preserveAspectRatio`,`xMinYMin meet`),m.attr(`height`,b+S+25)},`draw`),X={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:e(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},`init`),updateVal:e(function(e,t,n,r){e[t]===void 0?e[t]=n:e[t]=r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,r,i){let a=l().journey,o=this,s=0;function c(c){return e(function(e){s++;let l=o.sequenceItems.length-s+1;o.updateVal(e,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(e,`stopy`,i+l*a.boxMargin,Math.max),o.updateVal(X.data,`startx`,t-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopx`,r+l*a.boxMargin,Math.max),c!==`activation`&&(o.updateVal(e,`startx`,t-l*a.boxMargin,Math.min),o.updateVal(e,`stopx`,r+l*a.boxMargin,Math.max),o.updateVal(X.data,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopy`,i+l*a.boxMargin,Math.max))},`updateItemBounds`)}e(c,`updateFn`),this.sequenceItems.forEach(c())},`updateBounds`),insert:e(function(e,t,n,r){let i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(X.data,`startx`,i,Math.min),this.updateVal(X.data,`starty`,o,Math.min),this.updateVal(X.data,`stopx`,a,Math.max),this.updateVal(X.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=this.verticalPos},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return this.data},`getBounds`)},Z=J.sectionFills,Q=J.sectionColours,te=e(function(e,t,n,r){let i=l().journey,a=``,o=n+(i.height*2+i.diagramMarginY),s=0,c=`#CCC`,u=`black`,d=0;for(let[n,l]of t.entries()){if(a!==l.section){c=Z[s%Z.length],d=s%Z.length,u=Q[s%Q.length];let r=0,o=l.section;for(let e=n;e<t.length&&t[e].section==o;e++)r+=1;let f={x:n*i.taskMargin+n*i.width+Y,y:50,text:l.section,fill:c,num:d,colour:u,taskCount:r};U.drawSection(e,f,i),a=l.section,s++}let f=l.people.reduce((e,t)=>(G[t]&&(e[t]=G[t]),e),{});l.x=n*i.taskMargin+n*i.width+Y,l.y=o,l.width=i.diagramMarginX,l.height=i.diagramMarginY,l.colour=u,l.fill=c,l.num=d,l.actors=f,U.drawTask(e,l,i,r),X.insert(l.x,l.y,l.x+l.width+i.taskMargin,450)}},`drawTasks`),$={setConf:W,draw:ee},ne={parser:v,db:j,renderer:$,styles:M,init:e(e=>{$.setConf(e.journey),j.clear()},`init`)};export{ne as diagram};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-BGrd8tLy.js";import{m as t}from"./src-Dad2ZbCt.js";import{J as n,et as r,f as i,rt as a,tt as o,x as s,z as c}from"./chunk-WYO6CB5R-Do6SJrnY.js";import"./chunk-ICXQ74PX-DH8NJMok.js";import{t as l}from"./chunk-VAUOI2AC-Dpcz6BhT.js";import"./chunk-HOUHSVGY-BMPwFEwN.js";import"./chunk-Q4XR5HBZ-uvIGstBS.js";import{t as u}from"./chunk-5VM5RSS4-C3XB05yh.js";import"./chunk-OGEWGWER-TIcEoPPH.js";import"./chunk-C7G6YPKG-AsyDSQ9j.js";import{a as d,c as f,i as p}from"./chunk-ZGVPDNZ5-B7kWWaXv.js";import{n as m,t as h}from"./chunk-ZIRB5QZD-DTU0cDNh.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:r,9:22,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:u,7:d,10:23,11:f},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:c}),t(p,[2,19]),t(p,[2,21],{15:30,24:m}),t(p,[2,22]),t(p,[2,23]),t(h,[2,25]),t(h,[2,26]),t(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(g,[2,14],{7:_,11:v}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,16],{15:37,24:m}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(h,[2,31]),{21:[1,39]},{22:[1,40]},t(g,[2,13],{7:_,11:v}),t(y,[2,11]),t(y,[2,12]),t(p,[2,15],{24:b}),t(h,[2,30]),{22:[1,41]},t(h,[2,27]),t(h,[2,29])],defaultActions:{2:[2,1],6:[2,2]},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`)};x.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(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`<br/>`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function S(){this.yy={}}return e(S,`Parser`),S.prototype=x,x.Parser=S,new S})();g.parser=g;var _=g,v=[],y=[],b=0,x={},S=e(()=>{v=[],y=[],b=0,x={}},`clear`),C=e(e=>{if(v.length===0)return null;let t=v[0].level,n=null;for(let e=v.length-1;e>=0;e--)if(v[e].level===t&&!n&&(n=v[e]),v[e].level<t)throw Error(`Items without section detected, found section ("`+v[e].label+`")`);return e===n?.level?null:n},`getSection`),w=e(function(){return y},`getSections`),T=e(function(){let e=[],t=[],n=w(),r=s();for(let e of n){let n={id:e.id,label:c(e.label??``,r),labelType:`markdown`,isGroup:!0,ticket:e.ticket,shape:`kanbanSection`,level:e.level,look:r.look};t.push(n);let i=v.filter(t=>t.parentId===e.id);for(let n of i){let i={id:n.id,parentId:e.id,label:c(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(i)}}return{nodes:t,edges:e,other:{},config:s()}},`getData`),E=e((e,t,n,r,a)=>{let o=s(),l=o.mindmap?.padding??i.mindmap.padding;switch(r){case D.ROUNDED_RECT:case D.RECT:case D.HEXAGON:l*=2}let u={id:c(t,o)||`kbn`+ b++,level:e,label:c(n,o),width:o.mindmap?.maxNodeWidth??i.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(a!==void 0){let e;e=a.includes(`
|
|
7
|
+
`)?a+`
|
|
8
|
+
`:`{
|
|
9
|
+
`+a+`
|
|
10
|
+
}`;let t=m(e,{schema:h});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes(`_`)))throw Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&t.shape===`kanbanItem`&&(u.shape=t?.shape),t?.label&&(u.label=t?.label),t?.icon&&(u.icon=t?.icon.toString()),t?.assigned&&(u.assigned=t?.assigned.toString()),t?.ticket&&(u.ticket=t?.ticket.toString()),t?.priority&&(u.priority=t?.priority)}let d=C(e);d?u.parentId=d.id||`kbn`+ b++:y.push(u),v.push(u)},`addNode`),D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:E,getSections:w,getData:T,nodeType:D,getType:e((e,n)=>{switch(t.debug(`In get type`,e,n),e){case`[`:return D.RECT;case`(`:return n===`)`?D.ROUNDED_RECT:D.CLOUD;case`((`:return D.CIRCLE;case`)`:return D.CLOUD;case`))`:return D.BANG;case`{{`:return D.HEXAGON;default:return D.DEFAULT}},`getType`),setElementForId:e((e,t)=>{x[e]=t},`setElementForId`),decorateNode:e(e=>{if(!e)return;let t=s(),n=v[v.length-1];e.icon&&(n.icon=c(e.icon,t)),e.class&&(n.cssClasses=c(e.class,t))},`decorateNode`),type2Str:e(e=>{switch(e){case D.DEFAULT:return`no-border`;case D.RECT:return`rect`;case D.ROUNDED_RECT:return`rounded-rect`;case D.CIRCLE:return`circle`;case D.CLOUD:return`cloud`;case D.BANG:return`bang`;case D.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:e(()=>t,`getLogger`),getElementById:e(e=>x[e],`getElementById`)},k={draw:e(async(e,r,a,o)=>{t.debug(`Rendering kanban diagram
|
|
11
|
+
`+e);let c=o.db.getData(),u=s();u.htmlLabels=!1;let m=l(r);for(let e of c.nodes)e.domId=`${r}-${e.id}`;let h=m.append(`g`);h.attr(`class`,`sections`);let g=m.append(`g`);g.attr(`class`,`items`);let _=c.nodes.filter(e=>e.isGroup),v=0,y=[],b=25;for(let e of _){let t=u?.kanban?.sectionWidth||200;v+=1,e.x=t*v+(v-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+v;let n=await p(h,e);b=Math.max(b,n?.labelBBox?.height),y.push(n)}let x=0;for(let e of _){let t=y[x];x+=1;let n=u?.kanban?.sectionWidth||200,r=-n*3/2+b,i=r,a=c.nodes.filter(t=>t.parentId===e.id);for(let t of a){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-1.5*10;let r=(await d(g,t,{config:u})).node().getBBox();t.y=i+r.height/2,await f(t),i=t.y+r.height/2+10/2}let o=t.cluster.select(`rect`),s=Math.max(i-r+30,50)+(b-25);o.attr(`height`,s)}n(void 0,m,u.mindmap?.padding??i.kanban.padding,u.mindmap?.useMaxWidth??i.kanban.useMaxWidth)},`draw`)},A=e(t=>{let n=``;for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t[`lineColor`+e]=t[`lineColor`+e]||t[`cScaleInv`+e],a(t[`lineColor`+e])?t[`lineColor`+e]=o(t[`lineColor`+e],20):t[`lineColor`+e]=r(t[`lineColor`+e],20);let i=e((e,n)=>t.darkMode?r(e,n):o(e,n),`adjuster`);for(let e=0;e<t.THEME_COLOR_LIMIT;e++){let r=``+(17-3*e);n+=`
|
|
12
|
+
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} polygon, .section-${e-1} path {
|
|
13
|
+
fill: ${i(t[`cScale`+e],10)};
|
|
14
|
+
stroke: ${i(t[`cScale`+e],10)};
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
.section-${e-1} text {
|
|
18
|
+
fill: ${t[`cScaleLabel`+e]};
|
|
19
|
+
}
|
|
20
|
+
.node-icon-${e-1} {
|
|
21
|
+
font-size: 40px;
|
|
22
|
+
color: ${t[`cScaleLabel`+e]};
|
|
23
|
+
}
|
|
24
|
+
.section-edge-${e-1}{
|
|
25
|
+
stroke: ${t[`cScale`+e]};
|
|
26
|
+
}
|
|
27
|
+
.edge-depth-${e-1}{
|
|
28
|
+
stroke-width: ${r};
|
|
29
|
+
}
|
|
30
|
+
.section-${e-1} line {
|
|
31
|
+
stroke: ${t[`cScaleInv`+e]} ;
|
|
32
|
+
stroke-width: 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.disabled, .disabled circle, .disabled text {
|
|
36
|
+
fill: lightgray;
|
|
37
|
+
}
|
|
38
|
+
.disabled text {
|
|
39
|
+
fill: #efefef;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.node rect,
|
|
43
|
+
.node circle,
|
|
44
|
+
.node ellipse,
|
|
45
|
+
.node polygon,
|
|
46
|
+
.node path {
|
|
47
|
+
fill: ${t.background};
|
|
48
|
+
stroke: ${t.nodeBorder};
|
|
49
|
+
stroke-width: 1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.kanban-ticket-link {
|
|
53
|
+
fill: ${t.background};
|
|
54
|
+
stroke: ${t.nodeBorder};
|
|
55
|
+
text-decoration: underline;
|
|
56
|
+
}
|
|
57
|
+
`}return n},`genSections`),j={db:O,renderer:k,parser:_,styles:e(e=>`
|
|
58
|
+
.edge {
|
|
59
|
+
stroke-width: 3;
|
|
60
|
+
}
|
|
61
|
+
${A(e)}
|
|
62
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
63
|
+
fill: ${e.git0};
|
|
64
|
+
}
|
|
65
|
+
.section-root text {
|
|
66
|
+
fill: ${e.gitBranchLabel0};
|
|
67
|
+
}
|
|
68
|
+
.icon-container {
|
|
69
|
+
height:100%;
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
}
|
|
74
|
+
.edge {
|
|
75
|
+
fill: none;
|
|
76
|
+
}
|
|
77
|
+
.cluster-label, .label {
|
|
78
|
+
color: ${e.textColor};
|
|
79
|
+
fill: ${e.textColor};
|
|
80
|
+
}
|
|
81
|
+
.kanban-label {
|
|
82
|
+
dy: 1em;
|
|
83
|
+
alignment-baseline: middle;
|
|
84
|
+
text-anchor: middle;
|
|
85
|
+
dominant-baseline: middle;
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
${u()}
|
|
89
|
+
`,`getStyles`)};export{j as diagram};
|