@kabmo-labs/kabmo 0.32.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +805 -637
- package/dist/client/static/js/{CsvGrid-4gx0jevc.js → CsvGrid-vze4m5ag.js} +2 -2
- package/dist/client/static/js/{DocxView-0667nr8h.js → DocxView-jbf21gmh.js} +5 -5
- package/dist/client/static/js/{DrawioView-522v0d0r.js → DrawioView-b52qybx5.js} +2 -2
- package/dist/client/static/js/{ImageView-t8xp60hm.js → ImageView-mdgzj8px.js} +1 -1
- package/dist/client/static/js/LayoutWrapper-3c49dvtt.js +2 -0
- package/dist/client/static/js/Modal-sqp864vd.js +38 -0
- package/dist/client/static/js/{PdfView-3fx172xh.js → PdfView-g06rxqb1.js} +1 -1
- package/dist/client/static/js/{SessionsView-n3agmf5t.js → SessionsView-521adxyr.js} +1 -1
- package/dist/client/static/js/{SheetView-nmrdb1b8.js → SheetView-h8xmsz7q.js} +22 -22
- package/dist/client/static/js/{SvgPreview-0xsc6xam.js → SvgPreview-1j4jvcvz.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-jj31rs62.js → abnfDiagram-O67JEVCF-pasxh4b6.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-fc9kmq1w.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ay3yr7pf.js → architectureDiagram-NJMV4G6O-ms14g0bm.js} +4 -4
- package/dist/client/static/js/{astro-qgx1r159.js → astro-80bs6hvg.js} +1 -1
- package/dist/client/static/js/bash-b3rwyg5p.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-4x33e16k.js → blockDiagram-BEXU5L5S-ycn78fcq.js} +4 -4
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-dtb81cgz.js → c4Diagram-YGBWAQC7-vn2gpjfm.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-vk5a2n9w.js → classDiagram-v2-NBCMYWYE-fyrm1pr5.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-6rbjbe19.js → cose-bilkent-JH36ORCC-ea5nwvgq.js} +1 -1
- package/dist/client/static/js/css-6vj0d308.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-a4t8992q.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-vyjksedr.js → cynefinDiagram-VND7K2PF-j6bsjpre.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-7hey38z5.js → dagre-6A5THRUB-4smdkwv8.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-aes06jde.js → diagram-22UHCM2B-9sm4kqwc.js} +19 -19
- package/dist/client/static/js/{diagram-3UASUU5V-3cfkgm3x.js → diagram-3UASUU5V-2h3qxaed.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-z8mfhwpy.js → diagram-ATOU4E4O-1981bc94.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-t4821ctz.js → diagram-CDSNMT55-3vgsxavc.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-23yxbfrx.js → diagram-MLGK6HIB-c9gf2r3f.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-chhtf7v0.js → diagram-MPIPVDR6-gjqeq92d.js} +2 -2
- package/dist/client/static/js/{dockerfile-5b87ghm7.js → dockerfile-8v935dkn.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-9jejcvfr.js → ebnfDiagram-ZINNZB2B-4vbsgh99.js} +1 -1
- package/dist/client/static/js/{elixir-rpa1g4gy.js → elixir-vcbg60wv.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-xhhtkf58.js → elk-276RUBZZ-nca3t891.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-mt2apjjb.js → erDiagram-OPXOYQCR-5kfkev03.js} +6 -6
- package/dist/client/static/js/{erlang-6m6tpt72.js → erlang-qt876zrq.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-18bdrkv5.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-fg0yqx0h.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-8cm7a29w.js → ganttDiagram-FUAMR5RP-mxc73wmq.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-8fa6y40p.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-5s0gbnx2.js → gitGraphDiagram-X574FWY7-7en3ag0e.js} +12 -12
- package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
- package/dist/client/static/js/html-dbrwss36.js +1 -0
- package/dist/client/static/js/{index-ye3sr7db.js → index-0vm41je9.js} +4 -4
- package/dist/client/static/js/{index-5y7c62sm.js → index-1b0t1428.js} +5 -5
- package/dist/client/static/js/{index-9sd0vjmh.js → index-1ksg88qf.js} +2 -2
- package/dist/client/static/js/{index-brj8qwa6.js → index-1y9r4frb.js} +2 -2
- package/dist/client/static/js/index-231241f4.js +12 -0
- package/dist/client/static/js/index-2mx9ej4k.css +1 -0
- package/dist/client/static/js/{index-6q80csr0.js → index-2svnq5gg.js} +1 -1
- package/dist/client/static/js/{index-dt7e1328.js → index-354mqqra.js} +2 -2
- package/dist/client/static/js/{index-532btjmp.js → index-3zc1b0dv.js} +2 -2
- package/dist/client/static/js/{index-h06bcfds.js → index-4g46wbdw.js} +1 -1
- package/dist/client/static/js/{index-p7btwjvj.js → index-4qwzxj81.js} +3 -3
- package/dist/client/static/js/{index-3vhznzgr.js → index-52rqxgya.js} +1 -1
- package/dist/client/static/js/index-6sf2vsp2.js +1 -0
- package/dist/client/static/js/{index-xya34x4v.js → index-76zb4m0n.js} +2 -2
- package/dist/client/static/js/{index-jz9fpznk.js → index-7a64yjrm.js} +6 -6
- package/dist/client/static/js/{index-2xj14800.js → index-7y6rpsrp.js} +2 -2
- package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
- package/dist/client/static/js/{index-ay34b398.js → index-a0fmsv1d.js} +19 -19
- package/dist/client/static/js/{index-2gfc25tq.js → index-ag2rmtas.js} +1 -1
- package/dist/client/static/js/{index-sa9cp6km.js → index-ahv9y42z.js} +2 -2
- package/dist/client/static/js/{index-g33knza2.js → index-b29afsjh.js} +1 -1
- package/dist/client/static/js/{index-629kfbcb.js → index-c3ek61zv.js} +2 -2
- package/dist/client/static/js/{index-360d7j0d.js → index-cd65zqba.js} +1 -1
- package/dist/client/static/js/{index-4s8ttfxj.js → index-cgzrpvzj.js} +211 -211
- package/dist/client/static/js/{index-gbfg0anm.js → index-dbe6afkf.js} +2 -2
- package/dist/client/static/js/{index-z4v1xmh1.js → index-ev3yt353.js} +2 -2
- package/dist/client/static/js/{index-ehcpzk5b.js → index-eyfcm0cy.js} +1 -1
- package/dist/client/static/js/{index-a733k69t.js → index-f7jhhqtk.js} +2 -2
- package/dist/client/static/js/{index-hc2jmzpx.js → index-fta1y9pc.js} +65 -65
- package/dist/client/static/js/{index-vd0e25p0.js → index-fvmfge3p.js} +1 -1
- package/dist/client/static/js/{index-a6k2hqke.js → index-g2dyfze9.js} +1 -1
- package/dist/client/static/js/index-h5bn97p6.js +2 -0
- package/dist/client/static/js/{index-7fdp9c7m.js → index-hf52f59k.js} +2 -2
- package/dist/client/static/js/{index-qkscve6n.js → index-j0r5hj0j.js} +2 -2
- package/dist/client/static/js/{index-ejgd8w3s.js → index-j51d5a5m.js} +28 -28
- package/dist/client/static/js/{index-kpspnztv.js → index-jsyekbx9.js} +2 -2
- package/dist/client/static/js/{index-a0bdavdr.js → index-km2zb6wk.js} +2 -2
- package/dist/client/static/js/{index-59jb53v3.js → index-nccwxv0s.js} +2 -2
- package/dist/client/static/js/{index-dnp07j57.js → index-p0nz38bm.js} +1 -1
- package/dist/client/static/js/{index-c0x6s6f7.js → index-pm6xxwz1.js} +2 -2
- package/dist/client/static/js/{index-5x95n3hx.js → index-ptcrwswj.js} +1 -1
- package/dist/client/static/js/{index-fdbfzshx.js → index-ptcwae2n.js} +2 -2
- package/dist/client/static/js/{index-h7pn9qw6.js → index-qckv9nte.js} +2 -2
- package/dist/client/static/js/{index-wzma5n54.js → index-r014brzs.js} +2 -2
- package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
- package/dist/client/static/js/{index-qnwqaczk.js → index-rs80cwsv.js} +3 -3
- package/dist/client/static/js/{index-pf5sbesf.js → index-rytaa8ca.js} +2 -2
- package/dist/client/static/js/{index-c93sp4yh.js → index-rzxcj7cg.js} +1 -1
- package/dist/client/static/js/{index-a293pdg7.js → index-s7gkkkyz.js} +2 -2
- package/dist/client/static/js/{index-7n68yx6m.js → index-sd66wv26.js} +2 -2
- package/dist/client/static/js/{index-bbggh3f8.js → index-vhqe0y82.js} +2 -2
- package/dist/client/static/js/{index-dq1kdt03.js → index-vy6termr.js} +1 -1
- package/dist/client/static/js/{index-pf7syd7t.js → index-xx6mqpxm.js} +3 -3
- package/dist/client/static/js/{index-z5s27s26.js → index-ybm2x4vh.js} +1 -1
- package/dist/client/static/js/{index-jppt5mgc.js → index-zvfvqvn9.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-3hk844f7.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-3w1yz32c.js → infoDiagram-VRGFBTTK-sef80132.js} +2 -2
- package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ckt471dy.js → ishikawaDiagram-OU5B5YK6-yhvepp1q.js} +6 -6
- package/dist/client/static/js/java-g4dgwbfd.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kfvn4w7e.js → journeyDiagram-ZHPQQLJL-5w77y95w.js} +5 -5
- package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
- package/dist/client/static/js/{julia-0j0gsjvc.js → julia-d4j6wgvf.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-0q36cm83.js → kanban-definition-PNTS6WVX-02znqtna.js} +6 -6
- package/dist/client/static/js/lua-1g6w30de.js +1 -0
- package/dist/client/static/js/markdown-afx21x8c.js +1 -0
- package/dist/client/static/js/{mermaid.core-b1ssa824.js → mermaid.core-a6e6vck4.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-e2ym5en8.js → mindmap-definition-NLK3R4M7-y4n74q9x.js} +8 -8
- package/dist/client/static/js/one-dark-pro-vwhfpzr8.js +1 -0
- package/dist/client/static/js/one-light-y5t9x6zh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-4nj2yy10.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-t8bbdyhe.js → pegDiagram-GJSIUBJH-pr7ehgzb.js} +1 -1
- package/dist/client/static/js/{perl-7n7e9ncg.js → perl-srptw5vm.js} +1 -1
- package/dist/client/static/js/{php-32vy69vd.js → php-n89g3fk7.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-k7rde3f9.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-envv4brj.js → pieDiagram-5QR66LMP-39wpsk08.js} +2 -2
- package/dist/client/static/js/properties-thd83wey.js +1 -0
- package/dist/client/static/js/python-264ns4xw.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-72rk137a.js → quadrantDiagram-O4NWA36T-esm913km.js} +4 -4
- package/dist/client/static/js/r-qw82kkv9.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-513dpw4f.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-9bqnst9c.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-7367d5bv.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-b806b1mj.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-5a67rwf8.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-1ej0f5hr.js → railroadDiagram-XR7U4H2S-wy2mgya6.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-rvdaknpd.js → requirementDiagram-PLB6GJNP-6z9xdgbq.js} +4 -4
- package/dist/client/static/js/{ruby-5ty7fys7.js → ruby-r81ytgcm.js} +1 -1
- package/dist/client/static/js/{rust-2geezrcs.js → rust-frn3szvc.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-nxvhtdaw.js → sankeyDiagram-IPEJSGJF-rtmxk3ys.js} +5 -5
- package/dist/client/static/js/{sass-mey5150f.js → sass-9bxped7y.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-n5cn5qrt.js → sequenceDiagram-PO4LG4MO-awzcrafg.js} +18 -18
- package/dist/client/static/js/{sizeCapture-INFHLROL-r074kj7s.js → sizeCapture-INFHLROL-03gy196j.js} +1 -1
- package/dist/client/static/js/sql-0e9mnrda.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vxghxdb0.js → stateDiagram-v2-GCMORJYK-an8v3q5n.js} +3 -3
- package/dist/client/static/js/{svelte-3ewx0hzx.js → svelte-mwtx07d9.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-qkkv894p.js → swimlanes-2SLR337P-n9yb4wcs.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-nx5nfnf0.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-5tbq4ex2.js → timeline-definition-EJHVYXUP-jceb575g.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-kcy40evb.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-fsrvqxf4.js +1 -0
- package/dist/client/static/js/tsx-nm94hed6.js +1 -0
- package/dist/client/static/js/typescript-0s2t05jj.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-6p8hf0b7.js → usecaseDiagram-POWQR4AR-888h3100.js} +39 -39
- package/dist/client/static/js/vennDiagram-UO4OBE2U-wbfz0rzv.js +34 -0
- package/dist/client/static/js/{vue-06rdf4wh.js → vue-c0rtg1wf.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-36dmxww4.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-km2x4er8.js → wardleyDiagram-VNRHLVJA-rn8c5qf9.js} +4 -4
- package/dist/client/static/js/xml-dz51p1m3.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-kr3sgr4m.js → xychartDiagram-PMCCYNJV-8sn1apt6.js} +5 -5
- package/dist/client/static/js/yaml-2cfkd30t.js +1 -0
- package/package.json +4 -1
- package/src/client/components/auth/login-screen/index.tsx +1 -0
- package/src/client/components/common/MarkdownRenderer.tsx +9 -12
- package/src/client/components/common/context-usage-button/McpSection.test.tsx +98 -0
- package/src/client/components/common/context-usage-button/McpSection.tsx +12 -5
- package/src/client/components/common/context-usage-button/SessionStats.tsx +80 -0
- package/src/client/components/common/context-usage-button/index.test.tsx +26 -0
- package/src/client/components/common/context-usage-button/index.tsx +36 -28
- package/src/client/components/common/harness-glyph/brands.ts +8 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +12 -3
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
- package/src/client/components/settings/Modal.tsx +14 -84
- package/src/client/components/settings/Sidebar.tsx +3 -1
- package/src/client/components/settings/apply-side-effects.test.ts +11 -0
- package/src/client/components/settings/apply-side-effects.ts +7 -0
- package/src/client/components/settings/categories/ChatSettings.test.tsx +1 -1
- package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
- package/src/client/components/settings/categories/ConnectSettings.tsx +105 -0
- package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/ChangedFilesSection.tsx +79 -0
- package/src/client/components/settings/categories/chat-settings/groups.ts +4 -3
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +145 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +160 -0
- package/src/client/components/settings/categories/connect-settings/QrCode.tsx +73 -0
- package/src/client/components/settings/categories/connect-settings/ServerCard.tsx +94 -0
- package/src/client/components/settings/categories/connect-settings/TunnelRow.tsx +127 -0
- package/src/client/components/settings/category-content.tsx +116 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.test.tsx +120 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +137 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +22 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +13 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +17 -51
- package/src/client/components/workspace/diff-panel/index.tsx +23 -4
- package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +94 -0
- package/src/client/components/workspace/editor/Body.tsx +2 -0
- package/src/client/data/settings/omp-schema.json +73 -3
- package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
- package/src/client/hooks/chat/timeline/changed-files-setting.test.ts +31 -0
- package/src/client/hooks/chat/timeline/changed-files-setting.ts +60 -0
- package/src/client/hooks/chat/timeline/session-changes.ts +51 -0
- package/src/client/hooks/connect/use-connect-status.ts +116 -0
- package/src/client/hooks/connect/use-pairing.ts +100 -0
- package/src/client/hooks/ui/clipboard.ts +26 -0
- package/src/client/hooks/ui/notification-events.test.ts +3 -0
- package/src/client/hooks/ui/notification-events.ts +3 -1
- package/src/client/hooks/ui/notification-sound.ts +13 -6
- package/src/client/hooks/ui/ui-sounds.test.ts +15 -0
- package/src/client/hooks/workspace/diff-file.ts +11 -4
- package/src/client/hooks/workspace/file-tabs.ts +13 -4
- package/src/client/hooks/workspace/journal-diff.ts +97 -0
- package/src/client/lib/notifications/native-banner-sound.test.ts +93 -0
- package/src/client/lib/notifications/native-banner-sound.ts +46 -0
- package/src/client/lib/notifications/os.test.ts +14 -5
- package/src/client/lib/notifications/os.ts +8 -0
- package/src/client/tailwind.css +5 -0
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/font-css.server.test.ts +19 -0
- package/src/server/lib/auth/client-address.test.ts +58 -0
- package/src/server/lib/auth/client-address.ts +37 -3
- package/src/server/lib/auth/guard.ts +31 -4
- package/src/server/lib/auth/rate-limit.test.ts +25 -8
- package/src/server/lib/auth/rate-limit.ts +8 -5
- package/src/server/lib/connect/cloudflared.lifecycle.test.ts +88 -0
- package/src/server/lib/connect/cloudflared.server.test.ts +65 -0
- package/src/server/lib/connect/cloudflared.server.ts +206 -0
- package/src/server/lib/connect/devices.server.ts +192 -0
- package/src/server/lib/connect/identity.server.ts +81 -0
- package/src/server/lib/connect/pairing.server.test.ts +56 -0
- package/src/server/lib/connect/pairing.server.ts +113 -0
- package/src/server/lib/connect/qr.roundtrip.test.ts +106 -0
- package/src/server/lib/connect/qr.server.ts +36 -0
- package/src/server/lib/connect/run.server.ts +101 -0
- package/src/server/lib/connect/status.server.ts +177 -0
- package/src/server/lib/connect/tailscale.server.test.ts +117 -0
- package/src/server/lib/connect/tailscale.server.ts +172 -0
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/harness/launch-table.ts +10 -0
- package/src/server/lib/omp/session/changes.test.ts +201 -0
- package/src/server/lib/omp/session/changes.ts +313 -0
- package/src/server/lib/omp/session/session-discovery.test.ts +4 -4
- package/src/server/lib/omp/session/sidebar-activity.server.test.ts +6 -2
- package/src/server/lib/omp/session/subagent-presence-scan.ts +54 -0
- package/src/server/lib/omp/session/subagent-presence-store.test.ts +1 -1
- package/src/server/lib/omp/session/subagent-presence.test.ts +115 -0
- package/src/server/lib/omp/session/subagent-presence.ts +12 -3
- package/src/server/lib/omp/session/telemetry/compute.ts +68 -0
- package/src/server/lib/omp/session/telemetry.test.ts +81 -0
- package/src/server/routes/connect/devices.ts +56 -0
- package/src/server/routes/connect/index.ts +15 -0
- package/src/server/routes/connect/pair-page.ts +177 -0
- package/src/server/routes/connect/pair.ts +158 -0
- package/src/server/routes/connect/status.ts +19 -0
- package/src/server/routes/connect/tunnels.ts +76 -0
- package/src/server/routes/health/probe.ts +5 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/sessions/changes.test.ts +99 -0
- package/src/server/routes/sessions/changes.ts +79 -0
- package/src/server/routes/sessions/index.ts +7 -0
- package/src/shared/lib/chat/duration.ts +34 -0
- package/src/shared/lib/chat/timeline/changed-files.test.ts +121 -0
- package/src/shared/lib/chat/timeline/changed-files.ts +71 -0
- package/src/shared/lib/chat/timeline/fork-anchor.test.ts +3 -0
- package/src/shared/lib/connect/payload.test.ts +144 -0
- package/src/shared/lib/connect/payload.ts +229 -0
- package/src/shared/lib/connect/tier.test.ts +73 -0
- package/src/shared/lib/connect/tier.ts +105 -0
- package/src/shared/lib/connect/types.ts +99 -0
- package/src/shared/lib/format/duration.test.ts +31 -0
- package/src/shared/lib/format/duration.ts +27 -0
- package/src/shared/lib/fs/unified-diff.test.ts +53 -0
- package/src/shared/lib/fs/unified-diff.ts +127 -0
- package/src/shared/lib/harness/brand-color.ts +3 -0
- package/src/shared/lib/harness/catalog.test.ts +13 -0
- package/src/shared/lib/harness/catalog.ts +8 -1
- package/src/shared/lib/harness/fork.ts +4 -2
- package/src/shared/lib/harness/mcp-facts.ts +3 -0
- package/src/shared/lib/harness/provider-facts.ts +14 -0
- package/src/shared/lib/harness/updates.ts +5 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +27 -27
- package/src/shared/lib/markdown/fira-code-fonts.css +65 -6
- package/src/shared/lib/markdown/marked.ts +7 -4
- package/src/shared/lib/markdown/mermaid-actions.test.ts +78 -0
- package/src/shared/lib/markdown/mermaid-actions.ts +45 -0
- package/src/shared/lib/markdown/mermaid.ts +41 -7
- package/src/shared/lib/omp/config/schema.test.ts +4 -2
- package/src/shared/lib/settings/defaults.ts +1 -0
- package/src/shared/lib/settings/sections.ts +6 -1
- package/src/shared/lib/workspace/file-tab-id.ts +9 -0
- package/src/shared/types/context.ts +18 -0
- package/src/shared/types/fs.ts +21 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/omp/session.ts +6 -0
- package/src/shared/types/session-changes.ts +64 -0
- package/src/shared/types/settings/state.ts +10 -0
- package/dist/client/static/js/LayoutWrapper-xjnveecv.js +0 -2
- package/dist/client/static/js/Modal-k2jr9hc4.js +0 -38
- package/dist/client/static/js/architecture-7GRP2DOG-1y9zvsyt.js +0 -1
- package/dist/client/static/js/bash-m0qjsyy0.js +0 -1
- package/dist/client/static/js/css-t4ngafan.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-k2188qcq.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-pdr0qn0n.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-zvz0mxne.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-wmqf046s.js +0 -1
- package/dist/client/static/js/graphql-692h0n2x.js +0 -1
- package/dist/client/static/js/html-pv88ny12.js +0 -1
- package/dist/client/static/js/index-61tm0v57.js +0 -1
- package/dist/client/static/js/index-e94a1en0.css +0 -1
- package/dist/client/static/js/index-kg86e3sy.js +0 -12
- package/dist/client/static/js/index-nmmxb4va.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-zg3twte6.js +0 -1
- package/dist/client/static/js/ini-cg0a5wm3.js +0 -1
- package/dist/client/static/js/java-vcck089n.js +0 -1
- package/dist/client/static/js/jsx-ht9zyzwa.js +0 -1
- package/dist/client/static/js/lua-ke895s2q.js +0 -1
- package/dist/client/static/js/markdown-gwmsh53r.js +0 -1
- package/dist/client/static/js/one-dark-pro-4geyzhjj.js +0 -1
- package/dist/client/static/js/one-light-tqssjm9t.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-3pav51g0.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-wqfh7zdk.js +0 -1
- package/dist/client/static/js/properties-mzvvbqg5.js +0 -1
- package/dist/client/static/js/python-3w64wsyd.js +0 -1
- package/dist/client/static/js/r-32re2zwb.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-w7qjdr2g.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-rhr99kkj.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-c4jeea3m.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-x2ee66ex.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yw8wjfwg.js +0 -1
- package/dist/client/static/js/sql-g8wcshpc.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y81h9n27.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-ekz05ccs.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-aq6qymjr.js +0 -1
- package/dist/client/static/js/tsx-0p183w2f.js +0 -1
- package/dist/client/static/js/typescript-t9a5jyvv.js +0 -1
- package/dist/client/static/js/vennDiagram-UO4OBE2U-7k5jsxf9.js +0 -34
- package/dist/client/static/js/wardley-WFR3VGLG-z34tj4y3.js +0 -1
- package/dist/client/static/js/xml-81hxjjt4.js +0 -1
- package/dist/client/static/js/yaml-yssayv8a.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{t,l,
|
|
2
|
-
`+
|
|
3
|
-
Expecting `+mt.join(", ")+", got '"+(this.terminals_[
|
|
1
|
+
import{t,l,Mt,K,E,X,te,R,L,z,O,U,j,G,ai,On,Cs,de,oe,Cf}from"./index-fta1y9pc.js";import{na}from"./index-jsyekbx9.js";function _t(e,i,s){e=+e,i=+i,s=(a=arguments.length)<2?(i=e,e=0,1):a<3?1:+s;var n=-1,a=Math.max(0,Math.ceil((i-e)/s))|0,h=Array(a);while(++n<a)h[n]=e+n*s;return h}function gt(){var e=On().unknown(void 0),{domain:i,range:s}=e,n=0,a=1,h,c,x=!1,f=0,S=0,D=0.5;delete e.unknown;function _(){var y=i().length,F=a<n,I=F?a:n,M=F?n:a;if(h=(M-I)/Math.max(1,y-f+S*2),x)h=Math.floor(h);if(I+=(M-I-h*(y-f))*D,c=h*(1-f),x)I=Math.round(I),c=Math.round(c);var W=_t(y).map(function(J){return I+h*J});return s(F?W.reverse():W)}return e.domain=function(y){return arguments.length?(i(y),_()):i()},e.range=function(y){return arguments.length?([n,a]=y,n=+n,a=+a,_()):[n,a]},e.rangeRound=function(y){return[n,a]=y,n=+n,a=+a,x=!0,_()},e.bandwidth=function(){return c},e.step=function(){return h},e.round=function(y){return arguments.length?(x=!!y,_()):x},e.padding=function(y){return arguments.length?(f=Math.min(1,S=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(S=+y,_()):S},e.align=function(y){return arguments.length?(D=Math.max(0,Math.min(1,y)),_()):D},e.copy=function(){return gt(i(),[n,a]).round(x).paddingInner(f).paddingOuter(S).align(D)},ai.apply(_(),arguments)}var Tt=function(){var e=t(function(q,r,g,d){for(g=g||{},d=q.length;d--;g[q[d]]=r);return g},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],a=[1,5],h=[1,6],c=[1,7],x=[1,5,10,12,14,16,18,19,21,23,36,37,38],f=[1,25],S=[1,26],D=[1,28],_=[1,29],y=[1,30],F=[1,31],I=[1,32],M=[1,33],W=[1,34],J=[1,35],et=[1,36],w=[1,37],Y=[1,43],u=[1,42],N=[1,47],H=[1,50],A=[1,10,12,14,16,18,19,21,23,36,37,38],st=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],B=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],ht=[1,65],v=[26,28],k={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(r,g,d,p,C,o,nt){var m=o.length-1;switch(C){case 5:p.setOrientation(o[m]);break;case 9:p.setDiagramTitle(o[m].text.trim());break;case 12:p.setLineData({text:"",type:"text"},o[m]);break;case 13:p.setLineData(o[m-1],o[m]);break;case 14:p.setBarData({text:"",type:"text"},o[m]);break;case 15:p.setBarData(o[m-1],o[m]);break;case 16:this.$=o[m].trim(),p.setAccTitle(this.$);break;case 17:case 18:this.$=o[m].trim(),p.setAccDescription(this.$);break;case 19:this.$=o[m-1];break;case 20:case 30:this.$=[o[m-2],...o[m]];break;case 21:case 31:this.$=[o[m]];break;case 22:this.$={value:Number(o[m-1]),label:o[m]};break;case 23:this.$={value:Number(o[m]),label:""};break;case 24:p.setXAxisTitle(o[m]);break;case 25:p.setXAxisTitle(o[m-1]);break;case 26:p.setXAxisTitle({type:"text",text:""});break;case 27:p.setXAxisBand(o[m]);break;case 28:p.setXAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 29:this.$=o[m-1];break;case 32:p.setYAxisTitle(o[m]);break;case 33:p.setYAxisTitle(o[m-1]);break;case 34:p.setYAxisTitle({type:"text",text:""});break;case 35:p.setYAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 39:this.$={text:o[m],type:"text"};break;case 40:this.$={text:o[m],type:"text"};break;case 41:this.$={text:o[m],type:"markdown"};break;case 42:this.$=o[m];break;case 43:this.$=o[m-1]+""+o[m];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:a,37:h,38:c}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:a,37:h,38:c}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:a,37:h,38:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:a,37:h,38:c}),{1:[2,3]},e(x,[2,5]),e(i,[2,7],{4:22,36:a,37:h,38:c}),{11:23,30:f,39:24,40:S,41:27,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w},{11:39,13:38,24:Y,29:u,30:f,31:40,32:41,39:24,40:S,41:27,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w},{11:45,15:44,29:N,30:f,35:46,39:24,40:S,41:27,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w},{11:49,17:48,24:H,30:f,39:24,40:S,41:27,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w},{11:52,17:51,24:H,30:f,39:24,40:S,41:27,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w},{20:[1,53]},{22:[1,54]},e(A,[2,18]),{1:[2,2]},e(A,[2,8]),e(A,[2,9]),e(st,[2,39],{41:55,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w}),e(st,[2,40]),e(st,[2,41]),e(B,[2,42]),e(B,[2,44]),e(B,[2,45]),e(B,[2,46]),e(B,[2,47]),e(B,[2,48]),e(B,[2,49]),e(B,[2,50]),e(B,[2,51]),e(B,[2,52]),e(B,[2,53]),e(A,[2,10]),e(A,[2,24],{32:41,31:56,24:Y,29:u}),e(A,[2,26]),e(A,[2,27]),{33:[1,57]},{11:59,30:f,34:58,39:24,40:S,41:27,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w},e(A,[2,11]),e(A,[2,32],{35:60,29:N}),e(A,[2,34]),{33:[1,61]},e(A,[2,12]),{17:62,24:H},{25:63,27:64,29:ht},e(A,[2,14]),{17:66,24:H},e(A,[2,16]),e(A,[2,17]),e(B,[2,43]),e(A,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(A,[2,33]),{29:[1,70]},e(A,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(v,[2,23],{30:[1,73]}),e(A,[2,15]),e(A,[2,28]),e(A,[2,29]),{11:59,30:f,34:74,39:24,40:S,41:27,42:D,43:_,44:y,45:F,46:I,47:M,48:W,49:J,50:et,51:w},e(A,[2,35]),e(A,[2,19]),{25:75,27:64,29:ht},e(v,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(r,g){if(g.recoverable)this.trace(r);else{var d=Error(r);throw d.hash=g,d}},"parseError"),parse:t(function(r){var g=this,d=[0],p=[],C=[null],o=[],nt=this.table,m="",ft=0,Wt=0,Xt=0,xe=2,Nt=1,fe=o.slice.call(arguments,1),P=Object.create(this.lexer),at={yy:{}};for(var kt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,kt))at.yy[kt]=this.yy[kt];if(P.setInput(r,at.yy),at.yy.lexer=P,at.yy.parser=this,typeof P.yylloc>"u")P.yylloc={};var At=P.yylloc;o.push(At);var pe=P.options&&P.options.ranges;if(typeof at.yy.parseError==="function")this.parseError=at.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function me(Z){d.length=d.length-2*Z,C.length=C.length-Z,o.length=o.length-Z}t(me,"popStack");function Yt(){var Z=p.pop()||P.lex()||Nt;if(typeof Z!=="number"){if(Z instanceof Array)p=Z,Z=p.pop();Z=g.symbols_[Z]||Z}return Z}t(Yt,"lex");var V,Ct,ot,Q,Be,St,lt={},pt,it,Ht,mt;while(!0){if(ot=d[d.length-1],this.defaultActions[ot])Q=this.defaultActions[ot];else{if(V===null||typeof V>"u")V=Yt();Q=nt[ot]&&nt[ot][V]}if(typeof Q>"u"||!Q.length||!Q[0]){var Rt="";mt=[];for(pt in nt[ot])if(this.terminals_[pt]&&pt>xe)mt.push("'"+this.terminals_[pt]+"'");if(P.showPosition)Rt="Parse error on line "+(ft+1)+`:
|
|
2
|
+
`+P.showPosition()+`
|
|
3
|
+
Expecting `+mt.join(", ")+", got '"+(this.terminals_[V]||V)+"'";else Rt="Parse error on line "+(ft+1)+": Unexpected "+(V==Nt?"end of input":"'"+(this.terminals_[V]||V)+"'");this.parseError(Rt,{text:P.match,token:this.terminals_[V]||V,line:P.yylineno,loc:At,expected:mt})}if(Q[0]instanceof Array&&Q.length>1)throw Error("Parse Error: multiple actions possible at state: "+ot+", token: "+V);switch(Q[0]){case 1:if(d.push(V),C.push(P.yytext),o.push(P.yylloc),d.push(Q[1]),V=null,!Ct){if(Wt=P.yyleng,m=P.yytext,ft=P.yylineno,At=P.yylloc,Xt>0)Xt--}else V=Ct,Ct=null;break;case 2:if(it=this.productions_[Q[1]][1],lt.$=C[C.length-it],lt._$={first_line:o[o.length-(it||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(it||1)].first_column,last_column:o[o.length-1].last_column},pe)lt._$.range=[o[o.length-(it||1)].range[0],o[o.length-1].range[1]];if(St=this.performAction.apply(lt,[m,Wt,ft,at.yy,Q[1],C,o].concat(fe)),typeof St<"u")return St;if(it)d=d.slice(0,-1*it*2),C=C.slice(0,-1*it),o=o.slice(0,-1*it);d.push(this.productions_[Q[1]][0]),C.push(lt.$),o.push(lt._$),Ht=nt[d[d.length-2]][d[d.length-1]],d.push(Ht);break;case 3:return!0}}return!0},"parse")},tt=function(){var q={EOF:1,parseError:t(function(g,d){if(this.yy.parser)this.yy.parser.parseError(g,d);else throw Error(g)},"parseError"),setInput:t(function(r,g){if(this.yy=g||this.yy||{},this._input=r,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];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var g=r.length,d=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var p=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1)this.yylineno-=d.length-1;var C=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===p.length?this.yylloc.first_column:0)+p[p.length-d.length].length-d[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[C[0],C[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),g=Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
5
|
`+g+"^"},"showPosition"),test_match:t(function(r,g){var d,p,C;if(this.options.backtrack_lexer){if(C={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)C.yylloc.range=this.yylloc.range.slice(0)}if(p=r[0].match(/(?:\r\n?|\n).*/g),p)this.yylineno+=p.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],d=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(d)return d;else if(this._backtrack){for(var o in C)this[o]=C[o];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var r,g,d,p;if(!this._more)this.yytext="",this.match="";var C=this._currentRules();for(var o=0;o<C.length;o++)if(d=this._input.match(this.rules[C[o]]),d&&(!g||d[0].length>g[0].length)){if(g=d,p=o,this.options.backtrack_lexer)if(r=this.test_match(d,C[o]),r!==!1)return r;else if(this._backtrack){g=!1;continue}else return!1;else if(!this.options.flex)break}if(g){if(r=this.test_match(g,C[p]),r!==!1)return r;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,C){var o=C;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return q}();k.lexer=tt;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();Tt.parser=Tt;var be=Tt;function bt(e){return e.type==="bar"}t(bt,"isBarPlot");function yt(e){return e.type==="band"}t(yt,"isBandAxisData");function ct(e){return e.type==="linear"}t(ct,"isLinearAxisData");var Et=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=wf(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},$t=0.7,Ut=0.2,qt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if($t*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor($t*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},ye=class extends qt{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=gt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=gt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},we=class extends qt{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=ta().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=ta().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Dt(e,i,s,n){let a=new Et(n);if(yt(e))return new ye(i,s,e.categories,e.title,a);return new we(i,s,[e.min,e.max],e.title,a)}t(Dt,"getAxis");var ke=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Gt(e,i,s,n){let a=new Et(n);return new ke(a,e,i,s)}t(Gt,"getChartTitleComponent");var Ae=0.75,Ce=0.5,Se=0.35;function vt(e){return{fontSize:e,markerSize:e*Ae,markerSpacing:e*Se,itemSpacing:e*Ce}}t(vt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=vt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=vt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[S,D]of this.visiblePlots.entries())if(bt(D))x.push({x:h,y:c+S*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+S*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((S,D)=>({text:S.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function jt(e,i,s,n){let a=new Et(n);return new Re(a,e,i,s)}t(jt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Cs().y((n)=>n[0]).x((n)=>n[1])(e);else i=Cs().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let S=this.plotData.pointLabels[c];if(!S)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function Qt(e,i,s){return new De(e,i,s)}t(Qt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Gt(e,i,s,n),plot:Qt(e,i,s),legend:jt(e,i,s,n),xAxis:Dt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Dt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>bt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((S)=>bt(S)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},ut=0,Kt,dt=Bt(),xt=Mt(),b=zt(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,It=!1;function Mt(){let e=Lt(),i=E();return ae(e.xyChart,i.themeVariables.xyChart)}t(Mt,"getChartDefaultThemeConfig");function Bt(){let e=E();return ae(K.xyChart,e.xyChart)}t(Bt,"getChartDefaultConfig");function zt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(zt,"getChartDefaultData");function rt(e){let i=E();return X(e.trim(),i)}t(rt,"textSanitizer");function Zt(e){Kt=e}t(Zt,"setTmpSVGG");function Jt(e){if(e==="horizontal")dt.chartOrientation="horizontal";else dt.chartOrientation="vertical"}t(Jt,"setOrientation");function ee(e){b.xAxis.title=rt(e.text)}t(ee,"setXAxisTitle");function Ot(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},wt=!0}t(Ot,"setXAxisRangeData");function ie(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>rt(i.text))},wt=!0}t(ie,"setXAxisBand");function se(e){b.yAxis.title=rt(e.text)}t(se,"setYAxisTitle");function ne(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},It=!0}t(ne,"setYAxisRangeData");function oe(e){let i=Math.min(...e),s=Math.max(...e),n=ct(b.yAxis)?b.yAxis.min:1/0,a=ct(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(oe,"setYAxisRangeFromPlotData");function Vt(e){let i=[];if(e.length===0)return i;if(!wt){let s=ct(b.xAxis)?b.xAxis.min:1/0,n=ct(b.xAxis)?b.xAxis.max:-1/0;Ot(Math.min(s,1),Math.max(n,e.length))}if(yt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!It)oe(e);if(yt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(ct(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(Vt,"transformDataWithoutCategory");function Ft(e){return Pt[e===0?0:e%Pt.length]}t(Ft,"getPlotColorFromPalette");function re(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?rt(c.label):""),a=Vt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:rt(e.text),strokeFill:Ft(ut),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),ut++}t(re,"setLineData");function he(e,i){let s=i.map((a)=>a.value),n=Vt(s);b.plots.push({type:"bar",title:rt(e.text),fill:Ft(ut),data:n}),ut++}t(he,"setBarData");function le(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=G(),Pe.build(dt,b,xt,Kt)}t(le,"getDrawableElem");function ce(){return xt}t(ce,"getChartThemeConfig");function ge(){return dt}t(ge,"getChartConfig");function de(){return b}t(de,"getXYChartData");var Le=t(function(){R(),ut=0,dt=Bt(),b=zt(),xt=Mt(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,It=!1},"clear"),Ee={getDrawableElem:le,clear:Le,setAccTitle:M,getAccTitle:O,setDiagramTitle:j,getDiagramTitle:G,getAccDescription:z,setAccDescription:P,setOrientation:Jt,setXAxisTitle:ee,setXAxisRangeData:Ot,setXAxisBand:ie,setYAxisTitle:se,setYAxisRangeData:ne,setLineData:re,setBarData:he,setTmpSVGG:Zt,getChartThemeConfig:ce,getChartConfig:ge,getXYChartData:de},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function S(w){return w==="left"?"start":w==="right"?"end":"middle"}t(S,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
7
|
-
`+e);let _=
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,C){var o=C;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return q}();k.lexer=tt;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();Tt.parser=Tt;var be=Tt;function bt(e){return e.type==="bar"}t(bt,"isBarPlot");function yt(e){return e.type==="band"}t(yt,"isBandAxisData");function ct(e){return e.type==="linear"}t(ct,"isLinearAxisData");var Lt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=Cf(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},$t=0.7,Ut=0.2,qt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if($t*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor($t*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},ye=class extends qt{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=gt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=gt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},we=class extends qt{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=na().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=na().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Dt(e,i,s,n){let a=new Lt(n);if(yt(e))return new ye(i,s,e.categories,e.title,a);return new we(i,s,[e.min,e.max],e.title,a)}t(Dt,"getAxis");var ke=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Gt(e,i,s,n){let a=new Lt(n);return new ke(a,e,i,s)}t(Gt,"getChartTitleComponent");var Ae=0.75,Ce=0.5,Se=0.35;function vt(e){return{fontSize:e,markerSize:e*Ae,markerSpacing:e*Se,itemSpacing:e*Ce}}t(vt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=vt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=vt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[S,D]of this.visiblePlots.entries())if(bt(D))x.push({x:h,y:c+S*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+S*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((S,D)=>({text:S.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function jt(e,i,s,n){let a=new Lt(n);return new Re(a,e,i,s)}t(jt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Cs().y((n)=>n[0]).x((n)=>n[1])(e);else i=Cs().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let S=this.plotData.pointLabels[c];if(!S)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function Qt(e,i,s){return new De(e,i,s)}t(Qt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Gt(e,i,s,n),plot:Qt(e,i,s),legend:jt(e,i,s,n),xAxis:Dt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Dt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>bt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((S)=>bt(S)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},ut=0,Kt,dt=Bt(),xt=It(),b=zt(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,Et=!1;function It(){let e=Mt(),i=E();return oe(e.xyChart,i.themeVariables.xyChart)}t(It,"getChartDefaultThemeConfig");function Bt(){let e=E();return oe(K.xyChart,e.xyChart)}t(Bt,"getChartDefaultConfig");function zt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(zt,"getChartDefaultData");function rt(e){let i=E();return X(e.trim(),i)}t(rt,"textSanitizer");function Zt(e){Kt=e}t(Zt,"setTmpSVGG");function Jt(e){if(e==="horizontal")dt.chartOrientation="horizontal";else dt.chartOrientation="vertical"}t(Jt,"setOrientation");function ee(e){b.xAxis.title=rt(e.text)}t(ee,"setXAxisTitle");function Ot(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},wt=!0}t(Ot,"setXAxisRangeData");function ie(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>rt(i.text))},wt=!0}t(ie,"setXAxisBand");function se(e){b.yAxis.title=rt(e.text)}t(se,"setYAxisTitle");function ne(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},Et=!0}t(ne,"setYAxisRangeData");function ae(e){let i=Math.min(...e),s=Math.max(...e),n=ct(b.yAxis)?b.yAxis.min:1/0,a=ct(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(ae,"setYAxisRangeFromPlotData");function Vt(e){let i=[];if(e.length===0)return i;if(!wt){let s=ct(b.xAxis)?b.xAxis.min:1/0,n=ct(b.xAxis)?b.xAxis.max:-1/0;Ot(Math.min(s,1),Math.max(n,e.length))}if(yt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!Et)ae(e);if(yt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(ct(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(Vt,"transformDataWithoutCategory");function Ft(e){return Pt[e===0?0:e%Pt.length]}t(Ft,"getPlotColorFromPalette");function re(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?rt(c.label):""),a=Vt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:rt(e.text),strokeFill:Ft(ut),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),ut++}t(re,"setLineData");function he(e,i){let s=i.map((a)=>a.value),n=Vt(s);b.plots.push({type:"bar",title:rt(e.text),fill:Ft(ut),data:n}),ut++}t(he,"setBarData");function le(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=G(),Pe.build(dt,b,xt,Kt)}t(le,"getDrawableElem");function ce(){return xt}t(ce,"getChartThemeConfig");function ge(){return dt}t(ge,"getChartConfig");function ue(){return b}t(ue,"getXYChartData");var Le=t(function(){R(),ut=0,dt=Bt(),b=zt(),xt=It(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,Et=!1},"clear"),Ee={getDrawableElem:le,clear:Le,setAccTitle:L,getAccTitle:z,setDiagramTitle:j,getDiagramTitle:G,getAccDescription:U,setAccDescription:O,setOrientation:Jt,setXAxisTitle:ee,setXAxisRangeData:Ot,setXAxisBand:ie,setYAxisTitle:se,setYAxisRangeData:ne,setLineData:re,setBarData:he,setTmpSVGG:Zt,getChartThemeConfig:ce,getChartConfig:ge,getXYChartData:ue},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function S(w){return w==="left"?"start":w==="right"?"end":"middle"}t(S,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
7
|
+
`+e);let _=de(i),y=_.append("g").attr("class","main"),F=y.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");te(_,c.height,c.width,!0),_.attr("viewBox",`0 0 ${c.width} ${c.height}`),F.attr("fill",h.backgroundColor),a.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));let I=a.getDrawableElem(),M={};function W(w){let Y=y,u="";for(let[N]of w.entries()){let H=y;if(N>0&&M[u])H=M[u];if(u+=w[N],Y=M[u],!Y)Y=M[u]=H.append("g").attr("class",w[N])}return Y}t(W,"getGroup");for(let w of I){if(w.data.length===0)continue;let Y=W(w.groupTexts);switch(w.type){case"rect":if(Y.selectAll("rect").data(w.data).enter().append("rect").attr("x",(u)=>u.x).attr("y",(u)=>u.y).attr("width",(u)=>u.width).attr("height",(u)=>u.height).attr("fill",(u)=>u.fill).attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth),c.showDataLabel){let u=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let N=function(k,tt){let{data:T,label:q}=k;return tt*q.length*H<=T.width-A};var J=N;t(N,"fitsHorizontally");let H=0.7,A=10,st=w.data.map((k,tt)=>({data:k,label:x[tt].toString()})).filter((k)=>k.data.width>0&&k.data.height>0),B=st.map((k)=>{let{data:tt}=k,T=tt.height*0.7;while(!N(k,T)&&T>0)T-=1;return T}),ht=Math.floor(Math.min(...B)),v=t((k)=>{if(u)return k.data.x+k.data.width+A;else return k.data.x+k.data.width-A},"determineLabelXPosition");Y.selectAll("text").data(st).enter().append("text").attr("x",v).attr("y",(k)=>k.data.y+k.data.height/2).attr("text-anchor",u?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${ht}px`).text((k)=>k.label)}else{let N=function(v,k,tt){let{data:T,label:q}=v,r=0.7,g=k*q.length*0.7,d=T.x+T.width/2,p=d-g/2,C=d+g/2,o=p>=T.x&&C<=T.x+T.width,nt=T.y+tt+k<=T.y+T.height;return o&&nt};var et=N;t(N,"fitsInBar");let H=10,A=w.data.map((v,k)=>({data:v,label:x[k].toString()})).filter((v)=>v.data.width>0&&v.data.height>0),st=A.map((v)=>{let{data:k,label:tt}=v,T=k.width/(tt.length*0.7);while(!N(v,T,H)&&T>0)T-=1;return T}),B=Math.floor(Math.min(...st)),ht=t((v)=>{if(u)return v.data.y-H;else return v.data.y+H},"determineLabelYPosition");Y.selectAll("text").data(A).enter().append("text").attr("x",(v)=>v.data.x+v.data.width/2).attr("y",ht).attr("text-anchor","middle").attr("dominant-baseline",u?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${B}px`).text((v)=>v.label)}}break;case"text":Y.selectAll("text").data(w.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(u)=>u.fill).attr("font-size",(u)=>u.fontSize).attr("dominant-baseline",(u)=>f(u.verticalPos)).attr("text-anchor",(u)=>S(u.horizontalPos)).attr("transform",(u)=>D(u)).text((u)=>u.text);break;case"path":Y.selectAll("path").data(w.data).enter().append("path").attr("d",(u)=>u.path).attr("fill",(u)=>u.fill?u.fill:"none").attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth);break}}},"draw"),Me={draw:Ie},Ke={parser:be,db:Ee,renderer:Me};export{Ke as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Qf}from"./index-354mqqra.js";export{Qf as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kabmo-labs/kabmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Web console and diagnostic workbench for AI coding agents: Elysia + Preact on Bun.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"mermaid": "^12.0.0",
|
|
96
96
|
"postcss": "^8.5.16",
|
|
97
97
|
"preact": "^10.29.8",
|
|
98
|
+
"qrcode-generator": "^2.0.4",
|
|
98
99
|
"remend": "^1.3.1",
|
|
99
100
|
"ripgrep": "^0.3.1",
|
|
100
101
|
"shiki": "^4.4.3",
|
|
@@ -113,9 +114,11 @@
|
|
|
113
114
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
114
115
|
"@types/bun": "1.4.4",
|
|
115
116
|
"@types/node": "^22.14.0",
|
|
117
|
+
"@types/qrcode-generator": "^0.0.16",
|
|
116
118
|
"bun-types": "1.4.4",
|
|
117
119
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
118
120
|
"happy-dom": "^20.14.5",
|
|
121
|
+
"jsqr": "^1.4.0",
|
|
119
122
|
"semantic-release": "^25.0.9",
|
|
120
123
|
"typescript": "~5.8.2"
|
|
121
124
|
},
|
|
@@ -34,11 +34,12 @@ import { rewriteWikiReferences, type WikiRenderScope } from '@/shared/lib/wiki/d
|
|
|
34
34
|
import { expandGollumLinks } from '@/shared/lib/wiki/pages';
|
|
35
35
|
import { MATH_PENDING_CLASS, preloadKatex } from '@/shared/lib/markdown/katex';
|
|
36
36
|
import { sanitizeHtml } from '@/shared/lib/markdown/sanitize';
|
|
37
|
+
import { refreshMermaidFromClick } from '@/shared/lib/markdown/mermaid';
|
|
37
38
|
import { DIRECTIVE_BLOCK_CLASS } from '@/shared/lib/markdown/directives';
|
|
38
39
|
import { hydrateDirectiveBlocks, unmountDirectiveBlocks } from '@/client/lib/plugins/directives';
|
|
39
40
|
import { useMathHydration, useMermaidHydration } from '@/client/hooks/ui/markdown-hydration';
|
|
40
41
|
import { useDirectiveContext, useDirectiveRenderer } from '@/client/hooks/workspace/directives';
|
|
41
|
-
import {
|
|
42
|
+
import { copyFromButton } from '@/client/hooks/ui/clipboard';
|
|
42
43
|
import { openFileInEditor } from '@/client/hooks/ui/open-file';
|
|
43
44
|
import { useSyntaxReady } from '@/client/hooks/ui/syntax-ready';
|
|
44
45
|
import { DiagramViewer } from '@/client/components/common/diagram-viewer';
|
|
@@ -253,21 +254,17 @@ export function MarkdownRenderer({
|
|
|
253
254
|
return;
|
|
254
255
|
}
|
|
255
256
|
|
|
257
|
+
if (refreshMermaidFromClick(e.target)) {
|
|
258
|
+
e.preventDefault();
|
|
259
|
+
e.stopPropagation();
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
|
|
256
263
|
const target = (e.target as HTMLElement).closest<HTMLButtonElement>('button.code-copy-float');
|
|
257
264
|
if (target) {
|
|
258
|
-
const text = target.dataset.copy ?? '';
|
|
259
|
-
if (!text) return;
|
|
260
265
|
e.preventDefault();
|
|
261
266
|
e.stopPropagation();
|
|
262
|
-
|
|
263
|
-
if (!ok) return;
|
|
264
|
-
target.setAttribute('data-copied', 'true');
|
|
265
|
-
target.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>';
|
|
266
|
-
setTimeout(() => {
|
|
267
|
-
target.removeAttribute('data-copied');
|
|
268
|
-
target.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';
|
|
269
|
-
}, 2000);
|
|
270
|
-
});
|
|
267
|
+
copyFromButton(target);
|
|
271
268
|
return;
|
|
272
269
|
}
|
|
273
270
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The MCP rows' status glyph.
|
|
8
|
+
*
|
|
9
|
+
* The colour is the only signal a user gets from the collapsed row, and the
|
|
10
|
+
* fill token is not it: `text-error` is the palette's own `#E06C75` on
|
|
11
|
+
* `onedarkpro-light`, 2.91:1 on the popover's paper — a pale pink that reads as
|
|
12
|
+
* "nothing happened". The solved `-text` token is the red the failure state is
|
|
13
|
+
* supposed to show (4.51:1). A markup check that only looks for `text-error`
|
|
14
|
+
* passes on both, so each case asserts the exact token.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
18
|
+
import { Window } from 'happy-dom';
|
|
19
|
+
import { h, render } from 'preact';
|
|
20
|
+
import { act } from 'preact/test-utils';
|
|
21
|
+
import { McpSection } from '@/client/components/common/context-usage-button/McpSection';
|
|
22
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
23
|
+
import type { McpProbeResult, SessionMcpPayload } from '@/shared/types';
|
|
24
|
+
|
|
25
|
+
const nativeFetch = Bun.fetch;
|
|
26
|
+
let container: HTMLElement;
|
|
27
|
+
|
|
28
|
+
function payload(probe: McpProbeResult | null): SessionMcpPayload {
|
|
29
|
+
return {
|
|
30
|
+
sessionId: 'session-mcp',
|
|
31
|
+
harness: 'omp-rpc',
|
|
32
|
+
delivery: 'omp-config',
|
|
33
|
+
live: false,
|
|
34
|
+
servers: [{ name: 'obsidian', transport: 'http', source: 'user', enabled: true, probe }],
|
|
35
|
+
overrides: {},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function mount(probe: McpProbeResult | null): Promise<void> {
|
|
40
|
+
(globalThis as unknown as Record<string, unknown>).fetch = async () =>
|
|
41
|
+
new Response(JSON.stringify(payload(probe)), {
|
|
42
|
+
status: 200,
|
|
43
|
+
headers: { 'content-type': 'application/json' },
|
|
44
|
+
});
|
|
45
|
+
container = document.createElement('div');
|
|
46
|
+
document.body.appendChild(container);
|
|
47
|
+
await act(async () => {
|
|
48
|
+
render(h(McpSection, { sessionId: 'session-mcp' }), container);
|
|
49
|
+
});
|
|
50
|
+
for (let i = 0; i < 5; i += 1) await act(async () => {});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function infoButton(): HTMLElement {
|
|
54
|
+
return container.querySelector('button[aria-label^="obsidian status"]') as HTMLElement;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
beforeAll(() => {
|
|
58
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
afterEach(() => {
|
|
62
|
+
if (container) {
|
|
63
|
+
render(null, container);
|
|
64
|
+
container.remove();
|
|
65
|
+
}
|
|
66
|
+
(globalThis as unknown as Record<string, unknown>).fetch = nativeFetch;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
afterAll(() => {
|
|
70
|
+
restoreDomGlobals();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('McpSection status glyph', () => {
|
|
74
|
+
test('a failed handshake paints the info control with the readable red', async () => {
|
|
75
|
+
await mount({ ok: false, error: 'ECONNREFUSED', toolCount: 0, durationMs: 0, checkedAt: 1 });
|
|
76
|
+
|
|
77
|
+
const button = infoButton();
|
|
78
|
+
expect(button.getAttribute('aria-label')).toBe('obsidian status: error');
|
|
79
|
+
expect(button.classList.contains('text-error-text')).toBe(true);
|
|
80
|
+
expect(button.classList.contains('text-error')).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('a handshake that answered paints it green', async () => {
|
|
84
|
+
await mount({ ok: true, toolCount: 8, durationMs: 152, checkedAt: 1 });
|
|
85
|
+
|
|
86
|
+
const button = infoButton();
|
|
87
|
+
expect(button.getAttribute('aria-label')).toBe('obsidian status: active');
|
|
88
|
+
expect(button.classList.contains('text-success-text')).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('a server that was never probed stays amber', async () => {
|
|
92
|
+
await mount(null);
|
|
93
|
+
|
|
94
|
+
const button = infoButton();
|
|
95
|
+
expect(button.getAttribute('aria-label')).toBe('obsidian status: unknown');
|
|
96
|
+
expect(button.classList.contains('text-warning-text')).toBe(true);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
@@ -25,12 +25,19 @@ interface McpSectionProps {
|
|
|
25
25
|
sessionId: string | null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* The `-text` tokens, not the fill ones: the icon is a 12px glyph on the
|
|
30
|
+
* popover's paper, and the fill hex is the palette's own signal colour, which
|
|
31
|
+
* is not solved for reading. Measured on `onedarkpro-light`: `--theme-error`
|
|
32
|
+
* `#E06C75` is 2.91:1 on the paper (a pale pink), while `--theme-error-text`
|
|
33
|
+
* `#af545b` is 4.51:1 — the red the failure state is supposed to show.
|
|
34
|
+
*/
|
|
28
35
|
const STATUS_ICON_CLASS: Record<McpServerStatus, string> = {
|
|
29
|
-
active: 'text-success',
|
|
30
|
-
error: 'text-error',
|
|
31
|
-
checking: 'text-warning',
|
|
32
|
-
disabled: 'text-error',
|
|
33
|
-
unknown: 'text-warning',
|
|
36
|
+
active: 'text-success-text',
|
|
37
|
+
error: 'text-error-text',
|
|
38
|
+
checking: 'text-warning-text',
|
|
39
|
+
disabled: 'text-error-text',
|
|
40
|
+
unknown: 'text-warning-text',
|
|
34
41
|
};
|
|
35
42
|
|
|
36
43
|
function statusDetail(server: SessionMcpServer, status: McpServerStatus): string {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The timing half of the context popover: turns/steps, how long the model and
|
|
8
|
+
* the tools spent, and the rates behind them.
|
|
9
|
+
*
|
|
10
|
+
* EVERY row is conditional on its measurement existing. An ACP chat reports no
|
|
11
|
+
* per-call timing and an older transcript has no `ttft`; printing `0s` there
|
|
12
|
+
* would state a measurement the source never made — the same defect
|
|
13
|
+
* `cacheHitAverage` already avoids by hiding its row.
|
|
14
|
+
*
|
|
15
|
+
* `turns` is the count of user prompts and `steps` the count of assistant
|
|
16
|
+
* calls (one LLM request each). They are read straight off the telemetry the
|
|
17
|
+
* popover already receives, so a second counter cannot drift from them.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import type { SessionTimingStats } from '@/shared/types';
|
|
21
|
+
import { formatSpan } from '@/shared/lib/format/duration';
|
|
22
|
+
|
|
23
|
+
interface SessionStatsProps {
|
|
24
|
+
/** User prompts; a run may contain several LLM/tool turns. */
|
|
25
|
+
turns: number;
|
|
26
|
+
/** Assistant messages, i.e. one LLM request each. */
|
|
27
|
+
steps: number;
|
|
28
|
+
timing?: SessionTimingStats;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const ROW = 'flex justify-between gap-2';
|
|
32
|
+
const LABEL = 'text-ink/50 flex-shrink-0';
|
|
33
|
+
|
|
34
|
+
export function SessionStats({ turns, steps, timing }: SessionStatsProps) {
|
|
35
|
+
const llm = formatSpan(timing?.llmMs);
|
|
36
|
+
const tool = formatSpan(timing?.toolMs);
|
|
37
|
+
const ttft = formatSpan(timing?.ttftAvgMs);
|
|
38
|
+
const lastRate = timing?.lastTps === undefined ? undefined : timing.lastTps.toFixed(1);
|
|
39
|
+
const avgRate = timing?.avgTps === undefined ? undefined : timing.avgTps.toFixed(1);
|
|
40
|
+
const rateLabel = lastRate && avgRate
|
|
41
|
+
? `${lastRate} / ${avgRate}`
|
|
42
|
+
: lastRate
|
|
43
|
+
? `${lastRate} last`
|
|
44
|
+
: avgRate
|
|
45
|
+
? `${avgRate} avg`
|
|
46
|
+
: undefined;
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className="pt-2 mt-2 border-t border-ink/10 space-y-1.5">
|
|
50
|
+
<div className={ROW}>
|
|
51
|
+
<span className={LABEL}>Turns / steps:</span>
|
|
52
|
+
<span>{turns} / {steps}</span>
|
|
53
|
+
</div>
|
|
54
|
+
{llm && (
|
|
55
|
+
<div className={ROW}>
|
|
56
|
+
<span className={LABEL}>LLM time:</span>
|
|
57
|
+
<span>{llm}</span>
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
{tool && (
|
|
61
|
+
<div className={ROW}>
|
|
62
|
+
<span className={LABEL}>Tool time:</span>
|
|
63
|
+
<span>{tool}</span>
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
{ttft && (
|
|
67
|
+
<div className={ROW}>
|
|
68
|
+
<span className={LABEL}>TTFT avg:</span>
|
|
69
|
+
<span>{ttft}</span>
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
{rateLabel && (
|
|
73
|
+
<div className={ROW}>
|
|
74
|
+
<span className={LABEL}>Tok/s:</span>
|
|
75
|
+
<span>{rateLabel}</span>
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -59,6 +59,7 @@ function telemetryAt(percent: number): SessionContextTelemetry {
|
|
|
59
59
|
assistantCount: 3,
|
|
60
60
|
totalCost: 0.02,
|
|
61
61
|
costFormatted: '$0.02',
|
|
62
|
+
timing: { llmMs: 5000, toolMs: 1500, ttftAvgMs: 750, lastTps: 50, avgTps: 48.2 },
|
|
62
63
|
cacheHitAverage: 91.5,
|
|
63
64
|
lastMessage: { input: 10, output: 4, reasoning: 0, cacheRead: 2, cacheWrite: 0, cacheHitPercent: 16.6 },
|
|
64
65
|
distribution: { userTokens: 1, userPercent: 25, assistantTokens: 1, assistantPercent: 25, toolTokens: 1, toolPercent: 25, otherTokens: 1, otherPercent: 25 },
|
|
@@ -204,6 +205,16 @@ describe('ContextUsageButton', () => {
|
|
|
204
205
|
expect(panel?.textContent).toContain('DeepSeek V4-1-Flash');
|
|
205
206
|
expect(panel?.textContent).toContain('42%');
|
|
206
207
|
expect(panel?.textContent).toContain('$0.02');
|
|
208
|
+
expect(panel?.textContent).toContain('Turns / steps:');
|
|
209
|
+
expect(panel?.textContent).toContain('1 / 3');
|
|
210
|
+
expect(panel?.textContent).toContain('LLM time:');
|
|
211
|
+
expect(panel?.textContent).toContain('5.0s');
|
|
212
|
+
expect(panel?.textContent).toContain('Tool time:');
|
|
213
|
+
expect(panel?.textContent).toContain('1.5s');
|
|
214
|
+
expect(panel?.textContent).toContain('TTFT avg:');
|
|
215
|
+
expect(panel?.textContent).toContain('0.8s');
|
|
216
|
+
expect(panel?.textContent).toContain('Tok/s:');
|
|
217
|
+
expect(panel?.textContent).toContain('50.0 / 48.2');
|
|
207
218
|
|
|
208
219
|
await act(async () => {
|
|
209
220
|
document.dispatchEvent(new window.KeyboardEvent('keydown', { key: 'Escape' }));
|
|
@@ -211,6 +222,21 @@ describe('ContextUsageButton', () => {
|
|
|
211
222
|
expect(dialog()).toBeNull();
|
|
212
223
|
});
|
|
213
224
|
|
|
225
|
+
test('omits timing rows the source never measured', async () => {
|
|
226
|
+
// An ACP chat reports no per-call timing; printing "0s" would state a
|
|
227
|
+
// measurement the source never made.
|
|
228
|
+
await mount({ ...telemetryAt(42), timing: undefined });
|
|
229
|
+
await act(async () => {
|
|
230
|
+
trigger().click();
|
|
231
|
+
});
|
|
232
|
+
const panel = dialog();
|
|
233
|
+
expect(panel?.textContent).toContain('Turns / steps:');
|
|
234
|
+
expect(panel?.textContent).not.toContain('LLM time:');
|
|
235
|
+
expect(panel?.textContent).not.toContain('Tool time:');
|
|
236
|
+
expect(panel?.textContent).not.toContain('TTFT avg:');
|
|
237
|
+
expect(panel?.textContent).not.toContain('Tok/s:');
|
|
238
|
+
});
|
|
239
|
+
|
|
214
240
|
test('a session with no turn says so instead of printing zeros', async () => {
|
|
215
241
|
await mount({ ...telemetryAt(0), messagesCount: 0 });
|
|
216
242
|
expect(trigger().getAttribute('title')).toBe('Context usage: session not started');
|