codelith 0.1.0__py3-none-any.whl
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.
- backend/__init__.py +1 -0
- backend/agents/__init__.py +6 -0
- backend/agents/assessment_agent.py +273 -0
- backend/agents/coding_agent.py +779 -0
- backend/agents/concept_categories.py +131 -0
- backend/agents/concept_detector.py +1217 -0
- backend/agents/debug_agent.py +166 -0
- backend/agents/teacher_agent.py +179 -0
- backend/cli/__init__.py +1 -0
- backend/cli/config_cmd.py +135 -0
- backend/cli/main.py +606 -0
- backend/daemon/__init__.py +1 -0
- backend/daemon/launcher.py +243 -0
- backend/daemon/server.py +453 -0
- backend/daemon/state.py +110 -0
- backend/daemon/static/assets/Gambarino-Regular-BjbcsURA.otf +0 -0
- backend/daemon/static/assets/abnfDiagram-VCTEODGH-CCJBE2aE.js +1 -0
- backend/daemon/static/assets/arc-BEvzHx4o.js +1 -0
- backend/daemon/static/assets/architecture-7GRP2DOG-DaWrPggL.js +1 -0
- backend/daemon/static/assets/architectureDiagram-5GKGNRK7-pR-klcZv.js +36 -0
- backend/daemon/static/assets/array-BifhSqXX.js +1 -0
- backend/daemon/static/assets/blockDiagram-I7D4REHJ-C504Gj6_.js +129 -0
- backend/daemon/static/assets/c4Diagram-7LVT6UL2-BjM04Mni.js +38 -0
- backend/daemon/static/assets/channel-DzSauwD3.js +1 -0
- backend/daemon/static/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- backend/daemon/static/assets/chunk-4HAMMTFA-EgoP78tp.js +62 -0
- backend/daemon/static/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- backend/daemon/static/assets/chunk-75Z2AOVW-EXNbuzun.js +2 -0
- backend/daemon/static/assets/chunk-DU6HZSFF-CF3OK3MZ.js +127 -0
- backend/daemon/static/assets/chunk-F27PBJKO-G71ylWJa.js +1 -0
- backend/daemon/static/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- backend/daemon/static/assets/chunk-GMAD6QVW-2yfGg28o.js +72 -0
- backend/daemon/static/assets/chunk-GVQU2GXP-C_VeaX4U.js +1 -0
- backend/daemon/static/assets/chunk-IMKFNOWR-CNexRjjn.js +231 -0
- backend/daemon/static/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- backend/daemon/static/assets/chunk-P2QGCYS3-E4AByfsD.js +1 -0
- backend/daemon/static/assets/chunk-POPQ4Y6H-Bisbc2-3.js +1 -0
- backend/daemon/static/assets/chunk-PWAF6VOD-DaoPxZAa.js +1 -0
- backend/daemon/static/assets/chunk-SHT3W25Y-DarPToto.js +168 -0
- backend/daemon/static/assets/chunk-SVP7TREG-DvMOAiwI.js +88 -0
- backend/daemon/static/assets/chunk-TICWLB2K-DheuvyGM.js +206 -0
- backend/daemon/static/assets/chunk-XXDRQBXY-DFBUG-OT.js +1 -0
- backend/daemon/static/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- backend/daemon/static/assets/classDiagram-ZZMXUADV-Ys5zkCXW.js +1 -0
- backend/daemon/static/assets/classDiagram-v2-VYDZK3BY-Ys5zkCXW.js +1 -0
- backend/daemon/static/assets/cose-bilkent-JH36ORCC-DLPLnxrP.js +1 -0
- backend/daemon/static/assets/cynefin-OW5HDTMX-Dv1OY_0y.js +1 -0
- backend/daemon/static/assets/cynefinDiagram-5FMLGOSQ-Ur7MTCmF.js +62 -0
- backend/daemon/static/assets/cytoscape.esm-CECbKnxF.js +321 -0
- backend/daemon/static/assets/dagre-CJLTJMFW.js +1 -0
- backend/daemon/static/assets/dagre-GXQ25YYZ-R3BwTvng.js +4 -0
- backend/daemon/static/assets/defaultLocale-BFoDCU3G.js +1 -0
- backend/daemon/static/assets/diagram-S7CK7UJ4-BxIoEKb4.js +30 -0
- backend/daemon/static/assets/diagram-UQ7AKVKN-DO4cuWN-.js +41 -0
- backend/daemon/static/assets/diagram-VSXAHHWV-DW5imp5t.js +3 -0
- backend/daemon/static/assets/diagram-VX7I27RA-CdZ3k7wQ.js +24 -0
- backend/daemon/static/assets/diagram-Z3DM3KII-DPyjbneL.js +24 -0
- backend/daemon/static/assets/dist-DTg6UBE_.js +1 -0
- backend/daemon/static/assets/ebnfDiagram-PWID7BFC-BO7VQsye.js +1 -0
- backend/daemon/static/assets/erDiagram-RLTQ6QDP-CevvjECq.js +99 -0
- backend/daemon/static/assets/eventmodeling-NTZA5JFV-yNfKR6-v.js +1 -0
- backend/daemon/static/assets/flowDiagram-HODETNUW-B4GT41mU.js +1 -0
- backend/daemon/static/assets/ganttDiagram-EL5Y4UJY-DNW5fWw1.js +292 -0
- backend/daemon/static/assets/gitGraph-4MIJSDKK-DKgVkWaZ.js +1 -0
- backend/daemon/static/assets/gitGraphDiagram-WWUBYQGX-0S7OF9Aj.js +106 -0
- backend/daemon/static/assets/index-D3vj8REa.js +63 -0
- backend/daemon/static/assets/index-D4lMFaiv.css +1 -0
- backend/daemon/static/assets/info-A6RAGUB7-Bxy-SzRN.js +1 -0
- backend/daemon/static/assets/infoDiagram-27XIBGKW-ClzQji6X.js +2 -0
- backend/daemon/static/assets/init-C-OQMol4.js +1 -0
- backend/daemon/static/assets/ishikawaDiagram-5VMMS53U-B3Lo-sS3.js +70 -0
- backend/daemon/static/assets/journeyDiagram-3NMN7TZE-0KL6R2Rz.js +139 -0
- backend/daemon/static/assets/kanban-definition-UXKFOSKX-zt5NbEep.js +89 -0
- backend/daemon/static/assets/katex-CXMH3UgJ.js +257 -0
- backend/daemon/static/assets/line-CiAFRJVJ.js +1 -0
- backend/daemon/static/assets/linear-BI6yqEPV.js +1 -0
- backend/daemon/static/assets/logo_darkmode-BPDdj6GZ.png +0 -0
- backend/daemon/static/assets/logo_lightmode-C3ZWMgAH.png +0 -0
- backend/daemon/static/assets/mermaid-parser.core-DEadI1Ja.js +7 -0
- backend/daemon/static/assets/mindmap-definition-YA3MSWOX-TGKGYg5n.js +96 -0
- backend/daemon/static/assets/ordinal-BDEzSJ7C.js +1 -0
- backend/daemon/static/assets/packet-AYTQ26CC-CZTSuh5x.js +1 -0
- backend/daemon/static/assets/path-fybaL0A-.js +1 -0
- backend/daemon/static/assets/pegDiagram-XKGWAZYB-DGd8LACA.js +1 -0
- backend/daemon/static/assets/pie-WAS4IAKB-B59sPr3Z.js +1 -0
- backend/daemon/static/assets/pieDiagram-E7YTZNPT-CpwxCR3L.js +39 -0
- backend/daemon/static/assets/quadrantDiagram-AXDQQJYC-BwSeF_E_.js +7 -0
- backend/daemon/static/assets/radar-RG4KPBEZ-DAa4JvTb.js +1 -0
- backend/daemon/static/assets/railroad-74A4TZTK-BitdNgDt.js +1 -0
- backend/daemon/static/assets/railroad-abnf-HS5TGJTU-DCrNKqAH.js +1 -0
- backend/daemon/static/assets/railroad-ebnf-LZEXJU2U-DmEwx8OK.js +1 -0
- backend/daemon/static/assets/railroad-peg-WCYAUIDC-CPc8dTCP.js +1 -0
- backend/daemon/static/assets/railroadDiagram-O6MQD6OU-DuizuzwD.js +1 -0
- backend/daemon/static/assets/requirementDiagram-BXWQKSXE-BjMk0yS8.js +84 -0
- backend/daemon/static/assets/rough.esm-Dy-Kn_BL.js +1 -0
- backend/daemon/static/assets/sankeyDiagram-P5KCCOFB-0T_bhkmz.js +40 -0
- backend/daemon/static/assets/sequenceDiagram-WJ2MYXX4-Cwa-1Stp.js +162 -0
- backend/daemon/static/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- backend/daemon/static/assets/src-BH-TyZbA.js +1 -0
- backend/daemon/static/assets/stateDiagram-D77RDMKH-BpQSg_QL.js +1 -0
- backend/daemon/static/assets/stateDiagram-v2-MP3YSRHH-BItVXKof.js +1 -0
- backend/daemon/static/assets/swimlanes-42K2YHIH-h_ED18Vy.js +1 -0
- backend/daemon/static/assets/swimlanesDiagram-VR7AAH4N-D0fo0LN-.js +8 -0
- backend/daemon/static/assets/timeline-definition-24CTP7MA-DKfSO33a.js +120 -0
- backend/daemon/static/assets/treeView-Q6P3EWNA-DAj9fxfC.js +1 -0
- backend/daemon/static/assets/treemap-WGGIJYW6-5IIXD9Zu.js +1 -0
- backend/daemon/static/assets/vennDiagram-4TSXK5OY-BoBvVEci.js +34 -0
- backend/daemon/static/assets/wardley-WFR3VGLG-CGsd7s_-.js +1 -0
- backend/daemon/static/assets/wardleyDiagram-VM6X3IG4-QHdK5NsY.js +78 -0
- backend/daemon/static/assets/xychartDiagram-S5SC5T6Z-MN_fdKCJ.js +7 -0
- backend/daemon/static/index.html +49 -0
- backend/database/__init__.py +1 -0
- backend/database/concept_slug.py +39 -0
- backend/database/concepts.py +804 -0
- backend/llm/__init__.py +5 -0
- backend/llm/client.py +333 -0
- backend/llm/config.py +254 -0
- backend/llm/key_setup.py +237 -0
- backend/main.py +13 -0
- backend/orchestrator/__init__.py +1 -0
- backend/orchestrator/events.py +52 -0
- backend/orchestrator/graph.py +316 -0
- backend/orchestrator/modes.py +125 -0
- codelith-0.1.0.dist-info/METADATA +301 -0
- codelith-0.1.0.dist-info/RECORD +129 -0
- codelith-0.1.0.dist-info/WHEEL +5 -0
- codelith-0.1.0.dist-info/entry_points.txt +2 -0
- codelith-0.1.0.dist-info/licenses/LICENSE +21 -0
- codelith-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--color-bg:#181823;--color-bg-dim:#12121d;--color-bg-card:#1f2030;--color-bg-elevated:#25273c;--color-border:#2e3248;--color-border-subtle:#2e3248;--color-border-strong:#3e4c7a;--color-border-accent:#537fe733;--color-accent:#537fe7;--color-accent-hover:#678ff0;--color-accent-dim:#537fe71f;--color-telemetry:#c0eef2;--color-telemetry-solid:#7ebffc;--color-success:#10b981;--color-warning:#f59e0b;--color-danger:#ef4444;--color-text-primary:#fff;--color-text-secondary:#d0d6dd;--color-text-muted:#b4c6e0;--color-telemetry-dim:#c0eef24d;--diff-add-bg:#10b9811f;--diff-add-text:#a7f3d0;--diff-del-bg:#ef44441f;--diff-del-text:#fecaca;--shadow-popover:0 16px 36px -8px #000000a6, 0 0 0 1px var(--color-border-strong);--glow-telemetry:0 0 12px #c0eef240;--glow-primary:0 0 12px #537fe759;--font-sans:"Geist", system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono:"JetBrains Mono", ui-monospace, "Cascadia Code", monospace;--radius-sm:.125rem;--radius-default:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem}[data-theme=light]{--color-bg:#f4f6fb;--color-bg-dim:#eceff7;--color-bg-card:#fff;--color-bg-elevated:#eef1f9;--color-border:#d5dbeb;--color-border-subtle:#e2e7f2;--color-border-strong:#b9c2da;--color-border-accent:#537fe740;--color-accent:#3b66c4;--color-accent-hover:#2f57b2;--color-accent-dim:#3b66c41a;--color-telemetry:#0b6e8f;--color-telemetry-solid:#0b6e8f;--color-success:#059669;--color-warning:#b45309;--color-danger:#dc2626;--color-text-primary:#161a2b;--color-text-secondary:#3d4358;--color-text-muted:#5a6379;--color-telemetry-dim:#0b6e8f2e;--diff-add-bg:#0596691a;--diff-add-text:#047857;--diff-del-bg:#dc262614;--diff-del-text:#b91c1c;--shadow-popover:0 16px 36px -8px #161a2b2e, 0 0 0 1px var(--color-border-strong);--glow-telemetry:none;--glow-primary:none}*{box-sizing:border-box}@font-face{font-family:Gambarino;src:url(/assets/Gambarino-Regular-BjbcsURA.otf)format("opentype");font-weight:400;font-style:normal;font-display:swap}html{scroll-behavior:smooth}body{background-color:var(--color-bg);color:var(--color-text-primary);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-size:13px}::selection{background:#537fe759}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:9999px}::-webkit-scrollbar-thumb:hover{background:var(--color-border-strong)}kbd{background:var(--color-bg-elevated);border:1px solid var(--color-border);border-radius:var(--radius-default);color:var(--color-text-primary);font-family:var(--font-mono);padding:2px 6px;font-size:11px}.text-sm{font-size:.875rem}.text-lg{font-size:1.125rem}.text-secondary{color:var(--color-text-secondary)}.cl-shell{min-height:100vh}.cl-header{z-index:50;background:var(--color-bg-card);border-bottom:1px solid var(--color-border);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;gap:.75rem;height:48px;padding:0 1rem 0 0;display:flex;position:fixed;top:0;left:0;right:0}:root:not([data-theme=light]) .cl-header{background:#000}.cl-header-brand{align-items:center;gap:.625rem;min-width:0;display:flex}.cl-logo-tile{border-radius:var(--radius-default);object-fit:contain;flex-shrink:0;width:150px;height:90px;display:block}.cl-version-chip{font-family:var(--font-mono);letter-spacing:.08em;color:var(--color-text-muted);background:var(--color-bg-elevated);border:1px solid var(--color-border);border-radius:var(--radius-default);padding:1px 6px;font-size:10px;font-weight:600}.cl-header-status{align-items:center;gap:.5rem;min-width:0;display:flex}.metric-chip{border-radius:var(--radius-default);background:var(--color-bg-elevated);border:1px solid var(--color-border);font-family:var(--font-mono);color:var(--color-text-secondary);white-space:nowrap;align-items:center;gap:.375rem;padding:.25rem .625rem;font-size:11px;font-weight:500;line-height:16px;display:inline-flex}.metric-chip svg{flex-shrink:0}.metric-chip--accent{color:var(--color-telemetry);border-color:var(--color-telemetry-dim)}.metric-chip--primary{color:var(--color-telemetry-solid);border-color:#7ebffc66}[data-theme=light] .metric-chip--primary{border-color:var(--color-telemetry-dim)}.mode-dot{background:var(--color-telemetry-solid);border-radius:9999px;flex-shrink:0;width:6px;height:6px}.metric-chip strong{color:var(--color-text-primary);font-weight:600}.daemon-dot{background:var(--color-success);border-radius:9999px;flex-shrink:0;width:10px;height:10px;animation:1.5s ease-in-out infinite cl-breathe;position:relative;box-shadow:0 0 6px #10b98199}.daemon-dot--streaming{background:#3492eb;box-shadow:0 0 6px #3492eb99}[data-theme=light] .daemon-dot--streaming{background:var(--color-accent);box-shadow:0 0 6px #3b66c473}.daemon-dot--error{background:var(--color-danger);animation:none;box-shadow:0 0 6px #ef444499}.daemon-dot:after{content:"";border-radius:9999px;animation:2s ease-out infinite cl-ripple;position:absolute;inset:0}.daemon-dot--streaming:after{animation-name:cl-ripple-telemetry}@keyframes cl-ripple{0%{box-shadow:0 0 #10b98173}70%,to{box-shadow:0 0 0 8px #10b98100}}@keyframes cl-ripple-telemetry{0%{box-shadow:0 0 #3492eb66}70%,to{box-shadow:0 0 0 8px #3492eb00}}.cl-navigator{z-index:40;background:var(--color-bg-card);border-right:1px solid var(--color-border);-webkit-user-select:none;user-select:none;flex-direction:column;justify-content:space-between;width:240px;display:flex;position:fixed;top:48px;bottom:0;left:0}:root:not([data-theme=light]) .cl-navigator{background:#000}.cl-nav{flex-direction:column;gap:2px;padding:.5rem;display:flex}.cl-nav-link{border-radius:var(--radius-default);width:100%;color:var(--color-text-muted);font-family:var(--font-sans);text-align:left;cursor:pointer;background:0 0;border:none;border-left:2px solid #0000;align-items:center;gap:.625rem;padding:.5rem .625rem;font-size:13px;line-height:20px;transition:background-color .15s,color .15s;display:flex}.cl-nav-link svg{flex-shrink:0}.cl-nav-link:hover{background:var(--color-bg-elevated);color:var(--color-text-primary)}.cl-nav-link.active{background:var(--color-bg-elevated);border-left-color:var(--color-accent);color:var(--color-text-primary);font-weight:600}.cl-nav-link.active svg{color:var(--color-accent)}.cl-nav-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cl-navigator-footer{border-top:1px solid var(--color-border-subtle);padding:.5rem}.cl-telemetry-btn{border-radius:var(--radius-default);border:1px solid var(--color-telemetry-dim);width:100%;color:var(--color-telemetry);font-family:var(--font-mono);letter-spacing:.02em;cursor:pointer;background:0 0;justify-content:center;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:11px;font-weight:500;transition:background-color .15s,border-color .15s;display:flex}.cl-telemetry-btn:hover:not(:disabled){background:var(--color-bg-elevated);border-color:var(--color-telemetry)}.cl-telemetry-btn:disabled{opacity:.4;cursor:not-allowed}.cl-canvas{min-height:calc(100vh - 48px);margin-top:48px;margin-left:240px}.cl-canvas--docked{margin-right:380px}.cl-main{flex-direction:column;gap:1rem;max-width:900px;padding:1rem 1.5rem 2.5rem;display:flex}.cl-section{min-width:0;margin-top:.5cm}.cl-telemetry{z-index:40;background:var(--color-bg-card);border-left:1px solid var(--color-border);-webkit-user-select:none;user-select:none;flex-direction:column;width:380px;display:flex;position:fixed;top:48px;bottom:0;right:0;overflow-y:auto}:root:not([data-theme=light]) .cl-telemetry{background:#000}.cl-telemetry-section{border-bottom:1px solid var(--color-border-subtle);padding:.625rem .875rem}.cl-telemetry-section:last-child{border-bottom:none}.cl-telemetry-chips{flex-wrap:wrap;gap:.375rem;display:flex}.cl-stream{flex-direction:column;display:flex}.cl-stream-entry{font-family:var(--font-mono);border-bottom:1px dashed #2e324899;align-items:baseline;gap:.5rem;padding:.3125rem 0;font-size:11px;line-height:16px;display:flex}.cl-stream-entry:last-child{border-bottom:none}.cl-stream-time{color:var(--color-text-muted);flex-shrink:0}.cl-stream-kind{letter-spacing:.05em;text-transform:uppercase;border-radius:var(--radius-sm);border:1px solid;flex-shrink:0;padding:0 5px;font-size:10px;font-weight:600}.cl-stream-kind--concept{color:var(--color-telemetry);border-color:var(--color-telemetry-dim)}.cl-stream-kind--teaching{color:var(--diff-add-text);border-color:#10b9814d}.cl-stream-kind--assessment{color:#fcd34d;border-color:#f59e0b59}[data-theme=light] .cl-stream-kind--assessment{color:var(--color-warning);border-color:#b4530959}.cl-stream-kind--system{color:var(--color-text-secondary);border-color:var(--color-border)}.cl-stream-text{color:var(--color-text-secondary);overflow-wrap:anywhere;min-width:0}.cl-stream-empty{font-family:var(--font-mono);color:var(--color-text-muted);margin:0;font-size:11px;line-height:18px}.cl-payload{font-family:var(--font-mono);color:var(--color-telemetry);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:11px;line-height:16px}.cl-dock-actions{gap:.375rem;margin-top:.5rem;display:flex}.cl-dock-toggle{border-radius:var(--radius-default);background:var(--color-bg-elevated);border:1px solid var(--color-border);color:var(--color-text-secondary);font-family:var(--font-mono);cursor:pointer;flex:1;justify-content:center;align-items:center;gap:.375rem;padding:.3125rem .5rem;font-size:11px;transition:background-color .15s,color .15s;display:flex}.cl-dock-toggle:hover{background:var(--color-bg-dim);color:var(--color-text-primary)}.cl-header-btn{border-radius:var(--radius-default);border:1px solid var(--color-border);width:28px;height:28px;color:var(--color-text-secondary);cursor:pointer;background:0 0;justify-content:center;align-items:center;transition:background-color .15s,color .15s;display:none}.cl-header-btn:hover,.cl-header-btn.active{background:var(--color-bg-elevated);color:var(--color-text-primary)}.cl-mobile-tabs{z-index:50;background:var(--color-bg-card);border-top:1px solid var(--color-border);height:56px;padding:0 .25rem;display:none;position:fixed;bottom:0;left:0;right:0}.cl-mobile-tab{color:var(--color-text-muted);cursor:pointer;background:0 0;border:none;border-top:2px solid #0000;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:2px;padding:0;display:flex}.cl-mobile-tab span:last-child{font-family:var(--font-mono);letter-spacing:.05em;text-transform:uppercase;font-size:9px}.cl-mobile-tab.active{border-top-color:var(--color-accent);color:var(--color-text-primary);background:var(--color-bg-elevated)}.session-hero{justify-content:space-between;align-items:flex-end;gap:1rem;padding-bottom:.25rem;display:flex}.session-title{letter-spacing:.01em;color:var(--color-text-primary);align-items:center;gap:.625rem;margin:0 0 .25rem;font-family:Gambarino,serif;font-size:1.3125rem;font-weight:400;line-height:1.3;display:flex}.session-live-badge{font-family:var(--font-mono);letter-spacing:.08em;border-radius:var(--radius-default);color:var(--color-telemetry);border:1px solid var(--color-telemetry-dim);background:#c0eef214;padding:1px 8px;font-size:10px;font-weight:600}.session-blurb{max-width:40rem;color:var(--color-text-secondary);margin:.5rem 0 0;font-size:13px;line-height:20px}.session-hero-chips{flex-wrap:wrap;flex-shrink:0;gap:.375rem;display:flex}.card{background:var(--color-bg-card);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:1.25rem}.card--large{padding:2rem}@media (width>=640px){.card--large{padding:2.5rem}}.card-label{font-family:var(--font-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--color-text-muted);margin:0 0 1rem;font-size:10px;font-weight:600}.card-label--tight{margin-bottom:.75rem}.card-label--header{margin-bottom:0}.card-header-row{justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:1rem;display:flex}.badge{border-radius:var(--radius-default);font-family:var(--font-mono);letter-spacing:.03em;padding:.125rem .5rem;font-size:.6875rem;font-weight:600;display:inline-block}.badge--accent{background:var(--color-accent-dim);color:var(--color-telemetry);border:1px solid var(--color-telemetry-dim)}.badge--neutral{background:var(--color-bg-elevated);border:1px solid var(--color-border);color:var(--color-text-secondary)}.accordion-item{background:var(--color-bg-dim);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);transition:border-color .15s;overflow:hidden}.accordion-item:hover{border-color:var(--color-border-strong)}.accordion-header{width:100%;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;justify-content:space-between;align-items:center;padding:.75rem 1rem;transition:background-color .15s;display:flex}.accordion-header:hover{background:var(--color-bg-elevated)}.accordion-body{border-top:1px solid var(--color-border-subtle);padding:0 1rem 1rem}.chevron{width:1rem;height:1rem;color:var(--color-text-muted);flex-shrink:0;transition:transform .15s}.chevron--open{transform:rotate(180deg)}.btn{border-radius:var(--radius-default);font-family:var(--font-sans);cursor:pointer;border:none;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:background-color .15s,border-color .15s,color .15s;display:inline-block}.btn:active:not(:disabled){transform:scale(.98)}.btn--primary{background-color:var(--color-accent);color:var(--color-text-primary);box-shadow:inset 0 1px #e9f8f940}.btn--primary:hover:not(:disabled){background-color:var(--color-accent-hover)}.btn:disabled{opacity:.4;cursor:not-allowed}.btn--ghost{border:1px solid var(--color-border);color:var(--color-text-secondary);background:0 0}.btn--ghost:hover:not(:disabled){background:var(--color-bg-elevated);border-color:var(--color-border-strong);color:var(--color-text-primary)}.btn--danger{background:var(--color-danger);color:var(--color-text-primary)}.btn--danger:hover:not(:disabled){filter:brightness(1.1)}.btn--small{padding:.3rem .75rem;font-size:.75rem}.input,.textarea{background:var(--color-bg-dim);border:1px solid var(--color-border);border-radius:var(--radius-default);font-family:var(--font-sans);color:var(--color-text-primary);padding:.5rem 1rem;font-size:.875rem;transition:border-color .15s,box-shadow .15s}.input::placeholder,.textarea::placeholder{color:var(--color-text-muted)}.input:focus,.textarea:focus{border-color:var(--color-accent);box-shadow:0 0 0 1px var(--color-accent);outline:none}.textarea{resize:none;width:100%;padding:.5rem .75rem}.chat-prompt-field{background:var(--color-bg-dim);border:1px solid var(--color-border);border-radius:var(--radius-default);flex:1;align-items:center;transition:border-color .15s,box-shadow .15s;display:flex}.chat-prompt-field:focus-within{border-color:var(--color-accent);box-shadow:0 0 0 1px var(--color-accent)}.chat-prompt-token{font-family:var(--font-mono);color:var(--color-accent);-webkit-user-select:none;user-select:none;flex-shrink:0;padding-left:.75rem;font-size:.875rem}.chat-prompt-field .input{box-shadow:none;background:0 0;border:none;flex:1;padding:.5rem .75rem .5rem .5rem}.chat-prompt-field .input:focus{box-shadow:none;border:none}.confirm-overlay{z-index:60;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:#12121db3;justify-content:center;align-items:center;padding:1.5rem;display:flex;position:fixed;inset:0}.confirm-dialog{background:var(--color-bg-card);border-radius:var(--radius-lg);width:100%;max-width:26rem;box-shadow:var(--shadow-popover);padding:1.5rem}.confirm-title{color:var(--color-text-primary);margin:0 0 .5rem;font-size:1rem;font-weight:600}.confirm-message{color:var(--color-text-secondary);margin:0 0 1.25rem;font-size:.875rem;line-height:1.625}.confirm-actions{justify-content:flex-end;gap:.5rem;display:flex}.dashboard{flex-direction:column;min-height:100vh;display:flex}.dashboard-nav{background:var(--color-bg-card);border-bottom:1px solid var(--color-border);align-items:center;height:48px;padding:0 1rem;display:flex}.dashboard-logo{width:auto;height:2rem}.dashboard-body{flex:1;min-height:0;display:flex}.dashboard-sidebar{border-right:1px solid var(--color-border);width:15rem;padding:1rem}.dashboard-nav-links{flex-direction:column;gap:2px;display:flex}.dashboard-nav-link{border-radius:var(--radius-default);width:100%;font-size:.875rem;font-family:var(--font-sans);text-align:left;cursor:pointer;color:var(--color-text-muted);white-space:nowrap;background:0 0;border:none;padding:.5rem .75rem;text-decoration:none;transition:background-color .15s,color .15s;display:block}.dashboard-nav-link:hover{background:var(--color-bg-elevated);color:var(--color-text-primary)}.dashboard-nav-link.active{background:var(--color-bg-elevated);color:var(--color-text-primary);font-weight:600}.dashboard-main{flex-direction:column;flex:1;gap:1rem;width:100%;min-width:0;max-width:60rem;margin:0 auto;padding:1.5rem;display:flex}.dashboard-title{color:var(--color-text-primary);margin:0 0 .5rem;font-size:1.25rem;font-weight:600}.dashboard-section{min-width:0}.dashboard-chat{height:26rem}.mode-list{grid-template-columns:1fr;align-items:stretch;gap:.75rem;display:grid}@media (width>=1024px){.mode-list{grid-template-columns:repeat(3,1fr)}}.mode-btn{border-radius:var(--radius-lg);background:var(--color-bg-elevated);border:1px solid var(--color-border-accent);color:inherit;font:inherit;text-align:left;cursor:pointer;flex-direction:column;justify-content:space-between;gap:.875rem;padding:1rem 1rem 2.5rem;transition:border-color .15s,background-color .15s,box-shadow .15s;display:flex;position:relative;overflow:hidden}.mode-btn:hover{border-color:var(--color-border-strong);background:#2a2c44}.mode-btn:active{transform:scale(.99)}.mode-btn--active,.mode-btn--active:hover{border-color:var(--color-accent);box-shadow:var(--glow-primary), inset 0 1px 0 #e9f8f91f;background:linear-gradient(to bottom left,#3432c78c,#3432c724 25%,#3432c700 55%),#0a0a28}[data-theme=light] .mode-btn:hover{background:var(--color-bg-elevated)}[data-theme=light] .mode-btn--active,[data-theme=light] .mode-btn--active:hover{background:linear-gradient(to bottom left, #3b66c429, #3b66c412 25%, #3b66c400 55%), var(--color-bg-elevated);box-shadow:0 4px 14px #3b66c429,inset 0 1px #ffffffb3}:root:not([data-theme=light]) .mode-btn:not(.mode-btn--active),:root:not([data-theme=light]) .mode-btn:not(.mode-btn--active):hover{background:#000}.mode-btn__title-row{align-items:center;display:flex}.mode-name{letter-spacing:.01em;color:var(--color-text-primary);font-family:Gambarino,serif;font-size:1rem;font-weight:400}.mode-btn--active .mode-name,.mode-name--active{color:var(--color-text-primary)}.mode-desc{color:var(--color-text-secondary);margin:.5rem 0 0;font-size:12px;line-height:18px}.mode-tags{flex-wrap:wrap;gap:.375rem;display:flex}.mode-tag{font-family:var(--font-mono);letter-spacing:.02em;border-radius:var(--radius-default);background:var(--color-bg-dim);color:var(--color-telemetry);border:1px solid var(--color-border);padding:.1875rem .5rem;font-size:10px;font-weight:500}.mode-btn--active .mode-tag{border-color:var(--color-telemetry-dim)}.mode-btn--skeleton{border-style:dashed;min-height:10.5rem;animation:2s cubic-bezier(.4,0,.6,1) infinite cl-pulse}.mode-list--stack{flex-direction:column;gap:.5rem;display:flex}.progress-total{align-items:baseline;gap:.5rem;margin-bottom:1rem;display:flex}.progress-number{font-family:var(--font-mono);color:var(--color-telemetry);font-size:1.875rem;font-weight:700}.progress-total-label{color:var(--color-text-secondary);font-size:.875rem}.progress-concepts{flex-direction:column;gap:.5rem;display:flex}.progress-concept{background:var(--color-bg-dim);border:1px solid var(--color-border-subtle);border-radius:var(--radius-default);justify-content:space-between;align-items:center;gap:.75rem;padding:.375rem .625rem;font-size:.875rem;display:flex}.progress-concept-name{color:var(--color-text-secondary)}.progress-concept-count{font-family:var(--font-mono);color:var(--color-telemetry);font-size:.75rem}.progress-hint{color:var(--color-text-muted);margin:.25rem 0 .75rem;font-size:.75rem}.concept-list,.teaching-list,.answered-list{flex-direction:column;gap:.5rem;display:flex}.concept-title-row,.teaching-title-row{flex-wrap:wrap;align-items:center;gap:.75rem;display:flex}.concept-name,.teaching-name{color:var(--color-text-primary);font-size:.875rem;font-weight:500}.teaching-badge{margin-left:.5rem}.concept-desc,.teaching-explanation{color:var(--color-text-secondary);margin-top:.75rem;font-size:.875rem;line-height:1.625}.concept-decision{color:var(--color-text-secondary);background:var(--color-bg-dim);border-left:2px solid var(--color-warning);border-radius:var(--radius-sm);margin-top:.75rem;padding:.5rem .75rem;font-size:.8125rem;line-height:1.55}.concept-decision-label{letter-spacing:.06em;text-transform:uppercase;color:var(--color-warning);margin-bottom:.25rem;font-size:.6875rem;font-weight:600;display:block}.notes-box{background:var(--color-bg-dim);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);margin-top:.75rem;padding:.75rem}.notes-box .card-label{margin-bottom:.5rem}.notes-text{color:var(--color-text-secondary);font-size:.875rem;line-height:1.625}.concept-diagram{background:var(--color-bg-dim);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);margin-top:.75rem;margin-bottom:.75rem;padding:.75rem;overflow-x:auto}.concept-diagram .card-label{margin-bottom:.25rem}.concept-diagram-svg{justify-content:center;min-height:40px;display:flex}.concept-diagram-svg svg{max-width:100%;height:auto}.concept-diagram-svg marker path{fill:var(--color-accent);stroke:var(--color-accent)}.source-file{font-family:var(--font-mono);color:var(--color-text-muted);margin-top:.5rem;font-size:.75rem}.assessment-header-controls{align-items:center;gap:.5rem;display:flex}.assessment-header-row{justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:1rem;display:flex}.assessment-header-label{margin-bottom:0}.assessment-count-badge{white-space:nowrap;flex-shrink:0}.assessment-current-header{cursor:default}.assessment-current-header:hover{background:var(--color-bg-dim)}.assessment-queue-hint{color:var(--color-text-muted);margin:0;font-size:.75rem}.assessment-all-done{margin:0 0 1rem}.assessment-pending{flex-direction:column;gap:.75rem;margin-bottom:1.5rem;display:flex}.assessment-question-row{flex:1;justify-content:space-between;align-items:flex-start;gap:.75rem;min-width:0;display:flex}.assessment-context-toggle{border:1px solid var(--color-border-subtle);border-radius:var(--radius-default);color:var(--color-text-muted);font-family:var(--font-mono);cursor:pointer;background:0 0;flex-shrink:0;align-items:center;padding:.125rem .5rem;font-size:.6875rem;transition:color .15s,border-color .15s;display:inline-flex}.assessment-context-toggle:hover,.assessment-context-toggle[aria-expanded=true]{color:var(--color-text-secondary);border-color:var(--color-border-strong)}.assessment-context{margin-top:.75rem}.assessment-context .assessment-meta{margin-top:0}.assessment-context .assessment-source{margin-bottom:0}.assessment-submit{margin-top:.5rem}.assessment-body-content .textarea{background:0 0;border:none;border-bottom:1px solid #0000;border-radius:0;padding:.25rem 0}.assessment-pending .accordion-body{border-top-color:#0000}[data-theme=light] .assessment-pending .accordion-body{border-top-color:var(--color-border-subtle)}.assessment-body-content .textarea:focus{box-shadow:none;border-bottom-color:#0000;outline:none}[data-theme=light] .assessment-body-content .textarea:focus{border-bottom-color:var(--color-border-strong)}.assessment-feedback{color:var(--diff-add-text);background:var(--diff-add-bg);border-left:2px solid var(--color-success);border-radius:var(--radius-sm);margin:.5rem 0;padding:.5rem .75rem;font-size:.8125rem;line-height:1.5}.answered-item{background:var(--color-bg-dim);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);padding:.75rem 1rem}.answered-row{align-items:flex-start;gap:.75rem;display:flex}.answered-icon{color:var(--color-success);flex-shrink:0;margin-top:.125rem;display:inline-flex}.answered-icon .cl-icon-wrong{color:var(--color-danger)}.answered-content{flex:1}.answered-question{color:var(--color-text-primary);margin:0;font-size:.875rem}.answered-answer{font-family:var(--font-mono);color:var(--color-text-muted);margin:.25rem 0 0;font-size:.75rem}.chat-card{flex-direction:column;height:100%;display:flex}.chat-messages{flex-direction:column;flex:1;gap:.75rem;min-height:0;max-height:20rem;margin-bottom:1rem;display:flex;overflow-y:auto}.chat-empty{color:var(--color-text-muted);font-size:.875rem}.chat-msg{font-size:.875rem;line-height:1.625}.chat-msg--user{border-left:2px solid var(--color-accent);color:var(--color-text-primary);padding-left:.75rem}.chat-msg--user:before{content:"λ ";font-family:var(--font-mono);color:var(--color-accent)}.chat-msg--assistant{color:var(--color-text-secondary)}.chat-loading{font-size:.875rem;font-family:var(--font-mono);color:var(--color-telemetry);animation:1.5s ease-in-out infinite cl-pulse}.chat-input-row{align-items:stretch;gap:.5rem;display:flex}.chat-input{flex:1}.current-concept{width:100%;max-width:42rem;margin:0 auto}.current-concept .card-label{margin-bottom:1.5rem}.current-concept-title{color:var(--color-text-primary);margin:0 0 .5rem;font-size:1.5rem;font-weight:600}.current-concept-desc{color:var(--color-text-secondary);line-height:1.625}.current-concept-empty{color:var(--color-text-secondary);font-size:1.125rem}.diff-add{background:var(--diff-add-bg);color:var(--diff-add-text)}.diff-del{background:var(--diff-del-bg);color:var(--diff-del-text)}@media (width<=1199px){.cl-canvas--docked{margin-right:0}.cl-telemetry{display:none}.cl-telemetry.cl-drawer-open{z-index:60;box-shadow:var(--shadow-popover);display:flex}.cl-header-btn{display:flex}}@media (width>=1200px){.cl-header-btn{display:flex}}@media (width<=767px){.cl-navigator{display:none}.cl-canvas{margin-left:0;padding-bottom:56px}.cl-mobile-tabs{display:flex}.cl-main{padding:.875rem .875rem 1.5rem}.session-hero{flex-direction:column;align-items:flex-start}.dashboard-chat{height:22rem}.chat-messages{max-height:14rem}}@keyframes cl-breathe{0%,to{opacity:.4}50%{opacity:1}}@keyframes cl-pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-FOHPRMQF-DHwB1DNv.js";import{w as e}from"./mermaid-parser.core-DEadI1Ja.js";export{e as createInfoServices};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{m as e}from"./src-BH-TyZbA.js";import{c as t}from"./chunk-DU6HZSFF-CF3OK3MZ.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{St as r}from"./index-D3vj8REa.js";import{n as i}from"./mermaid-parser.core-DEadI1Ja.js";var a={parse:n(async t=>{let n=await i(`info`,t);e.debug(n)},`parse`)},o={version:`11.17.2`},s={parser:a,db:{getVersion:n(()=>o.version,`getVersion`)},renderer:{draw:n((n,i,a)=>{e.debug(`rendering info diagram
|
|
2
|
+
`+n);let o=r(i);t(o,100,400,!0),o.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${a}`)},`draw`)}};export{s as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}export{e as t};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import"./src-BH-TyZbA.js";import{H as e,K as t,U as n,a as r,c as i,s as a,v as o,w as s,x as c,y as l}from"./chunk-DU6HZSFF-CF3OK3MZ.js";import{n as u}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{p as d}from"./chunk-75Z2AOVW-EXNbuzun.js";import{t as f}from"./rough.esm-Dy-Kn_BL.js";import{St as p}from"./index-D3vj8REa.js";var m=(function(){var e=u(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,4],n=[1,14],r=[1,12],i=[1,13],a=[6,7,8],o=[1,20],s=[1,18],c=[1,19],l=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={trace:u(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`ISHIKAWA`,11:`EOF`,13:`SPACELIST`,14:`TEXT`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:u(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim())}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:i},e(a,[2,3]),{1:[2,2]},e(a,[2,4]),e(a,[2,5]),{1:[2,6],6:n,12:15,13:r,14:i},{6:n,9:16,12:11,13:r,14:i},{6:o,7:s,10:17,11:c},e(l,[2,18],{14:[1,21]}),e(l,[2,16]),e(l,[2,17]),{6:o,7:s,10:22,11:c},{1:[2,7],6:n,12:15,13:r,14:i},e(d,[2,14],{7:f,11:p}),e(m,[2,8]),e(m,[2,9]),e(m,[2,10]),e(l,[2,15]),e(d,[2,13],{7:f,11:p}),e(m,[2,11]),e(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:u(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:u(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,d=0,f=2,p=1,m=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}u(b,`popStack`);function x(){var e=r.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}u(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(c+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(l=h.yyleng,s=h.yytext,c=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,g.yy,T[1],i,a].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};h.lexer=(function(){return{EOF:1,parseError:u(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:u(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:u(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:u(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:u(function(){return this._more=!0,this},`more`),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:u(function(e){this.unput(this.match.slice(e))},`less`),pastInput:u(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:u(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:u(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:u(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:u(function(){return this.next()||this.lex()},`lex`),begin:u(function(e){this.conditionStack.push(e)},`begin`),popState:u(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:u(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:u(function(e){this.begin(e)},`pushState`),stateStackSize:u(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:u(function(e,t,n,r){switch(n){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}})();function g(){this.yy={}}return u(g,`Parser`),g.prototype=h,h.Parser=g,new g})();m.parser=m;var h=m,g=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{u(this,`IshikawaDB`)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,r()}getRoot(){return this.root}addNode(e,n){let r=a.sanitizeText(n,c());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],t(r);return}this.baseLevel??=e;let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();let o=this.stack[this.stack.length-1].node,s={text:r,children:[]};o.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return l()}setAccTitle(e){n(e)}getAccDescription(){return o()}setAccDescription(t){e(t)}getDiagramTitle(){return s()}setDiagramTitle(e){t(e)}},_=14,v=250,y=30,b=60,x=5,S=82*Math.PI/180,C=Math.cos(S),w=Math.sin(S),T=u((e,t,n)=>{let r=e.node().getBBox(),a=r.width+t*2,o=r.height+t*2;i(e,o,a,n),e.attr(`viewBox`,`${r.x-t} ${r.y-t} ${a} ${o}`)},`applyPaddedViewBox`),E=u((e,t,n,r)=>{let i=r.db.getRoot();if(!i)return;let a=c(),{look:o,handDrawnSeed:s,themeVariables:l}=a,u=d(a.fontSize)[0]??_,m=o===`handDrawn`,h=i.children??[],g=a.ishikawa?.diagramPadding??20,y=a.ishikawa?.useMaxWidth??!1,b=p(t),x=b.append(`g`).attr(`class`,`ishikawa`),S=m?f.svg(b.node()):void 0,C=S?{roughSvg:S,seed:s??0,lineColor:l?.lineColor??`#333`,fillColor:l?.mainBkg??`#fff`}:void 0,w=`ishikawa-arrow-${t}`;m||x.append(`defs`).append(`marker`).attr(`id`,w).attr(`viewBox`,`0 0 10 10`).attr(`refX`,0).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 Z`).attr(`class`,`ishikawa-arrow`);let E=0,k=v,A=m?void 0:L(x,E,k,E,k,`ishikawa-spine`);if(O(x,E,k,i.text,u,C),!h.length){m&&L(x,E,k,E,k,`ishikawa-spine`,C),T(b,g,y);return}E-=20;let j=h.filter((e,t)=>t%2==0),N=h.filter((e,t)=>t%2==1),P=D(j),F=D(N),I=P.total+F.total,R=v,z=v;if(I>0){let e=v*2,t=v*.3;R=Math.max(t,e*(P.total/I)),z=Math.max(t,e*(F.total/I))}let B=u*2;R=Math.max(R,P.max*B),z=Math.max(z,F.max*B),k=Math.max(R,v),A&&A.attr(`y1`,k).attr(`y2`,k),x.select(`.ishikawa-head-group`).attr(`transform`,`translate(0,${k})`);let V=Math.ceil(h.length/2);for(let e=0;e<V;e++){let t=x.append(`g`).attr(`class`,`ishikawa-pair`);for(let[n,r,i]of[[h[e*2],-1,R],[h[e*2+1],1,z]])n&&M(t,n,E,k,r,i,u,C);E=t.selectAll(`text`).nodes().reduce((e,t)=>Math.min(e,t.getBBox().x),1/0)}if(m)L(x,E,k,0,k,`ishikawa-spine`,C);else{A.attr(`x1`,E);let e=`url(#${w})`;x.selectAll(`line.ishikawa-branch, line.ishikawa-sub-branch`).attr(`marker-start`,e)}T(b,g,y)},`draw`),D=u(e=>{let t=u(e=>e.children.reduce((e,n)=>e+1+t(n),0),`countDescendants`);return e.reduce((e,n)=>{let r=t(n);return e.total+=r,e.max=Math.max(e.max,r),e},{total:0,max:0})},`sideStats`),O=u((e,t,n,r,i,a)=>{let o=Math.max(6,Math.floor(110/(i*.6))),s=e.append(`g`).attr(`class`,`ishikawa-head-group`).attr(`transform`,`translate(${t},${n})`),c=F(s,P(r,o),0,0,`ishikawa-head-label`,`start`,i),l=c.node().getBBox(),u=Math.max(60,l.width+6),d=Math.max(40,l.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${u*2.4} 0 0 ${-d/2} Z`;if(a){let e=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-head`)}else s.insert(`path`,`:first-child`).attr(`class`,`ishikawa-head`).attr(`d`,f);c.attr(`transform`,`translate(${(u-l.width)/2-l.x+3},${-l.y-l.height/2})`)},`drawHead`),k=u((e,t)=>{let n=[],r=[],i=u((e,a,o)=>{let s=t===-1?[...e].reverse():e;for(let e of s){let t=n.length,s=e.children??[];n.push({depth:o,text:P(e.text,15),parentIndex:a,childCount:s.length}),o%2==0?(r.push(t),s.length&&i(s,t,o+1)):(s.length&&i(s,t,o+1),r.push(t))}},`walk`);return i(e,-1,2),{entries:n,yOrder:r}},`flattenTree`),A=u((e,t,n,r,i,a,o)=>{let s=e.append(`g`).attr(`class`,`ishikawa-label-group`),c=F(s,t,n,r+11*i,`ishikawa-label cause`,`middle`,a).node().getBBox();if(o){let e=o.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-label-box`)}else s.insert(`rect`,`:first-child`).attr(`class`,`ishikawa-label-box`).attr(`x`,c.x-20).attr(`y`,c.y-2).attr(`width`,c.width+40).attr(`height`,c.height+4)},`drawCauseLabel`),j=u((e,t,n,r,i,a)=>{let o=Math.sqrt(r*r+i*i);if(o===0)return;let s=r/o,c=i/o,l=-c*6,u=s*6,d=t,f=n,p=`M ${d} ${f} L ${d-s*6*2+l} ${f-c*6*2+u} L ${d-s*6*2-l} ${f-c*6*2-u} Z`,m=a.roughSvg.path(p,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:`solid`,stroke:a.lineColor,strokeWidth:1});e.append(()=>m)},`drawArrowMarker`),M=u((e,t,n,r,i,a,o,s)=>{let c=t.children??[],l=a*(c.length?1:.2),u=-C*l,d=w*l*i,f=n+u,p=r+d;if(L(e,n,r,f,p,`ishikawa-branch`,s),s&&j(e,n,r,n-f,r-p,s),A(e,t.text,f,p,i,o,s),!c.length)return;let{entries:m,yOrder:h}=k(c,i),g=m.length,_=Array(g);for(let[e,t]of h.entries())_[t]=r+d*((e+1)/(g+1));let v=new Map;v.set(-1,{x0:n,y0:r,x1:f,y1:p,childCount:c.length,childrenDrawn:0});let S=-C,T=w*i,E=i<0?`ishikawa-label up`:`ishikawa-label down`;for(let[t,n]of m.entries()){let r=_[t],i=v.get(n.parentIndex),a=e.append(`g`).attr(`class`,`ishikawa-sub-group`),c=0,l=0,u=0;if(n.depth%2==0){let e=i.y1-i.y0;c=I(i.x0,i.x1,e?(r-i.y0)/e:.5),l=r,u=c-(n.childCount>0?b+n.childCount*x:y),L(a,c,r,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,r,1,0,s),F(a,n.text,u,r,`ishikawa-label align`,`end`,o)}else{let e=i.childrenDrawn++;c=I(i.x0,i.x1,(i.childCount-e)/(i.childCount+1)),l=i.y0,u=c+S*((r-l)/T),L(a,c,l,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,l,c-u,l-r,s),F(a,n.text,u,r,E,`end`,o)}n.childCount>0&&v.set(t,{x0:c,y0:l,x1:u,y1:r,childCount:n.childCount,childrenDrawn:0})}},`drawBranch`),N=u(e=>e.split(/<br\s*\/?>|\n/),`splitLines`),P=u((e,t)=>{if(e.length<=t)return e;let n=[];for(let r of e.split(/\s+/)){let e=n.length-1;e>=0&&n[e].length+1+r.length<=t?n[e]+=` `+r:n.push(r)}return n.join(`
|
|
7
|
+
`)},`wrapText`),F=u((e,t,n,r,i,a,o)=>{let s=N(t),c=o*1.05,l=e.append(`text`).attr(`class`,i).attr(`text-anchor`,a).attr(`x`,n).attr(`y`,r-(s.length-1)*c/2);for(let[e,t]of s.entries())l.append(`tspan`).attr(`x`,n).attr(`dy`,e===0?0:c).text(t);return l},`drawMultilineText`),I=u((e,t,n)=>e+(t-e)*n,`lerp`),L=u((e,t,n,r,i,a,o)=>{if(o){let s=o.roughSvg.line(t,n,r,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});e.append(()=>s).attr(`class`,a);return}return e.append(`line`).attr(`class`,a).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i)},`drawLine`),R={parser:h,get db(){return new g},renderer:{draw:E},styles:u(e=>`
|
|
8
|
+
.ishikawa .ishikawa-spine,
|
|
9
|
+
.ishikawa .ishikawa-branch,
|
|
10
|
+
.ishikawa .ishikawa-sub-branch {
|
|
11
|
+
stroke: ${e.lineColor};
|
|
12
|
+
stroke-width: 2;
|
|
13
|
+
fill: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ishikawa .ishikawa-sub-branch {
|
|
17
|
+
stroke-width: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ishikawa .ishikawa-arrow {
|
|
21
|
+
fill: ${e.lineColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ishikawa .ishikawa-head {
|
|
25
|
+
fill: ${e.mainBkg};
|
|
26
|
+
stroke: ${e.lineColor};
|
|
27
|
+
stroke-width: 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ishikawa .ishikawa-label-box {
|
|
31
|
+
fill: ${e.mainBkg};
|
|
32
|
+
stroke: ${e.lineColor};
|
|
33
|
+
stroke-width: 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ishikawa text {
|
|
37
|
+
font-family: ${e.fontFamily};
|
|
38
|
+
font-size: ${e.fontSize};
|
|
39
|
+
fill: ${e.textColor};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ishikawa .ishikawa-head-label {
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
text-anchor: middle;
|
|
45
|
+
dominant-baseline: middle;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ishikawa .ishikawa-label {
|
|
50
|
+
text-anchor: end;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ishikawa .ishikawa-label.cause {
|
|
54
|
+
text-anchor: middle;
|
|
55
|
+
dominant-baseline: middle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ishikawa .ishikawa-label.align {
|
|
59
|
+
text-anchor: end;
|
|
60
|
+
dominant-baseline: middle;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ishikawa .ishikawa-label.up {
|
|
64
|
+
dominant-baseline: baseline;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ishikawa .ishikawa-label.down {
|
|
68
|
+
dominant-baseline: hanging;
|
|
69
|
+
}
|
|
70
|
+
`,`getStyles`)};export{R as diagram};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import{p as e}from"./src-BH-TyZbA.js";import{H as t,K as n,U as r,a as i,c as a,v as o,w as s,x as c,y as l}from"./chunk-DU6HZSFF-CF3OK3MZ.js";import{n as u}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as d}from"./arc-BEvzHx4o.js";import{t as f}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{a as p,n as m,o as h,s as g}from"./chunk-F27PBJKO-G71ylWJa.js";var _=(function(){var e=u(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,8,10,11,12,14,16,17,18],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,14],c={trace:u(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:u(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:15,11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,5]),e(t,[2,6]),e(t,[2,8]),{13:[1,16]},{15:[1,17]},e(t,[2,11]),e(t,[2,12]),{19:[1,18]},e(t,[2,4]),e(t,[2,9]),e(t,[2,10]),e(t,[2,13])],defaultActions:{},parseError:u(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:u(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,d=0,f=2,p=1,m=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}u(b,`popStack`);function x(){var e=r.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}u(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(c+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(l=h.yyleng,s=h.yytext,c=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,g.yy,T[1],i,a].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};c.lexer=(function(){return{EOF:1,parseError:u(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:u(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:u(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:u(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:u(function(){return this._more=!0,this},`more`),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:u(function(e){this.unput(this.match.slice(e))},`less`),pastInput:u(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:u(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:u(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:u(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:u(function(){return this.next()||this.lex()},`lex`),begin:u(function(e){this.conditionStack.push(e)},`begin`),popState:u(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:u(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:u(function(e){this.begin(e)},`pushState`),stateStackSize:u(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:u(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin(`acc_title`),12;case 8:return this.popState(),`acc_title_value`;case 9:return this.begin(`acc_descr`),14;case 10:return this.popState(),`acc_descr_value`;case 11:this.begin(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 17;case 15:return 18;case 16:return 19;case 17:return`:`;case 18:return 6;case 19:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}})();function l(){this.yy={}}return u(l,`Parser`),l.prototype=c,c.Parser=l,new l})();_.parser=_;var v=_,y=``,b=[],x=[],S=[],C=u(function(){b.length=0,x.length=0,y=``,S.length=0,i()},`clear`),w=u(function(e){y=e,b.push(e)},`addSection`),T=u(function(){return b},`getSections`),E=u(function(){let e=A(),t=0;for(;!e&&t<100;)e=A(),t++;return x.push(...S),x},`getTasks`),D=u(function(){let e=[];return x.forEach(t=>{t.people&&e.push(...t.people)}),[...new Set(e)].sort()},`updateActors`),O=u(function(e,t){let n=t.substr(1).split(`:`),r=0,i=[];n.length===1?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(`,`));let a=i.map(e=>e.trim()),o={section:y,type:y,people:a,task:e,score:r};S.push(o)},`addTask`),k=u(function(e){let t={section:y,type:y,description:e,task:e,classes:[]};x.push(t)},`addTaskOrg`),A=u(function(){let e=u(function(e){return S[e].processed},`compileTask`),t=!0;for(let[n,r]of S.entries())e(n),t&&=r.processed;return t},`compileTasks`),j={getConfig:u(()=>c().journey,`getConfig`),clear:C,setDiagramTitle:n,getDiagramTitle:s,setAccTitle:r,getAccTitle:l,setAccDescription:t,getAccDescription:o,addSection:w,getSections:T,getTasks:E,addTask:O,addTaskOrg:k,getActors:u(function(){return D()},`getActors`)},M=u(e=>`.label {
|
|
7
|
+
font-family: ${e.fontFamily};
|
|
8
|
+
color: ${e.textColor};
|
|
9
|
+
}
|
|
10
|
+
.mouth {
|
|
11
|
+
stroke: #666;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
line {
|
|
15
|
+
stroke: ${e.textColor}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.legend {
|
|
19
|
+
fill: ${e.textColor};
|
|
20
|
+
font-family: ${e.fontFamily};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label text {
|
|
24
|
+
fill: #333;
|
|
25
|
+
}
|
|
26
|
+
.label {
|
|
27
|
+
color: ${e.textColor}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.face {
|
|
31
|
+
${e.faceColor?`fill: ${e.faceColor}`:`fill: #FFF8DC`};
|
|
32
|
+
stroke: #999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.node rect,
|
|
36
|
+
.node circle,
|
|
37
|
+
.node ellipse,
|
|
38
|
+
.node polygon,
|
|
39
|
+
.node path {
|
|
40
|
+
fill: ${e.mainBkg};
|
|
41
|
+
stroke: ${e.nodeBorder};
|
|
42
|
+
stroke-width: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.node .label {
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
.node.clickable {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.arrowheadPath {
|
|
53
|
+
fill: ${e.arrowheadColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edgePaths .path {
|
|
57
|
+
stroke: ${e.lineColor};
|
|
58
|
+
stroke-width: 1.5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.flowchart-link {
|
|
62
|
+
stroke: ${e.lineColor};
|
|
63
|
+
fill: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.edgeLabel {
|
|
67
|
+
background-color: ${e.edgeLabelBackground};
|
|
68
|
+
rect {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cluster rect {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cluster text {
|
|
78
|
+
fill: ${e.titleColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.mermaidTooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
text-align: center;
|
|
84
|
+
max-width: 200px;
|
|
85
|
+
padding: 2px;
|
|
86
|
+
font-family: ${e.fontFamily};
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
background: ${e.tertiaryColor};
|
|
89
|
+
border: 1px solid ${e.border2};
|
|
90
|
+
border-radius: 2px;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
z-index: 100;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.task-type-0, .section-type-0 {
|
|
96
|
+
${e.fillType0?`fill: ${e.fillType0}`:``};
|
|
97
|
+
}
|
|
98
|
+
.task-type-1, .section-type-1 {
|
|
99
|
+
${e.fillType0?`fill: ${e.fillType1}`:``};
|
|
100
|
+
}
|
|
101
|
+
.task-type-2, .section-type-2 {
|
|
102
|
+
${e.fillType0?`fill: ${e.fillType2}`:``};
|
|
103
|
+
}
|
|
104
|
+
.task-type-3, .section-type-3 {
|
|
105
|
+
${e.fillType0?`fill: ${e.fillType3}`:``};
|
|
106
|
+
}
|
|
107
|
+
.task-type-4, .section-type-4 {
|
|
108
|
+
${e.fillType0?`fill: ${e.fillType4}`:``};
|
|
109
|
+
}
|
|
110
|
+
.task-type-5, .section-type-5 {
|
|
111
|
+
${e.fillType0?`fill: ${e.fillType5}`:``};
|
|
112
|
+
}
|
|
113
|
+
.task-type-6, .section-type-6 {
|
|
114
|
+
${e.fillType0?`fill: ${e.fillType6}`:``};
|
|
115
|
+
}
|
|
116
|
+
.task-type-7, .section-type-7 {
|
|
117
|
+
${e.fillType0?`fill: ${e.fillType7}`:``};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.actor-0 {
|
|
121
|
+
${e.actor0?`fill: ${e.actor0}`:``};
|
|
122
|
+
}
|
|
123
|
+
.actor-1 {
|
|
124
|
+
${e.actor1?`fill: ${e.actor1}`:``};
|
|
125
|
+
}
|
|
126
|
+
.actor-2 {
|
|
127
|
+
${e.actor2?`fill: ${e.actor2}`:``};
|
|
128
|
+
}
|
|
129
|
+
.actor-3 {
|
|
130
|
+
${e.actor3?`fill: ${e.actor3}`:``};
|
|
131
|
+
}
|
|
132
|
+
.actor-4 {
|
|
133
|
+
${e.actor4?`fill: ${e.actor4}`:``};
|
|
134
|
+
}
|
|
135
|
+
.actor-5 {
|
|
136
|
+
${e.actor5?`fill: ${e.actor5}`:``};
|
|
137
|
+
}
|
|
138
|
+
${f()}
|
|
139
|
+
`,`getStyles`),N=u(function(e,t){return p(e,t)},`drawRect`),P=u(function(e,t){let n=e.append(`circle`).attr(`cx`,t.cx).attr(`cy`,t.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),r=e.append(`g`);r.append(`circle`).attr(`cx`,t.cx-5).attr(`cy`,t.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),r.append(`circle`).attr(`cx`,t.cx+5).attr(`cy`,t.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function i(e){let n=d().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,n).attr(`transform`,`translate(`+t.cx+`,`+(t.cy+2)+`)`)}u(i,`smile`);function a(e){let n=d().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,n).attr(`transform`,`translate(`+t.cx+`,`+(t.cy+7)+`)`)}u(a,`sad`);function o(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,t.cx-5).attr(`y1`,t.cy+7).attr(`x2`,t.cx+5).attr(`y2`,t.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return u(o,`ambivalent`),t.score>3?i(r):t.score<3?a(r):o(r),n},`drawFace`),F=u(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),I=u(function(e,t){return h(e,t)},`drawText`),L=u(function(e,t){function n(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}u(n,`genPoints`);let r=e.append(`polygon`);r.attr(`points`,n(t.x,t.y,50,20,7)),r.attr(`class`,`labelBox`),t.y+=t.labelMargin,t.x+=.5*t.labelMargin,I(e,t)},`drawLabel`),R=u(function(e,t,n){let r=e.append(`g`),i=g();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,N(r,i),H(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),z=-1,B=u(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);z++,a.append(`line`).attr(`id`,r+`-task`+z).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),P(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=g();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,N(a,o);let s=t.x+14;t.people.forEach(e=>{let n=t.actors[e].color,r={cx:s,cy:t.y,r:7,fill:n,stroke:`#000`,title:e,pos:t.actors[e].position};F(a,r),s+=10}),H(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),V=u(function(e,t){m(e,t)},`drawBackgroundRect`),H=(function(){function e(e,t,n,i,a,o,s,c){r(t.append(`text`).attr(`x`,n+a/2).attr(`y`,i+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}u(e,`byText`);function t(e,t,n,i,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,i).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,i+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),r(p,s)}}u(t,`byTspan`);function n(e,n,i,a,o,s,c,l){let u=n.append(`switch`),d=u.append(`foreignObject`).attr(`x`,i).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,u,i,a,o,s,c,l),r(d,c)}u(n,`byFo`);function r(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return u(r,`_setTextAttrs`),function(r){return r.textPlacement===`fo`?n:r.textPlacement===`old`?e:t}})(),U={drawRect:N,drawCircle:F,drawSection:R,drawText:I,drawLabel:L,drawTask:B,drawBackgroundRect:V,initGraphics:u(function(e,t){z=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`)},W=u(function(e){Object.keys(e).forEach(function(t){J[t]=e[t]})},`setConf`),G={},K=0;function q(e){let t=c().journey,n=t.maxLabelWidth;K=0;let r=60;Object.keys(G).forEach(i=>{let a=G[i].color,o={cx:20,cy:r,r:7,fill:a,stroke:`#000`,pos:G[i].position};U.drawCircle(e,o);let s=e.append(`text`).attr(`visibility`,`hidden`).text(i),c=s.node().getBoundingClientRect().width;s.remove();let l=[];if(c<=n)l=[i];else{let t=i.split(` `),r=``;s=e.append(`text`).attr(`visibility`,`hidden`),t.forEach(e=>{let t=r?`${r} ${e}`:e;if(s.text(t),s.node().getBoundingClientRect().width>n){if(r&&l.push(r),r=e,s.text(e),s.node().getBoundingClientRect().width>n){let t=``;for(let r of e)t+=r,s.text(t+`-`),s.node().getBoundingClientRect().width>n&&(l.push(t.slice(0,-1)+`-`),t=r);r=t}}else r=t}),r&&l.push(r),s.remove()}l.forEach((n,i)=>{let a={x:40,y:r+7+i*20,fill:`#666`,text:n,textMargin:t.boxTextMargin??5},o=U.drawText(e,a).node().getBoundingClientRect().width;o>K&&o>t.leftMargin-o&&(K=o)}),r+=Math.max(20,l.length*20)})}u(q,`drawActorLegend`);var J=c().journey,Y=0,ee=u(function(t,n,r,i){let o=c(),s=o.journey.titleColor,l=o.journey.titleFontSize,u=o.journey.titleFontFamily,d=o.securityLevel,f;d===`sandbox`&&(f=e(`#i`+n));let p=e(d===`sandbox`?f.nodes()[0].contentDocument.body:`body`);X.init();let m=p.select(`#`+n);U.initGraphics(m,n);let h=i.db.getTasks(),g=i.db.getDiagramTitle(),_=i.db.getActors();for(let e in G)delete G[e];let v=0;_.forEach(e=>{G[e]={color:J.actorColours[v%J.actorColours.length],position:v},v++}),q(m),Y=J.leftMargin+K,X.insert(0,0,Y,Object.keys(G).length*50),te(m,h,0,n);let y=X.getBounds();g&&m.append(`text`).text(g).attr(`x`,Y).attr(`font-size`,l).attr(`font-weight`,`bold`).attr(`y`,25).attr(`fill`,s).attr(`font-family`,u);let b=y.stopy-y.starty+2*J.diagramMarginY,x=Y+y.stopx+2*J.diagramMarginX;a(m,b,x,J.useMaxWidth),m.append(`line`).attr(`x1`,Y).attr(`y1`,J.height*4).attr(`x2`,x-Y-4).attr(`y2`,J.height*4).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#`+n+`-arrowhead)`);let S=g?70:0;m.attr(`viewBox`,`${y.startx} -25 ${x} ${b+S}`),m.attr(`preserveAspectRatio`,`xMinYMin meet`),m.attr(`height`,b+S+25)},`draw`),X={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:u(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},`init`),updateVal:u(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:u(function(e,t,n,r){let i=c().journey,a=this,o=0;function s(s){return u(function(c){o++;let l=a.sequenceItems.length-o+1;a.updateVal(c,`starty`,t-l*i.boxMargin,Math.min),a.updateVal(c,`stopy`,r+l*i.boxMargin,Math.max),a.updateVal(X.data,`startx`,e-l*i.boxMargin,Math.min),a.updateVal(X.data,`stopx`,n+l*i.boxMargin,Math.max),s!==`activation`&&(a.updateVal(c,`startx`,e-l*i.boxMargin,Math.min),a.updateVal(c,`stopx`,n+l*i.boxMargin,Math.max),a.updateVal(X.data,`starty`,t-l*i.boxMargin,Math.min),a.updateVal(X.data,`stopy`,r+l*i.boxMargin,Math.max))},`updateItemBounds`)}u(s,`updateFn`),this.sequenceItems.forEach(s())},`updateBounds`),insert:u(function(e,t,n,r){let i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(X.data,`startx`,i,Math.min),this.updateVal(X.data,`starty`,o,Math.min),this.updateVal(X.data,`stopx`,a,Math.max),this.updateVal(X.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),bumpVerticalPos:u(function(e){this.verticalPos+=e,this.data.stopy=this.verticalPos},`bumpVerticalPos`),getVerticalPos:u(function(){return this.verticalPos},`getVerticalPos`),getBounds:u(function(){return this.data},`getBounds`)},Z=J.sectionFills,Q=J.sectionColours,te=u(function(e,t,n,r){let i=c().journey,a=``,o=n+(i.height*2+i.diagramMarginY),s=0,l=`#CCC`,u=`black`,d=0;for(let[n,c]of t.entries()){if(a!==c.section){l=Z[s%Z.length],d=s%Z.length,u=Q[s%Q.length];let r=0,o=c.section;for(let e=n;e<t.length&&t[e].section==o;e++)r+=1;let f={x:n*i.taskMargin+n*i.width+Y,y:50,text:c.section,fill:l,num:d,colour:u,taskCount:r};U.drawSection(e,f,i),a=c.section,s++}let f=c.people.reduce((e,t)=>(G[t]&&(e[t]=G[t]),e),{});c.x=n*i.taskMargin+n*i.width+Y,c.y=o,c.width=i.diagramMarginX,c.height=i.diagramMarginY,c.colour=u,c.fill=l,c.num=d,c.actors=f,U.drawTask(e,c,i,r),X.insert(c.x,c.y,c.x+c.width+i.taskMargin,450)}},`drawTasks`),$={setConf:W,draw:ee},ne={parser:v,db:j,renderer:$,styles:M,init:u(e=>{$.setConf(e.journey),j.clear()},`init`)};export{ne as diagram};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{m as e}from"./src-BH-TyZbA.js";import{J as t,et as n,f as r,rt as i,tt as a,x as o,z as s}from"./chunk-DU6HZSFF-CF3OK3MZ.js";import{n as c}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./chunk-75Z2AOVW-EXNbuzun.js";import"./chunk-P2QGCYS3-E4AByfsD.js";import"./chunk-PWAF6VOD-DaoPxZAa.js";import"./chunk-GMAD6QVW-2yfGg28o.js";import"./chunk-4HAMMTFA-EgoP78tp.js";import{i as l,r as u}from"./chunk-GVQU2GXP-C_VeaX4U.js";import{St as d,i as f,r as p,xt as m}from"./index-D3vj8REa.js";import{t as h}from"./chunk-5VM5RSS4-ZNzvKenW.js";var g=(function(){var e=c(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:c(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:n,9:22,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:u,7:d,10:23,11:f},e(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:s}),e(p,[2,19]),e(p,[2,21],{15:30,24:m}),e(p,[2,22]),e(p,[2,23]),e(h,[2,25]),e(h,[2,26]),e(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(g,[2,14],{7:_,11:v}),e(y,[2,8]),e(y,[2,9]),e(y,[2,10]),e(p,[2,16],{15:37,24:m}),e(p,[2,17]),e(p,[2,18]),e(p,[2,20],{24:b}),e(h,[2,31]),{21:[1,39]},{22:[1,40]},e(g,[2,13],{7:_,11:v}),e(y,[2,11]),e(y,[2,12]),e(p,[2,15],{24:b}),e(h,[2,30]),{22:[1,41]},e(h,[2,27]),e(h,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:c(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,p=1,m=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}c(b,`popStack`);function x(){var e=r.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}c(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,s=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,u,l,g.yy,T[1],i,a].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};x.lexer=(function(){return{EOF:1,parseError:c(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:c(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:c(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:c(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:c(function(){return this._more=!0,this},`more`),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:c(function(e){this.unput(this.match.slice(e))},`less`),pastInput:c(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:c(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:c(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:c(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:c(function(){return this.next()||this.lex()},`lex`),begin:c(function(e){this.conditionStack.push(e)},`begin`),popState:c(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:c(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:c(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:c(function(e){this.begin(e)},`pushState`),stateStackSize:c(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:c(function(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`<br/>`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function S(){this.yy={}}return c(S,`Parser`),S.prototype=x,x.Parser=S,new S})();g.parser=g;var _=g,v=[],y=[],b=0,x={},S=c(()=>{v=[],y=[],b=0,x={}},`clear`),C=c(e=>{if(v.length===0)return null;let t=v[0].level,n=null;for(let e=v.length-1;e>=0;e--)if(v[e].level===t&&!n&&(n=v[e]),v[e].level<t)throw Error(`Items without section detected, found section ("`+v[e].label+`")`);return e===n?.level?null:n},`getSection`),w=c(function(){return y},`getSections`),T=c(function(){let e=[],t=[],n=w(),r=o();for(let e of n){let n={id:e.id,label:s(e.label??``,r),labelType:`markdown`,isGroup:!0,ticket:e.ticket,shape:`kanbanSection`,level:e.level,look:r.look};t.push(n);let i=v.filter(t=>t.parentId===e.id);for(let n of i){let i={id:n.id,parentId:e.id,label:s(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(i)}}return{nodes:t,edges:e,other:{},config:o()}},`getData`),E=c((e,t,n,i,a)=>{let c=o(),l=c.mindmap?.padding??r.mindmap.padding;switch(i){case D.ROUNDED_RECT:case D.RECT:case D.HEXAGON:l*=2}let u={id:s(t,c)||`kbn`+b++,level:e,label:s(n,c),width:c.mindmap?.maxNodeWidth??r.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(a!==void 0){let e;e=a.includes(`
|
|
7
|
+
`)?a+`
|
|
8
|
+
`:`{
|
|
9
|
+
`+a+`
|
|
10
|
+
}`;let t=f(e,{schema:p});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes(`_`)))throw Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&t.shape===`kanbanItem`&&(u.shape=t?.shape),t?.label&&(u.label=t?.label),t?.icon&&(u.icon=t?.icon.toString()),t?.assigned&&(u.assigned=t?.assigned.toString()),t?.ticket&&(u.ticket=t?.ticket.toString()),t?.priority&&(u.priority=t?.priority)}let d=C(e);d?u.parentId=d.id||`kbn`+b++:y.push(u),v.push(u)},`addNode`),D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:E,getSections:w,getData:T,nodeType:D,getType:c((t,n)=>{switch(e.debug(`In get type`,t,n),t){case`[`:return D.RECT;case`(`:return n===`)`?D.ROUNDED_RECT:D.CLOUD;case`((`:return D.CIRCLE;case`)`:return D.CLOUD;case`))`:return D.BANG;case`{{`:return D.HEXAGON;default:return D.DEFAULT}},`getType`),setElementForId:c((e,t)=>{x[e]=t},`setElementForId`),decorateNode:c(e=>{if(!e)return;let t=o(),n=v[v.length-1];e.icon&&(n.icon=s(e.icon,t)),e.class&&(n.cssClasses=s(e.class,t))},`decorateNode`),type2Str:c(e=>{switch(e){case D.DEFAULT:return`no-border`;case D.RECT:return`rect`;case D.ROUNDED_RECT:return`rounded-rect`;case D.CIRCLE:return`circle`;case D.CLOUD:return`cloud`;case D.BANG:return`bang`;case D.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:c(()=>e,`getLogger`),getElementById:c(e=>x[e],`getElementById`)},k={draw:c(async(n,i,a,s)=>{e.debug(`Rendering kanban diagram
|
|
11
|
+
`+n);let c=s.db.getData(),f=o();f.htmlLabels=!1;let p=d(i);for(let e of c.nodes)e.domId=`${i}-${e.id}`;let h=p.append(`g`);h.attr(`class`,`sections`);let g=p.append(`g`);g.attr(`class`,`items`);let _=c.nodes.filter(e=>e.isGroup),v=0,y=[],b=25;for(let e of _){let t=f?.kanban?.sectionWidth||200;v+=1,e.x=t*v+(v-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+v;let n=await m(h,e);b=Math.max(b,n?.labelBBox?.height),y.push(n)}let x=0;for(let e of _){let t=y[x];x+=1;let n=f?.kanban?.sectionWidth||200,r=-n*3/2+b,i=r,a=c.nodes.filter(t=>t.parentId===e.id);for(let t of a){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-15;let r=(await u(g,t,{config:f})).node().getBBox();t.y=i+r.height/2,await l(t),i=t.y+r.height/2+5}let o=t.cluster.select(`rect`),s=Math.max(i-r+30,50)+(b-25);o.attr(`height`,s)}t(void 0,p,f.mindmap?.padding??r.kanban.padding,f.mindmap?.useMaxWidth??r.kanban.useMaxWidth)},`draw`)},A=c(e=>{let t=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e[`lineColor`+t]=e[`lineColor`+t]||e[`cScaleInv`+t],i(e[`lineColor`+t])?e[`lineColor`+t]=a(e[`lineColor`+t],20):e[`lineColor`+t]=n(e[`lineColor`+t],20);let r=c((t,r)=>e.darkMode?n(t,r):a(t,r),`adjuster`);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){let i=``+(17-3*n);t+=`
|
|
12
|
+
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
|
|
13
|
+
fill: ${r(e[`cScale`+n],10)};
|
|
14
|
+
stroke: ${r(e[`cScale`+n],10)};
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
.section-${n-1} text {
|
|
18
|
+
fill: ${e[`cScaleLabel`+n]};
|
|
19
|
+
}
|
|
20
|
+
.node-icon-${n-1} {
|
|
21
|
+
font-size: 40px;
|
|
22
|
+
color: ${e[`cScaleLabel`+n]};
|
|
23
|
+
}
|
|
24
|
+
.section-edge-${n-1}{
|
|
25
|
+
stroke: ${e[`cScale`+n]};
|
|
26
|
+
}
|
|
27
|
+
.edge-depth-${n-1}{
|
|
28
|
+
stroke-width: ${i};
|
|
29
|
+
}
|
|
30
|
+
.section-${n-1} line {
|
|
31
|
+
stroke: ${e[`cScaleInv`+n]} ;
|
|
32
|
+
stroke-width: 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.disabled, .disabled circle, .disabled text {
|
|
36
|
+
fill: lightgray;
|
|
37
|
+
}
|
|
38
|
+
.disabled text {
|
|
39
|
+
fill: #efefef;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.node rect,
|
|
43
|
+
.node circle,
|
|
44
|
+
.node ellipse,
|
|
45
|
+
.node polygon,
|
|
46
|
+
.node path {
|
|
47
|
+
fill: ${e.background};
|
|
48
|
+
stroke: ${e.nodeBorder};
|
|
49
|
+
stroke-width: 1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.kanban-ticket-link {
|
|
53
|
+
fill: ${e.background};
|
|
54
|
+
stroke: ${e.nodeBorder};
|
|
55
|
+
text-decoration: underline;
|
|
56
|
+
}
|
|
57
|
+
`}return t},`genSections`),j={db:O,renderer:k,parser:_,styles:c(e=>`
|
|
58
|
+
.edge {
|
|
59
|
+
stroke-width: 3;
|
|
60
|
+
}
|
|
61
|
+
${A(e)}
|
|
62
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
63
|
+
fill: ${e.git0};
|
|
64
|
+
}
|
|
65
|
+
.section-root text {
|
|
66
|
+
fill: ${e.gitBranchLabel0};
|
|
67
|
+
}
|
|
68
|
+
.icon-container {
|
|
69
|
+
height:100%;
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
}
|
|
74
|
+
.edge {
|
|
75
|
+
fill: none;
|
|
76
|
+
}
|
|
77
|
+
.cluster-label, .label {
|
|
78
|
+
color: ${e.textColor};
|
|
79
|
+
fill: ${e.textColor};
|
|
80
|
+
}
|
|
81
|
+
.kanban-label {
|
|
82
|
+
dy: 1em;
|
|
83
|
+
alignment-baseline: middle;
|
|
84
|
+
text-anchor: middle;
|
|
85
|
+
dominant-baseline: middle;
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
${h()}
|
|
89
|
+
`,`getStyles`)};export{j as diagram};
|